@processpuzzle/base-app 0.2.1 → 0.3.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 +1 @@
1
- {"version":3,"file":"processpuzzle-base-app.mjs","sources":["../../../../libs/js-shared/base-app-frontend/src/lib/domain/app-definition.ts","../../../../libs/js-shared/base-app-frontend/src/lib/domain/module-definition.ts","../../../../libs/js-shared/base-app-frontend/src/lib/base-app.i18n.ts","../../../../libs/js-shared/base-app-frontend/src/lib/domain/app-entity-names.ts","../../../../libs/js-shared/base-app-frontend/src/lib/domain/module-mount.descriptors.ts","../../../../libs/js-shared/base-app-frontend/src/lib/domain/region-definition.descriptors.ts","../../../../libs/js-shared/base-app-frontend/src/lib/domain/route-definition.descriptors.ts","../../../../libs/js-shared/base-app-frontend/src/lib/domain/app-definition.descriptors.ts","../../../../libs/js-shared/base-app-frontend/src/lib/domain/nav-item.descriptors.ts","../../../../libs/js-shared/base-app-frontend/src/lib/domain/widget-instance.descriptors.ts","../../../../libs/js-shared/base-app-frontend/src/lib/domain/module-definition.descriptors.ts","../../../../libs/js-shared/base-app-frontend/src/lib/domain/route-definition.mapper.ts","../../../../libs/js-shared/base-app-frontend/src/lib/domain/app-definition.mapper.ts","../../../../libs/js-shared/base-app-frontend/src/lib/domain/app-definition.service.ts","../../../../libs/js-shared/base-app-frontend/src/lib/domain/app-definition.store.ts","../../../../libs/js-shared/base-app-frontend/src/lib/domain/module-definition.mapper.ts","../../../../libs/js-shared/base-app-frontend/src/lib/domain/module-definition.service.ts","../../../../libs/js-shared/base-app-frontend/src/lib/domain/module-definition.store.ts","../../../../libs/js-shared/base-app-frontend/src/lib/feature/app-definition.facade.ts","../../../../libs/js-shared/base-app-frontend/src/lib/feature/module-definition.facade.ts","../../../../libs/js-shared/base-app-frontend/src/lib/feature/app-module-mount.facade.ts","../../../../libs/js-shared/base-app-frontend/src/lib/feature/app-nav-item.facade.ts","../../../../libs/js-shared/base-app-frontend/src/lib/feature/app-route-builder.ts","../../../../libs/js-shared/base-app-frontend/src/lib/feature/widget-list.component.ts","../../../../libs/js-shared/base-app-frontend/src/lib/feature/route-widgets.component.ts","../../../../libs/js-shared/base-app-frontend/src/lib/feature/route-unsupported.component.ts","../../../../libs/js-shared/base-app-frontend/src/lib/feature/app-route-renderer.ts","../../../../libs/js-shared/base-app-frontend/src/lib/feature/app-region.facade.ts","../../../../libs/js-shared/base-app-frontend/src/lib/feature/app-route.facade.ts","../../../../libs/js-shared/base-app-frontend/src/lib/feature/app-widget.facade.ts","../../../../libs/js-shared/base-app-frontend/src/lib/feature/shell/app-shell.model.ts","../../../../libs/js-shared/base-app-frontend/src/lib/feature/shell/region-footer.component.ts","../../../../libs/js-shared/base-app-frontend/src/lib/feature/shell/region-header.component.ts","../../../../libs/js-shared/base-app-frontend/src/lib/feature/shell/region-nav.component.ts","../../../../libs/js-shared/base-app-frontend/src/lib/feature/shell/app-region.renderer.ts","../../../../libs/js-shared/base-app-frontend/src/lib/feature/shell/app-shell.component.ts","../../../../libs/js-shared/base-app-frontend/src/lib/feature/app-preview.component.ts","../../../../libs/js-shared/base-app-frontend/src/lib/feature/shell/app-shell-routes.ts","../../../../libs/js-shared/base-app-frontend/src/lib/feature/app-preview-tab.ts","../../../../libs/js-shared/base-app-frontend/src/lib/feature/app-definition-container.component.ts","../../../../libs/js-shared/base-app-frontend/src/lib/feature/module-definition-container.component.ts","../../../../libs/js-shared/base-app-frontend/src/lib/base-app.providers.ts","../../../../libs/js-shared/base-app-frontend/src/lib/base-app.routes.ts","../../../../libs/js-shared/base-app-frontend/src/public-api.ts","../../../../libs/js-shared/base-app-frontend/src/processpuzzle-base-app.ts"],"sourcesContent":["import { BaseEntity } from '@processpuzzle/base-entity';\nimport { WidgetInstance } from '@processpuzzle/widgets';\n\nexport { WIDGET_PLACEMENTS, WidgetInstance, WidgetPlacement } from '@processpuzzle/widgets';\n\n/**\n * Frontend model of the `AppDefinition` schema of `base-app-api.yaml`. `theme` and `layout` are\n * flattened onto the entity by {@link AppDefinitionMapper} so that the generated form can offer a\n * typed control per field; the original objects are kept alongside, because a full replacement PUT\n * would otherwise drop the parts no control writes. `regions`, `routes` and `modules` stay nested and\n * are edited through the `EMBEDDED_COMPONENTS` controls of the `App Region` / `App Route` /\n * `App Module Mount` descriptors.\n *\n * A route's `target` is flattened the same way, for the same reason and by the same mapper. The\n * contract already keeps `RouteTarget` flat rather than a `oneOf` because the generic form cannot edit\n * a discriminated union of classes; a nested object it equally cannot reach, since an\n * `EMBEDDED_COMPONENTS` row is edited as the parsed JSON it arrived as and a descriptor addresses one\n * property, not a path. So {@link RouteDefinition} carries `kind` and the per-kind fields directly and\n * {@link AppDefinitionMapper} re-nests them on save.\n *\n * The nested definitions are classes rather than interfaces, because each is an embedded entity of\n * its own: `EmbeddedEntityFacade` mints the blank row an `Add` opens the child's form on, and that\n * needs a constructor. They stay plain data — the rows of a loaded aggregate are the parsed JSON,\n * never instances of these classes, so nothing may rely on `instanceof` or on a method.\n */\n\nexport const MATERIAL_THEMES = ['azure-blue', 'rose-red', 'magenta-violet', 'cyan-orange'] as const;\nexport type MaterialTheme = (typeof MATERIAL_THEMES)[number];\n\nexport const COLOR_SCHEMES = ['light', 'dark', 'auto'] as const;\nexport type ColorScheme = (typeof COLOR_SCHEMES)[number];\n\nexport const LAYOUT_PRESETS = ['sidenav-left', 'sidenav-right', 'top-nav'] as const;\nexport type LayoutPreset = (typeof LAYOUT_PRESETS)[number];\n\nexport const SIDENAV_MODES = ['side', 'over', 'push'] as const;\nexport type SidenavMode = (typeof SIDENAV_MODES)[number];\n\n/**\n * No `content`: once routes own the content area it *is* the router outlet, so a content region would\n * have no field of its own — `widgets` is header/footer-only and `navItems` sidenav-only. Its sizing\n * lives in {@link LayoutDefinition.contentMaxWidth}.\n */\nexport const REGION_TYPES = ['header', 'sidenav', 'footer'] as const;\nexport type RegionType = (typeof REGION_TYPES)[number];\n\n/**\n * What a route renders. Uppercase because the contract's enum is — `RegionType` and the theme enums\n * are lowercase, and mixing the two up is a silent miss rather than a type error once a value reaches\n * JSON.\n */\nexport const ROUTE_TARGET_KINDS = ['WIDGETS', 'DOCUMENT', 'ENTITY'] as const;\nexport type RouteTargetKind = (typeof ROUTE_TARGET_KINDS)[number];\n\nexport const ENTITY_MODES = ['LIST', 'DETAILS'] as const;\nexport type EntityMode = (typeof ENTITY_MODES)[number];\n\nexport enum AppDefinitionStatus {\n DRAFT = 'DRAFT',\n PUBLISHED = 'PUBLISHED',\n}\n\nexport interface ThemeDefinition {\n materialTheme?: MaterialTheme;\n colorScheme?: ColorScheme;\n /** Overrides for the `--pp-*` custom properties of `widgets/src/theme/pp-colors.css`. */\n tokenOverrides?: Record<string, string>;\n logoUrl?: string;\n faviconUrl?: string;\n}\n\nexport interface LayoutDefinition {\n preset?: LayoutPreset;\n sidenavMode?: SidenavMode;\n sidenavCollapsible?: boolean;\n sidenavOpenByDefault?: boolean;\n contentMaxWidth?: string;\n}\n\nexport class NavItem implements BaseEntity {\n id: string;\n label: string;\n translocoId?: string;\n icon?: string;\n /**\n * `RouteDefinition.path` of the route this entry navigates to, resolved by string. Absent on a group\n * node, which expands its {@link children} instead of navigating.\n *\n * A path naming no route is a validation *warning* server-side, not an error: it may name a route of\n * a module that has not been authored yet, and modules stay loosely coupled.\n */\n routePath?: string;\n roles?: string[];\n children?: NavItem[];\n\n constructor(init: Partial<NavItem> = {}) {\n this.id = init.id ?? '';\n this.label = init.label ?? '';\n this.translocoId = init.translocoId;\n this.icon = init.icon;\n this.routePath = init.routePath;\n this.roles = init.roles;\n this.children = init.children;\n }\n}\n\nexport class RegionDefinition implements BaseEntity {\n /**\n * Declared, never assigned. The contract gives a region no `id` — `type` identifies it, see\n * `APP_REGION_ID_FIELD` — but `BaseEntity`'s only property is an optional `id`, and TypeScript's\n * weak-type rule rejects a type that shares no property with it. `declare` emits nothing, so the\n * payload stays exactly the shape the schema describes.\n */\n declare readonly id?: string;\n\n /**\n * Required by the contract, but undefined while a region is being created — the dropdown is declared\n * `required`, so the form is what enforces the contract before the row reaches the payload.\n */\n type: RegionType | undefined;\n /** `sidenav` only; left undefined so a header region's payload carries no empty nav tree. */\n navItems?: NavItem[];\n /** `header` / `footer` only. */\n widgets?: WidgetInstance[];\n\n constructor(init: Partial<RegionDefinition> = {}) {\n this.type = init.type;\n this.navItems = init.navItems;\n this.widgets = init.widgets;\n }\n}\n\n/**\n * The nested `target` object of the DTO. Only {@link AppDefinitionMapper} handles it — the form works\n * on the fields {@link RouteDefinition} carries flattened — so it is an interface rather than a class.\n */\nexport interface RouteTarget {\n kind: RouteTargetKind;\n /** WIDGETS only. */\n widgets?: WidgetInstance[];\n /** DOCUMENT only. */\n documentSlug?: string;\n /** ENTITY only. */\n entityName?: string;\n /** ENTITY only. */\n entityMode?: EntityMode;\n /** ENTITY + LIST only. */\n rsqlFilter?: string;\n}\n\n/**\n * One navigable route. **Flat: a route has no children.** `path` may be multi-segment, so `claims`,\n * `claims/open` and `claims/:id` are three sibling entries rather than a tree — Angular's own nesting\n * is derived from those prefixes when the shell builds its `Routes`, because nesting is a rendering\n * concern rather than something worth authoring. Structure is broken up at the module boundary\n * instead, through {@link ModuleMount}.\n *\n * The `target` fields are flattened onto the row and re-nested by {@link AppDefinitionMapper}; which of\n * them are meaningful follows from {@link kind}, and the backend — not the form — is what enforces it.\n */\nexport class RouteDefinition implements BaseEntity {\n /**\n * Declared, never assigned. The contract gives a route no `id`: `path` identifies it, which is what\n * a `NavItem.routePath` resolves against. Same reason as {@link RegionDefinition.id}.\n */\n declare readonly id?: string;\n\n /** Relative to the app root, no leading slash. May contain `/` for depth and `:name` for a parameter. */\n path: string;\n title: string;\n translocoId?: string;\n icon?: string;\n /** Empty or absent means any authenticated member of the organization, as on {@link NavItem.roles}. */\n roles?: string[];\n // region flattened target — re-nested into `target` by AppDefinitionMapper\n /**\n * Required by the contract, but undefined while a route is being created — the dropdown is declared\n * `required`, so the form is what enforces it before the row reaches the payload.\n */\n kind: RouteTargetKind | undefined;\n /** WIDGETS only. Starts as an empty array so the embedded list has something to append to. */\n widgets: WidgetInstance[];\n documentSlug?: string;\n entityName?: string;\n entityMode?: EntityMode;\n rsqlFilter?: string;\n // endregion\n /** The object the flattened fields came from, preserved so a save cannot drop a future field. */\n target?: RouteTarget;\n\n constructor(init: Partial<RouteDefinition> = {}) {\n this.path = init.path ?? '';\n this.title = init.title ?? '';\n this.translocoId = init.translocoId;\n this.icon = init.icon;\n this.roles = init.roles;\n this.kind = init.kind;\n this.widgets = init.widgets ?? [];\n this.documentSlug = init.documentSlug;\n this.entityName = init.entityName;\n this.entityMode = init.entityMode;\n this.rsqlFilter = init.rsqlFilter;\n this.target = init.target;\n }\n}\n\n/**\n * Mounts a module's routes under {@link basePath}. The one place route structure composes, and it\n * composes exactly one level deep: a module cannot mount modules.\n */\nexport class ModuleMount implements BaseEntity {\n /** `moduleKey` identifies the mount; the contract gives it no `id`. */\n declare readonly id?: string;\n\n /**\n * Key of a `ModuleDefinition` in this organization. One naming no existing module is a validation\n * warning, not an error — an app may mount a module before it has been authored.\n */\n moduleKey: string;\n basePath: string;\n\n constructor(init: Partial<ModuleMount> = {}) {\n this.moduleKey = init.moduleKey ?? '';\n this.basePath = init.basePath ?? '';\n }\n}\n\nexport class AppDefinition implements BaseEntity {\n /** Unique within the organization and used verbatim as the run-time route segment. */\n id: string;\n name: string;\n translocoId: string | undefined;\n description: string | undefined;\n // region flattened theme\n materialTheme: MaterialTheme | undefined;\n colorScheme: ColorScheme | undefined;\n tokenOverrides: Record<string, string> | undefined;\n logoUrl: string | undefined;\n faviconUrl: string | undefined;\n // endregion\n // region flattened layout\n preset: LayoutPreset | undefined;\n sidenavMode: SidenavMode | undefined;\n sidenavCollapsible: boolean;\n sidenavOpenByDefault: boolean;\n contentMaxWidth: string | undefined;\n // endregion\n /** The objects the flattened fields came from, preserved so a save cannot drop a future field. */\n theme: ThemeDefinition | undefined;\n layout: LayoutDefinition | undefined;\n regions: RegionDefinition[] | undefined;\n routes: RouteDefinition[] | undefined;\n modules: ModuleMount[] | undefined;\n // region server-assigned\n orgKey: string | undefined;\n status: AppDefinitionStatus | undefined;\n version: number | undefined;\n publishedVersion: number | undefined;\n createdAt: string | undefined;\n updatedAt: string | undefined;\n // endregion\n\n constructor(init: Partial<AppDefinition> = {}) {\n this.id = init.id ?? '';\n this.name = init.name ?? '';\n this.translocoId = init.translocoId;\n this.description = init.description;\n this.materialTheme = init.materialTheme;\n this.colorScheme = init.colorScheme;\n this.tokenOverrides = init.tokenOverrides;\n this.logoUrl = init.logoUrl;\n this.faviconUrl = init.faviconUrl;\n this.preset = init.preset;\n this.sidenavMode = init.sidenavMode;\n this.sidenavCollapsible = init.sidenavCollapsible ?? true;\n this.sidenavOpenByDefault = init.sidenavOpenByDefault ?? true;\n this.contentMaxWidth = init.contentMaxWidth;\n this.theme = init.theme;\n this.layout = init.layout;\n this.regions = init.regions;\n this.routes = init.routes;\n this.modules = init.modules;\n this.orgKey = init.orgKey;\n this.status = init.status;\n this.version = init.version;\n this.publishedVersion = init.publishedVersion;\n this.createdAt = init.createdAt;\n this.updatedAt = init.updatedAt;\n }\n}\n","import { BaseEntity } from '@processpuzzle/base-entity';\nimport { RouteDefinition } from './app-definition';\n\n/**\n * Frontend model of the `ModuleDefinition` schema of `base-app-api.yaml`: a lazily-loadable slice of an\n * application, with its own flat route list and its own transloco scope. An {@link ModuleMount} of an\n * `AppDefinition` names one of these by key and mounts its routes under a base path.\n *\n * **What \"lazy\" honestly means.** A module lazy-loads *metadata* — this definition, its routes, its\n * translations, and the documents and descriptors they name. It does **not** lazy-load widget code:\n * widget components are bundled at compile time and resolved through the frontend registry, so a\n * metadata module cannot split a bundle on its own. The wins are that `AppDefinition` stops being one\n * aggregate that has to be loaded, locked and published atomically, and that a module is the unit of\n * authoring permission and versioning. Nothing here should be justified on bundle size.\n *\n * Unlike the region / route / mount classes this one is a **routable** entity: it has endpoints of its\n * own, so it comes with a service, a store and a facade rather than travelling inside another payload.\n */\nexport class ModuleDefinition implements BaseEntity {\n /**\n * The contract calls this field `key`; base-entity keys every store, URL and reference on `id`, so\n * {@link ModuleDefinitionMapper} renames it on the way in and out rather than teaching the framework a\n * second identity field. One name for one thing on this side of the mapper — a `key` property beside\n * `id` could only ever disagree with it.\n *\n * Immutable by contract: `ModuleMount.moduleKey` resolves against it, and a rename would silently\n * unmount the module from every app that mounts it.\n */\n id: string;\n name: string;\n translocoId: string | undefined;\n description: string | undefined;\n /**\n * Transloco scope the module's translations load under. Absent means {@link id}, which is the default\n * the contract states; {@link moduleTranslocoScope} is the one place that default is applied.\n */\n translocoScope: string | undefined;\n /**\n * The module's routes, flat and relative to the base path it is mounted at — the same shape and the\n * same derived nesting as `AppDefinition.routes`, and flattened by the same mapper. A module does not\n * mount modules: this is where composition stops.\n */\n routes: RouteDefinition[] | undefined;\n // region server-assigned\n orgKey: string | undefined;\n version: number | undefined;\n createdAt: string | undefined;\n updatedAt: string | undefined;\n // endregion\n\n constructor(init: Partial<ModuleDefinition> = {}) {\n this.id = init.id ?? '';\n this.name = init.name ?? '';\n this.translocoId = init.translocoId;\n this.description = init.description;\n this.translocoScope = init.translocoScope;\n this.routes = init.routes;\n this.orgKey = init.orgKey;\n this.version = init.version;\n this.createdAt = init.createdAt;\n this.updatedAt = init.updatedAt;\n }\n}\n\n/**\n * The scope a module's translations load under, applying the contract's default. Kept as a function\n * rather than resolved in the mapper, so a definition never carries a `translocoScope` the designer did\n * not author — the field stays empty in the form, and the fallback is a rendering decision.\n */\nexport function moduleTranslocoScope(definition: ModuleDefinition): string {\n return definition.translocoScope?.trim() || definition.id;\n}\n","import type { TranslationSource } from '@processpuzzle/util';\n/**\n * Transloco scope of this library. The translations live in\n * `libs/js-shared/base-app-frontend/src/assets/i18n/base_app/*.json` and are published with the\n * package; a consuming application copies them to `assets/i18n/base_app` (see the testbed's\n * `project.json`). The scope is registered on {@link BASE_APP_ROUTES}, so it loads lazily with the\n * route rather than with the application shell.\n *\n * The alias is spelled out on purpose: transloco camel-cases the default alias, which would turn\n * `base_app` into `baseApp` and silently miss every key below.\n */\nexport const BASE_APP_TRANSLOCO_SCOPE = 'base_app';\n\n/**\n * Scope of the generic framework labels (`base_entity.tabs.*`, `base_entity.toolbar.*`), whose files\n * base-entity owns. It has to be registered next to {@link BASE_APP_TRANSLOCO_SCOPE} wherever the\n * generic screens are hosted: `BaseEntityTabsComponent` translates from it through `TranslocoPipe`,\n * which caches the value it resolved for a key on first render. If only `base_app` were loaded, the\n * tabs would keep the raw key even after the toolbar — which registers this scope for itself —\n * triggers the load.\n */\nexport const BASE_ENTITY_TRANSLOCO_SCOPE = 'base_entity';\n\n/** Key root of the `AppDefinition` entity name (`._self`) and of its attribute labels. */\nexport const APP_DEFINITION_I18N_SCOPE = `${BASE_APP_TRANSLOCO_SCOPE}.app_definition`;\n\n/**\n * Label of the Preview tab. Under this library's own scope rather than `base_entity.tabs.*`: the generic\n * tabs are List and Details, and an application preview is this feature's contribution, not the framework's.\n * Resolved with `{ entity }` like the generic tab labels, so a translation may name the entity if it reads\n * better that way.\n */\nexport const APP_PREVIEW_I18N_KEY = `${APP_DEFINITION_I18N_SCOPE}.tabs.preview`;\n\n/**\n * Key root of the `ModuleDefinition` entity name and attribute labels. A child of this library's scope\n * like the one above, and not to be confused with `ModuleDefinition.translocoScope`, which is a scope an\n * *authored* module's own translations load under — see {@link moduleTranslocoScope}. These keys are the\n * framework's labels for the authoring form; that one is the tenant's content.\n */\nexport const MODULE_DEFINITION_I18N_SCOPE = `${BASE_APP_TRANSLOCO_SCOPE}.module_definition`;\n\n/**\n * Key roots of the nested definitions the `AppDefinition` form contains through `EMBEDDED_COMPONENTS`\n * controls. They are children of {@link BASE_APP_TRANSLOCO_SCOPE} rather than scopes of their own,\n * because the whole graph is edited under `BASE_APP_ROUTES` and one scope registration has to cover\n * all of it — the embedded route branches add none.\n */\nexport const APP_REGION_I18N_SCOPE = `${BASE_APP_TRANSLOCO_SCOPE}.app_region`;\nexport const APP_ROUTE_I18N_SCOPE = `${BASE_APP_TRANSLOCO_SCOPE}.app_route`;\nexport const APP_MODULE_MOUNT_I18N_SCOPE = `${BASE_APP_TRANSLOCO_SCOPE}.app_module_mount`;\nexport const APP_NAV_ITEM_I18N_SCOPE = `${BASE_APP_TRANSLOCO_SCOPE}.app_nav_item`;\nexport const APP_WIDGET_I18N_SCOPE = `${BASE_APP_TRANSLOCO_SCOPE}.app_widget`;\n\n/** Keys of the `Publish` form action contributed by `AppDefinitionContainerComponent`. */\nexport const PUBLISH_BUTTON_I18N_KEY = `${BASE_APP_TRANSLOCO_SCOPE}.publish.button`;\nexport const PUBLISH_TOOLTIP_I18N_KEY = `${BASE_APP_TRANSLOCO_SCOPE}.publish.tooltip`;\n\n/**\n * Where this library's transloco bundles come from when the application ships without its assets.\n *\n * Spread into the application's `TRANSLATION_SOURCE_REGISTRY`, the way its facades are spread into\n * `BASE_ENTITY_FACADE_REGISTRY`. The scopes below normally arrive as static files — the build copies\n * them into `assets/i18n/<scope>` and the loader tries the asset first — so this is reached only by a\n * host that skips that copy step. It is declared here rather than in the application because which\n * backend owns a scope is base-app's knowledge, not its caller's.\n */\nexport const BASE_APP_TRANSLATION_SOURCE: TranslationSource = {\n scopes: ['base_app'],\n serviceRootKey: 'APP_SERVICE_ROOT',\n segment: 'app',\n};\n","/**\n * Entity names of the app-definition graph, kept in one dependency-free module.\n *\n * They live here rather than next to their descriptors because the graph is cyclic: `App Definition`\n * aggregates `App Region`, and `App Region` names `App Definition` as its `componentParent`. Each\n * descriptor module re-exports its own name, so importers are unaffected.\n */\nexport const APP_DEFINITION_ENTITY_NAME = 'App Definition';\n/**\n * A second aggregate root beside `App Definition`, not a part of it — hence no `App` prefix, which in\n * every other name here marks something the app document carries. `App Module Mount` is the row inside\n * an app that *names* one of these.\n */\nexport const MODULE_DEFINITION_ENTITY_NAME = 'Module Definition';\nexport const APP_MODULE_MOUNT_ENTITY_NAME = 'App Module Mount';\nexport const APP_NAV_ITEM_ENTITY_NAME = 'App Nav Item';\nexport const APP_REGION_ENTITY_NAME = 'App Region';\nexport const APP_ROUTE_ENTITY_NAME = 'App Route';\nexport const APP_WIDGET_ENTITY_NAME = 'App Widget';\n","import { AbstractAttrDescriptor, BaseEntityAttrDescriptor, BaseEntityDescriptor, FlexboxDescriptor, FlexDirection, FormControlType } from '@processpuzzle/base-entity';\nimport { APP_MODULE_MOUNT_I18N_SCOPE } from '../base-app.i18n';\nimport { APP_DEFINITION_ENTITY_NAME, APP_MODULE_MOUNT_ENTITY_NAME } from './app-entity-names';\n\nexport { APP_MODULE_MOUNT_ENTITY_NAME };\n\n/** `ModuleMount` has no `id` — an app mounts a given module once, so `moduleKey` identifies the row. */\nexport const APP_MODULE_MOUNT_ID_FIELD = 'moduleKey';\n\nfunction createModuleMountAttrDescriptors(): AbstractAttrDescriptor[] {\n // A plain text box rather than a FOREIGN_KEY onto the module list: modules stay loosely coupled, so a\n // key naming no existing module is a server-side warning rather than an error, and a dropdown of the\n // modules authored so far would turn that warning into something the form refuses to let happen.\n const moduleKeyAttr = new BaseEntityAttrDescriptor('moduleKey', FormControlType.TEXT_BOX, 'Module Key', undefined, true);\n moduleKeyAttr.required = true;\n moduleKeyAttr.isHeading = true;\n moduleKeyAttr.placeholder = 'Key of a module definition of this organization';\n // Both patterns are the contract's own. Declaring them here makes the form refuse what the backend\n // would refuse anyway, and puts them in the e2e registry, so generated fixtures produce dashed tokens\n // rather than prose the PUT answers with 400.\n moduleKeyAttr.pattern = '^[a-z0-9]+(-[a-z0-9]+)*$';\n\n const basePathAttr = new BaseEntityAttrDescriptor('basePath', FormControlType.TEXT_BOX, 'Base Path');\n basePathAttr.required = true;\n basePathAttr.placeholder = 'The module routes are mounted under this prefix, e.g. claims';\n basePathAttr.pattern = '^[a-z0-9][a-z0-9\\\\-/]*$';\n\n const flexBoxContainer = new FlexboxDescriptor([moduleKeyAttr, basePathAttr], FlexDirection.ROW);\n flexBoxContainer.style = { 'column-gap': '10px', width: 'fit-content' };\n return [flexBoxContainer];\n}\n\nexport function createModuleMountDescriptor(): BaseEntityDescriptor {\n return new BaseEntityDescriptor({\n entityName: APP_MODULE_MOUNT_ENTITY_NAME,\n attrDescriptors: createModuleMountAttrDescriptors(),\n i18nScope: APP_MODULE_MOUNT_I18N_SCOPE,\n componentParent: APP_DEFINITION_ENTITY_NAME,\n isEmbedded: true,\n });\n}\n","import { AbstractAttrDescriptor, BaseEntityAttrDescriptor, BaseEntityDescriptor, FlexboxDescriptor, FlexDirection, FormControlType, toSelectables } from '@processpuzzle/base-entity';\nimport { APP_REGION_I18N_SCOPE } from '../base-app.i18n';\nimport { REGION_TYPES } from './app-definition';\nimport { APP_DEFINITION_ENTITY_NAME, APP_NAV_ITEM_ENTITY_NAME, APP_REGION_ENTITY_NAME, APP_WIDGET_ENTITY_NAME } from './app-entity-names';\n\nexport { APP_REGION_ENTITY_NAME };\n\n/**\n * `RegionDefinition` has no `id` — a region is identified by the shell slot it fills, and an app\n * declares each slot at most once. Referencing attributes therefore have to set\n * `referenceIdField = 'type'`; see the `regions` attribute of the `AppDefinition` descriptor.\n */\nexport const APP_REGION_ID_FIELD = 'type';\n\nfunction createRegionDefinitionAttrDescriptors(): AbstractAttrDescriptor[] {\n const typeAttr = new BaseEntityAttrDescriptor('type', FormControlType.DROPDOWN, 'Type', toSelectables(REGION_TYPES), true);\n typeAttr.required = true;\n typeAttr.isHeading = true;\n\n // Per the contract, `navItems` applies to `sidenav` and `widgets` to `header` / `footer`; the\n // schema models them as optional siblings rather than a discriminated union, so both are offered\n // and it is the region's type that decides which one is meaningful. Both are contained: the rows\n // are nested arrays of this region, which is itself nested in the app definition's document.\n const navItemsAttr = new BaseEntityAttrDescriptor('navItems', FormControlType.EMBEDDED_COMPONENTS, 'Nav Items');\n navItemsAttr.linkedEntityType = APP_NAV_ITEM_ENTITY_NAME;\n navItemsAttr.hideInTable = true;\n\n const widgetsAttr = new BaseEntityAttrDescriptor('widgets', FormControlType.EMBEDDED_COMPONENTS, 'Widgets');\n widgetsAttr.linkedEntityType = APP_WIDGET_ENTITY_NAME;\n widgetsAttr.hideInTable = true;\n\n const flexBoxContainer = new FlexboxDescriptor([typeAttr, navItemsAttr, widgetsAttr], FlexDirection.COLUMN);\n flexBoxContainer.style = { 'row-gap': '5px', width: 'fit-content' };\n return [flexBoxContainer];\n}\n\nexport function createRegionDefinitionDescriptor(): BaseEntityDescriptor {\n return new BaseEntityDescriptor({\n entityName: APP_REGION_ENTITY_NAME,\n attrDescriptors: createRegionDefinitionAttrDescriptors(),\n i18nScope: APP_REGION_I18N_SCOPE,\n componentParent: APP_DEFINITION_ENTITY_NAME,\n isEmbedded: true,\n });\n}\n","import { AbstractAttrDescriptor, BaseEntityAttrDescriptor, BaseEntityDescriptor, FlexboxDescriptor, FlexDirection, FormControlType, toSelectables } from '@processpuzzle/base-entity';\nimport { APP_ROUTE_I18N_SCOPE } from '../base-app.i18n';\nimport { ENTITY_MODES, ROUTE_TARGET_KINDS } from './app-definition';\nimport { APP_DEFINITION_ENTITY_NAME, APP_ROUTE_ENTITY_NAME, APP_WIDGET_ENTITY_NAME, MODULE_DEFINITION_ENTITY_NAME } from './app-entity-names';\n\nexport { APP_ROUTE_ENTITY_NAME };\n\n/**\n * `RouteDefinition` has no `id` — `path` identifies a route, and it is what a `NavItem.routePath`\n * resolves against. Referencing attributes therefore have to set `referenceIdField = 'path'`; see the\n * `routePath` attribute of the `App Nav Item` descriptor.\n *\n * Unlike `App Region`'s `type`, this value may contain `/`, so the authoring URL that addresses one row\n * carries it percent-encoded (`app-route/claims%2Fopen/details`). Angular round-trips that, but a\n * reverse proxy that normalizes `%2F` before the SPA sees it would not — worth an e2e case once\n * multi-segment routes are authored in the testbed.\n */\nexport const APP_ROUTE_ID_FIELD = 'path';\n\nfunction createRouteDefinitionAttrDescriptors(): AbstractAttrDescriptor[] {\n const pathAttr = new BaseEntityAttrDescriptor('path', FormControlType.TEXT_BOX, 'Path', undefined, true);\n pathAttr.required = true;\n pathAttr.placeholder = 'Relative to the app root, e.g. claims/open or claims/:id';\n // The contract's own pattern. Declaring it here is what makes the form reject a value the backend\n // would reject anyway — and it is serialized into the e2e registry, so generated fixtures produce a\n // dashed token instead of a prose value the PUT answers with 400.\n pathAttr.pattern = '^[a-z0-9:][a-z0-9\\\\-:/]*$';\n\n const titleAttr = new BaseEntityAttrDescriptor('title', FormControlType.TEXT_BOX, 'Title');\n titleAttr.required = true;\n titleAttr.isHeading = true;\n\n const translocoIdAttr = new BaseEntityAttrDescriptor('translocoId', FormControlType.TEXT_BOX, 'Transloco Id');\n translocoIdAttr.placeholder = 'Translation key of the route title';\n translocoIdAttr.hideInTable = true;\n\n const iconAttr = new BaseEntityAttrDescriptor('icon', FormControlType.TEXT_BOX, 'Icon');\n iconAttr.placeholder = 'Material or FontAwesome icon name';\n iconAttr.hideInTable = true;\n\n const rolesAttr = new BaseEntityAttrDescriptor('roles', FormControlType.TAGS, 'Roles');\n rolesAttr.placeholder = 'Empty means any authenticated member of the organization';\n rolesAttr.hideInTable = true;\n\n // region flattened target — re-nested into `target` by AppDefinitionMapper\n // Which of the fields below is meaningful follows from `kind`; all of them are offered, and the\n // backend validator — not the form — is what rejects a combination that makes no sense. The generic\n // form has no conditional visibility, and a discriminated union is not something a descriptor can\n // express in the first place.\n const kindAttr = new BaseEntityAttrDescriptor('kind', FormControlType.DROPDOWN, 'Renders', toSelectables(ROUTE_TARGET_KINDS));\n kindAttr.required = true;\n\n const widgetsAttr = new BaseEntityAttrDescriptor('widgets', FormControlType.EMBEDDED_COMPONENTS, 'Widgets');\n widgetsAttr.linkedEntityType = APP_WIDGET_ENTITY_NAME;\n widgetsAttr.hideInTable = true;\n\n const documentSlugAttr = new BaseEntityAttrDescriptor('documentSlug', FormControlType.TEXT_BOX, 'Document Slug');\n documentSlugAttr.placeholder = 'DOCUMENT only: slug of the document to render';\n documentSlugAttr.hideInTable = true;\n\n const entityNameAttr = new BaseEntityAttrDescriptor('entityName', FormControlType.TEXT_BOX, 'Entity Name');\n entityNameAttr.placeholder = 'ENTITY only: name of the descriptor to generate the screen from';\n entityNameAttr.hideInTable = true;\n\n const entityModeAttr = new BaseEntityAttrDescriptor('entityMode', FormControlType.DROPDOWN, 'Entity Mode', toSelectables(ENTITY_MODES));\n entityModeAttr.hideInTable = true;\n\n const rsqlFilterAttr = new BaseEntityAttrDescriptor('rsqlFilter', FormControlType.TEXT_BOX, 'Rsql Filter');\n rsqlFilterAttr.placeholder = 'ENTITY + LIST only: RSQL the list is pre-filtered with';\n rsqlFilterAttr.hideInTable = true;\n // endregion\n\n const identityRow = new FlexboxDescriptor([pathAttr, titleAttr, translocoIdAttr], FlexDirection.ROW);\n identityRow.style = { 'column-gap': '10px' };\n const presentationRow = new FlexboxDescriptor([iconAttr, kindAttr], FlexDirection.ROW);\n presentationRow.style = { 'column-gap': '10px' };\n const documentRow = new FlexboxDescriptor([documentSlugAttr], FlexDirection.ROW);\n documentRow.style = { 'column-gap': '10px' };\n const entityRow = new FlexboxDescriptor([entityNameAttr, entityModeAttr, rsqlFilterAttr], FlexDirection.ROW);\n entityRow.style = { 'column-gap': '10px' };\n\n const flexBoxContainer = new FlexboxDescriptor([identityRow, presentationRow, rolesAttr, documentRow, entityRow, widgetsAttr], FlexDirection.COLUMN);\n flexBoxContainer.style = { 'row-gap': '5px', width: 'fit-content' };\n return [flexBoxContainer];\n}\n\nexport function createRouteDefinitionDescriptor(): BaseEntityDescriptor {\n return new BaseEntityDescriptor({\n entityName: APP_ROUTE_ENTITY_NAME,\n attrDescriptors: createRouteDefinitionAttrDescriptors(),\n i18nScope: APP_ROUTE_I18N_SCOPE,\n // Two parents, one descriptor: an app's own routes and a module's routes are the same schema, and a\n // route has to mean the same thing wherever it was authored. The module's paths are simply relative\n // to the base path its mount gives them.\n componentParent: [APP_DEFINITION_ENTITY_NAME, MODULE_DEFINITION_ENTITY_NAME],\n isEmbedded: true,\n });\n}\n","import { AbstractAttrDescriptor, BaseEntityAttrDescriptor, BaseEntityDescriptor, FlexboxDescriptor, FlexDirection, FormControlType, toSelectables } from '@processpuzzle/base-entity';\nimport { APP_DEFINITION_I18N_SCOPE } from '../base-app.i18n';\nimport { AppDefinitionStatus, COLOR_SCHEMES, LAYOUT_PRESETS, MATERIAL_THEMES, SIDENAV_MODES } from './app-definition';\nimport { APP_DEFINITION_ENTITY_NAME, APP_MODULE_MOUNT_ENTITY_NAME, APP_REGION_ENTITY_NAME, APP_ROUTE_ENTITY_NAME } from './app-entity-names';\nimport { APP_MODULE_MOUNT_ID_FIELD } from './module-mount.descriptors';\nimport { APP_REGION_ID_FIELD } from './region-definition.descriptors';\nimport { APP_ROUTE_ID_FIELD } from './route-definition.descriptors';\n\nexport { APP_DEFINITION_ENTITY_NAME };\n\nconst statusSelectables = toSelectables(Object.keys(AppDefinitionStatus));\n\nfunction createAppDefinitionAttrDescriptors(): AbstractAttrDescriptor[] {\n const idAttr = new BaseEntityAttrDescriptor('id', FormControlType.TEXT_BOX, 'Id');\n idAttr.required = true;\n idAttr.placeholder = 'Unique within the organization, e.g. claims-app';\n\n const nameAttr = new BaseEntityAttrDescriptor('name', FormControlType.TEXT_BOX, 'Name', undefined, true);\n nameAttr.required = true;\n nameAttr.isHeading = true;\n\n const translocoIdAttr = new BaseEntityAttrDescriptor('translocoId', FormControlType.TEXT_BOX, 'Transloco Id');\n translocoIdAttr.placeholder = 'Translation key of the application name';\n translocoIdAttr.hideInTable = true;\n\n const descriptionAttr = new BaseEntityAttrDescriptor('description', FormControlType.TEXTAREA, 'Description');\n descriptionAttr.styleClass = 'full-width';\n descriptionAttr.hideInTable = true;\n\n // Server-assigned: shown so the designer can see where a definition stands, never edited here.\n // Status changes through `POST .../publish`, the versions through any successful write.\n const statusAttr = new BaseEntityAttrDescriptor('status', FormControlType.DROPDOWN, 'Status', statusSelectables);\n statusAttr.disabled = true;\n\n const versionAttr = new BaseEntityAttrDescriptor('version', FormControlType.TEXT_BOX, 'Version');\n versionAttr.disabled = true;\n\n const publishedVersionAttr = new BaseEntityAttrDescriptor('publishedVersion', FormControlType.TEXT_BOX, 'Published Version');\n publishedVersionAttr.disabled = true;\n\n const updatedAtAttr = new BaseEntityAttrDescriptor('updatedAt', FormControlType.TEXT_BOX, 'Updated At');\n updatedAtAttr.disabled = true;\n\n // region theme — flattened out of `theme` by AppDefinitionMapper\n const materialThemeAttr = new BaseEntityAttrDescriptor('materialTheme', FormControlType.DROPDOWN, 'Material Theme', toSelectables(MATERIAL_THEMES));\n materialThemeAttr.hideInTable = true;\n\n const colorSchemeAttr = new BaseEntityAttrDescriptor('colorScheme', FormControlType.DROPDOWN, 'Color Scheme', toSelectables(COLOR_SCHEMES));\n colorSchemeAttr.hideInTable = true;\n\n const logoUrlAttr = new BaseEntityAttrDescriptor('logoUrl', FormControlType.TEXT_BOX, 'Logo Url');\n logoUrlAttr.placeholder = 'Tenant logo shown in the header region';\n logoUrlAttr.hideInTable = true;\n\n const faviconUrlAttr = new BaseEntityAttrDescriptor('faviconUrl', FormControlType.TEXT_BOX, 'Favicon Url');\n faviconUrlAttr.hideInTable = true;\n\n // An open key/value map by contract — keys are `--pp-*` token names, values any CSS color — so a\n // key/value editor is the only shape that can carry it without the form inventing a closed list.\n const tokenOverridesAttr = new BaseEntityAttrDescriptor('tokenOverrides', FormControlType.ADDITIONAL_PROPERTIES, 'Token Overrides');\n tokenOverridesAttr.hideInTable = true;\n // endregion\n\n // region layout — flattened out of `layout` by AppDefinitionMapper\n const presetAttr = new BaseEntityAttrDescriptor('preset', FormControlType.DROPDOWN, 'Layout Preset', toSelectables(LAYOUT_PRESETS));\n presetAttr.hideInTable = true;\n\n const sidenavModeAttr = new BaseEntityAttrDescriptor('sidenavMode', FormControlType.DROPDOWN, 'Sidenav Mode', toSelectables(SIDENAV_MODES));\n sidenavModeAttr.hideInTable = true;\n\n const contentMaxWidthAttr = new BaseEntityAttrDescriptor('contentMaxWidth', FormControlType.TEXT_BOX, 'Content Max Width');\n contentMaxWidthAttr.placeholder = 'CSS length, e.g. 1280px; empty means full width';\n contentMaxWidthAttr.hideInTable = true;\n\n const sidenavCollapsibleAttr = new BaseEntityAttrDescriptor('sidenavCollapsible', FormControlType.CHECKBOX, 'Sidenav Collapsible');\n sidenavCollapsibleAttr.hideInTable = true;\n\n const sidenavOpenByDefaultAttr = new BaseEntityAttrDescriptor('sidenavOpenByDefault', FormControlType.CHECKBOX, 'Sidenav Open By Default');\n sidenavOpenByDefaultAttr.hideInTable = true;\n // endregion\n\n // region nested graph — kept on the entity as-is by AppDefinitionMapper, so the full-replacement PUT preserves it\n // Containment, not association: the contract nests `RegionDefinition`, `RouteDefinition` and\n // `ModuleMount` inside the AppDefinition document, and none has an endpoint of its own, so the rows\n // travel inside this entity's payload and are saved with it. A `ModuleMount` is the exception that\n // proves it — the module it *names* is a separate aggregate with its own endpoints, but the mount\n // itself belongs to this app.\n const regionsAttr = new BaseEntityAttrDescriptor('regions', FormControlType.EMBEDDED_COMPONENTS, 'Regions');\n regionsAttr.linkedEntityType = APP_REGION_ENTITY_NAME;\n // A region has no `id` in the contract; `type` is what identifies it. See APP_REGION_ID_FIELD.\n regionsAttr.referenceIdField = APP_REGION_ID_FIELD;\n regionsAttr.hideInTable = true;\n\n // Flat by design: a route has no children, and the multi-segment paths of these rows are what the\n // shell derives Angular's nesting from at registration time.\n const routesAttr = new BaseEntityAttrDescriptor('routes', FormControlType.EMBEDDED_COMPONENTS, 'Routes');\n routesAttr.linkedEntityType = APP_ROUTE_ENTITY_NAME;\n routesAttr.referenceIdField = APP_ROUTE_ID_FIELD;\n routesAttr.hideInTable = true;\n\n const modulesAttr = new BaseEntityAttrDescriptor('modules', FormControlType.EMBEDDED_COMPONENTS, 'Modules');\n modulesAttr.linkedEntityType = APP_MODULE_MOUNT_ENTITY_NAME;\n modulesAttr.referenceIdField = APP_MODULE_MOUNT_ID_FIELD;\n modulesAttr.hideInTable = true;\n // endregion\n\n const identityRow = new FlexboxDescriptor([idAttr, nameAttr, translocoIdAttr], FlexDirection.ROW);\n identityRow.style = { 'column-gap': '10px' };\n const revisionRow = new FlexboxDescriptor([statusAttr, versionAttr, publishedVersionAttr, updatedAtAttr], FlexDirection.ROW);\n revisionRow.style = { 'column-gap': '10px' };\n const themeRow = new FlexboxDescriptor([materialThemeAttr, colorSchemeAttr], FlexDirection.ROW);\n themeRow.style = { 'column-gap': '10px' };\n const brandingRow = new FlexboxDescriptor([logoUrlAttr, faviconUrlAttr], FlexDirection.ROW);\n brandingRow.style = { 'column-gap': '10px' };\n const layoutRow = new FlexboxDescriptor([presetAttr, sidenavModeAttr, contentMaxWidthAttr], FlexDirection.ROW);\n layoutRow.style = { 'column-gap': '10px' };\n const sidenavRow = new FlexboxDescriptor([sidenavCollapsibleAttr, sidenavOpenByDefaultAttr], FlexDirection.ROW);\n sidenavRow.style = { 'column-gap': '10px' };\n const graphRow = new FlexboxDescriptor([regionsAttr, routesAttr, modulesAttr], FlexDirection.ROW);\n graphRow.style = { 'column-gap': '10px' };\n\n const flexBoxContainer = new FlexboxDescriptor(\n [identityRow, revisionRow, descriptionAttr, themeRow, brandingRow, tokenOverridesAttr, layoutRow, sidenavRow, graphRow],\n FlexDirection.COLUMN,\n );\n flexBoxContainer.style = { 'row-gap': '5px', width: 'fit-content' };\n return [flexBoxContainer];\n}\n\nexport function createAppDefinitionDescriptor(): BaseEntityDescriptor {\n return new BaseEntityDescriptor({ entityName: APP_DEFINITION_ENTITY_NAME, attrDescriptors: createAppDefinitionAttrDescriptors(), i18nScope: APP_DEFINITION_I18N_SCOPE });\n}\n","import { AbstractAttrDescriptor, BaseEntityAttrDescriptor, BaseEntityDescriptor, FlexboxDescriptor, FlexDirection, FormControlType } from '@processpuzzle/base-entity';\nimport { APP_NAV_ITEM_I18N_SCOPE } from '../base-app.i18n';\nimport { APP_NAV_ITEM_ENTITY_NAME, APP_REGION_ENTITY_NAME, APP_ROUTE_ENTITY_NAME } from './app-entity-names';\nimport { APP_ROUTE_ID_FIELD } from './route-definition.descriptors';\n\nexport { APP_NAV_ITEM_ENTITY_NAME };\n\nfunction createNavItemAttrDescriptors(): AbstractAttrDescriptor[] {\n const idAttr = new BaseEntityAttrDescriptor('id', FormControlType.TEXT_BOX, 'Id');\n idAttr.required = true;\n\n const labelAttr = new BaseEntityAttrDescriptor('label', FormControlType.TEXT_BOX, 'Label', undefined, true);\n labelAttr.required = true;\n labelAttr.isHeading = true;\n\n const translocoIdAttr = new BaseEntityAttrDescriptor('translocoId', FormControlType.TEXT_BOX, 'Transloco Id');\n translocoIdAttr.placeholder = 'Translation key of the label';\n translocoIdAttr.hideInTable = true;\n\n const iconAttr = new BaseEntityAttrDescriptor('icon', FormControlType.TEXT_BOX, 'Icon');\n iconAttr.placeholder = 'Material or FontAwesome icon name';\n iconAttr.hideInTable = true;\n\n // A group node expands its children instead of navigating, so this stays optional. The route is\n // resolved by `path` rather than by an id — see APP_ROUTE_ID_FIELD.\n const routePathAttr = new BaseEntityAttrDescriptor('routePath', FormControlType.FOREIGN_KEY, 'Route');\n routePathAttr.linkedEntityType = APP_ROUTE_ENTITY_NAME;\n routePathAttr.referenceIdField = APP_ROUTE_ID_FIELD;\n\n const rolesAttr = new BaseEntityAttrDescriptor('roles', FormControlType.TAGS, 'Roles');\n rolesAttr.placeholder = 'Empty means any authenticated member of the organization';\n rolesAttr.hideInTable = true;\n\n // A group node contains its children rather than pointing at them — they are an inline array of this\n // entry, and the entry itself is nested in the app definition's document.\n const childrenAttr = new BaseEntityAttrDescriptor('children', FormControlType.EMBEDDED_COMPONENTS, 'Children');\n childrenAttr.linkedEntityType = APP_NAV_ITEM_ENTITY_NAME;\n childrenAttr.hideInTable = true;\n\n const identityRow = new FlexboxDescriptor([idAttr, labelAttr, translocoIdAttr], FlexDirection.ROW);\n identityRow.style = { 'column-gap': '10px' };\n const targetRow = new FlexboxDescriptor([iconAttr, routePathAttr], FlexDirection.ROW);\n targetRow.style = { 'column-gap': '10px' };\n\n const flexBoxContainer = new FlexboxDescriptor([identityRow, targetRow, rolesAttr, childrenAttr], FlexDirection.COLUMN);\n flexBoxContainer.style = { 'row-gap': '5px', width: 'fit-content' };\n return [flexBoxContainer];\n}\n\nexport function createNavItemDescriptor(): BaseEntityDescriptor {\n return new BaseEntityDescriptor({\n entityName: APP_NAV_ITEM_ENTITY_NAME,\n attrDescriptors: createNavItemAttrDescriptors(),\n i18nScope: APP_NAV_ITEM_I18N_SCOPE,\n // A nav item hangs off the sidenav region, or off another nav item as a group child.\n componentParent: [APP_REGION_ENTITY_NAME, APP_NAV_ITEM_ENTITY_NAME],\n isEmbedded: true,\n });\n}\n","import { AbstractAttrDescriptor, BaseEntityAttrDescriptor, BaseEntityDescriptor, FlexboxDescriptor, FlexDirection, FormControlType, toSelectables } from '@processpuzzle/base-entity';\nimport { APP_WIDGET_I18N_SCOPE } from '../base-app.i18n';\nimport { WIDGET_PLACEMENTS } from './app-definition';\nimport { APP_REGION_ENTITY_NAME, APP_ROUTE_ENTITY_NAME, APP_WIDGET_ENTITY_NAME } from './app-entity-names';\n\nexport { APP_WIDGET_ENTITY_NAME };\n\nfunction createWidgetInstanceAttrDescriptors(): AbstractAttrDescriptor[] {\n // `id` rather than `type` identifies the widget: it is unique within its page or region, while a\n // page with two `entity-grid`s would otherwise show the same label twice.\n const idAttr = new BaseEntityAttrDescriptor('id', FormControlType.TEXT_BOX, 'Id', undefined, true);\n idAttr.required = true;\n idAttr.isHeading = true;\n idAttr.placeholder = 'Unique within the page or region, e.g. widget-claims-grid';\n\n // Deliberately a free-text box and not a dropdown: `WidgetInstance.type` is a key into the frontend\n // widget registry, which the contract keeps open so new widget types need no schema change.\n const typeAttr = new BaseEntityAttrDescriptor('type', FormControlType.TEXT_BOX, 'Type');\n typeAttr.required = true;\n typeAttr.placeholder = 'Widget registry key, e.g. entity-grid';\n\n // Each widget type owns and validates its own props shape, so the only thing this form can\n // honestly offer is an open key/value editor.\n const propsAttr = new BaseEntityAttrDescriptor('props', FormControlType.ADDITIONAL_PROPERTIES, 'Props');\n propsAttr.hideInTable = true;\n\n // Widgets do not nest: a container widget type lists the ids of siblings in `props.childIds`, and each\n // of those siblings is marked REFERENCED so it is placed by the container instead of rendering twice.\n // That is the whole of composition here — there is no child collection to edit.\n const placementAttr = new BaseEntityAttrDescriptor('placement', FormControlType.DROPDOWN, 'Placement', toSelectables(WIDGET_PLACEMENTS));\n placementAttr.hideInTable = true;\n\n const identityRow = new FlexboxDescriptor([idAttr, typeAttr, placementAttr], FlexDirection.ROW);\n identityRow.style = { 'column-gap': '10px' };\n\n const flexBoxContainer = new FlexboxDescriptor([identityRow, propsAttr], FlexDirection.COLUMN);\n flexBoxContainer.style = { 'row-gap': '5px', width: 'fit-content' };\n return [flexBoxContainer];\n}\n\nexport function createWidgetInstanceDescriptor(): BaseEntityDescriptor {\n return new BaseEntityDescriptor({\n entityName: APP_WIDGET_ENTITY_NAME,\n attrDescriptors: createWidgetInstanceAttrDescriptors(),\n i18nScope: APP_WIDGET_I18N_SCOPE,\n // A widget sits in a header/footer region or on a page — and only there, since it cannot be nested\n // in another widget.\n componentParent: [APP_REGION_ENTITY_NAME, APP_ROUTE_ENTITY_NAME],\n isEmbedded: true,\n });\n}\n","import { AbstractAttrDescriptor, BaseEntityAttrDescriptor, BaseEntityDescriptor, FlexboxDescriptor, FlexDirection, FormControlType } from '@processpuzzle/base-entity';\nimport { MODULE_DEFINITION_I18N_SCOPE } from '../base-app.i18n';\nimport { APP_ROUTE_ENTITY_NAME, MODULE_DEFINITION_ENTITY_NAME } from './app-entity-names';\nimport { APP_ROUTE_ID_FIELD } from './route-definition.descriptors';\n\nexport { MODULE_DEFINITION_ENTITY_NAME };\n\nfunction createModuleDefinitionAttrDescriptors(): AbstractAttrDescriptor[] {\n // The contract's `key`, renamed to `id` by ModuleDefinitionMapper because base-entity keys stores and\n // URLs on `id`. Labelled 'Key' so the designer sees the name the contract and `ModuleMount.moduleKey`\n // use. The pattern is the contract's own: the key is a URL segment of the module endpoints and the\n // prefix a mount composes with, so a value needing encoding would break both.\n const idAttr = new BaseEntityAttrDescriptor('id', FormControlType.TEXT_BOX, 'Key');\n idAttr.required = true;\n idAttr.pattern = '^[a-z0-9]+(-[a-z0-9]+)*$';\n idAttr.placeholder = 'Unique within the organization, e.g. claims — immutable once mounted';\n\n const nameAttr = new BaseEntityAttrDescriptor('name', FormControlType.TEXT_BOX, 'Name', undefined, true);\n nameAttr.required = true;\n nameAttr.isHeading = true;\n\n const translocoIdAttr = new BaseEntityAttrDescriptor('translocoId', FormControlType.TEXT_BOX, 'Transloco Id');\n translocoIdAttr.placeholder = 'Translation key of the module name';\n translocoIdAttr.hideInTable = true;\n\n const descriptionAttr = new BaseEntityAttrDescriptor('description', FormControlType.TEXTAREA, 'Description');\n descriptionAttr.styleClass = 'full-width';\n descriptionAttr.hideInTable = true;\n\n // Left empty means the key, which is the default the contract states — applied by\n // `moduleTranslocoScope` rather than written into the row, so an empty field stays empty.\n const translocoScopeAttr = new BaseEntityAttrDescriptor('translocoScope', FormControlType.TEXT_BOX, 'Transloco Scope');\n translocoScopeAttr.placeholder = \"Scope the module's translations load under; empty means the key\";\n translocoScopeAttr.hideInTable = true;\n\n // Server-assigned, shown so the designer can see where a module stands.\n const versionAttr = new BaseEntityAttrDescriptor('version', FormControlType.TEXT_BOX, 'Version');\n versionAttr.disabled = true;\n\n const updatedAtAttr = new BaseEntityAttrDescriptor('updatedAt', FormControlType.TEXT_BOX, 'Updated At');\n updatedAtAttr.disabled = true;\n\n // The same rows, the same descriptor and the same derived nesting as `AppDefinition.routes` — only the\n // paths are relative to the base path a mount gives them. `App Route` therefore names this entity as a\n // second `componentParent`.\n const routesAttr = new BaseEntityAttrDescriptor('routes', FormControlType.EMBEDDED_COMPONENTS, 'Routes');\n routesAttr.linkedEntityType = APP_ROUTE_ENTITY_NAME;\n routesAttr.referenceIdField = APP_ROUTE_ID_FIELD;\n routesAttr.hideInTable = true;\n\n const identityRow = new FlexboxDescriptor([idAttr, nameAttr, translocoIdAttr], FlexDirection.ROW);\n identityRow.style = { 'column-gap': '10px' };\n const revisionRow = new FlexboxDescriptor([translocoScopeAttr, versionAttr, updatedAtAttr], FlexDirection.ROW);\n revisionRow.style = { 'column-gap': '10px' };\n\n const flexBoxContainer = new FlexboxDescriptor([identityRow, revisionRow, descriptionAttr, routesAttr], FlexDirection.COLUMN);\n flexBoxContainer.style = { 'row-gap': '5px', width: 'fit-content' };\n return [flexBoxContainer];\n}\n\nexport function createModuleDefinitionDescriptor(): BaseEntityDescriptor {\n return new BaseEntityDescriptor({\n entityName: MODULE_DEFINITION_ENTITY_NAME,\n attrDescriptors: createModuleDefinitionAttrDescriptors(),\n i18nScope: MODULE_DEFINITION_I18N_SCOPE,\n });\n}\n","import { RouteDefinition, RouteTarget } from './app-definition';\n\n/** The `RouteDefinition` schema as it travels: `target` nested, exactly as the contract declares it. */\nexport interface RouteDefinitionDto {\n path?: string;\n title?: string;\n translocoId?: string;\n icon?: string;\n roles?: string[];\n target?: RouteTarget;\n}\n\n/**\n * The `target` flattening both aggregates that own routes need — `AppDefinition.routes` and\n * `ModuleDefinition.routes` carry the same schema, and a route authored in a module has to behave\n * exactly like one authored in an app.\n *\n * Why flatten at all: `EMBEDDED_COMPONENTS` edits a row as the flat JSON it arrived as, and a descriptor\n * addresses one property rather than a path, so nothing in the generated form could reach\n * `target.documentSlug`. The contract already keeps `RouteTarget` flat rather than a `oneOf` for the\n * related reason that the form cannot edit a discriminated union of classes.\n */\nexport function flattenRouteTarget(dto: RouteDefinitionDto): RouteDefinition {\n const target = dto.target;\n return new RouteDefinition({\n path: dto.path,\n title: dto.title,\n translocoId: dto.translocoId,\n icon: dto.icon,\n roles: dto.roles,\n kind: target?.kind,\n widgets: target?.widgets,\n documentSlug: target?.documentSlug,\n entityName: target?.entityName,\n entityMode: target?.entityMode,\n rsqlFilter: target?.rsqlFilter,\n // Kept so nestRouteTarget can merge onto it rather than replace it.\n target,\n });\n}\n\n/**\n * The inverse. `kind` is non-optional in the contract but undefined on a row the designer has not\n * finished — the dropdown is `required`, so the form rejects that before a save; the cast keeps this\n * mapping from having to invent a default the backend would then have to second-guess.\n *\n * `widgets` is omitted when empty rather than sent as `[]`, so a DOCUMENT or ENTITY route does not\n * persist an empty widget list it has no use for. The rest is merged onto the `target` the fields were\n * lifted out of, which preserves any field a later contract version adds before this mapping learns\n * about it — a PUT is a full replacement, so anything dropped here is dropped for good.\n */\nexport function nestRouteTarget(route: RouteDefinition): RouteDefinitionDto {\n const widgets = route.widgets;\n return {\n path: route.path,\n title: route.title,\n translocoId: route.translocoId,\n icon: route.icon,\n roles: route.roles,\n target: {\n ...route.target,\n kind: route.kind as RouteTarget['kind'],\n widgets: widgets?.length ? widgets : undefined,\n documentSlug: route.documentSlug,\n entityName: route.entityName,\n entityMode: route.entityMode,\n rsqlFilter: route.rsqlFilter,\n },\n };\n}\n","import { Injectable } from '@angular/core';\nimport { BaseEntityMapper } from '@processpuzzle/base-entity';\nimport { AppDefinition, AppDefinitionStatus, ColorScheme, LayoutDefinition, LayoutPreset, MaterialTheme, SidenavMode, ThemeDefinition } from './app-definition';\nimport { flattenRouteTarget, nestRouteTarget, RouteDefinitionDto } from './route-definition.mapper';\n\ninterface AppDefinitionDto {\n id?: string;\n name?: string;\n translocoId?: string;\n description?: string;\n theme?: ThemeDefinition;\n layout?: LayoutDefinition;\n regions?: AppDefinition['regions'];\n routes?: RouteDefinitionDto[];\n modules?: AppDefinition['modules'];\n orgKey?: string;\n status?: AppDefinitionStatus;\n version?: number;\n publishedVersion?: number;\n createdAt?: string;\n updatedAt?: string;\n}\n\n/** What `PUT /app-definitions/{appId}` receives: the DTO with `theme` and `layout` always rebuilt. */\ntype AppDefinitionPayload = AppDefinitionDto & { theme: ThemeDefinition; layout: LayoutDefinition };\n\n/**\n * Translates between the `AppDefinition` DTO of `base-app-api.yaml` and the flat entity the\n * generated form works with.\n *\n * Two invariants matter here. The form saves `{ ...entity, ...form.value }`, so every DTO field the\n * form does not show has to survive on the entity — `regions`, `routes` and `modules` are nested\n * rather than flattened for exactly that reason, and the `EMBEDDED_COMPONENTS` controls edit them in\n * place. And `PUT /app-definitions/{appId}` is a full replacement, so {@link toDto} rebuilds `theme`\n * and `layout` from the flattened controls *on top of* the objects they were lifted out of, which\n * keeps any field a later contract version adds before this mapper learns about it.\n *\n * A route's `target` is the third thing flattened, one level deeper: `regions` and `modules` rows\n * travel as the raw DTO they arrived as, but a route row cannot. That flattening lives in\n * `route-definition.mapper.ts` rather than here, because `ModuleDefinition.routes` carries the same\n * schema and a route authored in a module has to behave exactly like one authored in an app.\n */\n@Injectable({ providedIn: 'root' })\nexport class AppDefinitionMapper implements BaseEntityMapper<AppDefinition> {\n fromDto(dto: unknown): AppDefinition {\n const source = dto as AppDefinitionDto;\n const theme = source.theme;\n const layout = source.layout;\n return new AppDefinition({\n id: source.id,\n name: source.name,\n translocoId: source.translocoId,\n description: source.description,\n materialTheme: theme?.materialTheme as MaterialTheme | undefined,\n colorScheme: theme?.colorScheme as ColorScheme | undefined,\n tokenOverrides: theme?.tokenOverrides,\n logoUrl: theme?.logoUrl,\n faviconUrl: theme?.faviconUrl,\n preset: layout?.preset as LayoutPreset | undefined,\n sidenavMode: layout?.sidenavMode as SidenavMode | undefined,\n sidenavCollapsible: layout?.sidenavCollapsible,\n sidenavOpenByDefault: layout?.sidenavOpenByDefault,\n contentMaxWidth: layout?.contentMaxWidth,\n theme,\n layout,\n regions: source.regions,\n routes: source.routes?.map(flattenRouteTarget),\n modules: source.modules,\n orgKey: source.orgKey,\n status: source.status,\n version: source.version,\n publishedVersion: source.publishedVersion,\n createdAt: source.createdAt,\n updatedAt: source.updatedAt,\n });\n }\n\n toDto(entity: AppDefinition): AppDefinitionPayload {\n // Listed field by field rather than spread, so the flattened controls never reach the payload.\n return {\n id: entity.id,\n name: entity.name,\n translocoId: entity.translocoId,\n description: entity.description,\n theme: this.mergeTheme(entity),\n layout: this.mergeLayout(entity),\n regions: entity.regions,\n routes: entity.routes?.map(nestRouteTarget),\n modules: entity.modules,\n orgKey: entity.orgKey,\n status: entity.status,\n version: entity.version,\n publishedVersion: entity.publishedVersion,\n createdAt: entity.createdAt,\n updatedAt: entity.updatedAt,\n };\n }\n\n private mergeTheme(entity: AppDefinition): ThemeDefinition {\n return {\n ...entity.theme,\n materialTheme: entity.materialTheme,\n colorScheme: entity.colorScheme,\n tokenOverrides: entity.tokenOverrides,\n logoUrl: entity.logoUrl,\n faviconUrl: entity.faviconUrl,\n };\n }\n\n private mergeLayout(entity: AppDefinition): LayoutDefinition {\n return {\n ...entity.layout,\n preset: entity.preset,\n sidenavMode: entity.sidenavMode,\n sidenavCollapsible: entity.sidenavCollapsible,\n sidenavOpenByDefault: entity.sidenavOpenByDefault,\n contentMaxWidth: entity.contentMaxWidth,\n };\n }\n}\n","import { Injectable } from '@angular/core';\nimport { map, Observable } from 'rxjs';\nimport { BaseEntityRestService, PersistedEntity } from '@processpuzzle/base-entity';\nimport { AppDefinition } from './app-definition';\nimport { AppDefinitionMapper } from './app-definition.mapper';\n\n/**\n * REST access to `/organizations/{orgKey}/app-definitions`. As in base-rule, the organization is\n * part of the configured service root — `APP_SERVICE_ROOT`, the optional per-feature escape hatch,\n * falling back to `BACKEND_SERVICE_ROOT`, which is what every deployment actually sets — so the\n * tenant is a deployment concern rather than something every call has to carry.\n */\n@Injectable({ providedIn: 'root' })\nexport class AppDefinitionService extends BaseEntityRestService<AppDefinition> {\n constructor(protected override entityMapper: AppDefinitionMapper) {\n super(entityMapper, 'APP_SERVICE_ROOT', 'app-definitions');\n }\n\n /**\n * `POST /app-definitions/{appId}/publish` — promotes the stored `version` to `publishedVersion` and\n * sets the status to `PUBLISHED`. The backend validates the definition first and answers 400 when it\n * is not publishable, so the caller only has to deal with the happy path and the error.\n */\n publish(id: string): Observable<PersistedEntity<AppDefinition>> {\n const pathParams = new Map<string, string>([['id', String(id)]]);\n const fullUrl = this.buildFullUrl(this.resourceUrl + '/%{id}/publish', { pathParams });\n if (!fullUrl) throw new Error('Could not determine the full url');\n return this.httpClient.post(fullUrl, {}, { headers: this.headers }).pipe(map((response: unknown) => this.entityMapper.fromDto(response) as PersistedEntity<AppDefinition>));\n }\n}\n","import { inject } from '@angular/core';\nimport { patchState, signalStore, signalStoreFeature, type, withMethods } from '@ngrx/signals';\nimport { withDevtools } from '@angular-architects/ngrx-toolkit';\nimport { BaseEntityContainerStore, BaseEntityStore, BaseEntityTabsStore, PersistedEntity } from '@processpuzzle/base-entity';\nimport { httpErrorMessage } from '@processpuzzle/util';\nimport { firstValueFrom } from 'rxjs';\nimport { AppDefinition } from './app-definition';\nimport { AppDefinitionService } from './app-definition.service';\n\n/** The slice of `BaseEntityStore`'s state that {@link AppDefinitionPublishStore} reads and patches. */\ntype PublishableState = {\n entities: AppDefinition[];\n currentEntity: AppDefinition | undefined;\n isLoading: boolean;\n error: string | undefined;\n};\n\n/**\n * Adds the `publish` use case on top of the generic CRUD store. It keeps the same contract as\n * `addEntity` / `updateEntity`: flip `isLoading`, replace the entity in the list with the server's\n * answer so the form's read-only `status` / `publishedVersion` fields refresh, and surface failures\n * through `error` rather than by throwing.\n */\nexport function AppDefinitionPublishStore() {\n return signalStoreFeature(\n { state: type<PublishableState>() },\n withMethods((store, service = inject(AppDefinitionService)) => ({\n publish: async (id: string): Promise<PersistedEntity<AppDefinition> | undefined> => {\n patchState(store, { isLoading: true, error: undefined });\n try {\n const publishedEntity = await firstValueFrom(service.publish(id));\n const entities = [...store.entities()];\n const indexToUpdate = entities.findIndex((entity) => entity.id === id);\n if (indexToUpdate >= 0) entities[indexToUpdate] = publishedEntity;\n const currentEntity = store.currentEntity()?.id === id ? publishedEntity : store.currentEntity();\n patchState(store, { entities, currentEntity, isLoading: false });\n return publishedEntity;\n } catch (error) {\n patchState(store, { error: httpErrorMessage(error), isLoading: false });\n return undefined;\n }\n },\n })),\n );\n}\n\nexport const AppDefinitionStore = signalStore(\n { providedIn: 'root' },\n BaseEntityStore<AppDefinition>(AppDefinition, () => inject(AppDefinitionService)),\n BaseEntityTabsStore(),\n BaseEntityContainerStore(),\n AppDefinitionPublishStore(),\n withDevtools('AppDefinition'),\n);\n","import { Injectable } from '@angular/core';\nimport { BaseEntityMapper } from '@processpuzzle/base-entity';\nimport { ModuleDefinition } from './module-definition';\nimport { flattenRouteTarget, nestRouteTarget, RouteDefinitionDto } from './route-definition.mapper';\n\ninterface ModuleDefinitionDto {\n key?: string;\n name?: string;\n translocoId?: string;\n description?: string;\n translocoScope?: string;\n routes?: RouteDefinitionDto[];\n orgKey?: string;\n version?: number;\n createdAt?: string;\n updatedAt?: string;\n}\n\n/**\n * Translates between the `ModuleDefinition` DTO of `base-app-api.yaml` and the entity the generated form\n * works with. Two renamings, and nothing else — a module is a much smaller aggregate than an app:\n *\n * - **`key` becomes `id`.** base-entity keys every store, URL and reference on `id`, so the rename\n * happens here rather than in the framework. See {@link ModuleDefinition.id}.\n * - **each route's `target` is flattened** onto the row and re-nested on save, by the same functions\n * `AppDefinitionMapper` uses, so a route authored in a module behaves like one authored in an app.\n */\n@Injectable({ providedIn: 'root' })\nexport class ModuleDefinitionMapper implements BaseEntityMapper<ModuleDefinition> {\n fromDto(dto: unknown): ModuleDefinition {\n const source = dto as ModuleDefinitionDto;\n return new ModuleDefinition({\n id: source.key,\n name: source.name,\n translocoId: source.translocoId,\n description: source.description,\n translocoScope: source.translocoScope,\n routes: source.routes?.map(flattenRouteTarget),\n orgKey: source.orgKey,\n version: source.version,\n createdAt: source.createdAt,\n updatedAt: source.updatedAt,\n });\n }\n\n toDto(entity: ModuleDefinition): ModuleDefinitionDto {\n // Field by field rather than spread, so `id` does not travel beside the `key` it became.\n return {\n key: entity.id,\n name: entity.name,\n translocoId: entity.translocoId,\n description: entity.description,\n translocoScope: entity.translocoScope,\n routes: entity.routes?.map(nestRouteTarget),\n orgKey: entity.orgKey,\n version: entity.version,\n createdAt: entity.createdAt,\n updatedAt: entity.updatedAt,\n };\n }\n}\n","import { Injectable } from '@angular/core';\nimport { BaseEntityRestService } from '@processpuzzle/base-entity';\nimport { ModuleDefinition } from './module-definition';\nimport { ModuleDefinitionMapper } from './module-definition.mapper';\n\n/**\n * REST access to `/organizations/{orgKey}/modules`. As for `AppDefinitionService`, the organization is\n * part of the configured service root (`APP_SERVICE_ROOT`, falling back to `BACKEND_SERVICE_ROOT`), so\n * the tenant is a deployment concern rather\n * than something every call has to carry.\n *\n * The URL variable is the module key — `ModuleDefinitionMapper` maps it onto `id`, which is what the\n * inherited `findById` builds `GET .../modules/{moduleKey}` from. That single-module read is also the call\n * the shell makes when something first navigates under a mount; see `ModuleLoader` in\n * `app-route-builder.ts`.\n */\n@Injectable({ providedIn: 'root' })\nexport class ModuleDefinitionService extends BaseEntityRestService<ModuleDefinition> {\n constructor(protected override entityMapper: ModuleDefinitionMapper) {\n super(entityMapper, 'APP_SERVICE_ROOT', 'modules');\n }\n}\n","import { inject } from '@angular/core';\nimport { signalStore } from '@ngrx/signals';\nimport { withDevtools } from '@angular-architects/ngrx-toolkit';\nimport { BaseEntityContainerStore, BaseEntityStore, BaseEntityTabsStore } from '@processpuzzle/base-entity';\nimport { ModuleDefinition } from './module-definition';\nimport { ModuleDefinitionService } from './module-definition.service';\n\n/**\n * Plain generic CRUD — a module has no `publish` of its own. Publishing is an `AppDefinition` operation:\n * an app is what a user navigates to, and its status is what decides whether a mount is live. Giving a\n * module a second, independent lifecycle would make \"which version of what is live\" a question with two\n * answers.\n */\nexport const ModuleDefinitionStore = signalStore(\n { providedIn: 'root' },\n BaseEntityStore<ModuleDefinition>(ModuleDefinition, () => inject(ModuleDefinitionService)),\n BaseEntityTabsStore(),\n BaseEntityContainerStore(),\n withDevtools('ModuleDefinition'),\n);\n","import { inject, Injectable, Type } from '@angular/core';\nimport { BaseEntityDescriptor, BaseEntityFacade } from '@processpuzzle/base-entity';\nimport { AppDefinition } from '../domain/app-definition';\nimport { AppDefinitionMapper } from '../domain/app-definition.mapper';\nimport { AppDefinitionService } from '../domain/app-definition.service';\nimport { AppDefinitionStore } from '../domain/app-definition.store';\nimport { createAppDefinitionDescriptor } from '../domain/app-definition.descriptors';\n\n@Injectable()\nexport class AppDefinitionFacade extends BaseEntityFacade<AppDefinition> {\n readonly entityType = AppDefinition;\n\n private readonly mapperRef = inject(AppDefinitionMapper);\n private readonly serviceRef = inject(AppDefinitionService);\n\n protected override createMapper() {\n return this.mapperRef;\n }\n\n protected override createService() {\n return this.serviceRef;\n }\n\n protected override createStoreClass(): Type<unknown> {\n return AppDefinitionStore;\n }\n\n protected override createDescriptor(): BaseEntityDescriptor {\n return createAppDefinitionDescriptor();\n }\n}\n","import { inject, Injectable, Type } from '@angular/core';\nimport { BaseEntityDescriptor, BaseEntityFacade } from '@processpuzzle/base-entity';\nimport { ModuleDefinition } from '../domain/module-definition';\nimport { createModuleDefinitionDescriptor } from '../domain/module-definition.descriptors';\nimport { ModuleDefinitionMapper } from '../domain/module-definition.mapper';\nimport { ModuleDefinitionService } from '../domain/module-definition.service';\nimport { ModuleDefinitionStore } from '../domain/module-definition.store';\n\n@Injectable()\nexport class ModuleDefinitionFacade extends BaseEntityFacade<ModuleDefinition> {\n readonly entityType = ModuleDefinition;\n\n private readonly mapperRef = inject(ModuleDefinitionMapper);\n private readonly serviceRef = inject(ModuleDefinitionService);\n\n protected override createMapper() {\n return this.mapperRef;\n }\n\n protected override createService() {\n return this.serviceRef;\n }\n\n protected override createStoreClass(): Type<unknown> {\n return ModuleDefinitionStore;\n }\n\n protected override createDescriptor(): BaseEntityDescriptor {\n return createModuleDefinitionDescriptor();\n }\n}\n","import { Injectable } from '@angular/core';\nimport { BaseEntityDescriptor, EmbeddedEntityFacade } from '@processpuzzle/base-entity';\nimport { ModuleMount } from '../domain/app-definition';\nimport { createModuleMountDescriptor } from '../domain/module-mount.descriptors';\n\n/**\n * A mount is a row of the `App Definition` document, so it is edited through that document — unlike the\n * `ModuleDefinition` it names, which is an aggregate of its own with its own endpoints.\n */\n@Injectable()\nexport class AppModuleMountFacade extends EmbeddedEntityFacade<ModuleMount> {\n readonly entityType = ModuleMount;\n\n protected override createDescriptor(): BaseEntityDescriptor {\n return createModuleMountDescriptor();\n }\n}\n","import { Injectable } from '@angular/core';\nimport { BaseEntityDescriptor, EmbeddedEntityFacade } from '@processpuzzle/base-entity';\nimport { NavItem } from '../domain/app-definition';\nimport { createNavItemDescriptor } from '../domain/nav-item.descriptors';\n\n/**\n * One facade covers every level of the nav tree, however deep: the store is a root singleton and the row\n * it stands for comes from the route, so `app-nav-item/a/details/app-nav-item/b/details` resolves through\n * the same facade as the top level.\n */\n@Injectable()\nexport class AppNavItemFacade extends EmbeddedEntityFacade<NavItem> {\n readonly entityType = NavItem;\n\n protected override createDescriptor(): BaseEntityDescriptor {\n return createNavItemDescriptor();\n }\n}\n","import { Route, Routes } from '@angular/router';\nimport { provideTranslocoScope } from '@jsverse/transloco';\nimport { ModuleMount, RouteDefinition } from '../domain/app-definition';\nimport { ModuleDefinition, moduleTranslocoScope } from '../domain/module-definition';\nimport { BASE_APP_TRANSLOCO_SCOPE, BASE_ENTITY_TRANSLOCO_SCOPE } from '../base-app.i18n';\n\n/**\n * What the run-time shell registers routes from. `routes` and `modules` are the app definition's own\n * fields; the other two are how the routes of a mounted module get in.\n *\n * `moduleRoutes` holds the modules the shell already has, keyed by module key. `loadModule` is for the\n * ones it does not: a mount whose key is absent from `moduleRoutes` becomes a `loadChildren` that calls\n * it on first navigation into the mount. With neither, such a mount contributes nothing — a mount naming\n * a module that has not been authored is a warning rather than an error.\n *\n * A key present in `moduleRoutes` is never loaded again, so an empty array there says \"this module has no\n * routes\" and is honoured as such.\n */\nexport interface AppRouteSource {\n routes?: RouteDefinition[];\n modules?: ModuleMount[];\n moduleRoutes?: Record<string, RouteDefinition[] | undefined>;\n loadModule?: ModuleLoader;\n}\n\n/**\n * Fetches one module by key, or resolves to `undefined` if the organization has no such module. Rejecting\n * is a navigation error; resolving to `undefined` is the loose coupling the contract asks for.\n */\nexport type ModuleLoader = (moduleKey: string) => Promise<ModuleDefinition | undefined>;\n\n/**\n * Turns one authored route into the `Route` that renders it — component or `loadComponent`, `title`,\n * `data`, and any `canMatch` guard the definition's `roles` call for. `path` is {@link buildAppRoutes}'\n * to set; `children` it may contribute, and the authored ones are appended to them.\n *\n * May be asynchronous. An `ENTITY` route's screens are built from a `BaseEntityDescriptor` that has to be\n * *fetched* when the entity exists only as metadata, and the routes below it depend on what that\n * descriptor turns out to contain — which embedded children it carries. Making the renderer async is what\n * lets a route be emitted complete or not at all; the alternative, a guard that fills `children` in on the\n * way past, has no way to signal failure other than leaving the route matching nothing.\n */\nexport type RouteRenderer = (definition: RouteDefinition) => Route | Promise<Route>;\n\ninterface TrieNode {\n segment: string;\n definition?: RouteDefinition;\n children: TrieNode[];\n}\n\n/**\n * Derives Angular's nested `Routes` from the flat route list of an `AppDefinition`.\n *\n * Nesting is computed here rather than authored, which is the whole point of keeping\n * {@link RouteDefinition} flat: `claims`, `claims/open` and `claims/:id` are three sibling rows a\n * designer can reorder, rename and reason about one at a time, and it is only at registration that\n * they become a parent with two children. Two rules produce that shape:\n *\n * - **An authored route that is a prefix of others becomes their parent.** So `claims` stays mounted\n * while `claims/open` renders in its `<router-outlet>` — which is the one thing a flat registration\n * could not express, and the reason this function exists at all. A component rendering a route that\n * has children therefore has to host an outlet.\n * - **A prefix nothing authored stays part of the path.** With only `claims/open` and `claims/closed`\n * declared, no synthetic `claims` parent is invented: the two are emitted with their full paths, since\n * a component-less grouping node would change nothing about what matches or what renders.\n *\n * Modules mount as a parent of their own at {@link ModuleMount.basePath}, component-less because a mount\n * is a prefix rather than a screen. That is the single composition point, and it composes one level: the\n * routes of a mounted module are built by the same two rules, and a module mounts no modules. A module the\n * shell already has is emitted now; one it has not is emitted as `loadChildren` — see {@link lazyMount}.\n *\n * Siblings are ordered static-prefix-first, so `claims/new` is matched before `claims/:id` rather than\n * swallowed by it. Beyond that the authored order is kept, and a duplicate path — which the backend\n * rejects as an error, so it should never arrive — keeps its first occurrence.\n */\nexport async function buildAppRoutes(source: AppRouteSource, renderRoute: RouteRenderer): Promise<Routes> {\n const appRoutes = await emitLevel(trieOf(source.routes), [], renderRoute);\n return [...appRoutes, ...(await moduleRoutesOf(source, renderRoute))];\n}\n\nasync function moduleRoutesOf(source: AppRouteSource, renderRoute: RouteRenderer): Promise<Routes> {\n const mounted: Routes = [];\n for (const mount of source.modules ?? []) {\n if (!mount.basePath) continue;\n const routes = source.moduleRoutes?.[mount.moduleKey];\n if (routes) {\n if (routes.length) mounted.push({ path: mount.basePath, children: await emitLevel(trieOf(routes), [], renderRoute) });\n } else if (source.loadModule) {\n mounted.push(lazyMount(mount.moduleKey, mount.basePath, source.loadModule, renderRoute));\n }\n }\n return mounted;\n}\n\n/**\n * A mount whose module the shell has not got yet: the same component-less parent at the base path, with\n * its children resolved on first navigation into it instead of now.\n *\n * What is deferred is the *metadata* — one `GET /modules/{key}` per module the user actually visits, so an\n * app that mounts twenty modules does not fetch twenty definitions to show its first screen. It is not a\n * deferred *bundle*: the widgets a module's routes render come from the widget registry and are part of\n * the application's own build either way.\n *\n * The module's transloco scope is registered here, on a component-less wrapper inside the loaded children,\n * because that is the first moment its name is known — the default is the module key, but a module may\n * name its own. The alias is spelled out, as everywhere in this workspace: transloco would otherwise\n * camel-case it and miss every key below it.\n *\n * The framework scopes are re-registered alongside it, for the reason `BASE_APP_ROUTES.authoringScopes()`\n * gives: a route that declares TRANSLOCO_SCOPE *replaces* the collection it inherits rather than adding to\n * it, because Angular does not merge `multi` providers across injectors. A module's routes render the same\n * generic screens as everything else — an ENTITY route reaches `BaseEntityTabsComponent`, which translates\n * `base_entity.tabs.*` — so naming only the module's scope here would leave every framework label below the\n * mount unresolved.\n */\nfunction lazyMount(moduleKey: string, basePath: string, loadModule: ModuleLoader, renderRoute: RouteRenderer): Route {\n return {\n path: basePath,\n loadChildren: async () => {\n const definition = await loadModule(moduleKey);\n const children = await emitLevel(trieOf(definition?.routes), [], renderRoute);\n if (!definition || !children.length) return [];\n const scope = moduleTranslocoScope(definition);\n const providers = [\n provideTranslocoScope(\n { scope, alias: scope },\n { scope: BASE_ENTITY_TRANSLOCO_SCOPE, alias: BASE_ENTITY_TRANSLOCO_SCOPE },\n { scope: BASE_APP_TRANSLOCO_SCOPE, alias: BASE_APP_TRANSLOCO_SCOPE },\n ),\n ];\n return [{ path: '', providers, children }];\n },\n };\n}\n\n/** The authored paths as a trie, so a route that is a prefix of another can be recognized as its parent. */\nfunction trieOf(routes: RouteDefinition[] | undefined): TrieNode[] {\n const roots: TrieNode[] = [];\n for (const definition of routes ?? []) {\n const segments = segmentsOf(definition.path);\n if (!segments.length) continue;\n let level = roots;\n let node: TrieNode = { segment: '', children: roots };\n for (const segment of segments) {\n const existing = level.find((candidate) => candidate.segment === segment);\n node = existing ?? { segment, children: [] };\n if (!existing) level.push(node);\n level = node.children;\n }\n // First occurrence wins: a duplicate path is a validation error server-side, so the only way to see\n // one here is a definition that bypassed validation, and dropping the later row is the harmless read.\n node.definition ??= definition;\n }\n return roots;\n}\n\n/**\n * The routes of one level. An authored node becomes a `Route` whose children are emitted below it; an\n * unauthored one contributes its segment to the paths of its descendants instead of a route of its own.\n */\nasync function emitLevel(nodes: TrieNode[], prefix: string[], renderRoute: RouteRenderer): Promise<Routes> {\n const routes = (await Promise.all(nodes.map((node) => emitNode(node, prefix, renderRoute)))).flat();\n return routes.sort((left, right) => staticDepthOf(right.path) - staticDepthOf(left.path));\n}\n\nasync function emitNode(node: TrieNode, prefix: string[], renderRoute: RouteRenderer): Promise<Routes> {\n const path = [...prefix, node.segment];\n if (!node.definition) return (await Promise.all(node.children.map((child) => emitNode(child, path, renderRoute)))).flat();\n\n const authoredChildren = await emitLevel(node.children, [], renderRoute);\n const rendered = await renderRoute(node.definition);\n const route: Route = { ...rendered, path: path.join('/') };\n // The renderer's own children come first and the authored ones after, rather than the authored ones\n // replacing them. An `ENTITY` route contributes the List and Details routes of its entity *and* may be\n // the path prefix of other authored routes; overwriting would silently drop whichever of the two the\n // builder happened not to know about. The renderer's include an empty-path redirect, which `pathMatch:\n // 'full'` confines to the prefix's own URL, so it cannot shadow an authored sibling.\n const children = [...(rendered.children ?? []), ...authoredChildren];\n if (children.length) route.children = children;\n return [route];\n}\n\nfunction segmentsOf(path: string | undefined): string[] {\n return (path ?? '').split('/').filter((segment) => segment.length > 0);\n}\n\n/**\n * How many leading segments of a path are static. Sorting by it descending is what keeps a parameterized\n * route from shadowing its static siblings: `claims/new` scores 2, `claims/:id` scores 1, and Angular\n * matches in the order given.\n */\nfunction staticDepthOf(path: string | undefined): number {\n const segments = segmentsOf(path);\n const firstParameter = segments.findIndex((segment) => segment.startsWith(':') || segment === '**');\n return firstParameter === -1 ? segments.length : firstParameter;\n}\n","import { CommonModule } from '@angular/common';\nimport { Component, Type, computed, inject, input } from '@angular/core';\nimport { WIDGET_REGISTRY, WidgetInstance, WidgetPlacement } from '@processpuzzle/widgets';\n\n/**\n * One widget as it is rendered: the component the registry answered with, or none.\n *\n * Resolved once per definition into a computed rather than by a template method, so the lookup does not\n * re-run on every change detection pass and `ngComponentOutlet` is not handed a fresh value each time.\n */\nexport interface WidgetRow {\n id: string;\n type: string;\n props?: Record<string, unknown>;\n /** Absent when no `provideWidget()` in the hosting application answers `type`. */\n component?: Type<unknown>;\n}\n\n/** Maps widget instances onto rows, dropping the ones a container places by id rather than in sequence. */\nexport function toWidgetRows(widgets: WidgetInstance[] | undefined, registry: ReadonlyMap<string, Type<unknown>>): WidgetRow[] {\n return (widgets ?? [])\n .filter((widget) => widget.placement !== WidgetPlacement.REFERENCED)\n .map((widget) => {\n const component = registry.get(widget.type);\n return { id: widget.id, type: widget.type, props: widget.props, ...(component ? { component } : {}) };\n });\n}\n\n/**\n * Renders the top-level widgets shared by routed content and static shell regions.\n *\n * A `WidgetInstance.type` is an open string on the contract and the server checks it for blankness alone —\n * it cannot know which components the hosting application registered. So an unregistered type is a state\n * this component has to render, not one it can rule out: it shows a placeholder naming the type, where\n * throwing would take the whole shell down over one mistyped widget in one region and leave the designer\n * with a blank page instead of a pointer to the row at fault.\n */\n@Component({\n selector: 'pp-widget-list',\n standalone: true,\n imports: [CommonModule],\n template: `\n @for (row of rows(); track row.id) {\n @if (row.component; as component) {\n <ng-container *ngComponentOutlet=\"component; inputs: row.props\"></ng-container>\n } @else {\n <span class=\"pp-widget-list__unregistered\" [attr.data-testid]=\"'unregistered-' + row.id\" [title]=\"explain(row.type)\">{{ row.type }}</span>\n }\n }\n `,\n styles: [\n `\n .pp-widget-list__unregistered {\n font-style: italic;\n opacity: 0.6;\n }\n `,\n ],\n})\nexport class WidgetListComponent {\n readonly widgets = input<WidgetInstance[]>([]);\n\n /** Optional: an application that registers no widget at all renders every instance as a placeholder. */\n private readonly registry = inject(WIDGET_REGISTRY, { optional: true }) ?? new Map<string, Type<unknown>>();\n\n protected readonly rows = computed(() => toWidgetRows(this.widgets(), this.registry));\n\n protected explain(type: string): string {\n return `No component is registered for widget type '${type}' — check the provideWidget() calls of this application.`;\n }\n}\n","import { Component, inject } from '@angular/core';\nimport { ActivatedRoute } from '@angular/router';\nimport { WidgetInstance } from '@processpuzzle/widgets';\nimport { WidgetListComponent } from './widget-list.component';\n\n/**\n * Renders a route whose kind is WIDGETS: every STANDALONE instance in order, via NgComponentOutlet\n * resolved against WIDGET_REGISTRY. REFERENCED instances are skipped here for the same reason\n * DocumentEditorComponent skips them at its top level — they're placed by whichever STANDALONE\n * container widget names them in props.childIds, not by this component.\n *\n * Delegates the common widget rendering rule to WidgetListComponent, which is also used by the\n * header and footer regions in the application preview.\n */\n@Component({\n selector: 'pp-route-widgets',\n standalone: true,\n imports: [WidgetListComponent],\n template: `<pp-widget-list [widgets]=\"widgets\" />`,\n})\nexport class RouteWidgetsComponent {\n private readonly route = inject(ActivatedRoute);\n\n protected readonly widgets = (this.route.snapshot.data['widgets'] as WidgetInstance[] | undefined) ?? [];\n}\n","import { Component, computed, inject } from '@angular/core';\nimport { ActivatedRoute } from '@angular/router';\n\n/**\n * Fallback rendered by {@link AppRouteRenderer} for a route kind it doesn't yet know how to build a\n * real component for (today: DOCUMENT, and any kind value the frontend doesn't recognize). Exists so\n * an unfinished part of the shell fails visibly and specifically at the one route that hits it,\n * rather than throwing during route registration and taking the whole app down, or — worse — silently\n * rendering nothing and leaving a designer to wonder why their route is blank.\n *\n * Not an error state: an app definition is allowed to reference a route kind the frontend hasn't\n * caught up to yet, same spirit as a NavItem naming a route that hasn't been authored being a warning\n * rather than a validation failure elsewhere in this library.\n */\n@Component({\n selector: 'pp-route-unsupported',\n standalone: true,\n template: `<p class=\"pp-route-unsupported\">{{ reason() }}</p>`,\n})\nexport class RouteUnsupportedComponent {\n private readonly route = inject(ActivatedRoute);\n\n protected readonly reason = computed(() => (this.route.snapshot.data['reason'] as string) ?? 'This route is not yet supported.');\n}\n","import { inject, Injectable } from '@angular/core';\nimport { ResolveFn, Route } from '@angular/router';\nimport { TranslocoService } from '@jsverse/transloco';\nimport { entityScreenRoute, EntityScreenResolver, translateLabel } from '@processpuzzle/base-entity';\nimport { RouteDefinition } from '../domain/app-definition';\nimport { RouteWidgetsComponent } from './route-widgets.component';\nimport { RouteUnsupportedComponent } from './route-unsupported.component';\n\n/**\n * The route's `title`, preferring `translocoId` over the authored literal where the key resolves.\n *\n * A `ResolveFn` rather than a plain string because a title is resolved per navigation, which is late\n * enough for a lazily-loaded module scope to have arrived — the string form is captured when the route is\n * built, before the scope that owns the key is registered. `translateLabel` falls back to the literal, so\n * a route whose scope is absent or whose key is missing keeps the authored title.\n */\nfunction titleOf(definition: RouteDefinition): ResolveFn<string> {\n return () => translateLabel(inject(TranslocoService), definition.translocoId, definition.title);\n}\n\n/**\n * The `RouteRenderer` {@link buildAppRoutes} needs — turns one authored `RouteDefinition` into the\n * `Route` that actually renders it. Owns `component`, `data` and any `children` the kind calls for; `path`\n * is `buildAppRoutes`' to set, and the routes authored *below* this one are appended to whatever children\n * this contributes.\n *\n * A separate injectable rather than a free function because it is the one piece Preview and the eventual\n * production shell must call identically — same reasoning as `buildAppRoutes` itself being free of any\n * component.\n *\n * `roles` -> `canMatch` is deliberately not set here yet — see the note on this design's own deferral of\n * that question. `kind: DOCUMENT` is deliberately unhandled too: `BaseDocumentContainerComponent` is an\n * authoring component wired to one document via an injected store, not something parameterizable by a\n * route's `documentSlug` at runtime. Rendering a document read-only inside a live app is its own small\n * design question and this falls through to {@link RouteUnsupportedComponent} rather than guessing.\n */\n@Injectable({ providedIn: 'root' })\nexport class AppRouteRenderer {\n private readonly entityScreens = inject(EntityScreenResolver);\n\n render = async (definition: RouteDefinition): Promise<Route> => {\n switch (definition.kind) {\n case 'WIDGETS':\n return { component: RouteWidgetsComponent, title: titleOf(definition), data: { widgets: definition.widgets } };\n case 'ENTITY':\n return this.entityRoute(definition);\n case 'DOCUMENT':\n return {\n component: RouteUnsupportedComponent,\n title: titleOf(definition),\n data: { reason: `DOCUMENT routes are not yet supported (route '${definition.path}')` },\n };\n default:\n return {\n component: RouteUnsupportedComponent,\n title: titleOf(definition),\n data: { reason: `Unknown route kind '${String(definition.kind)}' (route '${definition.path}')` },\n };\n }\n };\n\n /**\n * An `ENTITY` route: base-entity's generated screens, mounted at the authored path.\n *\n * Both halves belong to base-entity and are called rather than reimplemented here: `EntityScreenResolver`\n * answers for an entity with a compile-time facade and for one that exists only as a `BaseEntityDefinition`\n * alike, and `entityScreenRoute` owns the URL shape those screens need. What is left is exactly the\n * *application definition* concern — when the routes are built, the authored title, and the authored\n * `entityMode` / `rsqlFilter`.\n *\n * The descriptor is resolved **before** the route exists, which is what makes the route either complete or\n * a leaf. An entity nothing answers to keeps the leaf, whose component says so at the URL the nav item\n * links to; a legitimate state, since an `AppDefinition` may name an entity that has been renamed or one\n * whose definitions this deployment's backend does not serve.\n *\n * `entityMode` is passed along but not applied. A `DETAILS` route lands on the list, from which the row is\n * one click away: making it open a form directly means carrying the authored route's own `:id` into the\n * child URL, and the `RedirectFunction` that would do it receives a *partial* route snapshot whose\n * parameter inheritance at recognition time is not something to bet a navigation on. Deferred with `roles`\n * and `rsqlFilter` rather than guessed at.\n */\n private async entityRoute(definition: RouteDefinition): Promise<Route> {\n const screens = await this.entityScreens.resolve(definition.entityName);\n const route = entityScreenRoute({\n entityName: definition.entityName,\n screens,\n hostPath: definition.path,\n data: { entityMode: definition.entityMode, rsqlFilter: definition.rsqlFilter },\n });\n\n return { ...route, title: titleOf(definition) };\n }\n}\n","import { Injectable } from '@angular/core';\nimport { BaseEntityDescriptor, EmbeddedEntityFacade } from '@processpuzzle/base-entity';\nimport { RegionDefinition } from '../domain/app-definition';\nimport { createRegionDefinitionDescriptor } from '../domain/region-definition.descriptors';\n\n/**\n * A region has a facade like any other entity — that is what gives it a store, and so a working list and\n * form. Its repository reads and writes the `App Definition` document instead of an endpoint of its own,\n * because the contract nests `regions` inside that document.\n */\n@Injectable()\nexport class AppRegionFacade extends EmbeddedEntityFacade<RegionDefinition> {\n readonly entityType = RegionDefinition;\n\n protected override createDescriptor(): BaseEntityDescriptor {\n return createRegionDefinitionDescriptor();\n }\n}\n","import { Injectable } from '@angular/core';\nimport { BaseEntityDescriptor, EmbeddedEntityFacade } from '@processpuzzle/base-entity';\nimport { RouteDefinition } from '../domain/app-definition';\nimport { createRouteDefinitionDescriptor } from '../domain/route-definition.descriptors';\n\n/**\n * `GET .../app-definitions/{appId}/layout` is a read-only projection for the run-time shell, not a write\n * endpoint — a route is authored inside the `App Definition` document, so its store goes through that\n * document like every other embedded child of the graph.\n */\n@Injectable()\nexport class AppRouteFacade extends EmbeddedEntityFacade<RouteDefinition> {\n readonly entityType = RouteDefinition;\n\n protected override createDescriptor(): BaseEntityDescriptor {\n return createRouteDefinitionDescriptor();\n }\n}\n","import { Injectable } from '@angular/core';\nimport { BaseEntityDescriptor, EmbeddedEntityFacade } from '@processpuzzle/base-entity';\nimport { WidgetInstance } from '../domain/app-definition';\nimport { createWidgetInstanceDescriptor } from '../domain/widget-instance.descriptors';\n\n/**\n * A widget sits under a region, a page or another widget, and one facade serves all three: which owner's\n * rows its store reads is decided by the route that is open, not by the facade.\n */\n@Injectable()\nexport class AppWidgetFacade extends EmbeddedEntityFacade<WidgetInstance> {\n readonly entityType = WidgetInstance;\n\n protected override createDescriptor(): BaseEntityDescriptor {\n return createWidgetInstanceDescriptor();\n }\n}\n","import { AppDefinition, ColorScheme, LayoutPreset, SidenavMode } from '../../domain/app-definition';\n\n/**\n * The layout decisions {@link AppShellComponent} renders from, resolved out of an `AppDefinition`'s\n * `layout` fields with every default already applied — so the template reads values rather than\n * spelling out fallbacks, and every default is asserted in one spec instead of being implied by a\n * `??` in markup.\n *\n * A plain function rather than a service for the same reason `buildAppRoutes` is one: nothing here\n * needs injection, and a pure derivation is testable without a `TestBed`.\n */\nexport interface ResolvedLayout {\n preset: LayoutPreset;\n /**\n * Always resolved, even for `top-nav` where it is meaningless — {@link hasSidenav} is what says\n * whether a sidenav is rendered at all. Leaving it undefined there would only push a `?? 'side'`\n * into the template that no definition can ever reach, since `hasSidenav` already implies a mode.\n */\n sidenavMode: SidenavMode;\n /** `end` for `sidenav-right`, `start` otherwise — the values `matSidenav`'s `position` takes. */\n sidenavPosition: 'start' | 'end';\n /** Whether the shell renders a sidenav at all. False for `top-nav`. */\n hasSidenav: boolean;\n sidenavOpened: boolean;\n sidenavCollapsible: boolean;\n /** Undefined means unconstrained, which is what an absent `contentMaxWidth` asks for. */\n contentMaxWidth?: string;\n}\n\n/**\n * `sidenav-left` because a definition that declares no preset is the common case — a freshly created\n * app — and the framework's own screens are left-sidenav. The same value the contract documents as\n * its default.\n */\nconst DEFAULT_PRESET: LayoutPreset = 'sidenav-left';\n\n/** Matches the contract's default and Material's own, so an unset value behaves as `mat-sidenav` does. */\nconst DEFAULT_SIDENAV_MODE: SidenavMode = 'side';\n\n/**\n * Resolves the layout of one definition.\n *\n * Each field is read from the flattened property first and from `layout` second. For an entity that\n * came through {@link AppDefinitionMapper} the two always agree — `fromDto` copies `layout.preset`\n * onto `preset`, and `toDto` merges the flattened value back — so the fallback is there for the\n * definitions nothing mapped: `new AppDefinition({ layout: { preset: 'top-nav' } })` is a legal\n * construction that leaves `preset` undefined, and a shell that ignored `layout` would silently\n * render the default instead.\n *\n * `sidenavCollapsible` and `sidenavOpenByDefault` need no such fallback: they are non-optional on the\n * entity and the constructor defaults them, so there is always a value to read.\n */\nexport function layoutOf(definition: AppDefinition | undefined): ResolvedLayout {\n const preset = definition?.preset ?? definition?.layout?.preset ?? DEFAULT_PRESET;\n\n return {\n preset,\n sidenavMode: definition?.sidenavMode ?? definition?.layout?.sidenavMode ?? DEFAULT_SIDENAV_MODE,\n sidenavPosition: preset === 'sidenav-right' ? 'end' : 'start',\n hasSidenav: preset !== 'top-nav',\n sidenavOpened: definition?.sidenavOpenByDefault ?? true,\n sidenavCollapsible: definition?.sidenavCollapsible ?? true,\n contentMaxWidth: definition?.contentMaxWidth ?? definition?.layout?.contentMaxWidth,\n };\n}\n\n/**\n * The `--pp-*` overrides of one definition, as a style object to bind on the shell's host element.\n *\n * Custom properties cascade, so setting them on one element re-tints every framework surface below it\n * — which is what makes a themed preview possible at all without an iframe. `materialTheme` and\n * `colorScheme` are deliberately **not** handled: those want `:root` and a Material theme class, and\n * neither scopes to a subtree. They belong to the standalone runtime host, where the shell owns the\n * document.\n *\n * Keys are passed through untouched, including their leading `--`: Angular's `[style]` binding treats\n * a custom property as a custom property, and the contract calls these overrides of the tokens in\n * `pp-colors.css`, so anything else would be this function inventing a naming rule.\n */\nexport function themeVarsOf(definition: AppDefinition | undefined): Record<string, string> {\n // The nested object first, so an override the form actually edited wins over the one the server sent.\n return { ...definition?.theme?.tokenOverrides, ...definition?.tokenOverrides };\n}\n\n/**\n * The route paths this definition accounts for: its own routes' paths, plus the base path of every module\n * it mounts.\n *\n * A module's *own* routes are deliberately absent. They live in the module's definition, which the router\n * fetches only when something navigates into the mount, so they cannot be known here — which is why the\n * consumer of this list treats a path *below* a known one as accounted for. See `toNavRows`.\n */\nexport function knownRoutePathsOf(definition: AppDefinition | undefined): string[] {\n const declared = (definition?.routes ?? []).map((route) => route.path);\n const mounted = (definition?.modules ?? []).map((mount) => mount.basePath);\n return [...declared, ...mounted].filter((path): path is string => !!path);\n}\n\n/** The scheme a definition that names none is rendered in, matching the contract's own default. */\nconst DEFAULT_COLOR_SCHEME: ColorScheme = 'light';\n\n/**\n * Which of the scoped Material themes in `app-shell.component.scss` the shell should wear, as the class\n * names that select it — `pp-theme-<materialTheme> pp-scheme-<colorScheme>`.\n *\n * **Empty unless a `materialTheme` is named.** A `colorScheme` on its own would be half a theme: it\n * decides which side of the stylesheet's `light-dark()` values is used, and with no theme block applied\n * there are none — so it would flip native controls to dark while every Material component kept the\n * surrounding application's colours. Inheriting the host's theme untouched is the honest reading of a\n * definition that has not chosen one, and matches the shell's rule of never inventing what was not\n * authored.\n */\nexport function themeClassOf(definition: AppDefinition | undefined): string {\n const materialTheme = definition?.materialTheme ?? definition?.theme?.materialTheme;\n if (!materialTheme) return '';\n\n const colorScheme = definition?.colorScheme ?? definition?.theme?.colorScheme ?? DEFAULT_COLOR_SCHEME;\n return `pp-theme-${materialTheme} pp-scheme-${colorScheme}`;\n}\n","import { Component, input } from '@angular/core';\nimport { WidgetInstance } from '@processpuzzle/widgets';\nimport { WidgetListComponent } from '../widget-list.component';\n\n/**\n * The `footer` region: the widgets it declares, and nothing else. The contract gives a footer no field\n * beyond `widgets`, so this stays a thin styled host over {@link WidgetListComponent} — separate from\n * the header only because the two are different slots with different styling, not because they share\n * no logic.\n */\n@Component({\n selector: 'pp-region-footer',\n standalone: true,\n imports: [WidgetListComponent],\n template: `<pp-widget-list [widgets]=\"widgets()\" />`,\n styles: [\n `\n :host {\n align-items: center;\n background-color: var(--pp-surface-header);\n display: flex;\n gap: 16px;\n justify-content: space-between;\n padding: 8px 16px;\n }\n /* Beside one another, as in the header — see the note there on why the list stays unopinionated. */\n pp-widget-list {\n align-items: center;\n display: flex;\n gap: 8px;\n }\n `,\n ],\n})\nexport class RegionFooterComponent {\n readonly widgets = input<WidgetInstance[]>([]);\n}\n","import { Component, input } from '@angular/core';\nimport { WidgetInstance } from '@processpuzzle/widgets';\nimport { WidgetListComponent } from '../widget-list.component';\n\n/**\n * The `header` region: the application's brand block and the widgets the region declares.\n *\n * The brand is the shell's contribution rather than the region's — `logoUrl` and the title come from\n * the definition's theme and name, not from anything authored on the region — which is why they are\n * inputs the renderer fills instead of something this component reaches into a store for. That keeps\n * it renderable from a spec with three inputs and no providers.\n *\n * Nav items are *not* handled here. Under the `top-nav` preset the shell places the `sidenav` region's\n * nav beside this component in the same row, so that a `top-nav` app with no header region is still\n * navigable — see {@link AppShellComponent}.\n */\n@Component({\n selector: 'pp-region-header',\n standalone: true,\n imports: [WidgetListComponent],\n template: `\n <div class=\"pp-region-header__brand\">\n @if (logoUrl(); as logo) {\n <img class=\"pp-region-header__logo\" [src]=\"logo\" [alt]=\"title()\" />\n }\n <h2 class=\"pp-region-header__title\">{{ title() }}</h2>\n </div>\n <pp-widget-list [widgets]=\"widgets()\" />\n `,\n styles: [\n `\n :host {\n align-items: center;\n background-color: var(--pp-surface-header);\n display: flex;\n flex: 1;\n gap: 16px;\n justify-content: space-between;\n padding: 8px 16px;\n }\n .pp-region-header__brand {\n align-items: center;\n display: flex;\n gap: 12px;\n min-width: 0;\n }\n .pp-region-header__logo {\n display: block;\n max-height: 48px;\n max-width: 160px;\n object-fit: contain;\n }\n .pp-region-header__title {\n margin: 0;\n }\n /*\n * A row, because a header's widgets sit beside one another. The list component itself stays\n * unopinionated — the same component fills a routed content area, where a landing page's widgets\n * belong *under* one another — so the axis is the region's to choose, and a chrome row is the one\n * place it is not the default.\n */\n pp-widget-list {\n align-items: center;\n display: flex;\n gap: 8px;\n }\n `,\n ],\n})\nexport class RegionHeaderComponent {\n readonly title = input('');\n readonly logoUrl = input<string | undefined>(undefined);\n readonly widgets = input<WidgetInstance[]>([]);\n}\n","import { NgTemplateOutlet } from '@angular/common';\nimport { Component, computed, input } from '@angular/core';\nimport { MatListItem, MatListItemIcon, MatListItemTitle, MatNavList } from '@angular/material/list';\nimport { RouterLink, RouterLinkActive } from '@angular/router';\nimport { EntityLabelPipe } from '@processpuzzle/base-entity';\nimport { NavItem } from '../../domain/app-definition';\n\n/** Which way the list runs. The shell decides it from `layout.preset`, not the region definition. */\nexport type NavOrientation = 'vertical' | 'horizontal';\n\n/**\n * One rendered row. A view model rather than the `NavItem` itself, so that \"does this item navigate, and\n * does its target exist\" is decided once per definition in a pure function instead of by methods the\n * template would re-run on every change detection pass.\n */\nexport interface NavRow {\n id: string;\n label: string;\n /**\n * Transloco key for {@link label}, preferred over it when the key resolves. Carried onto the row rather\n * than translated here: `toNavRows` is a pure function and translation depends on the active language\n * and on which scopes have finished loading, both of which are the template's concern.\n */\n translocoId?: string;\n icon?: string;\n /** Present only when the item names a route that something accounts for — see {@link toNavRows}. */\n routePath?: string;\n /** The item names a route path, but nothing in the definition accounts for it. */\n unresolved: boolean;\n children: NavRow[];\n}\n\n/**\n * Maps the authored nav tree onto rows, resolving each `routePath` against the paths the definition\n * accounts for.\n *\n * A path counts as resolved if it equals a declared route's path *or* sits below one — below a declared\n * route, or below a mounted module's base path. The prefix rule is what keeps this from crying wolf: the\n * routes inside a module live in the module's own definition, which is fetched lazily and is not knowable\n * here, so `back-office/lines` has to be trusted on the strength of the `back-office` mount alone.\n *\n * A group node — no `routePath`, children instead — is not unresolved. It expands rather than navigates.\n */\nexport function toNavRows(items: NavItem[] | undefined, knownPaths: string[]): NavRow[] {\n return (items ?? []).map((item) => {\n const routePath = normalize(item.routePath);\n const resolved = routePath !== undefined && knownPaths.some((known) => routePath === known || routePath.startsWith(`${known}/`));\n return {\n id: item.id,\n label: item.label,\n translocoId: item.translocoId,\n icon: item.icon,\n ...(resolved ? { routePath } : {}),\n unresolved: routePath !== undefined && !resolved,\n children: toNavRows(item.children, knownPaths),\n };\n });\n}\n\n/**\n * A route path as it is compared and linked: no surrounding slashes, since `RouteDefinition.path` is\n * relative with no leading slash by contract and a nav item may still have been authored with one.\n * Whitespace-only counts as absent — an item mid-authoring is a group node, not a broken link.\n */\nfunction normalize(routePath: string | undefined): string | undefined {\n const trimmed = routePath?.trim().replace(/^\\/+|\\/+$/g, '').trim();\n return trimmed ? trimmed : undefined;\n}\n\n/**\n * Renders the nav tree of the `sidenav` region — in the sidenav for the two sidenav presets, and\n * horizontally in the header row for `top-nav`. One component for both, because the tree and its\n * grouping rules are the same either way and only the axis differs.\n *\n * Links are relative, which is what makes the same component work in the designer's Preview tab and in a\n * standalone deployment: `routerLink=\"orders\"` resolves against whichever route hosts the shell, so it\n * becomes `…/app-definition/demo/preview/orders` under the designer and `/orders` under a runtime host,\n * with nothing here needing to know which.\n *\n * An item whose target nothing accounts for is rendered as an inert row with a title, not as a link that\n * would navigate into a 404. A dangling `routePath` is a *warning* server-side by design — it may name a\n * route of a module authored later — so the shell has to render it as something rather than reject it.\n *\n * `translocoId` is preferred over `label` where it resolves, through the impure `ppLabel` pipe — so a row\n * shows the authored literal until the scope that owns its key has loaded, then re-renders. A nav label is\n * *tenant* content living under a module's own scope, which for an authored module is served by the\n * backend rather than shipped as an asset; `ppLabel` falling back is the normal case, not a defect.\n */\n@Component({\n selector: 'pp-region-nav',\n standalone: true,\n imports: [MatNavList, MatListItem, MatListItemIcon, MatListItemTitle, NgTemplateOutlet, RouterLink, RouterLinkActive, EntityLabelPipe],\n template: `\n <mat-nav-list [class.pp-region-nav--horizontal]=\"orientation() === 'horizontal'\">\n <ng-container *ngTemplateOutlet=\"rowList; context: { $implicit: rows(), depth: 0 }\"></ng-container>\n </mat-nav-list>\n\n <!--\n Recursive through ngTemplateOutlet: a NavItem nests in itself, so the depth is not knowable here.\n\n The icon and the title are spelled out in both branches rather than shared through one more template.\n A list item sorts its content with an ng-content selector on [matListItemIcon], and a projection\n selector is matched at compile time against the element's own children — so anything arriving through\n ngTemplateOutlet is one opaque node to it, and lands in the unprojected slot beside the title. That is\n what put the icon on a line of its own above every label.\n -->\n <ng-template #rowList let-rows let-depth=\"depth\">\n @for (row of rows; track row.id) {\n @if (row.routePath; as routePath) {\n <!-- An anchor, not a bare list item: RouterLink only writes href onto one, and without it the row\n is not a real link — no middle-click, no open-in-new-tab, no keyboard activation. -->\n <a\n mat-list-item\n class=\"pp-region-nav__item\"\n [routerLink]=\"routePath\"\n routerLinkActive=\"pp-region-nav__item--active\"\n [style.padding-inline-start.px]=\"depth * 12\"\n [attr.data-testid]=\"'nav-' + row.id\"\n >\n @if (row.icon) {\n <span matListItemIcon class=\"material-symbols-outlined\">{{ row.icon }}</span>\n }\n <div matListItemTitle>{{ row.translocoId | ppLabel: row.label }}</div>\n </a>\n } @else {\n <mat-list-item\n class=\"pp-region-nav__item\"\n [class.pp-region-nav__item--unresolved]=\"row.unresolved\"\n [title]=\"row.unresolved ? 'No route of this application matches this navigation entry yet.' : ''\"\n [style.padding-inline-start.px]=\"depth * 12\"\n [attr.data-testid]=\"'nav-' + row.id\"\n >\n @if (row.icon) {\n <span matListItemIcon class=\"material-symbols-outlined\">{{ row.icon }}</span>\n }\n <div matListItemTitle>{{ row.translocoId | ppLabel: row.label }}</div>\n </mat-list-item>\n }\n @if (row.children.length) {\n <ng-container *ngTemplateOutlet=\"rowList; context: { $implicit: row.children, depth: depth + 1 }\"></ng-container>\n }\n }\n </ng-template>\n `,\n styles: [\n `\n :host {\n display: block;\n }\n .pp-region-nav--horizontal {\n display: flex;\n padding-top: 0;\n }\n .pp-region-nav--horizontal .pp-region-nav__item {\n width: auto;\n }\n .pp-region-nav__item--unresolved {\n font-style: italic;\n opacity: 0.6;\n }\n `,\n ],\n})\nexport class RegionNavComponent {\n readonly navItems = input<NavItem[]>([]);\n readonly orientation = input<NavOrientation>('vertical');\n /** Route paths the definition accounts for, supplied by `AppRegionRenderer`. See {@link toNavRows}. */\n readonly knownPaths = input<string[]>([]);\n\n protected readonly rows = computed(() => toNavRows(this.navItems(), this.knownPaths()));\n}\n","import { Injectable, Type } from '@angular/core';\nimport { AppDefinition, RegionDefinition, RegionType } from '../../domain/app-definition';\nimport { knownRoutePathsOf } from './app-shell.model';\nimport { RegionFooterComponent } from './region-footer.component';\nimport { RegionHeaderComponent } from './region-header.component';\nimport { RegionNavComponent } from './region-nav.component';\n\n/**\n * One region resolved to something renderable: which slot it fills, the component that fills it and\n * the inputs to bind. **Data, not a view** — deliberately the same shape of answer\n * {@link AppRouteRenderer} gives for a route, and for the same reasons: it is assertable from a spec\n * without a `TestBed`, and the shell can bind it declaratively so that editing the definition in the\n * neighbouring form re-renders through ordinary signal propagation.\n *\n * `slot` is where the region *asks* to go. The shell may place it elsewhere — the `top-nav` preset puts\n * the `sidenav` slot's view in the header row — and may override {@link inputs} when it does, which is\n * the second reason this carries inputs rather than a constructed component.\n */\nexport interface RegionView {\n slot: RegionType;\n component: Type<unknown>;\n inputs: Record<string, unknown>;\n}\n\n/**\n * Turns one authored `RegionDefinition` into the {@link RegionView} that renders it.\n *\n * An injectable rather than a free function, though stateless today, for the reason `AppRouteRenderer`\n * is one: the Preview tab and the eventual standalone runtime host must resolve regions *identically*,\n * so there has to be exactly one of these, and a constructor parameter is a cheaper way to grow it than\n * a rewrite.\n */\n@Injectable({ providedIn: 'root' })\nexport class AppRegionRenderer {\n render = (region: RegionDefinition, definition: AppDefinition | undefined): RegionView | undefined => {\n switch (region.type) {\n case 'header':\n return {\n slot: 'header',\n component: RegionHeaderComponent,\n // Brand from the definition, widgets from the region: the two halves of a header row come\n // from different levels of the document, and only this function knows both.\n inputs: { title: definition?.name ?? '', logoUrl: definition?.logoUrl ?? definition?.theme?.logoUrl, widgets: region.widgets ?? [] },\n };\n case 'footer':\n return { slot: 'footer', component: RegionFooterComponent, inputs: { widgets: region.widgets ?? [] } };\n case 'sidenav':\n // `orientation` is left at the component's own default; the shell overrides it for `top-nav`,\n // because the axis follows the layout preset rather than anything authored on the region.\n // `knownPaths` comes from the definition rather than the region: whether a nav entry resolves is a\n // question about the *application's* routes, which only this function can see from here.\n return { slot: 'sidenav', component: RegionNavComponent, inputs: { navItems: region.navItems ?? [], knownPaths: knownRoutePathsOf(definition) } };\n default:\n // A region whose `type` the designer has not chosen yet. `RegionDefinition.type` is\n // `RegionType | undefined` precisely because a row exists before its dropdown is touched, and\n // the preview renders it *while* that is happening — so this is the normal path, not an error\n // one. Omitting it is quieter than a placeholder, and the form already shows the empty row.\n return undefined;\n }\n };\n}\n","import { NgComponentOutlet } from '@angular/common';\nimport { Component, computed, inject, input } from '@angular/core';\nimport { MatSidenav, MatSidenavContainer, MatSidenavContent } from '@angular/material/sidenav';\nimport { RouterOutlet } from '@angular/router';\nimport { AppDefinition } from '../../domain/app-definition';\nimport { AppRegionRenderer, RegionView } from './app-region.renderer';\nimport { layoutOf, themeClassOf, themeVarsOf } from './app-shell.model';\nimport { NavOrientation } from './region-nav.component';\n\n/**\n * The run-time shell of a metadata-defined application: the chrome an `AppDefinition` describes, with a\n * `<router-outlet>` where its routes render.\n *\n * **This is the application, not a picture of one.** `AppPreviewComponent` hosts it so that the Preview\n * tab shows the real thing, and the standalone runtime host will mount the same component — which is\n * the whole point of it being a component with one input rather than something assembled inside the\n * preview. A shell built for the preview would drift from the one built for production, and a preview\n * that drifts is worse than none.\n *\n * Everything is bound declaratively. Regions are resolved to {@link RegionView}s and rendered through\n * `NgComponentOutlet`, never created imperatively, so that a definition edited in the neighbouring\n * details form re-renders through ordinary signal propagation instead of a clear-and-rebuild that would\n * drop scroll position and focus on every keystroke.\n *\n * The whole theme is applied here, not only the brand colours: `--pp-*` overrides as a style binding and\n * the definition's `materialTheme` / `colorScheme` as a class selecting one of the scoped Material themes\n * in `src/theme/pp-material-themes.scss`. Both work because a Material theme is a set of custom\n * properties and nothing else. That file is a **global stylesheet the application registers**; if it is\n * not registered the classes below still land and the shell simply inherits the host's theme. See it for\n * the one thing this cannot reach — CDK overlays, which render outside the shell's subtree.\n *\n * Not yet handled, deliberately: **no routes are registered** under the outlet. That is the nested router\n * context, which needs `EntityTabDescriptor` to be able to carry child routes.\n */\n@Component({\n selector: 'pp-app-shell',\n standalone: true,\n imports: [NgComponentOutlet, MatSidenav, MatSidenavContainer, MatSidenavContent, RouterOutlet],\n // Both theme bindings go on the host rather than on a wrapper, so the element that *is* the shell is\n // also the element they cascade from — and so the host can be the grid, see the stylesheet. `[class]`\n // selects one of the scoped Material themes there; `[style]` carries the `--pp-*` overrides.\n host: { '[class]': 'themeClass()', '[style]': 'themeVars()' },\n template: `\n @if (headerView() || topNavView()) {\n <div class=\"pp-app-shell__top\">\n @if (headerView(); as view) {\n <ng-container *ngComponentOutlet=\"view.component; inputs: view.inputs\"></ng-container>\n }\n @if (topNavView(); as view) {\n <ng-container *ngComponentOutlet=\"view.component; inputs: topNavInputs()\"></ng-container>\n }\n </div>\n }\n\n <mat-sidenav-container class=\"pp-app-shell__body\">\n @if (sidenavView(); as view) {\n <mat-sidenav class=\"pp-app-shell__sidenav\" [mode]=\"layout().sidenavMode\" [opened]=\"layout().sidenavOpened\" [position]=\"layout().sidenavPosition\">\n <ng-container *ngComponentOutlet=\"view.component; inputs: sidenavInputs()\"></ng-container>\n </mat-sidenav>\n }\n <mat-sidenav-content>\n <main class=\"pp-app-shell__content\" [style.max-width]=\"layout().contentMaxWidth\">\n <router-outlet />\n </main>\n </mat-sidenav-content>\n </mat-sidenav-container>\n\n @if (footerView(); as view) {\n <ng-container *ngComponentOutlet=\"view.component; inputs: view.inputs\"></ng-container>\n }\n `,\n styleUrl: 'app-shell.component.scss',\n})\nexport class AppShellComponent {\n /**\n * The definition to render. Optional rather than required because the shell is mounted before the\n * definition resolves — the preview's store selects the entity in its own `ngOnInit`, and a deep link\n * arrives with nothing loaded — so an empty shell is a state to render, not an error.\n */\n readonly definition = input<AppDefinition | undefined>(undefined);\n\n private readonly regionRenderer = inject(AppRegionRenderer);\n\n protected readonly layout = computed(() => layoutOf(this.definition()));\n protected readonly themeVars = computed(() => themeVarsOf(this.definition()));\n protected readonly themeClass = computed(() => themeClassOf(this.definition()));\n\n private readonly regionViews = computed(() =>\n (this.definition()?.regions ?? []).map((region) => this.regionRenderer.render(region, this.definition())).filter((view): view is RegionView => view !== undefined),\n );\n\n protected readonly headerView = computed(() => this.viewOf('header'));\n protected readonly footerView = computed(() => this.viewOf('footer'));\n\n /**\n * The nav in the sidenav, for the two sidenav presets. Split from {@link topNavView} rather than\n * decided in the template, so each slot is one unambiguous `@if` and the mutual exclusion is stated\n * once, here.\n */\n protected readonly sidenavView = computed(() => (this.layout().hasSidenav ? this.viewOf('sidenav') : undefined));\n\n /**\n * The same nav relocated into the header row under `top-nav`. It is placed beside the header region\n * rather than inside it, so that a `top-nav` app which declares no header region is still navigable —\n * and so that the shell still never invents a region that was not authored.\n */\n protected readonly topNavView = computed(() => (this.layout().hasSidenav ? undefined : this.viewOf('sidenav')));\n\n /**\n * The nav view's own inputs with the axis the layout dictates laid over them.\n *\n * Computeds rather than a method called from the template: a method would hand `NgComponentOutlet` a\n * freshly built object on every change-detection pass, so it would re-diff and re-apply the nav's\n * inputs continuously. Memoized, the identity only changes when the definition or the preset does.\n */\n protected readonly sidenavInputs = computed(() => this.navInputsOf(this.sidenavView(), 'vertical'));\n protected readonly topNavInputs = computed(() => this.navInputsOf(this.topNavView(), 'horizontal'));\n\n private navInputsOf(view: RegionView | undefined, orientation: NavOrientation): Record<string, unknown> {\n return { ...view?.inputs, orientation };\n }\n\n private viewOf(slot: RegionView['slot']): RegionView | undefined {\n // First occurrence wins. An app declares each slot at most once — `type` is the region's identity,\n // see APP_REGION_ID_FIELD — so a second one is a definition that bypassed validation, and ignoring\n // it is the harmless read. The same rule `buildAppRoutes` applies to a duplicate path.\n return this.regionViews().find((view) => view.slot === slot);\n }\n}\n","import { Component, computed, inject, input, OnInit } from '@angular/core';\nimport { AppDefinition } from '../domain/app-definition';\nimport { AppDefinitionStore } from '../domain/app-definition.store';\nimport { AppShellComponent } from './shell/app-shell.component';\n\n/**\n * The Preview tab's screen, mounted at `app-definition/<id>/preview` by `BASE_APP_ROUTES` — a sibling of\n * the generic Details form rather than something stacked under it, which is what the `extraTabs` hook on\n * `BaseEntityDescriptor` exists for.\n *\n * A **container and nothing more**: it resolves which definition is being previewed and frames the\n * result. Everything about *how* an application renders belongs to {@link AppShellComponent}, which the\n * standalone runtime host will mount just as this does — so the preview cannot grow behaviour the real\n * shell lacks, which is the only way a preview stays honest.\n *\n * The frame below — rounded, white, and tall enough to look like an application — is the preview's own,\n * not the shell's. In production the shell fills the viewport and none of it applies.\n */\n@Component({\n selector: 'pp-app-preview-tab',\n standalone: true,\n imports: [AppShellComponent],\n template: `\n <div class=\"pp-app-preview\">\n <pp-app-shell [definition]=\"app()\" />\n </div>\n `,\n styles: [\n `\n .pp-app-preview {\n background-color: var(--pp-surface-base, #ffffff);\n border-radius: 6px;\n overflow: hidden;\n }\n /*\n * How tall a previewed application is, and therefore where its footer sits: at the bottom of this\n * box, not directly under the header. The shell is a three-row grid whose middle row takes the slack,\n * so giving it a height is all that is needed — but something has to, and nothing above this can:\n * the tab panel, the router outlets and the designer's own layout are all auto-height, so a\n * percentage here would resolve against nothing.\n *\n * Viewport-relative rather than a calc() subtracting the chrome: what sits above a preview is a tab\n * bar, a status bar and a toolbar whose heights are Material's to change, and a subtraction would go\n * quietly wrong when they do.\n */\n .pp-app-preview > pp-app-shell {\n min-height: 65vh;\n }\n `,\n ],\n})\nexport class AppPreviewComponent implements OnInit {\n /**\n * Bound from the route's `:entityId` param by `withComponentInputBinding()`, the same way\n * `BaseEntityFormComponent` receives it — so a deep link and a reload resolve the same app definition as a\n * click through the tab does.\n */\n readonly entityId = input.required<string>();\n\n private readonly store = inject(AppDefinitionStore);\n\n protected readonly app = computed(() => this.store.currentEntity() as AppDefinition | undefined);\n\n ngOnInit(): void {\n // Also sets the current entity, so the tab bar's Details link stays enabled and the status bar keeps\n // naming the record — arriving here directly, nothing else has selected it.\n this.store.setCurrentEntity(this.entityId());\n }\n}\n","import { inject, Injectable } from '@angular/core';\nimport { CanMatchFn, Routes } from '@angular/router';\nimport { BaseUrlSegments } from '@processpuzzle/base-entity';\nimport { firstValueFrom } from 'rxjs';\nimport { AppDefinition } from '../../domain/app-definition';\nimport { AppDefinitionService } from '../../domain/app-definition.service';\nimport { AppDefinitionStore } from '../../domain/app-definition.store';\nimport { ModuleDefinition } from '../../domain/module-definition';\nimport { ModuleDefinitionService } from '../../domain/module-definition.service';\nimport { ModuleDefinitionStore } from '../../domain/module-definition.store';\nimport { buildAppRoutes } from '../app-route-builder';\nimport { AppRouteRenderer } from '../app-route-renderer';\n\n/**\n * Turns one `AppDefinition` into the `Routes` that render its screens — the missing consumer of\n * {@link buildAppRoutes}, which until now produced routes nothing registered.\n *\n * Separate from the guard below so the interesting part is testable without a router: this class answers\n * \"what routes does app X have\", and the guard is only the two lines that hand them to Angular.\n */\n@Injectable({ providedIn: 'root' })\nexport class AppShellRoutesFactory {\n private readonly appStore = inject(AppDefinitionStore);\n private readonly appService = inject(AppDefinitionService);\n private readonly moduleStore = inject(ModuleDefinitionStore);\n private readonly moduleService = inject(ModuleDefinitionService);\n private readonly renderRoute = inject(AppRouteRenderer).render;\n\n async childrenOf(appId: string): Promise<Routes> {\n const definition = await this.definitionOf(appId);\n if (!definition) return [];\n\n const built = await buildAppRoutes({ routes: definition.routes, modules: definition.modules, loadModule: this.loadModule }, this.renderRoute);\n return built.length ? [indexRoute(definition, built), ...built] : built;\n }\n\n /**\n * Store first, endpoint second.\n *\n * The store holds the newest definition immediately after a Save, so the next navigation inside the\n * preview picks up a route the designer just added — without a second GET, and without this having to\n * know that a save happened. The fetch is for the case the store cannot serve: a deep link or a reload,\n * where nothing has been loaded yet.\n *\n * A failure resolves to `undefined` rather than propagating. A guard that rejects fails the whole\n * navigation, and an app whose definition cannot be read should render an empty shell, not a dead URL.\n */\n private async definitionOf(appId: string): Promise<AppDefinition | undefined> {\n const known = this.appStore.loadById(appId);\n if (known) return known;\n return (await this.fetch(() => firstValueFrom(this.appService.findById(appId)))) as AppDefinition | undefined;\n }\n\n /**\n * The {@link ModuleLoader} `buildAppRoutes` calls for a mount whose module it has not got. Resolving to\n * `undefined` is deliberate and is what the contract asks for: a `ModuleMount` naming a module nobody has\n * authored yet is a validation *warning*, so it must contribute no routes rather than break navigation.\n */\n private loadModule = async (moduleKey: string): Promise<ModuleDefinition | undefined> => {\n const known = this.moduleStore.loadById(moduleKey);\n if (known) return known;\n return (await this.fetch(() => firstValueFrom(this.moduleService.findById(moduleKey)))) as ModuleDefinition | undefined;\n };\n\n /** `findById` resolves to `void` for a missing record and rejects on a transport error; both mean \"no\". */\n private async fetch<Result>(read: () => Promise<Result | void>): Promise<Result | undefined> {\n try {\n return (await read()) || undefined;\n } catch {\n return undefined;\n }\n }\n}\n\n/**\n * Where the application root goes. Without it the app's own URL — `…/preview` with nothing after it —\n * matches none of the children and the *whole* route fails to match, which would take the preview screen\n * down rather than merely leave its content area empty.\n *\n * The authored order decides, falling back to the first route as built. The fallback is not decoration: an\n * app may declare no routes of its own and mount all of its screens from a module, in which case the\n * definition offers no path to land on but the built routes do.\n */\nfunction indexRoute(definition: AppDefinition, built: Routes) {\n const target = definition.routes?.find((route) => route.path)?.path ?? built[0].path;\n // `pathMatch: 'full'`, or an empty path would prefix-match every URL below it and swallow the app.\n return { path: '', pathMatch: 'full' as const, redirectTo: target };\n}\n\n/**\n * Registers an application's own routes as the children of the Preview tab's route, so that navigating\n * inside a previewed application is *real* navigation: real URLs, real back button, real outlet.\n *\n * Why a `canMatch` guard rather than `loadChildren`, which is the obvious hook for lazily-known children:\n * the router caches a `loadChildren` result on the `Route` object as `_loadedRoutes`, and one Route object\n * serves every `:entityId`. The first app previewed would therefore have its routes replayed for the\n * second. `children`, by contrast, is read fresh on every recognition and never cached — and `canMatch`\n * runs, and is awaited, *before* the router reads it. So this is the one hook that can answer \"children of\n * *this* app\" and still work on a deep link.\n *\n * Always returns `true`. It is not deciding whether the tab may be entered — it is filling in the tab's\n * children on the way past.\n */\nexport const appShellRoutesGuard: CanMatchFn = (route, _segments, snapshot) => {\n const appId = snapshot.paramMap.get(BaseUrlSegments.EntityID);\n if (!appId) return true;\n\n // `inject` before the first await: an async function loses the injection context at its first suspension.\n const factory = inject(AppShellRoutesFactory);\n return factory.childrenOf(appId).then((children) => {\n route.children = children;\n return true;\n });\n};\n","import { EntityTabDescriptor } from '@processpuzzle/base-entity';\nimport { APP_PREVIEW_I18N_KEY } from '../base-app.i18n';\nimport { AppPreviewComponent } from './app-preview.component';\nimport { appShellRoutesGuard } from './shell/app-shell-routes';\n\n/**\n * The Preview tab, declared once and consumed twice: `BASE_APP_ROUTES` mounts it as\n * `app-definition/<id>/preview`, and `AppDefinitionContainerComponent` puts it on the descriptor so the tab bar\n * renders the link. One constant rather than two literals because the segment is what ties the link to the\n * route — a mismatch would render a tab that navigates to a URL nothing matches.\n *\n * The tab is a *container*: `children` starts empty and {@link appShellRoutesGuard} fills it with the\n * previewed application's own routes on every navigation, so the shell's `<router-outlet>` renders real\n * screens at real URLs — `app-definition/demo/preview/orders`. The empty array is load-bearing; a route with\n * no `children` at all takes the `loadChildren` path instead, which is cached per Route object and so cannot\n * vary by `:entityId`.\n */\nexport const APP_PREVIEW_TAB: EntityTabDescriptor = {\n segment: 'preview',\n i18nKey: APP_PREVIEW_I18N_KEY,\n component: AppPreviewComponent,\n testIdSuffix: 'show-preview',\n children: [],\n canMatch: [appShellRoutesGuard],\n};\n","import { Component, ComponentRef, computed, inject, OnDestroy, TemplateRef, viewChild, ViewChild } from '@angular/core';\nimport { TranslocoPipe } from '@jsverse/transloco';\nimport { MatButton } from '@angular/material/button';\nimport { MatTooltip } from '@angular/material/tooltip';\nimport { BaseEntityContainerComponent, BaseEntityDescriptor, BaseFormHostDirective } from '@processpuzzle/base-entity';\nimport { PUBLISH_BUTTON_I18N_KEY, PUBLISH_TOOLTIP_I18N_KEY } from '../base-app.i18n';\nimport { AppDefinitionStore } from '../domain/app-definition.store';\nimport { createAppDefinitionDescriptor } from '../domain/app-definition.descriptors';\nimport { APP_PREVIEW_TAB } from './app-preview-tab';\n\n@Component({\n selector: 'pp-app-definition-container',\n standalone: true,\n imports: [BaseEntityContainerComponent, MatButton, MatTooltip, TranslocoPipe],\n template: `\n <base-entity-container [entityDescriptor]=\"entityDescriptor\"></base-entity-container>\n <ng-template #publishActionsTpl>\n <button id=\"publish\" type=\"button\" mat-raised-button color=\"accent\" [disabled]=\"!canPublish()\" [matTooltip]=\"publishTooltipKey | transloco\" (click)=\"onPublish()\">\n {{ publishButtonKey | transloco }}\n </button>\n </ng-template>\n `,\n})\nexport class AppDefinitionContainerComponent implements OnDestroy {\n private readonly containerComponentRef: ComponentRef<BaseEntityContainerComponent> | undefined;\n @ViewChild(BaseFormHostDirective, { static: true, read: BaseFormHostDirective }) baseEntityHost!: BaseFormHostDirective;\n readonly publishActionsTpl = viewChild<TemplateRef<unknown>>('publishActionsTpl');\n private readonly store = inject(AppDefinitionStore);\n readonly entityDescriptor: BaseEntityDescriptor;\n readonly publishButtonKey = PUBLISH_BUTTON_I18N_KEY;\n readonly publishTooltipKey = PUBLISH_TOOLTIP_I18N_KEY;\n /** Only a definition the backend already knows can be promoted, so a not-yet-saved form cannot publish. */\n readonly canPublish = computed(() => !this.store.isLoading() && !!this.store.currentEntity()?.id);\n\n constructor() {\n this.entityDescriptor = createAppDefinitionDescriptor();\n this.entityDescriptor.store = this.store;\n this.entityDescriptor.extraFormActionsTemplate = () => this.publishActionsTpl();\n this.entityDescriptor.extraTabs = [APP_PREVIEW_TAB];\n }\n\n ngOnDestroy(): void {\n if (this.containerComponentRef) {\n this.containerComponentRef.destroy();\n }\n }\n\n async onPublish(): Promise<void> {\n const id = this.store.currentEntity()?.id;\n if (!id) return;\n await this.store.publish(id);\n }\n}\n","import { Component, inject } from '@angular/core';\nimport { BaseEntityContainerComponent, BaseEntityDescriptor } from '@processpuzzle/base-entity';\nimport { createModuleDefinitionDescriptor } from '../domain/module-definition.descriptors';\nimport { ModuleDefinitionStore } from '../domain/module-definition.store';\n\n/**\n * Hosts the generic container for `Module Definition`, whose only job is to bind the descriptor to the\n * store the routable screens read from.\n *\n * Deliberately without the `Publish` action `AppDefinitionContainerComponent` contributes: publishing is\n * an application operation. An app is what a user navigates to and its status is what decides whether a\n * mount is live, so a module with a lifecycle of its own would make \"which version of what is live\" a\n * question with two answers.\n */\n@Component({\n selector: 'pp-module-definition-container',\n standalone: true,\n imports: [BaseEntityContainerComponent],\n template: `<base-entity-container [entityDescriptor]=\"entityDescriptor\"></base-entity-container>`,\n})\nexport class ModuleDefinitionContainerComponent {\n private readonly store = inject(ModuleDefinitionStore);\n readonly entityDescriptor: BaseEntityDescriptor;\n\n constructor() {\n this.entityDescriptor = createModuleDefinitionDescriptor();\n this.entityDescriptor.store = this.store;\n }\n}\n","import type { Provider } from '@angular/core';\nimport type { BaseEntityFacadeRegistry } from '@processpuzzle/base-entity';\nimport {\n APP_DEFINITION_ENTITY_NAME,\n APP_MODULE_MOUNT_ENTITY_NAME,\n APP_NAV_ITEM_ENTITY_NAME,\n APP_REGION_ENTITY_NAME,\n APP_ROUTE_ENTITY_NAME,\n APP_WIDGET_ENTITY_NAME,\n MODULE_DEFINITION_ENTITY_NAME,\n} from './domain/app-entity-names';\nimport { AppDefinitionFacade } from './feature/app-definition.facade';\nimport { AppModuleMountFacade } from './feature/app-module-mount.facade';\nimport { AppNavItemFacade } from './feature/app-nav-item.facade';\nimport { AppRegionFacade } from './feature/app-region.facade';\nimport { AppRouteFacade } from './feature/app-route.facade';\nimport { AppWidgetFacade } from './feature/app-widget.facade';\nimport { ModuleDefinitionFacade } from './feature/module-definition.facade';\n\n/**\n * The facades of the whole definition graph, to be spread into the application's `providers`.\n *\n * The embedded ones are here for the same reason the routable one is: an embedded entity has a facade\n * like any other — that is what gives it a store — and only its repository differs, reading and writing\n * the `App Definition` document rather than an endpoint of its own.\n */\nexport const BASE_APP_FACADE_PROVIDERS: Provider[] = [AppDefinitionFacade, ModuleDefinitionFacade, AppRegionFacade, AppRouteFacade, AppModuleMountFacade, AppNavItemFacade, AppWidgetFacade];\n\n/**\n * The same facades keyed by entity name, to be spread into the application's\n * `BASE_ENTITY_FACADE_REGISTRY` value.\n *\n * Every entity an `EMBEDDED_COMPONENTS` attribute of this library names has to appear here, or the\n * control throws on first render rather than showing a list whose rows go nowhere on save — the\n * registry is how it reaches the child's store and descriptor. Spread rather than provided separately,\n * because the token holds one value: a second `provide: BASE_ENTITY_FACADE_REGISTRY` would replace the\n * application's own entities instead of adding to them.\n */\nexport const BASE_APP_ENTITY_FACADES: BaseEntityFacadeRegistry = {\n [APP_DEFINITION_ENTITY_NAME]: AppDefinitionFacade,\n [MODULE_DEFINITION_ENTITY_NAME]: ModuleDefinitionFacade,\n [APP_REGION_ENTITY_NAME]: AppRegionFacade,\n [APP_ROUTE_ENTITY_NAME]: AppRouteFacade,\n [APP_MODULE_MOUNT_ENTITY_NAME]: AppModuleMountFacade,\n [APP_NAV_ITEM_ENTITY_NAME]: AppNavItemFacade,\n [APP_WIDGET_ENTITY_NAME]: AppWidgetFacade,\n};\n","import { Routes } from '@angular/router';\nimport { provideTranslocoScope } from '@jsverse/transloco';\nimport { baseEntityRoutes, type EmbeddedChildRoute } from '@processpuzzle/base-entity';\nimport { BASE_APP_TRANSLOCO_SCOPE, BASE_ENTITY_TRANSLOCO_SCOPE } from './base-app.i18n';\nimport { APP_DEFINITION_ENTITY_NAME } from './domain/app-definition.descriptors';\nimport {\n APP_MODULE_MOUNT_ENTITY_NAME,\n APP_NAV_ITEM_ENTITY_NAME,\n APP_REGION_ENTITY_NAME,\n APP_ROUTE_ENTITY_NAME,\n APP_WIDGET_ENTITY_NAME,\n MODULE_DEFINITION_ENTITY_NAME\n} from './domain/app-entity-names';\nimport { AppDefinitionContainerComponent } from './feature/app-definition-container.component';\nimport { APP_PREVIEW_TAB } from './feature/app-preview-tab';\nimport { AppModuleMountFacade } from './feature/app-module-mount.facade';\nimport { AppNavItemFacade } from './feature/app-nav-item.facade';\nimport { AppRegionFacade } from './feature/app-region.facade';\nimport { AppRouteFacade } from './feature/app-route.facade';\nimport { AppWidgetFacade } from './feature/app-widget.facade';\nimport { ModuleDefinitionContainerComponent } from './feature/module-definition-container.component';\n\n/**\n * The path segment has to be `snakeCaseName('App Definition')`, because\n * `BaseFormNavigatorSingletonStore` builds the details URL from the entity name — see the same\n * constraint on `BASE_RULE_ROUTES`.\n */\nexport const BASE_APP_ROUTES: Routes = [\n {\n path: 'app-definition',\n title: 'ProcessPuzzle Design - Applications',\n data: { icon: 'web', menuTitle: 'design.applications', entityName: APP_DEFINITION_ENTITY_NAME },\n component: AppDefinitionContainerComponent,\n providers: [authoringScopes()],\n children: baseEntityRoutes(embeddedDefinitionRoutes(), [APP_PREVIEW_TAB]),\n },\n // A sibling rather than a child of the branch above: a module is an aggregate of its own, with its own\n // endpoints and its own list screen. What ties the two together is data — a `ModuleMount` naming a key —\n // and the run-time shell that resolves it, not the authoring URL.\n {\n path: 'module-definition',\n title: 'ProcessPuzzle Design - Modules',\n data: { icon: 'extension', menuTitle: 'design.modules', entityName: MODULE_DEFINITION_ENTITY_NAME },\n component: ModuleDefinitionContainerComponent,\n providers: [authoringScopes()],\n children: baseEntityRoutes([routeRoute()]),\n },\n];\n\n/**\n * The transloco scopes every authoring branch of this library needs. Both are required: a route that\n * declares TRANSLOCO_SCOPE replaces the collection it inherits rather than adding to it, and the generic\n * tabs translate the framework's own `base_entity.*` keys (see BASE_ENTITY_TRANSLOCO_SCOPE).\n *\n * Registered on the top-level routes rather than on the containers, so the base-entity tabs, list and form\n * rendered in the child routes resolve entity and attribute labels from the same scopes. The embedded\n * branches below need none of their own: `base_app.app_region.*` and its siblings are keys of the scope\n * already registered here.\n *\n * Both aliases are spelled out, as everywhere in this workspace: transloco camel-cases the default alias,\n * so `base_app` would silently become `baseApp` and miss every key below it.\n */\nfunction authoringScopes() {\n return provideTranslocoScope({ scope: BASE_ENTITY_TRANSLOCO_SCOPE, alias: BASE_ENTITY_TRANSLOCO_SCOPE }, { scope: BASE_APP_TRANSLOCO_SCOPE, alias: BASE_APP_TRANSLOCO_SCOPE });\n}\n\n/**\n * The definition graph as route branches: a region, a route and a module mount hang below the\n * definition's details route, a nav item and a widget below the region's, a widget below the route's,\n * and a nav item below itself.\n *\n * The nesting mirrors the containment of `base-app-api.yaml` exactly, and it has to: an embedded row has\n * no id of its own to be looked up by, so the URL — `app-definition/claims-app/details/app-region/sidenav/\n * details/app-nav-item/nav-claims/details` — is what addresses it, and each segment resolves against the\n * rows of the level above it.\n *\n * These are the *authoring* routes and have nothing to do with the routes an `AppDefinition` declares:\n * `App Route` rows are data here, and it is the run-time shell that turns them into `Routes` of their\n * own. A module mount is a leaf — the module it names is a separate aggregate with its own endpoints,\n * so its routes are authored there rather than through this branch.\n */\nfunction embeddedDefinitionRoutes(): EmbeddedChildRoute[] {\n return [\n { entityName: APP_REGION_ENTITY_NAME, facade: AppRegionFacade, children: () => [navItemRoute(), widgetRoute()] },\n routeRoute(),\n { entityName: APP_MODULE_MOUNT_ENTITY_NAME, facade: AppModuleMountFacade },\n ];\n}\n\n/**\n * The `App Route` branch, shared by both aggregates that own routes: an app's `routes` and a module's are\n * the same rows edited by the same descriptor, so the branch below them has to be the same too. Only the\n * URL prefix differs — `app-definition/demo/details/app-route/...` against\n * `module-definition/claims/details/app-route/...`.\n */\nfunction routeRoute(): EmbeddedChildRoute {\n return { entityName: APP_ROUTE_ENTITY_NAME, facade: AppRouteFacade, children: () => [widgetRoute()] };\n}\n\n/** A nav item nests in itself — a group node's children are nav items. Hence the thunk: the structure is\n * infinite, and `loadChildren` expands one level per navigation. */\nfunction navItemRoute(): EmbeddedChildRoute {\n return { entityName: APP_NAV_ITEM_ENTITY_NAME, facade: AppNavItemFacade, children: () => [navItemRoute()] };\n}\n\n/**\n * A widget, unlike a nav item, is a leaf branch: widgets do not nest, so there is no deeper level to\n * expand. A container widget places its siblings by id through `props.childIds`, and those siblings are\n * rows of this same list — reachable at this level, not below it.\n */\nfunction widgetRoute(): EmbeddedChildRoute {\n return { entityName: APP_WIDGET_ENTITY_NAME, facade: AppWidgetFacade };\n}\n","/*\n * Public API Surface of @processpuzzle/base-app\n */\n\nexport {\n AppDefinition,\n AppDefinitionStatus,\n COLOR_SCHEMES,\n ENTITY_MODES,\n LAYOUT_PRESETS,\n MATERIAL_THEMES,\n ModuleMount,\n NavItem,\n REGION_TYPES,\n RegionDefinition,\n ROUTE_TARGET_KINDS,\n RouteDefinition,\n SIDENAV_MODES,\n WIDGET_PLACEMENTS,\n WidgetInstance,\n type ColorScheme,\n type EntityMode,\n type LayoutDefinition,\n type LayoutPreset,\n type MaterialTheme,\n type RegionType,\n type RouteTarget,\n type RouteTargetKind,\n type SidenavMode,\n type ThemeDefinition,\n type WidgetPlacement,\n} from './lib/domain/app-definition';\nexport { ModuleDefinition, moduleTranslocoScope } from './lib/domain/module-definition';\nexport {\n APP_DEFINITION_I18N_SCOPE,\n APP_MODULE_MOUNT_I18N_SCOPE,\n APP_NAV_ITEM_I18N_SCOPE,\n APP_PREVIEW_I18N_KEY,\n APP_REGION_I18N_SCOPE,\n APP_ROUTE_I18N_SCOPE,\n APP_WIDGET_I18N_SCOPE,\n BASE_APP_TRANSLOCO_SCOPE,\n MODULE_DEFINITION_I18N_SCOPE,\n} from './lib/base-app.i18n';\nexport { APP_DEFINITION_ENTITY_NAME, createAppDefinitionDescriptor } from './lib/domain/app-definition.descriptors';\nexport { APP_MODULE_MOUNT_ENTITY_NAME, APP_MODULE_MOUNT_ID_FIELD, createModuleMountDescriptor } from './lib/domain/module-mount.descriptors';\nexport { APP_NAV_ITEM_ENTITY_NAME, createNavItemDescriptor } from './lib/domain/nav-item.descriptors';\nexport { APP_REGION_ENTITY_NAME, APP_REGION_ID_FIELD, createRegionDefinitionDescriptor } from './lib/domain/region-definition.descriptors';\nexport { APP_ROUTE_ENTITY_NAME, APP_ROUTE_ID_FIELD, createRouteDefinitionDescriptor } from './lib/domain/route-definition.descriptors';\nexport { APP_WIDGET_ENTITY_NAME, createWidgetInstanceDescriptor } from './lib/domain/widget-instance.descriptors';\nexport { MODULE_DEFINITION_ENTITY_NAME, createModuleDefinitionDescriptor } from './lib/domain/module-definition.descriptors';\nexport { AppDefinitionMapper } from './lib/domain/app-definition.mapper';\nexport { AppDefinitionService } from './lib/domain/app-definition.service';\nexport { AppDefinitionStore } from './lib/domain/app-definition.store';\nexport { ModuleDefinitionMapper } from './lib/domain/module-definition.mapper';\nexport { ModuleDefinitionService } from './lib/domain/module-definition.service';\nexport { ModuleDefinitionStore } from './lib/domain/module-definition.store';\nexport { AppDefinitionFacade } from './lib/feature/app-definition.facade';\nexport { ModuleDefinitionFacade } from './lib/feature/module-definition.facade';\nexport { AppModuleMountFacade } from './lib/feature/app-module-mount.facade';\nexport { AppNavItemFacade } from './lib/feature/app-nav-item.facade';\nexport { buildAppRoutes, type AppRouteSource, type ModuleLoader, type RouteRenderer } from './lib/feature/app-route-builder';\nexport { AppRouteRenderer } from './lib/feature/app-route-renderer';\nexport { RouteWidgetsComponent } from './lib/feature/route-widgets.component';\nexport { WidgetListComponent } from './lib/feature/widget-list.component';\nexport { RouteUnsupportedComponent } from './lib/feature/route-unsupported.component';\nexport { AppRegionFacade } from './lib/feature/app-region.facade';\nexport { AppRouteFacade } from './lib/feature/app-route.facade';\nexport { AppWidgetFacade } from './lib/feature/app-widget.facade';\nexport { AppDefinitionContainerComponent } from './lib/feature/app-definition-container.component';\nexport { AppPreviewComponent } from './lib/feature/app-preview.component';\n// The run-time shell. Published because the standalone runtime host mounts `AppShellComponent` exactly as\n// the Preview tab does — that being the whole reason the shell is a component with one input.\nexport { AppShellComponent } from './lib/feature/shell/app-shell.component';\nexport { AppShellRoutesFactory, appShellRoutesGuard } from './lib/feature/shell/app-shell-routes';\nexport { AppRegionRenderer, type RegionView } from './lib/feature/shell/app-region.renderer';\nexport { layoutOf, themeVarsOf, type ResolvedLayout } from './lib/feature/shell/app-shell.model';\nexport { RegionFooterComponent } from './lib/feature/shell/region-footer.component';\nexport { RegionHeaderComponent } from './lib/feature/shell/region-header.component';\nexport { RegionNavComponent, type NavOrientation } from './lib/feature/shell/region-nav.component';\nexport { APP_PREVIEW_TAB } from './lib/feature/app-preview-tab';\nexport { ModuleDefinitionContainerComponent } from './lib/feature/module-definition-container.component';\nexport { BASE_APP_ENTITY_FACADES, BASE_APP_FACADE_PROVIDERS } from './lib/base-app.providers';\nexport { BASE_APP_ROUTES } from './lib/base-app.routes';\nexport { BASE_APP_TRANSLATION_SOURCE } from './lib/base-app.i18n';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1.AppDefinitionMapper","i1.ModuleDefinitionMapper"],"mappings":";;;;;;;;;;;;;;;;;;AAKA;;;;;;;;;;;;;;;;;;;AAmBG;AAEI,MAAM,eAAe,GAAG,CAAC,YAAY,EAAE,UAAU,EAAE,gBAAgB,EAAE,aAAa;AAGlF,MAAM,aAAa,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM;AAG9C,MAAM,cAAc,GAAG,CAAC,cAAc,EAAE,eAAe,EAAE,SAAS;AAGlE,MAAM,aAAa,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM;AAGpD;;;;AAIG;AACI,MAAM,YAAY,GAAG,CAAC,QAAQ,EAAE,SAAS,EAAE,QAAQ;AAG1D;;;;AAIG;AACI,MAAM,kBAAkB,GAAG,CAAC,SAAS,EAAE,UAAU,EAAE,QAAQ;MAGrD,YAAY,GAAG,CAAC,MAAM,EAAE,SAAS;IAGlC;AAAZ,CAAA,UAAY,mBAAmB,EAAA;AAC7B,IAAA,mBAAA,CAAA,OAAA,CAAA,GAAA,OAAe;AACf,IAAA,mBAAA,CAAA,WAAA,CAAA,GAAA,WAAuB;AACzB,CAAC,EAHW,mBAAmB,KAAnB,mBAAmB,GAAA,EAAA,CAAA,CAAA;MAsBlB,OAAO,CAAA;AAClB,IAAA,EAAE;AACF,IAAA,KAAK;AACL,IAAA,WAAW;AACX,IAAA,IAAI;AACJ;;;;;;AAMG;AACH,IAAA,SAAS;AACT,IAAA,KAAK;AACL,IAAA,QAAQ;AAER,IAAA,WAAA,CAAY,OAAyB,EAAE,EAAA;QACrC,IAAI,CAAC,EAAE,G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AAO,EAAE,UAAU,EAAE,sBAAsB,EAAE,MAAM,EAAE,eAAe,EAAE;AACxE;;AChHA;;AAEG;;ACFH;;AAEG;;;;"}
1
+ {"version":3,"file":"processpuzzle-base-app.mjs","names":[],"sources":["../../../../libs/js-shared/base-app-frontend/src/lib/domain/app-definition.ts","../../../../libs/js-shared/base-app-frontend/src/lib/domain/module-definition.ts","../../../../libs/js-shared/base-app-frontend/src/lib/base-app.i18n.ts","../../../../libs/js-shared/base-app-frontend/src/lib/domain/app-entity-names.ts","../../../../libs/js-shared/base-app-frontend/src/lib/domain/module-mount.descriptors.ts","../../../../libs/js-shared/base-app-frontend/src/lib/domain/region-definition.descriptors.ts","../../../../libs/js-shared/base-app-frontend/src/lib/domain/route-definition.descriptors.ts","../../../../libs/js-shared/base-app-frontend/src/lib/domain/app-definition.descriptors.ts","../../../../libs/js-shared/base-app-frontend/src/lib/domain/nav-item.descriptors.ts","../../../../libs/js-shared/base-app-frontend/src/lib/domain/widget-instance.descriptors.ts","../../../../libs/js-shared/base-app-frontend/src/lib/domain/module-definition.descriptors.ts","../../../../libs/js-shared/base-app-frontend/src/lib/domain/route-definition.mapper.ts","../../../../libs/js-shared/base-app-frontend/src/lib/domain/app-definition.mapper.ts","../../../../libs/js-shared/base-app-frontend/src/lib/domain/app-definition.service.ts","../../../../libs/js-shared/base-app-frontend/src/lib/domain/app-definition.store.ts","../../../../libs/js-shared/base-app-frontend/src/lib/domain/module-definition.mapper.ts","../../../../libs/js-shared/base-app-frontend/src/lib/domain/module-definition.service.ts","../../../../libs/js-shared/base-app-frontend/src/lib/domain/module-definition.store.ts","../../../../libs/js-shared/base-app-frontend/src/lib/feature/app-definition.facade.ts","../../../../libs/js-shared/base-app-frontend/src/lib/feature/module-definition.facade.ts","../../../../libs/js-shared/base-app-frontend/src/lib/feature/app-module-mount.facade.ts","../../../../libs/js-shared/base-app-frontend/src/lib/feature/app-nav-item.facade.ts","../../../../libs/js-shared/base-app-frontend/src/lib/feature/app-route-builder.ts","../../../../libs/js-shared/base-app-frontend/src/lib/feature/widget-list.component.ts","../../../../libs/js-shared/base-app-frontend/src/lib/feature/route-widgets.component.ts","../../../../libs/js-shared/base-app-frontend/src/lib/feature/route-unsupported.component.ts","../../../../libs/js-shared/base-app-frontend/src/lib/feature/app-route-renderer.ts","../../../../libs/js-shared/base-app-frontend/src/lib/feature/app-region.facade.ts","../../../../libs/js-shared/base-app-frontend/src/lib/feature/app-route.facade.ts","../../../../libs/js-shared/base-app-frontend/src/lib/feature/app-widget.facade.ts","../../../../libs/js-shared/base-app-frontend/src/lib/feature/shell/app-shell.model.ts","../../../../libs/js-shared/base-app-frontend/src/lib/feature/shell/region-footer.component.ts","../../../../libs/js-shared/base-app-frontend/src/lib/feature/shell/region-header.component.ts","../../../../libs/js-shared/base-app-frontend/src/lib/feature/shell/region-nav.component.ts","../../../../libs/js-shared/base-app-frontend/src/lib/feature/shell/app-region.renderer.ts","../../../../libs/js-shared/base-app-frontend/src/lib/feature/shell/shell-application-context.ts","../../../../libs/js-shared/base-app-frontend/src/lib/feature/shell/shell-overlay-container.ts","../../../../libs/js-shared/base-app-frontend/src/lib/feature/shell/app-shell.component.ts","../../../../libs/js-shared/base-app-frontend/src/lib/feature/app-preview.component.ts","../../../../libs/js-shared/base-app-frontend/src/lib/feature/shell/app-shell-routes.ts","../../../../libs/js-shared/base-app-frontend/src/lib/feature/app-preview-tab.ts","../../../../libs/js-shared/base-app-frontend/src/lib/feature/app-definition-container.component.ts","../../../../libs/js-shared/base-app-frontend/src/lib/feature/module-definition-container.component.ts","../../../../libs/js-shared/base-app-frontend/src/lib/base-app.providers.ts","../../../../libs/js-shared/base-app-frontend/src/lib/base-app.routes.ts"],"sourcesContent":["import { BaseEntity } from '@processpuzzle/base-entity';\nimport { THEME_COLOR_SCHEMES, THEME_PRESETS, ThemeColorScheme, ThemePreset, WidgetInstance } from '@processpuzzle/widgets';\n\nexport { WIDGET_PLACEMENTS, WidgetInstance, WidgetPlacement } from '@processpuzzle/widgets';\n\n/**\n * Frontend model of the `AppDefinition` schema of `base-app-api.yaml`. `theme` and `layout` are\n * flattened onto the entity by {@link AppDefinitionMapper} so that the generated form can offer a\n * typed control per field; the original objects are kept alongside, because a full replacement PUT\n * would otherwise drop the parts no control writes. `regions`, `routes` and `modules` stay nested and\n * are edited through the `EMBEDDED_COMPONENTS` controls of the `App Region` / `App Route` /\n * `App Module Mount` descriptors.\n *\n * A route's `target` is flattened the same way, for the same reason and by the same mapper. The\n * contract already keeps `RouteTarget` flat rather than a `oneOf` because the generic form cannot edit\n * a discriminated union of classes; a nested object it equally cannot reach, since an\n * `EMBEDDED_COMPONENTS` row is edited as the parsed JSON it arrived as and a descriptor addresses one\n * property, not a path. So {@link RouteDefinition} carries `kind` and the per-kind fields directly and\n * {@link AppDefinitionMapper} re-nests them on save.\n *\n * The nested definitions are classes rather than interfaces, because each is an embedded entity of\n * its own: `EmbeddedEntityFacade` mints the blank row an `Add` opens the child's form on, and that\n * needs a constructor. They stay plain data — the rows of a loaded aggregate are the parsed JSON,\n * never instances of these classes, so nothing may rely on `instanceof` or on a method.\n */\n\n/**\n * The theme presets and colour schemes the contract's `MaterialTheme` / `ColorScheme` enums allow. They are\n * the widgets library's lists, because that is where the stylesheet defining them and the `ThemesButton`\n * picking from them live.\n */\nexport const MATERIAL_THEMES = THEME_PRESETS;\nexport type MaterialTheme = ThemePreset;\n\nexport const COLOR_SCHEMES = THEME_COLOR_SCHEMES;\nexport type ColorScheme = ThemeColorScheme;\n\nexport const LAYOUT_PRESETS = ['sidenav-left', 'sidenav-right', 'top-nav'] as const;\nexport type LayoutPreset = (typeof LAYOUT_PRESETS)[number];\n\nexport const SIDENAV_MODES = ['side', 'over', 'push'] as const;\nexport type SidenavMode = (typeof SIDENAV_MODES)[number];\n\n/**\n * No `content`: once routes own the content area it *is* the router outlet, so a content region would\n * have no field of its own — `widgets` is header/footer-only and `navItems` sidenav-only. Its sizing\n * lives in {@link LayoutDefinition.contentMaxWidth}.\n */\nexport const REGION_TYPES = ['header', 'sidenav', 'footer'] as const;\nexport type RegionType = (typeof REGION_TYPES)[number];\n\n/**\n * What a route renders. Uppercase because the contract's enum is — `RegionType` and the theme enums\n * are lowercase, and mixing the two up is a silent miss rather than a type error once a value reaches\n * JSON.\n */\nexport const ROUTE_TARGET_KINDS = ['WIDGETS', 'DOCUMENT', 'ENTITY'] as const;\nexport type RouteTargetKind = (typeof ROUTE_TARGET_KINDS)[number];\n\nexport const ENTITY_MODES = ['LIST', 'DETAILS'] as const;\nexport type EntityMode = (typeof ENTITY_MODES)[number];\n\nexport enum AppDefinitionStatus {\n DRAFT = 'DRAFT',\n PUBLISHED = 'PUBLISHED',\n}\n\nexport interface ThemeDefinition {\n materialTheme?: MaterialTheme;\n colorScheme?: ColorScheme;\n /** Overrides for the `--pp-*` custom properties of `base-widget-frontend/src/theme/pp-colors.css`. */\n tokenOverrides?: Record<string, string>;\n logoUrl?: string;\n faviconUrl?: string;\n}\n\nexport interface LayoutDefinition {\n preset?: LayoutPreset;\n sidenavMode?: SidenavMode;\n sidenavCollapsible?: boolean;\n sidenavOpenByDefault?: boolean;\n contentMaxWidth?: string;\n}\n\nexport class NavItem implements BaseEntity {\n id: string;\n label: string;\n translocoId?: string;\n icon?: string;\n /**\n * `RouteDefinition.path` of the route this entry navigates to, resolved by string. Absent on a group\n * node, which expands its {@link children} instead of navigating.\n *\n * A path naming no route is a validation *warning* server-side, not an error: it may name a route of\n * a module that has not been authored yet, and modules stay loosely coupled.\n */\n routePath?: string;\n roles?: string[];\n children?: NavItem[];\n\n constructor(init: Partial<NavItem> = {}) {\n this.id = init.id ?? '';\n this.label = init.label ?? '';\n this.translocoId = init.translocoId;\n this.icon = init.icon;\n this.routePath = init.routePath;\n this.roles = init.roles;\n this.children = init.children;\n }\n}\n\nexport class RegionDefinition implements BaseEntity {\n /**\n * Declared, never assigned. The contract gives a region no `id` — `type` identifies it, see\n * `APP_REGION_ID_FIELD` — but `BaseEntity`'s only property is an optional `id`, and TypeScript's\n * weak-type rule rejects a type that shares no property with it. `declare` emits nothing, so the\n * payload stays exactly the shape the schema describes.\n */\n declare readonly id?: string;\n\n /**\n * Required by the contract, but undefined while a region is being created — the dropdown is declared\n * `required`, so the form is what enforces the contract before the row reaches the payload.\n */\n type: RegionType | undefined;\n /** `sidenav` only; left undefined so a header region's payload carries no empty nav tree. */\n navItems?: NavItem[];\n /** `header` / `footer` only. */\n widgets?: WidgetInstance[];\n\n constructor(init: Partial<RegionDefinition> = {}) {\n this.type = init.type;\n this.navItems = init.navItems;\n this.widgets = init.widgets;\n }\n}\n\n/**\n * The nested `target` object of the DTO. Only {@link AppDefinitionMapper} handles it — the form works\n * on the fields {@link RouteDefinition} carries flattened — so it is an interface rather than a class.\n */\nexport interface RouteTarget {\n kind: RouteTargetKind;\n /** WIDGETS only. */\n widgets?: WidgetInstance[];\n /** DOCUMENT only. */\n documentSlug?: string;\n /** ENTITY only. */\n entityName?: string;\n /** ENTITY only. */\n entityMode?: EntityMode;\n /** ENTITY + LIST only. */\n rsqlFilter?: string;\n}\n\n/**\n * One navigable route. **Flat: a route has no children.** `path` may be multi-segment, so `claims`,\n * `claims/open` and `claims/:id` are three sibling entries rather than a tree — Angular's own nesting\n * is derived from those prefixes when the shell builds its `Routes`, because nesting is a rendering\n * concern rather than something worth authoring. Structure is broken up at the module boundary\n * instead, through {@link ModuleMount}.\n *\n * The `target` fields are flattened onto the row and re-nested by {@link AppDefinitionMapper}; which of\n * them are meaningful follows from {@link kind}, and the backend — not the form — is what enforces it.\n */\nexport class RouteDefinition implements BaseEntity {\n /**\n * Declared, never assigned. The contract gives a route no `id`: `path` identifies it, which is what\n * a `NavItem.routePath` resolves against. Same reason as {@link RegionDefinition.id}.\n */\n declare readonly id?: string;\n\n /** Relative to the app root, no leading slash. May contain `/` for depth and `:name` for a parameter. */\n path: string;\n title: string;\n translocoId?: string;\n icon?: string;\n /** Empty or absent means any authenticated member of the organization, as on {@link NavItem.roles}. */\n roles?: string[];\n // region flattened target — re-nested into `target` by AppDefinitionMapper\n /**\n * Required by the contract, but undefined while a route is being created — the dropdown is declared\n * `required`, so the form is what enforces it before the row reaches the payload.\n */\n kind: RouteTargetKind | undefined;\n /** WIDGETS only. Starts as an empty array so the embedded list has something to append to. */\n widgets: WidgetInstance[];\n documentSlug?: string;\n entityName?: string;\n entityMode?: EntityMode;\n rsqlFilter?: string;\n // endregion\n /** The object the flattened fields came from, preserved so a save cannot drop a future field. */\n target?: RouteTarget;\n\n constructor(init: Partial<RouteDefinition> = {}) {\n this.path = init.path ?? '';\n this.title = init.title ?? '';\n this.translocoId = init.translocoId;\n this.icon = init.icon;\n this.roles = init.roles;\n this.kind = init.kind;\n this.widgets = init.widgets ?? [];\n this.documentSlug = init.documentSlug;\n this.entityName = init.entityName;\n this.entityMode = init.entityMode;\n this.rsqlFilter = init.rsqlFilter;\n this.target = init.target;\n }\n}\n\n/**\n * Mounts a module's routes under {@link basePath}. The one place route structure composes, and it\n * composes exactly one level deep: a module cannot mount modules.\n */\nexport class ModuleMount implements BaseEntity {\n /** `moduleKey` identifies the mount; the contract gives it no `id`. */\n declare readonly id?: string;\n\n /**\n * Key of a `ModuleDefinition` in this organization. One naming no existing module is a validation\n * warning, not an error — an app may mount a module before it has been authored.\n */\n moduleKey: string;\n basePath: string;\n\n constructor(init: Partial<ModuleMount> = {}) {\n this.moduleKey = init.moduleKey ?? '';\n this.basePath = init.basePath ?? '';\n }\n}\n\nexport class AppDefinition implements BaseEntity {\n /** Unique within the organization and used verbatim as the run-time route segment. */\n id: string;\n name: string;\n translocoId: string | undefined;\n description: string | undefined;\n // region flattened theme\n materialTheme: MaterialTheme | undefined;\n colorScheme: ColorScheme | undefined;\n tokenOverrides: Record<string, string> | undefined;\n logoUrl: string | undefined;\n faviconUrl: string | undefined;\n // endregion\n // region flattened layout\n preset: LayoutPreset | undefined;\n sidenavMode: SidenavMode | undefined;\n sidenavCollapsible: boolean;\n sidenavOpenByDefault: boolean;\n contentMaxWidth: string | undefined;\n // endregion\n /** The objects the flattened fields came from, preserved so a save cannot drop a future field. */\n theme: ThemeDefinition | undefined;\n layout: LayoutDefinition | undefined;\n regions: RegionDefinition[] | undefined;\n routes: RouteDefinition[] | undefined;\n modules: ModuleMount[] | undefined;\n // region server-assigned\n orgKey: string | undefined;\n status: AppDefinitionStatus | undefined;\n version: number | undefined;\n publishedVersion: number | undefined;\n createdAt: string | undefined;\n updatedAt: string | undefined;\n // endregion\n\n constructor(init: Partial<AppDefinition> = {}) {\n this.id = init.id ?? '';\n this.name = init.name ?? '';\n this.translocoId = init.translocoId;\n this.description = init.description;\n this.materialTheme = init.materialTheme;\n this.colorScheme = init.colorScheme;\n this.tokenOverrides = init.tokenOverrides;\n this.logoUrl = init.logoUrl;\n this.faviconUrl = init.faviconUrl;\n this.preset = init.preset;\n this.sidenavMode = init.sidenavMode;\n this.sidenavCollapsible = init.sidenavCollapsible ?? true;\n this.sidenavOpenByDefault = init.sidenavOpenByDefault ?? true;\n this.contentMaxWidth = init.contentMaxWidth;\n this.theme = init.theme;\n this.layout = init.layout;\n this.regions = init.regions;\n this.routes = init.routes;\n this.modules = init.modules;\n this.orgKey = init.orgKey;\n this.status = init.status;\n this.version = init.version;\n this.publishedVersion = init.publishedVersion;\n this.createdAt = init.createdAt;\n this.updatedAt = init.updatedAt;\n }\n}\n","import { BaseEntity } from '@processpuzzle/base-entity';\nimport { RouteDefinition } from './app-definition';\n\n/**\n * Frontend model of the `ModuleDefinition` schema of `base-app-api.yaml`: a lazily-loadable slice of an\n * application, with its own flat route list and its own transloco scope. An {@link ModuleMount} of an\n * `AppDefinition` names one of these by key and mounts its routes under a base path.\n *\n * **What \"lazy\" honestly means.** A module lazy-loads *metadata* — this definition, its routes, its\n * translations, and the documents and descriptors they name. It does **not** lazy-load widget code:\n * widget components are bundled at compile time and resolved through the frontend registry, so a\n * metadata module cannot split a bundle on its own. The wins are that `AppDefinition` stops being one\n * aggregate that has to be loaded, locked and published atomically, and that a module is the unit of\n * authoring permission and versioning. Nothing here should be justified on bundle size.\n *\n * Unlike the region / route / mount classes this one is a **routable** entity: it has endpoints of its\n * own, so it comes with a service, a store and a facade rather than travelling inside another payload.\n */\nexport class ModuleDefinition implements BaseEntity {\n /**\n * The contract calls this field `key`; base-entity keys every store, URL and reference on `id`, so\n * {@link ModuleDefinitionMapper} renames it on the way in and out rather than teaching the framework a\n * second identity field. One name for one thing on this side of the mapper — a `key` property beside\n * `id` could only ever disagree with it.\n *\n * Immutable by contract: `ModuleMount.moduleKey` resolves against it, and a rename would silently\n * unmount the module from every app that mounts it.\n */\n id: string;\n name: string;\n translocoId: string | undefined;\n description: string | undefined;\n /**\n * Transloco scope the module's translations load under. Absent means {@link id}, which is the default\n * the contract states; {@link moduleTranslocoScope} is the one place that default is applied.\n */\n translocoScope: string | undefined;\n /**\n * The module's routes, flat and relative to the base path it is mounted at — the same shape and the\n * same derived nesting as `AppDefinition.routes`, and flattened by the same mapper. A module does not\n * mount modules: this is where composition stops.\n */\n routes: RouteDefinition[] | undefined;\n // region server-assigned\n orgKey: string | undefined;\n version: number | undefined;\n createdAt: string | undefined;\n updatedAt: string | undefined;\n // endregion\n\n constructor(init: Partial<ModuleDefinition> = {}) {\n this.id = init.id ?? '';\n this.name = init.name ?? '';\n this.translocoId = init.translocoId;\n this.description = init.description;\n this.translocoScope = init.translocoScope;\n this.routes = init.routes;\n this.orgKey = init.orgKey;\n this.version = init.version;\n this.createdAt = init.createdAt;\n this.updatedAt = init.updatedAt;\n }\n}\n\n/**\n * The scope a module's translations load under, applying the contract's default. Kept as a function\n * rather than resolved in the mapper, so a definition never carries a `translocoScope` the designer did\n * not author — the field stays empty in the form, and the fallback is a rendering decision.\n */\nexport function moduleTranslocoScope(definition: ModuleDefinition): string {\n return definition.translocoScope?.trim() || definition.id;\n}\n","import type { TranslationSource } from '@processpuzzle/util';\n/**\n * Transloco scope of this library. The translations live in\n * `libs/js-shared/base-app-frontend/src/assets/i18n/base_app/*.json` and are published with the\n * package; a consuming application copies them to `assets/i18n/base_app` (see the testbed's\n * `project.json`). The scope is registered on {@link BASE_APP_ROUTES}, so it loads lazily with the\n * route rather than with the application shell.\n *\n * The alias is spelled out on purpose: transloco camel-cases the default alias, which would turn\n * `base_app` into `baseApp` and silently miss every key below.\n */\nexport const BASE_APP_TRANSLOCO_SCOPE = 'base_app';\n\n/**\n * Scope of the generic framework labels (`base_entity.tabs.*`, `base_entity.toolbar.*`), whose files\n * base-entity owns. It has to be registered next to {@link BASE_APP_TRANSLOCO_SCOPE} wherever the\n * generic screens are hosted: `BaseEntityTabsComponent` translates from it through `TranslocoPipe`,\n * which caches the value it resolved for a key on first render. If only `base_app` were loaded, the\n * tabs would keep the raw key even after the toolbar — which registers this scope for itself —\n * triggers the load.\n */\nexport const BASE_ENTITY_TRANSLOCO_SCOPE = 'base_entity';\n\n/** Key root of the `AppDefinition` entity name (`._self`) and of its attribute labels. */\nexport const APP_DEFINITION_I18N_SCOPE = `${BASE_APP_TRANSLOCO_SCOPE}.app_definition`;\n\n/**\n * Label of the Preview tab. Under this library's own scope rather than `base_entity.tabs.*`: the generic\n * tabs are List and Details, and an application preview is this feature's contribution, not the framework's.\n * Resolved with `{ entity }` like the generic tab labels, so a translation may name the entity if it reads\n * better that way.\n */\nexport const APP_PREVIEW_I18N_KEY = `${APP_DEFINITION_I18N_SCOPE}.tabs.preview`;\n\n/**\n * Key root of the `ModuleDefinition` entity name and attribute labels. A child of this library's scope\n * like the one above, and not to be confused with `ModuleDefinition.translocoScope`, which is a scope an\n * *authored* module's own translations load under — see {@link moduleTranslocoScope}. These keys are the\n * framework's labels for the authoring form; that one is the tenant's content.\n */\nexport const MODULE_DEFINITION_I18N_SCOPE = `${BASE_APP_TRANSLOCO_SCOPE}.module_definition`;\n\n/**\n * Key roots of the nested definitions the `AppDefinition` form contains through `EMBEDDED_COMPONENTS`\n * controls. They are children of {@link BASE_APP_TRANSLOCO_SCOPE} rather than scopes of their own,\n * because the whole graph is edited under `BASE_APP_ROUTES` and one scope registration has to cover\n * all of it — the embedded route branches add none.\n */\nexport const APP_REGION_I18N_SCOPE = `${BASE_APP_TRANSLOCO_SCOPE}.app_region`;\nexport const APP_ROUTE_I18N_SCOPE = `${BASE_APP_TRANSLOCO_SCOPE}.app_route`;\nexport const APP_MODULE_MOUNT_I18N_SCOPE = `${BASE_APP_TRANSLOCO_SCOPE}.app_module_mount`;\nexport const APP_NAV_ITEM_I18N_SCOPE = `${BASE_APP_TRANSLOCO_SCOPE}.app_nav_item`;\nexport const APP_WIDGET_I18N_SCOPE = `${BASE_APP_TRANSLOCO_SCOPE}.app_widget`;\n\n/** Keys of the `Publish` form action contributed by `AppDefinitionContainerComponent`. */\nexport const PUBLISH_BUTTON_I18N_KEY = `${BASE_APP_TRANSLOCO_SCOPE}.publish.button`;\nexport const PUBLISH_TOOLTIP_I18N_KEY = `${BASE_APP_TRANSLOCO_SCOPE}.publish.tooltip`;\n\n/**\n * Where this library's transloco bundles come from when the application ships without its assets.\n *\n * Spread into the application's `TRANSLATION_SOURCE_REGISTRY`, the way its facades are spread into\n * `BASE_ENTITY_FACADE_REGISTRY`. The scopes below normally arrive as static files — the build copies\n * them into `assets/i18n/<scope>` and the loader tries the asset first — so this is reached only by a\n * host that skips that copy step. It is declared here rather than in the application because which\n * backend owns a scope is base-app's knowledge, not its caller's.\n */\nexport const BASE_APP_TRANSLATION_SOURCE: TranslationSource = {\n scopes: ['base_app'],\n serviceRootKey: 'APP_SERVICE_ROOT',\n segment: 'app',\n};\n","/**\n * Entity names of the app-definition graph, kept in one dependency-free module.\n *\n * They live here rather than next to their descriptors because the graph is cyclic: `App Definition`\n * aggregates `App Region`, and `App Region` names `App Definition` as its `componentParent`. Each\n * descriptor module re-exports its own name, so importers are unaffected.\n */\nexport const APP_DEFINITION_ENTITY_NAME = 'App Definition';\n/**\n * A second aggregate root beside `App Definition`, not a part of it — hence no `App` prefix, which in\n * every other name here marks something the app document carries. `App Module Mount` is the row inside\n * an app that *names* one of these.\n */\nexport const MODULE_DEFINITION_ENTITY_NAME = 'Module Definition';\nexport const APP_MODULE_MOUNT_ENTITY_NAME = 'App Module Mount';\nexport const APP_NAV_ITEM_ENTITY_NAME = 'App Nav Item';\nexport const APP_REGION_ENTITY_NAME = 'App Region';\nexport const APP_ROUTE_ENTITY_NAME = 'App Route';\nexport const APP_WIDGET_ENTITY_NAME = 'App Widget';\n","import { AbstractAttrDescriptor, BaseEntityAttrDescriptor, BaseEntityDescriptor, FlexboxDescriptor, FlexDirection, FormControlType } from '@processpuzzle/base-entity';\nimport { APP_MODULE_MOUNT_I18N_SCOPE } from '../base-app.i18n';\nimport { APP_DEFINITION_ENTITY_NAME, APP_MODULE_MOUNT_ENTITY_NAME } from './app-entity-names';\n\nexport { APP_MODULE_MOUNT_ENTITY_NAME };\n\n/** `ModuleMount` has no `id` — an app mounts a given module once, so `moduleKey` identifies the row. */\nexport const APP_MODULE_MOUNT_ID_FIELD = 'moduleKey';\n\nfunction createModuleMountAttrDescriptors(): AbstractAttrDescriptor[] {\n // A plain text box rather than a FOREIGN_KEY onto the module list: modules stay loosely coupled, so a\n // key naming no existing module is a server-side warning rather than an error, and a dropdown of the\n // modules authored so far would turn that warning into something the form refuses to let happen.\n const moduleKeyAttr = new BaseEntityAttrDescriptor('moduleKey', FormControlType.TEXT_BOX, 'Module Key', undefined, true);\n moduleKeyAttr.required = true;\n moduleKeyAttr.isHeading = true;\n moduleKeyAttr.placeholder = 'Key of a module definition of this organization';\n // Both patterns are the contract's own. Declaring them here makes the form refuse what the backend\n // would refuse anyway, and puts them in the e2e registry, so generated fixtures produce dashed tokens\n // rather than prose the PUT answers with 400.\n moduleKeyAttr.pattern = '^[a-z0-9]+(-[a-z0-9]+)*$';\n\n const basePathAttr = new BaseEntityAttrDescriptor('basePath', FormControlType.TEXT_BOX, 'Base Path');\n basePathAttr.required = true;\n basePathAttr.placeholder = 'The module routes are mounted under this prefix, e.g. claims';\n basePathAttr.pattern = '^[a-z0-9][a-z0-9\\\\-/]*$';\n\n const flexBoxContainer = new FlexboxDescriptor([moduleKeyAttr, basePathAttr], FlexDirection.ROW);\n flexBoxContainer.style = { 'column-gap': '10px', width: 'fit-content' };\n return [flexBoxContainer];\n}\n\nexport function createModuleMountDescriptor(): BaseEntityDescriptor {\n return new BaseEntityDescriptor({\n entityName: APP_MODULE_MOUNT_ENTITY_NAME,\n attrDescriptors: createModuleMountAttrDescriptors(),\n i18nScope: APP_MODULE_MOUNT_I18N_SCOPE,\n componentParent: APP_DEFINITION_ENTITY_NAME,\n isEmbedded: true,\n });\n}\n","import { AbstractAttrDescriptor, BaseEntityAttrDescriptor, BaseEntityDescriptor, FlexboxDescriptor, FlexDirection, FormControlType, toSelectables } from '@processpuzzle/base-entity';\nimport { APP_REGION_I18N_SCOPE } from '../base-app.i18n';\nimport { REGION_TYPES } from './app-definition';\nimport { APP_DEFINITION_ENTITY_NAME, APP_NAV_ITEM_ENTITY_NAME, APP_REGION_ENTITY_NAME, APP_WIDGET_ENTITY_NAME } from './app-entity-names';\n\nexport { APP_REGION_ENTITY_NAME };\n\n/**\n * `RegionDefinition` has no `id` — a region is identified by the shell slot it fills, and an app\n * declares each slot at most once. Referencing attributes therefore have to set\n * `referenceIdField = 'type'`; see the `regions` attribute of the `AppDefinition` descriptor.\n */\nexport const APP_REGION_ID_FIELD = 'type';\n\nfunction createRegionDefinitionAttrDescriptors(): AbstractAttrDescriptor[] {\n const typeAttr = new BaseEntityAttrDescriptor('type', FormControlType.DROPDOWN, 'Type', toSelectables(REGION_TYPES), true);\n typeAttr.required = true;\n typeAttr.isHeading = true;\n\n // Per the contract, `navItems` applies to `sidenav` and `widgets` to `header` / `footer`; the\n // schema models them as optional siblings rather than a discriminated union, so both are offered\n // and it is the region's type that decides which one is meaningful. Both are contained: the rows\n // are nested arrays of this region, which is itself nested in the app definition's document.\n const navItemsAttr = new BaseEntityAttrDescriptor('navItems', FormControlType.EMBEDDED_COMPONENTS, 'Nav Items');\n navItemsAttr.linkedEntityType = APP_NAV_ITEM_ENTITY_NAME;\n navItemsAttr.hideInTable = true;\n\n const widgetsAttr = new BaseEntityAttrDescriptor('widgets', FormControlType.EMBEDDED_COMPONENTS, 'Widgets');\n widgetsAttr.linkedEntityType = APP_WIDGET_ENTITY_NAME;\n widgetsAttr.hideInTable = true;\n\n const flexBoxContainer = new FlexboxDescriptor([typeAttr, navItemsAttr, widgetsAttr], FlexDirection.COLUMN);\n flexBoxContainer.style = { 'row-gap': '5px', width: 'fit-content' };\n return [flexBoxContainer];\n}\n\nexport function createRegionDefinitionDescriptor(): BaseEntityDescriptor {\n return new BaseEntityDescriptor({\n entityName: APP_REGION_ENTITY_NAME,\n attrDescriptors: createRegionDefinitionAttrDescriptors(),\n i18nScope: APP_REGION_I18N_SCOPE,\n componentParent: APP_DEFINITION_ENTITY_NAME,\n isEmbedded: true,\n });\n}\n","import { AbstractAttrDescriptor, BaseEntityAttrDescriptor, BaseEntityDescriptor, FlexboxDescriptor, FlexDirection, FormControlType, toSelectables } from '@processpuzzle/base-entity';\nimport { APP_ROUTE_I18N_SCOPE } from '../base-app.i18n';\nimport { ENTITY_MODES, ROUTE_TARGET_KINDS } from './app-definition';\nimport { APP_DEFINITION_ENTITY_NAME, APP_ROUTE_ENTITY_NAME, APP_WIDGET_ENTITY_NAME, MODULE_DEFINITION_ENTITY_NAME } from './app-entity-names';\n\nexport { APP_ROUTE_ENTITY_NAME };\n\n/**\n * `RouteDefinition` has no `id` — `path` identifies a route, and it is what a `NavItem.routePath`\n * resolves against. Referencing attributes therefore have to set `referenceIdField = 'path'`; see the\n * `routePath` attribute of the `App Nav Item` descriptor.\n *\n * Unlike `App Region`'s `type`, this value may contain `/`, so the authoring URL that addresses one row\n * carries it percent-encoded (`app-route/claims%2Fopen/details`). Angular round-trips that, but a\n * reverse proxy that normalizes `%2F` before the SPA sees it would not — worth an e2e case once\n * multi-segment routes are authored in the testbed.\n */\nexport const APP_ROUTE_ID_FIELD = 'path';\n\nfunction createRouteDefinitionAttrDescriptors(): AbstractAttrDescriptor[] {\n const pathAttr = new BaseEntityAttrDescriptor('path', FormControlType.TEXT_BOX, 'Path', undefined, true);\n pathAttr.required = true;\n pathAttr.placeholder = 'Relative to the app root, e.g. claims/open or claims/:id';\n // The contract's own pattern. Declaring it here is what makes the form reject a value the backend\n // would reject anyway — and it is serialized into the e2e registry, so generated fixtures produce a\n // dashed token instead of a prose value the PUT answers with 400.\n pathAttr.pattern = '^[a-z0-9:][a-z0-9\\\\-:/]*$';\n\n const titleAttr = new BaseEntityAttrDescriptor('title', FormControlType.TEXT_BOX, 'Title');\n titleAttr.required = true;\n titleAttr.isHeading = true;\n\n const translocoIdAttr = new BaseEntityAttrDescriptor('translocoId', FormControlType.TEXT_BOX, 'Transloco Id');\n translocoIdAttr.placeholder = 'Translation key of the route title';\n translocoIdAttr.hideInTable = true;\n\n const iconAttr = new BaseEntityAttrDescriptor('icon', FormControlType.TEXT_BOX, 'Icon');\n iconAttr.placeholder = 'Material or FontAwesome icon name';\n iconAttr.hideInTable = true;\n\n const rolesAttr = new BaseEntityAttrDescriptor('roles', FormControlType.TAGS, 'Roles');\n rolesAttr.placeholder = 'Empty means any authenticated member of the organization';\n rolesAttr.hideInTable = true;\n\n // region flattened target — re-nested into `target` by AppDefinitionMapper\n // Which of the fields below is meaningful follows from `kind`; all of them are offered, and the\n // backend validator — not the form — is what rejects a combination that makes no sense. The generic\n // form has no conditional visibility, and a discriminated union is not something a descriptor can\n // express in the first place.\n const kindAttr = new BaseEntityAttrDescriptor('kind', FormControlType.DROPDOWN, 'Renders', toSelectables(ROUTE_TARGET_KINDS));\n kindAttr.required = true;\n\n const widgetsAttr = new BaseEntityAttrDescriptor('widgets', FormControlType.EMBEDDED_COMPONENTS, 'Widgets');\n widgetsAttr.linkedEntityType = APP_WIDGET_ENTITY_NAME;\n widgetsAttr.hideInTable = true;\n\n const documentSlugAttr = new BaseEntityAttrDescriptor('documentSlug', FormControlType.TEXT_BOX, 'Document Slug');\n documentSlugAttr.placeholder = 'DOCUMENT only: slug of the document to render';\n documentSlugAttr.hideInTable = true;\n\n const entityNameAttr = new BaseEntityAttrDescriptor('entityName', FormControlType.TEXT_BOX, 'Entity Name');\n entityNameAttr.placeholder = 'ENTITY only: name of the descriptor to generate the screen from';\n entityNameAttr.hideInTable = true;\n\n const entityModeAttr = new BaseEntityAttrDescriptor('entityMode', FormControlType.DROPDOWN, 'Entity Mode', toSelectables(ENTITY_MODES));\n entityModeAttr.hideInTable = true;\n\n const rsqlFilterAttr = new BaseEntityAttrDescriptor('rsqlFilter', FormControlType.TEXT_BOX, 'Rsql Filter');\n rsqlFilterAttr.placeholder = 'ENTITY + LIST only: RSQL the list is pre-filtered with';\n rsqlFilterAttr.hideInTable = true;\n // endregion\n\n const identityRow = new FlexboxDescriptor([pathAttr, titleAttr, translocoIdAttr], FlexDirection.ROW);\n identityRow.style = { 'column-gap': '10px' };\n const presentationRow = new FlexboxDescriptor([iconAttr, kindAttr], FlexDirection.ROW);\n presentationRow.style = { 'column-gap': '10px' };\n const documentRow = new FlexboxDescriptor([documentSlugAttr], FlexDirection.ROW);\n documentRow.style = { 'column-gap': '10px' };\n const entityRow = new FlexboxDescriptor([entityNameAttr, entityModeAttr, rsqlFilterAttr], FlexDirection.ROW);\n entityRow.style = { 'column-gap': '10px' };\n\n const flexBoxContainer = new FlexboxDescriptor([identityRow, presentationRow, rolesAttr, documentRow, entityRow, widgetsAttr], FlexDirection.COLUMN);\n flexBoxContainer.style = { 'row-gap': '5px', width: 'fit-content' };\n return [flexBoxContainer];\n}\n\nexport function createRouteDefinitionDescriptor(): BaseEntityDescriptor {\n return new BaseEntityDescriptor({\n entityName: APP_ROUTE_ENTITY_NAME,\n attrDescriptors: createRouteDefinitionAttrDescriptors(),\n i18nScope: APP_ROUTE_I18N_SCOPE,\n // Two parents, one descriptor: an app's own routes and a module's routes are the same schema, and a\n // route has to mean the same thing wherever it was authored. The module's paths are simply relative\n // to the base path its mount gives them.\n componentParent: [APP_DEFINITION_ENTITY_NAME, MODULE_DEFINITION_ENTITY_NAME],\n isEmbedded: true,\n });\n}\n","import { AbstractAttrDescriptor, BaseEntityAttrDescriptor, BaseEntityDescriptor, FlexboxDescriptor, FlexDirection, FormControlType, toSelectables } from '@processpuzzle/base-entity';\nimport { APP_DEFINITION_I18N_SCOPE } from '../base-app.i18n';\nimport { AppDefinitionStatus, COLOR_SCHEMES, LAYOUT_PRESETS, MATERIAL_THEMES, SIDENAV_MODES } from './app-definition';\nimport { APP_DEFINITION_ENTITY_NAME, APP_MODULE_MOUNT_ENTITY_NAME, APP_REGION_ENTITY_NAME, APP_ROUTE_ENTITY_NAME } from './app-entity-names';\nimport { APP_MODULE_MOUNT_ID_FIELD } from './module-mount.descriptors';\nimport { APP_REGION_ID_FIELD } from './region-definition.descriptors';\nimport { APP_ROUTE_ID_FIELD } from './route-definition.descriptors';\n\nexport { APP_DEFINITION_ENTITY_NAME };\n\nconst statusSelectables = toSelectables(Object.keys(AppDefinitionStatus));\n\nfunction createAppDefinitionAttrDescriptors(): AbstractAttrDescriptor[] {\n const idAttr = new BaseEntityAttrDescriptor('id', FormControlType.TEXT_BOX, 'Id');\n idAttr.required = true;\n idAttr.placeholder = 'Unique within the organization, e.g. claims-app';\n\n const nameAttr = new BaseEntityAttrDescriptor('name', FormControlType.TEXT_BOX, 'Name', undefined, true);\n nameAttr.required = true;\n nameAttr.isHeading = true;\n\n const translocoIdAttr = new BaseEntityAttrDescriptor('translocoId', FormControlType.TEXT_BOX, 'Transloco Id');\n translocoIdAttr.placeholder = 'Translation key of the application name';\n translocoIdAttr.hideInTable = true;\n\n const descriptionAttr = new BaseEntityAttrDescriptor('description', FormControlType.TEXTAREA, 'Description');\n descriptionAttr.styleClass = 'full-width';\n descriptionAttr.hideInTable = true;\n\n // Server-assigned: shown so the designer can see where a definition stands, never edited here.\n // Status changes through `POST .../publish`, the versions through any successful write.\n const statusAttr = new BaseEntityAttrDescriptor('status', FormControlType.DROPDOWN, 'Status', statusSelectables);\n statusAttr.disabled = true;\n\n const versionAttr = new BaseEntityAttrDescriptor('version', FormControlType.TEXT_BOX, 'Version');\n versionAttr.disabled = true;\n\n const publishedVersionAttr = new BaseEntityAttrDescriptor('publishedVersion', FormControlType.TEXT_BOX, 'Published Version');\n publishedVersionAttr.disabled = true;\n\n const updatedAtAttr = new BaseEntityAttrDescriptor('updatedAt', FormControlType.TEXT_BOX, 'Updated At');\n updatedAtAttr.disabled = true;\n\n // region theme — flattened out of `theme` by AppDefinitionMapper\n const materialThemeAttr = new BaseEntityAttrDescriptor('materialTheme', FormControlType.DROPDOWN, 'Material Theme', toSelectables(MATERIAL_THEMES));\n materialThemeAttr.hideInTable = true;\n\n const colorSchemeAttr = new BaseEntityAttrDescriptor('colorScheme', FormControlType.DROPDOWN, 'Color Scheme', toSelectables(COLOR_SCHEMES));\n colorSchemeAttr.hideInTable = true;\n\n const logoUrlAttr = new BaseEntityAttrDescriptor('logoUrl', FormControlType.TEXT_BOX, 'Logo Url');\n logoUrlAttr.placeholder = 'Tenant logo shown in the header region';\n logoUrlAttr.hideInTable = true;\n\n const faviconUrlAttr = new BaseEntityAttrDescriptor('faviconUrl', FormControlType.TEXT_BOX, 'Favicon Url');\n faviconUrlAttr.hideInTable = true;\n\n // An open key/value map by contract — keys are `--pp-*` token names, values any CSS color — so a\n // key/value editor is the only shape that can carry it without the form inventing a closed list.\n const tokenOverridesAttr = new BaseEntityAttrDescriptor('tokenOverrides', FormControlType.ADDITIONAL_PROPERTIES, 'Token Overrides');\n tokenOverridesAttr.hideInTable = true;\n // endregion\n\n // region layout — flattened out of `layout` by AppDefinitionMapper\n const presetAttr = new BaseEntityAttrDescriptor('preset', FormControlType.DROPDOWN, 'Layout Preset', toSelectables(LAYOUT_PRESETS));\n presetAttr.hideInTable = true;\n\n const sidenavModeAttr = new BaseEntityAttrDescriptor('sidenavMode', FormControlType.DROPDOWN, 'Sidenav Mode', toSelectables(SIDENAV_MODES));\n sidenavModeAttr.hideInTable = true;\n\n const contentMaxWidthAttr = new BaseEntityAttrDescriptor('contentMaxWidth', FormControlType.TEXT_BOX, 'Content Max Width');\n contentMaxWidthAttr.placeholder = 'CSS length, e.g. 1280px; empty means full width';\n contentMaxWidthAttr.hideInTable = true;\n\n const sidenavCollapsibleAttr = new BaseEntityAttrDescriptor('sidenavCollapsible', FormControlType.CHECKBOX, 'Sidenav Collapsible');\n sidenavCollapsibleAttr.hideInTable = true;\n\n const sidenavOpenByDefaultAttr = new BaseEntityAttrDescriptor('sidenavOpenByDefault', FormControlType.CHECKBOX, 'Sidenav Open By Default');\n sidenavOpenByDefaultAttr.hideInTable = true;\n // endregion\n\n // region nested graph — kept on the entity as-is by AppDefinitionMapper, so the full-replacement PUT preserves it\n // Containment, not association: the contract nests `RegionDefinition`, `RouteDefinition` and\n // `ModuleMount` inside the AppDefinition document, and none has an endpoint of its own, so the rows\n // travel inside this entity's payload and are saved with it. A `ModuleMount` is the exception that\n // proves it — the module it *names* is a separate aggregate with its own endpoints, but the mount\n // itself belongs to this app.\n const regionsAttr = new BaseEntityAttrDescriptor('regions', FormControlType.EMBEDDED_COMPONENTS, 'Regions');\n regionsAttr.linkedEntityType = APP_REGION_ENTITY_NAME;\n // A region has no `id` in the contract; `type` is what identifies it. See APP_REGION_ID_FIELD.\n regionsAttr.referenceIdField = APP_REGION_ID_FIELD;\n regionsAttr.hideInTable = true;\n\n // Flat by design: a route has no children, and the multi-segment paths of these rows are what the\n // shell derives Angular's nesting from at registration time.\n const routesAttr = new BaseEntityAttrDescriptor('routes', FormControlType.EMBEDDED_COMPONENTS, 'Routes');\n routesAttr.linkedEntityType = APP_ROUTE_ENTITY_NAME;\n routesAttr.referenceIdField = APP_ROUTE_ID_FIELD;\n routesAttr.hideInTable = true;\n\n const modulesAttr = new BaseEntityAttrDescriptor('modules', FormControlType.EMBEDDED_COMPONENTS, 'Modules');\n modulesAttr.linkedEntityType = APP_MODULE_MOUNT_ENTITY_NAME;\n modulesAttr.referenceIdField = APP_MODULE_MOUNT_ID_FIELD;\n modulesAttr.hideInTable = true;\n // endregion\n\n const identityRow = new FlexboxDescriptor([idAttr, nameAttr, translocoIdAttr], FlexDirection.ROW);\n identityRow.style = { 'column-gap': '10px' };\n const revisionRow = new FlexboxDescriptor([statusAttr, versionAttr, publishedVersionAttr, updatedAtAttr], FlexDirection.ROW);\n revisionRow.style = { 'column-gap': '10px' };\n const themeRow = new FlexboxDescriptor([materialThemeAttr, colorSchemeAttr], FlexDirection.ROW);\n themeRow.style = { 'column-gap': '10px' };\n const brandingRow = new FlexboxDescriptor([logoUrlAttr, faviconUrlAttr], FlexDirection.ROW);\n brandingRow.style = { 'column-gap': '10px' };\n const layoutRow = new FlexboxDescriptor([presetAttr, sidenavModeAttr, contentMaxWidthAttr], FlexDirection.ROW);\n layoutRow.style = { 'column-gap': '10px' };\n const sidenavRow = new FlexboxDescriptor([sidenavCollapsibleAttr, sidenavOpenByDefaultAttr], FlexDirection.ROW);\n sidenavRow.style = { 'column-gap': '10px' };\n const graphRow = new FlexboxDescriptor([regionsAttr, routesAttr, modulesAttr], FlexDirection.ROW);\n graphRow.style = { 'column-gap': '10px' };\n\n const flexBoxContainer = new FlexboxDescriptor(\n [identityRow, revisionRow, descriptionAttr, themeRow, brandingRow, tokenOverridesAttr, layoutRow, sidenavRow, graphRow],\n FlexDirection.COLUMN,\n );\n flexBoxContainer.style = { 'row-gap': '5px', width: 'fit-content' };\n return [flexBoxContainer];\n}\n\nexport function createAppDefinitionDescriptor(): BaseEntityDescriptor {\n return new BaseEntityDescriptor({ entityName: APP_DEFINITION_ENTITY_NAME, attrDescriptors: createAppDefinitionAttrDescriptors(), i18nScope: APP_DEFINITION_I18N_SCOPE });\n}\n","import { AbstractAttrDescriptor, BaseEntityAttrDescriptor, BaseEntityDescriptor, FlexboxDescriptor, FlexDirection, FormControlType } from '@processpuzzle/base-entity';\nimport { APP_NAV_ITEM_I18N_SCOPE } from '../base-app.i18n';\nimport { APP_NAV_ITEM_ENTITY_NAME, APP_REGION_ENTITY_NAME, APP_ROUTE_ENTITY_NAME } from './app-entity-names';\nimport { APP_ROUTE_ID_FIELD } from './route-definition.descriptors';\n\nexport { APP_NAV_ITEM_ENTITY_NAME };\n\nfunction createNavItemAttrDescriptors(): AbstractAttrDescriptor[] {\n const idAttr = new BaseEntityAttrDescriptor('id', FormControlType.TEXT_BOX, 'Id');\n idAttr.required = true;\n\n const labelAttr = new BaseEntityAttrDescriptor('label', FormControlType.TEXT_BOX, 'Label', undefined, true);\n labelAttr.required = true;\n labelAttr.isHeading = true;\n\n const translocoIdAttr = new BaseEntityAttrDescriptor('translocoId', FormControlType.TEXT_BOX, 'Transloco Id');\n translocoIdAttr.placeholder = 'Translation key of the label';\n translocoIdAttr.hideInTable = true;\n\n const iconAttr = new BaseEntityAttrDescriptor('icon', FormControlType.TEXT_BOX, 'Icon');\n iconAttr.placeholder = 'Material or FontAwesome icon name';\n iconAttr.hideInTable = true;\n\n // A group node expands its children instead of navigating, so this stays optional. The route is\n // resolved by `path` rather than by an id — see APP_ROUTE_ID_FIELD.\n const routePathAttr = new BaseEntityAttrDescriptor('routePath', FormControlType.FOREIGN_KEY, 'Route');\n routePathAttr.linkedEntityType = APP_ROUTE_ENTITY_NAME;\n routePathAttr.referenceIdField = APP_ROUTE_ID_FIELD;\n\n const rolesAttr = new BaseEntityAttrDescriptor('roles', FormControlType.TAGS, 'Roles');\n rolesAttr.placeholder = 'Empty means any authenticated member of the organization';\n rolesAttr.hideInTable = true;\n\n // A group node contains its children rather than pointing at them — they are an inline array of this\n // entry, and the entry itself is nested in the app definition's document.\n const childrenAttr = new BaseEntityAttrDescriptor('children', FormControlType.EMBEDDED_COMPONENTS, 'Children');\n childrenAttr.linkedEntityType = APP_NAV_ITEM_ENTITY_NAME;\n childrenAttr.hideInTable = true;\n\n const identityRow = new FlexboxDescriptor([idAttr, labelAttr, translocoIdAttr], FlexDirection.ROW);\n identityRow.style = { 'column-gap': '10px' };\n const targetRow = new FlexboxDescriptor([iconAttr, routePathAttr], FlexDirection.ROW);\n targetRow.style = { 'column-gap': '10px' };\n\n const flexBoxContainer = new FlexboxDescriptor([identityRow, targetRow, rolesAttr, childrenAttr], FlexDirection.COLUMN);\n flexBoxContainer.style = { 'row-gap': '5px', width: 'fit-content' };\n return [flexBoxContainer];\n}\n\nexport function createNavItemDescriptor(): BaseEntityDescriptor {\n return new BaseEntityDescriptor({\n entityName: APP_NAV_ITEM_ENTITY_NAME,\n attrDescriptors: createNavItemAttrDescriptors(),\n i18nScope: APP_NAV_ITEM_I18N_SCOPE,\n // A nav item hangs off the sidenav region, or off another nav item as a group child.\n componentParent: [APP_REGION_ENTITY_NAME, APP_NAV_ITEM_ENTITY_NAME],\n isEmbedded: true,\n });\n}\n","import { AbstractAttrDescriptor, BaseEntityAttrDescriptor, BaseEntityDescriptor, FlexboxDescriptor, FlexDirection, FormControlType, toSelectables } from '@processpuzzle/base-entity';\nimport { createWidgetPropsAttrDescriptor } from '@processpuzzle/widgets';\nimport { APP_WIDGET_I18N_SCOPE } from '../base-app.i18n';\nimport { WIDGET_PLACEMENTS } from './app-definition';\nimport { APP_REGION_ENTITY_NAME, APP_ROUTE_ENTITY_NAME, APP_WIDGET_ENTITY_NAME } from './app-entity-names';\n\nexport { APP_WIDGET_ENTITY_NAME };\n\nfunction createWidgetInstanceAttrDescriptors(): AbstractAttrDescriptor[] {\n // `id` rather than `type` identifies the widget: it is unique within its page or region, while a\n // page with two `entity-grid`s would otherwise show the same label twice.\n const idAttr = new BaseEntityAttrDescriptor('id', FormControlType.TEXT_BOX, 'Id', undefined, true);\n idAttr.required = true;\n idAttr.isHeading = true;\n idAttr.placeholder = 'Unique within the page or region, e.g. widget-claims-grid';\n\n // Deliberately a free-text box and not a dropdown: `WidgetInstance.type` is a key into the frontend\n // widget registry, which the contract keeps open so new widget types need no schema change.\n const typeAttr = new BaseEntityAttrDescriptor('type', FormControlType.TEXT_BOX, 'Type');\n typeAttr.required = true;\n typeAttr.placeholder = 'Widget registry key, e.g. entity-grid';\n\n // Generated from the chosen type's `propsSchema`, as registered in the WIDGET_REGISTRY: one typed control per\n // prop, rebuilt when `type` changes. A type nobody registered or described gets the open key/value editor.\n const propsAttr = createWidgetPropsAttrDescriptor('props', 'type', 'Props');\n propsAttr.hideInTable = true;\n\n // Widgets do not nest: a container widget type lists the ids of siblings in `props.childIds`, and each\n // of those siblings is marked REFERENCED so it is placed by the container instead of rendering twice.\n // That is the whole of composition here — there is no child collection to edit.\n const placementAttr = new BaseEntityAttrDescriptor('placement', FormControlType.DROPDOWN, 'Placement', toSelectables(WIDGET_PLACEMENTS));\n placementAttr.hideInTable = true;\n\n const identityRow = new FlexboxDescriptor([idAttr, typeAttr, placementAttr], FlexDirection.ROW);\n identityRow.style = { 'column-gap': '10px' };\n\n const flexBoxContainer = new FlexboxDescriptor([identityRow, propsAttr], FlexDirection.COLUMN);\n flexBoxContainer.style = { 'row-gap': '5px', width: 'fit-content' };\n return [flexBoxContainer];\n}\n\nexport function createWidgetInstanceDescriptor(): BaseEntityDescriptor {\n return new BaseEntityDescriptor({\n entityName: APP_WIDGET_ENTITY_NAME,\n attrDescriptors: createWidgetInstanceAttrDescriptors(),\n i18nScope: APP_WIDGET_I18N_SCOPE,\n // A widget sits in a header/footer region or on a page — and only there, since it cannot be nested\n // in another widget.\n componentParent: [APP_REGION_ENTITY_NAME, APP_ROUTE_ENTITY_NAME],\n isEmbedded: true,\n });\n}\n","import { AbstractAttrDescriptor, BaseEntityAttrDescriptor, BaseEntityDescriptor, FlexboxDescriptor, FlexDirection, FormControlType } from '@processpuzzle/base-entity';\nimport { MODULE_DEFINITION_I18N_SCOPE } from '../base-app.i18n';\nimport { APP_ROUTE_ENTITY_NAME, MODULE_DEFINITION_ENTITY_NAME } from './app-entity-names';\nimport { APP_ROUTE_ID_FIELD } from './route-definition.descriptors';\n\nexport { MODULE_DEFINITION_ENTITY_NAME };\n\nfunction createModuleDefinitionAttrDescriptors(): AbstractAttrDescriptor[] {\n // The contract's `key`, renamed to `id` by ModuleDefinitionMapper because base-entity keys stores and\n // URLs on `id`. Labelled 'Key' so the designer sees the name the contract and `ModuleMount.moduleKey`\n // use. The pattern is the contract's own: the key is a URL segment of the module endpoints and the\n // prefix a mount composes with, so a value needing encoding would break both.\n const idAttr = new BaseEntityAttrDescriptor('id', FormControlType.TEXT_BOX, 'Key');\n idAttr.required = true;\n idAttr.pattern = '^[a-z0-9]+(-[a-z0-9]+)*$';\n idAttr.placeholder = 'Unique within the organization, e.g. claims — immutable once mounted';\n\n const nameAttr = new BaseEntityAttrDescriptor('name', FormControlType.TEXT_BOX, 'Name', undefined, true);\n nameAttr.required = true;\n nameAttr.isHeading = true;\n\n const translocoIdAttr = new BaseEntityAttrDescriptor('translocoId', FormControlType.TEXT_BOX, 'Transloco Id');\n translocoIdAttr.placeholder = 'Translation key of the module name';\n translocoIdAttr.hideInTable = true;\n\n const descriptionAttr = new BaseEntityAttrDescriptor('description', FormControlType.TEXTAREA, 'Description');\n descriptionAttr.styleClass = 'full-width';\n descriptionAttr.hideInTable = true;\n\n // Left empty means the key, which is the default the contract states — applied by\n // `moduleTranslocoScope` rather than written into the row, so an empty field stays empty.\n const translocoScopeAttr = new BaseEntityAttrDescriptor('translocoScope', FormControlType.TEXT_BOX, 'Transloco Scope');\n translocoScopeAttr.placeholder = \"Scope the module's translations load under; empty means the key\";\n translocoScopeAttr.hideInTable = true;\n\n // Server-assigned, shown so the designer can see where a module stands.\n const versionAttr = new BaseEntityAttrDescriptor('version', FormControlType.TEXT_BOX, 'Version');\n versionAttr.disabled = true;\n\n const updatedAtAttr = new BaseEntityAttrDescriptor('updatedAt', FormControlType.TEXT_BOX, 'Updated At');\n updatedAtAttr.disabled = true;\n\n // The same rows, the same descriptor and the same derived nesting as `AppDefinition.routes` — only the\n // paths are relative to the base path a mount gives them. `App Route` therefore names this entity as a\n // second `componentParent`.\n const routesAttr = new BaseEntityAttrDescriptor('routes', FormControlType.EMBEDDED_COMPONENTS, 'Routes');\n routesAttr.linkedEntityType = APP_ROUTE_ENTITY_NAME;\n routesAttr.referenceIdField = APP_ROUTE_ID_FIELD;\n routesAttr.hideInTable = true;\n\n const identityRow = new FlexboxDescriptor([idAttr, nameAttr, translocoIdAttr], FlexDirection.ROW);\n identityRow.style = { 'column-gap': '10px' };\n const revisionRow = new FlexboxDescriptor([translocoScopeAttr, versionAttr, updatedAtAttr], FlexDirection.ROW);\n revisionRow.style = { 'column-gap': '10px' };\n\n const flexBoxContainer = new FlexboxDescriptor([identityRow, revisionRow, descriptionAttr, routesAttr], FlexDirection.COLUMN);\n flexBoxContainer.style = { 'row-gap': '5px', width: 'fit-content' };\n return [flexBoxContainer];\n}\n\nexport function createModuleDefinitionDescriptor(): BaseEntityDescriptor {\n return new BaseEntityDescriptor({\n entityName: MODULE_DEFINITION_ENTITY_NAME,\n attrDescriptors: createModuleDefinitionAttrDescriptors(),\n i18nScope: MODULE_DEFINITION_I18N_SCOPE,\n });\n}\n","import { RouteDefinition, RouteTarget } from './app-definition';\n\n/** The `RouteDefinition` schema as it travels: `target` nested, exactly as the contract declares it. */\nexport interface RouteDefinitionDto {\n path?: string;\n title?: string;\n translocoId?: string;\n icon?: string;\n roles?: string[];\n target?: RouteTarget;\n}\n\n/**\n * The `target` flattening both aggregates that own routes need — `AppDefinition.routes` and\n * `ModuleDefinition.routes` carry the same schema, and a route authored in a module has to behave\n * exactly like one authored in an app.\n *\n * Why flatten at all: `EMBEDDED_COMPONENTS` edits a row as the flat JSON it arrived as, and a descriptor\n * addresses one property rather than a path, so nothing in the generated form could reach\n * `target.documentSlug`. The contract already keeps `RouteTarget` flat rather than a `oneOf` for the\n * related reason that the form cannot edit a discriminated union of classes.\n */\nexport function flattenRouteTarget(dto: RouteDefinitionDto): RouteDefinition {\n const target = dto.target;\n return new RouteDefinition({\n path: dto.path,\n title: dto.title,\n translocoId: dto.translocoId,\n icon: dto.icon,\n roles: dto.roles,\n kind: target?.kind,\n widgets: target?.widgets,\n documentSlug: target?.documentSlug,\n entityName: target?.entityName,\n entityMode: target?.entityMode,\n rsqlFilter: target?.rsqlFilter,\n // Kept so nestRouteTarget can merge onto it rather than replace it.\n target,\n });\n}\n\n/**\n * The inverse. `kind` is non-optional in the contract but undefined on a row the designer has not\n * finished — the dropdown is `required`, so the form rejects that before a save; the cast keeps this\n * mapping from having to invent a default the backend would then have to second-guess.\n *\n * `widgets` is omitted when empty rather than sent as `[]`, so a DOCUMENT or ENTITY route does not\n * persist an empty widget list it has no use for. The rest is merged onto the `target` the fields were\n * lifted out of, which preserves any field a later contract version adds before this mapping learns\n * about it — a PUT is a full replacement, so anything dropped here is dropped for good.\n */\nexport function nestRouteTarget(route: RouteDefinition): RouteDefinitionDto {\n const widgets = route.widgets;\n return {\n path: route.path,\n title: route.title,\n translocoId: route.translocoId,\n icon: route.icon,\n roles: route.roles,\n target: {\n ...route.target,\n kind: route.kind as RouteTarget['kind'],\n widgets: widgets?.length ? widgets : undefined,\n documentSlug: route.documentSlug,\n entityName: route.entityName,\n entityMode: route.entityMode,\n rsqlFilter: route.rsqlFilter,\n },\n };\n}\n","import { Injectable } from '@angular/core';\nimport { BaseEntityMapper } from '@processpuzzle/base-entity';\nimport { AppDefinition, AppDefinitionStatus, ColorScheme, LayoutDefinition, LayoutPreset, MaterialTheme, SidenavMode, ThemeDefinition } from './app-definition';\nimport { flattenRouteTarget, nestRouteTarget, RouteDefinitionDto } from './route-definition.mapper';\n\ninterface AppDefinitionDto {\n id?: string;\n name?: string;\n translocoId?: string;\n description?: string;\n theme?: ThemeDefinition;\n layout?: LayoutDefinition;\n regions?: AppDefinition['regions'];\n routes?: RouteDefinitionDto[];\n modules?: AppDefinition['modules'];\n orgKey?: string;\n status?: AppDefinitionStatus;\n version?: number;\n publishedVersion?: number;\n createdAt?: string;\n updatedAt?: string;\n}\n\n/** What `PUT /app-definitions/{appId}` receives: the DTO with `theme` and `layout` always rebuilt. */\ntype AppDefinitionPayload = AppDefinitionDto & { theme: ThemeDefinition; layout: LayoutDefinition };\n\n/**\n * Translates between the `AppDefinition` DTO of `base-app-api.yaml` and the flat entity the\n * generated form works with.\n *\n * Two invariants matter here. The form saves `{ ...entity, ...form.value }`, so every DTO field the\n * form does not show has to survive on the entity — `regions`, `routes` and `modules` are nested\n * rather than flattened for exactly that reason, and the `EMBEDDED_COMPONENTS` controls edit them in\n * place. And `PUT /app-definitions/{appId}` is a full replacement, so {@link toDto} rebuilds `theme`\n * and `layout` from the flattened controls *on top of* the objects they were lifted out of, which\n * keeps any field a later contract version adds before this mapper learns about it.\n *\n * A route's `target` is the third thing flattened, one level deeper: `regions` and `modules` rows\n * travel as the raw DTO they arrived as, but a route row cannot. That flattening lives in\n * `route-definition.mapper.ts` rather than here, because `ModuleDefinition.routes` carries the same\n * schema and a route authored in a module has to behave exactly like one authored in an app.\n */\n@Injectable({ providedIn: 'root' })\nexport class AppDefinitionMapper implements BaseEntityMapper<AppDefinition> {\n fromDto(dto: unknown): AppDefinition {\n const source = dto as AppDefinitionDto;\n const theme = source.theme;\n const layout = source.layout;\n return new AppDefinition({\n id: source.id,\n name: source.name,\n translocoId: source.translocoId,\n description: source.description,\n materialTheme: theme?.materialTheme as MaterialTheme | undefined,\n colorScheme: theme?.colorScheme as ColorScheme | undefined,\n tokenOverrides: theme?.tokenOverrides,\n logoUrl: theme?.logoUrl,\n faviconUrl: theme?.faviconUrl,\n preset: layout?.preset as LayoutPreset | undefined,\n sidenavMode: layout?.sidenavMode as SidenavMode | undefined,\n sidenavCollapsible: layout?.sidenavCollapsible,\n sidenavOpenByDefault: layout?.sidenavOpenByDefault,\n contentMaxWidth: layout?.contentMaxWidth,\n theme,\n layout,\n regions: source.regions,\n routes: source.routes?.map(flattenRouteTarget),\n modules: source.modules,\n orgKey: source.orgKey,\n status: source.status,\n version: source.version,\n publishedVersion: source.publishedVersion,\n createdAt: source.createdAt,\n updatedAt: source.updatedAt,\n });\n }\n\n toDto(entity: AppDefinition): AppDefinitionPayload {\n // Listed field by field rather than spread, so the flattened controls never reach the payload.\n return {\n id: entity.id,\n name: entity.name,\n translocoId: entity.translocoId,\n description: entity.description,\n theme: this.mergeTheme(entity),\n layout: this.mergeLayout(entity),\n regions: entity.regions,\n routes: entity.routes?.map(nestRouteTarget),\n modules: entity.modules,\n orgKey: entity.orgKey,\n status: entity.status,\n version: entity.version,\n publishedVersion: entity.publishedVersion,\n createdAt: entity.createdAt,\n updatedAt: entity.updatedAt,\n };\n }\n\n private mergeTheme(entity: AppDefinition): ThemeDefinition {\n return {\n ...entity.theme,\n materialTheme: entity.materialTheme,\n colorScheme: entity.colorScheme,\n tokenOverrides: entity.tokenOverrides,\n logoUrl: entity.logoUrl,\n faviconUrl: entity.faviconUrl,\n };\n }\n\n private mergeLayout(entity: AppDefinition): LayoutDefinition {\n return {\n ...entity.layout,\n preset: entity.preset,\n sidenavMode: entity.sidenavMode,\n sidenavCollapsible: entity.sidenavCollapsible,\n sidenavOpenByDefault: entity.sidenavOpenByDefault,\n contentMaxWidth: entity.contentMaxWidth,\n };\n }\n}\n","import { Injectable } from '@angular/core';\nimport { map, Observable } from 'rxjs';\nimport { BaseEntityRestService, PersistedEntity } from '@processpuzzle/base-entity';\nimport { AppDefinition } from './app-definition';\nimport { AppDefinitionMapper } from './app-definition.mapper';\n\n/**\n * REST access to `/organizations/{orgKey}/app-definitions`. As in base-rule, the organization is\n * part of the configured service root — `APP_SERVICE_ROOT`, the optional per-feature escape hatch,\n * falling back to `BACKEND_SERVICE_ROOT`, which is what every deployment actually sets — so the\n * tenant is a deployment concern rather than something every call has to carry.\n */\n@Injectable({ providedIn: 'root' })\nexport class AppDefinitionService extends BaseEntityRestService<AppDefinition> {\n constructor(protected override entityMapper: AppDefinitionMapper) {\n super(entityMapper, 'APP_SERVICE_ROOT', 'app-definitions');\n }\n\n /**\n * `POST /app-definitions/{appId}/publish` — promotes the stored `version` to `publishedVersion` and\n * sets the status to `PUBLISHED`. The backend validates the definition first and answers 400 when it\n * is not publishable, so the caller only has to deal with the happy path and the error.\n */\n publish(id: string): Observable<PersistedEntity<AppDefinition>> {\n const pathParams = new Map<string, string>([['id', String(id)]]);\n const fullUrl = this.buildFullUrl(this.resourceUrl + '/%{id}/publish', { pathParams });\n if (!fullUrl) throw new Error('Could not determine the full url');\n return this.httpClient.post(fullUrl, {}, { headers: this.headers }).pipe(map((response: unknown) => this.entityMapper.fromDto(response) as PersistedEntity<AppDefinition>));\n }\n}\n","import { inject } from '@angular/core';\nimport { patchState, signalStore, signalStoreFeature, type, withMethods } from '@ngrx/signals';\nimport { withDevtools } from '@angular-architects/ngrx-toolkit';\nimport { BaseEntityContainerStore, BaseEntityStore, BaseEntityTabsStore, PersistedEntity } from '@processpuzzle/base-entity';\nimport { httpErrorMessage } from '@processpuzzle/util';\nimport { firstValueFrom } from 'rxjs';\nimport { AppDefinition } from './app-definition';\nimport { AppDefinitionService } from './app-definition.service';\n\n/** The slice of `BaseEntityStore`'s state that {@link AppDefinitionPublishStore} reads and patches. */\ntype PublishableState = {\n entities: AppDefinition[];\n currentEntity: AppDefinition | undefined;\n isLoading: boolean;\n error: string | undefined;\n};\n\n/**\n * Adds the `publish` use case on top of the generic CRUD store. It keeps the same contract as\n * `addEntity` / `updateEntity`: flip `isLoading`, replace the entity in the list with the server's\n * answer so the form's read-only `status` / `publishedVersion` fields refresh, and surface failures\n * through `error` rather than by throwing.\n */\nexport function AppDefinitionPublishStore() {\n return signalStoreFeature(\n { state: type<PublishableState>() },\n withMethods((store, service = inject(AppDefinitionService)) => ({\n publish: async (id: string): Promise<PersistedEntity<AppDefinition> | undefined> => {\n patchState(store, { isLoading: true, error: undefined });\n try {\n const publishedEntity = await firstValueFrom(service.publish(id));\n const entities = [...store.entities()];\n const indexToUpdate = entities.findIndex((entity) => entity.id === id);\n if (indexToUpdate >= 0) entities[indexToUpdate] = publishedEntity;\n const currentEntity = store.currentEntity()?.id === id ? publishedEntity : store.currentEntity();\n patchState(store, { entities, currentEntity, isLoading: false });\n return publishedEntity;\n } catch (error) {\n patchState(store, { error: httpErrorMessage(error), isLoading: false });\n return undefined;\n }\n },\n })),\n );\n}\n\nexport const AppDefinitionStore = signalStore(\n { providedIn: 'root' },\n BaseEntityStore<AppDefinition>(AppDefinition, () => inject(AppDefinitionService)),\n BaseEntityTabsStore(),\n BaseEntityContainerStore(),\n AppDefinitionPublishStore(),\n withDevtools('AppDefinition'),\n);\n","import { Injectable } from '@angular/core';\nimport { BaseEntityMapper } from '@processpuzzle/base-entity';\nimport { ModuleDefinition } from './module-definition';\nimport { flattenRouteTarget, nestRouteTarget, RouteDefinitionDto } from './route-definition.mapper';\n\ninterface ModuleDefinitionDto {\n key?: string;\n name?: string;\n translocoId?: string;\n description?: string;\n translocoScope?: string;\n routes?: RouteDefinitionDto[];\n orgKey?: string;\n version?: number;\n createdAt?: string;\n updatedAt?: string;\n}\n\n/**\n * Translates between the `ModuleDefinition` DTO of `base-app-api.yaml` and the entity the generated form\n * works with. Two renamings, and nothing else — a module is a much smaller aggregate than an app:\n *\n * - **`key` becomes `id`.** base-entity keys every store, URL and reference on `id`, so the rename\n * happens here rather than in the framework. See {@link ModuleDefinition.id}.\n * - **each route's `target` is flattened** onto the row and re-nested on save, by the same functions\n * `AppDefinitionMapper` uses, so a route authored in a module behaves like one authored in an app.\n */\n@Injectable({ providedIn: 'root' })\nexport class ModuleDefinitionMapper implements BaseEntityMapper<ModuleDefinition> {\n fromDto(dto: unknown): ModuleDefinition {\n const source = dto as ModuleDefinitionDto;\n return new ModuleDefinition({\n id: source.key,\n name: source.name,\n translocoId: source.translocoId,\n description: source.description,\n translocoScope: source.translocoScope,\n routes: source.routes?.map(flattenRouteTarget),\n orgKey: source.orgKey,\n version: source.version,\n createdAt: source.createdAt,\n updatedAt: source.updatedAt,\n });\n }\n\n toDto(entity: ModuleDefinition): ModuleDefinitionDto {\n // Field by field rather than spread, so `id` does not travel beside the `key` it became.\n return {\n key: entity.id,\n name: entity.name,\n translocoId: entity.translocoId,\n description: entity.description,\n translocoScope: entity.translocoScope,\n routes: entity.routes?.map(nestRouteTarget),\n orgKey: entity.orgKey,\n version: entity.version,\n createdAt: entity.createdAt,\n updatedAt: entity.updatedAt,\n };\n }\n}\n","import { Injectable } from '@angular/core';\nimport { BaseEntityRestService } from '@processpuzzle/base-entity';\nimport { ModuleDefinition } from './module-definition';\nimport { ModuleDefinitionMapper } from './module-definition.mapper';\n\n/**\n * REST access to `/organizations/{orgKey}/modules`. As for `AppDefinitionService`, the organization is\n * part of the configured service root (`APP_SERVICE_ROOT`, falling back to `BACKEND_SERVICE_ROOT`), so\n * the tenant is a deployment concern rather\n * than something every call has to carry.\n *\n * The URL variable is the module key — `ModuleDefinitionMapper` maps it onto `id`, which is what the\n * inherited `findById` builds `GET .../modules/{moduleKey}` from. That single-module read is also the call\n * the shell makes when something first navigates under a mount; see `ModuleLoader` in\n * `app-route-builder.ts`.\n */\n@Injectable({ providedIn: 'root' })\nexport class ModuleDefinitionService extends BaseEntityRestService<ModuleDefinition> {\n constructor(protected override entityMapper: ModuleDefinitionMapper) {\n super(entityMapper, 'APP_SERVICE_ROOT', 'modules');\n }\n}\n","import { inject } from '@angular/core';\nimport { signalStore } from '@ngrx/signals';\nimport { withDevtools } from '@angular-architects/ngrx-toolkit';\nimport { BaseEntityContainerStore, BaseEntityStore, BaseEntityTabsStore } from '@processpuzzle/base-entity';\nimport { ModuleDefinition } from './module-definition';\nimport { ModuleDefinitionService } from './module-definition.service';\n\n/**\n * Plain generic CRUD — a module has no `publish` of its own. Publishing is an `AppDefinition` operation:\n * an app is what a user navigates to, and its status is what decides whether a mount is live. Giving a\n * module a second, independent lifecycle would make \"which version of what is live\" a question with two\n * answers.\n */\nexport const ModuleDefinitionStore = signalStore(\n { providedIn: 'root' },\n BaseEntityStore<ModuleDefinition>(ModuleDefinition, () => inject(ModuleDefinitionService)),\n BaseEntityTabsStore(),\n BaseEntityContainerStore(),\n withDevtools('ModuleDefinition'),\n);\n","import { inject, Injectable, Type } from '@angular/core';\nimport { BaseEntityDescriptor, BaseEntityFacade } from '@processpuzzle/base-entity';\nimport { AppDefinition } from '../domain/app-definition';\nimport { AppDefinitionMapper } from '../domain/app-definition.mapper';\nimport { AppDefinitionService } from '../domain/app-definition.service';\nimport { AppDefinitionStore } from '../domain/app-definition.store';\nimport { createAppDefinitionDescriptor } from '../domain/app-definition.descriptors';\n\n@Injectable()\nexport class AppDefinitionFacade extends BaseEntityFacade<AppDefinition> {\n readonly entityType = AppDefinition;\n\n private readonly mapperRef = inject(AppDefinitionMapper);\n private readonly serviceRef = inject(AppDefinitionService);\n\n protected override createMapper() {\n return this.mapperRef;\n }\n\n protected override createService() {\n return this.serviceRef;\n }\n\n protected override createStoreClass(): Type<unknown> {\n return AppDefinitionStore;\n }\n\n protected override createDescriptor(): BaseEntityDescriptor {\n return createAppDefinitionDescriptor();\n }\n}\n","import { inject, Injectable, Type } from '@angular/core';\nimport { BaseEntityDescriptor, BaseEntityFacade } from '@processpuzzle/base-entity';\nimport { ModuleDefinition } from '../domain/module-definition';\nimport { createModuleDefinitionDescriptor } from '../domain/module-definition.descriptors';\nimport { ModuleDefinitionMapper } from '../domain/module-definition.mapper';\nimport { ModuleDefinitionService } from '../domain/module-definition.service';\nimport { ModuleDefinitionStore } from '../domain/module-definition.store';\n\n@Injectable()\nexport class ModuleDefinitionFacade extends BaseEntityFacade<ModuleDefinition> {\n readonly entityType = ModuleDefinition;\n\n private readonly mapperRef = inject(ModuleDefinitionMapper);\n private readonly serviceRef = inject(ModuleDefinitionService);\n\n protected override createMapper() {\n return this.mapperRef;\n }\n\n protected override createService() {\n return this.serviceRef;\n }\n\n protected override createStoreClass(): Type<unknown> {\n return ModuleDefinitionStore;\n }\n\n protected override createDescriptor(): BaseEntityDescriptor {\n return createModuleDefinitionDescriptor();\n }\n}\n","import { Injectable } from '@angular/core';\nimport { BaseEntityDescriptor, EmbeddedEntityFacade } from '@processpuzzle/base-entity';\nimport { ModuleMount } from '../domain/app-definition';\nimport { createModuleMountDescriptor } from '../domain/module-mount.descriptors';\n\n/**\n * A mount is a row of the `App Definition` document, so it is edited through that document — unlike the\n * `ModuleDefinition` it names, which is an aggregate of its own with its own endpoints.\n */\n@Injectable()\nexport class AppModuleMountFacade extends EmbeddedEntityFacade<ModuleMount> {\n readonly entityType = ModuleMount;\n\n protected override createDescriptor(): BaseEntityDescriptor {\n return createModuleMountDescriptor();\n }\n}\n","import { Injectable } from '@angular/core';\nimport { BaseEntityDescriptor, EmbeddedEntityFacade } from '@processpuzzle/base-entity';\nimport { NavItem } from '../domain/app-definition';\nimport { createNavItemDescriptor } from '../domain/nav-item.descriptors';\n\n/**\n * One facade covers every level of the nav tree, however deep: the store is a root singleton and the row\n * it stands for comes from the route, so `app-nav-item/a/details/app-nav-item/b/details` resolves through\n * the same facade as the top level.\n */\n@Injectable()\nexport class AppNavItemFacade extends EmbeddedEntityFacade<NavItem> {\n readonly entityType = NavItem;\n\n protected override createDescriptor(): BaseEntityDescriptor {\n return createNavItemDescriptor();\n }\n}\n","import { Route, Routes } from '@angular/router';\nimport { provideTranslocoScope } from '@jsverse/transloco';\nimport { ModuleMount, RouteDefinition } from '../domain/app-definition';\nimport { ModuleDefinition, moduleTranslocoScope } from '../domain/module-definition';\nimport { BASE_APP_TRANSLOCO_SCOPE, BASE_ENTITY_TRANSLOCO_SCOPE } from '../base-app.i18n';\n\n/**\n * What the run-time shell registers routes from. `routes` and `modules` are the app definition's own\n * fields; the other two are how the routes of a mounted module get in.\n *\n * `moduleRoutes` holds the modules the shell already has, keyed by module key. `loadModule` is for the\n * ones it does not: a mount whose key is absent from `moduleRoutes` becomes a `loadChildren` that calls\n * it on first navigation into the mount. With neither, such a mount contributes nothing — a mount naming\n * a module that has not been authored is a warning rather than an error.\n *\n * A key present in `moduleRoutes` is never loaded again, so an empty array there says \"this module has no\n * routes\" and is honoured as such.\n */\nexport interface AppRouteSource {\n routes?: RouteDefinition[];\n modules?: ModuleMount[];\n moduleRoutes?: Record<string, RouteDefinition[] | undefined>;\n loadModule?: ModuleLoader;\n}\n\n/**\n * Fetches one module by key, or resolves to `undefined` if the organization has no such module. Rejecting\n * is a navigation error; resolving to `undefined` is the loose coupling the contract asks for.\n */\nexport type ModuleLoader = (moduleKey: string) => Promise<ModuleDefinition | undefined>;\n\n/**\n * Turns one authored route into the `Route` that renders it — component or `loadComponent`, `title`,\n * `data`, and any `canMatch` guard the definition's `roles` call for. `path` is {@link buildAppRoutes}'\n * to set; `children` it may contribute, and the authored ones are appended to them.\n *\n * May be asynchronous. An `ENTITY` route's screens are built from a `BaseEntityDescriptor` that has to be\n * *fetched* when the entity exists only as metadata, and the routes below it depend on what that\n * descriptor turns out to contain — which embedded children it carries. Making the renderer async is what\n * lets a route be emitted complete or not at all; the alternative, a guard that fills `children` in on the\n * way past, has no way to signal failure other than leaving the route matching nothing.\n */\nexport type RouteRenderer = (definition: RouteDefinition) => Route | Promise<Route>;\n\ninterface TrieNode {\n segment: string;\n definition?: RouteDefinition;\n children: TrieNode[];\n}\n\n/**\n * Derives Angular's nested `Routes` from the flat route list of an `AppDefinition`.\n *\n * Nesting is computed here rather than authored, which is the whole point of keeping\n * {@link RouteDefinition} flat: `claims`, `claims/open` and `claims/:id` are three sibling rows a\n * designer can reorder, rename and reason about one at a time, and it is only at registration that\n * they become a parent with two children. Two rules produce that shape:\n *\n * - **An authored route that is a prefix of others becomes their parent.** So `claims` stays mounted\n * while `claims/open` renders in its `<router-outlet>` — which is the one thing a flat registration\n * could not express, and the reason this function exists at all. A component rendering a route that\n * has children therefore has to host an outlet.\n * - **A prefix nothing authored stays part of the path.** With only `claims/open` and `claims/closed`\n * declared, no synthetic `claims` parent is invented: the two are emitted with their full paths, since\n * a component-less grouping node would change nothing about what matches or what renders.\n *\n * Modules mount as a parent of their own at {@link ModuleMount.basePath}, component-less because a mount\n * is a prefix rather than a screen. That is the single composition point, and it composes one level: the\n * routes of a mounted module are built by the same two rules, and a module mounts no modules. A module the\n * shell already has is emitted now; one it has not is emitted as `loadChildren` — see {@link lazyMount}.\n *\n * Siblings are ordered static-prefix-first, so `claims/new` is matched before `claims/:id` rather than\n * swallowed by it. Beyond that the authored order is kept, and a duplicate path — which the backend\n * rejects as an error, so it should never arrive — keeps its first occurrence.\n */\nexport async function buildAppRoutes(source: AppRouteSource, renderRoute: RouteRenderer): Promise<Routes> {\n const appRoutes = await emitLevel(trieOf(source.routes), [], renderRoute);\n return [...appRoutes, ...(await moduleRoutesOf(source, renderRoute))];\n}\n\nasync function moduleRoutesOf(source: AppRouteSource, renderRoute: RouteRenderer): Promise<Routes> {\n const mounted: Routes = [];\n for (const mount of source.modules ?? []) {\n if (!mount.basePath) continue;\n const routes = source.moduleRoutes?.[mount.moduleKey];\n if (routes) {\n if (routes.length) mounted.push({ path: mount.basePath, children: await emitLevel(trieOf(routes), [], renderRoute) });\n } else if (source.loadModule) {\n mounted.push(lazyMount(mount.moduleKey, mount.basePath, source.loadModule, renderRoute));\n }\n }\n return mounted;\n}\n\n/**\n * A mount whose module the shell has not got yet: the same component-less parent at the base path, with\n * its children resolved on first navigation into it instead of now.\n *\n * What is deferred is the *metadata* — one `GET /modules/{key}` per module the user actually visits, so an\n * app that mounts twenty modules does not fetch twenty definitions to show its first screen. It is not a\n * deferred *bundle*: the widgets a module's routes render come from the widget registry and are part of\n * the application's own build either way.\n *\n * The module's transloco scope is registered here, on a component-less wrapper inside the loaded children,\n * because that is the first moment its name is known — the default is the module key, but a module may\n * name its own. The alias is spelled out, as everywhere in this workspace: transloco would otherwise\n * camel-case it and miss every key below it.\n *\n * The framework scopes are re-registered alongside it, for the reason `BASE_APP_ROUTES.authoringScopes()`\n * gives: a route that declares TRANSLOCO_SCOPE *replaces* the collection it inherits rather than adding to\n * it, because Angular does not merge `multi` providers across injectors. A module's routes render the same\n * generic screens as everything else — an ENTITY route reaches `BaseEntityTabsComponent`, which translates\n * `base_entity.tabs.*` — so naming only the module's scope here would leave every framework label below the\n * mount unresolved.\n */\nfunction lazyMount(moduleKey: string, basePath: string, loadModule: ModuleLoader, renderRoute: RouteRenderer): Route {\n return {\n path: basePath,\n loadChildren: async () => {\n const definition = await loadModule(moduleKey);\n const children = await emitLevel(trieOf(definition?.routes), [], renderRoute);\n if (!definition || !children.length) return [];\n const scope = moduleTranslocoScope(definition);\n const providers = [\n provideTranslocoScope(\n { scope, alias: scope },\n { scope: BASE_ENTITY_TRANSLOCO_SCOPE, alias: BASE_ENTITY_TRANSLOCO_SCOPE },\n { scope: BASE_APP_TRANSLOCO_SCOPE, alias: BASE_APP_TRANSLOCO_SCOPE },\n ),\n ];\n return [{ path: '', providers, children }];\n },\n };\n}\n\n/** The authored paths as a trie, so a route that is a prefix of another can be recognized as its parent. */\nfunction trieOf(routes: RouteDefinition[] | undefined): TrieNode[] {\n const roots: TrieNode[] = [];\n for (const definition of routes ?? []) {\n const segments = segmentsOf(definition.path);\n if (!segments.length) continue;\n let level = roots;\n let node: TrieNode = { segment: '', children: roots };\n for (const segment of segments) {\n const existing = level.find((candidate) => candidate.segment === segment);\n node = existing ?? { segment, children: [] };\n if (!existing) level.push(node);\n level = node.children;\n }\n // First occurrence wins: a duplicate path is a validation error server-side, so the only way to see\n // one here is a definition that bypassed validation, and dropping the later row is the harmless read.\n node.definition ??= definition;\n }\n return roots;\n}\n\n/**\n * The routes of one level. An authored node becomes a `Route` whose children are emitted below it; an\n * unauthored one contributes its segment to the paths of its descendants instead of a route of its own.\n */\nasync function emitLevel(nodes: TrieNode[], prefix: string[], renderRoute: RouteRenderer): Promise<Routes> {\n const routes = (await Promise.all(nodes.map((node) => emitNode(node, prefix, renderRoute)))).flat();\n return routes.sort((left, right) => staticDepthOf(right.path) - staticDepthOf(left.path));\n}\n\nasync function emitNode(node: TrieNode, prefix: string[], renderRoute: RouteRenderer): Promise<Routes> {\n const path = [...prefix, node.segment];\n if (!node.definition) return (await Promise.all(node.children.map((child) => emitNode(child, path, renderRoute)))).flat();\n\n const authoredChildren = await emitLevel(node.children, [], renderRoute);\n const rendered = await renderRoute(node.definition);\n const route: Route = { ...rendered, path: path.join('/') };\n // The renderer's own children come first and the authored ones after, rather than the authored ones\n // replacing them. An `ENTITY` route contributes the List and Details routes of its entity *and* may be\n // the path prefix of other authored routes; overwriting would silently drop whichever of the two the\n // builder happened not to know about. The renderer's include an empty-path redirect, which `pathMatch:\n // 'full'` confines to the prefix's own URL, so it cannot shadow an authored sibling.\n const children = [...(rendered.children ?? []), ...authoredChildren];\n if (children.length) route.children = children;\n return [route];\n}\n\nfunction segmentsOf(path: string | undefined): string[] {\n return (path ?? '').split('/').filter((segment) => segment.length > 0);\n}\n\n/**\n * How many leading segments of a path are static. Sorting by it descending is what keeps a parameterized\n * route from shadowing its static siblings: `claims/new` scores 2, `claims/:id` scores 1, and Angular\n * matches in the order given.\n */\nfunction staticDepthOf(path: string | undefined): number {\n const segments = segmentsOf(path);\n const firstParameter = segments.findIndex((segment) => segment.startsWith(':') || segment === '**');\n return firstParameter === -1 ? segments.length : firstParameter;\n}\n","import { Component, computed, input } from '@angular/core';\nimport { WidgetHostComponent, WidgetInstance, WidgetPlacement } from '@processpuzzle/widgets';\n\n/** The widgets rendered in sequence — every one but those a container widget places by id. */\nexport function standaloneWidgets(widgets: WidgetInstance[] | undefined): WidgetInstance[] {\n return (widgets ?? []).filter((widget) => widget.placement !== WidgetPlacement.REFERENCED);\n}\n\n/**\n * Renders the top-level widgets shared by routed content and static shell regions, each through\n * base-widget's {@link WidgetHostComponent} — which resolves the component, binds the props and shows a\n * placeholder for a type the application did not register. This component only decides *which* widgets\n * render here, and in what order.\n *\n * base-app passes no binding resolver: a page or region declares no ports for `inputBindings` to resolve\n * against, so a placement here is configured by its props alone.\n */\n@Component({\n selector: 'pp-widget-list',\n standalone: true,\n imports: [WidgetHostComponent],\n template: `\n @for (widget of rows(); track widget.id) {\n <pp-widget-host [widget]=\"widget\" />\n }\n `,\n})\nexport class WidgetListComponent {\n readonly widgets = input<WidgetInstance[]>([]);\n\n protected readonly rows = computed(() => standaloneWidgets(this.widgets()));\n}\n","import { Component, inject } from '@angular/core';\nimport { ActivatedRoute } from '@angular/router';\nimport { WidgetInstance } from '@processpuzzle/widgets';\nimport { WidgetListComponent } from './widget-list.component';\n\n/**\n * Renders a route whose kind is WIDGETS: every STANDALONE instance in order, each through base-widget's\n * WidgetHostComponent. REFERENCED instances are skipped here for the same reason\n * DocumentEditorComponent skips them at its top level — they're placed by whichever STANDALONE\n * container widget names them in props.childIds, not by this component.\n *\n * Delegates the common widget rendering rule to WidgetListComponent, which is also used by the\n * header and footer regions in the application preview.\n */\n@Component({\n selector: 'pp-route-widgets',\n standalone: true,\n imports: [WidgetListComponent],\n template: `<pp-widget-list [widgets]=\"widgets\" />`,\n})\nexport class RouteWidgetsComponent {\n private readonly route = inject(ActivatedRoute);\n\n protected readonly widgets = (this.route.snapshot.data['widgets'] as WidgetInstance[] | undefined) ?? [];\n}\n","import { Component, computed, inject } from '@angular/core';\nimport { ActivatedRoute } from '@angular/router';\n\n/**\n * Fallback rendered by {@link AppRouteRenderer} for a route kind it doesn't yet know how to build a\n * real component for (today: DOCUMENT, and any kind value the frontend doesn't recognize). Exists so\n * an unfinished part of the shell fails visibly and specifically at the one route that hits it,\n * rather than throwing during route registration and taking the whole app down, or — worse — silently\n * rendering nothing and leaving a designer to wonder why their route is blank.\n *\n * Not an error state: an app definition is allowed to reference a route kind the frontend hasn't\n * caught up to yet, same spirit as a NavItem naming a route that hasn't been authored being a warning\n * rather than a validation failure elsewhere in this library.\n */\n@Component({\n selector: 'pp-route-unsupported',\n standalone: true,\n template: `<p class=\"pp-route-unsupported\">{{ reason() }}</p>`,\n})\nexport class RouteUnsupportedComponent {\n private readonly route = inject(ActivatedRoute);\n\n protected readonly reason = computed(() => (this.route.snapshot.data['reason'] as string) ?? 'This route is not yet supported.');\n}\n","import { inject, Injectable } from '@angular/core';\nimport { ResolveFn, Route } from '@angular/router';\nimport { TranslocoService } from '@jsverse/transloco';\nimport { entityScreenRoute, EntityScreenResolver, translateLabel } from '@processpuzzle/base-entity';\nimport { RouteDefinition } from '../domain/app-definition';\nimport { RouteWidgetsComponent } from './route-widgets.component';\nimport { RouteUnsupportedComponent } from './route-unsupported.component';\n\n/**\n * The route's `title`, preferring `translocoId` over the authored literal where the key resolves.\n *\n * A `ResolveFn` rather than a plain string because a title is resolved per navigation, which is late\n * enough for a lazily-loaded module scope to have arrived — the string form is captured when the route is\n * built, before the scope that owns the key is registered. `translateLabel` falls back to the literal, so\n * a route whose scope is absent or whose key is missing keeps the authored title.\n */\nfunction titleOf(definition: RouteDefinition): ResolveFn<string> {\n return () => translateLabel(inject(TranslocoService), definition.translocoId, definition.title);\n}\n\n/**\n * The `RouteRenderer` {@link buildAppRoutes} needs — turns one authored `RouteDefinition` into the\n * `Route` that actually renders it. Owns `component`, `data` and any `children` the kind calls for; `path`\n * is `buildAppRoutes`' to set, and the routes authored *below* this one are appended to whatever children\n * this contributes.\n *\n * A separate injectable rather than a free function because it is the one piece Preview and the eventual\n * production shell must call identically — same reasoning as `buildAppRoutes` itself being free of any\n * component.\n *\n * `roles` -> `canMatch` is deliberately not set here yet — see the note on this design's own deferral of\n * that question. `kind: DOCUMENT` is deliberately unhandled too: `BaseDocumentContainerComponent` is an\n * authoring component wired to one document via an injected store, not something parameterizable by a\n * route's `documentSlug` at runtime. Rendering a document read-only inside a live app is its own small\n * design question and this falls through to {@link RouteUnsupportedComponent} rather than guessing.\n */\n@Injectable({ providedIn: 'root' })\nexport class AppRouteRenderer {\n private readonly entityScreens = inject(EntityScreenResolver);\n\n render = async (definition: RouteDefinition): Promise<Route> => {\n switch (definition.kind) {\n case 'WIDGETS':\n return { component: RouteWidgetsComponent, title: titleOf(definition), data: { widgets: definition.widgets } };\n case 'ENTITY':\n return this.entityRoute(definition);\n case 'DOCUMENT':\n return {\n component: RouteUnsupportedComponent,\n title: titleOf(definition),\n data: { reason: `DOCUMENT routes are not yet supported (route '${definition.path}')` },\n };\n default:\n return {\n component: RouteUnsupportedComponent,\n title: titleOf(definition),\n data: { reason: `Unknown route kind '${String(definition.kind)}' (route '${definition.path}')` },\n };\n }\n };\n\n /**\n * An `ENTITY` route: base-entity's generated screens, mounted at the authored path.\n *\n * Both halves belong to base-entity and are called rather than reimplemented here: `EntityScreenResolver`\n * answers for an entity with a compile-time facade and for one that exists only as a `BaseEntityDefinition`\n * alike, and `entityScreenRoute` owns the URL shape those screens need. What is left is exactly the\n * *application definition* concern — when the routes are built, the authored title, and the authored\n * `entityMode` / `rsqlFilter`.\n *\n * The descriptor is resolved **before** the route exists, which is what makes the route either complete or\n * a leaf. An entity nothing answers to keeps the leaf, whose component says so at the URL the nav item\n * links to; a legitimate state, since an `AppDefinition` may name an entity that has been renamed or one\n * whose definitions this deployment's backend does not serve.\n *\n * `entityMode` is passed along but not applied. A `DETAILS` route lands on the list, from which the row is\n * one click away: making it open a form directly means carrying the authored route's own `:id` into the\n * child URL, and the `RedirectFunction` that would do it receives a *partial* route snapshot whose\n * parameter inheritance at recognition time is not something to bet a navigation on. Deferred with `roles`\n * and `rsqlFilter` rather than guessed at.\n */\n private async entityRoute(definition: RouteDefinition): Promise<Route> {\n const screens = await this.entityScreens.resolve(definition.entityName);\n const route = entityScreenRoute({\n entityName: definition.entityName,\n screens,\n hostPath: definition.path,\n data: { entityMode: definition.entityMode, rsqlFilter: definition.rsqlFilter },\n });\n\n return { ...route, title: titleOf(definition) };\n }\n}\n","import { Injectable } from '@angular/core';\nimport { BaseEntityDescriptor, EmbeddedEntityFacade } from '@processpuzzle/base-entity';\nimport { RegionDefinition } from '../domain/app-definition';\nimport { createRegionDefinitionDescriptor } from '../domain/region-definition.descriptors';\n\n/**\n * A region has a facade like any other entity — that is what gives it a store, and so a working list and\n * form. Its repository reads and writes the `App Definition` document instead of an endpoint of its own,\n * because the contract nests `regions` inside that document.\n */\n@Injectable()\nexport class AppRegionFacade extends EmbeddedEntityFacade<RegionDefinition> {\n readonly entityType = RegionDefinition;\n\n protected override createDescriptor(): BaseEntityDescriptor {\n return createRegionDefinitionDescriptor();\n }\n}\n","import { Injectable } from '@angular/core';\nimport { BaseEntityDescriptor, EmbeddedEntityFacade } from '@processpuzzle/base-entity';\nimport { RouteDefinition } from '../domain/app-definition';\nimport { createRouteDefinitionDescriptor } from '../domain/route-definition.descriptors';\n\n/**\n * `GET .../app-definitions/{appId}/layout` is a read-only projection for the run-time shell, not a write\n * endpoint — a route is authored inside the `App Definition` document, so its store goes through that\n * document like every other embedded child of the graph.\n */\n@Injectable()\nexport class AppRouteFacade extends EmbeddedEntityFacade<RouteDefinition> {\n readonly entityType = RouteDefinition;\n\n protected override createDescriptor(): BaseEntityDescriptor {\n return createRouteDefinitionDescriptor();\n }\n}\n","import { Injectable } from '@angular/core';\nimport { BaseEntityDescriptor, EmbeddedEntityFacade } from '@processpuzzle/base-entity';\nimport { WidgetInstance } from '../domain/app-definition';\nimport { createWidgetInstanceDescriptor } from '../domain/widget-instance.descriptors';\n\n/**\n * A widget sits under a region, a page or another widget, and one facade serves all three: which owner's\n * rows its store reads is decided by the route that is open, not by the facade.\n */\n@Injectable()\nexport class AppWidgetFacade extends EmbeddedEntityFacade<WidgetInstance> {\n readonly entityType = WidgetInstance;\n\n protected override createDescriptor(): BaseEntityDescriptor {\n return createWidgetInstanceDescriptor();\n }\n}\n","import { ThemeSelection } from '@processpuzzle/widgets';\nimport { AppDefinition, LayoutPreset, SidenavMode } from '../../domain/app-definition';\n\n/**\n * The layout decisions {@link AppShellComponent} renders from, resolved out of an `AppDefinition`'s\n * `layout` fields with every default already applied — so the template reads values rather than\n * spelling out fallbacks, and every default is asserted in one spec instead of being implied by a\n * `??` in markup.\n *\n * A plain function rather than a service for the same reason `buildAppRoutes` is one: nothing here\n * needs injection, and a pure derivation is testable without a `TestBed`.\n */\nexport interface ResolvedLayout {\n preset: LayoutPreset;\n /**\n * Always resolved, even for `top-nav` where it is meaningless — {@link hasSidenav} is what says\n * whether a sidenav is rendered at all. Leaving it undefined there would only push a `?? 'side'`\n * into the template that no definition can ever reach, since `hasSidenav` already implies a mode.\n */\n sidenavMode: SidenavMode;\n /** `end` for `sidenav-right`, `start` otherwise — the values `matSidenav`'s `position` takes. */\n sidenavPosition: 'start' | 'end';\n /** Whether the shell renders a sidenav at all. False for `top-nav`. */\n hasSidenav: boolean;\n sidenavOpened: boolean;\n sidenavCollapsible: boolean;\n /** Undefined means unconstrained, which is what an absent `contentMaxWidth` asks for. */\n contentMaxWidth?: string;\n}\n\n/**\n * `sidenav-left` because a definition that declares no preset is the common case — a freshly created\n * app — and the framework's own screens are left-sidenav. The same value the contract documents as\n * its default.\n */\nconst DEFAULT_PRESET: LayoutPreset = 'sidenav-left';\n\n/** Matches the contract's default and Material's own, so an unset value behaves as `mat-sidenav` does. */\nconst DEFAULT_SIDENAV_MODE: SidenavMode = 'side';\n\n/**\n * Resolves the layout of one definition.\n *\n * Each field is read from the flattened property first and from `layout` second. For an entity that\n * came through {@link AppDefinitionMapper} the two always agree — `fromDto` copies `layout.preset`\n * onto `preset`, and `toDto` merges the flattened value back — so the fallback is there for the\n * definitions nothing mapped: `new AppDefinition({ layout: { preset: 'top-nav' } })` is a legal\n * construction that leaves `preset` undefined, and a shell that ignored `layout` would silently\n * render the default instead.\n *\n * `sidenavCollapsible` and `sidenavOpenByDefault` need no such fallback: they are non-optional on the\n * entity and the constructor defaults them, so there is always a value to read.\n */\nexport function layoutOf(definition: AppDefinition | undefined): ResolvedLayout {\n const preset = definition?.preset ?? definition?.layout?.preset ?? DEFAULT_PRESET;\n\n return {\n preset,\n sidenavMode: definition?.sidenavMode ?? definition?.layout?.sidenavMode ?? DEFAULT_SIDENAV_MODE,\n sidenavPosition: preset === 'sidenav-right' ? 'end' : 'start',\n hasSidenav: preset !== 'top-nav',\n sidenavOpened: definition?.sidenavOpenByDefault ?? true,\n sidenavCollapsible: definition?.sidenavCollapsible ?? true,\n contentMaxWidth: definition?.contentMaxWidth ?? definition?.layout?.contentMaxWidth,\n };\n}\n\n/**\n * The `--pp-*` overrides of one definition, as a style object to bind on the shell's host element.\n *\n * Custom properties cascade, so setting them on one element re-tints every framework surface below it\n * — which is what makes a themed preview possible at all without an iframe. `materialTheme` and\n * `colorScheme` are not handled here but by {@link themeDefaultsOf} and the shell's `ThemeService`, as\n * classes on the same element.\n *\n * Keys are passed through untouched, including their leading `--`: Angular's `[style]` binding treats\n * a custom property as a custom property, and the contract calls these overrides of the tokens in\n * `pp-colors.css`, so anything else would be this function inventing a naming rule.\n */\nexport function themeVarsOf(definition: AppDefinition | undefined): Record<string, string> {\n // The nested object first, so an override the form actually edited wins over the one the server sent.\n return { ...definition?.theme?.tokenOverrides, ...definition?.tokenOverrides };\n}\n\n/**\n * The route paths this definition accounts for: its own routes' paths, plus the base path of every module\n * it mounts.\n *\n * A module's *own* routes are deliberately absent. They live in the module's definition, which the router\n * fetches only when something navigates into the mount, so they cannot be known here — which is why the\n * consumer of this list treats a path *below* a known one as accounted for. See `toNavRows`.\n */\nexport function knownRoutePathsOf(definition: AppDefinition | undefined): string[] {\n const declared = (definition?.routes ?? []).map((route) => route.path);\n const mounted = (definition?.modules ?? []).map((mount) => mount.basePath);\n return [...declared, ...mounted].filter((path): path is string => !!path);\n}\n\n/**\n * The theme preset and colour scheme a definition declares, as the defaults of the shell's `ThemeService` —\n * which a user's choice in a `ThemesButton` overrides, and which fall back to the ProcessPuzzle look, light,\n * for whatever the definition leaves unset. Those fallbacks are the contract's defaults too, so the server\n * fills the same values in on save.\n */\nexport function themeDefaultsOf(definition: AppDefinition | undefined): Partial<ThemeSelection> {\n const preset = definition?.materialTheme ?? definition?.theme?.materialTheme;\n const scheme = definition?.colorScheme ?? definition?.theme?.colorScheme;\n return { ...(preset ? { preset } : {}), ...(scheme ? { scheme } : {}) };\n}\n","import { Component, input } from '@angular/core';\nimport { WidgetInstance } from '@processpuzzle/widgets';\nimport { WidgetListComponent } from '../widget-list.component';\n\n/**\n * The `footer` region: the widgets it declares, and nothing else. The contract gives a footer no field\n * beyond `widgets`, so this stays a thin styled host over {@link WidgetListComponent} — separate from\n * the header only because the two are different slots with different styling, not because they share\n * no logic.\n */\n@Component({\n selector: 'pp-region-footer',\n standalone: true,\n imports: [WidgetListComponent],\n template: `<pp-widget-list [widgets]=\"widgets()\" />`,\n styles: [\n `\n :host {\n align-items: center;\n background-color: var(--pp-surface-header);\n color: var(--pp-on-header);\n display: flex;\n gap: 16px;\n justify-content: space-between;\n padding: 8px 16px;\n }\n /* Beside one another, as in the header — see the note there on why the list stays unopinionated. */\n pp-widget-list {\n align-items: center;\n display: flex;\n gap: 8px;\n }\n `,\n ],\n})\nexport class RegionFooterComponent {\n readonly widgets = input<WidgetInstance[]>([]);\n}\n","import { Component, input } from '@angular/core';\nimport { WidgetInstance } from '@processpuzzle/widgets';\nimport { WidgetListComponent } from '../widget-list.component';\n\n/**\n * The `header` region: the widgets the region declares, laid out in one row.\n *\n * The brand is widgets too — `app-logo` and `app-title` — which read the application's name and logo from\n * the shell's `APPLICATION_CONTEXT`. So a designer orders, omits or restyles them like any other widget, and\n * the header has no second, built-in way of showing the same thing. `--pp-app-title-color` is set to the\n * on-header colour here, so the title stays legible on the header surface whatever the theme.\n *\n * Nav items are *not* handled here. Under the `top-nav` preset the shell places the `sidenav` region's\n * nav beside this component in the same row, so that a `top-nav` app with no header region is still\n * navigable — see {@link AppShellComponent}.\n */\n@Component({\n selector: 'pp-region-header',\n standalone: true,\n imports: [WidgetListComponent],\n template: `<pp-widget-list [widgets]=\"widgets()\" />`,\n styles: [\n `\n :host {\n --pp-app-title-color: var(--pp-on-header, inherit);\n background-color: var(--pp-surface-header);\n color: var(--pp-on-header);\n align-items: center;\n display: flex;\n flex: 1;\n padding: 8px 16px;\n }\n /*\n * A row, because a header's widgets sit beside one another. The list component itself stays\n * unopinionated — the same component fills a routed content area, where a landing page's widgets\n * belong *under* one another — so the axis is the region's to choose, and a chrome row is the one\n * place it is not the default.\n */\n pp-widget-list {\n align-items: center;\n display: flex;\n flex: 1;\n gap: 8px;\n min-width: 0;\n }\n `,\n ],\n})\nexport class RegionHeaderComponent {\n readonly widgets = input<WidgetInstance[]>([]);\n}\n","import { NgTemplateOutlet } from '@angular/common';\nimport { Component, computed, input } from '@angular/core';\nimport { MatListItem, MatListItemIcon, MatListItemTitle, MatNavList } from '@angular/material/list';\nimport { RouterLink, RouterLinkActive } from '@angular/router';\nimport { EntityLabelPipe } from '@processpuzzle/base-entity';\nimport { NavItem } from '../../domain/app-definition';\n\n/** Which way the list runs. The shell decides it from `layout.preset`, not the region definition. */\nexport type NavOrientation = 'vertical' | 'horizontal';\n\n/**\n * One rendered row. A view model rather than the `NavItem` itself, so that \"does this item navigate, and\n * does its target exist\" is decided once per definition in a pure function instead of by methods the\n * template would re-run on every change detection pass.\n */\nexport interface NavRow {\n id: string;\n label: string;\n /**\n * Transloco key for {@link label}, preferred over it when the key resolves. Carried onto the row rather\n * than translated here: `toNavRows` is a pure function and translation depends on the active language\n * and on which scopes have finished loading, both of which are the template's concern.\n */\n translocoId?: string;\n icon?: string;\n /** Present only when the item names a route that something accounts for — see {@link toNavRows}. */\n routePath?: string;\n /** The item names a route path, but nothing in the definition accounts for it. */\n unresolved: boolean;\n children: NavRow[];\n}\n\n/**\n * Maps the authored nav tree onto rows, resolving each `routePath` against the paths the definition\n * accounts for.\n *\n * A path counts as resolved if it equals a declared route's path *or* sits below one — below a declared\n * route, or below a mounted module's base path. The prefix rule is what keeps this from crying wolf: the\n * routes inside a module live in the module's own definition, which is fetched lazily and is not knowable\n * here, so `back-office/lines` has to be trusted on the strength of the `back-office` mount alone.\n *\n * A group node — no `routePath`, children instead — is not unresolved. It expands rather than navigates.\n */\nexport function toNavRows(items: NavItem[] | undefined, knownPaths: string[]): NavRow[] {\n return (items ?? []).map((item) => {\n const routePath = normalize(item.routePath);\n const resolved = routePath !== undefined && knownPaths.some((known) => routePath === known || routePath.startsWith(`${known}/`));\n return {\n id: item.id,\n label: item.label,\n translocoId: item.translocoId,\n icon: item.icon,\n ...(resolved ? { routePath } : {}),\n unresolved: routePath !== undefined && !resolved,\n children: toNavRows(item.children, knownPaths),\n };\n });\n}\n\n/**\n * A route path as it is compared and linked: no surrounding slashes, since `RouteDefinition.path` is\n * relative with no leading slash by contract and a nav item may still have been authored with one.\n * Whitespace-only counts as absent — an item mid-authoring is a group node, not a broken link.\n */\nfunction normalize(routePath: string | undefined): string | undefined {\n const trimmed = routePath\n ?.trim()\n .replace(/^\\/+|\\/+$/g, '')\n .trim();\n return trimmed ? trimmed : undefined;\n}\n\n/**\n * Renders the nav tree of the `sidenav` region — in the sidenav for the two sidenav presets, and\n * horizontally in the header row for `top-nav`. One component for both, because the tree and its\n * grouping rules are the same either way and only the axis differs.\n *\n * Links are relative, which is what makes the same component work in the designer's Preview tab and in a\n * standalone deployment: `routerLink=\"orders\"` resolves against whichever route hosts the shell, so it\n * becomes `…/app-definition/demo/preview/orders` under the designer and `/orders` under a runtime host,\n * with nothing here needing to know which.\n *\n * An item whose target nothing accounts for is rendered as an inert row with a title, not as a link that\n * would navigate into a 404. A dangling `routePath` is a *warning* server-side by design — it may name a\n * route of a module authored later — so the shell has to render it as something rather than reject it.\n *\n * `translocoId` is preferred over `label` where it resolves, through the impure `ppLabel` pipe — so a row\n * shows the authored literal until the scope that owns its key has loaded, then re-renders. A nav label is\n * *tenant* content living under a module's own scope, which for an authored module is served by the\n * backend rather than shipped as an asset; `ppLabel` falling back is the normal case, not a defect.\n */\n@Component({\n selector: 'pp-region-nav',\n standalone: true,\n imports: [MatNavList, MatListItem, MatListItemIcon, MatListItemTitle, NgTemplateOutlet, RouterLink, RouterLinkActive, EntityLabelPipe],\n template: `\n @if (compact()) {\n <nav class=\"pp-region-nav--compact\">\n <ng-container *ngTemplateOutlet=\"compactRowList; context: { $implicit: rows() }\"></ng-container>\n </nav>\n } @else {\n <mat-nav-list [class.pp-region-nav--horizontal]=\"orientation() === 'horizontal'\">\n <ng-container *ngTemplateOutlet=\"rowList; context: { $implicit: rows(), depth: 0 }\"></ng-container>\n </mat-nav-list>\n }\n\n <!--\n Recursive through ngTemplateOutlet: a NavItem nests in itself, so the depth is not knowable here.\n\n The icon and the title are spelled out in both branches rather than shared through one more template.\n A list item sorts its content with an ng-content selector on [matListItemIcon], and a projection\n selector is matched at compile time against the element's own children — so anything arriving through\n ngTemplateOutlet is one opaque node to it, and lands in the unprojected slot beside the title. That is\n what put the icon on a line of its own above every label.\n -->\n <ng-template #rowList let-rows let-depth=\"depth\">\n @for (row of rows; track row.id) {\n @if (row.routePath; as routePath) {\n <!-- An anchor, not a bare list item: RouterLink only writes href onto one, and without it the row\n is not a real link — no middle-click, no open-in-new-tab, no keyboard activation. -->\n <a\n mat-list-item\n class=\"pp-region-nav__item\"\n [routerLink]=\"routePath\"\n routerLinkActive=\"pp-region-nav__item--active\"\n [style.padding-inline-start.px]=\"depth * 12\"\n [attr.data-testid]=\"'nav-' + row.id\"\n >\n @if (row.icon) {\n <span matListItemIcon class=\"material-symbols-outlined\">{{ row.icon }}</span>\n }\n <div matListItemTitle>{{ row.translocoId | ppLabel: row.label }}</div>\n </a>\n } @else {\n <mat-list-item\n class=\"pp-region-nav__item\"\n [class.pp-region-nav__item--unresolved]=\"row.unresolved\"\n [title]=\"row.unresolved ? 'No route of this application matches this navigation entry yet.' : ''\"\n [style.padding-inline-start.px]=\"depth * 12\"\n [attr.data-testid]=\"'nav-' + row.id\"\n >\n @if (row.icon) {\n <span matListItemIcon class=\"material-symbols-outlined\">{{ row.icon }}</span>\n }\n <div matListItemTitle>{{ row.translocoId | ppLabel: row.label }}</div>\n </mat-list-item>\n }\n @if (row.children.length) {\n <ng-container *ngTemplateOutlet=\"rowList; context: { $implicit: row.children, depth: depth + 1 }\"></ng-container>\n }\n }\n </ng-template>\n <!--\n The compact rows of a tablet layout: the icon above a short label, so the drawer — which is sized to its\n content — narrows to a rail. Plain elements rather than list items, whose fixed height and leading-icon\n slot are exactly the row layout this replaces. Nesting is shown by order alone; a rail has no room for\n indentation.\n -->\n <ng-template #compactRowList let-rows>\n @for (row of rows; track row.id) {\n @if (row.routePath; as routePath) {\n <a class=\"pp-region-nav__compact-item\" [routerLink]=\"routePath\" routerLinkActive=\"pp-region-nav__item--active\" [attr.data-testid]=\"'nav-' + row.id\">\n @if (row.icon) {\n <span class=\"material-symbols-outlined pp-region-nav__compact-icon\">{{ row.icon }}</span>\n }\n <span class=\"pp-region-nav__compact-label\">{{ row.translocoId | ppLabel: row.label }}</span>\n </a>\n } @else {\n <span\n class=\"pp-region-nav__compact-item\"\n [class.pp-region-nav__item--unresolved]=\"row.unresolved\"\n [title]=\"row.unresolved ? 'No route of this application matches this navigation entry yet.' : ''\"\n [attr.data-testid]=\"'nav-' + row.id\"\n >\n @if (row.icon) {\n <span class=\"material-symbols-outlined pp-region-nav__compact-icon\">{{ row.icon }}</span>\n }\n <span class=\"pp-region-nav__compact-label\">{{ row.translocoId | ppLabel: row.label }}</span>\n </span>\n }\n @if (row.children.length) {\n <ng-container *ngTemplateOutlet=\"compactRowList; context: { $implicit: row.children }\"></ng-container>\n }\n }\n </ng-template>\n `,\n styles: [\n `\n :host {\n display: block;\n }\n .pp-region-nav--horizontal {\n display: flex;\n padding-top: 0;\n }\n .pp-region-nav--horizontal .pp-region-nav__item {\n width: auto;\n }\n .pp-region-nav--compact {\n display: flex;\n flex-direction: column;\n gap: 4px;\n padding: 8px 4px;\n }\n .pp-region-nav__compact-item {\n align-items: center;\n border-radius: 8px;\n color: inherit;\n display: flex;\n flex-direction: column;\n gap: 2px;\n padding: 6px 4px;\n text-decoration: none;\n }\n a.pp-region-nav__compact-item:hover,\n .pp-region-nav__compact-item.pp-region-nav__item--active {\n background-color: color-mix(in srgb, currentColor 12%, transparent);\n }\n .pp-region-nav__compact-label {\n font: var(--mat-sys-label-small);\n max-width: 80px;\n overflow: hidden;\n text-align: center;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n .pp-region-nav__item--unresolved {\n font-style: italic;\n opacity: 0.6;\n }\n `,\n ],\n})\nexport class RegionNavComponent {\n readonly navItems = input<NavItem[]>([]);\n readonly orientation = input<NavOrientation>('vertical');\n /**\n * Icon-over-label rows for a narrow layout. Set by the shell on a tablet layout, where a content-sized\n * drawer with full rows would take too much of the screen; meaningless for the horizontal nav.\n */\n readonly compact = input(false);\n /** Route paths the definition accounts for, supplied by `AppRegionRenderer`. See {@link toNavRows}. */\n readonly knownPaths = input<string[]>([]);\n\n protected readonly rows = computed(() => toNavRows(this.navItems(), this.knownPaths()));\n}\n","import { Injectable, Type } from '@angular/core';\nimport { AppDefinition, RegionDefinition, RegionType } from '../../domain/app-definition';\nimport { knownRoutePathsOf } from './app-shell.model';\nimport { RegionFooterComponent } from './region-footer.component';\nimport { RegionHeaderComponent } from './region-header.component';\nimport { RegionNavComponent } from './region-nav.component';\n\n/**\n * One region resolved to something renderable: which slot it fills, the component that fills it and\n * the inputs to bind. **Data, not a view** — deliberately the same shape of answer\n * {@link AppRouteRenderer} gives for a route, and for the same reasons: it is assertable from a spec\n * without a `TestBed`, and the shell can bind it declaratively so that editing the definition in the\n * neighbouring form re-renders through ordinary signal propagation.\n *\n * `slot` is where the region *asks* to go. The shell may place it elsewhere — the `top-nav` preset puts\n * the `sidenav` slot's view in the header row — and may override {@link inputs} when it does, which is\n * the second reason this carries inputs rather than a constructed component.\n */\nexport interface RegionView {\n slot: RegionType;\n component: Type<unknown>;\n inputs: Record<string, unknown>;\n}\n\n/**\n * Turns one authored `RegionDefinition` into the {@link RegionView} that renders it.\n *\n * An injectable rather than a free function, though stateless today, for the reason `AppRouteRenderer`\n * is one: the Preview tab and the eventual standalone runtime host must resolve regions *identically*,\n * so there has to be exactly one of these, and a constructor parameter is a cheaper way to grow it than\n * a rewrite.\n */\n@Injectable({ providedIn: 'root' })\nexport class AppRegionRenderer {\n render = (region: RegionDefinition, definition: AppDefinition | undefined): RegionView | undefined => {\n switch (region.type) {\n case 'header':\n // Widgets alone: the brand is an `app-logo` and an `app-title` widget like any other, reading the\n // definition's name and logo through the shell's APPLICATION_CONTEXT.\n return { slot: 'header', component: RegionHeaderComponent, inputs: { widgets: region.widgets ?? [] } };\n case 'footer':\n return { slot: 'footer', component: RegionFooterComponent, inputs: { widgets: region.widgets ?? [] } };\n case 'sidenav':\n // `orientation` is left at the component's own default; the shell overrides it for `top-nav`,\n // because the axis follows the layout preset rather than anything authored on the region.\n // `knownPaths` comes from the definition rather than the region: whether a nav entry resolves is a\n // question about the *application's* routes, which only this function can see from here.\n return { slot: 'sidenav', component: RegionNavComponent, inputs: { navItems: region.navItems ?? [], knownPaths: knownRoutePathsOf(definition) } };\n default:\n // A region whose `type` the designer has not chosen yet. `RegionDefinition.type` is\n // `RegionType | undefined` precisely because a row exists before its dropdown is touched, and\n // the preview renders it *while* that is happening — so this is the normal path, not an error\n // one. Omitting it is quieter than a placeholder, and the form already shows the empty row.\n return undefined;\n }\n };\n}\n","import { computed, Injectable, signal } from '@angular/core';\nimport { ApplicationContext, NavMenuItem } from '@processpuzzle/widgets';\nimport { AppDefinition } from '../../domain/app-definition';\nimport { knownRoutePathsOf } from './app-shell.model';\nimport { NavRow, toNavRows } from './region-nav.component';\n\n/**\n * The shell's answer to base-widget's `APPLICATION_CONTEXT`: the name, logo and navigation of the definition\n * it renders, for `app-title`, `app-logo` and `nav-menu` to read without props.\n *\n * Provided on `AppShellComponent`, so every widget below it — in a region or in routed content — sees the\n * application it is part of. The shell writes {@link definition}; everything else derives from it.\n */\n@Injectable()\nexport class ShellApplicationContext implements ApplicationContext {\n readonly definition = signal<AppDefinition | undefined>(undefined);\n\n readonly name = computed(() => this.definition()?.name ?? '');\n readonly logoUrl = computed(() => this.definition()?.logoUrl ?? this.definition()?.theme?.logoUrl);\n readonly navItems = computed(() => navMenuItemsOf(this.definition()));\n}\n\n/**\n * The sidenav region's entries as menu items, resolved the way the sidenav resolves them: an entry naming a\n * route the application does not account for keeps its place but loses its link, so the menu never offers\n * a navigation the router would reject.\n */\nexport function navMenuItemsOf(definition: AppDefinition | undefined): NavMenuItem[] {\n const sidenav = definition?.regions?.find((region) => region.type === 'sidenav');\n return toMenuItems(toNavRows(sidenav?.navItems, knownRoutePathsOf(definition)));\n}\n\nfunction toMenuItems(rows: NavRow[]): NavMenuItem[] {\n return rows.map((row) => ({\n id: row.id,\n label: row.label,\n ...(row.translocoId ? { translocoId: row.translocoId } : {}),\n ...(row.icon ? { icon: row.icon } : {}),\n ...(row.routePath ? { routePath: row.routePath } : {}),\n ...(row.children.length ? { children: toMenuItems(row.children) } : {}),\n }));\n}\n","import { OverlayContainer } from '@angular/cdk/overlay';\nimport { ElementRef, inject, Injectable } from '@angular/core';\n\n/**\n * An `OverlayContainer` that lives inside the shell's host element instead of under `<body>`.\n *\n * The shell's theme is a set of custom properties and a `color-scheme` on its host, and they only cascade to\n * descendants. A menu, tooltip or dialog opened from inside the shell renders into the overlay container, so\n * with CDK's default one it would wear the surrounding application's theme — a light menu over a dark\n * previewed app. Moving the container into the host is all it takes; the container is `position: fixed`, and\n * native popovers render in the top layer regardless of where they sit in the DOM.\n *\n * Provided in `AppShellComponent`'s `providers`, which is also where `ElementRef` comes from. Menus and\n * tooltips resolve it through their own element injector; dialogs need `Dialog` and `MatDialog` provided\n * there as well, since the root ones would resolve the root container.\n */\n@Injectable()\nexport class ShellOverlayContainer extends OverlayContainer {\n private readonly host: HTMLElement = inject(ElementRef).nativeElement;\n\n protected override _createContainer(): void {\n super._createContainer();\n if (this._containerElement) this.host.appendChild(this._containerElement);\n }\n}\n","import { Dialog } from '@angular/cdk/dialog';\nimport { OverlayContainer } from '@angular/cdk/overlay';\nimport { NgComponentOutlet } from '@angular/common';\nimport { Component, computed, effect, inject, input } from '@angular/core';\nimport { MatDialog } from '@angular/material/dialog';\nimport { MatSidenav, MatSidenavContainer, MatSidenavContent } from '@angular/material/sidenav';\nimport { RouterOutlet } from '@angular/router';\nimport { LayoutService } from '@processpuzzle/util';\nimport { APPLICATION_CONTEXT, SidenavAutosizeDirective, ThemeService } from '@processpuzzle/widgets';\nimport { AppDefinition } from '../../domain/app-definition';\nimport { AppRegionRenderer, RegionView } from './app-region.renderer';\nimport { layoutOf, themeDefaultsOf, themeVarsOf } from './app-shell.model';\nimport { NavOrientation } from './region-nav.component';\nimport { ShellApplicationContext } from './shell-application-context';\nimport { ShellOverlayContainer } from './shell-overlay-container';\n\n/**\n * The run-time shell of a metadata-defined application: the chrome an `AppDefinition` describes, with a\n * `<router-outlet>` where its routes render.\n *\n * **This is the application, not a picture of one.** `AppPreviewComponent` hosts it so that the Preview\n * tab shows the real thing, and the standalone runtime host will mount the same component — which is\n * the whole point of it being a component with one input rather than something assembled inside the\n * preview. A shell built for the preview would drift from the one built for production, and a preview\n * that drifts is worse than none.\n *\n * Everything is bound declaratively. Regions are resolved to {@link RegionView}s and rendered through\n * `NgComponentOutlet`, never created imperatively, so that a definition edited in the neighbouring\n * details form re-renders through ordinary signal propagation instead of a clear-and-rebuild that would\n * drop scroll position and focus on every keystroke.\n *\n * The whole theme is applied here, not only the brand colours: `--pp-*` overrides as a style binding, and\n * a class selecting one of the scoped Material themes of widgets' `src/theme/pp-material-themes.scss`. The\n * class comes from the shell's own {@link ThemeService}: the definition's `materialTheme` / `colorScheme`\n * are its defaults, and a `ThemesButton` placed in one of the regions overrides them for this application\n * only. Both work because a Material theme is a set of custom properties and nothing else. That file is a\n * **global stylesheet the application registers**; if it is not registered the classes still land and the\n * shell simply inherits the host's theme. Overlays opened from inside the shell render into a\n * {@link ShellOverlayContainer} in its host, so they are themed as well.\n *\n * Not yet handled, deliberately: **no routes are registered** under the outlet. That is the nested router\n * context, which needs `EntityTabDescriptor` to be able to carry child routes.\n */\n@Component({\n selector: 'pp-app-shell',\n standalone: true,\n imports: [NgComponentOutlet, MatSidenav, MatSidenavContainer, MatSidenavContent, RouterOutlet, SidenavAutosizeDirective],\n providers: [\n ThemeService,\n ShellApplicationContext,\n { provide: APPLICATION_CONTEXT, useExisting: ShellApplicationContext },\n { provide: OverlayContainer, useClass: ShellOverlayContainer },\n Dialog,\n MatDialog,\n ],\n // Both theme bindings go on the host rather than on a wrapper, so the element that *is* the shell is\n // also the element they cascade from — and so the host can be the grid, see the stylesheet. `[class]`\n // selects one of the scoped Material themes there; `[style]` carries the `--pp-*` overrides.\n host: { '[class]': 'themeClass()', '[style]': 'themeVars()' },\n template: `\n @if (headerView() || topNavView()) {\n <div class=\"pp-app-shell__top\">\n @if (headerView(); as view) {\n <ng-container *ngComponentOutlet=\"view.component; inputs: view.inputs\"></ng-container>\n }\n @if (topNavView(); as view) {\n <ng-container *ngComponentOutlet=\"view.component; inputs: topNavInputs()\"></ng-container>\n }\n </div>\n }\n\n <mat-sidenav-container class=\"pp-app-shell__body\">\n @if (sidenavView(); as view) {\n <mat-sidenav\n class=\"pp-app-shell__sidenav\"\n ppSidenavAutosize\n [mode]=\"layout().sidenavMode\"\n [opened]=\"layout().sidenavOpened && !layoutService.isSidenavHidden()\"\n [position]=\"layout().sidenavPosition\"\n >\n <ng-container *ngComponentOutlet=\"view.component; inputs: sidenavInputs()\"></ng-container>\n </mat-sidenav>\n }\n <mat-sidenav-content>\n <main class=\"pp-app-shell__content\" [style.max-width]=\"layout().contentMaxWidth\">\n <router-outlet />\n </main>\n </mat-sidenav-content>\n </mat-sidenav-container>\n\n @if (footerView(); as view) {\n <ng-container *ngComponentOutlet=\"view.component; inputs: view.inputs\"></ng-container>\n }\n `,\n styleUrl: 'app-shell.component.scss',\n})\nexport class AppShellComponent {\n /**\n * The definition to render. Optional rather than required because the shell is mounted before the\n * definition resolves — the preview's store selects the entity in its own `ngOnInit`, and a deep link\n * arrives with nothing loaded — so an empty shell is a state to render, not an error.\n */\n readonly definition = input<AppDefinition | undefined>(undefined);\n\n /**\n * Whether a theme the user picks in a `ThemesButton` inside the shell is remembered, per application id.\n * The designer's preview turns it off: there a choice is only tried out, and a stored one would shadow the\n * theme being edited in the neighbouring form.\n */\n readonly persistTheme = input(true);\n\n private readonly regionRenderer = inject(AppRegionRenderer);\n private readonly theme = inject(ThemeService);\n private readonly applicationContext = inject(ShellApplicationContext);\n protected readonly layoutService = inject(LayoutService);\n\n protected readonly layout = computed(() => layoutOf(this.definition()));\n protected readonly themeVars = computed(() => themeVarsOf(this.definition()));\n protected readonly themeClass = this.theme.themeClass;\n\n // Re-run on every edit of the definition. Persisting, that re-reads the same stored choice; in the preview\n // it drops the choice tried out there, so an edit to the theme fields always shows.\n private readonly applyThemeDefaults = effect(() => {\n const definition = this.definition();\n this.theme.setDefaults(themeDefaultsOf(definition));\n this.theme.persistUnder(this.persistTheme() && definition?.id ? `pp-theme:${definition.id}` : null);\n this.applicationContext.definition.set(definition);\n });\n\n private readonly regionViews = computed(() =>\n (this.definition()?.regions ?? []).map((region) => this.regionRenderer.render(region, this.definition())).filter((view): view is RegionView => view !== undefined),\n );\n\n protected readonly headerView = computed(() => this.viewOf('header'));\n protected readonly footerView = computed(() => this.viewOf('footer'));\n\n /**\n * The nav in the sidenav, for the two sidenav presets. Split from {@link topNavView} rather than\n * decided in the template, so each slot is one unambiguous `@if` and the mutual exclusion is stated\n * once, here.\n */\n protected readonly sidenavView = computed(() => (this.layout().hasSidenav && !this.isSmallScreen() ? this.viewOf('sidenav') : undefined));\n\n /**\n * The same nav relocated into the header row under `top-nav`. It is placed beside the header region\n * rather than inside it, so that a `top-nav` app which declares no header region is still navigable —\n * and so that the shell still never invents a region that was not authored.\n */\n protected readonly topNavView = computed(() => (this.layout().hasSidenav || this.isSmallScreen() ? undefined : this.viewOf('sidenav')));\n\n /**\n * A handset layout has room for neither a sidenav nor a horizontal nav row, so the shell renders the nav\n * in neither place there; a `nav-menu` widget in the header stands in for it, reading the same entries\n * through the APPLICATION_CONTEXT. A definition with no such widget is not navigable on a phone — which is\n * why the seeded applications all place one.\n */\n private readonly isSmallScreen = computed(() => this.layoutService.isSmallDevice());\n\n /**\n * The nav view's own inputs with the axis the layout dictates laid over them.\n *\n * Computeds rather than a method called from the template: a method would hand `NgComponentOutlet` a\n * freshly built object on every change-detection pass, so it would re-diff and re-apply the nav's\n * inputs continuously. Memoized, the identity only changes when the definition or the preset does.\n */\n // Compact on a tablet layout, the sidenav's middle size: the drawer is sized to its content, so compact\n // rows are what narrow it to a rail. See SidenavAutosizeDirective for how the content margin follows.\n protected readonly sidenavInputs = computed(() => ({ ...this.navInputsOf(this.sidenavView(), 'vertical'), compact: this.layoutService.isMediumDevice() }));\n protected readonly topNavInputs = computed(() => this.navInputsOf(this.topNavView(), 'horizontal'));\n\n private navInputsOf(view: RegionView | undefined, orientation: NavOrientation): Record<string, unknown> {\n return { ...view?.inputs, orientation };\n }\n\n private viewOf(slot: RegionView['slot']): RegionView | undefined {\n // First occurrence wins. An app declares each slot at most once — `type` is the region's identity,\n // see APP_REGION_ID_FIELD — so a second one is a definition that bypassed validation, and ignoring\n // it is the harmless read. The same rule `buildAppRoutes` applies to a duplicate path.\n return this.regionViews().find((view) => view.slot === slot);\n }\n}\n","import { Component, computed, inject, input, OnInit } from '@angular/core';\nimport { AppDefinition } from '../domain/app-definition';\nimport { AppDefinitionStore } from '../domain/app-definition.store';\nimport { AppShellComponent } from './shell/app-shell.component';\n\n/**\n * The Preview tab's screen, mounted at `app-definition/<id>/preview` by `BASE_APP_ROUTES` — a sibling of\n * the generic Details form rather than something stacked under it, which is what the `extraTabs` hook on\n * `BaseEntityDescriptor` exists for.\n *\n * A **container and nothing more**: it resolves which definition is being previewed and frames the\n * result. Everything about *how* an application renders belongs to {@link AppShellComponent}, which the\n * standalone runtime host will mount just as this does — so the preview cannot grow behaviour the real\n * shell lacks, which is the only way a preview stays honest.\n *\n * The frame below — rounded, white, and tall enough to look like an application — is the preview's own,\n * not the shell's. In production the shell fills the viewport and none of it applies.\n */\n@Component({\n selector: 'pp-app-preview-tab',\n standalone: true,\n imports: [AppShellComponent],\n template: `\n <div class=\"pp-app-preview\">\n <pp-app-shell [definition]=\"app()\" [persistTheme]=\"false\" />\n </div>\n `,\n styles: [\n `\n .pp-app-preview {\n background-color: var(--pp-surface-base, #ffffff);\n border-radius: 6px;\n overflow: hidden;\n }\n /*\n * How tall a previewed application is, and therefore where its footer sits: at the bottom of this\n * box, not directly under the header. The shell is a three-row grid whose middle row takes the slack,\n * so giving it a height is all that is needed — but something has to, and nothing above this can:\n * the tab panel, the router outlets and the designer's own layout are all auto-height, so a\n * percentage here would resolve against nothing.\n *\n * Viewport-relative rather than a calc() subtracting the chrome: what sits above a preview is a tab\n * bar, a status bar and a toolbar whose heights are Material's to change, and a subtraction would go\n * quietly wrong when they do.\n */\n .pp-app-preview > pp-app-shell {\n min-height: 65vh;\n }\n `,\n ],\n})\nexport class AppPreviewComponent implements OnInit {\n /**\n * Bound from the route's `:entityId` param by `withComponentInputBinding()`, the same way\n * `BaseEntityFormComponent` receives it — so a deep link and a reload resolve the same app definition as a\n * click through the tab does.\n */\n readonly entityId = input.required<string>();\n\n private readonly store = inject(AppDefinitionStore);\n\n protected readonly app = computed(() => this.store.currentEntity() as AppDefinition | undefined);\n\n ngOnInit(): void {\n // Also sets the current entity, so the tab bar's Details link stays enabled and the status bar keeps\n // naming the record — arriving here directly, nothing else has selected it.\n this.store.setCurrentEntity(this.entityId());\n }\n}\n","import { inject, Injectable } from '@angular/core';\nimport { CanMatchFn, Routes } from '@angular/router';\nimport { BaseUrlSegments } from '@processpuzzle/base-entity';\nimport { firstValueFrom } from 'rxjs';\nimport { AppDefinition } from '../../domain/app-definition';\nimport { AppDefinitionService } from '../../domain/app-definition.service';\nimport { AppDefinitionStore } from '../../domain/app-definition.store';\nimport { ModuleDefinition } from '../../domain/module-definition';\nimport { ModuleDefinitionService } from '../../domain/module-definition.service';\nimport { ModuleDefinitionStore } from '../../domain/module-definition.store';\nimport { buildAppRoutes } from '../app-route-builder';\nimport { AppRouteRenderer } from '../app-route-renderer';\n\n/**\n * Turns one `AppDefinition` into the `Routes` that render its screens — the missing consumer of\n * {@link buildAppRoutes}, which until now produced routes nothing registered.\n *\n * Separate from the guard below so the interesting part is testable without a router: this class answers\n * \"what routes does app X have\", and the guard is only the two lines that hand them to Angular.\n */\n@Injectable({ providedIn: 'root' })\nexport class AppShellRoutesFactory {\n private readonly appStore = inject(AppDefinitionStore);\n private readonly appService = inject(AppDefinitionService);\n private readonly moduleStore = inject(ModuleDefinitionStore);\n private readonly moduleService = inject(ModuleDefinitionService);\n private readonly renderRoute = inject(AppRouteRenderer).render;\n\n async childrenOf(appId: string): Promise<Routes> {\n const definition = await this.definitionOf(appId);\n if (!definition) return [];\n\n const built = await buildAppRoutes({ routes: definition.routes, modules: definition.modules, loadModule: this.loadModule }, this.renderRoute);\n return built.length ? [indexRoute(definition, built), ...built] : built;\n }\n\n /**\n * Store first, endpoint second.\n *\n * The store holds the newest definition immediately after a Save, so the next navigation inside the\n * preview picks up a route the designer just added — without a second GET, and without this having to\n * know that a save happened. The fetch is for the case the store cannot serve: a deep link or a reload,\n * where nothing has been loaded yet.\n *\n * A failure resolves to `undefined` rather than propagating. A guard that rejects fails the whole\n * navigation, and an app whose definition cannot be read should render an empty shell, not a dead URL.\n */\n private async definitionOf(appId: string): Promise<AppDefinition | undefined> {\n const known = this.appStore.loadById(appId);\n if (known) return known;\n return (await this.fetch(() => firstValueFrom(this.appService.findById(appId)))) as AppDefinition | undefined;\n }\n\n /**\n * The {@link ModuleLoader} `buildAppRoutes` calls for a mount whose module it has not got. Resolving to\n * `undefined` is deliberate and is what the contract asks for: a `ModuleMount` naming a module nobody has\n * authored yet is a validation *warning*, so it must contribute no routes rather than break navigation.\n */\n private loadModule = async (moduleKey: string): Promise<ModuleDefinition | undefined> => {\n const known = this.moduleStore.loadById(moduleKey);\n if (known) return known;\n return (await this.fetch(() => firstValueFrom(this.moduleService.findById(moduleKey)))) as ModuleDefinition | undefined;\n };\n\n /** `findById` resolves to `void` for a missing record and rejects on a transport error; both mean \"no\". */\n private async fetch<Result>(read: () => Promise<Result | void>): Promise<Result | undefined> {\n try {\n return (await read()) || undefined;\n } catch {\n return undefined;\n }\n }\n}\n\n/**\n * Where the application root goes. Without it the app's own URL — `…/preview` with nothing after it —\n * matches none of the children and the *whole* route fails to match, which would take the preview screen\n * down rather than merely leave its content area empty.\n *\n * The authored order decides, falling back to the first route as built. The fallback is not decoration: an\n * app may declare no routes of its own and mount all of its screens from a module, in which case the\n * definition offers no path to land on but the built routes do.\n */\nfunction indexRoute(definition: AppDefinition, built: Routes) {\n const target = definition.routes?.find((route) => route.path)?.path ?? built[0].path;\n // `pathMatch: 'full'`, or an empty path would prefix-match every URL below it and swallow the app.\n return { path: '', pathMatch: 'full' as const, redirectTo: target };\n}\n\n/**\n * Registers an application's own routes as the children of the Preview tab's route, so that navigating\n * inside a previewed application is *real* navigation: real URLs, real back button, real outlet.\n *\n * Why a `canMatch` guard rather than `loadChildren`, which is the obvious hook for lazily-known children:\n * the router caches a `loadChildren` result on the `Route` object as `_loadedRoutes`, and one Route object\n * serves every `:entityId`. The first app previewed would therefore have its routes replayed for the\n * second. `children`, by contrast, is read fresh on every recognition and never cached — and `canMatch`\n * runs, and is awaited, *before* the router reads it. So this is the one hook that can answer \"children of\n * *this* app\" and still work on a deep link.\n *\n * Always returns `true`. It is not deciding whether the tab may be entered — it is filling in the tab's\n * children on the way past.\n */\nexport const appShellRoutesGuard: CanMatchFn = (route, _segments, snapshot) => {\n const appId = snapshot.paramMap.get(BaseUrlSegments.EntityID);\n if (!appId) return true;\n\n // `inject` before the first await: an async function loses the injection context at its first suspension.\n const factory = inject(AppShellRoutesFactory);\n return factory.childrenOf(appId).then((children) => {\n route.children = children;\n return true;\n });\n};\n","import { EntityTabDescriptor } from '@processpuzzle/base-entity';\nimport { APP_PREVIEW_I18N_KEY } from '../base-app.i18n';\nimport { AppPreviewComponent } from './app-preview.component';\nimport { appShellRoutesGuard } from './shell/app-shell-routes';\n\n/**\n * The Preview tab, declared once and consumed twice: `BASE_APP_ROUTES` mounts it as\n * `app-definition/<id>/preview`, and `AppDefinitionContainerComponent` puts it on the descriptor so the tab bar\n * renders the link. One constant rather than two literals because the segment is what ties the link to the\n * route — a mismatch would render a tab that navigates to a URL nothing matches.\n *\n * The tab is a *container*: `children` starts empty and {@link appShellRoutesGuard} fills it with the\n * previewed application's own routes on every navigation, so the shell's `<router-outlet>` renders real\n * screens at real URLs — `app-definition/demo/preview/orders`. The empty array is load-bearing; a route with\n * no `children` at all takes the `loadChildren` path instead, which is cached per Route object and so cannot\n * vary by `:entityId`.\n */\nexport const APP_PREVIEW_TAB: EntityTabDescriptor = {\n segment: 'preview',\n i18nKey: APP_PREVIEW_I18N_KEY,\n component: AppPreviewComponent,\n testIdSuffix: 'show-preview',\n children: [],\n canMatch: [appShellRoutesGuard],\n};\n","import { Component, ComponentRef, computed, inject, OnDestroy, TemplateRef, viewChild, ViewChild } from '@angular/core';\nimport { TranslocoPipe } from '@jsverse/transloco';\nimport { MatButton } from '@angular/material/button';\nimport { MatTooltip } from '@angular/material/tooltip';\nimport { BaseEntityContainerComponent, BaseEntityDescriptor, BaseFormHostDirective } from '@processpuzzle/base-entity';\nimport { PUBLISH_BUTTON_I18N_KEY, PUBLISH_TOOLTIP_I18N_KEY } from '../base-app.i18n';\nimport { AppDefinitionStore } from '../domain/app-definition.store';\nimport { createAppDefinitionDescriptor } from '../domain/app-definition.descriptors';\nimport { APP_PREVIEW_TAB } from './app-preview-tab';\n\n@Component({\n selector: 'pp-app-definition-container',\n standalone: true,\n imports: [BaseEntityContainerComponent, MatButton, MatTooltip, TranslocoPipe],\n template: `\n <base-entity-container [entityDescriptor]=\"entityDescriptor\"></base-entity-container>\n <ng-template #publishActionsTpl>\n <button id=\"publish\" type=\"button\" mat-raised-button color=\"accent\" [disabled]=\"!canPublish()\" [matTooltip]=\"publishTooltipKey | transloco\" (click)=\"onPublish()\">\n {{ publishButtonKey | transloco }}\n </button>\n </ng-template>\n `,\n})\nexport class AppDefinitionContainerComponent implements OnDestroy {\n private readonly containerComponentRef: ComponentRef<BaseEntityContainerComponent> | undefined;\n @ViewChild(BaseFormHostDirective, { static: true, read: BaseFormHostDirective }) baseEntityHost!: BaseFormHostDirective;\n readonly publishActionsTpl = viewChild<TemplateRef<unknown>>('publishActionsTpl');\n private readonly store = inject(AppDefinitionStore);\n readonly entityDescriptor: BaseEntityDescriptor;\n readonly publishButtonKey = PUBLISH_BUTTON_I18N_KEY;\n readonly publishTooltipKey = PUBLISH_TOOLTIP_I18N_KEY;\n /** Only a definition the backend already knows can be promoted, so a not-yet-saved form cannot publish. */\n readonly canPublish = computed(() => !this.store.isLoading() && !!this.store.currentEntity()?.id);\n\n constructor() {\n this.entityDescriptor = createAppDefinitionDescriptor();\n this.entityDescriptor.store = this.store;\n this.entityDescriptor.extraFormActionsTemplate = () => this.publishActionsTpl();\n this.entityDescriptor.extraTabs = [APP_PREVIEW_TAB];\n }\n\n ngOnDestroy(): void {\n if (this.containerComponentRef) {\n this.containerComponentRef.destroy();\n }\n }\n\n async onPublish(): Promise<void> {\n const id = this.store.currentEntity()?.id;\n if (!id) return;\n await this.store.publish(id);\n }\n}\n","import { Component, inject } from '@angular/core';\nimport { BaseEntityContainerComponent, BaseEntityDescriptor } from '@processpuzzle/base-entity';\nimport { createModuleDefinitionDescriptor } from '../domain/module-definition.descriptors';\nimport { ModuleDefinitionStore } from '../domain/module-definition.store';\n\n/**\n * Hosts the generic container for `Module Definition`, whose only job is to bind the descriptor to the\n * store the routable screens read from.\n *\n * Deliberately without the `Publish` action `AppDefinitionContainerComponent` contributes: publishing is\n * an application operation. An app is what a user navigates to and its status is what decides whether a\n * mount is live, so a module with a lifecycle of its own would make \"which version of what is live\" a\n * question with two answers.\n */\n@Component({\n selector: 'pp-module-definition-container',\n standalone: true,\n imports: [BaseEntityContainerComponent],\n template: `<base-entity-container [entityDescriptor]=\"entityDescriptor\"></base-entity-container>`,\n})\nexport class ModuleDefinitionContainerComponent {\n private readonly store = inject(ModuleDefinitionStore);\n readonly entityDescriptor: BaseEntityDescriptor;\n\n constructor() {\n this.entityDescriptor = createModuleDefinitionDescriptor();\n this.entityDescriptor.store = this.store;\n }\n}\n","import type { Provider } from '@angular/core';\nimport type { BaseEntityFacadeRegistry } from '@processpuzzle/base-entity';\nimport {\n APP_DEFINITION_ENTITY_NAME,\n APP_MODULE_MOUNT_ENTITY_NAME,\n APP_NAV_ITEM_ENTITY_NAME,\n APP_REGION_ENTITY_NAME,\n APP_ROUTE_ENTITY_NAME,\n APP_WIDGET_ENTITY_NAME,\n MODULE_DEFINITION_ENTITY_NAME,\n} from './domain/app-entity-names';\nimport { AppDefinitionFacade } from './feature/app-definition.facade';\nimport { AppModuleMountFacade } from './feature/app-module-mount.facade';\nimport { AppNavItemFacade } from './feature/app-nav-item.facade';\nimport { AppRegionFacade } from './feature/app-region.facade';\nimport { AppRouteFacade } from './feature/app-route.facade';\nimport { AppWidgetFacade } from './feature/app-widget.facade';\nimport { ModuleDefinitionFacade } from './feature/module-definition.facade';\n\n/**\n * The facades of the whole definition graph, to be spread into the application's `providers`.\n *\n * The embedded ones are here for the same reason the routable one is: an embedded entity has a facade\n * like any other — that is what gives it a store — and only its repository differs, reading and writing\n * the `App Definition` document rather than an endpoint of its own.\n */\nexport const BASE_APP_FACADE_PROVIDERS: Provider[] = [AppDefinitionFacade, ModuleDefinitionFacade, AppRegionFacade, AppRouteFacade, AppModuleMountFacade, AppNavItemFacade, AppWidgetFacade];\n\n/**\n * The same facades keyed by entity name, to be spread into the application's\n * `BASE_ENTITY_FACADE_REGISTRY` value.\n *\n * Every entity an `EMBEDDED_COMPONENTS` attribute of this library names has to appear here, or the\n * control throws on first render rather than showing a list whose rows go nowhere on save — the\n * registry is how it reaches the child's store and descriptor. Spread rather than provided separately,\n * because the token holds one value: a second `provide: BASE_ENTITY_FACADE_REGISTRY` would replace the\n * application's own entities instead of adding to them.\n */\nexport const BASE_APP_ENTITY_FACADES: BaseEntityFacadeRegistry = {\n [APP_DEFINITION_ENTITY_NAME]: AppDefinitionFacade,\n [MODULE_DEFINITION_ENTITY_NAME]: ModuleDefinitionFacade,\n [APP_REGION_ENTITY_NAME]: AppRegionFacade,\n [APP_ROUTE_ENTITY_NAME]: AppRouteFacade,\n [APP_MODULE_MOUNT_ENTITY_NAME]: AppModuleMountFacade,\n [APP_NAV_ITEM_ENTITY_NAME]: AppNavItemFacade,\n [APP_WIDGET_ENTITY_NAME]: AppWidgetFacade,\n};\n","import { Routes } from '@angular/router';\nimport { provideTranslocoScope } from '@jsverse/transloco';\nimport { baseEntityRoutes, type EmbeddedChildRoute } from '@processpuzzle/base-entity';\nimport { BASE_APP_TRANSLOCO_SCOPE, BASE_ENTITY_TRANSLOCO_SCOPE } from './base-app.i18n';\nimport { APP_DEFINITION_ENTITY_NAME } from './domain/app-definition.descriptors';\nimport {\n APP_MODULE_MOUNT_ENTITY_NAME,\n APP_NAV_ITEM_ENTITY_NAME,\n APP_REGION_ENTITY_NAME,\n APP_ROUTE_ENTITY_NAME,\n APP_WIDGET_ENTITY_NAME,\n MODULE_DEFINITION_ENTITY_NAME\n} from './domain/app-entity-names';\nimport { AppDefinitionContainerComponent } from './feature/app-definition-container.component';\nimport { APP_PREVIEW_TAB } from './feature/app-preview-tab';\nimport { AppModuleMountFacade } from './feature/app-module-mount.facade';\nimport { AppNavItemFacade } from './feature/app-nav-item.facade';\nimport { AppRegionFacade } from './feature/app-region.facade';\nimport { AppRouteFacade } from './feature/app-route.facade';\nimport { AppWidgetFacade } from './feature/app-widget.facade';\nimport { ModuleDefinitionContainerComponent } from './feature/module-definition-container.component';\n\n/**\n * The path segment has to be `snakeCaseName('App Definition')`, because\n * `BaseFormNavigatorSingletonStore` builds the details URL from the entity name — see the same\n * constraint on `BASE_RULE_ROUTES`.\n */\nexport const BASE_APP_ROUTES: Routes = [\n {\n path: 'app-definition',\n title: 'ProcessPuzzle Design - Applications',\n data: { icon: 'web', menuTitle: 'design.applications', entityName: APP_DEFINITION_ENTITY_NAME },\n component: AppDefinitionContainerComponent,\n providers: [authoringScopes()],\n children: baseEntityRoutes(embeddedDefinitionRoutes(), [APP_PREVIEW_TAB]),\n },\n // A sibling rather than a child of the branch above: a module is an aggregate of its own, with its own\n // endpoints and its own list screen. What ties the two together is data — a `ModuleMount` naming a key —\n // and the run-time shell that resolves it, not the authoring URL.\n {\n path: 'module-definition',\n title: 'ProcessPuzzle Design - Modules',\n data: { icon: 'extension', menuTitle: 'design.modules', entityName: MODULE_DEFINITION_ENTITY_NAME },\n component: ModuleDefinitionContainerComponent,\n providers: [authoringScopes()],\n children: baseEntityRoutes([routeRoute()]),\n },\n];\n\n/**\n * The transloco scopes every authoring branch of this library needs. Both are required: a route that\n * declares TRANSLOCO_SCOPE replaces the collection it inherits rather than adding to it, and the generic\n * tabs translate the framework's own `base_entity.*` keys (see BASE_ENTITY_TRANSLOCO_SCOPE).\n *\n * Registered on the top-level routes rather than on the containers, so the base-entity tabs, list and form\n * rendered in the child routes resolve entity and attribute labels from the same scopes. The embedded\n * branches below need none of their own: `base_app.app_region.*` and its siblings are keys of the scope\n * already registered here.\n *\n * Both aliases are spelled out, as everywhere in this workspace: transloco camel-cases the default alias,\n * so `base_app` would silently become `baseApp` and miss every key below it.\n */\nfunction authoringScopes() {\n return provideTranslocoScope({ scope: BASE_ENTITY_TRANSLOCO_SCOPE, alias: BASE_ENTITY_TRANSLOCO_SCOPE }, { scope: BASE_APP_TRANSLOCO_SCOPE, alias: BASE_APP_TRANSLOCO_SCOPE });\n}\n\n/**\n * The definition graph as route branches: a region, a route and a module mount hang below the\n * definition's details route, a nav item and a widget below the region's, a widget below the route's,\n * and a nav item below itself.\n *\n * The nesting mirrors the containment of `base-app-api.yaml` exactly, and it has to: an embedded row has\n * no id of its own to be looked up by, so the URL — `app-definition/claims-app/details/app-region/sidenav/\n * details/app-nav-item/nav-claims/details` — is what addresses it, and each segment resolves against the\n * rows of the level above it.\n *\n * These are the *authoring* routes and have nothing to do with the routes an `AppDefinition` declares:\n * `App Route` rows are data here, and it is the run-time shell that turns them into `Routes` of their\n * own. A module mount is a leaf — the module it names is a separate aggregate with its own endpoints,\n * so its routes are authored there rather than through this branch.\n */\nfunction embeddedDefinitionRoutes(): EmbeddedChildRoute[] {\n return [\n { entityName: APP_REGION_ENTITY_NAME, facade: AppRegionFacade, children: () => [navItemRoute(), widgetRoute()] },\n routeRoute(),\n { entityName: APP_MODULE_MOUNT_ENTITY_NAME, facade: AppModuleMountFacade },\n ];\n}\n\n/**\n * The `App Route` branch, shared by both aggregates that own routes: an app's `routes` and a module's are\n * the same rows edited by the same descriptor, so the branch below them has to be the same too. Only the\n * URL prefix differs — `app-definition/demo/details/app-route/...` against\n * `module-definition/claims/details/app-route/...`.\n */\nfunction routeRoute(): EmbeddedChildRoute {\n return { entityName: APP_ROUTE_ENTITY_NAME, facade: AppRouteFacade, children: () => [widgetRoute()] };\n}\n\n/** A nav item nests in itself — a group node's children are nav items. Hence the thunk: the structure is\n * infinite, and `loadChildren` expands one level per navigation. */\nfunction navItemRoute(): EmbeddedChildRoute {\n return { entityName: APP_NAV_ITEM_ENTITY_NAME, facade: AppNavItemFacade, children: () => [navItemRoute()] };\n}\n\n/**\n * A widget, unlike a nav item, is a leaf branch: widgets do not nest, so there is no deeper level to\n * expand. A container widget places its siblings by id through `props.childIds`, and those siblings are\n * rows of this same list — reachable at this level, not below it.\n */\nfunction widgetRoute(): EmbeddedChildRoute {\n return { entityName: APP_WIDGET_ENTITY_NAME, facade: AppWidgetFacade };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AA+BA,MAAa,kBAAkB;AAG/B,MAAa,gBAAgB;AAG7B,MAAa,iBAAiB;CAAC;CAAgB;CAAiB;AAAS;AAGzE,MAAa,gBAAgB;CAAC;CAAQ;CAAQ;AAAM;AAQpD,MAAa,eAAe;CAAC;CAAU;CAAW;AAAQ;AAQ1D,MAAa,qBAAqB;CAAC;CAAW;CAAY;AAAQ;AAGlE,MAAa,eAAe,CAAC,QAAQ,SAAS;AAG9C,IAAY;CAAZ,SAAY,qBAAmB;CAC7B,oBAAA,WAAA;CACA,oBAAA,eAAA;AACF,EAAA,CAHY,wBAAA,sBAAmB,CAAA,EAAA;AAsB/B,IAAa,UAAb,MAAoB;CAClB;CACA;CACA;CACA;CAQA;CACA;CACA;CAEA,YAAY,OAAyB,CAAA,GAAE;EACrC,K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