pubuilder 0.6.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/CHANGELOG.md +17 -0
- package/dist/api.d.ts +19 -0
- package/dist/cli.js +480 -375
- package/dist/components/SuspendButton.d.ts +6 -0
- package/dist/components/SuspendConflictPanel.d.ts +5 -0
- package/dist/index.js +809 -594
- package/dist/index.js.map +1 -1
- package/dist/publish-jobs.d.ts +28 -0
- package/dist/server/agent.d.ts +52 -3
- package/dist/server/snapshot.d.ts +10 -0
- package/dist/store.d.ts +18 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import { createContext as
|
|
4
|
-
import { createPortal as
|
|
5
|
-
import { normalizeIA as
|
|
6
|
-
import { defineIA as
|
|
7
|
-
import { create as
|
|
8
|
-
import { Handle as
|
|
9
|
-
const
|
|
10
|
-
class
|
|
11
|
-
constructor(
|
|
12
|
-
super(
|
|
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
|
|
16
|
-
constructor(
|
|
17
|
-
this.baseUrl =
|
|
15
|
+
class oe {
|
|
16
|
+
constructor(e = me) {
|
|
17
|
+
this.baseUrl = e;
|
|
18
18
|
}
|
|
19
|
-
async request(
|
|
20
|
-
const
|
|
21
|
-
...
|
|
22
|
-
headers: { "content-type": "application/json", ...
|
|
19
|
+
async request(e, r) {
|
|
20
|
+
const n = await fetch(`${this.baseUrl}${e}`, {
|
|
21
|
+
...r,
|
|
22
|
+
headers: { "content-type": "application/json", ...r?.headers }
|
|
23
23
|
});
|
|
24
|
-
if (!
|
|
25
|
-
const l = await
|
|
26
|
-
throw new
|
|
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
|
|
28
|
+
return n.status === 204 ? void 0 : await n.json();
|
|
29
29
|
}
|
|
30
30
|
async isAlive() {
|
|
31
31
|
try {
|
|
@@ -37,47 +37,71 @@ class ae {
|
|
|
37
37
|
listSkills() {
|
|
38
38
|
return this.request("/api/skills");
|
|
39
39
|
}
|
|
40
|
-
toggleSkill(
|
|
41
|
-
return this.request(`/api/skills/${encodeURIComponent(
|
|
40
|
+
toggleSkill(e, r) {
|
|
41
|
+
return this.request(`/api/skills/${encodeURIComponent(e)}`, { method: "PATCH", body: JSON.stringify({ enabled: r }) });
|
|
42
42
|
}
|
|
43
|
-
uploadSkill(
|
|
44
|
-
return this.request("/api/skills", { method: "POST", body: JSON.stringify({ filename:
|
|
43
|
+
uploadSkill(e, r) {
|
|
44
|
+
return this.request("/api/skills", { method: "POST", body: JSON.stringify({ filename: e, content: r }) });
|
|
45
45
|
}
|
|
46
|
-
removeSkill(
|
|
47
|
-
return this.request(`/api/skills/${encodeURIComponent(
|
|
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(
|
|
53
|
-
return this.request("/api/settings/figma-token", { method: "PUT", body: JSON.stringify({ token:
|
|
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(
|
|
59
|
-
return this.request("/api/publish", { method: "POST", body: JSON.stringify(
|
|
58
|
+
startPublish(e) {
|
|
59
|
+
return this.request("/api/publish", { method: "POST", body: JSON.stringify(e) });
|
|
60
60
|
}
|
|
61
|
-
cancelPublish(
|
|
62
|
-
return this.request(`/api/publish/${
|
|
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(
|
|
66
|
-
const
|
|
73
|
+
subscribePublish(e, r) {
|
|
74
|
+
const n = new EventSource(`${this.baseUrl}/api/publish/${e}/events`);
|
|
67
75
|
let l = !1;
|
|
68
|
-
return
|
|
69
|
-
const c = JSON.parse(
|
|
70
|
-
(c.type === "done" || c.type === "error") && (l = !0),
|
|
71
|
-
},
|
|
72
|
-
|
|
73
|
-
}, () =>
|
|
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
|
|
77
|
-
function
|
|
84
|
+
const j = de(new oe());
|
|
85
|
+
function ye() {
|
|
78
86
|
return typeof process < "u" && process.env.NODE_ENV === "production";
|
|
79
87
|
}
|
|
80
|
-
const
|
|
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 k = fe((t) => ({
|
|
|
85
109
|
selection: null,
|
|
86
110
|
selectedOuterHTML: null,
|
|
87
111
|
skillDrawerOpen: !1,
|
|
112
|
+
publishJobs: {},
|
|
88
113
|
openMap: () => t({ isMapOpen: !0 }),
|
|
114
|
+
// 오버레이만 닫는다 — publishJobs는 건드리지 않아 실행 중 job이 계속 살아있고,
|
|
115
|
+
// 맵을 다시 열어 같은 블록을 선택하면 진행 상황/결과에 재연결된다.
|
|
89
116
|
closeMap: () => t({ isMapOpen: !1, viewerPath: null, selection: null, selectedOuterHTML: null }),
|
|
90
|
-
openViewer: (
|
|
117
|
+
openViewer: (e) => t({ viewerPath: e, selection: null, selectedOuterHTML: null }),
|
|
91
118
|
closeViewer: () => t({ viewerPath: null, selection: null, selectedOuterHTML: null }),
|
|
92
|
-
setGranularity: (
|
|
93
|
-
setInspectEnabled: (
|
|
94
|
-
setSelectionWithHTML: (
|
|
95
|
-
toggleSkillDrawer: () => t((
|
|
96
|
-
})), me = ".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))}", we = "pubuilder-styles", ye = "pubuilder-xyflow-styles", ve = (
|
|
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 {
|
|
@@ -544,150 +593,235 @@ const k = fe((t) => ({
|
|
|
544
593
|
font-size: 11px;
|
|
545
594
|
color: #cccccc;
|
|
546
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
|
+
}
|
|
547
664
|
`
|
|
548
665
|
);
|
|
549
|
-
function
|
|
666
|
+
function Y(t, e) {
|
|
550
667
|
if (document.getElementById(t)) return;
|
|
551
|
-
const
|
|
552
|
-
|
|
668
|
+
const r = document.createElement("style");
|
|
669
|
+
r.id = t, r.textContent = e, document.head.appendChild(r);
|
|
553
670
|
}
|
|
554
|
-
function
|
|
555
|
-
typeof document > "u" || (
|
|
671
|
+
function ze() {
|
|
672
|
+
typeof document > "u" || (Y(_e, ve), Y(ke, Ne));
|
|
556
673
|
}
|
|
557
|
-
function
|
|
558
|
-
const
|
|
674
|
+
function Ce(t, e, r, n = 140, l = 48) {
|
|
675
|
+
const p = /* @__PURE__ */ new Map();
|
|
559
676
|
for (const g of t) {
|
|
560
|
-
const
|
|
561
|
-
|
|
677
|
+
const b = p.get(g.parentId) ?? [];
|
|
678
|
+
b.push(g), p.set(g.parentId, b);
|
|
562
679
|
}
|
|
563
680
|
const c = /* @__PURE__ */ new Map();
|
|
564
|
-
let
|
|
565
|
-
const
|
|
566
|
-
const
|
|
567
|
-
let
|
|
568
|
-
if (
|
|
569
|
-
|
|
681
|
+
let a = 0;
|
|
682
|
+
const u = (g) => {
|
|
683
|
+
const b = p.get(g.id) ?? [], d = g.depth * (e + n);
|
|
684
|
+
let v;
|
|
685
|
+
if (b.length === 0)
|
|
686
|
+
v = a, a += r + l;
|
|
570
687
|
else {
|
|
571
|
-
const
|
|
572
|
-
|
|
688
|
+
const f = b.map(u);
|
|
689
|
+
v = (Math.min(...f) + Math.max(...f)) / 2;
|
|
573
690
|
}
|
|
574
|
-
return c.set(g.id, { x:
|
|
691
|
+
return c.set(g.id, { x: d, y: v }), v;
|
|
575
692
|
};
|
|
576
|
-
for (const g of
|
|
693
|
+
for (const g of p.get(null) ?? []) u(g);
|
|
577
694
|
return t.map((g) => ({ ...g, ...c.get(g.id) }));
|
|
578
695
|
}
|
|
579
|
-
const
|
|
580
|
-
const { page:
|
|
581
|
-
|
|
582
|
-
const
|
|
583
|
-
if (!
|
|
584
|
-
const
|
|
585
|
-
C.isIntersecting && (g(!0),
|
|
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;
|
|
700
|
+
if (!v || r.external) return;
|
|
701
|
+
const f = new IntersectionObserver(([C]) => {
|
|
702
|
+
C.isIntersecting && (g(!0), f.disconnect());
|
|
586
703
|
});
|
|
587
|
-
return
|
|
588
|
-
}, [
|
|
589
|
-
const
|
|
590
|
-
return /* @__PURE__ */
|
|
591
|
-
|
|
704
|
+
return f.observe(v), () => f.disconnect();
|
|
705
|
+
}, [r.external]);
|
|
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);
|
|
592
709
|
}, children: [
|
|
593
|
-
/* @__PURE__ */
|
|
594
|
-
/* @__PURE__ */
|
|
595
|
-
/* @__PURE__ */
|
|
596
|
-
/* @__PURE__ */
|
|
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 })
|
|
597
714
|
] }),
|
|
598
|
-
/* @__PURE__ */
|
|
599
|
-
|
|
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(
|
|
600
717
|
"iframe",
|
|
601
718
|
{
|
|
602
719
|
className: "pbu-node-iframe",
|
|
603
|
-
src:
|
|
604
|
-
title: `${
|
|
720
|
+
src: r.path,
|
|
721
|
+
title: `${r.title} 미리보기`,
|
|
605
722
|
loading: "lazy",
|
|
606
723
|
tabIndex: -1,
|
|
607
724
|
style: {
|
|
608
|
-
width:
|
|
609
|
-
height:
|
|
610
|
-
transform: `scale(${
|
|
725
|
+
width: n.width,
|
|
726
|
+
height: n.height,
|
|
727
|
+
transform: `scale(${b})`
|
|
611
728
|
}
|
|
612
729
|
}
|
|
613
|
-
) : /* @__PURE__ */
|
|
614
|
-
/* @__PURE__ */
|
|
730
|
+
) : /* @__PURE__ */ o("div", { className: "pbu-node-placeholder", children: "…" }),
|
|
731
|
+
/* @__PURE__ */ o("div", { className: "pbu-node-shield" })
|
|
615
732
|
] }),
|
|
616
|
-
/* @__PURE__ */
|
|
733
|
+
/* @__PURE__ */ o(W, { type: "source", position: B.Right, className: "pbu-handle", isConnectable: !1 })
|
|
617
734
|
] });
|
|
618
|
-
})
|
|
619
|
-
function
|
|
620
|
-
const
|
|
621
|
-
|
|
622
|
-
|
|
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,
|
|
623
754
|
type: "page",
|
|
624
|
-
position: { x:
|
|
755
|
+
position: { x: b.x, y: b.y },
|
|
625
756
|
data: {
|
|
626
|
-
page:
|
|
757
|
+
page: b,
|
|
627
758
|
viewport: t.viewport,
|
|
628
|
-
thumbWidth:
|
|
629
|
-
bodyHeight:
|
|
759
|
+
thumbWidth: U,
|
|
760
|
+
bodyHeight: p
|
|
630
761
|
},
|
|
631
|
-
sourcePosition:
|
|
632
|
-
targetPosition:
|
|
633
|
-
})), g =
|
|
634
|
-
id: `${
|
|
635
|
-
source:
|
|
636
|
-
target:
|
|
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,
|
|
637
768
|
type: "smoothstep"
|
|
638
769
|
}));
|
|
639
|
-
return { nodes:
|
|
770
|
+
return { nodes: u, edges: g };
|
|
640
771
|
}, [t]);
|
|
641
|
-
return
|
|
642
|
-
const l = (
|
|
643
|
-
if (
|
|
644
|
-
const c =
|
|
645
|
-
c.viewerPath || c.skillDrawerOpen ||
|
|
772
|
+
return L(() => {
|
|
773
|
+
const l = (p) => {
|
|
774
|
+
if (p.key !== "Escape") return;
|
|
775
|
+
const c = y.getState();
|
|
776
|
+
c.viewerPath || c.skillDrawerOpen || e();
|
|
646
777
|
};
|
|
647
778
|
return window.addEventListener("keydown", l), () => window.removeEventListener("keydown", l);
|
|
648
|
-
}, [
|
|
649
|
-
/* @__PURE__ */
|
|
650
|
-
/* @__PURE__ */
|
|
651
|
-
/* @__PURE__ */
|
|
652
|
-
/* @__PURE__ */
|
|
653
|
-
/* @__PURE__ */
|
|
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: "✕" })
|
|
654
786
|
] }),
|
|
655
|
-
/* @__PURE__ */
|
|
656
|
-
|
|
787
|
+
/* @__PURE__ */ o("div", { className: "pbu-canvas", children: /* @__PURE__ */ o(
|
|
788
|
+
ge,
|
|
657
789
|
{
|
|
658
|
-
nodes:
|
|
659
|
-
edges:
|
|
660
|
-
nodeTypes:
|
|
790
|
+
nodes: r,
|
|
791
|
+
edges: n,
|
|
792
|
+
nodeTypes: Ee,
|
|
661
793
|
fitView: !0,
|
|
662
794
|
fitViewOptions: { padding: 0.15, maxZoom: 1 },
|
|
663
795
|
minZoom: 0.05,
|
|
664
796
|
maxZoom: 2,
|
|
665
797
|
nodesDraggable: !1,
|
|
666
798
|
nodesConnectable: !1,
|
|
667
|
-
elementsSelectable: !1
|
|
799
|
+
elementsSelectable: !1,
|
|
800
|
+
proOptions: { hideAttribution: !0 },
|
|
801
|
+
children: /* @__PURE__ */ o(xe, { showInteractive: !1 })
|
|
668
802
|
}
|
|
669
803
|
) })
|
|
670
804
|
] });
|
|
671
805
|
}
|
|
672
|
-
function
|
|
673
|
-
const t =
|
|
674
|
-
return /* @__PURE__ */
|
|
806
|
+
function Te() {
|
|
807
|
+
const t = y((n) => n.isMapOpen), e = y((n) => n.openMap), r = y((n) => n.closeMap);
|
|
808
|
+
return /* @__PURE__ */ o(
|
|
675
809
|
"button",
|
|
676
810
|
{
|
|
677
811
|
type: "button",
|
|
678
812
|
className: "pbu-fab",
|
|
679
813
|
title: "Page Map (pubuilder)",
|
|
680
814
|
"aria-label": "페이지 맵 열기",
|
|
681
|
-
onClick: () => t ?
|
|
682
|
-
children: /* @__PURE__ */
|
|
683
|
-
/* @__PURE__ */
|
|
684
|
-
/* @__PURE__ */
|
|
685
|
-
/* @__PURE__ */
|
|
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" })
|
|
686
820
|
] })
|
|
687
821
|
}
|
|
688
822
|
);
|
|
689
823
|
}
|
|
690
|
-
const
|
|
824
|
+
const Le = /* @__PURE__ */ new Set([
|
|
691
825
|
"section",
|
|
692
826
|
"header",
|
|
693
827
|
"footer",
|
|
@@ -696,7 +830,7 @@ const Te = /* @__PURE__ */ new Set([
|
|
|
696
830
|
"article",
|
|
697
831
|
"aside",
|
|
698
832
|
"form"
|
|
699
|
-
]),
|
|
833
|
+
]), Ie = /* @__PURE__ */ new Set([
|
|
700
834
|
"a",
|
|
701
835
|
"button",
|
|
702
836
|
"input",
|
|
@@ -716,83 +850,83 @@ const Te = /* @__PURE__ */ new Set([
|
|
|
716
850
|
"p",
|
|
717
851
|
"label"
|
|
718
852
|
]);
|
|
719
|
-
function
|
|
720
|
-
const
|
|
721
|
-
let
|
|
722
|
-
for (;
|
|
723
|
-
|
|
724
|
-
return
|
|
725
|
-
}
|
|
726
|
-
function
|
|
727
|
-
const
|
|
728
|
-
if (
|
|
729
|
-
const
|
|
730
|
-
const
|
|
731
|
-
return
|
|
853
|
+
function ne(t, e) {
|
|
854
|
+
const r = [];
|
|
855
|
+
let n = t;
|
|
856
|
+
for (; n && n !== e.body && n !== e.documentElement; )
|
|
857
|
+
r.push(n), n = n.parentElement;
|
|
858
|
+
return r;
|
|
859
|
+
}
|
|
860
|
+
function Oe(t, e) {
|
|
861
|
+
const r = ne(t, e);
|
|
862
|
+
if (r.length === 0) return null;
|
|
863
|
+
const n = r.find((c) => {
|
|
864
|
+
const a = c.tagName.toLowerCase();
|
|
865
|
+
return Le.has(a) && a !== "main";
|
|
732
866
|
});
|
|
733
|
-
if (
|
|
734
|
-
const l =
|
|
867
|
+
if (n) return n;
|
|
868
|
+
const l = r.find((c) => c.tagName.toLowerCase() === "main");
|
|
735
869
|
if (l) return l;
|
|
736
|
-
const
|
|
737
|
-
for (let c =
|
|
738
|
-
const
|
|
739
|
-
if (
|
|
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];
|
|
740
874
|
}
|
|
741
|
-
return
|
|
742
|
-
}
|
|
743
|
-
function
|
|
744
|
-
const
|
|
745
|
-
for (const
|
|
746
|
-
if (
|
|
747
|
-
const l =
|
|
748
|
-
if (l.width >= 40 && l.height >= 24 &&
|
|
875
|
+
return r[r.length - 1];
|
|
876
|
+
}
|
|
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;
|
|
749
883
|
}
|
|
750
|
-
return
|
|
884
|
+
return r[0] ?? null;
|
|
751
885
|
}
|
|
752
|
-
function
|
|
753
|
-
return
|
|
886
|
+
function $e(t, e, r) {
|
|
887
|
+
return r === "all" ? e.body : r === "section" ? Oe(t, e) : Re(t, e);
|
|
754
888
|
}
|
|
755
|
-
function
|
|
756
|
-
const
|
|
757
|
-
if (
|
|
758
|
-
const
|
|
759
|
-
if (
|
|
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);
|
|
760
894
|
const l = t.getAttribute("alt");
|
|
761
|
-
if (l) return
|
|
762
|
-
const
|
|
763
|
-
return
|
|
895
|
+
if (l) return A(l);
|
|
896
|
+
const p = (t.textContent ?? "").trim().replace(/\s+/g, " ");
|
|
897
|
+
return p ? A(p) : `<${t.tagName.toLowerCase()}>`;
|
|
764
898
|
}
|
|
765
|
-
function
|
|
766
|
-
return t.length >
|
|
899
|
+
function A(t, e = 30) {
|
|
900
|
+
return t.length > e ? `${t.slice(0, e)}…` : t;
|
|
767
901
|
}
|
|
768
|
-
function
|
|
902
|
+
function De(t, e) {
|
|
769
903
|
if (t.id) return `#${CSS.escape(t.id)}`;
|
|
770
|
-
const
|
|
771
|
-
let
|
|
772
|
-
for (;
|
|
773
|
-
if (
|
|
774
|
-
return
|
|
775
|
-
const l =
|
|
904
|
+
const r = [];
|
|
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;
|
|
776
910
|
let c = l;
|
|
777
|
-
if (
|
|
778
|
-
const
|
|
779
|
-
(
|
|
911
|
+
if (p) {
|
|
912
|
+
const a = Array.from(p.children).filter(
|
|
913
|
+
(u) => u.tagName === n.tagName
|
|
780
914
|
);
|
|
781
|
-
|
|
915
|
+
a.length > 1 && (c += `:nth-of-type(${a.indexOf(n) + 1})`);
|
|
782
916
|
}
|
|
783
|
-
|
|
917
|
+
r.unshift(c), n = p;
|
|
784
918
|
}
|
|
785
|
-
return
|
|
919
|
+
return r.join(" > ");
|
|
786
920
|
}
|
|
787
|
-
function
|
|
788
|
-
const
|
|
789
|
-
|
|
921
|
+
function X(t, e, r) {
|
|
922
|
+
const n = t.createElement("div");
|
|
923
|
+
n.setAttribute("data-pubuilder", "highlight"), Object.assign(n.style, {
|
|
790
924
|
position: "fixed",
|
|
791
925
|
top: "0",
|
|
792
926
|
left: "0",
|
|
793
927
|
display: "none",
|
|
794
|
-
border: `1px solid ${
|
|
795
|
-
background:
|
|
928
|
+
border: `1px solid ${e}`,
|
|
929
|
+
background: r,
|
|
796
930
|
borderRadius: "0",
|
|
797
931
|
pointerEvents: "none",
|
|
798
932
|
zIndex: "2147483647",
|
|
@@ -804,636 +938,717 @@ function te(t, o, n) {
|
|
|
804
938
|
left: "-1px",
|
|
805
939
|
top: "-22px",
|
|
806
940
|
padding: "2px 7px",
|
|
807
|
-
background:
|
|
941
|
+
background: e,
|
|
808
942
|
color: "#fff",
|
|
809
943
|
font: "600 10px/16px system-ui, sans-serif",
|
|
810
944
|
borderRadius: "0",
|
|
811
945
|
whiteSpace: "nowrap",
|
|
812
946
|
pointerEvents: "none"
|
|
813
|
-
}),
|
|
947
|
+
}), n.appendChild(l), { root: n, label: l };
|
|
814
948
|
}
|
|
815
|
-
function
|
|
816
|
-
const l =
|
|
817
|
-
if (
|
|
818
|
-
|
|
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);
|
|
819
953
|
return;
|
|
820
954
|
}
|
|
821
|
-
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 = `${
|
|
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";
|
|
822
956
|
}
|
|
823
|
-
function
|
|
957
|
+
function G(t) {
|
|
824
958
|
t.root.style.display = "none";
|
|
825
959
|
}
|
|
826
|
-
function
|
|
827
|
-
const
|
|
828
|
-
return `${t.tagName.toLowerCase()} · ${Math.round(
|
|
960
|
+
function Q(t) {
|
|
961
|
+
const e = t.getBoundingClientRect();
|
|
962
|
+
return `${t.tagName.toLowerCase()} · ${Math.round(e.width)}×${Math.round(e.height)}`;
|
|
829
963
|
}
|
|
830
|
-
function
|
|
831
|
-
let
|
|
964
|
+
function Ae(t, e) {
|
|
965
|
+
let r = null;
|
|
832
966
|
try {
|
|
833
|
-
|
|
967
|
+
r = t.contentDocument;
|
|
834
968
|
} catch {
|
|
835
969
|
return null;
|
|
836
970
|
}
|
|
837
|
-
const
|
|
838
|
-
if (!
|
|
839
|
-
const l =
|
|
840
|
-
let
|
|
841
|
-
const g =
|
|
842
|
-
l.body.appendChild(g.root), l.body.appendChild(
|
|
843
|
-
let
|
|
844
|
-
const
|
|
845
|
-
|
|
846
|
-
for (const
|
|
847
|
-
if (
|
|
848
|
-
const
|
|
849
|
-
if (
|
|
850
|
-
const
|
|
851
|
-
|
|
971
|
+
const n = t.contentWindow;
|
|
972
|
+
if (!r || !r.body || !n) return null;
|
|
973
|
+
const l = r;
|
|
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 });
|
|
852
986
|
}
|
|
853
987
|
}, C = () => {
|
|
854
|
-
const
|
|
855
|
-
|
|
856
|
-
},
|
|
857
|
-
const
|
|
858
|
-
let
|
|
859
|
-
for (const S of
|
|
860
|
-
S.el ===
|
|
861
|
-
return
|
|
862
|
-
},
|
|
863
|
-
|
|
864
|
-
}, T = (
|
|
865
|
-
if (
|
|
866
|
-
if (
|
|
867
|
-
if (
|
|
868
|
-
let
|
|
869
|
-
for (;
|
|
870
|
-
|
|
871
|
-
return
|
|
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 _;
|
|
872
1006
|
}
|
|
873
|
-
return
|
|
874
|
-
},
|
|
1007
|
+
return $e(h, l, p);
|
|
1008
|
+
}, I = (h) => {
|
|
875
1009
|
if (!c) return;
|
|
876
1010
|
C();
|
|
877
|
-
const
|
|
878
|
-
if (!
|
|
879
|
-
const
|
|
880
|
-
|
|
881
|
-
},
|
|
1011
|
+
const _ = h.target;
|
|
1012
|
+
if (!_ || !l.body.contains(_)) return;
|
|
1013
|
+
const k = T(_);
|
|
1014
|
+
k !== a && (a = k, E());
|
|
1015
|
+
}, i = (h) => {
|
|
882
1016
|
if (!c) return;
|
|
883
|
-
|
|
884
|
-
const
|
|
885
|
-
if (!
|
|
886
|
-
const
|
|
887
|
-
if (!
|
|
888
|
-
|
|
889
|
-
const S =
|
|
890
|
-
|
|
1017
|
+
h.preventDefault(), h.stopPropagation(), f(), v = Date.now();
|
|
1018
|
+
const _ = h.target;
|
|
1019
|
+
if (!_) return;
|
|
1020
|
+
const k = T(_);
|
|
1021
|
+
if (!k) return;
|
|
1022
|
+
u = k, E();
|
|
1023
|
+
const S = k.getBoundingClientRect();
|
|
1024
|
+
e.onSelect(
|
|
891
1025
|
{
|
|
892
|
-
pagePath:
|
|
893
|
-
selector:
|
|
894
|
-
tag:
|
|
895
|
-
label:
|
|
1026
|
+
pagePath: e.pagePath,
|
|
1027
|
+
selector: De(k, l),
|
|
1028
|
+
tag: k.tagName.toLowerCase(),
|
|
1029
|
+
label: je(k),
|
|
896
1030
|
rect: {
|
|
897
|
-
x: S.x +
|
|
898
|
-
y: S.y +
|
|
1031
|
+
x: S.x + n.scrollX,
|
|
1032
|
+
y: S.y + n.scrollY,
|
|
899
1033
|
width: S.width,
|
|
900
1034
|
height: S.height
|
|
901
1035
|
},
|
|
902
|
-
granularity:
|
|
1036
|
+
granularity: p
|
|
903
1037
|
},
|
|
904
|
-
|
|
1038
|
+
k
|
|
905
1039
|
);
|
|
906
|
-
},
|
|
907
|
-
|
|
908
|
-
},
|
|
909
|
-
|
|
1040
|
+
}, w = () => {
|
|
1041
|
+
a = null, E();
|
|
1042
|
+
}, O = () => E(), z = () => {
|
|
1043
|
+
f(), E();
|
|
910
1044
|
};
|
|
911
|
-
return
|
|
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), {
|
|
912
1046
|
destroy() {
|
|
913
1047
|
try {
|
|
914
|
-
l.removeEventListener("mousemove",
|
|
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();
|
|
915
1049
|
} catch {
|
|
916
1050
|
}
|
|
917
1051
|
},
|
|
918
|
-
setGranularity(
|
|
919
|
-
|
|
1052
|
+
setGranularity(h) {
|
|
1053
|
+
p = h, a = null, E();
|
|
920
1054
|
},
|
|
921
|
-
setEnabled(
|
|
922
|
-
c =
|
|
1055
|
+
setEnabled(h) {
|
|
1056
|
+
c = h, h || (a = null), E();
|
|
923
1057
|
}
|
|
924
1058
|
};
|
|
925
1059
|
}
|
|
926
|
-
const
|
|
1060
|
+
const Be = {
|
|
927
1061
|
log: "💬",
|
|
928
1062
|
tool: "🔧",
|
|
929
1063
|
error: "⛔",
|
|
930
1064
|
done: "✅"
|
|
931
|
-
};
|
|
932
|
-
function
|
|
933
|
-
const t =
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
const F = (u) => {
|
|
943
|
-
R.current = t.subscribePublish(u, (z) => {
|
|
944
|
-
m((L) => [...L, z]), z.type === "done" ? (i("done"), g(null), $(!1), R.current?.(), R.current = null) : z.type === "error" && (i("error"), T(z.text), g(null), $(!1), R.current?.(), R.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));
|
|
945
1076
|
});
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
})
|
|
962
|
-
|
|
963
|
-
|
|
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
|
|
964
1097
|
});
|
|
965
|
-
|
|
1098
|
+
} finally {
|
|
1099
|
+
l(c, { checking: !1 });
|
|
966
1100
|
}
|
|
967
|
-
g(L), m([]), i("running"), F(L);
|
|
968
|
-
} catch (z) {
|
|
969
|
-
if (u !== D.current) return;
|
|
970
|
-
i("error"), T(z instanceof Error ? z.message : String(z)), O(z instanceof J ? z.code ?? null : null);
|
|
971
|
-
} finally {
|
|
972
|
-
E(!1);
|
|
973
1101
|
}
|
|
974
|
-
},
|
|
975
|
-
if (!(!
|
|
976
|
-
|
|
1102
|
+
}, f = async () => {
|
|
1103
|
+
if (!(!c || !a.jobId || a.cancelling)) {
|
|
1104
|
+
l(c, { cancelling: !0 });
|
|
977
1105
|
try {
|
|
978
|
-
await t.cancelPublish(
|
|
979
|
-
} catch (
|
|
980
|
-
|
|
1106
|
+
await t.cancelPublish(a.jobId);
|
|
1107
|
+
} catch (i) {
|
|
1108
|
+
l(c, {
|
|
1109
|
+
errorMessage: i instanceof Error ? i.message : String(i),
|
|
1110
|
+
cancelling: !1
|
|
1111
|
+
});
|
|
981
1112
|
}
|
|
982
1113
|
}
|
|
983
|
-
},
|
|
984
|
-
const
|
|
985
|
-
if (!
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
instruction: u
|
|
994
|
-
});
|
|
995
|
-
if (z !== D.current) {
|
|
996
|
-
t.cancelPublish(L).catch(() => {
|
|
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 });
|
|
1118
|
+
try {
|
|
1119
|
+
const { jobId: w } = await t.startPublish({
|
|
1120
|
+
selection: e,
|
|
1121
|
+
outerHTML: r ?? "",
|
|
1122
|
+
figmaUrl: a.figmaUrl,
|
|
1123
|
+
instruction: i
|
|
997
1124
|
});
|
|
998
|
-
|
|
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 });
|
|
999
1134
|
}
|
|
1000
|
-
m((ie) => [...ie, { type: "log", text: `내 답변: ${u}` }]), w(""), g(L), i("running"), F(L);
|
|
1001
|
-
} catch (L) {
|
|
1002
|
-
if (z !== D.current) return;
|
|
1003
|
-
i("error"), T(L instanceof Error ? L.message : String(L)), O(L instanceof J ? L.code ?? null : null);
|
|
1004
|
-
} finally {
|
|
1005
|
-
E(!1);
|
|
1006
1135
|
}
|
|
1007
|
-
},
|
|
1008
|
-
await navigator.clipboard.writeText("npx pubuilder serve"),
|
|
1009
|
-
},
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
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
|
+
}
|
|
1016
1147
|
}
|
|
1017
|
-
},
|
|
1018
|
-
return /* @__PURE__ */
|
|
1019
|
-
/* @__PURE__ */
|
|
1020
|
-
/* @__PURE__ */
|
|
1021
|
-
/* @__PURE__ */
|
|
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: "🧰 스킬함 · 설정" })
|
|
1022
1153
|
] }),
|
|
1023
|
-
/* @__PURE__ */
|
|
1154
|
+
/* @__PURE__ */ o(
|
|
1024
1155
|
"input",
|
|
1025
1156
|
{
|
|
1026
1157
|
id: "pbu-figma-url",
|
|
1027
|
-
value:
|
|
1028
|
-
onChange: (
|
|
1029
|
-
disabled:
|
|
1158
|
+
value: a.figmaUrl,
|
|
1159
|
+
onChange: (i) => c && l(c, { figmaUrl: i.target.value }),
|
|
1160
|
+
disabled: T,
|
|
1030
1161
|
placeholder: "https://www.figma.com/design/..."
|
|
1031
1162
|
}
|
|
1032
1163
|
),
|
|
1033
|
-
|
|
1164
|
+
a.serverDown && /* @__PURE__ */ s("div", { className: "pbu-panel-empty", children: [
|
|
1034
1165
|
"컴패니언 서버가 꺼져 있어요",
|
|
1035
|
-
/* @__PURE__ */
|
|
1036
|
-
/* @__PURE__ */
|
|
1037
|
-
/* @__PURE__ */
|
|
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 ? "복사됨 ✓" : "복사" })
|
|
1038
1169
|
] }),
|
|
1039
|
-
/* @__PURE__ */
|
|
1040
|
-
/* @__PURE__ */
|
|
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: "다시 확인" })
|
|
1041
1172
|
] }),
|
|
1042
|
-
|
|
1043
|
-
/* @__PURE__ */
|
|
1044
|
-
|
|
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: "스킬함 열기" })
|
|
1045
1176
|
] }),
|
|
1046
|
-
|
|
1177
|
+
T ? /* @__PURE__ */ o("button", { type: "button", className: "pbu-btn pbu-btn-primary", disabled: a.cancelling, onClick: f, children: a.cancelling ? "중단 중..." : "중단" }) : /* @__PURE__ */ o(
|
|
1047
1178
|
"button",
|
|
1048
1179
|
{
|
|
1049
1180
|
type: "button",
|
|
1050
1181
|
className: "pbu-btn pbu-btn-primary",
|
|
1051
|
-
disabled:
|
|
1052
|
-
onClick:
|
|
1182
|
+
disabled: a.checking || !e,
|
|
1183
|
+
onClick: v,
|
|
1053
1184
|
children: "이 블록 퍼블리싱"
|
|
1054
1185
|
}
|
|
1055
1186
|
),
|
|
1056
|
-
(
|
|
1057
|
-
|
|
1058
|
-
|
|
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(
|
|
1059
1190
|
"div",
|
|
1060
1191
|
{
|
|
1061
|
-
className:
|
|
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",
|
|
1062
1193
|
children: [
|
|
1063
|
-
/* @__PURE__ */
|
|
1194
|
+
/* @__PURE__ */ o("span", { children: Be[i.type] }),
|
|
1064
1195
|
" ",
|
|
1065
|
-
/* @__PURE__ */
|
|
1196
|
+
/* @__PURE__ */ o("span", { children: i.text })
|
|
1066
1197
|
]
|
|
1067
1198
|
},
|
|
1068
|
-
|
|
1199
|
+
w
|
|
1069
1200
|
))
|
|
1070
1201
|
] }),
|
|
1071
|
-
|
|
1072
|
-
/* @__PURE__ */
|
|
1073
|
-
/* @__PURE__ */
|
|
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(
|
|
1074
1205
|
"textarea",
|
|
1075
1206
|
{
|
|
1076
1207
|
id: "pbu-publish-reply",
|
|
1077
|
-
value:
|
|
1078
|
-
onChange: (
|
|
1079
|
-
onKeyDown: (
|
|
1080
|
-
(
|
|
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();
|
|
1081
1212
|
},
|
|
1082
1213
|
placeholder: "예: B 방향으로 진행해줘. 공지와 알림은 유지해.",
|
|
1083
1214
|
rows: 3
|
|
1084
1215
|
}
|
|
1085
1216
|
),
|
|
1086
|
-
/* @__PURE__ */
|
|
1087
|
-
/* @__PURE__ */
|
|
1088
|
-
/* @__PURE__ */
|
|
1217
|
+
/* @__PURE__ */ s("div", { className: "pbu-publish-reply-actions", children: [
|
|
1218
|
+
/* @__PURE__ */ o("span", { children: "⌘/Ctrl + Enter" }),
|
|
1219
|
+
/* @__PURE__ */ o(
|
|
1089
1220
|
"button",
|
|
1090
1221
|
{
|
|
1091
1222
|
type: "button",
|
|
1092
1223
|
className: "pbu-btn pbu-btn-primary",
|
|
1093
|
-
disabled:
|
|
1094
|
-
onClick:
|
|
1095
|
-
children:
|
|
1224
|
+
disabled: a.checking || !a.reply.trim(),
|
|
1225
|
+
onClick: C,
|
|
1226
|
+
children: a.checking ? "전송 중..." : "답변 전송"
|
|
1096
1227
|
}
|
|
1097
1228
|
)
|
|
1098
1229
|
] })
|
|
1099
1230
|
] })
|
|
1100
1231
|
] });
|
|
1101
1232
|
}
|
|
1102
|
-
function
|
|
1103
|
-
const t =
|
|
1104
|
-
t && (await navigator.clipboard.writeText(t.selector),
|
|
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));
|
|
1105
1236
|
};
|
|
1106
|
-
return /* @__PURE__ */
|
|
1107
|
-
/* @__PURE__ */
|
|
1108
|
-
t ? /* @__PURE__ */
|
|
1109
|
-
/* @__PURE__ */
|
|
1110
|
-
/* @__PURE__ */
|
|
1111
|
-
/* @__PURE__ */
|
|
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 })
|
|
1112
1243
|
] }),
|
|
1113
|
-
/* @__PURE__ */
|
|
1114
|
-
/* @__PURE__ */
|
|
1115
|
-
/* @__PURE__ */
|
|
1116
|
-
/* @__PURE__ */
|
|
1117
|
-
/* @__PURE__ */
|
|
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 })
|
|
1118
1249
|
] })
|
|
1119
1250
|
] }),
|
|
1120
|
-
/* @__PURE__ */
|
|
1121
|
-
/* @__PURE__ */
|
|
1122
|
-
/* @__PURE__ */
|
|
1123
|
-
/* @__PURE__ */
|
|
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 복사" })
|
|
1124
1255
|
] }),
|
|
1125
|
-
/* @__PURE__ */
|
|
1126
|
-
/* @__PURE__ */
|
|
1127
|
-
/* @__PURE__ */
|
|
1256
|
+
/* @__PURE__ */ s("div", { className: "pbu-field", children: [
|
|
1257
|
+
/* @__PURE__ */ o("label", { children: "크기" }),
|
|
1258
|
+
/* @__PURE__ */ s("span", { children: [
|
|
1128
1259
|
Math.round(t.rect.width),
|
|
1129
1260
|
" × ",
|
|
1130
1261
|
Math.round(t.rect.height),
|
|
1131
1262
|
"px"
|
|
1132
1263
|
] })
|
|
1133
1264
|
] }),
|
|
1134
|
-
/* @__PURE__ */
|
|
1135
|
-
/* @__PURE__ */
|
|
1136
|
-
/* @__PURE__ */
|
|
1265
|
+
/* @__PURE__ */ s("div", { className: "pbu-field", children: [
|
|
1266
|
+
/* @__PURE__ */ o("label", { children: "단위" }),
|
|
1267
|
+
/* @__PURE__ */ o("span", { children: t.granularity === "all" ? "전체" : t.granularity === "section" ? "섹션" : "유닛" })
|
|
1137
1268
|
] }),
|
|
1138
|
-
/* @__PURE__ */
|
|
1139
|
-
] }) : /* @__PURE__ */
|
|
1269
|
+
/* @__PURE__ */ o(He, {})
|
|
1270
|
+
] }) : /* @__PURE__ */ s("div", { className: "pbu-panel-empty", children: [
|
|
1140
1271
|
"화면에서 블록에 마우스를 올리고 클릭해 선택하세요.",
|
|
1141
|
-
/* @__PURE__ */
|
|
1272
|
+
/* @__PURE__ */ o("br", {}),
|
|
1142
1273
|
"상단 토글로 ",
|
|
1143
|
-
/* @__PURE__ */
|
|
1274
|
+
/* @__PURE__ */ o("b", { children: "전체 / 섹션 / 유닛" }),
|
|
1144
1275
|
" 단위를 바꿀 수 있어요."
|
|
1145
1276
|
] })
|
|
1146
1277
|
] });
|
|
1147
1278
|
}
|
|
1148
|
-
function
|
|
1149
|
-
const
|
|
1150
|
-
|
|
1151
|
-
const
|
|
1152
|
-
if (!
|
|
1153
|
-
const C =
|
|
1154
|
-
pagePath:
|
|
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 = () => {
|
|
1281
|
+
u.current?.destroy(), u.current = null;
|
|
1282
|
+
const f = a.current;
|
|
1283
|
+
if (!f || !e) return;
|
|
1284
|
+
const C = y.getState(), P = Ae(f, {
|
|
1285
|
+
pagePath: e,
|
|
1155
1286
|
granularity: C.granularity,
|
|
1156
1287
|
enabled: C.inspectEnabled,
|
|
1157
|
-
onSelect: (
|
|
1288
|
+
onSelect: (E, T) => (
|
|
1158
1289
|
// 20K 상한 — 프롬프트 비대화 방지
|
|
1159
|
-
|
|
1290
|
+
y.getState().setSelectionWithHTML(E, T.outerHTML.slice(0, 2e4))
|
|
1160
1291
|
)
|
|
1161
1292
|
});
|
|
1162
|
-
if (!
|
|
1163
|
-
|
|
1293
|
+
if (!P) {
|
|
1294
|
+
b(!0);
|
|
1164
1295
|
return;
|
|
1165
1296
|
}
|
|
1166
|
-
|
|
1297
|
+
b(!1), u.current = P;
|
|
1167
1298
|
};
|
|
1168
|
-
return
|
|
1169
|
-
|
|
1170
|
-
}, [
|
|
1171
|
-
|
|
1172
|
-
}, [
|
|
1173
|
-
const
|
|
1174
|
-
C.key === "Escape" && (
|
|
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());
|
|
1175
1306
|
};
|
|
1176
|
-
return window.addEventListener("keydown",
|
|
1177
|
-
}, [
|
|
1178
|
-
/* @__PURE__ */
|
|
1179
|
-
/* @__PURE__ */
|
|
1180
|
-
/* @__PURE__ */
|
|
1181
|
-
|
|
1182
|
-
/* @__PURE__ */
|
|
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 })
|
|
1183
1314
|
] }),
|
|
1184
|
-
/* @__PURE__ */
|
|
1185
|
-
g && /* @__PURE__ */
|
|
1186
|
-
/* @__PURE__ */
|
|
1187
|
-
/* @__PURE__ */
|
|
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(
|
|
1188
1319
|
"button",
|
|
1189
1320
|
{
|
|
1190
1321
|
type: "button",
|
|
1191
|
-
className:
|
|
1322
|
+
className: n === "all" ? "pbu-on" : "",
|
|
1192
1323
|
onClick: () => l("all"),
|
|
1193
1324
|
children: "전체"
|
|
1194
1325
|
}
|
|
1195
1326
|
),
|
|
1196
|
-
/* @__PURE__ */
|
|
1327
|
+
/* @__PURE__ */ o(
|
|
1197
1328
|
"button",
|
|
1198
1329
|
{
|
|
1199
1330
|
type: "button",
|
|
1200
|
-
className:
|
|
1331
|
+
className: n === "section" ? "pbu-on" : "",
|
|
1201
1332
|
onClick: () => l("section"),
|
|
1202
1333
|
children: "섹션"
|
|
1203
1334
|
}
|
|
1204
1335
|
),
|
|
1205
|
-
/* @__PURE__ */
|
|
1336
|
+
/* @__PURE__ */ o(
|
|
1206
1337
|
"button",
|
|
1207
1338
|
{
|
|
1208
1339
|
type: "button",
|
|
1209
|
-
className:
|
|
1340
|
+
className: n === "unit" ? "pbu-on" : "",
|
|
1210
1341
|
onClick: () => l("unit"),
|
|
1211
1342
|
children: "유닛"
|
|
1212
1343
|
}
|
|
1213
1344
|
)
|
|
1214
1345
|
] }),
|
|
1215
|
-
/* @__PURE__ */
|
|
1216
|
-
/* @__PURE__ */
|
|
1346
|
+
/* @__PURE__ */ s("label", { className: "pbu-toggle", children: [
|
|
1347
|
+
/* @__PURE__ */ o(
|
|
1217
1348
|
"input",
|
|
1218
1349
|
{
|
|
1219
1350
|
type: "checkbox",
|
|
1220
|
-
checked:
|
|
1221
|
-
onChange: (
|
|
1351
|
+
checked: p,
|
|
1352
|
+
onChange: (f) => c(f.target.checked)
|
|
1222
1353
|
}
|
|
1223
1354
|
),
|
|
1224
1355
|
"검사 모드"
|
|
1225
1356
|
] }),
|
|
1226
|
-
/* @__PURE__ */
|
|
1357
|
+
/* @__PURE__ */ o(te, {}),
|
|
1358
|
+
/* @__PURE__ */ o("button", { type: "button", className: "pbu-icon-btn", onClick: r, "aria-label": "닫기", children: "✕" })
|
|
1227
1359
|
] }),
|
|
1228
|
-
/* @__PURE__ */
|
|
1229
|
-
/* @__PURE__ */
|
|
1360
|
+
/* @__PURE__ */ s("div", { className: "pbu-viewer-body", children: [
|
|
1361
|
+
/* @__PURE__ */ o("div", { className: "pbu-viewer-frame-wrap", children: /* @__PURE__ */ o(
|
|
1230
1362
|
"iframe",
|
|
1231
1363
|
{
|
|
1232
|
-
ref:
|
|
1364
|
+
ref: a,
|
|
1233
1365
|
className: "pbu-viewer-iframe",
|
|
1234
|
-
src:
|
|
1235
|
-
title:
|
|
1236
|
-
onLoad:
|
|
1366
|
+
src: d.path,
|
|
1367
|
+
title: d.title,
|
|
1368
|
+
onLoad: v
|
|
1237
1369
|
}
|
|
1238
1370
|
) }),
|
|
1239
|
-
/* @__PURE__ */
|
|
1371
|
+
/* @__PURE__ */ o(Ue, {})
|
|
1240
1372
|
] })
|
|
1241
1373
|
] }) : null;
|
|
1242
1374
|
}
|
|
1243
|
-
const
|
|
1375
|
+
const Fe = {
|
|
1244
1376
|
project: "프로젝트",
|
|
1245
1377
|
global: "글로벌",
|
|
1246
1378
|
uploaded: "업로드"
|
|
1247
|
-
},
|
|
1379
|
+
}, qe = {
|
|
1248
1380
|
project: "현재 프로젝트에서 발견한 스킬 · 여기서는 삭제할 수 없어요",
|
|
1249
1381
|
global: "내 전역 환경에 설치된 공용 스킬 · 여기서는 삭제할 수 없어요",
|
|
1250
1382
|
uploaded: "이 스킬함에 직접 올린 Markdown 스킬 · 삭제할 수 있어요"
|
|
1251
|
-
},
|
|
1252
|
-
function
|
|
1253
|
-
const t =
|
|
1254
|
-
const
|
|
1255
|
-
|
|
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);
|
|
1256
1388
|
try {
|
|
1257
|
-
const
|
|
1258
|
-
if (
|
|
1259
|
-
const [
|
|
1260
|
-
if (
|
|
1261
|
-
|
|
1262
|
-
} catch (
|
|
1263
|
-
if (
|
|
1264
|
-
|
|
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));
|
|
1265
1397
|
} finally {
|
|
1266
|
-
|
|
1398
|
+
x === i.current && n(!1);
|
|
1267
1399
|
}
|
|
1268
1400
|
};
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
}, []),
|
|
1272
|
-
const
|
|
1273
|
-
|
|
1401
|
+
L(() => {
|
|
1402
|
+
z();
|
|
1403
|
+
}, []), L(() => {
|
|
1404
|
+
const x = (m) => {
|
|
1405
|
+
m.key === "Escape" && t();
|
|
1274
1406
|
};
|
|
1275
|
-
return window.addEventListener("keydown",
|
|
1407
|
+
return window.addEventListener("keydown", x), () => window.removeEventListener("keydown", x);
|
|
1276
1408
|
}, [t]);
|
|
1277
|
-
const
|
|
1278
|
-
if (!
|
|
1279
|
-
|
|
1409
|
+
const h = async (x, m) => {
|
|
1410
|
+
if (!w) {
|
|
1411
|
+
O(x);
|
|
1280
1412
|
try {
|
|
1281
|
-
await
|
|
1282
|
-
} catch (
|
|
1283
|
-
|
|
1413
|
+
await m();
|
|
1414
|
+
} catch (M) {
|
|
1415
|
+
P(M instanceof Error ? M.message : String(M));
|
|
1284
1416
|
} finally {
|
|
1285
|
-
|
|
1417
|
+
O(null);
|
|
1286
1418
|
}
|
|
1287
1419
|
}
|
|
1288
|
-
},
|
|
1289
|
-
await
|
|
1290
|
-
}),
|
|
1291
|
-
window.confirm(`"${
|
|
1292
|
-
await
|
|
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();
|
|
1293
1425
|
});
|
|
1294
|
-
}, S = () =>
|
|
1295
|
-
const
|
|
1296
|
-
|
|
1297
|
-
const
|
|
1298
|
-
|
|
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);
|
|
1299
1431
|
});
|
|
1300
|
-
await
|
|
1432
|
+
await e.uploadSkill(m.name, D), await z();
|
|
1301
1433
|
});
|
|
1302
|
-
},
|
|
1303
|
-
|
|
1304
|
-
}),
|
|
1305
|
-
await
|
|
1306
|
-
}),
|
|
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 () => {
|
|
1307
1439
|
await navigator.clipboard.writeText("npx pubuilder serve"), T(!0), setTimeout(() => T(!1), 1200);
|
|
1308
|
-
},
|
|
1309
|
-
source:
|
|
1310
|
-
label:
|
|
1311
|
-
items: c.filter((
|
|
1312
|
-
})).filter((
|
|
1313
|
-
return /* @__PURE__ */
|
|
1314
|
-
/* @__PURE__ */
|
|
1315
|
-
/* @__PURE__ */
|
|
1316
|
-
/* @__PURE__ */
|
|
1317
|
-
/* @__PURE__ */
|
|
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: "퍼블리싱 실행 설정" })
|
|
1318
1450
|
] }),
|
|
1319
|
-
/* @__PURE__ */
|
|
1451
|
+
/* @__PURE__ */ o("button", { type: "button", className: "pbu-icon-btn", onClick: t, "aria-label": "닫기", children: "✕" })
|
|
1320
1452
|
] }),
|
|
1321
|
-
/* @__PURE__ */
|
|
1322
|
-
/* @__PURE__ */
|
|
1323
|
-
/* @__PURE__ */
|
|
1324
|
-
!
|
|
1325
|
-
/* @__PURE__ */
|
|
1326
|
-
c.length > 0 ? `${
|
|
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}개 스킬 사용 중` : "사용 가능한 스킬 없음"
|
|
1327
1459
|
] })
|
|
1328
1460
|
] }),
|
|
1329
|
-
C && /* @__PURE__ */
|
|
1330
|
-
/* @__PURE__ */
|
|
1331
|
-
/* @__PURE__ */
|
|
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: "✕" })
|
|
1332
1464
|
] }),
|
|
1333
|
-
|
|
1334
|
-
/* @__PURE__ */
|
|
1335
|
-
/* @__PURE__ */
|
|
1336
|
-
/* @__PURE__ */
|
|
1337
|
-
/* @__PURE__ */
|
|
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: "노드 링크에서 시안 이미지와 구조 정보를 읽을 때 사용해요." })
|
|
1338
1470
|
] }),
|
|
1339
|
-
/* @__PURE__ */
|
|
1471
|
+
/* @__PURE__ */ o("span", { className: `pbu-status-badge ${u?.configured ? "pbu-status-on" : "pbu-status-off"}`, children: u?.configured ? "연결됨" : "연결 필요" })
|
|
1340
1472
|
] }),
|
|
1341
|
-
|
|
1342
|
-
/* @__PURE__ */
|
|
1343
|
-
/* @__PURE__ */
|
|
1344
|
-
/* @__PURE__ */
|
|
1345
|
-
/* @__PURE__ */
|
|
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: "삭제" })
|
|
1346
1478
|
] })
|
|
1347
|
-
] }) : /* @__PURE__ */
|
|
1348
|
-
/* @__PURE__ */
|
|
1479
|
+
] }) : /* @__PURE__ */ s("div", { className: "pbu-field", children: [
|
|
1480
|
+
/* @__PURE__ */ o(
|
|
1349
1481
|
"input",
|
|
1350
1482
|
{
|
|
1351
1483
|
type: "password",
|
|
1352
|
-
value:
|
|
1353
|
-
onChange: (
|
|
1484
|
+
value: b,
|
|
1485
|
+
onChange: (x) => d(x.target.value),
|
|
1354
1486
|
placeholder: "Figma 토큰"
|
|
1355
1487
|
}
|
|
1356
1488
|
),
|
|
1357
|
-
/* @__PURE__ */
|
|
1489
|
+
/* @__PURE__ */ o("button", { type: "button", className: "pbu-btn pbu-btn-primary", disabled: w !== null, onClick: re, children: "저장" })
|
|
1358
1490
|
] }),
|
|
1359
|
-
/* @__PURE__ */
|
|
1360
|
-
/* @__PURE__ */
|
|
1361
|
-
/* @__PURE__ */
|
|
1362
|
-
/* @__PURE__ */
|
|
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 파일이에요." })
|
|
1363
1495
|
] }),
|
|
1364
|
-
/* @__PURE__ */
|
|
1365
|
-
/* @__PURE__ */
|
|
1496
|
+
/* @__PURE__ */ o("button", { type: "button", className: "pbu-btn", disabled: w !== null, onClick: S, children: "업로드" }),
|
|
1497
|
+
/* @__PURE__ */ o(
|
|
1366
1498
|
"input",
|
|
1367
1499
|
{
|
|
1368
|
-
ref:
|
|
1500
|
+
ref: I,
|
|
1369
1501
|
type: "file",
|
|
1370
1502
|
accept: ".md",
|
|
1371
1503
|
style: { display: "none" },
|
|
1372
|
-
onChange:
|
|
1504
|
+
onChange: V
|
|
1373
1505
|
}
|
|
1374
1506
|
)
|
|
1375
1507
|
] }),
|
|
1376
|
-
|
|
1377
|
-
/* @__PURE__ */
|
|
1378
|
-
/* @__PURE__ */
|
|
1379
|
-
/* @__PURE__ */
|
|
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] })
|
|
1380
1512
|
] }),
|
|
1381
|
-
|
|
1382
|
-
/* @__PURE__ */
|
|
1383
|
-
/* @__PURE__ */
|
|
1513
|
+
x.items.map((m) => /* @__PURE__ */ s("div", { className: "pbu-skill-row", children: [
|
|
1514
|
+
/* @__PURE__ */ s("label", { className: "pbu-toggle", children: [
|
|
1515
|
+
/* @__PURE__ */ o(
|
|
1384
1516
|
"input",
|
|
1385
1517
|
{
|
|
1386
1518
|
type: "checkbox",
|
|
1387
|
-
checked:
|
|
1388
|
-
disabled:
|
|
1389
|
-
onChange: (
|
|
1519
|
+
checked: m.enabled,
|
|
1520
|
+
disabled: w !== null,
|
|
1521
|
+
onChange: (M) => _(m.id, M.target.checked)
|
|
1390
1522
|
}
|
|
1391
1523
|
),
|
|
1392
|
-
|
|
1524
|
+
m.name
|
|
1393
1525
|
] }),
|
|
1394
|
-
/* @__PURE__ */
|
|
1395
|
-
/* @__PURE__ */
|
|
1396
|
-
|
|
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(
|
|
1397
1529
|
"button",
|
|
1398
1530
|
{
|
|
1399
1531
|
type: "button",
|
|
1400
1532
|
className: "pbu-icon-btn",
|
|
1401
|
-
disabled:
|
|
1402
|
-
onClick: () =>
|
|
1533
|
+
disabled: w !== null,
|
|
1534
|
+
onClick: () => k(m.id, m.name),
|
|
1403
1535
|
"aria-label": "삭제",
|
|
1404
1536
|
children: "🗑"
|
|
1405
1537
|
}
|
|
1406
1538
|
)
|
|
1407
|
-
] },
|
|
1408
|
-
] },
|
|
1409
|
-
] }) : /* @__PURE__ */
|
|
1539
|
+
] }, m.id))
|
|
1540
|
+
] }, x.source))
|
|
1541
|
+
] }) : /* @__PURE__ */ s("div", { className: "pbu-panel-empty", children: [
|
|
1410
1542
|
"컴패니언 서버가 꺼져 있어요",
|
|
1411
|
-
/* @__PURE__ */
|
|
1412
|
-
/* @__PURE__ */
|
|
1413
|
-
/* @__PURE__ */
|
|
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 ? "복사됨 ✓" : "복사" })
|
|
1414
1546
|
] }),
|
|
1415
|
-
/* @__PURE__ */
|
|
1416
|
-
/* @__PURE__ */
|
|
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: "다시 확인" })
|
|
1417
1549
|
] })
|
|
1418
1550
|
] });
|
|
1419
1551
|
}
|
|
1420
|
-
function
|
|
1421
|
-
const
|
|
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]);
|
|
1422
1636
|
return ue(() => {
|
|
1423
|
-
|
|
1424
|
-
}, [
|
|
1425
|
-
/* @__PURE__ */
|
|
1426
|
-
/* @__PURE__ */
|
|
1427
|
-
c && /* @__PURE__ */
|
|
1428
|
-
|
|
1429
|
-
|
|
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, {})
|
|
1430
1645
|
] }),
|
|
1431
1646
|
document.body
|
|
1432
1647
|
);
|
|
1433
1648
|
}
|
|
1434
1649
|
export {
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1650
|
+
oo as PageMap,
|
|
1651
|
+
ro as defineIA,
|
|
1652
|
+
fe as normalizeIA
|
|
1438
1653
|
};
|
|
1439
1654
|
//# sourceMappingURL=index.js.map
|