@ququ-jiaxk/dsh-plugin-center 0.1.43 → 0.1.44
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/lib/client.js +195 -19
- package/lib/index.js +1 -0
- package/logo.svg +15 -0
- package/package.json +4 -2
package/lib/client.js
CHANGED
|
@@ -24,13 +24,19 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
24
24
|
// src/client.tsx
|
|
25
25
|
var client_exports = {};
|
|
26
26
|
__export(client_exports, {
|
|
27
|
+
__testMarkdown: () => __testMarkdown,
|
|
27
28
|
apply: () => apply,
|
|
28
29
|
inject: () => inject
|
|
29
30
|
});
|
|
30
31
|
module.exports = __toCommonJS(client_exports);
|
|
31
32
|
var import_react = require("react");
|
|
33
|
+
|
|
34
|
+
// logo.svg
|
|
35
|
+
var logo_default = 'data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" width="64" height="64">%0A <defs>%0A <linearGradient id="g" x1="8" y1="4" x2="56" y2="60" gradientUnits="userSpaceOnUse">%0A <stop stop-color="%232E9BFF" />%0A <stop offset="0.55" stop-color="%230071E3" />%0A <stop offset="1" stop-color="%235E5CE6" />%0A </linearGradient>%0A </defs>%0A <rect width="64" height="64" rx="16" fill="url(%23g)" />%0A <g fill="none" stroke="%23fff" stroke-width="4.5" stroke-linecap="round">%0A <path d="M24 17v9M40 17v9" />%0A <path d="M19 28h26v7.5C45 43 39.2 48 32 48s-13-5-13-12.5V28Z" />%0A </g>%0A <circle cx="32" cy="55" r="2.5" fill="%23fff" opacity=".75" />%0A</svg>%0A';
|
|
36
|
+
|
|
37
|
+
// src/client.tsx
|
|
32
38
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
33
|
-
var PLUGIN_VERSION = true ? "0.1.
|
|
39
|
+
var PLUGIN_VERSION = true ? "0.1.44" : "0.0.0";
|
|
34
40
|
var PANEL_ID = "plugin-center";
|
|
35
41
|
var inject = ["slots", "remote", "remote.pluginManager"];
|
|
36
42
|
var hostCtx = null;
|
|
@@ -155,15 +161,13 @@ function apply(ctx) {
|
|
|
155
161
|
});
|
|
156
162
|
startSelfUpdateWatcher();
|
|
157
163
|
}
|
|
164
|
+
function BrandMark() {
|
|
165
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "pcx-logo", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", { src: logo_default, alt: "" }) });
|
|
166
|
+
}
|
|
158
167
|
function PanelIcon({ size = 16 }) {
|
|
159
168
|
const { latest } = useSelfUpdateInfo();
|
|
160
169
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: "pcx-sidebar-icon", children: [
|
|
161
|
-
/* @__PURE__ */ (0, import_jsx_runtime.
|
|
162
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("rect", { x: "1.75", y: "1.75", width: "5", height: "5", rx: "1.2", stroke: "currentColor", strokeWidth: "1.3" }),
|
|
163
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("rect", { x: "9.25", y: "1.75", width: "5", height: "5", rx: "1.2", stroke: "currentColor", strokeWidth: "1.3" }),
|
|
164
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("rect", { x: "1.75", y: "9.25", width: "5", height: "5", rx: "1.2", stroke: "currentColor", strokeWidth: "1.3" }),
|
|
165
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M11.75 9.5v4.25M9.63 11.63h4.25", stroke: "currentColor", strokeWidth: "1.3", strokeLinecap: "round" })
|
|
166
|
-
] }),
|
|
170
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", { className: "pcx-sidebar-logo", src: logo_default, width: size, height: size, alt: "" }),
|
|
167
171
|
latest ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "pcx-sidebar-dot", "aria-hidden": "true" }) : null
|
|
168
172
|
] });
|
|
169
173
|
}
|
|
@@ -184,6 +188,158 @@ function isNewer(latest, installed) {
|
|
|
184
188
|
if (!a.pre && b.pre) return true;
|
|
185
189
|
return false;
|
|
186
190
|
}
|
|
191
|
+
function escapeHtml(value) {
|
|
192
|
+
return value.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
193
|
+
}
|
|
194
|
+
function safeLinkUrl(url) {
|
|
195
|
+
const value = url.trim();
|
|
196
|
+
return /^(https?:|mailto:)/iu.test(value) ? value : null;
|
|
197
|
+
}
|
|
198
|
+
function safeImageUrl(url) {
|
|
199
|
+
const value = url.trim();
|
|
200
|
+
return /^(https?:\/\/|data:image\/)/iu.test(value) ? value : null;
|
|
201
|
+
}
|
|
202
|
+
function renderInline(raw) {
|
|
203
|
+
let text = escapeHtml(String(raw ?? ""));
|
|
204
|
+
const codes = [];
|
|
205
|
+
text = text.replace(/`([^`]+)`/gu, (_match, code) => {
|
|
206
|
+
codes.push(code);
|
|
207
|
+
return `@@CODE${codes.length - 1}@@`;
|
|
208
|
+
});
|
|
209
|
+
text = text.replace(
|
|
210
|
+
/!\[([^\]]*)\]\(([^)\s]+)(?:\s+"[^&]*?")?\)/gu,
|
|
211
|
+
(_match, alt, url) => {
|
|
212
|
+
const src = safeImageUrl(url);
|
|
213
|
+
return src ? `<img src="${src}" alt="${alt}" loading="lazy">` : alt;
|
|
214
|
+
}
|
|
215
|
+
);
|
|
216
|
+
text = text.replace(
|
|
217
|
+
/\[([^\]]+)\]\(([^)\s]+)(?:\s+"[^&]*?")?\)/gu,
|
|
218
|
+
(_match, label, url) => {
|
|
219
|
+
const href = safeLinkUrl(url);
|
|
220
|
+
return href ? `<a href="${href}" target="_blank" rel="noopener noreferrer">${label}</a>` : label;
|
|
221
|
+
}
|
|
222
|
+
);
|
|
223
|
+
text = text.replace(/\*\*([^*]+)\*\*/gu, "<strong>$1</strong>");
|
|
224
|
+
text = text.replace(/__([^_]+)__/gu, "<strong>$1</strong>");
|
|
225
|
+
text = text.replace(/(^|[^*])\*([^*\n]+)\*/gu, "$1<em>$2</em>");
|
|
226
|
+
text = text.replace(/~~([^~]+)~~/gu, "<del>$1</del>");
|
|
227
|
+
text = text.replace(/@@CODE(\d+)@@/gu, (_match, index) => {
|
|
228
|
+
return `<code>${escapeHtml(codes[Number(index)] ?? "")}</code>`;
|
|
229
|
+
});
|
|
230
|
+
return text;
|
|
231
|
+
}
|
|
232
|
+
function renderMarkdown(source) {
|
|
233
|
+
const lines = String(source ?? "").replace(/\r\n?/gu, "\n").split("\n");
|
|
234
|
+
const out = [];
|
|
235
|
+
let index = 0;
|
|
236
|
+
let paragraph = [];
|
|
237
|
+
let list = null;
|
|
238
|
+
const flushParagraph = () => {
|
|
239
|
+
if (paragraph.length === 0) return;
|
|
240
|
+
out.push(`<p>${paragraph.map((line) => renderInline(line)).join("<br>")}</p>`);
|
|
241
|
+
paragraph = [];
|
|
242
|
+
};
|
|
243
|
+
const closeList = () => {
|
|
244
|
+
if (list === null) return;
|
|
245
|
+
out.push(`</${list}>`);
|
|
246
|
+
list = null;
|
|
247
|
+
};
|
|
248
|
+
const flush = () => {
|
|
249
|
+
flushParagraph();
|
|
250
|
+
closeList();
|
|
251
|
+
};
|
|
252
|
+
while (index < lines.length) {
|
|
253
|
+
const line = lines[index];
|
|
254
|
+
const trimmed = line.trim();
|
|
255
|
+
if (trimmed.startsWith("```")) {
|
|
256
|
+
flush();
|
|
257
|
+
const language = trimmed.slice(3).trim();
|
|
258
|
+
const code = [];
|
|
259
|
+
index += 1;
|
|
260
|
+
while (index < lines.length && !lines[index].trim().startsWith("```")) {
|
|
261
|
+
code.push(lines[index]);
|
|
262
|
+
index += 1;
|
|
263
|
+
}
|
|
264
|
+
index += 1;
|
|
265
|
+
out.push(
|
|
266
|
+
`<pre class="pcx-md-pre"><code${language ? ` class="language-${escapeHtml(language)}"` : ""}>${escapeHtml(
|
|
267
|
+
code.join("\n")
|
|
268
|
+
)}</code></pre>`
|
|
269
|
+
);
|
|
270
|
+
continue;
|
|
271
|
+
}
|
|
272
|
+
if (!trimmed) {
|
|
273
|
+
flush();
|
|
274
|
+
index += 1;
|
|
275
|
+
continue;
|
|
276
|
+
}
|
|
277
|
+
const heading = /^(#{1,6})\s+(.*)$/u.exec(trimmed);
|
|
278
|
+
if (heading) {
|
|
279
|
+
flush();
|
|
280
|
+
const level = heading[1].length;
|
|
281
|
+
out.push(`<h${level}>${renderInline(heading[2])}</h${level}>`);
|
|
282
|
+
index += 1;
|
|
283
|
+
continue;
|
|
284
|
+
}
|
|
285
|
+
if (/^(-{3,}|\*{3,}|_{3,})$/u.test(trimmed)) {
|
|
286
|
+
flush();
|
|
287
|
+
out.push("<hr>");
|
|
288
|
+
index += 1;
|
|
289
|
+
continue;
|
|
290
|
+
}
|
|
291
|
+
if (/^>\s?/u.test(trimmed)) {
|
|
292
|
+
flush();
|
|
293
|
+
const quote = [];
|
|
294
|
+
while (index < lines.length && /^>\s?/u.test(lines[index].trim())) {
|
|
295
|
+
quote.push(lines[index].trim().replace(/^>\s?/u, ""));
|
|
296
|
+
index += 1;
|
|
297
|
+
}
|
|
298
|
+
out.push(`<blockquote>${quote.map((item) => renderInline(item)).join("<br>")}</blockquote>`);
|
|
299
|
+
continue;
|
|
300
|
+
}
|
|
301
|
+
if (trimmed.startsWith("|") && index + 1 < lines.length && /^\|?[\s:|-]+\|?$/u.test(lines[index + 1].trim()) && lines[index + 1].includes("-")) {
|
|
302
|
+
flush();
|
|
303
|
+
const cellsOf = (row) => {
|
|
304
|
+
return row.trim().replace(/^\|/u, "").replace(/\|$/u, "").split("|").map((cell) => cell.trim());
|
|
305
|
+
};
|
|
306
|
+
const rows = [cellsOf(trimmed)];
|
|
307
|
+
index += 2;
|
|
308
|
+
while (index < lines.length && lines[index].trim().startsWith("|")) {
|
|
309
|
+
rows.push(cellsOf(lines[index].trim()));
|
|
310
|
+
index += 1;
|
|
311
|
+
}
|
|
312
|
+
const head = rows.shift() ?? [];
|
|
313
|
+
out.push(
|
|
314
|
+
`<table class="pcx-md-table"><thead><tr>${head.map((cell) => `<th>${renderInline(cell)}</th>`).join("")}</tr></thead><tbody>${rows.map((row) => `<tr>${row.map((cell) => `<td>${renderInline(cell)}</td>`).join("")}</tr>`).join("")}</tbody></table>`
|
|
315
|
+
);
|
|
316
|
+
continue;
|
|
317
|
+
}
|
|
318
|
+
const unordered = /^[-*+]\s+(.*)$/u.exec(trimmed);
|
|
319
|
+
const ordered = /^\d+[.)]\s+(.*)$/u.exec(trimmed);
|
|
320
|
+
if (unordered || ordered) {
|
|
321
|
+
flushParagraph();
|
|
322
|
+
const kind = unordered ? "ul" : "ol";
|
|
323
|
+
if (list !== kind) {
|
|
324
|
+
closeList();
|
|
325
|
+
out.push(`<${kind}>`);
|
|
326
|
+
list = kind;
|
|
327
|
+
}
|
|
328
|
+
out.push(`<li>${renderInline((unordered ?? ordered)[1])}</li>`);
|
|
329
|
+
index += 1;
|
|
330
|
+
continue;
|
|
331
|
+
}
|
|
332
|
+
closeList();
|
|
333
|
+
paragraph.push(line);
|
|
334
|
+
index += 1;
|
|
335
|
+
}
|
|
336
|
+
flush();
|
|
337
|
+
return out.join("\n");
|
|
338
|
+
}
|
|
339
|
+
function Markdown({ text }) {
|
|
340
|
+
const html = (0, import_react.useMemo)(() => renderMarkdown(text), [text]);
|
|
341
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "pcx-md", dangerouslySetInnerHTML: { __html: html } });
|
|
342
|
+
}
|
|
187
343
|
function Badges({ plugin }) {
|
|
188
344
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
189
345
|
plugin.visibility === "private" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "pcx-badge pcx-badge-private", children: "\u79C1\u6709" }) : null,
|
|
@@ -268,7 +424,7 @@ function LocalDetailView({
|
|
|
268
424
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "pcx-root", children: [
|
|
269
425
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("a", { className: "pcx-back", onClick: onBack, children: "\u2190 \u8FD4\u56DE\u5217\u8868" }),
|
|
270
426
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "pcx-detail-head", children: [
|
|
271
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "pcx-icon pcx-icon-lg", children: iconLetter(bundle.displayName ?? bundle.name) }),
|
|
427
|
+
bundle.icon ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", { className: "pcx-detail-icon", src: bundle.icon, alt: "" }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "pcx-icon pcx-icon-lg", children: iconLetter(bundle.displayName ?? bundle.name) }),
|
|
272
428
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "pcx-detail-titles", children: [
|
|
273
429
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "pcx-row", children: [
|
|
274
430
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("h1", { className: "pcx-title", children: bundle.displayName ?? bundle.name }),
|
|
@@ -292,7 +448,7 @@ function LocalDetailView({
|
|
|
292
448
|
] }),
|
|
293
449
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("section", { className: "pcx-section", children: [
|
|
294
450
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("h2", { className: "pcx-h2", children: "\u63D2\u4EF6\u8BE6\u60C5" }),
|
|
295
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
451
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Markdown, { text: markdown || bundle.description || "\u8FD9\u4E2A\u63D2\u4EF6\u6CA1\u6709\u63D0\u4F9B README \u6216 locale \u8BE6\u60C5\u3002" })
|
|
296
452
|
] }),
|
|
297
453
|
origin ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("section", { className: "pcx-section", children: [
|
|
298
454
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("h2", { className: "pcx-h2", children: "\u8BE6\u60C5\u6765\u6E90" }),
|
|
@@ -921,7 +1077,7 @@ function Panel() {
|
|
|
921
1077
|
children: [
|
|
922
1078
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("header", { className: "pcx-header", children: [
|
|
923
1079
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "pcx-brand", children: [
|
|
924
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
1080
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(BrandMark, {}),
|
|
925
1081
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [
|
|
926
1082
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("h1", { className: "pcx-title", children: [
|
|
927
1083
|
"\u5C0F\u8DA3\u63D2\u4EF6\u4E2D\u5FC3",
|
|
@@ -1250,7 +1406,7 @@ function UploadView({
|
|
|
1250
1406
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "pcx-root", children: [
|
|
1251
1407
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("header", { className: "pcx-header", children: [
|
|
1252
1408
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "pcx-brand", children: [
|
|
1253
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
1409
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(BrandMark, {}),
|
|
1254
1410
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [
|
|
1255
1411
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("h1", { className: "pcx-title", children: "\u4E0A\u4F20\u63D2\u4EF6" }),
|
|
1256
1412
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "pcx-sub", children: "\u6B63\u5728\u8BFB\u53D6\u767B\u5F55\u72B6\u6001\u2026" })
|
|
@@ -1265,7 +1421,7 @@ function UploadView({
|
|
|
1265
1421
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "pcx-root", children: [
|
|
1266
1422
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("header", { className: "pcx-header", children: [
|
|
1267
1423
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "pcx-brand", children: [
|
|
1268
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
1424
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(BrandMark, {}),
|
|
1269
1425
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [
|
|
1270
1426
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("h1", { className: "pcx-title", children: "\u4E0A\u4F20\u63D2\u4EF6" }),
|
|
1271
1427
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "pcx-sub", children: "\u767B\u5F55\u540E\u5373\u53EF\u53D1\u5E03\u63D2\u4EF6" })
|
|
@@ -1343,7 +1499,7 @@ function UploadView({
|
|
|
1343
1499
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "pcx-root", children: [
|
|
1344
1500
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("header", { className: "pcx-header", children: [
|
|
1345
1501
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "pcx-brand", children: [
|
|
1346
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
1502
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(BrandMark, {}),
|
|
1347
1503
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [
|
|
1348
1504
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("h1", { className: "pcx-title", children: "\u4E0A\u4F20\u63D2\u4EF6" }),
|
|
1349
1505
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "pcx-sub", children: "\u5FC5\u586B\uFF1A\u5305\u540D\u3001\u540D\u79F0\u3001\u63CF\u8FF0\u3001\u4F7F\u7528\u65B9\u6CD5\u3001\u5305\u6587\u4EF6\u3001\u7248\u672C\u53F7" })
|
|
@@ -1805,11 +1961,11 @@ function DetailView({
|
|
|
1805
1961
|
notice ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "pcx-alert pcx-alert-success", children: notice }) : null,
|
|
1806
1962
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("section", { className: "pcx-section", children: [
|
|
1807
1963
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("h2", { className: "pcx-h2", children: "\u63D2\u4EF6\u63CF\u8FF0" }),
|
|
1808
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
1964
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Markdown, { text: detail.descriptionMd || "\u6682\u65E0\u63CF\u8FF0" })
|
|
1809
1965
|
] }),
|
|
1810
1966
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("section", { className: "pcx-section", children: [
|
|
1811
1967
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("h2", { className: "pcx-h2", children: "\u4F7F\u7528\u65B9\u6CD5" }),
|
|
1812
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
1968
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Markdown, { text: detail.usageMd || "\u6682\u65E0" })
|
|
1813
1969
|
] }),
|
|
1814
1970
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("section", { className: "pcx-section", children: [
|
|
1815
1971
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("h2", { className: "pcx-h2", children: [
|
|
@@ -2468,7 +2624,7 @@ function AdminView({
|
|
|
2468
2624
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("a", { className: "pcx-back", onClick: onBack, children: "\u2190 \u8FD4\u56DE\u5217\u8868" }),
|
|
2469
2625
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("header", { className: "pcx-header", children: [
|
|
2470
2626
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "pcx-brand", children: [
|
|
2471
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
2627
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(BrandMark, {}),
|
|
2472
2628
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [
|
|
2473
2629
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("h1", { className: "pcx-title", children: "\u6CBB\u7406" }),
|
|
2474
2630
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "pcx-sub", children: "\u4E0B\u67B6\u53EF\u6062\u590D\uFF1B\u5C01\u7981\u9700\u5BA1\u6838\uFF1B\u7BA1\u7406\u5458\u4E0D\u80FD\u5220\u9664\u63D2\u4EF6" })
|
|
@@ -2805,11 +2961,30 @@ var CSS = `
|
|
|
2805
2961
|
}
|
|
2806
2962
|
.pcx-logo {
|
|
2807
2963
|
width: 28px; height: 28px; border-radius: 8px; flex: none;
|
|
2808
|
-
display: grid; place-items: center;
|
|
2964
|
+
display: grid; place-items: center; overflow: hidden;
|
|
2809
2965
|
background: var(--dsw-alias-button-primary-fill, #0f1115);
|
|
2810
|
-
color: var(--dsw-alias-label-primary-foreground, #fff);
|
|
2811
|
-
font-size: 13px; font-weight: 700;
|
|
2812
2966
|
}
|
|
2967
|
+
.pcx-logo img { width: 100%; height: 100%; display: block; }
|
|
2968
|
+
.pcx-sidebar-logo { display: block; border-radius: 5px; object-fit: cover; }
|
|
2969
|
+
.pcx-detail-icon { width: 44px; height: 44px; border-radius: 12px; flex: none; object-fit: cover; }
|
|
2970
|
+
.pcx-md { font-size: 12.5px; line-height: 1.65; color: var(--dsw-alias-label-primary, #1a1a1a); word-break: break-word; }
|
|
2971
|
+
.pcx-md > :first-child { margin-top: 0; }
|
|
2972
|
+
.pcx-md > :last-child { margin-bottom: 0; }
|
|
2973
|
+
.pcx-md h1, .pcx-md h2, .pcx-md h3, .pcx-md h4, .pcx-md h5, .pcx-md h6 { margin: 14px 0 6px; font-size: 13.5px; font-weight: 600; }
|
|
2974
|
+
.pcx-md h1 { font-size: 15px; }
|
|
2975
|
+
.pcx-md p { margin: 6px 0; }
|
|
2976
|
+
.pcx-md ul, .pcx-md ol { margin: 6px 0; padding-left: 20px; }
|
|
2977
|
+
.pcx-md li { margin: 2px 0; }
|
|
2978
|
+
.pcx-md code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11.5px; padding: 1px 4px; border-radius: 4px; background: var(--dsw-alias-interactive-bg-hover, rgba(0,0,0,.06)); }
|
|
2979
|
+
.pcx-md pre { margin: 8px 0; padding: 10px 12px; border-radius: 8px; overflow: auto; background: var(--dsw-alias-interactive-bg-hover, rgba(0,0,0,.06)); }
|
|
2980
|
+
.pcx-md pre code { padding: 0; background: none; }
|
|
2981
|
+
.pcx-md blockquote { margin: 8px 0; padding: 2px 10px; border-left: 3px solid var(--dsw-alias-border-l3, rgba(0,0,0,.15)); color: var(--dsw-alias-label-secondary, #61666b); }
|
|
2982
|
+
.pcx-md img { max-width: 100%; border-radius: 6px; }
|
|
2983
|
+
.pcx-md table { border-collapse: collapse; margin: 8px 0; font-size: 12px; }
|
|
2984
|
+
.pcx-md th, .pcx-md td { border: 1px solid var(--dsw-alias-border-l2, rgba(0,0,0,.1)); padding: 5px 8px; text-align: left; }
|
|
2985
|
+
.pcx-md a { color: var(--dsw-alias-state-business-primary, #1f6feb); text-decoration: none; }
|
|
2986
|
+
.pcx-md a:hover { text-decoration: underline; }
|
|
2987
|
+
.pcx-md hr { border: 0; border-top: 1px solid var(--dsw-alias-border-l2, rgba(0,0,0,.1)); margin: 12px 0; }
|
|
2813
2988
|
.pcx-title { margin: 0; font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
|
|
2814
2989
|
.pcx-version-tag {
|
|
2815
2990
|
display: inline-flex; align-items: center; height: 18px; margin-left: 7px; padding: 0 6px;
|
|
@@ -3149,6 +3324,7 @@ var CSS = `
|
|
|
3149
3324
|
.pcx-trace { margin: 8px 0; padding: 8px 10px; border-radius: 8px; background: rgba(0,0,0,.04); font-size: 11px; }
|
|
3150
3325
|
.pcx-trace pre { margin: 6px 0 0; white-space: pre-wrap; font-family: ui-monospace, monospace; }
|
|
3151
3326
|
`;
|
|
3327
|
+
var __testMarkdown = renderMarkdown;
|
|
3152
3328
|
|
|
3153
3329
|
return module.exports;
|
|
3154
3330
|
}
|
package/lib/index.js
CHANGED
|
@@ -944,6 +944,7 @@ export function apply(ctx) {
|
|
|
944
944
|
name: bundle.name,
|
|
945
945
|
displayName: typeof meta.name === 'string' ? meta.name : bundle.name,
|
|
946
946
|
summary: typeof meta.summary === 'string' ? meta.summary : (bundle.description ?? ''),
|
|
947
|
+
icon: typeof meta.icon === 'string' ? meta.icon : null,
|
|
947
948
|
description: bundle.description ?? null,
|
|
948
949
|
version: bundle.version ?? null,
|
|
949
950
|
enabled: bundle.enabled,
|
package/logo.svg
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" width="64" height="64">
|
|
2
|
+
<defs>
|
|
3
|
+
<linearGradient id="g" x1="8" y1="4" x2="56" y2="60" gradientUnits="userSpaceOnUse">
|
|
4
|
+
<stop stop-color="#2E9BFF" />
|
|
5
|
+
<stop offset="0.55" stop-color="#0071E3" />
|
|
6
|
+
<stop offset="1" stop-color="#5E5CE6" />
|
|
7
|
+
</linearGradient>
|
|
8
|
+
</defs>
|
|
9
|
+
<rect width="64" height="64" rx="16" fill="url(#g)" />
|
|
10
|
+
<g fill="none" stroke="#fff" stroke-width="4.5" stroke-linecap="round">
|
|
11
|
+
<path d="M24 17v9M40 17v9" />
|
|
12
|
+
<path d="M19 28h26v7.5C45 43 39.2 48 32 48s-13-5-13-12.5V28Z" />
|
|
13
|
+
</g>
|
|
14
|
+
<circle cx="32" cy="55" r="2.5" fill="#fff" opacity=".75" />
|
|
15
|
+
</svg>
|
package/package.json
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ququ-jiaxk/dsh-plugin-center",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.44",
|
|
4
4
|
"description": "小趣插件中心:浏览、安装、更新和发布远端插件中心的插件",
|
|
5
|
+
"icon": "logo.svg",
|
|
5
6
|
"type": "module",
|
|
6
7
|
"main": "lib/index.js",
|
|
7
8
|
"exports": {
|
|
@@ -11,7 +12,8 @@
|
|
|
11
12
|
},
|
|
12
13
|
"files": [
|
|
13
14
|
"lib",
|
|
14
|
-
"cordis.patch.yml"
|
|
15
|
+
"cordis.patch.yml",
|
|
16
|
+
"logo.svg"
|
|
15
17
|
],
|
|
16
18
|
"dsh": {
|
|
17
19
|
"bundle": {
|