@web-mods/articles 1.1.2 → 1.1.4
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 +22 -0
- package/dist/components/ArticleNavigationSettings.d.ts +9 -0
- package/dist/components/ValidationIssues.d.ts +5 -0
- package/dist/components/ui/Tooltip.d.ts +3 -1
- package/dist/index.cjs +67 -31
- package/dist/index.d.ts +3 -2
- package/dist/index.js +1712 -1177
- package/dist/server.cjs +3 -3
- package/dist/server.d.ts +3 -2
- package/dist/server.js +80 -42
- package/dist/service.d.ts +9 -1
- package/dist/style.css +1 -1
- package/dist/types.d.ts +25 -0
- package/package.json +11 -10
package/dist/index.js
CHANGED
|
@@ -1,109 +1,109 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import { defaultArticleService as
|
|
4
|
-
import { createArticleService as
|
|
5
|
-
import { useNavigate as
|
|
6
|
-
import { createPortal as
|
|
7
|
-
const
|
|
1
|
+
import { jsx as n, jsxs as s, Fragment as ue } from "react/jsx-runtime";
|
|
2
|
+
import ce, { createContext as Ae, useContext as He, useState as _, useEffect as K, forwardRef as nt, createElement as Le, useRef as Y, useId as Ie, useCallback as xe, memo as We, useLayoutEffect as Mt } from "react";
|
|
3
|
+
import { defaultArticleService as Ct } from "./server.js";
|
|
4
|
+
import { ArticleServiceError as ea, createArticleService as ta, renderArticleByPathname as ra } from "./server.js";
|
|
5
|
+
import { useNavigate as St, useParams as jt, useLocation as Ot, useMatch as qe } from "react-router";
|
|
6
|
+
import { createPortal as at } from "react-dom";
|
|
7
|
+
const Re = Ae({
|
|
8
8
|
navigate: () => {
|
|
9
9
|
},
|
|
10
10
|
params: {},
|
|
11
11
|
locationState: null
|
|
12
12
|
});
|
|
13
|
-
function
|
|
14
|
-
return
|
|
13
|
+
function Ve() {
|
|
14
|
+
return He(Re);
|
|
15
15
|
}
|
|
16
|
-
let
|
|
17
|
-
const
|
|
18
|
-
function
|
|
19
|
-
|
|
16
|
+
let se = [];
|
|
17
|
+
const Te = /* @__PURE__ */ new Set();
|
|
18
|
+
function Be() {
|
|
19
|
+
Te.forEach((e) => e([...se]));
|
|
20
20
|
}
|
|
21
|
-
function
|
|
21
|
+
function $e(e, t) {
|
|
22
22
|
const r = Math.random().toString(36).slice(2);
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
se = [...se, { id: r, type: e, content: t }], Be(), setTimeout(() => {
|
|
24
|
+
se = se.filter((a) => a.id !== r), Be();
|
|
25
25
|
}, 3e3);
|
|
26
26
|
}
|
|
27
|
-
const
|
|
28
|
-
success: (e) =>
|
|
29
|
-
error: (e) =>
|
|
30
|
-
warning: (e) =>
|
|
27
|
+
const J = {
|
|
28
|
+
success: (e) => $e("success", e),
|
|
29
|
+
error: (e) => $e("error", e),
|
|
30
|
+
warning: (e) => $e("warning", e)
|
|
31
31
|
};
|
|
32
|
-
function
|
|
33
|
-
return
|
|
34
|
-
|
|
32
|
+
function Pt(e) {
|
|
33
|
+
return Te.add(e), () => {
|
|
34
|
+
Te.delete(e);
|
|
35
35
|
};
|
|
36
36
|
}
|
|
37
|
-
function
|
|
38
|
-
return
|
|
37
|
+
function Et() {
|
|
38
|
+
return se;
|
|
39
39
|
}
|
|
40
|
-
const
|
|
40
|
+
const Lt = {
|
|
41
41
|
success: "bg-emerald-500",
|
|
42
42
|
error: "bg-red-500",
|
|
43
43
|
warning: "bg-amber-500"
|
|
44
|
-
},
|
|
44
|
+
}, Tt = {
|
|
45
45
|
success: "✓",
|
|
46
46
|
error: "✕",
|
|
47
47
|
warning: "⚠"
|
|
48
48
|
};
|
|
49
|
-
function
|
|
50
|
-
const [e, t] =
|
|
51
|
-
return K(() =>
|
|
49
|
+
function _t() {
|
|
50
|
+
const [e, t] = _(Et());
|
|
51
|
+
return K(() => Pt(t), []), e.length === 0 ? null : /* @__PURE__ */ n("div", { className: "fixed top-4 right-4 z-[9999] flex flex-col gap-2 pointer-events-none", children: e.map((r) => /* @__PURE__ */ s(
|
|
52
52
|
"div",
|
|
53
53
|
{
|
|
54
|
-
className: `flex items-center gap-2 px-4 py-2.5 rounded-lg shadow-lg text-sm text-white font-medium pointer-events-auto ${
|
|
54
|
+
className: `flex items-center gap-2 px-4 py-2.5 rounded-lg shadow-lg text-sm text-white font-medium pointer-events-auto ${Lt[r.type]}`,
|
|
55
55
|
children: [
|
|
56
|
-
/* @__PURE__ */
|
|
56
|
+
/* @__PURE__ */ n("span", { className: "shrink-0 font-bold", children: Tt[r.type] }),
|
|
57
57
|
r.content
|
|
58
58
|
]
|
|
59
59
|
},
|
|
60
60
|
r.id
|
|
61
61
|
)) });
|
|
62
62
|
}
|
|
63
|
-
const
|
|
64
|
-
function
|
|
63
|
+
const it = Ae(null);
|
|
64
|
+
function Un({
|
|
65
65
|
children: e,
|
|
66
66
|
basePath: t,
|
|
67
|
-
service: r =
|
|
68
|
-
previewBaseUrl:
|
|
69
|
-
previewTailwind:
|
|
70
|
-
navigate:
|
|
67
|
+
service: r = Ct,
|
|
68
|
+
previewBaseUrl: a,
|
|
69
|
+
previewTailwind: o,
|
|
70
|
+
navigate: l
|
|
71
71
|
}) {
|
|
72
|
-
const
|
|
73
|
-
|
|
72
|
+
const f = /* @__PURE__ */ s(
|
|
73
|
+
it.Provider,
|
|
74
74
|
{
|
|
75
|
-
value: { basePath: t, service: r, previewBaseUrl:
|
|
75
|
+
value: { basePath: t, service: r, previewBaseUrl: a, previewTailwind: o },
|
|
76
76
|
children: [
|
|
77
77
|
e,
|
|
78
|
-
/* @__PURE__ */
|
|
78
|
+
/* @__PURE__ */ n(_t, {})
|
|
79
79
|
]
|
|
80
80
|
}
|
|
81
81
|
);
|
|
82
|
-
return
|
|
83
|
-
|
|
82
|
+
return l ? /* @__PURE__ */ n(
|
|
83
|
+
Re.Provider,
|
|
84
84
|
{
|
|
85
|
-
value: { navigate:
|
|
86
|
-
children:
|
|
85
|
+
value: { navigate: l, params: {}, locationState: null },
|
|
86
|
+
children: f
|
|
87
87
|
}
|
|
88
|
-
) :
|
|
88
|
+
) : f;
|
|
89
89
|
}
|
|
90
|
-
function
|
|
91
|
-
const e =
|
|
90
|
+
function ve() {
|
|
91
|
+
const e = He(it);
|
|
92
92
|
if (!e)
|
|
93
93
|
throw new Error(
|
|
94
94
|
"useArticlesConfig must be used within ArticlesProvider"
|
|
95
95
|
);
|
|
96
96
|
return e;
|
|
97
97
|
}
|
|
98
|
-
function
|
|
99
|
-
const t =
|
|
100
|
-
return /* @__PURE__ */
|
|
101
|
-
|
|
98
|
+
function Gn({ children: e }) {
|
|
99
|
+
const t = St(), r = jt(), a = Ot(), { basePath: o } = ve(), l = o.replace(/\/+$/, ""), f = qe(`${l}/:id/edit`), g = qe(`${l}/:id/detail`), y = f ?? g;
|
|
100
|
+
return /* @__PURE__ */ n(
|
|
101
|
+
Re.Provider,
|
|
102
102
|
{
|
|
103
103
|
value: {
|
|
104
|
-
navigate: (
|
|
105
|
-
params: r,
|
|
106
|
-
locationState:
|
|
104
|
+
navigate: (k, p) => t(k, p),
|
|
105
|
+
params: { ...r, ...y == null ? void 0 : y.params },
|
|
106
|
+
locationState: a.state
|
|
107
107
|
},
|
|
108
108
|
children: e
|
|
109
109
|
}
|
|
@@ -115,23 +115,23 @@ function vn({ children: e }) {
|
|
|
115
115
|
* This source code is licensed under the ISC license.
|
|
116
116
|
* See the LICENSE file in the root directory of this source tree.
|
|
117
117
|
*/
|
|
118
|
-
const
|
|
118
|
+
const st = (...e) => e.filter((t, r, a) => !!t && t.trim() !== "" && a.indexOf(t) === r).join(" ").trim();
|
|
119
119
|
/**
|
|
120
120
|
* @license lucide-react v1.11.0 - ISC
|
|
121
121
|
*
|
|
122
122
|
* This source code is licensed under the ISC license.
|
|
123
123
|
* See the LICENSE file in the root directory of this source tree.
|
|
124
124
|
*/
|
|
125
|
-
const
|
|
125
|
+
const Dt = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
|
|
126
126
|
/**
|
|
127
127
|
* @license lucide-react v1.11.0 - ISC
|
|
128
128
|
*
|
|
129
129
|
* This source code is licensed under the ISC license.
|
|
130
130
|
* See the LICENSE file in the root directory of this source tree.
|
|
131
131
|
*/
|
|
132
|
-
const
|
|
132
|
+
const zt = (e) => e.replace(
|
|
133
133
|
/^([A-Z])|[\s-_]+(\w)/g,
|
|
134
|
-
(t, r,
|
|
134
|
+
(t, r, a) => a ? a.toUpperCase() : r.toLowerCase()
|
|
135
135
|
);
|
|
136
136
|
/**
|
|
137
137
|
* @license lucide-react v1.11.0 - ISC
|
|
@@ -139,8 +139,8 @@ const kt = (e) => e.replace(
|
|
|
139
139
|
* This source code is licensed under the ISC license.
|
|
140
140
|
* See the LICENSE file in the root directory of this source tree.
|
|
141
141
|
*/
|
|
142
|
-
const
|
|
143
|
-
const t =
|
|
142
|
+
const Fe = (e) => {
|
|
143
|
+
const t = zt(e);
|
|
144
144
|
return t.charAt(0).toUpperCase() + t.slice(1);
|
|
145
145
|
};
|
|
146
146
|
/**
|
|
@@ -149,7 +149,7 @@ const Ie = (e) => {
|
|
|
149
149
|
* This source code is licensed under the ISC license.
|
|
150
150
|
* See the LICENSE file in the root directory of this source tree.
|
|
151
151
|
*/
|
|
152
|
-
var
|
|
152
|
+
var Me = {
|
|
153
153
|
xmlns: "http://www.w3.org/2000/svg",
|
|
154
154
|
width: 24,
|
|
155
155
|
height: 24,
|
|
@@ -166,36 +166,36 @@ var ve = {
|
|
|
166
166
|
* This source code is licensed under the ISC license.
|
|
167
167
|
* See the LICENSE file in the root directory of this source tree.
|
|
168
168
|
*/
|
|
169
|
-
const
|
|
169
|
+
const At = (e) => {
|
|
170
170
|
for (const t in e)
|
|
171
171
|
if (t.startsWith("aria-") || t === "role" || t === "title")
|
|
172
172
|
return !0;
|
|
173
173
|
return !1;
|
|
174
|
-
},
|
|
175
|
-
({ color: e, size: t, strokeWidth: r, absoluteStrokeWidth:
|
|
174
|
+
}, Ht = Ae({}), It = () => He(Ht), Wt = nt(
|
|
175
|
+
({ color: e, size: t, strokeWidth: r, absoluteStrokeWidth: a, className: o = "", children: l, iconNode: f, ...g }, y) => {
|
|
176
176
|
const {
|
|
177
|
-
size:
|
|
178
|
-
strokeWidth:
|
|
179
|
-
absoluteStrokeWidth:
|
|
180
|
-
color:
|
|
181
|
-
className:
|
|
182
|
-
} =
|
|
183
|
-
return
|
|
177
|
+
size: k = 24,
|
|
178
|
+
strokeWidth: p = 2,
|
|
179
|
+
absoluteStrokeWidth: v = !1,
|
|
180
|
+
color: P = "currentColor",
|
|
181
|
+
className: A = ""
|
|
182
|
+
} = It() ?? {}, H = a ?? v ? Number(r ?? p) * 24 / Number(t ?? k) : r ?? p;
|
|
183
|
+
return Le(
|
|
184
184
|
"svg",
|
|
185
185
|
{
|
|
186
|
-
ref:
|
|
187
|
-
...
|
|
188
|
-
width: t ??
|
|
189
|
-
height: t ??
|
|
190
|
-
stroke: e ??
|
|
191
|
-
strokeWidth:
|
|
192
|
-
className:
|
|
193
|
-
...!
|
|
194
|
-
|
|
186
|
+
ref: y,
|
|
187
|
+
...Me,
|
|
188
|
+
width: t ?? k ?? Me.width,
|
|
189
|
+
height: t ?? k ?? Me.height,
|
|
190
|
+
stroke: e ?? P,
|
|
191
|
+
strokeWidth: H,
|
|
192
|
+
className: st("lucide", A, o),
|
|
193
|
+
...!l && !At(g) && { "aria-hidden": "true" },
|
|
194
|
+
...g
|
|
195
195
|
},
|
|
196
196
|
[
|
|
197
|
-
...
|
|
198
|
-
...Array.isArray(
|
|
197
|
+
...f.map(([T, W]) => Le(T, W)),
|
|
198
|
+
...Array.isArray(l) ? l : [l]
|
|
199
199
|
]
|
|
200
200
|
);
|
|
201
201
|
}
|
|
@@ -206,20 +206,20 @@ const $t = (e) => {
|
|
|
206
206
|
* This source code is licensed under the ISC license.
|
|
207
207
|
* See the LICENSE file in the root directory of this source tree.
|
|
208
208
|
*/
|
|
209
|
-
const
|
|
210
|
-
const r =
|
|
211
|
-
({ className:
|
|
212
|
-
ref:
|
|
209
|
+
const B = (e, t) => {
|
|
210
|
+
const r = nt(
|
|
211
|
+
({ className: a, ...o }, l) => Le(Wt, {
|
|
212
|
+
ref: l,
|
|
213
213
|
iconNode: t,
|
|
214
|
-
className:
|
|
215
|
-
`lucide-${
|
|
214
|
+
className: st(
|
|
215
|
+
`lucide-${Dt(Fe(e))}`,
|
|
216
216
|
`lucide-${e}`,
|
|
217
|
-
|
|
217
|
+
a
|
|
218
218
|
),
|
|
219
|
-
...
|
|
219
|
+
...o
|
|
220
220
|
})
|
|
221
221
|
);
|
|
222
|
-
return r.displayName =
|
|
222
|
+
return r.displayName = Fe(e), r;
|
|
223
223
|
};
|
|
224
224
|
/**
|
|
225
225
|
* @license lucide-react v1.11.0 - ISC
|
|
@@ -227,48 +227,80 @@ const U = (e, t) => {
|
|
|
227
227
|
* This source code is licensed under the ISC license.
|
|
228
228
|
* See the LICENSE file in the root directory of this source tree.
|
|
229
229
|
*/
|
|
230
|
-
const
|
|
230
|
+
const Rt = [
|
|
231
231
|
["path", { d: "m12 19-7-7 7-7", key: "1l729n" }],
|
|
232
232
|
["path", { d: "M19 12H5", key: "x3x0zl" }]
|
|
233
|
-
],
|
|
233
|
+
], ot = B("arrow-left", Rt);
|
|
234
234
|
/**
|
|
235
235
|
* @license lucide-react v1.11.0 - ISC
|
|
236
236
|
*
|
|
237
237
|
* This source code is licensed under the ISC license.
|
|
238
238
|
* See the LICENSE file in the root directory of this source tree.
|
|
239
239
|
*/
|
|
240
|
-
const
|
|
240
|
+
const Vt = [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]], Yt = B("check", Vt);
|
|
241
|
+
/**
|
|
242
|
+
* @license lucide-react v1.11.0 - ISC
|
|
243
|
+
*
|
|
244
|
+
* This source code is licensed under the ISC license.
|
|
245
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
246
|
+
*/
|
|
247
|
+
const qt = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]], Bt = B("chevron-down", qt);
|
|
248
|
+
/**
|
|
249
|
+
* @license lucide-react v1.11.0 - ISC
|
|
250
|
+
*
|
|
251
|
+
* This source code is licensed under the ISC license.
|
|
252
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
253
|
+
*/
|
|
254
|
+
const Ft = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]], Ue = B("chevron-right", Ft);
|
|
255
|
+
/**
|
|
256
|
+
* @license lucide-react v1.11.0 - ISC
|
|
257
|
+
*
|
|
258
|
+
* This source code is licensed under the ISC license.
|
|
259
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
260
|
+
*/
|
|
261
|
+
const Ut = [
|
|
262
|
+
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
|
|
263
|
+
["line", { x1: "12", x2: "12", y1: "8", y2: "12", key: "1pkeuh" }],
|
|
264
|
+
["line", { x1: "12", x2: "12.01", y1: "16", y2: "16", key: "4dfq90" }]
|
|
265
|
+
], Gt = B("circle-alert", Ut);
|
|
266
|
+
/**
|
|
267
|
+
* @license lucide-react v1.11.0 - ISC
|
|
268
|
+
*
|
|
269
|
+
* This source code is licensed under the ISC license.
|
|
270
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
271
|
+
*/
|
|
272
|
+
const Zt = [
|
|
241
273
|
["path", { d: "m16 18 6-6-6-6", key: "eg8j8" }],
|
|
242
274
|
["path", { d: "m8 6-6 6 6 6", key: "ppft3o" }]
|
|
243
|
-
],
|
|
275
|
+
], Ye = B("code", Zt);
|
|
244
276
|
/**
|
|
245
277
|
* @license lucide-react v1.11.0 - ISC
|
|
246
278
|
*
|
|
247
279
|
* This source code is licensed under the ISC license.
|
|
248
280
|
* See the LICENSE file in the root directory of this source tree.
|
|
249
281
|
*/
|
|
250
|
-
const
|
|
282
|
+
const Kt = [
|
|
251
283
|
["rect", { width: "14", height: "14", x: "8", y: "8", rx: "2", ry: "2", key: "17jyea" }],
|
|
252
284
|
["path", { d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2", key: "zix9uf" }]
|
|
253
|
-
],
|
|
285
|
+
], Jt = B("copy", Kt);
|
|
254
286
|
/**
|
|
255
287
|
* @license lucide-react v1.11.0 - ISC
|
|
256
288
|
*
|
|
257
289
|
* This source code is licensed under the ISC license.
|
|
258
290
|
* See the LICENSE file in the root directory of this source tree.
|
|
259
291
|
*/
|
|
260
|
-
const
|
|
292
|
+
const Qt = [
|
|
261
293
|
["path", { d: "M15 3h6v6", key: "1q9fwt" }],
|
|
262
294
|
["path", { d: "M10 14 21 3", key: "gplh6r" }],
|
|
263
295
|
["path", { d: "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6", key: "a6xqqp" }]
|
|
264
|
-
],
|
|
296
|
+
], Xt = B("external-link", Qt);
|
|
265
297
|
/**
|
|
266
298
|
* @license lucide-react v1.11.0 - ISC
|
|
267
299
|
*
|
|
268
300
|
* This source code is licensed under the ISC license.
|
|
269
301
|
* See the LICENSE file in the root directory of this source tree.
|
|
270
302
|
*/
|
|
271
|
-
const
|
|
303
|
+
const er = [
|
|
272
304
|
[
|
|
273
305
|
"path",
|
|
274
306
|
{
|
|
@@ -277,14 +309,14 @@ const Tt = [
|
|
|
277
309
|
}
|
|
278
310
|
],
|
|
279
311
|
["circle", { cx: "12", cy: "12", r: "3", key: "1v7zrd" }]
|
|
280
|
-
],
|
|
312
|
+
], _e = B("eye", er);
|
|
281
313
|
/**
|
|
282
314
|
* @license lucide-react v1.11.0 - ISC
|
|
283
315
|
*
|
|
284
316
|
* This source code is licensed under the ISC license.
|
|
285
317
|
* See the LICENSE file in the root directory of this source tree.
|
|
286
318
|
*/
|
|
287
|
-
const
|
|
319
|
+
const tr = [
|
|
288
320
|
[
|
|
289
321
|
"path",
|
|
290
322
|
{
|
|
@@ -296,14 +328,14 @@ const At = [
|
|
|
296
328
|
["path", { d: "M10 9H8", key: "b1mrlr" }],
|
|
297
329
|
["path", { d: "M16 13H8", key: "t4e002" }],
|
|
298
330
|
["path", { d: "M16 17H8", key: "z1uh3a" }]
|
|
299
|
-
],
|
|
331
|
+
], rr = B("file-text", tr);
|
|
300
332
|
/**
|
|
301
333
|
* @license lucide-react v1.11.0 - ISC
|
|
302
334
|
*
|
|
303
335
|
* This source code is licensed under the ISC license.
|
|
304
336
|
* See the LICENSE file in the root directory of this source tree.
|
|
305
337
|
*/
|
|
306
|
-
const
|
|
338
|
+
const nr = [
|
|
307
339
|
["polyline", { points: "22 12 16 12 14 15 10 15 8 12 2 12", key: "o97t9d" }],
|
|
308
340
|
[
|
|
309
341
|
"path",
|
|
@@ -312,42 +344,63 @@ const zt = [
|
|
|
312
344
|
key: "oot6mr"
|
|
313
345
|
}
|
|
314
346
|
]
|
|
315
|
-
],
|
|
347
|
+
], ar = B("inbox", nr);
|
|
316
348
|
/**
|
|
317
349
|
* @license lucide-react v1.11.0 - ISC
|
|
318
350
|
*
|
|
319
351
|
* This source code is licensed under the ISC license.
|
|
320
352
|
* See the LICENSE file in the root directory of this source tree.
|
|
321
353
|
*/
|
|
322
|
-
const
|
|
354
|
+
const ir = [
|
|
355
|
+
["rect", { width: "18", height: "7", x: "3", y: "3", rx: "1", key: "f1a2em" }],
|
|
356
|
+
["rect", { width: "7", height: "7", x: "3", y: "14", rx: "1", key: "1bb6yr" }],
|
|
357
|
+
["rect", { width: "7", height: "7", x: "14", y: "14", rx: "1", key: "nxv5o0" }]
|
|
358
|
+
], ct = B("layout-panel-top", ir);
|
|
359
|
+
/**
|
|
360
|
+
* @license lucide-react v1.11.0 - ISC
|
|
361
|
+
*
|
|
362
|
+
* This source code is licensed under the ISC license.
|
|
363
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
364
|
+
*/
|
|
365
|
+
const sr = [
|
|
323
366
|
["path", { d: "M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71", key: "1cjeqo" }],
|
|
324
367
|
["path", { d: "M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71", key: "19qd67" }]
|
|
325
|
-
],
|
|
368
|
+
], or = B("link", sr);
|
|
326
369
|
/**
|
|
327
370
|
* @license lucide-react v1.11.0 - ISC
|
|
328
371
|
*
|
|
329
372
|
* This source code is licensed under the ISC license.
|
|
330
373
|
* See the LICENSE file in the root directory of this source tree.
|
|
331
374
|
*/
|
|
332
|
-
const
|
|
375
|
+
const cr = [["path", { d: "M21 12a9 9 0 1 1-6.219-8.56", key: "13zald" }]], lt = B("loader-circle", cr);
|
|
333
376
|
/**
|
|
334
377
|
* @license lucide-react v1.11.0 - ISC
|
|
335
378
|
*
|
|
336
379
|
* This source code is licensed under the ISC license.
|
|
337
380
|
* See the LICENSE file in the root directory of this source tree.
|
|
338
381
|
*/
|
|
339
|
-
const
|
|
382
|
+
const lr = [
|
|
340
383
|
["rect", { width: "20", height: "14", x: "2", y: "3", rx: "2", key: "48i651" }],
|
|
341
384
|
["line", { x1: "8", x2: "16", y1: "21", y2: "21", key: "1svkeh" }],
|
|
342
385
|
["line", { x1: "12", x2: "12", y1: "17", y2: "21", key: "vw1qmm" }]
|
|
343
|
-
],
|
|
386
|
+
], dt = B("monitor", lr);
|
|
344
387
|
/**
|
|
345
388
|
* @license lucide-react v1.11.0 - ISC
|
|
346
389
|
*
|
|
347
390
|
* This source code is licensed under the ISC license.
|
|
348
391
|
* See the LICENSE file in the root directory of this source tree.
|
|
349
392
|
*/
|
|
350
|
-
const
|
|
393
|
+
const dr = [
|
|
394
|
+
["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
|
|
395
|
+
["path", { d: "M3 15h18", key: "5xshup" }]
|
|
396
|
+
], ut = B("panel-bottom", dr);
|
|
397
|
+
/**
|
|
398
|
+
* @license lucide-react v1.11.0 - ISC
|
|
399
|
+
*
|
|
400
|
+
* This source code is licensed under the ISC license.
|
|
401
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
402
|
+
*/
|
|
403
|
+
const ur = [
|
|
351
404
|
[
|
|
352
405
|
"path",
|
|
353
406
|
{
|
|
@@ -356,44 +409,44 @@ const Ut = [
|
|
|
356
409
|
}
|
|
357
410
|
],
|
|
358
411
|
["path", { d: "m15 5 4 4", key: "1mk7zo" }]
|
|
359
|
-
],
|
|
412
|
+
], hr = B("pencil", ur);
|
|
360
413
|
/**
|
|
361
414
|
* @license lucide-react v1.11.0 - ISC
|
|
362
415
|
*
|
|
363
416
|
* This source code is licensed under the ISC license.
|
|
364
417
|
* See the LICENSE file in the root directory of this source tree.
|
|
365
418
|
*/
|
|
366
|
-
const
|
|
419
|
+
const mr = [
|
|
367
420
|
["path", { d: "M5 12h14", key: "1ays0h" }],
|
|
368
421
|
["path", { d: "M12 5v14", key: "s699le" }]
|
|
369
|
-
],
|
|
422
|
+
], ht = B("plus", mr);
|
|
370
423
|
/**
|
|
371
424
|
* @license lucide-react v1.11.0 - ISC
|
|
372
425
|
*
|
|
373
426
|
* This source code is licensed under the ISC license.
|
|
374
427
|
* See the LICENSE file in the root directory of this source tree.
|
|
375
428
|
*/
|
|
376
|
-
const
|
|
429
|
+
const pr = [
|
|
377
430
|
["path", { d: "M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8", key: "1357e3" }],
|
|
378
431
|
["path", { d: "M3 3v5h5", key: "1xhq8a" }]
|
|
379
|
-
],
|
|
432
|
+
], fr = B("rotate-ccw", pr);
|
|
380
433
|
/**
|
|
381
434
|
* @license lucide-react v1.11.0 - ISC
|
|
382
435
|
*
|
|
383
436
|
* This source code is licensed under the ISC license.
|
|
384
437
|
* See the LICENSE file in the root directory of this source tree.
|
|
385
438
|
*/
|
|
386
|
-
const
|
|
439
|
+
const gr = [
|
|
387
440
|
["path", { d: "m21 21-4.34-4.34", key: "14j7rj" }],
|
|
388
441
|
["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }]
|
|
389
|
-
],
|
|
442
|
+
], Ce = B("search", gr);
|
|
390
443
|
/**
|
|
391
444
|
* @license lucide-react v1.11.0 - ISC
|
|
392
445
|
*
|
|
393
446
|
* This source code is licensed under the ISC license.
|
|
394
447
|
* See the LICENSE file in the root directory of this source tree.
|
|
395
448
|
*/
|
|
396
|
-
const
|
|
449
|
+
const xr = [
|
|
397
450
|
[
|
|
398
451
|
"path",
|
|
399
452
|
{
|
|
@@ -402,286 +455,296 @@ const Gt = [
|
|
|
402
455
|
}
|
|
403
456
|
],
|
|
404
457
|
["path", { d: "m9 12 2 2 4-4", key: "dzmm74" }]
|
|
405
|
-
],
|
|
458
|
+
], Ge = B("shield-check", xr);
|
|
406
459
|
/**
|
|
407
460
|
* @license lucide-react v1.11.0 - ISC
|
|
408
461
|
*
|
|
409
462
|
* This source code is licensed under the ISC license.
|
|
410
463
|
* See the LICENSE file in the root directory of this source tree.
|
|
411
464
|
*/
|
|
412
|
-
const
|
|
465
|
+
const br = [
|
|
413
466
|
["rect", { width: "14", height: "20", x: "5", y: "2", rx: "2", ry: "2", key: "1yt0o3" }],
|
|
414
467
|
["path", { d: "M12 18h.01", key: "mhygvu" }]
|
|
415
|
-
],
|
|
468
|
+
], mt = B("smartphone", br);
|
|
416
469
|
/**
|
|
417
470
|
* @license lucide-react v1.11.0 - ISC
|
|
418
471
|
*
|
|
419
472
|
* This source code is licensed under the ISC license.
|
|
420
473
|
* See the LICENSE file in the root directory of this source tree.
|
|
421
474
|
*/
|
|
422
|
-
const
|
|
475
|
+
const yr = [
|
|
423
476
|
["rect", { width: "16", height: "20", x: "4", y: "2", rx: "2", ry: "2", key: "76otgf" }],
|
|
424
477
|
["line", { x1: "12", x2: "12.01", y1: "18", y2: "18", key: "1dp563" }]
|
|
425
|
-
],
|
|
426
|
-
|
|
478
|
+
], pt = B("tablet", yr);
|
|
479
|
+
/**
|
|
480
|
+
* @license lucide-react v1.11.0 - ISC
|
|
481
|
+
*
|
|
482
|
+
* This source code is licensed under the ISC license.
|
|
483
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
484
|
+
*/
|
|
485
|
+
const vr = [
|
|
486
|
+
["path", { d: "M18 6 6 18", key: "1bl5f8" }],
|
|
487
|
+
["path", { d: "m6 6 12 12", key: "d8bk6v" }]
|
|
488
|
+
], wr = B("x", vr);
|
|
489
|
+
function Nr(e) {
|
|
427
490
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
428
491
|
}
|
|
429
|
-
var
|
|
430
|
-
function
|
|
431
|
-
return
|
|
432
|
-
(function(r,
|
|
433
|
-
e.exports =
|
|
434
|
-
})(
|
|
435
|
-
var r = 1e3,
|
|
436
|
-
var i = ["th", "st", "nd", "rd"],
|
|
437
|
-
return "[" +
|
|
438
|
-
} },
|
|
439
|
-
var
|
|
440
|
-
return !
|
|
441
|
-
},
|
|
442
|
-
var i = -
|
|
443
|
-
return (i <= 0 ? "+" : "-") +
|
|
444
|
-
}, m: function
|
|
445
|
-
if (i.date() <
|
|
446
|
-
var
|
|
447
|
-
return +(-(
|
|
448
|
-
}, a: function(
|
|
449
|
-
return
|
|
450
|
-
}, p: function(
|
|
451
|
-
return { M:
|
|
452
|
-
}, u: function(
|
|
453
|
-
return
|
|
454
|
-
} },
|
|
455
|
-
b[
|
|
456
|
-
var
|
|
457
|
-
return
|
|
458
|
-
},
|
|
459
|
-
var
|
|
460
|
-
if (!i) return
|
|
492
|
+
var ge = { exports: {} }, kr = ge.exports, Ze;
|
|
493
|
+
function $r() {
|
|
494
|
+
return Ze || (Ze = 1, (function(e, t) {
|
|
495
|
+
(function(r, a) {
|
|
496
|
+
e.exports = a();
|
|
497
|
+
})(kr, (function() {
|
|
498
|
+
var r = 1e3, a = 6e4, o = 36e5, l = "millisecond", f = "second", g = "minute", y = "hour", k = "day", p = "week", v = "month", P = "quarter", A = "year", H = "date", T = "Invalid Date", W = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, D = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, R = { name: "en", weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), ordinal: function(d) {
|
|
499
|
+
var i = ["th", "st", "nd", "rd"], c = d % 100;
|
|
500
|
+
return "[" + d + (i[(c - 20) % 10] || i[c] || i[0]) + "]";
|
|
501
|
+
} }, V = function(d, i, c) {
|
|
502
|
+
var m = String(d);
|
|
503
|
+
return !m || m.length >= i ? d : "" + Array(i + 1 - m.length).join(c) + d;
|
|
504
|
+
}, j = { s: V, z: function(d) {
|
|
505
|
+
var i = -d.utcOffset(), c = Math.abs(i), m = Math.floor(c / 60), u = c % 60;
|
|
506
|
+
return (i <= 0 ? "+" : "-") + V(m, 2, "0") + ":" + V(u, 2, "0");
|
|
507
|
+
}, m: function d(i, c) {
|
|
508
|
+
if (i.date() < c.date()) return -d(c, i);
|
|
509
|
+
var m = 12 * (c.year() - i.year()) + (c.month() - i.month()), u = i.clone().add(m, v), C = c - u < 0, O = i.clone().add(m + (C ? -1 : 1), v);
|
|
510
|
+
return +(-(m + (c - u) / (C ? u - O : O - u)) || 0);
|
|
511
|
+
}, a: function(d) {
|
|
512
|
+
return d < 0 ? Math.ceil(d) || 0 : Math.floor(d);
|
|
513
|
+
}, p: function(d) {
|
|
514
|
+
return { M: v, y: A, w: p, d: k, D: H, h: y, m: g, s: f, ms: l, Q: P }[d] || String(d || "").toLowerCase().replace(/s$/, "");
|
|
515
|
+
}, u: function(d) {
|
|
516
|
+
return d === void 0;
|
|
517
|
+
} }, E = "en", b = {};
|
|
518
|
+
b[E] = R;
|
|
519
|
+
var h = "$isDayjsObject", z = function(d) {
|
|
520
|
+
return d instanceof L || !(!d || !d[h]);
|
|
521
|
+
}, M = function d(i, c, m) {
|
|
522
|
+
var u;
|
|
523
|
+
if (!i) return E;
|
|
461
524
|
if (typeof i == "string") {
|
|
462
|
-
var
|
|
463
|
-
b[
|
|
464
|
-
var
|
|
465
|
-
if (!
|
|
525
|
+
var C = i.toLowerCase();
|
|
526
|
+
b[C] && (u = C), c && (b[C] = c, u = C);
|
|
527
|
+
var O = i.split("-");
|
|
528
|
+
if (!u && O.length > 1) return d(O[0]);
|
|
466
529
|
} else {
|
|
467
|
-
var
|
|
468
|
-
b[
|
|
530
|
+
var N = i.name;
|
|
531
|
+
b[N] = i, u = N;
|
|
469
532
|
}
|
|
470
|
-
return !
|
|
471
|
-
},
|
|
472
|
-
if (
|
|
473
|
-
var
|
|
474
|
-
return
|
|
475
|
-
},
|
|
476
|
-
|
|
477
|
-
return
|
|
533
|
+
return !m && u && (E = u), u || !m && E;
|
|
534
|
+
}, x = function(d, i) {
|
|
535
|
+
if (z(d)) return d.clone();
|
|
536
|
+
var c = typeof i == "object" ? i : {};
|
|
537
|
+
return c.date = d, c.args = arguments, new L(c);
|
|
538
|
+
}, w = j;
|
|
539
|
+
w.l = M, w.i = z, w.w = function(d, i) {
|
|
540
|
+
return x(d, { locale: i.$L, utc: i.$u, x: i.$x, $offset: i.$offset });
|
|
478
541
|
};
|
|
479
|
-
var
|
|
480
|
-
function
|
|
481
|
-
this.$L =
|
|
542
|
+
var L = (function() {
|
|
543
|
+
function d(c) {
|
|
544
|
+
this.$L = M(c.locale, null, !0), this.parse(c), this.$x = this.$x || c.x || {}, this[h] = !0;
|
|
482
545
|
}
|
|
483
|
-
var i =
|
|
484
|
-
return i.parse = function(
|
|
485
|
-
this.$d = (function(
|
|
486
|
-
var
|
|
487
|
-
if (
|
|
488
|
-
if (
|
|
489
|
-
if (
|
|
490
|
-
if (typeof
|
|
491
|
-
var
|
|
492
|
-
if (
|
|
493
|
-
var
|
|
494
|
-
return
|
|
546
|
+
var i = d.prototype;
|
|
547
|
+
return i.parse = function(c) {
|
|
548
|
+
this.$d = (function(m) {
|
|
549
|
+
var u = m.date, C = m.utc;
|
|
550
|
+
if (u === null) return /* @__PURE__ */ new Date(NaN);
|
|
551
|
+
if (w.u(u)) return /* @__PURE__ */ new Date();
|
|
552
|
+
if (u instanceof Date) return new Date(u);
|
|
553
|
+
if (typeof u == "string" && !/Z$/i.test(u)) {
|
|
554
|
+
var O = u.match(W);
|
|
555
|
+
if (O) {
|
|
556
|
+
var N = O[2] - 1 || 0, S = (O[7] || "0").substring(0, 3);
|
|
557
|
+
return C ? new Date(Date.UTC(O[1], N, O[3] || 1, O[4] || 0, O[5] || 0, O[6] || 0, S)) : new Date(O[1], N, O[3] || 1, O[4] || 0, O[5] || 0, O[6] || 0, S);
|
|
495
558
|
}
|
|
496
559
|
}
|
|
497
|
-
return new Date(
|
|
498
|
-
})(
|
|
560
|
+
return new Date(u);
|
|
561
|
+
})(c), this.init();
|
|
499
562
|
}, i.init = function() {
|
|
500
|
-
var
|
|
501
|
-
this.$y =
|
|
563
|
+
var c = this.$d;
|
|
564
|
+
this.$y = c.getFullYear(), this.$M = c.getMonth(), this.$D = c.getDate(), this.$W = c.getDay(), this.$H = c.getHours(), this.$m = c.getMinutes(), this.$s = c.getSeconds(), this.$ms = c.getMilliseconds();
|
|
502
565
|
}, i.$utils = function() {
|
|
503
|
-
return
|
|
566
|
+
return w;
|
|
504
567
|
}, i.isValid = function() {
|
|
505
|
-
return this.$d.toString() !==
|
|
506
|
-
}, i.isSame = function(
|
|
507
|
-
var
|
|
508
|
-
return this.startOf(
|
|
509
|
-
}, i.isAfter = function(
|
|
510
|
-
return
|
|
511
|
-
}, i.isBefore = function(
|
|
512
|
-
return this.endOf(
|
|
513
|
-
}, i.$g = function(
|
|
514
|
-
return
|
|
568
|
+
return this.$d.toString() !== T;
|
|
569
|
+
}, i.isSame = function(c, m) {
|
|
570
|
+
var u = x(c);
|
|
571
|
+
return this.startOf(m) <= u && u <= this.endOf(m);
|
|
572
|
+
}, i.isAfter = function(c, m) {
|
|
573
|
+
return x(c) < this.startOf(m);
|
|
574
|
+
}, i.isBefore = function(c, m) {
|
|
575
|
+
return this.endOf(m) < x(c);
|
|
576
|
+
}, i.$g = function(c, m, u) {
|
|
577
|
+
return w.u(c) ? this[m] : this.set(u, c);
|
|
515
578
|
}, i.unix = function() {
|
|
516
579
|
return Math.floor(this.valueOf() / 1e3);
|
|
517
580
|
}, i.valueOf = function() {
|
|
518
581
|
return this.$d.getTime();
|
|
519
|
-
}, i.startOf = function(
|
|
520
|
-
var
|
|
521
|
-
var
|
|
522
|
-
return
|
|
523
|
-
},
|
|
524
|
-
return
|
|
525
|
-
},
|
|
526
|
-
switch (
|
|
527
|
-
case
|
|
528
|
-
return
|
|
529
|
-
case
|
|
530
|
-
return
|
|
531
|
-
case
|
|
532
|
-
var
|
|
533
|
-
return
|
|
534
|
-
case
|
|
535
|
-
case
|
|
536
|
-
return
|
|
537
|
-
case M:
|
|
538
|
-
return N(Q + "Minutes", 1);
|
|
539
|
-
case $:
|
|
540
|
-
return N(Q + "Seconds", 2);
|
|
582
|
+
}, i.startOf = function(c, m) {
|
|
583
|
+
var u = this, C = !!w.u(m) || m, O = w.p(c), N = function(re, $) {
|
|
584
|
+
var Z = w.w(u.$u ? Date.UTC(u.$y, $, re) : new Date(u.$y, $, re), u);
|
|
585
|
+
return C ? Z : Z.endOf(k);
|
|
586
|
+
}, S = function(re, $) {
|
|
587
|
+
return w.w(u.toDate()[re].apply(u.toDate("s"), (C ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice($)), u);
|
|
588
|
+
}, I = this.$W, q = this.$M, G = this.$D, ee = "set" + (this.$u ? "UTC" : "");
|
|
589
|
+
switch (O) {
|
|
590
|
+
case A:
|
|
591
|
+
return C ? N(1, 0) : N(31, 11);
|
|
592
|
+
case v:
|
|
593
|
+
return C ? N(1, q) : N(0, q + 1);
|
|
594
|
+
case p:
|
|
595
|
+
var te = this.$locale().weekStart || 0, ae = (I < te ? I + 7 : I) - te;
|
|
596
|
+
return N(C ? G - ae : G + (6 - ae), q);
|
|
597
|
+
case k:
|
|
598
|
+
case H:
|
|
599
|
+
return S(ee + "Hours", 0);
|
|
541
600
|
case y:
|
|
542
|
-
return
|
|
601
|
+
return S(ee + "Minutes", 1);
|
|
602
|
+
case g:
|
|
603
|
+
return S(ee + "Seconds", 2);
|
|
604
|
+
case f:
|
|
605
|
+
return S(ee + "Milliseconds", 3);
|
|
543
606
|
default:
|
|
544
607
|
return this.clone();
|
|
545
608
|
}
|
|
546
|
-
}, i.endOf = function(
|
|
547
|
-
return this.startOf(
|
|
548
|
-
}, i.$set = function(
|
|
549
|
-
var
|
|
550
|
-
if (
|
|
551
|
-
var
|
|
552
|
-
|
|
553
|
-
} else
|
|
609
|
+
}, i.endOf = function(c) {
|
|
610
|
+
return this.startOf(c, !1);
|
|
611
|
+
}, i.$set = function(c, m) {
|
|
612
|
+
var u, C = w.p(c), O = "set" + (this.$u ? "UTC" : ""), N = (u = {}, u[k] = O + "Date", u[H] = O + "Date", u[v] = O + "Month", u[A] = O + "FullYear", u[y] = O + "Hours", u[g] = O + "Minutes", u[f] = O + "Seconds", u[l] = O + "Milliseconds", u)[C], S = C === k ? this.$D + (m - this.$W) : m;
|
|
613
|
+
if (C === v || C === A) {
|
|
614
|
+
var I = this.clone().set(H, 1);
|
|
615
|
+
I.$d[N](S), I.init(), this.$d = I.set(H, Math.min(this.$D, I.daysInMonth())).$d;
|
|
616
|
+
} else N && this.$d[N](S);
|
|
554
617
|
return this.init(), this;
|
|
555
|
-
}, i.set = function(
|
|
556
|
-
return this.clone().$set(
|
|
557
|
-
}, i.get = function(
|
|
558
|
-
return this[
|
|
559
|
-
}, i.add = function(
|
|
560
|
-
var
|
|
561
|
-
|
|
562
|
-
var
|
|
563
|
-
var
|
|
564
|
-
return
|
|
618
|
+
}, i.set = function(c, m) {
|
|
619
|
+
return this.clone().$set(c, m);
|
|
620
|
+
}, i.get = function(c) {
|
|
621
|
+
return this[w.p(c)]();
|
|
622
|
+
}, i.add = function(c, m) {
|
|
623
|
+
var u, C = this;
|
|
624
|
+
c = Number(c);
|
|
625
|
+
var O = w.p(m), N = function(q) {
|
|
626
|
+
var G = x(C);
|
|
627
|
+
return w.w(G.date(G.date() + Math.round(q * c)), C);
|
|
565
628
|
};
|
|
566
|
-
if (
|
|
567
|
-
if (
|
|
568
|
-
if (
|
|
569
|
-
if (
|
|
570
|
-
var
|
|
571
|
-
return
|
|
572
|
-
}, i.subtract = function(
|
|
573
|
-
return this.add(-1 *
|
|
574
|
-
}, i.format = function(
|
|
575
|
-
var
|
|
576
|
-
if (!this.isValid()) return
|
|
577
|
-
var
|
|
578
|
-
return
|
|
579
|
-
},
|
|
580
|
-
return
|
|
581
|
-
},
|
|
582
|
-
var
|
|
583
|
-
return
|
|
629
|
+
if (O === v) return this.set(v, this.$M + c);
|
|
630
|
+
if (O === A) return this.set(A, this.$y + c);
|
|
631
|
+
if (O === k) return N(1);
|
|
632
|
+
if (O === p) return N(7);
|
|
633
|
+
var S = (u = {}, u[g] = a, u[y] = o, u[f] = r, u)[O] || 1, I = this.$d.getTime() + c * S;
|
|
634
|
+
return w.w(I, this);
|
|
635
|
+
}, i.subtract = function(c, m) {
|
|
636
|
+
return this.add(-1 * c, m);
|
|
637
|
+
}, i.format = function(c) {
|
|
638
|
+
var m = this, u = this.$locale();
|
|
639
|
+
if (!this.isValid()) return u.invalidDate || T;
|
|
640
|
+
var C = c || "YYYY-MM-DDTHH:mm:ssZ", O = w.z(this), N = this.$H, S = this.$m, I = this.$M, q = u.weekdays, G = u.months, ee = u.meridiem, te = function($, Z, U, Q) {
|
|
641
|
+
return $ && ($[Z] || $(m, C)) || U[Z].slice(0, Q);
|
|
642
|
+
}, ae = function($) {
|
|
643
|
+
return w.s(N % 12 || 12, $, "0");
|
|
644
|
+
}, re = ee || function($, Z, U) {
|
|
645
|
+
var Q = $ < 12 ? "AM" : "PM";
|
|
646
|
+
return U ? Q.toLowerCase() : Q;
|
|
584
647
|
};
|
|
585
|
-
return
|
|
586
|
-
return
|
|
587
|
-
switch (
|
|
648
|
+
return C.replace(D, (function($, Z) {
|
|
649
|
+
return Z || (function(U) {
|
|
650
|
+
switch (U) {
|
|
588
651
|
case "YY":
|
|
589
|
-
return String(
|
|
652
|
+
return String(m.$y).slice(-2);
|
|
590
653
|
case "YYYY":
|
|
591
|
-
return
|
|
654
|
+
return w.s(m.$y, 4, "0");
|
|
592
655
|
case "M":
|
|
593
|
-
return
|
|
656
|
+
return I + 1;
|
|
594
657
|
case "MM":
|
|
595
|
-
return
|
|
658
|
+
return w.s(I + 1, 2, "0");
|
|
596
659
|
case "MMM":
|
|
597
|
-
return
|
|
660
|
+
return te(u.monthsShort, I, G, 3);
|
|
598
661
|
case "MMMM":
|
|
599
|
-
return
|
|
662
|
+
return te(G, I);
|
|
600
663
|
case "D":
|
|
601
|
-
return
|
|
664
|
+
return m.$D;
|
|
602
665
|
case "DD":
|
|
603
|
-
return
|
|
666
|
+
return w.s(m.$D, 2, "0");
|
|
604
667
|
case "d":
|
|
605
|
-
return String(
|
|
668
|
+
return String(m.$W);
|
|
606
669
|
case "dd":
|
|
607
|
-
return
|
|
670
|
+
return te(u.weekdaysMin, m.$W, q, 2);
|
|
608
671
|
case "ddd":
|
|
609
|
-
return
|
|
672
|
+
return te(u.weekdaysShort, m.$W, q, 3);
|
|
610
673
|
case "dddd":
|
|
611
|
-
return
|
|
674
|
+
return q[m.$W];
|
|
612
675
|
case "H":
|
|
613
|
-
return String(
|
|
676
|
+
return String(N);
|
|
614
677
|
case "HH":
|
|
615
|
-
return
|
|
678
|
+
return w.s(N, 2, "0");
|
|
616
679
|
case "h":
|
|
617
|
-
return
|
|
680
|
+
return ae(1);
|
|
618
681
|
case "hh":
|
|
619
|
-
return
|
|
682
|
+
return ae(2);
|
|
620
683
|
case "a":
|
|
621
|
-
return
|
|
684
|
+
return re(N, S, !0);
|
|
622
685
|
case "A":
|
|
623
|
-
return
|
|
686
|
+
return re(N, S, !1);
|
|
624
687
|
case "m":
|
|
625
|
-
return String(
|
|
688
|
+
return String(S);
|
|
626
689
|
case "mm":
|
|
627
|
-
return
|
|
690
|
+
return w.s(S, 2, "0");
|
|
628
691
|
case "s":
|
|
629
|
-
return String(
|
|
692
|
+
return String(m.$s);
|
|
630
693
|
case "ss":
|
|
631
|
-
return
|
|
694
|
+
return w.s(m.$s, 2, "0");
|
|
632
695
|
case "SSS":
|
|
633
|
-
return
|
|
696
|
+
return w.s(m.$ms, 3, "0");
|
|
634
697
|
case "Z":
|
|
635
|
-
return
|
|
698
|
+
return O;
|
|
636
699
|
}
|
|
637
700
|
return null;
|
|
638
|
-
})(
|
|
701
|
+
})($) || O.replace(":", "");
|
|
639
702
|
}));
|
|
640
703
|
}, i.utcOffset = function() {
|
|
641
704
|
return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
|
|
642
|
-
}, i.diff = function(
|
|
643
|
-
var
|
|
644
|
-
return
|
|
705
|
+
}, i.diff = function(c, m, u) {
|
|
706
|
+
var C, O = this, N = w.p(m), S = x(c), I = (S.utcOffset() - this.utcOffset()) * a, q = this - S, G = function() {
|
|
707
|
+
return w.m(O, S);
|
|
645
708
|
};
|
|
646
|
-
switch (
|
|
647
|
-
case
|
|
648
|
-
|
|
709
|
+
switch (N) {
|
|
710
|
+
case A:
|
|
711
|
+
C = G() / 12;
|
|
649
712
|
break;
|
|
650
|
-
case
|
|
651
|
-
|
|
713
|
+
case v:
|
|
714
|
+
C = G();
|
|
652
715
|
break;
|
|
653
|
-
case
|
|
654
|
-
|
|
716
|
+
case P:
|
|
717
|
+
C = G() / 3;
|
|
655
718
|
break;
|
|
656
|
-
case
|
|
657
|
-
|
|
719
|
+
case p:
|
|
720
|
+
C = (q - I) / 6048e5;
|
|
658
721
|
break;
|
|
659
|
-
case
|
|
660
|
-
|
|
722
|
+
case k:
|
|
723
|
+
C = (q - I) / 864e5;
|
|
661
724
|
break;
|
|
662
|
-
case
|
|
663
|
-
|
|
725
|
+
case y:
|
|
726
|
+
C = q / o;
|
|
664
727
|
break;
|
|
665
|
-
case
|
|
666
|
-
|
|
728
|
+
case g:
|
|
729
|
+
C = q / a;
|
|
667
730
|
break;
|
|
668
|
-
case
|
|
669
|
-
|
|
731
|
+
case f:
|
|
732
|
+
C = q / r;
|
|
670
733
|
break;
|
|
671
734
|
default:
|
|
672
|
-
|
|
735
|
+
C = q;
|
|
673
736
|
}
|
|
674
|
-
return
|
|
737
|
+
return u ? C : w.a(C);
|
|
675
738
|
}, i.daysInMonth = function() {
|
|
676
|
-
return this.endOf(
|
|
739
|
+
return this.endOf(v).$D;
|
|
677
740
|
}, i.$locale = function() {
|
|
678
741
|
return b[this.$L];
|
|
679
|
-
}, i.locale = function(
|
|
680
|
-
if (!
|
|
681
|
-
var
|
|
682
|
-
return
|
|
742
|
+
}, i.locale = function(c, m) {
|
|
743
|
+
if (!c) return this.$L;
|
|
744
|
+
var u = this.clone(), C = M(c, m, !0);
|
|
745
|
+
return C && (u.$L = C), u;
|
|
683
746
|
}, i.clone = function() {
|
|
684
|
-
return
|
|
747
|
+
return w.w(this.$d, this);
|
|
685
748
|
}, i.toDate = function() {
|
|
686
749
|
return new Date(this.valueOf());
|
|
687
750
|
}, i.toJSON = function() {
|
|
@@ -690,66 +753,66 @@ function rr() {
|
|
|
690
753
|
return this.$d.toISOString();
|
|
691
754
|
}, i.toString = function() {
|
|
692
755
|
return this.$d.toUTCString();
|
|
693
|
-
},
|
|
694
|
-
})(),
|
|
695
|
-
return
|
|
696
|
-
|
|
697
|
-
return this.$g(i,
|
|
756
|
+
}, d;
|
|
757
|
+
})(), F = L.prototype;
|
|
758
|
+
return x.prototype = F, [["$ms", l], ["$s", f], ["$m", g], ["$H", y], ["$W", k], ["$M", v], ["$y", A], ["$D", H]].forEach((function(d) {
|
|
759
|
+
F[d[1]] = function(i) {
|
|
760
|
+
return this.$g(i, d[0], d[1]);
|
|
698
761
|
};
|
|
699
|
-
})),
|
|
700
|
-
return
|
|
701
|
-
},
|
|
702
|
-
return
|
|
703
|
-
},
|
|
762
|
+
})), x.extend = function(d, i) {
|
|
763
|
+
return d.$i || (d(i, L, x), d.$i = !0), x;
|
|
764
|
+
}, x.locale = M, x.isDayjs = z, x.unix = function(d) {
|
|
765
|
+
return x(1e3 * d);
|
|
766
|
+
}, x.en = b[E], x.Ls = b, x.p = {}, x;
|
|
704
767
|
}));
|
|
705
|
-
})(
|
|
706
|
-
}
|
|
707
|
-
var
|
|
708
|
-
const De = /* @__PURE__ */
|
|
709
|
-
function
|
|
710
|
-
const [e, t] =
|
|
711
|
-
confirm: (
|
|
712
|
-
|
|
768
|
+
})(ge)), ge.exports;
|
|
769
|
+
}
|
|
770
|
+
var Mr = $r();
|
|
771
|
+
const De = /* @__PURE__ */ Nr(Mr);
|
|
772
|
+
function ft() {
|
|
773
|
+
const [e, t] = _(!1), [r, a] = _(!1), o = Y({ title: "" }), l = {
|
|
774
|
+
confirm: (v) => {
|
|
775
|
+
o.current = v, a(!1), t(!0);
|
|
713
776
|
}
|
|
714
|
-
},
|
|
715
|
-
var
|
|
716
|
-
|
|
777
|
+
}, f = async () => {
|
|
778
|
+
var v, P;
|
|
779
|
+
a(!0);
|
|
717
780
|
try {
|
|
718
|
-
await ((
|
|
781
|
+
await ((P = (v = o.current).onOk) == null ? void 0 : P.call(v)), t(!1);
|
|
719
782
|
} finally {
|
|
720
|
-
|
|
783
|
+
a(!1);
|
|
721
784
|
}
|
|
722
|
-
},
|
|
723
|
-
var
|
|
724
|
-
(
|
|
725
|
-
},
|
|
726
|
-
/* @__PURE__ */
|
|
727
|
-
/* @__PURE__ */
|
|
785
|
+
}, g = () => {
|
|
786
|
+
var v, P;
|
|
787
|
+
(P = (v = o.current).onCancel) == null || P.call(v), t(!1);
|
|
788
|
+
}, y = o.current, k = y.okType === "danger", p = e ? at(
|
|
789
|
+
/* @__PURE__ */ s("div", { className: "fixed inset-0 z-[9998] flex items-center justify-center", children: [
|
|
790
|
+
/* @__PURE__ */ n(
|
|
728
791
|
"div",
|
|
729
792
|
{
|
|
730
793
|
className: "absolute inset-0 bg-black/40",
|
|
731
|
-
onClick:
|
|
794
|
+
onClick: g
|
|
732
795
|
}
|
|
733
796
|
),
|
|
734
|
-
/* @__PURE__ */
|
|
735
|
-
/* @__PURE__ */
|
|
736
|
-
|
|
737
|
-
/* @__PURE__ */
|
|
738
|
-
/* @__PURE__ */
|
|
797
|
+
/* @__PURE__ */ s("div", { className: "relative bg-white rounded-2xl shadow-xl w-full max-w-md mx-4 p-6", children: [
|
|
798
|
+
/* @__PURE__ */ n("div", { className: "text-base font-semibold text-gray-800 mb-2", children: y.title }),
|
|
799
|
+
y.content && /* @__PURE__ */ n("div", { className: "text-sm text-gray-600 mt-3", children: y.content }),
|
|
800
|
+
/* @__PURE__ */ s("div", { className: "flex justify-end gap-2 mt-5", children: [
|
|
801
|
+
/* @__PURE__ */ n(
|
|
739
802
|
"button",
|
|
740
803
|
{
|
|
741
804
|
className: "px-4 py-1.5 rounded-lg border border-gray-200 text-sm text-gray-600 hover:bg-gray-50 transition-colors cursor-pointer",
|
|
742
|
-
onClick:
|
|
743
|
-
children:
|
|
805
|
+
onClick: g,
|
|
806
|
+
children: y.cancelText ?? "取消"
|
|
744
807
|
}
|
|
745
808
|
),
|
|
746
|
-
/* @__PURE__ */
|
|
809
|
+
/* @__PURE__ */ n(
|
|
747
810
|
"button",
|
|
748
811
|
{
|
|
749
812
|
disabled: r,
|
|
750
|
-
className: `px-4 py-1.5 rounded-lg text-white text-sm font-medium transition-colors disabled:opacity-50 cursor-pointer ${
|
|
751
|
-
onClick:
|
|
752
|
-
children: r ? "处理中…" :
|
|
813
|
+
className: `px-4 py-1.5 rounded-lg text-white text-sm font-medium transition-colors disabled:opacity-50 cursor-pointer ${k ? "bg-red-500 hover:bg-red-600" : "bg-blue-500 hover:bg-blue-600"}`,
|
|
814
|
+
onClick: f,
|
|
815
|
+
children: r ? "处理中…" : y.okText ?? "确定"
|
|
753
816
|
}
|
|
754
817
|
)
|
|
755
818
|
] })
|
|
@@ -757,282 +820,633 @@ function nt() {
|
|
|
757
820
|
] }),
|
|
758
821
|
document.body
|
|
759
822
|
) : null;
|
|
760
|
-
return [
|
|
823
|
+
return [l, p];
|
|
824
|
+
}
|
|
825
|
+
const gt = (e, t) => JSON.stringify([e.trim().replace(/\/+$/, ""), t]);
|
|
826
|
+
function Cr({ article: e, groups: t, canLoadGroups: r, onRetry: a }) {
|
|
827
|
+
var f;
|
|
828
|
+
const o = e.navPlacements ?? [], l = (f = e.navname) == null ? void 0 : f.trim();
|
|
829
|
+
return !e.navEnabled && !l && !o.length ? /* @__PURE__ */ n("span", { className: "text-xs text-gray-400", children: "未加入网站导航" }) : /* @__PURE__ */ s("div", { className: "min-w-0 space-y-2.5 py-0.5", children: [
|
|
830
|
+
/* @__PURE__ */ s("div", { className: "flex min-w-0 items-center gap-2", children: [
|
|
831
|
+
/* @__PURE__ */ n("span", { className: "min-w-0 break-words text-sm font-semibold text-gray-800", children: l || "未命名导航" }),
|
|
832
|
+
/* @__PURE__ */ s(
|
|
833
|
+
"span",
|
|
834
|
+
{
|
|
835
|
+
className: `inline-flex shrink-0 items-center gap-1 rounded-full px-2 py-0.5 text-[11px] font-medium ${e.navEnabled ? "bg-emerald-50 text-emerald-700" : "bg-gray-100 text-gray-500"}`,
|
|
836
|
+
title: e.navEnabled ? "已在以下位置展示" : "导航已关闭,保留以下位置配置",
|
|
837
|
+
children: [
|
|
838
|
+
/* @__PURE__ */ n("span", { "aria-hidden": "true", className: `h-1.5 w-1.5 rounded-full ${e.navEnabled ? "bg-emerald-500" : "bg-gray-400"}` }),
|
|
839
|
+
e.navEnabled ? "展示中" : "已关闭"
|
|
840
|
+
]
|
|
841
|
+
}
|
|
842
|
+
)
|
|
843
|
+
] }),
|
|
844
|
+
/* @__PURE__ */ s("div", { className: `space-y-1.5 ${e.navEnabled ? "" : "opacity-60"}`, children: [
|
|
845
|
+
["header", "footer"].map((g) => {
|
|
846
|
+
const y = o.find((D) => D.position === g);
|
|
847
|
+
if (!y) return null;
|
|
848
|
+
const k = g === "header", p = k ? ct : ut, v = k ? "页眉" : "页尾", P = t[gt(e.host ?? "", g)], A = y.parentNavId ? P == null ? void 0 : P.names[y.parentNavId] : void 0, H = r && e.host && (!P || P.status === "loading"), T = A || (H ? "加载中…" : (P == null ? void 0 : P.status) === "error" ? "加载失败" : "父导航名称不可用"), W = [v, ...y.parentNavId ? [T] : [], l || "未命名导航"].join(" → ");
|
|
849
|
+
return /* @__PURE__ */ s("div", { className: "flex min-w-0 items-start gap-2", "aria-label": W, title: W, children: [
|
|
850
|
+
/* @__PURE__ */ s("span", { className: `inline-flex shrink-0 items-center gap-1 rounded-md px-1.5 py-1 text-[11px] font-medium leading-none ${k ? "bg-blue-50 text-blue-600" : "bg-violet-50 text-violet-600"}`, children: [
|
|
851
|
+
/* @__PURE__ */ n(p, { size: 12, "aria-hidden": "true" }),
|
|
852
|
+
v
|
|
853
|
+
] }),
|
|
854
|
+
/* @__PURE__ */ n(Ue, { size: 12, className: "mt-0.5 shrink-0 text-gray-300", "aria-hidden": "true" }),
|
|
855
|
+
/* @__PURE__ */ s("div", { className: "flex min-w-0 flex-wrap items-center gap-x-1 gap-y-1 pt-0.5 text-xs leading-4", children: [
|
|
856
|
+
y.parentNavId && /* @__PURE__ */ s(ue, { children: [
|
|
857
|
+
/* @__PURE__ */ n("span", { className: `break-all ${A ? "text-gray-600" : "text-gray-400"}`, children: T }),
|
|
858
|
+
(P == null ? void 0 : P.status) === "error" && /* @__PURE__ */ n("button", { type: "button", onClick: a, className: "cursor-pointer text-blue-500 hover:text-blue-600", children: "重试" }),
|
|
859
|
+
/* @__PURE__ */ n(Ue, { size: 12, className: "shrink-0 text-gray-300", "aria-hidden": "true" })
|
|
860
|
+
] }),
|
|
861
|
+
/* @__PURE__ */ n("span", { className: "break-all text-gray-700", children: l || "未命名导航" })
|
|
862
|
+
] })
|
|
863
|
+
] }, g);
|
|
864
|
+
}),
|
|
865
|
+
!o.length && /* @__PURE__ */ n("p", { className: "text-xs text-gray-400", children: "尚未设置展示位置" })
|
|
866
|
+
] })
|
|
867
|
+
] });
|
|
761
868
|
}
|
|
762
|
-
const
|
|
763
|
-
const { navigate: e } =
|
|
869
|
+
const Zn = () => {
|
|
870
|
+
const { navigate: e } = Ve(), { basePath: t, service: r } = ve(), [a, o] = ft(), [l, f] = _(""), [g, y] = _(""), [k, p] = _(!1), [v, P] = _([]), [A, H] = _({}), [T, W] = _(0), [D, R] = _({
|
|
764
871
|
current: 1,
|
|
765
872
|
size: 15,
|
|
766
873
|
total: 0
|
|
767
|
-
}),
|
|
768
|
-
const
|
|
769
|
-
if (!
|
|
874
|
+
}), V = (h) => {
|
|
875
|
+
const z = h.trim();
|
|
876
|
+
if (!z) return "";
|
|
770
877
|
try {
|
|
771
878
|
return new URL(
|
|
772
|
-
|
|
879
|
+
z.startsWith("http") ? z : `https://${z}`
|
|
773
880
|
).origin;
|
|
774
881
|
} catch {
|
|
775
|
-
return
|
|
882
|
+
return z;
|
|
776
883
|
}
|
|
777
|
-
},
|
|
778
|
-
|
|
884
|
+
}, j = async (h = D.current, z = D.size, M = l, x = g) => {
|
|
885
|
+
p(!0);
|
|
779
886
|
try {
|
|
780
|
-
const w = { page:
|
|
781
|
-
|
|
782
|
-
const
|
|
783
|
-
|
|
784
|
-
const
|
|
785
|
-
|
|
786
|
-
...
|
|
787
|
-
current:
|
|
788
|
-
size:
|
|
789
|
-
total:
|
|
887
|
+
const w = { page: h, size: z };
|
|
888
|
+
M && (w.pathname = M);
|
|
889
|
+
const L = V(x);
|
|
890
|
+
L && (w.host = L);
|
|
891
|
+
const F = await r.getList(w);
|
|
892
|
+
P(F.items), R((d) => ({
|
|
893
|
+
...d,
|
|
894
|
+
current: h,
|
|
895
|
+
size: z,
|
|
896
|
+
total: F.total ?? d.total
|
|
790
897
|
}));
|
|
791
898
|
} catch (w) {
|
|
792
|
-
|
|
899
|
+
J.error(w.message || "获取文章失败");
|
|
793
900
|
} finally {
|
|
794
|
-
|
|
901
|
+
p(!1);
|
|
795
902
|
}
|
|
796
903
|
};
|
|
797
904
|
K(() => {
|
|
798
|
-
|
|
799
|
-
}, [])
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
905
|
+
j(1);
|
|
906
|
+
}, []), K(() => {
|
|
907
|
+
if (!r.getNavigationGroups) return;
|
|
908
|
+
let h = !0;
|
|
909
|
+
const z = /* @__PURE__ */ new Map();
|
|
910
|
+
for (const M of v)
|
|
911
|
+
if (M.host)
|
|
912
|
+
for (const x of M.navPlacements ?? []) {
|
|
913
|
+
if (!x.parentNavId) continue;
|
|
914
|
+
const w = M.host.trim().replace(/\/+$/, "");
|
|
915
|
+
z.set(gt(w, x.position), { host: w, position: x.position });
|
|
916
|
+
}
|
|
917
|
+
H(Object.fromEntries([...z.keys()].map((M) => [M, { status: "loading", names: {} }])));
|
|
918
|
+
for (const [M, x] of z)
|
|
919
|
+
(async () => {
|
|
920
|
+
try {
|
|
921
|
+
const w = await r.getNavigationGroups(x);
|
|
922
|
+
if (!h) return;
|
|
923
|
+
H((L) => ({ ...L, [M]: { status: "loaded", names: Object.fromEntries(w.map((F) => [F.id, F.name])) } }));
|
|
924
|
+
} catch {
|
|
925
|
+
if (!h) return;
|
|
926
|
+
H((w) => ({ ...w, [M]: { status: "error", names: {} } }));
|
|
927
|
+
}
|
|
928
|
+
})();
|
|
929
|
+
return () => {
|
|
930
|
+
h = !1;
|
|
931
|
+
};
|
|
932
|
+
}, [v, r, T]);
|
|
933
|
+
const E = (h) => {
|
|
934
|
+
a.confirm({
|
|
935
|
+
title: "删除文章",
|
|
936
|
+
content: `确认删除 /${h.pathname}?`,
|
|
804
937
|
okText: "删除",
|
|
805
938
|
okType: "danger",
|
|
806
939
|
cancelText: "取消",
|
|
807
940
|
onOk: async () => {
|
|
808
|
-
await r.delete(
|
|
941
|
+
await r.delete(h.id), J.success("删除成功"), j(1);
|
|
809
942
|
}
|
|
810
943
|
});
|
|
811
|
-
},
|
|
812
|
-
return /* @__PURE__ */
|
|
813
|
-
|
|
814
|
-
/* @__PURE__ */
|
|
944
|
+
}, b = Math.ceil(D.total / D.size) || 1;
|
|
945
|
+
return /* @__PURE__ */ s("div", { className: "min-w-0 bg-white rounded-xl shadow-sm border border-gray-100 p-5", children: [
|
|
946
|
+
o,
|
|
947
|
+
/* @__PURE__ */ s(
|
|
815
948
|
"form",
|
|
816
949
|
{
|
|
817
|
-
className: "flex items-center gap-2 mb-5",
|
|
818
|
-
onSubmit: (
|
|
819
|
-
|
|
950
|
+
className: "flex flex-wrap items-center gap-2 mb-5",
|
|
951
|
+
onSubmit: (h) => {
|
|
952
|
+
h.preventDefault(), j(1);
|
|
820
953
|
},
|
|
821
954
|
children: [
|
|
822
|
-
/* @__PURE__ */
|
|
823
|
-
/* @__PURE__ */
|
|
824
|
-
/* @__PURE__ */
|
|
955
|
+
/* @__PURE__ */ s("div", { className: "relative w-full sm:w-52", children: [
|
|
956
|
+
/* @__PURE__ */ n(Ce, { className: "absolute left-3 top-1/2 -translate-y-1/2 w-3.5 h-3.5 text-gray-400" }),
|
|
957
|
+
/* @__PURE__ */ n(
|
|
825
958
|
"input",
|
|
826
959
|
{
|
|
827
960
|
className: "w-full pl-9 pr-3 py-1.5 text-sm border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500/30 focus:border-blue-400 transition",
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
961
|
+
"aria-label": "搜索访问路径",
|
|
962
|
+
placeholder: "搜索访问路径",
|
|
963
|
+
value: l,
|
|
964
|
+
onChange: (h) => f(h.target.value)
|
|
831
965
|
}
|
|
832
966
|
)
|
|
833
967
|
] }),
|
|
834
|
-
/* @__PURE__ */
|
|
835
|
-
/* @__PURE__ */
|
|
836
|
-
/* @__PURE__ */
|
|
968
|
+
/* @__PURE__ */ s("div", { className: "relative w-full sm:w-52", children: [
|
|
969
|
+
/* @__PURE__ */ n(Ce, { className: "absolute left-3 top-1/2 -translate-y-1/2 w-3.5 h-3.5 text-gray-400" }),
|
|
970
|
+
/* @__PURE__ */ n(
|
|
837
971
|
"input",
|
|
838
972
|
{
|
|
839
973
|
className: "w-full pl-9 pr-3 py-1.5 text-sm border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500/30 focus:border-blue-400 transition",
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
974
|
+
"aria-label": "搜索网站地址",
|
|
975
|
+
placeholder: "搜索网站地址",
|
|
976
|
+
value: g,
|
|
977
|
+
onChange: (h) => y(h.target.value)
|
|
843
978
|
}
|
|
844
979
|
)
|
|
845
980
|
] }),
|
|
846
|
-
/* @__PURE__ */
|
|
981
|
+
/* @__PURE__ */ s(
|
|
847
982
|
"button",
|
|
848
983
|
{
|
|
849
984
|
type: "submit",
|
|
850
985
|
className: "flex items-center gap-1.5 px-3 py-1.5 bg-blue-500 hover:bg-blue-600 text-white text-sm rounded-lg transition cursor-pointer",
|
|
851
986
|
children: [
|
|
852
|
-
/* @__PURE__ */
|
|
987
|
+
/* @__PURE__ */ n(Ce, { className: "w-3.5 h-3.5" }),
|
|
853
988
|
"搜索"
|
|
854
989
|
]
|
|
855
990
|
}
|
|
856
991
|
),
|
|
857
|
-
/* @__PURE__ */
|
|
992
|
+
/* @__PURE__ */ s(
|
|
858
993
|
"button",
|
|
859
994
|
{
|
|
860
995
|
type: "button",
|
|
861
996
|
className: "flex items-center gap-1.5 px-3 py-1.5 border border-gray-200 hover:bg-gray-50 text-gray-600 text-sm rounded-lg transition cursor-pointer",
|
|
862
997
|
onClick: () => {
|
|
863
|
-
|
|
998
|
+
f(""), y(""), j(1, D.size, "", "");
|
|
864
999
|
},
|
|
865
1000
|
children: [
|
|
866
|
-
/* @__PURE__ */
|
|
1001
|
+
/* @__PURE__ */ n(fr, { className: "w-3.5 h-3.5" }),
|
|
867
1002
|
"重置"
|
|
868
1003
|
]
|
|
869
1004
|
}
|
|
870
1005
|
),
|
|
871
|
-
/* @__PURE__ */
|
|
872
|
-
/* @__PURE__ */
|
|
1006
|
+
/* @__PURE__ */ n("div", { className: "flex-1" }),
|
|
1007
|
+
/* @__PURE__ */ s(
|
|
873
1008
|
"button",
|
|
874
1009
|
{
|
|
875
1010
|
type: "button",
|
|
876
1011
|
className: "flex items-center gap-1.5 px-3 py-1.5 bg-blue-500 hover:bg-blue-600 text-white text-sm rounded-lg transition cursor-pointer",
|
|
877
1012
|
onClick: () => e(`${t}/create`),
|
|
878
1013
|
children: [
|
|
879
|
-
/* @__PURE__ */
|
|
880
|
-
"
|
|
1014
|
+
/* @__PURE__ */ n(ht, { className: "w-3.5 h-3.5" }),
|
|
1015
|
+
"新增文章"
|
|
881
1016
|
]
|
|
882
1017
|
}
|
|
883
1018
|
)
|
|
884
1019
|
]
|
|
885
1020
|
}
|
|
886
1021
|
),
|
|
887
|
-
/* @__PURE__ */
|
|
888
|
-
/* @__PURE__ */
|
|
889
|
-
/* @__PURE__ */
|
|
890
|
-
/* @__PURE__ */
|
|
891
|
-
/* @__PURE__ */
|
|
892
|
-
/* @__PURE__ */
|
|
893
|
-
/* @__PURE__ */
|
|
1022
|
+
/* @__PURE__ */ n("div", { className: "relative overflow-x-auto", role: "region", "aria-label": "文章列表", tabIndex: 0, children: /* @__PURE__ */ s("table", { className: "w-full min-w-[1120px] table-fixed text-sm", children: [
|
|
1023
|
+
/* @__PURE__ */ n("thead", { children: /* @__PURE__ */ s("tr", { className: "border-b border-gray-100", children: [
|
|
1024
|
+
/* @__PURE__ */ n("th", { scope: "col", className: "text-left py-2.5 px-3 font-medium text-gray-400 text-xs uppercase tracking-wide w-36", children: "访问路径" }),
|
|
1025
|
+
/* @__PURE__ */ n("th", { scope: "col", className: "text-left py-2.5 px-3 font-medium text-gray-400 text-xs uppercase tracking-wide w-32", children: "网站地址" }),
|
|
1026
|
+
/* @__PURE__ */ n("th", { scope: "col", className: "text-left py-2.5 px-3 font-medium text-gray-400 text-xs uppercase tracking-wide w-80", children: "网站导航" }),
|
|
1027
|
+
/* @__PURE__ */ n("th", { scope: "col", className: "text-left py-2.5 px-3 font-medium text-gray-400 text-xs uppercase tracking-wide", children: "HTML 摘要" }),
|
|
1028
|
+
/* @__PURE__ */ n("th", { scope: "col", className: "text-left py-2.5 px-3 font-medium text-gray-400 text-xs uppercase tracking-wide w-36", children: "创建时间" }),
|
|
1029
|
+
/* @__PURE__ */ n("th", { scope: "col", className: "text-left py-2.5 px-3 font-medium text-gray-400 text-xs uppercase tracking-wide w-60", children: "操作" })
|
|
894
1030
|
] }) }),
|
|
895
|
-
/* @__PURE__ */
|
|
896
|
-
/* @__PURE__ */
|
|
897
|
-
/* @__PURE__ */
|
|
898
|
-
] }) }) }) :
|
|
899
|
-
/* @__PURE__ */
|
|
900
|
-
/* @__PURE__ */
|
|
901
|
-
] }) }) }) :
|
|
902
|
-
const
|
|
903
|
-
return /* @__PURE__ */
|
|
1031
|
+
/* @__PURE__ */ n("tbody", { children: k ? /* @__PURE__ */ n("tr", { children: /* @__PURE__ */ n("td", { colSpan: 6, className: "py-16 text-center", children: /* @__PURE__ */ s("div", { className: "flex flex-col items-center gap-2 text-gray-400", children: [
|
|
1032
|
+
/* @__PURE__ */ n(lt, { className: "w-6 h-6 text-blue-400 animate-spin" }),
|
|
1033
|
+
/* @__PURE__ */ n("span", { className: "text-sm", children: "加载中…" })
|
|
1034
|
+
] }) }) }) : v.length === 0 ? /* @__PURE__ */ n("tr", { children: /* @__PURE__ */ n("td", { colSpan: 6, className: "py-16 text-center", children: /* @__PURE__ */ s("div", { className: "flex flex-col items-center gap-2 text-gray-300", children: [
|
|
1035
|
+
/* @__PURE__ */ n(ar, { className: "w-10 h-10" }),
|
|
1036
|
+
/* @__PURE__ */ n("span", { className: "text-sm", children: "暂无文章" })
|
|
1037
|
+
] }) }) }) : v.map((h) => {
|
|
1038
|
+
const z = (h.content || "").replace(/<(style|script)\b[^>]*>[\s\S]*?<\/\1>/gi, " ").replace(/<[^>]+>/g, " ").replace(/\s+/g, " ").trim().slice(0, 80);
|
|
1039
|
+
return /* @__PURE__ */ s(
|
|
904
1040
|
"tr",
|
|
905
1041
|
{
|
|
906
1042
|
className: "border-b border-gray-50 hover:bg-gray-50/60 transition-colors",
|
|
907
1043
|
children: [
|
|
908
|
-
/* @__PURE__ */
|
|
1044
|
+
/* @__PURE__ */ n("td", { className: "py-3 px-3", children: /* @__PURE__ */ s("span", { className: "block break-words font-mono text-xs text-gray-700", children: [
|
|
909
1045
|
"/",
|
|
910
|
-
|
|
1046
|
+
h.pathname
|
|
911
1047
|
] }) }),
|
|
912
|
-
/* @__PURE__ */
|
|
1048
|
+
/* @__PURE__ */ n("td", { className: "py-3 px-3", children: h.host ? /* @__PURE__ */ s(
|
|
913
1049
|
"a",
|
|
914
1050
|
{
|
|
915
|
-
href:
|
|
1051
|
+
href: h.host,
|
|
916
1052
|
target: "_blank",
|
|
917
1053
|
rel: "noopener noreferrer",
|
|
918
|
-
className: "inline-flex items-center gap-1
|
|
919
|
-
title:
|
|
1054
|
+
className: "inline-flex max-w-full items-center gap-1 text-xs text-blue-600 underline underline-offset-2 hover:text-blue-800 transition-colors",
|
|
1055
|
+
title: h.host,
|
|
920
1056
|
children: [
|
|
921
|
-
/* @__PURE__ */
|
|
922
|
-
/* @__PURE__ */
|
|
1057
|
+
/* @__PURE__ */ n("span", { className: "truncate", children: h.host.replace(/^https?:\/\//, "") }),
|
|
1058
|
+
/* @__PURE__ */ n(Xt, { className: "w-3 h-3 shrink-0" })
|
|
923
1059
|
]
|
|
924
1060
|
}
|
|
925
|
-
) : /* @__PURE__ */
|
|
926
|
-
/* @__PURE__ */
|
|
1061
|
+
) : /* @__PURE__ */ n("span", { className: "text-xs text-gray-300", children: "—" }) }),
|
|
1062
|
+
/* @__PURE__ */ n("td", { className: "py-3 px-3", children: /* @__PURE__ */ n(Cr, { article: h, groups: A, canLoadGroups: !!r.getNavigationGroups, onRetry: () => W((M) => M + 1) }) }),
|
|
1063
|
+
/* @__PURE__ */ n("td", { className: "py-3 px-3", children: z ? /* @__PURE__ */ n(
|
|
927
1064
|
"span",
|
|
928
1065
|
{
|
|
929
1066
|
className: "text-sm text-gray-500 truncate block max-w-sm",
|
|
930
|
-
title:
|
|
931
|
-
children:
|
|
1067
|
+
title: z,
|
|
1068
|
+
children: z
|
|
932
1069
|
}
|
|
933
|
-
) : /* @__PURE__ */
|
|
934
|
-
/* @__PURE__ */
|
|
1070
|
+
) : /* @__PURE__ */ n("span", { className: "text-xs text-gray-300", children: "暂无内容" }) }),
|
|
1071
|
+
/* @__PURE__ */ n("td", { className: "py-3 px-3 text-xs whitespace-nowrap text-gray-400", children: h.createdAt ? De(h.createdAt).format(
|
|
935
1072
|
"YYYY/MM/DD HH:mm"
|
|
936
1073
|
) : "—" }),
|
|
937
|
-
/* @__PURE__ */
|
|
938
|
-
|
|
1074
|
+
/* @__PURE__ */ n("td", { className: "py-3 px-3", children: /* @__PURE__ */ s("div", { className: "flex items-center gap-1", children: [
|
|
1075
|
+
h.host && /* @__PURE__ */ n(
|
|
939
1076
|
"button",
|
|
940
1077
|
{
|
|
941
1078
|
className: "px-2.5 py-1 text-xs border border-gray-200 rounded-md hover:bg-gray-50 text-gray-600 transition cursor-pointer",
|
|
942
1079
|
onClick: () => window.open(
|
|
943
|
-
`${
|
|
1080
|
+
`${h.host.replace(/\/$/, "")}/${h.pathname}`,
|
|
944
1081
|
"_blank"
|
|
945
1082
|
),
|
|
946
1083
|
children: "跳转"
|
|
947
1084
|
}
|
|
948
1085
|
),
|
|
949
|
-
/* @__PURE__ */
|
|
1086
|
+
/* @__PURE__ */ n(
|
|
950
1087
|
"button",
|
|
951
1088
|
{
|
|
952
1089
|
className: "px-2.5 py-1 text-xs border border-gray-200 rounded-md hover:bg-gray-50 text-gray-600 transition cursor-pointer",
|
|
953
1090
|
onClick: () => e(
|
|
954
|
-
`${t}/${
|
|
955
|
-
{ state: { record:
|
|
1091
|
+
`${t}/${h.id}/detail`,
|
|
1092
|
+
{ state: { record: h } }
|
|
956
1093
|
),
|
|
957
1094
|
children: "详情"
|
|
958
1095
|
}
|
|
959
1096
|
),
|
|
960
|
-
/* @__PURE__ */
|
|
1097
|
+
/* @__PURE__ */ n(
|
|
961
1098
|
"button",
|
|
962
1099
|
{
|
|
963
1100
|
className: "px-2.5 py-1 text-xs bg-blue-500 hover:bg-blue-600 text-white rounded-md transition cursor-pointer",
|
|
964
1101
|
onClick: () => e(
|
|
965
|
-
`${t}/${
|
|
966
|
-
{ state: { record:
|
|
1102
|
+
`${t}/${h.id}/edit`,
|
|
1103
|
+
{ state: { record: h } }
|
|
967
1104
|
),
|
|
968
1105
|
children: "编辑"
|
|
969
1106
|
}
|
|
970
1107
|
),
|
|
971
|
-
/* @__PURE__ */
|
|
1108
|
+
/* @__PURE__ */ n(
|
|
972
1109
|
"button",
|
|
973
1110
|
{
|
|
974
1111
|
className: "px-2.5 py-1 text-xs bg-red-500 hover:bg-red-600 text-white rounded-md transition cursor-pointer",
|
|
975
|
-
onClick: () =>
|
|
1112
|
+
onClick: () => E(h),
|
|
976
1113
|
children: "删除"
|
|
977
1114
|
}
|
|
978
1115
|
)
|
|
979
1116
|
] }) })
|
|
980
1117
|
]
|
|
981
1118
|
},
|
|
982
|
-
|
|
1119
|
+
h.id
|
|
983
1120
|
);
|
|
984
1121
|
}) })
|
|
985
1122
|
] }) }),
|
|
986
|
-
|
|
987
|
-
/* @__PURE__ */
|
|
1123
|
+
D.total > 0 && /* @__PURE__ */ s("div", { className: "flex flex-wrap items-center justify-between gap-3 pt-4 mt-2 border-t border-gray-100", children: [
|
|
1124
|
+
/* @__PURE__ */ s("span", { className: "text-xs text-gray-400", children: [
|
|
988
1125
|
"共 ",
|
|
989
|
-
|
|
990
|
-
"
|
|
1126
|
+
D.total,
|
|
1127
|
+
" 篇文章"
|
|
991
1128
|
] }),
|
|
992
|
-
/* @__PURE__ */
|
|
993
|
-
/* @__PURE__ */
|
|
1129
|
+
/* @__PURE__ */ s("div", { className: "flex flex-wrap items-center gap-1", children: [
|
|
1130
|
+
/* @__PURE__ */ n(
|
|
994
1131
|
"button",
|
|
995
1132
|
{
|
|
996
1133
|
className: "px-2.5 py-1 text-xs border border-gray-200 rounded-md hover:bg-gray-50 disabled:opacity-40 disabled:cursor-not-allowed text-gray-600 transition cursor-pointer",
|
|
997
|
-
disabled:
|
|
998
|
-
onClick: () =>
|
|
1134
|
+
disabled: D.current <= 1,
|
|
1135
|
+
onClick: () => j(D.current - 1),
|
|
999
1136
|
children: "上一页"
|
|
1000
1137
|
}
|
|
1001
1138
|
),
|
|
1002
|
-
/* @__PURE__ */
|
|
1003
|
-
|
|
1139
|
+
/* @__PURE__ */ s("span", { className: "px-3 py-1 text-xs text-gray-500", children: [
|
|
1140
|
+
D.current,
|
|
1004
1141
|
" / ",
|
|
1005
|
-
|
|
1142
|
+
b
|
|
1006
1143
|
] }),
|
|
1007
|
-
/* @__PURE__ */
|
|
1144
|
+
/* @__PURE__ */ n(
|
|
1008
1145
|
"button",
|
|
1009
1146
|
{
|
|
1010
1147
|
className: "px-2.5 py-1 text-xs border border-gray-200 rounded-md hover:bg-gray-50 disabled:opacity-40 disabled:cursor-not-allowed text-gray-600 transition cursor-pointer",
|
|
1011
|
-
disabled:
|
|
1012
|
-
onClick: () =>
|
|
1148
|
+
disabled: D.current >= b,
|
|
1149
|
+
onClick: () => j(D.current + 1),
|
|
1013
1150
|
children: "下一页"
|
|
1014
1151
|
}
|
|
1015
1152
|
),
|
|
1016
|
-
/* @__PURE__ */
|
|
1153
|
+
/* @__PURE__ */ n(
|
|
1017
1154
|
"select",
|
|
1018
1155
|
{
|
|
1156
|
+
"aria-label": "每页条数",
|
|
1019
1157
|
className: "ml-2 text-xs border border-gray-200 rounded-md px-1.5 py-1 text-gray-600 focus:outline-none focus:ring-1 focus:ring-blue-400 cursor-pointer",
|
|
1020
|
-
value:
|
|
1021
|
-
onChange: (
|
|
1022
|
-
children: [10, 15, 20, 50].map((
|
|
1023
|
-
|
|
1158
|
+
value: D.size,
|
|
1159
|
+
onChange: (h) => j(1, Number(h.target.value)),
|
|
1160
|
+
children: [10, 15, 20, 50].map((h) => /* @__PURE__ */ s("option", { value: h, children: [
|
|
1161
|
+
h,
|
|
1024
1162
|
" 条/页"
|
|
1025
|
-
] },
|
|
1163
|
+
] }, h))
|
|
1026
1164
|
}
|
|
1027
1165
|
)
|
|
1028
1166
|
] })
|
|
1029
1167
|
] })
|
|
1030
1168
|
] });
|
|
1031
|
-
}
|
|
1032
|
-
|
|
1169
|
+
}, Sr = [
|
|
1170
|
+
{ position: "header", label: "页眉", icon: ct, parentEnabled: !1 },
|
|
1171
|
+
{ position: "footer", label: "页尾", icon: ut, parentEnabled: !0 }
|
|
1172
|
+
], ze = "w-full min-w-0 rounded-lg border border-gray-200 bg-white px-3 py-2 text-sm text-gray-700 outline-none transition focus:border-blue-400 focus:ring-2 focus:ring-blue-500/20";
|
|
1173
|
+
function jr({ host: e, position: t, label: r, parentEnabled: a, service: o, parentNavId: l, onSelect: f }) {
|
|
1174
|
+
const g = Ie(), [y, k] = _([]), [p, v] = _(!1), [P, A] = _(""), [H, T] = _(!1), [W, D] = _(""), [R, V] = _(""), [j, E] = _(!1), b = Y(0), h = Y(0), z = Y(f);
|
|
1175
|
+
z.current = f;
|
|
1176
|
+
const M = o.getNavigationGroups, x = o.createNavigationGroup, w = xe(async () => {
|
|
1177
|
+
if (!e || !M) return;
|
|
1178
|
+
const d = ++h.current;
|
|
1179
|
+
v(!0), A("");
|
|
1180
|
+
try {
|
|
1181
|
+
const i = await M({ host: e, position: t });
|
|
1182
|
+
return d !== h.current ? void 0 : (k(i), i);
|
|
1183
|
+
} catch (i) {
|
|
1184
|
+
d === h.current && A(i instanceof Error ? i.message : "父导航加载失败");
|
|
1185
|
+
} finally {
|
|
1186
|
+
d === h.current && v(!1);
|
|
1187
|
+
}
|
|
1188
|
+
}, [e, t, M]);
|
|
1189
|
+
K(() => (b.current++, w(), () => {
|
|
1190
|
+
b.current++, h.current++;
|
|
1191
|
+
}), [w]);
|
|
1192
|
+
const L = async () => {
|
|
1193
|
+
if (j || !x || !a) return;
|
|
1194
|
+
const d = W.trim();
|
|
1195
|
+
if (!d) {
|
|
1196
|
+
V("请输入父导航名称");
|
|
1197
|
+
return;
|
|
1198
|
+
}
|
|
1199
|
+
const i = y.find((m) => m.name === d);
|
|
1200
|
+
if (i) {
|
|
1201
|
+
z.current(i.id), T(!1);
|
|
1202
|
+
return;
|
|
1203
|
+
}
|
|
1204
|
+
const c = b.current;
|
|
1205
|
+
E(!0), V("");
|
|
1206
|
+
try {
|
|
1207
|
+
const m = await x({ host: e, position: t, name: d });
|
|
1208
|
+
if (c !== b.current) return;
|
|
1209
|
+
k((u) => [...u.filter((C) => C.id !== m.id), m]), z.current(m.id), T(!1), D(""), w();
|
|
1210
|
+
} catch (m) {
|
|
1211
|
+
if (c !== b.current) return;
|
|
1212
|
+
if ((m == null ? void 0 : m.status) === 409) {
|
|
1213
|
+
const u = await w();
|
|
1214
|
+
if (c !== b.current) return;
|
|
1215
|
+
const C = u == null ? void 0 : u.find((O) => O.name === d);
|
|
1216
|
+
if (C) {
|
|
1217
|
+
z.current(C.id), T(!1), D("");
|
|
1218
|
+
return;
|
|
1219
|
+
}
|
|
1220
|
+
}
|
|
1221
|
+
V(m instanceof Error ? m.message : "新增父导航失败");
|
|
1222
|
+
} finally {
|
|
1223
|
+
c === b.current && E(!1);
|
|
1224
|
+
}
|
|
1225
|
+
}, F = !!l && !y.some((d) => d.id === l);
|
|
1226
|
+
return /* @__PURE__ */ s("div", { className: "mt-3", children: [
|
|
1227
|
+
/* @__PURE__ */ s("label", { htmlFor: g, className: "mb-1.5 block text-xs text-gray-500", children: [
|
|
1228
|
+
"所属父导航 ",
|
|
1229
|
+
/* @__PURE__ */ n("span", { className: "text-gray-400", children: "(可选)" })
|
|
1230
|
+
] }),
|
|
1231
|
+
/* @__PURE__ */ s(
|
|
1232
|
+
"select",
|
|
1233
|
+
{
|
|
1234
|
+
id: g,
|
|
1235
|
+
"aria-label": `${r}父导航`,
|
|
1236
|
+
disabled: !a || !e || p || j,
|
|
1237
|
+
value: l ?? "",
|
|
1238
|
+
onChange: (d) => f(d.target.value || null),
|
|
1239
|
+
className: `${ze} disabled:cursor-not-allowed disabled:bg-gray-50 disabled:text-gray-400`,
|
|
1240
|
+
children: [
|
|
1241
|
+
/* @__PURE__ */ n("option", { value: "", children: "无(顶级导航)" }),
|
|
1242
|
+
y.map((d) => /* @__PURE__ */ n("option", { value: d.id, children: d.name }, d.id)),
|
|
1243
|
+
F && /* @__PURE__ */ s("option", { value: l, children: [
|
|
1244
|
+
"已选父导航(",
|
|
1245
|
+
l,
|
|
1246
|
+
")"
|
|
1247
|
+
] })
|
|
1248
|
+
]
|
|
1249
|
+
}
|
|
1250
|
+
),
|
|
1251
|
+
p && /* @__PURE__ */ n("p", { role: "status", className: "mt-2 text-xs text-gray-500", children: "加载父导航中…" }),
|
|
1252
|
+
P && /* @__PURE__ */ s("p", { role: "alert", className: "mt-2 text-xs text-red-500", children: [
|
|
1253
|
+
P,
|
|
1254
|
+
/* @__PURE__ */ n("button", { type: "button", onClick: () => void w(), className: "ml-2 cursor-pointer text-blue-500", children: "重试" })
|
|
1255
|
+
] }),
|
|
1256
|
+
a ? e ? H ? /* @__PURE__ */ s("div", { className: "mt-3", children: [
|
|
1257
|
+
/* @__PURE__ */ s("label", { htmlFor: `${g}-new`, className: "mb-1.5 block text-xs text-gray-500", children: [
|
|
1258
|
+
"新增",
|
|
1259
|
+
r,
|
|
1260
|
+
"父导航"
|
|
1261
|
+
] }),
|
|
1262
|
+
/* @__PURE__ */ n(
|
|
1263
|
+
"input",
|
|
1264
|
+
{
|
|
1265
|
+
id: `${g}-new`,
|
|
1266
|
+
autoFocus: !0,
|
|
1267
|
+
maxLength: 100,
|
|
1268
|
+
value: W,
|
|
1269
|
+
disabled: j,
|
|
1270
|
+
placeholder: "输入父导航名称",
|
|
1271
|
+
"aria-invalid": !!R,
|
|
1272
|
+
"aria-describedby": R ? `${g}-error` : void 0,
|
|
1273
|
+
onChange: (d) => {
|
|
1274
|
+
D(d.target.value), V("");
|
|
1275
|
+
},
|
|
1276
|
+
onKeyDown: (d) => {
|
|
1277
|
+
d.key === "Enter" && !d.nativeEvent.isComposing && (d.preventDefault(), L()), d.key === "Escape" && !j && T(!1);
|
|
1278
|
+
},
|
|
1279
|
+
className: ze
|
|
1280
|
+
}
|
|
1281
|
+
),
|
|
1282
|
+
R && /* @__PURE__ */ n("p", { id: `${g}-error`, role: "alert", className: "mt-1.5 text-xs text-red-500", children: R }),
|
|
1283
|
+
/* @__PURE__ */ s("div", { className: "mt-2 flex flex-wrap gap-2", children: [
|
|
1284
|
+
/* @__PURE__ */ s("button", { type: "button", disabled: j, onClick: () => void L(), className: "flex cursor-pointer items-center gap-1 rounded-lg bg-blue-500 px-2.5 py-1.5 text-xs text-white hover:bg-blue-600 disabled:opacity-50", children: [
|
|
1285
|
+
j ? /* @__PURE__ */ n(lt, { size: 12, className: "animate-spin" }) : /* @__PURE__ */ n(Yt, { size: 12, "aria-hidden": "true" }),
|
|
1286
|
+
j ? "添加中…" : "添加并选中"
|
|
1287
|
+
] }),
|
|
1288
|
+
/* @__PURE__ */ s("button", { type: "button", disabled: j, onClick: () => T(!1), className: "flex cursor-pointer items-center gap-1 rounded-lg px-2.5 py-1.5 text-xs text-gray-500 hover:bg-gray-100 disabled:opacity-50", children: [
|
|
1289
|
+
/* @__PURE__ */ n(wr, { size: 12, "aria-hidden": "true" }),
|
|
1290
|
+
"取消"
|
|
1291
|
+
] })
|
|
1292
|
+
] })
|
|
1293
|
+
] }) : x ? /* @__PURE__ */ s("button", { type: "button", disabled: p, "aria-label": `新增${r}父导航`, onClick: () => {
|
|
1294
|
+
T(!0), D(""), V("");
|
|
1295
|
+
}, className: "mt-2.5 flex cursor-pointer items-center gap-1 text-xs text-blue-500 enabled:hover:text-blue-600 disabled:opacity-50", children: [
|
|
1296
|
+
/* @__PURE__ */ n(ht, { size: 13, "aria-hidden": "true" }),
|
|
1297
|
+
"新增父导航"
|
|
1298
|
+
] }) : null : /* @__PURE__ */ n("p", { className: "mt-2 text-xs text-gray-500", children: "请先填写网站地址" }) : /* @__PURE__ */ n("p", { className: "mt-2 text-xs text-gray-500", children: "页眉暂不支持设置父导航。" })
|
|
1299
|
+
] });
|
|
1300
|
+
}
|
|
1301
|
+
function Or({ host: e, service: t, value: r, onChange: a }) {
|
|
1302
|
+
const o = Ie(), l = e.trim().replace(/\/+$/, ""), [f, g] = _(!1), y = !!t.getNavigationGroups, k = (v) => a({ ...r, ...v }), p = (v, P) => {
|
|
1303
|
+
k({
|
|
1304
|
+
navPlacements: P ? [...r.navPlacements, { position: v, parentNavId: null }] : r.navPlacements.filter((A) => A.position !== v)
|
|
1305
|
+
});
|
|
1306
|
+
};
|
|
1307
|
+
return /* @__PURE__ */ s("section", { "aria-label": "导航设置", className: "mt-5 border-t border-gray-100 pt-4", children: [
|
|
1308
|
+
/* @__PURE__ */ s("div", { className: "flex flex-wrap items-center justify-between gap-3", children: [
|
|
1309
|
+
/* @__PURE__ */ n("span", { className: "text-sm font-medium text-gray-700", children: "导航设置" }),
|
|
1310
|
+
/* @__PURE__ */ s("label", { htmlFor: `${o}-enabled`, className: "flex cursor-pointer items-center gap-2 text-sm text-gray-600", children: [
|
|
1311
|
+
/* @__PURE__ */ n("span", { children: "启用导航" }),
|
|
1312
|
+
/* @__PURE__ */ s("span", { className: "relative inline-flex h-5 w-9 shrink-0 items-center", children: [
|
|
1313
|
+
/* @__PURE__ */ n(
|
|
1314
|
+
"input",
|
|
1315
|
+
{
|
|
1316
|
+
id: `${o}-enabled`,
|
|
1317
|
+
type: "checkbox",
|
|
1318
|
+
role: "switch",
|
|
1319
|
+
checked: r.navEnabled,
|
|
1320
|
+
disabled: !y,
|
|
1321
|
+
"aria-controls": `${o}-fields`,
|
|
1322
|
+
onChange: (v) => k({ navEnabled: v.target.checked }),
|
|
1323
|
+
className: "peer absolute inset-0 z-10 m-0 h-full w-full cursor-pointer opacity-0 disabled:cursor-not-allowed"
|
|
1324
|
+
}
|
|
1325
|
+
),
|
|
1326
|
+
/* @__PURE__ */ n("span", { "aria-hidden": "true", className: "absolute inset-0 rounded-full bg-gray-200 transition peer-checked:bg-blue-500 peer-disabled:opacity-50 peer-focus-visible:outline-2 peer-focus-visible:outline-offset-2 peer-focus-visible:outline-blue-500" }),
|
|
1327
|
+
/* @__PURE__ */ n("span", { "aria-hidden": "true", className: "pointer-events-none relative ml-0.5 h-4 w-4 rounded-full bg-white shadow-sm transition-transform peer-checked:translate-x-4" })
|
|
1328
|
+
] })
|
|
1329
|
+
] })
|
|
1330
|
+
] }),
|
|
1331
|
+
y ? r.navEnabled ? /* @__PURE__ */ s("div", { id: `${o}-fields`, className: "mt-4 space-y-4", children: [
|
|
1332
|
+
/* @__PURE__ */ s("div", { className: "max-w-md", children: [
|
|
1333
|
+
/* @__PURE__ */ s("label", { htmlFor: `${o}-name`, className: "mb-1.5 block text-sm font-medium text-gray-700", children: [
|
|
1334
|
+
"导航名称 ",
|
|
1335
|
+
/* @__PURE__ */ n("span", { className: "text-red-500", children: "*" })
|
|
1336
|
+
] }),
|
|
1337
|
+
/* @__PURE__ */ n(
|
|
1338
|
+
"input",
|
|
1339
|
+
{
|
|
1340
|
+
id: `${o}-name`,
|
|
1341
|
+
value: r.navname,
|
|
1342
|
+
maxLength: 100,
|
|
1343
|
+
placeholder: "输入导航名称",
|
|
1344
|
+
required: !0,
|
|
1345
|
+
"aria-invalid": f && !r.navname.trim(),
|
|
1346
|
+
"aria-describedby": f && !r.navname.trim() ? `${o}-name-error` : void 0,
|
|
1347
|
+
onChange: (v) => k({ navname: v.target.value }),
|
|
1348
|
+
onBlur: () => g(!0),
|
|
1349
|
+
className: ze
|
|
1350
|
+
}
|
|
1351
|
+
),
|
|
1352
|
+
f && !r.navname.trim() && /* @__PURE__ */ n("p", { id: `${o}-name-error`, role: "alert", className: "mt-1.5 text-xs text-red-500", children: "开启导航后,请填写导航名称" })
|
|
1353
|
+
] }),
|
|
1354
|
+
/* @__PURE__ */ s("fieldset", { "aria-describedby": `${o}-placements-hint`, children: [
|
|
1355
|
+
/* @__PURE__ */ s("legend", { className: "mb-2 text-sm font-medium text-gray-700", children: [
|
|
1356
|
+
"展示位置 ",
|
|
1357
|
+
/* @__PURE__ */ n("span", { className: "text-red-500", children: "*" })
|
|
1358
|
+
] }),
|
|
1359
|
+
/* @__PURE__ */ n("p", { id: `${o}-placements-hint`, className: "mb-3 text-xs text-gray-500", children: "可同时选择页眉和页尾,页尾可设置父导航。" }),
|
|
1360
|
+
/* @__PURE__ */ n("div", { className: "grid grid-cols-1 gap-3 sm:grid-cols-2", children: Sr.map(({ position: v, label: P, icon: A, parentEnabled: H }) => {
|
|
1361
|
+
const T = r.navPlacements.find((W) => W.position === v);
|
|
1362
|
+
return /* @__PURE__ */ s("div", { className: `min-w-0 rounded-xl border p-3.5 transition-colors ${T ? "border-blue-200 bg-blue-50/30" : "border-gray-200 bg-gray-50/50"}`, children: [
|
|
1363
|
+
/* @__PURE__ */ s("label", { className: "flex cursor-pointer items-center gap-2.5 text-sm text-gray-700", children: [
|
|
1364
|
+
/* @__PURE__ */ n("input", { type: "checkbox", checked: !!T, onChange: (W) => p(v, W.target.checked), className: "h-4 w-4 shrink-0 accent-blue-500" }),
|
|
1365
|
+
/* @__PURE__ */ n(A, { size: 15, className: "shrink-0 text-gray-400", "aria-hidden": "true" }),
|
|
1366
|
+
/* @__PURE__ */ n("span", { className: "font-medium", children: P })
|
|
1367
|
+
] }),
|
|
1368
|
+
T && /* @__PURE__ */ n(
|
|
1369
|
+
jr,
|
|
1370
|
+
{
|
|
1371
|
+
host: l,
|
|
1372
|
+
position: v,
|
|
1373
|
+
label: P,
|
|
1374
|
+
parentEnabled: H,
|
|
1375
|
+
service: t,
|
|
1376
|
+
parentNavId: T.parentNavId,
|
|
1377
|
+
onSelect: (W) => k({ navPlacements: r.navPlacements.map((D) => D.position === v ? { ...D, parentNavId: W } : D) })
|
|
1378
|
+
},
|
|
1379
|
+
`${l}:${v}`
|
|
1380
|
+
)
|
|
1381
|
+
] }, v);
|
|
1382
|
+
}) }),
|
|
1383
|
+
r.navPlacements.length === 0 && /* @__PURE__ */ n("p", { role: "alert", className: "mt-2 text-xs text-red-500", children: "请至少选择一个展示位置" })
|
|
1384
|
+
] })
|
|
1385
|
+
] }) : /* @__PURE__ */ n("p", { className: "mt-1.5 text-xs text-gray-500", children: "开启后可将文章加入页眉、页尾或同时加入两处。" }) : /* @__PURE__ */ n("p", { className: "mt-1.5 text-xs text-gray-500", children: "当前服务尚未接入导航配置" })
|
|
1386
|
+
] });
|
|
1387
|
+
}
|
|
1388
|
+
function Pr(e) {
|
|
1389
|
+
return e.split(/(“[^”]+”|"[^"]+")/g).map(
|
|
1390
|
+
(t, r) => /^(“.*”|".*")$/.test(t) ? /* @__PURE__ */ n("code", { className: "rounded bg-gray-100 px-1 py-0.5 font-mono text-[11px] text-gray-800", children: t.slice(1, -1) }, r) : t
|
|
1391
|
+
);
|
|
1392
|
+
}
|
|
1393
|
+
function Er({ errors: e, source: t }) {
|
|
1394
|
+
const [r, a] = _(null), o = t.split(`
|
|
1395
|
+
`);
|
|
1396
|
+
return /* @__PURE__ */ s("div", { children: [
|
|
1397
|
+
/* @__PURE__ */ s("div", { className: "sticky top-0 z-10 flex items-center gap-3 border-b border-gray-100 bg-white px-4 py-3.5", children: [
|
|
1398
|
+
/* @__PURE__ */ n("span", { className: "flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-red-50 text-red-500", children: /* @__PURE__ */ n(Gt, { size: 18, strokeWidth: 1.75 }) }),
|
|
1399
|
+
/* @__PURE__ */ s("div", { className: "min-w-0 flex-1", children: [
|
|
1400
|
+
/* @__PURE__ */ n("div", { className: "text-sm font-semibold text-gray-900", children: "HTML 校验" }),
|
|
1401
|
+
/* @__PURE__ */ n("div", { className: "mt-0.5 text-xs text-gray-500", children: "点击问题查看详情" })
|
|
1402
|
+
] }),
|
|
1403
|
+
/* @__PURE__ */ s("span", { className: "shrink-0 rounded-full bg-red-50 px-2.5 py-1 text-xs font-medium text-red-600", children: [
|
|
1404
|
+
e.length,
|
|
1405
|
+
" 个问题"
|
|
1406
|
+
] })
|
|
1407
|
+
] }),
|
|
1408
|
+
/* @__PURE__ */ n("ol", { className: "m-0 list-none divide-y divide-gray-100 p-0", children: e.map((l, f) => {
|
|
1409
|
+
var k, p;
|
|
1410
|
+
const g = (l.lastLine ? (k = o[l.lastLine - 1]) == null ? void 0 : k.trim() : "") || ((p = l.extract) == null ? void 0 : p.trim()), y = r === f;
|
|
1411
|
+
return /* @__PURE__ */ s("li", { children: [
|
|
1412
|
+
/* @__PURE__ */ s(
|
|
1413
|
+
"button",
|
|
1414
|
+
{
|
|
1415
|
+
type: "button",
|
|
1416
|
+
"aria-expanded": y,
|
|
1417
|
+
onClick: () => a(y ? null : f),
|
|
1418
|
+
className: `flex w-full cursor-pointer items-center gap-2.5 px-4 py-3 text-left transition-colors hover:bg-gray-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-blue-400 ${y ? "bg-gray-50" : ""}`,
|
|
1419
|
+
children: [
|
|
1420
|
+
/* @__PURE__ */ n("span", { className: "h-1.5 w-1.5 shrink-0 rounded-full bg-red-400" }),
|
|
1421
|
+
/* @__PURE__ */ n("span", { className: "w-16 shrink-0 font-mono text-[11px] text-gray-500", children: l.lastLine != null ? `第 ${l.lastLine} 行` : `问题 ${f + 1}` }),
|
|
1422
|
+
/* @__PURE__ */ n("span", { className: "min-w-0 flex-1 truncate text-xs leading-5 text-gray-700", children: l.message.replace(/[“”"]/g, "") }),
|
|
1423
|
+
/* @__PURE__ */ n(Bt, { size: 14, className: `shrink-0 text-gray-400 transition-transform ${y ? "rotate-180" : ""}` })
|
|
1424
|
+
]
|
|
1425
|
+
}
|
|
1426
|
+
),
|
|
1427
|
+
y && /* @__PURE__ */ s("div", { className: "border-t border-gray-100 px-4 pb-4 pt-3", children: [
|
|
1428
|
+
l.lastColumn != null && /* @__PURE__ */ s("div", { className: "mb-2 font-mono text-[11px] text-gray-400", children: [
|
|
1429
|
+
"第 ",
|
|
1430
|
+
l.lastColumn,
|
|
1431
|
+
" 列"
|
|
1432
|
+
] }),
|
|
1433
|
+
/* @__PURE__ */ n("p", { className: "m-0 text-[13px] leading-6 text-gray-600", children: Pr(l.message) }),
|
|
1434
|
+
g && /* @__PURE__ */ s("div", { className: "mt-3 overflow-hidden rounded-lg border border-gray-100 bg-gray-50", children: [
|
|
1435
|
+
/* @__PURE__ */ s("div", { className: "flex items-center gap-1.5 border-b border-gray-100 px-3 py-1.5 text-[10px] font-medium uppercase tracking-wider text-gray-400", children: [
|
|
1436
|
+
/* @__PURE__ */ n(Ye, { size: 11 }),
|
|
1437
|
+
" 源代码"
|
|
1438
|
+
] }),
|
|
1439
|
+
/* @__PURE__ */ n("pre", { className: "m-0 whitespace-pre-wrap break-words px-3 py-2.5 font-mono text-[11px] leading-5 text-gray-600", children: g })
|
|
1440
|
+
] })
|
|
1441
|
+
] })
|
|
1442
|
+
] }, f);
|
|
1443
|
+
}) })
|
|
1444
|
+
] });
|
|
1445
|
+
}
|
|
1446
|
+
async function Ke(e) {
|
|
1033
1447
|
const t = new AbortController(), r = setTimeout(() => t.abort(), 1e4);
|
|
1034
1448
|
try {
|
|
1035
|
-
const
|
|
1449
|
+
const a = await fetch("https://validator.w3.org/nu/?out=json", {
|
|
1036
1450
|
method: "POST",
|
|
1037
1451
|
headers: {
|
|
1038
1452
|
"Content-Type": "text/html; charset=utf-8",
|
|
@@ -1041,117 +1455,117 @@ async function Ve(e) {
|
|
|
1041
1455
|
body: e,
|
|
1042
1456
|
signal: t.signal
|
|
1043
1457
|
});
|
|
1044
|
-
if (!
|
|
1045
|
-
const
|
|
1046
|
-
return { isValid:
|
|
1047
|
-
} catch (
|
|
1048
|
-
return console.error("W3C 校验请求失败:",
|
|
1458
|
+
if (!a.ok) throw new Error(`W3C validator responded with ${a.status}`);
|
|
1459
|
+
const f = ((await a.json()).messages || []).filter((g) => g.type === "error");
|
|
1460
|
+
return { isValid: f.length === 0, errors: f };
|
|
1461
|
+
} catch (a) {
|
|
1462
|
+
return console.error("W3C 校验请求失败:", a), { isValid: !0, errors: [], networkError: !0 };
|
|
1049
1463
|
} finally {
|
|
1050
1464
|
clearTimeout(r);
|
|
1051
1465
|
}
|
|
1052
1466
|
}
|
|
1053
|
-
function
|
|
1467
|
+
function Je(e, t) {
|
|
1054
1468
|
(t == null || t > e.length) && (t = e.length);
|
|
1055
|
-
for (var r = 0,
|
|
1056
|
-
return
|
|
1469
|
+
for (var r = 0, a = Array(t); r < t; r++) a[r] = e[r];
|
|
1470
|
+
return a;
|
|
1057
1471
|
}
|
|
1058
|
-
function
|
|
1472
|
+
function Lr(e) {
|
|
1059
1473
|
if (Array.isArray(e)) return e;
|
|
1060
1474
|
}
|
|
1061
|
-
function
|
|
1062
|
-
return (t =
|
|
1475
|
+
function Tr(e, t, r) {
|
|
1476
|
+
return (t = Wr(t)) in e ? Object.defineProperty(e, t, {
|
|
1063
1477
|
value: r,
|
|
1064
1478
|
enumerable: !0,
|
|
1065
1479
|
configurable: !0,
|
|
1066
1480
|
writable: !0
|
|
1067
1481
|
}) : e[t] = r, e;
|
|
1068
1482
|
}
|
|
1069
|
-
function
|
|
1483
|
+
function _r(e, t) {
|
|
1070
1484
|
var r = e == null ? null : typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"];
|
|
1071
1485
|
if (r != null) {
|
|
1072
|
-
var
|
|
1486
|
+
var a, o, l, f, g = [], y = !0, k = !1;
|
|
1073
1487
|
try {
|
|
1074
|
-
if (
|
|
1075
|
-
} catch (
|
|
1076
|
-
|
|
1488
|
+
if (l = (r = r.call(e)).next, t !== 0) for (; !(y = (a = l.call(r)).done) && (g.push(a.value), g.length !== t); y = !0) ;
|
|
1489
|
+
} catch (p) {
|
|
1490
|
+
k = !0, o = p;
|
|
1077
1491
|
} finally {
|
|
1078
1492
|
try {
|
|
1079
|
-
if (!
|
|
1493
|
+
if (!y && r.return != null && (f = r.return(), Object(f) !== f)) return;
|
|
1080
1494
|
} finally {
|
|
1081
|
-
if (
|
|
1495
|
+
if (k) throw o;
|
|
1082
1496
|
}
|
|
1083
1497
|
}
|
|
1084
|
-
return
|
|
1498
|
+
return g;
|
|
1085
1499
|
}
|
|
1086
1500
|
}
|
|
1087
|
-
function
|
|
1501
|
+
function Dr() {
|
|
1088
1502
|
throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
1089
1503
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
|
|
1090
1504
|
}
|
|
1091
|
-
function
|
|
1505
|
+
function Qe(e, t) {
|
|
1092
1506
|
var r = Object.keys(e);
|
|
1093
1507
|
if (Object.getOwnPropertySymbols) {
|
|
1094
|
-
var
|
|
1095
|
-
t && (
|
|
1096
|
-
return Object.getOwnPropertyDescriptor(e,
|
|
1097
|
-
})), r.push.apply(r,
|
|
1508
|
+
var a = Object.getOwnPropertySymbols(e);
|
|
1509
|
+
t && (a = a.filter(function(o) {
|
|
1510
|
+
return Object.getOwnPropertyDescriptor(e, o).enumerable;
|
|
1511
|
+
})), r.push.apply(r, a);
|
|
1098
1512
|
}
|
|
1099
1513
|
return r;
|
|
1100
1514
|
}
|
|
1101
|
-
function
|
|
1515
|
+
function Xe(e) {
|
|
1102
1516
|
for (var t = 1; t < arguments.length; t++) {
|
|
1103
1517
|
var r = arguments[t] != null ? arguments[t] : {};
|
|
1104
|
-
t % 2 ?
|
|
1105
|
-
|
|
1106
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) :
|
|
1107
|
-
Object.defineProperty(e,
|
|
1518
|
+
t % 2 ? Qe(Object(r), !0).forEach(function(a) {
|
|
1519
|
+
Tr(e, a, r[a]);
|
|
1520
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : Qe(Object(r)).forEach(function(a) {
|
|
1521
|
+
Object.defineProperty(e, a, Object.getOwnPropertyDescriptor(r, a));
|
|
1108
1522
|
});
|
|
1109
1523
|
}
|
|
1110
1524
|
return e;
|
|
1111
1525
|
}
|
|
1112
|
-
function
|
|
1526
|
+
function zr(e, t) {
|
|
1113
1527
|
if (e == null) return {};
|
|
1114
|
-
var r,
|
|
1528
|
+
var r, a, o = Ar(e, t);
|
|
1115
1529
|
if (Object.getOwnPropertySymbols) {
|
|
1116
|
-
var
|
|
1117
|
-
for (
|
|
1530
|
+
var l = Object.getOwnPropertySymbols(e);
|
|
1531
|
+
for (a = 0; a < l.length; a++) r = l[a], t.indexOf(r) === -1 && {}.propertyIsEnumerable.call(e, r) && (o[r] = e[r]);
|
|
1118
1532
|
}
|
|
1119
|
-
return
|
|
1533
|
+
return o;
|
|
1120
1534
|
}
|
|
1121
|
-
function
|
|
1535
|
+
function Ar(e, t) {
|
|
1122
1536
|
if (e == null) return {};
|
|
1123
1537
|
var r = {};
|
|
1124
|
-
for (var
|
|
1125
|
-
if (t.indexOf(
|
|
1126
|
-
r[
|
|
1538
|
+
for (var a in e) if ({}.hasOwnProperty.call(e, a)) {
|
|
1539
|
+
if (t.indexOf(a) !== -1) continue;
|
|
1540
|
+
r[a] = e[a];
|
|
1127
1541
|
}
|
|
1128
1542
|
return r;
|
|
1129
1543
|
}
|
|
1130
|
-
function
|
|
1131
|
-
return
|
|
1544
|
+
function Hr(e, t) {
|
|
1545
|
+
return Lr(e) || _r(e, t) || Rr(e, t) || Dr();
|
|
1132
1546
|
}
|
|
1133
|
-
function
|
|
1547
|
+
function Ir(e, t) {
|
|
1134
1548
|
if (typeof e != "object" || !e) return e;
|
|
1135
1549
|
var r = e[Symbol.toPrimitive];
|
|
1136
1550
|
if (r !== void 0) {
|
|
1137
|
-
var
|
|
1138
|
-
if (typeof
|
|
1551
|
+
var a = r.call(e, t);
|
|
1552
|
+
if (typeof a != "object") return a;
|
|
1139
1553
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
1140
1554
|
}
|
|
1141
1555
|
return (t === "string" ? String : Number)(e);
|
|
1142
1556
|
}
|
|
1143
|
-
function
|
|
1144
|
-
var t =
|
|
1557
|
+
function Wr(e) {
|
|
1558
|
+
var t = Ir(e, "string");
|
|
1145
1559
|
return typeof t == "symbol" ? t : t + "";
|
|
1146
1560
|
}
|
|
1147
|
-
function
|
|
1561
|
+
function Rr(e, t) {
|
|
1148
1562
|
if (e) {
|
|
1149
|
-
if (typeof e == "string") return
|
|
1563
|
+
if (typeof e == "string") return Je(e, t);
|
|
1150
1564
|
var r = {}.toString.call(e).slice(8, -1);
|
|
1151
|
-
return r === "Object" && e.constructor && (r = e.constructor.name), r === "Map" || r === "Set" ? Array.from(e) : r === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r) ?
|
|
1565
|
+
return r === "Object" && e.constructor && (r = e.constructor.name), r === "Map" || r === "Set" ? Array.from(e) : r === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r) ? Je(e, t) : void 0;
|
|
1152
1566
|
}
|
|
1153
1567
|
}
|
|
1154
|
-
function
|
|
1568
|
+
function Vr(e, t, r) {
|
|
1155
1569
|
return t in e ? Object.defineProperty(e, t, {
|
|
1156
1570
|
value: r,
|
|
1157
1571
|
enumerable: !0,
|
|
@@ -1159,79 +1573,79 @@ function mr(e, t, r) {
|
|
|
1159
1573
|
writable: !0
|
|
1160
1574
|
}) : e[t] = r, e;
|
|
1161
1575
|
}
|
|
1162
|
-
function
|
|
1576
|
+
function et(e, t) {
|
|
1163
1577
|
var r = Object.keys(e);
|
|
1164
1578
|
if (Object.getOwnPropertySymbols) {
|
|
1165
|
-
var
|
|
1166
|
-
t && (
|
|
1167
|
-
return Object.getOwnPropertyDescriptor(e,
|
|
1168
|
-
})), r.push.apply(r,
|
|
1579
|
+
var a = Object.getOwnPropertySymbols(e);
|
|
1580
|
+
t && (a = a.filter(function(o) {
|
|
1581
|
+
return Object.getOwnPropertyDescriptor(e, o).enumerable;
|
|
1582
|
+
})), r.push.apply(r, a);
|
|
1169
1583
|
}
|
|
1170
1584
|
return r;
|
|
1171
1585
|
}
|
|
1172
|
-
function
|
|
1586
|
+
function tt(e) {
|
|
1173
1587
|
for (var t = 1; t < arguments.length; t++) {
|
|
1174
1588
|
var r = arguments[t] != null ? arguments[t] : {};
|
|
1175
|
-
t % 2 ?
|
|
1176
|
-
|
|
1177
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) :
|
|
1178
|
-
Object.defineProperty(e,
|
|
1589
|
+
t % 2 ? et(Object(r), !0).forEach(function(a) {
|
|
1590
|
+
Vr(e, a, r[a]);
|
|
1591
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : et(Object(r)).forEach(function(a) {
|
|
1592
|
+
Object.defineProperty(e, a, Object.getOwnPropertyDescriptor(r, a));
|
|
1179
1593
|
});
|
|
1180
1594
|
}
|
|
1181
1595
|
return e;
|
|
1182
1596
|
}
|
|
1183
|
-
function
|
|
1597
|
+
function Yr() {
|
|
1184
1598
|
for (var e = arguments.length, t = new Array(e), r = 0; r < e; r++)
|
|
1185
1599
|
t[r] = arguments[r];
|
|
1186
|
-
return function(
|
|
1187
|
-
return t.reduceRight(function(
|
|
1188
|
-
return
|
|
1189
|
-
},
|
|
1600
|
+
return function(a) {
|
|
1601
|
+
return t.reduceRight(function(o, l) {
|
|
1602
|
+
return l(o);
|
|
1603
|
+
}, a);
|
|
1190
1604
|
};
|
|
1191
1605
|
}
|
|
1192
|
-
function
|
|
1606
|
+
function le(e) {
|
|
1193
1607
|
return function t() {
|
|
1194
|
-
for (var r = this,
|
|
1195
|
-
|
|
1196
|
-
return
|
|
1197
|
-
for (var
|
|
1198
|
-
|
|
1199
|
-
return t.apply(r, [].concat(
|
|
1608
|
+
for (var r = this, a = arguments.length, o = new Array(a), l = 0; l < a; l++)
|
|
1609
|
+
o[l] = arguments[l];
|
|
1610
|
+
return o.length >= e.length ? e.apply(this, o) : function() {
|
|
1611
|
+
for (var f = arguments.length, g = new Array(f), y = 0; y < f; y++)
|
|
1612
|
+
g[y] = arguments[y];
|
|
1613
|
+
return t.apply(r, [].concat(o, g));
|
|
1200
1614
|
};
|
|
1201
1615
|
};
|
|
1202
1616
|
}
|
|
1203
|
-
function
|
|
1617
|
+
function be(e) {
|
|
1204
1618
|
return {}.toString.call(e).includes("Object");
|
|
1205
1619
|
}
|
|
1206
|
-
function
|
|
1620
|
+
function qr(e) {
|
|
1207
1621
|
return !Object.keys(e).length;
|
|
1208
1622
|
}
|
|
1209
|
-
function
|
|
1623
|
+
function he(e) {
|
|
1210
1624
|
return typeof e == "function";
|
|
1211
1625
|
}
|
|
1212
|
-
function
|
|
1626
|
+
function Br(e, t) {
|
|
1213
1627
|
return Object.prototype.hasOwnProperty.call(e, t);
|
|
1214
1628
|
}
|
|
1215
|
-
function
|
|
1216
|
-
return
|
|
1217
|
-
return !
|
|
1218
|
-
}) &&
|
|
1629
|
+
function Fr(e, t) {
|
|
1630
|
+
return be(t) || ne("changeType"), Object.keys(t).some(function(r) {
|
|
1631
|
+
return !Br(e, r);
|
|
1632
|
+
}) && ne("changeField"), t;
|
|
1219
1633
|
}
|
|
1220
|
-
function
|
|
1221
|
-
|
|
1634
|
+
function Ur(e) {
|
|
1635
|
+
he(e) || ne("selectorType");
|
|
1222
1636
|
}
|
|
1223
|
-
function
|
|
1224
|
-
|
|
1225
|
-
return !
|
|
1226
|
-
}) &&
|
|
1637
|
+
function Gr(e) {
|
|
1638
|
+
he(e) || be(e) || ne("handlerType"), be(e) && Object.values(e).some(function(t) {
|
|
1639
|
+
return !he(t);
|
|
1640
|
+
}) && ne("handlersType");
|
|
1227
1641
|
}
|
|
1228
|
-
function
|
|
1229
|
-
e ||
|
|
1642
|
+
function Zr(e) {
|
|
1643
|
+
e || ne("initialIsRequired"), be(e) || ne("initialType"), qr(e) && ne("initialContent");
|
|
1230
1644
|
}
|
|
1231
|
-
function
|
|
1645
|
+
function Kr(e, t) {
|
|
1232
1646
|
throw new Error(e[t] || e.default);
|
|
1233
1647
|
}
|
|
1234
|
-
var
|
|
1648
|
+
var Jr = {
|
|
1235
1649
|
initialIsRequired: "initial state is required",
|
|
1236
1650
|
initialType: "initial state should be an object",
|
|
1237
1651
|
initialContent: "initial state shouldn't be an empty object",
|
|
@@ -1241,76 +1655,76 @@ var kr = {
|
|
|
1241
1655
|
changeType: "provided value of changes should be an object",
|
|
1242
1656
|
changeField: 'it seams you want to change a field in the state which is not specified in the "initial" state',
|
|
1243
1657
|
default: "an unknown error accured in `state-local` package"
|
|
1244
|
-
},
|
|
1245
|
-
changes:
|
|
1246
|
-
selector:
|
|
1247
|
-
handler:
|
|
1248
|
-
initial:
|
|
1658
|
+
}, ne = le(Kr)(Jr), pe = {
|
|
1659
|
+
changes: Fr,
|
|
1660
|
+
selector: Ur,
|
|
1661
|
+
handler: Gr,
|
|
1662
|
+
initial: Zr
|
|
1249
1663
|
};
|
|
1250
|
-
function
|
|
1664
|
+
function Qr(e) {
|
|
1251
1665
|
var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
1252
|
-
|
|
1666
|
+
pe.initial(e), pe.handler(t);
|
|
1253
1667
|
var r = {
|
|
1254
1668
|
current: e
|
|
1255
|
-
},
|
|
1256
|
-
function
|
|
1257
|
-
var
|
|
1258
|
-
return
|
|
1669
|
+
}, a = le(tn)(r, t), o = le(en)(r), l = le(pe.changes)(e), f = le(Xr)(r);
|
|
1670
|
+
function g() {
|
|
1671
|
+
var k = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : function(p) {
|
|
1672
|
+
return p;
|
|
1259
1673
|
};
|
|
1260
|
-
return
|
|
1674
|
+
return pe.selector(k), k(r.current);
|
|
1261
1675
|
}
|
|
1262
|
-
function
|
|
1263
|
-
|
|
1676
|
+
function y(k) {
|
|
1677
|
+
Yr(a, o, l, f)(k);
|
|
1264
1678
|
}
|
|
1265
|
-
return [
|
|
1679
|
+
return [g, y];
|
|
1266
1680
|
}
|
|
1267
|
-
function
|
|
1268
|
-
return
|
|
1681
|
+
function Xr(e, t) {
|
|
1682
|
+
return he(t) ? t(e.current) : t;
|
|
1269
1683
|
}
|
|
1270
|
-
function
|
|
1271
|
-
return e.current =
|
|
1684
|
+
function en(e, t) {
|
|
1685
|
+
return e.current = tt(tt({}, e.current), t), t;
|
|
1272
1686
|
}
|
|
1273
|
-
function
|
|
1274
|
-
return
|
|
1275
|
-
var
|
|
1276
|
-
return (
|
|
1687
|
+
function tn(e, t, r) {
|
|
1688
|
+
return he(t) ? t(e.current) : Object.keys(r).forEach(function(a) {
|
|
1689
|
+
var o;
|
|
1690
|
+
return (o = t[a]) === null || o === void 0 ? void 0 : o.call(t, e.current[a]);
|
|
1277
1691
|
}), r;
|
|
1278
1692
|
}
|
|
1279
|
-
var
|
|
1280
|
-
create:
|
|
1281
|
-
},
|
|
1693
|
+
var rn = {
|
|
1694
|
+
create: Qr
|
|
1695
|
+
}, nn = {
|
|
1282
1696
|
paths: {
|
|
1283
1697
|
vs: "https://cdn.jsdelivr.net/npm/monaco-editor@0.55.1/min/vs"
|
|
1284
1698
|
}
|
|
1285
1699
|
};
|
|
1286
|
-
function
|
|
1700
|
+
function an(e) {
|
|
1287
1701
|
return function t() {
|
|
1288
|
-
for (var r = this,
|
|
1289
|
-
|
|
1290
|
-
return
|
|
1291
|
-
for (var
|
|
1292
|
-
|
|
1293
|
-
return t.apply(r, [].concat(
|
|
1702
|
+
for (var r = this, a = arguments.length, o = new Array(a), l = 0; l < a; l++)
|
|
1703
|
+
o[l] = arguments[l];
|
|
1704
|
+
return o.length >= e.length ? e.apply(this, o) : function() {
|
|
1705
|
+
for (var f = arguments.length, g = new Array(f), y = 0; y < f; y++)
|
|
1706
|
+
g[y] = arguments[y];
|
|
1707
|
+
return t.apply(r, [].concat(o, g));
|
|
1294
1708
|
};
|
|
1295
1709
|
};
|
|
1296
1710
|
}
|
|
1297
|
-
function
|
|
1711
|
+
function sn(e) {
|
|
1298
1712
|
return {}.toString.call(e).includes("Object");
|
|
1299
1713
|
}
|
|
1300
|
-
function
|
|
1301
|
-
return e ||
|
|
1714
|
+
function on(e) {
|
|
1715
|
+
return e || rt("configIsRequired"), sn(e) || rt("configType"), e.urls ? (cn(), {
|
|
1302
1716
|
paths: {
|
|
1303
1717
|
vs: e.urls.monacoBase
|
|
1304
1718
|
}
|
|
1305
1719
|
}) : e;
|
|
1306
1720
|
}
|
|
1307
|
-
function
|
|
1308
|
-
console.warn(
|
|
1721
|
+
function cn() {
|
|
1722
|
+
console.warn(xt.deprecation);
|
|
1309
1723
|
}
|
|
1310
|
-
function
|
|
1724
|
+
function ln(e, t) {
|
|
1311
1725
|
throw new Error(e[t] || e.default);
|
|
1312
1726
|
}
|
|
1313
|
-
var
|
|
1727
|
+
var xt = {
|
|
1314
1728
|
configIsRequired: "the configuration object is required",
|
|
1315
1729
|
configType: "the configuration object should be an object",
|
|
1316
1730
|
default: "an unknown error accured in `@monaco-editor/loader` package",
|
|
@@ -1324,376 +1738,483 @@ var at = {
|
|
|
1324
1738
|
|
|
1325
1739
|
For more please check the link https://github.com/suren-atoyan/monaco-loader#config
|
|
1326
1740
|
`
|
|
1327
|
-
},
|
|
1328
|
-
config:
|
|
1329
|
-
},
|
|
1330
|
-
for (var t = arguments.length, r = new Array(t),
|
|
1331
|
-
r[
|
|
1332
|
-
return function(
|
|
1333
|
-
return r.reduceRight(function(
|
|
1334
|
-
return
|
|
1335
|
-
},
|
|
1741
|
+
}, rt = an(ln)(xt), dn = {
|
|
1742
|
+
config: on
|
|
1743
|
+
}, un = function() {
|
|
1744
|
+
for (var t = arguments.length, r = new Array(t), a = 0; a < t; a++)
|
|
1745
|
+
r[a] = arguments[a];
|
|
1746
|
+
return function(o) {
|
|
1747
|
+
return r.reduceRight(function(l, f) {
|
|
1748
|
+
return f(l);
|
|
1749
|
+
}, o);
|
|
1336
1750
|
};
|
|
1337
1751
|
};
|
|
1338
|
-
function
|
|
1752
|
+
function bt(e, t) {
|
|
1339
1753
|
return Object.keys(t).forEach(function(r) {
|
|
1340
|
-
t[r] instanceof Object && e[r] && Object.assign(t[r],
|
|
1341
|
-
}),
|
|
1754
|
+
t[r] instanceof Object && e[r] && Object.assign(t[r], bt(e[r], t[r]));
|
|
1755
|
+
}), Xe(Xe({}, e), t);
|
|
1342
1756
|
}
|
|
1343
|
-
var
|
|
1757
|
+
var hn = {
|
|
1344
1758
|
type: "cancelation",
|
|
1345
1759
|
msg: "operation is manually canceled"
|
|
1346
1760
|
};
|
|
1347
|
-
function
|
|
1348
|
-
var t = !1, r = new Promise(function(
|
|
1349
|
-
e.then(function(
|
|
1350
|
-
return t ?
|
|
1351
|
-
}), e.catch(
|
|
1761
|
+
function Se(e) {
|
|
1762
|
+
var t = !1, r = new Promise(function(a, o) {
|
|
1763
|
+
e.then(function(l) {
|
|
1764
|
+
return t ? o(hn) : a(l);
|
|
1765
|
+
}), e.catch(o);
|
|
1352
1766
|
});
|
|
1353
1767
|
return r.cancel = function() {
|
|
1354
1768
|
return t = !0;
|
|
1355
1769
|
}, r;
|
|
1356
1770
|
}
|
|
1357
|
-
var
|
|
1358
|
-
config:
|
|
1771
|
+
var mn = ["monaco"], pn = rn.create({
|
|
1772
|
+
config: nn,
|
|
1359
1773
|
isInitialized: !1,
|
|
1360
1774
|
resolve: null,
|
|
1361
1775
|
reject: null,
|
|
1362
1776
|
monaco: null
|
|
1363
|
-
}),
|
|
1364
|
-
function
|
|
1365
|
-
var t =
|
|
1366
|
-
|
|
1777
|
+
}), yt = Hr(pn, 2), me = yt[0], we = yt[1];
|
|
1778
|
+
function fn(e) {
|
|
1779
|
+
var t = dn.config(e), r = t.monaco, a = zr(t, mn);
|
|
1780
|
+
we(function(o) {
|
|
1367
1781
|
return {
|
|
1368
|
-
config:
|
|
1782
|
+
config: bt(o.config, a),
|
|
1369
1783
|
monaco: r
|
|
1370
1784
|
};
|
|
1371
1785
|
});
|
|
1372
1786
|
}
|
|
1373
|
-
function
|
|
1374
|
-
var e =
|
|
1375
|
-
var r = t.monaco,
|
|
1787
|
+
function gn() {
|
|
1788
|
+
var e = me(function(t) {
|
|
1789
|
+
var r = t.monaco, a = t.isInitialized, o = t.resolve;
|
|
1376
1790
|
return {
|
|
1377
1791
|
monaco: r,
|
|
1378
|
-
isInitialized:
|
|
1379
|
-
resolve:
|
|
1792
|
+
isInitialized: a,
|
|
1793
|
+
resolve: o
|
|
1380
1794
|
};
|
|
1381
1795
|
});
|
|
1382
1796
|
if (!e.isInitialized) {
|
|
1383
|
-
if (
|
|
1797
|
+
if (we({
|
|
1384
1798
|
isInitialized: !0
|
|
1385
1799
|
}), e.monaco)
|
|
1386
|
-
return e.resolve(e.monaco),
|
|
1800
|
+
return e.resolve(e.monaco), Se(je);
|
|
1387
1801
|
if (window.monaco && window.monaco.editor)
|
|
1388
|
-
return
|
|
1389
|
-
|
|
1802
|
+
return vt(window.monaco), e.resolve(window.monaco), Se(je);
|
|
1803
|
+
un(xn, yn)(vn);
|
|
1390
1804
|
}
|
|
1391
|
-
return
|
|
1805
|
+
return Se(je);
|
|
1392
1806
|
}
|
|
1393
|
-
function
|
|
1807
|
+
function xn(e) {
|
|
1394
1808
|
return document.body.appendChild(e);
|
|
1395
1809
|
}
|
|
1396
|
-
function
|
|
1810
|
+
function bn(e) {
|
|
1397
1811
|
var t = document.createElement("script");
|
|
1398
1812
|
return e && (t.src = e), t;
|
|
1399
1813
|
}
|
|
1400
|
-
function
|
|
1401
|
-
var t =
|
|
1402
|
-
var
|
|
1814
|
+
function yn(e) {
|
|
1815
|
+
var t = me(function(a) {
|
|
1816
|
+
var o = a.config, l = a.reject;
|
|
1403
1817
|
return {
|
|
1404
|
-
config:
|
|
1405
|
-
reject:
|
|
1818
|
+
config: o,
|
|
1819
|
+
reject: l
|
|
1406
1820
|
};
|
|
1407
|
-
}), r =
|
|
1821
|
+
}), r = bn("".concat(t.config.paths.vs, "/loader.js"));
|
|
1408
1822
|
return r.onload = function() {
|
|
1409
1823
|
return e();
|
|
1410
1824
|
}, r.onerror = t.reject, r;
|
|
1411
1825
|
}
|
|
1412
|
-
function
|
|
1413
|
-
var e =
|
|
1414
|
-
var
|
|
1826
|
+
function vn() {
|
|
1827
|
+
var e = me(function(r) {
|
|
1828
|
+
var a = r.config, o = r.resolve, l = r.reject;
|
|
1415
1829
|
return {
|
|
1416
|
-
config:
|
|
1417
|
-
resolve:
|
|
1418
|
-
reject:
|
|
1830
|
+
config: a,
|
|
1831
|
+
resolve: o,
|
|
1832
|
+
reject: l
|
|
1419
1833
|
};
|
|
1420
1834
|
}), t = window.require;
|
|
1421
1835
|
t.config(e.config), t(["vs/editor/editor.main"], function(r) {
|
|
1422
|
-
var
|
|
1423
|
-
|
|
1836
|
+
var a = r.m || r;
|
|
1837
|
+
vt(a), e.resolve(a);
|
|
1424
1838
|
}, function(r) {
|
|
1425
1839
|
e.reject(r);
|
|
1426
1840
|
});
|
|
1427
1841
|
}
|
|
1428
|
-
function
|
|
1429
|
-
|
|
1842
|
+
function vt(e) {
|
|
1843
|
+
me().monaco || we({
|
|
1430
1844
|
monaco: e
|
|
1431
1845
|
});
|
|
1432
1846
|
}
|
|
1433
|
-
function
|
|
1434
|
-
return
|
|
1847
|
+
function wn() {
|
|
1848
|
+
return me(function(e) {
|
|
1435
1849
|
var t = e.monaco;
|
|
1436
1850
|
return t;
|
|
1437
1851
|
});
|
|
1438
1852
|
}
|
|
1439
|
-
var
|
|
1440
|
-
return
|
|
1853
|
+
var je = new Promise(function(e, t) {
|
|
1854
|
+
return we({
|
|
1441
1855
|
resolve: e,
|
|
1442
1856
|
reject: t
|
|
1443
1857
|
});
|
|
1444
|
-
}),
|
|
1445
|
-
config:
|
|
1446
|
-
init:
|
|
1447
|
-
__getMonacoInstance:
|
|
1448
|
-
},
|
|
1449
|
-
function
|
|
1450
|
-
return
|
|
1451
|
-
}
|
|
1452
|
-
var
|
|
1453
|
-
function
|
|
1454
|
-
return
|
|
1455
|
-
}
|
|
1456
|
-
var
|
|
1457
|
-
function
|
|
1858
|
+
}), wt = {
|
|
1859
|
+
config: fn,
|
|
1860
|
+
init: gn,
|
|
1861
|
+
__getMonacoInstance: wn
|
|
1862
|
+
}, Nn = { wrapper: { display: "flex", position: "relative", textAlign: "initial" }, fullWidth: { width: "100%" }, hide: { display: "none" } }, Oe = Nn, kn = { container: { display: "flex", height: "100%", width: "100%", justifyContent: "center", alignItems: "center" } }, $n = kn;
|
|
1863
|
+
function Mn({ children: e }) {
|
|
1864
|
+
return ce.createElement("div", { style: $n.container }, e);
|
|
1865
|
+
}
|
|
1866
|
+
var Cn = Mn, Sn = Cn;
|
|
1867
|
+
function jn({ width: e, height: t, isEditorReady: r, loading: a, _ref: o, className: l, wrapperProps: f }) {
|
|
1868
|
+
return ce.createElement("section", { style: { ...Oe.wrapper, width: e, height: t }, ...f }, !r && ce.createElement(Sn, null, a), ce.createElement("div", { ref: o, style: { ...Oe.fullWidth, ...!r && Oe.hide }, className: l }));
|
|
1869
|
+
}
|
|
1870
|
+
var On = jn, Nt = We(On);
|
|
1871
|
+
function Pn(e) {
|
|
1458
1872
|
K(e, []);
|
|
1459
1873
|
}
|
|
1460
|
-
var
|
|
1461
|
-
function
|
|
1462
|
-
let
|
|
1463
|
-
K(
|
|
1464
|
-
|
|
1874
|
+
var kt = Pn;
|
|
1875
|
+
function En(e, t, r = !0) {
|
|
1876
|
+
let a = Y(!0);
|
|
1877
|
+
K(a.current || !r ? () => {
|
|
1878
|
+
a.current = !1;
|
|
1465
1879
|
} : e, t);
|
|
1466
1880
|
}
|
|
1467
|
-
var
|
|
1468
|
-
function
|
|
1881
|
+
var X = En;
|
|
1882
|
+
function de() {
|
|
1469
1883
|
}
|
|
1470
|
-
function
|
|
1471
|
-
return
|
|
1884
|
+
function oe(e, t, r, a) {
|
|
1885
|
+
return Ln(e, a) || Tn(e, t, r, a);
|
|
1472
1886
|
}
|
|
1473
|
-
function
|
|
1474
|
-
return e.editor.getModel(
|
|
1887
|
+
function Ln(e, t) {
|
|
1888
|
+
return e.editor.getModel($t(e, t));
|
|
1475
1889
|
}
|
|
1476
|
-
function
|
|
1477
|
-
return e.editor.createModel(t, r,
|
|
1890
|
+
function Tn(e, t, r, a) {
|
|
1891
|
+
return e.editor.createModel(t, r, a ? $t(e, a) : void 0);
|
|
1478
1892
|
}
|
|
1479
|
-
function
|
|
1893
|
+
function $t(e, t) {
|
|
1480
1894
|
return e.Uri.parse(t);
|
|
1481
1895
|
}
|
|
1482
|
-
function
|
|
1483
|
-
let [
|
|
1484
|
-
|
|
1485
|
-
let i =
|
|
1486
|
-
return i.then((
|
|
1487
|
-
}),
|
|
1488
|
-
if (b.current &&
|
|
1489
|
-
let i = b.current.getOriginalEditor(),
|
|
1490
|
-
|
|
1896
|
+
function _n({ original: e, modified: t, language: r, originalLanguage: a, modifiedLanguage: o, originalModelPath: l, modifiedModelPath: f, keepCurrentOriginalModel: g = !1, keepCurrentModifiedModel: y = !1, theme: k = "light", loading: p = "Loading...", options: v = {}, height: P = "100%", width: A = "100%", className: H, wrapperProps: T = {}, beforeMount: W = de, onMount: D = de }) {
|
|
1897
|
+
let [R, V] = _(!1), [j, E] = _(!0), b = Y(null), h = Y(null), z = Y(null), M = Y(D), x = Y(W), w = Y(!1);
|
|
1898
|
+
kt(() => {
|
|
1899
|
+
let i = wt.init();
|
|
1900
|
+
return i.then((c) => (h.current = c) && E(!1)).catch((c) => (c == null ? void 0 : c.type) !== "cancelation" && console.error("Monaco initialization: error:", c)), () => b.current ? d() : i.cancel();
|
|
1901
|
+
}), X(() => {
|
|
1902
|
+
if (b.current && h.current) {
|
|
1903
|
+
let i = b.current.getOriginalEditor(), c = oe(h.current, e || "", a || r || "text", l || "");
|
|
1904
|
+
c !== i.getModel() && i.setModel(c);
|
|
1491
1905
|
}
|
|
1492
|
-
}, [
|
|
1493
|
-
if (b.current &&
|
|
1494
|
-
let i = b.current.getModifiedEditor(),
|
|
1495
|
-
|
|
1906
|
+
}, [l], R), X(() => {
|
|
1907
|
+
if (b.current && h.current) {
|
|
1908
|
+
let i = b.current.getModifiedEditor(), c = oe(h.current, t || "", o || r || "text", f || "");
|
|
1909
|
+
c !== i.getModel() && i.setModel(c);
|
|
1496
1910
|
}
|
|
1497
|
-
}, [
|
|
1911
|
+
}, [f], R), X(() => {
|
|
1498
1912
|
let i = b.current.getModifiedEditor();
|
|
1499
|
-
i.getOption(
|
|
1500
|
-
}, [t],
|
|
1501
|
-
var i,
|
|
1502
|
-
(
|
|
1503
|
-
}, [e],
|
|
1504
|
-
let { original: i, modified:
|
|
1505
|
-
|
|
1506
|
-
}, [r,
|
|
1913
|
+
i.getOption(h.current.editor.EditorOption.readOnly) ? i.setValue(t || "") : t !== i.getValue() && (i.executeEdits("", [{ range: i.getModel().getFullModelRange(), text: t || "", forceMoveMarkers: !0 }]), i.pushUndoStop());
|
|
1914
|
+
}, [t], R), X(() => {
|
|
1915
|
+
var i, c;
|
|
1916
|
+
(c = (i = b.current) == null ? void 0 : i.getModel()) == null || c.original.setValue(e || "");
|
|
1917
|
+
}, [e], R), X(() => {
|
|
1918
|
+
let { original: i, modified: c } = b.current.getModel();
|
|
1919
|
+
h.current.editor.setModelLanguage(i, a || r || "text"), h.current.editor.setModelLanguage(c, o || r || "text");
|
|
1920
|
+
}, [r, a, o], R), X(() => {
|
|
1507
1921
|
var i;
|
|
1508
|
-
(i =
|
|
1509
|
-
}, [
|
|
1922
|
+
(i = h.current) == null || i.editor.setTheme(k);
|
|
1923
|
+
}, [k], R), X(() => {
|
|
1510
1924
|
var i;
|
|
1511
|
-
(i = b.current) == null || i.updateOptions(
|
|
1512
|
-
}, [
|
|
1513
|
-
let
|
|
1514
|
-
var
|
|
1515
|
-
if (!
|
|
1516
|
-
|
|
1517
|
-
let i =
|
|
1518
|
-
(
|
|
1519
|
-
}, [r, t,
|
|
1925
|
+
(i = b.current) == null || i.updateOptions(v);
|
|
1926
|
+
}, [v], R);
|
|
1927
|
+
let L = xe(() => {
|
|
1928
|
+
var m;
|
|
1929
|
+
if (!h.current) return;
|
|
1930
|
+
x.current(h.current);
|
|
1931
|
+
let i = oe(h.current, e || "", a || r || "text", l || ""), c = oe(h.current, t || "", o || r || "text", f || "");
|
|
1932
|
+
(m = b.current) == null || m.setModel({ original: i, modified: c });
|
|
1933
|
+
}, [r, t, o, e, a, l, f]), F = xe(() => {
|
|
1520
1934
|
var i;
|
|
1521
|
-
!
|
|
1522
|
-
}, [
|
|
1935
|
+
!w.current && z.current && (b.current = h.current.editor.createDiffEditor(z.current, { automaticLayout: !0, ...v }), L(), (i = h.current) == null || i.editor.setTheme(k), V(!0), w.current = !0);
|
|
1936
|
+
}, [v, k, L]);
|
|
1523
1937
|
K(() => {
|
|
1524
|
-
|
|
1525
|
-
}, [
|
|
1526
|
-
!
|
|
1527
|
-
}, [
|
|
1528
|
-
function
|
|
1529
|
-
var
|
|
1530
|
-
let i = (
|
|
1531
|
-
|
|
1938
|
+
R && M.current(b.current, h.current);
|
|
1939
|
+
}, [R]), K(() => {
|
|
1940
|
+
!j && !R && F();
|
|
1941
|
+
}, [j, R, F]);
|
|
1942
|
+
function d() {
|
|
1943
|
+
var c, m, u, C;
|
|
1944
|
+
let i = (c = b.current) == null ? void 0 : c.getModel();
|
|
1945
|
+
g || ((m = i == null ? void 0 : i.original) == null || m.dispose()), y || ((u = i == null ? void 0 : i.modified) == null || u.dispose()), (C = b.current) == null || C.dispose();
|
|
1532
1946
|
}
|
|
1533
|
-
return
|
|
1947
|
+
return ce.createElement(Nt, { width: A, height: P, isEditorReady: R, loading: p, _ref: z, className: H, wrapperProps: T });
|
|
1534
1948
|
}
|
|
1535
|
-
var
|
|
1536
|
-
|
|
1537
|
-
function
|
|
1949
|
+
var Dn = _n;
|
|
1950
|
+
We(Dn);
|
|
1951
|
+
function zn(e) {
|
|
1538
1952
|
let t = Y();
|
|
1539
1953
|
return K(() => {
|
|
1540
1954
|
t.current = e;
|
|
1541
1955
|
}, [e]), t.current;
|
|
1542
1956
|
}
|
|
1543
|
-
var
|
|
1544
|
-
function
|
|
1545
|
-
let [
|
|
1546
|
-
|
|
1547
|
-
let
|
|
1548
|
-
return
|
|
1549
|
-
}),
|
|
1550
|
-
var
|
|
1551
|
-
let
|
|
1552
|
-
|
|
1553
|
-
}, [
|
|
1554
|
-
var
|
|
1555
|
-
(
|
|
1556
|
-
}, [
|
|
1557
|
-
!
|
|
1558
|
-
}, [
|
|
1559
|
-
var
|
|
1560
|
-
let
|
|
1561
|
-
|
|
1562
|
-
}, [
|
|
1563
|
-
var
|
|
1564
|
-
|
|
1565
|
-
}, [
|
|
1566
|
-
var
|
|
1567
|
-
(
|
|
1568
|
-
}, [
|
|
1569
|
-
let
|
|
1570
|
-
var
|
|
1571
|
-
if (!(!
|
|
1572
|
-
|
|
1573
|
-
let
|
|
1574
|
-
|
|
1957
|
+
var An = zn, fe = /* @__PURE__ */ new Map();
|
|
1958
|
+
function Hn({ defaultValue: e, defaultLanguage: t, defaultPath: r, value: a, language: o, path: l, theme: f = "light", line: g, loading: y = "Loading...", options: k = {}, overrideServices: p = {}, saveViewState: v = !0, keepCurrentModel: P = !1, width: A = "100%", height: H = "100%", className: T, wrapperProps: W = {}, beforeMount: D = de, onMount: R = de, onChange: V, onValidate: j = de }) {
|
|
1959
|
+
let [E, b] = _(!1), [h, z] = _(!0), M = Y(null), x = Y(null), w = Y(null), L = Y(R), F = Y(D), d = Y(), i = Y(a), c = An(l), m = Y(!1), u = Y(!1);
|
|
1960
|
+
kt(() => {
|
|
1961
|
+
let N = wt.init();
|
|
1962
|
+
return N.then((S) => (M.current = S) && z(!1)).catch((S) => (S == null ? void 0 : S.type) !== "cancelation" && console.error("Monaco initialization: error:", S)), () => x.current ? O() : N.cancel();
|
|
1963
|
+
}), X(() => {
|
|
1964
|
+
var S, I, q, G;
|
|
1965
|
+
let N = oe(M.current, e || a || "", t || o || "", l || r || "");
|
|
1966
|
+
N !== ((S = x.current) == null ? void 0 : S.getModel()) && (v && fe.set(c, (I = x.current) == null ? void 0 : I.saveViewState()), (q = x.current) == null || q.setModel(N), v && ((G = x.current) == null || G.restoreViewState(fe.get(l))));
|
|
1967
|
+
}, [l], E), X(() => {
|
|
1968
|
+
var N;
|
|
1969
|
+
(N = x.current) == null || N.updateOptions(k);
|
|
1970
|
+
}, [k], E), X(() => {
|
|
1971
|
+
!x.current || a === void 0 || (x.current.getOption(M.current.editor.EditorOption.readOnly) ? x.current.setValue(a) : a !== x.current.getValue() && (u.current = !0, x.current.executeEdits("", [{ range: x.current.getModel().getFullModelRange(), text: a, forceMoveMarkers: !0 }]), x.current.pushUndoStop(), u.current = !1));
|
|
1972
|
+
}, [a], E), X(() => {
|
|
1973
|
+
var S, I;
|
|
1974
|
+
let N = (S = x.current) == null ? void 0 : S.getModel();
|
|
1975
|
+
N && o && ((I = M.current) == null || I.editor.setModelLanguage(N, o));
|
|
1976
|
+
}, [o], E), X(() => {
|
|
1977
|
+
var N;
|
|
1978
|
+
g !== void 0 && ((N = x.current) == null || N.revealLine(g));
|
|
1979
|
+
}, [g], E), X(() => {
|
|
1980
|
+
var N;
|
|
1981
|
+
(N = M.current) == null || N.editor.setTheme(f);
|
|
1982
|
+
}, [f], E);
|
|
1983
|
+
let C = xe(() => {
|
|
1984
|
+
var N;
|
|
1985
|
+
if (!(!w.current || !M.current) && !m.current) {
|
|
1986
|
+
F.current(M.current);
|
|
1987
|
+
let S = l || r, I = oe(M.current, a || e || "", t || o || "", S || "");
|
|
1988
|
+
x.current = (N = M.current) == null ? void 0 : N.editor.create(w.current, { model: I, automaticLayout: !0, ...k }, p), v && x.current.restoreViewState(fe.get(S)), M.current.editor.setTheme(f), g !== void 0 && x.current.revealLine(g), b(!0), m.current = !0;
|
|
1575
1989
|
}
|
|
1576
|
-
}, [e, t, r,
|
|
1990
|
+
}, [e, t, r, a, o, l, k, p, v, f, g]);
|
|
1577
1991
|
K(() => {
|
|
1578
|
-
|
|
1579
|
-
}, [
|
|
1580
|
-
!
|
|
1581
|
-
}, [
|
|
1582
|
-
var
|
|
1583
|
-
|
|
1584
|
-
|
|
1992
|
+
E && L.current(x.current, M.current);
|
|
1993
|
+
}, [E]), K(() => {
|
|
1994
|
+
!h && !E && C();
|
|
1995
|
+
}, [h, E, C]), i.current = a, K(() => {
|
|
1996
|
+
var N, S;
|
|
1997
|
+
E && V && ((N = d.current) == null || N.dispose(), d.current = (S = x.current) == null ? void 0 : S.onDidChangeModelContent((I) => {
|
|
1998
|
+
u.current || V(x.current.getValue(), I);
|
|
1585
1999
|
}));
|
|
1586
|
-
}, [
|
|
1587
|
-
if (
|
|
1588
|
-
let
|
|
1589
|
-
var
|
|
1590
|
-
let
|
|
1591
|
-
if (
|
|
1592
|
-
let
|
|
1593
|
-
|
|
2000
|
+
}, [E, V]), K(() => {
|
|
2001
|
+
if (E) {
|
|
2002
|
+
let N = M.current.editor.onDidChangeMarkers((S) => {
|
|
2003
|
+
var q;
|
|
2004
|
+
let I = (q = x.current.getModel()) == null ? void 0 : q.uri;
|
|
2005
|
+
if (I && S.find((G) => G.path === I.path)) {
|
|
2006
|
+
let G = M.current.editor.getModelMarkers({ resource: I });
|
|
2007
|
+
j == null || j(G);
|
|
1594
2008
|
}
|
|
1595
2009
|
});
|
|
1596
2010
|
return () => {
|
|
1597
|
-
|
|
2011
|
+
N == null || N.dispose();
|
|
1598
2012
|
};
|
|
1599
2013
|
}
|
|
1600
2014
|
return () => {
|
|
1601
2015
|
};
|
|
1602
|
-
}, [
|
|
1603
|
-
function
|
|
1604
|
-
var
|
|
1605
|
-
(
|
|
2016
|
+
}, [E, j]);
|
|
2017
|
+
function O() {
|
|
2018
|
+
var N, S;
|
|
2019
|
+
(N = d.current) == null || N.dispose(), P ? v && fe.set(l, x.current.saveViewState()) : (S = x.current.getModel()) == null || S.dispose(), x.current.dispose();
|
|
1606
2020
|
}
|
|
1607
|
-
return
|
|
1608
|
-
}
|
|
1609
|
-
var
|
|
1610
|
-
function ye({ title: e, children: t, placement: r = "top" }) {
|
|
1611
|
-
const [
|
|
1612
|
-
|
|
2021
|
+
return ce.createElement(Nt, { width: A, height: H, isEditorReady: E, loading: y, _ref: w, className: T, wrapperProps: W });
|
|
2022
|
+
}
|
|
2023
|
+
var In = Hn, Wn = We(In), Rn = Wn;
|
|
2024
|
+
function ye({ title: e, children: t, placement: r = "top", align: a = "center", variant: o = "default" }) {
|
|
2025
|
+
const [l, f] = _(!1), [g, y] = _(null), k = Y(null), p = Y(null), v = Y(void 0), P = Y(!1), A = Y(null), H = Ie(), T = () => {
|
|
2026
|
+
clearTimeout(v.current), P.current = !1, A.current = null, f(!1), y(null);
|
|
2027
|
+
}, W = () => {
|
|
2028
|
+
clearTimeout(v.current), f(!0);
|
|
2029
|
+
}, D = () => {
|
|
2030
|
+
clearTimeout(v.current), !P.current && (v.current = setTimeout(() => {
|
|
2031
|
+
P.current || T();
|
|
2032
|
+
}, 150));
|
|
2033
|
+
}, R = () => {
|
|
2034
|
+
o === "card" && (P.current = !0, W());
|
|
2035
|
+
}, V = (j) => {
|
|
2036
|
+
var E, b;
|
|
2037
|
+
return j instanceof Node && (((E = k.current) == null ? void 0 : E.contains(j)) || ((b = p.current) == null ? void 0 : b.contains(j)));
|
|
2038
|
+
};
|
|
2039
|
+
return K(() => () => clearTimeout(v.current), []), K(() => {
|
|
2040
|
+
if (!l) return;
|
|
2041
|
+
const j = (b) => {
|
|
2042
|
+
V(b.target) || T();
|
|
2043
|
+
}, E = (b) => {
|
|
2044
|
+
b.key === "Escape" && T();
|
|
2045
|
+
};
|
|
2046
|
+
return document.addEventListener("pointerdown", j), document.addEventListener("keydown", E), () => {
|
|
2047
|
+
document.removeEventListener("pointerdown", j), document.removeEventListener("keydown", E);
|
|
2048
|
+
};
|
|
2049
|
+
}, [l]), Mt(() => {
|
|
2050
|
+
if (!l || !e) return;
|
|
2051
|
+
const j = () => {
|
|
2052
|
+
const b = k.current, h = p.current;
|
|
2053
|
+
if (!b || !h) return;
|
|
2054
|
+
const z = 12, M = 6, x = b.getBoundingClientRect(), w = Math.max(0, x.top - z - M), L = Math.max(0, window.innerHeight - x.bottom - z - M), F = o === "card" ? 420 : 320;
|
|
2055
|
+
if (!A.current) {
|
|
2056
|
+
const m = o === "card" ? F : Math.min(F, h.getBoundingClientRect().height), u = r === "top" ? w >= m || w >= L : !(L >= m || L >= w);
|
|
2057
|
+
A.current = u ? "top" : "bottom";
|
|
2058
|
+
}
|
|
2059
|
+
const d = A.current === "top";
|
|
2060
|
+
h.style.maxHeight = `${Math.min(F, d ? w : L)}px`;
|
|
2061
|
+
const { width: i, height: c } = h.getBoundingClientRect();
|
|
2062
|
+
y({
|
|
2063
|
+
left: Math.max(z, Math.min(
|
|
2064
|
+
a === "end" ? x.right - i : x.left + (x.width - i) / 2,
|
|
2065
|
+
window.innerWidth - i - z
|
|
2066
|
+
)),
|
|
2067
|
+
top: d ? x.top - c - M : x.bottom + M
|
|
2068
|
+
});
|
|
2069
|
+
};
|
|
2070
|
+
j();
|
|
2071
|
+
const E = new ResizeObserver(j);
|
|
2072
|
+
return p.current && E.observe(p.current), window.addEventListener("resize", j), window.addEventListener("scroll", j, !0), () => {
|
|
2073
|
+
E.disconnect(), window.removeEventListener("resize", j), window.removeEventListener("scroll", j, !0);
|
|
2074
|
+
};
|
|
2075
|
+
}, [l, e, r, a, o]), e ? /* @__PURE__ */ s(
|
|
1613
2076
|
"div",
|
|
1614
2077
|
{
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
2078
|
+
ref: k,
|
|
2079
|
+
className: "inline-flex",
|
|
2080
|
+
"aria-describedby": l && o === "default" ? H : void 0,
|
|
2081
|
+
onMouseEnter: W,
|
|
2082
|
+
onMouseLeave: D,
|
|
2083
|
+
onPointerDown: R,
|
|
2084
|
+
onClick: () => {
|
|
2085
|
+
o === "default" && T();
|
|
2086
|
+
},
|
|
2087
|
+
onFocus: W,
|
|
2088
|
+
onBlur: (j) => {
|
|
2089
|
+
V(j.relatedTarget) || (j.relatedTarget ? T() : D());
|
|
2090
|
+
},
|
|
1618
2091
|
children: [
|
|
1619
2092
|
t,
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
2093
|
+
l && at(
|
|
2094
|
+
/* @__PURE__ */ n(
|
|
2095
|
+
"div",
|
|
2096
|
+
{
|
|
2097
|
+
ref: p,
|
|
2098
|
+
id: H,
|
|
2099
|
+
role: o === "card" ? "dialog" : "tooltip",
|
|
2100
|
+
"aria-label": o === "card" ? "校验问题" : void 0,
|
|
2101
|
+
className: `aisee-articles-tooltip aisee-articles-tooltip--${o}`,
|
|
2102
|
+
style: {
|
|
2103
|
+
width: o === "card" ? 480 : "max-content",
|
|
2104
|
+
maxWidth: "min(480px, calc(100vw - 24px))",
|
|
2105
|
+
overflowWrap: "anywhere",
|
|
2106
|
+
scrollbarWidth: "thin",
|
|
2107
|
+
left: (g == null ? void 0 : g.left) ?? 0,
|
|
2108
|
+
top: (g == null ? void 0 : g.top) ?? 0,
|
|
2109
|
+
visibility: g ? "visible" : "hidden"
|
|
2110
|
+
},
|
|
2111
|
+
onMouseEnter: W,
|
|
2112
|
+
onMouseLeave: D,
|
|
2113
|
+
onPointerDown: R,
|
|
2114
|
+
onFocus: W,
|
|
2115
|
+
children: e
|
|
2116
|
+
}
|
|
2117
|
+
),
|
|
2118
|
+
document.body
|
|
1626
2119
|
)
|
|
1627
2120
|
]
|
|
1628
2121
|
}
|
|
1629
|
-
) : /* @__PURE__ */
|
|
1630
|
-
}
|
|
1631
|
-
const
|
|
1632
|
-
{ key: "desktop", icon: /* @__PURE__ */
|
|
1633
|
-
{ key: "tablet", icon: /* @__PURE__ */
|
|
1634
|
-
{ key: "mobile", icon: /* @__PURE__ */
|
|
1635
|
-
],
|
|
1636
|
-
const { navigate: r, params:
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
},
|
|
1641
|
-
|
|
1642
|
-
|
|
2122
|
+
) : /* @__PURE__ */ n(ue, { children: t });
|
|
2123
|
+
}
|
|
2124
|
+
const Pe = [
|
|
2125
|
+
{ key: "desktop", icon: /* @__PURE__ */ n(dt, { size: 13 }), label: "桌面", width: null },
|
|
2126
|
+
{ key: "tablet", icon: /* @__PURE__ */ n(pt, { size: 13 }), label: "平板", width: 768 },
|
|
2127
|
+
{ key: "mobile", icon: /* @__PURE__ */ n(mt, { size: 13 }), label: "手机", width: 390 }
|
|
2128
|
+
], Kn = ({ id: e, record: t }) => {
|
|
2129
|
+
const { navigate: r, params: a, locationState: o } = Ve(), l = e ?? a.id, { basePath: f, service: g, previewBaseUrl: y, previewTailwind: k } = ve(), p = !!l, [v, P] = ft(), [A, H] = _(!1), [T, W] = _(t ?? (o == null ? void 0 : o.record) ?? null), [D, R] = _(""), [V, j] = _(p ? "" : "https://aisee.live"), [E, b] = _(""), [h, z] = _(""), [M, x] = _({
|
|
2130
|
+
navEnabled: !1,
|
|
2131
|
+
navname: "",
|
|
2132
|
+
navPlacements: []
|
|
2133
|
+
}), w = ($) => x({
|
|
2134
|
+
navEnabled: $.navEnabled ?? !1,
|
|
2135
|
+
navname: $.navname ?? "",
|
|
2136
|
+
navPlacements: $.navPlacements ?? []
|
|
2137
|
+
}), [L, F] = _(""), [d, i] = _("code"), [c, m] = _(!1), [u, C] = _("desktop"), [O, N] = _(!1), [S, I] = _(null), q = ($, Z) => {
|
|
2138
|
+
const U = y ? `<base href="${y}">` : "", Q = Z ? `<meta name="viewport" content="width=${Z}, initial-scale=1">` : "", ie = Z ? "<style>*,*::before,*::after{box-sizing:border-box}img,video,svg,canvas,audio{max-width:100%;height:auto}pre{white-space:pre-wrap;word-break:break-word;overflow-x:auto}table{display:block;max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}</style>" : "", Ne = k && !$.includes("cdn.tailwindcss.com") ? '<script src="https://cdn.tailwindcss.com"><\/script>' : "", ke = U + Q + ie + Ne;
|
|
2139
|
+
return ke ? $.includes("</head>") ? $.replace("</head>", `${ke}
|
|
2140
|
+
</head>`) : ke + $ : $;
|
|
2141
|
+
}, G = async () => {
|
|
2142
|
+
if (!L.trim()) {
|
|
2143
|
+
J.warning("请先输入 HTML 代码");
|
|
1643
2144
|
return;
|
|
1644
2145
|
}
|
|
1645
|
-
|
|
2146
|
+
N(!0), I(null);
|
|
1646
2147
|
try {
|
|
1647
|
-
const
|
|
1648
|
-
|
|
2148
|
+
const $ = await Ke(L);
|
|
2149
|
+
I($), $.networkError ? J.warning("W3C 校验服务不可用") : $.isValid && J.success("HTML 校验通过");
|
|
1649
2150
|
} finally {
|
|
1650
|
-
|
|
2151
|
+
N(!1);
|
|
1651
2152
|
}
|
|
1652
2153
|
};
|
|
1653
2154
|
K(() => {
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
}).catch((
|
|
1657
|
-
|
|
2155
|
+
p && (T ? (R(T.pathname || ""), j(T.host || ""), F(T.content || ""), w(T)) : g.getById(l).then(($) => {
|
|
2156
|
+
W($), R($.pathname || ""), j($.host || ""), F($.content || ""), w($);
|
|
2157
|
+
}).catch(($) => {
|
|
2158
|
+
J.error($.message || "获取文章失败"), r(f);
|
|
1658
2159
|
}));
|
|
1659
|
-
}, [
|
|
1660
|
-
const
|
|
1661
|
-
|
|
1662
|
-
|
|
2160
|
+
}, [l]);
|
|
2161
|
+
const ee = () => r(f), te = !D.trim(), ae = L.split(`
|
|
2162
|
+
`).length, re = async () => {
|
|
2163
|
+
if (A) return;
|
|
2164
|
+
if (!D.trim()) {
|
|
2165
|
+
z("请输入访问路径");
|
|
1663
2166
|
return;
|
|
1664
2167
|
}
|
|
1665
|
-
if (!
|
|
1666
|
-
|
|
2168
|
+
if (!L.trim()) {
|
|
2169
|
+
m(!0), J.error("请先输入 HTML 代码");
|
|
1667
2170
|
return;
|
|
1668
2171
|
}
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
2172
|
+
const $ = V.trim().replace(/\/+$/, "");
|
|
2173
|
+
try {
|
|
2174
|
+
const U = new URL($);
|
|
2175
|
+
if (!["http:", "https:"].includes(U.protocol) || U.search || U.hash || U.username || U.password) throw new Error();
|
|
2176
|
+
} catch {
|
|
2177
|
+
b("请输入有效的网站地址,需以 http:// 或 https:// 开头");
|
|
2178
|
+
return;
|
|
2179
|
+
}
|
|
2180
|
+
if (g.getNavigationGroups && M.navEnabled) {
|
|
2181
|
+
if (!M.navname.trim()) {
|
|
2182
|
+
J.error("开启导航后,请填写导航名称");
|
|
2183
|
+
return;
|
|
2184
|
+
}
|
|
2185
|
+
if (!M.navPlacements.length) {
|
|
2186
|
+
J.error("请至少选择一个展示位置");
|
|
2187
|
+
return;
|
|
2188
|
+
}
|
|
2189
|
+
}
|
|
2190
|
+
H(!0);
|
|
2191
|
+
const Z = await Ke(L);
|
|
2192
|
+
if (H(!1), Z.networkError)
|
|
2193
|
+
J.warning("W3C 校验服务不可用,已跳过校验");
|
|
2194
|
+
else if (!Z.isValid && !await new Promise((Q) => {
|
|
2195
|
+
v.confirm({
|
|
2196
|
+
title: "HTML 校验发现问题",
|
|
2197
|
+
content: /* @__PURE__ */ s("div", { className: "mt-1", children: [
|
|
2198
|
+
/* @__PURE__ */ n("p", { className: "text-gray-600 mb-2", children: "检测到以下 W3C 标准问题,仍要保存吗?" }),
|
|
2199
|
+
/* @__PURE__ */ s("ul", { className: "space-y-1", children: [
|
|
2200
|
+
Z.errors.slice(0, 5).map((ie, Ne) => /* @__PURE__ */ s(
|
|
1680
2201
|
"li",
|
|
1681
2202
|
{
|
|
1682
2203
|
className: "flex items-start gap-1.5 text-red-500 text-sm",
|
|
1683
2204
|
children: [
|
|
1684
|
-
/* @__PURE__ */
|
|
1685
|
-
/* @__PURE__ */
|
|
1686
|
-
|
|
1687
|
-
|
|
2205
|
+
/* @__PURE__ */ n("span", { className: "shrink-0", children: "✕" }),
|
|
2206
|
+
/* @__PURE__ */ s("span", { children: [
|
|
2207
|
+
ie.lastLine ? `第 ${ie.lastLine} 行:` : "",
|
|
2208
|
+
ie.message
|
|
1688
2209
|
] })
|
|
1689
2210
|
]
|
|
1690
2211
|
},
|
|
1691
|
-
|
|
2212
|
+
Ne
|
|
1692
2213
|
)),
|
|
1693
|
-
|
|
1694
|
-
"
|
|
1695
|
-
|
|
1696
|
-
"
|
|
2214
|
+
Z.errors.length > 5 && /* @__PURE__ */ s("li", { className: "text-gray-400 text-xs mt-1", children: [
|
|
2215
|
+
"另有 ",
|
|
2216
|
+
Z.errors.length - 5,
|
|
2217
|
+
" 个问题"
|
|
1697
2218
|
] })
|
|
1698
2219
|
] })
|
|
1699
2220
|
] }),
|
|
@@ -1704,400 +2225,413 @@ const Me = [
|
|
|
1704
2225
|
});
|
|
1705
2226
|
}))
|
|
1706
2227
|
return;
|
|
1707
|
-
|
|
2228
|
+
H(!0);
|
|
1708
2229
|
try {
|
|
1709
|
-
const
|
|
1710
|
-
pathname:
|
|
1711
|
-
content:
|
|
1712
|
-
host:
|
|
2230
|
+
const U = {
|
|
2231
|
+
pathname: D.trim(),
|
|
2232
|
+
content: L,
|
|
2233
|
+
host: $,
|
|
2234
|
+
...g.getNavigationGroups ? {
|
|
2235
|
+
navEnabled: M.navEnabled,
|
|
2236
|
+
navname: M.navname.trim() || null,
|
|
2237
|
+
navPlacements: M.navPlacements.map(({ position: Q, parentNavId: ie }) => ({
|
|
2238
|
+
position: Q,
|
|
2239
|
+
parentNavId: ie || null
|
|
2240
|
+
}))
|
|
2241
|
+
} : {}
|
|
1713
2242
|
};
|
|
1714
|
-
|
|
1715
|
-
} catch (
|
|
1716
|
-
|
|
2243
|
+
p && T ? (await g.update(T.id, U), J.success("编辑成功")) : (await g.create(U), J.success("新增成功")), r(f);
|
|
2244
|
+
} catch (U) {
|
|
2245
|
+
J.error(U.message || "保存失败");
|
|
1717
2246
|
} finally {
|
|
1718
|
-
|
|
2247
|
+
H(!1);
|
|
1719
2248
|
}
|
|
1720
2249
|
};
|
|
1721
|
-
return /* @__PURE__ */
|
|
1722
|
-
|
|
1723
|
-
/* @__PURE__ */
|
|
2250
|
+
return /* @__PURE__ */ s(ue, { children: [
|
|
2251
|
+
P,
|
|
2252
|
+
/* @__PURE__ */ s(
|
|
1724
2253
|
"div",
|
|
1725
2254
|
{
|
|
1726
2255
|
className: "w-full bg-white rounded-2xl shadow-sm border border-gray-100 overflow-hidden flex flex-col",
|
|
1727
2256
|
style: { height: "calc(100vh - 90px)" },
|
|
1728
2257
|
children: [
|
|
1729
|
-
/* @__PURE__ */
|
|
1730
|
-
/* @__PURE__ */
|
|
1731
|
-
/* @__PURE__ */
|
|
2258
|
+
/* @__PURE__ */ s("div", { className: "shrink-0 flex items-center justify-between px-6 py-4 border-b border-gray-100 bg-gray-50/60", children: [
|
|
2259
|
+
/* @__PURE__ */ s("div", { className: "flex items-center gap-3", children: [
|
|
2260
|
+
/* @__PURE__ */ n(
|
|
1732
2261
|
"button",
|
|
1733
2262
|
{
|
|
2263
|
+
"aria-label": "返回文章列表",
|
|
1734
2264
|
className: "flex items-center justify-center w-7 h-7 rounded-lg text-gray-400 hover:text-gray-700 hover:bg-gray-200 transition -ml-1 cursor-pointer",
|
|
1735
|
-
onClick:
|
|
1736
|
-
children: /* @__PURE__ */
|
|
2265
|
+
onClick: ee,
|
|
2266
|
+
children: /* @__PURE__ */ n(ot, { size: 15 })
|
|
1737
2267
|
}
|
|
1738
2268
|
),
|
|
1739
|
-
/* @__PURE__ */
|
|
1740
|
-
/* @__PURE__ */
|
|
1741
|
-
|
|
2269
|
+
/* @__PURE__ */ s("div", { children: [
|
|
2270
|
+
/* @__PURE__ */ n("div", { className: "text-base font-semibold text-gray-800 leading-tight", children: p ? "编辑文章" : "新增文章" }),
|
|
2271
|
+
p && T && /* @__PURE__ */ s("div", { className: "text-xs text-gray-400 mt-0.5 font-mono", children: [
|
|
1742
2272
|
"/",
|
|
1743
|
-
|
|
2273
|
+
T.pathname
|
|
1744
2274
|
] })
|
|
1745
2275
|
] })
|
|
1746
2276
|
] }),
|
|
1747
|
-
/* @__PURE__ */
|
|
1748
|
-
/* @__PURE__ */
|
|
2277
|
+
/* @__PURE__ */ s("div", { className: "flex items-center gap-2", children: [
|
|
2278
|
+
/* @__PURE__ */ n(
|
|
1749
2279
|
"button",
|
|
1750
2280
|
{
|
|
1751
2281
|
className: "px-4 py-1.5 border border-gray-200 rounded-lg text-sm text-gray-600 hover:bg-gray-50 transition cursor-pointer",
|
|
1752
|
-
onClick:
|
|
2282
|
+
onClick: ee,
|
|
1753
2283
|
children: "取消"
|
|
1754
2284
|
}
|
|
1755
2285
|
),
|
|
1756
|
-
/* @__PURE__ */
|
|
2286
|
+
/* @__PURE__ */ n(
|
|
1757
2287
|
"button",
|
|
1758
2288
|
{
|
|
1759
|
-
disabled:
|
|
2289
|
+
disabled: te || A,
|
|
1760
2290
|
className: "px-4 py-1.5 bg-blue-500 hover:bg-blue-600 text-white text-sm rounded-lg transition disabled:opacity-50 disabled:cursor-not-allowed cursor-pointer",
|
|
1761
|
-
onClick:
|
|
1762
|
-
children:
|
|
2291
|
+
onClick: re,
|
|
2292
|
+
children: A ? "保存中…" : "保存"
|
|
1763
2293
|
}
|
|
1764
2294
|
)
|
|
1765
2295
|
] })
|
|
1766
2296
|
] }),
|
|
1767
|
-
/* @__PURE__ */
|
|
1768
|
-
/* @__PURE__ */
|
|
1769
|
-
/* @__PURE__ */
|
|
1770
|
-
"
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
2297
|
+
/* @__PURE__ */ s("div", { className: "flex min-h-0 flex-1 flex-col overflow-y-auto", children: [
|
|
2298
|
+
/* @__PURE__ */ s("div", { className: "shrink-0 px-6 pt-5 pb-4 border-b border-gray-100", children: [
|
|
2299
|
+
/* @__PURE__ */ s("div", { className: "flex flex-col gap-4 sm:flex-row", children: [
|
|
2300
|
+
/* @__PURE__ */ s("div", { className: "flex-1", children: [
|
|
2301
|
+
/* @__PURE__ */ s("label", { className: "block text-sm font-medium text-gray-700 mb-1.5", children: [
|
|
2302
|
+
"访问路径",
|
|
2303
|
+
/* @__PURE__ */ n("span", { className: "text-xs text-gray-400 font-normal ml-1.5", children: "前台页面路径" })
|
|
2304
|
+
] }),
|
|
2305
|
+
/* @__PURE__ */ s(
|
|
2306
|
+
"div",
|
|
2307
|
+
{
|
|
2308
|
+
className: `flex items-center border rounded-lg transition focus-within:ring-2 focus-within:ring-blue-500/30 focus-within:border-blue-400 ${h ? "border-red-400 ring-2 ring-red-500/20" : "border-gray-200"}`,
|
|
2309
|
+
children: [
|
|
2310
|
+
/* @__PURE__ */ n("span", { className: "pl-3 text-gray-400 select-none text-sm shrink-0", children: "/" }),
|
|
2311
|
+
/* @__PURE__ */ n(
|
|
2312
|
+
"input",
|
|
2313
|
+
{
|
|
2314
|
+
className: "flex-1 pr-3 py-1.5 text-sm bg-transparent focus:outline-none",
|
|
2315
|
+
placeholder: "例如 about-us",
|
|
2316
|
+
value: D,
|
|
2317
|
+
onChange: ($) => {
|
|
2318
|
+
R($.target.value), h && z("");
|
|
2319
|
+
}
|
|
2320
|
+
}
|
|
2321
|
+
)
|
|
2322
|
+
]
|
|
2323
|
+
}
|
|
2324
|
+
),
|
|
2325
|
+
/* @__PURE__ */ n("p", { className: "text-xs text-gray-500 mt-1.5", children: "建议使用小写字母,不能包含空格,例如 about-us。" }),
|
|
2326
|
+
h && /* @__PURE__ */ n("p", { className: "text-red-500 text-xs mt-1", children: h })
|
|
2327
|
+
] }),
|
|
2328
|
+
/* @__PURE__ */ s("div", { className: "flex-1", children: [
|
|
2329
|
+
/* @__PURE__ */ s("label", { className: "block text-sm font-medium text-gray-700 mb-1.5", children: [
|
|
2330
|
+
"网站地址",
|
|
2331
|
+
/* @__PURE__ */ n("span", { className: "text-red-500 ml-1", children: "*" }),
|
|
2332
|
+
/* @__PURE__ */ n("span", { className: "text-xs text-gray-400 font-normal ml-1.5", children: "网站基础地址" })
|
|
2333
|
+
] }),
|
|
2334
|
+
/* @__PURE__ */ n(
|
|
2335
|
+
"input",
|
|
2336
|
+
{
|
|
2337
|
+
className: "w-full px-3 py-1.5 text-sm border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500/30 focus:border-blue-400 transition",
|
|
2338
|
+
placeholder: "例如 https://aisee.live",
|
|
2339
|
+
value: V,
|
|
2340
|
+
"aria-label": "网站地址",
|
|
2341
|
+
"aria-invalid": !!E,
|
|
2342
|
+
onChange: ($) => {
|
|
2343
|
+
const Z = $.target.value;
|
|
2344
|
+
Z.trim().replace(/\/+$/, "") !== V.trim().replace(/\/+$/, "") && x((U) => ({
|
|
2345
|
+
...U,
|
|
2346
|
+
navPlacements: U.navPlacements.map((Q) => ({ ...Q, parentNavId: null }))
|
|
2347
|
+
})), j(Z), b("");
|
|
1788
2348
|
}
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
O && /* @__PURE__ */ a("p", { className: "text-red-500 text-xs mt-1", children: O })
|
|
1794
|
-
] }),
|
|
1795
|
-
/* @__PURE__ */ l("div", { className: "flex-1", children: [
|
|
1796
|
-
/* @__PURE__ */ l("label", { className: "block text-sm font-medium text-gray-700 mb-1.5", children: [
|
|
1797
|
-
"Website URL",
|
|
1798
|
-
/* @__PURE__ */ a("span", { className: "text-xs text-gray-400 font-normal ml-1.5", children: "可跳转的网站地址" })
|
|
2349
|
+
}
|
|
2350
|
+
),
|
|
2351
|
+
E && /* @__PURE__ */ n("p", { role: "alert", className: "mt-1 text-xs text-red-500", children: E })
|
|
2352
|
+
] })
|
|
1799
2353
|
] }),
|
|
1800
|
-
/* @__PURE__ */
|
|
1801
|
-
|
|
2354
|
+
/* @__PURE__ */ n(
|
|
2355
|
+
Or,
|
|
1802
2356
|
{
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
value:
|
|
1806
|
-
onChange:
|
|
2357
|
+
host: V,
|
|
2358
|
+
service: g,
|
|
2359
|
+
value: M,
|
|
2360
|
+
onChange: x
|
|
1807
2361
|
}
|
|
1808
2362
|
)
|
|
1809
|
-
] })
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
2363
|
+
] }),
|
|
2364
|
+
/* @__PURE__ */ n("div", { className: "shrink-0 border-b border-gray-100 bg-gray-50/40", children: /* @__PURE__ */ s("div", { className: "flex flex-wrap items-center justify-between gap-2 px-6 py-2", children: [
|
|
2365
|
+
/* @__PURE__ */ n("div", { className: "flex items-center gap-3", children: /* @__PURE__ */ s("div", { className: "flex items-center bg-gray-100/80 rounded-lg p-0.5 gap-0.5 border border-gray-200/60", children: [
|
|
2366
|
+
/* @__PURE__ */ s(
|
|
2367
|
+
"button",
|
|
2368
|
+
{
|
|
2369
|
+
className: `flex items-center gap-1.5 px-3 py-1 rounded-md text-xs font-medium transition-all duration-150 select-none cursor-pointer ${d === "code" ? "bg-white text-gray-800 shadow-sm ring-1 ring-gray-200/50" : "text-gray-400 hover:text-gray-600 hover:bg-white/50"}`,
|
|
2370
|
+
onClick: () => i("code"),
|
|
2371
|
+
children: [
|
|
2372
|
+
/* @__PURE__ */ n(Ye, { size: 11 }),
|
|
2373
|
+
" 代码"
|
|
2374
|
+
]
|
|
2375
|
+
}
|
|
2376
|
+
),
|
|
2377
|
+
/* @__PURE__ */ s(
|
|
2378
|
+
"button",
|
|
2379
|
+
{
|
|
2380
|
+
className: `flex items-center gap-1.5 px-3 py-1 rounded-md text-xs font-medium transition-all duration-150 select-none ${d === "preview" ? "bg-white text-gray-800 shadow-sm ring-1 ring-gray-200/50 cursor-pointer" : L ? "text-gray-400 hover:text-gray-600 hover:bg-white/50 cursor-pointer" : "text-gray-300 cursor-not-allowed"}`,
|
|
2381
|
+
onClick: () => i("preview"),
|
|
2382
|
+
disabled: !L,
|
|
2383
|
+
children: [
|
|
2384
|
+
/* @__PURE__ */ n(_e, { size: 11 }),
|
|
2385
|
+
" 预览"
|
|
2386
|
+
]
|
|
2387
|
+
}
|
|
2388
|
+
)
|
|
2389
|
+
] }) }),
|
|
2390
|
+
d === "preview" && L && /* @__PURE__ */ n("div", { className: "flex items-center bg-gray-100/80 rounded-lg p-0.5 gap-0.5 border border-gray-200/60", children: Pe.map(($) => /* @__PURE__ */ n(ye, { title: $.label, children: /* @__PURE__ */ n(
|
|
1825
2391
|
"button",
|
|
1826
2392
|
{
|
|
1827
|
-
className: `flex items-center
|
|
1828
|
-
onClick: () =>
|
|
1829
|
-
|
|
1830
|
-
children: [
|
|
1831
|
-
/* @__PURE__ */ a(Pe, { size: 11 }),
|
|
1832
|
-
" 预览"
|
|
1833
|
-
]
|
|
2393
|
+
className: `flex items-center justify-center w-7 h-6 rounded-md text-xs transition-all duration-150 select-none cursor-pointer ${u === $.key ? "bg-white text-gray-800 shadow-sm ring-1 ring-gray-200/50" : "text-gray-400 hover:text-gray-600 hover:bg-white/50"}`,
|
|
2394
|
+
onClick: () => C($.key),
|
|
2395
|
+
children: $.icon
|
|
1834
2396
|
}
|
|
1835
|
-
)
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
d && !d.networkError && (d.isValid ? /* @__PURE__ */ l("span", { className: "flex items-center gap-1 px-2 py-0.5 rounded-full bg-green-50 border border-green-200 text-green-600 text-xs", children: [
|
|
1855
|
-
/* @__PURE__ */ a(We, { size: 11 }),
|
|
1856
|
-
" 校验通过"
|
|
1857
|
-
] }) : /* @__PURE__ */ a(
|
|
1858
|
-
ye,
|
|
1859
|
-
{
|
|
1860
|
-
title: /* @__PURE__ */ l("ul", { className: "m-0 pl-0 list-none space-y-1 max-w-xs", children: [
|
|
1861
|
-
d.errors.slice(0, 5).map(
|
|
1862
|
-
(h, _) => /* @__PURE__ */ l(
|
|
1863
|
-
"li",
|
|
1864
|
-
{
|
|
1865
|
-
className: "text-xs",
|
|
1866
|
-
children: [
|
|
1867
|
-
h.lastLine ? `第 ${h.lastLine} 行:` : "",
|
|
1868
|
-
h.message
|
|
1869
|
-
]
|
|
1870
|
-
},
|
|
1871
|
-
_
|
|
1872
|
-
)
|
|
1873
|
-
),
|
|
1874
|
-
d.errors.length > 5 && /* @__PURE__ */ l("li", { className: "text-gray-400 text-xs", children: [
|
|
1875
|
-
"还有",
|
|
1876
|
-
" ",
|
|
1877
|
-
d.errors.length - 5,
|
|
2397
|
+
) }, $.key)) }),
|
|
2398
|
+
d === "code" && /* @__PURE__ */ s("div", { className: "flex min-w-0 flex-wrap items-center gap-2", children: [
|
|
2399
|
+
L && /* @__PURE__ */ s("span", { className: "text-xs text-gray-400", children: [
|
|
2400
|
+
ae,
|
|
2401
|
+
" 行 · ",
|
|
2402
|
+
L.length,
|
|
2403
|
+
" 字符"
|
|
2404
|
+
] }),
|
|
2405
|
+
S && !S.networkError && (S.isValid ? /* @__PURE__ */ s("span", { className: "flex items-center gap-1 px-2 py-0.5 rounded-full bg-green-50 border border-green-200 text-green-600 text-xs", children: [
|
|
2406
|
+
/* @__PURE__ */ n(Ge, { size: 11 }),
|
|
2407
|
+
" 校验通过"
|
|
2408
|
+
] }) : /* @__PURE__ */ n(
|
|
2409
|
+
ye,
|
|
2410
|
+
{
|
|
2411
|
+
variant: "card",
|
|
2412
|
+
align: "end",
|
|
2413
|
+
title: /* @__PURE__ */ n(Er, { errors: S.errors, source: L }),
|
|
2414
|
+
children: /* @__PURE__ */ s("span", { tabIndex: 0, className: "flex items-center gap-1 px-2 py-0.5 rounded-full bg-red-50 border border-red-200 text-red-500 text-xs cursor-default", children: [
|
|
2415
|
+
"✕",
|
|
1878
2416
|
" ",
|
|
1879
|
-
|
|
2417
|
+
S.errors.length,
|
|
2418
|
+
" 个问题"
|
|
1880
2419
|
] })
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
"
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
2420
|
+
}
|
|
2421
|
+
)),
|
|
2422
|
+
/* @__PURE__ */ s(
|
|
2423
|
+
"button",
|
|
2424
|
+
{
|
|
2425
|
+
disabled: !L || O,
|
|
2426
|
+
className: "flex items-center gap-1.5 px-2.5 py-1 text-xs border border-gray-200 rounded-lg hover:bg-gray-50 text-gray-600 transition disabled:opacity-40 disabled:cursor-not-allowed cursor-pointer",
|
|
2427
|
+
onClick: G,
|
|
2428
|
+
children: [
|
|
2429
|
+
/* @__PURE__ */ n(Ge, { size: 12 }),
|
|
2430
|
+
O ? "校验中…" : "W3C 校验"
|
|
2431
|
+
]
|
|
2432
|
+
}
|
|
2433
|
+
)
|
|
2434
|
+
] })
|
|
2435
|
+
] }) }),
|
|
2436
|
+
/* @__PURE__ */ s("div", { className: "relative min-h-[320px] flex-1 shrink-0", children: [
|
|
2437
|
+
/* @__PURE__ */ n(
|
|
2438
|
+
"div",
|
|
1893
2439
|
{
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
2440
|
+
className: "absolute inset-0",
|
|
2441
|
+
style: {
|
|
2442
|
+
display: d === "code" ? "block" : "none",
|
|
2443
|
+
outline: c ? "2px solid #ff4d4f" : "none"
|
|
2444
|
+
},
|
|
2445
|
+
children: /* @__PURE__ */ n(
|
|
2446
|
+
Rn,
|
|
2447
|
+
{
|
|
2448
|
+
height: "100%",
|
|
2449
|
+
language: "html",
|
|
2450
|
+
theme: "vs-dark",
|
|
2451
|
+
value: L,
|
|
2452
|
+
onChange: ($) => {
|
|
2453
|
+
F($ ?? ""), c && m(!1), S && I(null);
|
|
2454
|
+
},
|
|
2455
|
+
options: {
|
|
2456
|
+
fontSize: 13,
|
|
2457
|
+
minimap: { enabled: !1 },
|
|
2458
|
+
wordWrap: "on",
|
|
2459
|
+
scrollBeyondLastLine: !1,
|
|
2460
|
+
automaticLayout: !0,
|
|
2461
|
+
tabSize: 2,
|
|
2462
|
+
formatOnPaste: !0,
|
|
2463
|
+
lineNumbers: "on",
|
|
2464
|
+
renderWhitespace: "none",
|
|
2465
|
+
smoothScrolling: !0,
|
|
2466
|
+
cursorBlinking: "smooth",
|
|
2467
|
+
padding: { top: 12, bottom: 12 }
|
|
2468
|
+
}
|
|
2469
|
+
}
|
|
2470
|
+
)
|
|
1901
2471
|
}
|
|
1902
|
-
)
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
2472
|
+
),
|
|
2473
|
+
d === "preview" && (L ? /* @__PURE__ */ n("div", { className: "absolute inset-0 overflow-auto bg-gray-100/60 flex justify-center", children: u !== "desktop" ? /* @__PURE__ */ n("div", { className: "flex flex-col items-center py-6 h-full", children: /* @__PURE__ */ n(
|
|
2474
|
+
"iframe",
|
|
2475
|
+
{
|
|
2476
|
+
srcDoc: q(
|
|
2477
|
+
L,
|
|
2478
|
+
Pe.find(
|
|
2479
|
+
($) => $.key === u
|
|
2480
|
+
).width
|
|
2481
|
+
),
|
|
2482
|
+
sandbox: "allow-same-origin allow-scripts",
|
|
2483
|
+
title: "HTML 预览",
|
|
2484
|
+
style: {
|
|
2485
|
+
width: `${Pe.find(
|
|
2486
|
+
($) => $.key === u
|
|
2487
|
+
).width}px`,
|
|
1917
2488
|
height: "100%",
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
options: {
|
|
1925
|
-
fontSize: 13,
|
|
1926
|
-
minimap: { enabled: !1 },
|
|
1927
|
-
wordWrap: "on",
|
|
1928
|
-
scrollBeyondLastLine: !1,
|
|
1929
|
-
automaticLayout: !0,
|
|
1930
|
-
tabSize: 2,
|
|
1931
|
-
formatOnPaste: !0,
|
|
1932
|
-
lineNumbers: "on",
|
|
1933
|
-
renderWhitespace: "none",
|
|
1934
|
-
smoothScrolling: !0,
|
|
1935
|
-
cursorBlinking: "smooth",
|
|
1936
|
-
padding: { top: 12, bottom: 12 }
|
|
1937
|
-
}
|
|
2489
|
+
minHeight: 0,
|
|
2490
|
+
border: "1px solid #e5e7eb",
|
|
2491
|
+
borderRadius: 10,
|
|
2492
|
+
background: "#fff",
|
|
2493
|
+
boxShadow: "0 4px 24px 0 rgba(0,0,0,0.10)",
|
|
2494
|
+
flexShrink: 0
|
|
1938
2495
|
}
|
|
1939
|
-
)
|
|
1940
|
-
}
|
|
1941
|
-
),
|
|
1942
|
-
L === "preview" && (w ? /* @__PURE__ */ a("div", { className: "absolute inset-0 overflow-auto bg-gray-100/60 flex justify-center", children: G !== "desktop" ? /* @__PURE__ */ a("div", { className: "flex flex-col items-center py-6 h-full", children: /* @__PURE__ */ a(
|
|
1943
|
-
"iframe",
|
|
1944
|
-
{
|
|
1945
|
-
srcDoc: v(
|
|
1946
|
-
w,
|
|
1947
|
-
Me.find(
|
|
1948
|
-
(h) => h.key === G
|
|
1949
|
-
).width
|
|
1950
|
-
),
|
|
1951
|
-
sandbox: "allow-same-origin allow-scripts",
|
|
1952
|
-
title: "HTML 预览",
|
|
1953
|
-
style: {
|
|
1954
|
-
width: `${Me.find(
|
|
1955
|
-
(h) => h.key === G
|
|
1956
|
-
).width}px`,
|
|
1957
|
-
height: "100%",
|
|
1958
|
-
minHeight: 0,
|
|
1959
|
-
border: "1px solid #e5e7eb",
|
|
1960
|
-
borderRadius: 10,
|
|
1961
|
-
background: "#fff",
|
|
1962
|
-
boxShadow: "0 4px 24px 0 rgba(0,0,0,0.10)",
|
|
1963
|
-
flexShrink: 0
|
|
1964
2496
|
}
|
|
1965
|
-
}
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
2497
|
+
) }) : /* @__PURE__ */ n(
|
|
2498
|
+
"iframe",
|
|
2499
|
+
{
|
|
2500
|
+
srcDoc: q(
|
|
2501
|
+
L
|
|
2502
|
+
),
|
|
2503
|
+
sandbox: "allow-same-origin allow-scripts",
|
|
2504
|
+
title: "HTML 预览",
|
|
2505
|
+
style: {
|
|
2506
|
+
width: "100%",
|
|
2507
|
+
height: "100%",
|
|
2508
|
+
border: "none",
|
|
2509
|
+
background: "#fff",
|
|
2510
|
+
display: "block"
|
|
2511
|
+
}
|
|
1980
2512
|
}
|
|
1981
|
-
}
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
] })
|
|
2513
|
+
) }) : /* @__PURE__ */ s("div", { className: "flex flex-col items-center justify-center h-full text-gray-300 gap-3 select-none", children: [
|
|
2514
|
+
/* @__PURE__ */ n(_e, { size: 36 }),
|
|
2515
|
+
/* @__PURE__ */ n("span", { className: "text-sm", children: "请先输入 HTML 代码以预览" })
|
|
2516
|
+
] }))
|
|
2517
|
+
] })
|
|
1986
2518
|
] })
|
|
1987
2519
|
]
|
|
1988
2520
|
}
|
|
1989
2521
|
)
|
|
1990
2522
|
] });
|
|
1991
|
-
},
|
|
1992
|
-
{ key: "desktop", icon: /* @__PURE__ */
|
|
1993
|
-
{ key: "tablet", icon: /* @__PURE__ */
|
|
1994
|
-
{ key: "mobile", icon: /* @__PURE__ */
|
|
1995
|
-
],
|
|
2523
|
+
}, Ee = [
|
|
2524
|
+
{ key: "desktop", icon: /* @__PURE__ */ n(dt, { size: 13 }), label: "Desktop", width: null },
|
|
2525
|
+
{ key: "tablet", icon: /* @__PURE__ */ n(pt, { size: 13 }), label: "Tablet", width: 768 },
|
|
2526
|
+
{ key: "mobile", icon: /* @__PURE__ */ n(mt, { size: 13 }), label: "Mobile", width: 390 }
|
|
2527
|
+
], Jn = ({
|
|
1996
2528
|
id: e,
|
|
1997
2529
|
record: t
|
|
1998
2530
|
}) => {
|
|
1999
|
-
const { navigate: r, params:
|
|
2000
|
-
t ?? (
|
|
2001
|
-
), [
|
|
2531
|
+
const { navigate: r, params: a, locationState: o } = Ve(), l = e ?? a.id, { basePath: f, service: g, previewBaseUrl: y, previewTailwind: k } = ve(), [p, v] = _(
|
|
2532
|
+
t ?? (o == null ? void 0 : o.record) ?? null
|
|
2533
|
+
), [P, A] = _(!1), [H, T] = _("preview"), [W, D] = _("desktop");
|
|
2002
2534
|
K(() => {
|
|
2003
|
-
!
|
|
2004
|
-
|
|
2005
|
-
}).finally(() =>
|
|
2006
|
-
}, [
|
|
2007
|
-
const
|
|
2008
|
-
|
|
2009
|
-
},
|
|
2010
|
-
const
|
|
2011
|
-
return
|
|
2012
|
-
</head>`) :
|
|
2535
|
+
!p && l && (A(!0), g.getById(l).then(v).catch((b) => {
|
|
2536
|
+
J.error(b.message || "获取数据失败"), r(f);
|
|
2537
|
+
}).finally(() => A(!1)));
|
|
2538
|
+
}, [l]);
|
|
2539
|
+
const R = () => r(f), V = () => r(`${f}/${l}/edit`, { state: { record: p } }), j = () => {
|
|
2540
|
+
p != null && p.content && (navigator.clipboard.writeText(p.content), J.success("已复制到剪贴板"));
|
|
2541
|
+
}, E = (b, h) => {
|
|
2542
|
+
const z = y ? `<base href="${y}">` : "", M = h ? `<meta name="viewport" content="width=${h}, initial-scale=1">` : "", x = h ? "<style>*,*::before,*::after{box-sizing:border-box}img,video,svg,canvas,audio{max-width:100%;height:auto}pre{white-space:pre-wrap;word-break:break-word;overflow-x:auto}table{display:block;max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}</style>" : "", w = k && !b.includes("cdn.tailwindcss.com") ? '<script src="https://cdn.tailwindcss.com"><\/script>' : "", L = z + M + x + w;
|
|
2543
|
+
return L ? b.includes("</head>") ? b.replace("</head>", `${L}
|
|
2544
|
+
</head>`) : L + b : b;
|
|
2013
2545
|
};
|
|
2014
|
-
return
|
|
2546
|
+
return P ? /* @__PURE__ */ n("div", { className: "flex items-center justify-center h-64 text-gray-400 text-sm", children: "加载中…" }) : /* @__PURE__ */ s(
|
|
2015
2547
|
"div",
|
|
2016
2548
|
{
|
|
2017
2549
|
className: "w-full bg-white rounded-2xl shadow-sm border border-gray-100 overflow-hidden flex flex-col",
|
|
2018
2550
|
style: { height: "calc(100vh - 90px)" },
|
|
2019
2551
|
children: [
|
|
2020
|
-
/* @__PURE__ */
|
|
2021
|
-
/* @__PURE__ */
|
|
2022
|
-
/* @__PURE__ */
|
|
2552
|
+
/* @__PURE__ */ s("div", { className: "flex items-center justify-between px-5 py-3.5 border-b border-gray-100 bg-white shrink-0", children: [
|
|
2553
|
+
/* @__PURE__ */ s("div", { className: "flex items-center gap-3 min-w-0", children: [
|
|
2554
|
+
/* @__PURE__ */ n(
|
|
2023
2555
|
"button",
|
|
2024
2556
|
{
|
|
2025
2557
|
className: "flex items-center justify-center w-7 h-7 rounded-lg text-gray-400 hover:text-gray-700 hover:bg-gray-100 transition -ml-1 shrink-0 cursor-pointer",
|
|
2026
|
-
onClick:
|
|
2027
|
-
children: /* @__PURE__ */
|
|
2558
|
+
onClick: R,
|
|
2559
|
+
children: /* @__PURE__ */ n(ot, { size: 15 })
|
|
2028
2560
|
}
|
|
2029
2561
|
),
|
|
2030
|
-
/* @__PURE__ */
|
|
2562
|
+
/* @__PURE__ */ n(
|
|
2031
2563
|
"div",
|
|
2032
2564
|
{
|
|
2033
2565
|
className: "flex items-center justify-center w-8 h-8 rounded-lg shrink-0",
|
|
2034
2566
|
style: {
|
|
2035
2567
|
background: "linear-gradient(135deg, #60a5fa, #818cf8)"
|
|
2036
2568
|
},
|
|
2037
|
-
children: /* @__PURE__ */
|
|
2569
|
+
children: /* @__PURE__ */ n(rr, { size: 13, className: "text-white" })
|
|
2038
2570
|
}
|
|
2039
2571
|
),
|
|
2040
|
-
/* @__PURE__ */
|
|
2041
|
-
/* @__PURE__ */
|
|
2042
|
-
/* @__PURE__ */
|
|
2043
|
-
/* @__PURE__ */
|
|
2572
|
+
/* @__PURE__ */ s("div", { className: "min-w-0", children: [
|
|
2573
|
+
/* @__PURE__ */ n("div", { className: "font-semibold text-gray-800 text-sm leading-tight", children: "Article 详情" }),
|
|
2574
|
+
/* @__PURE__ */ n("div", { className: "flex items-center gap-1 mt-0.5", children: /* @__PURE__ */ s("span", { className: "inline-flex items-center gap-1 px-1.5 py-0 rounded bg-blue-50 border border-blue-100 text-blue-600 font-mono text-xs leading-5 truncate max-w-[300px]", children: [
|
|
2575
|
+
/* @__PURE__ */ n(or, { size: 9 }),
|
|
2044
2576
|
"/",
|
|
2045
|
-
|
|
2577
|
+
p == null ? void 0 : p.pathname
|
|
2046
2578
|
] }) })
|
|
2047
2579
|
] })
|
|
2048
2580
|
] }),
|
|
2049
|
-
/* @__PURE__ */
|
|
2050
|
-
|
|
2581
|
+
/* @__PURE__ */ s("div", { className: "flex items-center gap-2 shrink-0", children: [
|
|
2582
|
+
H === "preview" && /* @__PURE__ */ n("div", { className: "flex items-center bg-gray-100/80 rounded-lg p-0.5 gap-0.5 border border-gray-200/60", children: Ee.map((b) => /* @__PURE__ */ n(ye, { title: b.label, children: /* @__PURE__ */ n(
|
|
2051
2583
|
"button",
|
|
2052
2584
|
{
|
|
2053
|
-
className: `flex items-center justify-center w-7 h-6 rounded-md text-xs transition-all duration-150 select-none cursor-pointer ${
|
|
2054
|
-
onClick: () =>
|
|
2585
|
+
className: `flex items-center justify-center w-7 h-6 rounded-md text-xs transition-all duration-150 select-none cursor-pointer ${W === b.key ? "bg-white text-gray-800 shadow-sm ring-1 ring-gray-200/50" : "text-gray-400 hover:text-gray-600 hover:bg-white/50"}`,
|
|
2586
|
+
onClick: () => D(b.key),
|
|
2055
2587
|
children: b.icon
|
|
2056
2588
|
}
|
|
2057
2589
|
) }, b.key)) }),
|
|
2058
|
-
/* @__PURE__ */
|
|
2590
|
+
/* @__PURE__ */ n("div", { className: "flex items-center bg-gray-100/80 rounded-lg p-0.5 gap-0.5 border border-gray-200/60", children: ["preview", "code"].map((b) => /* @__PURE__ */ n(
|
|
2059
2591
|
"button",
|
|
2060
2592
|
{
|
|
2061
|
-
className: `flex items-center gap-1.5 px-3 py-1 rounded-md text-xs font-medium transition-all duration-150 select-none cursor-pointer ${
|
|
2062
|
-
onClick: () =>
|
|
2063
|
-
children: b === "preview" ? /* @__PURE__ */
|
|
2064
|
-
/* @__PURE__ */
|
|
2593
|
+
className: `flex items-center gap-1.5 px-3 py-1 rounded-md text-xs font-medium transition-all duration-150 select-none cursor-pointer ${H === b ? "bg-white text-gray-800 shadow-sm ring-1 ring-gray-200/50" : "text-gray-400 hover:text-gray-600 hover:bg-white/50"}`,
|
|
2594
|
+
onClick: () => T(b),
|
|
2595
|
+
children: b === "preview" ? /* @__PURE__ */ s(ue, { children: [
|
|
2596
|
+
/* @__PURE__ */ n(_e, { size: 11 }),
|
|
2065
2597
|
" 预览"
|
|
2066
|
-
] }) : /* @__PURE__ */
|
|
2067
|
-
/* @__PURE__ */
|
|
2598
|
+
] }) : /* @__PURE__ */ s(ue, { children: [
|
|
2599
|
+
/* @__PURE__ */ n(Ye, { size: 11 }),
|
|
2068
2600
|
" Code"
|
|
2069
2601
|
] })
|
|
2070
2602
|
},
|
|
2071
2603
|
b
|
|
2072
2604
|
)) }),
|
|
2073
|
-
|
|
2605
|
+
H === "code" && /* @__PURE__ */ n(ye, { title: "复制代码", children: /* @__PURE__ */ n(
|
|
2074
2606
|
"button",
|
|
2075
2607
|
{
|
|
2608
|
+
type: "button",
|
|
2609
|
+
"aria-label": "复制代码",
|
|
2076
2610
|
className: "flex items-center justify-center w-7 h-7 rounded-lg text-gray-400 hover:text-blue-500 hover:bg-blue-50 transition cursor-pointer",
|
|
2077
|
-
onClick:
|
|
2078
|
-
children: /* @__PURE__ */
|
|
2611
|
+
onClick: j,
|
|
2612
|
+
children: /* @__PURE__ */ n(Jt, { size: 14 })
|
|
2079
2613
|
}
|
|
2080
2614
|
) })
|
|
2081
2615
|
] })
|
|
2082
2616
|
] }),
|
|
2083
|
-
/* @__PURE__ */
|
|
2617
|
+
/* @__PURE__ */ n(
|
|
2084
2618
|
"div",
|
|
2085
2619
|
{
|
|
2086
|
-
className: `flex-1 min-h-0 ${
|
|
2087
|
-
children:
|
|
2620
|
+
className: `flex-1 min-h-0 ${H === "preview" ? "bg-gray-100/70" : ""}`,
|
|
2621
|
+
children: H === "preview" ? /* @__PURE__ */ n("div", { className: "w-full h-full flex justify-center overflow-auto py-0", children: W !== "desktop" ? /* @__PURE__ */ n("div", { className: "flex flex-col items-center py-6 h-full", children: /* @__PURE__ */ n(
|
|
2088
2622
|
"iframe",
|
|
2089
2623
|
{
|
|
2090
|
-
srcDoc:
|
|
2091
|
-
(
|
|
2092
|
-
|
|
2093
|
-
(b) => b.key ===
|
|
2624
|
+
srcDoc: E(
|
|
2625
|
+
(p == null ? void 0 : p.content) || "",
|
|
2626
|
+
Ee.find(
|
|
2627
|
+
(b) => b.key === W
|
|
2094
2628
|
).width
|
|
2095
2629
|
),
|
|
2096
2630
|
sandbox: "allow-same-origin allow-scripts",
|
|
2097
2631
|
title: "HTML 预览",
|
|
2098
2632
|
style: {
|
|
2099
|
-
width: `${
|
|
2100
|
-
(b) => b.key ===
|
|
2633
|
+
width: `${Ee.find(
|
|
2634
|
+
(b) => b.key === W
|
|
2101
2635
|
).width}px`,
|
|
2102
2636
|
height: "100%",
|
|
2103
2637
|
minHeight: 0,
|
|
@@ -2108,11 +2642,11 @@ const Me = [
|
|
|
2108
2642
|
flexShrink: 0
|
|
2109
2643
|
}
|
|
2110
2644
|
}
|
|
2111
|
-
) }) : /* @__PURE__ */
|
|
2645
|
+
) }) : /* @__PURE__ */ n(
|
|
2112
2646
|
"iframe",
|
|
2113
2647
|
{
|
|
2114
|
-
srcDoc:
|
|
2115
|
-
(
|
|
2648
|
+
srcDoc: E(
|
|
2649
|
+
(p == null ? void 0 : p.content) || ""
|
|
2116
2650
|
),
|
|
2117
2651
|
sandbox: "allow-same-origin allow-scripts",
|
|
2118
2652
|
title: "HTML 预览",
|
|
@@ -2124,13 +2658,13 @@ const Me = [
|
|
|
2124
2658
|
display: "block"
|
|
2125
2659
|
}
|
|
2126
2660
|
}
|
|
2127
|
-
) }) : /* @__PURE__ */
|
|
2661
|
+
) }) : /* @__PURE__ */ s(
|
|
2128
2662
|
"div",
|
|
2129
2663
|
{
|
|
2130
2664
|
className: "h-full flex flex-col",
|
|
2131
2665
|
style: { background: "#1e1e2e" },
|
|
2132
2666
|
children: [
|
|
2133
|
-
/* @__PURE__ */
|
|
2667
|
+
/* @__PURE__ */ s(
|
|
2134
2668
|
"div",
|
|
2135
2669
|
{
|
|
2136
2670
|
className: "shrink-0 flex items-center justify-between px-4 py-2 border-b",
|
|
@@ -2139,13 +2673,13 @@ const Me = [
|
|
|
2139
2673
|
background: "#252536"
|
|
2140
2674
|
},
|
|
2141
2675
|
children: [
|
|
2142
|
-
/* @__PURE__ */
|
|
2143
|
-
/* @__PURE__ */
|
|
2144
|
-
/* @__PURE__ */
|
|
2145
|
-
/* @__PURE__ */
|
|
2146
|
-
/* @__PURE__ */
|
|
2676
|
+
/* @__PURE__ */ s("div", { className: "flex items-center gap-2", children: [
|
|
2677
|
+
/* @__PURE__ */ s("div", { className: "flex gap-1.5", children: [
|
|
2678
|
+
/* @__PURE__ */ n("span", { className: "w-3 h-3 rounded-full bg-red-400/80 inline-block" }),
|
|
2679
|
+
/* @__PURE__ */ n("span", { className: "w-3 h-3 rounded-full bg-yellow-400/80 inline-block" }),
|
|
2680
|
+
/* @__PURE__ */ n("span", { className: "w-3 h-3 rounded-full bg-green-400/80 inline-block" })
|
|
2147
2681
|
] }),
|
|
2148
|
-
/* @__PURE__ */
|
|
2682
|
+
/* @__PURE__ */ n(
|
|
2149
2683
|
"span",
|
|
2150
2684
|
{
|
|
2151
2685
|
className: "text-xs font-mono ml-2",
|
|
@@ -2154,24 +2688,24 @@ const Me = [
|
|
|
2154
2688
|
}
|
|
2155
2689
|
)
|
|
2156
2690
|
] }),
|
|
2157
|
-
/* @__PURE__ */
|
|
2691
|
+
/* @__PURE__ */ n(
|
|
2158
2692
|
"span",
|
|
2159
2693
|
{
|
|
2160
2694
|
className: "text-xs font-mono",
|
|
2161
2695
|
style: { color: "#6c7086" },
|
|
2162
|
-
children:
|
|
2163
|
-
`).length} 行 · ${
|
|
2696
|
+
children: p != null && p.content ? `${p.content.split(`
|
|
2697
|
+
`).length} 行 · ${p.content.length} 字符` : "空"
|
|
2164
2698
|
}
|
|
2165
2699
|
)
|
|
2166
2700
|
]
|
|
2167
2701
|
}
|
|
2168
2702
|
),
|
|
2169
|
-
/* @__PURE__ */
|
|
2703
|
+
/* @__PURE__ */ n("div", { className: "flex-1 overflow-auto", children: /* @__PURE__ */ n(
|
|
2170
2704
|
"pre",
|
|
2171
2705
|
{
|
|
2172
2706
|
className: "m-0 p-5 text-xs font-mono whitespace-pre-wrap break-all leading-relaxed",
|
|
2173
2707
|
style: { color: "#cdd6f4" },
|
|
2174
|
-
children: (
|
|
2708
|
+
children: (p == null ? void 0 : p.content) || /* @__PURE__ */ n("span", { style: { color: "#585b70" }, children: "// 暂无内容" })
|
|
2175
2709
|
}
|
|
2176
2710
|
) })
|
|
2177
2711
|
]
|
|
@@ -2179,26 +2713,26 @@ const Me = [
|
|
|
2179
2713
|
)
|
|
2180
2714
|
}
|
|
2181
2715
|
),
|
|
2182
|
-
/* @__PURE__ */
|
|
2183
|
-
/* @__PURE__ */
|
|
2184
|
-
(
|
|
2716
|
+
/* @__PURE__ */ s("div", { className: "shrink-0 flex items-center justify-between px-5 py-2.5 border-t border-gray-100 bg-gray-50/60", children: [
|
|
2717
|
+
/* @__PURE__ */ s("div", { className: "flex items-center gap-4 text-xs text-gray-400", children: [
|
|
2718
|
+
(p == null ? void 0 : p.createdAt) && /* @__PURE__ */ s("span", { children: [
|
|
2185
2719
|
"创建于",
|
|
2186
2720
|
" ",
|
|
2187
|
-
De(
|
|
2721
|
+
De(p.createdAt).format("YYYY/MM/DD HH:mm")
|
|
2188
2722
|
] }),
|
|
2189
|
-
(
|
|
2723
|
+
(p == null ? void 0 : p.updatedAt) && /* @__PURE__ */ s("span", { children: [
|
|
2190
2724
|
"更新于",
|
|
2191
2725
|
" ",
|
|
2192
|
-
De(
|
|
2726
|
+
De(p.updatedAt).format("YYYY/MM/DD HH:mm")
|
|
2193
2727
|
] })
|
|
2194
2728
|
] }),
|
|
2195
|
-
/* @__PURE__ */
|
|
2729
|
+
/* @__PURE__ */ s(
|
|
2196
2730
|
"button",
|
|
2197
2731
|
{
|
|
2198
2732
|
className: "flex items-center gap-1.5 px-3 py-1.5 text-xs border border-gray-200 rounded-lg hover:bg-gray-50 text-gray-600 transition cursor-pointer",
|
|
2199
|
-
onClick:
|
|
2733
|
+
onClick: V,
|
|
2200
2734
|
children: [
|
|
2201
|
-
/* @__PURE__ */
|
|
2735
|
+
/* @__PURE__ */ n(hr, { size: 12 }),
|
|
2202
2736
|
"编辑"
|
|
2203
2737
|
]
|
|
2204
2738
|
}
|
|
@@ -2209,12 +2743,13 @@ const Me = [
|
|
|
2209
2743
|
);
|
|
2210
2744
|
};
|
|
2211
2745
|
export {
|
|
2212
|
-
|
|
2213
|
-
|
|
2214
|
-
|
|
2215
|
-
|
|
2216
|
-
|
|
2217
|
-
|
|
2218
|
-
|
|
2219
|
-
|
|
2746
|
+
Jn as ArticleDetail,
|
|
2747
|
+
Kn as ArticleEdit,
|
|
2748
|
+
Zn as ArticleList,
|
|
2749
|
+
ea as ArticleServiceError,
|
|
2750
|
+
Un as ArticlesProvider,
|
|
2751
|
+
Gn as ReactRouterAdapter,
|
|
2752
|
+
ta as createArticleService,
|
|
2753
|
+
Ct as defaultArticleService,
|
|
2754
|
+
ra as renderArticleByPathname
|
|
2220
2755
|
};
|