underpost 2.8.881 → 2.8.882

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 (32) hide show
  1. package/.github/workflows/release.cd.yml +1 -2
  2. package/README.md +46 -36
  3. package/cli.md +86 -86
  4. package/conf.js +1 -0
  5. package/manifests/deployment/dd-default-development/deployment.yaml +2 -2
  6. package/manifests/deployment/dd-test-development/deployment.yaml +6 -6
  7. package/package.json +1 -1
  8. package/src/api/document/document.service.js +9 -1
  9. package/src/cli/repository.js +2 -0
  10. package/src/client/components/core/Auth.js +258 -89
  11. package/src/client/components/core/BtnIcon.js +10 -1
  12. package/src/client/components/core/CssCore.js +36 -27
  13. package/src/client/components/core/Docs.js +189 -85
  14. package/src/client/components/core/LoadingAnimation.js +5 -10
  15. package/src/client/components/core/Modal.js +255 -120
  16. package/src/client/components/core/ObjectLayerEngine.js +154 -158
  17. package/src/client/components/core/Panel.js +2 -0
  18. package/src/client/components/core/PanelForm.js +94 -60
  19. package/src/client/components/core/Router.js +15 -15
  20. package/src/client/components/core/ToolTip.js +83 -19
  21. package/src/client/components/core/Translate.js +1 -1
  22. package/src/client/components/core/VanillaJs.js +4 -3
  23. package/src/client/components/core/windowGetDimensions.js +202 -0
  24. package/src/client/components/default/MenuDefault.js +11 -0
  25. package/src/client/ssr/Render.js +1 -1
  26. package/src/index.js +1 -1
  27. package/src/server/auth.js +68 -17
  28. package/src/server/crypto.js +195 -76
  29. package/src/server/peer.js +47 -5
  30. package/src/server/process.js +85 -1
  31. package/src/server/runtime.js +13 -10
  32. package/test/crypto.test.js +117 -0
@@ -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
 
@@ -159,7 +156,13 @@ const Docs = {
159
156
  id: options.idModal,
160
157
  routeId: 'docs',
161
158
  event: (path) => {
159
+ Modal.subMenuBtnClass['docs'].open = !Modal.subMenuBtnClass['docs'].open;
162
160
  if (s(`.btn-docs-${path}`)) s(`.btn-docs-${path}`).click();
161
+ if (Modal.mobileModal()) {
162
+ setTimeout(() => {
163
+ s(`.btn-close-modal-menu`).click();
164
+ });
165
+ }
163
166
  },
164
167
  });
165
168
  });
@@ -183,98 +186,199 @@ const Docs = {
183
186
  tabHref = docData.url();
184
187
  docMenuRender += html`
185
188
  ${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>`,
189
+ class: `in wfa main-btn-menu submenu-btn btn-docs btn-docs-${docData.type}`,
190
+ label: html`<span class="inl menu-btn-icon">${docData.icon}</span
191
+ ><span class="menu-label-text menu-label-text-docs"> ${docData.text} </span>`,
189
192
  tabHref,
190
- handleContainerClass: 'handle-btn-container',
191
193
  tooltipHtml: await Badge.Render(buildBadgeToolTipMenuOption(docData.text, 'right')),
192
- attrs: `data-id="${docData.type}"`,
193
- handleContainerClass: 'handle-btn-container',
194
+ useMenuBtn: true,
194
195
  })}
195
196
  `;
196
197
  }
198
+ // s(`.menu-btn-container-children`).classList.remove('hide');
199
+ // htmls(`.nav-path-display-${'modal-menu'}`, location.pathname);
197
200
 
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);
201
+ htmls('.menu-btn-container-children-docs', docMenuRender);
201
202
 
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('|') : [];
203
+ {
204
+ const docsData = [
205
+ {
206
+ id: 'getting-started',
207
+ icon: 'rocket',
208
+ title: 'Getting Started',
209
+ description: 'Learn the basics and get started with our platform',
217
210
  },
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('|'));
211
+ {
212
+ id: 'api-docs',
213
+ icon: 'code',
214
+ title: 'API Reference',
215
+ description: 'Detailed documentation of our API endpoints',
226
216
  },
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();
217
+ {
218
+ id: 'guides',
219
+ icon: 'book',
220
+ title: 'Guides',
221
+ description: 'Step-by-step tutorials and how-to guides',
222
+ },
223
+ {
224
+ id: 'demo',
225
+ icon: 'laptop-code',
226
+ title: 'Demo',
227
+ description: 'Practical examples and code snippets',
228
+ },
229
+ {
230
+ id: 'faq',
231
+ icon: 'question-circle',
232
+ title: 'FAQ',
233
+ description: 'Frequently asked questions',
234
+ },
235
+ {
236
+ id: 'community',
237
+ icon: 'users',
238
+ title: 'Community',
239
+ description: 'Join our developer community',
240
+ },
241
+ ];
238
242
 
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
- });
243
+ return html`
244
+ <style>
245
+ .docs-landing {
246
+ padding: 2rem;
247
+ max-width: 1200px;
248
+ margin: 0 auto;
249
+ height: 100%;
250
+ box-sizing: border-box;
251
+ }
252
+ .docs-header {
253
+ text-align: center;
254
+ margin-bottom: 3rem;
255
+ opacity: 0;
256
+ animation: fadeInUp 0.6s ease-out forwards;
257
+ }
258
+ .docs-header h1 {
259
+ font-size: 2.5rem;
260
+ margin: 0 0 1rem;
261
+ line-height: 1.2;
262
+ }
263
+ .docs-header p {
264
+ font-size: 1.2rem;
265
+ max-width: 700px;
266
+ margin: 0 auto 2rem;
267
+ line-height: 1.6;
268
+ }
269
+ .docs-grid {
270
+ display: grid;
271
+ grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
272
+ gap: 1.5rem;
273
+ margin: 0;
274
+ padding: 0;
275
+ list-style: none;
276
+ }
277
+ .docs-card-container {
278
+ cursor: pointer;
279
+ opacity: 0;
280
+ margin-bottom: 3rem;
281
+ animation: fadeInUp 0.6s ease-out forwards;
282
+ }
283
+ .docs-card {
284
+ border-radius: 8px;
285
+ padding: 1.5rem;
286
+ display: flex;
287
+ flex-direction: column;
288
+ height: 100%;
289
+ position: relative;
290
+ transition: all 0.3s ease-in-out;
291
+ }
292
+
293
+ .card-icon {
294
+ font-size: 1.75rem;
295
+ width: 56px;
296
+ height: 56px;
297
+ border-radius: 12px;
298
+ display: flex;
299
+ align-items: center;
300
+ justify-content: center;
301
+ margin: 0 0 1.25rem;
302
+ transition: transform 0.2s ease;
303
+ }
304
+
305
+ .card-content {
306
+ flex: 1;
307
+ }
308
+ .card-content h3 {
309
+ margin: 0 0 0.5rem;
310
+ font-size: 1.25rem;
311
+ font-weight: 600;
312
+ }
313
+ .card-content p {
314
+ margin: 0;
315
+ font-size: 0.95rem;
316
+ transition: color 0.3s ease;
317
+ }
318
+ </style>
319
+
320
+ <style>
321
+ ${docsData
322
+ .map(
323
+ (_, index) => css`
324
+ .docs-card-container:nth-child(${index + 1}) {
325
+ animation-delay: ${0.1 * (index + 1)}s;
326
+ }
327
+ `,
328
+ )
329
+ .join('')}
330
+ </style>
250
331
 
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>`;
332
+ <div class="docs-landing">
333
+ <div class="docs-header">
334
+ <h1>Documentation</h1>
335
+ <p>
336
+ Find everything you need to build amazing applications with our platform. Get started with our guides, API
337
+ reference, and examples.
338
+ </p>
339
+ <!--
340
+ <div class="search-bar">
341
+ <i class="fas fa-search"></i>
342
+ <input type="text" placeholder="Search documentation..." id="docs-search">
343
+ </div>
344
+ -->
345
+ </div>
346
+
347
+ <ul class="docs-grid">
348
+ ${docsData
349
+ .map((item) => {
350
+ setTimeout(() => {
351
+ if (s(`.docs-card-container-${item.id}`)) {
352
+ s(`.docs-card-container-${item.id}`).onclick = () => {
353
+ if (item.id.match('demo')) {
354
+ location.href = 'https://underpostnet.github.io/pwa-microservices-template-ghpkg/';
355
+ } else if (item.id.match('api')) {
356
+ if (s(`.btn-docs-api`)) s(`.btn-docs-api`).click();
357
+ } else {
358
+ if (s(`.btn-docs-src`)) s(`.btn-docs-src`).click();
359
+ }
360
+ };
361
+ }
362
+ });
363
+ return html`
364
+ <div class="in docs-card-container docs-card-container-${item.id}">
365
+ <li class="docs-card">
366
+ <div class="card-icon">
367
+ <i class="fas fa-${item.icon}"></i>
368
+ </div>
369
+ <div class="card-content">
370
+ <h3>${item.title}</h3>
371
+ <p>${item.description}</p>
372
+ </div>
373
+ </li>
374
+ </div>
375
+ `;
376
+ })
377
+ .join('')}
378
+ </ul>
379
+ </div>
380
+ `;
381
+ }
278
382
  },
279
383
  };
280
384
 
@@ -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) {