@processpuzzle/base-app 0.3.0 → 0.4.0

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.
@@ -1,15 +1,16 @@
1
- import { APPLICATION_CONTEXT, SidenavAutosizeDirective, THEME_COLOR_SCHEMES, THEME_PRESETS, ThemeService, WIDGET_PLACEMENTS, WidgetHostComponent, WidgetInstance, WidgetPlacement, createWidgetPropsAttrDescriptor } from "@processpuzzle/widgets";
2
- import { BaseEntityAttrDescriptor, BaseEntityContainerComponent, BaseEntityContainerStore, BaseEntityDescriptor, BaseEntityFacade, BaseEntityRestService, BaseEntityStore, BaseEntityTabsStore, BaseFormHostDirective, BaseUrlSegments, EmbeddedEntityFacade, EntityLabelPipe, EntityScreenResolver, FlexDirection, FlexboxDescriptor, FormControlType, baseEntityRoutes, entityScreenRoute, toSelectables, translateLabel } from "@processpuzzle/base-entity";
1
+ import { APPLICATION_CONTEXT, APP_ASSET_CONTEXT, MODULE_ASSET_CONTEXT, SIDENAV_CONTROL, SidenavAutosizeDirective, SidenavContentOutletComponent, THEME_COLOR_SCHEMES, THEME_PRESETS, ThemeService, WIDGET_PLACEMENTS, WIDGET_REGISTRY, WidgetHostComponent, WidgetInstance, WidgetPlacement, createWidgetPropsAttrDescriptor } from "@processpuzzle/widgets";
2
+ import { HttpClient, HttpContext, HttpErrorResponse } from "@angular/common/http";
3
3
  import * as i0 from "@angular/core";
4
- import { Component, ElementRef, Injectable, ViewChild, computed, effect, inject, input, signal, viewChild } from "@angular/core";
5
- import { firstValueFrom, map } from "rxjs";
4
+ import { Component, DestroyRef, Directive, ElementRef, EnvironmentInjector, Injectable, Injector, ViewChild, afterNextRender, computed, contentChild, effect, inject, input, runInInjectionContext, signal } from "@angular/core";
5
+ import { EXPECTED_ERROR_STATUSES, LayoutService, RUNTIME_CONFIGURATION, TranslocoHttpLoader, httpErrorMessage, serviceRootOf } from "@processpuzzle/util";
6
+ import { MatButton } from "@angular/material/button";
7
+ import { TranslocoPipe, TranslocoService, provideTranslocoScope } from "@jsverse/transloco";
8
+ import { BaseEntityAttrDescriptor, BaseEntityContainerComponent, BaseEntityContainerStore, BaseEntityDescriptor, BaseEntityFacade, BaseEntityRestService, BaseEntityStore, BaseEntityTabsStore, BaseFormControlComponent, BaseFormHostDirective, BaseUrlSegments, CONTEXT_COLLECTION_CONTEXT_KEY, CONTEXT_COLLECTION_ENTITY_KEY, CONTEXT_COLLECTION_PATH_KEY, ContextCollectionComponent, EmbeddedEntityFacade, EntityLabelPipe, EntityScreenResolver, FlexDirection, FlexboxDescriptor, FormControlType, REALM_ROLE_SUGGESTIONS, WorkingContextService, WorkingContextStatusbarComponent, baseEntityRoutes, entityScreenRoute, toSelectables, translateLabel, workingContextRoutes } from "@processpuzzle/base-entity";
9
+ import { takeUntilDestroyed } from "@angular/core/rxjs-interop";
10
+ import { catchError, firstValueFrom, forkJoin, map, of, take, throwError } from "rxjs";
6
11
  import { patchState, signalStore, signalStoreFeature, type, withMethods } from "@ngrx/signals";
7
12
  import { withDevtools } from "@angular-architects/ngrx-toolkit";
8
- import { LayoutService, httpErrorMessage } from "@processpuzzle/util";
9
- import { TranslocoPipe, TranslocoService, provideTranslocoScope } from "@jsverse/transloco";
10
- import { ActivatedRoute, RouterLink, RouterLinkActive, RouterOutlet } from "@angular/router";
11
- import { MatButton } from "@angular/material/button";
12
- import { MatTooltip } from "@angular/material/tooltip";
13
+ import { ActivatedRoute, Router, RouterLink, RouterLinkActive, RouterOutlet } from "@angular/router";
13
14
  import { Dialog } from "@angular/cdk/dialog";
14
15
  import { OverlayContainer } from "@angular/cdk/overlay";
15
16
  import { NgComponentOutlet, NgTemplateOutlet } from "@angular/common";
@@ -31,7 +32,8 @@ const SIDENAV_MODES = [
31
32
  const REGION_TYPES = [
32
33
  "header",
33
34
  "sidenav",
34
- "footer"
35
+ "footer",
36
+ "statusbar"
35
37
  ];
36
38
  const ROUTE_TARGET_KINDS = [
37
39
  "WIDGETS",
@@ -78,12 +80,15 @@ var RouteDefinition = class {
78
80
  translocoId;
79
81
  icon;
80
82
  roles;
83
+ requiresContext;
81
84
  kind;
82
85
  widgets;
83
86
  documentSlug;
84
87
  entityName;
85
88
  entityMode;
86
89
  rsqlFilter;
90
+ contextPath;
91
+ filterByContext;
87
92
  target;
88
93
  constructor(init = {}) {
89
94
  this.path = init.path ?? "";
@@ -91,15 +96,46 @@ var RouteDefinition = class {
91
96
  this.translocoId = init.translocoId;
92
97
  this.icon = init.icon;
93
98
  this.roles = init.roles;
99
+ this.requiresContext = init.requiresContext;
94
100
  this.kind = init.kind;
95
101
  this.widgets = init.widgets ?? [];
96
102
  this.documentSlug = init.documentSlug;
97
103
  this.entityName = init.entityName;
98
104
  this.entityMode = init.entityMode;
99
105
  this.rsqlFilter = init.rsqlFilter;
106
+ this.contextPath = init.contextPath;
107
+ this.filterByContext = init.filterByContext;
100
108
  this.target = init.target;
101
109
  }
102
110
  };
111
+ var WorkingContextRow = class {
112
+ name;
113
+ entityName;
114
+ parent;
115
+ basePath;
116
+ persist;
117
+ pickerSearchFields;
118
+ pickerRecent;
119
+ displayLabel;
120
+ displayBadge;
121
+ displayExtra;
122
+ confirmSwitchStates;
123
+ source;
124
+ constructor(init = {}) {
125
+ this.name = init.name ?? "";
126
+ this.entityName = init.entityName ?? "";
127
+ this.parent = init.parent;
128
+ this.basePath = init.basePath;
129
+ this.persist = init.persist;
130
+ this.pickerSearchFields = init.pickerSearchFields;
131
+ this.pickerRecent = init.pickerRecent;
132
+ this.displayLabel = init.displayLabel;
133
+ this.displayBadge = init.displayBadge;
134
+ this.displayExtra = init.displayExtra;
135
+ this.confirmSwitchStates = init.confirmSwitchStates;
136
+ this.source = init.source;
137
+ }
138
+ };
103
139
  var ModuleMount = class {
104
140
  moduleKey;
105
141
  basePath;
@@ -128,6 +164,8 @@ var AppDefinition = class {
128
164
  regions;
129
165
  routes;
130
166
  modules;
167
+ contexts;
168
+ mountedModules;
131
169
  orgKey;
132
170
  status;
133
171
  version;
@@ -154,6 +192,8 @@ var AppDefinition = class {
154
192
  this.regions = init.regions;
155
193
  this.routes = init.routes;
156
194
  this.modules = init.modules;
195
+ this.contexts = init.contexts;
196
+ this.mountedModules = init.mountedModules;
157
197
  this.orgKey = init.orgKey;
158
198
  this.status = init.status;
159
199
  this.version = init.version;
@@ -187,8 +227,57 @@ var ModuleDefinition = class {
187
227
  }
188
228
  };
189
229
  function moduleTranslocoScope(definition) {
190
- return definition.translocoScope?.trim() || definition.id;
230
+ return definition.translocoScope?.trim() || definition.id.replaceAll("-", "_");
231
+ }
232
+ function moduleRouteTranslocoId(scope, route) {
233
+ return route.translocoId?.trim() || `${scope}.route.${route.path}`;
191
234
  }
235
+ var ModuleTranslationService = class ModuleTranslationService {
236
+ http = inject(HttpClient);
237
+ runtimeConfiguration = inject(RUNTIME_CONFIGURATION);
238
+ coverage(moduleKey) {
239
+ return this.http.get(`${this.moduleUrl(moduleKey)}/translation-coverage`);
240
+ }
241
+ download(moduleKey) {
242
+ return this.http.get(`${this.moduleUrl(moduleKey)}/translations`, { responseType: "blob" });
243
+ }
244
+ upload(moduleKey, file) {
245
+ const body = new FormData();
246
+ body.append("file", file, file.name);
247
+ return this.http.put(`${this.moduleUrl(moduleKey)}/translations`, body);
248
+ }
249
+ bundle(moduleKey, locale, revision) {
250
+ return this.http.get(`${this.moduleUrl(moduleKey)}/translations/${encodeURIComponent(locale)}`, { params: { revision } });
251
+ }
252
+ moduleUrl(moduleKey) {
253
+ return `${serviceRootOf(this.runtimeConfiguration, "APP_SERVICE_ROOT")}/modules/${encodeURIComponent(moduleKey)}`;
254
+ }
255
+ static ɵfac = i0.ɵɵngDeclareFactory({
256
+ minVersion: "12.0.0",
257
+ version: "22.2.6",
258
+ ngImport: i0,
259
+ type: ModuleTranslationService,
260
+ deps: [],
261
+ target: i0.ɵɵFactoryTarget.Injectable
262
+ });
263
+ static ɵprov = i0.ɵɵngDeclareInjectable({
264
+ minVersion: "12.0.0",
265
+ version: "22.2.6",
266
+ ngImport: i0,
267
+ type: ModuleTranslationService,
268
+ providedIn: "root"
269
+ });
270
+ };
271
+ i0.ɵɵngDeclareClassMetadata({
272
+ minVersion: "12.0.0",
273
+ version: "22.2.6",
274
+ ngImport: i0,
275
+ type: ModuleTranslationService,
276
+ decorators: [{
277
+ type: Injectable,
278
+ args: [{ providedIn: "root" }]
279
+ }]
280
+ });
192
281
  const BASE_APP_TRANSLOCO_SCOPE = "base_app";
193
282
  const BASE_ENTITY_TRANSLOCO_SCOPE = "base_entity";
194
283
  const APP_DEFINITION_I18N_SCOPE = `${BASE_APP_TRANSLOCO_SCOPE}.app_definition`;
@@ -196,22 +285,997 @@ const APP_PREVIEW_I18N_KEY = `${APP_DEFINITION_I18N_SCOPE}.tabs.preview`;
196
285
  const MODULE_DEFINITION_I18N_SCOPE = `${BASE_APP_TRANSLOCO_SCOPE}.module_definition`;
197
286
  const APP_REGION_I18N_SCOPE = `${BASE_APP_TRANSLOCO_SCOPE}.app_region`;
198
287
  const APP_ROUTE_I18N_SCOPE = `${BASE_APP_TRANSLOCO_SCOPE}.app_route`;
288
+ const APP_CONTEXT_I18N_SCOPE = `${BASE_APP_TRANSLOCO_SCOPE}.app_context`;
199
289
  const APP_MODULE_MOUNT_I18N_SCOPE = `${BASE_APP_TRANSLOCO_SCOPE}.app_module_mount`;
200
290
  const APP_NAV_ITEM_I18N_SCOPE = `${BASE_APP_TRANSLOCO_SCOPE}.app_nav_item`;
201
291
  const APP_WIDGET_I18N_SCOPE = `${BASE_APP_TRANSLOCO_SCOPE}.app_widget`;
202
- const PUBLISH_BUTTON_I18N_KEY = `${BASE_APP_TRANSLOCO_SCOPE}.publish.button`;
203
- const PUBLISH_TOOLTIP_I18N_KEY = `${BASE_APP_TRANSLOCO_SCOPE}.publish.tooltip`;
292
+ const APP_CONCEPTS_I18N_SCOPE = `${BASE_APP_TRANSLOCO_SCOPE}.concepts`;
204
293
  const BASE_APP_TRANSLATION_SOURCE = {
205
294
  scopes: ["base_app"],
206
295
  serviceRootKey: "APP_SERVICE_ROOT",
207
296
  segment: "app"
208
297
  };
298
+ var AppAssetService = class AppAssetService {
299
+ http = inject(HttpClient);
300
+ runtimeConfiguration = inject(RUNTIME_CONFIGURATION);
301
+ list(appId, revision = "draft") {
302
+ return this.http.get(this.assetsUrl(appId), { params: { revision } });
303
+ }
304
+ upload(appId, file, path) {
305
+ const body = new FormData();
306
+ body.append("file", file, file.name);
307
+ if (path) body.append("path", path);
308
+ return this.http.post(this.assetsUrl(appId), body);
309
+ }
310
+ remove(appId, path) {
311
+ return this.http.delete(this.assetsUrl(appId), { params: { path } });
312
+ }
313
+ content(appId, path, revision) {
314
+ return this.http.get(`${this.assetsUrl(appId)}/content`, {
315
+ params: {
316
+ path,
317
+ revision
318
+ },
319
+ responseType: "blob"
320
+ });
321
+ }
322
+ assetsUrl(appId) {
323
+ return `${serviceRootOf(this.runtimeConfiguration, "APP_SERVICE_ROOT")}/app-definitions/${encodeURIComponent(appId)}/assets`;
324
+ }
325
+ static ɵfac = i0.ɵɵngDeclareFactory({
326
+ minVersion: "12.0.0",
327
+ version: "22.2.6",
328
+ ngImport: i0,
329
+ type: AppAssetService,
330
+ deps: [],
331
+ target: i0.ɵɵFactoryTarget.Injectable
332
+ });
333
+ static ɵprov = i0.ɵɵngDeclareInjectable({
334
+ minVersion: "12.0.0",
335
+ version: "22.2.6",
336
+ ngImport: i0,
337
+ type: AppAssetService,
338
+ providedIn: "root"
339
+ });
340
+ };
341
+ i0.ɵɵngDeclareClassMetadata({
342
+ minVersion: "12.0.0",
343
+ version: "22.2.6",
344
+ ngImport: i0,
345
+ type: AppAssetService,
346
+ decorators: [{
347
+ type: Injectable,
348
+ args: [{ providedIn: "root" }]
349
+ }]
350
+ });
351
+ const ASSETS_CONTROL_TEMPLATE = `
352
+ <div class="base-entity-form-field pp-assets">
353
+ <span class="pp-assets__label">{{ config().i18nKey() | ppLabel: config().label }}</span>
354
+ @if (ownerKey(); as key) {
355
+ <p class="pp-assets__hint">{{ scope + '.hint' | transloco }}</p>
356
+ @if (assets().length) {
357
+ <table class="pp-assets__list" [attr.data-testid]="testIdPrefix + '-assets-list'">
358
+ <thead>
359
+ <tr>
360
+ <th>{{ scope + '.path' | transloco }}</th>
361
+ <th>{{ scope + '.type' | transloco }}</th>
362
+ <th>{{ scope + '.size' | transloco }}</th>
363
+ <th></th>
364
+ </tr>
365
+ </thead>
366
+ <tbody>
367
+ @for (asset of assets(); track asset.path) {
368
+ <tr [attr.data-testid]="testIdPrefix + '-asset-' + asset.path">
369
+ <td>
370
+ <code>{{ scheme }}:{{ asset.path }}</code>
371
+ </td>
372
+ <td>{{ asset.mimeType }}</td>
373
+ <td>{{ sizeOf(asset) }}</td>
374
+ <td>
375
+ <button mat-button type="button" [attr.data-testid]="testIdPrefix + '-asset-remove-' + asset.path" (click)="remove(key, asset)">{{ scope + '.remove' | transloco }}</button>
376
+ </td>
377
+ </tr>
378
+ }
379
+ </tbody>
380
+ </table>
381
+ } @else {
382
+ <p class="pp-assets__hint" [attr.data-testid]="testIdPrefix + '-assets-none'">{{ scope + '.none' | transloco }}</p>
383
+ }
384
+ <div class="pp-assets__actions">
385
+ <label class="pp-assets__folder">
386
+ <span>{{ scope + '.folder' | transloco }}</span>
387
+ <input #folder type="text" placeholder="docs/img" [attr.data-testid]="testIdPrefix + '-assets-folder'" />
388
+ </label>
389
+ <button mat-stroked-button type="button" [attr.data-testid]="testIdPrefix + '-assets-upload'" (click)="fileInput.click()">{{ scope + '.upload' | transloco }}</button>
390
+ <input #fileInput type="file" multiple hidden [attr.data-testid]="testIdPrefix + '-assets-file'" (change)="upload(key, fileInput, folder.value)" />
391
+ </div>
392
+ @if (error(); as message) {
393
+ <p class="pp-assets__error" [attr.data-testid]="testIdPrefix + '-assets-error'">{{ message }}</p>
394
+ }
395
+ } @else {
396
+ <p class="pp-assets__hint" [attr.data-testid]="testIdPrefix + '-assets-save-first'">{{ scope + '.save_first' | transloco }}</p>
397
+ }
398
+ </div>
399
+ `;
400
+ var AssetsControlBase = class AssetsControlBase extends BaseFormControlComponent {
401
+ destroyRef = inject(DestroyRef);
402
+ savedKey = signal(void 0, ...ngDevMode ? [{ debugName: "savedKey" }] : /* istanbul ignore next */ []);
403
+ ownerKey = this.savedKey.asReadonly();
404
+ assets = signal([], ...ngDevMode ? [{ debugName: "assets" }] : /* istanbul ignore next */ []);
405
+ error = signal(void 0, ...ngDevMode ? [{ debugName: "error" }] : /* istanbul ignore next */ []);
406
+ ngOnInit() {
407
+ const id = this.formGroup?.get("id");
408
+ const version = this.formGroup?.get("version");
409
+ const refresh = () => this.updateKey(id?.value, version?.value);
410
+ refresh();
411
+ id?.valueChanges.pipe(takeUntilDestroyed(this.destroyRef)).subscribe(refresh);
412
+ version?.valueChanges.pipe(takeUntilDestroyed(this.destroyRef)).subscribe(refresh);
413
+ }
414
+ sizeOf(asset) {
415
+ return asset.size < 1024 ? `${asset.size} B` : `${(asset.size / 1024).toFixed(1)} kB`;
416
+ }
417
+ upload(ownerKey, input, folder) {
418
+ const files = Array.from(input.files ?? []);
419
+ if (!files.length) return;
420
+ this.error.set(void 0);
421
+ const prefix = trimSlashes$1(folder.trim());
422
+ let pending = files.length;
423
+ for (const file of files) this.service.upload(ownerKey, file, prefix ? `${prefix}/${file.name}` : void 0).subscribe({
424
+ next: () => void 0,
425
+ error: (failure) => {
426
+ this.error.set(this.messageOf(failure));
427
+ if (--pending === 0) this.reload(ownerKey);
428
+ },
429
+ complete: () => {
430
+ if (--pending === 0) this.reload(ownerKey);
431
+ }
432
+ });
433
+ input.value = "";
434
+ }
435
+ remove(ownerKey, asset) {
436
+ this.error.set(void 0);
437
+ this.service.remove(ownerKey, asset.path).subscribe({
438
+ next: () => this.reload(ownerKey),
439
+ error: (failure) => this.error.set(this.messageOf(failure))
440
+ });
441
+ }
442
+ updateKey(id, version) {
443
+ const key = typeof id === "string" && id !== "" && version ? id : void 0;
444
+ if (key === this.savedKey()) return;
445
+ this.savedKey.set(key);
446
+ this.assets.set([]);
447
+ if (key) this.reload(key);
448
+ }
449
+ reload(ownerKey) {
450
+ this.service.list(ownerKey).subscribe({
451
+ next: (assets) => this.assets.set(assets),
452
+ error: () => this.assets.set([])
453
+ });
454
+ }
455
+ messageOf(failure) {
456
+ if (failure instanceof HttpErrorResponse) return failure.error?.errorText ?? failure.message;
457
+ return String(failure);
458
+ }
459
+ static ɵfac = i0.ɵɵngDeclareFactory({
460
+ minVersion: "12.0.0",
461
+ version: "22.2.6",
462
+ ngImport: i0,
463
+ type: AssetsControlBase,
464
+ deps: null,
465
+ target: i0.ɵɵFactoryTarget.Component
466
+ });
467
+ static ɵcmp = i0.ɵɵngDeclareComponent({
468
+ minVersion: "14.0.0",
469
+ version: "22.2.6",
470
+ type: AssetsControlBase,
471
+ isStandalone: true,
472
+ selector: "ng-component",
473
+ usesInheritance: true,
474
+ ngImport: i0,
475
+ template: "",
476
+ isInline: true
477
+ });
478
+ };
479
+ i0.ɵɵngDeclareClassMetadata({
480
+ minVersion: "12.0.0",
481
+ version: "22.2.6",
482
+ ngImport: i0,
483
+ type: AssetsControlBase,
484
+ decorators: [{
485
+ type: Component,
486
+ args: [{ template: "" }]
487
+ }]
488
+ });
489
+ function trimSlashes$1(value) {
490
+ let start = 0;
491
+ let end = value.length;
492
+ while (start < end && value[start] === "/") start++;
493
+ while (end > start && value[end - 1] === "/") end--;
494
+ return value.slice(start, end);
495
+ }
496
+ const APP_ASSETS_I18N_SCOPE = `${APP_DEFINITION_I18N_SCOPE}.assets_panel`;
497
+ var AppAssetsAttrDescriptor = class extends BaseEntityAttrDescriptor {
498
+ constructor() {
499
+ super("assets", FormControlType.CUSTOM, "Assets");
500
+ this.component = AppAssetsControlComponent;
501
+ this.disabled = true;
502
+ this.hideInTable = true;
503
+ }
504
+ };
505
+ var AppAssetsControlComponent = class AppAssetsControlComponent extends AssetsControlBase {
506
+ scope = APP_ASSETS_I18N_SCOPE;
507
+ scheme = "app";
508
+ testIdPrefix = "app";
509
+ service = inject(AppAssetService);
510
+ static ɵfac = i0.ɵɵngDeclareFactory({
511
+ minVersion: "12.0.0",
512
+ version: "22.2.6",
513
+ ngImport: i0,
514
+ type: AppAssetsControlComponent,
515
+ deps: null,
516
+ target: i0.ɵɵFactoryTarget.Component
517
+ });
518
+ static ɵcmp = i0.ɵɵngDeclareComponent({
519
+ minVersion: "17.0.0",
520
+ version: "22.2.6",
521
+ type: AppAssetsControlComponent,
522
+ isStandalone: true,
523
+ selector: "pp-app-assets-control",
524
+ usesInheritance: true,
525
+ ngImport: i0,
526
+ template: "\n <div class=\"base-entity-form-field pp-assets\">\n <span class=\"pp-assets__label\">{{ config().i18nKey() | ppLabel: config().label }}</span>\n @if (ownerKey(); as key) {\n <p class=\"pp-assets__hint\">{{ scope + '.hint' | transloco }}</p>\n @if (assets().length) {\n <table class=\"pp-assets__list\" [attr.data-testid]=\"testIdPrefix + '-assets-list'\">\n <thead>\n <tr>\n <th>{{ scope + '.path' | transloco }}</th>\n <th>{{ scope + '.type' | transloco }}</th>\n <th>{{ scope + '.size' | transloco }}</th>\n <th></th>\n </tr>\n </thead>\n <tbody>\n @for (asset of assets(); track asset.path) {\n <tr [attr.data-testid]=\"testIdPrefix + '-asset-' + asset.path\">\n <td>\n <code>{{ scheme }}:{{ asset.path }}</code>\n </td>\n <td>{{ asset.mimeType }}</td>\n <td>{{ sizeOf(asset) }}</td>\n <td>\n <button mat-button type=\"button\" [attr.data-testid]=\"testIdPrefix + '-asset-remove-' + asset.path\" (click)=\"remove(key, asset)\">{{ scope + '.remove' | transloco }}</button>\n </td>\n </tr>\n }\n </tbody>\n </table>\n } @else {\n <p class=\"pp-assets__hint\" [attr.data-testid]=\"testIdPrefix + '-assets-none'\">{{ scope + '.none' | transloco }}</p>\n }\n <div class=\"pp-assets__actions\">\n <label class=\"pp-assets__folder\">\n <span>{{ scope + '.folder' | transloco }}</span>\n <input #folder type=\"text\" placeholder=\"docs/img\" [attr.data-testid]=\"testIdPrefix + '-assets-folder'\" />\n </label>\n <button mat-stroked-button type=\"button\" [attr.data-testid]=\"testIdPrefix + '-assets-upload'\" (click)=\"fileInput.click()\">{{ scope + '.upload' | transloco }}</button>\n <input #fileInput type=\"file\" multiple hidden [attr.data-testid]=\"testIdPrefix + '-assets-file'\" (change)=\"upload(key, fileInput, folder.value)\" />\n </div>\n @if (error(); as message) {\n <p class=\"pp-assets__error\" [attr.data-testid]=\"testIdPrefix + '-assets-error'\">{{ message }}</p>\n }\n } @else {\n <p class=\"pp-assets__hint\" [attr.data-testid]=\"testIdPrefix + '-assets-save-first'\">{{ scope + '.save_first' | transloco }}</p>\n }\n </div>\n ",
527
+ isInline: true,
528
+ styles: [".pp-assets{border:1px solid var(--mat-sys-outline-variant);border-radius:4px;display:flex;flex-direction:column;gap:6px;padding:8px 12px}.pp-assets__label{font:var(--mat-sys-label-large)}.pp-assets__hint{margin:0;opacity:.7;font-size:12px}.pp-assets__list{border-collapse:collapse;text-align:left}.pp-assets__list th,.pp-assets__list td{padding:2px 16px 2px 0}.pp-assets__actions{display:flex;gap:8px;align-items:center}.pp-assets__folder{display:flex;gap:6px;align-items:center}.pp-assets__error{margin:0;color:var(--mat-sys-error)}\n"],
529
+ dependencies: [
530
+ {
531
+ kind: "component",
532
+ type: MatButton,
533
+ selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ",
534
+ inputs: ["matButton"],
535
+ exportAs: ["matButton", "matAnchor"]
536
+ },
537
+ {
538
+ kind: "pipe",
539
+ type: EntityLabelPipe,
540
+ name: "ppLabel"
541
+ },
542
+ {
543
+ kind: "pipe",
544
+ type: TranslocoPipe,
545
+ name: "transloco"
546
+ }
547
+ ]
548
+ });
549
+ };
550
+ i0.ɵɵngDeclareClassMetadata({
551
+ minVersion: "12.0.0",
552
+ version: "22.2.6",
553
+ ngImport: i0,
554
+ type: AppAssetsControlComponent,
555
+ decorators: [{
556
+ type: Component,
557
+ args: [{
558
+ selector: "pp-app-assets-control",
559
+ standalone: true,
560
+ imports: [
561
+ EntityLabelPipe,
562
+ MatButton,
563
+ TranslocoPipe
564
+ ],
565
+ template: ASSETS_CONTROL_TEMPLATE,
566
+ styles: [".pp-assets{border:1px solid var(--mat-sys-outline-variant);border-radius:4px;display:flex;flex-direction:column;gap:6px;padding:8px 12px}.pp-assets__label{font:var(--mat-sys-label-large)}.pp-assets__hint{margin:0;opacity:.7;font-size:12px}.pp-assets__list{border-collapse:collapse;text-align:left}.pp-assets__list th,.pp-assets__list td{padding:2px 16px 2px 0}.pp-assets__actions{display:flex;gap:8px;align-items:center}.pp-assets__folder{display:flex;gap:6px;align-items:center}.pp-assets__error{margin:0;color:var(--mat-sys-error)}\n"]
567
+ }]
568
+ }]
569
+ });
570
+ var AppTranslationService = class AppTranslationService {
571
+ http = inject(HttpClient);
572
+ runtimeConfiguration = inject(RUNTIME_CONFIGURATION);
573
+ download(appId) {
574
+ return this.http.get(`${this.translationsUrl(appId)}`, { responseType: "blob" });
575
+ }
576
+ upload(appId, file) {
577
+ const body = new FormData();
578
+ body.append("file", file, file.name);
579
+ return this.http.put(this.translationsUrl(appId), body);
580
+ }
581
+ remove(appId, locale) {
582
+ return this.http.delete(`${this.translationsUrl(appId)}/${encodeURIComponent(locale)}`);
583
+ }
584
+ bundle(appId, locale, revision) {
585
+ return this.http.get(`${this.translationsUrl(appId)}/${encodeURIComponent(locale)}`, { params: { revision } });
586
+ }
587
+ translationsUrl(appId) {
588
+ return `${serviceRootOf(this.runtimeConfiguration, "APP_SERVICE_ROOT")}/app-definitions/${encodeURIComponent(appId)}/translations`;
589
+ }
590
+ static ɵfac = i0.ɵɵngDeclareFactory({
591
+ minVersion: "12.0.0",
592
+ version: "22.2.6",
593
+ ngImport: i0,
594
+ type: AppTranslationService,
595
+ deps: [],
596
+ target: i0.ɵɵFactoryTarget.Injectable
597
+ });
598
+ static ɵprov = i0.ɵɵngDeclareInjectable({
599
+ minVersion: "12.0.0",
600
+ version: "22.2.6",
601
+ ngImport: i0,
602
+ type: AppTranslationService,
603
+ providedIn: "root"
604
+ });
605
+ };
606
+ i0.ɵɵngDeclareClassMetadata({
607
+ minVersion: "12.0.0",
608
+ version: "22.2.6",
609
+ ngImport: i0,
610
+ type: AppTranslationService,
611
+ decorators: [{
612
+ type: Injectable,
613
+ args: [{ providedIn: "root" }]
614
+ }]
615
+ });
616
+ const APP_TRANSLATIONS_I18N_SCOPE = `${APP_DEFINITION_I18N_SCOPE}.translations_panel`;
617
+ var AppTranslationsAttrDescriptor = class extends BaseEntityAttrDescriptor {
618
+ constructor() {
619
+ super("translations", FormControlType.CUSTOM, "Translations");
620
+ this.component = AppTranslationsControlComponent;
621
+ this.disabled = true;
622
+ this.hideInTable = true;
623
+ }
624
+ };
625
+ var AppTranslationsControlComponent = class AppTranslationsControlComponent extends BaseFormControlComponent {
626
+ scope = APP_TRANSLATIONS_I18N_SCOPE;
627
+ translations = inject(AppTranslationService);
628
+ transloco = inject(TranslocoService);
629
+ destroyRef = inject(DestroyRef);
630
+ savedId = signal(void 0, ...ngDevMode ? [{ debugName: "savedId" }] : /* istanbul ignore next */ []);
631
+ reading;
632
+ appId = this.savedId.asReadonly();
633
+ report = signal(void 0, ...ngDevMode ? [{ debugName: "report" }] : /* istanbul ignore next */ []);
634
+ error = signal(void 0, ...ngDevMode ? [{ debugName: "error" }] : /* istanbul ignore next */ []);
635
+ stored = signal(void 0, ...ngDevMode ? [{ debugName: "stored" }] : /* istanbul ignore next */ []);
636
+ selected = signal(void 0, ...ngDevMode ? [{ debugName: "selected" }] : /* istanbul ignore next */ []);
637
+ selectedLanguage = computed(() => this.stored()?.find((language) => language.locale === this.selected()), ...ngDevMode ? [{ debugName: "selectedLanguage" }] : /* istanbul ignore next */ []);
638
+ ngOnInit() {
639
+ const id = this.formGroup?.get("id");
640
+ const version = this.formGroup?.get("version");
641
+ const refresh = () => this.updateId(id?.value, version?.value);
642
+ refresh();
643
+ id?.valueChanges.pipe(takeUntilDestroyed(this.destroyRef)).subscribe(refresh);
644
+ version?.valueChanges.pipe(takeUntilDestroyed(this.destroyRef)).subscribe(refresh);
645
+ }
646
+ download(appId) {
647
+ this.error.set(void 0);
648
+ this.translations.download(appId).subscribe({
649
+ next: (zip) => this.save(zip, `${appId}-translations.zip`),
650
+ error: (failure) => this.error.set(this.messageOf(failure))
651
+ });
652
+ }
653
+ upload(appId, input) {
654
+ const file = input.files?.item(0);
655
+ if (!file) return;
656
+ this.error.set(void 0);
657
+ this.translations.upload(appId, file).subscribe({
658
+ next: (report) => {
659
+ this.report.set(report);
660
+ this.readStored(appId);
661
+ },
662
+ error: (failure) => this.error.set(this.messageOf(failure))
663
+ });
664
+ input.value = "";
665
+ }
666
+ updateId(id, version) {
667
+ const key = typeof id === "string" && id !== "" && version ? id : void 0;
668
+ if (key === this.savedId()) return;
669
+ this.savedId.set(key);
670
+ this.report.set(void 0);
671
+ this.stored.set(void 0);
672
+ this.selected.set(void 0);
673
+ if (key) this.readStored(key);
674
+ }
675
+ toggle(locale) {
676
+ this.selected.update((current) => current === locale ? void 0 : locale);
677
+ }
678
+ readStored(appId) {
679
+ this.reading?.unsubscribe();
680
+ const reads = this.languages().map((locale) => this.readLanguage(appId, locale));
681
+ this.reading = forkJoin(reads).pipe(takeUntilDestroyed(this.destroyRef)).subscribe((languages) => {
682
+ const stored = languages.filter((language) => !!language);
683
+ this.stored.set(stored);
684
+ if (!stored.some((language) => language.locale === this.selected())) this.selected.set(void 0);
685
+ });
686
+ }
687
+ readLanguage(appId, locale) {
688
+ return this.translations.bundle(appId, locale, "draft").pipe(map((texts) => {
689
+ const keys = Object.keys(texts ?? {}).sort((left, right) => left.localeCompare(right));
690
+ return keys.length ? {
691
+ locale,
692
+ texts,
693
+ keys
694
+ } : void 0;
695
+ }), catchError(() => of(void 0)));
696
+ }
697
+ languages() {
698
+ const available = this.transloco.getAvailableLangs().map((lang) => typeof lang === "string" ? lang : lang.id);
699
+ return [.../* @__PURE__ */ new Set([...available, "en"])];
700
+ }
701
+ save(zip, fileName) {
702
+ const url = URL.createObjectURL(zip);
703
+ const link = document.createElement("a");
704
+ link.href = url;
705
+ link.download = fileName;
706
+ link.click();
707
+ URL.revokeObjectURL(url);
708
+ }
709
+ messageOf(failure) {
710
+ if (failure instanceof HttpErrorResponse) return failure.error?.errorText ?? failure.message;
711
+ return String(failure);
712
+ }
713
+ static ɵfac = i0.ɵɵngDeclareFactory({
714
+ minVersion: "12.0.0",
715
+ version: "22.2.6",
716
+ ngImport: i0,
717
+ type: AppTranslationsControlComponent,
718
+ deps: null,
719
+ target: i0.ɵɵFactoryTarget.Component
720
+ });
721
+ static ɵcmp = i0.ɵɵngDeclareComponent({
722
+ minVersion: "17.0.0",
723
+ version: "22.2.6",
724
+ type: AppTranslationsControlComponent,
725
+ isStandalone: true,
726
+ selector: "pp-app-translations-control",
727
+ usesInheritance: true,
728
+ ngImport: i0,
729
+ template: `
730
+ <div class="base-entity-form-field pp-app-translations">
731
+ <span class="pp-app-translations__label">{{ config().i18nKey() | ppLabel: config().label }}</span>
732
+ @if (appId(); as id) {
733
+ <p class="pp-app-translations__hint">{{ scope + '.hint' | transloco }}</p>
734
+ @if (stored(); as languages) {
735
+ @if (languages.length) {
736
+ <div class="pp-app-translations__languages" data-testid="app-translations-languages">
737
+ @for (language of languages; track language.locale) {
738
+ <button
739
+ mat-button
740
+ type="button"
741
+ [class.pp-app-translations__language--selected]="selected() === language.locale"
742
+ [attr.aria-pressed]="selected() === language.locale"
743
+ [attr.data-testid]="'app-translations-language-' + language.locale"
744
+ (click)="toggle(language.locale)">
745
+ {{ language.locale }} · {{ scope + '.stored' | transloco: { count: language.keys.length } }}
746
+ </button>
747
+ }
748
+ </div>
749
+ @if (selectedLanguage(); as language) {
750
+ <table class="pp-app-translations__texts" data-testid="app-translations-texts">
751
+ <thead>
752
+ <tr>
753
+ <th>{{ scope + '.key' | transloco }}</th>
754
+ <th>{{ scope + '.text' | transloco }}</th>
755
+ </tr>
756
+ </thead>
757
+ <tbody>
758
+ @for (key of language.keys; track key) {
759
+ <tr>
760
+ <td class="pp-app-translations__key">{{ key }}</td>
761
+ <td>{{ language.texts[key] }}</td>
762
+ </tr>
763
+ }
764
+ </tbody>
765
+ </table>
766
+ }
767
+ } @else {
768
+ <p class="pp-app-translations__hint" data-testid="app-translations-none">{{ scope + '.none_stored' | transloco }}</p>
769
+ }
770
+ }
771
+ <div class="pp-app-translations__actions">
772
+ <button mat-stroked-button type="button" data-testid="app-translations-download" (click)="download(id)">{{ scope + '.download' | transloco }}</button>
773
+ <button mat-stroked-button type="button" data-testid="app-translations-upload" (click)="fileInput.click()">{{ scope + '.upload' | transloco }}</button>
774
+ <input #fileInput type="file" accept=".zip,.json" hidden data-testid="app-translations-file" (change)="upload(id, fileInput)" />
775
+ </div>
776
+ @if (report(); as uploaded) {
777
+ <ul class="pp-app-translations__report" data-testid="app-translations-report">
778
+ @for (language of uploaded.languages; track language.locale) {
779
+ <li>
780
+ <strong>{{ language.locale }}</strong
781
+ >: {{ scope + '.stored' | transloco: { count: language.storedKeys } }}
782
+ </li>
783
+ }
784
+ </ul>
785
+ }
786
+ @if (error(); as message) {
787
+ <p class="pp-app-translations__error" data-testid="app-translations-error">{{ message }}</p>
788
+ }
789
+ } @else {
790
+ <p class="pp-app-translations__hint" data-testid="app-translations-save-first">{{ scope + '.save_first' | transloco }}</p>
791
+ }
792
+ </div>
793
+ `,
794
+ isInline: true,
795
+ styles: [".pp-app-translations{border:1px solid var(--mat-sys-outline-variant);border-radius:4px;display:flex;flex-direction:column;gap:6px;padding:8px 12px}.pp-app-translations__label{font:var(--mat-sys-label-large)}.pp-app-translations__hint{margin:0;opacity:.7;font-size:12px}.pp-app-translations__actions{display:flex;gap:8px}.pp-app-translations__languages{display:flex;flex-wrap:wrap;gap:4px}.pp-app-translations__language--selected{background:var(--mat-sys-secondary-container)}.pp-app-translations__texts{border-collapse:collapse;display:block;font-size:12px;max-height:320px;overflow:auto}.pp-app-translations__texts th,.pp-app-translations__texts td{border-bottom:1px solid var(--mat-sys-outline-variant);padding:2px 8px;text-align:left;vertical-align:top}.pp-app-translations__key{font-family:monospace;white-space:nowrap}.pp-app-translations__report{margin:0;padding-left:16px}.pp-app-translations__error{margin:0;color:var(--mat-sys-error)}\n"],
796
+ dependencies: [
797
+ {
798
+ kind: "component",
799
+ type: MatButton,
800
+ selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ",
801
+ inputs: ["matButton"],
802
+ exportAs: ["matButton", "matAnchor"]
803
+ },
804
+ {
805
+ kind: "pipe",
806
+ type: EntityLabelPipe,
807
+ name: "ppLabel"
808
+ },
809
+ {
810
+ kind: "pipe",
811
+ type: TranslocoPipe,
812
+ name: "transloco"
813
+ }
814
+ ]
815
+ });
816
+ };
817
+ i0.ɵɵngDeclareClassMetadata({
818
+ minVersion: "12.0.0",
819
+ version: "22.2.6",
820
+ ngImport: i0,
821
+ type: AppTranslationsControlComponent,
822
+ decorators: [{
823
+ type: Component,
824
+ args: [{
825
+ selector: "pp-app-translations-control",
826
+ standalone: true,
827
+ imports: [
828
+ EntityLabelPipe,
829
+ MatButton,
830
+ TranslocoPipe
831
+ ],
832
+ template: `
833
+ <div class="base-entity-form-field pp-app-translations">
834
+ <span class="pp-app-translations__label">{{ config().i18nKey() | ppLabel: config().label }}</span>
835
+ @if (appId(); as id) {
836
+ <p class="pp-app-translations__hint">{{ scope + '.hint' | transloco }}</p>
837
+ @if (stored(); as languages) {
838
+ @if (languages.length) {
839
+ <div class="pp-app-translations__languages" data-testid="app-translations-languages">
840
+ @for (language of languages; track language.locale) {
841
+ <button
842
+ mat-button
843
+ type="button"
844
+ [class.pp-app-translations__language--selected]="selected() === language.locale"
845
+ [attr.aria-pressed]="selected() === language.locale"
846
+ [attr.data-testid]="'app-translations-language-' + language.locale"
847
+ (click)="toggle(language.locale)">
848
+ {{ language.locale }} · {{ scope + '.stored' | transloco: { count: language.keys.length } }}
849
+ </button>
850
+ }
851
+ </div>
852
+ @if (selectedLanguage(); as language) {
853
+ <table class="pp-app-translations__texts" data-testid="app-translations-texts">
854
+ <thead>
855
+ <tr>
856
+ <th>{{ scope + '.key' | transloco }}</th>
857
+ <th>{{ scope + '.text' | transloco }}</th>
858
+ </tr>
859
+ </thead>
860
+ <tbody>
861
+ @for (key of language.keys; track key) {
862
+ <tr>
863
+ <td class="pp-app-translations__key">{{ key }}</td>
864
+ <td>{{ language.texts[key] }}</td>
865
+ </tr>
866
+ }
867
+ </tbody>
868
+ </table>
869
+ }
870
+ } @else {
871
+ <p class="pp-app-translations__hint" data-testid="app-translations-none">{{ scope + '.none_stored' | transloco }}</p>
872
+ }
873
+ }
874
+ <div class="pp-app-translations__actions">
875
+ <button mat-stroked-button type="button" data-testid="app-translations-download" (click)="download(id)">{{ scope + '.download' | transloco }}</button>
876
+ <button mat-stroked-button type="button" data-testid="app-translations-upload" (click)="fileInput.click()">{{ scope + '.upload' | transloco }}</button>
877
+ <input #fileInput type="file" accept=".zip,.json" hidden data-testid="app-translations-file" (change)="upload(id, fileInput)" />
878
+ </div>
879
+ @if (report(); as uploaded) {
880
+ <ul class="pp-app-translations__report" data-testid="app-translations-report">
881
+ @for (language of uploaded.languages; track language.locale) {
882
+ <li>
883
+ <strong>{{ language.locale }}</strong
884
+ >: {{ scope + '.stored' | transloco: { count: language.storedKeys } }}
885
+ </li>
886
+ }
887
+ </ul>
888
+ }
889
+ @if (error(); as message) {
890
+ <p class="pp-app-translations__error" data-testid="app-translations-error">{{ message }}</p>
891
+ }
892
+ } @else {
893
+ <p class="pp-app-translations__hint" data-testid="app-translations-save-first">{{ scope + '.save_first' | transloco }}</p>
894
+ }
895
+ </div>
896
+ `,
897
+ styles: [".pp-app-translations{border:1px solid var(--mat-sys-outline-variant);border-radius:4px;display:flex;flex-direction:column;gap:6px;padding:8px 12px}.pp-app-translations__label{font:var(--mat-sys-label-large)}.pp-app-translations__hint{margin:0;opacity:.7;font-size:12px}.pp-app-translations__actions{display:flex;gap:8px}.pp-app-translations__languages{display:flex;flex-wrap:wrap;gap:4px}.pp-app-translations__language--selected{background:var(--mat-sys-secondary-container)}.pp-app-translations__texts{border-collapse:collapse;display:block;font-size:12px;max-height:320px;overflow:auto}.pp-app-translations__texts th,.pp-app-translations__texts td{border-bottom:1px solid var(--mat-sys-outline-variant);padding:2px 8px;text-align:left;vertical-align:top}.pp-app-translations__key{font-family:monospace;white-space:nowrap}.pp-app-translations__report{margin:0;padding-left:16px}.pp-app-translations__error{margin:0;color:var(--mat-sys-error)}\n"]
898
+ }]
899
+ }]
900
+ });
901
+ var ModuleAssetService = class ModuleAssetService {
902
+ http = inject(HttpClient);
903
+ runtimeConfiguration = inject(RUNTIME_CONFIGURATION);
904
+ list(moduleKey, revision = "draft") {
905
+ return this.http.get(this.assetsUrl(moduleKey), { params: { revision } });
906
+ }
907
+ upload(moduleKey, file, path) {
908
+ const body = new FormData();
909
+ body.append("file", file, file.name);
910
+ if (path) body.append("path", path);
911
+ return this.http.post(this.assetsUrl(moduleKey), body);
912
+ }
913
+ remove(moduleKey, path) {
914
+ return this.http.delete(this.assetsUrl(moduleKey), { params: { path } });
915
+ }
916
+ content(moduleKey, path, revision) {
917
+ return this.http.get(`${this.assetsUrl(moduleKey)}/content`, {
918
+ params: {
919
+ path,
920
+ revision
921
+ },
922
+ responseType: "blob"
923
+ });
924
+ }
925
+ assetsUrl(moduleKey) {
926
+ return `${serviceRootOf(this.runtimeConfiguration, "APP_SERVICE_ROOT")}/modules/${encodeURIComponent(moduleKey)}/assets`;
927
+ }
928
+ static ɵfac = i0.ɵɵngDeclareFactory({
929
+ minVersion: "12.0.0",
930
+ version: "22.2.6",
931
+ ngImport: i0,
932
+ type: ModuleAssetService,
933
+ deps: [],
934
+ target: i0.ɵɵFactoryTarget.Injectable
935
+ });
936
+ static ɵprov = i0.ɵɵngDeclareInjectable({
937
+ minVersion: "12.0.0",
938
+ version: "22.2.6",
939
+ ngImport: i0,
940
+ type: ModuleAssetService,
941
+ providedIn: "root"
942
+ });
943
+ };
944
+ i0.ɵɵngDeclareClassMetadata({
945
+ minVersion: "12.0.0",
946
+ version: "22.2.6",
947
+ ngImport: i0,
948
+ type: ModuleAssetService,
949
+ decorators: [{
950
+ type: Injectable,
951
+ args: [{ providedIn: "root" }]
952
+ }]
953
+ });
954
+ const MODULE_ASSETS_I18N_SCOPE = `${MODULE_DEFINITION_I18N_SCOPE}.assets_panel`;
955
+ var ModuleAssetsAttrDescriptor = class extends BaseEntityAttrDescriptor {
956
+ constructor() {
957
+ super("assets", FormControlType.CUSTOM, "Assets");
958
+ this.component = ModuleAssetsControlComponent;
959
+ this.disabled = true;
960
+ this.hideInTable = true;
961
+ }
962
+ };
963
+ var ModuleAssetsControlComponent = class ModuleAssetsControlComponent extends AssetsControlBase {
964
+ scope = MODULE_ASSETS_I18N_SCOPE;
965
+ scheme = "module";
966
+ testIdPrefix = "module";
967
+ service = inject(ModuleAssetService);
968
+ static ɵfac = i0.ɵɵngDeclareFactory({
969
+ minVersion: "12.0.0",
970
+ version: "22.2.6",
971
+ ngImport: i0,
972
+ type: ModuleAssetsControlComponent,
973
+ deps: null,
974
+ target: i0.ɵɵFactoryTarget.Component
975
+ });
976
+ static ɵcmp = i0.ɵɵngDeclareComponent({
977
+ minVersion: "17.0.0",
978
+ version: "22.2.6",
979
+ type: ModuleAssetsControlComponent,
980
+ isStandalone: true,
981
+ selector: "pp-module-assets-control",
982
+ usesInheritance: true,
983
+ ngImport: i0,
984
+ template: "\n <div class=\"base-entity-form-field pp-assets\">\n <span class=\"pp-assets__label\">{{ config().i18nKey() | ppLabel: config().label }}</span>\n @if (ownerKey(); as key) {\n <p class=\"pp-assets__hint\">{{ scope + '.hint' | transloco }}</p>\n @if (assets().length) {\n <table class=\"pp-assets__list\" [attr.data-testid]=\"testIdPrefix + '-assets-list'\">\n <thead>\n <tr>\n <th>{{ scope + '.path' | transloco }}</th>\n <th>{{ scope + '.type' | transloco }}</th>\n <th>{{ scope + '.size' | transloco }}</th>\n <th></th>\n </tr>\n </thead>\n <tbody>\n @for (asset of assets(); track asset.path) {\n <tr [attr.data-testid]=\"testIdPrefix + '-asset-' + asset.path\">\n <td>\n <code>{{ scheme }}:{{ asset.path }}</code>\n </td>\n <td>{{ asset.mimeType }}</td>\n <td>{{ sizeOf(asset) }}</td>\n <td>\n <button mat-button type=\"button\" [attr.data-testid]=\"testIdPrefix + '-asset-remove-' + asset.path\" (click)=\"remove(key, asset)\">{{ scope + '.remove' | transloco }}</button>\n </td>\n </tr>\n }\n </tbody>\n </table>\n } @else {\n <p class=\"pp-assets__hint\" [attr.data-testid]=\"testIdPrefix + '-assets-none'\">{{ scope + '.none' | transloco }}</p>\n }\n <div class=\"pp-assets__actions\">\n <label class=\"pp-assets__folder\">\n <span>{{ scope + '.folder' | transloco }}</span>\n <input #folder type=\"text\" placeholder=\"docs/img\" [attr.data-testid]=\"testIdPrefix + '-assets-folder'\" />\n </label>\n <button mat-stroked-button type=\"button\" [attr.data-testid]=\"testIdPrefix + '-assets-upload'\" (click)=\"fileInput.click()\">{{ scope + '.upload' | transloco }}</button>\n <input #fileInput type=\"file\" multiple hidden [attr.data-testid]=\"testIdPrefix + '-assets-file'\" (change)=\"upload(key, fileInput, folder.value)\" />\n </div>\n @if (error(); as message) {\n <p class=\"pp-assets__error\" [attr.data-testid]=\"testIdPrefix + '-assets-error'\">{{ message }}</p>\n }\n } @else {\n <p class=\"pp-assets__hint\" [attr.data-testid]=\"testIdPrefix + '-assets-save-first'\">{{ scope + '.save_first' | transloco }}</p>\n }\n </div>\n ",
985
+ isInline: true,
986
+ styles: [".pp-assets{border:1px solid var(--mat-sys-outline-variant);border-radius:4px;display:flex;flex-direction:column;gap:6px;padding:8px 12px}.pp-assets__label{font:var(--mat-sys-label-large)}.pp-assets__hint{margin:0;opacity:.7;font-size:12px}.pp-assets__list{border-collapse:collapse;text-align:left}.pp-assets__list th,.pp-assets__list td{padding:2px 16px 2px 0}.pp-assets__actions{display:flex;gap:8px;align-items:center}.pp-assets__folder{display:flex;gap:6px;align-items:center}.pp-assets__error{margin:0;color:var(--mat-sys-error)}\n"],
987
+ dependencies: [
988
+ {
989
+ kind: "component",
990
+ type: MatButton,
991
+ selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ",
992
+ inputs: ["matButton"],
993
+ exportAs: ["matButton", "matAnchor"]
994
+ },
995
+ {
996
+ kind: "pipe",
997
+ type: EntityLabelPipe,
998
+ name: "ppLabel"
999
+ },
1000
+ {
1001
+ kind: "pipe",
1002
+ type: TranslocoPipe,
1003
+ name: "transloco"
1004
+ }
1005
+ ]
1006
+ });
1007
+ };
1008
+ i0.ɵɵngDeclareClassMetadata({
1009
+ minVersion: "12.0.0",
1010
+ version: "22.2.6",
1011
+ ngImport: i0,
1012
+ type: ModuleAssetsControlComponent,
1013
+ decorators: [{
1014
+ type: Component,
1015
+ args: [{
1016
+ selector: "pp-module-assets-control",
1017
+ standalone: true,
1018
+ imports: [
1019
+ EntityLabelPipe,
1020
+ MatButton,
1021
+ TranslocoPipe
1022
+ ],
1023
+ template: ASSETS_CONTROL_TEMPLATE,
1024
+ styles: [".pp-assets{border:1px solid var(--mat-sys-outline-variant);border-radius:4px;display:flex;flex-direction:column;gap:6px;padding:8px 12px}.pp-assets__label{font:var(--mat-sys-label-large)}.pp-assets__hint{margin:0;opacity:.7;font-size:12px}.pp-assets__list{border-collapse:collapse;text-align:left}.pp-assets__list th,.pp-assets__list td{padding:2px 16px 2px 0}.pp-assets__actions{display:flex;gap:8px;align-items:center}.pp-assets__folder{display:flex;gap:6px;align-items:center}.pp-assets__error{margin:0;color:var(--mat-sys-error)}\n"]
1025
+ }]
1026
+ }]
1027
+ });
1028
+ const MODULE_TRANSLATIONS_I18N_SCOPE = `${MODULE_DEFINITION_I18N_SCOPE}.translations_panel`;
1029
+ var ModuleTranslationsAttrDescriptor = class extends BaseEntityAttrDescriptor {
1030
+ constructor() {
1031
+ super("translations", FormControlType.CUSTOM, "Translations");
1032
+ this.component = ModuleTranslationsControlComponent;
1033
+ this.disabled = true;
1034
+ this.hideInTable = true;
1035
+ }
1036
+ };
1037
+ var ModuleTranslationsControlComponent = class ModuleTranslationsControlComponent extends BaseFormControlComponent {
1038
+ scope = MODULE_TRANSLATIONS_I18N_SCOPE;
1039
+ translations = inject(ModuleTranslationService);
1040
+ destroyRef = inject(DestroyRef);
1041
+ savedKey = signal(void 0, ...ngDevMode ? [{ debugName: "savedKey" }] : /* istanbul ignore next */ []);
1042
+ moduleKey = this.savedKey.asReadonly();
1043
+ coverage = signal([], ...ngDevMode ? [{ debugName: "coverage" }] : /* istanbul ignore next */ []);
1044
+ report = signal(void 0, ...ngDevMode ? [{ debugName: "report" }] : /* istanbul ignore next */ []);
1045
+ error = signal(void 0, ...ngDevMode ? [{ debugName: "error" }] : /* istanbul ignore next */ []);
1046
+ ngOnInit() {
1047
+ const id = this.formGroup?.get("id");
1048
+ const version = this.formGroup?.get("version");
1049
+ const refresh = () => this.updateKey(id?.value, version?.value);
1050
+ refresh();
1051
+ id?.valueChanges.pipe(takeUntilDestroyed(this.destroyRef)).subscribe(refresh);
1052
+ version?.valueChanges.pipe(takeUntilDestroyed(this.destroyRef)).subscribe(refresh);
1053
+ }
1054
+ download(moduleKey) {
1055
+ this.error.set(void 0);
1056
+ this.translations.download(moduleKey).subscribe({
1057
+ next: (zip) => this.save(zip, `${moduleKey}-translations.zip`),
1058
+ error: (failure) => this.error.set(this.messageOf(failure))
1059
+ });
1060
+ }
1061
+ upload(moduleKey, input) {
1062
+ const file = input.files?.item(0);
1063
+ if (!file) return;
1064
+ this.error.set(void 0);
1065
+ this.translations.upload(moduleKey, file).subscribe({
1066
+ next: (report) => {
1067
+ this.report.set(report);
1068
+ this.loadCoverage(moduleKey);
1069
+ },
1070
+ error: (failure) => this.error.set(this.messageOf(failure))
1071
+ });
1072
+ input.value = "";
1073
+ }
1074
+ updateKey(id, version) {
1075
+ const key = typeof id === "string" && id !== "" && version ? id : void 0;
1076
+ if (key === this.savedKey()) return;
1077
+ this.savedKey.set(key);
1078
+ this.report.set(void 0);
1079
+ this.coverage.set([]);
1080
+ if (key) this.loadCoverage(key);
1081
+ }
1082
+ loadCoverage(moduleKey) {
1083
+ this.translations.coverage(moduleKey).subscribe({
1084
+ next: (coverage) => this.coverage.set(coverage),
1085
+ error: () => this.coverage.set([])
1086
+ });
1087
+ }
1088
+ save(zip, fileName) {
1089
+ const url = URL.createObjectURL(zip);
1090
+ const link = document.createElement("a");
1091
+ link.href = url;
1092
+ link.download = fileName;
1093
+ link.click();
1094
+ URL.revokeObjectURL(url);
1095
+ }
1096
+ messageOf(failure) {
1097
+ if (failure instanceof HttpErrorResponse) return failure.error?.errorText ?? failure.message;
1098
+ return String(failure);
1099
+ }
1100
+ static ɵfac = i0.ɵɵngDeclareFactory({
1101
+ minVersion: "12.0.0",
1102
+ version: "22.2.6",
1103
+ ngImport: i0,
1104
+ type: ModuleTranslationsControlComponent,
1105
+ deps: null,
1106
+ target: i0.ɵɵFactoryTarget.Component
1107
+ });
1108
+ static ɵcmp = i0.ɵɵngDeclareComponent({
1109
+ minVersion: "17.0.0",
1110
+ version: "22.2.6",
1111
+ type: ModuleTranslationsControlComponent,
1112
+ isStandalone: true,
1113
+ selector: "pp-module-translations-control",
1114
+ usesInheritance: true,
1115
+ ngImport: i0,
1116
+ template: `
1117
+ <div class="base-entity-form-field pp-module-translations">
1118
+ <span class="pp-module-translations__label">{{ config().i18nKey() | ppLabel: config().label }}</span>
1119
+ @if (moduleKey(); as key) {
1120
+ <p class="pp-module-translations__hint">{{ scope + '.hint' | transloco }}</p>
1121
+ @if (coverage().length) {
1122
+ <table class="pp-module-translations__coverage" data-testid="module-translations-coverage">
1123
+ <thead>
1124
+ <tr>
1125
+ <th>{{ scope + '.language' | transloco }}</th>
1126
+ <th>{{ scope + '.translated' | transloco }}</th>
1127
+ </tr>
1128
+ </thead>
1129
+ <tbody>
1130
+ @for (language of coverage(); track language.locale) {
1131
+ <tr [attr.data-testid]="'module-translations-' + language.locale">
1132
+ <td>{{ language.locale }}</td>
1133
+ <td [title]="language.missingKeys.join(', ')">{{ language.translatedCount }} / {{ language.keyCount }}</td>
1134
+ </tr>
1135
+ }
1136
+ </tbody>
1137
+ </table>
1138
+ }
1139
+ <div class="pp-module-translations__actions">
1140
+ <button mat-stroked-button type="button" data-testid="module-translations-download" (click)="download(key)">{{ scope + '.download' | transloco }}</button>
1141
+ <button mat-stroked-button type="button" data-testid="module-translations-upload" (click)="fileInput.click()">{{ scope + '.upload' | transloco }}</button>
1142
+ <input #fileInput type="file" accept=".zip,.json" hidden data-testid="module-translations-file" (change)="upload(key, fileInput)" />
1143
+ </div>
1144
+ @if (report(); as uploaded) {
1145
+ <ul class="pp-module-translations__report" data-testid="module-translations-report">
1146
+ @for (language of uploaded.languages; track language.locale) {
1147
+ <li>
1148
+ <strong>{{ language.locale }}</strong
1149
+ >: {{ scope + '.stored' | transloco: { count: language.storedKeys } }}
1150
+ @if (language.additionalKeys.length) {
1151
+ <span class="pp-module-translations__note" [title]="language.additionalKeys.join(', ')">{{ scope + '.additional' | transloco: { count: language.additionalKeys.length } }}</span>
1152
+ }
1153
+ @if (language.missingKeys.length) {
1154
+ <span class="pp-module-translations__warning" [title]="language.missingKeys.join(', ')">{{ scope + '.missing' | transloco: { count: language.missingKeys.length } }}</span>
1155
+ }
1156
+ @if (language.untranslatedKeys.length) {
1157
+ <span class="pp-module-translations__warning" [title]="language.untranslatedKeys.join(', ')">{{
1158
+ scope + '.untranslated' | transloco: { count: language.untranslatedKeys.length }
1159
+ }}</span>
1160
+ }
1161
+ </li>
1162
+ }
1163
+ </ul>
1164
+ }
1165
+ @if (error(); as message) {
1166
+ <p class="pp-module-translations__error" data-testid="module-translations-error">{{ message }}</p>
1167
+ }
1168
+ } @else {
1169
+ <p class="pp-module-translations__hint" data-testid="module-translations-save-first">{{ scope + '.save_first' | transloco }}</p>
1170
+ }
1171
+ </div>
1172
+ `,
1173
+ isInline: true,
1174
+ styles: [".pp-module-translations{border:1px solid var(--mat-sys-outline-variant);border-radius:4px;display:flex;flex-direction:column;gap:6px;padding:8px 12px}.pp-module-translations__label{font:var(--mat-sys-label-large)}.pp-module-translations__hint{margin:0;opacity:.7;font-size:12px}.pp-module-translations__coverage{border-collapse:collapse;text-align:left}.pp-module-translations__coverage th,.pp-module-translations__coverage td{padding:2px 16px 2px 0}.pp-module-translations__actions{display:flex;gap:8px}.pp-module-translations__report{margin:0;padding-left:16px}.pp-module-translations__note{margin-left:8px;font-size:12px;opacity:.7}.pp-module-translations__warning{margin-left:8px;font-size:12px;color:var(--mat-sys-tertiary)}.pp-module-translations__error{margin:0;color:var(--mat-sys-error)}\n"],
1175
+ dependencies: [
1176
+ {
1177
+ kind: "component",
1178
+ type: MatButton,
1179
+ selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ",
1180
+ inputs: ["matButton"],
1181
+ exportAs: ["matButton", "matAnchor"]
1182
+ },
1183
+ {
1184
+ kind: "pipe",
1185
+ type: EntityLabelPipe,
1186
+ name: "ppLabel"
1187
+ },
1188
+ {
1189
+ kind: "pipe",
1190
+ type: TranslocoPipe,
1191
+ name: "transloco"
1192
+ }
1193
+ ]
1194
+ });
1195
+ };
1196
+ i0.ɵɵngDeclareClassMetadata({
1197
+ minVersion: "12.0.0",
1198
+ version: "22.2.6",
1199
+ ngImport: i0,
1200
+ type: ModuleTranslationsControlComponent,
1201
+ decorators: [{
1202
+ type: Component,
1203
+ args: [{
1204
+ selector: "pp-module-translations-control",
1205
+ standalone: true,
1206
+ imports: [
1207
+ EntityLabelPipe,
1208
+ MatButton,
1209
+ TranslocoPipe
1210
+ ],
1211
+ template: `
1212
+ <div class="base-entity-form-field pp-module-translations">
1213
+ <span class="pp-module-translations__label">{{ config().i18nKey() | ppLabel: config().label }}</span>
1214
+ @if (moduleKey(); as key) {
1215
+ <p class="pp-module-translations__hint">{{ scope + '.hint' | transloco }}</p>
1216
+ @if (coverage().length) {
1217
+ <table class="pp-module-translations__coverage" data-testid="module-translations-coverage">
1218
+ <thead>
1219
+ <tr>
1220
+ <th>{{ scope + '.language' | transloco }}</th>
1221
+ <th>{{ scope + '.translated' | transloco }}</th>
1222
+ </tr>
1223
+ </thead>
1224
+ <tbody>
1225
+ @for (language of coverage(); track language.locale) {
1226
+ <tr [attr.data-testid]="'module-translations-' + language.locale">
1227
+ <td>{{ language.locale }}</td>
1228
+ <td [title]="language.missingKeys.join(', ')">{{ language.translatedCount }} / {{ language.keyCount }}</td>
1229
+ </tr>
1230
+ }
1231
+ </tbody>
1232
+ </table>
1233
+ }
1234
+ <div class="pp-module-translations__actions">
1235
+ <button mat-stroked-button type="button" data-testid="module-translations-download" (click)="download(key)">{{ scope + '.download' | transloco }}</button>
1236
+ <button mat-stroked-button type="button" data-testid="module-translations-upload" (click)="fileInput.click()">{{ scope + '.upload' | transloco }}</button>
1237
+ <input #fileInput type="file" accept=".zip,.json" hidden data-testid="module-translations-file" (change)="upload(key, fileInput)" />
1238
+ </div>
1239
+ @if (report(); as uploaded) {
1240
+ <ul class="pp-module-translations__report" data-testid="module-translations-report">
1241
+ @for (language of uploaded.languages; track language.locale) {
1242
+ <li>
1243
+ <strong>{{ language.locale }}</strong
1244
+ >: {{ scope + '.stored' | transloco: { count: language.storedKeys } }}
1245
+ @if (language.additionalKeys.length) {
1246
+ <span class="pp-module-translations__note" [title]="language.additionalKeys.join(', ')">{{ scope + '.additional' | transloco: { count: language.additionalKeys.length } }}</span>
1247
+ }
1248
+ @if (language.missingKeys.length) {
1249
+ <span class="pp-module-translations__warning" [title]="language.missingKeys.join(', ')">{{ scope + '.missing' | transloco: { count: language.missingKeys.length } }}</span>
1250
+ }
1251
+ @if (language.untranslatedKeys.length) {
1252
+ <span class="pp-module-translations__warning" [title]="language.untranslatedKeys.join(', ')">{{
1253
+ scope + '.untranslated' | transloco: { count: language.untranslatedKeys.length }
1254
+ }}</span>
1255
+ }
1256
+ </li>
1257
+ }
1258
+ </ul>
1259
+ }
1260
+ @if (error(); as message) {
1261
+ <p class="pp-module-translations__error" data-testid="module-translations-error">{{ message }}</p>
1262
+ }
1263
+ } @else {
1264
+ <p class="pp-module-translations__hint" data-testid="module-translations-save-first">{{ scope + '.save_first' | transloco }}</p>
1265
+ }
1266
+ </div>
1267
+ `,
1268
+ styles: [".pp-module-translations{border:1px solid var(--mat-sys-outline-variant);border-radius:4px;display:flex;flex-direction:column;gap:6px;padding:8px 12px}.pp-module-translations__label{font:var(--mat-sys-label-large)}.pp-module-translations__hint{margin:0;opacity:.7;font-size:12px}.pp-module-translations__coverage{border-collapse:collapse;text-align:left}.pp-module-translations__coverage th,.pp-module-translations__coverage td{padding:2px 16px 2px 0}.pp-module-translations__actions{display:flex;gap:8px}.pp-module-translations__report{margin:0;padding-left:16px}.pp-module-translations__note{margin-left:8px;font-size:12px;opacity:.7}.pp-module-translations__warning{margin-left:8px;font-size:12px;color:var(--mat-sys-tertiary)}.pp-module-translations__error{margin:0;color:var(--mat-sys-error)}\n"]
1269
+ }]
1270
+ }]
1271
+ });
209
1272
  const APP_DEFINITION_ENTITY_NAME = "App Definition";
210
1273
  const MODULE_DEFINITION_ENTITY_NAME = "Module Definition";
211
1274
  const APP_MODULE_MOUNT_ENTITY_NAME = "App Module Mount";
212
1275
  const APP_NAV_ITEM_ENTITY_NAME = "App Nav Item";
213
1276
  const APP_REGION_ENTITY_NAME = "App Region";
214
1277
  const APP_ROUTE_ENTITY_NAME = "App Route";
1278
+ const APP_CONTEXT_ENTITY_NAME = "App Context";
215
1279
  const APP_WIDGET_ENTITY_NAME = "App Widget";
216
1280
  const APP_MODULE_MOUNT_ID_FIELD = "moduleKey";
217
1281
  function createModuleMountAttrDescriptors() {
@@ -240,6 +1304,80 @@ function createModuleMountDescriptor() {
240
1304
  isEmbedded: true
241
1305
  });
242
1306
  }
1307
+ const APP_CONTEXT_ID_FIELD = "name";
1308
+ const PERSIST_MODES = ["url", "url-local-storage"];
1309
+ function createContextAttrDescriptors() {
1310
+ const nameAttr = new BaseEntityAttrDescriptor("name", FormControlType.TEXT_BOX, "Name", void 0, true);
1311
+ nameAttr.required = true;
1312
+ nameAttr.isHeading = true;
1313
+ nameAttr.placeholder = "The context's URL segment, e.g. warehouse";
1314
+ nameAttr.pattern = "^[a-z0-9]+(-[a-z0-9]+)*$";
1315
+ const entityNameAttr = new BaseEntityAttrDescriptor("entityName", FormControlType.TEXT_BOX, "Entity Name");
1316
+ entityNameAttr.required = true;
1317
+ entityNameAttr.placeholder = "The entity type the user picks, e.g. Warehouse";
1318
+ const parentAttr = new BaseEntityAttrDescriptor("parent", FormControlType.TEXT_BOX, "Parent");
1319
+ parentAttr.placeholder = "Name of the context this one is nested in";
1320
+ parentAttr.hideInTable = true;
1321
+ const basePathAttr = new BaseEntityAttrDescriptor("basePath", FormControlType.TEXT_BOX, "Base Path");
1322
+ basePathAttr.placeholder = "Where its routes are mounted, e.g. /conduct; empty for the app root";
1323
+ basePathAttr.hideInTable = true;
1324
+ const persistAttr = new BaseEntityAttrDescriptor("persist", FormControlType.DROPDOWN, "Persist", toSelectables(PERSIST_MODES));
1325
+ persistAttr.hideInTable = true;
1326
+ const pickerSearchFieldsAttr = new BaseEntityAttrDescriptor("pickerSearchFields", FormControlType.TAGS, "Picker Search Fields");
1327
+ pickerSearchFieldsAttr.placeholder = "Attributes the picker searches; empty for the title attribute";
1328
+ pickerSearchFieldsAttr.hideInTable = true;
1329
+ const pickerRecentAttr = new BaseEntityAttrDescriptor("pickerRecent", FormControlType.TEXT_BOX, "Picker Recent", void 0, false, { inputType: "number" });
1330
+ pickerRecentAttr.hideInTable = true;
1331
+ const displayLabelAttr = new BaseEntityAttrDescriptor("displayLabel", FormControlType.TEXT_BOX, "Display Label");
1332
+ displayLabelAttr.placeholder = "Crumb text, e.g. {{name}}; empty for the title attribute";
1333
+ displayLabelAttr.hideInTable = true;
1334
+ const displayBadgeAttr = new BaseEntityAttrDescriptor("displayBadge", FormControlType.TEXT_BOX, "Display Badge");
1335
+ displayBadgeAttr.placeholder = "Attribute shown as a badge; state for the state attribute";
1336
+ displayBadgeAttr.hideInTable = true;
1337
+ const displayExtraAttr = new BaseEntityAttrDescriptor("displayExtra", FormControlType.TEXT_BOX, "Display Extra");
1338
+ displayExtraAttr.placeholder = "A second text, e.g. zone {{currentZone}}";
1339
+ displayExtraAttr.hideInTable = true;
1340
+ const confirmSwitchStatesAttr = new BaseEntityAttrDescriptor("confirmSwitchStates", FormControlType.TAGS, "Confirm Switch States");
1341
+ confirmSwitchStatesAttr.placeholder = "States that make leaving the entity ask first, e.g. Running";
1342
+ confirmSwitchStatesAttr.hideInTable = true;
1343
+ const identityRow = new FlexboxDescriptor([
1344
+ nameAttr,
1345
+ entityNameAttr,
1346
+ parentAttr
1347
+ ], FlexDirection.ROW);
1348
+ identityRow.style = { "column-gap": "10px" };
1349
+ const placementRow = new FlexboxDescriptor([basePathAttr, persistAttr], FlexDirection.ROW);
1350
+ placementRow.style = { "column-gap": "10px" };
1351
+ const pickerRow = new FlexboxDescriptor([pickerSearchFieldsAttr, pickerRecentAttr], FlexDirection.ROW);
1352
+ pickerRow.style = { "column-gap": "10px" };
1353
+ const displayRow = new FlexboxDescriptor([
1354
+ displayLabelAttr,
1355
+ displayBadgeAttr,
1356
+ displayExtraAttr
1357
+ ], FlexDirection.ROW);
1358
+ displayRow.style = { "column-gap": "10px" };
1359
+ const flexBoxContainer = new FlexboxDescriptor([
1360
+ identityRow,
1361
+ placementRow,
1362
+ pickerRow,
1363
+ displayRow,
1364
+ confirmSwitchStatesAttr
1365
+ ], FlexDirection.COLUMN);
1366
+ flexBoxContainer.style = {
1367
+ "row-gap": "5px",
1368
+ width: "fit-content"
1369
+ };
1370
+ return [flexBoxContainer];
1371
+ }
1372
+ function createWorkingContextDescriptor() {
1373
+ return new BaseEntityDescriptor({
1374
+ entityName: APP_CONTEXT_ENTITY_NAME,
1375
+ attrDescriptors: createContextAttrDescriptors(),
1376
+ i18nScope: APP_CONTEXT_I18N_SCOPE,
1377
+ componentParent: APP_DEFINITION_ENTITY_NAME,
1378
+ isEmbedded: true
1379
+ });
1380
+ }
243
1381
  const APP_REGION_ID_FIELD = "type";
244
1382
  function createRegionDefinitionAttrDescriptors() {
245
1383
  const typeAttr = new BaseEntityAttrDescriptor("type", FormControlType.DROPDOWN, "Type", toSelectables(REGION_TYPES), true);
@@ -248,9 +1386,11 @@ function createRegionDefinitionAttrDescriptors() {
248
1386
  const navItemsAttr = new BaseEntityAttrDescriptor("navItems", FormControlType.EMBEDDED_COMPONENTS, "Nav Items");
249
1387
  navItemsAttr.linkedEntityType = APP_NAV_ITEM_ENTITY_NAME;
250
1388
  navItemsAttr.hideInTable = true;
1389
+ navItemsAttr.ordered = true;
251
1390
  const widgetsAttr = new BaseEntityAttrDescriptor("widgets", FormControlType.EMBEDDED_COMPONENTS, "Widgets");
252
1391
  widgetsAttr.linkedEntityType = APP_WIDGET_ENTITY_NAME;
253
1392
  widgetsAttr.hideInTable = true;
1393
+ widgetsAttr.ordered = true;
254
1394
  const flexBoxContainer = new FlexboxDescriptor([
255
1395
  typeAttr,
256
1396
  navItemsAttr,
@@ -289,11 +1429,16 @@ function createRouteDefinitionAttrDescriptors() {
289
1429
  const rolesAttr = new BaseEntityAttrDescriptor("roles", FormControlType.TAGS, "Roles");
290
1430
  rolesAttr.placeholder = "Empty means any authenticated member of the organization";
291
1431
  rolesAttr.hideInTable = true;
1432
+ rolesAttr.tagSuggestions = REALM_ROLE_SUGGESTIONS;
1433
+ const requiresContextAttr = new BaseEntityAttrDescriptor("requiresContext", FormControlType.TEXT_BOX, "Requires Context");
1434
+ requiresContextAttr.placeholder = "Name of a context of the app; the page then lives below ctx/<name>/<id>";
1435
+ requiresContextAttr.hideInTable = true;
292
1436
  const kindAttr = new BaseEntityAttrDescriptor("kind", FormControlType.DROPDOWN, "Renders", toSelectables(ROUTE_TARGET_KINDS));
293
1437
  kindAttr.required = true;
294
1438
  const widgetsAttr = new BaseEntityAttrDescriptor("widgets", FormControlType.EMBEDDED_COMPONENTS, "Widgets");
295
1439
  widgetsAttr.linkedEntityType = APP_WIDGET_ENTITY_NAME;
296
1440
  widgetsAttr.hideInTable = true;
1441
+ widgetsAttr.ordered = true;
297
1442
  const documentSlugAttr = new BaseEntityAttrDescriptor("documentSlug", FormControlType.TEXT_BOX, "Document Slug");
298
1443
  documentSlugAttr.placeholder = "DOCUMENT only: slug of the document to render";
299
1444
  documentSlugAttr.hideInTable = true;
@@ -305,20 +1450,32 @@ function createRouteDefinitionAttrDescriptors() {
305
1450
  const rsqlFilterAttr = new BaseEntityAttrDescriptor("rsqlFilter", FormControlType.TEXT_BOX, "Rsql Filter");
306
1451
  rsqlFilterAttr.placeholder = "ENTITY + LIST only: RSQL the list is pre-filtered with";
307
1452
  rsqlFilterAttr.hideInTable = true;
1453
+ const contextPathAttr = new BaseEntityAttrDescriptor("contextPath", FormControlType.TEXT_BOX, "Context Path");
1454
+ contextPathAttr.placeholder = "ENTITY + requires context: the context entity's collection to list, e.g. zones";
1455
+ contextPathAttr.hideInTable = true;
1456
+ const filterByContextAttr = new BaseEntityAttrDescriptor("filterByContext", FormControlType.TEXT_BOX, "Filter By Context");
1457
+ filterByContextAttr.placeholder = "ENTITY + LIST: name of a context; the list can be narrowed to its active entity";
1458
+ filterByContextAttr.hideInTable = true;
308
1459
  const identityRow = new FlexboxDescriptor([
309
1460
  pathAttr,
310
1461
  titleAttr,
311
1462
  translocoIdAttr
312
1463
  ], FlexDirection.ROW);
313
1464
  identityRow.style = { "column-gap": "10px" };
314
- const presentationRow = new FlexboxDescriptor([iconAttr, kindAttr], FlexDirection.ROW);
1465
+ const presentationRow = new FlexboxDescriptor([
1466
+ iconAttr,
1467
+ kindAttr,
1468
+ requiresContextAttr
1469
+ ], FlexDirection.ROW);
315
1470
  presentationRow.style = { "column-gap": "10px" };
316
1471
  const documentRow = new FlexboxDescriptor([documentSlugAttr], FlexDirection.ROW);
317
1472
  documentRow.style = { "column-gap": "10px" };
318
1473
  const entityRow = new FlexboxDescriptor([
319
1474
  entityNameAttr,
320
1475
  entityModeAttr,
321
- rsqlFilterAttr
1476
+ rsqlFilterAttr,
1477
+ contextPathAttr,
1478
+ filterByContextAttr
322
1479
  ], FlexDirection.ROW);
323
1480
  entityRow.style = { "column-gap": "10px" };
324
1481
  const flexBoxContainer = new FlexboxDescriptor([
@@ -346,10 +1503,10 @@ function createRouteDefinitionDescriptor() {
346
1503
  }
347
1504
  const statusSelectables = toSelectables(Object.keys(AppDefinitionStatus));
348
1505
  function createAppDefinitionAttrDescriptors() {
349
- const idAttr = new BaseEntityAttrDescriptor("id", FormControlType.TEXT_BOX, "Id");
1506
+ const idAttr = new BaseEntityAttrDescriptor("id", FormControlType.TEXT_BOX, "Id", void 0, true);
350
1507
  idAttr.required = true;
351
1508
  idAttr.placeholder = "Unique within the organization, e.g. claims-app";
352
- const nameAttr = new BaseEntityAttrDescriptor("name", FormControlType.TEXT_BOX, "Name", void 0, true);
1509
+ const nameAttr = new BaseEntityAttrDescriptor("name", FormControlType.TEXT_BOX, "Name");
353
1510
  nameAttr.required = true;
354
1511
  nameAttr.isHeading = true;
355
1512
  const translocoIdAttr = new BaseEntityAttrDescriptor("translocoId", FormControlType.TEXT_BOX, "Transloco Id");
@@ -400,6 +1557,12 @@ function createAppDefinitionAttrDescriptors() {
400
1557
  modulesAttr.linkedEntityType = APP_MODULE_MOUNT_ENTITY_NAME;
401
1558
  modulesAttr.referenceIdField = APP_MODULE_MOUNT_ID_FIELD;
402
1559
  modulesAttr.hideInTable = true;
1560
+ const contextsAttr = new BaseEntityAttrDescriptor("contexts", FormControlType.EMBEDDED_COMPONENTS, "Contexts");
1561
+ contextsAttr.linkedEntityType = APP_CONTEXT_ENTITY_NAME;
1562
+ contextsAttr.referenceIdField = APP_CONTEXT_ID_FIELD;
1563
+ contextsAttr.hideInTable = true;
1564
+ const assetsAttr = new AppAssetsAttrDescriptor();
1565
+ const translationsAttr = new AppTranslationsAttrDescriptor();
403
1566
  const identityRow = new FlexboxDescriptor([
404
1567
  idAttr,
405
1568
  nameAttr,
@@ -428,7 +1591,8 @@ function createAppDefinitionAttrDescriptors() {
428
1591
  const graphRow = new FlexboxDescriptor([
429
1592
  regionsAttr,
430
1593
  routesAttr,
431
- modulesAttr
1594
+ modulesAttr,
1595
+ contextsAttr
432
1596
  ], FlexDirection.ROW);
433
1597
  graphRow.style = { "column-gap": "10px" };
434
1598
  const flexBoxContainer = new FlexboxDescriptor([
@@ -440,7 +1604,9 @@ function createAppDefinitionAttrDescriptors() {
440
1604
  tokenOverridesAttr,
441
1605
  layoutRow,
442
1606
  sidenavRow,
443
- graphRow
1607
+ graphRow,
1608
+ translationsAttr,
1609
+ assetsAttr
444
1610
  ], FlexDirection.COLUMN);
445
1611
  flexBoxContainer.style = {
446
1612
  "row-gap": "5px",
@@ -452,7 +1618,8 @@ function createAppDefinitionDescriptor() {
452
1618
  return new BaseEntityDescriptor({
453
1619
  entityName: APP_DEFINITION_ENTITY_NAME,
454
1620
  attrDescriptors: createAppDefinitionAttrDescriptors(),
455
- i18nScope: APP_DEFINITION_I18N_SCOPE
1621
+ i18nScope: APP_DEFINITION_I18N_SCOPE,
1622
+ titleKey: "name"
456
1623
  });
457
1624
  }
458
1625
  function createNavItemAttrDescriptors() {
@@ -473,9 +1640,11 @@ function createNavItemAttrDescriptors() {
473
1640
  const rolesAttr = new BaseEntityAttrDescriptor("roles", FormControlType.TAGS, "Roles");
474
1641
  rolesAttr.placeholder = "Empty means any authenticated member of the organization";
475
1642
  rolesAttr.hideInTable = true;
1643
+ rolesAttr.tagSuggestions = REALM_ROLE_SUGGESTIONS;
476
1644
  const childrenAttr = new BaseEntityAttrDescriptor("children", FormControlType.EMBEDDED_COMPONENTS, "Children");
477
1645
  childrenAttr.linkedEntityType = APP_NAV_ITEM_ENTITY_NAME;
478
1646
  childrenAttr.hideInTable = true;
1647
+ childrenAttr.ordered = true;
479
1648
  const identityRow = new FlexboxDescriptor([
480
1649
  idAttr,
481
1650
  labelAttr,
@@ -505,14 +1674,13 @@ function createNavItemDescriptor() {
505
1674
  isEmbedded: true
506
1675
  });
507
1676
  }
508
- function createWidgetInstanceAttrDescriptors() {
1677
+ function createWidgetInstanceAttrDescriptors(widgetTypes) {
509
1678
  const idAttr = new BaseEntityAttrDescriptor("id", FormControlType.TEXT_BOX, "Id", void 0, true);
510
1679
  idAttr.required = true;
511
1680
  idAttr.isHeading = true;
512
1681
  idAttr.placeholder = "Unique within the page or region, e.g. widget-claims-grid";
513
- const typeAttr = new BaseEntityAttrDescriptor("type", FormControlType.TEXT_BOX, "Type");
1682
+ const typeAttr = new BaseEntityAttrDescriptor("type", FormControlType.DROPDOWN, "Type", widgetTypes);
514
1683
  typeAttr.required = true;
515
- typeAttr.placeholder = "Widget registry key, e.g. entity-grid";
516
1684
  const propsAttr = createWidgetPropsAttrDescriptor("props", "type", "Props");
517
1685
  propsAttr.hideInTable = true;
518
1686
  const placementAttr = new BaseEntityAttrDescriptor("placement", FormControlType.DROPDOWN, "Placement", toSelectables(WIDGET_PLACEMENTS));
@@ -530,15 +1698,18 @@ function createWidgetInstanceAttrDescriptors() {
530
1698
  };
531
1699
  return [flexBoxContainer];
532
1700
  }
533
- function createWidgetInstanceDescriptor() {
1701
+ function createWidgetInstanceDescriptor(widgetTypes = []) {
534
1702
  return new BaseEntityDescriptor({
535
1703
  entityName: APP_WIDGET_ENTITY_NAME,
536
- attrDescriptors: createWidgetInstanceAttrDescriptors(),
1704
+ attrDescriptors: createWidgetInstanceAttrDescriptors(widgetTypes),
537
1705
  i18nScope: APP_WIDGET_I18N_SCOPE,
538
1706
  componentParent: [APP_REGION_ENTITY_NAME, APP_ROUTE_ENTITY_NAME],
539
1707
  isEmbedded: true
540
1708
  });
541
1709
  }
1710
+ function widgetTypeSelectables(registry) {
1711
+ return toSelectables([...registry.keys()].sort((left, right) => left.localeCompare(right)));
1712
+ }
542
1713
  function createModuleDefinitionAttrDescriptors() {
543
1714
  const idAttr = new BaseEntityAttrDescriptor("id", FormControlType.TEXT_BOX, "Key");
544
1715
  idAttr.required = true;
@@ -564,6 +1735,8 @@ function createModuleDefinitionAttrDescriptors() {
564
1735
  routesAttr.linkedEntityType = APP_ROUTE_ENTITY_NAME;
565
1736
  routesAttr.referenceIdField = APP_ROUTE_ID_FIELD;
566
1737
  routesAttr.hideInTable = true;
1738
+ const translationsAttr = new ModuleTranslationsAttrDescriptor();
1739
+ const assetsAttr = new ModuleAssetsAttrDescriptor();
567
1740
  const identityRow = new FlexboxDescriptor([
568
1741
  idAttr,
569
1742
  nameAttr,
@@ -580,7 +1753,9 @@ function createModuleDefinitionAttrDescriptors() {
580
1753
  identityRow,
581
1754
  revisionRow,
582
1755
  descriptionAttr,
583
- routesAttr
1756
+ routesAttr,
1757
+ translationsAttr,
1758
+ assetsAttr
584
1759
  ], FlexDirection.COLUMN);
585
1760
  flexBoxContainer.style = {
586
1761
  "row-gap": "5px",
@@ -603,12 +1778,15 @@ function flattenRouteTarget(dto) {
603
1778
  translocoId: dto.translocoId,
604
1779
  icon: dto.icon,
605
1780
  roles: dto.roles,
1781
+ requiresContext: dto.requiresContext,
606
1782
  kind: target?.kind,
607
1783
  widgets: target?.widgets,
608
1784
  documentSlug: target?.documentSlug,
609
1785
  entityName: target?.entityName,
610
1786
  entityMode: target?.entityMode,
611
1787
  rsqlFilter: target?.rsqlFilter,
1788
+ contextPath: target?.contextPath,
1789
+ filterByContext: target?.filterByContext,
612
1790
  target
613
1791
  });
614
1792
  }
@@ -620,6 +1798,7 @@ function nestRouteTarget(route) {
620
1798
  translocoId: route.translocoId,
621
1799
  icon: route.icon,
622
1800
  roles: route.roles,
1801
+ requiresContext: route.requiresContext || void 0,
623
1802
  target: {
624
1803
  ...route.target,
625
1804
  kind: route.kind,
@@ -627,11 +1806,125 @@ function nestRouteTarget(route) {
627
1806
  documentSlug: route.documentSlug,
628
1807
  entityName: route.entityName,
629
1808
  entityMode: route.entityMode,
630
- rsqlFilter: route.rsqlFilter
1809
+ rsqlFilter: route.rsqlFilter,
1810
+ contextPath: route.contextPath || void 0,
1811
+ filterByContext: route.filterByContext || void 0
631
1812
  }
632
1813
  };
633
1814
  }
1815
+ var ModuleDefinitionMapper = class ModuleDefinitionMapper {
1816
+ fromDto(dto) {
1817
+ const source = dto;
1818
+ return new ModuleDefinition({
1819
+ id: source.key,
1820
+ name: source.name,
1821
+ translocoId: source.translocoId,
1822
+ description: source.description,
1823
+ translocoScope: source.translocoScope,
1824
+ routes: source.routes?.map(flattenRouteTarget),
1825
+ orgKey: source.orgKey,
1826
+ version: source.version,
1827
+ createdAt: source.createdAt,
1828
+ updatedAt: source.updatedAt
1829
+ });
1830
+ }
1831
+ toDto(entity) {
1832
+ return {
1833
+ key: entity.id,
1834
+ name: entity.name,
1835
+ translocoId: entity.translocoId,
1836
+ description: entity.description,
1837
+ translocoScope: entity.translocoScope,
1838
+ routes: entity.routes?.map(nestRouteTarget),
1839
+ orgKey: entity.orgKey,
1840
+ version: entity.version,
1841
+ createdAt: entity.createdAt,
1842
+ updatedAt: entity.updatedAt
1843
+ };
1844
+ }
1845
+ static ɵfac = i0.ɵɵngDeclareFactory({
1846
+ minVersion: "12.0.0",
1847
+ version: "22.2.6",
1848
+ ngImport: i0,
1849
+ type: ModuleDefinitionMapper,
1850
+ deps: [],
1851
+ target: i0.ɵɵFactoryTarget.Injectable
1852
+ });
1853
+ static ɵprov = i0.ɵɵngDeclareInjectable({
1854
+ minVersion: "12.0.0",
1855
+ version: "22.2.6",
1856
+ ngImport: i0,
1857
+ type: ModuleDefinitionMapper,
1858
+ providedIn: "root"
1859
+ });
1860
+ };
1861
+ i0.ɵɵngDeclareClassMetadata({
1862
+ minVersion: "12.0.0",
1863
+ version: "22.2.6",
1864
+ ngImport: i0,
1865
+ type: ModuleDefinitionMapper,
1866
+ decorators: [{
1867
+ type: Injectable,
1868
+ args: [{ providedIn: "root" }]
1869
+ }]
1870
+ });
1871
+ const STATE_CONDITION = "state";
1872
+ function flattenWorkingContext(dto) {
1873
+ const states = dto.confirmSwitchWhen?.[STATE_CONDITION];
1874
+ return new WorkingContextRow({
1875
+ name: dto.name,
1876
+ entityName: dto.entityName,
1877
+ parent: dto.parent,
1878
+ basePath: dto.basePath,
1879
+ persist: dto.persist,
1880
+ pickerSearchFields: dto.picker?.searchFields,
1881
+ pickerRecent: dto.picker?.recent,
1882
+ displayLabel: dto.display?.label,
1883
+ displayBadge: dto.display?.badge,
1884
+ displayExtra: dto.display?.extra,
1885
+ confirmSwitchStates: states === void 0 ? void 0 : [states].flat().map(String),
1886
+ source: dto
1887
+ });
1888
+ }
1889
+ function nestWorkingContext(row) {
1890
+ const picker = clean({
1891
+ ...row.source?.picker,
1892
+ searchFields: row.pickerSearchFields?.length ? row.pickerSearchFields : void 0,
1893
+ recent: toCount(row.pickerRecent)
1894
+ });
1895
+ const display = clean({
1896
+ ...row.source?.display,
1897
+ label: row.displayLabel || void 0,
1898
+ badge: row.displayBadge || void 0,
1899
+ extra: row.displayExtra || void 0
1900
+ });
1901
+ const confirmSwitchWhen = clean({
1902
+ ...row.source?.confirmSwitchWhen,
1903
+ [STATE_CONDITION]: row.confirmSwitchStates?.length ? row.confirmSwitchStates : void 0
1904
+ });
1905
+ return clean({
1906
+ ...row.source,
1907
+ name: row.name,
1908
+ entityName: row.entityName,
1909
+ parent: row.parent || void 0,
1910
+ basePath: row.basePath || void 0,
1911
+ persist: row.persist || void 0,
1912
+ picker,
1913
+ display,
1914
+ confirmSwitchWhen
1915
+ });
1916
+ }
1917
+ function toCount(value) {
1918
+ if (value === void 0 || value === null || value === "") return void 0;
1919
+ const count = Number(value);
1920
+ return Number.isInteger(count) && count >= 0 ? count : void 0;
1921
+ }
1922
+ function clean(value) {
1923
+ const entries = Object.entries(value).filter(([, member]) => member !== void 0);
1924
+ return entries.length === 0 ? void 0 : Object.fromEntries(entries);
1925
+ }
634
1926
  var AppDefinitionMapper = class AppDefinitionMapper {
1927
+ moduleMapper = new ModuleDefinitionMapper();
635
1928
  fromDto(dto) {
636
1929
  const source = dto;
637
1930
  const theme = source.theme;
@@ -656,6 +1949,8 @@ var AppDefinitionMapper = class AppDefinitionMapper {
656
1949
  regions: source.regions,
657
1950
  routes: source.routes?.map(flattenRouteTarget),
658
1951
  modules: source.modules,
1952
+ contexts: source.contexts?.map(flattenWorkingContext),
1953
+ mountedModules: source.mountedModules?.map((module) => this.moduleMapper.fromDto(module)),
659
1954
  orgKey: source.orgKey,
660
1955
  status: source.status,
661
1956
  version: source.version,
@@ -675,6 +1970,7 @@ var AppDefinitionMapper = class AppDefinitionMapper {
675
1970
  regions: entity.regions,
676
1971
  routes: entity.routes?.map(nestRouteTarget),
677
1972
  modules: entity.modules,
1973
+ contexts: entity.contexts?.map(nestWorkingContext),
678
1974
  orgKey: entity.orgKey,
679
1975
  status: entity.status,
680
1976
  version: entity.version,
@@ -705,7 +2001,7 @@ var AppDefinitionMapper = class AppDefinitionMapper {
705
2001
  }
706
2002
  static ɵfac = i0.ɵɵngDeclareFactory({
707
2003
  minVersion: "12.0.0",
708
- version: "22.1.7",
2004
+ version: "22.2.6",
709
2005
  ngImport: i0,
710
2006
  type: AppDefinitionMapper,
711
2007
  deps: [],
@@ -713,7 +2009,7 @@ var AppDefinitionMapper = class AppDefinitionMapper {
713
2009
  });
714
2010
  static ɵprov = i0.ɵɵngDeclareInjectable({
715
2011
  minVersion: "12.0.0",
716
- version: "22.1.7",
2012
+ version: "22.2.6",
717
2013
  ngImport: i0,
718
2014
  type: AppDefinitionMapper,
719
2015
  providedIn: "root"
@@ -721,7 +2017,7 @@ var AppDefinitionMapper = class AppDefinitionMapper {
721
2017
  };
722
2018
  i0.ɵɵngDeclareClassMetadata({
723
2019
  minVersion: "12.0.0",
724
- version: "22.1.7",
2020
+ version: "22.2.6",
725
2021
  ngImport: i0,
726
2022
  type: AppDefinitionMapper,
727
2023
  decorators: [{
@@ -741,9 +2037,19 @@ var AppDefinitionService = class AppDefinitionService extends BaseEntityRestServ
741
2037
  if (!fullUrl) throw new Error("Could not determine the full url");
742
2038
  return this.httpClient.post(fullUrl, {}, { headers: this.headers }).pipe(map((response) => this.entityMapper.fromDto(response)));
743
2039
  }
2040
+ findPublished(id) {
2041
+ const pathParams = /* @__PURE__ */ new Map([["id", String(id)]]);
2042
+ const fullUrl = this.buildFullUrl(this.resourceUrl + "/%{id}/layout", { pathParams });
2043
+ if (!fullUrl) throw new Error("Could not determine the full url");
2044
+ const context = new HttpContext().set(EXPECTED_ERROR_STATUSES, [404]);
2045
+ return this.httpClient.get(fullUrl, {
2046
+ headers: this.headers,
2047
+ context
2048
+ }).pipe(map((response) => this.entityMapper.fromDto(response)), catchError((error) => error instanceof HttpErrorResponse && error.status === 404 ? of(void 0) : throwError(() => error)));
2049
+ }
744
2050
  static ɵfac = i0.ɵɵngDeclareFactory({
745
2051
  minVersion: "12.0.0",
746
- version: "22.1.7",
2052
+ version: "22.2.6",
747
2053
  ngImport: i0,
748
2054
  type: AppDefinitionService,
749
2055
  deps: [{ token: AppDefinitionMapper }],
@@ -751,7 +2057,7 @@ var AppDefinitionService = class AppDefinitionService extends BaseEntityRestServ
751
2057
  });
752
2058
  static ɵprov = i0.ɵɵngDeclareInjectable({
753
2059
  minVersion: "12.0.0",
754
- version: "22.1.7",
2060
+ version: "22.2.6",
755
2061
  ngImport: i0,
756
2062
  type: AppDefinitionService,
757
2063
  providedIn: "root"
@@ -759,7 +2065,7 @@ var AppDefinitionService = class AppDefinitionService extends BaseEntityRestServ
759
2065
  };
760
2066
  i0.ɵɵngDeclareClassMetadata({
761
2067
  minVersion: "12.0.0",
762
- version: "22.1.7",
2068
+ version: "22.2.6",
763
2069
  ngImport: i0,
764
2070
  type: AppDefinitionService,
765
2071
  decorators: [{
@@ -779,9 +2085,10 @@ function AppDefinitionPublishStore() {
779
2085
  const entities = [...store.entities()];
780
2086
  const indexToUpdate = entities.findIndex((entity) => entity.id === id);
781
2087
  if (indexToUpdate >= 0) entities[indexToUpdate] = publishedEntity;
2088
+ const currentEntity = store.currentEntity()?.id === id ? publishedEntity : store.currentEntity();
782
2089
  patchState(store, {
783
2090
  entities,
784
- currentEntity: store.currentEntity()?.id === id ? publishedEntity : store.currentEntity(),
2091
+ currentEntity,
785
2092
  isLoading: false
786
2093
  });
787
2094
  return publishedEntity;
@@ -795,62 +2102,6 @@ function AppDefinitionPublishStore() {
795
2102
  } })));
796
2103
  }
797
2104
  const AppDefinitionStore = signalStore({ providedIn: "root" }, BaseEntityStore(AppDefinition, () => inject(AppDefinitionService)), BaseEntityTabsStore(), BaseEntityContainerStore(), AppDefinitionPublishStore(), withDevtools("AppDefinition"));
798
- var ModuleDefinitionMapper = class ModuleDefinitionMapper {
799
- fromDto(dto) {
800
- const source = dto;
801
- return new ModuleDefinition({
802
- id: source.key,
803
- name: source.name,
804
- translocoId: source.translocoId,
805
- description: source.description,
806
- translocoScope: source.translocoScope,
807
- routes: source.routes?.map(flattenRouteTarget),
808
- orgKey: source.orgKey,
809
- version: source.version,
810
- createdAt: source.createdAt,
811
- updatedAt: source.updatedAt
812
- });
813
- }
814
- toDto(entity) {
815
- return {
816
- key: entity.id,
817
- name: entity.name,
818
- translocoId: entity.translocoId,
819
- description: entity.description,
820
- translocoScope: entity.translocoScope,
821
- routes: entity.routes?.map(nestRouteTarget),
822
- orgKey: entity.orgKey,
823
- version: entity.version,
824
- createdAt: entity.createdAt,
825
- updatedAt: entity.updatedAt
826
- };
827
- }
828
- static ɵfac = i0.ɵɵngDeclareFactory({
829
- minVersion: "12.0.0",
830
- version: "22.1.7",
831
- ngImport: i0,
832
- type: ModuleDefinitionMapper,
833
- deps: [],
834
- target: i0.ɵɵFactoryTarget.Injectable
835
- });
836
- static ɵprov = i0.ɵɵngDeclareInjectable({
837
- minVersion: "12.0.0",
838
- version: "22.1.7",
839
- ngImport: i0,
840
- type: ModuleDefinitionMapper,
841
- providedIn: "root"
842
- });
843
- };
844
- i0.ɵɵngDeclareClassMetadata({
845
- minVersion: "12.0.0",
846
- version: "22.1.7",
847
- ngImport: i0,
848
- type: ModuleDefinitionMapper,
849
- decorators: [{
850
- type: Injectable,
851
- args: [{ providedIn: "root" }]
852
- }]
853
- });
854
2105
  var ModuleDefinitionService = class ModuleDefinitionService extends BaseEntityRestService {
855
2106
  entityMapper;
856
2107
  constructor(entityMapper) {
@@ -859,7 +2110,7 @@ var ModuleDefinitionService = class ModuleDefinitionService extends BaseEntityRe
859
2110
  }
860
2111
  static ɵfac = i0.ɵɵngDeclareFactory({
861
2112
  minVersion: "12.0.0",
862
- version: "22.1.7",
2113
+ version: "22.2.6",
863
2114
  ngImport: i0,
864
2115
  type: ModuleDefinitionService,
865
2116
  deps: [{ token: ModuleDefinitionMapper }],
@@ -867,7 +2118,7 @@ var ModuleDefinitionService = class ModuleDefinitionService extends BaseEntityRe
867
2118
  });
868
2119
  static ɵprov = i0.ɵɵngDeclareInjectable({
869
2120
  minVersion: "12.0.0",
870
- version: "22.1.7",
2121
+ version: "22.2.6",
871
2122
  ngImport: i0,
872
2123
  type: ModuleDefinitionService,
873
2124
  providedIn: "root"
@@ -875,7 +2126,7 @@ var ModuleDefinitionService = class ModuleDefinitionService extends BaseEntityRe
875
2126
  };
876
2127
  i0.ɵɵngDeclareClassMetadata({
877
2128
  minVersion: "12.0.0",
878
- version: "22.1.7",
2129
+ version: "22.2.6",
879
2130
  ngImport: i0,
880
2131
  type: ModuleDefinitionService,
881
2132
  decorators: [{
@@ -903,7 +2154,7 @@ var AppDefinitionFacade = class AppDefinitionFacade extends BaseEntityFacade {
903
2154
  }
904
2155
  static ɵfac = i0.ɵɵngDeclareFactory({
905
2156
  minVersion: "12.0.0",
906
- version: "22.1.7",
2157
+ version: "22.2.6",
907
2158
  ngImport: i0,
908
2159
  type: AppDefinitionFacade,
909
2160
  deps: null,
@@ -911,14 +2162,14 @@ var AppDefinitionFacade = class AppDefinitionFacade extends BaseEntityFacade {
911
2162
  });
912
2163
  static ɵprov = i0.ɵɵngDeclareInjectable({
913
2164
  minVersion: "12.0.0",
914
- version: "22.1.7",
2165
+ version: "22.2.6",
915
2166
  ngImport: i0,
916
2167
  type: AppDefinitionFacade
917
2168
  });
918
2169
  };
919
2170
  i0.ɵɵngDeclareClassMetadata({
920
2171
  minVersion: "12.0.0",
921
- version: "22.1.7",
2172
+ version: "22.2.6",
922
2173
  ngImport: i0,
923
2174
  type: AppDefinitionFacade,
924
2175
  decorators: [{ type: Injectable }]
@@ -941,7 +2192,7 @@ var ModuleDefinitionFacade = class ModuleDefinitionFacade extends BaseEntityFaca
941
2192
  }
942
2193
  static ɵfac = i0.ɵɵngDeclareFactory({
943
2194
  minVersion: "12.0.0",
944
- version: "22.1.7",
2195
+ version: "22.2.6",
945
2196
  ngImport: i0,
946
2197
  type: ModuleDefinitionFacade,
947
2198
  deps: null,
@@ -949,14 +2200,14 @@ var ModuleDefinitionFacade = class ModuleDefinitionFacade extends BaseEntityFaca
949
2200
  });
950
2201
  static ɵprov = i0.ɵɵngDeclareInjectable({
951
2202
  minVersion: "12.0.0",
952
- version: "22.1.7",
2203
+ version: "22.2.6",
953
2204
  ngImport: i0,
954
2205
  type: ModuleDefinitionFacade
955
2206
  });
956
2207
  };
957
2208
  i0.ɵɵngDeclareClassMetadata({
958
2209
  minVersion: "12.0.0",
959
- version: "22.1.7",
2210
+ version: "22.2.6",
960
2211
  ngImport: i0,
961
2212
  type: ModuleDefinitionFacade,
962
2213
  decorators: [{ type: Injectable }]
@@ -968,7 +2219,7 @@ var AppModuleMountFacade = class AppModuleMountFacade extends EmbeddedEntityFaca
968
2219
  }
969
2220
  static ɵfac = i0.ɵɵngDeclareFactory({
970
2221
  minVersion: "12.0.0",
971
- version: "22.1.7",
2222
+ version: "22.2.6",
972
2223
  ngImport: i0,
973
2224
  type: AppModuleMountFacade,
974
2225
  deps: null,
@@ -976,14 +2227,14 @@ var AppModuleMountFacade = class AppModuleMountFacade extends EmbeddedEntityFaca
976
2227
  });
977
2228
  static ɵprov = i0.ɵɵngDeclareInjectable({
978
2229
  minVersion: "12.0.0",
979
- version: "22.1.7",
2230
+ version: "22.2.6",
980
2231
  ngImport: i0,
981
2232
  type: AppModuleMountFacade
982
2233
  });
983
2234
  };
984
2235
  i0.ɵɵngDeclareClassMetadata({
985
2236
  minVersion: "12.0.0",
986
- version: "22.1.7",
2237
+ version: "22.2.6",
987
2238
  ngImport: i0,
988
2239
  type: AppModuleMountFacade,
989
2240
  decorators: [{ type: Injectable }]
@@ -995,7 +2246,7 @@ var AppNavItemFacade = class AppNavItemFacade extends EmbeddedEntityFacade {
995
2246
  }
996
2247
  static ɵfac = i0.ɵɵngDeclareFactory({
997
2248
  minVersion: "12.0.0",
998
- version: "22.1.7",
2249
+ version: "22.2.6",
999
2250
  ngImport: i0,
1000
2251
  type: AppNavItemFacade,
1001
2252
  deps: null,
@@ -1003,22 +2254,37 @@ var AppNavItemFacade = class AppNavItemFacade extends EmbeddedEntityFacade {
1003
2254
  });
1004
2255
  static ɵprov = i0.ɵɵngDeclareInjectable({
1005
2256
  minVersion: "12.0.0",
1006
- version: "22.1.7",
2257
+ version: "22.2.6",
1007
2258
  ngImport: i0,
1008
2259
  type: AppNavItemFacade
1009
2260
  });
1010
2261
  };
1011
2262
  i0.ɵɵngDeclareClassMetadata({
1012
2263
  minVersion: "12.0.0",
1013
- version: "22.1.7",
2264
+ version: "22.2.6",
1014
2265
  ngImport: i0,
1015
2266
  type: AppNavItemFacade,
1016
2267
  decorators: [{ type: Injectable }]
1017
2268
  });
2269
+ const REQUIRES_CONTEXT_DATA_KEY = "requiresContext";
1018
2270
  async function buildAppRoutes(source, renderRoute) {
1019
- return [...await emitLevel(trieOf(source.routes), [], renderRoute), ...await moduleRoutesOf(source, renderRoute)];
2271
+ const contexts = await withAggregates(source);
2272
+ return [...await emitLevel(trieOf(source.routes), [], renderRoute, contexts), ...await moduleRoutesOf(source, renderRoute, contexts)];
2273
+ }
2274
+ async function withAggregates(source) {
2275
+ return Promise.all((source.contexts ?? []).map(async (context) => {
2276
+ if (!context.entityName) return context;
2277
+ const embeddedChildren = await source.contextChildren?.(context.entityName) ?? [];
2278
+ return {
2279
+ ...context,
2280
+ aggregate: {
2281
+ entityName: context.entityName,
2282
+ embeddedChildren
2283
+ }
2284
+ };
2285
+ }));
1020
2286
  }
1021
- async function moduleRoutesOf(source, renderRoute) {
2287
+ async function moduleRoutesOf(source, renderRoute, contexts) {
1022
2288
  const mounted = [];
1023
2289
  for (const mount of source.modules ?? []) {
1024
2290
  if (!mount.basePath) continue;
@@ -1026,37 +2292,51 @@ async function moduleRoutesOf(source, renderRoute) {
1026
2292
  if (routes) {
1027
2293
  if (routes.length) mounted.push({
1028
2294
  path: mount.basePath,
1029
- children: await emitLevel(trieOf(routes), [], renderRoute)
2295
+ children: await emitLevel(trieOf(routes), [], renderRoute, contexts)
1030
2296
  });
1031
- } else if (source.loadModule) mounted.push(lazyMount(mount.moduleKey, mount.basePath, source.loadModule, renderRoute));
2297
+ } else if (source.loadModule) mounted.push(lazyMount(mount.moduleKey, mount.basePath, source.loadModule, renderRoute, source.loadTranslations, source.moduleAssets, contexts));
1032
2298
  }
1033
2299
  return mounted;
1034
2300
  }
1035
- function lazyMount(moduleKey, basePath, loadModule, renderRoute) {
2301
+ function lazyMount(moduleKey, basePath, loadModule, renderRoute, translations, assets, contexts = []) {
1036
2302
  return {
1037
2303
  path: basePath,
1038
2304
  loadChildren: async () => {
1039
2305
  const definition = await loadModule(moduleKey);
1040
- const children = await emitLevel(trieOf(definition?.routes), [], renderRoute);
1041
- if (!definition || !children.length) return [];
2306
+ if (!definition) return [];
1042
2307
  const scope = moduleTranslocoScope(definition);
2308
+ const routes = definition.routes?.map((route) => ({
2309
+ ...route,
2310
+ translocoId: moduleRouteTranslocoId(scope, route)
2311
+ }));
2312
+ const children = await emitLevel(trieOf(routes), [], renderRoute, contexts);
2313
+ if (!children.length) return [];
2314
+ const providers = [provideTranslocoScope({
2315
+ scope,
2316
+ alias: scope,
2317
+ ...translations && { loader: inlineLoaderOf(translations, moduleKey, scope) }
2318
+ }, {
2319
+ scope: BASE_ENTITY_TRANSLOCO_SCOPE,
2320
+ alias: BASE_ENTITY_TRANSLOCO_SCOPE
2321
+ }, {
2322
+ scope: BASE_APP_TRANSLOCO_SCOPE,
2323
+ alias: BASE_APP_TRANSLOCO_SCOPE
2324
+ })];
2325
+ if (assets) providers.push({
2326
+ provide: MODULE_ASSET_CONTEXT,
2327
+ useValue: assets(moduleKey)
2328
+ });
1043
2329
  return [{
1044
2330
  path: "",
1045
- providers: [provideTranslocoScope({
1046
- scope,
1047
- alias: scope
1048
- }, {
1049
- scope: BASE_ENTITY_TRANSLOCO_SCOPE,
1050
- alias: BASE_ENTITY_TRANSLOCO_SCOPE
1051
- }, {
1052
- scope: BASE_APP_TRANSLOCO_SCOPE,
1053
- alias: BASE_APP_TRANSLOCO_SCOPE
1054
- })],
2331
+ providers,
1055
2332
  children
1056
2333
  }];
1057
2334
  }
1058
2335
  };
1059
2336
  }
2337
+ function inlineLoaderOf(translations, moduleKey, scope) {
2338
+ return Object.fromEntries(translations.languages.map((locale) => [locale, () => translations.load(moduleKey, scope, locale)]));
2339
+ }
1060
2340
  function trieOf(routes) {
1061
2341
  const roots = [];
1062
2342
  for (const definition of routes ?? []) {
@@ -1080,18 +2360,37 @@ function trieOf(routes) {
1080
2360
  }
1081
2361
  return roots;
1082
2362
  }
1083
- async function emitLevel(nodes, prefix, renderRoute) {
1084
- return (await Promise.all(nodes.map((node) => emitNode(node, prefix, renderRoute)))).flat().sort((left, right) => staticDepthOf(right.path) - staticDepthOf(left.path));
2363
+ async function emitLevel(nodes, prefix, renderRoute, contexts) {
2364
+ return groupContextRoutes((await Promise.all(nodes.map((node) => emitNode(node, prefix, renderRoute, contexts)))).flat().sort((left, right) => staticDepthOf(right.path) - staticDepthOf(left.path)), contexts);
2365
+ }
2366
+ function groupContextRoutes(routes, contexts) {
2367
+ const bound = routes.filter((route) => contextOf(route) !== void 0);
2368
+ if (bound.length === 0) return routes;
2369
+ const own = /* @__PURE__ */ new Map();
2370
+ for (const route of bound) own.set(contextOf(route), [...own.get(contextOf(route)) ?? [], route]);
2371
+ const parentOf = (name) => contexts.find((context) => context.name === name && context.parent && contexts.some((candidate) => candidate.name === context.parent))?.parent;
2372
+ const names = new Set(own.keys());
2373
+ for (const name of [...names]) for (let parent = parentOf(name); parent && !names.has(parent); parent = parentOf(parent)) names.add(parent);
2374
+ const build = (name) => workingContextRoutes(name, [...own.get(name) ?? [], ...[...names].filter((child) => parentOf(child) === name).flatMap(build)], contexts.find((context) => context.name === name)?.aggregate);
2375
+ return [...[...names].filter((name) => parentOf(name) === void 0).flatMap(build), ...routes.filter((route) => contextOf(route) === void 0)];
1085
2376
  }
1086
- async function emitNode(node, prefix, renderRoute) {
2377
+ function contextOf(route) {
2378
+ const name = route.data?.[REQUIRES_CONTEXT_DATA_KEY];
2379
+ return typeof name === "string" && name.length > 0 ? name : void 0;
2380
+ }
2381
+ async function emitNode(node, prefix, renderRoute, contexts) {
1087
2382
  const path = [...prefix, node.segment];
1088
- if (!node.definition) return (await Promise.all(node.children.map((child) => emitNode(child, path, renderRoute)))).flat();
1089
- const authoredChildren = await emitLevel(node.children, [], renderRoute);
2383
+ if (!node.definition) return (await Promise.all(node.children.map((child) => emitNode(child, path, renderRoute, contexts)))).flat();
2384
+ const authoredChildren = await emitLevel(node.children, [], renderRoute, contexts);
1090
2385
  const rendered = await renderRoute(node.definition);
1091
2386
  const route = {
1092
2387
  ...rendered,
1093
2388
  path: path.join("/")
1094
2389
  };
2390
+ if (node.definition.requiresContext) route.data = {
2391
+ ...rendered.data,
2392
+ [REQUIRES_CONTEXT_DATA_KEY]: node.definition.requiresContext
2393
+ };
1095
2394
  const children = [...rendered.children ?? [], ...authoredChildren];
1096
2395
  if (children.length) route.children = children;
1097
2396
  return [route];
@@ -1108,11 +2407,11 @@ function standaloneWidgets(widgets) {
1108
2407
  return (widgets ?? []).filter((widget) => widget.placement !== WidgetPlacement.REFERENCED);
1109
2408
  }
1110
2409
  var WidgetListComponent = class WidgetListComponent {
1111
- widgets = input([], ...ngDevMode ? [{ debugName: "widgets" }] : /* istanbul ignore next */ []);
1112
- rows = computed(() => standaloneWidgets(this.widgets()), ...ngDevMode ? [{ debugName: "rows" }] : /* istanbul ignore next */ []);
2410
+ widgets = input([], ...ngDevMode ? [{ debugName: "widgets" }] : /* istanbul ignore next */ []);
2411
+ rows = computed(() => standaloneWidgets(this.widgets()), ...ngDevMode ? [{ debugName: "rows" }] : /* istanbul ignore next */ []);
1113
2412
  static ɵfac = i0.ɵɵngDeclareFactory({
1114
2413
  minVersion: "12.0.0",
1115
- version: "22.1.7",
2414
+ version: "22.2.6",
1116
2415
  ngImport: i0,
1117
2416
  type: WidgetListComponent,
1118
2417
  deps: [],
@@ -1120,7 +2419,7 @@ var WidgetListComponent = class WidgetListComponent {
1120
2419
  });
1121
2420
  static ɵcmp = i0.ɵɵngDeclareComponent({
1122
2421
  minVersion: "17.0.0",
1123
- version: "22.1.7",
2422
+ version: "22.2.6",
1124
2423
  type: WidgetListComponent,
1125
2424
  isStandalone: true,
1126
2425
  selector: "pp-widget-list",
@@ -1149,7 +2448,7 @@ var WidgetListComponent = class WidgetListComponent {
1149
2448
  };
1150
2449
  i0.ɵɵngDeclareClassMetadata({
1151
2450
  minVersion: "12.0.0",
1152
- version: "22.1.7",
2451
+ version: "22.2.6",
1153
2452
  ngImport: i0,
1154
2453
  type: WidgetListComponent,
1155
2454
  decorators: [{
@@ -1179,7 +2478,7 @@ var RouteWidgetsComponent = class RouteWidgetsComponent {
1179
2478
  widgets = this.route.snapshot.data["widgets"] ?? [];
1180
2479
  static ɵfac = i0.ɵɵngDeclareFactory({
1181
2480
  minVersion: "12.0.0",
1182
- version: "22.1.7",
2481
+ version: "22.2.6",
1183
2482
  ngImport: i0,
1184
2483
  type: RouteWidgetsComponent,
1185
2484
  deps: [],
@@ -1187,7 +2486,7 @@ var RouteWidgetsComponent = class RouteWidgetsComponent {
1187
2486
  });
1188
2487
  static ɵcmp = i0.ɵɵngDeclareComponent({
1189
2488
  minVersion: "14.0.0",
1190
- version: "22.1.7",
2489
+ version: "22.2.6",
1191
2490
  type: RouteWidgetsComponent,
1192
2491
  isStandalone: true,
1193
2492
  selector: "pp-route-widgets",
@@ -1204,7 +2503,7 @@ var RouteWidgetsComponent = class RouteWidgetsComponent {
1204
2503
  };
1205
2504
  i0.ɵɵngDeclareClassMetadata({
1206
2505
  minVersion: "12.0.0",
1207
- version: "22.1.7",
2506
+ version: "22.2.6",
1208
2507
  ngImport: i0,
1209
2508
  type: RouteWidgetsComponent,
1210
2509
  decorators: [{
@@ -1219,10 +2518,10 @@ i0.ɵɵngDeclareClassMetadata({
1219
2518
  });
1220
2519
  var RouteUnsupportedComponent = class RouteUnsupportedComponent {
1221
2520
  route = inject(ActivatedRoute);
1222
- reason = computed(() => this.route.snapshot.data["reason"] ?? "This route is not yet supported.", ...ngDevMode ? [{ debugName: "reason" }] : /* istanbul ignore next */ []);
2521
+ reason = computed(() => this.route.snapshot.data["reason"] ?? "This route is not yet supported.", ...ngDevMode ? [{ debugName: "reason" }] : /* istanbul ignore next */ []);
1223
2522
  static ɵfac = i0.ɵɵngDeclareFactory({
1224
2523
  minVersion: "12.0.0",
1225
- version: "22.1.7",
2524
+ version: "22.2.6",
1226
2525
  ngImport: i0,
1227
2526
  type: RouteUnsupportedComponent,
1228
2527
  deps: [],
@@ -1230,7 +2529,7 @@ var RouteUnsupportedComponent = class RouteUnsupportedComponent {
1230
2529
  });
1231
2530
  static ɵcmp = i0.ɵɵngDeclareComponent({
1232
2531
  minVersion: "14.0.0",
1233
- version: "22.1.7",
2532
+ version: "22.2.6",
1234
2533
  type: RouteUnsupportedComponent,
1235
2534
  isStandalone: true,
1236
2535
  selector: "pp-route-unsupported",
@@ -1241,7 +2540,7 @@ var RouteUnsupportedComponent = class RouteUnsupportedComponent {
1241
2540
  };
1242
2541
  i0.ɵɵngDeclareClassMetadata({
1243
2542
  minVersion: "12.0.0",
1244
- version: "22.1.7",
2543
+ version: "22.2.6",
1245
2544
  ngImport: i0,
1246
2545
  type: RouteUnsupportedComponent,
1247
2546
  decorators: [{
@@ -1279,6 +2578,15 @@ var AppRouteRenderer = class AppRouteRenderer {
1279
2578
  }
1280
2579
  };
1281
2580
  async entityRoute(definition) {
2581
+ if (definition.requiresContext && definition.contextPath && definition.entityName) return {
2582
+ component: ContextCollectionComponent,
2583
+ title: titleOf(definition),
2584
+ data: {
2585
+ [CONTEXT_COLLECTION_CONTEXT_KEY]: definition.requiresContext,
2586
+ [CONTEXT_COLLECTION_PATH_KEY]: definition.contextPath,
2587
+ [CONTEXT_COLLECTION_ENTITY_KEY]: definition.entityName
2588
+ }
2589
+ };
1282
2590
  const screens = await this.entityScreens.resolve(definition.entityName);
1283
2591
  return {
1284
2592
  ...entityScreenRoute({
@@ -1287,7 +2595,8 @@ var AppRouteRenderer = class AppRouteRenderer {
1287
2595
  hostPath: definition.path,
1288
2596
  data: {
1289
2597
  entityMode: definition.entityMode,
1290
- rsqlFilter: definition.rsqlFilter
2598
+ rsqlFilter: definition.rsqlFilter,
2599
+ filterByContext: definition.filterByContext
1291
2600
  }
1292
2601
  }),
1293
2602
  title: titleOf(definition)
@@ -1295,7 +2604,7 @@ var AppRouteRenderer = class AppRouteRenderer {
1295
2604
  }
1296
2605
  static ɵfac = i0.ɵɵngDeclareFactory({
1297
2606
  minVersion: "12.0.0",
1298
- version: "22.1.7",
2607
+ version: "22.2.6",
1299
2608
  ngImport: i0,
1300
2609
  type: AppRouteRenderer,
1301
2610
  deps: [],
@@ -1303,7 +2612,7 @@ var AppRouteRenderer = class AppRouteRenderer {
1303
2612
  });
1304
2613
  static ɵprov = i0.ɵɵngDeclareInjectable({
1305
2614
  minVersion: "12.0.0",
1306
- version: "22.1.7",
2615
+ version: "22.2.6",
1307
2616
  ngImport: i0,
1308
2617
  type: AppRouteRenderer,
1309
2618
  providedIn: "root"
@@ -1311,7 +2620,7 @@ var AppRouteRenderer = class AppRouteRenderer {
1311
2620
  };
1312
2621
  i0.ɵɵngDeclareClassMetadata({
1313
2622
  minVersion: "12.0.0",
1314
- version: "22.1.7",
2623
+ version: "22.2.6",
1315
2624
  ngImport: i0,
1316
2625
  type: AppRouteRenderer,
1317
2626
  decorators: [{
@@ -1326,7 +2635,7 @@ var AppRegionFacade = class AppRegionFacade extends EmbeddedEntityFacade {
1326
2635
  }
1327
2636
  static ɵfac = i0.ɵɵngDeclareFactory({
1328
2637
  minVersion: "12.0.0",
1329
- version: "22.1.7",
2638
+ version: "22.2.6",
1330
2639
  ngImport: i0,
1331
2640
  type: AppRegionFacade,
1332
2641
  deps: null,
@@ -1334,14 +2643,14 @@ var AppRegionFacade = class AppRegionFacade extends EmbeddedEntityFacade {
1334
2643
  });
1335
2644
  static ɵprov = i0.ɵɵngDeclareInjectable({
1336
2645
  minVersion: "12.0.0",
1337
- version: "22.1.7",
2646
+ version: "22.2.6",
1338
2647
  ngImport: i0,
1339
2648
  type: AppRegionFacade
1340
2649
  });
1341
2650
  };
1342
2651
  i0.ɵɵngDeclareClassMetadata({
1343
2652
  minVersion: "12.0.0",
1344
- version: "22.1.7",
2653
+ version: "22.2.6",
1345
2654
  ngImport: i0,
1346
2655
  type: AppRegionFacade,
1347
2656
  decorators: [{ type: Injectable }]
@@ -1353,7 +2662,7 @@ var AppRouteFacade = class AppRouteFacade extends EmbeddedEntityFacade {
1353
2662
  }
1354
2663
  static ɵfac = i0.ɵɵngDeclareFactory({
1355
2664
  minVersion: "12.0.0",
1356
- version: "22.1.7",
2665
+ version: "22.2.6",
1357
2666
  ngImport: i0,
1358
2667
  type: AppRouteFacade,
1359
2668
  deps: null,
@@ -1361,26 +2670,27 @@ var AppRouteFacade = class AppRouteFacade extends EmbeddedEntityFacade {
1361
2670
  });
1362
2671
  static ɵprov = i0.ɵɵngDeclareInjectable({
1363
2672
  minVersion: "12.0.0",
1364
- version: "22.1.7",
2673
+ version: "22.2.6",
1365
2674
  ngImport: i0,
1366
2675
  type: AppRouteFacade
1367
2676
  });
1368
2677
  };
1369
2678
  i0.ɵɵngDeclareClassMetadata({
1370
2679
  minVersion: "12.0.0",
1371
- version: "22.1.7",
2680
+ version: "22.2.6",
1372
2681
  ngImport: i0,
1373
2682
  type: AppRouteFacade,
1374
2683
  decorators: [{ type: Injectable }]
1375
2684
  });
1376
2685
  var AppWidgetFacade = class AppWidgetFacade extends EmbeddedEntityFacade {
1377
2686
  entityType = WidgetInstance;
2687
+ widgetRegistry = inject(WIDGET_REGISTRY, { optional: true }) ?? /* @__PURE__ */ new Map();
1378
2688
  createDescriptor() {
1379
- return createWidgetInstanceDescriptor();
2689
+ return createWidgetInstanceDescriptor(widgetTypeSelectables(this.widgetRegistry));
1380
2690
  }
1381
2691
  static ɵfac = i0.ɵɵngDeclareFactory({
1382
2692
  minVersion: "12.0.0",
1383
- version: "22.1.7",
2693
+ version: "22.2.6",
1384
2694
  ngImport: i0,
1385
2695
  type: AppWidgetFacade,
1386
2696
  deps: null,
@@ -1388,14 +2698,14 @@ var AppWidgetFacade = class AppWidgetFacade extends EmbeddedEntityFacade {
1388
2698
  });
1389
2699
  static ɵprov = i0.ɵɵngDeclareInjectable({
1390
2700
  minVersion: "12.0.0",
1391
- version: "22.1.7",
2701
+ version: "22.2.6",
1392
2702
  ngImport: i0,
1393
2703
  type: AppWidgetFacade
1394
2704
  });
1395
2705
  };
1396
2706
  i0.ɵɵngDeclareClassMetadata({
1397
2707
  minVersion: "12.0.0",
1398
- version: "22.1.7",
2708
+ version: "22.2.6",
1399
2709
  ngImport: i0,
1400
2710
  type: AppWidgetFacade,
1401
2711
  decorators: [{ type: Injectable }]
@@ -1425,6 +2735,43 @@ function knownRoutePathsOf(definition) {
1425
2735
  const mounted = (definition?.modules ?? []).map((mount) => mount.basePath);
1426
2736
  return [...declared, ...mounted].filter((path) => !!path);
1427
2737
  }
2738
+ function trimSlashes(path) {
2739
+ let start = 0;
2740
+ let end = path.length;
2741
+ while (start < end && path[start] === "/") start++;
2742
+ while (end > start && path[end - 1] === "/") end--;
2743
+ return path.slice(start, end);
2744
+ }
2745
+ function contextLinksOf(definition) {
2746
+ const own = (definition?.routes ?? []).filter((route) => route.requiresContext).map((route) => ({
2747
+ base: "",
2748
+ path: route.path,
2749
+ context: route.requiresContext
2750
+ }));
2751
+ const mounted = (definition?.modules ?? []).flatMap((mount) => {
2752
+ return ((definition?.mountedModules?.find((candidate) => candidate.id === mount.moduleKey))?.routes ?? []).filter((route) => route.requiresContext).map((route) => ({
2753
+ base: mount.basePath,
2754
+ path: route.path,
2755
+ context: route.requiresContext
2756
+ }));
2757
+ });
2758
+ return [...own, ...mounted].filter((link) => !!link.path);
2759
+ }
2760
+ function resolveContextLink(routePath, links, activeIds) {
2761
+ for (const { base, path, context } of links) {
2762
+ const full = [base, path].filter(Boolean).join("/");
2763
+ if (routePath !== full && !routePath.startsWith(full + "/")) continue;
2764
+ return [
2765
+ base,
2766
+ "ctx",
2767
+ context,
2768
+ activeIds[context],
2769
+ path,
2770
+ routePath.slice(full.length + 1)
2771
+ ].filter(Boolean).join("/");
2772
+ }
2773
+ return routePath;
2774
+ }
1428
2775
  function themeDefaultsOf(definition) {
1429
2776
  const preset = definition?.materialTheme ?? definition?.theme?.materialTheme;
1430
2777
  const scheme = definition?.colorScheme ?? definition?.theme?.colorScheme;
@@ -1434,10 +2781,10 @@ function themeDefaultsOf(definition) {
1434
2781
  };
1435
2782
  }
1436
2783
  var RegionFooterComponent = class RegionFooterComponent {
1437
- widgets = input([], ...ngDevMode ? [{ debugName: "widgets" }] : /* istanbul ignore next */ []);
2784
+ widgets = input([], ...ngDevMode ? [{ debugName: "widgets" }] : /* istanbul ignore next */ []);
1438
2785
  static ɵfac = i0.ɵɵngDeclareFactory({
1439
2786
  minVersion: "12.0.0",
1440
- version: "22.1.7",
2787
+ version: "22.2.6",
1441
2788
  ngImport: i0,
1442
2789
  type: RegionFooterComponent,
1443
2790
  deps: [],
@@ -1445,7 +2792,7 @@ var RegionFooterComponent = class RegionFooterComponent {
1445
2792
  });
1446
2793
  static ɵcmp = i0.ɵɵngDeclareComponent({
1447
2794
  minVersion: "17.1.0",
1448
- version: "22.1.7",
2795
+ version: "22.2.6",
1449
2796
  type: RegionFooterComponent,
1450
2797
  isStandalone: true,
1451
2798
  selector: "pp-region-footer",
@@ -1470,7 +2817,7 @@ var RegionFooterComponent = class RegionFooterComponent {
1470
2817
  };
1471
2818
  i0.ɵɵngDeclareClassMetadata({
1472
2819
  minVersion: "12.0.0",
1473
- version: "22.1.7",
2820
+ version: "22.2.6",
1474
2821
  ngImport: i0,
1475
2822
  type: RegionFooterComponent,
1476
2823
  decorators: [{
@@ -1493,10 +2840,10 @@ i0.ɵɵngDeclareClassMetadata({
1493
2840
  }] }
1494
2841
  });
1495
2842
  var RegionHeaderComponent = class RegionHeaderComponent {
1496
- widgets = input([], ...ngDevMode ? [{ debugName: "widgets" }] : /* istanbul ignore next */ []);
2843
+ widgets = input([], ...ngDevMode ? [{ debugName: "widgets" }] : /* istanbul ignore next */ []);
1497
2844
  static ɵfac = i0.ɵɵngDeclareFactory({
1498
2845
  minVersion: "12.0.0",
1499
- version: "22.1.7",
2846
+ version: "22.2.6",
1500
2847
  ngImport: i0,
1501
2848
  type: RegionHeaderComponent,
1502
2849
  deps: [],
@@ -1504,7 +2851,7 @@ var RegionHeaderComponent = class RegionHeaderComponent {
1504
2851
  });
1505
2852
  static ɵcmp = i0.ɵɵngDeclareComponent({
1506
2853
  minVersion: "17.1.0",
1507
- version: "22.1.7",
2854
+ version: "22.2.6",
1508
2855
  type: RegionHeaderComponent,
1509
2856
  isStandalone: true,
1510
2857
  selector: "pp-region-header",
@@ -1529,7 +2876,7 @@ var RegionHeaderComponent = class RegionHeaderComponent {
1529
2876
  };
1530
2877
  i0.ɵɵngDeclareClassMetadata({
1531
2878
  minVersion: "12.0.0",
1532
- version: "22.1.7",
2879
+ version: "22.2.6",
1533
2880
  ngImport: i0,
1534
2881
  type: RegionHeaderComponent,
1535
2882
  decorators: [{
@@ -1567,18 +2914,31 @@ function toNavRows(items, knownPaths) {
1567
2914
  });
1568
2915
  }
1569
2916
  function normalize(routePath) {
1570
- const trimmed = routePath?.trim().replace(/^\/+|\/+$/g, "").trim();
2917
+ const trimmed = trimSlashes(routePath?.trim() ?? "").trim();
1571
2918
  return trimmed ? trimmed : void 0;
1572
2919
  }
1573
2920
  var RegionNavComponent = class RegionNavComponent {
1574
- navItems = input([], ...ngDevMode ? [{ debugName: "navItems" }] : /* istanbul ignore next */ []);
1575
- orientation = input("vertical", ...ngDevMode ? [{ debugName: "orientation" }] : /* istanbul ignore next */ []);
1576
- compact = input(false, ...ngDevMode ? [{ debugName: "compact" }] : /* istanbul ignore next */ []);
1577
- knownPaths = input([], ...ngDevMode ? [{ debugName: "knownPaths" }] : /* istanbul ignore next */ []);
1578
- rows = computed(() => toNavRows(this.navItems(), this.knownPaths()), ...ngDevMode ? [{ debugName: "rows" }] : /* istanbul ignore next */ []);
2921
+ navItems = input([], ...ngDevMode ? [{ debugName: "navItems" }] : /* istanbul ignore next */ []);
2922
+ orientation = input("vertical", ...ngDevMode ? [{ debugName: "orientation" }] : /* istanbul ignore next */ []);
2923
+ compact = input(false, ...ngDevMode ? [{ debugName: "compact" }] : /* istanbul ignore next */ []);
2924
+ knownPaths = input([], ...ngDevMode ? [{ debugName: "knownPaths" }] : /* istanbul ignore next */ []);
2925
+ contextLinks = input([], ...ngDevMode ? [{ debugName: "contextLinks" }] : /* istanbul ignore next */ []);
2926
+ workingContext = inject(WorkingContextService);
2927
+ activeIds = computed(() => Object.fromEntries(this.workingContext.active().map((context) => [context.name, context.id])), ...ngDevMode ? [{ debugName: "activeIds" }] : /* istanbul ignore next */ []);
2928
+ rows = computed(() => this.withContextLinks(toNavRows(this.navItems(), this.knownPaths())), ...ngDevMode ? [{ debugName: "rows" }] : /* istanbul ignore next */ []);
2929
+ withContextLinks(rows) {
2930
+ const links = this.contextLinks();
2931
+ if (links.length === 0) return rows;
2932
+ const activeIds = this.activeIds();
2933
+ return rows.map((row) => ({
2934
+ ...row,
2935
+ ...row.routePath ? { routePath: resolveContextLink(row.routePath, links, activeIds) } : {},
2936
+ children: this.withContextLinks(row.children)
2937
+ }));
2938
+ }
1579
2939
  static ɵfac = i0.ɵɵngDeclareFactory({
1580
2940
  minVersion: "12.0.0",
1581
- version: "22.1.7",
2941
+ version: "22.2.6",
1582
2942
  ngImport: i0,
1583
2943
  type: RegionNavComponent,
1584
2944
  deps: [],
@@ -1586,7 +2946,7 @@ var RegionNavComponent = class RegionNavComponent {
1586
2946
  });
1587
2947
  static ɵcmp = i0.ɵɵngDeclareComponent({
1588
2948
  minVersion: "17.0.0",
1589
- version: "22.1.7",
2949
+ version: "22.2.6",
1590
2950
  type: RegionNavComponent,
1591
2951
  isStandalone: true,
1592
2952
  selector: "pp-region-nav",
@@ -1618,6 +2978,13 @@ var RegionNavComponent = class RegionNavComponent {
1618
2978
  isSignal: true,
1619
2979
  isRequired: false,
1620
2980
  transformFunction: null
2981
+ },
2982
+ contextLinks: {
2983
+ classPropertyName: "contextLinks",
2984
+ publicName: "contextLinks",
2985
+ isSignal: true,
2986
+ isRequired: false,
2987
+ transformFunction: null
1621
2988
  }
1622
2989
  },
1623
2990
  ngImport: i0,
@@ -1789,7 +3156,7 @@ var RegionNavComponent = class RegionNavComponent {
1789
3156
  };
1790
3157
  i0.ɵɵngDeclareClassMetadata({
1791
3158
  minVersion: "12.0.0",
1792
- version: "22.1.7",
3159
+ version: "22.2.6",
1793
3160
  ngImport: i0,
1794
3161
  type: RegionNavComponent,
1795
3162
  decorators: [{
@@ -1933,6 +3300,14 @@ i0.ɵɵngDeclareClassMetadata({
1933
3300
  alias: "knownPaths",
1934
3301
  required: false
1935
3302
  }]
3303
+ }],
3304
+ contextLinks: [{
3305
+ type: i0.Input,
3306
+ args: [{
3307
+ isSignal: true,
3308
+ alias: "contextLinks",
3309
+ required: false
3310
+ }]
1936
3311
  }]
1937
3312
  }
1938
3313
  });
@@ -1949,12 +3324,18 @@ var AppRegionRenderer = class AppRegionRenderer {
1949
3324
  component: RegionFooterComponent,
1950
3325
  inputs: { widgets: region.widgets ?? [] }
1951
3326
  };
3327
+ case "statusbar": return {
3328
+ slot: "statusbar",
3329
+ component: WorkingContextStatusbarComponent,
3330
+ inputs: {}
3331
+ };
1952
3332
  case "sidenav": return {
1953
3333
  slot: "sidenav",
1954
3334
  component: RegionNavComponent,
1955
3335
  inputs: {
1956
3336
  navItems: region.navItems ?? [],
1957
- knownPaths: knownRoutePathsOf(definition)
3337
+ knownPaths: knownRoutePathsOf(definition),
3338
+ contextLinks: contextLinksOf(definition)
1958
3339
  }
1959
3340
  };
1960
3341
  default: return;
@@ -1962,7 +3343,7 @@ var AppRegionRenderer = class AppRegionRenderer {
1962
3343
  };
1963
3344
  static ɵfac = i0.ɵɵngDeclareFactory({
1964
3345
  minVersion: "12.0.0",
1965
- version: "22.1.7",
3346
+ version: "22.2.6",
1966
3347
  ngImport: i0,
1967
3348
  type: AppRegionRenderer,
1968
3349
  deps: [],
@@ -1970,7 +3351,7 @@ var AppRegionRenderer = class AppRegionRenderer {
1970
3351
  });
1971
3352
  static ɵprov = i0.ɵɵngDeclareInjectable({
1972
3353
  minVersion: "12.0.0",
1973
- version: "22.1.7",
3354
+ version: "22.2.6",
1974
3355
  ngImport: i0,
1975
3356
  type: AppRegionRenderer,
1976
3357
  providedIn: "root"
@@ -1978,7 +3359,7 @@ var AppRegionRenderer = class AppRegionRenderer {
1978
3359
  };
1979
3360
  i0.ɵɵngDeclareClassMetadata({
1980
3361
  minVersion: "12.0.0",
1981
- version: "22.1.7",
3362
+ version: "22.2.6",
1982
3363
  ngImport: i0,
1983
3364
  type: AppRegionRenderer,
1984
3365
  decorators: [{
@@ -1987,13 +3368,13 @@ i0.ɵɵngDeclareClassMetadata({
1987
3368
  }]
1988
3369
  });
1989
3370
  var ShellApplicationContext = class ShellApplicationContext {
1990
- definition = signal(void 0, ...ngDevMode ? [{ debugName: "definition" }] : /* istanbul ignore next */ []);
1991
- name = computed(() => this.definition()?.name ?? "", ...ngDevMode ? [{ debugName: "name" }] : /* istanbul ignore next */ []);
1992
- logoUrl = computed(() => this.definition()?.logoUrl ?? this.definition()?.theme?.logoUrl, ...ngDevMode ? [{ debugName: "logoUrl" }] : /* istanbul ignore next */ []);
1993
- navItems = computed(() => navMenuItemsOf(this.definition()), ...ngDevMode ? [{ debugName: "navItems" }] : /* istanbul ignore next */ []);
3371
+ definition = signal(void 0, ...ngDevMode ? [{ debugName: "definition" }] : /* istanbul ignore next */ []);
3372
+ name = computed(() => this.definition()?.name ?? "", ...ngDevMode ? [{ debugName: "name" }] : /* istanbul ignore next */ []);
3373
+ logoUrl = computed(() => this.definition()?.logoUrl ?? this.definition()?.theme?.logoUrl, ...ngDevMode ? [{ debugName: "logoUrl" }] : /* istanbul ignore next */ []);
3374
+ navItems = computed(() => navMenuItemsOf(this.definition()), ...ngDevMode ? [{ debugName: "navItems" }] : /* istanbul ignore next */ []);
1994
3375
  static ɵfac = i0.ɵɵngDeclareFactory({
1995
3376
  minVersion: "12.0.0",
1996
- version: "22.1.7",
3377
+ version: "22.2.6",
1997
3378
  ngImport: i0,
1998
3379
  type: ShellApplicationContext,
1999
3380
  deps: [],
@@ -2001,14 +3382,14 @@ var ShellApplicationContext = class ShellApplicationContext {
2001
3382
  });
2002
3383
  static ɵprov = i0.ɵɵngDeclareInjectable({
2003
3384
  minVersion: "12.0.0",
2004
- version: "22.1.7",
3385
+ version: "22.2.6",
2005
3386
  ngImport: i0,
2006
3387
  type: ShellApplicationContext
2007
3388
  });
2008
3389
  };
2009
3390
  i0.ɵɵngDeclareClassMetadata({
2010
3391
  minVersion: "12.0.0",
2011
- version: "22.1.7",
3392
+ version: "22.2.6",
2012
3393
  ngImport: i0,
2013
3394
  type: ShellApplicationContext,
2014
3395
  decorators: [{ type: Injectable }]
@@ -2027,6 +3408,34 @@ function toMenuItems(rows) {
2027
3408
  ...row.children.length ? { children: toMenuItems(row.children) } : {}
2028
3409
  }));
2029
3410
  }
3411
+ var ShellSidenavControl = class ShellSidenavControl {
3412
+ available = signal(false, ...ngDevMode ? [{ debugName: "available" }] : /* istanbul ignore next */ []);
3413
+ opened = signal(true, ...ngDevMode ? [{ debugName: "opened" }] : /* istanbul ignore next */ []);
3414
+ toggle() {
3415
+ this.opened.update((opened) => !opened);
3416
+ }
3417
+ static ɵfac = i0.ɵɵngDeclareFactory({
3418
+ minVersion: "12.0.0",
3419
+ version: "22.2.6",
3420
+ ngImport: i0,
3421
+ type: ShellSidenavControl,
3422
+ deps: [],
3423
+ target: i0.ɵɵFactoryTarget.Injectable
3424
+ });
3425
+ static ɵprov = i0.ɵɵngDeclareInjectable({
3426
+ minVersion: "12.0.0",
3427
+ version: "22.2.6",
3428
+ ngImport: i0,
3429
+ type: ShellSidenavControl
3430
+ });
3431
+ };
3432
+ i0.ɵɵngDeclareClassMetadata({
3433
+ minVersion: "12.0.0",
3434
+ version: "22.2.6",
3435
+ ngImport: i0,
3436
+ type: ShellSidenavControl,
3437
+ decorators: [{ type: Injectable }]
3438
+ });
2030
3439
  var ShellOverlayContainer = class ShellOverlayContainer extends OverlayContainer {
2031
3440
  host = inject(ElementRef).nativeElement;
2032
3441
  _createContainer() {
@@ -2035,7 +3444,7 @@ var ShellOverlayContainer = class ShellOverlayContainer extends OverlayContainer
2035
3444
  }
2036
3445
  static ɵfac = i0.ɵɵngDeclareFactory({
2037
3446
  minVersion: "12.0.0",
2038
- version: "22.1.7",
3447
+ version: "22.2.6",
2039
3448
  ngImport: i0,
2040
3449
  type: ShellOverlayContainer,
2041
3450
  deps: null,
@@ -2043,45 +3452,106 @@ var ShellOverlayContainer = class ShellOverlayContainer extends OverlayContainer
2043
3452
  });
2044
3453
  static ɵprov = i0.ɵɵngDeclareInjectable({
2045
3454
  minVersion: "12.0.0",
2046
- version: "22.1.7",
3455
+ version: "22.2.6",
2047
3456
  ngImport: i0,
2048
3457
  type: ShellOverlayContainer
2049
3458
  });
2050
3459
  };
2051
3460
  i0.ɵɵngDeclareClassMetadata({
2052
3461
  minVersion: "12.0.0",
2053
- version: "22.1.7",
3462
+ version: "22.2.6",
2054
3463
  ngImport: i0,
2055
3464
  type: ShellOverlayContainer,
2056
3465
  decorators: [{ type: Injectable }]
2057
3466
  });
3467
+ var ShellActionsDirective = class ShellActionsDirective {
3468
+ static ɵfac = i0.ɵɵngDeclareFactory({
3469
+ minVersion: "12.0.0",
3470
+ version: "22.2.6",
3471
+ ngImport: i0,
3472
+ type: ShellActionsDirective,
3473
+ deps: [],
3474
+ target: i0.ɵɵFactoryTarget.Directive
3475
+ });
3476
+ static ɵdir = i0.ɵɵngDeclareDirective({
3477
+ minVersion: "14.0.0",
3478
+ version: "22.2.6",
3479
+ type: ShellActionsDirective,
3480
+ isStandalone: true,
3481
+ selector: "[ppShellActions]",
3482
+ host: { classAttribute: "pp-app-shell__actions" },
3483
+ providers: [{
3484
+ provide: OverlayContainer,
3485
+ useClass: ShellOverlayContainer
3486
+ }],
3487
+ ngImport: i0
3488
+ });
3489
+ };
3490
+ i0.ɵɵngDeclareClassMetadata({
3491
+ minVersion: "12.0.0",
3492
+ version: "22.2.6",
3493
+ ngImport: i0,
3494
+ type: ShellActionsDirective,
3495
+ decorators: [{
3496
+ type: Directive,
3497
+ args: [{
3498
+ selector: "[ppShellActions]",
3499
+ standalone: true,
3500
+ host: { class: "pp-app-shell__actions" },
3501
+ providers: [{
3502
+ provide: OverlayContainer,
3503
+ useClass: ShellOverlayContainer
3504
+ }]
3505
+ }]
3506
+ }]
3507
+ });
2058
3508
  var AppShellComponent = class AppShellComponent {
2059
- definition = input(void 0, ...ngDevMode ? [{ debugName: "definition" }] : /* istanbul ignore next */ []);
2060
- persistTheme = input(true, ...ngDevMode ? [{ debugName: "persistTheme" }] : /* istanbul ignore next */ []);
3509
+ definition = input(void 0, ...ngDevMode ? [{ debugName: "definition" }] : /* istanbul ignore next */ []);
3510
+ persistTheme = input(true, ...ngDevMode ? [{ debugName: "persistTheme" }] : /* istanbul ignore next */ []);
2061
3511
  regionRenderer = inject(AppRegionRenderer);
2062
3512
  theme = inject(ThemeService);
2063
3513
  applicationContext = inject(ShellApplicationContext);
3514
+ workingContext = inject(WorkingContextService);
3515
+ hostRoute = inject(ActivatedRoute);
2064
3516
  layoutService = inject(LayoutService);
2065
- layout = computed(() => layoutOf(this.definition()), ...ngDevMode ? [{ debugName: "layout" }] : /* istanbul ignore next */ []);
2066
- themeVars = computed(() => themeVarsOf(this.definition()), ...ngDevMode ? [{ debugName: "themeVars" }] : /* istanbul ignore next */ []);
3517
+ sidenavControl = inject(ShellSidenavControl);
3518
+ hostActions = contentChild(ShellActionsDirective, ...ngDevMode ? [{ debugName: "hostActions" }] : /* istanbul ignore next */ []);
3519
+ layout = computed(() => layoutOf(this.definition()), ...ngDevMode ? [{ debugName: "layout" }] : /* istanbul ignore next */ []);
3520
+ themeVars = computed(() => themeVarsOf(this.definition()), ...ngDevMode ? [{ debugName: "themeVars" }] : /* istanbul ignore next */ []);
2067
3521
  themeClass = this.theme.themeClass;
2068
3522
  applyThemeDefaults = effect(() => {
2069
3523
  const definition = this.definition();
2070
3524
  this.theme.setDefaults(themeDefaultsOf(definition));
2071
3525
  this.theme.persistUnder(this.persistTheme() && definition?.id ? `pp-theme:${definition.id}` : null);
2072
3526
  this.applicationContext.definition.set(definition);
2073
- }, ...ngDevMode ? [{ debugName: "applyThemeDefaults" }] : /* istanbul ignore next */ []);
2074
- regionViews = computed(() => (this.definition()?.regions ?? []).map((region) => this.regionRenderer.render(region, this.definition())).filter((view) => view !== void 0), ...ngDevMode ? [{ debugName: "regionViews" }] : /* istanbul ignore next */ []);
2075
- headerView = computed(() => this.viewOf("header"), ...ngDevMode ? [{ debugName: "headerView" }] : /* istanbul ignore next */ []);
2076
- footerView = computed(() => this.viewOf("footer"), ...ngDevMode ? [{ debugName: "footerView" }] : /* istanbul ignore next */ []);
2077
- sidenavView = computed(() => this.layout().hasSidenav && !this.isSmallScreen() ? this.viewOf("sidenav") : void 0, ...ngDevMode ? [{ debugName: "sidenavView" }] : /* istanbul ignore next */ []);
2078
- topNavView = computed(() => this.layout().hasSidenav || this.isSmallScreen() ? void 0 : this.viewOf("sidenav"), ...ngDevMode ? [{ debugName: "topNavView" }] : /* istanbul ignore next */ []);
2079
- isSmallScreen = computed(() => this.layoutService.isSmallDevice(), ...ngDevMode ? [{ debugName: "isSmallScreen" }] : /* istanbul ignore next */ []);
3527
+ }, ...ngDevMode ? [{ debugName: "applyThemeDefaults" }] : /* istanbul ignore next */ []);
3528
+ registerWorkingContexts = effect((onCleanup) => {
3529
+ const contexts = this.definition()?.contexts;
3530
+ if (!contexts?.length) return;
3531
+ const mountedAt = "/" + this.hostRoute.pathFromRoot.flatMap((route) => route.snapshot.url.map((segment) => segment.path)).join("/");
3532
+ const prefix = mountedAt === "/" ? "" : mountedAt;
3533
+ onCleanup(this.workingContext.register(contexts.map((row) => ({
3534
+ ...nestWorkingContext(row),
3535
+ basePath: prefix + "/" + trimSlashes(row.basePath ?? "")
3536
+ }))));
3537
+ }, ...ngDevMode ? [{ debugName: "registerWorkingContexts" }] : /* istanbul ignore next */ []);
3538
+ applySidenavDefault = effect(() => this.sidenavControl.opened.set(this.layout().sidenavOpened), ...ngDevMode ? [{ debugName: "applySidenavDefault" }] : /* istanbul ignore next */ []);
3539
+ regionViews = computed(() => (this.definition()?.regions ?? []).map((region) => this.regionRenderer.render(region, this.definition())).filter((view) => view !== void 0), ...ngDevMode ? [{ debugName: "regionViews" }] : /* istanbul ignore next */ []);
3540
+ headerView = computed(() => this.viewOf("header"), ...ngDevMode ? [{ debugName: "headerView" }] : /* istanbul ignore next */ []);
3541
+ footerView = computed(() => this.viewOf("footer"), ...ngDevMode ? [{ debugName: "footerView" }] : /* istanbul ignore next */ []);
3542
+ statusbarView = computed(() => this.viewOf("statusbar"), ...ngDevMode ? [{ debugName: "statusbarView" }] : /* istanbul ignore next */ []);
3543
+ sidenavView = computed(() => this.layout().hasSidenav && !this.isSmallScreen() ? this.viewOf("sidenav") : void 0, ...ngDevMode ? [{ debugName: "sidenavView" }] : /* istanbul ignore next */ []);
3544
+ topNavView = computed(() => this.layout().hasSidenav || this.isSmallScreen() ? void 0 : this.viewOf("sidenav"), ...ngDevMode ? [{ debugName: "topNavView" }] : /* istanbul ignore next */ []);
3545
+ isSmallScreen = computed(() => this.layoutService.isSmallDevice(), ...ngDevMode ? [{ debugName: "isSmallScreen" }] : /* istanbul ignore next */ []);
2080
3546
  sidenavInputs = computed(() => ({
2081
3547
  ...this.navInputsOf(this.sidenavView(), "vertical"),
2082
3548
  compact: this.layoutService.isMediumDevice()
2083
- }), ...ngDevMode ? [{ debugName: "sidenavInputs" }] : /* istanbul ignore next */ []);
2084
- topNavInputs = computed(() => this.navInputsOf(this.topNavView(), "horizontal"), ...ngDevMode ? [{ debugName: "topNavInputs" }] : /* istanbul ignore next */ []);
3549
+ }), ...ngDevMode ? [{ debugName: "sidenavInputs" }] : /* istanbul ignore next */ []);
3550
+ topNavInputs = computed(() => this.navInputsOf(this.topNavView(), "horizontal"), ...ngDevMode ? [{ debugName: "topNavInputs" }] : /* istanbul ignore next */ []);
3551
+ syncSidenavAvailability = effect(() => this.sidenavControl.available.set(this.sidenavView() !== void 0 && !this.layoutService.isSidenavHidden()), ...ngDevMode ? [{ debugName: "syncSidenavAvailability" }] : /* istanbul ignore next */ []);
3552
+ onSidenavOpenedChange(opened) {
3553
+ if (!this.layoutService.isSidenavHidden()) this.sidenavControl.opened.set(opened);
3554
+ }
2085
3555
  navInputsOf(view, orientation) {
2086
3556
  return {
2087
3557
  ...view?.inputs,
@@ -2093,7 +3563,7 @@ var AppShellComponent = class AppShellComponent {
2093
3563
  }
2094
3564
  static ɵfac = i0.ɵɵngDeclareFactory({
2095
3565
  minVersion: "12.0.0",
2096
- version: "22.1.7",
3566
+ version: "22.2.6",
2097
3567
  ngImport: i0,
2098
3568
  type: AppShellComponent,
2099
3569
  deps: [],
@@ -2101,7 +3571,7 @@ var AppShellComponent = class AppShellComponent {
2101
3571
  });
2102
3572
  static ɵcmp = i0.ɵɵngDeclareComponent({
2103
3573
  minVersion: "17.0.0",
2104
- version: "22.1.7",
3574
+ version: "22.2.6",
2105
3575
  type: AppShellComponent,
2106
3576
  isStandalone: true,
2107
3577
  selector: "pp-app-shell",
@@ -2132,6 +3602,11 @@ var AppShellComponent = class AppShellComponent {
2132
3602
  provide: APPLICATION_CONTEXT,
2133
3603
  useExisting: ShellApplicationContext
2134
3604
  },
3605
+ ShellSidenavControl,
3606
+ {
3607
+ provide: SIDENAV_CONTROL,
3608
+ useExisting: ShellSidenavControl
3609
+ },
2135
3610
  {
2136
3611
  provide: OverlayContainer,
2137
3612
  useClass: ShellOverlayContainer
@@ -2139,9 +3614,16 @@ var AppShellComponent = class AppShellComponent {
2139
3614
  Dialog,
2140
3615
  MatDialog
2141
3616
  ],
3617
+ queries: [{
3618
+ propertyName: "hostActions",
3619
+ first: true,
3620
+ predicate: ShellActionsDirective,
3621
+ descendants: true,
3622
+ isSignal: true
3623
+ }],
2142
3624
  ngImport: i0,
2143
3625
  template: `
2144
- @if (headerView() || topNavView()) {
3626
+ @if (headerView() || topNavView() || hostActions()) {
2145
3627
  <div class="pp-app-shell__top">
2146
3628
  @if (headerView(); as view) {
2147
3629
  <ng-container *ngComponentOutlet="view.component; inputs: view.inputs"></ng-container>
@@ -2149,19 +3631,28 @@ var AppShellComponent = class AppShellComponent {
2149
3631
  @if (topNavView(); as view) {
2150
3632
  <ng-container *ngComponentOutlet="view.component; inputs: topNavInputs()"></ng-container>
2151
3633
  }
3634
+ <ng-content select="[ppShellActions]" />
2152
3635
  </div>
2153
3636
  }
2154
3637
 
3638
+ @if (statusbarView(); as view) {
3639
+ <ng-container *ngComponentOutlet="view.component; inputs: view.inputs"></ng-container>
3640
+ }
3641
+
2155
3642
  <mat-sidenav-container class="pp-app-shell__body">
2156
3643
  @if (sidenavView(); as view) {
2157
3644
  <mat-sidenav
2158
3645
  class="pp-app-shell__sidenav"
2159
3646
  ppSidenavAutosize
2160
3647
  [mode]="layout().sidenavMode"
2161
- [opened]="layout().sidenavOpened && !layoutService.isSidenavHidden()"
3648
+ [opened]="sidenavControl.opened() && !layoutService.isSidenavHidden()"
3649
+ (openedChange)="onSidenavOpenedChange($event)"
2162
3650
  [position]="layout().sidenavPosition"
2163
3651
  >
2164
- <ng-container *ngComponentOutlet="view.component; inputs: sidenavInputs()"></ng-container>
3652
+ <!-- A page such as a content book may take the sidenav over; the outlet keeps the nav one click away. -->
3653
+ <pp-sidenav-content-outlet>
3654
+ <ng-container *ngComponentOutlet="view.component; inputs: sidenavInputs()"></ng-container>
3655
+ </pp-sidenav-content-outlet>
2165
3656
  </mat-sidenav>
2166
3657
  }
2167
3658
  <mat-sidenav-content>
@@ -2176,7 +3667,7 @@ var AppShellComponent = class AppShellComponent {
2176
3667
  }
2177
3668
  `,
2178
3669
  isInline: true,
2179
- styles: ["@charset \"UTF-8\";:host{display:grid;grid-template-rows:auto 1fr auto;height:100%}.pp-app-shell__top{align-items:stretch;display:flex;background-color:var(--pp-surface-header)}.pp-app-shell__body{height:100%;min-height:0}.pp-app-shell__sidenav{background-color:var(--pp-surface-sidenav);color:var(--pp-on-sidenav);width:auto}.pp-app-shell__content{padding:16px 20px 24px}\n"],
3670
+ styles: ["@charset \"UTF-8\";:host{display:grid;grid-template-rows:auto 1fr auto;height:100%}.pp-app-shell__top{align-items:stretch;display:flex;background-color:var(--pp-surface-header)}.pp-app-shell__top ::ng-deep .pp-app-shell__actions{align-items:center;color:var(--pp-on-header);display:flex;gap:4px;margin-left:auto;padding:0 8px}.pp-app-shell__body{height:100%;min-height:0}.pp-app-shell__sidenav{background-color:var(--pp-surface-sidenav);color:var(--pp-on-sidenav);width:auto}.pp-app-shell__content{padding:16px 20px 24px}\n"],
2180
3671
  dependencies: [
2181
3672
  {
2182
3673
  kind: "directive",
@@ -2231,13 +3722,18 @@ var AppShellComponent = class AppShellComponent {
2231
3722
  kind: "directive",
2232
3723
  type: SidenavAutosizeDirective,
2233
3724
  selector: "mat-sidenav[ppSidenavAutosize]"
3725
+ },
3726
+ {
3727
+ kind: "component",
3728
+ type: SidenavContentOutletComponent,
3729
+ selector: "pp-sidenav-content-outlet"
2234
3730
  }
2235
3731
  ]
2236
3732
  });
2237
3733
  };
2238
3734
  i0.ɵɵngDeclareClassMetadata({
2239
3735
  minVersion: "12.0.0",
2240
- version: "22.1.7",
3736
+ version: "22.2.6",
2241
3737
  ngImport: i0,
2242
3738
  type: AppShellComponent,
2243
3739
  decorators: [{
@@ -2251,7 +3747,8 @@ i0.ɵɵngDeclareClassMetadata({
2251
3747
  MatSidenavContainer,
2252
3748
  MatSidenavContent,
2253
3749
  RouterOutlet,
2254
- SidenavAutosizeDirective
3750
+ SidenavAutosizeDirective,
3751
+ SidenavContentOutletComponent
2255
3752
  ],
2256
3753
  providers: [
2257
3754
  ThemeService,
@@ -2260,6 +3757,11 @@ i0.ɵɵngDeclareClassMetadata({
2260
3757
  provide: APPLICATION_CONTEXT,
2261
3758
  useExisting: ShellApplicationContext
2262
3759
  },
3760
+ ShellSidenavControl,
3761
+ {
3762
+ provide: SIDENAV_CONTROL,
3763
+ useExisting: ShellSidenavControl
3764
+ },
2263
3765
  {
2264
3766
  provide: OverlayContainer,
2265
3767
  useClass: ShellOverlayContainer
@@ -2272,7 +3774,7 @@ i0.ɵɵngDeclareClassMetadata({
2272
3774
  "[style]": "themeVars()"
2273
3775
  },
2274
3776
  template: `
2275
- @if (headerView() || topNavView()) {
3777
+ @if (headerView() || topNavView() || hostActions()) {
2276
3778
  <div class="pp-app-shell__top">
2277
3779
  @if (headerView(); as view) {
2278
3780
  <ng-container *ngComponentOutlet="view.component; inputs: view.inputs"></ng-container>
@@ -2280,19 +3782,28 @@ i0.ɵɵngDeclareClassMetadata({
2280
3782
  @if (topNavView(); as view) {
2281
3783
  <ng-container *ngComponentOutlet="view.component; inputs: topNavInputs()"></ng-container>
2282
3784
  }
3785
+ <ng-content select="[ppShellActions]" />
2283
3786
  </div>
2284
3787
  }
2285
3788
 
3789
+ @if (statusbarView(); as view) {
3790
+ <ng-container *ngComponentOutlet="view.component; inputs: view.inputs"></ng-container>
3791
+ }
3792
+
2286
3793
  <mat-sidenav-container class="pp-app-shell__body">
2287
3794
  @if (sidenavView(); as view) {
2288
3795
  <mat-sidenav
2289
3796
  class="pp-app-shell__sidenav"
2290
3797
  ppSidenavAutosize
2291
3798
  [mode]="layout().sidenavMode"
2292
- [opened]="layout().sidenavOpened && !layoutService.isSidenavHidden()"
3799
+ [opened]="sidenavControl.opened() && !layoutService.isSidenavHidden()"
3800
+ (openedChange)="onSidenavOpenedChange($event)"
2293
3801
  [position]="layout().sidenavPosition"
2294
3802
  >
2295
- <ng-container *ngComponentOutlet="view.component; inputs: sidenavInputs()"></ng-container>
3803
+ <!-- A page such as a content book may take the sidenav over; the outlet keeps the nav one click away. -->
3804
+ <pp-sidenav-content-outlet>
3805
+ <ng-container *ngComponentOutlet="view.component; inputs: sidenavInputs()"></ng-container>
3806
+ </pp-sidenav-content-outlet>
2296
3807
  </mat-sidenav>
2297
3808
  }
2298
3809
  <mat-sidenav-content>
@@ -2306,7 +3817,7 @@ i0.ɵɵngDeclareClassMetadata({
2306
3817
  <ng-container *ngComponentOutlet="view.component; inputs: view.inputs"></ng-container>
2307
3818
  }
2308
3819
  `,
2309
- styles: ["@charset \"UTF-8\";:host{display:grid;grid-template-rows:auto 1fr auto;height:100%}.pp-app-shell__top{align-items:stretch;display:flex;background-color:var(--pp-surface-header)}.pp-app-shell__body{height:100%;min-height:0}.pp-app-shell__sidenav{background-color:var(--pp-surface-sidenav);color:var(--pp-on-sidenav);width:auto}.pp-app-shell__content{padding:16px 20px 24px}\n"]
3820
+ styles: ["@charset \"UTF-8\";:host{display:grid;grid-template-rows:auto 1fr auto;height:100%}.pp-app-shell__top{align-items:stretch;display:flex;background-color:var(--pp-surface-header)}.pp-app-shell__top ::ng-deep .pp-app-shell__actions{align-items:center;color:var(--pp-on-header);display:flex;gap:4px;margin-left:auto;padding:0 8px}.pp-app-shell__body{height:100%;min-height:0}.pp-app-shell__sidenav{background-color:var(--pp-surface-sidenav);color:var(--pp-on-sidenav);width:auto}.pp-app-shell__content{padding:16px 20px 24px}\n"]
2310
3821
  }]
2311
3822
  }],
2312
3823
  propDecorators: {
@@ -2325,19 +3836,23 @@ i0.ɵɵngDeclareClassMetadata({
2325
3836
  alias: "persistTheme",
2326
3837
  required: false
2327
3838
  }]
3839
+ }],
3840
+ hostActions: [{
3841
+ type: i0.ContentChild,
3842
+ args: [i0.forwardRef(() => ShellActionsDirective), { isSignal: true }]
2328
3843
  }]
2329
3844
  }
2330
3845
  });
2331
3846
  var AppPreviewComponent = class AppPreviewComponent {
2332
- entityId = input.required(...ngDevMode ? [{ debugName: "entityId" }] : /* istanbul ignore next */ []);
3847
+ entityId = input.required(...ngDevMode ? [{ debugName: "entityId" }] : /* istanbul ignore next */ []);
2333
3848
  store = inject(AppDefinitionStore);
2334
- app = computed(() => this.store.currentEntity(), ...ngDevMode ? [{ debugName: "app" }] : /* istanbul ignore next */ []);
3849
+ app = computed(() => this.store.currentEntity(), ...ngDevMode ? [{ debugName: "app" }] : /* istanbul ignore next */ []);
2335
3850
  ngOnInit() {
2336
3851
  this.store.setCurrentEntity(this.entityId());
2337
3852
  }
2338
3853
  static ɵfac = i0.ɵɵngDeclareFactory({
2339
3854
  minVersion: "12.0.0",
2340
- version: "22.1.7",
3855
+ version: "22.2.6",
2341
3856
  ngImport: i0,
2342
3857
  type: AppPreviewComponent,
2343
3858
  deps: [],
@@ -2345,7 +3860,7 @@ var AppPreviewComponent = class AppPreviewComponent {
2345
3860
  });
2346
3861
  static ɵcmp = i0.ɵɵngDeclareComponent({
2347
3862
  minVersion: "17.1.0",
2348
- version: "22.1.7",
3863
+ version: "22.2.6",
2349
3864
  type: AppPreviewComponent,
2350
3865
  isStandalone: true,
2351
3866
  selector: "pp-app-preview-tab",
@@ -2374,7 +3889,7 @@ var AppPreviewComponent = class AppPreviewComponent {
2374
3889
  };
2375
3890
  i0.ɵɵngDeclareClassMetadata({
2376
3891
  minVersion: "12.0.0",
2377
- version: "22.1.7",
3892
+ version: "22.2.6",
2378
3893
  ngImport: i0,
2379
3894
  type: AppPreviewComponent,
2380
3895
  decorators: [{
@@ -2400,29 +3915,155 @@ i0.ɵɵngDeclareClassMetadata({
2400
3915
  }]
2401
3916
  }] }
2402
3917
  });
3918
+ function appAssetContextOf(service, appId, revision) {
3919
+ return { blob: (path) => service.content(appId, path, revision) };
3920
+ }
3921
+ function moduleAssetContextOf(service, moduleKey, revision) {
3922
+ return { blob: (path) => service.content(moduleKey, path, revision) };
3923
+ }
3924
+ var AppTranslationsLoader = class AppTranslationsLoader {
3925
+ transloco = inject(TranslocoService);
3926
+ service = inject(AppTranslationService);
3927
+ watching;
3928
+ async activate(appId, revision) {
3929
+ this.watching?.unsubscribe();
3930
+ const merged = /* @__PURE__ */ new Set();
3931
+ const mergeOnce = (lang) => {
3932
+ if (merged.has(lang)) return Promise.resolve();
3933
+ merged.add(lang);
3934
+ return this.merge(appId, lang, revision);
3935
+ };
3936
+ await mergeOnce(this.transloco.getActiveLang());
3937
+ for (const lang of this.languages()) mergeOnce(lang);
3938
+ this.watching = this.transloco.langChanges$.subscribe((lang) => void mergeOnce(lang));
3939
+ }
3940
+ async merge(appId, lang, revision) {
3941
+ let texts;
3942
+ try {
3943
+ texts = await firstValueFrom(this.service.bundle(appId, lang, revision));
3944
+ } catch {
3945
+ return;
3946
+ }
3947
+ if (!Object.keys(texts ?? {}).length) return;
3948
+ try {
3949
+ await firstValueFrom(this.transloco.load(lang));
3950
+ } catch {}
3951
+ this.transloco.setTranslation(texts, lang, { merge: true });
3952
+ }
3953
+ languages() {
3954
+ const available = this.transloco.getAvailableLangs().map((lang) => typeof lang === "string" ? lang : lang.id);
3955
+ return [.../* @__PURE__ */ new Set([...available, "en"])];
3956
+ }
3957
+ static ɵfac = i0.ɵɵngDeclareFactory({
3958
+ minVersion: "12.0.0",
3959
+ version: "22.2.6",
3960
+ ngImport: i0,
3961
+ type: AppTranslationsLoader,
3962
+ deps: [],
3963
+ target: i0.ɵɵFactoryTarget.Injectable
3964
+ });
3965
+ static ɵprov = i0.ɵɵngDeclareInjectable({
3966
+ minVersion: "12.0.0",
3967
+ version: "22.2.6",
3968
+ ngImport: i0,
3969
+ type: AppTranslationsLoader,
3970
+ providedIn: "root"
3971
+ });
3972
+ };
3973
+ i0.ɵɵngDeclareClassMetadata({
3974
+ minVersion: "12.0.0",
3975
+ version: "22.2.6",
3976
+ ngImport: i0,
3977
+ type: AppTranslationsLoader,
3978
+ decorators: [{
3979
+ type: Injectable,
3980
+ args: [{ providedIn: "root" }]
3981
+ }]
3982
+ });
2403
3983
  var AppShellRoutesFactory = class AppShellRoutesFactory {
2404
- appStore = inject(AppDefinitionStore);
3984
+ injector = inject(Injector);
2405
3985
  appService = inject(AppDefinitionService);
2406
- moduleStore = inject(ModuleDefinitionStore);
2407
3986
  moduleService = inject(ModuleDefinitionService);
2408
3987
  renderRoute = inject(AppRouteRenderer).render;
3988
+ entityScreens = inject(EntityScreenResolver);
2409
3989
  async childrenOf(appId) {
2410
3990
  const definition = await this.definitionOf(appId);
2411
- if (!definition) return [];
3991
+ return definition ? this.childrenFor(definition) : [];
3992
+ }
3993
+ async childrenFor(definition) {
3994
+ const loadModule = definition.mountedModules ? inlineModules(definition.mountedModules) : this.loadModule;
3995
+ const revision = definition.mountedModules ? "released" : "draft";
3996
+ const loadTranslations = this.translationsOf(revision);
3997
+ await this.injector.get(AppTranslationsLoader).activate(definition.id, revision).catch(() => void 0);
3998
+ const moduleAssets = (moduleKey) => moduleAssetContextOf(this.injector.get(ModuleAssetService), moduleKey, revision);
2412
3999
  const built = await buildAppRoutes({
2413
4000
  routes: definition.routes,
2414
4001
  modules: definition.modules,
2415
- loadModule: this.loadModule
4002
+ contexts: definition.contexts?.map(({ name, parent, entityName }) => ({
4003
+ name,
4004
+ parent,
4005
+ entityName
4006
+ })),
4007
+ contextChildren: async (entityName) => (await this.entityScreens.resolve(entityName))?.embeddedChildren ?? [],
4008
+ loadModule,
4009
+ loadTranslations,
4010
+ moduleAssets
2416
4011
  }, this.renderRoute);
2417
- return built.length ? [indexRoute(definition, built), ...built] : built;
4012
+ const appAssets = {
4013
+ provide: APP_ASSET_CONTEXT,
4014
+ useFactory: () => appAssetContextOf(this.injector.get(AppAssetService), definition.id, revision)
4015
+ };
4016
+ const withAssets = built.map((route) => ({
4017
+ ...route,
4018
+ providers: [...route.providers ?? [], appAssets]
4019
+ }));
4020
+ return withAssets.length ? [indexRoute(definition, withAssets), ...withAssets] : withAssets;
4021
+ }
4022
+ translationsOf(revision) {
4023
+ const languages = () => this.languages();
4024
+ return {
4025
+ get languages() {
4026
+ return languages();
4027
+ },
4028
+ load: async (moduleKey, scope, locale) => {
4029
+ const [shipped, uploaded] = await Promise.all([this.shipped(scope, locale), this.uploaded(moduleKey, locale, revision)]);
4030
+ return {
4031
+ ...shipped,
4032
+ ...uploaded
4033
+ };
4034
+ }
4035
+ };
4036
+ }
4037
+ async shipped(scope, locale) {
4038
+ try {
4039
+ return await firstValueFrom(this.injector.get(TranslocoHttpLoader).getTranslation(`${scope}/${locale}`, { scope }));
4040
+ } catch {
4041
+ return {};
4042
+ }
4043
+ }
4044
+ async uploaded(moduleKey, locale, revision) {
4045
+ try {
4046
+ return await firstValueFrom(this.injector.get(ModuleTranslationService).bundle(moduleKey, locale, revision));
4047
+ } catch {
4048
+ return {};
4049
+ }
4050
+ }
4051
+ languages() {
4052
+ const transloco = this.injector.get(TranslocoService);
4053
+ const available = transloco.getAvailableLangs().map((lang) => typeof lang === "string" ? lang : lang.id);
4054
+ return [.../* @__PURE__ */ new Set([
4055
+ ...available,
4056
+ transloco.getActiveLang(),
4057
+ "en"
4058
+ ])];
2418
4059
  }
2419
4060
  async definitionOf(appId) {
2420
- const known = this.appStore.loadById(appId);
4061
+ const known = this.injector.get(AppDefinitionStore).loadById(appId);
2421
4062
  if (known) return known;
2422
4063
  return await this.fetch(() => firstValueFrom(this.appService.findById(appId)));
2423
4064
  }
2424
4065
  loadModule = async (moduleKey) => {
2425
- const known = this.moduleStore.loadById(moduleKey);
4066
+ const known = this.injector.get(ModuleDefinitionStore).loadById(moduleKey);
2426
4067
  if (known) return known;
2427
4068
  return await this.fetch(() => firstValueFrom(this.moduleService.findById(moduleKey)));
2428
4069
  };
@@ -2435,7 +4076,7 @@ var AppShellRoutesFactory = class AppShellRoutesFactory {
2435
4076
  }
2436
4077
  static ɵfac = i0.ɵɵngDeclareFactory({
2437
4078
  minVersion: "12.0.0",
2438
- version: "22.1.7",
4079
+ version: "22.2.6",
2439
4080
  ngImport: i0,
2440
4081
  type: AppShellRoutesFactory,
2441
4082
  deps: [],
@@ -2443,7 +4084,7 @@ var AppShellRoutesFactory = class AppShellRoutesFactory {
2443
4084
  });
2444
4085
  static ɵprov = i0.ɵɵngDeclareInjectable({
2445
4086
  minVersion: "12.0.0",
2446
- version: "22.1.7",
4087
+ version: "22.2.6",
2447
4088
  ngImport: i0,
2448
4089
  type: AppShellRoutesFactory,
2449
4090
  providedIn: "root"
@@ -2451,7 +4092,7 @@ var AppShellRoutesFactory = class AppShellRoutesFactory {
2451
4092
  };
2452
4093
  i0.ɵɵngDeclareClassMetadata({
2453
4094
  minVersion: "12.0.0",
2454
- version: "22.1.7",
4095
+ version: "22.2.6",
2455
4096
  ngImport: i0,
2456
4097
  type: AppShellRoutesFactory,
2457
4098
  decorators: [{
@@ -2459,6 +4100,9 @@ i0.ɵɵngDeclareClassMetadata({
2459
4100
  args: [{ providedIn: "root" }]
2460
4101
  }]
2461
4102
  });
4103
+ function inlineModules(modules) {
4104
+ return async (moduleKey) => modules.find((module) => module.id === moduleKey);
4105
+ }
2462
4106
  function indexRoute(definition, built) {
2463
4107
  return {
2464
4108
  path: "",
@@ -2485,47 +4129,31 @@ const APP_PREVIEW_TAB = {
2485
4129
  var AppDefinitionContainerComponent = class AppDefinitionContainerComponent {
2486
4130
  containerComponentRef;
2487
4131
  baseEntityHost;
2488
- publishActionsTpl = viewChild("publishActionsTpl", ...ngDevMode ? [{ debugName: "publishActionsTpl" }] : /* istanbul ignore next */ []);
2489
4132
  store = inject(AppDefinitionStore);
2490
4133
  entityDescriptor;
2491
- publishButtonKey = PUBLISH_BUTTON_I18N_KEY;
2492
- publishTooltipKey = PUBLISH_TOOLTIP_I18N_KEY;
2493
- canPublish = computed(() => !this.store.isLoading() && !!this.store.currentEntity()?.id, ...ngDevMode ? [{ debugName: "canPublish" }] : /* istanbul ignore next */ []);
2494
4134
  constructor() {
2495
4135
  this.entityDescriptor = createAppDefinitionDescriptor();
2496
4136
  this.entityDescriptor.store = this.store;
2497
- this.entityDescriptor.extraFormActionsTemplate = () => this.publishActionsTpl();
2498
4137
  this.entityDescriptor.extraTabs = [APP_PREVIEW_TAB];
2499
4138
  }
2500
4139
  ngOnDestroy() {
2501
4140
  if (this.containerComponentRef) this.containerComponentRef.destroy();
2502
4141
  }
2503
- async onPublish() {
2504
- const id = this.store.currentEntity()?.id;
2505
- if (!id) return;
2506
- await this.store.publish(id);
2507
- }
2508
4142
  static ɵfac = i0.ɵɵngDeclareFactory({
2509
4143
  minVersion: "12.0.0",
2510
- version: "22.1.7",
4144
+ version: "22.2.6",
2511
4145
  ngImport: i0,
2512
4146
  type: AppDefinitionContainerComponent,
2513
4147
  deps: [],
2514
4148
  target: i0.ɵɵFactoryTarget.Component
2515
4149
  });
2516
4150
  static ɵcmp = i0.ɵɵngDeclareComponent({
2517
- minVersion: "17.2.0",
2518
- version: "22.1.7",
4151
+ minVersion: "14.0.0",
4152
+ version: "22.2.6",
2519
4153
  type: AppDefinitionContainerComponent,
2520
4154
  isStandalone: true,
2521
4155
  selector: "pp-app-definition-container",
2522
4156
  viewQueries: [{
2523
- propertyName: "publishActionsTpl",
2524
- first: true,
2525
- predicate: ["publishActionsTpl"],
2526
- descendants: true,
2527
- isSignal: true
2528
- }, {
2529
4157
  propertyName: "baseEntityHost",
2530
4158
  first: true,
2531
4159
  predicate: BaseFormHostDirective,
@@ -2534,56 +4162,19 @@ var AppDefinitionContainerComponent = class AppDefinitionContainerComponent {
2534
4162
  static: true
2535
4163
  }],
2536
4164
  ngImport: i0,
2537
- template: `
2538
- <base-entity-container [entityDescriptor]="entityDescriptor"></base-entity-container>
2539
- <ng-template #publishActionsTpl>
2540
- <button id="publish" type="button" mat-raised-button color="accent" [disabled]="!canPublish()" [matTooltip]="publishTooltipKey | transloco" (click)="onPublish()">
2541
- {{ publishButtonKey | transloco }}
2542
- </button>
2543
- </ng-template>
2544
- `,
4165
+ template: ` <base-entity-container [entityDescriptor]="entityDescriptor"></base-entity-container> `,
2545
4166
  isInline: true,
2546
- dependencies: [
2547
- {
2548
- kind: "component",
2549
- type: BaseEntityContainerComponent,
2550
- selector: "base-entity-container",
2551
- inputs: ["entityDescriptor", "facade"]
2552
- },
2553
- {
2554
- kind: "component",
2555
- type: MatButton,
2556
- selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ",
2557
- inputs: ["matButton"],
2558
- exportAs: ["matButton", "matAnchor"]
2559
- },
2560
- {
2561
- kind: "directive",
2562
- type: MatTooltip,
2563
- selector: "[matTooltip]",
2564
- inputs: [
2565
- "matTooltipPosition",
2566
- "matTooltipPositionAtOrigin",
2567
- "matTooltipDisabled",
2568
- "matTooltipShowDelay",
2569
- "matTooltipHideDelay",
2570
- "matTooltipTouchGestures",
2571
- "matTooltip",
2572
- "matTooltipClass"
2573
- ],
2574
- exportAs: ["matTooltip"]
2575
- },
2576
- {
2577
- kind: "pipe",
2578
- type: TranslocoPipe,
2579
- name: "transloco"
2580
- }
2581
- ]
4167
+ dependencies: [{
4168
+ kind: "component",
4169
+ type: BaseEntityContainerComponent,
4170
+ selector: "base-entity-container",
4171
+ inputs: ["entityDescriptor", "facade"]
4172
+ }]
2582
4173
  });
2583
4174
  };
2584
4175
  i0.ɵɵngDeclareClassMetadata({
2585
4176
  minVersion: "12.0.0",
2586
- version: "22.1.7",
4177
+ version: "22.2.6",
2587
4178
  ngImport: i0,
2588
4179
  type: AppDefinitionContainerComponent,
2589
4180
  decorators: [{
@@ -2591,37 +4182,277 @@ i0.ɵɵngDeclareClassMetadata({
2591
4182
  args: [{
2592
4183
  selector: "pp-app-definition-container",
2593
4184
  standalone: true,
2594
- imports: [
2595
- BaseEntityContainerComponent,
2596
- MatButton,
2597
- MatTooltip,
2598
- TranslocoPipe
2599
- ],
2600
- template: `
2601
- <base-entity-container [entityDescriptor]="entityDescriptor"></base-entity-container>
2602
- <ng-template #publishActionsTpl>
2603
- <button id="publish" type="button" mat-raised-button color="accent" [disabled]="!canPublish()" [matTooltip]="publishTooltipKey | transloco" (click)="onPublish()">
2604
- {{ publishButtonKey | transloco }}
2605
- </button>
2606
- </ng-template>
2607
- `
4185
+ imports: [BaseEntityContainerComponent],
4186
+ template: ` <base-entity-container [entityDescriptor]="entityDescriptor"></base-entity-container> `
2608
4187
  }]
2609
4188
  }],
2610
4189
  ctorParameters: () => [],
4190
+ propDecorators: { baseEntityHost: [{
4191
+ type: ViewChild,
4192
+ args: [BaseFormHostDirective, {
4193
+ static: true,
4194
+ read: BaseFormHostDirective
4195
+ }]
4196
+ }] }
4197
+ });
4198
+ var PublishedAppStore = class PublishedAppStore {
4199
+ appService = inject(AppDefinitionService);
4200
+ _published = signal(void 0, ...ngDevMode ? [{ debugName: "_published" }] : /* istanbul ignore next */ []);
4201
+ _loaded = signal(false, ...ngDevMode ? [{ debugName: "_loaded" }] : /* istanbul ignore next */ []);
4202
+ published = this._published.asReadonly();
4203
+ loaded = this._loaded.asReadonly();
4204
+ async load(appId) {
4205
+ let definition;
4206
+ try {
4207
+ definition = await firstValueFrom(this.appService.findPublished(appId));
4208
+ } catch (error) {
4209
+ if (error instanceof HttpErrorResponse && error.status === 401) throw error;
4210
+ definition = void 0;
4211
+ }
4212
+ this._published.set(definition);
4213
+ this._loaded.set(true);
4214
+ return definition;
4215
+ }
4216
+ async clear() {
4217
+ this._published.set(void 0);
4218
+ this._loaded.set(true);
4219
+ }
4220
+ static ɵfac = i0.ɵɵngDeclareFactory({
4221
+ minVersion: "12.0.0",
4222
+ version: "22.2.6",
4223
+ ngImport: i0,
4224
+ type: PublishedAppStore,
4225
+ deps: [],
4226
+ target: i0.ɵɵFactoryTarget.Injectable
4227
+ });
4228
+ static ɵprov = i0.ɵɵngDeclareInjectable({
4229
+ minVersion: "12.0.0",
4230
+ version: "22.2.6",
4231
+ ngImport: i0,
4232
+ type: PublishedAppStore,
4233
+ providedIn: "root"
4234
+ });
4235
+ };
4236
+ i0.ɵɵngDeclareClassMetadata({
4237
+ minVersion: "12.0.0",
4238
+ version: "22.2.6",
4239
+ ngImport: i0,
4240
+ type: PublishedAppStore,
4241
+ decorators: [{
4242
+ type: Injectable,
4243
+ args: [{ providedIn: "root" }]
4244
+ }]
4245
+ });
4246
+ function publishedAppRoutesGuard(appId, fallback = []) {
4247
+ return (route) => {
4248
+ if (isActive(inject(Router).routerState.snapshot.root, route)) return true;
4249
+ const store = inject(PublishedAppStore);
4250
+ const factory = inject(AppShellRoutesFactory);
4251
+ return (typeof appId === "string" ? Promise.resolve(appId) : appId()).then((resolved) => resolved ? store.load(resolved) : store.clear()).then(async (definition) => {
4252
+ const children = definition ? await factory.childrenFor(definition) : [];
4253
+ route.children = children.length ? children : fallback;
4254
+ return true;
4255
+ });
4256
+ };
4257
+ }
4258
+ function isActive(snapshot, route) {
4259
+ return snapshot.routeConfig === route || snapshot.children.some((child) => isActive(child, route));
4260
+ }
4261
+ var PublishedAppThemeDirective = class PublishedAppThemeDirective {
4262
+ appIdResolver = input.required({
4263
+ ...ngDevMode ? { debugName: "appIdResolver" } : /* istanbul ignore next */ {},
4264
+ alias: "ppPublishedAppTheme"
4265
+ });
4266
+ enabled = input(true, {
4267
+ ...ngDevMode ? { debugName: "enabled" } : /* istanbul ignore next */ {},
4268
+ alias: "ppPublishedAppThemeEnabled"
4269
+ });
4270
+ store = inject(PublishedAppStore);
4271
+ theme = inject(ThemeService);
4272
+ injector = inject(EnvironmentInjector);
4273
+ loading = false;
4274
+ themeClass = computed(() => this.enabled() ? this.theme.themeClass() : "", ...ngDevMode ? [{ debugName: "themeClass" }] : /* istanbul ignore next */ []);
4275
+ themeVars = computed(() => this.enabled() ? themeVarsOf(this.store.published()) : {}, ...ngDevMode ? [{ debugName: "themeVars" }] : /* istanbul ignore next */ []);
4276
+ loadWhenUnread = effect(() => {
4277
+ if (!this.enabled() || this.store.loaded() || this.loading) return;
4278
+ this.loading = true;
4279
+ const resolver = this.appIdResolver();
4280
+ runInInjectionContext(this.injector, resolver).then((appId) => appId ? this.store.load(appId) : this.store.clear()).catch(() => void 0).finally(() => this.loading = false);
4281
+ }, ...ngDevMode ? [{ debugName: "loadWhenUnread" }] : /* istanbul ignore next */ []);
4282
+ applyDefaults = effect(() => {
4283
+ const definition = this.store.published();
4284
+ this.theme.setDefaults(themeDefaultsOf(definition));
4285
+ this.theme.persistUnder(definition?.id ? `pp-theme:${definition.id}` : null);
4286
+ }, ...ngDevMode ? [{ debugName: "applyDefaults" }] : /* istanbul ignore next */ []);
4287
+ static ɵfac = i0.ɵɵngDeclareFactory({
4288
+ minVersion: "12.0.0",
4289
+ version: "22.2.6",
4290
+ ngImport: i0,
4291
+ type: PublishedAppThemeDirective,
4292
+ deps: [],
4293
+ target: i0.ɵɵFactoryTarget.Directive
4294
+ });
4295
+ static ɵdir = i0.ɵɵngDeclareDirective({
4296
+ minVersion: "17.1.0",
4297
+ version: "22.2.6",
4298
+ type: PublishedAppThemeDirective,
4299
+ isStandalone: true,
4300
+ selector: "[ppPublishedAppTheme]",
4301
+ inputs: {
4302
+ appIdResolver: {
4303
+ classPropertyName: "appIdResolver",
4304
+ publicName: "ppPublishedAppTheme",
4305
+ isSignal: true,
4306
+ isRequired: true,
4307
+ transformFunction: null
4308
+ },
4309
+ enabled: {
4310
+ classPropertyName: "enabled",
4311
+ publicName: "ppPublishedAppThemeEnabled",
4312
+ isSignal: true,
4313
+ isRequired: false,
4314
+ transformFunction: null
4315
+ }
4316
+ },
4317
+ host: { properties: {
4318
+ "class": "themeClass()",
4319
+ "style": "themeVars()"
4320
+ } },
4321
+ providers: [ThemeService],
4322
+ ngImport: i0
4323
+ });
4324
+ };
4325
+ i0.ɵɵngDeclareClassMetadata({
4326
+ minVersion: "12.0.0",
4327
+ version: "22.2.6",
4328
+ ngImport: i0,
4329
+ type: PublishedAppThemeDirective,
4330
+ decorators: [{
4331
+ type: Directive,
4332
+ args: [{
4333
+ selector: "[ppPublishedAppTheme]",
4334
+ providers: [ThemeService],
4335
+ host: {
4336
+ "[class]": "themeClass()",
4337
+ "[style]": "themeVars()"
4338
+ }
4339
+ }]
4340
+ }],
2611
4341
  propDecorators: {
2612
- baseEntityHost: [{
2613
- type: ViewChild,
2614
- args: [BaseFormHostDirective, {
2615
- static: true,
2616
- read: BaseFormHostDirective
4342
+ appIdResolver: [{
4343
+ type: i0.Input,
4344
+ args: [{
4345
+ isSignal: true,
4346
+ alias: "ppPublishedAppTheme",
4347
+ required: true
2617
4348
  }]
2618
4349
  }],
2619
- publishActionsTpl: [{
2620
- type: i0.ViewChild,
2621
- args: ["publishActionsTpl", { isSignal: true }]
4350
+ enabled: [{
4351
+ type: i0.Input,
4352
+ args: [{
4353
+ isSignal: true,
4354
+ alias: "ppPublishedAppThemeEnabled",
4355
+ required: false
4356
+ }]
2622
4357
  }]
2623
4358
  }
2624
4359
  });
4360
+ const APP_CONCEPTS = [
4361
+ "assembling",
4362
+ "application",
4363
+ "theme",
4364
+ "layout",
4365
+ "regions",
4366
+ "header",
4367
+ "footer",
4368
+ "navigation",
4369
+ "routes",
4370
+ "widgets",
4371
+ "entities",
4372
+ "documents",
4373
+ "modules",
4374
+ "roles",
4375
+ "lifecycle"
4376
+ ];
4377
+ function appConceptAnchor(concept) {
4378
+ return `app-concept-${concept}`;
4379
+ }
4380
+ var AppConceptsGuideComponent = class AppConceptsGuideComponent {
4381
+ scope = APP_CONCEPTS_I18N_SCOPE;
4382
+ concepts = APP_CONCEPTS;
4383
+ anchor = appConceptAnchor;
4384
+ route = inject(ActivatedRoute);
4385
+ transloco = inject(TranslocoService);
4386
+ injector = inject(Injector);
4387
+ constructor() {
4388
+ const fragment = this.route.snapshot.fragment;
4389
+ if (!fragment) return;
4390
+ this.transloco.selectTranslation(`${BASE_APP_TRANSLOCO_SCOPE}/${this.transloco.getActiveLang()}`).pipe(take(1), takeUntilDestroyed(inject(DestroyRef))).subscribe(() => afterNextRender(() => document.getElementById(fragment)?.scrollIntoView({ block: "start" }), { injector: this.injector }));
4391
+ }
4392
+ static ɵfac = i0.ɵɵngDeclareFactory({
4393
+ minVersion: "12.0.0",
4394
+ version: "22.2.6",
4395
+ ngImport: i0,
4396
+ type: AppConceptsGuideComponent,
4397
+ deps: [],
4398
+ target: i0.ɵɵFactoryTarget.Component
4399
+ });
4400
+ static ɵcmp = i0.ɵɵngDeclareComponent({
4401
+ minVersion: "17.0.0",
4402
+ version: "22.2.6",
4403
+ type: AppConceptsGuideComponent,
4404
+ isStandalone: true,
4405
+ selector: "pp-app-concepts-guide",
4406
+ ngImport: i0,
4407
+ template: `
4408
+ <article class="guide" aria-labelledby="app-concepts-title">
4409
+ <h2 id="app-concepts-title">{{ scope + '.title' | transloco }}</h2>
4410
+ <p class="intro" [innerHTML]="scope + '.intro' | transloco"></p>
4411
+ @for (concept of concepts; track concept) {
4412
+ <section [id]="anchor(concept)">
4413
+ <h3>{{ scope + '.' + concept + '.title' | transloco }}</h3>
4414
+ <div [innerHTML]="scope + '.' + concept + '.body' | transloco"></div>
4415
+ </section>
4416
+ }
4417
+ </article>
4418
+ `,
4419
+ isInline: true,
4420
+ styles: [".guide{max-width:960px;padding:16px 24px 32px;line-height:1.5}.intro{font-size:1.05em}section{border-top:1px solid rgba(0,0,0,.12);padding-top:8px;scroll-margin-top:16px}h3{margin:8px 0 4px}:host ::ng-deep code{background:#0000000f;border-radius:3px;padding:0 4px}\n"],
4421
+ dependencies: [{
4422
+ kind: "pipe",
4423
+ type: TranslocoPipe,
4424
+ name: "transloco"
4425
+ }]
4426
+ });
4427
+ };
4428
+ i0.ɵɵngDeclareClassMetadata({
4429
+ minVersion: "12.0.0",
4430
+ version: "22.2.6",
4431
+ ngImport: i0,
4432
+ type: AppConceptsGuideComponent,
4433
+ decorators: [{
4434
+ type: Component,
4435
+ args: [{
4436
+ selector: "pp-app-concepts-guide",
4437
+ standalone: true,
4438
+ imports: [TranslocoPipe],
4439
+ template: `
4440
+ <article class="guide" aria-labelledby="app-concepts-title">
4441
+ <h2 id="app-concepts-title">{{ scope + '.title' | transloco }}</h2>
4442
+ <p class="intro" [innerHTML]="scope + '.intro' | transloco"></p>
4443
+ @for (concept of concepts; track concept) {
4444
+ <section [id]="anchor(concept)">
4445
+ <h3>{{ scope + '.' + concept + '.title' | transloco }}</h3>
4446
+ <div [innerHTML]="scope + '.' + concept + '.body' | transloco"></div>
4447
+ </section>
4448
+ }
4449
+ </article>
4450
+ `,
4451
+ styles: [".guide{max-width:960px;padding:16px 24px 32px;line-height:1.5}.intro{font-size:1.05em}section{border-top:1px solid rgba(0,0,0,.12);padding-top:8px;scroll-margin-top:16px}h3{margin:8px 0 4px}:host ::ng-deep code{background:#0000000f;border-radius:3px;padding:0 4px}\n"]
4452
+ }]
4453
+ }],
4454
+ ctorParameters: () => []
4455
+ });
2625
4456
  var ModuleDefinitionContainerComponent = class ModuleDefinitionContainerComponent {
2626
4457
  store = inject(ModuleDefinitionStore);
2627
4458
  entityDescriptor;
@@ -2631,7 +4462,7 @@ var ModuleDefinitionContainerComponent = class ModuleDefinitionContainerComponen
2631
4462
  }
2632
4463
  static ɵfac = i0.ɵɵngDeclareFactory({
2633
4464
  minVersion: "12.0.0",
2634
- version: "22.1.7",
4465
+ version: "22.2.6",
2635
4466
  ngImport: i0,
2636
4467
  type: ModuleDefinitionContainerComponent,
2637
4468
  deps: [],
@@ -2639,7 +4470,7 @@ var ModuleDefinitionContainerComponent = class ModuleDefinitionContainerComponen
2639
4470
  });
2640
4471
  static ɵcmp = i0.ɵɵngDeclareComponent({
2641
4472
  minVersion: "14.0.0",
2642
- version: "22.1.7",
4473
+ version: "22.2.6",
2643
4474
  type: ModuleDefinitionContainerComponent,
2644
4475
  isStandalone: true,
2645
4476
  selector: "pp-module-definition-container",
@@ -2656,7 +4487,7 @@ var ModuleDefinitionContainerComponent = class ModuleDefinitionContainerComponen
2656
4487
  };
2657
4488
  i0.ɵɵngDeclareClassMetadata({
2658
4489
  minVersion: "12.0.0",
2659
- version: "22.1.7",
4490
+ version: "22.2.6",
2660
4491
  ngImport: i0,
2661
4492
  type: ModuleDefinitionContainerComponent,
2662
4493
  decorators: [{
@@ -2670,12 +4501,40 @@ i0.ɵɵngDeclareClassMetadata({
2670
4501
  }],
2671
4502
  ctorParameters: () => []
2672
4503
  });
4504
+ var AppContextFacade = class AppContextFacade extends EmbeddedEntityFacade {
4505
+ entityType = WorkingContextRow;
4506
+ createDescriptor() {
4507
+ return createWorkingContextDescriptor();
4508
+ }
4509
+ static ɵfac = i0.ɵɵngDeclareFactory({
4510
+ minVersion: "12.0.0",
4511
+ version: "22.2.6",
4512
+ ngImport: i0,
4513
+ type: AppContextFacade,
4514
+ deps: null,
4515
+ target: i0.ɵɵFactoryTarget.Injectable
4516
+ });
4517
+ static ɵprov = i0.ɵɵngDeclareInjectable({
4518
+ minVersion: "12.0.0",
4519
+ version: "22.2.6",
4520
+ ngImport: i0,
4521
+ type: AppContextFacade
4522
+ });
4523
+ };
4524
+ i0.ɵɵngDeclareClassMetadata({
4525
+ minVersion: "12.0.0",
4526
+ version: "22.2.6",
4527
+ ngImport: i0,
4528
+ type: AppContextFacade,
4529
+ decorators: [{ type: Injectable }]
4530
+ });
2673
4531
  const BASE_APP_FACADE_PROVIDERS = [
2674
4532
  AppDefinitionFacade,
2675
4533
  ModuleDefinitionFacade,
2676
4534
  AppRegionFacade,
2677
4535
  AppRouteFacade,
2678
4536
  AppModuleMountFacade,
4537
+ AppContextFacade,
2679
4538
  AppNavItemFacade,
2680
4539
  AppWidgetFacade
2681
4540
  ];
@@ -2685,6 +4544,7 @@ const BASE_APP_ENTITY_FACADES = {
2685
4544
  [APP_REGION_ENTITY_NAME]: AppRegionFacade,
2686
4545
  [APP_ROUTE_ENTITY_NAME]: AppRouteFacade,
2687
4546
  [APP_MODULE_MOUNT_ENTITY_NAME]: AppModuleMountFacade,
4547
+ [APP_CONTEXT_ENTITY_NAME]: AppContextFacade,
2688
4548
  [APP_NAV_ITEM_ENTITY_NAME]: AppNavItemFacade,
2689
4549
  [APP_WIDGET_ENTITY_NAME]: AppWidgetFacade
2690
4550
  };
@@ -2731,6 +4591,10 @@ function embeddedDefinitionRoutes() {
2731
4591
  {
2732
4592
  entityName: APP_MODULE_MOUNT_ENTITY_NAME,
2733
4593
  facade: AppModuleMountFacade
4594
+ },
4595
+ {
4596
+ entityName: APP_CONTEXT_ENTITY_NAME,
4597
+ facade: AppContextFacade
2734
4598
  }
2735
4599
  ];
2736
4600
  }
@@ -2754,6 +4618,6 @@ function widgetRoute() {
2754
4618
  facade: AppWidgetFacade
2755
4619
  };
2756
4620
  }
2757
- export { APP_DEFINITION_ENTITY_NAME, APP_DEFINITION_I18N_SCOPE, APP_MODULE_MOUNT_ENTITY_NAME, APP_MODULE_MOUNT_I18N_SCOPE, APP_MODULE_MOUNT_ID_FIELD, APP_NAV_ITEM_ENTITY_NAME, APP_NAV_ITEM_I18N_SCOPE, APP_PREVIEW_I18N_KEY, APP_PREVIEW_TAB, APP_REGION_ENTITY_NAME, APP_REGION_I18N_SCOPE, APP_REGION_ID_FIELD, APP_ROUTE_ENTITY_NAME, APP_ROUTE_I18N_SCOPE, APP_ROUTE_ID_FIELD, APP_WIDGET_ENTITY_NAME, APP_WIDGET_I18N_SCOPE, AppDefinition, AppDefinitionContainerComponent, AppDefinitionFacade, AppDefinitionMapper, AppDefinitionService, AppDefinitionStatus, AppDefinitionStore, AppModuleMountFacade, AppNavItemFacade, AppPreviewComponent, AppRegionFacade, AppRegionRenderer, AppRouteFacade, AppRouteRenderer, AppShellComponent, AppShellRoutesFactory, AppWidgetFacade, BASE_APP_ENTITY_FACADES, BASE_APP_FACADE_PROVIDERS, BASE_APP_ROUTES, BASE_APP_TRANSLATION_SOURCE, BASE_APP_TRANSLOCO_SCOPE, COLOR_SCHEMES, ENTITY_MODES, LAYOUT_PRESETS, MATERIAL_THEMES, MODULE_DEFINITION_ENTITY_NAME, MODULE_DEFINITION_I18N_SCOPE, ModuleDefinition, ModuleDefinitionContainerComponent, ModuleDefinitionFacade, ModuleDefinitionMapper, ModuleDefinitionService, ModuleDefinitionStore, ModuleMount, NavItem, REGION_TYPES, ROUTE_TARGET_KINDS, RegionDefinition, RegionFooterComponent, RegionHeaderComponent, RegionNavComponent, RouteDefinition, RouteUnsupportedComponent, RouteWidgetsComponent, SIDENAV_MODES, WIDGET_PLACEMENTS, WidgetInstance, WidgetListComponent, appShellRoutesGuard, buildAppRoutes, createAppDefinitionDescriptor, createModuleDefinitionDescriptor, createModuleMountDescriptor, createNavItemDescriptor, createRegionDefinitionDescriptor, createRouteDefinitionDescriptor, createWidgetInstanceDescriptor, layoutOf, moduleTranslocoScope, themeVarsOf };
4621
+ export { APP_ASSETS_I18N_SCOPE, APP_CONCEPTS, APP_DEFINITION_ENTITY_NAME, APP_DEFINITION_I18N_SCOPE, APP_MODULE_MOUNT_ENTITY_NAME, APP_MODULE_MOUNT_I18N_SCOPE, APP_MODULE_MOUNT_ID_FIELD, APP_NAV_ITEM_ENTITY_NAME, APP_NAV_ITEM_I18N_SCOPE, APP_PREVIEW_I18N_KEY, APP_PREVIEW_TAB, APP_REGION_ENTITY_NAME, APP_REGION_I18N_SCOPE, APP_REGION_ID_FIELD, APP_ROUTE_ENTITY_NAME, APP_ROUTE_I18N_SCOPE, APP_ROUTE_ID_FIELD, APP_TRANSLATIONS_I18N_SCOPE, APP_WIDGET_ENTITY_NAME, APP_WIDGET_I18N_SCOPE, AppAssetService, AppAssetsControlComponent, AppConceptsGuideComponent, AppDefinition, AppDefinitionContainerComponent, AppDefinitionFacade, AppDefinitionMapper, AppDefinitionService, AppDefinitionStatus, AppDefinitionStore, AppModuleMountFacade, AppNavItemFacade, AppPreviewComponent, AppRegionFacade, AppRegionRenderer, AppRouteFacade, AppRouteRenderer, AppShellComponent, AppShellRoutesFactory, AppTranslationService, AppTranslationsControlComponent, AppWidgetFacade, BASE_APP_ENTITY_FACADES, BASE_APP_FACADE_PROVIDERS, BASE_APP_ROUTES, BASE_APP_TRANSLATION_SOURCE, BASE_APP_TRANSLOCO_SCOPE, COLOR_SCHEMES, ENTITY_MODES, LAYOUT_PRESETS, MATERIAL_THEMES, MODULE_ASSETS_I18N_SCOPE, MODULE_DEFINITION_ENTITY_NAME, MODULE_DEFINITION_I18N_SCOPE, MODULE_TRANSLATIONS_I18N_SCOPE, ModuleAssetService, ModuleAssetsControlComponent, ModuleDefinition, ModuleDefinitionContainerComponent, ModuleDefinitionFacade, ModuleDefinitionMapper, ModuleDefinitionService, ModuleDefinitionStore, ModuleMount, ModuleTranslationService, ModuleTranslationsControlComponent, NavItem, PublishedAppStore, PublishedAppThemeDirective, REGION_TYPES, ROUTE_TARGET_KINDS, RegionDefinition, RegionFooterComponent, RegionHeaderComponent, RegionNavComponent, RouteDefinition, RouteUnsupportedComponent, RouteWidgetsComponent, SIDENAV_MODES, ShellActionsDirective, WIDGET_PLACEMENTS, WidgetInstance, WidgetListComponent, appConceptAnchor, appShellRoutesGuard, buildAppRoutes, createAppDefinitionDescriptor, createModuleDefinitionDescriptor, createModuleMountDescriptor, createNavItemDescriptor, createRegionDefinitionDescriptor, createRouteDefinitionDescriptor, createWidgetInstanceDescriptor, layoutOf, moduleRouteTranslocoId, moduleTranslocoScope, publishedAppRoutesGuard, themeVarsOf, widgetTypeSelectables };
2758
4622
 
2759
4623
  //# sourceMappingURL=processpuzzle-base-app.mjs.map