@jogak/ui 0.1.0-alpha.4 → 0.1.0-alpha.6
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 +52 -0
- package/README.md +84 -8
- package/dist/index.js +1 -1
- package/dist/index.mjs +595 -912
- package/package.json +4 -3
- package/src/app/App.tsx +3 -16
- package/src/app/main.tsx +6 -0
- package/src/components/Actions/index.tsx +20 -50
- package/src/components/Controls/index.tsx +49 -70
- package/src/components/Preview/index.tsx +140 -250
- package/src/components/Sidebar/index.tsx +39 -66
- package/src/styles/jogak.css +47 -7
package/dist/index.mjs
CHANGED
|
@@ -1,1219 +1,902 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { defaultActionChannel as
|
|
4
|
-
import { useRegistryMeta as
|
|
5
|
-
import { themes as
|
|
6
|
-
function
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import { jsxs as j, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { useState as f, useEffect as w, useRef as H, useMemo as y, useCallback as C } from "react";
|
|
3
|
+
import { defaultActionChannel as S, ComponentRegistry as I, defaultRegistry as V } from "@jogak/core";
|
|
4
|
+
import { useRegistryMeta as q, useEntry as Q, reactAdapter as A, JogakProvider as X, useRegistry as Y } from "@jogak/react";
|
|
5
|
+
import { themes as B, Highlight as Z } from "prism-react-renderer";
|
|
6
|
+
function z(o) {
|
|
7
|
+
var a, r, t = "";
|
|
8
|
+
if (typeof o == "string" || typeof o == "number") t += o;
|
|
9
|
+
else if (typeof o == "object") if (Array.isArray(o)) {
|
|
10
|
+
var g = o.length;
|
|
11
|
+
for (a = 0; a < g; a++) o[a] && (r = z(o[a])) && (t && (t += " "), t += r);
|
|
12
|
+
} else for (r in o) o[r] && (t && (t += " "), t += r);
|
|
13
|
+
return t;
|
|
14
|
+
}
|
|
15
|
+
function h() {
|
|
16
|
+
for (var o, a, r = 0, t = "", g = arguments.length; r < g; r++) (o = arguments[r]) && (a = z(o)) && (t && (t += " "), t += a);
|
|
17
|
+
return t;
|
|
18
|
+
}
|
|
19
|
+
function K({
|
|
20
|
+
selectedEntryId: o,
|
|
21
|
+
selectedJogakName: a,
|
|
22
|
+
onSelect: r
|
|
10
23
|
}) {
|
|
11
|
-
const [
|
|
12
|
-
return /* @__PURE__ */
|
|
24
|
+
const [t, g] = f(""), { metaTree: n, searchMeta: k } = q(), s = t.trim().length > 0 ? k(t) : null;
|
|
25
|
+
return /* @__PURE__ */ j(
|
|
13
26
|
"aside",
|
|
14
27
|
{
|
|
15
28
|
"data-testid": "sidebar",
|
|
16
|
-
|
|
17
|
-
borderRight: "1px solid #e5e7eb",
|
|
18
|
-
height: "100%",
|
|
19
|
-
overflow: "auto",
|
|
20
|
-
display: "flex",
|
|
21
|
-
flexDirection: "column"
|
|
22
|
-
},
|
|
29
|
+
className: "jogak:flex jogak:flex-col jogak:h-full jogak:overflow-auto jogak:border-r jogak:border-[var(--jogak-color-border)]",
|
|
23
30
|
children: [
|
|
24
|
-
/* @__PURE__ */
|
|
31
|
+
/* @__PURE__ */ e("div", { className: "jogak:p-3 jogak:border-b jogak:border-[var(--jogak-color-border)]", children: /* @__PURE__ */ e(
|
|
25
32
|
"input",
|
|
26
33
|
{
|
|
27
34
|
type: "search",
|
|
28
35
|
placeholder: "Search components...",
|
|
29
|
-
value:
|
|
30
|
-
onChange: (
|
|
31
|
-
|
|
32
|
-
},
|
|
33
|
-
style: {
|
|
34
|
-
width: "100%",
|
|
35
|
-
padding: "6px 8px",
|
|
36
|
-
border: "1px solid #d1d5db",
|
|
37
|
-
borderRadius: 4
|
|
36
|
+
value: t,
|
|
37
|
+
onChange: (l) => {
|
|
38
|
+
g(l.target.value);
|
|
38
39
|
},
|
|
40
|
+
className: "jogak:w-full jogak:px-2 jogak:py-1.5 jogak:border jogak:border-[var(--jogak-color-border-strong)] jogak:rounded-[var(--jogak-radius-md)]",
|
|
39
41
|
"aria-label": "Search components"
|
|
40
42
|
}
|
|
41
43
|
) }),
|
|
42
|
-
/* @__PURE__ */
|
|
43
|
-
|
|
44
|
+
/* @__PURE__ */ e("nav", { className: "jogak:flex-1 jogak:overflow-auto jogak:py-2", children: s !== null ? /* @__PURE__ */ e(
|
|
45
|
+
T,
|
|
44
46
|
{
|
|
45
|
-
metas:
|
|
46
|
-
selectedEntryId:
|
|
47
|
-
selectedJogakName:
|
|
48
|
-
onSelect:
|
|
47
|
+
metas: s,
|
|
48
|
+
selectedEntryId: o,
|
|
49
|
+
selectedJogakName: a,
|
|
50
|
+
onSelect: r
|
|
49
51
|
}
|
|
50
|
-
) : /* @__PURE__ */
|
|
51
|
-
|
|
52
|
+
) : /* @__PURE__ */ e(
|
|
53
|
+
D,
|
|
52
54
|
{
|
|
53
|
-
node:
|
|
54
|
-
selectedEntryId:
|
|
55
|
-
selectedJogakName:
|
|
56
|
-
onSelect:
|
|
55
|
+
node: n,
|
|
56
|
+
selectedEntryId: o,
|
|
57
|
+
selectedJogakName: a,
|
|
58
|
+
onSelect: r
|
|
57
59
|
}
|
|
58
60
|
) })
|
|
59
61
|
]
|
|
60
62
|
}
|
|
61
63
|
);
|
|
62
64
|
}
|
|
63
|
-
function
|
|
64
|
-
metas:
|
|
65
|
-
selectedEntryId:
|
|
66
|
-
selectedJogakName:
|
|
67
|
-
onSelect:
|
|
65
|
+
function T({
|
|
66
|
+
metas: o,
|
|
67
|
+
selectedEntryId: a,
|
|
68
|
+
selectedJogakName: r,
|
|
69
|
+
onSelect: t
|
|
68
70
|
}) {
|
|
69
|
-
return
|
|
70
|
-
|
|
71
|
+
return o.length === 0 ? /* @__PURE__ */ e("p", { className: "jogak:px-3 jogak:text-[var(--jogak-color-fg-subtle)] jogak:text-[13px]", children: "No results" }) : /* @__PURE__ */ e("ul", { className: "jogak:list-none jogak:m-0 jogak:p-0", children: o.map((g) => /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(
|
|
72
|
+
F,
|
|
71
73
|
{
|
|
72
|
-
meta:
|
|
73
|
-
selectedEntryId:
|
|
74
|
-
selectedJogakName:
|
|
75
|
-
onSelect:
|
|
74
|
+
meta: g,
|
|
75
|
+
selectedEntryId: a,
|
|
76
|
+
selectedJogakName: r,
|
|
77
|
+
onSelect: t,
|
|
76
78
|
indent: 0
|
|
77
79
|
}
|
|
78
|
-
) },
|
|
80
|
+
) }, g.id)) });
|
|
79
81
|
}
|
|
80
|
-
function
|
|
81
|
-
node:
|
|
82
|
-
selectedEntryId:
|
|
83
|
-
selectedJogakName:
|
|
84
|
-
onSelect:
|
|
85
|
-
depth:
|
|
82
|
+
function D({
|
|
83
|
+
node: o,
|
|
84
|
+
selectedEntryId: a,
|
|
85
|
+
selectedJogakName: r,
|
|
86
|
+
onSelect: t,
|
|
87
|
+
depth: g = 0
|
|
86
88
|
}) {
|
|
87
|
-
return /* @__PURE__ */
|
|
89
|
+
return /* @__PURE__ */ e(
|
|
88
90
|
"ul",
|
|
89
91
|
{
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
},
|
|
95
|
-
children: Object.entries(e).map(([r, a]) => /* @__PURE__ */ n("li", { children: "id" in a ? /* @__PURE__ */ n(
|
|
96
|
-
D,
|
|
92
|
+
className: "jogak:list-none jogak:m-0 jogak:pr-0 jogak:py-0 jogak:pl-[var(--jogak-tree-pl)]",
|
|
93
|
+
style: { "--jogak-tree-pl": `${g * 12}px` },
|
|
94
|
+
children: Object.entries(o).map(([n, k]) => /* @__PURE__ */ e("li", { children: "id" in k ? /* @__PURE__ */ e(
|
|
95
|
+
F,
|
|
97
96
|
{
|
|
98
|
-
meta:
|
|
99
|
-
selectedEntryId:
|
|
100
|
-
selectedJogakName:
|
|
101
|
-
onSelect:
|
|
97
|
+
meta: k,
|
|
98
|
+
selectedEntryId: a,
|
|
99
|
+
selectedJogakName: r,
|
|
100
|
+
onSelect: t,
|
|
102
101
|
indent: 0
|
|
103
102
|
}
|
|
104
|
-
) : /* @__PURE__ */
|
|
105
|
-
|
|
103
|
+
) : /* @__PURE__ */ e(
|
|
104
|
+
oo,
|
|
106
105
|
{
|
|
107
|
-
label:
|
|
108
|
-
node:
|
|
109
|
-
selectedEntryId:
|
|
110
|
-
selectedJogakName:
|
|
111
|
-
onSelect:
|
|
112
|
-
depth:
|
|
106
|
+
label: n,
|
|
107
|
+
node: k,
|
|
108
|
+
selectedEntryId: a,
|
|
109
|
+
selectedJogakName: r,
|
|
110
|
+
onSelect: t,
|
|
111
|
+
depth: g + 1
|
|
113
112
|
}
|
|
114
|
-
) },
|
|
113
|
+
) }, n))
|
|
115
114
|
}
|
|
116
115
|
);
|
|
117
116
|
}
|
|
118
|
-
function
|
|
119
|
-
label:
|
|
120
|
-
node:
|
|
121
|
-
selectedEntryId:
|
|
122
|
-
selectedJogakName:
|
|
123
|
-
onSelect:
|
|
124
|
-
depth:
|
|
117
|
+
function oo({
|
|
118
|
+
label: o,
|
|
119
|
+
node: a,
|
|
120
|
+
selectedEntryId: r,
|
|
121
|
+
selectedJogakName: t,
|
|
122
|
+
onSelect: g,
|
|
123
|
+
depth: n
|
|
125
124
|
}) {
|
|
126
|
-
const [
|
|
127
|
-
return /* @__PURE__ */
|
|
128
|
-
/* @__PURE__ */
|
|
125
|
+
const [k, s] = f(!0);
|
|
126
|
+
return /* @__PURE__ */ j("div", { children: [
|
|
127
|
+
/* @__PURE__ */ j(
|
|
129
128
|
"button",
|
|
130
129
|
{
|
|
131
130
|
type: "button",
|
|
132
131
|
onClick: () => {
|
|
133
|
-
|
|
134
|
-
},
|
|
135
|
-
style: {
|
|
136
|
-
display: "flex",
|
|
137
|
-
alignItems: "center",
|
|
138
|
-
gap: 4,
|
|
139
|
-
width: "100%",
|
|
140
|
-
padding: "4px 12px",
|
|
141
|
-
background: "none",
|
|
142
|
-
border: "none",
|
|
143
|
-
cursor: "pointer",
|
|
144
|
-
fontSize: 12,
|
|
145
|
-
fontWeight: 600,
|
|
146
|
-
color: "#6b7280",
|
|
147
|
-
textTransform: "uppercase",
|
|
148
|
-
letterSpacing: "0.05em"
|
|
132
|
+
s((l) => !l);
|
|
149
133
|
},
|
|
150
|
-
"
|
|
134
|
+
className: "jogak:flex jogak:items-center jogak:gap-1 jogak:w-full jogak:px-3 jogak:py-1 jogak:bg-transparent jogak:border-none jogak:cursor-pointer jogak:text-[12px] jogak:font-semibold jogak:text-[var(--jogak-color-fg-muted)] jogak:uppercase jogak:tracking-wider",
|
|
135
|
+
"aria-expanded": k,
|
|
151
136
|
children: [
|
|
152
|
-
/* @__PURE__ */
|
|
153
|
-
|
|
137
|
+
/* @__PURE__ */ e("span", { children: k ? "▾" : "▸" }),
|
|
138
|
+
o
|
|
154
139
|
]
|
|
155
140
|
}
|
|
156
141
|
),
|
|
157
|
-
|
|
158
|
-
|
|
142
|
+
k && /* @__PURE__ */ e(
|
|
143
|
+
D,
|
|
159
144
|
{
|
|
160
|
-
node:
|
|
161
|
-
selectedEntryId:
|
|
162
|
-
selectedJogakName:
|
|
163
|
-
onSelect:
|
|
164
|
-
depth:
|
|
145
|
+
node: a,
|
|
146
|
+
selectedEntryId: r,
|
|
147
|
+
selectedJogakName: t,
|
|
148
|
+
onSelect: g,
|
|
149
|
+
depth: n
|
|
165
150
|
}
|
|
166
151
|
)
|
|
167
152
|
] });
|
|
168
153
|
}
|
|
169
|
-
function
|
|
170
|
-
meta:
|
|
171
|
-
selectedEntryId:
|
|
172
|
-
selectedJogakName:
|
|
173
|
-
onSelect:
|
|
174
|
-
indent:
|
|
154
|
+
function F({
|
|
155
|
+
meta: o,
|
|
156
|
+
selectedEntryId: a,
|
|
157
|
+
selectedJogakName: r,
|
|
158
|
+
onSelect: t,
|
|
159
|
+
indent: g
|
|
175
160
|
}) {
|
|
176
|
-
const
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
}, [
|
|
180
|
-
const
|
|
181
|
-
return /* @__PURE__ */
|
|
182
|
-
/* @__PURE__ */
|
|
161
|
+
const n = o.id === a, [k, s] = f(n);
|
|
162
|
+
w(() => {
|
|
163
|
+
n && s(!0);
|
|
164
|
+
}, [n]);
|
|
165
|
+
const l = o.title.split("/").pop() ?? o.title, b = 16 + g * 12;
|
|
166
|
+
return /* @__PURE__ */ j("div", { children: [
|
|
167
|
+
/* @__PURE__ */ j(
|
|
183
168
|
"button",
|
|
184
169
|
{
|
|
185
170
|
type: "button",
|
|
186
171
|
onClick: () => {
|
|
187
|
-
if (
|
|
188
|
-
|
|
172
|
+
if (n)
|
|
173
|
+
s((i) => !i);
|
|
189
174
|
else {
|
|
190
|
-
|
|
191
|
-
const
|
|
192
|
-
|
|
175
|
+
s(!0);
|
|
176
|
+
const i = o.jogakNames[0];
|
|
177
|
+
i !== void 0 && t(o.id, i);
|
|
193
178
|
}
|
|
194
179
|
},
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
cursor: "pointer",
|
|
204
|
-
fontSize: 13,
|
|
205
|
-
color: r ? "#2563eb" : "#374151",
|
|
206
|
-
fontWeight: r ? 500 : 400,
|
|
207
|
-
textAlign: "left"
|
|
208
|
-
},
|
|
209
|
-
"aria-expanded": a,
|
|
180
|
+
className: h(
|
|
181
|
+
"jogak:flex jogak:items-center jogak:gap-1.5 jogak:w-full jogak:pr-3 jogak:py-[5px]",
|
|
182
|
+
"jogak:pl-[var(--jogak-entry-pl)]",
|
|
183
|
+
"jogak:border-none jogak:cursor-pointer jogak:text-left jogak:text-[13px]",
|
|
184
|
+
n ? "jogak:bg-[var(--jogak-color-accent-bg)] jogak:text-[var(--jogak-color-accent)] jogak:font-medium" : "jogak:bg-transparent jogak:text-[var(--jogak-color-fg)] jogak:font-normal"
|
|
185
|
+
),
|
|
186
|
+
style: { "--jogak-entry-pl": `${b}px` },
|
|
187
|
+
"aria-expanded": k,
|
|
210
188
|
children: [
|
|
211
|
-
/* @__PURE__ */
|
|
212
|
-
|
|
189
|
+
/* @__PURE__ */ e("span", { className: "jogak:text-[10px] jogak:shrink-0 jogak:leading-none", children: k ? "▾" : "▸" }),
|
|
190
|
+
l
|
|
213
191
|
]
|
|
214
192
|
}
|
|
215
193
|
),
|
|
216
|
-
|
|
217
|
-
const
|
|
218
|
-
return /* @__PURE__ */
|
|
194
|
+
k && /* @__PURE__ */ e("ul", { className: "jogak:list-none jogak:m-0 jogak:p-0", children: o.jogakNames.map((i) => {
|
|
195
|
+
const u = n && i === r;
|
|
196
|
+
return /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(
|
|
219
197
|
"button",
|
|
220
198
|
{
|
|
221
199
|
type: "button",
|
|
222
200
|
onClick: () => {
|
|
223
|
-
|
|
201
|
+
t(o.id, i);
|
|
224
202
|
},
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
color: h ? "#1d4ed8" : "#6b7280",
|
|
235
|
-
fontWeight: h ? 500 : 400
|
|
236
|
-
},
|
|
237
|
-
"aria-current": h ? "true" : void 0,
|
|
238
|
-
children: p
|
|
203
|
+
className: h(
|
|
204
|
+
"jogak:block jogak:w-full jogak:text-left jogak:pr-3 jogak:py-1",
|
|
205
|
+
"jogak:pl-[var(--jogak-jogak-pl)]",
|
|
206
|
+
"jogak:border-none jogak:cursor-pointer jogak:text-[12px]",
|
|
207
|
+
u ? "jogak:bg-[var(--jogak-color-accent-bg-soft)] jogak:text-[var(--jogak-color-accent-fg)] jogak:font-medium" : "jogak:bg-transparent jogak:text-[var(--jogak-color-fg-muted)] jogak:font-normal"
|
|
208
|
+
),
|
|
209
|
+
style: { "--jogak-jogak-pl": `${b + 18}px` },
|
|
210
|
+
"aria-current": u ? "true" : void 0,
|
|
211
|
+
children: i
|
|
239
212
|
}
|
|
240
|
-
) },
|
|
213
|
+
) }, i);
|
|
241
214
|
}) })
|
|
242
215
|
] });
|
|
243
216
|
}
|
|
244
|
-
function
|
|
245
|
-
const
|
|
246
|
-
return
|
|
217
|
+
function ao(o, a) {
|
|
218
|
+
const r = a == null ? void 0 : a.control, t = (a == null ? void 0 : a.action) !== void 0 && a.action !== !1, g = (a == null ? void 0 : a.type) === "function" || typeof o == "function";
|
|
219
|
+
return t || g ? "action" : r === "boolean" || typeof o == "boolean" ? "boolean" : r === "number" || r === "range" || typeof o == "number" ? "number" : r === "select" || r === "radio" || (a == null ? void 0 : a.options) !== void 0 && a.options.length > 0 ? "select" : r === "text" || r === "color" || typeof o == "string" ? "text" : "json";
|
|
247
220
|
}
|
|
248
|
-
|
|
249
|
-
|
|
221
|
+
const R = "jogak:px-2 jogak:py-1 jogak:border jogak:border-[var(--jogak-color-border-strong)] jogak:rounded-[var(--jogak-radius-md)] jogak:text-[13px] jogak:w-full jogak:max-w-[280px]", _ = "jogak:px-5 jogak:py-1.5 jogak:text-left jogak:text-[var(--jogak-color-fg-muted)] jogak:font-medium jogak:text-[12px] jogak:border-b jogak:border-[var(--jogak-color-border)]", $ = "jogak:px-5 jogak:py-2 jogak:align-middle jogak:border-b jogak:border-[var(--jogak-color-border-muted)]";
|
|
222
|
+
function eo({ argKey: o, value: a, argType: r, onArgChange: t }) {
|
|
223
|
+
switch (ao(a, r)) {
|
|
250
224
|
case "boolean":
|
|
251
|
-
return /* @__PURE__ */
|
|
225
|
+
return /* @__PURE__ */ e(
|
|
252
226
|
"input",
|
|
253
227
|
{
|
|
254
228
|
type: "checkbox",
|
|
255
|
-
checked:
|
|
256
|
-
onChange: (
|
|
257
|
-
|
|
229
|
+
checked: a === !0,
|
|
230
|
+
onChange: (n) => {
|
|
231
|
+
t(o, n.target.checked);
|
|
258
232
|
},
|
|
259
|
-
|
|
233
|
+
className: "jogak:cursor-pointer jogak:w-4 jogak:h-4 jogak:accent-[var(--jogak-color-accent)]"
|
|
260
234
|
}
|
|
261
235
|
);
|
|
262
236
|
case "number":
|
|
263
|
-
return /* @__PURE__ */
|
|
237
|
+
return /* @__PURE__ */ e(
|
|
264
238
|
"input",
|
|
265
239
|
{
|
|
266
240
|
type: "number",
|
|
267
|
-
value: typeof
|
|
268
|
-
onChange: (
|
|
269
|
-
|
|
241
|
+
value: typeof a == "number" ? a : "",
|
|
242
|
+
onChange: (n) => {
|
|
243
|
+
t(o, n.target.valueAsNumber);
|
|
270
244
|
},
|
|
271
|
-
|
|
245
|
+
className: R
|
|
272
246
|
}
|
|
273
247
|
);
|
|
274
248
|
case "select": {
|
|
275
|
-
const
|
|
276
|
-
return /* @__PURE__ */
|
|
249
|
+
const n = (r == null ? void 0 : r.options) ?? [];
|
|
250
|
+
return /* @__PURE__ */ e(
|
|
277
251
|
"select",
|
|
278
252
|
{
|
|
279
|
-
value: String(
|
|
280
|
-
onChange: (
|
|
281
|
-
|
|
253
|
+
value: String(a ?? ""),
|
|
254
|
+
onChange: (k) => {
|
|
255
|
+
t(o, k.target.value);
|
|
282
256
|
},
|
|
283
|
-
|
|
284
|
-
children:
|
|
257
|
+
className: R,
|
|
258
|
+
children: n.map((k) => /* @__PURE__ */ e("option", { value: String(k), children: String(k) }, String(k)))
|
|
285
259
|
}
|
|
286
260
|
);
|
|
287
261
|
}
|
|
288
262
|
case "text":
|
|
289
|
-
return /* @__PURE__ */
|
|
263
|
+
return /* @__PURE__ */ e(
|
|
290
264
|
"input",
|
|
291
265
|
{
|
|
292
266
|
type: "text",
|
|
293
|
-
value: typeof
|
|
294
|
-
onChange: (
|
|
295
|
-
|
|
267
|
+
value: typeof a == "string" ? a : String(a ?? ""),
|
|
268
|
+
onChange: (n) => {
|
|
269
|
+
t(o, n.target.value);
|
|
296
270
|
},
|
|
297
|
-
|
|
271
|
+
className: R
|
|
298
272
|
}
|
|
299
273
|
);
|
|
300
274
|
case "action":
|
|
301
|
-
return /* @__PURE__ */
|
|
302
|
-
"span",
|
|
303
|
-
{
|
|
304
|
-
style: {
|
|
305
|
-
display: "inline-block",
|
|
306
|
-
padding: "2px 8px",
|
|
307
|
-
fontSize: 11,
|
|
308
|
-
fontWeight: 600,
|
|
309
|
-
color: "#7c3aed",
|
|
310
|
-
background: "#f5f3ff",
|
|
311
|
-
border: "1px solid #ddd6fe",
|
|
312
|
-
borderRadius: 4,
|
|
313
|
-
fontFamily: "monospace"
|
|
314
|
-
},
|
|
315
|
-
children: "(action)"
|
|
316
|
-
}
|
|
317
|
-
);
|
|
275
|
+
return /* @__PURE__ */ e("span", { className: "jogak:inline-block jogak:px-2 jogak:py-0.5 jogak:text-[11px] jogak:font-semibold jogak:text-[var(--jogak-color-violet)] jogak:bg-[var(--jogak-color-violet-bg)] jogak:border jogak:border-[var(--jogak-color-violet-border)] jogak:rounded-[var(--jogak-radius-md)] jogak:font-[family-name:var(--jogak-font-mono)] jogak:leading-none", children: "(action)" });
|
|
318
276
|
case "json":
|
|
319
|
-
return /* @__PURE__ */
|
|
277
|
+
return /* @__PURE__ */ e("code", { className: "jogak:text-[12px] jogak:text-[var(--jogak-color-fg-muted)] jogak:font-[family-name:var(--jogak-font-mono)]", children: JSON.stringify(a) });
|
|
320
278
|
}
|
|
321
279
|
}
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
textAlign: "left",
|
|
332
|
-
color: "#6b7280",
|
|
333
|
-
fontWeight: 500,
|
|
334
|
-
fontSize: 12,
|
|
335
|
-
borderBottom: "1px solid #e5e7eb"
|
|
336
|
-
}, B = {
|
|
337
|
-
padding: "8px 20px",
|
|
338
|
-
verticalAlign: "middle",
|
|
339
|
-
borderBottom: "1px solid #f3f4f6"
|
|
340
|
-
};
|
|
341
|
-
function te({ args: e, argTypes: t, onArgChange: o }) {
|
|
342
|
-
const d = Array.from(/* @__PURE__ */ new Set([...Object.keys(e), ...Object.keys(t)])).map((r) => [r, e[r]]);
|
|
343
|
-
return /* @__PURE__ */ c("div", { style: { borderTop: "2px solid #e5e7eb" }, children: [
|
|
344
|
-
/* @__PURE__ */ n(
|
|
345
|
-
"div",
|
|
346
|
-
{
|
|
347
|
-
style: {
|
|
348
|
-
padding: "6px 20px",
|
|
349
|
-
fontSize: 11,
|
|
350
|
-
fontWeight: 700,
|
|
351
|
-
color: "#9ca3af",
|
|
352
|
-
textTransform: "uppercase",
|
|
353
|
-
letterSpacing: "0.08em",
|
|
354
|
-
borderBottom: "1px solid #e5e7eb",
|
|
355
|
-
background: "#f9fafb"
|
|
356
|
-
},
|
|
357
|
-
children: "Controls"
|
|
358
|
-
}
|
|
359
|
-
),
|
|
360
|
-
d.length === 0 ? /* @__PURE__ */ n("div", { style: { padding: "12px 20px", color: "#9ca3af", fontSize: 13 }, children: "No args defined" }) : /* @__PURE__ */ c("table", { style: { width: "100%", borderCollapse: "collapse", fontSize: 13 }, children: [
|
|
361
|
-
/* @__PURE__ */ n("thead", { children: /* @__PURE__ */ c("tr", { children: [
|
|
362
|
-
/* @__PURE__ */ n("th", { style: A, children: "Name" }),
|
|
363
|
-
/* @__PURE__ */ n("th", { style: A, children: "Control" }),
|
|
364
|
-
/* @__PURE__ */ n("th", { style: A, children: "Description" })
|
|
280
|
+
function ro({ args: o, argTypes: a, onArgChange: r }) {
|
|
281
|
+
const g = Array.from(/* @__PURE__ */ new Set([...Object.keys(o), ...Object.keys(a)])).map((n) => [n, o[n]]);
|
|
282
|
+
return /* @__PURE__ */ j("div", { className: "jogak:border-t-2 jogak:border-[var(--jogak-color-border)]", children: [
|
|
283
|
+
/* @__PURE__ */ e("div", { className: "jogak:px-5 jogak:py-1.5 jogak:text-[11px] jogak:font-bold jogak:text-[var(--jogak-color-fg-subtle)] jogak:uppercase jogak:tracking-[0.08em] jogak:border-b jogak:border-[var(--jogak-color-border)] jogak:bg-[var(--jogak-color-bg-subtle)]", children: "Controls" }),
|
|
284
|
+
g.length === 0 ? /* @__PURE__ */ e("div", { className: "jogak:px-5 jogak:py-3 jogak:text-[var(--jogak-color-fg-subtle)] jogak:text-[13px]", children: "No args defined" }) : /* @__PURE__ */ j("table", { className: "jogak:w-full jogak:border-collapse jogak:text-[13px]", children: [
|
|
285
|
+
/* @__PURE__ */ e("thead", { children: /* @__PURE__ */ j("tr", { children: [
|
|
286
|
+
/* @__PURE__ */ e("th", { className: _, children: "Name" }),
|
|
287
|
+
/* @__PURE__ */ e("th", { className: _, children: "Control" }),
|
|
288
|
+
/* @__PURE__ */ e("th", { className: _, children: "Description" })
|
|
365
289
|
] }) }),
|
|
366
|
-
/* @__PURE__ */
|
|
367
|
-
const
|
|
368
|
-
return /* @__PURE__ */
|
|
369
|
-
/* @__PURE__ */
|
|
290
|
+
/* @__PURE__ */ e("tbody", { children: g.map(([n, k]) => {
|
|
291
|
+
const s = a[n];
|
|
292
|
+
return /* @__PURE__ */ j("tr", { children: [
|
|
293
|
+
/* @__PURE__ */ e(
|
|
370
294
|
"td",
|
|
371
295
|
{
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
whiteSpace: "nowrap"
|
|
378
|
-
},
|
|
379
|
-
children: r
|
|
296
|
+
className: h(
|
|
297
|
+
$,
|
|
298
|
+
"jogak:font-[family-name:var(--jogak-font-mono)] jogak:text-[12px] jogak:text-[var(--jogak-color-fg)] jogak:whitespace-nowrap"
|
|
299
|
+
),
|
|
300
|
+
children: n
|
|
380
301
|
}
|
|
381
302
|
),
|
|
382
|
-
/* @__PURE__ */
|
|
383
|
-
|
|
303
|
+
/* @__PURE__ */ e("td", { className: $, children: /* @__PURE__ */ e(
|
|
304
|
+
eo,
|
|
384
305
|
{
|
|
385
|
-
argKey:
|
|
386
|
-
value:
|
|
387
|
-
argType:
|
|
388
|
-
onArgChange:
|
|
306
|
+
argKey: n,
|
|
307
|
+
value: k,
|
|
308
|
+
argType: s,
|
|
309
|
+
onArgChange: r
|
|
389
310
|
}
|
|
390
311
|
) }),
|
|
391
|
-
/* @__PURE__ */
|
|
392
|
-
] },
|
|
312
|
+
/* @__PURE__ */ e("td", { className: h($, "jogak:text-[var(--jogak-color-fg-subtle)]"), children: (s == null ? void 0 : s.description) ?? "" })
|
|
313
|
+
] }, n);
|
|
393
314
|
}) })
|
|
394
315
|
] })
|
|
395
316
|
] });
|
|
396
317
|
}
|
|
397
|
-
function
|
|
398
|
-
if (
|
|
318
|
+
function to(o) {
|
|
319
|
+
if (o.length === 0) return "()";
|
|
399
320
|
try {
|
|
400
|
-
return
|
|
401
|
-
var
|
|
402
|
-
if (
|
|
403
|
-
if (
|
|
404
|
-
if (typeof
|
|
405
|
-
if (typeof
|
|
406
|
-
const
|
|
407
|
-
return
|
|
321
|
+
return o.map((a) => {
|
|
322
|
+
var r;
|
|
323
|
+
if (a === null) return "null";
|
|
324
|
+
if (a === void 0) return "undefined";
|
|
325
|
+
if (typeof a == "function") return "[Function]";
|
|
326
|
+
if (typeof a == "object") {
|
|
327
|
+
const t = ((r = a.constructor) == null ? void 0 : r.name) ?? "Object";
|
|
328
|
+
return t !== "Object" && t !== "Array" ? `[${t}]` : JSON.stringify(a);
|
|
408
329
|
}
|
|
409
|
-
return JSON.stringify(
|
|
330
|
+
return JSON.stringify(a);
|
|
410
331
|
}).join(", ");
|
|
411
332
|
} catch {
|
|
412
333
|
return "[unserializable]";
|
|
413
334
|
}
|
|
414
335
|
}
|
|
415
|
-
function
|
|
416
|
-
const
|
|
417
|
-
return `${
|
|
336
|
+
function no(o) {
|
|
337
|
+
const a = new Date(o), r = a.getHours().toString().padStart(2, "0"), t = a.getMinutes().toString().padStart(2, "0"), g = a.getSeconds().toString().padStart(2, "0"), n = a.getMilliseconds().toString().padStart(3, "0");
|
|
338
|
+
return `${r}:${t}:${g}.${n}`;
|
|
418
339
|
}
|
|
419
|
-
function
|
|
420
|
-
const [
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
{
|
|
447
|
-
type: "button",
|
|
448
|
-
onClick: () => {
|
|
449
|
-
z.clear();
|
|
450
|
-
},
|
|
451
|
-
disabled: e.length === 0,
|
|
452
|
-
style: {
|
|
453
|
-
fontSize: 10,
|
|
454
|
-
fontWeight: 600,
|
|
455
|
-
padding: "2px 8px",
|
|
456
|
-
border: "1px solid #d1d5db",
|
|
457
|
-
borderRadius: 3,
|
|
458
|
-
background: "#fff",
|
|
459
|
-
color: e.length === 0 ? "#9ca3af" : "#374151",
|
|
460
|
-
cursor: e.length === 0 ? "default" : "pointer",
|
|
461
|
-
textTransform: "none",
|
|
462
|
-
letterSpacing: 0
|
|
463
|
-
},
|
|
464
|
-
children: "Clear"
|
|
465
|
-
}
|
|
466
|
-
)
|
|
467
|
-
]
|
|
468
|
-
}
|
|
469
|
-
),
|
|
470
|
-
/* @__PURE__ */ n("div", { style: { flex: 1, overflow: "auto" }, children: e.length === 0 ? /* @__PURE__ */ n(
|
|
471
|
-
"div",
|
|
472
|
-
{
|
|
473
|
-
style: {
|
|
474
|
-
padding: "12px 20px",
|
|
475
|
-
color: "#9ca3af",
|
|
476
|
-
fontSize: 13
|
|
477
|
-
},
|
|
478
|
-
children: "함수 prop이 호출되면 여기에 기록됩니다"
|
|
479
|
-
}
|
|
480
|
-
) : /* @__PURE__ */ n("ul", { style: { listStyle: "none", margin: 0, padding: 0, fontFamily: "monospace", fontSize: 12 }, children: e.map((o) => /* @__PURE__ */ c(
|
|
340
|
+
function go() {
|
|
341
|
+
const [o, a] = f(() => S.getLogs());
|
|
342
|
+
w(() => S.subscribe(a), []);
|
|
343
|
+
const r = o.length === 0;
|
|
344
|
+
return /* @__PURE__ */ j("div", { className: "jogak:h-full jogak:flex jogak:flex-col", children: [
|
|
345
|
+
/* @__PURE__ */ j("div", { className: "jogak:px-5 jogak:py-1.5 jogak:text-[11px] jogak:font-bold jogak:text-[var(--jogak-color-fg-subtle)] jogak:uppercase jogak:tracking-[0.08em] jogak:border-b jogak:border-[var(--jogak-color-border)] jogak:bg-[var(--jogak-color-bg-subtle)] jogak:flex jogak:items-center jogak:justify-between jogak:shrink-0", children: [
|
|
346
|
+
/* @__PURE__ */ j("span", { children: [
|
|
347
|
+
"Actions ",
|
|
348
|
+
o.length > 0 && `(${o.length.toString()})`
|
|
349
|
+
] }),
|
|
350
|
+
/* @__PURE__ */ e(
|
|
351
|
+
"button",
|
|
352
|
+
{
|
|
353
|
+
type: "button",
|
|
354
|
+
onClick: () => {
|
|
355
|
+
S.clear();
|
|
356
|
+
},
|
|
357
|
+
disabled: r,
|
|
358
|
+
className: h(
|
|
359
|
+
"jogak:text-[10px] jogak:font-semibold jogak:px-2 jogak:py-0.5 jogak:border jogak:border-[var(--jogak-color-border-strong)] jogak:rounded-[var(--jogak-radius-sm)] jogak:bg-[var(--jogak-color-bg)] jogak:normal-case jogak:tracking-normal",
|
|
360
|
+
r ? "jogak:text-[var(--jogak-color-fg-subtle)] jogak:cursor-default" : "jogak:text-[var(--jogak-color-fg)] jogak:cursor-pointer"
|
|
361
|
+
),
|
|
362
|
+
children: "Clear"
|
|
363
|
+
}
|
|
364
|
+
)
|
|
365
|
+
] }),
|
|
366
|
+
/* @__PURE__ */ e("div", { className: "jogak:flex-1 jogak:overflow-auto", children: r ? /* @__PURE__ */ e("div", { className: "jogak:px-5 jogak:py-3 jogak:text-[var(--jogak-color-fg-subtle)] jogak:text-[13px] jogak:leading-none", children: "함수 prop이 호출되면 여기에 기록됩니다" }) : /* @__PURE__ */ e("ul", { className: "jogak:list-none jogak:m-0 jogak:p-0 jogak:font-[family-name:var(--jogak-font-mono)] jogak:text-[12px]", children: o.map((t) => /* @__PURE__ */ j(
|
|
481
367
|
"li",
|
|
482
368
|
{
|
|
483
|
-
|
|
484
|
-
display: "flex",
|
|
485
|
-
alignItems: "baseline",
|
|
486
|
-
gap: 10,
|
|
487
|
-
padding: "6px 20px",
|
|
488
|
-
borderBottom: "1px solid #f3f4f6"
|
|
489
|
-
},
|
|
369
|
+
className: "jogak:flex jogak:items-baseline jogak:gap-[10px] jogak:px-5 jogak:py-1.5 jogak:border-b jogak:border-[var(--jogak-color-border-muted)]",
|
|
490
370
|
children: [
|
|
491
|
-
/* @__PURE__ */
|
|
492
|
-
/* @__PURE__ */
|
|
493
|
-
/* @__PURE__ */
|
|
371
|
+
/* @__PURE__ */ e("span", { className: "jogak:text-[var(--jogak-color-fg-subtle)] jogak:text-[11px] jogak:min-w-[92px]", children: no(t.timestamp) }),
|
|
372
|
+
/* @__PURE__ */ e("span", { className: "jogak:text-[var(--jogak-color-violet)] jogak:font-semibold", children: t.name }),
|
|
373
|
+
/* @__PURE__ */ j("span", { className: "jogak:text-[var(--jogak-color-fg)] jogak:break-all jogak:flex-1", children: [
|
|
494
374
|
"(",
|
|
495
|
-
|
|
375
|
+
to(t.args),
|
|
496
376
|
")"
|
|
497
377
|
] })
|
|
498
378
|
]
|
|
499
379
|
},
|
|
500
|
-
|
|
380
|
+
t.id
|
|
501
381
|
)) }) })
|
|
502
382
|
] });
|
|
503
383
|
}
|
|
504
|
-
const
|
|
384
|
+
const U = {
|
|
505
385
|
mobile: 375,
|
|
506
386
|
tablet: 768,
|
|
507
387
|
desktop: "none"
|
|
508
|
-
},
|
|
388
|
+
}, so = {
|
|
509
389
|
mobile: "Mobile",
|
|
510
390
|
tablet: "Tablet",
|
|
511
391
|
desktop: "Desktop"
|
|
512
|
-
},
|
|
513
|
-
white: {
|
|
514
|
-
|
|
392
|
+
}, O = {
|
|
393
|
+
white: {
|
|
394
|
+
"--jogak-canvas-bg": "#ffffff",
|
|
395
|
+
"--jogak-canvas-bg-image": "none",
|
|
396
|
+
"--jogak-canvas-bg-size": "auto",
|
|
397
|
+
"--jogak-canvas-bg-position": "0 0"
|
|
398
|
+
},
|
|
399
|
+
dark: {
|
|
400
|
+
"--jogak-canvas-bg": "#1f2937",
|
|
401
|
+
"--jogak-canvas-bg-image": "none",
|
|
402
|
+
"--jogak-canvas-bg-size": "auto",
|
|
403
|
+
"--jogak-canvas-bg-position": "0 0"
|
|
404
|
+
},
|
|
515
405
|
transparent: {
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
"linear-gradient(-45deg, transparent 75%, #e2e8f0 75%)"
|
|
521
|
-
].join(", "),
|
|
522
|
-
backgroundSize: "16px 16px",
|
|
523
|
-
backgroundPosition: "0 0, 0 8px, 8px -8px, -8px 0px",
|
|
524
|
-
backgroundColor: "#ffffff"
|
|
406
|
+
"--jogak-canvas-bg": "#ffffff",
|
|
407
|
+
"--jogak-canvas-bg-image": "linear-gradient(45deg, #e2e8f0 25%, transparent 25%), linear-gradient(-45deg, #e2e8f0 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #e2e8f0 75%), linear-gradient(-45deg, transparent 75%, #e2e8f0 75%)",
|
|
408
|
+
"--jogak-canvas-bg-size": "16px 16px",
|
|
409
|
+
"--jogak-canvas-bg-position": "0 0, 0 8px, 8px -8px, -8px 0px"
|
|
525
410
|
}
|
|
526
|
-
},
|
|
527
|
-
function
|
|
528
|
-
return
|
|
411
|
+
}, L = "jogak:bg-[var(--jogak-canvas-bg)] jogak:bg-[image:var(--jogak-canvas-bg-image)] jogak:bg-[length:var(--jogak-canvas-bg-size)] jogak:bg-[position:var(--jogak-canvas-bg-position)]";
|
|
412
|
+
function ko(o) {
|
|
413
|
+
return B[o] ?? B.vsDark;
|
|
529
414
|
}
|
|
530
|
-
function
|
|
531
|
-
entryId:
|
|
532
|
-
jogakName:
|
|
533
|
-
overrideArgs:
|
|
534
|
-
onArgChange:
|
|
535
|
-
onReset:
|
|
536
|
-
codeTheme:
|
|
537
|
-
onResolveJogak:
|
|
415
|
+
function lo({
|
|
416
|
+
entryId: o,
|
|
417
|
+
jogakName: a,
|
|
418
|
+
overrideArgs: r,
|
|
419
|
+
onArgChange: t,
|
|
420
|
+
onReset: g,
|
|
421
|
+
codeTheme: n,
|
|
422
|
+
onResolveJogak: k
|
|
538
423
|
}) {
|
|
539
|
-
const
|
|
540
|
-
return
|
|
541
|
-
"
|
|
542
|
-
|
|
543
|
-
|
|
424
|
+
const s = Q(o), [l, b] = f("desktop"), [i, u] = f("white"), [v, m] = f("controls"), x = ko(n);
|
|
425
|
+
return s.status === "unknown" ? /* @__PURE__ */ j(
|
|
426
|
+
"div",
|
|
427
|
+
{
|
|
428
|
+
"data-testid": "preview-not-found",
|
|
429
|
+
className: "jogak:p-6 jogak:text-[var(--jogak-color-error)]",
|
|
430
|
+
children: [
|
|
431
|
+
"Entry not found: ",
|
|
432
|
+
o
|
|
433
|
+
]
|
|
434
|
+
}
|
|
435
|
+
) : s.status === "error" ? /* @__PURE__ */ j(
|
|
544
436
|
"div",
|
|
545
437
|
{
|
|
546
438
|
"data-testid": "preview-error",
|
|
547
|
-
|
|
548
|
-
padding: 24,
|
|
549
|
-
color: "#b91c1c",
|
|
550
|
-
background: "#fef2f2",
|
|
551
|
-
height: "100%",
|
|
552
|
-
display: "flex",
|
|
553
|
-
flexDirection: "column",
|
|
554
|
-
gap: 12,
|
|
555
|
-
alignItems: "flex-start"
|
|
556
|
-
},
|
|
439
|
+
className: "jogak:p-6 jogak:text-[var(--jogak-color-error-fg)] jogak:bg-[var(--jogak-color-bg-error)] jogak:h-full jogak:flex jogak:flex-col jogak:gap-3 jogak:items-start",
|
|
557
440
|
children: [
|
|
558
|
-
/* @__PURE__ */
|
|
441
|
+
/* @__PURE__ */ j("div", { className: "jogak:font-semibold", children: [
|
|
559
442
|
"Failed to load entry: ",
|
|
560
|
-
|
|
443
|
+
o
|
|
561
444
|
] }),
|
|
562
|
-
/* @__PURE__ */
|
|
563
|
-
"pre",
|
|
564
|
-
{
|
|
565
|
-
style: {
|
|
566
|
-
margin: 0,
|
|
567
|
-
padding: 12,
|
|
568
|
-
background: "#fff",
|
|
569
|
-
border: "1px solid #fecaca",
|
|
570
|
-
borderRadius: 6,
|
|
571
|
-
fontSize: 12,
|
|
572
|
-
whiteSpace: "pre-wrap",
|
|
573
|
-
maxWidth: "100%"
|
|
574
|
-
},
|
|
575
|
-
children: l.error.message
|
|
576
|
-
}
|
|
577
|
-
)
|
|
445
|
+
/* @__PURE__ */ e("pre", { className: "jogak:m-0 jogak:p-3 jogak:bg-[var(--jogak-color-bg)] jogak:border jogak:border-[var(--jogak-color-error-border)] jogak:rounded-[var(--jogak-radius-lg)] jogak:text-[12px] jogak:whitespace-pre-wrap jogak:max-w-full", children: s.error.message })
|
|
578
446
|
]
|
|
579
447
|
}
|
|
580
|
-
) :
|
|
581
|
-
|
|
448
|
+
) : s.status === "loading" ? /* @__PURE__ */ e(
|
|
449
|
+
jo,
|
|
582
450
|
{
|
|
583
|
-
meta:
|
|
584
|
-
jogakName:
|
|
585
|
-
viewport:
|
|
586
|
-
bgMode:
|
|
587
|
-
onViewportChange:
|
|
588
|
-
onBgModeChange:
|
|
451
|
+
meta: s.meta,
|
|
452
|
+
jogakName: a,
|
|
453
|
+
viewport: l,
|
|
454
|
+
bgMode: i,
|
|
455
|
+
onViewportChange: b,
|
|
456
|
+
onBgModeChange: u
|
|
589
457
|
}
|
|
590
|
-
) : /* @__PURE__ */
|
|
591
|
-
|
|
458
|
+
) : /* @__PURE__ */ e(
|
|
459
|
+
io,
|
|
592
460
|
{
|
|
593
|
-
entry:
|
|
594
|
-
jogakName:
|
|
595
|
-
overrideArgs:
|
|
596
|
-
onArgChange:
|
|
597
|
-
onReset:
|
|
598
|
-
onResolveJogak:
|
|
599
|
-
viewport:
|
|
600
|
-
bgMode:
|
|
601
|
-
bottomTab:
|
|
602
|
-
onViewportChange:
|
|
603
|
-
onBgModeChange:
|
|
604
|
-
onBottomTabChange:
|
|
605
|
-
prismTheme:
|
|
461
|
+
entry: s.entry,
|
|
462
|
+
jogakName: a,
|
|
463
|
+
overrideArgs: r,
|
|
464
|
+
onArgChange: t,
|
|
465
|
+
onReset: g,
|
|
466
|
+
onResolveJogak: k,
|
|
467
|
+
viewport: l,
|
|
468
|
+
bgMode: i,
|
|
469
|
+
bottomTab: v,
|
|
470
|
+
onViewportChange: b,
|
|
471
|
+
onBgModeChange: u,
|
|
472
|
+
onBottomTabChange: m,
|
|
473
|
+
prismTheme: x
|
|
606
474
|
}
|
|
607
475
|
);
|
|
608
476
|
}
|
|
609
|
-
function
|
|
610
|
-
meta:
|
|
611
|
-
jogakName:
|
|
612
|
-
viewport:
|
|
613
|
-
bgMode:
|
|
614
|
-
onViewportChange:
|
|
615
|
-
onBgModeChange:
|
|
477
|
+
function jo({
|
|
478
|
+
meta: o,
|
|
479
|
+
jogakName: a,
|
|
480
|
+
viewport: r,
|
|
481
|
+
bgMode: t,
|
|
482
|
+
onViewportChange: g,
|
|
483
|
+
onBgModeChange: n
|
|
616
484
|
}) {
|
|
617
|
-
const
|
|
618
|
-
return /* @__PURE__ */
|
|
485
|
+
const k = a ?? o.jogakNames[0] ?? "...", s = U[r];
|
|
486
|
+
return /* @__PURE__ */ j(
|
|
619
487
|
"div",
|
|
620
488
|
{
|
|
621
489
|
"data-testid": "preview-loading",
|
|
622
|
-
|
|
490
|
+
className: "jogak:flex jogak:flex-col jogak:h-full",
|
|
623
491
|
children: [
|
|
624
|
-
/* @__PURE__ */
|
|
625
|
-
|
|
492
|
+
/* @__PURE__ */ e(
|
|
493
|
+
W,
|
|
626
494
|
{
|
|
627
|
-
title:
|
|
628
|
-
jogakName:
|
|
629
|
-
viewport:
|
|
630
|
-
bgMode:
|
|
631
|
-
onViewportChange:
|
|
632
|
-
onBgModeChange:
|
|
495
|
+
title: o.title,
|
|
496
|
+
jogakName: k,
|
|
497
|
+
viewport: r,
|
|
498
|
+
bgMode: t,
|
|
499
|
+
onViewportChange: g,
|
|
500
|
+
onBgModeChange: n,
|
|
633
501
|
showReset: !1,
|
|
634
502
|
onReset: () => {
|
|
635
503
|
}
|
|
636
504
|
}
|
|
637
505
|
),
|
|
638
|
-
/* @__PURE__ */
|
|
506
|
+
/* @__PURE__ */ e(
|
|
639
507
|
"div",
|
|
640
508
|
{
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
overflow: "auto",
|
|
645
|
-
...M[i]
|
|
646
|
-
},
|
|
647
|
-
children: /* @__PURE__ */ n(
|
|
509
|
+
className: `jogak:flex-1 jogak:overflow-auto jogak:min-h-[320px] ${L}`,
|
|
510
|
+
style: O[t],
|
|
511
|
+
children: /* @__PURE__ */ e(
|
|
648
512
|
"div",
|
|
649
513
|
{
|
|
514
|
+
className: "jogak:mx-auto jogak:p-6 jogak:max-w-[var(--jogak-canvas-mw)]",
|
|
650
515
|
style: {
|
|
651
|
-
|
|
652
|
-
margin: "0 auto",
|
|
653
|
-
padding: 24
|
|
516
|
+
"--jogak-canvas-mw": s === "none" ? "100%" : `${s}px`
|
|
654
517
|
},
|
|
655
|
-
children: /* @__PURE__ */
|
|
656
|
-
"
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
borderRadius: 8,
|
|
661
|
-
padding: 16,
|
|
662
|
-
minHeight: I - 64,
|
|
663
|
-
display: "flex",
|
|
664
|
-
alignItems: "center",
|
|
665
|
-
justifyContent: "center",
|
|
666
|
-
color: "#9ca3af",
|
|
667
|
-
fontSize: 13,
|
|
668
|
-
background: "linear-gradient(90deg, rgba(229,231,235,0) 0%, rgba(229,231,235,0.45) 50%, rgba(229,231,235,0) 100%)",
|
|
669
|
-
backgroundSize: "200% 100%",
|
|
670
|
-
animation: "jogakSkeleton 1.4s ease-in-out infinite"
|
|
671
|
-
},
|
|
672
|
-
children: [
|
|
673
|
-
"Loading ",
|
|
674
|
-
e.title,
|
|
675
|
-
"…"
|
|
676
|
-
]
|
|
677
|
-
}
|
|
678
|
-
)
|
|
518
|
+
children: /* @__PURE__ */ j("div", { className: "jogak-skeleton-shimmer jogak:border jogak:border-dashed jogak:border-[var(--jogak-color-border)] jogak:rounded-[var(--jogak-radius-xl)] jogak:p-4 jogak:flex jogak:items-center jogak:justify-center jogak:text-[var(--jogak-color-fg-subtle)] jogak:text-[13px] jogak:min-h-[256px]", children: [
|
|
519
|
+
"Loading ",
|
|
520
|
+
o.title,
|
|
521
|
+
"…"
|
|
522
|
+
] })
|
|
679
523
|
}
|
|
680
524
|
)
|
|
681
525
|
}
|
|
682
|
-
)
|
|
683
|
-
/* @__PURE__ */ n("style", { children: "@keyframes jogakSkeleton { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }" })
|
|
526
|
+
)
|
|
684
527
|
]
|
|
685
528
|
}
|
|
686
529
|
);
|
|
687
530
|
}
|
|
688
|
-
function
|
|
689
|
-
entry:
|
|
690
|
-
jogakName:
|
|
691
|
-
overrideArgs:
|
|
692
|
-
onArgChange:
|
|
693
|
-
onReset:
|
|
694
|
-
onResolveJogak:
|
|
695
|
-
viewport:
|
|
696
|
-
bgMode:
|
|
697
|
-
bottomTab:
|
|
698
|
-
onViewportChange:
|
|
699
|
-
onBgModeChange:
|
|
700
|
-
onBottomTabChange:
|
|
701
|
-
prismTheme:
|
|
531
|
+
function io({
|
|
532
|
+
entry: o,
|
|
533
|
+
jogakName: a,
|
|
534
|
+
overrideArgs: r,
|
|
535
|
+
onArgChange: t,
|
|
536
|
+
onReset: g,
|
|
537
|
+
onResolveJogak: n,
|
|
538
|
+
viewport: k,
|
|
539
|
+
bgMode: s,
|
|
540
|
+
bottomTab: l,
|
|
541
|
+
onViewportChange: b,
|
|
542
|
+
onBgModeChange: i,
|
|
543
|
+
onBottomTabChange: u,
|
|
544
|
+
prismTheme: v
|
|
702
545
|
}) {
|
|
703
|
-
var
|
|
704
|
-
const
|
|
705
|
-
if (
|
|
706
|
-
|
|
707
|
-
}, [
|
|
708
|
-
return /* @__PURE__ */
|
|
546
|
+
var J;
|
|
547
|
+
const m = a ?? ((J = o.jogaks[0]) == null ? void 0 : J.name) ?? null;
|
|
548
|
+
if (w(() => {
|
|
549
|
+
a === null && m !== null && n !== void 0 && n(o.id, m);
|
|
550
|
+
}, [a, m, o.id, n]), m === null)
|
|
551
|
+
return /* @__PURE__ */ j("div", { className: "jogak:p-6 jogak:text-[var(--jogak-color-error)]", children: [
|
|
709
552
|
"Entry has no jogaks: ",
|
|
710
|
-
|
|
553
|
+
o.id
|
|
711
554
|
] });
|
|
712
|
-
const
|
|
713
|
-
if (
|
|
714
|
-
return /* @__PURE__ */
|
|
555
|
+
const x = o.jogaks.find((N) => N.name === m);
|
|
556
|
+
if (x === void 0)
|
|
557
|
+
return /* @__PURE__ */ j("div", { className: "jogak:p-6 jogak:text-[var(--jogak-color-error)]", children: [
|
|
715
558
|
"Jogak not found: ",
|
|
716
|
-
|
|
559
|
+
m
|
|
717
560
|
] });
|
|
718
|
-
const
|
|
719
|
-
...
|
|
720
|
-
...
|
|
721
|
-
},
|
|
722
|
-
return /* @__PURE__ */
|
|
723
|
-
/* @__PURE__ */
|
|
724
|
-
|
|
561
|
+
const d = { ...x.args ?? {}, ...r }, p = {
|
|
562
|
+
...o.meta.argTypes ?? {},
|
|
563
|
+
...x.argTypes ?? {}
|
|
564
|
+
}, G = Object.keys(r).length > 0, E = U[k];
|
|
565
|
+
return /* @__PURE__ */ j("div", { className: "jogak:flex jogak:flex-col jogak:h-full", children: [
|
|
566
|
+
/* @__PURE__ */ e(
|
|
567
|
+
W,
|
|
725
568
|
{
|
|
726
|
-
title:
|
|
727
|
-
jogakName:
|
|
728
|
-
viewport:
|
|
729
|
-
bgMode:
|
|
730
|
-
onViewportChange:
|
|
731
|
-
onBgModeChange:
|
|
732
|
-
showReset:
|
|
733
|
-
onReset:
|
|
569
|
+
title: o.title,
|
|
570
|
+
jogakName: x.name,
|
|
571
|
+
viewport: k,
|
|
572
|
+
bgMode: s,
|
|
573
|
+
onViewportChange: b,
|
|
574
|
+
onBgModeChange: i,
|
|
575
|
+
showReset: G,
|
|
576
|
+
onReset: g
|
|
734
577
|
}
|
|
735
578
|
),
|
|
736
|
-
/* @__PURE__ */
|
|
579
|
+
/* @__PURE__ */ e(
|
|
737
580
|
"div",
|
|
738
581
|
{
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
overflow: "auto",
|
|
743
|
-
...M[l]
|
|
744
|
-
},
|
|
745
|
-
children: /* @__PURE__ */ n(
|
|
582
|
+
className: `jogak:flex-1 jogak:overflow-auto jogak:min-h-[320px] ${L}`,
|
|
583
|
+
style: O[s],
|
|
584
|
+
children: /* @__PURE__ */ e(
|
|
746
585
|
"div",
|
|
747
586
|
{
|
|
748
587
|
"data-jogak-content": !0,
|
|
588
|
+
className: "jogak:mx-auto jogak:p-6 jogak:max-w-[var(--jogak-canvas-mw)]",
|
|
749
589
|
style: {
|
|
750
|
-
|
|
751
|
-
margin: "0 auto",
|
|
752
|
-
padding: 24
|
|
590
|
+
"--jogak-canvas-mw": E === "none" ? "100%" : `${E}px`
|
|
753
591
|
},
|
|
754
|
-
children: /* @__PURE__ */
|
|
755
|
-
|
|
592
|
+
children: /* @__PURE__ */ e(
|
|
593
|
+
co,
|
|
756
594
|
{
|
|
757
|
-
entry:
|
|
758
|
-
args:
|
|
759
|
-
source:
|
|
760
|
-
theme:
|
|
595
|
+
entry: o,
|
|
596
|
+
args: d,
|
|
597
|
+
source: o.source,
|
|
598
|
+
theme: v
|
|
761
599
|
},
|
|
762
|
-
`${
|
|
600
|
+
`${o.id}/${x.name}`
|
|
763
601
|
)
|
|
764
602
|
}
|
|
765
603
|
)
|
|
766
604
|
}
|
|
767
605
|
),
|
|
768
|
-
/* @__PURE__ */
|
|
606
|
+
/* @__PURE__ */ j(
|
|
769
607
|
"div",
|
|
770
608
|
{
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
flexShrink: 0,
|
|
774
|
-
display: "flex",
|
|
775
|
-
flexDirection: "column",
|
|
776
|
-
borderTop: "2px solid #e5e7eb"
|
|
777
|
-
},
|
|
609
|
+
"data-testid": "bottom-panel",
|
|
610
|
+
className: "jogak:h-[260px] jogak:shrink-0 jogak:flex jogak:flex-col jogak:border-t-2 jogak:border-[var(--jogak-color-border)]",
|
|
778
611
|
children: [
|
|
779
|
-
/* @__PURE__ */
|
|
612
|
+
/* @__PURE__ */ e(
|
|
780
613
|
"div",
|
|
781
614
|
{
|
|
782
615
|
role: "tablist",
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
background: "#fff",
|
|
788
|
-
borderBottom: "1px solid #e5e7eb",
|
|
789
|
-
flexShrink: 0
|
|
790
|
-
},
|
|
791
|
-
children: ["controls", "actions"].map((k) => {
|
|
792
|
-
const C = s === k;
|
|
793
|
-
return /* @__PURE__ */ n(
|
|
616
|
+
className: "jogak:flex jogak:gap-1 jogak:pt-1 jogak:px-3 jogak:pb-0 jogak:bg-[var(--jogak-color-bg)] jogak:border-b jogak:border-[var(--jogak-color-border)] jogak:shrink-0",
|
|
617
|
+
children: ["controls", "actions"].map((N) => {
|
|
618
|
+
const P = l === N;
|
|
619
|
+
return /* @__PURE__ */ e(
|
|
794
620
|
"button",
|
|
795
621
|
{
|
|
796
622
|
type: "button",
|
|
797
623
|
role: "tab",
|
|
798
|
-
"aria-selected":
|
|
624
|
+
"aria-selected": P,
|
|
799
625
|
onClick: () => {
|
|
800
|
-
|
|
626
|
+
u(N);
|
|
801
627
|
},
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
background: "transparent",
|
|
808
|
-
border: "none",
|
|
809
|
-
borderBottom: C ? "2px solid #2563eb" : "2px solid transparent",
|
|
810
|
-
marginBottom: -1,
|
|
811
|
-
cursor: "pointer",
|
|
812
|
-
textTransform: "capitalize"
|
|
813
|
-
},
|
|
814
|
-
children: k
|
|
628
|
+
className: h(
|
|
629
|
+
"jogak:px-[14px] jogak:py-[6px] jogak:text-[12px] jogak:bg-transparent jogak:border-x-0 jogak:border-t-0 jogak:border-b-2 jogak:border-solid jogak:-mb-px jogak:cursor-pointer jogak:capitalize",
|
|
630
|
+
P ? "jogak:font-semibold jogak:text-[var(--jogak-color-fg-strong)] jogak:border-[var(--jogak-color-accent)]" : "jogak:font-medium jogak:text-[var(--jogak-color-fg-muted)] jogak:border-transparent"
|
|
631
|
+
),
|
|
632
|
+
children: N
|
|
815
633
|
},
|
|
816
|
-
|
|
634
|
+
N
|
|
817
635
|
);
|
|
818
636
|
})
|
|
819
637
|
}
|
|
820
638
|
),
|
|
821
|
-
/* @__PURE__ */
|
|
822
|
-
|
|
639
|
+
/* @__PURE__ */ e("div", { className: "jogak:flex-1 jogak:min-h-0 jogak:overflow-auto", children: l === "controls" ? /* @__PURE__ */ e(
|
|
640
|
+
ro,
|
|
823
641
|
{
|
|
824
|
-
args:
|
|
825
|
-
argTypes:
|
|
826
|
-
onArgChange:
|
|
642
|
+
args: d,
|
|
643
|
+
argTypes: p,
|
|
644
|
+
onArgChange: t
|
|
827
645
|
}
|
|
828
|
-
) : /* @__PURE__ */
|
|
646
|
+
) : /* @__PURE__ */ e(go, {}) })
|
|
829
647
|
]
|
|
830
648
|
}
|
|
831
649
|
)
|
|
832
650
|
] });
|
|
833
651
|
}
|
|
834
|
-
function
|
|
835
|
-
title:
|
|
836
|
-
jogakName:
|
|
837
|
-
viewport:
|
|
838
|
-
bgMode:
|
|
839
|
-
onViewportChange:
|
|
840
|
-
onBgModeChange:
|
|
841
|
-
showReset:
|
|
842
|
-
onReset:
|
|
652
|
+
function W({
|
|
653
|
+
title: o,
|
|
654
|
+
jogakName: a,
|
|
655
|
+
viewport: r,
|
|
656
|
+
bgMode: t,
|
|
657
|
+
onViewportChange: g,
|
|
658
|
+
onBgModeChange: n,
|
|
659
|
+
showReset: k,
|
|
660
|
+
onReset: s
|
|
843
661
|
}) {
|
|
844
|
-
return /* @__PURE__ */
|
|
845
|
-
"div",
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
662
|
+
return /* @__PURE__ */ j("div", { className: "jogak:flex jogak:items-center jogak:gap-[10px] jogak:px-[14px] jogak:py-[7px] jogak:border-b jogak:border-[var(--jogak-color-border)] jogak:bg-[var(--jogak-color-bg)] jogak:shrink-0", children: [
|
|
663
|
+
/* @__PURE__ */ j("div", { className: "jogak:flex-1 jogak:text-[13px]", children: [
|
|
664
|
+
/* @__PURE__ */ e("span", { className: "jogak:text-[var(--jogak-color-fg-subtle)]", children: o }),
|
|
665
|
+
/* @__PURE__ */ e("span", { className: "jogak:text-[var(--jogak-color-border-strong)] jogak:mx-1.5 jogak:leading-none", children: "/" }),
|
|
666
|
+
/* @__PURE__ */ e("span", { className: "jogak:text-[var(--jogak-color-fg-strong)] jogak:font-semibold", children: a })
|
|
667
|
+
] }),
|
|
668
|
+
/* @__PURE__ */ e("div", { className: "jogak:flex jogak:gap-0.5 jogak:bg-[var(--jogak-color-bg-subtle)] jogak:rounded-[var(--jogak-radius-lg)] jogak:p-0.5", children: ["mobile", "tablet", "desktop"].map((l) => /* @__PURE__ */ e(
|
|
669
|
+
"button",
|
|
670
|
+
{
|
|
671
|
+
type: "button",
|
|
672
|
+
onClick: () => {
|
|
673
|
+
g(l);
|
|
674
|
+
},
|
|
675
|
+
"aria-pressed": r === l,
|
|
676
|
+
className: h(
|
|
677
|
+
"jogak:px-[9px] jogak:py-[3px] jogak:text-[12px] jogak:border-none jogak:rounded-[var(--jogak-radius-md)] jogak:cursor-pointer jogak:transition-all jogak:duration-100",
|
|
678
|
+
r === l ? "jogak:bg-[var(--jogak-color-bg-elevated)] jogak:text-[var(--jogak-color-fg-strong)] jogak:font-semibold jogak:shadow-[0_1px_2px_rgba(0,0,0,0.08)]" : "jogak:bg-transparent jogak:text-[var(--jogak-color-fg-muted)] jogak:font-normal jogak:shadow-none"
|
|
679
|
+
),
|
|
680
|
+
children: so[l]
|
|
855
681
|
},
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
},
|
|
872
|
-
children: ["mobile", "tablet", "desktop"].map((s) => /* @__PURE__ */ n(
|
|
873
|
-
"button",
|
|
874
|
-
{
|
|
875
|
-
type: "button",
|
|
876
|
-
onClick: () => {
|
|
877
|
-
d(s);
|
|
878
|
-
},
|
|
879
|
-
"aria-pressed": o === s,
|
|
880
|
-
style: {
|
|
881
|
-
padding: "3px 9px",
|
|
882
|
-
fontSize: 12,
|
|
883
|
-
border: "none",
|
|
884
|
-
borderRadius: 4,
|
|
885
|
-
cursor: "pointer",
|
|
886
|
-
background: o === s ? "#fff" : "transparent",
|
|
887
|
-
color: o === s ? "#111827" : "#6b7280",
|
|
888
|
-
fontWeight: o === s ? 600 : 400,
|
|
889
|
-
boxShadow: o === s ? "0 1px 2px rgba(0,0,0,0.08)" : "none",
|
|
890
|
-
transition: "all 0.1s"
|
|
891
|
-
},
|
|
892
|
-
children: ie[s]
|
|
893
|
-
},
|
|
894
|
-
s
|
|
895
|
-
))
|
|
896
|
-
}
|
|
682
|
+
l
|
|
683
|
+
)) }),
|
|
684
|
+
/* @__PURE__ */ e("div", { className: "jogak:flex jogak:gap-1 jogak:items-center", children: ["white", "dark", "transparent"].map((l) => /* @__PURE__ */ e(
|
|
685
|
+
"button",
|
|
686
|
+
{
|
|
687
|
+
type: "button",
|
|
688
|
+
onClick: () => {
|
|
689
|
+
n(l);
|
|
690
|
+
},
|
|
691
|
+
"aria-pressed": t === l,
|
|
692
|
+
"aria-label": `${l} background`,
|
|
693
|
+
className: h(
|
|
694
|
+
"jogak:w-5 jogak:h-5 jogak:rounded-[var(--jogak-radius-md)] jogak:border-2 jogak:cursor-pointer jogak:p-0 jogak:shrink-0",
|
|
695
|
+
L,
|
|
696
|
+
t === l ? "jogak:border-[var(--jogak-color-accent)]" : "jogak:border-[var(--jogak-color-border-strong)]"
|
|
897
697
|
),
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
cursor: "pointer",
|
|
913
|
-
padding: 0,
|
|
914
|
-
flexShrink: 0,
|
|
915
|
-
...M[s]
|
|
916
|
-
}
|
|
917
|
-
},
|
|
918
|
-
s
|
|
919
|
-
)) }),
|
|
920
|
-
a && /* @__PURE__ */ n(
|
|
921
|
-
"button",
|
|
922
|
-
{
|
|
923
|
-
type: "button",
|
|
924
|
-
onClick: l,
|
|
925
|
-
style: {
|
|
926
|
-
padding: "3px 10px",
|
|
927
|
-
fontSize: 12,
|
|
928
|
-
border: "1px solid #d1d5db",
|
|
929
|
-
borderRadius: 4,
|
|
930
|
-
background: "#fff",
|
|
931
|
-
cursor: "pointer",
|
|
932
|
-
color: "#374151"
|
|
933
|
-
},
|
|
934
|
-
children: "Reset"
|
|
935
|
-
}
|
|
936
|
-
)
|
|
937
|
-
]
|
|
938
|
-
}
|
|
939
|
-
);
|
|
698
|
+
style: O[l]
|
|
699
|
+
},
|
|
700
|
+
l
|
|
701
|
+
)) }),
|
|
702
|
+
k && /* @__PURE__ */ e(
|
|
703
|
+
"button",
|
|
704
|
+
{
|
|
705
|
+
type: "button",
|
|
706
|
+
onClick: s,
|
|
707
|
+
className: "jogak:px-[10px] jogak:py-[3px] jogak:text-[12px] jogak:border jogak:border-[var(--jogak-color-border-strong)] jogak:rounded-[var(--jogak-radius-md)] jogak:bg-[var(--jogak-color-bg)] jogak:cursor-pointer jogak:text-[var(--jogak-color-fg)] jogak:leading-none",
|
|
708
|
+
children: "Reset"
|
|
709
|
+
}
|
|
710
|
+
)
|
|
711
|
+
] });
|
|
940
712
|
}
|
|
941
|
-
function
|
|
942
|
-
const
|
|
943
|
-
return
|
|
944
|
-
const
|
|
945
|
-
if (
|
|
946
|
-
return
|
|
947
|
-
|
|
713
|
+
function co({ entry: o, args: a, source: r, theme: t }) {
|
|
714
|
+
const g = H(null), [n, k] = f(!1);
|
|
715
|
+
return w(() => {
|
|
716
|
+
const s = g.current;
|
|
717
|
+
if (s !== null)
|
|
718
|
+
return A.render(o, a, s), () => {
|
|
719
|
+
A.unmount(s);
|
|
948
720
|
};
|
|
949
|
-
}, [
|
|
950
|
-
const
|
|
951
|
-
|
|
952
|
-
}, [
|
|
953
|
-
/* @__PURE__ */
|
|
954
|
-
/* @__PURE__ */
|
|
721
|
+
}, [o]), w(() => {
|
|
722
|
+
const s = g.current;
|
|
723
|
+
s !== null && A.render(o, a, s);
|
|
724
|
+
}, [o, a]), /* @__PURE__ */ j("div", { children: [
|
|
725
|
+
/* @__PURE__ */ j("div", { className: "jogak:relative", children: [
|
|
726
|
+
/* @__PURE__ */ e(
|
|
955
727
|
"div",
|
|
956
728
|
{
|
|
957
|
-
ref:
|
|
729
|
+
ref: g,
|
|
958
730
|
"data-testid": "preview-content",
|
|
959
|
-
|
|
960
|
-
border: "1px dashed #e5e7eb",
|
|
961
|
-
borderRadius: 8,
|
|
962
|
-
padding: 16,
|
|
963
|
-
paddingBottom: 36
|
|
964
|
-
}
|
|
731
|
+
className: "jogak:border jogak:border-dashed jogak:border-[var(--jogak-color-border)] jogak:rounded-[var(--jogak-radius-xl)] jogak:p-4 jogak:pb-9"
|
|
965
732
|
}
|
|
966
733
|
),
|
|
967
|
-
/* @__PURE__ */
|
|
734
|
+
/* @__PURE__ */ e(
|
|
968
735
|
"button",
|
|
969
736
|
{
|
|
970
737
|
type: "button",
|
|
971
738
|
onClick: () => {
|
|
972
|
-
|
|
973
|
-
},
|
|
974
|
-
"aria-pressed": r,
|
|
975
|
-
"aria-label": r ? "Hide source code" : "Show source code",
|
|
976
|
-
style: {
|
|
977
|
-
position: "absolute",
|
|
978
|
-
bottom: 8,
|
|
979
|
-
right: 8,
|
|
980
|
-
padding: "4px 9px",
|
|
981
|
-
fontSize: 11,
|
|
982
|
-
fontFamily: "ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace",
|
|
983
|
-
fontWeight: 600,
|
|
984
|
-
letterSpacing: "0.02em",
|
|
985
|
-
background: r ? "#2563eb" : "#1e293b",
|
|
986
|
-
color: "#fff",
|
|
987
|
-
border: "none",
|
|
988
|
-
borderRadius: 5,
|
|
989
|
-
cursor: "pointer",
|
|
990
|
-
boxShadow: "0 1px 4px rgba(0,0,0,0.2)",
|
|
991
|
-
transition: "background 0.15s"
|
|
739
|
+
k((s) => !s);
|
|
992
740
|
},
|
|
741
|
+
"aria-pressed": n,
|
|
742
|
+
"aria-label": n ? "Hide source code" : "Show source code",
|
|
743
|
+
className: h(
|
|
744
|
+
"jogak:absolute jogak:bottom-2 jogak:right-2 jogak:px-[9px] jogak:py-1",
|
|
745
|
+
"jogak:text-[11px] jogak:font-[family-name:var(--jogak-font-mono)] jogak:font-semibold jogak:tracking-[0.02em]",
|
|
746
|
+
"jogak:text-[var(--jogak-color-bg)] jogak:border-none jogak:rounded-[5px] jogak:cursor-pointer",
|
|
747
|
+
"jogak:shadow-[0_1px_4px_rgba(0,0,0,0.2)] jogak:transition-[background-color] jogak:duration-150 jogak:leading-none",
|
|
748
|
+
n ? "jogak:bg-[var(--jogak-color-accent)]" : "jogak:bg-[#1e293b]"
|
|
749
|
+
),
|
|
993
750
|
children: "</>"
|
|
994
751
|
}
|
|
995
752
|
)
|
|
996
753
|
] }),
|
|
997
|
-
|
|
998
|
-
"div",
|
|
999
|
-
{
|
|
1000
|
-
style: {
|
|
1001
|
-
marginTop: 8,
|
|
1002
|
-
borderRadius: 8,
|
|
1003
|
-
overflow: "hidden",
|
|
1004
|
-
height: 320,
|
|
1005
|
-
boxShadow: "0 0 0 1px rgba(0,0,0,0.08), 0 4px 16px rgba(0,0,0,0.12)"
|
|
1006
|
-
},
|
|
1007
|
-
children: /* @__PURE__ */ n(pe, { source: o, theme: i })
|
|
1008
|
-
}
|
|
1009
|
-
)
|
|
754
|
+
n && /* @__PURE__ */ e("div", { className: "jogak:mt-2 jogak:rounded-[var(--jogak-radius-xl)] jogak:overflow-hidden jogak:h-[320px] jogak:shadow-[0_0_0_1px_rgba(0,0,0,0.08),_0_4px_16px_rgba(0,0,0,0.12)]", children: /* @__PURE__ */ e(po, { source: r, theme: t }) })
|
|
1010
755
|
] });
|
|
1011
756
|
}
|
|
1012
|
-
function
|
|
1013
|
-
const [
|
|
1014
|
-
return
|
|
757
|
+
function po({ source: o, theme: a }) {
|
|
758
|
+
const [r, t] = f(!1), g = a.plain.backgroundColor ?? "#1e293b";
|
|
759
|
+
return o === void 0 ? /* @__PURE__ */ e(
|
|
1015
760
|
"div",
|
|
1016
761
|
{
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
display: "flex",
|
|
1020
|
-
alignItems: "center",
|
|
1021
|
-
justifyContent: "center",
|
|
1022
|
-
background: d,
|
|
1023
|
-
color: "#94a3b8",
|
|
1024
|
-
fontSize: 13
|
|
1025
|
-
},
|
|
762
|
+
className: "jogak:h-full jogak:flex jogak:items-center jogak:justify-center jogak:bg-[var(--jogak-source-bg)] jogak:text-[#94a3b8] jogak:text-[13px]",
|
|
763
|
+
style: { "--jogak-source-bg": g },
|
|
1026
764
|
children: "Source not available"
|
|
1027
765
|
}
|
|
1028
|
-
) : /* @__PURE__ */
|
|
1029
|
-
/* @__PURE__ */
|
|
766
|
+
) : /* @__PURE__ */ j("div", { className: "jogak:relative jogak:h-full", children: [
|
|
767
|
+
/* @__PURE__ */ e(
|
|
1030
768
|
"button",
|
|
1031
769
|
{
|
|
1032
770
|
type: "button",
|
|
1033
771
|
onClick: () => {
|
|
1034
|
-
navigator.clipboard.writeText(
|
|
1035
|
-
|
|
1036
|
-
|
|
772
|
+
navigator.clipboard.writeText(o).then(() => {
|
|
773
|
+
t(!0), setTimeout(() => {
|
|
774
|
+
t(!1);
|
|
1037
775
|
}, 2e3);
|
|
1038
776
|
});
|
|
1039
777
|
},
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
top: 10,
|
|
1043
|
-
right: 12,
|
|
1044
|
-
zIndex: 1,
|
|
1045
|
-
padding: "3px 9px",
|
|
1046
|
-
fontSize: 11,
|
|
1047
|
-
background: "rgba(255,255,255,0.1)",
|
|
1048
|
-
color: "#e2e8f0",
|
|
1049
|
-
border: "1px solid rgba(255,255,255,0.18)",
|
|
1050
|
-
borderRadius: 4,
|
|
1051
|
-
cursor: "pointer"
|
|
1052
|
-
},
|
|
1053
|
-
children: o ? "✓ Copied" : "Copy"
|
|
778
|
+
className: "jogak:absolute jogak:top-[10px] jogak:right-3 jogak:z-[1] jogak:px-[9px] jogak:py-[3px] jogak:text-[11px] jogak:bg-[rgba(255,255,255,0.1)] jogak:text-[#e2e8f0] jogak:border jogak:border-[rgba(255,255,255,0.18)] jogak:rounded-[var(--jogak-radius-md)] jogak:cursor-pointer jogak:leading-none",
|
|
779
|
+
children: r ? "✓ Copied" : "Copy"
|
|
1054
780
|
}
|
|
1055
781
|
),
|
|
1056
|
-
/* @__PURE__ */
|
|
782
|
+
/* @__PURE__ */ e(Z, { code: o.trim(), language: "tsx", theme: a, children: ({ style: k, tokens: s, getLineProps: l, getTokenProps: b }) => /* @__PURE__ */ e(
|
|
1057
783
|
"pre",
|
|
1058
784
|
{
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
padding: "12px 0",
|
|
1063
|
-
fontSize: 12.5,
|
|
1064
|
-
lineHeight: 1.7,
|
|
1065
|
-
fontFamily: "ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace",
|
|
1066
|
-
height: "100%",
|
|
1067
|
-
boxSizing: "border-box",
|
|
1068
|
-
overflow: "auto"
|
|
1069
|
-
},
|
|
1070
|
-
children: l.map((p, h) => /* @__PURE__ */ c(
|
|
785
|
+
className: "jogak:m-0 jogak:py-3 jogak:px-0 jogak:text-[12.5px] jogak:leading-[1.7] jogak:font-[family-name:var(--jogak-font-mono)] jogak:h-full jogak:box-border jogak:overflow-auto",
|
|
786
|
+
style: k,
|
|
787
|
+
children: s.map((i, u) => /* @__PURE__ */ j(
|
|
1071
788
|
"div",
|
|
1072
789
|
{
|
|
1073
|
-
...
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
display: "flex",
|
|
1077
|
-
paddingRight: 24
|
|
1078
|
-
},
|
|
790
|
+
...l({ line: i }),
|
|
791
|
+
className: "jogak:flex jogak:pr-6",
|
|
792
|
+
style: l({ line: i }).style,
|
|
1079
793
|
children: [
|
|
1080
|
-
/* @__PURE__ */
|
|
1081
|
-
|
|
1082
|
-
{
|
|
1083
|
-
style: {
|
|
1084
|
-
userSelect: "none",
|
|
1085
|
-
minWidth: 40,
|
|
1086
|
-
paddingLeft: 14,
|
|
1087
|
-
paddingRight: 14,
|
|
1088
|
-
textAlign: "right",
|
|
1089
|
-
color: "rgba(148,163,184,0.45)",
|
|
1090
|
-
flexShrink: 0
|
|
1091
|
-
},
|
|
1092
|
-
children: h + 1
|
|
1093
|
-
}
|
|
1094
|
-
),
|
|
1095
|
-
/* @__PURE__ */ n("span", { children: p.map((S, b) => /* @__PURE__ */ n("span", { ...m({ token: S }) }, b)) })
|
|
794
|
+
/* @__PURE__ */ e("span", { className: "jogak:select-none jogak:min-w-10 jogak:pl-[14px] jogak:pr-[14px] jogak:text-right jogak:text-[rgba(148,163,184,0.45)] jogak:shrink-0 jogak:leading-[1.7]", children: u + 1 }),
|
|
795
|
+
/* @__PURE__ */ e("span", { children: i.map((v, m) => /* @__PURE__ */ e("span", { ...b({ token: v }) }, m)) })
|
|
1096
796
|
]
|
|
1097
797
|
},
|
|
1098
|
-
|
|
798
|
+
u
|
|
1099
799
|
))
|
|
1100
800
|
}
|
|
1101
801
|
) })
|
|
1102
802
|
] });
|
|
1103
803
|
}
|
|
1104
|
-
function
|
|
804
|
+
function M() {
|
|
1105
805
|
if (typeof window > "u") return null;
|
|
1106
|
-
const
|
|
1107
|
-
if (
|
|
1108
|
-
const
|
|
1109
|
-
return { entryId:
|
|
806
|
+
const o = new URLSearchParams(window.location.search), a = o.get("entry");
|
|
807
|
+
if (a === null) return null;
|
|
808
|
+
const r = o.get("jogak");
|
|
809
|
+
return { entryId: a, jogakName: r };
|
|
1110
810
|
}
|
|
1111
|
-
function
|
|
1112
|
-
const
|
|
1113
|
-
|
|
811
|
+
function uo(o, a) {
|
|
812
|
+
const r = new URLSearchParams();
|
|
813
|
+
r.set("entry", o), r.set("jogak", a), window.history.pushState({}, "", `?${r.toString()}`);
|
|
1114
814
|
}
|
|
1115
|
-
function
|
|
1116
|
-
entries:
|
|
1117
|
-
metas:
|
|
1118
|
-
codeTheme:
|
|
815
|
+
function vo({
|
|
816
|
+
entries: o,
|
|
817
|
+
metas: a,
|
|
818
|
+
codeTheme: r = "vsDark"
|
|
1119
819
|
} = {}) {
|
|
1120
|
-
const
|
|
1121
|
-
if (
|
|
1122
|
-
|
|
820
|
+
const t = y(() => {
|
|
821
|
+
if (o !== void 0) {
|
|
822
|
+
a !== void 0 && console.warn(
|
|
1123
823
|
"[jogak] JogakApp received both `entries` and `metas` — `entries` (eager) takes precedence."
|
|
1124
824
|
);
|
|
1125
|
-
const
|
|
1126
|
-
for (const
|
|
1127
|
-
return
|
|
825
|
+
const c = new I();
|
|
826
|
+
for (const d of o) c.register(d);
|
|
827
|
+
return c;
|
|
1128
828
|
}
|
|
1129
|
-
if (
|
|
1130
|
-
for (const
|
|
1131
|
-
return
|
|
1132
|
-
}, [
|
|
1133
|
-
(
|
|
1134
|
-
), [
|
|
1135
|
-
(
|
|
1136
|
-
), [
|
|
1137
|
-
|
|
1138
|
-
const
|
|
1139
|
-
const
|
|
1140
|
-
|
|
829
|
+
if (a !== void 0)
|
|
830
|
+
for (const c of a) V.registerMeta(c);
|
|
831
|
+
return V;
|
|
832
|
+
}, [o, a]), g = y(() => M(), []), [n, k] = f(
|
|
833
|
+
(g == null ? void 0 : g.entryId) ?? null
|
|
834
|
+
), [s, l] = f(
|
|
835
|
+
(g == null ? void 0 : g.jogakName) ?? null
|
|
836
|
+
), [b, i] = f({});
|
|
837
|
+
w(() => {
|
|
838
|
+
const c = () => {
|
|
839
|
+
const d = M();
|
|
840
|
+
d !== null ? (k(d.entryId), l(d.jogakName), i({})) : (k(null), l(null));
|
|
1141
841
|
};
|
|
1142
|
-
return window.addEventListener("popstate",
|
|
1143
|
-
window.removeEventListener("popstate",
|
|
842
|
+
return window.addEventListener("popstate", c), () => {
|
|
843
|
+
window.removeEventListener("popstate", c);
|
|
1144
844
|
};
|
|
1145
845
|
}, []);
|
|
1146
|
-
const
|
|
1147
|
-
|
|
1148
|
-
}, []),
|
|
1149
|
-
if (
|
|
1150
|
-
const
|
|
1151
|
-
|
|
846
|
+
const u = C((c, d) => {
|
|
847
|
+
k(c), l(d), i({}), uo(c, d);
|
|
848
|
+
}, []), v = C((c, d) => {
|
|
849
|
+
if (k((p) => p === c ? c : p), l((p) => p ?? d), typeof window < "u") {
|
|
850
|
+
const p = new URLSearchParams(window.location.search);
|
|
851
|
+
p.get("entry") === c && p.get("jogak") === null && (p.set("jogak", d), window.history.replaceState({}, "", `?${p.toString()}`));
|
|
1152
852
|
}
|
|
1153
|
-
}, []),
|
|
1154
|
-
|
|
1155
|
-
}, []),
|
|
1156
|
-
|
|
853
|
+
}, []), m = C((c, d) => {
|
|
854
|
+
i((p) => ({ ...p, [c]: d }));
|
|
855
|
+
}, []), x = C(() => {
|
|
856
|
+
i({});
|
|
1157
857
|
}, []);
|
|
1158
|
-
return /* @__PURE__ */
|
|
858
|
+
return /* @__PURE__ */ e(X, { registry: t, children: /* @__PURE__ */ j(
|
|
1159
859
|
"div",
|
|
1160
860
|
{
|
|
1161
861
|
"data-jogak-shell": !0,
|
|
1162
|
-
|
|
1163
|
-
display: "grid",
|
|
1164
|
-
gridTemplateColumns: "260px 1fr",
|
|
1165
|
-
height: "100dvh",
|
|
1166
|
-
overflow: "hidden"
|
|
1167
|
-
},
|
|
862
|
+
className: "jogak:grid jogak:grid-cols-[260px_1fr] jogak:h-dvh jogak:overflow-hidden",
|
|
1168
863
|
children: [
|
|
1169
|
-
/* @__PURE__ */
|
|
1170
|
-
|
|
864
|
+
/* @__PURE__ */ e(
|
|
865
|
+
K,
|
|
1171
866
|
{
|
|
1172
|
-
selectedEntryId:
|
|
1173
|
-
selectedJogakName:
|
|
1174
|
-
onSelect:
|
|
867
|
+
selectedEntryId: n,
|
|
868
|
+
selectedJogakName: s,
|
|
869
|
+
onSelect: u
|
|
1175
870
|
}
|
|
1176
871
|
),
|
|
1177
|
-
/* @__PURE__ */
|
|
1178
|
-
|
|
872
|
+
/* @__PURE__ */ e("main", { className: "jogak:overflow-hidden jogak:min-h-0", children: n !== null ? /* @__PURE__ */ e(
|
|
873
|
+
lo,
|
|
1179
874
|
{
|
|
1180
|
-
entryId:
|
|
1181
|
-
jogakName:
|
|
1182
|
-
overrideArgs:
|
|
1183
|
-
onArgChange:
|
|
1184
|
-
onReset:
|
|
1185
|
-
codeTheme:
|
|
1186
|
-
onResolveJogak:
|
|
875
|
+
entryId: n,
|
|
876
|
+
jogakName: s,
|
|
877
|
+
overrideArgs: b,
|
|
878
|
+
onArgChange: m,
|
|
879
|
+
onReset: x,
|
|
880
|
+
codeTheme: r,
|
|
881
|
+
onResolveJogak: v
|
|
1187
882
|
}
|
|
1188
|
-
) : /* @__PURE__ */
|
|
1189
|
-
"div",
|
|
1190
|
-
{
|
|
1191
|
-
style: {
|
|
1192
|
-
display: "flex",
|
|
1193
|
-
alignItems: "center",
|
|
1194
|
-
justifyContent: "center",
|
|
1195
|
-
height: "100%",
|
|
1196
|
-
color: "#9ca3af"
|
|
1197
|
-
},
|
|
1198
|
-
children: "Select a component from the sidebar"
|
|
1199
|
-
}
|
|
1200
|
-
) })
|
|
883
|
+
) : /* @__PURE__ */ e("div", { className: "jogak:flex jogak:items-center jogak:justify-center jogak:h-full jogak:text-[var(--jogak-color-fg-subtle)]", children: "Select a component from the sidebar" }) })
|
|
1201
884
|
]
|
|
1202
885
|
}
|
|
1203
886
|
) });
|
|
1204
887
|
}
|
|
1205
|
-
function
|
|
1206
|
-
const
|
|
1207
|
-
() => (
|
|
1208
|
-
[
|
|
888
|
+
function No() {
|
|
889
|
+
const o = Y(), a = y(() => o.getAll(), [o]), r = y(() => o.getTree(), [o]), t = y(
|
|
890
|
+
() => (g) => o.search(g),
|
|
891
|
+
[o]
|
|
1209
892
|
);
|
|
1210
|
-
return { entries:
|
|
893
|
+
return { entries: a, tree: r, search: t };
|
|
1211
894
|
}
|
|
1212
895
|
export {
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
896
|
+
go as Actions,
|
|
897
|
+
ro as Controls,
|
|
898
|
+
vo as JogakApp,
|
|
899
|
+
lo as Preview,
|
|
900
|
+
K as Sidebar,
|
|
901
|
+
No as useRegistry
|
|
1219
902
|
};
|