underpost 3.2.5 → 3.2.8
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/.github/workflows/release.cd.yml +1 -2
- package/CHANGELOG.md +251 -1
- package/CLI-HELP.md +26 -13
- package/Dockerfile +0 -4
- package/README.md +3 -3
- package/bin/build.js +13 -3
- package/bin/deploy.js +570 -1
- package/bin/file.js +5 -0
- package/conf.js +11 -2
- package/jsconfig.json +1 -1
- package/manifests/cronjobs/dd-cron/dd-cron-backup.yaml +1 -1
- package/manifests/cronjobs/dd-cron/dd-cron-dns.yaml +1 -1
- package/manifests/deployment/dd-default-development/deployment.yaml +2 -6
- package/manifests/deployment/dd-test-development/deployment.yaml +136 -66
- package/manifests/deployment/dd-test-development/proxy.yaml +41 -5
- package/package.json +20 -11
- package/src/api/core/core.controller.js +10 -10
- package/src/api/core/core.service.js +10 -10
- package/src/api/default/default.controller.js +10 -10
- package/src/api/default/default.service.js +10 -10
- package/src/api/document/document.controller.js +12 -12
- package/src/api/document/document.model.js +10 -16
- package/src/api/file/file.controller.js +8 -8
- package/src/api/file/file.model.js +10 -10
- package/src/api/file/file.service.js +36 -36
- package/src/api/test/test.controller.js +8 -8
- package/src/api/test/test.service.js +8 -8
- package/src/api/user/guest.service.js +99 -0
- package/src/api/user/user.controller.js +6 -6
- package/src/api/user/user.model.js +8 -13
- package/src/api/user/user.service.js +3 -20
- package/src/cli/deploy.js +33 -30
- package/src/cli/fs.js +62 -5
- package/src/cli/image.js +43 -1
- package/src/cli/index.js +5 -1
- package/src/cli/release.js +57 -1
- package/src/cli/repository.js +35 -3
- package/src/cli/run.js +300 -35
- package/src/cli/ssh.js +1 -1
- package/src/cli/static.js +43 -115
- package/src/client/Default.index.js +21 -33
- package/src/client/components/core/404.js +4 -4
- package/src/client/components/core/500.js +4 -4
- package/src/client/components/core/Account.js +73 -60
- package/src/client/components/core/AgGrid.js +23 -33
- package/src/client/components/core/Alert.js +12 -13
- package/src/client/components/core/AppStore.js +1 -1
- package/src/client/components/core/Auth.js +20 -32
- package/src/client/components/core/Badge.js +7 -13
- package/src/client/components/core/BtnIcon.js +15 -17
- package/src/client/components/core/CalendarCore.js +42 -63
- package/src/client/components/core/Chat.js +13 -15
- package/src/client/components/core/ClientEvents.js +87 -0
- package/src/client/components/core/ColorPaletteElement.js +309 -0
- package/src/client/components/core/Content.js +17 -14
- package/src/client/components/core/Css.js +15 -71
- package/src/client/components/core/CssCore.js +12 -16
- package/src/client/components/core/D3Chart.js +4 -4
- package/src/client/components/core/Docs.js +60 -59
- package/src/client/components/core/DropDown.js +69 -91
- package/src/client/components/core/EventBus.js +92 -0
- package/src/client/components/core/EventsUI.js +14 -17
- package/src/client/components/core/FileExplorer.js +102 -234
- package/src/client/components/core/FullScreen.js +47 -75
- package/src/client/components/core/Input.js +24 -69
- package/src/client/components/core/Keyboard.js +25 -18
- package/src/client/components/core/KeyboardAvoidance.js +145 -0
- package/src/client/components/core/LoadingAnimation.js +25 -31
- package/src/client/components/core/LogIn.js +41 -41
- package/src/client/components/core/LogOut.js +23 -14
- package/src/client/components/core/Modal.js +397 -176
- package/src/client/components/core/NotificationManager.js +14 -18
- package/src/client/components/core/Panel.js +54 -50
- package/src/client/components/core/PanelForm.js +25 -125
- package/src/client/components/core/Polyhedron.js +110 -214
- package/src/client/components/core/PublicProfile.js +39 -32
- package/src/client/components/core/Recover.js +52 -48
- package/src/client/components/core/Responsive.js +88 -32
- package/src/client/components/core/RichText.js +9 -18
- package/src/client/components/core/Router.js +24 -3
- package/src/client/components/core/SearchBox.js +37 -37
- package/src/client/components/core/SignUp.js +39 -30
- package/src/client/components/core/SocketIo.js +31 -2
- package/src/client/components/core/SocketIoHandler.js +6 -6
- package/src/client/components/core/ToggleSwitch.js +8 -20
- package/src/client/components/core/ToolTip.js +5 -17
- package/src/client/components/core/Translate.js +56 -59
- package/src/client/components/core/Validator.js +26 -16
- package/src/client/components/core/Wallet.js +15 -26
- package/src/client/components/core/Worker.js +140 -25
- package/src/client/components/core/windowGetDimensions.js +7 -7
- package/src/client/components/default/{MenuDefault.js → AppShellDefault.js} +87 -87
- package/src/client/components/default/CssDefault.js +12 -12
- package/src/client/components/default/LogInDefault.js +6 -4
- package/src/client/components/default/LogOutDefault.js +6 -4
- package/src/client/components/default/RouterDefault.js +47 -0
- package/src/client/components/default/SettingsDefault.js +4 -4
- package/src/client/components/default/SignUpDefault.js +6 -4
- package/src/client/components/default/TranslateDefault.js +3 -3
- package/src/client/services/core/core.service.js +17 -49
- package/src/client/services/default/default.management.js +139 -242
- package/src/client/services/default/default.service.js +10 -16
- package/src/client/services/document/document.service.js +14 -19
- package/src/client/services/file/file.service.js +8 -13
- package/src/client/services/test/test.service.js +8 -13
- package/src/client/services/user/guest.service.js +79 -0
- package/src/client/services/user/user.management.js +5 -5
- package/src/client/services/user/user.service.js +14 -20
- package/src/client/ssr/body/404.js +3 -3
- package/src/client/ssr/body/500.js +3 -3
- package/src/client/ssr/body/CacheControl.js +5 -2
- package/src/client/ssr/body/DefaultSplashScreen.js +19 -12
- package/src/client/ssr/mailer/DefaultRecoverEmail.js +19 -20
- package/src/client/ssr/mailer/DefaultVerifyEmail.js +15 -16
- package/src/client/ssr/offline/Maintenance.js +12 -11
- package/src/client/ssr/offline/NoNetworkConnection.js +3 -3
- package/src/client/ssr/pages/Test.js +2 -2
- package/src/client/sw/core.sw.js +212 -0
- package/src/index.js +1 -1
- package/src/runtime/express/Dockerfile +4 -4
- package/src/runtime/lampp/Dockerfile +8 -7
- package/src/runtime/wp/Dockerfile +11 -17
- package/src/server/client-build-docs.js +45 -46
- package/src/server/client-build.js +334 -60
- package/src/server/client-formatted.js +47 -16
- package/src/server/conf.js +5 -4
- package/src/server/ipfs-client.js +232 -91
- package/src/server/process.js +13 -27
- package/src/server/start.js +6 -3
- package/src/server/valkey.js +134 -235
- package/tsconfig.docs.json +15 -0
- package/typedoc.json +20 -0
- package/jsdoc.json +0 -52
- package/src/client/components/core/ColorPalette.js +0 -5267
- package/src/client/components/core/JoyStick.js +0 -80
- package/src/client/components/default/RoutesDefault.js +0 -49
- package/src/client/sw/default.sw.js +0 -127
- package/src/client/sw/template.sw.js +0 -84
|
@@ -12,9 +12,15 @@ import { EventsUI } from './EventsUI.js';
|
|
|
12
12
|
import { LoadingAnimation } from './LoadingAnimation.js';
|
|
13
13
|
import { loggerFactory } from './Logger.js';
|
|
14
14
|
import { LoadRouter } from './Router.js';
|
|
15
|
+
import { registerRoutes } from './Router.js';
|
|
15
16
|
import { Translate } from './Translate.js';
|
|
16
17
|
import { s } from './VanillaJs.js';
|
|
17
18
|
import { getProxyPath } from './Router.js';
|
|
19
|
+
import { Css } from './Css.js';
|
|
20
|
+
import { TranslateCore } from './Translate.js';
|
|
21
|
+
import { Responsive } from './Responsive.js';
|
|
22
|
+
import { SocketIo } from './SocketIo.js';
|
|
23
|
+
import { Keyboard } from './Keyboard.js';
|
|
18
24
|
const logger = loggerFactory(import.meta);
|
|
19
25
|
|
|
20
26
|
/**
|
|
@@ -71,17 +77,39 @@ class PwaWorker {
|
|
|
71
77
|
return window.renderPayload.dev || location.origin.match('localhost') || location.origin.match('127.0.0.1');
|
|
72
78
|
}
|
|
73
79
|
|
|
80
|
+
async runComponentInit(component, options) {
|
|
81
|
+
if (!component) return;
|
|
82
|
+
if (Array.isArray(component)) {
|
|
83
|
+
for (const item of component) await this.runComponentInit(item, options);
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
if (typeof component.instance === 'function') {
|
|
87
|
+
await component.instance(options);
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
if (typeof component === 'function') {
|
|
91
|
+
await component(options);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
74
95
|
/**
|
|
75
|
-
*
|
|
76
|
-
*
|
|
77
|
-
*
|
|
78
|
-
*
|
|
79
|
-
* @param {object} options
|
|
80
|
-
* @param {function(): object}
|
|
81
|
-
* @param {function(): Promise<
|
|
96
|
+
* Bootstraps the app with a declarative options object.
|
|
97
|
+
* Shared core inits (Css, TranslateCore, Responsive, SocketIo, Keyboard) run
|
|
98
|
+
* internally in the correct order so index entrypoints only list app-specific components.
|
|
99
|
+
*
|
|
100
|
+
* @param {object} options
|
|
101
|
+
* @param {function(): object} options.router - Function returning the router instance.
|
|
102
|
+
* @param {function(): Promise<string>} [options.template] - Async function returning the landing HTML body.
|
|
103
|
+
* @param {Array} [options.themes] - CSS theme array passed to Css.loadThemes().
|
|
104
|
+
* @param {object|Array} [options.translate] - App translate class(es) with static instance().
|
|
105
|
+
* @param {object} [options.render] - AppShell class with static instance().
|
|
106
|
+
* @param {string} [options.socketPath] - Socket.IO path override.
|
|
107
|
+
* @param {object} [options.appStore] - AppStore whose .Data is used for socket channels.
|
|
108
|
+
* @param {object} [options.session] - Session components: { socket, login, signout, signup }.
|
|
109
|
+
* @param {function(): Promise<void>} [options.render] - Legacy raw render callback (backward-compat).
|
|
82
110
|
* @returns {Promise<void>}
|
|
83
111
|
*/
|
|
84
|
-
async instance({ router, render }) {
|
|
112
|
+
async instance({ router, template, themes, translate, render, socketPath, appStore, session }) {
|
|
85
113
|
window.ononline = async () => {
|
|
86
114
|
logger.warn('ononline');
|
|
87
115
|
};
|
|
@@ -131,10 +159,39 @@ class PwaWorker {
|
|
|
131
159
|
});
|
|
132
160
|
}
|
|
133
161
|
|
|
134
|
-
this.RouterInstance = router();
|
|
162
|
+
this.RouterInstance = typeof router?.instance === 'function' ? router.instance() : router();
|
|
163
|
+
if (this.RouterInstance?.Routes) registerRoutes(this.RouterInstance.Routes);
|
|
135
164
|
const isInstall = await this.status();
|
|
136
165
|
if (!isInstall) await this.install();
|
|
137
|
-
|
|
166
|
+
|
|
167
|
+
// ── declarative bootstrap path ──────────────────────────────────────────
|
|
168
|
+
if (typeof render !== 'function' || render.instance) {
|
|
169
|
+
// shared core inits
|
|
170
|
+
if (themes) await Css.loadThemes(themes);
|
|
171
|
+
await this.runComponentInit(TranslateCore);
|
|
172
|
+
await this.runComponentInit(translate);
|
|
173
|
+
await this.runComponentInit(Responsive);
|
|
174
|
+
// app shell render
|
|
175
|
+
if (render && typeof render.instance === 'function') {
|
|
176
|
+
const htmlMainBody = typeof template === 'function' ? template : undefined;
|
|
177
|
+
await this.runComponentInit(render, htmlMainBody ? { htmlMainBody } : undefined);
|
|
178
|
+
}
|
|
179
|
+
// socket init
|
|
180
|
+
const channels = appStore ? appStore.Data : (session && session.socket && session.socket.Data) || undefined;
|
|
181
|
+
await this.runComponentInit(SocketIo, { channels, path: socketPath });
|
|
182
|
+
if (session) {
|
|
183
|
+
await this.runComponentInit(session.socket);
|
|
184
|
+
await this.runComponentInit(session.login);
|
|
185
|
+
await this.runComponentInit(session.logout || session.signout);
|
|
186
|
+
await this.runComponentInit(session.signup);
|
|
187
|
+
await this.runComponentInit(session.account);
|
|
188
|
+
}
|
|
189
|
+
await this.runComponentInit(Keyboard);
|
|
190
|
+
} else {
|
|
191
|
+
// ── legacy raw render callback (backward-compat) ─────────────────────
|
|
192
|
+
await render();
|
|
193
|
+
}
|
|
194
|
+
// ────────────────────────────────────────────────────────────────────────
|
|
138
195
|
await LoadRouter(this.RouterInstance);
|
|
139
196
|
LoadingAnimation.removeSplashScreen();
|
|
140
197
|
if (this.devMode()) {
|
|
@@ -178,6 +235,68 @@ class PwaWorker {
|
|
|
178
235
|
});
|
|
179
236
|
}
|
|
180
237
|
|
|
238
|
+
async clearAllCaches() {
|
|
239
|
+
const cacheNames = await caches.keys();
|
|
240
|
+
await Promise.all(cacheNames.map((cacheName) => caches.delete(cacheName)));
|
|
241
|
+
return cacheNames.length;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
async clearWorkboxIndexedDb() {
|
|
245
|
+
if (!('indexedDB' in window) || typeof indexedDB.databases !== 'function') return 0;
|
|
246
|
+
const databases = await indexedDB.databases();
|
|
247
|
+
const workboxDatabases = databases
|
|
248
|
+
.map((database) => database.name)
|
|
249
|
+
.filter(
|
|
250
|
+
(name) =>
|
|
251
|
+
typeof name === 'string' &&
|
|
252
|
+
(name.toLowerCase().includes('workbox') ||
|
|
253
|
+
name.toLowerCase().includes('background-sync') ||
|
|
254
|
+
name.includes('api-mutation-queue')),
|
|
255
|
+
);
|
|
256
|
+
|
|
257
|
+
await Promise.all(
|
|
258
|
+
workboxDatabases.map(
|
|
259
|
+
(name) =>
|
|
260
|
+
new Promise((resolve) => {
|
|
261
|
+
const request = indexedDB.deleteDatabase(name);
|
|
262
|
+
request.onsuccess = () => resolve(true);
|
|
263
|
+
request.onerror = () => resolve(false);
|
|
264
|
+
request.onblocked = () => resolve(false);
|
|
265
|
+
}),
|
|
266
|
+
),
|
|
267
|
+
);
|
|
268
|
+
|
|
269
|
+
return workboxDatabases.length;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
async requestWorkboxReset() {
|
|
273
|
+
if (!(navigator.serviceWorker && navigator.serviceWorker.controller)) return false;
|
|
274
|
+
|
|
275
|
+
return new Promise((resolve) => {
|
|
276
|
+
const channel = new MessageChannel();
|
|
277
|
+
const timeoutId = setTimeout(() => resolve(false), 1500);
|
|
278
|
+
|
|
279
|
+
channel.port1.onmessage = (event) => {
|
|
280
|
+
clearTimeout(timeoutId);
|
|
281
|
+
resolve(event.data?.status === 'workbox-reset-done');
|
|
282
|
+
};
|
|
283
|
+
|
|
284
|
+
navigator.serviceWorker.controller.postMessage({ status: 'workbox-reset' }, [channel.port2]);
|
|
285
|
+
});
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
async resetWorkboxAndRestart() {
|
|
289
|
+
localStorage.clear();
|
|
290
|
+
sessionStorage.clear();
|
|
291
|
+
|
|
292
|
+
await this.requestWorkboxReset();
|
|
293
|
+
await this.uninstall();
|
|
294
|
+
await this.clearAllCaches();
|
|
295
|
+
await this.clearWorkboxIndexedDb();
|
|
296
|
+
await this.install();
|
|
297
|
+
await this.reload(600);
|
|
298
|
+
}
|
|
299
|
+
|
|
181
300
|
/**
|
|
182
301
|
* Updates the application by clearing specific caches and running the service worker update logic.
|
|
183
302
|
* Cache names matching 'components/', 'services/', or '.index.js' are deleted.
|
|
@@ -242,9 +361,7 @@ class PwaWorker {
|
|
|
242
361
|
return new Promise((resolve) => {
|
|
243
362
|
if ('serviceWorker' in navigator) {
|
|
244
363
|
navigator.serviceWorker
|
|
245
|
-
.register(`${getProxyPath()}sw.js
|
|
246
|
-
type: 'module',
|
|
247
|
-
})
|
|
364
|
+
.register(`${getProxyPath()}sw.js`)
|
|
248
365
|
.then((...args) => {
|
|
249
366
|
logger.warn('Service Worker Registered', args);
|
|
250
367
|
resolve(args);
|
|
@@ -340,28 +457,26 @@ class PwaWorker {
|
|
|
340
457
|
// Event listener for the clean cache button
|
|
341
458
|
EventsUI.onClick(`.btn-clean-cache`, async (e) => {
|
|
342
459
|
e.preventDefault();
|
|
343
|
-
//
|
|
344
|
-
|
|
345
|
-
await this.uninstall();
|
|
346
|
-
await this.reload();
|
|
460
|
+
// Full reset: workbox runtime state + SW registrations + client storage.
|
|
461
|
+
await this.resetWorkboxAndRestart();
|
|
347
462
|
});
|
|
348
463
|
});
|
|
349
464
|
return html` <div class="in">
|
|
350
|
-
${await BtnIcon.
|
|
465
|
+
${await BtnIcon.instance({
|
|
351
466
|
class: 'inl section-mp btn-custom btn-install-service-controller hide',
|
|
352
|
-
label: html`<i class="fas fa-download"></i> ${Translate.
|
|
467
|
+
label: html`<i class="fas fa-download"></i> ${Translate.instance('Install control service')}`,
|
|
353
468
|
})}
|
|
354
|
-
${await BtnIcon.
|
|
469
|
+
${await BtnIcon.instance({
|
|
355
470
|
class: 'inl section-mp btn-custom btn-uninstall-service-controller hide',
|
|
356
|
-
label: html`<i class="far fa-trash-alt"></i> ${Translate.
|
|
471
|
+
label: html`<i class="far fa-trash-alt"></i> ${Translate.instance('Uninstall control service')}`,
|
|
357
472
|
})}
|
|
358
|
-
${await BtnIcon.
|
|
473
|
+
${await BtnIcon.instance({
|
|
359
474
|
class: 'inl section-mp btn-custom btn-clean-cache',
|
|
360
|
-
label: html`<i class="fa-solid fa-broom"></i> ${Translate.
|
|
475
|
+
label: html`<i class="fa-solid fa-broom"></i> ${Translate.instance('clean-cache')}`,
|
|
361
476
|
})}
|
|
362
|
-
${await BtnIcon.
|
|
477
|
+
${await BtnIcon.instance({
|
|
363
478
|
class: 'inl section-mp btn-custom btn-reload hide',
|
|
364
|
-
label: html`<i class="fas fa-sync-alt"></i> ${Translate.
|
|
479
|
+
label: html`<i class="fas fa-sync-alt"></i> ${Translate.instance('Reload')}`,
|
|
365
480
|
})}
|
|
366
481
|
</div>`;
|
|
367
482
|
}
|
|
@@ -149,23 +149,23 @@ export class PwaWindowDimensions {
|
|
|
149
149
|
* Get the best-available viewport height in pixels.
|
|
150
150
|
*
|
|
151
151
|
* Priority (from most reliable for "visible" to least):
|
|
152
|
-
* 1.
|
|
153
|
-
* 2.
|
|
154
|
-
* 3.
|
|
155
|
-
* 4.
|
|
156
|
-
* 5. window.visualViewport.height (if `preferVisualViewport` is false)
|
|
152
|
+
* 1. document.documentElement.clientHeight (Layout viewport, default — stable against iframe scrolls)
|
|
153
|
+
* 2. window.innerHeight (Window size)
|
|
154
|
+
* 3. document.body.clientHeight (Body size)
|
|
155
|
+
* 4. window.visualViewport.height (if `preferVisualViewport` is true; first priority; or last before screen fallbacks)
|
|
156
|
+
* 5. window.visualViewport.height (if `preferVisualViewport` is false — used as fallback after layout values)
|
|
157
157
|
* 6. window.screen.availHeight / window.screen.height (Physical screen)
|
|
158
158
|
* 7. window.outerHeight (Last resort)
|
|
159
159
|
*
|
|
160
160
|
* @memberof PwaWindowDimensions
|
|
161
161
|
* @static
|
|
162
162
|
* @param {Object} [options]
|
|
163
|
-
* @param {boolean} [options.preferVisualViewport=
|
|
163
|
+
* @param {boolean} [options.preferVisualViewport=false] - When true, visualViewport is checked first (best for visible screen size, e.g., above mobile keyboard). Defaults to false to use stable layout viewport height, preventing Chrome iframe scroll from causing transient visualViewport changes that affect modal sizing.
|
|
164
164
|
* @returns {number|null} Height in px (rounded integer) or null if none found.
|
|
165
165
|
* @memberof PwaWindowDimensions
|
|
166
166
|
*/
|
|
167
167
|
static getH(options = {}) {
|
|
168
|
-
const { preferVisualViewport =
|
|
168
|
+
const { preferVisualViewport = false } = options;
|
|
169
169
|
|
|
170
170
|
const vv = PwaWindowDimensions.#getFromVisualViewport();
|
|
171
171
|
const de = PwaWindowDimensions.#getFromDocumentElement();
|