pubuilder 0.5.0 → 0.7.0

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/index.js CHANGED
@@ -1,31 +1,31 @@
1
1
  "use client";
2
- import { jsxs as d, jsx as n, Fragment as ee } from "react/jsx-runtime";
3
- import { createContext as ae, memo as ce, useRef as D, useState as _, useEffect as R, useMemo as V, useContext as te, useLayoutEffect as ie } from "react";
4
- import { createPortal as se } from "react-dom";
5
- import { normalizeIA as de } from "./config.js";
6
- import { defineIA as Xe } from "./config.js";
7
- import { create as ue } from "zustand";
8
- import { Handle as J, Position as j, ReactFlow as pe } from "@xyflow/react";
9
- const be = "http://localhost:4816";
10
- class oe extends Error {
11
- constructor(t, r) {
12
- super(t), this.code = r, this.name = "ApiError";
2
+ import { jsxs as s, jsx as o, Fragment as ee } from "react/jsx-runtime";
3
+ import { createContext as de, memo as pe, useRef as $, useState as N, useEffect as L, useContext as H, useMemo as J, useLayoutEffect as ue } from "react";
4
+ import { createPortal as be } from "react-dom";
5
+ import { normalizeIA as fe } from "./config.js";
6
+ import { defineIA as ro } from "./config.js";
7
+ import { create as he } from "zustand";
8
+ import { Handle as W, Position as B, ReactFlow as ge, Controls as xe } from "@xyflow/react";
9
+ const me = "http://localhost:4816";
10
+ class F extends Error {
11
+ constructor(e, r) {
12
+ super(e), this.code = r, this.name = "ApiError";
13
13
  }
14
14
  }
15
- class re {
16
- constructor(t = be) {
17
- this.baseUrl = t;
15
+ class oe {
16
+ constructor(e = me) {
17
+ this.baseUrl = e;
18
18
  }
19
- async request(t, r) {
20
- const o = await fetch(`${this.baseUrl}${t}`, {
19
+ async request(e, r) {
20
+ const n = await fetch(`${this.baseUrl}${e}`, {
21
21
  ...r,
22
22
  headers: { "content-type": "application/json", ...r?.headers }
23
23
  });
24
- if (!o.ok) {
25
- const l = await o.json().catch(() => ({}));
26
- throw new oe(l.message ?? `요청 실패 (${o.status})`, l.code);
24
+ if (!n.ok) {
25
+ const l = await n.json().catch(() => ({}));
26
+ throw new F(l.message ?? `요청 실패 (${n.status})`, l.code);
27
27
  }
28
- return o.status === 204 ? void 0 : await o.json();
28
+ return n.status === 204 ? void 0 : await n.json();
29
29
  }
30
30
  async isAlive() {
31
31
  try {
@@ -37,47 +37,71 @@ class re {
37
37
  listSkills() {
38
38
  return this.request("/api/skills");
39
39
  }
40
- toggleSkill(t, r) {
41
- return this.request(`/api/skills/${encodeURIComponent(t)}`, { method: "PATCH", body: JSON.stringify({ enabled: r }) });
40
+ toggleSkill(e, r) {
41
+ return this.request(`/api/skills/${encodeURIComponent(e)}`, { method: "PATCH", body: JSON.stringify({ enabled: r }) });
42
42
  }
43
- uploadSkill(t, r) {
44
- return this.request("/api/skills", { method: "POST", body: JSON.stringify({ filename: t, content: r }) });
43
+ uploadSkill(e, r) {
44
+ return this.request("/api/skills", { method: "POST", body: JSON.stringify({ filename: e, content: r }) });
45
45
  }
46
- removeSkill(t) {
47
- return this.request(`/api/skills/${encodeURIComponent(t)}`, { method: "DELETE" });
46
+ removeSkill(e) {
47
+ return this.request(`/api/skills/${encodeURIComponent(e)}`, { method: "DELETE" });
48
48
  }
49
49
  tokenStatus() {
50
50
  return this.request("/api/settings/figma-token");
51
51
  }
52
- saveToken(t) {
53
- return this.request("/api/settings/figma-token", { method: "PUT", body: JSON.stringify({ token: t }) });
52
+ saveToken(e) {
53
+ return this.request("/api/settings/figma-token", { method: "PUT", body: JSON.stringify({ token: e }) });
54
54
  }
55
55
  deleteToken() {
56
56
  return this.request("/api/settings/figma-token", { method: "DELETE" });
57
57
  }
58
- startPublish(t) {
59
- return this.request("/api/publish", { method: "POST", body: JSON.stringify(t) });
58
+ startPublish(e) {
59
+ return this.request("/api/publish", { method: "POST", body: JSON.stringify(e) });
60
60
  }
61
- cancelPublish(t) {
62
- return this.request(`/api/publish/${t}`, { method: "DELETE" });
61
+ cancelPublish(e) {
62
+ return this.request(`/api/publish/${e}`, { method: "DELETE" });
63
+ }
64
+ /** 진행 중 job 전체 kill + 파일 자동롤백/충돌 분류 */
65
+ suspendPublish() {
66
+ return this.request("/api/publish/suspend", { method: "POST", body: "{}" });
67
+ }
68
+ /** 충돌 파일 결정(revert/keep/edit) 적용 */
69
+ resolveSuspend(e) {
70
+ return this.request("/api/publish/suspend/resolve", { method: "POST", body: JSON.stringify({ resolutions: e }) });
63
71
  }
64
72
  /** SSE 구독 — 반환값 호출로 해제 */
65
- subscribePublish(t, r) {
66
- const o = new EventSource(`${this.baseUrl}/api/publish/${t}/events`);
73
+ subscribePublish(e, r) {
74
+ const n = new EventSource(`${this.baseUrl}/api/publish/${e}/events`);
67
75
  let l = !1;
68
- return o.onmessage = (a) => {
69
- const i = JSON.parse(a.data);
70
- (i.type === "done" || i.type === "error") && (l = !0), r(i);
71
- }, o.onerror = () => {
72
- o.close(), l || (l = !0, r({ type: "error", text: "서버 연결이 끊겼어요. pubuilder serve 상태를 확인해주세요" }));
73
- }, () => o.close();
76
+ return n.onmessage = (p) => {
77
+ const c = JSON.parse(p.data);
78
+ (c.type === "done" || c.type === "error") && (l = !0), r(c);
79
+ }, n.onerror = () => {
80
+ n.close(), l || (l = !0, r({ type: "error", text: "서버 연결이 끊겼어요. pubuilder serve 상태를 확인해주세요" }));
81
+ }, () => n.close();
74
82
  }
75
83
  }
76
- const Y = ae(new re());
77
- function fe() {
84
+ const j = de(new oe());
85
+ function ye() {
78
86
  return typeof process < "u" && process.env.NODE_ENV === "production";
79
87
  }
80
- const y = ue((e) => ({
88
+ const q = {
89
+ jobId: null,
90
+ status: "idle",
91
+ events: [],
92
+ errorMessage: null,
93
+ errorCode: null,
94
+ serverDown: !1,
95
+ checking: !1,
96
+ cancelling: !1,
97
+ figmaUrl: "",
98
+ reply: ""
99
+ };
100
+ function we(t) {
101
+ return `${t.pagePath}
102
+ ${t.selector}`;
103
+ }
104
+ const y = he((t) => ({
81
105
  isMapOpen: !1,
82
106
  viewerPath: null,
83
107
  granularity: "section",
@@ -85,15 +109,40 @@ const y = ue((e) => ({
85
109
  selection: null,
86
110
  selectedOuterHTML: null,
87
111
  skillDrawerOpen: !1,
88
- openMap: () => e({ isMapOpen: !0 }),
89
- closeMap: () => e({ isMapOpen: !1, viewerPath: null, selection: null, selectedOuterHTML: null }),
90
- openViewer: (t) => e({ viewerPath: t, selection: null, selectedOuterHTML: null }),
91
- closeViewer: () => e({ viewerPath: null, selection: null, selectedOuterHTML: null }),
92
- setGranularity: (t) => e({ granularity: t }),
93
- setInspectEnabled: (t) => e({ inspectEnabled: t }),
94
- setSelectionWithHTML: (t, r) => e({ selection: t, selectedOuterHTML: r }),
95
- toggleSkillDrawer: () => e((t) => ({ skillDrawerOpen: !t.skillDrawerOpen }))
96
- })), ge = ".react-flow{direction:ltr;--xy-edge-stroke-default: #b1b1b7;--xy-edge-stroke-width-default: 1;--xy-edge-stroke-selected-default: #555;--xy-connectionline-stroke-default: #b1b1b7;--xy-connectionline-stroke-width-default: 1;--xy-attribution-background-color-default: rgba(255, 255, 255, .5);--xy-minimap-background-color-default: #fff;--xy-minimap-mask-background-color-default: rgba(240, 240, 240, .6);--xy-minimap-mask-stroke-color-default: transparent;--xy-minimap-mask-stroke-width-default: 1;--xy-minimap-node-background-color-default: #e2e2e2;--xy-minimap-node-stroke-color-default: transparent;--xy-minimap-node-stroke-width-default: 2;--xy-background-color-default: transparent;--xy-background-pattern-dots-color-default: #91919a;--xy-background-pattern-lines-color-default: #eee;--xy-background-pattern-cross-color-default: #e2e2e2;background-color:var(--xy-background-color, var(--xy-background-color-default));--xy-node-color-default: inherit;--xy-node-border-default: 1px solid #1a192b;--xy-node-background-color-default: #fff;--xy-node-group-background-color-default: rgba(240, 240, 240, .25);--xy-node-boxshadow-hover-default: 0 1px 4px 1px rgba(0, 0, 0, .08);--xy-node-boxshadow-selected-default: 0 0 0 .5px #1a192b;--xy-node-border-radius-default: 3px;--xy-handle-background-color-default: #1a192b;--xy-handle-border-color-default: #fff;--xy-selection-background-color-default: rgba(0, 89, 220, .08);--xy-selection-border-default: 1px dotted rgba(0, 89, 220, .8);--xy-controls-button-background-color-default: #fefefe;--xy-controls-button-background-color-hover-default: #f4f4f4;--xy-controls-button-color-default: inherit;--xy-controls-button-color-hover-default: inherit;--xy-controls-button-border-color-default: #eee;--xy-controls-box-shadow-default: 0 0 2px 1px rgba(0, 0, 0, .08);--xy-edge-label-background-color-default: #ffffff;--xy-edge-label-color-default: inherit;--xy-resize-background-color-default: #3367d9}.react-flow.dark{--xy-edge-stroke-default: #3e3e3e;--xy-edge-stroke-width-default: 1;--xy-edge-stroke-selected-default: #727272;--xy-connectionline-stroke-default: #b1b1b7;--xy-connectionline-stroke-width-default: 1;--xy-attribution-background-color-default: rgba(150, 150, 150, .25);--xy-minimap-background-color-default: #141414;--xy-minimap-mask-background-color-default: rgba(60, 60, 60, .6);--xy-minimap-mask-stroke-color-default: transparent;--xy-minimap-mask-stroke-width-default: 1;--xy-minimap-node-background-color-default: #2b2b2b;--xy-minimap-node-stroke-color-default: transparent;--xy-minimap-node-stroke-width-default: 2;--xy-background-color-default: #141414;--xy-background-pattern-dots-color-default: #555;--xy-background-pattern-lines-color-default: #333;--xy-background-pattern-cross-color-default: #333;--xy-node-color-default: #f8f8f8;--xy-node-border-default: 1px solid #3c3c3c;--xy-node-background-color-default: #1e1e1e;--xy-node-group-background-color-default: rgba(240, 240, 240, .25);--xy-node-boxshadow-hover-default: 0 1px 4px 1px rgba(255, 255, 255, .08);--xy-node-boxshadow-selected-default: 0 0 0 .5px #999;--xy-handle-background-color-default: #bebebe;--xy-handle-border-color-default: #1e1e1e;--xy-selection-background-color-default: rgba(200, 200, 220, .08);--xy-selection-border-default: 1px dotted rgba(200, 200, 220, .8);--xy-controls-button-background-color-default: #2b2b2b;--xy-controls-button-background-color-hover-default: #3e3e3e;--xy-controls-button-color-default: #f8f8f8;--xy-controls-button-color-hover-default: #fff;--xy-controls-button-border-color-default: #5b5b5b;--xy-controls-box-shadow-default: 0 0 2px 1px rgba(0, 0, 0, .08);--xy-edge-label-background-color-default: #141414;--xy-edge-label-color-default: #f8f8f8}.react-flow__background{background-color:var(--xy-background-color-props, var(--xy-background-color, var(--xy-background-color-default)));pointer-events:none;z-index:-1}.react-flow__container{position:absolute;width:100%;height:100%;top:0;left:0}.react-flow__pane{z-index:1;touch-action:none}.react-flow__pane.draggable{cursor:grab}.react-flow__pane.dragging{cursor:grabbing}.react-flow__pane.selection{cursor:pointer}.react-flow__viewport{transform-origin:0 0;z-index:2;pointer-events:none}.react-flow__renderer{z-index:4}.react-flow__selection{z-index:6}.react-flow__nodesselection-rect:focus,.react-flow__nodesselection-rect:focus-visible{outline:none}.react-flow__edge-path{stroke:var(--xy-edge-stroke, var(--xy-edge-stroke-default));stroke-width:var(--xy-edge-stroke-width, var(--xy-edge-stroke-width-default));fill:none}.react-flow__connection-path{stroke:var(--xy-connectionline-stroke, var(--xy-connectionline-stroke-default));stroke-width:var(--xy-connectionline-stroke-width, var(--xy-connectionline-stroke-width-default));fill:none}.react-flow .react-flow__edges{position:absolute}.react-flow .react-flow__edges svg{overflow:visible;position:absolute;pointer-events:none}.react-flow__edge{pointer-events:visibleStroke}.react-flow__edge.selectable{cursor:pointer}.react-flow__edge.animated path{stroke-dasharray:5;animation:dashdraw .5s linear infinite}.react-flow__edge.animated path.react-flow__edge-interaction{stroke-dasharray:none;animation:none}.react-flow__edge.inactive{pointer-events:none}.react-flow__edge.selected,.react-flow__edge:focus,.react-flow__edge:focus-visible{outline:none}.react-flow__edge.selected .react-flow__edge-path,.react-flow__edge.selectable:focus .react-flow__edge-path,.react-flow__edge.selectable:focus-visible .react-flow__edge-path{stroke:var(--xy-edge-stroke-selected, var(--xy-edge-stroke-selected-default))}.react-flow__edge-textwrapper{pointer-events:all}.react-flow__edge .react-flow__edge-text{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__arrowhead polyline{stroke:var(--xy-edge-stroke, var(--xy-edge-stroke-default))}.react-flow__arrowhead polyline.arrowclosed{fill:var(--xy-edge-stroke, var(--xy-edge-stroke-default))}.react-flow__connection{pointer-events:none}.react-flow__connection .animated{stroke-dasharray:5;animation:dashdraw .5s linear infinite}svg.react-flow__connectionline{z-index:1001;overflow:visible;position:absolute}.react-flow__nodes{pointer-events:none;transform-origin:0 0}.react-flow__node{position:absolute;-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:all;transform-origin:0 0;box-sizing:border-box;cursor:default}.react-flow__node.selectable{cursor:pointer}.react-flow__node.draggable{cursor:grab;pointer-events:all}.react-flow__node.draggable.dragging{cursor:grabbing}.react-flow__nodesselection{z-index:3;transform-origin:left top;pointer-events:none}.react-flow__nodesselection-rect{position:absolute;pointer-events:all;cursor:grab}.react-flow__handle{position:absolute;pointer-events:none;min-width:5px;min-height:5px;width:6px;height:6px;background-color:var(--xy-handle-background-color, var(--xy-handle-background-color-default));border:1px solid var(--xy-handle-border-color, var(--xy-handle-border-color-default));border-radius:100%}.react-flow__handle.connectingfrom{pointer-events:all}.react-flow__handle.connectionindicator{pointer-events:all;cursor:crosshair}.react-flow__handle-bottom{top:auto;left:50%;bottom:0;transform:translate(-50%,50%)}.react-flow__handle-top{top:0;left:50%;transform:translate(-50%,-50%)}.react-flow__handle-left{top:50%;left:0;transform:translate(-50%,-50%)}.react-flow__handle-right{top:50%;right:0;transform:translate(50%,-50%)}.react-flow__edgeupdater{cursor:move;pointer-events:all}.react-flow__pane.selection .react-flow__panel{pointer-events:none}.react-flow__panel{position:absolute;z-index:5;margin:15px}.react-flow__panel.top{top:0}.react-flow__panel.bottom{bottom:0}.react-flow__panel.top.center,.react-flow__panel.bottom.center{left:50%;transform:translate(-15px) translate(-50%)}.react-flow__panel.left{left:0}.react-flow__panel.right{right:0}.react-flow__panel.left.center,.react-flow__panel.right.center{top:50%;transform:translateY(-15px) translateY(-50%)}.react-flow__attribution{font-size:10px;background:var(--xy-attribution-background-color, var(--xy-attribution-background-color-default));padding:2px 3px;margin:0}.react-flow__attribution a{text-decoration:none;color:#999}@keyframes dashdraw{0%{stroke-dashoffset:10}}.react-flow__edgelabel-renderer{position:absolute;width:100%;height:100%;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;left:0;top:0}.react-flow__viewport-portal{position:absolute;width:100%;height:100%;left:0;top:0;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__minimap{background:var( --xy-minimap-background-color-props, var(--xy-minimap-background-color, var(--xy-minimap-background-color-default)) )}.react-flow__minimap-svg{display:block}.react-flow__minimap-mask{fill:var( --xy-minimap-mask-background-color-props, var(--xy-minimap-mask-background-color, var(--xy-minimap-mask-background-color-default)) );stroke:var( --xy-minimap-mask-stroke-color-props, var(--xy-minimap-mask-stroke-color, var(--xy-minimap-mask-stroke-color-default)) );stroke-width:var( --xy-minimap-mask-stroke-width-props, var(--xy-minimap-mask-stroke-width, var(--xy-minimap-mask-stroke-width-default)) )}.react-flow__minimap-node{fill:var( --xy-minimap-node-background-color-props, var(--xy-minimap-node-background-color, var(--xy-minimap-node-background-color-default)) );stroke:var( --xy-minimap-node-stroke-color-props, var(--xy-minimap-node-stroke-color, var(--xy-minimap-node-stroke-color-default)) );stroke-width:var( --xy-minimap-node-stroke-width-props, var(--xy-minimap-node-stroke-width, var(--xy-minimap-node-stroke-width-default)) )}.react-flow__background-pattern.dots{fill:var( --xy-background-pattern-color-props, var(--xy-background-pattern-color, var(--xy-background-pattern-dots-color-default)) )}.react-flow__background-pattern.lines{stroke:var( --xy-background-pattern-color-props, var(--xy-background-pattern-color, var(--xy-background-pattern-lines-color-default)) )}.react-flow__background-pattern.cross{stroke:var( --xy-background-pattern-color-props, var(--xy-background-pattern-color, var(--xy-background-pattern-cross-color-default)) )}.react-flow__controls{display:flex;flex-direction:column;box-shadow:var(--xy-controls-box-shadow, var(--xy-controls-box-shadow-default))}.react-flow__controls.horizontal{flex-direction:row}.react-flow__controls-button{display:flex;justify-content:center;align-items:center;height:26px;width:26px;padding:4px;border:none;background:var(--xy-controls-button-background-color, var(--xy-controls-button-background-color-default));border-bottom:1px solid var( --xy-controls-button-border-color-props, var(--xy-controls-button-border-color, var(--xy-controls-button-border-color-default)) );color:var( --xy-controls-button-color-props, var(--xy-controls-button-color, var(--xy-controls-button-color-default)) );cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__controls-button svg{width:100%;max-width:12px;max-height:12px;fill:currentColor}.react-flow__edge.updating .react-flow__edge-path{stroke:#777}.react-flow__edge-text{font-size:10px}.react-flow__node.selectable:focus,.react-flow__node.selectable:focus-visible{outline:none}.react-flow__node-input,.react-flow__node-default,.react-flow__node-output,.react-flow__node-group{padding:10px;border-radius:var(--xy-node-border-radius, var(--xy-node-border-radius-default));width:150px;font-size:12px;color:var(--xy-node-color, var(--xy-node-color-default));text-align:center;border:var(--xy-node-border, var(--xy-node-border-default));background-color:var(--xy-node-background-color, var(--xy-node-background-color-default))}.react-flow__node-input.selectable:hover,.react-flow__node-default.selectable:hover,.react-flow__node-output.selectable:hover,.react-flow__node-group.selectable:hover{box-shadow:var(--xy-node-boxshadow-hover, var(--xy-node-boxshadow-hover-default))}.react-flow__node-input.selectable.selected,.react-flow__node-input.selectable:focus,.react-flow__node-input.selectable:focus-visible,.react-flow__node-default.selectable.selected,.react-flow__node-default.selectable:focus,.react-flow__node-default.selectable:focus-visible,.react-flow__node-output.selectable.selected,.react-flow__node-output.selectable:focus,.react-flow__node-output.selectable:focus-visible,.react-flow__node-group.selectable.selected,.react-flow__node-group.selectable:focus,.react-flow__node-group.selectable:focus-visible{box-shadow:var(--xy-node-boxshadow-selected, var(--xy-node-boxshadow-selected-default))}.react-flow__node-group{background-color:var(--xy-node-group-background-color, var(--xy-node-group-background-color-default))}.react-flow__nodesselection-rect,.react-flow__selection{background:var(--xy-selection-background-color, var(--xy-selection-background-color-default));border:var(--xy-selection-border, var(--xy-selection-border-default))}.react-flow__nodesselection-rect:focus,.react-flow__nodesselection-rect:focus-visible,.react-flow__selection:focus,.react-flow__selection:focus-visible{outline:none}.react-flow__controls-button:hover{background:var( --xy-controls-button-background-color-hover-props, var(--xy-controls-button-background-color-hover, var(--xy-controls-button-background-color-hover-default)) );color:var( --xy-controls-button-color-hover-props, var(--xy-controls-button-color-hover, var(--xy-controls-button-color-hover-default)) )}.react-flow__controls-button:disabled{pointer-events:none}.react-flow__controls-button:disabled svg{fill-opacity:.4}.react-flow__controls-button:last-child{border-bottom:none}.react-flow__controls.horizontal .react-flow__controls-button{border-bottom:none;border-right:1px solid var( --xy-controls-button-border-color-props, var(--xy-controls-button-border-color, var(--xy-controls-button-border-color-default)) )}.react-flow__controls.horizontal .react-flow__controls-button:last-child{border-right:none}.react-flow__resize-control{position:absolute}.react-flow__resize-control.left,.react-flow__resize-control.right{cursor:ew-resize}.react-flow__resize-control.top,.react-flow__resize-control.bottom{cursor:ns-resize}.react-flow__resize-control.top.left,.react-flow__resize-control.bottom.right{cursor:nwse-resize}.react-flow__resize-control.bottom.left,.react-flow__resize-control.top.right{cursor:nesw-resize}.react-flow__resize-control.handle{width:5px;height:5px;border:1px solid #fff;border-radius:1px;background-color:var(--xy-resize-background-color, var(--xy-resize-background-color-default));translate:-50% -50%}.react-flow__resize-control.handle.left{left:0;top:50%}.react-flow__resize-control.handle.right{left:100%;top:50%}.react-flow__resize-control.handle.top{left:50%;top:0}.react-flow__resize-control.handle.bottom{left:50%;top:100%}.react-flow__resize-control.handle.top.left,.react-flow__resize-control.handle.bottom.left{left:0}.react-flow__resize-control.handle.top.right,.react-flow__resize-control.handle.bottom.right{left:100%}.react-flow__resize-control.line{border-color:var(--xy-resize-background-color, var(--xy-resize-background-color-default));border-width:0;border-style:solid}.react-flow__resize-control.line.left,.react-flow__resize-control.line.right{width:1px;transform:translate(-50%);top:0;height:100%}.react-flow__resize-control.line.left{left:0;border-left-width:1px}.react-flow__resize-control.line.right{left:100%;border-right-width:1px}.react-flow__resize-control.line.top,.react-flow__resize-control.line.bottom{height:1px;transform:translateY(-50%);left:0;width:100%}.react-flow__resize-control.line.top{top:0;border-top-width:1px}.react-flow__resize-control.line.bottom{border-bottom-width:1px;top:100%}.react-flow__edge-textbg{fill:var(--xy-edge-label-background-color, var(--xy-edge-label-background-color-default))}.react-flow__edge-text{fill:var(--xy-edge-label-color, var(--xy-edge-label-color-default))}", he = "pubuilder-styles", me = "pubuilder-xyflow-styles", xe = (
112
+ publishJobs: {},
113
+ openMap: () => t({ isMapOpen: !0 }),
114
+ // 오버레이만 닫는다 publishJobs는 건드리지 않아 실행 job이 계속 살아있고,
115
+ // 맵을 다시 열어 같은 블록을 선택하면 진행 상황/결과에 재연결된다.
116
+ closeMap: () => t({ isMapOpen: !1, viewerPath: null, selection: null, selectedOuterHTML: null }),
117
+ openViewer: (e) => t({ viewerPath: e, selection: null, selectedOuterHTML: null }),
118
+ closeViewer: () => t({ viewerPath: null, selection: null, selectedOuterHTML: null }),
119
+ setGranularity: (e) => t({ granularity: e }),
120
+ setInspectEnabled: (e) => t({ inspectEnabled: e }),
121
+ setSelectionWithHTML: (e, r) => t({ selection: e, selectedOuterHTML: r }),
122
+ toggleSkillDrawer: () => t((e) => ({ skillDrawerOpen: !e.skillDrawerOpen })),
123
+ patchPublishJob: (e, r) => t((n) => ({
124
+ publishJobs: {
125
+ ...n.publishJobs,
126
+ [e]: { ...n.publishJobs[e] ?? q, ...r }
127
+ }
128
+ })),
129
+ appendPublishEvent: (e, r) => t((n) => {
130
+ const l = n.publishJobs[e] ?? q;
131
+ return {
132
+ publishJobs: {
133
+ ...n.publishJobs,
134
+ [e]: { ...l, events: [...l.events, r] }
135
+ }
136
+ };
137
+ }),
138
+ suspendConflicts: [],
139
+ suspendResolutions: {},
140
+ setSuspendConflicts: (e) => t({ suspendConflicts: e, suspendResolutions: {} }),
141
+ setConflictResolution: (e, r, n) => t((l) => ({
142
+ suspendResolutions: { ...l.suspendResolutions, [e]: { file: e, action: r, ...n !== void 0 ? { content: n } : {} } }
143
+ })),
144
+ clearSuspend: () => t({ suspendConflicts: [], suspendResolutions: {} })
145
+ })), ve = ".react-flow{direction:ltr;--xy-edge-stroke-default: #b1b1b7;--xy-edge-stroke-width-default: 1;--xy-edge-stroke-selected-default: #555;--xy-connectionline-stroke-default: #b1b1b7;--xy-connectionline-stroke-width-default: 1;--xy-attribution-background-color-default: rgba(255, 255, 255, .5);--xy-minimap-background-color-default: #fff;--xy-minimap-mask-background-color-default: rgba(240, 240, 240, .6);--xy-minimap-mask-stroke-color-default: transparent;--xy-minimap-mask-stroke-width-default: 1;--xy-minimap-node-background-color-default: #e2e2e2;--xy-minimap-node-stroke-color-default: transparent;--xy-minimap-node-stroke-width-default: 2;--xy-background-color-default: transparent;--xy-background-pattern-dots-color-default: #91919a;--xy-background-pattern-lines-color-default: #eee;--xy-background-pattern-cross-color-default: #e2e2e2;background-color:var(--xy-background-color, var(--xy-background-color-default));--xy-node-color-default: inherit;--xy-node-border-default: 1px solid #1a192b;--xy-node-background-color-default: #fff;--xy-node-group-background-color-default: rgba(240, 240, 240, .25);--xy-node-boxshadow-hover-default: 0 1px 4px 1px rgba(0, 0, 0, .08);--xy-node-boxshadow-selected-default: 0 0 0 .5px #1a192b;--xy-node-border-radius-default: 3px;--xy-handle-background-color-default: #1a192b;--xy-handle-border-color-default: #fff;--xy-selection-background-color-default: rgba(0, 89, 220, .08);--xy-selection-border-default: 1px dotted rgba(0, 89, 220, .8);--xy-controls-button-background-color-default: #fefefe;--xy-controls-button-background-color-hover-default: #f4f4f4;--xy-controls-button-color-default: inherit;--xy-controls-button-color-hover-default: inherit;--xy-controls-button-border-color-default: #eee;--xy-controls-box-shadow-default: 0 0 2px 1px rgba(0, 0, 0, .08);--xy-edge-label-background-color-default: #ffffff;--xy-edge-label-color-default: inherit;--xy-resize-background-color-default: #3367d9}.react-flow.dark{--xy-edge-stroke-default: #3e3e3e;--xy-edge-stroke-width-default: 1;--xy-edge-stroke-selected-default: #727272;--xy-connectionline-stroke-default: #b1b1b7;--xy-connectionline-stroke-width-default: 1;--xy-attribution-background-color-default: rgba(150, 150, 150, .25);--xy-minimap-background-color-default: #141414;--xy-minimap-mask-background-color-default: rgba(60, 60, 60, .6);--xy-minimap-mask-stroke-color-default: transparent;--xy-minimap-mask-stroke-width-default: 1;--xy-minimap-node-background-color-default: #2b2b2b;--xy-minimap-node-stroke-color-default: transparent;--xy-minimap-node-stroke-width-default: 2;--xy-background-color-default: #141414;--xy-background-pattern-dots-color-default: #555;--xy-background-pattern-lines-color-default: #333;--xy-background-pattern-cross-color-default: #333;--xy-node-color-default: #f8f8f8;--xy-node-border-default: 1px solid #3c3c3c;--xy-node-background-color-default: #1e1e1e;--xy-node-group-background-color-default: rgba(240, 240, 240, .25);--xy-node-boxshadow-hover-default: 0 1px 4px 1px rgba(255, 255, 255, .08);--xy-node-boxshadow-selected-default: 0 0 0 .5px #999;--xy-handle-background-color-default: #bebebe;--xy-handle-border-color-default: #1e1e1e;--xy-selection-background-color-default: rgba(200, 200, 220, .08);--xy-selection-border-default: 1px dotted rgba(200, 200, 220, .8);--xy-controls-button-background-color-default: #2b2b2b;--xy-controls-button-background-color-hover-default: #3e3e3e;--xy-controls-button-color-default: #f8f8f8;--xy-controls-button-color-hover-default: #fff;--xy-controls-button-border-color-default: #5b5b5b;--xy-controls-box-shadow-default: 0 0 2px 1px rgba(0, 0, 0, .08);--xy-edge-label-background-color-default: #141414;--xy-edge-label-color-default: #f8f8f8}.react-flow__background{background-color:var(--xy-background-color-props, var(--xy-background-color, var(--xy-background-color-default)));pointer-events:none;z-index:-1}.react-flow__container{position:absolute;width:100%;height:100%;top:0;left:0}.react-flow__pane{z-index:1;touch-action:none}.react-flow__pane.draggable{cursor:grab}.react-flow__pane.dragging{cursor:grabbing}.react-flow__pane.selection{cursor:pointer}.react-flow__viewport{transform-origin:0 0;z-index:2;pointer-events:none}.react-flow__renderer{z-index:4}.react-flow__selection{z-index:6}.react-flow__nodesselection-rect:focus,.react-flow__nodesselection-rect:focus-visible{outline:none}.react-flow__edge-path{stroke:var(--xy-edge-stroke, var(--xy-edge-stroke-default));stroke-width:var(--xy-edge-stroke-width, var(--xy-edge-stroke-width-default));fill:none}.react-flow__connection-path{stroke:var(--xy-connectionline-stroke, var(--xy-connectionline-stroke-default));stroke-width:var(--xy-connectionline-stroke-width, var(--xy-connectionline-stroke-width-default));fill:none}.react-flow .react-flow__edges{position:absolute}.react-flow .react-flow__edges svg{overflow:visible;position:absolute;pointer-events:none}.react-flow__edge{pointer-events:visibleStroke}.react-flow__edge.selectable{cursor:pointer}.react-flow__edge.animated path{stroke-dasharray:5;animation:dashdraw .5s linear infinite}.react-flow__edge.animated path.react-flow__edge-interaction{stroke-dasharray:none;animation:none}.react-flow__edge.inactive{pointer-events:none}.react-flow__edge.selected,.react-flow__edge:focus,.react-flow__edge:focus-visible{outline:none}.react-flow__edge.selected .react-flow__edge-path,.react-flow__edge.selectable:focus .react-flow__edge-path,.react-flow__edge.selectable:focus-visible .react-flow__edge-path{stroke:var(--xy-edge-stroke-selected, var(--xy-edge-stroke-selected-default))}.react-flow__edge-textwrapper{pointer-events:all}.react-flow__edge .react-flow__edge-text{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__arrowhead polyline{stroke:var(--xy-edge-stroke, var(--xy-edge-stroke-default))}.react-flow__arrowhead polyline.arrowclosed{fill:var(--xy-edge-stroke, var(--xy-edge-stroke-default))}.react-flow__connection{pointer-events:none}.react-flow__connection .animated{stroke-dasharray:5;animation:dashdraw .5s linear infinite}svg.react-flow__connectionline{z-index:1001;overflow:visible;position:absolute}.react-flow__nodes{pointer-events:none;transform-origin:0 0}.react-flow__node{position:absolute;-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:all;transform-origin:0 0;box-sizing:border-box;cursor:default}.react-flow__node.selectable{cursor:pointer}.react-flow__node.draggable{cursor:grab;pointer-events:all}.react-flow__node.draggable.dragging{cursor:grabbing}.react-flow__nodesselection{z-index:3;transform-origin:left top;pointer-events:none}.react-flow__nodesselection-rect{position:absolute;pointer-events:all;cursor:grab}.react-flow__handle{position:absolute;pointer-events:none;min-width:5px;min-height:5px;width:6px;height:6px;background-color:var(--xy-handle-background-color, var(--xy-handle-background-color-default));border:1px solid var(--xy-handle-border-color, var(--xy-handle-border-color-default));border-radius:100%}.react-flow__handle.connectingfrom{pointer-events:all}.react-flow__handle.connectionindicator{pointer-events:all;cursor:crosshair}.react-flow__handle-bottom{top:auto;left:50%;bottom:0;transform:translate(-50%,50%)}.react-flow__handle-top{top:0;left:50%;transform:translate(-50%,-50%)}.react-flow__handle-left{top:50%;left:0;transform:translate(-50%,-50%)}.react-flow__handle-right{top:50%;right:0;transform:translate(50%,-50%)}.react-flow__edgeupdater{cursor:move;pointer-events:all}.react-flow__pane.selection .react-flow__panel{pointer-events:none}.react-flow__panel{position:absolute;z-index:5;margin:15px}.react-flow__panel.top{top:0}.react-flow__panel.bottom{bottom:0}.react-flow__panel.top.center,.react-flow__panel.bottom.center{left:50%;transform:translate(-15px) translate(-50%)}.react-flow__panel.left{left:0}.react-flow__panel.right{right:0}.react-flow__panel.left.center,.react-flow__panel.right.center{top:50%;transform:translateY(-15px) translateY(-50%)}.react-flow__attribution{font-size:10px;background:var(--xy-attribution-background-color, var(--xy-attribution-background-color-default));padding:2px 3px;margin:0}.react-flow__attribution a{text-decoration:none;color:#999}@keyframes dashdraw{0%{stroke-dashoffset:10}}.react-flow__edgelabel-renderer{position:absolute;width:100%;height:100%;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;left:0;top:0}.react-flow__viewport-portal{position:absolute;width:100%;height:100%;left:0;top:0;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__minimap{background:var( --xy-minimap-background-color-props, var(--xy-minimap-background-color, var(--xy-minimap-background-color-default)) )}.react-flow__minimap-svg{display:block}.react-flow__minimap-mask{fill:var( --xy-minimap-mask-background-color-props, var(--xy-minimap-mask-background-color, var(--xy-minimap-mask-background-color-default)) );stroke:var( --xy-minimap-mask-stroke-color-props, var(--xy-minimap-mask-stroke-color, var(--xy-minimap-mask-stroke-color-default)) );stroke-width:var( --xy-minimap-mask-stroke-width-props, var(--xy-minimap-mask-stroke-width, var(--xy-minimap-mask-stroke-width-default)) )}.react-flow__minimap-node{fill:var( --xy-minimap-node-background-color-props, var(--xy-minimap-node-background-color, var(--xy-minimap-node-background-color-default)) );stroke:var( --xy-minimap-node-stroke-color-props, var(--xy-minimap-node-stroke-color, var(--xy-minimap-node-stroke-color-default)) );stroke-width:var( --xy-minimap-node-stroke-width-props, var(--xy-minimap-node-stroke-width, var(--xy-minimap-node-stroke-width-default)) )}.react-flow__background-pattern.dots{fill:var( --xy-background-pattern-color-props, var(--xy-background-pattern-color, var(--xy-background-pattern-dots-color-default)) )}.react-flow__background-pattern.lines{stroke:var( --xy-background-pattern-color-props, var(--xy-background-pattern-color, var(--xy-background-pattern-lines-color-default)) )}.react-flow__background-pattern.cross{stroke:var( --xy-background-pattern-color-props, var(--xy-background-pattern-color, var(--xy-background-pattern-cross-color-default)) )}.react-flow__controls{display:flex;flex-direction:column;box-shadow:var(--xy-controls-box-shadow, var(--xy-controls-box-shadow-default))}.react-flow__controls.horizontal{flex-direction:row}.react-flow__controls-button{display:flex;justify-content:center;align-items:center;height:26px;width:26px;padding:4px;border:none;background:var(--xy-controls-button-background-color, var(--xy-controls-button-background-color-default));border-bottom:1px solid var( --xy-controls-button-border-color-props, var(--xy-controls-button-border-color, var(--xy-controls-button-border-color-default)) );color:var( --xy-controls-button-color-props, var(--xy-controls-button-color, var(--xy-controls-button-color-default)) );cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__controls-button svg{width:100%;max-width:12px;max-height:12px;fill:currentColor}.react-flow__edge.updating .react-flow__edge-path{stroke:#777}.react-flow__edge-text{font-size:10px}.react-flow__node.selectable:focus,.react-flow__node.selectable:focus-visible{outline:none}.react-flow__node-input,.react-flow__node-default,.react-flow__node-output,.react-flow__node-group{padding:10px;border-radius:var(--xy-node-border-radius, var(--xy-node-border-radius-default));width:150px;font-size:12px;color:var(--xy-node-color, var(--xy-node-color-default));text-align:center;border:var(--xy-node-border, var(--xy-node-border-default));background-color:var(--xy-node-background-color, var(--xy-node-background-color-default))}.react-flow__node-input.selectable:hover,.react-flow__node-default.selectable:hover,.react-flow__node-output.selectable:hover,.react-flow__node-group.selectable:hover{box-shadow:var(--xy-node-boxshadow-hover, var(--xy-node-boxshadow-hover-default))}.react-flow__node-input.selectable.selected,.react-flow__node-input.selectable:focus,.react-flow__node-input.selectable:focus-visible,.react-flow__node-default.selectable.selected,.react-flow__node-default.selectable:focus,.react-flow__node-default.selectable:focus-visible,.react-flow__node-output.selectable.selected,.react-flow__node-output.selectable:focus,.react-flow__node-output.selectable:focus-visible,.react-flow__node-group.selectable.selected,.react-flow__node-group.selectable:focus,.react-flow__node-group.selectable:focus-visible{box-shadow:var(--xy-node-boxshadow-selected, var(--xy-node-boxshadow-selected-default))}.react-flow__node-group{background-color:var(--xy-node-group-background-color, var(--xy-node-group-background-color-default))}.react-flow__nodesselection-rect,.react-flow__selection{background:var(--xy-selection-background-color, var(--xy-selection-background-color-default));border:var(--xy-selection-border, var(--xy-selection-border-default))}.react-flow__nodesselection-rect:focus,.react-flow__nodesselection-rect:focus-visible,.react-flow__selection:focus,.react-flow__selection:focus-visible{outline:none}.react-flow__controls-button:hover{background:var( --xy-controls-button-background-color-hover-props, var(--xy-controls-button-background-color-hover, var(--xy-controls-button-background-color-hover-default)) );color:var( --xy-controls-button-color-hover-props, var(--xy-controls-button-color-hover, var(--xy-controls-button-color-hover-default)) )}.react-flow__controls-button:disabled{pointer-events:none}.react-flow__controls-button:disabled svg{fill-opacity:.4}.react-flow__controls-button:last-child{border-bottom:none}.react-flow__controls.horizontal .react-flow__controls-button{border-bottom:none;border-right:1px solid var( --xy-controls-button-border-color-props, var(--xy-controls-button-border-color, var(--xy-controls-button-border-color-default)) )}.react-flow__controls.horizontal .react-flow__controls-button:last-child{border-right:none}.react-flow__resize-control{position:absolute}.react-flow__resize-control.left,.react-flow__resize-control.right{cursor:ew-resize}.react-flow__resize-control.top,.react-flow__resize-control.bottom{cursor:ns-resize}.react-flow__resize-control.top.left,.react-flow__resize-control.bottom.right{cursor:nwse-resize}.react-flow__resize-control.bottom.left,.react-flow__resize-control.top.right{cursor:nesw-resize}.react-flow__resize-control.handle{width:5px;height:5px;border:1px solid #fff;border-radius:1px;background-color:var(--xy-resize-background-color, var(--xy-resize-background-color-default));translate:-50% -50%}.react-flow__resize-control.handle.left{left:0;top:50%}.react-flow__resize-control.handle.right{left:100%;top:50%}.react-flow__resize-control.handle.top{left:50%;top:0}.react-flow__resize-control.handle.bottom{left:50%;top:100%}.react-flow__resize-control.handle.top.left,.react-flow__resize-control.handle.bottom.left{left:0}.react-flow__resize-control.handle.top.right,.react-flow__resize-control.handle.bottom.right{left:100%}.react-flow__resize-control.line{border-color:var(--xy-resize-background-color, var(--xy-resize-background-color-default));border-width:0;border-style:solid}.react-flow__resize-control.line.left,.react-flow__resize-control.line.right{width:1px;transform:translate(-50%);top:0;height:100%}.react-flow__resize-control.line.left{left:0;border-left-width:1px}.react-flow__resize-control.line.right{left:100%;border-right-width:1px}.react-flow__resize-control.line.top,.react-flow__resize-control.line.bottom{height:1px;transform:translateY(-50%);left:0;width:100%}.react-flow__resize-control.line.top{top:0;border-top-width:1px}.react-flow__resize-control.line.bottom{border-bottom-width:1px;top:100%}.react-flow__edge-textbg{fill:var(--xy-edge-label-background-color, var(--xy-edge-label-background-color-default))}.react-flow__edge-text{fill:var(--xy-edge-label-color, var(--xy-edge-label-color-default))}", ke = "pubuilder-styles", _e = "pubuilder-xyflow-styles", Ne = (
97
146
  /* css */
98
147
  `
99
148
  .pbu-fab {
@@ -341,7 +390,14 @@ const y = ue((e) => ({
341
390
  flex-direction: column;
342
391
  gap: 8px;
343
392
  }
344
- .pbu-publish > label { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: #8c8c8c; }
393
+ .pbu-publish-heading {
394
+ display: flex;
395
+ align-items: center;
396
+ justify-content: space-between;
397
+ gap: 8px;
398
+ }
399
+ .pbu-publish-heading > label { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: #8c8c8c; }
400
+ .pbu-skill-entry { white-space: nowrap; }
345
401
  .pbu-publish input {
346
402
  background: #1e1e1e;
347
403
  border: 1px solid #3c3c3c;
@@ -368,6 +424,43 @@ const y = ue((e) => ({
368
424
  .pbu-log-tool { color: #8c8c8c; }
369
425
  .pbu-log-error { color: #f2b3b3; }
370
426
  .pbu-log-done { color: #89d185; font-weight: 600; }
427
+ .pbu-publish-reply {
428
+ padding-top: 8px;
429
+ border-top: 1px solid #3c3c3c;
430
+ display: flex;
431
+ flex-direction: column;
432
+ gap: 6px;
433
+ }
434
+ .pbu-publish-reply > label {
435
+ color: #cccccc;
436
+ font-size: 11px;
437
+ font-weight: 600;
438
+ }
439
+ .pbu-publish-reply textarea {
440
+ width: 100%;
441
+ min-height: 62px;
442
+ resize: vertical;
443
+ box-sizing: border-box;
444
+ background: #1e1e1e;
445
+ border: 1px solid #4b4b4b;
446
+ border-radius: 2px;
447
+ color: #e6e6e6;
448
+ font: 11px/1.5 ui-monospace, Menlo, monospace;
449
+ padding: 7px 8px;
450
+ outline: none;
451
+ }
452
+ .pbu-publish-reply textarea:focus {
453
+ border-color: #3794ff;
454
+ box-shadow: 0 0 0 1px #3794ff;
455
+ }
456
+ .pbu-publish-reply textarea::placeholder { color: #6f6f6f; }
457
+ .pbu-publish-reply-actions {
458
+ display: flex;
459
+ align-items: center;
460
+ justify-content: space-between;
461
+ gap: 8px;
462
+ }
463
+ .pbu-publish-reply-actions > span { color: #777; font-size: 9px; }
371
464
 
372
465
  .pbu-drawer {
373
466
  position: fixed;
@@ -394,6 +487,50 @@ const y = ue((e) => ({
394
487
  padding-bottom: 8px;
395
488
  border-bottom: 1px solid #3c3c3c;
396
489
  }
490
+ .pbu-drawer-header > div { display: flex; flex-direction: column; gap: 2px; }
491
+ .pbu-drawer-kicker { color: #858585; font-size: 9px; letter-spacing: 0.04em; }
492
+ .pbu-drawer-guide {
493
+ background: #1e1e1e;
494
+ border: 1px solid #3c3c3c;
495
+ border-left: 2px solid #3794ff;
496
+ padding: 10px;
497
+ display: flex;
498
+ flex-direction: column;
499
+ gap: 5px;
500
+ line-height: 1.45;
501
+ }
502
+ .pbu-drawer-guide strong { color: #e5e5e5; font-size: 11px; }
503
+ .pbu-drawer-guide > span { color: #9d9d9d; font-size: 10px; }
504
+ .pbu-guide-status { color: #cccccc; font-size: 10px; display: flex; align-items: center; gap: 5px; margin-top: 2px; }
505
+ .pbu-status-dot { width: 6px; height: 6px; border-radius: 50%; background: #777; }
506
+ .pbu-status-dot-on { background: #73c991; box-shadow: 0 0 0 2px rgba(115, 201, 145, 0.12); }
507
+ .pbu-drawer-section-head {
508
+ margin-top: 4px;
509
+ padding-bottom: 7px;
510
+ border-bottom: 1px solid #3c3c3c;
511
+ display: flex;
512
+ align-items: flex-start;
513
+ justify-content: space-between;
514
+ gap: 8px;
515
+ }
516
+ .pbu-drawer-section-head > div { display: flex; flex-direction: column; gap: 2px; }
517
+ .pbu-drawer-section-head strong { color: #e5e5e5; font-size: 11px; }
518
+ .pbu-drawer-section-head div > span { color: #858585; font-size: 9px; line-height: 1.4; }
519
+ .pbu-drawer-section-head-skills { margin-top: 10px; }
520
+ .pbu-status-badge, .pbu-skill-state {
521
+ flex: none;
522
+ border: 1px solid #4a4a4a;
523
+ border-radius: 999px;
524
+ padding: 1px 6px;
525
+ color: #8c8c8c;
526
+ font-size: 9px;
527
+ line-height: 1.5;
528
+ }
529
+ .pbu-status-on, .pbu-skill-state-on { border-color: #3e7651; background: #23362a; color: #89d185; }
530
+ .pbu-status-off { border-color: #765f3e; background: #382f22; color: #cca96a; }
531
+ .pbu-skill-source { margin: 8px 0 4px; display: flex; flex-direction: column; gap: 1px; }
532
+ .pbu-skill-source strong { color: #cccccc; font-size: 10px; }
533
+ .pbu-skill-source span { color: #777; font-size: 9px; line-height: 1.35; }
397
534
  .pbu-drawer-group {
398
535
  display: flex;
399
536
  align-items: center;
@@ -456,59 +593,127 @@ const y = ue((e) => ({
456
593
  font-size: 11px;
457
594
  color: #cccccc;
458
595
  }
596
+
597
+ /* 일시 종료 버튼 — 위험 액션이라 붉은 계열 */
598
+ .pbu-suspend-btn {
599
+ border-color: #7a3b3b;
600
+ background: #3a2626;
601
+ color: #f2b3b3;
602
+ white-space: nowrap;
603
+ }
604
+ .pbu-suspend-btn:hover:not(:disabled) { background: #4a2d2d; }
605
+
606
+ /* 충돌 해결 모달 */
607
+ .pbu-suspend-overlay {
608
+ position: fixed;
609
+ inset: 0;
610
+ z-index: 2147483400;
611
+ background: rgba(0, 0, 0, 0.55);
612
+ display: flex;
613
+ align-items: center;
614
+ justify-content: center;
615
+ padding: 24px;
616
+ }
617
+ .pbu-suspend-panel {
618
+ width: min(560px, 100%);
619
+ max-height: 82vh;
620
+ overflow-y: auto;
621
+ background: #252526;
622
+ border: 1px solid #3c3c3c;
623
+ border-radius: 4px;
624
+ padding: 16px;
625
+ display: flex;
626
+ flex-direction: column;
627
+ gap: 12px;
628
+ color: #cccccc;
629
+ }
630
+ .pbu-suspend-head { display: flex; flex-direction: column; gap: 4px; }
631
+ .pbu-suspend-head strong { color: #f2b3b3; font-size: 13px; }
632
+ .pbu-suspend-head > span { color: #9d9d9d; font-size: 11px; line-height: 1.45; }
633
+ .pbu-conflict-row {
634
+ display: flex;
635
+ flex-direction: column;
636
+ gap: 6px;
637
+ padding: 10px;
638
+ border: 1px solid #3c3c3c;
639
+ border-radius: 2px;
640
+ background: #1e1e1e;
641
+ }
642
+ .pbu-conflict-file { font-family: ui-monospace, Menlo, monospace; font-size: 12px; color: #e6e6e6; }
643
+ .pbu-conflict-actions { display: flex; gap: 6px; }
644
+ .pbu-conflict-edit {
645
+ width: 100%;
646
+ box-sizing: border-box;
647
+ resize: vertical;
648
+ background: #1e1e1e;
649
+ border: 1px solid #4b4b4b;
650
+ border-radius: 2px;
651
+ color: #e6e6e6;
652
+ font: 11px/1.5 ui-monospace, Menlo, monospace;
653
+ padding: 7px 8px;
654
+ outline: none;
655
+ }
656
+ .pbu-conflict-edit:focus { border-color: #3794ff; box-shadow: 0 0 0 1px #3794ff; }
657
+ .pbu-suspend-foot {
658
+ display: flex;
659
+ justify-content: flex-end;
660
+ gap: 8px;
661
+ padding-top: 4px;
662
+ border-top: 1px solid #3c3c3c;
663
+ }
459
664
  `
460
665
  );
461
- function X(e, t) {
462
- if (document.getElementById(e)) return;
666
+ function Y(t, e) {
667
+ if (document.getElementById(t)) return;
463
668
  const r = document.createElement("style");
464
- r.id = e, r.textContent = t, document.head.appendChild(r);
669
+ r.id = t, r.textContent = e, document.head.appendChild(r);
465
670
  }
466
- function we() {
467
- typeof document > "u" || (X(me, ge), X(he, xe));
671
+ function ze() {
672
+ typeof document > "u" || (Y(_e, ve), Y(ke, Ne));
468
673
  }
469
- function ye(e, t, r, o = 140, l = 48) {
470
- const a = /* @__PURE__ */ new Map();
471
- for (const u of e) {
472
- const w = a.get(u.parentId) ?? [];
473
- w.push(u), a.set(u.parentId, w);
674
+ function Ce(t, e, r, n = 140, l = 48) {
675
+ const p = /* @__PURE__ */ new Map();
676
+ for (const g of t) {
677
+ const b = p.get(g.parentId) ?? [];
678
+ b.push(g), p.set(g.parentId, b);
474
679
  }
475
- const i = /* @__PURE__ */ new Map();
476
- let c = 0;
477
- const h = (u) => {
478
- const w = a.get(u.id) ?? [], f = u.depth * (t + o);
680
+ const c = /* @__PURE__ */ new Map();
681
+ let a = 0;
682
+ const u = (g) => {
683
+ const b = p.get(g.id) ?? [], d = g.depth * (e + n);
479
684
  let v;
480
- if (w.length === 0)
481
- v = c, c += r + l;
685
+ if (b.length === 0)
686
+ v = a, a += r + l;
482
687
  else {
483
- const N = w.map(h);
484
- v = (Math.min(...N) + Math.max(...N)) / 2;
688
+ const f = b.map(u);
689
+ v = (Math.min(...f) + Math.max(...f)) / 2;
485
690
  }
486
- return i.set(u.id, { x: f, y: v }), v;
691
+ return c.set(g.id, { x: d, y: v }), v;
487
692
  };
488
- for (const u of a.get(null) ?? []) h(u);
489
- return e.map((u) => ({ ...u, ...i.get(u.id) }));
693
+ for (const g of p.get(null) ?? []) u(g);
694
+ return t.map((g) => ({ ...g, ...c.get(g.id) }));
490
695
  }
491
- const ve = ce(function(t) {
492
- const { page: r, viewport: o, thumbWidth: l, bodyHeight: a } = t.data, i = y((v) => v.openViewer), c = D(null), [h, u] = _(!1);
493
- R(() => {
494
- const v = c.current;
696
+ const Se = pe(function(e) {
697
+ const { page: r, viewport: n, thumbWidth: l, bodyHeight: p } = e.data, c = y((v) => v.openViewer), a = $(null), [u, g] = N(!1);
698
+ L(() => {
699
+ const v = a.current;
495
700
  if (!v || r.external) return;
496
- const N = new IntersectionObserver(([g]) => {
497
- g.isIntersecting && (u(!0), N.disconnect());
701
+ const f = new IntersectionObserver(([C]) => {
702
+ C.isIntersecting && (g(!0), f.disconnect());
498
703
  });
499
- return N.observe(v), () => N.disconnect();
704
+ return f.observe(v), () => f.disconnect();
500
705
  }, [r.external]);
501
- const w = l / o.width;
502
- return /* @__PURE__ */ d("div", { ref: c, className: "pbu-node", style: { width: l }, onClick: () => {
503
- r.external ? window.open(r.path, "_blank", "noopener") : i(r.path);
706
+ const b = l / n.width;
707
+ return /* @__PURE__ */ s("div", { ref: a, className: "pbu-node", style: { width: l }, onClick: () => {
708
+ r.external ? window.open(r.path, "_blank", "noopener") : c(r.path);
504
709
  }, children: [
505
- /* @__PURE__ */ n(J, { type: "target", position: j.Left, className: "pbu-handle", isConnectable: !1 }),
506
- /* @__PURE__ */ d("div", { className: "pbu-node-header", children: [
507
- /* @__PURE__ */ n("span", { className: "pbu-node-title", children: r.title }),
508
- /* @__PURE__ */ n("span", { className: "pbu-node-path", children: r.external ? "외부 ↗" : r.path })
710
+ /* @__PURE__ */ o(W, { type: "target", position: B.Left, className: "pbu-handle", isConnectable: !1 }),
711
+ /* @__PURE__ */ s("div", { className: "pbu-node-header", children: [
712
+ /* @__PURE__ */ o("span", { className: "pbu-node-title", children: r.title }),
713
+ /* @__PURE__ */ o("span", { className: "pbu-node-path", children: r.external ? "외부 ↗" : r.path })
509
714
  ] }),
510
- /* @__PURE__ */ d("div", { className: "pbu-node-body", style: { height: a }, children: [
511
- r.external ? /* @__PURE__ */ n("div", { className: "pbu-node-placeholder", children: "↗ 외부 링크" }) : h ? /* @__PURE__ */ n(
715
+ /* @__PURE__ */ s("div", { className: "pbu-node-body", style: { height: p }, children: [
716
+ r.external ? /* @__PURE__ */ o("div", { className: "pbu-node-placeholder", children: "↗ 외부 링크" }) : u ? /* @__PURE__ */ o(
512
717
  "iframe",
513
718
  {
514
719
  className: "pbu-node-iframe",
@@ -517,90 +722,106 @@ const ve = ce(function(t) {
517
722
  loading: "lazy",
518
723
  tabIndex: -1,
519
724
  style: {
520
- width: o.width,
521
- height: o.height,
522
- transform: `scale(${w})`
725
+ width: n.width,
726
+ height: n.height,
727
+ transform: `scale(${b})`
523
728
  }
524
729
  }
525
- ) : /* @__PURE__ */ n("div", { className: "pbu-node-placeholder", children: "…" }),
526
- /* @__PURE__ */ n("div", { className: "pbu-node-shield" })
730
+ ) : /* @__PURE__ */ o("div", { className: "pbu-node-placeholder", children: "…" }),
731
+ /* @__PURE__ */ o("div", { className: "pbu-node-shield" })
527
732
  ] }),
528
- /* @__PURE__ */ n(J, { type: "source", position: j.Right, className: "pbu-handle", isConnectable: !1 })
733
+ /* @__PURE__ */ o(W, { type: "source", position: B.Right, className: "pbu-handle", isConnectable: !1 })
529
734
  ] });
530
- }), ke = { page: ve }, G = 260, _e = 30;
531
- function Ne({ ia: e }) {
532
- const t = y((a) => a.closeMap), r = y((a) => a.toggleSkillDrawer), { nodes: o, edges: l } = V(() => {
533
- const a = G / e.viewport.width, i = Math.round(e.viewport.height * a), c = i + _e, h = ye(e.nodes, G, c), u = h.map((f) => ({
534
- id: f.id,
735
+ });
736
+ function te() {
737
+ const t = H(j), e = y((a) => a.publishJobs), r = y((a) => a.setSuspendConflicts), [n, l] = N(!1);
738
+ return Object.values(e).some((a) => a.status === "running") ? /* @__PURE__ */ o("button", { type: "button", className: "pbu-btn pbu-suspend-btn", onClick: async () => {
739
+ l(!0);
740
+ try {
741
+ const a = await t.suspendPublish();
742
+ a.conflicts.length > 0 && r(a.conflicts);
743
+ } catch {
744
+ } finally {
745
+ l(!1);
746
+ }
747
+ }, disabled: n, children: n ? "종료 중..." : "⏹ 일시 종료" }) : null;
748
+ }
749
+ const Ee = { page: Se }, U = 260, Me = 30;
750
+ function Pe({ ia: t }) {
751
+ const e = y((l) => l.closeMap), { nodes: r, edges: n } = J(() => {
752
+ const l = U / t.viewport.width, p = Math.round(t.viewport.height * l), c = p + Me, a = Ce(t.nodes, U, c), u = a.map((b) => ({
753
+ id: b.id,
535
754
  type: "page",
536
- position: { x: f.x, y: f.y },
755
+ position: { x: b.x, y: b.y },
537
756
  data: {
538
- page: f,
539
- viewport: e.viewport,
540
- thumbWidth: G,
541
- bodyHeight: i
757
+ page: b,
758
+ viewport: t.viewport,
759
+ thumbWidth: U,
760
+ bodyHeight: p
542
761
  },
543
- sourcePosition: j.Right,
544
- targetPosition: j.Left
545
- })), w = h.filter((f) => f.parentId).map((f) => ({
546
- id: `${f.parentId}->${f.id}`,
547
- source: f.parentId,
548
- target: f.id,
762
+ sourcePosition: B.Right,
763
+ targetPosition: B.Left
764
+ })), g = a.filter((b) => b.parentId).map((b) => ({
765
+ id: `${b.parentId}->${b.id}`,
766
+ source: b.parentId,
767
+ target: b.id,
549
768
  type: "smoothstep"
550
769
  }));
551
- return { nodes: u, edges: w };
552
- }, [e]);
553
- return R(() => {
554
- const a = (i) => {
555
- if (i.key !== "Escape") return;
770
+ return { nodes: u, edges: g };
771
+ }, [t]);
772
+ return L(() => {
773
+ const l = (p) => {
774
+ if (p.key !== "Escape") return;
556
775
  const c = y.getState();
557
- c.viewerPath || c.skillDrawerOpen || t();
776
+ c.viewerPath || c.skillDrawerOpen || e();
558
777
  };
559
- return window.addEventListener("keydown", a), () => window.removeEventListener("keydown", a);
560
- }, [t]), /* @__PURE__ */ d("div", { className: "pbu-overlay", children: [
561
- /* @__PURE__ */ d("div", { className: "pbu-bar", children: [
562
- /* @__PURE__ */ n("span", { className: "pbu-logo", children: "pubuilder" }),
563
- /* @__PURE__ */ n("span", { className: "pbu-hint", children: "노드 클릭 → 페이지 확대 · 스크롤 줌 · 드래그 팬 · Esc 닫기" }),
564
- /* @__PURE__ */ n("span", { className: "pbu-spacer" }),
565
- /* @__PURE__ */ n("button", { type: "button", className: "pbu-btn", onClick: r, children: "🧰 스킬함" }),
566
- /* @__PURE__ */ n("button", { type: "button", className: "pbu-icon-btn", onClick: t, "aria-label": "닫기", children: "✕" })
778
+ return window.addEventListener("keydown", l), () => window.removeEventListener("keydown", l);
779
+ }, [e]), /* @__PURE__ */ s("div", { className: "pbu-overlay", children: [
780
+ /* @__PURE__ */ s("div", { className: "pbu-bar", children: [
781
+ /* @__PURE__ */ o("span", { className: "pbu-logo", children: "pubuilder" }),
782
+ /* @__PURE__ */ o("span", { className: "pbu-hint", children: "노드 클릭 → 페이지 확대 · 스크롤 줌 · 드래그 팬 · Esc 닫기" }),
783
+ /* @__PURE__ */ o("span", { className: "pbu-spacer" }),
784
+ /* @__PURE__ */ o(te, {}),
785
+ /* @__PURE__ */ o("button", { type: "button", className: "pbu-icon-btn", onClick: e, "aria-label": "닫기", children: "✕" })
567
786
  ] }),
568
- /* @__PURE__ */ n("div", { className: "pbu-canvas", children: /* @__PURE__ */ n(
569
- pe,
787
+ /* @__PURE__ */ o("div", { className: "pbu-canvas", children: /* @__PURE__ */ o(
788
+ ge,
570
789
  {
571
- nodes: o,
572
- edges: l,
573
- nodeTypes: ke,
790
+ nodes: r,
791
+ edges: n,
792
+ nodeTypes: Ee,
574
793
  fitView: !0,
575
794
  fitViewOptions: { padding: 0.15, maxZoom: 1 },
576
795
  minZoom: 0.05,
577
796
  maxZoom: 2,
578
797
  nodesDraggable: !1,
579
798
  nodesConnectable: !1,
580
- elementsSelectable: !1
799
+ elementsSelectable: !1,
800
+ proOptions: { hideAttribution: !0 },
801
+ children: /* @__PURE__ */ o(xe, { showInteractive: !1 })
581
802
  }
582
803
  ) })
583
804
  ] });
584
805
  }
585
- function ze() {
586
- const e = y((o) => o.isMapOpen), t = y((o) => o.openMap), r = y((o) => o.closeMap);
587
- return /* @__PURE__ */ n(
806
+ function Te() {
807
+ const t = y((n) => n.isMapOpen), e = y((n) => n.openMap), r = y((n) => n.closeMap);
808
+ return /* @__PURE__ */ o(
588
809
  "button",
589
810
  {
590
811
  type: "button",
591
812
  className: "pbu-fab",
592
813
  title: "Page Map (pubuilder)",
593
814
  "aria-label": "페이지 맵 열기",
594
- onClick: () => e ? r() : t(),
595
- children: /* @__PURE__ */ d("svg", { width: "22", height: "22", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: [
596
- /* @__PURE__ */ n("polygon", { points: "3 6 9 3 15 6 21 3 21 18 15 21 9 18 3 21" }),
597
- /* @__PURE__ */ n("line", { x1: "9", y1: "3", x2: "9", y2: "18" }),
598
- /* @__PURE__ */ n("line", { x1: "15", y1: "6", x2: "15", y2: "21" })
815
+ onClick: () => t ? r() : e(),
816
+ children: /* @__PURE__ */ s("svg", { width: "22", height: "22", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: [
817
+ /* @__PURE__ */ o("polygon", { points: "3 6 9 3 15 6 21 3 21 18 15 21 9 18 3 21" }),
818
+ /* @__PURE__ */ o("line", { x1: "9", y1: "3", x2: "9", y2: "18" }),
819
+ /* @__PURE__ */ o("line", { x1: "15", y1: "6", x2: "15", y2: "21" })
599
820
  ] })
600
821
  }
601
822
  );
602
823
  }
603
- const Ce = /* @__PURE__ */ new Set([
824
+ const Le = /* @__PURE__ */ new Set([
604
825
  "section",
605
826
  "header",
606
827
  "footer",
@@ -609,7 +830,7 @@ const Ce = /* @__PURE__ */ new Set([
609
830
  "article",
610
831
  "aside",
611
832
  "form"
612
- ]), Ee = /* @__PURE__ */ new Set([
833
+ ]), Ie = /* @__PURE__ */ new Set([
613
834
  "a",
614
835
  "button",
615
836
  "input",
@@ -629,640 +850,805 @@ const Ce = /* @__PURE__ */ new Set([
629
850
  "p",
630
851
  "label"
631
852
  ]);
632
- function ne(e, t) {
853
+ function ne(t, e) {
633
854
  const r = [];
634
- let o = e;
635
- for (; o && o !== t.body && o !== t.documentElement; )
636
- r.push(o), o = o.parentElement;
855
+ let n = t;
856
+ for (; n && n !== e.body && n !== e.documentElement; )
857
+ r.push(n), n = n.parentElement;
637
858
  return r;
638
859
  }
639
- function Se(e, t) {
640
- const r = ne(e, t);
860
+ function Oe(t, e) {
861
+ const r = ne(t, e);
641
862
  if (r.length === 0) return null;
642
- const o = r.find((i) => {
643
- const c = i.tagName.toLowerCase();
644
- return Ce.has(c) && c !== "main";
863
+ const n = r.find((c) => {
864
+ const a = c.tagName.toLowerCase();
865
+ return Le.has(a) && a !== "main";
645
866
  });
646
- if (o) return o;
647
- const l = r.find((i) => i.tagName.toLowerCase() === "main");
867
+ if (n) return n;
868
+ const l = r.find((c) => c.tagName.toLowerCase() === "main");
648
869
  if (l) return l;
649
- const a = t.body.scrollHeight || 1;
650
- for (let i = r.length - 1; i >= 0; i--) {
651
- const c = r[i].getBoundingClientRect();
652
- if (c.height > 0 && c.height < a * 0.8) return r[i];
870
+ const p = e.body.scrollHeight || 1;
871
+ for (let c = r.length - 1; c >= 0; c--) {
872
+ const a = r[c].getBoundingClientRect();
873
+ if (a.height > 0 && a.height < p * 0.8) return r[c];
653
874
  }
654
875
  return r[r.length - 1];
655
876
  }
656
- function Te(e, t) {
657
- const r = ne(e, t);
658
- for (const o of r) {
659
- if (Ee.has(o.tagName.toLowerCase())) return o;
660
- const l = o.getBoundingClientRect(), a = o.children.length > 0 || (o.textContent ?? "").trim().length > 0;
661
- if (l.width >= 40 && l.height >= 24 && a) return o;
877
+ function Re(t, e) {
878
+ const r = ne(t, e);
879
+ for (const n of r) {
880
+ if (Ie.has(n.tagName.toLowerCase())) return n;
881
+ const l = n.getBoundingClientRect(), p = n.children.length > 0 || (n.textContent ?? "").trim().length > 0;
882
+ if (l.width >= 40 && l.height >= 24 && p) return n;
662
883
  }
663
884
  return r[0] ?? null;
664
885
  }
665
- function Le(e, t, r) {
666
- return r === "all" ? t.body : r === "section" ? Se(e, t) : Te(e, t);
886
+ function $e(t, e, r) {
887
+ return r === "all" ? e.body : r === "section" ? Oe(t, e) : Re(t, e);
667
888
  }
668
- function Me(e) {
669
- const r = e.querySelector("h1, h2, h3, h4, h5, h6")?.textContent?.trim();
670
- if (r) return B(r);
671
- const o = e.getAttribute("aria-label");
672
- if (o) return B(o);
673
- const l = e.getAttribute("alt");
674
- if (l) return B(l);
675
- const a = (e.textContent ?? "").trim().replace(/\s+/g, " ");
676
- return a ? B(a) : `<${e.tagName.toLowerCase()}>`;
889
+ function je(t) {
890
+ const r = t.querySelector("h1, h2, h3, h4, h5, h6")?.textContent?.trim();
891
+ if (r) return A(r);
892
+ const n = t.getAttribute("aria-label");
893
+ if (n) return A(n);
894
+ const l = t.getAttribute("alt");
895
+ if (l) return A(l);
896
+ const p = (t.textContent ?? "").trim().replace(/\s+/g, " ");
897
+ return p ? A(p) : `<${t.tagName.toLowerCase()}>`;
677
898
  }
678
- function B(e, t = 30) {
679
- return e.length > t ? `${e.slice(0, t)}…` : e;
899
+ function A(t, e = 30) {
900
+ return t.length > e ? `${t.slice(0, e)}…` : t;
680
901
  }
681
- function Pe(e, t) {
682
- if (e.id) return `#${CSS.escape(e.id)}`;
902
+ function De(t, e) {
903
+ if (t.id) return `#${CSS.escape(t.id)}`;
683
904
  const r = [];
684
- let o = e;
685
- for (; o && o !== t.body && r.length < 8; ) {
686
- if (o.id)
687
- return r.unshift(`#${CSS.escape(o.id)}`), r.join(" > ");
688
- const l = o.tagName.toLowerCase(), a = o.parentElement;
689
- let i = l;
690
- if (a) {
691
- const c = Array.from(a.children).filter(
692
- (h) => h.tagName === o.tagName
905
+ let n = t;
906
+ for (; n && n !== e.body && r.length < 8; ) {
907
+ if (n.id)
908
+ return r.unshift(`#${CSS.escape(n.id)}`), r.join(" > ");
909
+ const l = n.tagName.toLowerCase(), p = n.parentElement;
910
+ let c = l;
911
+ if (p) {
912
+ const a = Array.from(p.children).filter(
913
+ (u) => u.tagName === n.tagName
693
914
  );
694
- c.length > 1 && (i += `:nth-of-type(${c.indexOf(o) + 1})`);
915
+ a.length > 1 && (c += `:nth-of-type(${a.indexOf(n) + 1})`);
695
916
  }
696
- r.unshift(i), o = a;
917
+ r.unshift(c), n = p;
697
918
  }
698
919
  return r.join(" > ");
699
920
  }
700
- function K(e, t, r) {
701
- const o = e.createElement("div");
702
- o.setAttribute("data-pubuilder", "highlight"), Object.assign(o.style, {
921
+ function X(t, e, r) {
922
+ const n = t.createElement("div");
923
+ n.setAttribute("data-pubuilder", "highlight"), Object.assign(n.style, {
703
924
  position: "fixed",
704
925
  top: "0",
705
926
  left: "0",
706
927
  display: "none",
707
- border: `1px solid ${t}`,
928
+ border: `1px solid ${e}`,
708
929
  background: r,
709
930
  borderRadius: "0",
710
931
  pointerEvents: "none",
711
932
  zIndex: "2147483647",
712
933
  boxSizing: "border-box"
713
934
  });
714
- const l = e.createElement("div");
935
+ const l = t.createElement("div");
715
936
  return Object.assign(l.style, {
716
937
  position: "absolute",
717
938
  left: "-1px",
718
939
  top: "-22px",
719
940
  padding: "2px 7px",
720
- background: t,
941
+ background: e,
721
942
  color: "#fff",
722
943
  font: "600 10px/16px system-ui, sans-serif",
723
944
  borderRadius: "0",
724
945
  whiteSpace: "nowrap",
725
946
  pointerEvents: "none"
726
- }), o.appendChild(l), { root: o, label: l };
947
+ }), n.appendChild(l), { root: n, label: l };
727
948
  }
728
- function Z(e, t, r, o) {
729
- const l = t.getBoundingClientRect(), a = o ?? -1 / 0, i = Math.max(l.top, a), c = l.bottom - i;
730
- if (c <= 2) {
731
- W(e);
949
+ function Z(t, e, r, n) {
950
+ const l = e.getBoundingClientRect(), p = n ?? -1 / 0, c = Math.max(l.top, p), a = l.bottom - c;
951
+ if (a <= 2) {
952
+ G(t);
732
953
  return;
733
954
  }
734
- e.root.style.display = "block", e.root.style.transform = `translate(${l.x}px, ${i}px)`, e.root.style.width = `${l.width}px`, e.root.style.height = `${c}px`, e.label.textContent = r, e.label.style.top = i < 30 || i - 24 < a ? "2px" : "-24px";
955
+ t.root.style.display = "block", t.root.style.transform = `translate(${l.x}px, ${c}px)`, t.root.style.width = `${l.width}px`, t.root.style.height = `${a}px`, t.label.textContent = r, t.label.style.top = c < 30 || c - 24 < p ? "2px" : "-24px";
735
956
  }
736
- function W(e) {
737
- e.root.style.display = "none";
957
+ function G(t) {
958
+ t.root.style.display = "none";
738
959
  }
739
- function Q(e) {
740
- const t = e.getBoundingClientRect();
741
- return `${e.tagName.toLowerCase()} · ${Math.round(t.width)}×${Math.round(t.height)}`;
960
+ function Q(t) {
961
+ const e = t.getBoundingClientRect();
962
+ return `${t.tagName.toLowerCase()} · ${Math.round(e.width)}×${Math.round(e.height)}`;
742
963
  }
743
- function Oe(e, t) {
964
+ function Ae(t, e) {
744
965
  let r = null;
745
966
  try {
746
- r = e.contentDocument;
967
+ r = t.contentDocument;
747
968
  } catch {
748
969
  return null;
749
970
  }
750
- const o = e.contentWindow;
751
- if (!r || !r.body || !o) return null;
971
+ const n = t.contentWindow;
972
+ if (!r || !r.body || !n) return null;
752
973
  const l = r;
753
- let a = t.granularity, i = t.enabled, c = null, h = null;
754
- const u = K(l, "rgba(14,99,156,0.95)", "rgba(14,99,156,0.10)"), w = K(l, "rgba(35,134,54,0.95)", "rgba(35,134,54,0.07)");
755
- l.body.appendChild(u.root), l.body.appendChild(w.root);
756
- let f = [], v = 0;
757
- const N = () => {
758
- f = [];
759
- for (const p of Array.from(l.body.querySelectorAll("*"))) {
760
- if (p === u.root || p === w.root || u.root.contains(p) || w.root.contains(p)) continue;
761
- const k = o.getComputedStyle(p).position;
762
- if (k !== "fixed" && k !== "sticky") continue;
763
- const m = p.getBoundingClientRect();
764
- m.width === 0 || m.height === 0 || m.top <= 1 && m.height < o.innerHeight * 0.5 && f.push({ el: p, rect: m });
974
+ let p = e.granularity, c = e.enabled, a = null, u = null;
975
+ const g = X(l, "rgba(14,99,156,0.95)", "rgba(14,99,156,0.10)"), b = X(l, "rgba(35,134,54,0.95)", "rgba(35,134,54,0.07)");
976
+ l.body.appendChild(g.root), l.body.appendChild(b.root);
977
+ let d = [], v = 0;
978
+ const f = () => {
979
+ d = [];
980
+ for (const h of Array.from(l.body.querySelectorAll("*"))) {
981
+ if (h === g.root || h === b.root || g.root.contains(h) || b.root.contains(h)) continue;
982
+ const _ = n.getComputedStyle(h).position;
983
+ if (_ !== "fixed" && _ !== "sticky") continue;
984
+ const k = h.getBoundingClientRect();
985
+ k.width === 0 || k.height === 0 || k.top <= 1 && k.height < n.innerHeight * 0.5 && d.push({ el: h, rect: k });
765
986
  }
766
- }, g = () => {
767
- const p = Date.now();
768
- p - v < 500 || (v = p, N());
769
- }, E = (p) => {
770
- const k = p.getBoundingClientRect();
771
- let m = null;
772
- for (const z of f)
773
- z.el === p || z.el.contains(p) || p.contains(z.el) || !(k.left < z.rect.right && k.right > z.rect.left) || (m === null || z.rect.bottom > m) && (m = z.rect.bottom);
774
- return m;
775
- }, S = () => {
776
- c && i && c.isConnected ? Z(u, c, Q(c), E(c)) : W(u), h && h.isConnected ? Z(w, h, `선택됨 · ${Q(h)}`, E(h)) : W(w);
777
- }, L = (p) => {
778
- if (a === "all") return l.body;
779
- if (h && h.isConnected && h.contains(p)) {
780
- if (h === p) return h;
781
- let k = p;
782
- for (; k.parentElement && k.parentElement !== h; )
783
- k = k.parentElement;
784
- return k;
987
+ }, C = () => {
988
+ const h = Date.now();
989
+ h - v < 500 || (v = h, f());
990
+ }, P = (h) => {
991
+ const _ = h.getBoundingClientRect();
992
+ let k = null;
993
+ for (const S of d)
994
+ S.el === h || S.el.contains(h) || h.contains(S.el) || !(_.left < S.rect.right && _.right > S.rect.left) || (k === null || S.rect.bottom > k) && (k = S.rect.bottom);
995
+ return k;
996
+ }, E = () => {
997
+ a && c && a.isConnected ? Z(g, a, Q(a), P(a)) : G(g), u && u.isConnected ? Z(b, u, `선택됨 · ${Q(u)}`, P(u)) : G(b);
998
+ }, T = (h) => {
999
+ if (p === "all") return l.body;
1000
+ if (u && u.isConnected && u.contains(h)) {
1001
+ if (u === h) return u;
1002
+ let _ = h;
1003
+ for (; _.parentElement && _.parentElement !== u; )
1004
+ _ = _.parentElement;
1005
+ return _;
785
1006
  }
786
- return Le(p, l, a);
787
- }, I = (p) => {
788
- if (!i) return;
789
- g();
790
- const k = p.target;
791
- if (!k || !l.body.contains(k)) return;
792
- const m = L(k);
793
- m !== c && (c = m, S());
794
- }, M = (p) => {
795
- if (!i) return;
796
- p.preventDefault(), p.stopPropagation(), N(), v = Date.now();
797
- const k = p.target;
1007
+ return $e(h, l, p);
1008
+ }, I = (h) => {
1009
+ if (!c) return;
1010
+ C();
1011
+ const _ = h.target;
1012
+ if (!_ || !l.body.contains(_)) return;
1013
+ const k = T(_);
1014
+ k !== a && (a = k, E());
1015
+ }, i = (h) => {
1016
+ if (!c) return;
1017
+ h.preventDefault(), h.stopPropagation(), f(), v = Date.now();
1018
+ const _ = h.target;
1019
+ if (!_) return;
1020
+ const k = T(_);
798
1021
  if (!k) return;
799
- const m = L(k);
800
- if (!m) return;
801
- h = m, S();
802
- const z = m.getBoundingClientRect();
803
- t.onSelect(
1022
+ u = k, E();
1023
+ const S = k.getBoundingClientRect();
1024
+ e.onSelect(
804
1025
  {
805
- pagePath: t.pagePath,
806
- selector: Pe(m, l),
807
- tag: m.tagName.toLowerCase(),
808
- label: Me(m),
1026
+ pagePath: e.pagePath,
1027
+ selector: De(k, l),
1028
+ tag: k.tagName.toLowerCase(),
1029
+ label: je(k),
809
1030
  rect: {
810
- x: z.x + o.scrollX,
811
- y: z.y + o.scrollY,
812
- width: z.width,
813
- height: z.height
1031
+ x: S.x + n.scrollX,
1032
+ y: S.y + n.scrollY,
1033
+ width: S.width,
1034
+ height: S.height
814
1035
  },
815
- granularity: a
1036
+ granularity: p
816
1037
  },
817
- m
1038
+ k
818
1039
  );
819
- }, T = () => {
820
- c = null, S();
821
- }, O = () => S(), P = () => {
822
- N(), S();
1040
+ }, w = () => {
1041
+ a = null, E();
1042
+ }, O = () => E(), z = () => {
1043
+ f(), E();
823
1044
  };
824
- return N(), l.addEventListener("mousemove", I, !0), l.addEventListener("click", M, !0), l.documentElement.addEventListener("mouseleave", T), o.addEventListener("scroll", O, !0), o.addEventListener("resize", P), {
1045
+ return f(), l.addEventListener("mousemove", I, !0), l.addEventListener("click", i, !0), l.documentElement.addEventListener("mouseleave", w), n.addEventListener("scroll", O, !0), n.addEventListener("resize", z), {
825
1046
  destroy() {
826
1047
  try {
827
- l.removeEventListener("mousemove", I, !0), l.removeEventListener("click", M, !0), l.documentElement.removeEventListener("mouseleave", T), o.removeEventListener("scroll", O, !0), o.removeEventListener("resize", P), u.root.remove(), w.root.remove();
1048
+ l.removeEventListener("mousemove", I, !0), l.removeEventListener("click", i, !0), l.documentElement.removeEventListener("mouseleave", w), n.removeEventListener("scroll", O, !0), n.removeEventListener("resize", z), g.root.remove(), b.root.remove();
828
1049
  } catch {
829
1050
  }
830
1051
  },
831
- setGranularity(p) {
832
- a = p, c = null, S();
1052
+ setGranularity(h) {
1053
+ p = h, a = null, E();
833
1054
  },
834
- setEnabled(p) {
835
- i = p, p || (c = null), S();
1055
+ setEnabled(h) {
1056
+ c = h, h || (a = null), E();
836
1057
  }
837
1058
  };
838
1059
  }
839
- const Re = {
1060
+ const Be = {
840
1061
  log: "💬",
841
1062
  tool: "🔧",
842
1063
  error: "⛔",
843
1064
  done: "✅"
844
- };
845
- function Ie() {
846
- const e = te(Y), t = y((s) => s.selection), r = y((s) => s.selectedOuterHTML), o = y((s) => s.toggleSkillDrawer), [l, a] = _(""), [i, c] = _("idle"), [h, u] = _(null), [w, f] = _([]), [v, N] = _(!1), [g, E] = _(!1), [S, L] = _(null), [I, M] = _(null), [T, O] = _(!1), [P, p] = _(!1), k = D(null), m = D(null), z = D(0);
847
- R(() => {
848
- z.current++, m.current?.(), m.current = null, c("idle"), u(null), f([]), N(!1), E(!1), O(!1), L(null), M(null), a("");
849
- }, [t?.selector]), R(() => {
850
- const s = k.current;
851
- s && (s.scrollTop = s.scrollHeight);
852
- }, [w]), R(() => () => {
853
- z.current++, m.current?.(), m.current = null;
854
- }, []);
855
- const A = (s) => {
856
- m.current = e.subscribePublish(s, (C) => {
857
- f(($) => [...$, C]), C.type === "done" ? (c("done"), u(null), O(!1), m.current?.(), m.current = null) : C.type === "error" && (c("error"), L(C.text), u(null), O(!1), m.current?.(), m.current = null);
1065
+ }, R = /* @__PURE__ */ new Map();
1066
+ function He() {
1067
+ const t = H(j), e = y((i) => i.selection), r = y((i) => i.selectedOuterHTML), n = y((i) => i.toggleSkillDrawer), l = y((i) => i.patchPublishJob), p = y((i) => i.appendPublishEvent), c = e ? we(e) : null, a = y((i) => c ? i.publishJobs[c] : void 0) ?? q, [u, g] = N(!1), b = $(null);
1068
+ L(() => {
1069
+ const i = b.current;
1070
+ i && (i.scrollTop = i.scrollHeight);
1071
+ }, [a.events]);
1072
+ const d = (i, w) => {
1073
+ R.get(i)?.();
1074
+ const O = t.subscribePublish(w, (z) => {
1075
+ p(i, z), z.type === "done" ? (l(i, { status: "done", jobId: null, cancelling: !1 }), R.get(i)?.(), R.delete(i)) : z.type === "error" && (l(i, { status: "error", errorMessage: z.text, jobId: null, cancelling: !1 }), R.get(i)?.(), R.delete(i));
858
1076
  });
859
- }, F = async () => {
860
- if (!t || i === "running" || g) return;
861
- const s = z.current;
862
- N(!1), L(null), M(null), E(!0);
863
- try {
864
- const C = await e.isAlive();
865
- if (s !== z.current) return;
866
- if (!C) {
867
- N(!0);
868
- return;
1077
+ R.set(i, O);
1078
+ }, v = async () => {
1079
+ if (!(!c || !e || a.status === "running" || a.checking)) {
1080
+ l(c, { serverDown: !1, errorMessage: null, errorCode: null, checking: !0 });
1081
+ try {
1082
+ if (!await t.isAlive()) {
1083
+ l(c, { serverDown: !0 });
1084
+ return;
1085
+ }
1086
+ const { jobId: w } = await t.startPublish({
1087
+ selection: e,
1088
+ outerHTML: r ?? "",
1089
+ figmaUrl: a.figmaUrl
1090
+ });
1091
+ l(c, { jobId: w, status: "running", events: [] }), d(c, w);
1092
+ } catch (i) {
1093
+ l(c, {
1094
+ status: "error",
1095
+ errorMessage: i instanceof Error ? i.message : String(i),
1096
+ errorCode: i instanceof F ? i.code ?? null : null
1097
+ });
1098
+ } finally {
1099
+ l(c, { checking: !1 });
869
1100
  }
870
- const { jobId: $ } = await e.startPublish({
871
- selection: t,
872
- outerHTML: r ?? "",
873
- figmaUrl: l
874
- });
875
- if (s !== z.current) {
876
- e.cancelPublish($).catch(() => {
1101
+ }
1102
+ }, f = async () => {
1103
+ if (!(!c || !a.jobId || a.cancelling)) {
1104
+ l(c, { cancelling: !0 });
1105
+ try {
1106
+ await t.cancelPublish(a.jobId);
1107
+ } catch (i) {
1108
+ l(c, {
1109
+ errorMessage: i instanceof Error ? i.message : String(i),
1110
+ cancelling: !1
877
1111
  });
878
- return;
879
1112
  }
880
- u($), f([]), c("running"), A($);
881
- } catch (C) {
882
- if (s !== z.current) return;
883
- c("error"), L(C instanceof Error ? C.message : String(C)), M(C instanceof oe ? C.code ?? null : null);
884
- } finally {
885
- E(!1);
886
1113
  }
887
- }, U = async () => {
888
- if (!(!h || T)) {
889
- O(!0);
1114
+ }, C = async () => {
1115
+ const i = a.reply.trim();
1116
+ if (!(!c || !e || !i || a.checking || a.status === "running")) {
1117
+ l(c, { checking: !0, errorMessage: null });
890
1118
  try {
891
- await e.cancelPublish(h);
892
- } catch (s) {
893
- L(s instanceof Error ? s.message : String(s)), O(!1);
1119
+ const { jobId: w } = await t.startPublish({
1120
+ selection: e,
1121
+ outerHTML: r ?? "",
1122
+ figmaUrl: a.figmaUrl,
1123
+ instruction: i
1124
+ });
1125
+ p(c, { type: "log", text: `내 답변: ${i}` }), l(c, { reply: "", jobId: w, status: "running" }), d(c, w);
1126
+ } catch (w) {
1127
+ l(c, {
1128
+ status: "error",
1129
+ errorMessage: w instanceof Error ? w.message : String(w),
1130
+ errorCode: w instanceof F ? w.code ?? null : null
1131
+ });
1132
+ } finally {
1133
+ l(c, { checking: !1 });
894
1134
  }
895
1135
  }
896
- }, q = async () => {
897
- await navigator.clipboard.writeText("npx pubuilder serve"), p(!0), setTimeout(() => p(!1), 1200);
898
- }, H = async () => {
899
- E(!0);
900
- try {
901
- const s = await e.isAlive();
902
- N(!s);
903
- } finally {
904
- E(!1);
1136
+ }, P = async () => {
1137
+ await navigator.clipboard.writeText("npx pubuilder serve"), g(!0), setTimeout(() => g(!1), 1200);
1138
+ }, E = async () => {
1139
+ if (c) {
1140
+ l(c, { checking: !0 });
1141
+ try {
1142
+ const i = await t.isAlive();
1143
+ l(c, { serverDown: !i });
1144
+ } finally {
1145
+ l(c, { checking: !1 });
1146
+ }
905
1147
  }
906
- }, b = i === "running";
907
- return /* @__PURE__ */ d("div", { className: "pbu-publish", children: [
908
- /* @__PURE__ */ n("label", { children: "Figma 노드 링크" }),
909
- /* @__PURE__ */ n(
1148
+ }, T = a.status === "running", I = a.errorCode === "NO_FIGMA_TOKEN" || a.errorCode === "FIGMA_API_ERROR";
1149
+ return /* @__PURE__ */ s("div", { className: "pbu-publish", children: [
1150
+ /* @__PURE__ */ s("div", { className: "pbu-publish-heading", children: [
1151
+ /* @__PURE__ */ o("label", { htmlFor: "pbu-figma-url", children: "Figma 노드 링크" }),
1152
+ /* @__PURE__ */ o("button", { type: "button", className: "pbu-btn pbu-skill-entry", onClick: n, children: "🧰 스킬함 · 설정" })
1153
+ ] }),
1154
+ /* @__PURE__ */ o(
910
1155
  "input",
911
1156
  {
912
- value: l,
913
- onChange: (s) => a(s.target.value),
914
- disabled: b,
1157
+ id: "pbu-figma-url",
1158
+ value: a.figmaUrl,
1159
+ onChange: (i) => c && l(c, { figmaUrl: i.target.value }),
1160
+ disabled: T,
915
1161
  placeholder: "https://www.figma.com/design/..."
916
1162
  }
917
1163
  ),
918
- v && /* @__PURE__ */ d("div", { className: "pbu-panel-empty", children: [
1164
+ a.serverDown && /* @__PURE__ */ s("div", { className: "pbu-panel-empty", children: [
919
1165
  "컴패니언 서버가 꺼져 있어요",
920
- /* @__PURE__ */ d("div", { className: "pbu-drawer-code", children: [
921
- /* @__PURE__ */ n("code", { children: "npx pubuilder serve" }),
922
- /* @__PURE__ */ n("button", { type: "button", className: "pbu-btn", onClick: q, children: P ? "복사됨 ✓" : "복사" })
1166
+ /* @__PURE__ */ s("div", { className: "pbu-drawer-code", children: [
1167
+ /* @__PURE__ */ o("code", { children: "npx pubuilder serve" }),
1168
+ /* @__PURE__ */ o("button", { type: "button", className: "pbu-btn", onClick: P, children: u ? "복사됨 ✓" : "복사" })
923
1169
  ] }),
924
- /* @__PURE__ */ n("div", { className: "pbu-hint", children: 'package.json의 dev 스크립트를 "pubuilder dev -- <기존 명령>"으로 감싸면 자동 실행돼요' }),
925
- /* @__PURE__ */ n("button", { type: "button", className: "pbu-btn", disabled: g, onClick: H, children: "다시 확인" })
1170
+ /* @__PURE__ */ o("div", { className: "pbu-hint", children: 'package.json의 dev 스크립트를 "pubuilder dev -- <기존 명령>"으로 감싸면 자동 실행돼요' }),
1171
+ /* @__PURE__ */ o("button", { type: "button", className: "pbu-btn", disabled: a.checking, onClick: E, children: "다시 확인" })
926
1172
  ] }),
927
- S && !v && /* @__PURE__ */ d("div", { className: "pbu-drawer-error", children: [
928
- /* @__PURE__ */ n("span", { children: S }),
929
- (I === "NO_FIGMA_TOKEN" || I === "FIGMA_API_ERROR") && /* @__PURE__ */ n("button", { type: "button", className: "pbu-btn", onClick: o, children: "스킬함 열기" })
1173
+ a.errorMessage && !a.serverDown && /* @__PURE__ */ s("div", { className: "pbu-drawer-error", children: [
1174
+ /* @__PURE__ */ o("span", { children: a.errorMessage }),
1175
+ I && /* @__PURE__ */ o("button", { type: "button", className: "pbu-btn", onClick: n, children: "스킬함 열기" })
930
1176
  ] }),
931
- b ? /* @__PURE__ */ n("button", { type: "button", className: "pbu-btn pbu-btn-primary", disabled: T, onClick: U, children: T ? "중단 중..." : "중단" }) : /* @__PURE__ */ n(
1177
+ T ? /* @__PURE__ */ o("button", { type: "button", className: "pbu-btn pbu-btn-primary", disabled: a.cancelling, onClick: f, children: a.cancelling ? "중단 중..." : "중단" }) : /* @__PURE__ */ o(
932
1178
  "button",
933
1179
  {
934
1180
  type: "button",
935
1181
  className: "pbu-btn pbu-btn-primary",
936
- disabled: g || !t,
937
- onClick: F,
1182
+ disabled: a.checking || !e,
1183
+ onClick: v,
938
1184
  children: "이 블록 퍼블리싱"
939
1185
  }
940
1186
  ),
941
- (w.length > 0 || b) && /* @__PURE__ */ d("div", { className: "pbu-publish-log", ref: k, children: [
942
- b && w.length === 0 && /* @__PURE__ */ n("div", { className: "pbu-log-line pbu-log-tool", children: "실행 중..." }),
943
- w.map((s, C) => /* @__PURE__ */ d(
1187
+ (a.events.length > 0 || T) && /* @__PURE__ */ s("div", { className: "pbu-publish-log", ref: b, children: [
1188
+ T && a.events.length === 0 && /* @__PURE__ */ o("div", { className: "pbu-log-line pbu-log-tool", children: "실행 중..." }),
1189
+ a.events.map((i, w) => /* @__PURE__ */ s(
944
1190
  "div",
945
1191
  {
946
- className: s.type === "error" ? "pbu-log-line pbu-log-error" : s.type === "done" ? "pbu-log-line pbu-log-done" : s.type === "tool" ? "pbu-log-line pbu-log-tool" : "pbu-log-line",
1192
+ className: i.type === "error" ? "pbu-log-line pbu-log-error" : i.type === "done" ? "pbu-log-line pbu-log-done" : i.type === "tool" ? "pbu-log-line pbu-log-tool" : "pbu-log-line",
947
1193
  children: [
948
- /* @__PURE__ */ n("span", { children: Re[s.type] }),
1194
+ /* @__PURE__ */ o("span", { children: Be[i.type] }),
949
1195
  " ",
950
- /* @__PURE__ */ n("span", { children: s.text })
1196
+ /* @__PURE__ */ o("span", { children: i.text })
951
1197
  ]
952
1198
  },
953
- C
1199
+ w
954
1200
  ))
1201
+ ] }),
1202
+ a.status === "done" && /* @__PURE__ */ s("div", { className: "pbu-publish-reply", children: [
1203
+ /* @__PURE__ */ o("label", { htmlFor: "pbu-publish-reply", children: "AI에게 이어서 답하기" }),
1204
+ /* @__PURE__ */ o(
1205
+ "textarea",
1206
+ {
1207
+ id: "pbu-publish-reply",
1208
+ value: a.reply,
1209
+ onChange: (i) => c && l(c, { reply: i.target.value }),
1210
+ onKeyDown: (i) => {
1211
+ (i.metaKey || i.ctrlKey) && i.key === "Enter" && C();
1212
+ },
1213
+ placeholder: "예: B 방향으로 진행해줘. 공지와 알림은 유지해.",
1214
+ rows: 3
1215
+ }
1216
+ ),
1217
+ /* @__PURE__ */ s("div", { className: "pbu-publish-reply-actions", children: [
1218
+ /* @__PURE__ */ o("span", { children: "⌘/Ctrl + Enter" }),
1219
+ /* @__PURE__ */ o(
1220
+ "button",
1221
+ {
1222
+ type: "button",
1223
+ className: "pbu-btn pbu-btn-primary",
1224
+ disabled: a.checking || !a.reply.trim(),
1225
+ onClick: C,
1226
+ children: a.checking ? "전송 중..." : "답변 전송"
1227
+ }
1228
+ )
1229
+ ] })
955
1230
  ] })
956
1231
  ] });
957
1232
  }
958
- function De() {
959
- const e = y((l) => l.selection), [t, r] = _(!1), o = async () => {
960
- e && (await navigator.clipboard.writeText(e.selector), r(!0), setTimeout(() => r(!1), 1200));
1233
+ function Ue() {
1234
+ const t = y((l) => l.selection), [e, r] = N(!1), n = async () => {
1235
+ t && (await navigator.clipboard.writeText(t.selector), r(!0), setTimeout(() => r(!1), 1200));
961
1236
  };
962
- return /* @__PURE__ */ d("aside", { className: "pbu-panel", children: [
963
- /* @__PURE__ */ n("div", { className: "pbu-panel-title", children: "선택된 블록" }),
964
- e ? /* @__PURE__ */ d(ee, { children: [
965
- /* @__PURE__ */ d("div", { className: "pbu-field", children: [
966
- /* @__PURE__ */ n("label", { children: "페이지" }),
967
- /* @__PURE__ */ n("code", { children: e.pagePath })
1237
+ return /* @__PURE__ */ s("aside", { className: "pbu-panel", children: [
1238
+ /* @__PURE__ */ o("div", { className: "pbu-panel-title", children: "선택된 블록" }),
1239
+ t ? /* @__PURE__ */ s(ee, { children: [
1240
+ /* @__PURE__ */ s("div", { className: "pbu-field", children: [
1241
+ /* @__PURE__ */ o("label", { children: "페이지" }),
1242
+ /* @__PURE__ */ o("code", { children: t.pagePath })
968
1243
  ] }),
969
- /* @__PURE__ */ d("div", { className: "pbu-field", children: [
970
- /* @__PURE__ */ n("label", { children: "블록" }),
971
- /* @__PURE__ */ d("div", { children: [
972
- /* @__PURE__ */ n("span", { className: "pbu-chip", children: e.tag }),
973
- /* @__PURE__ */ n("span", { children: e.label })
1244
+ /* @__PURE__ */ s("div", { className: "pbu-field", children: [
1245
+ /* @__PURE__ */ o("label", { children: "블록" }),
1246
+ /* @__PURE__ */ s("div", { children: [
1247
+ /* @__PURE__ */ o("span", { className: "pbu-chip", children: t.tag }),
1248
+ /* @__PURE__ */ o("span", { children: t.label })
974
1249
  ] })
975
1250
  ] }),
976
- /* @__PURE__ */ d("div", { className: "pbu-field", children: [
977
- /* @__PURE__ */ n("label", { children: "Selector" }),
978
- /* @__PURE__ */ n("code", { className: "pbu-selector", children: e.selector }),
979
- /* @__PURE__ */ n("button", { type: "button", className: "pbu-btn", onClick: o, children: t ? "복사됨 ✓" : "Selector 복사" })
1251
+ /* @__PURE__ */ s("div", { className: "pbu-field", children: [
1252
+ /* @__PURE__ */ o("label", { children: "Selector" }),
1253
+ /* @__PURE__ */ o("code", { className: "pbu-selector", children: t.selector }),
1254
+ /* @__PURE__ */ o("button", { type: "button", className: "pbu-btn", onClick: n, children: e ? "복사됨 ✓" : "Selector 복사" })
980
1255
  ] }),
981
- /* @__PURE__ */ d("div", { className: "pbu-field", children: [
982
- /* @__PURE__ */ n("label", { children: "크기" }),
983
- /* @__PURE__ */ d("span", { children: [
984
- Math.round(e.rect.width),
1256
+ /* @__PURE__ */ s("div", { className: "pbu-field", children: [
1257
+ /* @__PURE__ */ o("label", { children: "크기" }),
1258
+ /* @__PURE__ */ s("span", { children: [
1259
+ Math.round(t.rect.width),
985
1260
  " × ",
986
- Math.round(e.rect.height),
1261
+ Math.round(t.rect.height),
987
1262
  "px"
988
1263
  ] })
989
1264
  ] }),
990
- /* @__PURE__ */ d("div", { className: "pbu-field", children: [
991
- /* @__PURE__ */ n("label", { children: "단위" }),
992
- /* @__PURE__ */ n("span", { children: e.granularity === "all" ? "전체" : e.granularity === "section" ? "섹션" : "유닛" })
1265
+ /* @__PURE__ */ s("div", { className: "pbu-field", children: [
1266
+ /* @__PURE__ */ o("label", { children: "단위" }),
1267
+ /* @__PURE__ */ o("span", { children: t.granularity === "all" ? "전체" : t.granularity === "section" ? "섹션" : "유닛" })
993
1268
  ] }),
994
- /* @__PURE__ */ n(Ie, {})
995
- ] }) : /* @__PURE__ */ d("div", { className: "pbu-panel-empty", children: [
1269
+ /* @__PURE__ */ o(He, {})
1270
+ ] }) : /* @__PURE__ */ s("div", { className: "pbu-panel-empty", children: [
996
1271
  "화면에서 블록에 마우스를 올리고 클릭해 선택하세요.",
997
- /* @__PURE__ */ n("br", {}),
1272
+ /* @__PURE__ */ o("br", {}),
998
1273
  "상단 토글로 ",
999
- /* @__PURE__ */ n("b", { children: "전체 / 섹션 / 유닛" }),
1274
+ /* @__PURE__ */ o("b", { children: "전체 / 섹션 / 유닛" }),
1000
1275
  " 단위를 바꿀 수 있어요."
1001
1276
  ] })
1002
1277
  ] });
1003
1278
  }
1004
- function $e({ ia: e }) {
1005
- const t = y((g) => g.viewerPath), r = y((g) => g.closeViewer), o = y((g) => g.granularity), l = y((g) => g.setGranularity), a = y((g) => g.inspectEnabled), i = y((g) => g.setInspectEnabled), c = y((g) => g.toggleSkillDrawer), h = D(null), u = D(null), [w, f] = _(!1), v = e.nodes.find((g) => g.path === t), N = () => {
1279
+ function Je({ ia: t }) {
1280
+ const e = y((f) => f.viewerPath), r = y((f) => f.closeViewer), n = y((f) => f.granularity), l = y((f) => f.setGranularity), p = y((f) => f.inspectEnabled), c = y((f) => f.setInspectEnabled), a = $(null), u = $(null), [g, b] = N(!1), d = t.nodes.find((f) => f.path === e), v = () => {
1006
1281
  u.current?.destroy(), u.current = null;
1007
- const g = h.current;
1008
- if (!g || !t) return;
1009
- const E = y.getState(), S = Oe(g, {
1010
- pagePath: t,
1011
- granularity: E.granularity,
1012
- enabled: E.inspectEnabled,
1013
- onSelect: (L, I) => (
1282
+ const f = a.current;
1283
+ if (!f || !e) return;
1284
+ const C = y.getState(), P = Ae(f, {
1285
+ pagePath: e,
1286
+ granularity: C.granularity,
1287
+ enabled: C.inspectEnabled,
1288
+ onSelect: (E, T) => (
1014
1289
  // 20K 상한 — 프롬프트 비대화 방지
1015
- y.getState().setSelectionWithHTML(L, I.outerHTML.slice(0, 2e4))
1290
+ y.getState().setSelectionWithHTML(E, T.outerHTML.slice(0, 2e4))
1016
1291
  )
1017
1292
  });
1018
- if (!S) {
1019
- f(!0);
1293
+ if (!P) {
1294
+ b(!0);
1020
1295
  return;
1021
1296
  }
1022
- f(!1), u.current = S;
1297
+ b(!1), u.current = P;
1023
1298
  };
1024
- return R(() => () => u.current?.destroy(), []), R(() => {
1025
- u.current?.setGranularity(o);
1026
- }, [o]), R(() => {
1027
- u.current?.setEnabled(a);
1028
- }, [a]), R(() => {
1029
- const g = (E) => {
1030
- E.key === "Escape" && (y.getState().skillDrawerOpen || r());
1299
+ return L(() => () => u.current?.destroy(), []), L(() => {
1300
+ u.current?.setGranularity(n);
1301
+ }, [n]), L(() => {
1302
+ u.current?.setEnabled(p);
1303
+ }, [p]), L(() => {
1304
+ const f = (C) => {
1305
+ C.key === "Escape" && (y.getState().skillDrawerOpen || r());
1031
1306
  };
1032
- return window.addEventListener("keydown", g), () => window.removeEventListener("keydown", g);
1033
- }, [r]), v ? /* @__PURE__ */ d("div", { className: "pbu-viewer", children: [
1034
- /* @__PURE__ */ d("div", { className: "pbu-bar", children: [
1035
- /* @__PURE__ */ n("button", { type: "button", className: "pbu-btn", onClick: r, children: "← 맵으로" }),
1036
- /* @__PURE__ */ d("span", { className: "pbu-viewer-title", children: [
1037
- v.title,
1038
- /* @__PURE__ */ n("code", { children: v.path })
1307
+ return window.addEventListener("keydown", f), () => window.removeEventListener("keydown", f);
1308
+ }, [r]), d ? /* @__PURE__ */ s("div", { className: "pbu-viewer", children: [
1309
+ /* @__PURE__ */ s("div", { className: "pbu-bar", children: [
1310
+ /* @__PURE__ */ o("button", { type: "button", className: "pbu-btn", onClick: r, children: "← 맵으로" }),
1311
+ /* @__PURE__ */ s("span", { className: "pbu-viewer-title", children: [
1312
+ d.title,
1313
+ /* @__PURE__ */ o("code", { children: d.path })
1039
1314
  ] }),
1040
- /* @__PURE__ */ n("span", { className: "pbu-spacer" }),
1041
- w && /* @__PURE__ */ n("span", { className: "pbu-hint", children: "⚠ 이 페이지는 검사할 수 없어요" }),
1042
- /* @__PURE__ */ d("div", { className: "pbu-seg", role: "group", "aria-label": "블록 단위", children: [
1043
- /* @__PURE__ */ n(
1315
+ /* @__PURE__ */ o("span", { className: "pbu-spacer" }),
1316
+ g && /* @__PURE__ */ o("span", { className: "pbu-hint", children: "⚠ 이 페이지는 검사할 수 없어요" }),
1317
+ /* @__PURE__ */ s("div", { className: "pbu-seg", role: "group", "aria-label": "블록 단위", children: [
1318
+ /* @__PURE__ */ o(
1044
1319
  "button",
1045
1320
  {
1046
1321
  type: "button",
1047
- className: o === "all" ? "pbu-on" : "",
1322
+ className: n === "all" ? "pbu-on" : "",
1048
1323
  onClick: () => l("all"),
1049
1324
  children: "전체"
1050
1325
  }
1051
1326
  ),
1052
- /* @__PURE__ */ n(
1327
+ /* @__PURE__ */ o(
1053
1328
  "button",
1054
1329
  {
1055
1330
  type: "button",
1056
- className: o === "section" ? "pbu-on" : "",
1331
+ className: n === "section" ? "pbu-on" : "",
1057
1332
  onClick: () => l("section"),
1058
1333
  children: "섹션"
1059
1334
  }
1060
1335
  ),
1061
- /* @__PURE__ */ n(
1336
+ /* @__PURE__ */ o(
1062
1337
  "button",
1063
1338
  {
1064
1339
  type: "button",
1065
- className: o === "unit" ? "pbu-on" : "",
1340
+ className: n === "unit" ? "pbu-on" : "",
1066
1341
  onClick: () => l("unit"),
1067
1342
  children: "유닛"
1068
1343
  }
1069
1344
  )
1070
1345
  ] }),
1071
- /* @__PURE__ */ d("label", { className: "pbu-toggle", children: [
1072
- /* @__PURE__ */ n(
1346
+ /* @__PURE__ */ s("label", { className: "pbu-toggle", children: [
1347
+ /* @__PURE__ */ o(
1073
1348
  "input",
1074
1349
  {
1075
1350
  type: "checkbox",
1076
- checked: a,
1077
- onChange: (g) => i(g.target.checked)
1351
+ checked: p,
1352
+ onChange: (f) => c(f.target.checked)
1078
1353
  }
1079
1354
  ),
1080
1355
  "검사 모드"
1081
1356
  ] }),
1082
- /* @__PURE__ */ n("button", { type: "button", className: "pbu-btn", onClick: c, children: "🧰 스킬함" }),
1083
- /* @__PURE__ */ n("button", { type: "button", className: "pbu-icon-btn", onClick: r, "aria-label": "닫기", children: "✕" })
1357
+ /* @__PURE__ */ o(te, {}),
1358
+ /* @__PURE__ */ o("button", { type: "button", className: "pbu-icon-btn", onClick: r, "aria-label": "닫기", children: "✕" })
1084
1359
  ] }),
1085
- /* @__PURE__ */ d("div", { className: "pbu-viewer-body", children: [
1086
- /* @__PURE__ */ n("div", { className: "pbu-viewer-frame-wrap", children: /* @__PURE__ */ n(
1360
+ /* @__PURE__ */ s("div", { className: "pbu-viewer-body", children: [
1361
+ /* @__PURE__ */ o("div", { className: "pbu-viewer-frame-wrap", children: /* @__PURE__ */ o(
1087
1362
  "iframe",
1088
1363
  {
1089
- ref: h,
1364
+ ref: a,
1090
1365
  className: "pbu-viewer-iframe",
1091
- src: v.path,
1092
- title: v.title,
1093
- onLoad: N
1366
+ src: d.path,
1367
+ title: d.title,
1368
+ onLoad: v
1094
1369
  }
1095
1370
  ) }),
1096
- /* @__PURE__ */ n(De, {})
1371
+ /* @__PURE__ */ o(Ue, {})
1097
1372
  ] })
1098
1373
  ] }) : null;
1099
1374
  }
1100
- const Ae = {
1375
+ const Fe = {
1101
1376
  project: "프로젝트",
1102
1377
  global: "글로벌",
1103
1378
  uploaded: "업로드"
1104
- }, He = ["project", "global", "uploaded"];
1105
- function Be() {
1106
- const e = y((b) => b.toggleSkillDrawer), t = te(Y), [r, o] = _(!0), [l, a] = _(!1), [i, c] = _([]), [h, u] = _(null), [w, f] = _(""), [v, N] = _(!1), [g, E] = _(null), [S, L] = _(!1), I = D(null), M = D(0), [T, O] = _(null), P = async () => {
1107
- const b = ++M.current;
1108
- o(!0), E(null);
1379
+ }, qe = {
1380
+ project: "현재 프로젝트에서 발견한 스킬 · 여기서는 삭제할 수 없어요",
1381
+ global: "내 전역 환경에 설치된 공용 스킬 · 여기서는 삭제할 없어요",
1382
+ uploaded: "이 스킬함에 직접 올린 Markdown 스킬 · 삭제할 수 있어요"
1383
+ }, Ge = ["project", "global", "uploaded"];
1384
+ function Ve() {
1385
+ const t = y((x) => x.toggleSkillDrawer), e = H(j), [r, n] = N(!0), [l, p] = N(!1), [c, a] = N([]), [u, g] = N(null), [b, d] = N(""), [v, f] = N(!1), [C, P] = N(null), [E, T] = N(!1), I = $(null), i = $(0), [w, O] = N(null), z = async () => {
1386
+ const x = ++i.current;
1387
+ n(!0), P(null);
1109
1388
  try {
1110
- const x = await t.isAlive();
1111
- if (b !== M.current || (a(x), !x)) return;
1112
- const [s, C] = await Promise.all([t.listSkills(), t.tokenStatus()]);
1113
- if (b !== M.current) return;
1114
- c(s), u(C), N(!C.configured);
1115
- } catch (x) {
1116
- if (b !== M.current) return;
1117
- E(x instanceof Error ? x.message : String(x));
1389
+ const m = await e.isAlive();
1390
+ if (x !== i.current || (p(m), !m)) return;
1391
+ const [M, D] = await Promise.all([e.listSkills(), e.tokenStatus()]);
1392
+ if (x !== i.current) return;
1393
+ a(M), g(D), f(!D.configured);
1394
+ } catch (m) {
1395
+ if (x !== i.current) return;
1396
+ P(m instanceof Error ? m.message : String(m));
1118
1397
  } finally {
1119
- b === M.current && o(!1);
1398
+ x === i.current && n(!1);
1120
1399
  }
1121
1400
  };
1122
- R(() => {
1123
- P();
1124
- }, []), R(() => {
1125
- const b = (x) => {
1126
- x.key === "Escape" && e();
1401
+ L(() => {
1402
+ z();
1403
+ }, []), L(() => {
1404
+ const x = (m) => {
1405
+ m.key === "Escape" && t();
1127
1406
  };
1128
- return window.addEventListener("keydown", b), () => window.removeEventListener("keydown", b);
1129
- }, [e]);
1130
- const p = async (b, x) => {
1131
- if (!T) {
1132
- O(b);
1407
+ return window.addEventListener("keydown", x), () => window.removeEventListener("keydown", x);
1408
+ }, [t]);
1409
+ const h = async (x, m) => {
1410
+ if (!w) {
1411
+ O(x);
1133
1412
  try {
1134
- await x();
1135
- } catch (s) {
1136
- E(s instanceof Error ? s.message : String(s));
1413
+ await m();
1414
+ } catch (M) {
1415
+ P(M instanceof Error ? M.message : String(M));
1137
1416
  } finally {
1138
1417
  O(null);
1139
1418
  }
1140
1419
  }
1141
- }, k = (b, x) => p(`toggle:${b}`, async () => {
1142
- await t.toggleSkill(b, x), await P();
1143
- }), m = (b, x) => {
1144
- window.confirm(`"${x}" 스킬을 삭제할까요?`) && p(`remove:${b}`, async () => {
1145
- await t.removeSkill(b), await P();
1420
+ }, _ = (x, m) => h(`toggle:${x}`, async () => {
1421
+ await e.toggleSkill(x, m), await z();
1422
+ }), k = (x, m) => {
1423
+ window.confirm(`"${m}" 스킬을 삭제할까요?`) && h(`remove:${x}`, async () => {
1424
+ await e.removeSkill(x), await z();
1146
1425
  });
1147
- }, z = () => I.current?.click(), A = (b) => {
1148
- const x = b.target.files?.[0];
1149
- b.target.value = "", x && p("upload", async () => {
1150
- const s = new FileReader(), C = await new Promise(($, le) => {
1151
- s.onload = () => $(String(s.result ?? "")), s.onerror = () => le(s.error ?? new Error("파일을 읽을 수 없어요")), s.readAsText(x);
1426
+ }, S = () => I.current?.click(), V = (x) => {
1427
+ const m = x.target.files?.[0];
1428
+ x.target.value = "", m && h("upload", async () => {
1429
+ const M = new FileReader(), D = await new Promise((ie, se) => {
1430
+ M.onload = () => ie(String(M.result ?? "")), M.onerror = () => se(M.error ?? new Error("파일을 읽을 수 없어요")), M.readAsText(m);
1152
1431
  });
1153
- await t.uploadSkill(x.name, C), await P();
1432
+ await e.uploadSkill(m.name, D), await z();
1154
1433
  });
1155
- }, F = () => p("token:save", async () => {
1156
- w.trim() && (await t.saveToken(w.trim()), f(""), await P());
1157
- }), U = () => p("token:delete", async () => {
1158
- await t.deleteToken(), f(""), await P();
1159
- }), q = async () => {
1160
- await navigator.clipboard.writeText("npx pubuilder serve"), L(!0), setTimeout(() => L(!1), 1200);
1161
- }, H = He.map((b) => ({
1162
- source: b,
1163
- label: Ae[b],
1164
- items: i.filter((x) => x.source === b)
1165
- })).filter((b) => b.items.length > 0);
1166
- return /* @__PURE__ */ d("aside", { className: "pbu-drawer", children: [
1167
- /* @__PURE__ */ d("div", { className: "pbu-drawer-header", children: [
1168
- /* @__PURE__ */ n("span", { className: "pbu-panel-title", children: "스킬함" }),
1169
- /* @__PURE__ */ n("button", { type: "button", className: "pbu-icon-btn", onClick: e, "aria-label": "닫기", children: "" })
1434
+ }, re = () => h("token:save", async () => {
1435
+ b.trim() && (await e.saveToken(b.trim()), d(""), await z());
1436
+ }), le = () => h("token:delete", async () => {
1437
+ await e.deleteToken(), d(""), await z();
1438
+ }), ae = async () => {
1439
+ await navigator.clipboard.writeText("npx pubuilder serve"), T(!0), setTimeout(() => T(!1), 1200);
1440
+ }, K = Ge.map((x) => ({
1441
+ source: x,
1442
+ label: Fe[x],
1443
+ items: c.filter((m) => m.source === x)
1444
+ })).filter((x) => x.items.length > 0), ce = c.filter((x) => x.enabled).length;
1445
+ return /* @__PURE__ */ s("aside", { className: "pbu-drawer", children: [
1446
+ /* @__PURE__ */ s("div", { className: "pbu-drawer-header", children: [
1447
+ /* @__PURE__ */ s("div", { children: [
1448
+ /* @__PURE__ */ o("span", { className: "pbu-panel-title", children: "스킬함" }),
1449
+ /* @__PURE__ */ o("span", { className: "pbu-drawer-kicker", children: "퍼블리싱 실행 설정" })
1450
+ ] }),
1451
+ /* @__PURE__ */ o("button", { type: "button", className: "pbu-icon-btn", onClick: t, "aria-label": "닫기", children: "✕" })
1170
1452
  ] }),
1171
- g && /* @__PURE__ */ d("div", { className: "pbu-drawer-error", children: [
1172
- /* @__PURE__ */ n("span", { children: g }),
1173
- /* @__PURE__ */ n("button", { type: "button", className: "pbu-icon-btn", onClick: () => E(null), "aria-label": "닫기", children: "✕" })
1453
+ /* @__PURE__ */ s("div", { className: "pbu-drawer-guide", children: [
1454
+ /* @__PURE__ */ o("strong", { children: "다음 퍼블리싱에 적용할 규칙을 고르세요." }),
1455
+ /* @__PURE__ */ o("span", { children: "체크된 스킬의 지침만 AI에게 전달됩니다. 변경 사항은 다음 실행부터 적용돼요." }),
1456
+ !r && l && /* @__PURE__ */ s("div", { className: "pbu-guide-status", children: [
1457
+ /* @__PURE__ */ o("span", { className: "pbu-status-dot pbu-status-dot-on" }),
1458
+ c.length > 0 ? `${ce}/${c.length}개 스킬 사용 중` : "사용 가능한 스킬 없음"
1459
+ ] })
1460
+ ] }),
1461
+ C && /* @__PURE__ */ s("div", { className: "pbu-drawer-error", children: [
1462
+ /* @__PURE__ */ o("span", { children: C }),
1463
+ /* @__PURE__ */ o("button", { type: "button", className: "pbu-icon-btn", onClick: () => P(null), "aria-label": "닫기", children: "✕" })
1174
1464
  ] }),
1175
- r ? /* @__PURE__ */ n("div", { className: "pbu-panel-empty", children: "불러오는 중..." }) : l ? /* @__PURE__ */ d(ee, { children: [
1176
- /* @__PURE__ */ n("div", { className: "pbu-drawer-group", children: "토큰" }),
1177
- h?.configured && !v ? /* @__PURE__ */ d("div", { className: "pbu-field", children: [
1178
- /* @__PURE__ */ n("span", { className: "pbu-token-masked", children: h.masked }),
1179
- /* @__PURE__ */ d("div", { children: [
1180
- /* @__PURE__ */ n("button", { type: "button", className: "pbu-btn", disabled: T !== null, onClick: () => N(!0), children: "재입력" }),
1181
- /* @__PURE__ */ n("button", { type: "button", className: "pbu-btn", disabled: T !== null, onClick: U, children: "삭제" })
1465
+ r ? /* @__PURE__ */ o("div", { className: "pbu-panel-empty", children: "불러오는 중..." }) : l ? /* @__PURE__ */ s(ee, { children: [
1466
+ /* @__PURE__ */ s("div", { className: "pbu-drawer-section-head", children: [
1467
+ /* @__PURE__ */ s("div", { children: [
1468
+ /* @__PURE__ */ o("strong", { children: "Figma 연결" }),
1469
+ /* @__PURE__ */ o("span", { children: "노드 링크에서 시안 이미지와 구조 정보를 읽을 때 사용해요." })
1470
+ ] }),
1471
+ /* @__PURE__ */ o("span", { className: `pbu-status-badge ${u?.configured ? "pbu-status-on" : "pbu-status-off"}`, children: u?.configured ? "연결됨" : "연결 필요" })
1472
+ ] }),
1473
+ u?.configured && !v ? /* @__PURE__ */ s("div", { className: "pbu-field", children: [
1474
+ /* @__PURE__ */ o("span", { className: "pbu-token-masked", children: u.masked }),
1475
+ /* @__PURE__ */ s("div", { children: [
1476
+ /* @__PURE__ */ o("button", { type: "button", className: "pbu-btn", disabled: w !== null, onClick: () => f(!0), children: "재입력" }),
1477
+ /* @__PURE__ */ o("button", { type: "button", className: "pbu-btn", disabled: w !== null, onClick: le, children: "삭제" })
1182
1478
  ] })
1183
- ] }) : /* @__PURE__ */ d("div", { className: "pbu-field", children: [
1184
- /* @__PURE__ */ n(
1479
+ ] }) : /* @__PURE__ */ s("div", { className: "pbu-field", children: [
1480
+ /* @__PURE__ */ o(
1185
1481
  "input",
1186
1482
  {
1187
1483
  type: "password",
1188
- value: w,
1189
- onChange: (b) => f(b.target.value),
1484
+ value: b,
1485
+ onChange: (x) => d(x.target.value),
1190
1486
  placeholder: "Figma 토큰"
1191
1487
  }
1192
1488
  ),
1193
- /* @__PURE__ */ n("button", { type: "button", className: "pbu-btn pbu-btn-primary", disabled: T !== null, onClick: F, children: "저장" })
1489
+ /* @__PURE__ */ o("button", { type: "button", className: "pbu-btn pbu-btn-primary", disabled: w !== null, onClick: re, children: "저장" })
1194
1490
  ] }),
1195
- /* @__PURE__ */ d("div", { className: "pbu-drawer-group", children: [
1196
- "스킬 목록",
1197
- /* @__PURE__ */ n("button", { type: "button", className: "pbu-btn", disabled: T !== null, onClick: z, children: "업로드" }),
1198
- /* @__PURE__ */ n(
1491
+ /* @__PURE__ */ s("div", { className: "pbu-drawer-section-head pbu-drawer-section-head-skills", children: [
1492
+ /* @__PURE__ */ s("div", { children: [
1493
+ /* @__PURE__ */ o("strong", { children: "AI 작업 스킬" }),
1494
+ /* @__PURE__ */ o("span", { children: "스킬은 AI에게 전달되는 작업 규칙이 담긴 Markdown 파일이에요." })
1495
+ ] }),
1496
+ /* @__PURE__ */ o("button", { type: "button", className: "pbu-btn", disabled: w !== null, onClick: S, children: "업로드" }),
1497
+ /* @__PURE__ */ o(
1199
1498
  "input",
1200
1499
  {
1201
1500
  ref: I,
1202
1501
  type: "file",
1203
1502
  accept: ".md",
1204
1503
  style: { display: "none" },
1205
- onChange: A
1504
+ onChange: V
1206
1505
  }
1207
1506
  )
1208
1507
  ] }),
1209
- H.length === 0 ? /* @__PURE__ */ n("div", { className: "pbu-panel-empty", children: "등록된 스킬이 없어요." }) : H.map((b) => /* @__PURE__ */ d("div", { children: [
1210
- /* @__PURE__ */ n("div", { className: "pbu-drawer-group", children: b.label }),
1211
- b.items.map((x) => /* @__PURE__ */ d("div", { className: "pbu-skill-row", children: [
1212
- /* @__PURE__ */ d("label", { className: "pbu-toggle", children: [
1213
- /* @__PURE__ */ n(
1508
+ K.length === 0 ? /* @__PURE__ */ o("div", { className: "pbu-panel-empty", children: "등록된 스킬이 없어요." }) : K.map((x) => /* @__PURE__ */ s("div", { children: [
1509
+ /* @__PURE__ */ s("div", { className: "pbu-skill-source", children: [
1510
+ /* @__PURE__ */ o("strong", { children: x.label }),
1511
+ /* @__PURE__ */ o("span", { children: qe[x.source] })
1512
+ ] }),
1513
+ x.items.map((m) => /* @__PURE__ */ s("div", { className: "pbu-skill-row", children: [
1514
+ /* @__PURE__ */ s("label", { className: "pbu-toggle", children: [
1515
+ /* @__PURE__ */ o(
1214
1516
  "input",
1215
1517
  {
1216
1518
  type: "checkbox",
1217
- checked: x.enabled,
1218
- disabled: T !== null,
1219
- onChange: (s) => k(x.id, s.target.checked)
1519
+ checked: m.enabled,
1520
+ disabled: w !== null,
1521
+ onChange: (M) => _(m.id, M.target.checked)
1220
1522
  }
1221
1523
  ),
1222
- x.name
1524
+ m.name
1223
1525
  ] }),
1224
- /* @__PURE__ */ n("span", { className: "pbu-hint", title: x.description, children: x.description }),
1225
- x.source === "uploaded" && /* @__PURE__ */ n(
1526
+ /* @__PURE__ */ o("span", { className: "pbu-hint", title: m.description, children: m.description }),
1527
+ /* @__PURE__ */ o("span", { className: `pbu-skill-state ${m.enabled ? "pbu-skill-state-on" : ""}`, children: w === `toggle:${m.id}` ? "변경 중" : m.enabled ? "사용 중" : "제외됨" }),
1528
+ m.source === "uploaded" && /* @__PURE__ */ o(
1226
1529
  "button",
1227
1530
  {
1228
1531
  type: "button",
1229
1532
  className: "pbu-icon-btn",
1230
- disabled: T !== null,
1231
- onClick: () => m(x.id, x.name),
1533
+ disabled: w !== null,
1534
+ onClick: () => k(m.id, m.name),
1232
1535
  "aria-label": "삭제",
1233
1536
  children: "🗑"
1234
1537
  }
1235
1538
  )
1236
- ] }, x.id))
1237
- ] }, b.source))
1238
- ] }) : /* @__PURE__ */ d("div", { className: "pbu-panel-empty", children: [
1539
+ ] }, m.id))
1540
+ ] }, x.source))
1541
+ ] }) : /* @__PURE__ */ s("div", { className: "pbu-panel-empty", children: [
1239
1542
  "컴패니언 서버가 꺼져 있어요",
1240
- /* @__PURE__ */ d("div", { className: "pbu-drawer-code", children: [
1241
- /* @__PURE__ */ n("code", { children: "npx pubuilder serve" }),
1242
- /* @__PURE__ */ n("button", { type: "button", className: "pbu-btn", onClick: q, children: S ? "복사됨 ✓" : "복사" })
1543
+ /* @__PURE__ */ s("div", { className: "pbu-drawer-code", children: [
1544
+ /* @__PURE__ */ o("code", { children: "npx pubuilder serve" }),
1545
+ /* @__PURE__ */ o("button", { type: "button", className: "pbu-btn", onClick: ae, children: E ? "복사됨 ✓" : "복사" })
1243
1546
  ] }),
1244
- /* @__PURE__ */ n("div", { className: "pbu-hint", children: 'package.json의 dev 스크립트를 "pubuilder dev -- <기존 명령>"으로 감싸면 자동 실행돼요' }),
1245
- /* @__PURE__ */ n("button", { type: "button", className: "pbu-btn", onClick: P, children: "다시 확인" })
1547
+ /* @__PURE__ */ o("div", { className: "pbu-hint", children: 'package.json의 dev 스크립트를 "pubuilder dev -- <기존 명령>"으로 감싸면 자동 실행돼요' }),
1548
+ /* @__PURE__ */ o("button", { type: "button", className: "pbu-btn", onClick: z, children: "다시 확인" })
1246
1549
  ] })
1247
1550
  ] });
1248
1551
  }
1249
- function We({ config: e, enabled: t = !0, serverUrl: r }) {
1250
- const o = t && !fe(), [l, a] = _(!1), i = y((f) => f.isMapOpen), c = y((f) => f.viewerPath), h = y((f) => f.skillDrawerOpen), u = V(() => de(e), [e]), w = V(() => new re(r), [r]);
1251
- return ie(() => {
1252
- o && window.self === window.top && (we(), a(!0));
1253
- }, [o]), !l || !o ? null : se(
1254
- /* @__PURE__ */ d(Y.Provider, { value: w, children: [
1255
- /* @__PURE__ */ n(ze, {}),
1256
- i && /* @__PURE__ */ n(Ne, { ia: u }),
1257
- c && /* @__PURE__ */ n($e, { ia: u }),
1258
- h && /* @__PURE__ */ n(Be, {})
1552
+ function Ke() {
1553
+ const t = H(j), e = y((d) => d.suspendConflicts), r = y((d) => d.suspendResolutions), n = y((d) => d.setConflictResolution), l = y((d) => d.clearSuspend), [p, c] = N(!1), [a, u] = N(null);
1554
+ if (e.length === 0) return null;
1555
+ const g = e.every((d) => r[d.file]), b = async () => {
1556
+ c(!0), u(null);
1557
+ try {
1558
+ await t.resolveSuspend(e.map((d) => r[d.file])), l();
1559
+ } catch (d) {
1560
+ u(d instanceof Error ? d.message : String(d));
1561
+ } finally {
1562
+ c(!1);
1563
+ }
1564
+ };
1565
+ return /* @__PURE__ */ o("div", { className: "pbu-suspend-overlay", children: /* @__PURE__ */ s("div", { className: "pbu-suspend-panel", children: [
1566
+ /* @__PURE__ */ s("div", { className: "pbu-suspend-head", children: [
1567
+ /* @__PURE__ */ s("strong", { children: [
1568
+ "일시 종료 — 충돌 ",
1569
+ e.length,
1570
+ "건"
1571
+ ] }),
1572
+ /* @__PURE__ */ o("span", { children: "롤백이 다른 변경과 겹쳐요. 파일마다 처리를 골라주세요. 충돌 없는 파일은 이미 되돌렸어요." })
1573
+ ] }),
1574
+ e.map((d) => {
1575
+ const v = r[d.file];
1576
+ return /* @__PURE__ */ s("div", { className: "pbu-conflict-row", children: [
1577
+ /* @__PURE__ */ o("div", { className: "pbu-conflict-file", children: d.file }),
1578
+ /* @__PURE__ */ s("div", { className: "pbu-conflict-actions", children: [
1579
+ /* @__PURE__ */ o(
1580
+ "button",
1581
+ {
1582
+ type: "button",
1583
+ className: `pbu-btn ${v?.action === "revert" ? "pbu-btn-primary" : ""}`,
1584
+ onClick: () => n(d.file, "revert"),
1585
+ children: "이전으로"
1586
+ }
1587
+ ),
1588
+ /* @__PURE__ */ o(
1589
+ "button",
1590
+ {
1591
+ type: "button",
1592
+ className: `pbu-btn ${v?.action === "keep" ? "pbu-btn-primary" : ""}`,
1593
+ onClick: () => n(d.file, "keep"),
1594
+ children: "현재 유지"
1595
+ }
1596
+ ),
1597
+ /* @__PURE__ */ o(
1598
+ "button",
1599
+ {
1600
+ type: "button",
1601
+ className: `pbu-btn ${v?.action === "edit" ? "pbu-btn-primary" : ""}`,
1602
+ onClick: () => n(d.file, "edit", d.current),
1603
+ children: "편집"
1604
+ }
1605
+ )
1606
+ ] }),
1607
+ v?.action === "edit" && /* @__PURE__ */ o(
1608
+ "textarea",
1609
+ {
1610
+ className: "pbu-conflict-edit",
1611
+ value: v.content ?? "",
1612
+ onChange: (f) => n(d.file, "edit", f.target.value),
1613
+ rows: 6
1614
+ }
1615
+ )
1616
+ ] }, d.file);
1617
+ }),
1618
+ a && /* @__PURE__ */ o("div", { className: "pbu-drawer-error", children: /* @__PURE__ */ o("span", { children: a }) }),
1619
+ /* @__PURE__ */ s("div", { className: "pbu-suspend-foot", children: [
1620
+ /* @__PURE__ */ o("button", { type: "button", className: "pbu-btn", onClick: l, disabled: p, children: "닫기" }),
1621
+ /* @__PURE__ */ o(
1622
+ "button",
1623
+ {
1624
+ type: "button",
1625
+ className: "pbu-btn pbu-btn-primary",
1626
+ onClick: b,
1627
+ disabled: !g || p,
1628
+ children: p ? "적용 중..." : "모두 해결 후 적용"
1629
+ }
1630
+ )
1631
+ ] })
1632
+ ] }) });
1633
+ }
1634
+ function oo({ config: t, enabled: e = !0, serverUrl: r }) {
1635
+ const n = e && !ye(), [l, p] = N(!1), c = y((d) => d.isMapOpen), a = y((d) => d.viewerPath), u = y((d) => d.skillDrawerOpen), g = J(() => fe(t), [t]), b = J(() => new oe(r), [r]);
1636
+ return ue(() => {
1637
+ n && window.self === window.top && (ze(), p(!0));
1638
+ }, [n]), !l || !n ? null : be(
1639
+ /* @__PURE__ */ s(j.Provider, { value: b, children: [
1640
+ /* @__PURE__ */ o(Te, {}),
1641
+ c && /* @__PURE__ */ o(Pe, { ia: g }),
1642
+ a && /* @__PURE__ */ o(Je, { ia: g }),
1643
+ u && /* @__PURE__ */ o(Ve, {}),
1644
+ /* @__PURE__ */ o(Ke, {})
1259
1645
  ] }),
1260
1646
  document.body
1261
1647
  );
1262
1648
  }
1263
1649
  export {
1264
- We as PageMap,
1265
- Xe as defineIA,
1266
- de as normalizeIA
1650
+ oo as PageMap,
1651
+ ro as defineIA,
1652
+ fe as normalizeIA
1267
1653
  };
1268
1654
  //# sourceMappingURL=index.js.map