underpost 2.8.881 → 2.8.883

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.
Files changed (36) hide show
  1. package/.github/workflows/release.cd.yml +1 -2
  2. package/README.md +50 -36
  3. package/bin/db.js +1 -4
  4. package/cli.md +86 -86
  5. package/conf.js +1 -0
  6. package/manifests/deployment/dd-default-development/deployment.yaml +2 -2
  7. package/manifests/deployment/dd-test-development/deployment.yaml +6 -6
  8. package/manifests/maas/device-scan.sh +1 -1
  9. package/package.json +1 -1
  10. package/src/api/document/document.service.js +9 -1
  11. package/src/cli/repository.js +2 -0
  12. package/src/client/components/core/Auth.js +258 -89
  13. package/src/client/components/core/BtnIcon.js +10 -1
  14. package/src/client/components/core/CssCore.js +36 -27
  15. package/src/client/components/core/Docs.js +188 -85
  16. package/src/client/components/core/LoadingAnimation.js +5 -10
  17. package/src/client/components/core/Modal.js +262 -120
  18. package/src/client/components/core/ObjectLayerEngine.js +154 -158
  19. package/src/client/components/core/Panel.js +2 -0
  20. package/src/client/components/core/PanelForm.js +94 -60
  21. package/src/client/components/core/Router.js +15 -15
  22. package/src/client/components/core/ToolTip.js +83 -19
  23. package/src/client/components/core/Translate.js +1 -1
  24. package/src/client/components/core/VanillaJs.js +4 -3
  25. package/src/client/components/core/windowGetDimensions.js +202 -0
  26. package/src/client/components/default/MenuDefault.js +11 -0
  27. package/src/client/ssr/Render.js +1 -1
  28. package/src/index.js +1 -1
  29. package/src/runtime/lampp/Lampp.js +253 -128
  30. package/src/server/auth.js +68 -17
  31. package/src/server/crypto.js +195 -76
  32. package/src/server/peer.js +47 -5
  33. package/src/server/process.js +85 -1
  34. package/src/server/runtime.js +13 -32
  35. package/test/crypto.test.js +117 -0
  36. package/src/runtime/xampp/Xampp.js +0 -83
@@ -1,12 +1,9 @@
1
1
  import { Badge } from './Badge.js';
2
2
  import { BtnIcon } from './BtnIcon.js';
3
3
  import { Css, renderCssAttr, simpleIconsRender, ThemeEvents, Themes } from './Css.js';
4
- import { DropDown } from './DropDown.js';
5
- import { buildBadgeToolTipMenuOption, Modal, renderMenuLabel, renderViewTitle } from './Modal.js';
4
+ import { buildBadgeToolTipMenuOption, Modal, renderViewTitle } from './Modal.js';
6
5
  import { listenQueryPathInstance, setQueryPath, closeModalRouteChangeEvent, getProxyPath } from './Router.js';
7
- import { Translate } from './Translate.js';
8
6
  import { htmls, s } from './VanillaJs.js';
9
- import Sortable from 'sortablejs';
10
7
 
11
8
  // https://mintlify.com/docs/quickstart
12
9
 
@@ -160,6 +157,11 @@ const Docs = {
160
157
  routeId: 'docs',
161
158
  event: (path) => {
162
159
  if (s(`.btn-docs-${path}`)) s(`.btn-docs-${path}`).click();
160
+ if (Modal.mobileModal()) {
161
+ setTimeout(() => {
162
+ s(`.btn-close-modal-menu`).click();
163
+ });
164
+ }
163
165
  },
164
166
  });
165
167
  });
@@ -183,98 +185,199 @@ const Docs = {
183
185
  tabHref = docData.url();
184
186
  docMenuRender += html`
185
187
  ${await BtnIcon.Render({
186
- class: `in wfa main-btn-menu btn-docs-${docData.type}`,
187
- label: html`<span class="menu-btn-icon">${docData.icon}</span
188
- ><span class="menu-label-text"> ${docData.text} </span>`,
188
+ class: `in wfa main-btn-menu submenu-btn btn-docs btn-docs-${docData.type}`,
189
+ label: html`<span class="inl menu-btn-icon">${docData.icon}</span
190
+ ><span class="menu-label-text menu-label-text-docs"> ${docData.text} </span>`,
189
191
  tabHref,
190
- handleContainerClass: 'handle-btn-container',
191
192
  tooltipHtml: await Badge.Render(buildBadgeToolTipMenuOption(docData.text, 'right')),
192
- attrs: `data-id="${docData.type}"`,
193
- handleContainerClass: 'handle-btn-container',
193
+ useMenuBtn: true,
194
194
  })}
195
195
  `;
196
196
  }
197
+ // s(`.menu-btn-container-children`).classList.remove('hide');
198
+ // htmls(`.nav-path-display-${'modal-menu'}`, location.pathname);
197
199
 
198
- htmls('.menu-btn-container-children', html` <div class="fl menu-btn-container-docs">${docMenuRender}</div>`);
199
- if (s(`.menu-btn-container-main`)) s(`.menu-btn-container-main`).classList.add('hide');
200
- htmls(`.nav-path-display-${'modal-menu'}`, location.pathname);
200
+ htmls('.menu-btn-container-children-docs', docMenuRender);
201
201
 
202
- this.Tokens[idModal] = new Sortable(s(`.menu-btn-container-docs`), {
203
- animation: 150,
204
- group: `docs-sortable`,
205
- forceFallback: true,
206
- fallbackOnBody: true,
207
- handle: '.handle-btn-container',
208
- store: {
209
- /**
210
- * Get the order of elements. Called once during initialization.
211
- * @param {Sortable} sortable
212
- * @returns {Array}
213
- */
214
- get: function (sortable) {
215
- const order = localStorage.getItem(sortable.options.group.name);
216
- return order ? order.split('|') : [];
202
+ {
203
+ const docsData = [
204
+ {
205
+ id: 'getting-started',
206
+ icon: 'rocket',
207
+ title: 'Getting Started',
208
+ description: 'Learn the basics and get started with our platform',
217
209
  },
218
-
219
- /**
220
- * Save the order of elements. Called onEnd (when the item is dropped).
221
- * @param {Sortable} sortable
222
- */
223
- set: function (sortable) {
224
- const order = sortable.toArray();
225
- localStorage.setItem(sortable.options.group.name, order.join('|'));
210
+ {
211
+ id: 'api-docs',
212
+ icon: 'code',
213
+ title: 'API Reference',
214
+ description: 'Detailed documentation of our API endpoints',
226
215
  },
227
- },
228
- // chosenClass: 'css-class',
229
- // ghostClass: 'css-class',
230
- // Element dragging ended
231
- onEnd: function (/**Event*/ evt) {
232
- // console.log('Sortable onEnd', evt);
233
- // console.log('evt.oldIndex', evt.oldIndex);
234
- // console.log('evt.newIndex', evt.newIndex);
235
- const slotId = Array.from(evt.item.classList).pop();
236
- // console.log('slotId', slotId);
237
- if (evt.oldIndex === evt.newIndex) s(`.${slotId}`).click();
216
+ {
217
+ id: 'guides',
218
+ icon: 'book',
219
+ title: 'Guides',
220
+ description: 'Step-by-step tutorials and how-to guides',
221
+ },
222
+ {
223
+ id: 'demo',
224
+ icon: 'laptop-code',
225
+ title: 'Demo',
226
+ description: 'Practical examples and code snippets',
227
+ },
228
+ {
229
+ id: 'faq',
230
+ icon: 'question-circle',
231
+ title: 'FAQ',
232
+ description: 'Frequently asked questions',
233
+ },
234
+ {
235
+ id: 'community',
236
+ icon: 'users',
237
+ title: 'Community',
238
+ description: 'Join our developer community',
239
+ },
240
+ ];
238
241
 
239
- // var itemEl = evt.item; // dragged HTMLElement
240
- // evt.to; // target list
241
- // evt.from; // previous list
242
- // evt.oldIndex; // element's old index within old parent
243
- // evt.newIndex; // element's new index within new parent
244
- // evt.oldDraggableIndex; // element's old index within old parent, only counting draggable elements
245
- // evt.newDraggableIndex; // element's new index within new parent, only counting draggable elements
246
- // evt.clone; // the clone element
247
- // evt.pullMode; // when item is in another sortable: `"clone"` if cloning, `true` if moving
248
- },
249
- });
242
+ return html`
243
+ <style>
244
+ .docs-landing {
245
+ padding: 2rem;
246
+ max-width: 1200px;
247
+ margin: 0 auto;
248
+ height: 100%;
249
+ box-sizing: border-box;
250
+ }
251
+ .docs-header {
252
+ text-align: center;
253
+ margin-bottom: 3rem;
254
+ opacity: 0;
255
+ animation: fadeInUp 0.6s ease-out forwards;
256
+ }
257
+ .docs-header h1 {
258
+ font-size: 2.5rem;
259
+ margin: 0 0 1rem;
260
+ line-height: 1.2;
261
+ }
262
+ .docs-header p {
263
+ font-size: 1.2rem;
264
+ max-width: 700px;
265
+ margin: 0 auto 2rem;
266
+ line-height: 1.6;
267
+ }
268
+ .docs-grid {
269
+ display: grid;
270
+ grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
271
+ gap: 1.5rem;
272
+ margin: 0;
273
+ padding: 0;
274
+ list-style: none;
275
+ }
276
+ .docs-card-container {
277
+ cursor: pointer;
278
+ opacity: 0;
279
+ margin-bottom: 3rem;
280
+ animation: fadeInUp 0.6s ease-out forwards;
281
+ }
282
+ .docs-card {
283
+ border-radius: 8px;
284
+ padding: 1.5rem;
285
+ display: flex;
286
+ flex-direction: column;
287
+ height: 100%;
288
+ position: relative;
289
+ transition: all 0.3s ease-in-out;
290
+ }
291
+
292
+ .card-icon {
293
+ font-size: 1.75rem;
294
+ width: 56px;
295
+ height: 56px;
296
+ border-radius: 12px;
297
+ display: flex;
298
+ align-items: center;
299
+ justify-content: center;
300
+ margin: 0 0 1.25rem;
301
+ transition: transform 0.2s ease;
302
+ }
303
+
304
+ .card-content {
305
+ flex: 1;
306
+ }
307
+ .card-content h3 {
308
+ margin: 0 0 0.5rem;
309
+ font-size: 1.25rem;
310
+ font-weight: 600;
311
+ }
312
+ .card-content p {
313
+ margin: 0;
314
+ font-size: 0.95rem;
315
+ transition: color 0.3s ease;
316
+ }
317
+ </style>
318
+
319
+ <style>
320
+ ${docsData
321
+ .map(
322
+ (_, index) => css`
323
+ .docs-card-container:nth-child(${index + 1}) {
324
+ animation-delay: ${0.1 * (index + 1)}s;
325
+ }
326
+ `,
327
+ )
328
+ .join('')}
329
+ </style>
250
330
 
251
- return '';
252
- return html` <div class="in section-mp">${docMenuRender}</div>`;
253
- return html` <div class="in section-mp">
254
- ${await DropDown.Render({
255
- id: 'dropdown-docs',
256
- disableClose: true,
257
- disableSelectLabel: true,
258
- disableSelectOptionsLabel: true,
259
- disableSearchBox: true,
260
- open: true,
261
- lastSelectClass: 'hover-active',
262
- label: renderMenuLabel({
263
- icon: html`<i class="fas fa-book"></i>`,
264
- text: html`${Translate.Render('docs')}`,
265
- }),
266
- containerClass: '',
267
- data: this.Data.map((docTypeData) => {
268
- return {
269
- display: docTypeData.label,
270
- value: docTypeData.type,
271
- onClick: async () => {
272
- console.warn(this.viewUrl[docTypeData.type]());
273
- },
274
- };
275
- }),
276
- })}
277
- </div>`;
331
+ <div class="docs-landing">
332
+ <div class="docs-header">
333
+ <h1>Documentation</h1>
334
+ <p>
335
+ Find everything you need to build amazing applications with our platform. Get started with our guides, API
336
+ reference, and examples.
337
+ </p>
338
+ <!--
339
+ <div class="search-bar">
340
+ <i class="fas fa-search"></i>
341
+ <input type="text" placeholder="Search documentation..." id="docs-search">
342
+ </div>
343
+ -->
344
+ </div>
345
+
346
+ <ul class="docs-grid">
347
+ ${docsData
348
+ .map((item) => {
349
+ setTimeout(() => {
350
+ if (s(`.docs-card-container-${item.id}`)) {
351
+ s(`.docs-card-container-${item.id}`).onclick = () => {
352
+ if (item.id.match('demo')) {
353
+ location.href = 'https://underpostnet.github.io/pwa-microservices-template-ghpkg/';
354
+ } else if (item.id.match('api')) {
355
+ if (s(`.btn-docs-api`)) s(`.btn-docs-api`).click();
356
+ } else {
357
+ if (s(`.btn-docs-src`)) s(`.btn-docs-src`).click();
358
+ }
359
+ };
360
+ }
361
+ });
362
+ return html`
363
+ <div class="in docs-card-container docs-card-container-${item.id}">
364
+ <li class="docs-card">
365
+ <div class="card-icon">
366
+ <i class="fas fa-${item.icon}"></i>
367
+ </div>
368
+ <div class="card-content">
369
+ <h3>${item.title}</h3>
370
+ <p>${item.description}</p>
371
+ </div>
372
+ </li>
373
+ </div>
374
+ `;
375
+ })
376
+ .join('')}
377
+ </ul>
378
+ </div>
379
+ `;
380
+ }
278
381
  },
279
382
  };
280
383
 
@@ -129,16 +129,11 @@ const LoadingAnimation = {
129
129
  removeSplashScreen: function (backgroundContainer, callBack) {
130
130
  if (s(`.clean-cache-container`)) s(`.clean-cache-container`).style.display = 'none';
131
131
  if (!backgroundContainer) backgroundContainer = '.ssr-background';
132
- if (s(backgroundContainer))
133
- setTimeout(() => {
134
- s(backgroundContainer).style.opacity = 0;
135
- setTimeout(async () => {
136
- s(backgroundContainer).style.display = 'none';
137
- if (s(`.modal-menu`)) s(`.modal-menu`).classList.remove('hide');
138
- if (s(`.main-body-btn-container`)) s(`.main-body-btn-container`).classList.remove('hide');
139
- if (callBack) callBack();
140
- }, 300);
141
- });
132
+ if (s(backgroundContainer)) {
133
+ s(backgroundContainer).style.display = 'none';
134
+ if (s(`.main-body-btn-container`)) s(`.main-body-btn-container`).classList.remove('hide');
135
+ if (callBack) callBack();
136
+ }
142
137
  },
143
138
 
144
139
  RenderCurrentSrcLoad: function (event) {