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