pubuilder 0.4.0 → 0.5.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/README.md +2 -2
- package/dist/cli.js +2 -2
- package/dist/components/PageMap.d.ts +1 -1
- package/dist/config.d.ts +1 -1
- package/dist/config.js +58 -0
- package/dist/config.js.map +1 -0
- package/dist/index.d.ts +3 -3
- package/dist/index.js +415 -466
- package/dist/index.js.map +1 -1
- package/package.json +5 -1
package/dist/index.js
CHANGED
|
@@ -1,29 +1,31 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import { createContext as
|
|
4
|
-
import { createPortal as
|
|
2
|
+
import { jsxs as d, jsx as n, Fragment as ee } from "react/jsx-runtime";
|
|
3
|
+
import { createContext as ae, memo as ce, useRef as D, useState as _, useEffect as R, useMemo as V, useContext as te, useLayoutEffect as ie } from "react";
|
|
4
|
+
import { createPortal as se } from "react-dom";
|
|
5
|
+
import { normalizeIA as de } from "./config.js";
|
|
6
|
+
import { defineIA as Xe } from "./config.js";
|
|
5
7
|
import { create as ue } from "zustand";
|
|
6
8
|
import { Handle as J, Position as j, ReactFlow as pe } from "@xyflow/react";
|
|
7
9
|
const be = "http://localhost:4816";
|
|
8
|
-
class
|
|
9
|
-
constructor(t,
|
|
10
|
-
super(t), this.code =
|
|
10
|
+
class oe extends Error {
|
|
11
|
+
constructor(t, r) {
|
|
12
|
+
super(t), this.code = r, this.name = "ApiError";
|
|
11
13
|
}
|
|
12
14
|
}
|
|
13
|
-
class
|
|
15
|
+
class re {
|
|
14
16
|
constructor(t = be) {
|
|
15
17
|
this.baseUrl = t;
|
|
16
18
|
}
|
|
17
|
-
async request(t,
|
|
18
|
-
const
|
|
19
|
-
...
|
|
20
|
-
headers: { "content-type": "application/json", ...
|
|
19
|
+
async request(t, r) {
|
|
20
|
+
const o = await fetch(`${this.baseUrl}${t}`, {
|
|
21
|
+
...r,
|
|
22
|
+
headers: { "content-type": "application/json", ...r?.headers }
|
|
21
23
|
});
|
|
22
|
-
if (!
|
|
23
|
-
const
|
|
24
|
-
throw new
|
|
24
|
+
if (!o.ok) {
|
|
25
|
+
const l = await o.json().catch(() => ({}));
|
|
26
|
+
throw new oe(l.message ?? `요청 실패 (${o.status})`, l.code);
|
|
25
27
|
}
|
|
26
|
-
return
|
|
28
|
+
return o.status === 204 ? void 0 : await o.json();
|
|
27
29
|
}
|
|
28
30
|
async isAlive() {
|
|
29
31
|
try {
|
|
@@ -35,11 +37,11 @@ class ne {
|
|
|
35
37
|
listSkills() {
|
|
36
38
|
return this.request("/api/skills");
|
|
37
39
|
}
|
|
38
|
-
toggleSkill(t,
|
|
39
|
-
return this.request(`/api/skills/${encodeURIComponent(t)}`, { method: "PATCH", body: JSON.stringify({ enabled:
|
|
40
|
+
toggleSkill(t, r) {
|
|
41
|
+
return this.request(`/api/skills/${encodeURIComponent(t)}`, { method: "PATCH", body: JSON.stringify({ enabled: r }) });
|
|
40
42
|
}
|
|
41
|
-
uploadSkill(t,
|
|
42
|
-
return this.request("/api/skills", { method: "POST", body: JSON.stringify({ filename: t, content:
|
|
43
|
+
uploadSkill(t, r) {
|
|
44
|
+
return this.request("/api/skills", { method: "POST", body: JSON.stringify({ filename: t, content: r }) });
|
|
43
45
|
}
|
|
44
46
|
removeSkill(t) {
|
|
45
47
|
return this.request(`/api/skills/${encodeURIComponent(t)}`, { method: "DELETE" });
|
|
@@ -60,72 +62,19 @@ class ne {
|
|
|
60
62
|
return this.request(`/api/publish/${t}`, { method: "DELETE" });
|
|
61
63
|
}
|
|
62
64
|
/** SSE 구독 — 반환값 호출로 해제 */
|
|
63
|
-
subscribePublish(t,
|
|
64
|
-
const
|
|
65
|
-
let
|
|
66
|
-
return
|
|
67
|
-
const i = JSON.parse(
|
|
68
|
-
(i.type === "done" || i.type === "error") && (
|
|
69
|
-
},
|
|
70
|
-
|
|
71
|
-
}, () =>
|
|
65
|
+
subscribePublish(t, r) {
|
|
66
|
+
const o = new EventSource(`${this.baseUrl}/api/publish/${t}/events`);
|
|
67
|
+
let l = !1;
|
|
68
|
+
return o.onmessage = (a) => {
|
|
69
|
+
const i = JSON.parse(a.data);
|
|
70
|
+
(i.type === "done" || i.type === "error") && (l = !0), r(i);
|
|
71
|
+
}, o.onerror = () => {
|
|
72
|
+
o.close(), l || (l = !0, r({ type: "error", text: "서버 연결이 끊겼어요. pubuilder serve 상태를 확인해주세요" }));
|
|
73
|
+
}, () => o.close();
|
|
72
74
|
}
|
|
73
75
|
}
|
|
74
|
-
const Y =
|
|
75
|
-
function
|
|
76
|
-
return e;
|
|
77
|
-
}
|
|
78
|
-
const fe = { width: 1440, height: 900 };
|
|
79
|
-
function X(e, t, o) {
|
|
80
|
-
o != null && e.append(t, String(o));
|
|
81
|
-
}
|
|
82
|
-
function he(e, t) {
|
|
83
|
-
const o = e.indexOf("#"), r = o >= 0 ? e.slice(o) : "", a = o >= 0 ? e.slice(0, o) : e, c = a.indexOf("?"), i = c >= 0 ? a.slice(0, c) : a, l = new URLSearchParams(c >= 0 ? a.slice(c + 1) : "");
|
|
84
|
-
for (const [s, x] of Object.entries(t.query))
|
|
85
|
-
if (l.delete(s), Array.isArray(x))
|
|
86
|
-
for (const f of x) X(l, s, f);
|
|
87
|
-
else
|
|
88
|
-
X(l, s, x);
|
|
89
|
-
const p = l.toString();
|
|
90
|
-
return `${i}${p ? `?${p}` : ""}${r}`;
|
|
91
|
-
}
|
|
92
|
-
function ge(e) {
|
|
93
|
-
const t = [], o = /* @__PURE__ */ new Set(), r = (a, c, i) => {
|
|
94
|
-
for (const l of a) {
|
|
95
|
-
if (!l.path) throw new Error("[pubuilder] page.path는 필수입니다");
|
|
96
|
-
if (!l.title) throw new Error(`[pubuilder] "${l.path}"의 title이 없습니다`);
|
|
97
|
-
if (o.has(l.path)) throw new Error(`[pubuilder] 중복 path: ${l.path}`);
|
|
98
|
-
if (o.add(l.path), t.push({
|
|
99
|
-
id: l.path,
|
|
100
|
-
path: l.path,
|
|
101
|
-
title: l.title,
|
|
102
|
-
external: l.external ?? /^https?:\/\//.test(l.path),
|
|
103
|
-
parentId: c,
|
|
104
|
-
depth: i
|
|
105
|
-
}), l.variants?.length) {
|
|
106
|
-
if (l.external ?? /^https?:\/\//.test(l.path))
|
|
107
|
-
throw new Error(`[pubuilder] 외부 페이지에는 variants를 사용할 수 없습니다: ${l.path}`);
|
|
108
|
-
for (const p of l.variants) {
|
|
109
|
-
if (!p.title) throw new Error(`[pubuilder] "${l.path}" variant의 title이 없습니다`);
|
|
110
|
-
const s = he(l.path, p);
|
|
111
|
-
if (o.has(s)) throw new Error(`[pubuilder] 중복 path: ${s}`);
|
|
112
|
-
o.add(s), t.push({
|
|
113
|
-
id: s,
|
|
114
|
-
path: s,
|
|
115
|
-
title: p.title,
|
|
116
|
-
external: !1,
|
|
117
|
-
parentId: l.path,
|
|
118
|
-
depth: i + 1
|
|
119
|
-
});
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
l.children?.length && r(l.children, l.path, i + 1);
|
|
123
|
-
}
|
|
124
|
-
};
|
|
125
|
-
if (r(e.pages, null, 0), t.length === 0) throw new Error("[pubuilder] pages가 비어 있습니다");
|
|
126
|
-
return { nodes: t, viewport: e.viewport ?? fe };
|
|
127
|
-
}
|
|
128
|
-
function xe() {
|
|
76
|
+
const Y = ae(new re());
|
|
77
|
+
function fe() {
|
|
129
78
|
return typeof process < "u" && process.env.NODE_ENV === "production";
|
|
130
79
|
}
|
|
131
80
|
const y = ue((e) => ({
|
|
@@ -142,9 +91,9 @@ const y = ue((e) => ({
|
|
|
142
91
|
closeViewer: () => e({ viewerPath: null, selection: null, selectedOuterHTML: null }),
|
|
143
92
|
setGranularity: (t) => e({ granularity: t }),
|
|
144
93
|
setInspectEnabled: (t) => e({ inspectEnabled: t }),
|
|
145
|
-
setSelectionWithHTML: (t,
|
|
94
|
+
setSelectionWithHTML: (t, r) => e({ selection: t, selectedOuterHTML: r }),
|
|
146
95
|
toggleSkillDrawer: () => e((t) => ({ skillDrawerOpen: !t.skillDrawerOpen }))
|
|
147
|
-
})), 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 = (
|
|
96
|
+
})), ge = ".react-flow{direction:ltr;--xy-edge-stroke-default: #b1b1b7;--xy-edge-stroke-width-default: 1;--xy-edge-stroke-selected-default: #555;--xy-connectionline-stroke-default: #b1b1b7;--xy-connectionline-stroke-width-default: 1;--xy-attribution-background-color-default: rgba(255, 255, 255, .5);--xy-minimap-background-color-default: #fff;--xy-minimap-mask-background-color-default: rgba(240, 240, 240, .6);--xy-minimap-mask-stroke-color-default: transparent;--xy-minimap-mask-stroke-width-default: 1;--xy-minimap-node-background-color-default: #e2e2e2;--xy-minimap-node-stroke-color-default: transparent;--xy-minimap-node-stroke-width-default: 2;--xy-background-color-default: transparent;--xy-background-pattern-dots-color-default: #91919a;--xy-background-pattern-lines-color-default: #eee;--xy-background-pattern-cross-color-default: #e2e2e2;background-color:var(--xy-background-color, var(--xy-background-color-default));--xy-node-color-default: inherit;--xy-node-border-default: 1px solid #1a192b;--xy-node-background-color-default: #fff;--xy-node-group-background-color-default: rgba(240, 240, 240, .25);--xy-node-boxshadow-hover-default: 0 1px 4px 1px rgba(0, 0, 0, .08);--xy-node-boxshadow-selected-default: 0 0 0 .5px #1a192b;--xy-node-border-radius-default: 3px;--xy-handle-background-color-default: #1a192b;--xy-handle-border-color-default: #fff;--xy-selection-background-color-default: rgba(0, 89, 220, .08);--xy-selection-border-default: 1px dotted rgba(0, 89, 220, .8);--xy-controls-button-background-color-default: #fefefe;--xy-controls-button-background-color-hover-default: #f4f4f4;--xy-controls-button-color-default: inherit;--xy-controls-button-color-hover-default: inherit;--xy-controls-button-border-color-default: #eee;--xy-controls-box-shadow-default: 0 0 2px 1px rgba(0, 0, 0, .08);--xy-edge-label-background-color-default: #ffffff;--xy-edge-label-color-default: inherit;--xy-resize-background-color-default: #3367d9}.react-flow.dark{--xy-edge-stroke-default: #3e3e3e;--xy-edge-stroke-width-default: 1;--xy-edge-stroke-selected-default: #727272;--xy-connectionline-stroke-default: #b1b1b7;--xy-connectionline-stroke-width-default: 1;--xy-attribution-background-color-default: rgba(150, 150, 150, .25);--xy-minimap-background-color-default: #141414;--xy-minimap-mask-background-color-default: rgba(60, 60, 60, .6);--xy-minimap-mask-stroke-color-default: transparent;--xy-minimap-mask-stroke-width-default: 1;--xy-minimap-node-background-color-default: #2b2b2b;--xy-minimap-node-stroke-color-default: transparent;--xy-minimap-node-stroke-width-default: 2;--xy-background-color-default: #141414;--xy-background-pattern-dots-color-default: #555;--xy-background-pattern-lines-color-default: #333;--xy-background-pattern-cross-color-default: #333;--xy-node-color-default: #f8f8f8;--xy-node-border-default: 1px solid #3c3c3c;--xy-node-background-color-default: #1e1e1e;--xy-node-group-background-color-default: rgba(240, 240, 240, .25);--xy-node-boxshadow-hover-default: 0 1px 4px 1px rgba(255, 255, 255, .08);--xy-node-boxshadow-selected-default: 0 0 0 .5px #999;--xy-handle-background-color-default: #bebebe;--xy-handle-border-color-default: #1e1e1e;--xy-selection-background-color-default: rgba(200, 200, 220, .08);--xy-selection-border-default: 1px dotted rgba(200, 200, 220, .8);--xy-controls-button-background-color-default: #2b2b2b;--xy-controls-button-background-color-hover-default: #3e3e3e;--xy-controls-button-color-default: #f8f8f8;--xy-controls-button-color-hover-default: #fff;--xy-controls-button-border-color-default: #5b5b5b;--xy-controls-box-shadow-default: 0 0 2px 1px rgba(0, 0, 0, .08);--xy-edge-label-background-color-default: #141414;--xy-edge-label-color-default: #f8f8f8}.react-flow__background{background-color:var(--xy-background-color-props, var(--xy-background-color, var(--xy-background-color-default)));pointer-events:none;z-index:-1}.react-flow__container{position:absolute;width:100%;height:100%;top:0;left:0}.react-flow__pane{z-index:1;touch-action:none}.react-flow__pane.draggable{cursor:grab}.react-flow__pane.dragging{cursor:grabbing}.react-flow__pane.selection{cursor:pointer}.react-flow__viewport{transform-origin:0 0;z-index:2;pointer-events:none}.react-flow__renderer{z-index:4}.react-flow__selection{z-index:6}.react-flow__nodesselection-rect:focus,.react-flow__nodesselection-rect:focus-visible{outline:none}.react-flow__edge-path{stroke:var(--xy-edge-stroke, var(--xy-edge-stroke-default));stroke-width:var(--xy-edge-stroke-width, var(--xy-edge-stroke-width-default));fill:none}.react-flow__connection-path{stroke:var(--xy-connectionline-stroke, var(--xy-connectionline-stroke-default));stroke-width:var(--xy-connectionline-stroke-width, var(--xy-connectionline-stroke-width-default));fill:none}.react-flow .react-flow__edges{position:absolute}.react-flow .react-flow__edges svg{overflow:visible;position:absolute;pointer-events:none}.react-flow__edge{pointer-events:visibleStroke}.react-flow__edge.selectable{cursor:pointer}.react-flow__edge.animated path{stroke-dasharray:5;animation:dashdraw .5s linear infinite}.react-flow__edge.animated path.react-flow__edge-interaction{stroke-dasharray:none;animation:none}.react-flow__edge.inactive{pointer-events:none}.react-flow__edge.selected,.react-flow__edge:focus,.react-flow__edge:focus-visible{outline:none}.react-flow__edge.selected .react-flow__edge-path,.react-flow__edge.selectable:focus .react-flow__edge-path,.react-flow__edge.selectable:focus-visible .react-flow__edge-path{stroke:var(--xy-edge-stroke-selected, var(--xy-edge-stroke-selected-default))}.react-flow__edge-textwrapper{pointer-events:all}.react-flow__edge .react-flow__edge-text{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__arrowhead polyline{stroke:var(--xy-edge-stroke, var(--xy-edge-stroke-default))}.react-flow__arrowhead polyline.arrowclosed{fill:var(--xy-edge-stroke, var(--xy-edge-stroke-default))}.react-flow__connection{pointer-events:none}.react-flow__connection .animated{stroke-dasharray:5;animation:dashdraw .5s linear infinite}svg.react-flow__connectionline{z-index:1001;overflow:visible;position:absolute}.react-flow__nodes{pointer-events:none;transform-origin:0 0}.react-flow__node{position:absolute;-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:all;transform-origin:0 0;box-sizing:border-box;cursor:default}.react-flow__node.selectable{cursor:pointer}.react-flow__node.draggable{cursor:grab;pointer-events:all}.react-flow__node.draggable.dragging{cursor:grabbing}.react-flow__nodesselection{z-index:3;transform-origin:left top;pointer-events:none}.react-flow__nodesselection-rect{position:absolute;pointer-events:all;cursor:grab}.react-flow__handle{position:absolute;pointer-events:none;min-width:5px;min-height:5px;width:6px;height:6px;background-color:var(--xy-handle-background-color, var(--xy-handle-background-color-default));border:1px solid var(--xy-handle-border-color, var(--xy-handle-border-color-default));border-radius:100%}.react-flow__handle.connectingfrom{pointer-events:all}.react-flow__handle.connectionindicator{pointer-events:all;cursor:crosshair}.react-flow__handle-bottom{top:auto;left:50%;bottom:0;transform:translate(-50%,50%)}.react-flow__handle-top{top:0;left:50%;transform:translate(-50%,-50%)}.react-flow__handle-left{top:50%;left:0;transform:translate(-50%,-50%)}.react-flow__handle-right{top:50%;right:0;transform:translate(50%,-50%)}.react-flow__edgeupdater{cursor:move;pointer-events:all}.react-flow__pane.selection .react-flow__panel{pointer-events:none}.react-flow__panel{position:absolute;z-index:5;margin:15px}.react-flow__panel.top{top:0}.react-flow__panel.bottom{bottom:0}.react-flow__panel.top.center,.react-flow__panel.bottom.center{left:50%;transform:translate(-15px) translate(-50%)}.react-flow__panel.left{left:0}.react-flow__panel.right{right:0}.react-flow__panel.left.center,.react-flow__panel.right.center{top:50%;transform:translateY(-15px) translateY(-50%)}.react-flow__attribution{font-size:10px;background:var(--xy-attribution-background-color, var(--xy-attribution-background-color-default));padding:2px 3px;margin:0}.react-flow__attribution a{text-decoration:none;color:#999}@keyframes dashdraw{0%{stroke-dashoffset:10}}.react-flow__edgelabel-renderer{position:absolute;width:100%;height:100%;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;left:0;top:0}.react-flow__viewport-portal{position:absolute;width:100%;height:100%;left:0;top:0;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__minimap{background:var( --xy-minimap-background-color-props, var(--xy-minimap-background-color, var(--xy-minimap-background-color-default)) )}.react-flow__minimap-svg{display:block}.react-flow__minimap-mask{fill:var( --xy-minimap-mask-background-color-props, var(--xy-minimap-mask-background-color, var(--xy-minimap-mask-background-color-default)) );stroke:var( --xy-minimap-mask-stroke-color-props, var(--xy-minimap-mask-stroke-color, var(--xy-minimap-mask-stroke-color-default)) );stroke-width:var( --xy-minimap-mask-stroke-width-props, var(--xy-minimap-mask-stroke-width, var(--xy-minimap-mask-stroke-width-default)) )}.react-flow__minimap-node{fill:var( --xy-minimap-node-background-color-props, var(--xy-minimap-node-background-color, var(--xy-minimap-node-background-color-default)) );stroke:var( --xy-minimap-node-stroke-color-props, var(--xy-minimap-node-stroke-color, var(--xy-minimap-node-stroke-color-default)) );stroke-width:var( --xy-minimap-node-stroke-width-props, var(--xy-minimap-node-stroke-width, var(--xy-minimap-node-stroke-width-default)) )}.react-flow__background-pattern.dots{fill:var( --xy-background-pattern-color-props, var(--xy-background-pattern-color, var(--xy-background-pattern-dots-color-default)) )}.react-flow__background-pattern.lines{stroke:var( --xy-background-pattern-color-props, var(--xy-background-pattern-color, var(--xy-background-pattern-lines-color-default)) )}.react-flow__background-pattern.cross{stroke:var( --xy-background-pattern-color-props, var(--xy-background-pattern-color, var(--xy-background-pattern-cross-color-default)) )}.react-flow__controls{display:flex;flex-direction:column;box-shadow:var(--xy-controls-box-shadow, var(--xy-controls-box-shadow-default))}.react-flow__controls.horizontal{flex-direction:row}.react-flow__controls-button{display:flex;justify-content:center;align-items:center;height:26px;width:26px;padding:4px;border:none;background:var(--xy-controls-button-background-color, var(--xy-controls-button-background-color-default));border-bottom:1px solid var( --xy-controls-button-border-color-props, var(--xy-controls-button-border-color, var(--xy-controls-button-border-color-default)) );color:var( --xy-controls-button-color-props, var(--xy-controls-button-color, var(--xy-controls-button-color-default)) );cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__controls-button svg{width:100%;max-width:12px;max-height:12px;fill:currentColor}.react-flow__edge.updating .react-flow__edge-path{stroke:#777}.react-flow__edge-text{font-size:10px}.react-flow__node.selectable:focus,.react-flow__node.selectable:focus-visible{outline:none}.react-flow__node-input,.react-flow__node-default,.react-flow__node-output,.react-flow__node-group{padding:10px;border-radius:var(--xy-node-border-radius, var(--xy-node-border-radius-default));width:150px;font-size:12px;color:var(--xy-node-color, var(--xy-node-color-default));text-align:center;border:var(--xy-node-border, var(--xy-node-border-default));background-color:var(--xy-node-background-color, var(--xy-node-background-color-default))}.react-flow__node-input.selectable:hover,.react-flow__node-default.selectable:hover,.react-flow__node-output.selectable:hover,.react-flow__node-group.selectable:hover{box-shadow:var(--xy-node-boxshadow-hover, var(--xy-node-boxshadow-hover-default))}.react-flow__node-input.selectable.selected,.react-flow__node-input.selectable:focus,.react-flow__node-input.selectable:focus-visible,.react-flow__node-default.selectable.selected,.react-flow__node-default.selectable:focus,.react-flow__node-default.selectable:focus-visible,.react-flow__node-output.selectable.selected,.react-flow__node-output.selectable:focus,.react-flow__node-output.selectable:focus-visible,.react-flow__node-group.selectable.selected,.react-flow__node-group.selectable:focus,.react-flow__node-group.selectable:focus-visible{box-shadow:var(--xy-node-boxshadow-selected, var(--xy-node-boxshadow-selected-default))}.react-flow__node-group{background-color:var(--xy-node-group-background-color, var(--xy-node-group-background-color-default))}.react-flow__nodesselection-rect,.react-flow__selection{background:var(--xy-selection-background-color, var(--xy-selection-background-color-default));border:var(--xy-selection-border, var(--xy-selection-border-default))}.react-flow__nodesselection-rect:focus,.react-flow__nodesselection-rect:focus-visible,.react-flow__selection:focus,.react-flow__selection:focus-visible{outline:none}.react-flow__controls-button:hover{background:var( --xy-controls-button-background-color-hover-props, var(--xy-controls-button-background-color-hover, var(--xy-controls-button-background-color-hover-default)) );color:var( --xy-controls-button-color-hover-props, var(--xy-controls-button-color-hover, var(--xy-controls-button-color-hover-default)) )}.react-flow__controls-button:disabled{pointer-events:none}.react-flow__controls-button:disabled svg{fill-opacity:.4}.react-flow__controls-button:last-child{border-bottom:none}.react-flow__controls.horizontal .react-flow__controls-button{border-bottom:none;border-right:1px solid var( --xy-controls-button-border-color-props, var(--xy-controls-button-border-color, var(--xy-controls-button-border-color-default)) )}.react-flow__controls.horizontal .react-flow__controls-button:last-child{border-right:none}.react-flow__resize-control{position:absolute}.react-flow__resize-control.left,.react-flow__resize-control.right{cursor:ew-resize}.react-flow__resize-control.top,.react-flow__resize-control.bottom{cursor:ns-resize}.react-flow__resize-control.top.left,.react-flow__resize-control.bottom.right{cursor:nwse-resize}.react-flow__resize-control.bottom.left,.react-flow__resize-control.top.right{cursor:nesw-resize}.react-flow__resize-control.handle{width:5px;height:5px;border:1px solid #fff;border-radius:1px;background-color:var(--xy-resize-background-color, var(--xy-resize-background-color-default));translate:-50% -50%}.react-flow__resize-control.handle.left{left:0;top:50%}.react-flow__resize-control.handle.right{left:100%;top:50%}.react-flow__resize-control.handle.top{left:50%;top:0}.react-flow__resize-control.handle.bottom{left:50%;top:100%}.react-flow__resize-control.handle.top.left,.react-flow__resize-control.handle.bottom.left{left:0}.react-flow__resize-control.handle.top.right,.react-flow__resize-control.handle.bottom.right{left:100%}.react-flow__resize-control.line{border-color:var(--xy-resize-background-color, var(--xy-resize-background-color-default));border-width:0;border-style:solid}.react-flow__resize-control.line.left,.react-flow__resize-control.line.right{width:1px;transform:translate(-50%);top:0;height:100%}.react-flow__resize-control.line.left{left:0;border-left-width:1px}.react-flow__resize-control.line.right{left:100%;border-right-width:1px}.react-flow__resize-control.line.top,.react-flow__resize-control.line.bottom{height:1px;transform:translateY(-50%);left:0;width:100%}.react-flow__resize-control.line.top{top:0;border-top-width:1px}.react-flow__resize-control.line.bottom{border-bottom-width:1px;top:100%}.react-flow__edge-textbg{fill:var(--xy-edge-label-background-color, var(--xy-edge-label-background-color-default))}.react-flow__edge-text{fill:var(--xy-edge-label-color, var(--xy-edge-label-color-default))}", he = "pubuilder-styles", me = "pubuilder-xyflow-styles", xe = (
|
|
148
97
|
/* css */
|
|
149
98
|
`
|
|
150
99
|
.pbu-fab {
|
|
@@ -509,68 +458,68 @@ const y = ue((e) => ({
|
|
|
509
458
|
}
|
|
510
459
|
`
|
|
511
460
|
);
|
|
512
|
-
function
|
|
461
|
+
function X(e, t) {
|
|
513
462
|
if (document.getElementById(e)) return;
|
|
514
|
-
const
|
|
515
|
-
|
|
463
|
+
const r = document.createElement("style");
|
|
464
|
+
r.id = e, r.textContent = t, document.head.appendChild(r);
|
|
516
465
|
}
|
|
517
|
-
function
|
|
518
|
-
typeof document > "u" || (
|
|
466
|
+
function we() {
|
|
467
|
+
typeof document > "u" || (X(me, ge), X(he, xe));
|
|
519
468
|
}
|
|
520
|
-
function
|
|
521
|
-
const
|
|
522
|
-
for (const
|
|
523
|
-
const
|
|
524
|
-
|
|
469
|
+
function ye(e, t, r, o = 140, l = 48) {
|
|
470
|
+
const a = /* @__PURE__ */ new Map();
|
|
471
|
+
for (const u of e) {
|
|
472
|
+
const w = a.get(u.parentId) ?? [];
|
|
473
|
+
w.push(u), a.set(u.parentId, w);
|
|
525
474
|
}
|
|
526
475
|
const i = /* @__PURE__ */ new Map();
|
|
527
|
-
let
|
|
528
|
-
const
|
|
529
|
-
const
|
|
476
|
+
let c = 0;
|
|
477
|
+
const h = (u) => {
|
|
478
|
+
const w = a.get(u.id) ?? [], f = u.depth * (t + o);
|
|
530
479
|
let v;
|
|
531
|
-
if (
|
|
532
|
-
v =
|
|
480
|
+
if (w.length === 0)
|
|
481
|
+
v = c, c += r + l;
|
|
533
482
|
else {
|
|
534
|
-
const N =
|
|
483
|
+
const N = w.map(h);
|
|
535
484
|
v = (Math.min(...N) + Math.max(...N)) / 2;
|
|
536
485
|
}
|
|
537
|
-
return i.set(
|
|
486
|
+
return i.set(u.id, { x: f, y: v }), v;
|
|
538
487
|
};
|
|
539
|
-
for (const
|
|
540
|
-
return e.map((
|
|
541
|
-
}
|
|
542
|
-
const
|
|
543
|
-
const { page:
|
|
544
|
-
|
|
545
|
-
const v =
|
|
546
|
-
if (!v ||
|
|
488
|
+
for (const u of a.get(null) ?? []) h(u);
|
|
489
|
+
return e.map((u) => ({ ...u, ...i.get(u.id) }));
|
|
490
|
+
}
|
|
491
|
+
const ve = ce(function(t) {
|
|
492
|
+
const { page: r, viewport: o, thumbWidth: l, bodyHeight: a } = t.data, i = y((v) => v.openViewer), c = D(null), [h, u] = _(!1);
|
|
493
|
+
R(() => {
|
|
494
|
+
const v = c.current;
|
|
495
|
+
if (!v || r.external) return;
|
|
547
496
|
const N = new IntersectionObserver(([g]) => {
|
|
548
|
-
g.isIntersecting && (
|
|
497
|
+
g.isIntersecting && (u(!0), N.disconnect());
|
|
549
498
|
});
|
|
550
499
|
return N.observe(v), () => N.disconnect();
|
|
551
|
-
}, [
|
|
552
|
-
const
|
|
553
|
-
return /* @__PURE__ */
|
|
554
|
-
|
|
500
|
+
}, [r.external]);
|
|
501
|
+
const w = l / o.width;
|
|
502
|
+
return /* @__PURE__ */ d("div", { ref: c, className: "pbu-node", style: { width: l }, onClick: () => {
|
|
503
|
+
r.external ? window.open(r.path, "_blank", "noopener") : i(r.path);
|
|
555
504
|
}, children: [
|
|
556
505
|
/* @__PURE__ */ n(J, { type: "target", position: j.Left, className: "pbu-handle", isConnectable: !1 }),
|
|
557
|
-
/* @__PURE__ */
|
|
558
|
-
/* @__PURE__ */ n("span", { className: "pbu-node-title", children:
|
|
559
|
-
/* @__PURE__ */ n("span", { className: "pbu-node-path", children:
|
|
506
|
+
/* @__PURE__ */ d("div", { className: "pbu-node-header", children: [
|
|
507
|
+
/* @__PURE__ */ n("span", { className: "pbu-node-title", children: r.title }),
|
|
508
|
+
/* @__PURE__ */ n("span", { className: "pbu-node-path", children: r.external ? "외부 ↗" : r.path })
|
|
560
509
|
] }),
|
|
561
|
-
/* @__PURE__ */
|
|
562
|
-
|
|
510
|
+
/* @__PURE__ */ d("div", { className: "pbu-node-body", style: { height: a }, children: [
|
|
511
|
+
r.external ? /* @__PURE__ */ n("div", { className: "pbu-node-placeholder", children: "↗ 외부 링크" }) : h ? /* @__PURE__ */ n(
|
|
563
512
|
"iframe",
|
|
564
513
|
{
|
|
565
514
|
className: "pbu-node-iframe",
|
|
566
|
-
src:
|
|
567
|
-
title: `${
|
|
515
|
+
src: r.path,
|
|
516
|
+
title: `${r.title} 미리보기`,
|
|
568
517
|
loading: "lazy",
|
|
569
518
|
tabIndex: -1,
|
|
570
519
|
style: {
|
|
571
|
-
width:
|
|
572
|
-
height:
|
|
573
|
-
transform: `scale(${
|
|
520
|
+
width: o.width,
|
|
521
|
+
height: o.height,
|
|
522
|
+
transform: `scale(${w})`
|
|
574
523
|
}
|
|
575
524
|
}
|
|
576
525
|
) : /* @__PURE__ */ n("div", { className: "pbu-node-placeholder", children: "…" }),
|
|
@@ -578,50 +527,50 @@ const Ne = ie(function(t) {
|
|
|
578
527
|
] }),
|
|
579
528
|
/* @__PURE__ */ n(J, { type: "source", position: j.Right, className: "pbu-handle", isConnectable: !1 })
|
|
580
529
|
] });
|
|
581
|
-
}),
|
|
582
|
-
function
|
|
583
|
-
const t = y((
|
|
584
|
-
const
|
|
530
|
+
}), ke = { page: ve }, G = 260, _e = 30;
|
|
531
|
+
function Ne({ ia: e }) {
|
|
532
|
+
const t = y((a) => a.closeMap), r = y((a) => a.toggleSkillDrawer), { nodes: o, edges: l } = V(() => {
|
|
533
|
+
const a = G / e.viewport.width, i = Math.round(e.viewport.height * a), c = i + _e, h = ye(e.nodes, G, c), u = h.map((f) => ({
|
|
585
534
|
id: f.id,
|
|
586
535
|
type: "page",
|
|
587
536
|
position: { x: f.x, y: f.y },
|
|
588
537
|
data: {
|
|
589
538
|
page: f,
|
|
590
539
|
viewport: e.viewport,
|
|
591
|
-
thumbWidth:
|
|
540
|
+
thumbWidth: G,
|
|
592
541
|
bodyHeight: i
|
|
593
542
|
},
|
|
594
543
|
sourcePosition: j.Right,
|
|
595
544
|
targetPosition: j.Left
|
|
596
|
-
})),
|
|
545
|
+
})), w = h.filter((f) => f.parentId).map((f) => ({
|
|
597
546
|
id: `${f.parentId}->${f.id}`,
|
|
598
547
|
source: f.parentId,
|
|
599
548
|
target: f.id,
|
|
600
549
|
type: "smoothstep"
|
|
601
550
|
}));
|
|
602
|
-
return { nodes:
|
|
551
|
+
return { nodes: u, edges: w };
|
|
603
552
|
}, [e]);
|
|
604
|
-
return
|
|
605
|
-
const
|
|
553
|
+
return R(() => {
|
|
554
|
+
const a = (i) => {
|
|
606
555
|
if (i.key !== "Escape") return;
|
|
607
|
-
const
|
|
608
|
-
|
|
556
|
+
const c = y.getState();
|
|
557
|
+
c.viewerPath || c.skillDrawerOpen || t();
|
|
609
558
|
};
|
|
610
|
-
return window.addEventListener("keydown",
|
|
611
|
-
}, [t]), /* @__PURE__ */
|
|
612
|
-
/* @__PURE__ */
|
|
559
|
+
return window.addEventListener("keydown", a), () => window.removeEventListener("keydown", a);
|
|
560
|
+
}, [t]), /* @__PURE__ */ d("div", { className: "pbu-overlay", children: [
|
|
561
|
+
/* @__PURE__ */ d("div", { className: "pbu-bar", children: [
|
|
613
562
|
/* @__PURE__ */ n("span", { className: "pbu-logo", children: "pubuilder" }),
|
|
614
563
|
/* @__PURE__ */ n("span", { className: "pbu-hint", children: "노드 클릭 → 페이지 확대 · 스크롤 줌 · 드래그 팬 · Esc 닫기" }),
|
|
615
564
|
/* @__PURE__ */ n("span", { className: "pbu-spacer" }),
|
|
616
|
-
/* @__PURE__ */ n("button", { type: "button", className: "pbu-btn", onClick:
|
|
565
|
+
/* @__PURE__ */ n("button", { type: "button", className: "pbu-btn", onClick: r, children: "🧰 스킬함" }),
|
|
617
566
|
/* @__PURE__ */ n("button", { type: "button", className: "pbu-icon-btn", onClick: t, "aria-label": "닫기", children: "✕" })
|
|
618
567
|
] }),
|
|
619
568
|
/* @__PURE__ */ n("div", { className: "pbu-canvas", children: /* @__PURE__ */ n(
|
|
620
569
|
pe,
|
|
621
570
|
{
|
|
622
|
-
nodes:
|
|
623
|
-
edges:
|
|
624
|
-
nodeTypes:
|
|
571
|
+
nodes: o,
|
|
572
|
+
edges: l,
|
|
573
|
+
nodeTypes: ke,
|
|
625
574
|
fitView: !0,
|
|
626
575
|
fitViewOptions: { padding: 0.15, maxZoom: 1 },
|
|
627
576
|
minZoom: 0.05,
|
|
@@ -633,8 +582,8 @@ function Se({ ia: e }) {
|
|
|
633
582
|
) })
|
|
634
583
|
] });
|
|
635
584
|
}
|
|
636
|
-
function
|
|
637
|
-
const e = y((
|
|
585
|
+
function ze() {
|
|
586
|
+
const e = y((o) => o.isMapOpen), t = y((o) => o.openMap), r = y((o) => o.closeMap);
|
|
638
587
|
return /* @__PURE__ */ n(
|
|
639
588
|
"button",
|
|
640
589
|
{
|
|
@@ -642,8 +591,8 @@ function Ce() {
|
|
|
642
591
|
className: "pbu-fab",
|
|
643
592
|
title: "Page Map (pubuilder)",
|
|
644
593
|
"aria-label": "페이지 맵 열기",
|
|
645
|
-
onClick: () => e ?
|
|
646
|
-
children: /* @__PURE__ */
|
|
594
|
+
onClick: () => e ? r() : t(),
|
|
595
|
+
children: /* @__PURE__ */ d("svg", { width: "22", height: "22", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: [
|
|
647
596
|
/* @__PURE__ */ n("polygon", { points: "3 6 9 3 15 6 21 3 21 18 15 21 9 18 3 21" }),
|
|
648
597
|
/* @__PURE__ */ n("line", { x1: "9", y1: "3", x2: "9", y2: "18" }),
|
|
649
598
|
/* @__PURE__ */ n("line", { x1: "15", y1: "6", x2: "15", y2: "21" })
|
|
@@ -651,7 +600,7 @@ function Ce() {
|
|
|
651
600
|
}
|
|
652
601
|
);
|
|
653
602
|
}
|
|
654
|
-
const
|
|
603
|
+
const Ce = /* @__PURE__ */ new Set([
|
|
655
604
|
"section",
|
|
656
605
|
"header",
|
|
657
606
|
"footer",
|
|
@@ -660,7 +609,7 @@ const Te = /* @__PURE__ */ new Set([
|
|
|
660
609
|
"article",
|
|
661
610
|
"aside",
|
|
662
611
|
"form"
|
|
663
|
-
]),
|
|
612
|
+
]), Ee = /* @__PURE__ */ new Set([
|
|
664
613
|
"a",
|
|
665
614
|
"button",
|
|
666
615
|
"input",
|
|
@@ -680,90 +629,90 @@ const Te = /* @__PURE__ */ new Set([
|
|
|
680
629
|
"p",
|
|
681
630
|
"label"
|
|
682
631
|
]);
|
|
683
|
-
function
|
|
684
|
-
const
|
|
685
|
-
let
|
|
686
|
-
for (;
|
|
687
|
-
|
|
688
|
-
return
|
|
689
|
-
}
|
|
690
|
-
function
|
|
691
|
-
const
|
|
692
|
-
if (
|
|
693
|
-
const
|
|
694
|
-
const
|
|
695
|
-
return
|
|
632
|
+
function ne(e, t) {
|
|
633
|
+
const r = [];
|
|
634
|
+
let o = e;
|
|
635
|
+
for (; o && o !== t.body && o !== t.documentElement; )
|
|
636
|
+
r.push(o), o = o.parentElement;
|
|
637
|
+
return r;
|
|
638
|
+
}
|
|
639
|
+
function Se(e, t) {
|
|
640
|
+
const r = ne(e, t);
|
|
641
|
+
if (r.length === 0) return null;
|
|
642
|
+
const o = r.find((i) => {
|
|
643
|
+
const c = i.tagName.toLowerCase();
|
|
644
|
+
return Ce.has(c) && c !== "main";
|
|
696
645
|
});
|
|
697
|
-
if (
|
|
698
|
-
const
|
|
699
|
-
if (
|
|
700
|
-
const
|
|
701
|
-
for (let i =
|
|
702
|
-
const
|
|
703
|
-
if (
|
|
646
|
+
if (o) return o;
|
|
647
|
+
const l = r.find((i) => i.tagName.toLowerCase() === "main");
|
|
648
|
+
if (l) return l;
|
|
649
|
+
const a = t.body.scrollHeight || 1;
|
|
650
|
+
for (let i = r.length - 1; i >= 0; i--) {
|
|
651
|
+
const c = r[i].getBoundingClientRect();
|
|
652
|
+
if (c.height > 0 && c.height < a * 0.8) return r[i];
|
|
704
653
|
}
|
|
705
|
-
return
|
|
706
|
-
}
|
|
707
|
-
function
|
|
708
|
-
const
|
|
709
|
-
for (const
|
|
710
|
-
if (
|
|
711
|
-
const
|
|
712
|
-
if (
|
|
654
|
+
return r[r.length - 1];
|
|
655
|
+
}
|
|
656
|
+
function Te(e, t) {
|
|
657
|
+
const r = ne(e, t);
|
|
658
|
+
for (const o of r) {
|
|
659
|
+
if (Ee.has(o.tagName.toLowerCase())) return o;
|
|
660
|
+
const l = o.getBoundingClientRect(), a = o.children.length > 0 || (o.textContent ?? "").trim().length > 0;
|
|
661
|
+
if (l.width >= 40 && l.height >= 24 && a) return o;
|
|
713
662
|
}
|
|
714
|
-
return
|
|
663
|
+
return r[0] ?? null;
|
|
715
664
|
}
|
|
716
|
-
function
|
|
717
|
-
return
|
|
665
|
+
function Le(e, t, r) {
|
|
666
|
+
return r === "all" ? t.body : r === "section" ? Se(e, t) : Te(e, t);
|
|
718
667
|
}
|
|
719
|
-
function
|
|
720
|
-
const
|
|
721
|
-
if (o) return B(o);
|
|
722
|
-
const r = e.getAttribute("aria-label");
|
|
668
|
+
function Me(e) {
|
|
669
|
+
const r = e.querySelector("h1, h2, h3, h4, h5, h6")?.textContent?.trim();
|
|
723
670
|
if (r) return B(r);
|
|
724
|
-
const
|
|
725
|
-
if (
|
|
726
|
-
const
|
|
727
|
-
|
|
671
|
+
const o = e.getAttribute("aria-label");
|
|
672
|
+
if (o) return B(o);
|
|
673
|
+
const l = e.getAttribute("alt");
|
|
674
|
+
if (l) return B(l);
|
|
675
|
+
const a = (e.textContent ?? "").trim().replace(/\s+/g, " ");
|
|
676
|
+
return a ? B(a) : `<${e.tagName.toLowerCase()}>`;
|
|
728
677
|
}
|
|
729
678
|
function B(e, t = 30) {
|
|
730
679
|
return e.length > t ? `${e.slice(0, t)}…` : e;
|
|
731
680
|
}
|
|
732
|
-
function
|
|
681
|
+
function Pe(e, t) {
|
|
733
682
|
if (e.id) return `#${CSS.escape(e.id)}`;
|
|
734
|
-
const
|
|
735
|
-
let
|
|
736
|
-
for (;
|
|
737
|
-
if (
|
|
738
|
-
return
|
|
739
|
-
const
|
|
740
|
-
let i =
|
|
741
|
-
if (
|
|
742
|
-
const
|
|
743
|
-
(
|
|
683
|
+
const r = [];
|
|
684
|
+
let o = e;
|
|
685
|
+
for (; o && o !== t.body && r.length < 8; ) {
|
|
686
|
+
if (o.id)
|
|
687
|
+
return r.unshift(`#${CSS.escape(o.id)}`), r.join(" > ");
|
|
688
|
+
const l = o.tagName.toLowerCase(), a = o.parentElement;
|
|
689
|
+
let i = l;
|
|
690
|
+
if (a) {
|
|
691
|
+
const c = Array.from(a.children).filter(
|
|
692
|
+
(h) => h.tagName === o.tagName
|
|
744
693
|
);
|
|
745
|
-
|
|
694
|
+
c.length > 1 && (i += `:nth-of-type(${c.indexOf(o) + 1})`);
|
|
746
695
|
}
|
|
747
|
-
|
|
696
|
+
r.unshift(i), o = a;
|
|
748
697
|
}
|
|
749
|
-
return
|
|
698
|
+
return r.join(" > ");
|
|
750
699
|
}
|
|
751
|
-
function
|
|
752
|
-
const
|
|
753
|
-
|
|
700
|
+
function K(e, t, r) {
|
|
701
|
+
const o = e.createElement("div");
|
|
702
|
+
o.setAttribute("data-pubuilder", "highlight"), Object.assign(o.style, {
|
|
754
703
|
position: "fixed",
|
|
755
704
|
top: "0",
|
|
756
705
|
left: "0",
|
|
757
706
|
display: "none",
|
|
758
707
|
border: `1px solid ${t}`,
|
|
759
|
-
background:
|
|
708
|
+
background: r,
|
|
760
709
|
borderRadius: "0",
|
|
761
710
|
pointerEvents: "none",
|
|
762
711
|
zIndex: "2147483647",
|
|
763
712
|
boxSizing: "border-box"
|
|
764
713
|
});
|
|
765
|
-
const
|
|
766
|
-
return Object.assign(
|
|
714
|
+
const l = e.createElement("div");
|
|
715
|
+
return Object.assign(l.style, {
|
|
767
716
|
position: "absolute",
|
|
768
717
|
left: "-1px",
|
|
769
718
|
top: "-22px",
|
|
@@ -774,276 +723,276 @@ function Z(e, t, o) {
|
|
|
774
723
|
borderRadius: "0",
|
|
775
724
|
whiteSpace: "nowrap",
|
|
776
725
|
pointerEvents: "none"
|
|
777
|
-
}),
|
|
726
|
+
}), o.appendChild(l), { root: o, label: l };
|
|
778
727
|
}
|
|
779
|
-
function
|
|
780
|
-
const
|
|
781
|
-
if (
|
|
728
|
+
function Z(e, t, r, o) {
|
|
729
|
+
const l = t.getBoundingClientRect(), a = o ?? -1 / 0, i = Math.max(l.top, a), c = l.bottom - i;
|
|
730
|
+
if (c <= 2) {
|
|
782
731
|
W(e);
|
|
783
732
|
return;
|
|
784
733
|
}
|
|
785
|
-
e.root.style.display = "block", e.root.style.transform = `translate(${
|
|
734
|
+
e.root.style.display = "block", e.root.style.transform = `translate(${l.x}px, ${i}px)`, e.root.style.width = `${l.width}px`, e.root.style.height = `${c}px`, e.label.textContent = r, e.label.style.top = i < 30 || i - 24 < a ? "2px" : "-24px";
|
|
786
735
|
}
|
|
787
736
|
function W(e) {
|
|
788
737
|
e.root.style.display = "none";
|
|
789
738
|
}
|
|
790
|
-
function
|
|
739
|
+
function Q(e) {
|
|
791
740
|
const t = e.getBoundingClientRect();
|
|
792
741
|
return `${e.tagName.toLowerCase()} · ${Math.round(t.width)}×${Math.round(t.height)}`;
|
|
793
742
|
}
|
|
794
|
-
function
|
|
795
|
-
let
|
|
743
|
+
function Oe(e, t) {
|
|
744
|
+
let r = null;
|
|
796
745
|
try {
|
|
797
|
-
|
|
746
|
+
r = e.contentDocument;
|
|
798
747
|
} catch {
|
|
799
748
|
return null;
|
|
800
749
|
}
|
|
801
|
-
const
|
|
802
|
-
if (!
|
|
803
|
-
const
|
|
804
|
-
let
|
|
805
|
-
const
|
|
806
|
-
|
|
750
|
+
const o = e.contentWindow;
|
|
751
|
+
if (!r || !r.body || !o) return null;
|
|
752
|
+
const l = r;
|
|
753
|
+
let a = t.granularity, i = t.enabled, c = null, h = null;
|
|
754
|
+
const u = K(l, "rgba(14,99,156,0.95)", "rgba(14,99,156,0.10)"), w = K(l, "rgba(35,134,54,0.95)", "rgba(35,134,54,0.07)");
|
|
755
|
+
l.body.appendChild(u.root), l.body.appendChild(w.root);
|
|
807
756
|
let f = [], v = 0;
|
|
808
757
|
const N = () => {
|
|
809
758
|
f = [];
|
|
810
|
-
for (const
|
|
811
|
-
if (
|
|
812
|
-
const k =
|
|
759
|
+
for (const p of Array.from(l.body.querySelectorAll("*"))) {
|
|
760
|
+
if (p === u.root || p === w.root || u.root.contains(p) || w.root.contains(p)) continue;
|
|
761
|
+
const k = o.getComputedStyle(p).position;
|
|
813
762
|
if (k !== "fixed" && k !== "sticky") continue;
|
|
814
|
-
const m =
|
|
815
|
-
m.width === 0 || m.height === 0 || m.top <= 1 && m.height <
|
|
763
|
+
const m = p.getBoundingClientRect();
|
|
764
|
+
m.width === 0 || m.height === 0 || m.top <= 1 && m.height < o.innerHeight * 0.5 && f.push({ el: p, rect: m });
|
|
816
765
|
}
|
|
817
766
|
}, g = () => {
|
|
818
|
-
const
|
|
819
|
-
|
|
820
|
-
},
|
|
821
|
-
const k =
|
|
767
|
+
const p = Date.now();
|
|
768
|
+
p - v < 500 || (v = p, N());
|
|
769
|
+
}, E = (p) => {
|
|
770
|
+
const k = p.getBoundingClientRect();
|
|
822
771
|
let m = null;
|
|
823
|
-
for (const
|
|
824
|
-
|
|
772
|
+
for (const z of f)
|
|
773
|
+
z.el === p || z.el.contains(p) || p.contains(z.el) || !(k.left < z.rect.right && k.right > z.rect.left) || (m === null || z.rect.bottom > m) && (m = z.rect.bottom);
|
|
825
774
|
return m;
|
|
826
|
-
},
|
|
827
|
-
|
|
828
|
-
}, L = (
|
|
829
|
-
if (
|
|
830
|
-
if (
|
|
831
|
-
if (
|
|
832
|
-
let k =
|
|
833
|
-
for (; k.parentElement && k.parentElement !==
|
|
775
|
+
}, S = () => {
|
|
776
|
+
c && i && c.isConnected ? Z(u, c, Q(c), E(c)) : W(u), h && h.isConnected ? Z(w, h, `선택됨 · ${Q(h)}`, E(h)) : W(w);
|
|
777
|
+
}, L = (p) => {
|
|
778
|
+
if (a === "all") return l.body;
|
|
779
|
+
if (h && h.isConnected && h.contains(p)) {
|
|
780
|
+
if (h === p) return h;
|
|
781
|
+
let k = p;
|
|
782
|
+
for (; k.parentElement && k.parentElement !== h; )
|
|
834
783
|
k = k.parentElement;
|
|
835
784
|
return k;
|
|
836
785
|
}
|
|
837
|
-
return
|
|
838
|
-
},
|
|
786
|
+
return Le(p, l, a);
|
|
787
|
+
}, I = (p) => {
|
|
839
788
|
if (!i) return;
|
|
840
789
|
g();
|
|
841
|
-
const k =
|
|
842
|
-
if (!k || !
|
|
790
|
+
const k = p.target;
|
|
791
|
+
if (!k || !l.body.contains(k)) return;
|
|
843
792
|
const m = L(k);
|
|
844
|
-
m !==
|
|
845
|
-
}, M = (
|
|
793
|
+
m !== c && (c = m, S());
|
|
794
|
+
}, M = (p) => {
|
|
846
795
|
if (!i) return;
|
|
847
|
-
|
|
848
|
-
const k =
|
|
796
|
+
p.preventDefault(), p.stopPropagation(), N(), v = Date.now();
|
|
797
|
+
const k = p.target;
|
|
849
798
|
if (!k) return;
|
|
850
799
|
const m = L(k);
|
|
851
800
|
if (!m) return;
|
|
852
|
-
|
|
853
|
-
const
|
|
801
|
+
h = m, S();
|
|
802
|
+
const z = m.getBoundingClientRect();
|
|
854
803
|
t.onSelect(
|
|
855
804
|
{
|
|
856
805
|
pagePath: t.pagePath,
|
|
857
|
-
selector:
|
|
806
|
+
selector: Pe(m, l),
|
|
858
807
|
tag: m.tagName.toLowerCase(),
|
|
859
|
-
label:
|
|
808
|
+
label: Me(m),
|
|
860
809
|
rect: {
|
|
861
|
-
x:
|
|
862
|
-
y:
|
|
863
|
-
width:
|
|
864
|
-
height:
|
|
810
|
+
x: z.x + o.scrollX,
|
|
811
|
+
y: z.y + o.scrollY,
|
|
812
|
+
width: z.width,
|
|
813
|
+
height: z.height
|
|
865
814
|
},
|
|
866
|
-
granularity:
|
|
815
|
+
granularity: a
|
|
867
816
|
},
|
|
868
817
|
m
|
|
869
818
|
);
|
|
870
819
|
}, T = () => {
|
|
871
|
-
|
|
872
|
-
}, O = () =>
|
|
873
|
-
N(),
|
|
820
|
+
c = null, S();
|
|
821
|
+
}, O = () => S(), P = () => {
|
|
822
|
+
N(), S();
|
|
874
823
|
};
|
|
875
|
-
return N(),
|
|
824
|
+
return N(), l.addEventListener("mousemove", I, !0), l.addEventListener("click", M, !0), l.documentElement.addEventListener("mouseleave", T), o.addEventListener("scroll", O, !0), o.addEventListener("resize", P), {
|
|
876
825
|
destroy() {
|
|
877
826
|
try {
|
|
878
|
-
|
|
827
|
+
l.removeEventListener("mousemove", I, !0), l.removeEventListener("click", M, !0), l.documentElement.removeEventListener("mouseleave", T), o.removeEventListener("scroll", O, !0), o.removeEventListener("resize", P), u.root.remove(), w.root.remove();
|
|
879
828
|
} catch {
|
|
880
829
|
}
|
|
881
830
|
},
|
|
882
|
-
setGranularity(
|
|
883
|
-
|
|
831
|
+
setGranularity(p) {
|
|
832
|
+
a = p, c = null, S();
|
|
884
833
|
},
|
|
885
|
-
setEnabled(
|
|
886
|
-
i =
|
|
834
|
+
setEnabled(p) {
|
|
835
|
+
i = p, p || (c = null), S();
|
|
887
836
|
}
|
|
888
837
|
};
|
|
889
838
|
}
|
|
890
|
-
const
|
|
839
|
+
const Re = {
|
|
891
840
|
log: "💬",
|
|
892
841
|
tool: "🔧",
|
|
893
842
|
error: "⛔",
|
|
894
843
|
done: "✅"
|
|
895
844
|
};
|
|
896
|
-
function
|
|
897
|
-
const e =
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
}, [t?.selector]),
|
|
901
|
-
const
|
|
902
|
-
|
|
903
|
-
}, [
|
|
904
|
-
|
|
845
|
+
function Ie() {
|
|
846
|
+
const e = te(Y), t = y((s) => s.selection), r = y((s) => s.selectedOuterHTML), o = y((s) => s.toggleSkillDrawer), [l, a] = _(""), [i, c] = _("idle"), [h, u] = _(null), [w, f] = _([]), [v, N] = _(!1), [g, E] = _(!1), [S, L] = _(null), [I, M] = _(null), [T, O] = _(!1), [P, p] = _(!1), k = D(null), m = D(null), z = D(0);
|
|
847
|
+
R(() => {
|
|
848
|
+
z.current++, m.current?.(), m.current = null, c("idle"), u(null), f([]), N(!1), E(!1), O(!1), L(null), M(null), a("");
|
|
849
|
+
}, [t?.selector]), R(() => {
|
|
850
|
+
const s = k.current;
|
|
851
|
+
s && (s.scrollTop = s.scrollHeight);
|
|
852
|
+
}, [w]), R(() => () => {
|
|
853
|
+
z.current++, m.current?.(), m.current = null;
|
|
905
854
|
}, []);
|
|
906
|
-
const A = (
|
|
907
|
-
m.current = e.subscribePublish(
|
|
908
|
-
f((
|
|
855
|
+
const A = (s) => {
|
|
856
|
+
m.current = e.subscribePublish(s, (C) => {
|
|
857
|
+
f(($) => [...$, C]), C.type === "done" ? (c("done"), u(null), O(!1), m.current?.(), m.current = null) : C.type === "error" && (c("error"), L(C.text), u(null), O(!1), m.current?.(), m.current = null);
|
|
909
858
|
});
|
|
910
|
-
},
|
|
859
|
+
}, F = async () => {
|
|
911
860
|
if (!t || i === "running" || g) return;
|
|
912
|
-
const
|
|
913
|
-
N(!1), L(null), M(null),
|
|
861
|
+
const s = z.current;
|
|
862
|
+
N(!1), L(null), M(null), E(!0);
|
|
914
863
|
try {
|
|
915
|
-
const
|
|
916
|
-
if (
|
|
917
|
-
if (!
|
|
864
|
+
const C = await e.isAlive();
|
|
865
|
+
if (s !== z.current) return;
|
|
866
|
+
if (!C) {
|
|
918
867
|
N(!0);
|
|
919
868
|
return;
|
|
920
869
|
}
|
|
921
|
-
const { jobId:
|
|
870
|
+
const { jobId: $ } = await e.startPublish({
|
|
922
871
|
selection: t,
|
|
923
|
-
outerHTML:
|
|
924
|
-
figmaUrl:
|
|
872
|
+
outerHTML: r ?? "",
|
|
873
|
+
figmaUrl: l
|
|
925
874
|
});
|
|
926
|
-
if (
|
|
927
|
-
e.cancelPublish(
|
|
875
|
+
if (s !== z.current) {
|
|
876
|
+
e.cancelPublish($).catch(() => {
|
|
928
877
|
});
|
|
929
878
|
return;
|
|
930
879
|
}
|
|
931
|
-
|
|
932
|
-
} catch (
|
|
933
|
-
if (
|
|
934
|
-
|
|
880
|
+
u($), f([]), c("running"), A($);
|
|
881
|
+
} catch (C) {
|
|
882
|
+
if (s !== z.current) return;
|
|
883
|
+
c("error"), L(C instanceof Error ? C.message : String(C)), M(C instanceof oe ? C.code ?? null : null);
|
|
935
884
|
} finally {
|
|
936
|
-
|
|
885
|
+
E(!1);
|
|
937
886
|
}
|
|
938
|
-
},
|
|
939
|
-
if (!(!
|
|
887
|
+
}, U = async () => {
|
|
888
|
+
if (!(!h || T)) {
|
|
940
889
|
O(!0);
|
|
941
890
|
try {
|
|
942
|
-
await e.cancelPublish(
|
|
943
|
-
} catch (
|
|
944
|
-
L(
|
|
891
|
+
await e.cancelPublish(h);
|
|
892
|
+
} catch (s) {
|
|
893
|
+
L(s instanceof Error ? s.message : String(s)), O(!1);
|
|
945
894
|
}
|
|
946
895
|
}
|
|
947
896
|
}, q = async () => {
|
|
948
|
-
await navigator.clipboard.writeText("npx pubuilder serve"),
|
|
897
|
+
await navigator.clipboard.writeText("npx pubuilder serve"), p(!0), setTimeout(() => p(!1), 1200);
|
|
949
898
|
}, H = async () => {
|
|
950
|
-
|
|
899
|
+
E(!0);
|
|
951
900
|
try {
|
|
952
|
-
const
|
|
953
|
-
N(!
|
|
901
|
+
const s = await e.isAlive();
|
|
902
|
+
N(!s);
|
|
954
903
|
} finally {
|
|
955
|
-
|
|
904
|
+
E(!1);
|
|
956
905
|
}
|
|
957
|
-
},
|
|
958
|
-
return /* @__PURE__ */
|
|
906
|
+
}, b = i === "running";
|
|
907
|
+
return /* @__PURE__ */ d("div", { className: "pbu-publish", children: [
|
|
959
908
|
/* @__PURE__ */ n("label", { children: "Figma 노드 링크" }),
|
|
960
909
|
/* @__PURE__ */ n(
|
|
961
910
|
"input",
|
|
962
911
|
{
|
|
963
|
-
value:
|
|
964
|
-
onChange: (
|
|
965
|
-
disabled:
|
|
912
|
+
value: l,
|
|
913
|
+
onChange: (s) => a(s.target.value),
|
|
914
|
+
disabled: b,
|
|
966
915
|
placeholder: "https://www.figma.com/design/..."
|
|
967
916
|
}
|
|
968
917
|
),
|
|
969
|
-
v && /* @__PURE__ */
|
|
918
|
+
v && /* @__PURE__ */ d("div", { className: "pbu-panel-empty", children: [
|
|
970
919
|
"컴패니언 서버가 꺼져 있어요",
|
|
971
|
-
/* @__PURE__ */
|
|
920
|
+
/* @__PURE__ */ d("div", { className: "pbu-drawer-code", children: [
|
|
972
921
|
/* @__PURE__ */ n("code", { children: "npx pubuilder serve" }),
|
|
973
922
|
/* @__PURE__ */ n("button", { type: "button", className: "pbu-btn", onClick: q, children: P ? "복사됨 ✓" : "복사" })
|
|
974
923
|
] }),
|
|
975
924
|
/* @__PURE__ */ n("div", { className: "pbu-hint", children: 'package.json의 dev 스크립트를 "pubuilder dev -- <기존 명령>"으로 감싸면 자동 실행돼요' }),
|
|
976
925
|
/* @__PURE__ */ n("button", { type: "button", className: "pbu-btn", disabled: g, onClick: H, children: "다시 확인" })
|
|
977
926
|
] }),
|
|
978
|
-
|
|
979
|
-
/* @__PURE__ */ n("span", { children:
|
|
980
|
-
(
|
|
927
|
+
S && !v && /* @__PURE__ */ d("div", { className: "pbu-drawer-error", children: [
|
|
928
|
+
/* @__PURE__ */ n("span", { children: S }),
|
|
929
|
+
(I === "NO_FIGMA_TOKEN" || I === "FIGMA_API_ERROR") && /* @__PURE__ */ n("button", { type: "button", className: "pbu-btn", onClick: o, children: "스킬함 열기" })
|
|
981
930
|
] }),
|
|
982
|
-
|
|
931
|
+
b ? /* @__PURE__ */ n("button", { type: "button", className: "pbu-btn pbu-btn-primary", disabled: T, onClick: U, children: T ? "중단 중..." : "중단" }) : /* @__PURE__ */ n(
|
|
983
932
|
"button",
|
|
984
933
|
{
|
|
985
934
|
type: "button",
|
|
986
935
|
className: "pbu-btn pbu-btn-primary",
|
|
987
936
|
disabled: g || !t,
|
|
988
|
-
onClick:
|
|
937
|
+
onClick: F,
|
|
989
938
|
children: "이 블록 퍼블리싱"
|
|
990
939
|
}
|
|
991
940
|
),
|
|
992
|
-
(
|
|
993
|
-
|
|
994
|
-
|
|
941
|
+
(w.length > 0 || b) && /* @__PURE__ */ d("div", { className: "pbu-publish-log", ref: k, children: [
|
|
942
|
+
b && w.length === 0 && /* @__PURE__ */ n("div", { className: "pbu-log-line pbu-log-tool", children: "실행 중..." }),
|
|
943
|
+
w.map((s, C) => /* @__PURE__ */ d(
|
|
995
944
|
"div",
|
|
996
945
|
{
|
|
997
|
-
className:
|
|
946
|
+
className: s.type === "error" ? "pbu-log-line pbu-log-error" : s.type === "done" ? "pbu-log-line pbu-log-done" : s.type === "tool" ? "pbu-log-line pbu-log-tool" : "pbu-log-line",
|
|
998
947
|
children: [
|
|
999
|
-
/* @__PURE__ */ n("span", { children:
|
|
948
|
+
/* @__PURE__ */ n("span", { children: Re[s.type] }),
|
|
1000
949
|
" ",
|
|
1001
|
-
/* @__PURE__ */ n("span", { children:
|
|
950
|
+
/* @__PURE__ */ n("span", { children: s.text })
|
|
1002
951
|
]
|
|
1003
952
|
},
|
|
1004
|
-
|
|
953
|
+
C
|
|
1005
954
|
))
|
|
1006
955
|
] })
|
|
1007
956
|
] });
|
|
1008
957
|
}
|
|
1009
|
-
function
|
|
1010
|
-
const e = y((
|
|
1011
|
-
e && (await navigator.clipboard.writeText(e.selector),
|
|
958
|
+
function De() {
|
|
959
|
+
const e = y((l) => l.selection), [t, r] = _(!1), o = async () => {
|
|
960
|
+
e && (await navigator.clipboard.writeText(e.selector), r(!0), setTimeout(() => r(!1), 1200));
|
|
1012
961
|
};
|
|
1013
|
-
return /* @__PURE__ */
|
|
962
|
+
return /* @__PURE__ */ d("aside", { className: "pbu-panel", children: [
|
|
1014
963
|
/* @__PURE__ */ n("div", { className: "pbu-panel-title", children: "선택된 블록" }),
|
|
1015
|
-
e ? /* @__PURE__ */
|
|
1016
|
-
/* @__PURE__ */
|
|
964
|
+
e ? /* @__PURE__ */ d(ee, { children: [
|
|
965
|
+
/* @__PURE__ */ d("div", { className: "pbu-field", children: [
|
|
1017
966
|
/* @__PURE__ */ n("label", { children: "페이지" }),
|
|
1018
967
|
/* @__PURE__ */ n("code", { children: e.pagePath })
|
|
1019
968
|
] }),
|
|
1020
|
-
/* @__PURE__ */
|
|
969
|
+
/* @__PURE__ */ d("div", { className: "pbu-field", children: [
|
|
1021
970
|
/* @__PURE__ */ n("label", { children: "블록" }),
|
|
1022
|
-
/* @__PURE__ */
|
|
971
|
+
/* @__PURE__ */ d("div", { children: [
|
|
1023
972
|
/* @__PURE__ */ n("span", { className: "pbu-chip", children: e.tag }),
|
|
1024
973
|
/* @__PURE__ */ n("span", { children: e.label })
|
|
1025
974
|
] })
|
|
1026
975
|
] }),
|
|
1027
|
-
/* @__PURE__ */
|
|
976
|
+
/* @__PURE__ */ d("div", { className: "pbu-field", children: [
|
|
1028
977
|
/* @__PURE__ */ n("label", { children: "Selector" }),
|
|
1029
978
|
/* @__PURE__ */ n("code", { className: "pbu-selector", children: e.selector }),
|
|
1030
|
-
/* @__PURE__ */ n("button", { type: "button", className: "pbu-btn", onClick:
|
|
979
|
+
/* @__PURE__ */ n("button", { type: "button", className: "pbu-btn", onClick: o, children: t ? "복사됨 ✓" : "Selector 복사" })
|
|
1031
980
|
] }),
|
|
1032
|
-
/* @__PURE__ */
|
|
981
|
+
/* @__PURE__ */ d("div", { className: "pbu-field", children: [
|
|
1033
982
|
/* @__PURE__ */ n("label", { children: "크기" }),
|
|
1034
|
-
/* @__PURE__ */
|
|
983
|
+
/* @__PURE__ */ d("span", { children: [
|
|
1035
984
|
Math.round(e.rect.width),
|
|
1036
985
|
" × ",
|
|
1037
986
|
Math.round(e.rect.height),
|
|
1038
987
|
"px"
|
|
1039
988
|
] })
|
|
1040
989
|
] }),
|
|
1041
|
-
/* @__PURE__ */
|
|
990
|
+
/* @__PURE__ */ d("div", { className: "pbu-field", children: [
|
|
1042
991
|
/* @__PURE__ */ n("label", { children: "단위" }),
|
|
1043
992
|
/* @__PURE__ */ n("span", { children: e.granularity === "all" ? "전체" : e.granularity === "section" ? "섹션" : "유닛" })
|
|
1044
993
|
] }),
|
|
1045
|
-
/* @__PURE__ */ n(
|
|
1046
|
-
] }) : /* @__PURE__ */
|
|
994
|
+
/* @__PURE__ */ n(Ie, {})
|
|
995
|
+
] }) : /* @__PURE__ */ d("div", { className: "pbu-panel-empty", children: [
|
|
1047
996
|
"화면에서 블록에 마우스를 올리고 클릭해 선택하세요.",
|
|
1048
997
|
/* @__PURE__ */ n("br", {}),
|
|
1049
998
|
"상단 토글로 ",
|
|
@@ -1052,51 +1001,51 @@ function He() {
|
|
|
1052
1001
|
] })
|
|
1053
1002
|
] });
|
|
1054
1003
|
}
|
|
1055
|
-
function
|
|
1056
|
-
const t = y((g) => g.viewerPath),
|
|
1057
|
-
|
|
1058
|
-
const g =
|
|
1004
|
+
function $e({ ia: e }) {
|
|
1005
|
+
const t = y((g) => g.viewerPath), r = y((g) => g.closeViewer), o = y((g) => g.granularity), l = y((g) => g.setGranularity), a = y((g) => g.inspectEnabled), i = y((g) => g.setInspectEnabled), c = y((g) => g.toggleSkillDrawer), h = D(null), u = D(null), [w, f] = _(!1), v = e.nodes.find((g) => g.path === t), N = () => {
|
|
1006
|
+
u.current?.destroy(), u.current = null;
|
|
1007
|
+
const g = h.current;
|
|
1059
1008
|
if (!g || !t) return;
|
|
1060
|
-
const
|
|
1009
|
+
const E = y.getState(), S = Oe(g, {
|
|
1061
1010
|
pagePath: t,
|
|
1062
|
-
granularity:
|
|
1063
|
-
enabled:
|
|
1064
|
-
onSelect: (L,
|
|
1011
|
+
granularity: E.granularity,
|
|
1012
|
+
enabled: E.inspectEnabled,
|
|
1013
|
+
onSelect: (L, I) => (
|
|
1065
1014
|
// 20K 상한 — 프롬프트 비대화 방지
|
|
1066
|
-
y.getState().setSelectionWithHTML(L,
|
|
1015
|
+
y.getState().setSelectionWithHTML(L, I.outerHTML.slice(0, 2e4))
|
|
1067
1016
|
)
|
|
1068
1017
|
});
|
|
1069
|
-
if (!
|
|
1018
|
+
if (!S) {
|
|
1070
1019
|
f(!0);
|
|
1071
1020
|
return;
|
|
1072
1021
|
}
|
|
1073
|
-
f(!1),
|
|
1022
|
+
f(!1), u.current = S;
|
|
1074
1023
|
};
|
|
1075
|
-
return
|
|
1076
|
-
|
|
1077
|
-
}, [
|
|
1078
|
-
|
|
1079
|
-
}, [
|
|
1080
|
-
const g = (
|
|
1081
|
-
|
|
1024
|
+
return R(() => () => u.current?.destroy(), []), R(() => {
|
|
1025
|
+
u.current?.setGranularity(o);
|
|
1026
|
+
}, [o]), R(() => {
|
|
1027
|
+
u.current?.setEnabled(a);
|
|
1028
|
+
}, [a]), R(() => {
|
|
1029
|
+
const g = (E) => {
|
|
1030
|
+
E.key === "Escape" && (y.getState().skillDrawerOpen || r());
|
|
1082
1031
|
};
|
|
1083
1032
|
return window.addEventListener("keydown", g), () => window.removeEventListener("keydown", g);
|
|
1084
|
-
}, [
|
|
1085
|
-
/* @__PURE__ */
|
|
1086
|
-
/* @__PURE__ */ n("button", { type: "button", className: "pbu-btn", onClick:
|
|
1087
|
-
/* @__PURE__ */
|
|
1033
|
+
}, [r]), v ? /* @__PURE__ */ d("div", { className: "pbu-viewer", children: [
|
|
1034
|
+
/* @__PURE__ */ d("div", { className: "pbu-bar", children: [
|
|
1035
|
+
/* @__PURE__ */ n("button", { type: "button", className: "pbu-btn", onClick: r, children: "← 맵으로" }),
|
|
1036
|
+
/* @__PURE__ */ d("span", { className: "pbu-viewer-title", children: [
|
|
1088
1037
|
v.title,
|
|
1089
1038
|
/* @__PURE__ */ n("code", { children: v.path })
|
|
1090
1039
|
] }),
|
|
1091
1040
|
/* @__PURE__ */ n("span", { className: "pbu-spacer" }),
|
|
1092
|
-
|
|
1093
|
-
/* @__PURE__ */
|
|
1041
|
+
w && /* @__PURE__ */ n("span", { className: "pbu-hint", children: "⚠ 이 페이지는 검사할 수 없어요" }),
|
|
1042
|
+
/* @__PURE__ */ d("div", { className: "pbu-seg", role: "group", "aria-label": "블록 단위", children: [
|
|
1094
1043
|
/* @__PURE__ */ n(
|
|
1095
1044
|
"button",
|
|
1096
1045
|
{
|
|
1097
1046
|
type: "button",
|
|
1098
|
-
className:
|
|
1099
|
-
onClick: () =>
|
|
1047
|
+
className: o === "all" ? "pbu-on" : "",
|
|
1048
|
+
onClick: () => l("all"),
|
|
1100
1049
|
children: "전체"
|
|
1101
1050
|
}
|
|
1102
1051
|
),
|
|
@@ -1104,8 +1053,8 @@ function Be({ ia: e }) {
|
|
|
1104
1053
|
"button",
|
|
1105
1054
|
{
|
|
1106
1055
|
type: "button",
|
|
1107
|
-
className:
|
|
1108
|
-
onClick: () =>
|
|
1056
|
+
className: o === "section" ? "pbu-on" : "",
|
|
1057
|
+
onClick: () => l("section"),
|
|
1109
1058
|
children: "섹션"
|
|
1110
1059
|
}
|
|
1111
1060
|
),
|
|
@@ -1113,143 +1062,143 @@ function Be({ ia: e }) {
|
|
|
1113
1062
|
"button",
|
|
1114
1063
|
{
|
|
1115
1064
|
type: "button",
|
|
1116
|
-
className:
|
|
1117
|
-
onClick: () =>
|
|
1065
|
+
className: o === "unit" ? "pbu-on" : "",
|
|
1066
|
+
onClick: () => l("unit"),
|
|
1118
1067
|
children: "유닛"
|
|
1119
1068
|
}
|
|
1120
1069
|
)
|
|
1121
1070
|
] }),
|
|
1122
|
-
/* @__PURE__ */
|
|
1071
|
+
/* @__PURE__ */ d("label", { className: "pbu-toggle", children: [
|
|
1123
1072
|
/* @__PURE__ */ n(
|
|
1124
1073
|
"input",
|
|
1125
1074
|
{
|
|
1126
1075
|
type: "checkbox",
|
|
1127
|
-
checked:
|
|
1076
|
+
checked: a,
|
|
1128
1077
|
onChange: (g) => i(g.target.checked)
|
|
1129
1078
|
}
|
|
1130
1079
|
),
|
|
1131
1080
|
"검사 모드"
|
|
1132
1081
|
] }),
|
|
1133
|
-
/* @__PURE__ */ n("button", { type: "button", className: "pbu-btn", onClick:
|
|
1134
|
-
/* @__PURE__ */ n("button", { type: "button", className: "pbu-icon-btn", onClick:
|
|
1082
|
+
/* @__PURE__ */ n("button", { type: "button", className: "pbu-btn", onClick: c, children: "🧰 스킬함" }),
|
|
1083
|
+
/* @__PURE__ */ n("button", { type: "button", className: "pbu-icon-btn", onClick: r, "aria-label": "닫기", children: "✕" })
|
|
1135
1084
|
] }),
|
|
1136
|
-
/* @__PURE__ */
|
|
1085
|
+
/* @__PURE__ */ d("div", { className: "pbu-viewer-body", children: [
|
|
1137
1086
|
/* @__PURE__ */ n("div", { className: "pbu-viewer-frame-wrap", children: /* @__PURE__ */ n(
|
|
1138
1087
|
"iframe",
|
|
1139
1088
|
{
|
|
1140
|
-
ref:
|
|
1089
|
+
ref: h,
|
|
1141
1090
|
className: "pbu-viewer-iframe",
|
|
1142
1091
|
src: v.path,
|
|
1143
1092
|
title: v.title,
|
|
1144
1093
|
onLoad: N
|
|
1145
1094
|
}
|
|
1146
1095
|
) }),
|
|
1147
|
-
/* @__PURE__ */ n(
|
|
1096
|
+
/* @__PURE__ */ n(De, {})
|
|
1148
1097
|
] })
|
|
1149
1098
|
] }) : null;
|
|
1150
1099
|
}
|
|
1151
|
-
const
|
|
1100
|
+
const Ae = {
|
|
1152
1101
|
project: "프로젝트",
|
|
1153
1102
|
global: "글로벌",
|
|
1154
1103
|
uploaded: "업로드"
|
|
1155
|
-
},
|
|
1156
|
-
function
|
|
1157
|
-
const e = y((
|
|
1158
|
-
const
|
|
1159
|
-
|
|
1104
|
+
}, He = ["project", "global", "uploaded"];
|
|
1105
|
+
function Be() {
|
|
1106
|
+
const e = y((b) => b.toggleSkillDrawer), t = te(Y), [r, o] = _(!0), [l, a] = _(!1), [i, c] = _([]), [h, u] = _(null), [w, f] = _(""), [v, N] = _(!1), [g, E] = _(null), [S, L] = _(!1), I = D(null), M = D(0), [T, O] = _(null), P = async () => {
|
|
1107
|
+
const b = ++M.current;
|
|
1108
|
+
o(!0), E(null);
|
|
1160
1109
|
try {
|
|
1161
|
-
const
|
|
1162
|
-
if (
|
|
1163
|
-
const [
|
|
1164
|
-
if (
|
|
1165
|
-
|
|
1166
|
-
} catch (
|
|
1167
|
-
if (
|
|
1168
|
-
|
|
1110
|
+
const x = await t.isAlive();
|
|
1111
|
+
if (b !== M.current || (a(x), !x)) return;
|
|
1112
|
+
const [s, C] = await Promise.all([t.listSkills(), t.tokenStatus()]);
|
|
1113
|
+
if (b !== M.current) return;
|
|
1114
|
+
c(s), u(C), N(!C.configured);
|
|
1115
|
+
} catch (x) {
|
|
1116
|
+
if (b !== M.current) return;
|
|
1117
|
+
E(x instanceof Error ? x.message : String(x));
|
|
1169
1118
|
} finally {
|
|
1170
|
-
|
|
1119
|
+
b === M.current && o(!1);
|
|
1171
1120
|
}
|
|
1172
1121
|
};
|
|
1173
|
-
|
|
1122
|
+
R(() => {
|
|
1174
1123
|
P();
|
|
1175
|
-
}, []),
|
|
1176
|
-
const
|
|
1177
|
-
|
|
1124
|
+
}, []), R(() => {
|
|
1125
|
+
const b = (x) => {
|
|
1126
|
+
x.key === "Escape" && e();
|
|
1178
1127
|
};
|
|
1179
|
-
return window.addEventListener("keydown",
|
|
1128
|
+
return window.addEventListener("keydown", b), () => window.removeEventListener("keydown", b);
|
|
1180
1129
|
}, [e]);
|
|
1181
|
-
const
|
|
1130
|
+
const p = async (b, x) => {
|
|
1182
1131
|
if (!T) {
|
|
1183
|
-
O(
|
|
1132
|
+
O(b);
|
|
1184
1133
|
try {
|
|
1185
|
-
await
|
|
1186
|
-
} catch (
|
|
1187
|
-
|
|
1134
|
+
await x();
|
|
1135
|
+
} catch (s) {
|
|
1136
|
+
E(s instanceof Error ? s.message : String(s));
|
|
1188
1137
|
} finally {
|
|
1189
1138
|
O(null);
|
|
1190
1139
|
}
|
|
1191
1140
|
}
|
|
1192
|
-
}, k = (
|
|
1193
|
-
await t.toggleSkill(
|
|
1194
|
-
}), m = (
|
|
1195
|
-
window.confirm(`"${
|
|
1196
|
-
await t.removeSkill(
|
|
1141
|
+
}, k = (b, x) => p(`toggle:${b}`, async () => {
|
|
1142
|
+
await t.toggleSkill(b, x), await P();
|
|
1143
|
+
}), m = (b, x) => {
|
|
1144
|
+
window.confirm(`"${x}" 스킬을 삭제할까요?`) && p(`remove:${b}`, async () => {
|
|
1145
|
+
await t.removeSkill(b), await P();
|
|
1197
1146
|
});
|
|
1198
|
-
},
|
|
1199
|
-
const
|
|
1200
|
-
|
|
1201
|
-
const
|
|
1202
|
-
|
|
1147
|
+
}, z = () => I.current?.click(), A = (b) => {
|
|
1148
|
+
const x = b.target.files?.[0];
|
|
1149
|
+
b.target.value = "", x && p("upload", async () => {
|
|
1150
|
+
const s = new FileReader(), C = await new Promise(($, le) => {
|
|
1151
|
+
s.onload = () => $(String(s.result ?? "")), s.onerror = () => le(s.error ?? new Error("파일을 읽을 수 없어요")), s.readAsText(x);
|
|
1203
1152
|
});
|
|
1204
|
-
await t.uploadSkill(
|
|
1153
|
+
await t.uploadSkill(x.name, C), await P();
|
|
1205
1154
|
});
|
|
1206
|
-
},
|
|
1207
|
-
|
|
1208
|
-
}),
|
|
1155
|
+
}, F = () => p("token:save", async () => {
|
|
1156
|
+
w.trim() && (await t.saveToken(w.trim()), f(""), await P());
|
|
1157
|
+
}), U = () => p("token:delete", async () => {
|
|
1209
1158
|
await t.deleteToken(), f(""), await P();
|
|
1210
1159
|
}), q = async () => {
|
|
1211
1160
|
await navigator.clipboard.writeText("npx pubuilder serve"), L(!0), setTimeout(() => L(!1), 1200);
|
|
1212
|
-
}, H =
|
|
1213
|
-
source:
|
|
1214
|
-
label:
|
|
1215
|
-
items: i.filter((
|
|
1216
|
-
})).filter((
|
|
1217
|
-
return /* @__PURE__ */
|
|
1218
|
-
/* @__PURE__ */
|
|
1161
|
+
}, H = He.map((b) => ({
|
|
1162
|
+
source: b,
|
|
1163
|
+
label: Ae[b],
|
|
1164
|
+
items: i.filter((x) => x.source === b)
|
|
1165
|
+
})).filter((b) => b.items.length > 0);
|
|
1166
|
+
return /* @__PURE__ */ d("aside", { className: "pbu-drawer", children: [
|
|
1167
|
+
/* @__PURE__ */ d("div", { className: "pbu-drawer-header", children: [
|
|
1219
1168
|
/* @__PURE__ */ n("span", { className: "pbu-panel-title", children: "스킬함" }),
|
|
1220
1169
|
/* @__PURE__ */ n("button", { type: "button", className: "pbu-icon-btn", onClick: e, "aria-label": "닫기", children: "✕" })
|
|
1221
1170
|
] }),
|
|
1222
|
-
g && /* @__PURE__ */
|
|
1171
|
+
g && /* @__PURE__ */ d("div", { className: "pbu-drawer-error", children: [
|
|
1223
1172
|
/* @__PURE__ */ n("span", { children: g }),
|
|
1224
|
-
/* @__PURE__ */ n("button", { type: "button", className: "pbu-icon-btn", onClick: () =>
|
|
1173
|
+
/* @__PURE__ */ n("button", { type: "button", className: "pbu-icon-btn", onClick: () => E(null), "aria-label": "닫기", children: "✕" })
|
|
1225
1174
|
] }),
|
|
1226
|
-
|
|
1175
|
+
r ? /* @__PURE__ */ n("div", { className: "pbu-panel-empty", children: "불러오는 중..." }) : l ? /* @__PURE__ */ d(ee, { children: [
|
|
1227
1176
|
/* @__PURE__ */ n("div", { className: "pbu-drawer-group", children: "토큰" }),
|
|
1228
|
-
|
|
1229
|
-
/* @__PURE__ */ n("span", { className: "pbu-token-masked", children:
|
|
1230
|
-
/* @__PURE__ */
|
|
1177
|
+
h?.configured && !v ? /* @__PURE__ */ d("div", { className: "pbu-field", children: [
|
|
1178
|
+
/* @__PURE__ */ n("span", { className: "pbu-token-masked", children: h.masked }),
|
|
1179
|
+
/* @__PURE__ */ d("div", { children: [
|
|
1231
1180
|
/* @__PURE__ */ n("button", { type: "button", className: "pbu-btn", disabled: T !== null, onClick: () => N(!0), children: "재입력" }),
|
|
1232
|
-
/* @__PURE__ */ n("button", { type: "button", className: "pbu-btn", disabled: T !== null, onClick:
|
|
1181
|
+
/* @__PURE__ */ n("button", { type: "button", className: "pbu-btn", disabled: T !== null, onClick: U, children: "삭제" })
|
|
1233
1182
|
] })
|
|
1234
|
-
] }) : /* @__PURE__ */
|
|
1183
|
+
] }) : /* @__PURE__ */ d("div", { className: "pbu-field", children: [
|
|
1235
1184
|
/* @__PURE__ */ n(
|
|
1236
1185
|
"input",
|
|
1237
1186
|
{
|
|
1238
1187
|
type: "password",
|
|
1239
|
-
value:
|
|
1240
|
-
onChange: (
|
|
1188
|
+
value: w,
|
|
1189
|
+
onChange: (b) => f(b.target.value),
|
|
1241
1190
|
placeholder: "Figma 토큰"
|
|
1242
1191
|
}
|
|
1243
1192
|
),
|
|
1244
|
-
/* @__PURE__ */ n("button", { type: "button", className: "pbu-btn pbu-btn-primary", disabled: T !== null, onClick:
|
|
1193
|
+
/* @__PURE__ */ n("button", { type: "button", className: "pbu-btn pbu-btn-primary", disabled: T !== null, onClick: F, children: "저장" })
|
|
1245
1194
|
] }),
|
|
1246
|
-
/* @__PURE__ */
|
|
1195
|
+
/* @__PURE__ */ d("div", { className: "pbu-drawer-group", children: [
|
|
1247
1196
|
"스킬 목록",
|
|
1248
|
-
/* @__PURE__ */ n("button", { type: "button", className: "pbu-btn", disabled: T !== null, onClick:
|
|
1197
|
+
/* @__PURE__ */ n("button", { type: "button", className: "pbu-btn", disabled: T !== null, onClick: z, children: "업로드" }),
|
|
1249
1198
|
/* @__PURE__ */ n(
|
|
1250
1199
|
"input",
|
|
1251
1200
|
{
|
|
1252
|
-
ref:
|
|
1201
|
+
ref: I,
|
|
1253
1202
|
type: "file",
|
|
1254
1203
|
accept: ".md",
|
|
1255
1204
|
style: { display: "none" },
|
|
@@ -1257,63 +1206,63 @@ function Fe() {
|
|
|
1257
1206
|
}
|
|
1258
1207
|
)
|
|
1259
1208
|
] }),
|
|
1260
|
-
H.length === 0 ? /* @__PURE__ */ n("div", { className: "pbu-panel-empty", children: "등록된 스킬이 없어요." }) : H.map((
|
|
1261
|
-
/* @__PURE__ */ n("div", { className: "pbu-drawer-group", children:
|
|
1262
|
-
|
|
1263
|
-
/* @__PURE__ */
|
|
1209
|
+
H.length === 0 ? /* @__PURE__ */ n("div", { className: "pbu-panel-empty", children: "등록된 스킬이 없어요." }) : H.map((b) => /* @__PURE__ */ d("div", { children: [
|
|
1210
|
+
/* @__PURE__ */ n("div", { className: "pbu-drawer-group", children: b.label }),
|
|
1211
|
+
b.items.map((x) => /* @__PURE__ */ d("div", { className: "pbu-skill-row", children: [
|
|
1212
|
+
/* @__PURE__ */ d("label", { className: "pbu-toggle", children: [
|
|
1264
1213
|
/* @__PURE__ */ n(
|
|
1265
1214
|
"input",
|
|
1266
1215
|
{
|
|
1267
1216
|
type: "checkbox",
|
|
1268
|
-
checked:
|
|
1217
|
+
checked: x.enabled,
|
|
1269
1218
|
disabled: T !== null,
|
|
1270
|
-
onChange: (
|
|
1219
|
+
onChange: (s) => k(x.id, s.target.checked)
|
|
1271
1220
|
}
|
|
1272
1221
|
),
|
|
1273
|
-
|
|
1222
|
+
x.name
|
|
1274
1223
|
] }),
|
|
1275
|
-
/* @__PURE__ */ n("span", { className: "pbu-hint", title:
|
|
1276
|
-
|
|
1224
|
+
/* @__PURE__ */ n("span", { className: "pbu-hint", title: x.description, children: x.description }),
|
|
1225
|
+
x.source === "uploaded" && /* @__PURE__ */ n(
|
|
1277
1226
|
"button",
|
|
1278
1227
|
{
|
|
1279
1228
|
type: "button",
|
|
1280
1229
|
className: "pbu-icon-btn",
|
|
1281
1230
|
disabled: T !== null,
|
|
1282
|
-
onClick: () => m(
|
|
1231
|
+
onClick: () => m(x.id, x.name),
|
|
1283
1232
|
"aria-label": "삭제",
|
|
1284
1233
|
children: "🗑"
|
|
1285
1234
|
}
|
|
1286
1235
|
)
|
|
1287
|
-
] },
|
|
1288
|
-
] },
|
|
1289
|
-
] }) : /* @__PURE__ */
|
|
1236
|
+
] }, x.id))
|
|
1237
|
+
] }, b.source))
|
|
1238
|
+
] }) : /* @__PURE__ */ d("div", { className: "pbu-panel-empty", children: [
|
|
1290
1239
|
"컴패니언 서버가 꺼져 있어요",
|
|
1291
|
-
/* @__PURE__ */
|
|
1240
|
+
/* @__PURE__ */ d("div", { className: "pbu-drawer-code", children: [
|
|
1292
1241
|
/* @__PURE__ */ n("code", { children: "npx pubuilder serve" }),
|
|
1293
|
-
/* @__PURE__ */ n("button", { type: "button", className: "pbu-btn", onClick: q, children:
|
|
1242
|
+
/* @__PURE__ */ n("button", { type: "button", className: "pbu-btn", onClick: q, children: S ? "복사됨 ✓" : "복사" })
|
|
1294
1243
|
] }),
|
|
1295
1244
|
/* @__PURE__ */ n("div", { className: "pbu-hint", children: 'package.json의 dev 스크립트를 "pubuilder dev -- <기존 명령>"으로 감싸면 자동 실행돼요' }),
|
|
1296
1245
|
/* @__PURE__ */ n("button", { type: "button", className: "pbu-btn", onClick: P, children: "다시 확인" })
|
|
1297
1246
|
] })
|
|
1298
1247
|
] });
|
|
1299
1248
|
}
|
|
1300
|
-
function
|
|
1301
|
-
const
|
|
1302
|
-
return
|
|
1303
|
-
|
|
1304
|
-
}, [
|
|
1305
|
-
/* @__PURE__ */
|
|
1306
|
-
/* @__PURE__ */ n(
|
|
1307
|
-
i && /* @__PURE__ */ n(
|
|
1308
|
-
|
|
1309
|
-
|
|
1249
|
+
function We({ config: e, enabled: t = !0, serverUrl: r }) {
|
|
1250
|
+
const o = t && !fe(), [l, a] = _(!1), i = y((f) => f.isMapOpen), c = y((f) => f.viewerPath), h = y((f) => f.skillDrawerOpen), u = V(() => de(e), [e]), w = V(() => new re(r), [r]);
|
|
1251
|
+
return ie(() => {
|
|
1252
|
+
o && window.self === window.top && (we(), a(!0));
|
|
1253
|
+
}, [o]), !l || !o ? null : se(
|
|
1254
|
+
/* @__PURE__ */ d(Y.Provider, { value: w, children: [
|
|
1255
|
+
/* @__PURE__ */ n(ze, {}),
|
|
1256
|
+
i && /* @__PURE__ */ n(Ne, { ia: u }),
|
|
1257
|
+
c && /* @__PURE__ */ n($e, { ia: u }),
|
|
1258
|
+
h && /* @__PURE__ */ n(Be, {})
|
|
1310
1259
|
] }),
|
|
1311
1260
|
document.body
|
|
1312
1261
|
);
|
|
1313
1262
|
}
|
|
1314
1263
|
export {
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1264
|
+
We as PageMap,
|
|
1265
|
+
Xe as defineIA,
|
|
1266
|
+
de as normalizeIA
|
|
1318
1267
|
};
|
|
1319
1268
|
//# sourceMappingURL=index.js.map
|