@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.
- package/README.md +12 -0
- package/assets/i18n/base_app/de.json +227 -10
- package/assets/i18n/base_app/en.json +227 -10
- package/assets/i18n/base_app/es.json +227 -10
- package/assets/i18n/base_app/fr.json +227 -10
- package/assets/i18n/base_app/hu.json +227 -10
- package/assets/images/demo-logo.svg +101 -0
- package/fesm2022/processpuzzle-base-app.mjs +2178 -314
- package/fesm2022/processpuzzle-base-app.mjs.map +1 -1
- package/package.json +4 -4
- package/types/processpuzzle-base-app.d.ts +718 -154
- package/types/processpuzzle-base-app.d.ts.map +1 -1
|
@@ -1,10 +1,73 @@
|
|
|
1
|
-
import { BaseEntity, BaseEntityDescriptor, BaseEntityFacade, BaseEntityFacadeRegistry, BaseEntityMapper, BaseEntityRestService, BaseFormHostDirective, EmbeddedEntityFacade, EntityTabDescriptor, PersistedEntity } from "@processpuzzle/base-entity";
|
|
2
|
-
import { ThemeColorScheme, ThemePreset,
|
|
3
|
-
import { LayoutService, TranslationSource } from "@processpuzzle/util";
|
|
4
|
-
import * as i0 from "@angular/core";
|
|
5
|
-
import { OnDestroy, OnInit, Provider, TemplateRef, Type } from "@angular/core";
|
|
1
|
+
import { BaseEntity, BaseEntityDescriptor, BaseEntityFacade, BaseEntityFacadeRegistry, BaseEntityMapper, BaseEntityRestService, BaseFormControlComponent, BaseFormHostDirective, EmbeddedChildRoute, EmbeddedEntityFacade, EntityTabDescriptor, PersistedEntity, Selectable, SelectablesInput, WorkingContextAggregate, WorkingContextDefinition, WorkingContextPersistence } from "@processpuzzle/base-entity";
|
|
2
|
+
import { ModuleAssetContext, SidenavControl, ThemeColorScheme, ThemePreset, WIDGET_PLACEMENTS, WidgetInstance, WidgetInstance as WidgetInstance$1, WidgetPlacement, WidgetRegistration } from "@processpuzzle/widgets";
|
|
6
3
|
import { Observable } from "rxjs";
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
import { OnDestroy, OnInit, Provider, Type } from "@angular/core";
|
|
6
|
+
import { LayoutService, TranslationSource } from "@processpuzzle/util";
|
|
7
7
|
import { CanMatchFn, Route, Routes } from "@angular/router";
|
|
8
|
+
import { Translation } from "@jsverse/transloco";
|
|
9
|
+
/**
|
|
10
|
+
* Frontend model of the `ModuleDefinition` schema of `base-app-api.yaml`: a lazily-loadable slice of an
|
|
11
|
+
* application, with its own flat route list and its own transloco scope. An {@link ModuleMount} of an
|
|
12
|
+
* `AppDefinition` names one of these by key and mounts its routes under a base path.
|
|
13
|
+
*
|
|
14
|
+
* **What "lazy" honestly means.** A module lazy-loads *metadata* — this definition, its routes, its
|
|
15
|
+
* translations, and the documents and descriptors they name. It does **not** lazy-load widget code:
|
|
16
|
+
* widget components are bundled at compile time and resolved through the frontend registry, so a
|
|
17
|
+
* metadata module cannot split a bundle on its own. The wins are that `AppDefinition` stops being one
|
|
18
|
+
* aggregate that has to be loaded, locked and published atomically, and that a module is the unit of
|
|
19
|
+
* authoring permission and versioning. Nothing here should be justified on bundle size.
|
|
20
|
+
*
|
|
21
|
+
* Unlike the region / route / mount classes this one is a **routable** entity: it has endpoints of its
|
|
22
|
+
* own, so it comes with a service, a store and a facade rather than travelling inside another payload.
|
|
23
|
+
*/
|
|
24
|
+
export declare class ModuleDefinition implements BaseEntity {
|
|
25
|
+
/**
|
|
26
|
+
* The contract calls this field `key`; base-entity keys every store, URL and reference on `id`, so
|
|
27
|
+
* {@link ModuleDefinitionMapper} renames it on the way in and out rather than teaching the framework a
|
|
28
|
+
* second identity field. One name for one thing on this side of the mapper — a `key` property beside
|
|
29
|
+
* `id` could only ever disagree with it.
|
|
30
|
+
*
|
|
31
|
+
* Immutable by contract: `ModuleMount.moduleKey` resolves against it, and a rename would silently
|
|
32
|
+
* unmount the module from every app that mounts it.
|
|
33
|
+
*/
|
|
34
|
+
id: string;
|
|
35
|
+
name: string;
|
|
36
|
+
translocoId: string | undefined;
|
|
37
|
+
description: string | undefined;
|
|
38
|
+
/**
|
|
39
|
+
* Transloco scope the module's translations load under. Absent means {@link id}, which is the default
|
|
40
|
+
* the contract states; {@link moduleTranslocoScope} is the one place that default is applied.
|
|
41
|
+
*/
|
|
42
|
+
translocoScope: string | undefined;
|
|
43
|
+
/**
|
|
44
|
+
* The module's routes, flat and relative to the base path it is mounted at — the same shape and the
|
|
45
|
+
* same derived nesting as `AppDefinition.routes`, and flattened by the same mapper. A module does not
|
|
46
|
+
* mount modules: this is where composition stops.
|
|
47
|
+
*/
|
|
48
|
+
routes: RouteDefinition[] | undefined;
|
|
49
|
+
orgKey: string | undefined;
|
|
50
|
+
version: number | undefined;
|
|
51
|
+
createdAt: string | undefined;
|
|
52
|
+
updatedAt: string | undefined;
|
|
53
|
+
constructor(init?: Partial<ModuleDefinition>);
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* The scope a module's translations load under, applying the contract's default: the module key with its dashes
|
|
57
|
+
* written as underscores (`conduct-race` is `conduct_race`), because transloco keys use underscores and the scope is
|
|
58
|
+
* the first segment of every key a widget names for the module. The backend derives the same default
|
|
59
|
+
* (`ModuleDefinition.getTranslocoScope`). Kept as a function
|
|
60
|
+
* rather than resolved in the mapper, so a definition never carries a `translocoScope` the designer did
|
|
61
|
+
* not author — the field stays empty in the form, and the fallback is a rendering decision.
|
|
62
|
+
*/
|
|
63
|
+
export declare function moduleTranslocoScope(definition: ModuleDefinition): string;
|
|
64
|
+
/**
|
|
65
|
+
* The transloco key a module's route title is translated under: the authored `translocoId`, else one derived
|
|
66
|
+
* from the scope and the path — `<scope>.route.<path>`. A designer therefore never has to type a key for a
|
|
67
|
+
* module to be translatable; the backend derives the same key when it prepares the translation files
|
|
68
|
+
* (`ModuleTranslationKeys`), and the two have to agree.
|
|
69
|
+
*/
|
|
70
|
+
export declare function moduleRouteTranslocoId(scope: string, route: RouteDefinition): string;
|
|
8
71
|
/**
|
|
9
72
|
* Frontend model of the `AppDefinition` schema of `base-app-api.yaml`. `theme` and `layout` are
|
|
10
73
|
* flattened onto the entity by {@link AppDefinitionMapper} so that the generated form can offer a
|
|
@@ -39,11 +102,13 @@ type LayoutPreset = (typeof LAYOUT_PRESETS)[number];
|
|
|
39
102
|
export declare const SIDENAV_MODES: readonly ["side", "over", "push"];
|
|
40
103
|
type SidenavMode = (typeof SIDENAV_MODES)[number];
|
|
41
104
|
/**
|
|
105
|
+
* `statusbar` carries neither `navItems` nor `widgets`: the shell fills it with the active working contexts.
|
|
106
|
+
*
|
|
42
107
|
* No `content`: once routes own the content area it *is* the router outlet, so a content region would
|
|
43
108
|
* have no field of its own — `widgets` is header/footer-only and `navItems` sidenav-only. Its sizing
|
|
44
109
|
* lives in {@link LayoutDefinition.contentMaxWidth}.
|
|
45
110
|
*/
|
|
46
|
-
export declare const REGION_TYPES: readonly ["header", "sidenav", "footer"];
|
|
111
|
+
export declare const REGION_TYPES: readonly ["header", "sidenav", "footer", "statusbar"];
|
|
47
112
|
type RegionType = (typeof REGION_TYPES)[number];
|
|
48
113
|
/**
|
|
49
114
|
* What a route renders. Uppercase because the contract's enum is — `RegionType` and the theme enums
|
|
@@ -125,6 +190,10 @@ interface RouteTarget {
|
|
|
125
190
|
entityMode?: EntityMode;
|
|
126
191
|
/** ENTITY + LIST only. */
|
|
127
192
|
rsqlFilter?: string;
|
|
193
|
+
/** ENTITY + LIST only: see {@link RouteDefinition.filterByContext}. */
|
|
194
|
+
filterByContext?: string;
|
|
195
|
+
/** ENTITY only, with `requiresContext`: see {@link RouteDefinition.contextPath}. */
|
|
196
|
+
contextPath?: string;
|
|
128
197
|
}
|
|
129
198
|
/**
|
|
130
199
|
* One navigable route. **Flat: a route has no children.** `path` may be multi-segment, so `claims`,
|
|
@@ -149,6 +218,11 @@ export declare class RouteDefinition implements BaseEntity {
|
|
|
149
218
|
icon?: string;
|
|
150
219
|
/** Empty or absent means any authenticated member of the organization, as on {@link NavItem.roles}. */
|
|
151
220
|
roles?: string[];
|
|
221
|
+
/**
|
|
222
|
+
* Name of a {@link WorkingContextRow} the route needs. The route is then served below `ctx/<name>/<id>/` and,
|
|
223
|
+
* opened without an active entity, shows a "Select a …" empty state with the picker instead of the screen.
|
|
224
|
+
*/
|
|
225
|
+
requiresContext?: string;
|
|
152
226
|
/**
|
|
153
227
|
* Required by the contract, but undefined while a route is being created — the dropdown is declared
|
|
154
228
|
* `required`, so the form is what enforces it before the row reaches the payload.
|
|
@@ -160,10 +234,46 @@ export declare class RouteDefinition implements BaseEntity {
|
|
|
160
234
|
entityName?: string;
|
|
161
235
|
entityMode?: EntityMode;
|
|
162
236
|
rsqlFilter?: string;
|
|
237
|
+
/**
|
|
238
|
+
* With `requiresContext` on an ENTITY route: the attribute of the context's entity whose embedded collection the
|
|
239
|
+
* route lists, `entityName` being the items' type. Adding, editing and removing an item then acts on the **active**
|
|
240
|
+
* entity of the context — no selection, and no form of the whole entity.
|
|
241
|
+
*/
|
|
242
|
+
contextPath?: string;
|
|
243
|
+
/**
|
|
244
|
+
* ENTITY + LIST: the working context the list may be narrowed to. The route does not require the context — an optional
|
|
245
|
+
* view, shown with a toggle "only the active …" that filters the list by `<context name> == <active id>` while it is on.
|
|
246
|
+
*/
|
|
247
|
+
filterByContext?: string;
|
|
163
248
|
/** The object the flattened fields came from, preserved so a save cannot drop a future field. */
|
|
164
249
|
target?: RouteTarget;
|
|
165
250
|
constructor(init?: Partial<RouteDefinition>);
|
|
166
251
|
}
|
|
252
|
+
/**
|
|
253
|
+
* One working context of the app, as the form edits it: `picker` and `display` flattened onto the row, because a
|
|
254
|
+
* descriptor addresses one property rather than a path, and `confirmSwitchWhen` reduced to the one condition the
|
|
255
|
+
* form offers — the states that make leaving the entity ask first. {@link source} keeps the object the row came
|
|
256
|
+
* from, so a save cannot drop what no control writes.
|
|
257
|
+
*
|
|
258
|
+
* A class rather than an interface for the reason {@link NavItem} is one: the `Add` action mints a blank row.
|
|
259
|
+
*/
|
|
260
|
+
declare class WorkingContextRow implements BaseEntity {
|
|
261
|
+
/** The contract gives a context no `id`: `name` identifies it, as `moduleKey` does a mount. */
|
|
262
|
+
readonly id?: string;
|
|
263
|
+
name: string;
|
|
264
|
+
entityName: string;
|
|
265
|
+
parent?: string;
|
|
266
|
+
basePath?: string;
|
|
267
|
+
persist?: WorkingContextPersistence;
|
|
268
|
+
pickerSearchFields?: string[];
|
|
269
|
+
pickerRecent?: number;
|
|
270
|
+
displayLabel?: string;
|
|
271
|
+
displayBadge?: string;
|
|
272
|
+
displayExtra?: string;
|
|
273
|
+
confirmSwitchStates?: string[];
|
|
274
|
+
source?: WorkingContextDefinition;
|
|
275
|
+
constructor(init?: Partial<WorkingContextRow>);
|
|
276
|
+
}
|
|
167
277
|
/**
|
|
168
278
|
* Mounts a module's routes under {@link basePath}. The one place route structure composes, and it
|
|
169
279
|
* composes exactly one level deep: a module cannot mount modules.
|
|
@@ -201,6 +311,14 @@ export declare class AppDefinition implements BaseEntity {
|
|
|
201
311
|
regions: RegionDefinition[] | undefined;
|
|
202
312
|
routes: RouteDefinition[] | undefined;
|
|
203
313
|
modules: ModuleMount[] | undefined;
|
|
314
|
+
/** Working contexts routes may require, with `picker` / `display` flattened for the form. */
|
|
315
|
+
contexts: WorkingContextRow[] | undefined;
|
|
316
|
+
/**
|
|
317
|
+
* The mounted modules themselves, as the `/layout` read carries them: the released rows with the published
|
|
318
|
+
* revision, the drafts with the draft. Read-only, never saved, and `undefined` on the designer's own read —
|
|
319
|
+
* which is how the route builder tells a layout that brought its modules from a definition that did not.
|
|
320
|
+
*/
|
|
321
|
+
mountedModules: ModuleDefinition[] | undefined;
|
|
204
322
|
orgKey: string | undefined;
|
|
205
323
|
status: AppDefinitionStatus | undefined;
|
|
206
324
|
version: number | undefined;
|
|
@@ -210,57 +328,301 @@ export declare class AppDefinition implements BaseEntity {
|
|
|
210
328
|
constructor(init?: Partial<AppDefinition>);
|
|
211
329
|
}
|
|
212
330
|
/**
|
|
213
|
-
* Frontend
|
|
214
|
-
*
|
|
215
|
-
*
|
|
216
|
-
*
|
|
217
|
-
* **What "lazy" honestly means.** A module lazy-loads *metadata* — this definition, its routes, its
|
|
218
|
-
* translations, and the documents and descriptors they name. It does **not** lazy-load widget code:
|
|
219
|
-
* widget components are bundled at compile time and resolved through the frontend registry, so a
|
|
220
|
-
* metadata module cannot split a bundle on its own. The wins are that `AppDefinition` stops being one
|
|
221
|
-
* aggregate that has to be loaded, locked and published atomically, and that a module is the unit of
|
|
222
|
-
* authoring permission and versioning. Nothing here should be justified on bundle size.
|
|
223
|
-
*
|
|
224
|
-
* Unlike the region / route / mount classes this one is a **routable** entity: it has endpoints of its
|
|
225
|
-
* own, so it comes with a service, a store and a facade rather than travelling inside another payload.
|
|
331
|
+
* Frontend models of the module-translation schemas of `base-app-api.yaml`. The app is not a translation
|
|
332
|
+
* editor: a user downloads the prepared files, translates off-line and uploads them again, so what the
|
|
333
|
+
* frontend knows of translations is how far each language is covered and what an upload stored.
|
|
226
334
|
*/
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
335
|
+
/** How much of a module one language covers; the default language is complete by definition. */
|
|
336
|
+
interface ModuleTranslationCoverage {
|
|
337
|
+
readonly locale: string;
|
|
338
|
+
readonly defaultLocale: boolean;
|
|
339
|
+
readonly keyCount: number;
|
|
340
|
+
readonly translatedCount: number;
|
|
341
|
+
readonly missingKeys: string[];
|
|
342
|
+
}
|
|
343
|
+
/** What an upload stored for one language: every key of the file, reported by how it relates to what the module authors. */
|
|
344
|
+
interface ModuleTranslationUploadLanguage {
|
|
345
|
+
readonly locale: string;
|
|
346
|
+
readonly storedKeys: number;
|
|
347
|
+
/** Keys of the file the module does not author itself — the texts its widgets name under its scope; stored like the rest. */
|
|
348
|
+
readonly additionalKeys: string[];
|
|
349
|
+
readonly missingKeys: string[];
|
|
350
|
+
/** Stored keys whose value still equals the authored text. */
|
|
351
|
+
readonly untranslatedKeys: string[];
|
|
352
|
+
}
|
|
353
|
+
interface ModuleTranslationUploadReport {
|
|
354
|
+
readonly languages: ModuleTranslationUploadLanguage[];
|
|
355
|
+
}
|
|
356
|
+
/** The stored bundle of one module, language and channel: keys relative to the module's transloco scope. */
|
|
357
|
+
type ModuleTranslationBundle = Record<string, string>;
|
|
358
|
+
/**
|
|
359
|
+
* REST access to the prepared translation files of a module, under `/organizations/{orgKey}/modules/{key}`.
|
|
360
|
+
* A service of its own rather than more methods on `ModuleDefinitionService`: those would inherit the JSON
|
|
361
|
+
* `Content-Type` header of the generic CRUD client, which is wrong for a multipart upload and a zip download.
|
|
362
|
+
*/
|
|
363
|
+
export declare class ModuleTranslationService {
|
|
364
|
+
private readonly http;
|
|
365
|
+
private readonly runtimeConfiguration;
|
|
366
|
+
/** The draft's coverage of every supported language. */
|
|
367
|
+
coverage(moduleKey: string): Observable<ModuleTranslationCoverage[]>;
|
|
368
|
+
/** The zip of one prepared `<language>.json` per supported language. */
|
|
369
|
+
download(moduleKey: string): Observable<Blob>;
|
|
370
|
+
/** Stores the translated files — the zip, or one `<language>.json` — onto the draft. */
|
|
371
|
+
upload(moduleKey: string, file: File): Observable<ModuleTranslationUploadReport>;
|
|
241
372
|
/**
|
|
242
|
-
*
|
|
243
|
-
* the
|
|
373
|
+
* What the module's transloco scope loads for one language: the stored translations only, keys relative
|
|
374
|
+
* to the scope. `released` is the running application's read, `draft` the designer's.
|
|
244
375
|
*/
|
|
245
|
-
|
|
376
|
+
bundle(moduleKey: string, locale: string, revision: 'draft' | 'released'): Observable<ModuleTranslationBundle>;
|
|
377
|
+
private moduleUrl;
|
|
378
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ModuleTranslationService, never>;
|
|
379
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
380
|
+
}
|
|
381
|
+
/** Frontend model of `ModuleAssetInfo` in `base-app-api.yaml`, which app assets share: one file an application brings along, without its bytes. */
|
|
382
|
+
interface AppAsset {
|
|
383
|
+
/** Relative to the application, e.g. `cards/plan-race.svg`; what a widget names as `app:<path>`. */
|
|
384
|
+
readonly path: string;
|
|
385
|
+
readonly mimeType: string;
|
|
386
|
+
/** Bytes. */
|
|
387
|
+
readonly size: number;
|
|
388
|
+
/** Hex SHA-256 of the content. */
|
|
389
|
+
readonly sha256: string;
|
|
390
|
+
}
|
|
391
|
+
/**
|
|
392
|
+
* REST access to the assets of an application, under `/organizations/{orgKey}/app-definitions/{appId}/assets`. A
|
|
393
|
+
* service of its own, for the reason {@link ModuleAssetService} is: the generic CRUD client sends a JSON
|
|
394
|
+
* `Content-Type`, which is wrong for a multipart upload and for a file download.
|
|
395
|
+
*/
|
|
396
|
+
export declare class AppAssetService {
|
|
397
|
+
private readonly http;
|
|
398
|
+
private readonly runtimeConfiguration;
|
|
399
|
+
list(appId: string, revision?: 'draft' | 'released'): Observable<AppAsset[]>;
|
|
400
|
+
/** Adds the file to the application draft under `path`, replacing the asset already there; its own name when `path` is empty. */
|
|
401
|
+
upload(appId: string, file: File, path?: string): Observable<AppAsset>;
|
|
402
|
+
remove(appId: string, path: string): Observable<void>;
|
|
403
|
+
/** The bytes of one asset. Through `HttpClient`, so that the bearer token goes with it. */
|
|
404
|
+
content(appId: string, path: string, revision: 'draft' | 'released'): Observable<Blob>;
|
|
405
|
+
private assetsUrl;
|
|
406
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AppAssetService, never>;
|
|
407
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
408
|
+
}
|
|
409
|
+
/** One file an owner brings along, as the list endpoint reports it. */
|
|
410
|
+
interface OwnedAsset {
|
|
411
|
+
readonly path: string;
|
|
412
|
+
readonly mimeType: string;
|
|
413
|
+
readonly size: number;
|
|
414
|
+
readonly sha256: string;
|
|
415
|
+
}
|
|
416
|
+
/** What the Assets section needs of the service behind it: a module's or an application's. */
|
|
417
|
+
interface OwnedAssetService {
|
|
418
|
+
list(ownerKey: string): Observable<OwnedAsset[]>;
|
|
419
|
+
upload(ownerKey: string, file: File, path?: string): Observable<OwnedAsset>;
|
|
420
|
+
remove(ownerKey: string, path: string): Observable<void>;
|
|
421
|
+
}
|
|
422
|
+
/**
|
|
423
|
+
* The logic of an Assets section: the files an owner — a module or an application — brings along, listed with
|
|
424
|
+
* their path, type and size, and added one by one, never as an archive. A widget names one as `<scheme>:<path>`.
|
|
425
|
+
*
|
|
426
|
+
* Offered once the owner is saved, since an asset belongs to the stored draft. Each upload goes to the folder the
|
|
427
|
+
* user typed (empty: the owner's root), under the file's own name.
|
|
428
|
+
*/
|
|
429
|
+
declare abstract class AssetsControlBase<Entity extends BaseEntity> extends BaseFormControlComponent<Entity> implements OnInit {
|
|
430
|
+
/** Key root of the section's own words. */
|
|
431
|
+
protected abstract readonly scope: string;
|
|
432
|
+
/** What a widget writes before the path: `module` or `app`. */
|
|
433
|
+
protected abstract readonly scheme: string;
|
|
434
|
+
/** Prefix of the section's test ids. */
|
|
435
|
+
protected abstract readonly testIdPrefix: string;
|
|
436
|
+
protected abstract readonly service: OwnedAssetService;
|
|
437
|
+
private readonly destroyRef;
|
|
438
|
+
private readonly savedKey;
|
|
439
|
+
/** The key of the stored owner, once there is one. */
|
|
440
|
+
protected readonly ownerKey: import("@angular/core").Signal<string | undefined>;
|
|
441
|
+
protected readonly assets: import("@angular/core").WritableSignal<OwnedAsset[]>;
|
|
442
|
+
protected readonly error: import("@angular/core").WritableSignal<string | undefined>;
|
|
443
|
+
ngOnInit(): void;
|
|
444
|
+
protected sizeOf(asset: OwnedAsset): string;
|
|
445
|
+
/** Uploads each chosen file, one request apiece, into the folder typed beside the button. */
|
|
446
|
+
protected upload(ownerKey: string, input: HTMLInputElement, folder: string): void;
|
|
447
|
+
protected remove(ownerKey: string, asset: OwnedAsset): void;
|
|
448
|
+
/** Only a saved owner has a draft to hold assets; a key typed into a new form is not one. */
|
|
449
|
+
private updateKey;
|
|
450
|
+
private reload;
|
|
451
|
+
private messageOf;
|
|
452
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AssetsControlBase<any>, never>;
|
|
453
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<AssetsControlBase<any>, "ng-component", never, {}, {}, never, never, true, never>;
|
|
454
|
+
}
|
|
455
|
+
/** Key root of the control's own words. */
|
|
456
|
+
export declare const APP_ASSETS_I18N_SCOPE = "base_app.app_definition.assets_panel";
|
|
457
|
+
/** The files an application brings along — the pictures of its own pages, say; a widget names one as `app:<path>`. */
|
|
458
|
+
export declare class AppAssetsControlComponent<Entity extends BaseEntity> extends AssetsControlBase<Entity> {
|
|
459
|
+
protected readonly scope = "base_app.app_definition.assets_panel";
|
|
460
|
+
protected readonly scheme = "app";
|
|
461
|
+
protected readonly testIdPrefix = "app";
|
|
462
|
+
protected readonly service: AppAssetService;
|
|
463
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AppAssetsControlComponent<any>, never>;
|
|
464
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<AppAssetsControlComponent<any>, "pp-app-assets-control", never, {}, {}, never, never, true, never>;
|
|
465
|
+
}
|
|
466
|
+
/**
|
|
467
|
+
* Frontend models of the app-translation schemas of `base-app-api.yaml`. As for a module, the app is not a translation
|
|
468
|
+
* editor: a user downloads the files, translates off-line and uploads them again.
|
|
469
|
+
*/
|
|
470
|
+
/** What an upload stored for one language. */
|
|
471
|
+
interface AppTranslationUploadLanguage {
|
|
472
|
+
readonly locale: string;
|
|
473
|
+
readonly storedKeys: number;
|
|
474
|
+
}
|
|
475
|
+
interface AppTranslationUploadReport {
|
|
476
|
+
readonly languages: AppTranslationUploadLanguage[];
|
|
477
|
+
}
|
|
478
|
+
/** The stored bundle of one application, language and channel: flat keys, whatever the application's widgets name. */
|
|
479
|
+
type AppTranslationBundle = Record<string, string>;
|
|
480
|
+
/**
|
|
481
|
+
* REST access to the translation files of an application, under `/organizations/{orgKey}/app-definitions/{appId}`.
|
|
482
|
+
* A service of its own, for the reason {@link ModuleTranslationService} is: the generic CRUD client sends a JSON
|
|
483
|
+
* `Content-Type`, which is wrong for a multipart upload and a zip download.
|
|
484
|
+
*/
|
|
485
|
+
export declare class AppTranslationService {
|
|
486
|
+
private readonly http;
|
|
487
|
+
private readonly runtimeConfiguration;
|
|
488
|
+
/** The zip of one `<language>.json` per supported language, holding what the draft has stored. */
|
|
489
|
+
download(appId: string): Observable<Blob>;
|
|
490
|
+
/** Stores the translated files — the zip, or one `<language>.json` — onto the draft, replacing each language they name. */
|
|
491
|
+
upload(appId: string, file: File): Observable<AppTranslationUploadReport>;
|
|
492
|
+
/** Removes the draft bundle of one language. */
|
|
493
|
+
remove(appId: string, locale: string): Observable<void>;
|
|
246
494
|
/**
|
|
247
|
-
* The
|
|
248
|
-
* same derived nesting as `AppDefinition.routes`, and flattened by the same mapper. A module does not
|
|
249
|
-
* mount modules: this is where composition stops.
|
|
495
|
+
* The stored texts of one language, flat. `released` is the running application's read, `draft` the designer's.
|
|
250
496
|
*/
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
497
|
+
bundle(appId: string, locale: string, revision: 'draft' | 'released'): Observable<AppTranslationBundle>;
|
|
498
|
+
private translationsUrl;
|
|
499
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AppTranslationService, never>;
|
|
500
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
501
|
+
}
|
|
502
|
+
/** Key root of the control's own words. */
|
|
503
|
+
export declare const APP_TRANSLATIONS_I18N_SCOPE = "base_app.app_definition.translations_panel";
|
|
504
|
+
/** One language the draft holds texts for, its keys sorted so the list reads the same every time. */
|
|
505
|
+
interface StoredLanguage {
|
|
506
|
+
readonly locale: string;
|
|
507
|
+
readonly texts: Record<string, string>;
|
|
508
|
+
readonly keys: string[];
|
|
257
509
|
}
|
|
258
510
|
/**
|
|
259
|
-
*
|
|
260
|
-
*
|
|
261
|
-
*
|
|
511
|
+
* Where the user fetches and returns the texts of the application's own pages. *Download* gives one file per
|
|
512
|
+
* supported language holding what is stored (an empty one for a language nothing is stored for), the user fills them
|
|
513
|
+
* in off-line, and *Upload* takes them back. Unlike a module's, the keys are not derived from the definition: they are
|
|
514
|
+
* whatever the application's widgets name under their `translocoPrefix`, so the section shows what is stored: each
|
|
515
|
+
* language that holds texts, with its count, and — on a click — its keys and texts, read-only.
|
|
516
|
+
*
|
|
517
|
+
* There is no endpoint listing the stored languages, and none is needed: the draft bundle of a language answers an
|
|
518
|
+
* empty object when nothing is stored, so each language the application offers is read and the empty ones are left
|
|
519
|
+
* out. A failed read counts as empty — the list is a view, and Download still gives the authoritative files.
|
|
520
|
+
*
|
|
521
|
+
* Offered once the application is saved, since the texts belong to the stored draft.
|
|
262
522
|
*/
|
|
263
|
-
export declare
|
|
523
|
+
export declare class AppTranslationsControlComponent<Entity extends BaseEntity> extends BaseFormControlComponent<Entity> implements OnInit {
|
|
524
|
+
protected readonly scope = "base_app.app_definition.translations_panel";
|
|
525
|
+
private readonly translations;
|
|
526
|
+
private readonly transloco;
|
|
527
|
+
private readonly destroyRef;
|
|
528
|
+
private readonly savedId;
|
|
529
|
+
private reading?;
|
|
530
|
+
/** The id of the stored application, once there is one. */
|
|
531
|
+
protected readonly appId: import("@angular/core").Signal<string | undefined>;
|
|
532
|
+
protected readonly report: import("@angular/core").WritableSignal<AppTranslationUploadReport | undefined>;
|
|
533
|
+
protected readonly error: import("@angular/core").WritableSignal<string | undefined>;
|
|
534
|
+
/** The languages holding texts; `undefined` until the first read answers. */
|
|
535
|
+
protected readonly stored: import("@angular/core").WritableSignal<StoredLanguage[] | undefined>;
|
|
536
|
+
protected readonly selected: import("@angular/core").WritableSignal<string | undefined>;
|
|
537
|
+
protected readonly selectedLanguage: import("@angular/core").Signal<StoredLanguage | undefined>;
|
|
538
|
+
ngOnInit(): void;
|
|
539
|
+
protected download(appId: string): void;
|
|
540
|
+
protected upload(appId: string, input: HTMLInputElement): void;
|
|
541
|
+
/** Only a saved application has a draft to hold the texts; an id typed into a new form is not one. */
|
|
542
|
+
private updateId;
|
|
543
|
+
/** Shows a language's texts, or hides them when it is the one already shown. */
|
|
544
|
+
protected toggle(locale: string): void;
|
|
545
|
+
/** Reads the draft bundle of every offered language; a newer read replaces one still under way. */
|
|
546
|
+
private readStored;
|
|
547
|
+
private readLanguage;
|
|
548
|
+
/** The languages the application is offered in, the fallback one included, in the configured order. */
|
|
549
|
+
private languages;
|
|
550
|
+
private save;
|
|
551
|
+
private messageOf;
|
|
552
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AppTranslationsControlComponent<any>, never>;
|
|
553
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<AppTranslationsControlComponent<any>, "pp-app-translations-control", never, {}, {}, never, never, true, never>;
|
|
554
|
+
}
|
|
555
|
+
/** Frontend model of `ModuleAssetInfo` in `base-app-api.yaml`: one file a module brings along, without its bytes. */
|
|
556
|
+
interface ModuleAsset {
|
|
557
|
+
/** Relative to the module, e.g. `docs/img/flow.png`; what a widget names as `module:<path>`. */
|
|
558
|
+
readonly path: string;
|
|
559
|
+
readonly mimeType: string;
|
|
560
|
+
/** Bytes. */
|
|
561
|
+
readonly size: number;
|
|
562
|
+
/** Hex SHA-256 of the content. */
|
|
563
|
+
readonly sha256: string;
|
|
564
|
+
}
|
|
565
|
+
/**
|
|
566
|
+
* REST access to the assets of a module, under `/organizations/{orgKey}/modules/{key}/assets`. A service of its
|
|
567
|
+
* own, for the reason `ModuleTranslationService` is: the generic CRUD client sends a JSON `Content-Type`, which is
|
|
568
|
+
* wrong for a multipart upload and for a file download.
|
|
569
|
+
*/
|
|
570
|
+
export declare class ModuleAssetService {
|
|
571
|
+
private readonly http;
|
|
572
|
+
private readonly runtimeConfiguration;
|
|
573
|
+
list(moduleKey: string, revision?: 'draft' | 'released'): Observable<ModuleAsset[]>;
|
|
574
|
+
/** Adds the file to the module draft under `path`, replacing the asset already there; its own name when `path` is empty. */
|
|
575
|
+
upload(moduleKey: string, file: File, path?: string): Observable<ModuleAsset>;
|
|
576
|
+
remove(moduleKey: string, path: string): Observable<void>;
|
|
577
|
+
/** The bytes of one asset. Through `HttpClient`, so that the bearer token goes with it. */
|
|
578
|
+
content(moduleKey: string, path: string, revision: 'draft' | 'released'): Observable<Blob>;
|
|
579
|
+
private assetsUrl;
|
|
580
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ModuleAssetService, never>;
|
|
581
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
582
|
+
}
|
|
583
|
+
/** Key root of the control's own words. */
|
|
584
|
+
export declare const MODULE_ASSETS_I18N_SCOPE = "base_app.module_definition.assets_panel";
|
|
585
|
+
/** The files a module brings along; a widget names one as `module:<path>`, a markdown file links the others relatively. */
|
|
586
|
+
export declare class ModuleAssetsControlComponent<Entity extends BaseEntity> extends AssetsControlBase<Entity> {
|
|
587
|
+
protected readonly scope = "base_app.module_definition.assets_panel";
|
|
588
|
+
protected readonly scheme = "module";
|
|
589
|
+
protected readonly testIdPrefix = "module";
|
|
590
|
+
protected readonly service: ModuleAssetService;
|
|
591
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ModuleAssetsControlComponent<any>, never>;
|
|
592
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<ModuleAssetsControlComponent<any>, "pp-module-assets-control", never, {}, {}, never, never, true, never>;
|
|
593
|
+
}
|
|
594
|
+
/** Key root of the control's own words. */
|
|
595
|
+
export declare const MODULE_TRANSLATIONS_I18N_SCOPE = "base_app.module_definition.translations_panel";
|
|
596
|
+
/**
|
|
597
|
+
* Where the user fetches and returns the module's translation files. The app is deliberately not a
|
|
598
|
+
* translation editor: *Download* prepares one file per supported language holding every translatable item
|
|
599
|
+
* of the module, the user translates them off-line, and *Upload* takes them back. What the section shows is
|
|
600
|
+
* how far each language is covered, and — after an upload — what was stored and what was not understood.
|
|
601
|
+
*
|
|
602
|
+
* Offered once the module is saved: the files are prepared from the stored draft, so for a module that has
|
|
603
|
+
* only been typed into the form there is nothing yet to prepare them from.
|
|
604
|
+
*/
|
|
605
|
+
export declare class ModuleTranslationsControlComponent<Entity extends BaseEntity> extends BaseFormControlComponent<Entity> implements OnInit {
|
|
606
|
+
protected readonly scope = "base_app.module_definition.translations_panel";
|
|
607
|
+
private readonly translations;
|
|
608
|
+
private readonly destroyRef;
|
|
609
|
+
private readonly savedKey;
|
|
610
|
+
/** The key of the stored module, once there is one. */
|
|
611
|
+
protected readonly moduleKey: import("@angular/core").Signal<string | undefined>;
|
|
612
|
+
protected readonly coverage: import("@angular/core").WritableSignal<ModuleTranslationCoverage[]>;
|
|
613
|
+
protected readonly report: import("@angular/core").WritableSignal<ModuleTranslationUploadReport | undefined>;
|
|
614
|
+
protected readonly error: import("@angular/core").WritableSignal<string | undefined>;
|
|
615
|
+
ngOnInit(): void;
|
|
616
|
+
protected download(moduleKey: string): void;
|
|
617
|
+
protected upload(moduleKey: string, input: HTMLInputElement): void;
|
|
618
|
+
/** Only a saved module has a draft to prepare the files from; a key typed into a new form is not one. */
|
|
619
|
+
private updateKey;
|
|
620
|
+
private loadCoverage;
|
|
621
|
+
private save;
|
|
622
|
+
private messageOf;
|
|
623
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ModuleTranslationsControlComponent<any>, never>;
|
|
624
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<ModuleTranslationsControlComponent<any>, "pp-module-translations-control", never, {}, {}, never, never, true, never>;
|
|
625
|
+
}
|
|
264
626
|
/**
|
|
265
627
|
* Transloco scope of this library. The translations live in
|
|
266
628
|
* `libs/js-shared/base-app-frontend/src/assets/i18n/base_app/*.json` and are published with the
|
|
@@ -272,15 +634,6 @@ export declare function moduleTranslocoScope(definition: ModuleDefinition): stri
|
|
|
272
634
|
* `base_app` into `baseApp` and silently miss every key below.
|
|
273
635
|
*/
|
|
274
636
|
export declare const BASE_APP_TRANSLOCO_SCOPE = "base_app";
|
|
275
|
-
/**
|
|
276
|
-
* Scope of the generic framework labels (`base_entity.tabs.*`, `base_entity.toolbar.*`), whose files
|
|
277
|
-
* base-entity owns. It has to be registered next to {@link BASE_APP_TRANSLOCO_SCOPE} wherever the
|
|
278
|
-
* generic screens are hosted: `BaseEntityTabsComponent` translates from it through `TranslocoPipe`,
|
|
279
|
-
* which caches the value it resolved for a key on first render. If only `base_app` were loaded, the
|
|
280
|
-
* tabs would keep the raw key even after the toolbar — which registers this scope for itself —
|
|
281
|
-
* triggers the load.
|
|
282
|
-
*/
|
|
283
|
-
declare const BASE_ENTITY_TRANSLOCO_SCOPE = "base_entity";
|
|
284
637
|
/** Key root of the `AppDefinition` entity name (`._self`) and of its attribute labels. */
|
|
285
638
|
export declare const APP_DEFINITION_I18N_SCOPE = "base_app.app_definition";
|
|
286
639
|
/**
|
|
@@ -308,9 +661,6 @@ export declare const APP_ROUTE_I18N_SCOPE = "base_app.app_route";
|
|
|
308
661
|
export declare const APP_MODULE_MOUNT_I18N_SCOPE = "base_app.app_module_mount";
|
|
309
662
|
export declare const APP_NAV_ITEM_I18N_SCOPE = "base_app.app_nav_item";
|
|
310
663
|
export declare const APP_WIDGET_I18N_SCOPE = "base_app.app_widget";
|
|
311
|
-
/** Keys of the `Publish` form action contributed by `AppDefinitionContainerComponent`. */
|
|
312
|
-
declare const PUBLISH_BUTTON_I18N_KEY = "base_app.publish.button";
|
|
313
|
-
declare const PUBLISH_TOOLTIP_I18N_KEY = "base_app.publish.tooltip";
|
|
314
664
|
/**
|
|
315
665
|
* Where this library's transloco bundles come from when the application ships without its assets.
|
|
316
666
|
*
|
|
@@ -364,8 +714,19 @@ export declare function createRegionDefinitionDescriptor(): BaseEntityDescriptor
|
|
|
364
714
|
*/
|
|
365
715
|
export declare const APP_ROUTE_ID_FIELD = "path";
|
|
366
716
|
export declare function createRouteDefinitionDescriptor(): BaseEntityDescriptor;
|
|
367
|
-
|
|
717
|
+
/**
|
|
718
|
+
* @param widgetTypes the options of the `type` dropdown — see {@link widgetTypeSelectables}. Without them the
|
|
719
|
+
* dropdown is empty, as it should be where no widget is registered: none could render.
|
|
720
|
+
*/
|
|
721
|
+
export declare function createWidgetInstanceDescriptor(widgetTypes?: SelectablesInput): BaseEntityDescriptor;
|
|
722
|
+
/**
|
|
723
|
+
* The registered widget types as dropdown options, sorted alphabetically using the current locale. `key` and `value` are both the registry key,
|
|
724
|
+
* because the dropdown stores and displays `value` — a display name there would be saved as the type.
|
|
725
|
+
*/
|
|
726
|
+
export declare function widgetTypeSelectables(registry: ReadonlyMap<string, WidgetRegistration>): Selectable[];
|
|
368
727
|
export declare function createModuleDefinitionDescriptor(): BaseEntityDescriptor;
|
|
728
|
+
/** Lifts `picker` / `display` / `confirmSwitchWhen` onto the row, where a form control can reach them. */
|
|
729
|
+
declare function flattenWorkingContext(dto: WorkingContextDefinition): WorkingContextRow;
|
|
369
730
|
/** The `RouteDefinition` schema as it travels: `target` nested, exactly as the contract declares it. */
|
|
370
731
|
interface RouteDefinitionDto {
|
|
371
732
|
path?: string;
|
|
@@ -373,30 +734,9 @@ interface RouteDefinitionDto {
|
|
|
373
734
|
translocoId?: string;
|
|
374
735
|
icon?: string;
|
|
375
736
|
roles?: string[];
|
|
737
|
+
requiresContext?: string;
|
|
376
738
|
target?: RouteTarget;
|
|
377
739
|
}
|
|
378
|
-
/**
|
|
379
|
-
* The `target` flattening both aggregates that own routes need — `AppDefinition.routes` and
|
|
380
|
-
* `ModuleDefinition.routes` carry the same schema, and a route authored in a module has to behave
|
|
381
|
-
* exactly like one authored in an app.
|
|
382
|
-
*
|
|
383
|
-
* Why flatten at all: `EMBEDDED_COMPONENTS` edits a row as the flat JSON it arrived as, and a descriptor
|
|
384
|
-
* addresses one property rather than a path, so nothing in the generated form could reach
|
|
385
|
-
* `target.documentSlug`. The contract already keeps `RouteTarget` flat rather than a `oneOf` for the
|
|
386
|
-
* related reason that the form cannot edit a discriminated union of classes.
|
|
387
|
-
*/
|
|
388
|
-
declare function flattenRouteTarget(dto: RouteDefinitionDto): RouteDefinition;
|
|
389
|
-
/**
|
|
390
|
-
* The inverse. `kind` is non-optional in the contract but undefined on a row the designer has not
|
|
391
|
-
* finished — the dropdown is `required`, so the form rejects that before a save; the cast keeps this
|
|
392
|
-
* mapping from having to invent a default the backend would then have to second-guess.
|
|
393
|
-
*
|
|
394
|
-
* `widgets` is omitted when empty rather than sent as `[]`, so a DOCUMENT or ENTITY route does not
|
|
395
|
-
* persist an empty widget list it has no use for. The rest is merged onto the `target` the fields were
|
|
396
|
-
* lifted out of, which preserves any field a later contract version adds before this mapping learns
|
|
397
|
-
* about it — a PUT is a full replacement, so anything dropped here is dropped for good.
|
|
398
|
-
*/
|
|
399
|
-
declare function nestRouteTarget(route: RouteDefinition): RouteDefinitionDto;
|
|
400
740
|
interface AppDefinitionDto {
|
|
401
741
|
id?: string;
|
|
402
742
|
name?: string;
|
|
@@ -407,6 +747,9 @@ interface AppDefinitionDto {
|
|
|
407
747
|
regions?: AppDefinition['regions'];
|
|
408
748
|
routes?: RouteDefinitionDto[];
|
|
409
749
|
modules?: AppDefinition['modules'];
|
|
750
|
+
contexts?: Parameters<typeof flattenWorkingContext>[0][];
|
|
751
|
+
/** `/layout` only. */
|
|
752
|
+
mountedModules?: unknown[];
|
|
410
753
|
orgKey?: string;
|
|
411
754
|
status?: AppDefinitionStatus;
|
|
412
755
|
version?: number;
|
|
@@ -436,6 +779,7 @@ type AppDefinitionPayload = AppDefinitionDto & {
|
|
|
436
779
|
* schema and a route authored in a module has to behave exactly like one authored in an app.
|
|
437
780
|
*/
|
|
438
781
|
export declare class AppDefinitionMapper implements BaseEntityMapper<AppDefinition> {
|
|
782
|
+
private readonly moduleMapper;
|
|
439
783
|
fromDto(dto: unknown): AppDefinition;
|
|
440
784
|
toDto(entity: AppDefinition): AppDefinitionPayload;
|
|
441
785
|
private mergeTheme;
|
|
@@ -458,33 +802,17 @@ export declare class AppDefinitionService extends BaseEntityRestService<AppDefin
|
|
|
458
802
|
* is not publishable, so the caller only has to deal with the happy path and the error.
|
|
459
803
|
*/
|
|
460
804
|
publish(id: string): Observable<PersistedEntity<AppDefinition>>;
|
|
805
|
+
/**
|
|
806
|
+
* `GET /app-definitions/{appId}/layout` — the **published** revision, role-filtered, with its routes:
|
|
807
|
+
* what the runtime host renders. `findById` is the designer's read and always returns the draft.
|
|
808
|
+
*
|
|
809
|
+
* Resolves to `undefined` while the application has never been published, which the backend answers
|
|
810
|
+
* with 404. That is the state of every new organization, so it is not reported as an error.
|
|
811
|
+
*/
|
|
812
|
+
findPublished(id: string): Observable<AppDefinition | undefined>;
|
|
461
813
|
static ɵfac: i0.ɵɵFactoryDeclaration<AppDefinitionService, never>;
|
|
462
814
|
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
463
815
|
}
|
|
464
|
-
/** The slice of `BaseEntityStore`'s state that {@link AppDefinitionPublishStore} reads and patches. */
|
|
465
|
-
type PublishableState = {
|
|
466
|
-
entities: AppDefinition[];
|
|
467
|
-
currentEntity: AppDefinition | undefined;
|
|
468
|
-
isLoading: boolean;
|
|
469
|
-
error: string | undefined;
|
|
470
|
-
};
|
|
471
|
-
/**
|
|
472
|
-
* Adds the `publish` use case on top of the generic CRUD store. It keeps the same contract as
|
|
473
|
-
* `addEntity` / `updateEntity`: flip `isLoading`, replace the entity in the list with the server's
|
|
474
|
-
* answer so the form's read-only `status` / `publishedVersion` fields refresh, and surface failures
|
|
475
|
-
* through `error` rather than by throwing.
|
|
476
|
-
*/
|
|
477
|
-
declare function AppDefinitionPublishStore(): import("@ngrx/signals").SignalStoreFeature<{
|
|
478
|
-
state: PublishableState;
|
|
479
|
-
props: {};
|
|
480
|
-
methods: {};
|
|
481
|
-
}, {
|
|
482
|
-
state: {};
|
|
483
|
-
props: {};
|
|
484
|
-
methods: {
|
|
485
|
-
publish: (id: string) => Promise<PersistedEntity<AppDefinition> | undefined>;
|
|
486
|
-
};
|
|
487
|
-
}>;
|
|
488
816
|
export declare const AppDefinitionStore: import("@angular/core").Type<{
|
|
489
817
|
entities: import("@angular/core").Signal<AppDefinition[]>;
|
|
490
818
|
number: import("@angular/core").Signal<number>;
|
|
@@ -496,6 +824,7 @@ export declare const AppDefinitionStore: import("@angular/core").Type<{
|
|
|
496
824
|
isLoading: import("@angular/core").Signal<boolean>;
|
|
497
825
|
error: import("@angular/core").Signal<string | undefined>;
|
|
498
826
|
selectedEntities: import("@angular/core").Signal<AppDefinition[]>;
|
|
827
|
+
stagedIds: import("@angular/core").Signal<string[]>;
|
|
499
828
|
activeTabs: import("@angular/core").Signal<string[]>;
|
|
500
829
|
currentTab: import("@angular/core").Signal<string | undefined>;
|
|
501
830
|
filterKey: import("@angular/core").Signal<string | undefined>;
|
|
@@ -505,14 +834,18 @@ export declare const AppDefinitionStore: import("@angular/core").Type<{
|
|
|
505
834
|
createEntity: () => AppDefinition;
|
|
506
835
|
add: (entity: AppDefinition) => Promise<PersistedEntity<AppDefinition> | undefined>;
|
|
507
836
|
delete: (id: string) => Promise<void>;
|
|
837
|
+
keyOf: (entity: AppDefinition) => string | undefined;
|
|
838
|
+
hasStagedChanges: (id: string) => boolean;
|
|
508
839
|
deleteAll: import("@ngrx/signals/rxjs-interop").RxMethod<void>;
|
|
509
840
|
deselectAll: () => void;
|
|
510
841
|
deselectEntity: (id: string) => void;
|
|
511
842
|
load: import("@ngrx/signals/rxjs-interop").RxMethod<import("@processpuzzle/base-entity").BaseEntityQueryCondition>;
|
|
512
843
|
loadById: (id: string) => AppDefinition | undefined;
|
|
844
|
+
reload: (id: string) => Promise<PersistedEntity<AppDefinition> | undefined>;
|
|
513
845
|
resetErrorState: () => void;
|
|
514
846
|
selectEntity: (id: string) => void;
|
|
515
847
|
setCurrentEntity: (id: string | undefined) => void;
|
|
848
|
+
stage: (entity: PersistedEntity<AppDefinition>) => void;
|
|
516
849
|
update: (entity: PersistedEntity<AppDefinition>) => Promise<PersistedEntity<AppDefinition> | undefined>;
|
|
517
850
|
reset: () => void;
|
|
518
851
|
tabIsActive: (tabName: string) => void;
|
|
@@ -530,6 +863,7 @@ export declare const AppDefinitionStore: import("@angular/core").Type<{
|
|
|
530
863
|
isLoading: boolean;
|
|
531
864
|
error: string | undefined;
|
|
532
865
|
selectedEntities: AppDefinition[];
|
|
866
|
+
stagedIds: string[];
|
|
533
867
|
activeTabs: string[];
|
|
534
868
|
currentTab: string | undefined;
|
|
535
869
|
filterKey: string | undefined;
|
|
@@ -595,6 +929,7 @@ export declare const ModuleDefinitionStore: import("@angular/core").Type<{
|
|
|
595
929
|
isLoading: import("@angular/core").Signal<boolean>;
|
|
596
930
|
error: import("@angular/core").Signal<string | undefined>;
|
|
597
931
|
selectedEntities: import("@angular/core").Signal<ModuleDefinition[]>;
|
|
932
|
+
stagedIds: import("@angular/core").Signal<string[]>;
|
|
598
933
|
activeTabs: import("@angular/core").Signal<string[]>;
|
|
599
934
|
currentTab: import("@angular/core").Signal<string | undefined>;
|
|
600
935
|
filterKey: import("@angular/core").Signal<string | undefined>;
|
|
@@ -604,14 +939,18 @@ export declare const ModuleDefinitionStore: import("@angular/core").Type<{
|
|
|
604
939
|
createEntity: () => ModuleDefinition;
|
|
605
940
|
add: (entity: ModuleDefinition) => Promise<import("@processpuzzle/base-entity").PersistedEntity<ModuleDefinition> | undefined>;
|
|
606
941
|
delete: (id: string) => Promise<void>;
|
|
942
|
+
keyOf: (entity: ModuleDefinition) => string | undefined;
|
|
943
|
+
hasStagedChanges: (id: string) => boolean;
|
|
607
944
|
deleteAll: import("@ngrx/signals/rxjs-interop").RxMethod<void>;
|
|
608
945
|
deselectAll: () => void;
|
|
609
946
|
deselectEntity: (id: string) => void;
|
|
610
947
|
load: import("@ngrx/signals/rxjs-interop").RxMethod<import("@processpuzzle/base-entity").BaseEntityQueryCondition>;
|
|
611
948
|
loadById: (id: string) => ModuleDefinition | undefined;
|
|
949
|
+
reload: (id: string) => Promise<import("@processpuzzle/base-entity").PersistedEntity<ModuleDefinition> | undefined>;
|
|
612
950
|
resetErrorState: () => void;
|
|
613
951
|
selectEntity: (id: string) => void;
|
|
614
952
|
setCurrentEntity: (id: string | undefined) => void;
|
|
953
|
+
stage: (entity: import("@processpuzzle/base-entity").PersistedEntity<ModuleDefinition>) => void;
|
|
615
954
|
update: (entity: import("@processpuzzle/base-entity").PersistedEntity<ModuleDefinition>) => Promise<import("@processpuzzle/base-entity").PersistedEntity<ModuleDefinition> | undefined>;
|
|
616
955
|
reset: () => void;
|
|
617
956
|
tabIsActive: (tabName: string) => void;
|
|
@@ -628,6 +967,7 @@ export declare const ModuleDefinitionStore: import("@angular/core").Type<{
|
|
|
628
967
|
isLoading: boolean;
|
|
629
968
|
error: string | undefined;
|
|
630
969
|
selectedEntities: ModuleDefinition[];
|
|
970
|
+
stagedIds: string[];
|
|
631
971
|
activeTabs: string[];
|
|
632
972
|
currentTab: string | undefined;
|
|
633
973
|
filterKey: string | undefined;
|
|
@@ -675,6 +1015,15 @@ export declare class AppNavItemFacade extends EmbeddedEntityFacade<NavItem> {
|
|
|
675
1015
|
static ɵfac: i0.ɵɵFactoryDeclaration<AppNavItemFacade, never>;
|
|
676
1016
|
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
677
1017
|
}
|
|
1018
|
+
/** What the builder needs to know of a context: its name, and the one it is nested in. */
|
|
1019
|
+
interface ContextRef {
|
|
1020
|
+
name: string;
|
|
1021
|
+
parent?: string;
|
|
1022
|
+
/** The context's entity type. With it, the context's route is the aggregate root of the embedded screens below it. */
|
|
1023
|
+
entityName?: string;
|
|
1024
|
+
/** What the entity is made of, for those screens; filled in by {@link buildAppRoutes} from `contextChildren`. */
|
|
1025
|
+
aggregate?: WorkingContextAggregate;
|
|
1026
|
+
}
|
|
678
1027
|
/**
|
|
679
1028
|
* What the run-time shell registers routes from. `routes` and `modules` are the app definition's own
|
|
680
1029
|
* fields; the other two are how the routes of a mounted module get in.
|
|
@@ -686,12 +1035,35 @@ export declare class AppNavItemFacade extends EmbeddedEntityFacade<NavItem> {
|
|
|
686
1035
|
*
|
|
687
1036
|
* A key present in `moduleRoutes` is never loaded again, so an empty array there says "this module has no
|
|
688
1037
|
* routes" and is honoured as such.
|
|
1038
|
+
*
|
|
1039
|
+
* `loadTranslations` is where a lazily mounted module's own translations come from; without it the module's
|
|
1040
|
+
* scope is registered with the application's default loader alone.
|
|
689
1041
|
*/
|
|
690
1042
|
interface AppRouteSource {
|
|
691
1043
|
routes?: RouteDefinition[];
|
|
692
1044
|
modules?: ModuleMount[];
|
|
1045
|
+
/** The app's working contexts. A route naming one is served below `ctx/<name>/:id/`; see {@link groupContextRoutes}. */
|
|
1046
|
+
contexts?: ContextRef[];
|
|
1047
|
+
/**
|
|
1048
|
+
* The embedded children of an entity type, as its own details route mounts them. Asked once per context that names an
|
|
1049
|
+
* entity: the rows of those children open as screens below the context's route, saved through the item endpoints.
|
|
1050
|
+
*/
|
|
1051
|
+
contextChildren?: (entityName: string) => EmbeddedChildRoute[] | Promise<EmbeddedChildRoute[]>;
|
|
693
1052
|
moduleRoutes?: Record<string, RouteDefinition[] | undefined>;
|
|
694
1053
|
loadModule?: ModuleLoader;
|
|
1054
|
+
loadTranslations?: ModuleTranslationLoader;
|
|
1055
|
+
/** The assets of a module, by key, for the widgets below its mount; without it a `module:` value resolves to nothing. */
|
|
1056
|
+
moduleAssets?: (moduleKey: string) => ModuleAssetContext;
|
|
1057
|
+
}
|
|
1058
|
+
/**
|
|
1059
|
+
* Fetches the translations of one module and language. `languages` — read when the module loads, so it may be
|
|
1060
|
+
* a getter — is what the module's scope is registered
|
|
1061
|
+
* for: transloco enumerates an inline loader's languages when the scope is registered, so a loader that
|
|
1062
|
+
* answers any language still has to name the ones it answers.
|
|
1063
|
+
*/
|
|
1064
|
+
interface ModuleTranslationLoader {
|
|
1065
|
+
readonly languages: string[];
|
|
1066
|
+
load(moduleKey: string, scope: string, locale: string): Promise<Translation>;
|
|
695
1067
|
}
|
|
696
1068
|
/**
|
|
697
1069
|
* Fetches one module by key, or resolves to `undefined` if the organization has no such module. Rejecting
|
|
@@ -794,8 +1166,6 @@ export declare class RouteWidgetsComponent {
|
|
|
794
1166
|
static ɵfac: i0.ɵɵFactoryDeclaration<RouteWidgetsComponent, never>;
|
|
795
1167
|
static ɵcmp: i0.ɵɵComponentDeclaration<RouteWidgetsComponent, "pp-route-widgets", never, {}, {}, never, never, true, never>;
|
|
796
1168
|
}
|
|
797
|
-
/** The widgets rendered in sequence — every one but those a container widget places by id. */
|
|
798
|
-
declare function standaloneWidgets(widgets: WidgetInstance$1[] | undefined): WidgetInstance$1[];
|
|
799
1169
|
/**
|
|
800
1170
|
* Renders the top-level widgets shared by routed content and static shell regions, each through
|
|
801
1171
|
* base-widget's {@link WidgetHostComponent} — which resolves the component, binds the props and shows a
|
|
@@ -859,26 +1229,31 @@ export declare class AppRouteFacade extends EmbeddedEntityFacade<RouteDefinition
|
|
|
859
1229
|
/**
|
|
860
1230
|
* A widget sits under a region, a page or another widget, and one facade serves all three: which owner's
|
|
861
1231
|
* rows its store reads is decided by the route that is open, not by the facade.
|
|
1232
|
+
*
|
|
1233
|
+
* The `type` dropdown lists the registry this facade's injector sees — widgets registered only in a lazily
|
|
1234
|
+
* loaded route below it are not offered, the same limit the props control has.
|
|
862
1235
|
*/
|
|
863
1236
|
export declare class AppWidgetFacade extends EmbeddedEntityFacade<WidgetInstance> {
|
|
864
1237
|
readonly entityType: typeof WidgetInstance;
|
|
1238
|
+
private readonly widgetRegistry;
|
|
865
1239
|
protected createDescriptor(): BaseEntityDescriptor;
|
|
866
1240
|
static ɵfac: i0.ɵɵFactoryDeclaration<AppWidgetFacade, never>;
|
|
867
1241
|
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
868
1242
|
}
|
|
1243
|
+
/**
|
|
1244
|
+
* The App Definition screens, with the Preview tab beside the form.
|
|
1245
|
+
*
|
|
1246
|
+
* There is no Publish button here any more. An application goes live together with everything it uses — its
|
|
1247
|
+
* modules, and the entities, rules and workflows its routes reach — so publishing is the organization's
|
|
1248
|
+
* release, made from the designer's Release section, not an action on one definition.
|
|
1249
|
+
*/
|
|
869
1250
|
export declare class AppDefinitionContainerComponent implements OnDestroy {
|
|
870
1251
|
private readonly containerComponentRef;
|
|
871
1252
|
baseEntityHost: BaseFormHostDirective;
|
|
872
|
-
readonly publishActionsTpl: import("@angular/core").Signal<TemplateRef<unknown> | undefined>;
|
|
873
1253
|
private readonly store;
|
|
874
1254
|
readonly entityDescriptor: BaseEntityDescriptor;
|
|
875
|
-
readonly publishButtonKey = "base_app.publish.button";
|
|
876
|
-
readonly publishTooltipKey = "base_app.publish.tooltip";
|
|
877
|
-
/** Only a definition the backend already knows can be promoted, so a not-yet-saved form cannot publish. */
|
|
878
|
-
readonly canPublish: import("@angular/core").Signal<boolean>;
|
|
879
1255
|
constructor();
|
|
880
1256
|
ngOnDestroy(): void;
|
|
881
|
-
onPublish(): Promise<void>;
|
|
882
1257
|
static ɵfac: i0.ɵɵFactoryDeclaration<AppDefinitionContainerComponent, never>;
|
|
883
1258
|
static ɵcmp: i0.ɵɵComponentDeclaration<AppDefinitionContainerComponent, "pp-app-definition-container", never, {}, {}, never, never, true, never>;
|
|
884
1259
|
}
|
|
@@ -889,7 +1264,7 @@ export declare class AppDefinitionContainerComponent implements OnDestroy {
|
|
|
889
1264
|
*
|
|
890
1265
|
* A **container and nothing more**: it resolves which definition is being previewed and frames the
|
|
891
1266
|
* result. Everything about *how* an application renders belongs to {@link AppShellComponent}, which the
|
|
892
|
-
*
|
|
1267
|
+
* runtime host mounts just as this does — so the preview cannot grow behaviour the real
|
|
893
1268
|
* shell lacks, which is the only way a preview stays honest.
|
|
894
1269
|
*
|
|
895
1270
|
* The frame below — rounded, white, and tall enough to look like an application — is the preview's own,
|
|
@@ -934,7 +1309,7 @@ interface RegionView {
|
|
|
934
1309
|
* Turns one authored `RegionDefinition` into the {@link RegionView} that renders it.
|
|
935
1310
|
*
|
|
936
1311
|
* An injectable rather than a free function, though stateless today, for the reason `AppRouteRenderer`
|
|
937
|
-
* is one: the Preview tab and the
|
|
1312
|
+
* is one: the Preview tab and the runtime host must resolve regions *identically*,
|
|
938
1313
|
* so there has to be exactly one of these, and a constructor parameter is a cheaper way to grow it than
|
|
939
1314
|
* a rewrite.
|
|
940
1315
|
*/
|
|
@@ -943,14 +1318,43 @@ export declare class AppRegionRenderer {
|
|
|
943
1318
|
static ɵfac: i0.ɵɵFactoryDeclaration<AppRegionRenderer, never>;
|
|
944
1319
|
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
945
1320
|
}
|
|
1321
|
+
/**
|
|
1322
|
+
* The shell's answer to base-widget's `SIDENAV_CONTROL`, for the `sidenav-toggle` widget. The shell owns the
|
|
1323
|
+
* drawer and writes {@link available}; the widget only flips {@link opened}, which the shell binds to it.
|
|
1324
|
+
*/
|
|
1325
|
+
declare class ShellSidenavControl implements SidenavControl {
|
|
1326
|
+
readonly available: import("@angular/core").WritableSignal<boolean>;
|
|
1327
|
+
readonly opened: import("@angular/core").WritableSignal<boolean>;
|
|
1328
|
+
toggle(): void;
|
|
1329
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ShellSidenavControl, never>;
|
|
1330
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
1331
|
+
}
|
|
1332
|
+
/**
|
|
1333
|
+
* Marks content a host projects into the end of the shell's top row: `<div ppShellActions>…</div>`.
|
|
1334
|
+
*
|
|
1335
|
+
* For controls that belong to the platform rather than to the application — signing out, switching
|
|
1336
|
+
* organization, opening the designer. They come from the host and not from a header region, because a
|
|
1337
|
+
* definition decides what its regions hold, and a definition that could drop the designer button would
|
|
1338
|
+
* let a designer lock themselves out of the designer.
|
|
1339
|
+
*
|
|
1340
|
+
* **It brings its own overlay container.** Projected content resolves its dependencies through the
|
|
1341
|
+
* injectors of the template that declared it — the host's — not through the shell's, so the shell's
|
|
1342
|
+
* {@link ShellOverlayContainer} is out of its reach: a menu opened from one of these controls would render
|
|
1343
|
+
* under `<body>` and wear the host's theme. This element is inside the shell's host, which is all a
|
|
1344
|
+
* container needs to wear the application's.
|
|
1345
|
+
*/
|
|
1346
|
+
export declare class ShellActionsDirective {
|
|
1347
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ShellActionsDirective, never>;
|
|
1348
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<ShellActionsDirective, "[ppShellActions]", never, {}, {}, never, never, true, never>;
|
|
1349
|
+
}
|
|
946
1350
|
/**
|
|
947
1351
|
* The run-time shell of a metadata-defined application: the chrome an `AppDefinition` describes, with a
|
|
948
1352
|
* `<router-outlet>` where its routes render.
|
|
949
1353
|
*
|
|
950
|
-
* **This is the application, not a picture of one.** `AppPreviewComponent` hosts it
|
|
951
|
-
* tab shows the real thing, and
|
|
952
|
-
* the whole point of it being a component with one input rather than
|
|
953
|
-
* preview. A shell built for the preview would drift from the one built for production, and a preview
|
|
1354
|
+
* **This is the application, not a picture of one.** `AppPreviewComponent` hosts it with the draft so
|
|
1355
|
+
* that the Preview tab shows the real thing, and a runtime host mounts the same component with the
|
|
1356
|
+
* published revision — which is the whole point of it being a component with one input rather than
|
|
1357
|
+
* something assembled inside the preview. A shell built for the preview would drift from the one built for production, and a preview
|
|
954
1358
|
* that drifts is worse than none.
|
|
955
1359
|
*
|
|
956
1360
|
* Everything is bound declaratively. Regions are resolved to {@link RegionView}s and rendered through
|
|
@@ -967,8 +1371,12 @@ export declare class AppRegionRenderer {
|
|
|
967
1371
|
* shell simply inherits the host's theme. Overlays opened from inside the shell render into a
|
|
968
1372
|
* {@link ShellOverlayContainer} in its host, so they are themed as well.
|
|
969
1373
|
*
|
|
970
|
-
*
|
|
971
|
-
*
|
|
1374
|
+
* The definition's routes render in the outlet once its host registers them as the children of the route
|
|
1375
|
+
* the shell is mounted on — `appShellRoutesGuard` for the Preview, `publishedAppRoutesGuard` for a runtime
|
|
1376
|
+
* host.
|
|
1377
|
+
*
|
|
1378
|
+
* A host may also project controls of its own into the end of the top row, marked {@link ShellActionsDirective}
|
|
1379
|
+
* — the platform's controls a definition must not be able to remove, such as the way into the designer.
|
|
972
1380
|
*/
|
|
973
1381
|
export declare class AppShellComponent {
|
|
974
1382
|
/**
|
|
@@ -986,14 +1394,27 @@ export declare class AppShellComponent {
|
|
|
986
1394
|
private readonly regionRenderer;
|
|
987
1395
|
private readonly theme;
|
|
988
1396
|
private readonly applicationContext;
|
|
1397
|
+
private readonly workingContext;
|
|
1398
|
+
private readonly hostRoute;
|
|
989
1399
|
protected readonly layoutService: LayoutService;
|
|
1400
|
+
protected readonly sidenavControl: ShellSidenavControl;
|
|
1401
|
+
/** Controls the host projected into the top row; the row is rendered for them alone if need be. */
|
|
1402
|
+
protected readonly hostActions: import("@angular/core").Signal<ShellActionsDirective | undefined>;
|
|
990
1403
|
protected readonly layout: import("@angular/core").Signal<import("@processpuzzle/base-app").ResolvedLayout>;
|
|
991
1404
|
protected readonly themeVars: import("@angular/core").Signal<Record<string, string>>;
|
|
992
1405
|
protected readonly themeClass: import("@angular/core").Signal<string>;
|
|
993
1406
|
private readonly applyThemeDefaults;
|
|
1407
|
+
/**
|
|
1408
|
+
* Hands the definition's working contexts to the service, with the URL the shell is mounted at in front of
|
|
1409
|
+
* each `basePath` — what lets "Set as active" on an entity's list reach the context's pages from outside them.
|
|
1410
|
+
* Re-run on every edit, and undone on destroy, so a previewed definition's contexts never outlive its preview.
|
|
1411
|
+
*/
|
|
1412
|
+
private readonly registerWorkingContexts;
|
|
1413
|
+
private readonly applySidenavDefault;
|
|
994
1414
|
private readonly regionViews;
|
|
995
1415
|
protected readonly headerView: import("@angular/core").Signal<RegionView | undefined>;
|
|
996
1416
|
protected readonly footerView: import("@angular/core").Signal<RegionView | undefined>;
|
|
1417
|
+
protected readonly statusbarView: import("@angular/core").Signal<RegionView | undefined>;
|
|
997
1418
|
/**
|
|
998
1419
|
* The nav in the sidenav, for the two sidenav presets. Split from {@link topNavView} rather than
|
|
999
1420
|
* decided in the template, so each slot is one unambiguous `@if` and the mutual exclusion is stated
|
|
@@ -1024,6 +1445,9 @@ export declare class AppShellComponent {
|
|
|
1024
1445
|
compact: boolean;
|
|
1025
1446
|
}>;
|
|
1026
1447
|
protected readonly topNavInputs: import("@angular/core").Signal<Record<string, unknown>>;
|
|
1448
|
+
private readonly syncSidenavAvailability;
|
|
1449
|
+
/** A backdrop click or Escape closes an over-mode drawer; a hide request from a page is not the user's choice. */
|
|
1450
|
+
protected onSidenavOpenedChange(opened: boolean): void;
|
|
1027
1451
|
private navInputsOf;
|
|
1028
1452
|
private viewOf;
|
|
1029
1453
|
static ɵfac: i0.ɵɵFactoryDeclaration<AppShellComponent, never>;
|
|
@@ -1038,7 +1462,7 @@ export declare class AppShellComponent {
|
|
|
1038
1462
|
"required": false;
|
|
1039
1463
|
"isSignal": true;
|
|
1040
1464
|
};
|
|
1041
|
-
}, {},
|
|
1465
|
+
}, {}, ["hostActions"], ["[ppShellActions]"], true, never>;
|
|
1042
1466
|
}
|
|
1043
1467
|
/**
|
|
1044
1468
|
* Turns one `AppDefinition` into the `Routes` that render its screens — the missing consumer of
|
|
@@ -1048,12 +1472,41 @@ export declare class AppShellComponent {
|
|
|
1048
1472
|
* "what routes does app X have", and the guard is only the two lines that hand them to Angular.
|
|
1049
1473
|
*/
|
|
1050
1474
|
export declare class AppShellRoutesFactory {
|
|
1051
|
-
private readonly
|
|
1475
|
+
private readonly injector;
|
|
1052
1476
|
private readonly appService;
|
|
1053
|
-
private readonly moduleStore;
|
|
1054
1477
|
private readonly moduleService;
|
|
1055
1478
|
private readonly renderRoute;
|
|
1479
|
+
private readonly entityScreens;
|
|
1056
1480
|
childrenOf(appId: string): Promise<Routes>;
|
|
1481
|
+
/**
|
|
1482
|
+
* The routes of a definition already in hand — the published one the runtime host fetched, or the draft
|
|
1483
|
+
* {@link childrenOf} found. One builder for both is what keeps the Preview and the live application from
|
|
1484
|
+
* rendering the same definition differently.
|
|
1485
|
+
*
|
|
1486
|
+
* A definition read through `/layout` brings its mounted modules along, from its own side — the released
|
|
1487
|
+
* modules with the published revision — and those are the only ones it mounts. Fetching a module instead
|
|
1488
|
+
* would read its draft, and the live application would show edits nobody has released.
|
|
1489
|
+
*/
|
|
1490
|
+
childrenFor(definition: AppDefinition): Promise<Routes>;
|
|
1491
|
+
/**
|
|
1492
|
+
* Where a mounted module's translations come from: whatever the application or the seeded bundles already
|
|
1493
|
+
* serve for the scope, under what the module's own uploaded files say. The shipped bundle stays underneath
|
|
1494
|
+
* so that a module translated the way every module was before files could be uploaded — a seeded
|
|
1495
|
+
* `order_admin` bundle — keeps its words.
|
|
1496
|
+
*
|
|
1497
|
+
* A language the module has nothing uploaded for answers with the shipped bundle alone, and a failed read
|
|
1498
|
+
* of the uploaded one is no reason to fail the load: the titles keep their authored text.
|
|
1499
|
+
*/
|
|
1500
|
+
private translationsOf;
|
|
1501
|
+
/**
|
|
1502
|
+
* The bundle the application ships for the scope, if it ships one. A module a Business Starter brought has only
|
|
1503
|
+
* the texts it uploaded, so there is no `assets/i18n/<scope>/<locale>.json` and the request answers 404 — which
|
|
1504
|
+
* must not fail the whole load, or the uploaded texts would never reach the module.
|
|
1505
|
+
*/
|
|
1506
|
+
private shipped;
|
|
1507
|
+
private uploaded;
|
|
1508
|
+
/** The languages transloco is configured for, the active and the fallback one included. */
|
|
1509
|
+
private languages;
|
|
1057
1510
|
/**
|
|
1058
1511
|
* Store first, endpoint second.
|
|
1059
1512
|
*
|
|
@@ -1092,6 +1545,99 @@ export declare class AppShellRoutesFactory {
|
|
|
1092
1545
|
* children on the way past.
|
|
1093
1546
|
*/
|
|
1094
1547
|
export declare const appShellRoutesGuard: CanMatchFn;
|
|
1548
|
+
/**
|
|
1549
|
+
* The published revision of the application the runtime host renders — what end users see, as opposed to
|
|
1550
|
+
* the draft the designer edits and previews.
|
|
1551
|
+
*
|
|
1552
|
+
* Held here rather than in `AppDefinitionStore`, which is the designer's store of drafts: the two are
|
|
1553
|
+
* different revisions of the same entity, and one store holding both would let a save in the designer
|
|
1554
|
+
* leak into the live application before it was published.
|
|
1555
|
+
*/
|
|
1556
|
+
export declare class PublishedAppStore {
|
|
1557
|
+
private readonly appService;
|
|
1558
|
+
private readonly _published;
|
|
1559
|
+
private readonly _loaded;
|
|
1560
|
+
/** The published definition; `undefined` before the first load and while nothing has been published. */
|
|
1561
|
+
readonly published: import("@angular/core").Signal<AppDefinition | undefined>;
|
|
1562
|
+
/** Whether a load has finished, so a host can tell "not published" from "not asked yet". */
|
|
1563
|
+
readonly loaded: import("@angular/core").Signal<boolean>;
|
|
1564
|
+
/**
|
|
1565
|
+
* Reads the published revision afresh. A transport failure is treated like "not published": the host then
|
|
1566
|
+
* renders its fallback rather than a dead URL, and the error itself has been reported by the interceptor.
|
|
1567
|
+
*
|
|
1568
|
+
* A 401 is the exception: it says the session ended, not that nothing is published, and answering it with
|
|
1569
|
+
* the fallback would show the user a working-looking application that fails on every call. It is rethrown
|
|
1570
|
+
* and the store is left as it was — neither `published` nor `loaded` changes — while the session-expired
|
|
1571
|
+
* interceptor sends the user to sign in again.
|
|
1572
|
+
*/
|
|
1573
|
+
load(appId: string): Promise<AppDefinition | undefined>;
|
|
1574
|
+
/** Records that there is no application to load, as a finished load that found nothing. */
|
|
1575
|
+
clear(): Promise<undefined>;
|
|
1576
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<PublishedAppStore, never>;
|
|
1577
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
1578
|
+
}
|
|
1579
|
+
/**
|
|
1580
|
+
* Registers the **published** application's routes as the children of the runtime host's route — the
|
|
1581
|
+
* production counterpart of `appShellRoutesGuard`, and the same `canMatch` technique for the same reason:
|
|
1582
|
+
* `children` is read fresh on every recognition, and this runs, awaited, before the router reads it.
|
|
1583
|
+
*
|
|
1584
|
+
* **When it fetches.** On entering the host — the first load, or coming back from the designer or any other
|
|
1585
|
+
* screen outside it — and not on navigations inside it. Entering is the moment a newly published revision
|
|
1586
|
+
* has to show up: "Publish, then back to the application" is the designer's whole workflow. Inside, the
|
|
1587
|
+
* routes built on entry stay, so moving between the application's pages costs no request.
|
|
1588
|
+
*
|
|
1589
|
+
* `fallback` takes the place of the application's routes while nothing has been published — or a published
|
|
1590
|
+
* revision has no routes — so that the host's URL always matches something. Without it the host route would
|
|
1591
|
+
* fail to match, a catch-all would redirect back to it, and the navigation would never settle.
|
|
1592
|
+
*
|
|
1593
|
+
* `appId` is either the id itself or a function that finds it — for a host that cannot know it at build
|
|
1594
|
+
* time, because the organization's application is whichever one it kept. The function is called in the
|
|
1595
|
+
* guard's injection context, and an `undefined` answer means there is no application: the fallback.
|
|
1596
|
+
*
|
|
1597
|
+
* Always resolves to `true`: it does not decide whether the host may be entered, it fills in its children.
|
|
1598
|
+
*/
|
|
1599
|
+
export declare function publishedAppRoutesGuard(appId: string | AppIdResolver, fallback?: Routes): CanMatchFn;
|
|
1600
|
+
/** Finds the id of the application a runtime host renders; `undefined` when the organization has none. */
|
|
1601
|
+
type AppIdResolver = () => Promise<string | undefined>;
|
|
1602
|
+
/**
|
|
1603
|
+
* Makes the element and everything below it wear the theme of the **published** application — the preset,
|
|
1604
|
+
* colour scheme and token overrides its definition declares, and the user's own choice in a `ThemesButton`,
|
|
1605
|
+
* remembered under the same key `AppShellComponent` uses. So the screens that work *on* the application
|
|
1606
|
+
* (administration, for one) look like the application instead of like the host's default.
|
|
1607
|
+
*
|
|
1608
|
+
* The standard way for a custom application's own chrome to follow the application's theme: bind it on the
|
|
1609
|
+
* chrome's root element, passing the {@link AppIdResolver} that finds the application. When the published
|
|
1610
|
+
* revision has not been read yet — a deep link straight into the administration — the directive reads it.
|
|
1611
|
+
*
|
|
1612
|
+
* `enabled` switches the theme off, for a mode that must keep the host's look (the designer).
|
|
1613
|
+
*
|
|
1614
|
+
* Like `AppShellComponent` it needs `pp-material-themes.scss` among the application's global styles.
|
|
1615
|
+
*/
|
|
1616
|
+
export declare class PublishedAppThemeDirective {
|
|
1617
|
+
readonly appIdResolver: import("@angular/core").InputSignal<AppIdResolver>;
|
|
1618
|
+
readonly enabled: import("@angular/core").InputSignal<boolean>;
|
|
1619
|
+
private readonly store;
|
|
1620
|
+
private readonly theme;
|
|
1621
|
+
private readonly injector;
|
|
1622
|
+
private loading;
|
|
1623
|
+
protected readonly themeClass: import("@angular/core").Signal<string>;
|
|
1624
|
+
protected readonly themeVars: import("@angular/core").Signal<Record<string, string>>;
|
|
1625
|
+
private readonly loadWhenUnread;
|
|
1626
|
+
private readonly applyDefaults;
|
|
1627
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<PublishedAppThemeDirective, never>;
|
|
1628
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<PublishedAppThemeDirective, "[ppPublishedAppTheme]", never, {
|
|
1629
|
+
"appIdResolver": {
|
|
1630
|
+
"alias": "ppPublishedAppTheme";
|
|
1631
|
+
"required": true;
|
|
1632
|
+
"isSignal": true;
|
|
1633
|
+
};
|
|
1634
|
+
"enabled": {
|
|
1635
|
+
"alias": "ppPublishedAppThemeEnabled";
|
|
1636
|
+
"required": false;
|
|
1637
|
+
"isSignal": true;
|
|
1638
|
+
};
|
|
1639
|
+
}, {}, never, never, true, never>;
|
|
1640
|
+
}
|
|
1095
1641
|
/**
|
|
1096
1642
|
* The layout decisions {@link AppShellComponent} renders from, resolved out of an `AppDefinition`'s
|
|
1097
1643
|
* `layout` fields with every default already applied — so the template reads values rather than
|
|
@@ -1146,21 +1692,14 @@ export declare function layoutOf(definition: AppDefinition | undefined): Resolve
|
|
|
1146
1692
|
*/
|
|
1147
1693
|
export declare function themeVarsOf(definition: AppDefinition | undefined): Record<string, string>;
|
|
1148
1694
|
/**
|
|
1149
|
-
*
|
|
1150
|
-
*
|
|
1151
|
-
*
|
|
1152
|
-
* A module's *own* routes are deliberately absent. They live in the module's definition, which the router
|
|
1153
|
-
* fetches only when something navigates into the mount, so they cannot be known here — which is why the
|
|
1154
|
-
* consumer of this list treats a path *below* a known one as accounted for. See `toNavRows`.
|
|
1155
|
-
*/
|
|
1156
|
-
declare function knownRoutePathsOf(definition: AppDefinition | undefined): string[];
|
|
1157
|
-
/**
|
|
1158
|
-
* The theme preset and colour scheme a definition declares, as the defaults of the shell's `ThemeService` —
|
|
1159
|
-
* which a user's choice in a `ThemesButton` overrides, and which fall back to the ProcessPuzzle look, light,
|
|
1160
|
-
* for whatever the definition leaves unset. Those fallbacks are the contract's defaults too, so the server
|
|
1161
|
-
* fills the same values in on save.
|
|
1695
|
+
* A route that requires a working context, by where the shell serves it: `base` is the module mount's path (empty
|
|
1696
|
+
* for the app's own routes), `path` the route's own. Its pages live at `<base>/ctx/<context>/[<id>/]<path>`.
|
|
1162
1697
|
*/
|
|
1163
|
-
|
|
1698
|
+
interface ContextLink {
|
|
1699
|
+
base: string;
|
|
1700
|
+
path: string;
|
|
1701
|
+
context: string;
|
|
1702
|
+
}
|
|
1164
1703
|
/**
|
|
1165
1704
|
* The `footer` region: the widgets it declares, and nothing else. The contract gives a footer no field
|
|
1166
1705
|
* beyond `widgets`, so this stays a thin styled host over {@link WidgetListComponent} — separate from
|
|
@@ -1224,18 +1763,6 @@ interface NavRow {
|
|
|
1224
1763
|
unresolved: boolean;
|
|
1225
1764
|
children: NavRow[];
|
|
1226
1765
|
}
|
|
1227
|
-
/**
|
|
1228
|
-
* Maps the authored nav tree onto rows, resolving each `routePath` against the paths the definition
|
|
1229
|
-
* accounts for.
|
|
1230
|
-
*
|
|
1231
|
-
* A path counts as resolved if it equals a declared route's path *or* sits below one — below a declared
|
|
1232
|
-
* route, or below a mounted module's base path. The prefix rule is what keeps this from crying wolf: the
|
|
1233
|
-
* routes inside a module live in the module's own definition, which is fetched lazily and is not knowable
|
|
1234
|
-
* here, so `back-office/lines` has to be trusted on the strength of the `back-office` mount alone.
|
|
1235
|
-
*
|
|
1236
|
-
* A group node — no `routePath`, children instead — is not unresolved. It expands rather than navigates.
|
|
1237
|
-
*/
|
|
1238
|
-
declare function toNavRows(items: NavItem[] | undefined, knownPaths: string[]): NavRow[];
|
|
1239
1766
|
/**
|
|
1240
1767
|
* Renders the nav tree of the `sidenav` region — in the sidenav for the two sidenav presets, and
|
|
1241
1768
|
* horizontally in the header row for `top-nav`. One component for both, because the tree and its
|
|
@@ -1265,7 +1792,12 @@ export declare class RegionNavComponent {
|
|
|
1265
1792
|
readonly compact: import("@angular/core").InputSignal<boolean>;
|
|
1266
1793
|
/** Route paths the definition accounts for, supplied by `AppRegionRenderer`. See {@link toNavRows}. */
|
|
1267
1794
|
readonly knownPaths: import("@angular/core").InputSignal<string[]>;
|
|
1795
|
+
/** Routes bound to a working context, supplied by `AppRegionRenderer`: their nav entries lead into the context. */
|
|
1796
|
+
readonly contextLinks: import("@angular/core").InputSignal<ContextLink[]>;
|
|
1797
|
+
private readonly workingContext;
|
|
1798
|
+
private readonly activeIds;
|
|
1268
1799
|
protected readonly rows: import("@angular/core").Signal<NavRow[]>;
|
|
1800
|
+
private withContextLinks;
|
|
1269
1801
|
static ɵfac: i0.ɵɵFactoryDeclaration<RegionNavComponent, never>;
|
|
1270
1802
|
static ɵcmp: i0.ɵɵComponentDeclaration<RegionNavComponent, "pp-region-nav", never, {
|
|
1271
1803
|
"navItems": {
|
|
@@ -1288,8 +1820,40 @@ export declare class RegionNavComponent {
|
|
|
1288
1820
|
"required": false;
|
|
1289
1821
|
"isSignal": true;
|
|
1290
1822
|
};
|
|
1823
|
+
"contextLinks": {
|
|
1824
|
+
"alias": "contextLinks";
|
|
1825
|
+
"required": false;
|
|
1826
|
+
"isSignal": true;
|
|
1827
|
+
};
|
|
1291
1828
|
}, {}, never, never, true, never>;
|
|
1292
1829
|
}
|
|
1830
|
+
/**
|
|
1831
|
+
* The concepts the guide explains, in the order an application is assembled. Each is a section with a
|
|
1832
|
+
* stable anchor — see {@link appConceptAnchor} — so a designer tooltip can point at exactly the paragraph
|
|
1833
|
+
* that explains its field.
|
|
1834
|
+
*/
|
|
1835
|
+
export declare const APP_CONCEPTS: readonly ["assembling", "application", "theme", "layout", "regions", "header", "footer", "navigation", "routes", "widgets", "entities", "documents", "modules", "roles", "lifecycle"];
|
|
1836
|
+
type AppConcept = (typeof APP_CONCEPTS)[number];
|
|
1837
|
+
/** Element id of a concept's section; append it as the URL fragment of a page hosting the guide. */
|
|
1838
|
+
export declare function appConceptAnchor(concept: AppConcept): string;
|
|
1839
|
+
/**
|
|
1840
|
+
* The guide hosted by the application samples page: what a dynamic application is made of and how the
|
|
1841
|
+
* pieces relate, written for the person assembling one rather than for a developer.
|
|
1842
|
+
*
|
|
1843
|
+
* The bodies are translation values carrying a little inline markup (`<b>`, `<code>`, `<ul>`), bound
|
|
1844
|
+
* through `[innerHTML]` — Angular's sanitizer keeps exactly that subset, and the text is ours, not the tenant's.
|
|
1845
|
+
*/
|
|
1846
|
+
export declare class AppConceptsGuideComponent {
|
|
1847
|
+
readonly scope = "base_app.concepts";
|
|
1848
|
+
readonly concepts: readonly ["assembling", "application", "theme", "layout", "regions", "header", "footer", "navigation", "routes", "widgets", "entities", "documents", "modules", "roles", "lifecycle"];
|
|
1849
|
+
readonly anchor: typeof appConceptAnchor;
|
|
1850
|
+
private readonly route;
|
|
1851
|
+
private readonly transloco;
|
|
1852
|
+
private readonly injector;
|
|
1853
|
+
constructor();
|
|
1854
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AppConceptsGuideComponent, never>;
|
|
1855
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<AppConceptsGuideComponent, "pp-app-concepts-guide", never, {}, {}, never, never, true, never>;
|
|
1856
|
+
}
|
|
1293
1857
|
/**
|
|
1294
1858
|
* The Preview tab, declared once and consumed twice: `BASE_APP_ROUTES` mounts it as
|
|
1295
1859
|
* `app-definition/<id>/preview`, and `AppDefinitionContainerComponent` puts it on the descriptor so the tab bar
|
|
@@ -1344,5 +1908,5 @@ export declare const BASE_APP_ENTITY_FACADES: BaseEntityFacadeRegistry;
|
|
|
1344
1908
|
* constraint on `BASE_RULE_ROUTES`.
|
|
1345
1909
|
*/
|
|
1346
1910
|
export declare const BASE_APP_ROUTES: Routes;
|
|
1347
|
-
export { type AppRouteSource, type ColorScheme, type EntityMode, type LayoutDefinition, type LayoutPreset, type MaterialTheme, type ModuleLoader, type NavOrientation, type RegionType, type RegionView, type ResolvedLayout, type RouteRenderer, type RouteTarget, type RouteTargetKind, type SidenavMode, type ThemeDefinition, WIDGET_PLACEMENTS, WidgetInstance, type WidgetPlacement };
|
|
1911
|
+
export { type AppAsset, type AppConcept, type AppIdResolver, type AppRouteSource, type AppTranslationBundle, type AppTranslationUploadReport, type ColorScheme, type EntityMode, type LayoutDefinition, type LayoutPreset, type MaterialTheme, type ModuleAsset, type ModuleLoader, type ModuleTranslationBundle, type ModuleTranslationCoverage, type ModuleTranslationUploadLanguage, type ModuleTranslationUploadReport, type NavOrientation, type RegionType, type RegionView, type ResolvedLayout, type RouteRenderer, type RouteTarget, type RouteTargetKind, type SidenavMode, type ThemeDefinition, WIDGET_PLACEMENTS, WidgetInstance, type WidgetPlacement };
|
|
1348
1912
|
//# sourceMappingURL=processpuzzle-base-app.d.ts.map
|