@fecommunity/reactpress-server 4.0.0-beta.0 → 4.0.0-beta.10
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 +44 -318
- package/bin/reactpress-server.js +10 -2
- package/dist/generate-swagger.d.ts +1 -1
- package/dist/generate-swagger.js +1 -0
- package/dist/generate-swagger.js.map +1 -1
- package/dist/main.d.ts +1 -1
- package/dist/main.js +1 -0
- package/dist/main.js.map +1 -1
- package/dist/modules/article/article-revision.entity.js +1 -1
- package/dist/modules/article/article-revision.entity.js.map +1 -1
- package/dist/modules/article/article.entity.js +1 -1
- package/dist/modules/article/article.entity.js.map +1 -1
- package/dist/modules/knowledge/knowledge.entity.js +1 -1
- package/dist/modules/knowledge/knowledge.entity.js.map +1 -1
- package/dist/modules/page/page.entity.js +1 -1
- package/dist/modules/page/page.entity.js.map +1 -1
- package/dist/modules/setting/setting.constant.d.ts +1 -1
- package/dist/modules/user/user.entity.js +2 -2
- package/dist/modules/user/user.entity.js.map +1 -1
- package/dist/node-polyfills.d.ts +18 -0
- package/dist/node-polyfills.js +24 -0
- package/dist/node-polyfills.js.map +1 -0
- package/dist/starter.d.ts +1 -0
- package/dist/starter.js +1 -0
- package/dist/starter.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/utils/theme-placeholder-cover.d.ts +8 -0
- package/dist/utils/theme-placeholder-cover.js +94 -0
- package/dist/utils/theme-placeholder-cover.js.map +1 -0
- package/package.json +4 -4
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.buildThemePlaceholderCoverSvg = void 0;
|
|
4
|
+
function escapeXml(text) {
|
|
5
|
+
return String(text).replace(/[<>&"']/g, (ch) => {
|
|
6
|
+
var _a;
|
|
7
|
+
const map = {
|
|
8
|
+
'<': '<',
|
|
9
|
+
'>': '>',
|
|
10
|
+
'&': '&',
|
|
11
|
+
'"': '"',
|
|
12
|
+
"'": ''',
|
|
13
|
+
};
|
|
14
|
+
return (_a = map[ch]) !== null && _a !== void 0 ? _a : ch;
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
function sanitizeColor(color, fallback) {
|
|
18
|
+
if (!color)
|
|
19
|
+
return fallback;
|
|
20
|
+
const trimmed = String(color).trim();
|
|
21
|
+
if (/^#[0-9a-fA-F]{3,8}$/.test(trimmed))
|
|
22
|
+
return trimmed;
|
|
23
|
+
return fallback;
|
|
24
|
+
}
|
|
25
|
+
function safeSvgId(id) {
|
|
26
|
+
return String(id).replace(/[^a-zA-Z0-9_-]/g, '') || 'theme';
|
|
27
|
+
}
|
|
28
|
+
function buildThemePlaceholderCoverSvg(options) {
|
|
29
|
+
var _a, _b;
|
|
30
|
+
const svgId = safeSvgId(options.id);
|
|
31
|
+
const primary = sanitizeColor(options.primary, '#2563eb');
|
|
32
|
+
const accent = sanitizeColor(options.accent, '#7c3aed');
|
|
33
|
+
const rawName = String((_b = (_a = options.name) !== null && _a !== void 0 ? _a : options.id) !== null && _b !== void 0 ? _b : 'Theme');
|
|
34
|
+
const safeName = escapeXml(rawName.length > 48 ? `${rawName.slice(0, 45)}…` : rawName);
|
|
35
|
+
const version = options.version ? escapeXml(String(options.version)) : '';
|
|
36
|
+
const versionBadge = version
|
|
37
|
+
? `<rect x="656" y="28" width="112" height="26" rx="13" fill="#ffffff" fill-opacity="0.08"/>
|
|
38
|
+
<text x="712" y="45" text-anchor="middle" fill="#ffffff" fill-opacity="0.65" font-family="system-ui,-apple-system,sans-serif" font-size="11" font-weight="500">v${version}</text>`
|
|
39
|
+
: '';
|
|
40
|
+
return `<svg xmlns="http://www.w3.org/2000/svg" width="800" height="500" viewBox="0 0 800 500" role="img" aria-label="${safeName}">
|
|
41
|
+
<defs>
|
|
42
|
+
<linearGradient id="${svgId}-bg" x1="0" y1="0" x2="800" y2="500" gradientUnits="userSpaceOnUse">
|
|
43
|
+
<stop offset="0%" stop-color="#0b1220"/>
|
|
44
|
+
<stop offset="100%" stop-color="#151b2b"/>
|
|
45
|
+
</linearGradient>
|
|
46
|
+
<linearGradient id="${svgId}-hero" x1="0" y1="0" x2="512" y2="0" gradientUnits="userSpaceOnUse">
|
|
47
|
+
<stop offset="0%" stop-color="${primary}"/>
|
|
48
|
+
<stop offset="100%" stop-color="${accent}"/>
|
|
49
|
+
</linearGradient>
|
|
50
|
+
<radialGradient id="${svgId}-glow1" cx="0" cy="0" r="1" gradientTransform="translate(96 48) rotate(90) scale(220 220)">
|
|
51
|
+
<stop offset="0%" stop-color="${primary}" stop-opacity="0.38"/>
|
|
52
|
+
<stop offset="100%" stop-color="${primary}" stop-opacity="0"/>
|
|
53
|
+
</radialGradient>
|
|
54
|
+
<radialGradient id="${svgId}-glow2" cx="0" cy="0" r="1" gradientTransform="translate(704 432) rotate(90) scale(260 260)">
|
|
55
|
+
<stop offset="0%" stop-color="${accent}" stop-opacity="0.3"/>
|
|
56
|
+
<stop offset="100%" stop-color="${accent}" stop-opacity="0"/>
|
|
57
|
+
</radialGradient>
|
|
58
|
+
<pattern id="${svgId}-grid" width="32" height="32" patternUnits="userSpaceOnUse">
|
|
59
|
+
<path d="M32 0H0V32" fill="none" stroke="#ffffff" stroke-opacity="0.045" stroke-width="1"/>
|
|
60
|
+
</pattern>
|
|
61
|
+
<filter id="${svgId}-shadow" x="-16%" y="-16%" width="132%" height="132%">
|
|
62
|
+
<feDropShadow dx="0" dy="18" stdDeviation="22" flood-color="#000000" flood-opacity="0.38"/>
|
|
63
|
+
</filter>
|
|
64
|
+
</defs>
|
|
65
|
+
<rect width="800" height="500" fill="url(#${svgId}-bg)"/>
|
|
66
|
+
<rect width="800" height="500" fill="url(#${svgId}-glow1)"/>
|
|
67
|
+
<rect width="800" height="500" fill="url(#${svgId}-glow2)"/>
|
|
68
|
+
<rect width="800" height="500" fill="url(#${svgId}-grid)"/>
|
|
69
|
+
<rect x="32" y="28" width="112" height="26" rx="13" fill="#ffffff" fill-opacity="0.08"/>
|
|
70
|
+
<text x="74" y="45" text-anchor="middle" fill="#ffffff" fill-opacity="0.75" font-family="system-ui,-apple-system,sans-serif" font-size="11" font-weight="600" letter-spacing="0.08em">REACTPRESS</text>
|
|
71
|
+
${versionBadge}
|
|
72
|
+
<g transform="translate(120 68)" filter="url(#${svgId}-shadow)">
|
|
73
|
+
<rect width="560" height="328" rx="14" fill="#ffffff"/>
|
|
74
|
+
<path d="M0 14C0 6.268 6.268 0 14 0h532c7.732 0 14 6.268 14 14v38H0V14z" fill="#f8fafc"/>
|
|
75
|
+
<circle cx="28" cy="19" r="5.5" fill="#ff5f57" fill-opacity="0.88"/>
|
|
76
|
+
<circle cx="48" cy="19" r="5.5" fill="#febc2e" fill-opacity="0.88"/>
|
|
77
|
+
<circle cx="68" cy="19" r="5.5" fill="#28c840" fill-opacity="0.88"/>
|
|
78
|
+
<rect x="120" y="12" width="320" height="14" rx="7" fill="#e2e8f0"/>
|
|
79
|
+
<rect x="24" y="62" width="512" height="108" rx="10" fill="url(#${svgId}-hero)"/>
|
|
80
|
+
<rect x="40" y="86" width="196" height="14" rx="7" fill="#ffffff" fill-opacity="0.92"/>
|
|
81
|
+
<rect x="40" y="108" width="272" height="10" rx="5" fill="#ffffff" fill-opacity="0.55"/>
|
|
82
|
+
<rect x="24" y="194" width="340" height="10" rx="5" fill="#e2e8f0"/>
|
|
83
|
+
<rect x="24" y="214" width="420" height="8" rx="4" fill="#f1f5f9"/>
|
|
84
|
+
<rect x="24" y="228" width="380" height="8" rx="4" fill="#f1f5f9"/>
|
|
85
|
+
<rect x="24" y="252" width="160" height="52" rx="8" fill="#f8fafc" stroke="#e2e8f0" stroke-width="1"/>
|
|
86
|
+
<rect x="200" y="252" width="160" height="52" rx="8" fill="#f8fafc" stroke="#e2e8f0" stroke-width="1"/>
|
|
87
|
+
<rect x="376" y="252" width="136" height="52" rx="8" fill="#f8fafc" stroke="#e2e8f0" stroke-width="1"/>
|
|
88
|
+
</g>
|
|
89
|
+
<text x="400" y="456" text-anchor="middle" fill="#ffffff" font-family="system-ui,-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif" font-size="24" font-weight="600">${safeName}</text>
|
|
90
|
+
<text x="400" y="478" text-anchor="middle" fill="#ffffff" fill-opacity="0.5" font-family="system-ui,-apple-system,sans-serif" font-size="12" font-weight="500">Theme Preview</text>
|
|
91
|
+
</svg>`;
|
|
92
|
+
}
|
|
93
|
+
exports.buildThemePlaceholderCoverSvg = buildThemePlaceholderCoverSvg;
|
|
94
|
+
//# sourceMappingURL=theme-placeholder-cover.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme-placeholder-cover.js","sourceRoot":"","sources":["../../src/utils/theme-placeholder-cover.ts"],"names":[],"mappings":";;;AASA,SAAS,SAAS,CAAC,IAAY;IAC7B,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,UAAU,EAAE,CAAC,EAAE,EAAE,EAAE;;QAC7C,MAAM,GAAG,GAA2B;YAClC,GAAG,EAAE,MAAM;YACX,GAAG,EAAE,MAAM;YACX,GAAG,EAAE,OAAO;YACZ,GAAG,EAAE,QAAQ;YACb,GAAG,EAAE,OAAO;SACb,CAAC;QACF,OAAO,MAAA,GAAG,CAAC,EAAE,CAAC,mCAAI,EAAE,CAAC;IACvB,CAAC,CAAC,CAAC;AACL,CAAC;AAED,SAAS,aAAa,CAAC,KAAyB,EAAE,QAAgB;IAChE,IAAI,CAAC,KAAK;QAAE,OAAO,QAAQ,CAAC;IAC5B,MAAM,OAAO,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,CAAC;IACrC,IAAI,qBAAqB,CAAC,IAAI,CAAC,OAAO,CAAC;QAAE,OAAO,OAAO,CAAC;IACxD,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED,SAAS,SAAS,CAAC,EAAU;IAC3B,OAAO,MAAM,CAAC,EAAE,CAAC,CAAC,OAAO,C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|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fecommunity/reactpress-server",
|
|
3
|
-
"version": "4.0.0-beta.
|
|
4
|
-
"deprecated": "
|
|
5
|
-
"description": "ReactPress
|
|
3
|
+
"version": "4.0.0-beta.10",
|
|
4
|
+
"deprecated": "Use the built-in API in @fecommunity/reactpress (CLI). Standalone server publishing stopped from 3.1.",
|
|
5
|
+
"description": "ReactPress NestJS CMS API — headless REST for the publishing platform (MySQL or SQLite)",
|
|
6
6
|
"author": "fecommunity",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"main": "dist/main.js",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"node": ">=16.5.0"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@fecommunity/reactpress-toolkit": "4.0.0-beta.
|
|
38
|
+
"@fecommunity/reactpress-toolkit": "4.0.0-beta.10",
|
|
39
39
|
"@nestjs/cli": "^6.9.0",
|
|
40
40
|
"@nestjs/common": "^6.7.2",
|
|
41
41
|
"@nestjs/config": "^0.6.3",
|