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