underpost 2.8.84 → 2.8.85
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/.env.development +1 -0
- package/.env.production +1 -0
- package/.env.test +1 -0
- package/.github/workflows/{ghpkg.yml → ghpkg.ci.yml} +1 -1
- package/.github/workflows/{npmpkg.yml → npmpkg.ci.yml} +1 -1
- package/.github/workflows/{publish.yml → publish.ci.yml} +1 -1
- package/.github/workflows/{pwa-microservices-template.page.yml → pwa-microservices-template-page.cd.yml} +1 -1
- package/.github/workflows/{pwa-microservices-template.test.yml → pwa-microservices-template-test.ci.yml} +1 -1
- package/.vscode/settings.json +0 -1
- package/README.md +45 -2
- package/bin/build.js +15 -5
- package/bin/deploy.js +17 -82
- package/bin/file.js +15 -8
- package/cli.md +65 -44
- package/conf.js +1 -1
- package/docker-compose.yml +1 -1
- package/manifests/deployment/dd-template-development/deployment.yaml +2 -2
- package/manifests/maas/gpu-diag.sh +1 -1
- package/package.json +4 -6
- package/src/api/user/user.router.js +24 -1
- package/src/api/user/user.service.js +1 -4
- package/src/cli/cluster.js +42 -27
- package/src/cli/deploy.js +20 -0
- package/src/cli/index.js +9 -0
- package/src/cli/monitor.js +8 -12
- package/src/cli/run.js +111 -6
- package/src/cli/ssh.js +32 -0
- package/src/client/Default.index.js +7 -3
- package/src/client/components/core/Account.js +1 -1
- package/src/client/components/core/Chat.js +1 -1
- package/src/client/components/core/CommonJs.js +24 -22
- package/src/client/components/core/Content.js +1 -5
- package/src/client/components/core/Css.js +258 -18
- package/src/client/components/core/CssCore.js +8 -8
- package/src/client/components/core/Docs.js +14 -61
- package/src/client/components/core/DropDown.js +137 -82
- package/src/client/components/core/EventsUI.js +92 -5
- package/src/client/components/core/LoadingAnimation.js +8 -15
- package/src/client/components/core/Modal.js +597 -136
- package/src/client/components/core/NotificationManager.js +2 -2
- package/src/client/components/core/ObjectLayerEngine.js +638 -0
- package/src/client/components/core/Panel.js +158 -34
- package/src/client/components/core/PanelForm.js +12 -3
- package/src/client/components/core/Recover.js +1 -1
- package/src/client/components/core/Router.js +77 -17
- package/src/client/components/core/SocketIo.js +3 -3
- package/src/client/components/core/Translate.js +6 -2
- package/src/client/components/core/VanillaJs.js +0 -3
- package/src/client/components/core/Worker.js +3 -1
- package/src/client/components/default/CssDefault.js +17 -3
- package/src/client/components/default/MenuDefault.js +264 -45
- package/src/client/components/default/RoutesDefault.js +6 -12
- package/src/client/public/default/android-chrome-144x144.png +0 -0
- package/src/client/public/default/android-chrome-192x192.png +0 -0
- package/src/client/public/default/android-chrome-256x256.png +0 -0
- package/src/client/public/default/android-chrome-36x36.png +0 -0
- package/src/client/public/default/android-chrome-48x48.png +0 -0
- package/src/client/public/default/android-chrome-72x72.png +0 -0
- package/src/client/public/default/android-chrome-96x96.png +0 -0
- package/src/client/public/default/apple-touch-icon-114x114-precomposed.png +0 -0
- package/src/client/public/default/apple-touch-icon-114x114.png +0 -0
- package/src/client/public/default/apple-touch-icon-120x120-precomposed.png +0 -0
- package/src/client/public/default/apple-touch-icon-120x120.png +0 -0
- package/src/client/public/default/apple-touch-icon-144x144-precomposed.png +0 -0
- package/src/client/public/default/apple-touch-icon-144x144.png +0 -0
- package/src/client/public/default/apple-touch-icon-152x152-precomposed.png +0 -0
- package/src/client/public/default/apple-touch-icon-152x152.png +0 -0
- package/src/client/public/default/apple-touch-icon-180x180-precomposed.png +0 -0
- package/src/client/public/default/apple-touch-icon-180x180.png +0 -0
- package/src/client/public/default/apple-touch-icon-57x57-precomposed.png +0 -0
- package/src/client/public/default/apple-touch-icon-57x57.png +0 -0
- package/src/client/public/default/apple-touch-icon-60x60-precomposed.png +0 -0
- package/src/client/public/default/apple-touch-icon-60x60.png +0 -0
- package/src/client/public/default/apple-touch-icon-72x72-precomposed.png +0 -0
- package/src/client/public/default/apple-touch-icon-72x72.png +0 -0
- package/src/client/public/default/apple-touch-icon-76x76-precomposed.png +0 -0
- package/src/client/public/default/apple-touch-icon-76x76.png +0 -0
- package/src/client/public/default/apple-touch-icon-precomposed.png +0 -0
- package/src/client/public/default/apple-touch-icon.png +0 -0
- package/src/client/public/default/assets/background/dark.jpg +0 -0
- package/src/client/public/default/assets/background/dark.svg +557 -0
- package/src/client/public/default/assets/logo/base-icon.png +0 -0
- package/src/client/public/default/assets/logo/underpost.gif +0 -0
- package/src/client/public/default/assets/mailer/api-user-check.png +0 -0
- package/src/client/public/default/assets/mailer/api-user-invalid-token.png +0 -0
- package/src/client/public/default/assets/mailer/api-user-recover.png +0 -0
- package/src/client/public/default/favicon-16x16.png +0 -0
- package/src/client/public/default/favicon-32x32.png +0 -0
- package/src/client/public/default/favicon.ico +0 -0
- package/src/client/public/default/mstile-144x144.png +0 -0
- package/src/client/public/default/mstile-150x150.png +0 -0
- package/src/client/public/default/mstile-310x150.png +0 -0
- package/src/client/public/default/mstile-310x310.png +0 -0
- package/src/client/public/default/mstile-70x70.png +0 -0
- package/src/client/public/default/safari-pinned-tab.svg +24 -0
- package/src/client/ssr/body/DefaultSplashScreen.js +2 -2
- package/src/index.js +9 -1
- package/src/monitor.js +24 -0
- package/src/runtime/lampp/Dockerfile +30 -39
- package/src/runtime/lampp/Lampp.js +11 -2
- package/src/server/client-build-docs.js +205 -0
- package/src/server/client-build.js +16 -166
- package/src/server/conf.js +12 -5
- package/src/server/valkey.js +102 -41
|
@@ -105,7 +105,6 @@ const Content = {
|
|
|
105
105
|
class: '',
|
|
106
106
|
container: '',
|
|
107
107
|
url: '',
|
|
108
|
-
aHrefOptions: { disable: false },
|
|
109
108
|
raw: false,
|
|
110
109
|
},
|
|
111
110
|
) {
|
|
@@ -143,10 +142,7 @@ const Content = {
|
|
|
143
142
|
? getApiBaseUrl({ id: file._id, endpoint: 'file/blob' })
|
|
144
143
|
: URL.createObjectURL(getBlobFromUint8ArrayFile(file.data.data, file.mimetype));
|
|
145
144
|
const imgRender = html`<img class="in ${options.class}" ${options.style} src="${url}" />`;
|
|
146
|
-
render +=
|
|
147
|
-
? imgRender
|
|
148
|
-
: html`<a href="${url}" target="_top">${imgRender}</a>`}`;
|
|
149
|
-
|
|
145
|
+
render += imgRender;
|
|
150
146
|
break;
|
|
151
147
|
}
|
|
152
148
|
case 'pdf': {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { getId, newInstance, range, s4, splitEveryXChar } from './CommonJs.js';
|
|
1
|
+
import { getId, newInstance, range, rgbToHex, s4, splitEveryXChar } from './CommonJs.js';
|
|
2
2
|
import { CssCoreDark, CssCoreLight } from './CssCore.js';
|
|
3
3
|
import { DropDown } from './DropDown.js';
|
|
4
4
|
import { Modal } from './Modal.js';
|
|
5
5
|
import { Translate } from './Translate.js';
|
|
6
|
-
import { append, getProxyPath, htmls, s } from './VanillaJs.js';
|
|
6
|
+
import { append, getProxyPath, htmls, s, sa } from './VanillaJs.js';
|
|
7
7
|
|
|
8
8
|
let ThemesScope = [];
|
|
9
9
|
|
|
@@ -12,14 +12,47 @@ let ThemesScope = [];
|
|
|
12
12
|
// https://www.1001fonts.com/
|
|
13
13
|
|
|
14
14
|
const Css = {
|
|
15
|
+
// Menu button container transition styles
|
|
16
|
+
menuButtonContainer: () => css`
|
|
17
|
+
.main-btn-menu {
|
|
18
|
+
transition: all 0.2s ease-in-out;
|
|
19
|
+
position: relative;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.main-btn-menu::after {
|
|
23
|
+
content: '';
|
|
24
|
+
position: absolute;
|
|
25
|
+
bottom: 0;
|
|
26
|
+
left: 50%;
|
|
27
|
+
width: 0;
|
|
28
|
+
height: 2px;
|
|
29
|
+
background: currentColor;
|
|
30
|
+
transition: all 0.2s ease-in-out;
|
|
31
|
+
transform: translateX(-50%);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.main-btn-menu:hover::after {
|
|
35
|
+
width: 60%;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.main-btn-menu.active {
|
|
39
|
+
background: rgba(255, 255, 255, 0.1);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.main-btn-menu.active::after {
|
|
43
|
+
width: 80%;
|
|
44
|
+
background: currentColor;
|
|
45
|
+
}
|
|
46
|
+
`,
|
|
47
|
+
|
|
15
48
|
loadThemes: async function (themes = []) {
|
|
16
49
|
ThemesScope = [];
|
|
17
50
|
for (const themeOptions of themes) addTheme(themeOptions);
|
|
18
51
|
// if (!ThemesScope.find((t) => t.dark)) addTheme(CssCoreDark);
|
|
19
52
|
// if (!ThemesScope.find((t) => !t.dark)) addTheme(CssCoreLight);
|
|
20
53
|
if (ThemesScope.length === 0) {
|
|
21
|
-
addTheme(CssCoreDark);
|
|
22
54
|
addTheme(CssCoreLight);
|
|
55
|
+
addTheme(CssCoreDark);
|
|
23
56
|
}
|
|
24
57
|
const localStorageTheme = localStorage.getItem('_theme');
|
|
25
58
|
if (localStorageTheme && Themes[localStorageTheme]) {
|
|
@@ -31,6 +64,16 @@ const Css = {
|
|
|
31
64
|
Init: async function (options) {
|
|
32
65
|
if (!options) options = ThemesScope[0];
|
|
33
66
|
const { theme } = options;
|
|
67
|
+
|
|
68
|
+
// Inject menu button container styles
|
|
69
|
+
const styleId = 'menu-btn-container-styles';
|
|
70
|
+
if (!document.getElementById(styleId)) {
|
|
71
|
+
const style = document.createElement('style');
|
|
72
|
+
style.id = styleId;
|
|
73
|
+
style.textContent = this.menuButtonContainer();
|
|
74
|
+
document.head.appendChild(style);
|
|
75
|
+
}
|
|
76
|
+
|
|
34
77
|
return await Themes[theme](options);
|
|
35
78
|
},
|
|
36
79
|
RenderSetting: async function () {
|
|
@@ -156,6 +199,7 @@ const addTheme = (options) => {
|
|
|
156
199
|
if (!['core', 'css-core'].includes(options.theme))
|
|
157
200
|
render += darkTheme ? await CssCoreDark.render() : await CssCoreLight.render();
|
|
158
201
|
render += await options.render();
|
|
202
|
+
render += await subThemeManager.render();
|
|
159
203
|
htmls('.theme', render);
|
|
160
204
|
TriggerThemeEvents();
|
|
161
205
|
}
|
|
@@ -169,13 +213,13 @@ const addTheme = (options) => {
|
|
|
169
213
|
};
|
|
170
214
|
};
|
|
171
215
|
|
|
172
|
-
const borderChar = (px, color, selectors) => {
|
|
216
|
+
const borderChar = (px, color, selectors, hover = false) => {
|
|
173
217
|
if (selectors) {
|
|
174
218
|
return selectors
|
|
175
219
|
.map(
|
|
176
220
|
(selector) => html`
|
|
177
221
|
<style>
|
|
178
|
-
${selector} {
|
|
222
|
+
${selector}${hover ? ':hover' : ''} {
|
|
179
223
|
text-shadow: ${px}px -${px}px ${px}px ${color}, -${px}px ${px}px ${px}px ${color},
|
|
180
224
|
-${px}px -${px}px ${px}px ${color}, ${px}px ${px}px ${px}px ${color};
|
|
181
225
|
}
|
|
@@ -189,18 +233,29 @@ const borderChar = (px, color, selectors) => {
|
|
|
189
233
|
${color}, ${px}px ${px}px ${px}px ${color};
|
|
190
234
|
`;
|
|
191
235
|
};
|
|
192
|
-
|
|
193
236
|
const boxShadow = ({ selector }) => html`
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
237
|
+
${darkTheme
|
|
238
|
+
? html`
|
|
239
|
+
<style>
|
|
240
|
+
${selector} {
|
|
241
|
+
box-shadow: 0 4px 8px 0 rgba(255, 255, 255, 0.1), 0 6px 20px 0 rgba(255, 255, 255, 0.08);
|
|
242
|
+
}
|
|
243
|
+
${selector}:hover {
|
|
244
|
+
box-shadow: 0 8px 16px 0 rgba(255, 255, 255, 0.15), 0 10px 30px 0 rgba(255, 255, 255, 0.1);
|
|
245
|
+
}
|
|
246
|
+
</style>
|
|
247
|
+
`
|
|
248
|
+
: html`
|
|
249
|
+
<style>
|
|
250
|
+
${selector} {
|
|
251
|
+
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
|
|
252
|
+
}
|
|
253
|
+
${selector}:hover {
|
|
254
|
+
box-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0.2), 0 10px 30px 0 rgba(0, 0, 0, 0.3);
|
|
255
|
+
}
|
|
256
|
+
</style>
|
|
257
|
+
`}
|
|
202
258
|
`;
|
|
203
|
-
|
|
204
259
|
const renderMediaQuery = (mediaData) => {
|
|
205
260
|
// first limit should be '0'
|
|
206
261
|
return html`
|
|
@@ -634,6 +689,166 @@ const scrollBarLightRender = () => {
|
|
|
634
689
|
.join('');
|
|
635
690
|
};
|
|
636
691
|
|
|
692
|
+
/**
|
|
693
|
+
* Adjust hex color brightness toward white/black ("mix") or by modifying HSL lightness ("hsl").
|
|
694
|
+
*
|
|
695
|
+
* @param {string} hex - Color as '#rrggbb', 'rrggbb', '#rgb', or 'rgb'.
|
|
696
|
+
* @param {number} factor - -1..1 or -100..100 (percent). Positive = lighten, negative = darken.
|
|
697
|
+
* @param {{mode?: 'mix'|'hsl'}} [options]
|
|
698
|
+
* @returns {string} - Adjusted color as '#rrggbb' (lowercase).
|
|
699
|
+
*/
|
|
700
|
+
function adjustHex(hex, factor = 0.1, options = {}) {
|
|
701
|
+
if (typeof hex !== 'string') throw new TypeError('hex must be a string');
|
|
702
|
+
if (typeof factor !== 'number') throw new TypeError('factor must be a number');
|
|
703
|
+
|
|
704
|
+
// normalize factor: allow -100..100 or -1..1
|
|
705
|
+
if (factor > 1 && factor <= 100) factor = factor / 100;
|
|
706
|
+
if (factor < -1 && factor >= -100) factor = factor / 100;
|
|
707
|
+
factor = Math.max(-1, Math.min(1, factor));
|
|
708
|
+
|
|
709
|
+
const mode = options.mode === 'hsl' ? 'hsl' : 'mix';
|
|
710
|
+
|
|
711
|
+
// normalize hex
|
|
712
|
+
let h = hex.replace(/^#/, '').trim();
|
|
713
|
+
if (!(h.length === 3 || h.length === 6)) throw new Error('Invalid hex format');
|
|
714
|
+
if (h.length === 3)
|
|
715
|
+
h = h
|
|
716
|
+
.split('')
|
|
717
|
+
.map((c) => c + c)
|
|
718
|
+
.join('');
|
|
719
|
+
|
|
720
|
+
const r = parseInt(h.slice(0, 2), 16);
|
|
721
|
+
const g = parseInt(h.slice(2, 4), 16);
|
|
722
|
+
const b = parseInt(h.slice(4, 6), 16);
|
|
723
|
+
|
|
724
|
+
const clamp = (v, a = 0, z = 255) => Math.max(a, Math.min(z, v));
|
|
725
|
+
|
|
726
|
+
const rgbToHex = (rr, gg, bb) =>
|
|
727
|
+
'#' +
|
|
728
|
+
[rr, gg, bb]
|
|
729
|
+
.map((v) => Math.round(v).toString(16).padStart(2, '0'))
|
|
730
|
+
.join('')
|
|
731
|
+
.toLowerCase();
|
|
732
|
+
|
|
733
|
+
if (mode === 'mix') {
|
|
734
|
+
// positive: mix toward white (255); negative: mix toward black (0)
|
|
735
|
+
const mixChannel = (c) => {
|
|
736
|
+
if (factor >= 0) {
|
|
737
|
+
return clamp(Math.round(c + (255 - c) * factor));
|
|
738
|
+
} else {
|
|
739
|
+
const a = Math.abs(factor);
|
|
740
|
+
return clamp(Math.round(c * (1 - a)));
|
|
741
|
+
}
|
|
742
|
+
};
|
|
743
|
+
return rgbToHex(mixChannel(r), mixChannel(g), mixChannel(b));
|
|
744
|
+
} else {
|
|
745
|
+
// HSL mode: convert rgb to hsl, adjust L by factor, convert back
|
|
746
|
+
const rgbToHsl = (r, g, b) => {
|
|
747
|
+
r /= 255;
|
|
748
|
+
g /= 255;
|
|
749
|
+
b /= 255;
|
|
750
|
+
const max = Math.max(r, g, b),
|
|
751
|
+
min = Math.min(r, g, b);
|
|
752
|
+
let h = 0,
|
|
753
|
+
s = 0,
|
|
754
|
+
l = (max + min) / 2;
|
|
755
|
+
if (max !== min) {
|
|
756
|
+
const d = max - min;
|
|
757
|
+
s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
|
|
758
|
+
switch (max) {
|
|
759
|
+
case r:
|
|
760
|
+
h = (g - b) / d + (g < b ? 6 : 0);
|
|
761
|
+
break;
|
|
762
|
+
case g:
|
|
763
|
+
h = (b - r) / d + 2;
|
|
764
|
+
break;
|
|
765
|
+
case b:
|
|
766
|
+
h = (r - g) / d + 4;
|
|
767
|
+
break;
|
|
768
|
+
}
|
|
769
|
+
h /= 6;
|
|
770
|
+
}
|
|
771
|
+
return { h, s, l };
|
|
772
|
+
};
|
|
773
|
+
|
|
774
|
+
const hslToRgb = (h, s, l) => {
|
|
775
|
+
let r, g, b;
|
|
776
|
+
if (s === 0) {
|
|
777
|
+
r = g = b = l;
|
|
778
|
+
} else {
|
|
779
|
+
const hue2rgb = (p, q, t) => {
|
|
780
|
+
if (t < 0) t += 1;
|
|
781
|
+
if (t > 1) t -= 1;
|
|
782
|
+
if (t < 1 / 6) return p + (q - p) * 6 * t;
|
|
783
|
+
if (t < 1 / 2) return q;
|
|
784
|
+
if (t < 2 / 3) return p + (q - p) * (2 / 3 - t) * 6;
|
|
785
|
+
return p;
|
|
786
|
+
};
|
|
787
|
+
const q = l < 0.5 ? l * (1 + s) : l + s - l * s;
|
|
788
|
+
const p = 2 * l - q;
|
|
789
|
+
r = hue2rgb(p, q, h + 1 / 3);
|
|
790
|
+
g = hue2rgb(p, q, h);
|
|
791
|
+
b = hue2rgb(p, q, h - 1 / 3);
|
|
792
|
+
}
|
|
793
|
+
return { r: r * 255, g: g * 255, b: b * 255 };
|
|
794
|
+
};
|
|
795
|
+
|
|
796
|
+
const { h: hh, s: ss, l: ll } = rgbToHsl(r, g, b);
|
|
797
|
+
// add factor to lightness (factor already normalized -1..1)
|
|
798
|
+
let newL = ll + factor;
|
|
799
|
+
newL = Math.max(0, Math.min(1, newL));
|
|
800
|
+
const { r: r2, g: g2, b: b2 } = hslToRgb(hh, ss, newL);
|
|
801
|
+
return rgbToHex(r2, g2, b2);
|
|
802
|
+
}
|
|
803
|
+
}
|
|
804
|
+
|
|
805
|
+
// Convenience helpers:
|
|
806
|
+
function lightenHex(hex, percentOr01 = 0.1, options = {}) {
|
|
807
|
+
return adjustHex(hex, Math.abs(percentOr01), options);
|
|
808
|
+
}
|
|
809
|
+
function darkenHex(hex, percentOr01 = 0.1, options = {}) {
|
|
810
|
+
return adjustHex(hex, -Math.abs(percentOr01), options);
|
|
811
|
+
}
|
|
812
|
+
|
|
813
|
+
const subThemeManager = {
|
|
814
|
+
render: async function () {
|
|
815
|
+
if (darkTheme && this.renderDark) {
|
|
816
|
+
return await this.renderDark();
|
|
817
|
+
} else if (!darkTheme && this.renderLight) {
|
|
818
|
+
return await this.renderLight();
|
|
819
|
+
}
|
|
820
|
+
return html``;
|
|
821
|
+
},
|
|
822
|
+
lightColor: null,
|
|
823
|
+
setLightTheme: function (color) {
|
|
824
|
+
this.lightColor = color;
|
|
825
|
+
this.renderLight = async function () {
|
|
826
|
+
return html`<style>
|
|
827
|
+
button:hover,
|
|
828
|
+
.a-btn:hover,
|
|
829
|
+
.main-btn-menu-active {
|
|
830
|
+
color: ${this.lightColor};
|
|
831
|
+
background-color: ${lightenHex(this.lightColor, 0.8)};
|
|
832
|
+
}
|
|
833
|
+
</style>`;
|
|
834
|
+
};
|
|
835
|
+
},
|
|
836
|
+
darkColor: null,
|
|
837
|
+
setDarkTheme: function (color) {
|
|
838
|
+
this.darkColor = color;
|
|
839
|
+
this.renderDark = async function () {
|
|
840
|
+
return html`<style>
|
|
841
|
+
button:hover,
|
|
842
|
+
.a-btn:hover,
|
|
843
|
+
.main-btn-menu-active {
|
|
844
|
+
color: ${lightenHex(this.darkColor, 0.8)};
|
|
845
|
+
background-color: ${darkenHex(this.darkColor, 0.75)};
|
|
846
|
+
}
|
|
847
|
+
</style>`;
|
|
848
|
+
};
|
|
849
|
+
},
|
|
850
|
+
};
|
|
851
|
+
|
|
637
852
|
const scrollBarDarkRender = () => {
|
|
638
853
|
return cssBrowserCodes
|
|
639
854
|
.map(
|
|
@@ -642,8 +857,8 @@ const scrollBarDarkRender = () => {
|
|
|
642
857
|
::-` +
|
|
643
858
|
b +
|
|
644
859
|
`-scrollbar {
|
|
645
|
-
width:
|
|
646
|
-
height:
|
|
860
|
+
width: 8px;
|
|
861
|
+
height: 8px;
|
|
647
862
|
/* line-height: 1em; */
|
|
648
863
|
}
|
|
649
864
|
|
|
@@ -659,7 +874,7 @@ const scrollBarDarkRender = () => {
|
|
|
659
874
|
b +
|
|
660
875
|
`-scrollbar-thumb {
|
|
661
876
|
background: #74747457;
|
|
662
|
-
border-radius:
|
|
877
|
+
border-radius: 4px;
|
|
663
878
|
}
|
|
664
879
|
|
|
665
880
|
/* Handle on hover */
|
|
@@ -811,6 +1026,24 @@ const imageShimmer = () => html`<div
|
|
|
811
1026
|
</div>
|
|
812
1027
|
</div>`;
|
|
813
1028
|
|
|
1029
|
+
const renderChessPattern = () => `background: repeating-conic-gradient(#808080 0 25%, #0000 0 50%) 50% / 20px 20px`;
|
|
1030
|
+
|
|
1031
|
+
const extractBackgroundImageUrl = (element) => {
|
|
1032
|
+
const style = window.getComputedStyle(element);
|
|
1033
|
+
const imageString = style.backgroundImage;
|
|
1034
|
+
const foundUrlRaw = imageString.match(/^url\(?(.+)\)$/i)[1];
|
|
1035
|
+
if (!foundUrlRaw) return null;
|
|
1036
|
+
const foundUrl = foundUrlRaw.replace(/^['|"| ]*/, '').replace(/['" ]*$/, '');
|
|
1037
|
+
if (!foundUrl) return null;
|
|
1038
|
+
return foundUrl;
|
|
1039
|
+
};
|
|
1040
|
+
|
|
1041
|
+
const simpleIconsRender = (selector) => {
|
|
1042
|
+
sa(selector).forEach((el) => {
|
|
1043
|
+
el.src = `https://cdn.simpleicons.org/coveralls/${rgbToHex(window.getComputedStyle(s('html')).color)}`;
|
|
1044
|
+
});
|
|
1045
|
+
};
|
|
1046
|
+
|
|
814
1047
|
export {
|
|
815
1048
|
Css,
|
|
816
1049
|
Themes,
|
|
@@ -843,4 +1076,11 @@ export {
|
|
|
843
1076
|
renderWave,
|
|
844
1077
|
cssEffect,
|
|
845
1078
|
imageShimmer,
|
|
1079
|
+
simpleIconsRender,
|
|
1080
|
+
extractBackgroundImageUrl,
|
|
1081
|
+
renderChessPattern,
|
|
1082
|
+
subThemeManager,
|
|
1083
|
+
lightenHex,
|
|
1084
|
+
darkenHex,
|
|
1085
|
+
adjustHex,
|
|
846
1086
|
};
|
|
@@ -17,8 +17,8 @@ const CssCommonCore = async () => {
|
|
|
17
17
|
await AgGrid.RenderStyle();
|
|
18
18
|
return html`<style>
|
|
19
19
|
.top-bar-app-icon {
|
|
20
|
-
width:
|
|
21
|
-
height:
|
|
20
|
+
width: 40px;
|
|
21
|
+
height: 40px;
|
|
22
22
|
}
|
|
23
23
|
.mini-title {
|
|
24
24
|
font-size: 15px;
|
|
@@ -33,7 +33,7 @@ const CssCommonCore = async () => {
|
|
|
33
33
|
top: 0;
|
|
34
34
|
left: 0;
|
|
35
35
|
transition: 0.3s;
|
|
36
|
-
height:
|
|
36
|
+
height: 10px;
|
|
37
37
|
width: 100%;
|
|
38
38
|
z-index: 11;
|
|
39
39
|
}
|
|
@@ -51,7 +51,6 @@ const CssCommonCore = async () => {
|
|
|
51
51
|
cursor: grabbing !important;
|
|
52
52
|
}
|
|
53
53
|
.btn-label-content {
|
|
54
|
-
height: 100%;
|
|
55
54
|
top: 15px;
|
|
56
55
|
}
|
|
57
56
|
.badge {
|
|
@@ -122,6 +121,7 @@ const CssCommonCore = async () => {
|
|
|
122
121
|
left: 0;
|
|
123
122
|
width: 100%;
|
|
124
123
|
z-index: 1;
|
|
124
|
+
transition: 0.3s;
|
|
125
125
|
}
|
|
126
126
|
@keyframes ripple {
|
|
127
127
|
to {
|
|
@@ -137,10 +137,6 @@ const CssCommonCore = async () => {
|
|
|
137
137
|
.title-view-modal .view-title-icon {
|
|
138
138
|
font-size: 21px !important;
|
|
139
139
|
}
|
|
140
|
-
.plantuml-svg {
|
|
141
|
-
width: 100%;
|
|
142
|
-
height: auto;
|
|
143
|
-
}
|
|
144
140
|
.down-arrow-submenu {
|
|
145
141
|
top: -20px;
|
|
146
142
|
text-align: right;
|
|
@@ -611,6 +607,10 @@ const CssCoreLight = {
|
|
|
611
607
|
background: gray;
|
|
612
608
|
transition: 0.3s;
|
|
613
609
|
}
|
|
610
|
+
.bar-default-modal-icon {
|
|
611
|
+
width: 15px;
|
|
612
|
+
height: 15px;
|
|
613
|
+
}
|
|
614
614
|
.slide-menu-top-bar {
|
|
615
615
|
width: 100%;
|
|
616
616
|
top: 0;
|
|
@@ -1,27 +1,22 @@
|
|
|
1
1
|
import { Badge } from './Badge.js';
|
|
2
2
|
import { BtnIcon } from './BtnIcon.js';
|
|
3
3
|
import { rgbToHex } from './CommonJs.js';
|
|
4
|
-
import { Css, darkTheme, dynamicCol, renderCssAttr, ThemeEvents, Themes } from './Css.js';
|
|
4
|
+
import { Css, darkTheme, dynamicCol, renderCssAttr, simpleIconsRender, ThemeEvents, Themes } from './Css.js';
|
|
5
5
|
import { DropDown } from './DropDown.js';
|
|
6
6
|
import { buildBadgeToolTipMenuOption, Modal, renderMenuLabel, renderViewTitle } from './Modal.js';
|
|
7
7
|
import { listenQueryPathInstance, setQueryPath } from './Router.js';
|
|
8
8
|
import { Translate } from './Translate.js';
|
|
9
|
-
import { getProxyPath, getQueryParams, htmls, s } from './VanillaJs.js';
|
|
9
|
+
import { getProxyPath, getQueryParams, htmls, s, sa } from './VanillaJs.js';
|
|
10
10
|
import Sortable from 'sortablejs';
|
|
11
11
|
|
|
12
12
|
// https://mintlify.com/docs/quickstart
|
|
13
13
|
|
|
14
|
-
const umlTypes = ['server', 'cron', 'client', 'ssr'];
|
|
15
|
-
|
|
16
14
|
const Docs = {
|
|
17
15
|
RenderModal: async function (type, modalOptions) {
|
|
18
16
|
const docData = this.Data.find((d) => d.type === type);
|
|
19
17
|
const ModalId = `modal-docs-${docData.type}`;
|
|
20
18
|
const { barConfig } = await Themes[Css.currentTheme]();
|
|
21
|
-
|
|
22
|
-
setQueryPath({ path: 'docs' });
|
|
23
|
-
Modal.removeModal(ModalId);
|
|
24
|
-
};
|
|
19
|
+
|
|
25
20
|
await Modal.Render({
|
|
26
21
|
barConfig,
|
|
27
22
|
title: renderViewTitle(docData),
|
|
@@ -48,8 +43,16 @@ const Docs = {
|
|
|
48
43
|
Modal.Data[ModalId].onObserverListener[ModalId] = () => {
|
|
49
44
|
if (s(`.iframe-${ModalId}`))
|
|
50
45
|
s(`.iframe-${ModalId}`).style.height = `${s(`.${ModalId}`).offsetHeight - Modal.headerTitleHeight}px`;
|
|
46
|
+
|
|
47
|
+
if (type.match('coverage')) {
|
|
48
|
+
simpleIconsRender(`.doc-icon-coverage`);
|
|
49
|
+
simpleIconsRender(`.doc-icon-coverage-link`);
|
|
50
|
+
}
|
|
51
51
|
};
|
|
52
52
|
Modal.Data[ModalId].onObserverListener[ModalId]();
|
|
53
|
+
Modal.Data[ModalId].onCloseListener[ModalId] = () => {
|
|
54
|
+
setQueryPath({ path: 'docs', queryPath: '' });
|
|
55
|
+
};
|
|
53
56
|
},
|
|
54
57
|
Data: [
|
|
55
58
|
{
|
|
@@ -98,10 +101,7 @@ const Docs = {
|
|
|
98
101
|
return `${getProxyPath()}docs/coverage`;
|
|
99
102
|
},
|
|
100
103
|
themeEvent: () => {
|
|
101
|
-
if (s(`.doc-icon-coverage`))
|
|
102
|
-
s(`.doc-icon-coverage`).src = `https://cdn.simpleicons.org/coveralls/${rgbToHex(
|
|
103
|
-
window.getComputedStyle(s('html')).color,
|
|
104
|
-
)}`;
|
|
104
|
+
if (s(`.doc-icon-coverage`)) setTimeout(() => simpleIconsRender(`.doc-icon-coverage`));
|
|
105
105
|
},
|
|
106
106
|
},
|
|
107
107
|
{
|
|
@@ -112,43 +112,10 @@ const Docs = {
|
|
|
112
112
|
return `https://coveralls.io/github/underpostnet/engine`;
|
|
113
113
|
},
|
|
114
114
|
themeEvent: () => {
|
|
115
|
-
if (s(`.doc-icon-coverage-link`))
|
|
116
|
-
s(`.doc-icon-coverage-link`).src = `https://cdn.simpleicons.org/coveralls/${rgbToHex(
|
|
117
|
-
window.getComputedStyle(s('html')).color,
|
|
118
|
-
)}`;
|
|
115
|
+
if (s(`.doc-icon-coverage-link`)) setTimeout(() => simpleIconsRender(`.doc-icon-coverage-link`));
|
|
119
116
|
},
|
|
120
117
|
},
|
|
121
|
-
]
|
|
122
|
-
umlTypes.map((umlType) => {
|
|
123
|
-
const umlId = `uml-${umlType}`;
|
|
124
|
-
return {
|
|
125
|
-
type: umlId,
|
|
126
|
-
icon: html`<i class="fas fa-sitemap"></i>`,
|
|
127
|
-
text: Translate.Render(`${umlType} config uml`),
|
|
128
|
-
url: function () {
|
|
129
|
-
return `/docs/?cid=${umlId}`;
|
|
130
|
-
},
|
|
131
|
-
renderHtml: function () {
|
|
132
|
-
return html` <div class="in section-mp">
|
|
133
|
-
<div class="in sub-title-modal"><i class="fas fa-project-diagram"></i> Schema</div>
|
|
134
|
-
</div>
|
|
135
|
-
<div class="in section-mp">
|
|
136
|
-
<a href="${getProxyPath()}docs/plantuml/${umlType}-schema.svg" target="_blank"
|
|
137
|
-
><img class="in plantuml-svg" src="${getProxyPath()}docs/plantuml/${umlType}-schema.svg"
|
|
138
|
-
/></a>
|
|
139
|
-
</div>
|
|
140
|
-
<div class="in section-mp">
|
|
141
|
-
<div class="in sub-title-modal"><i class="fas fa-project-diagram"></i> Instance example</div>
|
|
142
|
-
</div>
|
|
143
|
-
<div class="in section-mp">
|
|
144
|
-
<a href="${getProxyPath()}docs/plantuml/${umlType}-conf.svg" target="_blank"
|
|
145
|
-
><img class="in plantuml-svg" src="${getProxyPath()}docs/plantuml/${umlType}-conf.svg"
|
|
146
|
-
/></a>
|
|
147
|
-
</div>`;
|
|
148
|
-
},
|
|
149
|
-
};
|
|
150
|
-
}),
|
|
151
|
-
),
|
|
118
|
+
],
|
|
152
119
|
Tokens: {},
|
|
153
120
|
Init: async function (options) {
|
|
154
121
|
const { idModal } = options;
|
|
@@ -158,10 +125,6 @@ const Docs = {
|
|
|
158
125
|
s(`.btn-docs-src`).classList.remove('main-btn-menu-active');
|
|
159
126
|
s(`.btn-docs-api`).classList.remove('main-btn-menu-active');
|
|
160
127
|
s(`.btn-docs-coverage`).classList.remove('main-btn-menu-active');
|
|
161
|
-
for (const umlType of umlTypes) {
|
|
162
|
-
const umlId = `uml-${umlType}`;
|
|
163
|
-
s(`.btn-docs-${umlId}`).classList.remove('main-btn-menu-active');
|
|
164
|
-
}
|
|
165
128
|
};
|
|
166
129
|
s(`.btn-docs-src`).onclick = async () => {
|
|
167
130
|
setQueryPath({ path: 'docs', queryPath: 'src' });
|
|
@@ -195,16 +158,6 @@ const Docs = {
|
|
|
195
158
|
location.href = docData.url();
|
|
196
159
|
};
|
|
197
160
|
|
|
198
|
-
for (const umlType of umlTypes) {
|
|
199
|
-
const umlId = `uml-${umlType}`;
|
|
200
|
-
s(`.btn-docs-${umlId}`).onclick = async () => {
|
|
201
|
-
cleanActive();
|
|
202
|
-
s(`.btn-docs-${umlId}`).classList.add('main-btn-menu-active');
|
|
203
|
-
setQueryPath({ path: 'docs', queryPath: umlId });
|
|
204
|
-
await this.RenderModal(umlId, { ...options.modalOptions, handleType: 'bar' });
|
|
205
|
-
};
|
|
206
|
-
}
|
|
207
|
-
|
|
208
161
|
listenQueryPathInstance({
|
|
209
162
|
id: options.idModal,
|
|
210
163
|
routeId: 'docs',
|