@swapnil-srivastava/constellation-angular 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -34,9 +34,20 @@ bootstrapApplication(AppComponent, {
34
34
 
35
35
  | API | Purpose |
36
36
  | --- | --- |
37
- | `provideConstellation(options)` | `sdkConfig` (skip the sdk-config.json fetch), `localComponentMap` (custom and override components), `mashupRootId`, `appName`. |
37
+ | `provideConstellation(options)` | `sdkConfig` (skip the sdk-config.json fetch), `localComponentMap` (custom and override components), `useBuiltInOverrides` (default true), `mashupRootId`, `appName`. |
38
38
  | `<cx-embed-case>` | Inputs `caseType`, `startingFields`, `pageName` (default `pyEmbedAssignment`). Outputs `started`, `cancelled`, `completed`, `failed`. |
39
39
  | `ConstellationBootstrapService.start()` | Login + PCore bootstrap once per page; resolves the root PConnect. |
40
+ | `packageComponentMap` | Overrides this package maps by default (see below). |
41
+
42
+ ## Built-in overrides
43
+
44
+ The package maps these Pega components to its own versions. Your `localComponentMap` is applied after them, so a key there replaces the package's component. To use only Pega's components, pass `provideConstellation({ useBuiltInOverrides: false })`.
45
+
46
+ | Pega component | Package component | Look |
47
+ | --- | --- | --- |
48
+ | `TextInput` | `BankTextInputComponent` | Square box, 2px border, label inside the box above the value, helper and error text below. States: hover, focus (3px ring), filled, required, error, warning, disabled, read-only, display-only, hidden. Details in `src/lib/components/bank-text-input/README.md`. |
49
+
50
+ Retheme it with CSS custom properties (`--cx-field-border`, `--cx-field-focus-ring`, `--cx-field-error`, `--cx-field-font` and others) on `cx-bank-text-input` or any ancestor.
40
51
 
41
52
  ## Host app assets
42
53
 
@@ -1,7 +1,9 @@
1
1
  import * as i0 from '@angular/core';
2
- import { InjectionToken, makeEnvironmentProviders, provideEnvironmentInitializer, inject, Injectable, input, output, signal, ChangeDetectionStrategy, Component } from '@angular/core';
2
+ import { InjectionToken, makeEnvironmentProviders, provideEnvironmentInitializer, Component, forwardRef, inject, Injectable, input, output, signal, ChangeDetectionStrategy } from '@angular/core';
3
3
  import { setConfigRetrievalOverride, sdkSetAuthHeader, sdkSetCustomTokenParamsCB, getSdkConfig, loginIfNecessary, SdkConfigAccess } from '@pega/auth/lib/sdk-auth-manager';
4
- import { compareSdkPCoreVersions, getSdkComponentMap, ComponentMapperComponent, Utils } from '@pega/angular-sdk-components';
4
+ import { FieldBase, handleEvent, FieldWarningDirective, ComponentMapperComponent, compareSdkPCoreVersions, getSdkComponentMap, Utils } from '@pega/angular-sdk-components';
5
+ import * as i1 from '@angular/forms';
6
+ import { ReactiveFormsModule } from '@angular/forms';
5
7
 
6
8
  const CONSTELLATION_OPTIONS = new InjectionToken('CONSTELLATION_OPTIONS');
7
9
 
@@ -49,6 +51,76 @@ function initializeAuthentication(sdkConfigAuth) {
49
51
  }
50
52
  }
51
53
 
54
+ let nextId$1 = 0;
55
+ /**
56
+ * Override for the SDK's `TextInput`: same store wiring (extends FieldBase, like the
57
+ * SDK's TextInputComponent), with a bank-style look: a square box with a 2px border,
58
+ * the label inside the box above the value, helper and error text under it.
59
+ * Mapped by default through `packageComponentMap`; an app can still replace it.
60
+ */
61
+ class BankTextInputComponent extends FieldBase {
62
+ configProps$;
63
+ inputId = `cx-bank-text-input-${++nextId$1}`;
64
+ helperId = `${this.inputId}-helper`;
65
+ errorId = `${this.inputId}-error`;
66
+ updateSelf() {
67
+ this.configProps$ = this.pConn$.resolveConfigProps(this.pConn$.getConfigProps());
68
+ this.updateComponentCommonProperties(this.configProps$);
69
+ const { value } = this.configProps$;
70
+ this.value$ = value;
71
+ // FieldBase sets the control once in ngOnInit; keep it in step with later store
72
+ // updates so the filled state and validation see the value that is shown.
73
+ if (this.fieldControl.value !== (value ?? '')) {
74
+ this.fieldControl.setValue(value ?? '', { emitEvent: false });
75
+ }
76
+ }
77
+ /** Errors show once the field was left (or the server flagged it), like the SDK's mat-error. */
78
+ get showError() {
79
+ return this.fieldControl.invalid && this.fieldControl.touched;
80
+ }
81
+ get describedBy() {
82
+ const ids = [this.helperText ? this.helperId : '', this.showError ? this.errorId : ''].filter(Boolean);
83
+ return ids.length ? ids.join(' ') : null;
84
+ }
85
+ get filled() {
86
+ const value = this.fieldControl.value;
87
+ return value !== null && value !== undefined && `${value}` !== '';
88
+ }
89
+ fieldOnChange(event) {
90
+ const oldVal = this.value$ ?? '';
91
+ if (event.target.value.toString() !== oldVal.toString()) {
92
+ this.pConn$.clearErrorMessages({ property: this.propName });
93
+ }
94
+ }
95
+ fieldOnBlur(event) {
96
+ const oldVal = this.value$ ?? '';
97
+ const value = event.target.value;
98
+ if (value.toString() !== oldVal.toString()) {
99
+ handleEvent(this.actionsApi, 'changeNblur', this.propName, value);
100
+ }
101
+ }
102
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.26", ngImport: i0, type: BankTextInputComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
103
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.26", type: BankTextInputComponent, isStandalone: true, selector: "cx-bank-text-input", usesInheritance: true, ngImport: i0, template: "@if (displayMode$) {\n @if (bVisible$ !== false) {\n <component-mapper name=\"FieldValueList\" [props]=\"{ label$, value$, displayMode$ }\"></component-mapper>\n }\n} @else if (!bReadonly$ && bHasForm$) {\n @if (bVisible$) {\n <div\n class=\"bank-field\"\n [formGroup]=\"formGroup$\"\n [class.bank-field--filled]=\"filled\"\n [class.bank-field--error]=\"showError\"\n [class.bank-field--warning]=\"bFieldMessageVisible$\"\n [class.bank-field--disabled]=\"bDisabled$\"\n >\n <div class=\"bank-field__box\">\n <label class=\"bank-field__label\" [class.bank-field__label--hidden]=\"hideLabel\" [for]=\"inputId\">\n {{ label$ }}\n @if (bRequired$) {\n <span class=\"bank-field__required\" aria-hidden=\"true\">*</span>\n }\n </label>\n <input\n class=\"bank-field__input\"\n type=\"text\"\n [id]=\"inputId\"\n [placeholder]=\"placeholder\"\n [value]=\"value$\"\n [required]=\"bRequired$\"\n [attr.aria-invalid]=\"showError ? 'true' : null\"\n [attr.aria-describedby]=\"describedBy\"\n [attr.data-test-id]=\"testId\"\n [formControl]=\"fieldControl\"\n (change)=\"fieldOnChange($event)\"\n (blur)=\"fieldOnBlur($event)\"\n />\n </div>\n @if (helperText) {\n <div class=\"bank-field__helper\" [id]=\"helperId\" [appFieldWarning]=\"bFieldMessageVisible$\">{{ helperText }}</div>\n }\n <div class=\"bank-field__error\" [id]=\"errorId\" aria-live=\"polite\">\n @if (showError) {\n {{ getErrorMessage() }}\n }\n </div>\n </div>\n }\n} @else {\n @if (bVisible$ !== false) {\n <component-mapper name=\"Text\" [props]=\"{ pConn$, formatAs$: 'text' }\"></component-mapper>\n }\n}\n", styles: [":host{--cx-field-font: system-ui, -apple-system, \"Segoe UI\", Roboto, \"Helvetica Neue\", Arial, sans-serif;--cx-field-text: #373737;--cx-field-muted: #595959;--cx-field-bg: #fff;--cx-field-border: #8c8c8c;--cx-field-border-active: #6e6e6e;--cx-field-border-width: 2px;--cx-field-radius: 0;--cx-field-focus-ring: #58595b;--cx-field-error: #d21f1e;--cx-field-error-bg: #ffeded;--cx-field-disabled-bg: #eee;--cx-field-disabled: #bbb;display:block;font-family:var(--cx-field-font)}.bank-field__box{position:relative;display:flex;flex-direction:column;min-height:48px;padding:6px 12px 4px;box-sizing:border-box;background:var(--cx-field-bg);border:var(--cx-field-border-width) solid var(--cx-field-border);border-radius:var(--cx-field-radius);cursor:text;transition:border-color .12s ease,box-shadow .12s ease}.bank-field__box:hover{border-color:var(--cx-field-border-active)}.bank-field__box:focus-within{border-color:var(--cx-field-border-active)}.bank-field__box:has(.bank-field__input:focus-visible){box-shadow:0 0 0 3px var(--cx-field-focus-ring);outline:2px solid transparent;outline-offset:2px}.bank-field__label{font-size:13px;line-height:18px;color:var(--cx-field-text);cursor:inherit}.bank-field__label--hidden{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}.bank-field__required{margin-inline-start:2px;color:var(--cx-field-error)}.bank-field__input{width:100%;padding:0;border:0;background:transparent;color:var(--cx-field-text);font:inherit;font-size:16px;line-height:24px;outline:none}.bank-field__input::placeholder{color:var(--cx-field-muted);opacity:1}.bank-field__helper,.bank-field__error{padding-inline:12px;font-size:13px;line-height:18px}.bank-field__helper{margin-block-start:4px;color:var(--cx-field-muted)}.bank-field__error{color:var(--cx-field-error);font-weight:600}.bank-field__error:not(:empty){margin-block-start:4px}.bank-field--error .bank-field__box{border-color:var(--cx-field-error);background:var(--cx-field-error-bg)}.bank-field--error .bank-field__box:focus-within{border-color:var(--cx-field-error)}.bank-field--warning .bank-field__box{border-color:var(--app-alert-warning-border-color, #8a5300)}.bank-field--disabled .bank-field__box{background:var(--cx-field-disabled-bg);border-color:var(--cx-field-disabled);box-shadow:none;cursor:not-allowed}.bank-field--disabled .bank-field__box .bank-field__label,.bank-field--disabled .bank-field__box .bank-field__input{color:var(--cx-field-disabled);cursor:not-allowed}@media(prefers-reduced-motion:reduce){.bank-field__box{transition:none}}\n"], dependencies: [{ kind: "ngmodule", type: i0.forwardRef(() => ReactiveFormsModule) }, { kind: "directive", type: i0.forwardRef(() => i1.DefaultValueAccessor), selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i0.forwardRef(() => i1.NgControlStatus), selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i0.forwardRef(() => i1.NgControlStatusGroup), selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i0.forwardRef(() => i1.RequiredValidator), selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i0.forwardRef(() => i1.FormControlDirective), selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i0.forwardRef(() => i1.FormGroupDirective), selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i0.forwardRef(() => FieldWarningDirective), selector: "[appFieldWarning]", inputs: ["appFieldWarning"] }, { kind: "component", type: i0.forwardRef(() => ComponentMapperComponent), selector: "component-mapper", inputs: ["name", "props", "errorMsg", "outputEvents", "parent"] }] });
104
+ }
105
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.26", ngImport: i0, type: BankTextInputComponent, decorators: [{
106
+ type: Component,
107
+ args: [{ selector: 'cx-bank-text-input', imports: [ReactiveFormsModule, FieldWarningDirective, forwardRef(() => ComponentMapperComponent)], template: "@if (displayMode$) {\n @if (bVisible$ !== false) {\n <component-mapper name=\"FieldValueList\" [props]=\"{ label$, value$, displayMode$ }\"></component-mapper>\n }\n} @else if (!bReadonly$ && bHasForm$) {\n @if (bVisible$) {\n <div\n class=\"bank-field\"\n [formGroup]=\"formGroup$\"\n [class.bank-field--filled]=\"filled\"\n [class.bank-field--error]=\"showError\"\n [class.bank-field--warning]=\"bFieldMessageVisible$\"\n [class.bank-field--disabled]=\"bDisabled$\"\n >\n <div class=\"bank-field__box\">\n <label class=\"bank-field__label\" [class.bank-field__label--hidden]=\"hideLabel\" [for]=\"inputId\">\n {{ label$ }}\n @if (bRequired$) {\n <span class=\"bank-field__required\" aria-hidden=\"true\">*</span>\n }\n </label>\n <input\n class=\"bank-field__input\"\n type=\"text\"\n [id]=\"inputId\"\n [placeholder]=\"placeholder\"\n [value]=\"value$\"\n [required]=\"bRequired$\"\n [attr.aria-invalid]=\"showError ? 'true' : null\"\n [attr.aria-describedby]=\"describedBy\"\n [attr.data-test-id]=\"testId\"\n [formControl]=\"fieldControl\"\n (change)=\"fieldOnChange($event)\"\n (blur)=\"fieldOnBlur($event)\"\n />\n </div>\n @if (helperText) {\n <div class=\"bank-field__helper\" [id]=\"helperId\" [appFieldWarning]=\"bFieldMessageVisible$\">{{ helperText }}</div>\n }\n <div class=\"bank-field__error\" [id]=\"errorId\" aria-live=\"polite\">\n @if (showError) {\n {{ getErrorMessage() }}\n }\n </div>\n </div>\n }\n} @else {\n @if (bVisible$ !== false) {\n <component-mapper name=\"Text\" [props]=\"{ pConn$, formatAs$: 'text' }\"></component-mapper>\n }\n}\n", styles: [":host{--cx-field-font: system-ui, -apple-system, \"Segoe UI\", Roboto, \"Helvetica Neue\", Arial, sans-serif;--cx-field-text: #373737;--cx-field-muted: #595959;--cx-field-bg: #fff;--cx-field-border: #8c8c8c;--cx-field-border-active: #6e6e6e;--cx-field-border-width: 2px;--cx-field-radius: 0;--cx-field-focus-ring: #58595b;--cx-field-error: #d21f1e;--cx-field-error-bg: #ffeded;--cx-field-disabled-bg: #eee;--cx-field-disabled: #bbb;display:block;font-family:var(--cx-field-font)}.bank-field__box{position:relative;display:flex;flex-direction:column;min-height:48px;padding:6px 12px 4px;box-sizing:border-box;background:var(--cx-field-bg);border:var(--cx-field-border-width) solid var(--cx-field-border);border-radius:var(--cx-field-radius);cursor:text;transition:border-color .12s ease,box-shadow .12s ease}.bank-field__box:hover{border-color:var(--cx-field-border-active)}.bank-field__box:focus-within{border-color:var(--cx-field-border-active)}.bank-field__box:has(.bank-field__input:focus-visible){box-shadow:0 0 0 3px var(--cx-field-focus-ring);outline:2px solid transparent;outline-offset:2px}.bank-field__label{font-size:13px;line-height:18px;color:var(--cx-field-text);cursor:inherit}.bank-field__label--hidden{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}.bank-field__required{margin-inline-start:2px;color:var(--cx-field-error)}.bank-field__input{width:100%;padding:0;border:0;background:transparent;color:var(--cx-field-text);font:inherit;font-size:16px;line-height:24px;outline:none}.bank-field__input::placeholder{color:var(--cx-field-muted);opacity:1}.bank-field__helper,.bank-field__error{padding-inline:12px;font-size:13px;line-height:18px}.bank-field__helper{margin-block-start:4px;color:var(--cx-field-muted)}.bank-field__error{color:var(--cx-field-error);font-weight:600}.bank-field__error:not(:empty){margin-block-start:4px}.bank-field--error .bank-field__box{border-color:var(--cx-field-error);background:var(--cx-field-error-bg)}.bank-field--error .bank-field__box:focus-within{border-color:var(--cx-field-error)}.bank-field--warning .bank-field__box{border-color:var(--app-alert-warning-border-color, #8a5300)}.bank-field--disabled .bank-field__box{background:var(--cx-field-disabled-bg);border-color:var(--cx-field-disabled);box-shadow:none;cursor:not-allowed}.bank-field--disabled .bank-field__box .bank-field__label,.bank-field--disabled .bank-field__box .bank-field__input{color:var(--cx-field-disabled);cursor:not-allowed}@media(prefers-reduced-motion:reduce){.bank-field__box{transition:none}}\n"] }]
108
+ }] });
109
+
110
+ /**
111
+ * Overrides this package ships and maps by default. Keys are Pega's component names.
112
+ * An app's own `localComponentMap` is applied after this one, so it always wins.
113
+ */
114
+ const packageComponentMap = {
115
+ TextInput: BankTextInputComponent
116
+ };
117
+ /**
118
+ * The map handed to the SDK: the package's overrides first (unless turned off), then the app's.
119
+ */
120
+ function buildComponentMap(localComponentMap, useBuiltInOverrides = true) {
121
+ return { ...(useBuiltInOverrides ? packageComponentMap : {}), ...(localComponentMap ?? {}) };
122
+ }
123
+
52
124
  const constellationWindow = () => window;
53
125
  function getPCore() {
54
126
  const pcore = constellationWindow().PCore;
@@ -93,7 +165,7 @@ class ConstellationBootstrapService {
93
165
  win.PCore.onPCoreReady(async (renderObj) => {
94
166
  try {
95
167
  compareSdkPCoreVersions();
96
- await getSdkComponentMap(this.options.localComponentMap ?? {});
168
+ await getSdkComponentMap(buildComponentMap(this.options.localComponentMap, this.options.useBuiltInOverrides ?? true));
97
169
  // Required so PConnect.createComponent returns the c11n environment
98
170
  win.PCore.registerComponentCreator(c11nEnv => c11nEnv);
99
171
  resolve(renderObj.props.getPConnect());
@@ -235,5 +307,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.26", ngImpo
235
307
  * Generated bundle index. Do not edit.
236
308
  */
237
309
 
238
- export { CONSTELLATION_OPTIONS, ConstellationBootstrapService, EmbedCaseComponent, initializeAuthentication, provideConstellation };
310
+ export { BankTextInputComponent, CONSTELLATION_OPTIONS, ConstellationBootstrapService, EmbedCaseComponent, buildComponentMap, initializeAuthentication, packageComponentMap, provideConstellation };
239
311
  //# sourceMappingURL=swapnil-srivastava-constellation-angular.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"swapnil-srivastava-constellation-angular.mjs","sources":["../../src/lib/types.ts","../../src/lib/provide-constellation.ts","../../src/lib/auth.ts","../../src/lib/pcore.ts","../../src/lib/constellation-bootstrap.service.ts","../../src/lib/embed-case.component.ts","../../src/public-api.ts","../../src/swapnil-srivastava-constellation-angular.ts"],"sourcesContent":["import { InjectionToken, Type } from '@angular/core';\n\n/**\n * Shape of sdk-config.json as read by @pega/auth. Only the keys this package\n * touches are typed; everything else passes through unchanged.\n * See https://docs.pega.com/bundle/constellation-sdk/page/constellation-sdks/sdks/configuring-sdk-config-json.html\n */\nexport interface ConstellationSdkConfig {\n theme?: 'light' | 'dark' | string;\n authConfig: {\n authService?: string;\n mashupClientId?: string;\n mashupGrantType?: string;\n mashupUserIdentifier?: string;\n /** Base64 encoded. Only for local testing: anything here is readable in the browser. */\n mashupPassword?: string;\n customAuthType?: string;\n portalClientId?: string;\n [key: string]: unknown;\n };\n serverConfig: {\n infinityRestServerUrl: string;\n appAlias?: string;\n sdkContentServerUrl?: string;\n appMashupCaseType?: string;\n showModalsInEmbeddedMode?: boolean;\n [key: string]: unknown;\n };\n [key: string]: unknown;\n}\n\n/** Map of Constellation component name to an Angular component that renders it. */\nexport type LocalComponentMap = Record<string, Type<unknown>>;\n\nexport interface ConstellationOptions {\n /**\n * Pass the config object directly instead of fetching ./sdk-config.json.\n * Useful when values come from your own backend or environment.\n */\n sdkConfig?: ConstellationSdkConfig;\n /**\n * Custom and override components, merged in front of Pega's component map\n * (same role as sdk-local-component-map.ts in the Angular SDK).\n */\n localComponentMap?: LocalComponentMap;\n /** Root id passed to the bootstrap shell's loadMashup. Defaults to 'app-root'. */\n mashupRootId?: string;\n /**\n * appName passed to loginIfNecessary. Defaults to the current path,\n * which is what the Angular SDK embedded sample does.\n */\n appName?: string;\n}\n\nexport const CONSTELLATION_OPTIONS = new InjectionToken<ConstellationOptions>('CONSTELLATION_OPTIONS');\n","import { EnvironmentProviders, makeEnvironmentProviders, provideEnvironmentInitializer } from '@angular/core';\nimport { setConfigRetrievalOverride } from '@pega/auth/lib/sdk-auth-manager';\nimport { CONSTELLATION_OPTIONS, ConstellationOptions } from './types';\n\n/**\n * Registers Constellation embedding for the app.\n *\n * ```ts\n * bootstrapApplication(AppComponent, {\n * providers: [provideHttpClient(), provideAnimations(), provideConstellation({ localComponentMap })]\n * });\n * ```\n */\nexport function provideConstellation(options: ConstellationOptions = {}): EnvironmentProviders {\n return makeEnvironmentProviders([\n { provide: CONSTELLATION_OPTIONS, useValue: options },\n provideEnvironmentInitializer(() => {\n const { sdkConfig } = options;\n if (sdkConfig) {\n // @pega/auth otherwise fetches ./sdk-config.json\n setConfigRetrievalOverride(async () => structuredClone(sdkConfig));\n }\n })\n ]);\n}\n","// Ported from pegasystems/angular-sdk v26.1.10 src/app/_samples/embedded/utils.ts (Apache-2.0).\nimport { sdkSetAuthHeader, sdkSetCustomTokenParamsCB } from '@pega/auth/lib/sdk-auth-manager';\nimport { ConstellationSdkConfig } from './types';\n\n/**\n * Applies the custom auth modes supported by the Angular SDK embedded sample\n * (Basic, BasicTO, CustomIdentifier). For the normal OAuth flow it does nothing.\n */\nexport function initializeAuthentication(sdkConfigAuth: ConstellationSdkConfig['authConfig']): void {\n const noOAuthClient = sdkConfigAuth.mashupGrantType === 'none' || !sdkConfigAuth.mashupClientId;\n const password = sdkConfigAuth.mashupPassword ? window.atob(sdkConfigAuth.mashupPassword) : '';\n\n if (noOAuthClient && sdkConfigAuth.customAuthType === 'Basic') {\n sdkSetAuthHeader(`Basic ${window.btoa(`${sdkConfigAuth.mashupUserIdentifier}:${password}`)}`);\n }\n\n if (noOAuthClient && sdkConfigAuth.customAuthType === 'BasicTO') {\n const expTime = new Date(Date.now() + 5 * 60 * 1000);\n const isoTime = `${expTime.toISOString().split('.')[0]}Z`.replace(/[-:]/g, '');\n sdkSetAuthHeader(`Basic ${window.btoa(`${sdkConfigAuth.mashupUserIdentifier}:${password}:${isoTime}`)}`);\n }\n\n if (sdkConfigAuth.mashupGrantType === 'customBearer' && sdkConfigAuth.customAuthType === 'CustomIdentifier') {\n // Insecure, demo only (same caveat as Pega's sample)\n sdkSetCustomTokenParamsCB(() => ({ userIdentifier: sdkConfigAuth.mashupUserIdentifier }));\n }\n}\n","/**\n * Minimal view of the window globals that the Constellation bootstrap shell\n * creates. Kept local so this package does not leak @pega/pcore-pconnect-typedefs\n * into its public types.\n */\nexport interface PConnectLike {\n getComponentName(): string;\n [key: string]: unknown;\n}\n\nexport interface PCoreLike {\n onPCoreReady(cb: (renderObj: { props: { getPConnect(): PConnectLike } }) => void | Promise<void>): void;\n registerComponentCreator(cb: (c11nEnv: unknown) => unknown): void;\n getMashupApi(): {\n createCase(caseType: string, context: string, options: { pageName?: string; startingFields?: Record<string, unknown> }): Promise<unknown>;\n };\n getConstants(): {\n APP: { APP: string };\n PUB_SUB_EVENTS: { EVENT_CANCEL: string; CASE_EVENTS: { END_OF_ASSIGNMENT_PROCESSING: string } };\n };\n getEnvironmentInfo(): {\n environmentInfoObject?: { pyCaseTypeList?: { pyWorkTypeImplementationClassName: string }[] };\n };\n getPubSubUtils(): {\n subscribe(event: string, cb: (payload?: unknown) => void, id: string): void;\n unsubscribe(event: string, id: string): void;\n };\n}\n\ntype ConstellationWindow = Window & {\n PCore?: PCoreLike;\n myLoadMashup?: (rootId: string, preLoadComponents: boolean) => void;\n};\n\nexport const constellationWindow = (): ConstellationWindow => window as ConstellationWindow;\n\nexport function getPCore(): PCoreLike {\n const pcore = constellationWindow().PCore;\n if (!pcore) {\n throw new Error('PCore is not loaded yet. Call ConstellationBootstrapService.start() first.');\n }\n return pcore;\n}\n","// Bootstrap sequence ported from pegasystems/angular-sdk v26.1.10\n// src/app/_samples/embedded/embedded.component.ts (Apache-2.0).\nimport { Injectable, inject } from '@angular/core';\nimport { getSdkConfig, loginIfNecessary } from '@pega/auth/lib/sdk-auth-manager';\nimport { compareSdkPCoreVersions, getSdkComponentMap } from '@pega/angular-sdk-components';\nimport { initializeAuthentication } from './auth';\nimport { constellationWindow, PConnectLike } from './pcore';\nimport { CONSTELLATION_OPTIONS, ConstellationSdkConfig } from './types';\n\n/**\n * Logs in, loads the Constellation bootstrap shell and PCore, and initialises\n * the SDK component map. Runs once per page: PCore and the component map are\n * window-level singletons.\n */\n@Injectable({ providedIn: 'root' })\nexport class ConstellationBootstrapService {\n private readonly options = inject(CONSTELLATION_OPTIONS, { optional: true }) ?? {};\n private ready?: Promise<PConnectLike>;\n\n /** Resolves with the root PConnect once PCore is ready. Safe to call many times. */\n start(): Promise<PConnectLike> {\n this.ready ??= this.boot().catch(err => {\n this.ready = undefined; // allow a retry\n throw err;\n });\n return this.ready;\n }\n\n private async boot(): Promise<PConnectLike> {\n const sdkConfig = (await getSdkConfig()) as ConstellationSdkConfig;\n const { authConfig, theme } = sdkConfig;\n\n document.body.classList.remove('light', 'dark');\n document.body.classList.add(theme || 'light');\n\n initializeAuthentication(authConfig);\n\n // Register before login: @pega/auth fires this once the bootstrap shell has loaded.\n const constellationReady = new Promise<void>(resolve =>\n document.addEventListener('SdkConstellationReady', () => resolve(), { once: true })\n );\n\n const path = window.location.pathname;\n const appName = this.options.appName ?? path.substring(path.indexOf('/') + 1);\n loginIfNecessary({ appName, mainRedirect: false });\n\n await constellationReady;\n\n return new Promise<PConnectLike>((resolve, reject) => {\n const win = constellationWindow();\n win.PCore!.onPCoreReady(async renderObj => {\n try {\n compareSdkPCoreVersions();\n await getSdkComponentMap(this.options.localComponentMap ?? {});\n // Required so PConnect.createComponent returns the c11n environment\n win.PCore!.registerComponentCreator(c11nEnv => c11nEnv);\n resolve(renderObj.props.getPConnect());\n } catch (err) {\n reject(err);\n }\n });\n\n if (!win.myLoadMashup) {\n reject(new Error('Bootstrap shell did not define loadMashup. Check that /constellation/bootstrap-shell.js is served.'));\n return;\n }\n win.myLoadMashup(this.options.mashupRootId ?? 'app-root', false);\n });\n }\n}\n","// Case start and RootContainer rendering ported from pegasystems/angular-sdk v26.1.10\n// src/app/_samples/embedded/main-screen/main-screen.component.ts (Apache-2.0).\nimport { ChangeDetectionStrategy, Component, OnDestroy, OnInit, inject, input, output, signal } from '@angular/core';\nimport { ComponentMapperComponent, Utils } from '@pega/angular-sdk-components';\nimport { SdkConfigAccess } from '@pega/auth/lib/sdk-auth-manager';\nimport { ConstellationBootstrapService } from './constellation-bootstrap.service';\nimport { getPCore, PConnectLike } from './pcore';\n\nlet nextId = 0;\n\n/**\n * Starts a Constellation case and renders it in place.\n *\n * ```html\n * <cx-embed-case caseType=\"ORG-App-Work-MyCase\" (completed)=\"done()\" />\n * ```\n */\n@Component({\n selector: 'cx-embed-case',\n imports: [ComponentMapperComponent],\n providers: [Utils],\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: { class: 'pega-part-of-page cx-embed-case' },\n template: `\n @if (error(); as message) {\n <div class=\"cx-embed-case__error\" role=\"alert\">{{ message }}</div>\n } @else if (pConn(); as pConn$) {\n <component-mapper name=\"RootContainer\" [props]=\"{ pConn$: pConn$, displayOnlyFA$: true }\" />\n } @else {\n <div class=\"cx-embed-case__loading\" aria-busy=\"true\">Loading…</div>\n }\n `\n})\nexport class EmbedCaseComponent implements OnInit, OnDestroy {\n /** Case type class, e.g. ORG-App-Work-MyCase. Falls back to serverConfig.appMashupCaseType when empty. */\n readonly caseType = input<string>('');\n /** Fields to set on the new case (Pega's startingFields). */\n readonly startingFields = input<Record<string, unknown>>({});\n /** Page the mashup renders into. */\n readonly pageName = input<string>('pyEmbedAssignment');\n\n /** The case has been created and the first assignment is rendering. */\n readonly started = output<void>();\n /** The user cancelled the assignment. */\n readonly cancelled = output<void>();\n /** The assignment finished processing. */\n readonly completed = output<void>();\n /** Login, bootstrap or case creation failed. */\n readonly failed = output<unknown>();\n\n protected readonly pConn = signal<PConnectLike | undefined>(undefined);\n protected readonly error = signal<string | undefined>(undefined);\n\n private readonly bootstrap = inject(ConstellationBootstrapService);\n private readonly subscriptionId = `cx-embed-case-${nextId++}`;\n private subscribed = false;\n\n async ngOnInit(): Promise<void> {\n try {\n const rootPConn = await this.bootstrap.start();\n this.subscribeToCaseEvents();\n this.pConn.set(rootPConn);\n await this.createCase();\n this.started.emit();\n } catch (err) {\n console.error('[constellation-angular]', err);\n this.error.set(err instanceof Error ? err.message : 'Could not start the case.');\n this.failed.emit(err);\n }\n }\n\n ngOnDestroy(): void {\n if (!this.subscribed) return;\n const pcore = getPCore();\n const { PUB_SUB_EVENTS } = pcore.getConstants();\n pcore.getPubSubUtils().unsubscribe(PUB_SUB_EVENTS.EVENT_CANCEL, this.subscriptionId);\n pcore.getPubSubUtils().unsubscribe(PUB_SUB_EVENTS.CASE_EVENTS.END_OF_ASSIGNMENT_PROCESSING, this.subscriptionId);\n }\n\n private subscribeToCaseEvents(): void {\n const pcore = getPCore();\n const { PUB_SUB_EVENTS } = pcore.getConstants();\n pcore.getPubSubUtils().subscribe(PUB_SUB_EVENTS.EVENT_CANCEL, () => this.cancelled.emit(), this.subscriptionId);\n pcore\n .getPubSubUtils()\n .subscribe(PUB_SUB_EVENTS.CASE_EVENTS.END_OF_ASSIGNMENT_PROCESSING, () => this.completed.emit(), this.subscriptionId);\n this.subscribed = true;\n }\n\n private async createCase(): Promise<void> {\n const pcore = getPCore();\n const caseType = this.caseType() || this.configuredCaseType();\n if (!caseType) {\n throw new Error('No case type: set the caseType input or serverConfig.appMashupCaseType.');\n }\n await pcore.getMashupApi().createCase(caseType, pcore.getConstants().APP.APP, {\n pageName: this.pageName(),\n startingFields: this.startingFields()\n });\n }\n\n private configuredCaseType(): string | undefined {\n const server = SdkConfigAccess?.getSdkConfigServer() as { appMashupCaseType?: string } | undefined;\n if (server?.appMashupCaseType) return server.appMashupCaseType;\n // Same fallback as the SDK sample: the first case type in the application\n return getPCore().getEnvironmentInfo().environmentInfoObject?.pyCaseTypeList?.[0]?.pyWorkTypeImplementationClassName;\n }\n}\n","/*\n * Public API of @swapnil-srivastava/constellation-angular\n */\nexport * from './lib/types';\nexport * from './lib/provide-constellation';\nexport * from './lib/constellation-bootstrap.service';\nexport * from './lib/embed-case.component';\nexport { initializeAuthentication } from './lib/auth';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;MAsDa,qBAAqB,GAAG,IAAI,cAAc,CAAuB,uBAAuB;;AClDrG;;;;;;;;AAQG;AACG,SAAU,oBAAoB,CAAC,OAAA,GAAgC,EAAE,EAAA;AACrE,IAAA,OAAO,wBAAwB,CAAC;AAC9B,QAAA,EAAE,OAAO,EAAE,qBAAqB,EAAE,QAAQ,EAAE,OAAO,EAAE;QACrD,6BAA6B,CAAC,MAAK;AACjC,YAAA,MAAM,EAAE,SAAS,EAAE,GAAG,OAAO;YAC7B,IAAI,SAAS,EAAE;;gBAEb,0BAA0B,CAAC,YAAY,eAAe,CAAC,SAAS,CAAC,CAAC;YACpE;AACF,QAAA,CAAC;AACF,KAAA,CAAC;AACJ;;ACxBA;AAIA;;;AAGG;AACG,SAAU,wBAAwB,CAAC,aAAmD,EAAA;AAC1F,IAAA,MAAM,aAAa,GAAG,aAAa,CAAC,eAAe,KAAK,MAAM,IAAI,CAAC,aAAa,CAAC,cAAc;IAC/F,MAAM,QAAQ,GAAG,aAAa,CAAC,cAAc,GAAG,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC,cAAc,CAAC,GAAG,EAAE;IAE9F,IAAI,aAAa,IAAI,aAAa,CAAC,cAAc,KAAK,OAAO,EAAE;AAC7D,QAAA,gBAAgB,CAAC,CAAA,MAAA,EAAS,MAAM,CAAC,IAAI,CA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AAA,EAAA,UAAA,EAAA,cAAA,EAAA,QAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;4FAcvB,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBAhB9B,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,eAAe;oBACzB,OAAO,EAAE,CAAC,wBAAwB,CAAC;oBACnC,SAAS,EAAE,CAAC,KAAK,CAAC;oBAClB,eAAe,EAAE,uBAAuB,CAAC,MAAM;AAC/C,oBAAA,IAAI,EAAE,EAAE,KAAK,EAAE,iCAAiC,EAAE;AAClD,oBAAA,QAAQ,EAAE;;;;;;;;AAQT,EAAA;AACF,iBAAA;;;AChCD;;AAEG;;ACFH;;AAEG;;"}
1
+ {"version":3,"file":"swapnil-srivastava-constellation-angular.mjs","sources":["../../src/lib/types.ts","../../src/lib/provide-constellation.ts","../../src/lib/auth.ts","../../src/lib/components/bank-text-input/bank-text-input.component.ts","../../src/lib/components/bank-text-input/bank-text-input.component.html","../../src/lib/component-map.ts","../../src/lib/pcore.ts","../../src/lib/constellation-bootstrap.service.ts","../../src/lib/embed-case.component.ts","../../src/public-api.ts","../../src/swapnil-srivastava-constellation-angular.ts"],"sourcesContent":["import { InjectionToken, Type } from '@angular/core';\n\n/**\n * Shape of sdk-config.json as read by @pega/auth. Only the keys this package\n * touches are typed; everything else passes through unchanged.\n * See https://docs.pega.com/bundle/constellation-sdk/page/constellation-sdks/sdks/configuring-sdk-config-json.html\n */\nexport interface ConstellationSdkConfig {\n theme?: 'light' | 'dark' | string;\n authConfig: {\n authService?: string;\n mashupClientId?: string;\n mashupGrantType?: string;\n mashupUserIdentifier?: string;\n /** Base64 encoded. Only for local testing: anything here is readable in the browser. */\n mashupPassword?: string;\n customAuthType?: string;\n portalClientId?: string;\n [key: string]: unknown;\n };\n serverConfig: {\n infinityRestServerUrl: string;\n appAlias?: string;\n sdkContentServerUrl?: string;\n appMashupCaseType?: string;\n showModalsInEmbeddedMode?: boolean;\n [key: string]: unknown;\n };\n [key: string]: unknown;\n}\n\n/** Map of Constellation component name to an Angular component that renders it. */\nexport type LocalComponentMap = Record<string, Type<unknown>>;\n\nexport interface ConstellationOptions {\n /**\n * Pass the config object directly instead of fetching ./sdk-config.json.\n * Useful when values come from your own backend or environment.\n */\n sdkConfig?: ConstellationSdkConfig;\n /**\n * Custom and override components, merged in front of Pega's component map\n * (same role as sdk-local-component-map.ts in the Angular SDK).\n */\n localComponentMap?: LocalComponentMap;\n /**\n * Map this package's own overrides (see `packageComponentMap`, e.g. the bank-style\n * `TextInput`). Defaults to true. Set false to use only Pega's components and your map.\n */\n useBuiltInOverrides?: boolean;\n /** Root id passed to the bootstrap shell's loadMashup. Defaults to 'app-root'. */\n mashupRootId?: string;\n /**\n * appName passed to loginIfNecessary. Defaults to the current path,\n * which is what the Angular SDK embedded sample does.\n */\n appName?: string;\n}\n\nexport const CONSTELLATION_OPTIONS = new InjectionToken<ConstellationOptions>('CONSTELLATION_OPTIONS');\n","import { EnvironmentProviders, makeEnvironmentProviders, provideEnvironmentInitializer } from '@angular/core';\nimport { setConfigRetrievalOverride } from '@pega/auth/lib/sdk-auth-manager';\nimport { CONSTELLATION_OPTIONS, ConstellationOptions } from './types';\n\n/**\n * Registers Constellation embedding for the app.\n *\n * ```ts\n * bootstrapApplication(AppComponent, {\n * providers: [provideHttpClient(), provideAnimations(), provideConstellation({ localComponentMap })]\n * });\n * ```\n */\nexport function provideConstellation(options: ConstellationOptions = {}): EnvironmentProviders {\n return makeEnvironmentProviders([\n { provide: CONSTELLATION_OPTIONS, useValue: options },\n provideEnvironmentInitializer(() => {\n const { sdkConfig } = options;\n if (sdkConfig) {\n // @pega/auth otherwise fetches ./sdk-config.json\n setConfigRetrievalOverride(async () => structuredClone(sdkConfig));\n }\n })\n ]);\n}\n","// Ported from pegasystems/angular-sdk v26.1.10 src/app/_samples/embedded/utils.ts (Apache-2.0).\nimport { sdkSetAuthHeader, sdkSetCustomTokenParamsCB } from '@pega/auth/lib/sdk-auth-manager';\nimport { ConstellationSdkConfig } from './types';\n\n/**\n * Applies the custom auth modes supported by the Angular SDK embedded sample\n * (Basic, BasicTO, CustomIdentifier). For the normal OAuth flow it does nothing.\n */\nexport function initializeAuthentication(sdkConfigAuth: ConstellationSdkConfig['authConfig']): void {\n const noOAuthClient = sdkConfigAuth.mashupGrantType === 'none' || !sdkConfigAuth.mashupClientId;\n const password = sdkConfigAuth.mashupPassword ? window.atob(sdkConfigAuth.mashupPassword) : '';\n\n if (noOAuthClient && sdkConfigAuth.customAuthType === 'Basic') {\n sdkSetAuthHeader(`Basic ${window.btoa(`${sdkConfigAuth.mashupUserIdentifier}:${password}`)}`);\n }\n\n if (noOAuthClient && sdkConfigAuth.customAuthType === 'BasicTO') {\n const expTime = new Date(Date.now() + 5 * 60 * 1000);\n const isoTime = `${expTime.toISOString().split('.')[0]}Z`.replace(/[-:]/g, '');\n sdkSetAuthHeader(`Basic ${window.btoa(`${sdkConfigAuth.mashupUserIdentifier}:${password}:${isoTime}`)}`);\n }\n\n if (sdkConfigAuth.mashupGrantType === 'customBearer' && sdkConfigAuth.customAuthType === 'CustomIdentifier') {\n // Insecure, demo only (same caveat as Pega's sample)\n sdkSetCustomTokenParamsCB(() => ({ userIdentifier: sdkConfigAuth.mashupUserIdentifier }));\n }\n}\n","import { Component, forwardRef } from '@angular/core';\nimport { ReactiveFormsModule } from '@angular/forms';\nimport {\n ComponentMapperComponent,\n FieldBase,\n FieldWarningDirective,\n handleEvent,\n PConnFieldProps\n} from '@pega/angular-sdk-components';\n\nlet nextId = 0;\n\n/**\n * Override for the SDK's `TextInput`: same store wiring (extends FieldBase, like the\n * SDK's TextInputComponent), with a bank-style look: a square box with a 2px border,\n * the label inside the box above the value, helper and error text under it.\n * Mapped by default through `packageComponentMap`; an app can still replace it.\n */\n@Component({\n selector: 'cx-bank-text-input',\n imports: [ReactiveFormsModule, FieldWarningDirective, forwardRef(() => ComponentMapperComponent)],\n templateUrl: './bank-text-input.component.html',\n styleUrl: './bank-text-input.component.scss'\n})\nexport class BankTextInputComponent extends FieldBase {\n configProps$!: PConnFieldProps;\n\n protected readonly inputId = `cx-bank-text-input-${++nextId}`;\n protected readonly helperId = `${this.inputId}-helper`;\n protected readonly errorId = `${this.inputId}-error`;\n\n override updateSelf(): void {\n this.configProps$ = this.pConn$.resolveConfigProps(this.pConn$.getConfigProps());\n this.updateComponentCommonProperties(this.configProps$);\n const { value } = this.configProps$;\n this.value$ = value;\n // FieldBase sets the control once in ngOnInit; keep it in step with later store\n // updates so the filled state and validation see the value that is shown.\n if (this.fieldControl.value !== (value ?? '')) {\n this.fieldControl.setValue(value ?? '', { emitEvent: false });\n }\n }\n\n /** Errors show once the field was left (or the server flagged it), like the SDK's mat-error. */\n protected get showError(): boolean {\n return this.fieldControl.invalid && this.fieldControl.touched;\n }\n\n protected get describedBy(): string | null {\n const ids = [this.helperText ? this.helperId : '', this.showError ? this.errorId : ''].filter(Boolean);\n return ids.length ? ids.join(' ') : null;\n }\n\n protected get filled(): boolean {\n const value: unknown = this.fieldControl.value;\n return value !== null && value !== undefined && `${value}` !== '';\n }\n\n fieldOnChange(event: Event): void {\n const oldVal = this.value$ ?? '';\n if ((event.target as HTMLInputElement).value.toString() !== oldVal.toString()) {\n this.pConn$.clearErrorMessages({ property: this.propName });\n }\n }\n\n fieldOnBlur(event: Event): void {\n const oldVal = this.value$ ?? '';\n const value = (event.target as HTMLInputElement).value;\n if (value.toString() !== oldVal.toString()) {\n handleEvent(this.actionsApi, 'changeNblur', this.propName, value);\n }\n }\n}\n","@if (displayMode$) {\n @if (bVisible$ !== false) {\n <component-mapper name=\"FieldValueList\" [props]=\"{ label$, value$, displayMode$ }\"></component-mapper>\n }\n} @else if (!bReadonly$ && bHasForm$) {\n @if (bVisible$) {\n <div\n class=\"bank-field\"\n [formGroup]=\"formGroup$\"\n [class.bank-field--filled]=\"filled\"\n [class.bank-field--error]=\"showError\"\n [class.bank-field--warning]=\"bFieldMessageVisible$\"\n [class.bank-field--disabled]=\"bDisabled$\"\n >\n <div class=\"bank-field__box\">\n <label class=\"bank-field__label\" [class.bank-field__label--hidden]=\"hideLabel\" [for]=\"inputId\">\n {{ label$ }}\n @if (bRequired$) {\n <span class=\"bank-field__required\" aria-hidden=\"true\">*</span>\n }\n </label>\n <input\n class=\"bank-field__input\"\n type=\"text\"\n [id]=\"inputId\"\n [placeholder]=\"placeholder\"\n [value]=\"value$\"\n [required]=\"bRequired$\"\n [attr.aria-invalid]=\"showError ? 'true' : null\"\n [attr.aria-describedby]=\"describedBy\"\n [attr.data-test-id]=\"testId\"\n [formControl]=\"fieldControl\"\n (change)=\"fieldOnChange($event)\"\n (blur)=\"fieldOnBlur($event)\"\n />\n </div>\n @if (helperText) {\n <div class=\"bank-field__helper\" [id]=\"helperId\" [appFieldWarning]=\"bFieldMessageVisible$\">{{ helperText }}</div>\n }\n <div class=\"bank-field__error\" [id]=\"errorId\" aria-live=\"polite\">\n @if (showError) {\n {{ getErrorMessage() }}\n }\n </div>\n </div>\n }\n} @else {\n @if (bVisible$ !== false) {\n <component-mapper name=\"Text\" [props]=\"{ pConn$, formatAs$: 'text' }\"></component-mapper>\n }\n}\n","import { BankTextInputComponent } from './components/bank-text-input/bank-text-input.component';\nimport { LocalComponentMap } from './types';\n\n/**\n * Overrides this package ships and maps by default. Keys are Pega's component names.\n * An app's own `localComponentMap` is applied after this one, so it always wins.\n */\nexport const packageComponentMap: LocalComponentMap = {\n TextInput: BankTextInputComponent\n};\n\n/**\n * The map handed to the SDK: the package's overrides first (unless turned off), then the app's.\n */\nexport function buildComponentMap(\n localComponentMap: LocalComponentMap | undefined,\n useBuiltInOverrides = true\n): LocalComponentMap {\n return { ...(useBuiltInOverrides ? packageComponentMap : {}), ...(localComponentMap ?? {}) };\n}\n","/**\n * Minimal view of the window globals that the Constellation bootstrap shell\n * creates. Kept local so this package does not leak @pega/pcore-pconnect-typedefs\n * into its public types.\n */\nexport interface PConnectLike {\n getComponentName(): string;\n [key: string]: unknown;\n}\n\nexport interface PCoreLike {\n onPCoreReady(cb: (renderObj: { props: { getPConnect(): PConnectLike } }) => void | Promise<void>): void;\n registerComponentCreator(cb: (c11nEnv: unknown) => unknown): void;\n getMashupApi(): {\n createCase(caseType: string, context: string, options: { pageName?: string; startingFields?: Record<string, unknown> }): Promise<unknown>;\n };\n getConstants(): {\n APP: { APP: string };\n PUB_SUB_EVENTS: { EVENT_CANCEL: string; CASE_EVENTS: { END_OF_ASSIGNMENT_PROCESSING: string } };\n };\n getEnvironmentInfo(): {\n environmentInfoObject?: { pyCaseTypeList?: { pyWorkTypeImplementationClassName: string }[] };\n };\n getPubSubUtils(): {\n subscribe(event: string, cb: (payload?: unknown) => void, id: string): void;\n unsubscribe(event: string, id: string): void;\n };\n}\n\ntype ConstellationWindow = Window & {\n PCore?: PCoreLike;\n myLoadMashup?: (rootId: string, preLoadComponents: boolean) => void;\n};\n\nexport const constellationWindow = (): ConstellationWindow => window as ConstellationWindow;\n\nexport function getPCore(): PCoreLike {\n const pcore = constellationWindow().PCore;\n if (!pcore) {\n throw new Error('PCore is not loaded yet. Call ConstellationBootstrapService.start() first.');\n }\n return pcore;\n}\n","// Bootstrap sequence ported from pegasystems/angular-sdk v26.1.10\n// src/app/_samples/embedded/embedded.component.ts (Apache-2.0).\nimport { Injectable, inject } from '@angular/core';\nimport { getSdkConfig, loginIfNecessary } from '@pega/auth/lib/sdk-auth-manager';\nimport { compareSdkPCoreVersions, getSdkComponentMap } from '@pega/angular-sdk-components';\nimport { initializeAuthentication } from './auth';\nimport { buildComponentMap } from './component-map';\nimport { constellationWindow, PConnectLike } from './pcore';\nimport { CONSTELLATION_OPTIONS, ConstellationSdkConfig } from './types';\n\n/**\n * Logs in, loads the Constellation bootstrap shell and PCore, and initialises\n * the SDK component map. Runs once per page: PCore and the component map are\n * window-level singletons.\n */\n@Injectable({ providedIn: 'root' })\nexport class ConstellationBootstrapService {\n private readonly options = inject(CONSTELLATION_OPTIONS, { optional: true }) ?? {};\n private ready?: Promise<PConnectLike>;\n\n /** Resolves with the root PConnect once PCore is ready. Safe to call many times. */\n start(): Promise<PConnectLike> {\n this.ready ??= this.boot().catch(err => {\n this.ready = undefined; // allow a retry\n throw err;\n });\n return this.ready;\n }\n\n private async boot(): Promise<PConnectLike> {\n const sdkConfig = (await getSdkConfig()) as ConstellationSdkConfig;\n const { authConfig, theme } = sdkConfig;\n\n document.body.classList.remove('light', 'dark');\n document.body.classList.add(theme || 'light');\n\n initializeAuthentication(authConfig);\n\n // Register before login: @pega/auth fires this once the bootstrap shell has loaded.\n const constellationReady = new Promise<void>(resolve =>\n document.addEventListener('SdkConstellationReady', () => resolve(), { once: true })\n );\n\n const path = window.location.pathname;\n const appName = this.options.appName ?? path.substring(path.indexOf('/') + 1);\n loginIfNecessary({ appName, mainRedirect: false });\n\n await constellationReady;\n\n return new Promise<PConnectLike>((resolve, reject) => {\n const win = constellationWindow();\n win.PCore!.onPCoreReady(async renderObj => {\n try {\n compareSdkPCoreVersions();\n await getSdkComponentMap(buildComponentMap(this.options.localComponentMap, this.options.useBuiltInOverrides ?? true));\n // Required so PConnect.createComponent returns the c11n environment\n win.PCore!.registerComponentCreator(c11nEnv => c11nEnv);\n resolve(renderObj.props.getPConnect());\n } catch (err) {\n reject(err);\n }\n });\n\n if (!win.myLoadMashup) {\n reject(new Error('Bootstrap shell did not define loadMashup. Check that /constellation/bootstrap-shell.js is served.'));\n return;\n }\n win.myLoadMashup(this.options.mashupRootId ?? 'app-root', false);\n });\n }\n}\n","// Case start and RootContainer rendering ported from pegasystems/angular-sdk v26.1.10\n// src/app/_samples/embedded/main-screen/main-screen.component.ts (Apache-2.0).\nimport { ChangeDetectionStrategy, Component, OnDestroy, OnInit, inject, input, output, signal } from '@angular/core';\nimport { ComponentMapperComponent, Utils } from '@pega/angular-sdk-components';\nimport { SdkConfigAccess } from '@pega/auth/lib/sdk-auth-manager';\nimport { ConstellationBootstrapService } from './constellation-bootstrap.service';\nimport { getPCore, PConnectLike } from './pcore';\n\nlet nextId = 0;\n\n/**\n * Starts a Constellation case and renders it in place.\n *\n * ```html\n * <cx-embed-case caseType=\"ORG-App-Work-MyCase\" (completed)=\"done()\" />\n * ```\n */\n@Component({\n selector: 'cx-embed-case',\n imports: [ComponentMapperComponent],\n providers: [Utils],\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: { class: 'pega-part-of-page cx-embed-case' },\n template: `\n @if (error(); as message) {\n <div class=\"cx-embed-case__error\" role=\"alert\">{{ message }}</div>\n } @else if (pConn(); as pConn$) {\n <component-mapper name=\"RootContainer\" [props]=\"{ pConn$: pConn$, displayOnlyFA$: true }\" />\n } @else {\n <div class=\"cx-embed-case__loading\" aria-busy=\"true\">Loading…</div>\n }\n `\n})\nexport class EmbedCaseComponent implements OnInit, OnDestroy {\n /** Case type class, e.g. ORG-App-Work-MyCase. Falls back to serverConfig.appMashupCaseType when empty. */\n readonly caseType = input<string>('');\n /** Fields to set on the new case (Pega's startingFields). */\n readonly startingFields = input<Record<string, unknown>>({});\n /** Page the mashup renders into. */\n readonly pageName = input<string>('pyEmbedAssignment');\n\n /** The case has been created and the first assignment is rendering. */\n readonly started = output<void>();\n /** The user cancelled the assignment. */\n readonly cancelled = output<void>();\n /** The assignment finished processing. */\n readonly completed = output<void>();\n /** Login, bootstrap or case creation failed. */\n readonly failed = output<unknown>();\n\n protected readonly pConn = signal<PConnectLike | undefined>(undefined);\n protected readonly error = signal<string | undefined>(undefined);\n\n private readonly bootstrap = inject(ConstellationBootstrapService);\n private readonly subscriptionId = `cx-embed-case-${nextId++}`;\n private subscribed = false;\n\n async ngOnInit(): Promise<void> {\n try {\n const rootPConn = await this.bootstrap.start();\n this.subscribeToCaseEvents();\n this.pConn.set(rootPConn);\n await this.createCase();\n this.started.emit();\n } catch (err) {\n console.error('[constellation-angular]', err);\n this.error.set(err instanceof Error ? err.message : 'Could not start the case.');\n this.failed.emit(err);\n }\n }\n\n ngOnDestroy(): void {\n if (!this.subscribed) return;\n const pcore = getPCore();\n const { PUB_SUB_EVENTS } = pcore.getConstants();\n pcore.getPubSubUtils().unsubscribe(PUB_SUB_EVENTS.EVENT_CANCEL, this.subscriptionId);\n pcore.getPubSubUtils().unsubscribe(PUB_SUB_EVENTS.CASE_EVENTS.END_OF_ASSIGNMENT_PROCESSING, this.subscriptionId);\n }\n\n private subscribeToCaseEvents(): void {\n const pcore = getPCore();\n const { PUB_SUB_EVENTS } = pcore.getConstants();\n pcore.getPubSubUtils().subscribe(PUB_SUB_EVENTS.EVENT_CANCEL, () => this.cancelled.emit(), this.subscriptionId);\n pcore\n .getPubSubUtils()\n .subscribe(PUB_SUB_EVENTS.CASE_EVENTS.END_OF_ASSIGNMENT_PROCESSING, () => this.completed.emit(), this.subscriptionId);\n this.subscribed = true;\n }\n\n private async createCase(): Promise<void> {\n const pcore = getPCore();\n const caseType = this.caseType() || this.configuredCaseType();\n if (!caseType) {\n throw new Error('No case type: set the caseType input or serverConfig.appMashupCaseType.');\n }\n await pcore.getMashupApi().createCase(caseType, pcore.getConstants().APP.APP, {\n pageName: this.pageName(),\n startingFields: this.startingFields()\n });\n }\n\n private configuredCaseType(): string | undefined {\n const server = SdkConfigAccess?.getSdkConfigServer() as { appMashupCaseType?: string } | undefined;\n if (server?.appMashupCaseType) return server.appMashupCaseType;\n // Same fallback as the SDK sample: the first case type in the application\n return getPCore().getEnvironmentInfo().environmentInfoObject?.pyCaseTypeList?.[0]?.pyWorkTypeImplementationClassName;\n }\n}\n","/*\n * Public API of @swapnil-srivastava/constellation-angular\n */\nexport * from './lib/types';\nexport * from './lib/provide-constellation';\nexport * from './lib/constellation-bootstrap.service';\nexport * from './lib/embed-case.component';\nexport * from './lib/component-map';\nexport * from './lib/components/bank-text-input/bank-text-input.component';\nexport { initializeAuthentication } from './lib/auth';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["nextId"],"mappings":";;;;;;;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QAAA,EAAA,EAAA,IAAA,EAAA,EAAA,cAAA,EAAA,iCAAA,EAAA,EAAA,SAAA,EAblB,CAAC,KAAK,CAAC,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EAGR;;;;;;;;AAQT,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAZS,wBAAwB,EAAA,QAAA,EAAA,kBAAA,EAAA,MAAA,EAAA,CAAA,MAAA,EAAA,OAAA,EAAA,UAAA,EAAA,cAAA,EAAA,QAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;4FAcvB,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBAhB9B,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,eAAe;oBACzB,OAAO,EAAE,CAAC,wBAAwB,CAAC;oBACnC,SAAS,EAAE,CAAC,KAAK,CAAC;oBAClB,eAAe,EAAE,uBAAuB,CAAC,MAAM;AAC/C,oBAAA,IAAI,EAAE,EAAE,KAAK,EAAE,iCAAiC,EAAE;AAClD,oBAAA,QAAQ,EAAE;;;;;;;;AAQT,EAAA;AACF,iBAAA;;;AChCD;;AAEG;;ACFH;;AAEG;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@swapnil-srivastava/constellation-angular",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "description": "Embed a Pega Constellation case (create case, RootContainer, flow, assignment) in any Angular app, built on @pega/angular-sdk-components.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -22,6 +22,7 @@
22
22
  "peerDependencies": {
23
23
  "@angular/common": "^21.2.4",
24
24
  "@angular/core": "^21.2.4",
25
+ "@angular/forms": "^21.2.4",
25
26
  "@angular/material": "^21.2.2",
26
27
  "@pega/angular-sdk-components": "~26.1.10",
27
28
  "@pega/auth": "^1.0.0"
@@ -1,5 +1,6 @@
1
1
  import * as _angular_core from '@angular/core';
2
2
  import { InjectionToken, Type, EnvironmentProviders, OnInit, OnDestroy } from '@angular/core';
3
+ import { FieldBase, PConnFieldProps } from '@pega/angular-sdk-components';
3
4
 
4
5
  /**
5
6
  * Shape of sdk-config.json as read by @pega/auth. Only the keys this package
@@ -42,6 +43,11 @@ interface ConstellationOptions {
42
43
  * (same role as sdk-local-component-map.ts in the Angular SDK).
43
44
  */
44
45
  localComponentMap?: LocalComponentMap;
46
+ /**
47
+ * Map this package's own overrides (see `packageComponentMap`, e.g. the bank-style
48
+ * `TextInput`). Defaults to true. Set false to use only Pega's components and your map.
49
+ */
50
+ useBuiltInOverrides?: boolean;
45
51
  /** Root id passed to the bootstrap shell's loadMashup. Defaults to 'app-root'. */
46
52
  mashupRootId?: string;
47
53
  /**
@@ -124,11 +130,43 @@ declare class EmbedCaseComponent implements OnInit, OnDestroy {
124
130
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<EmbedCaseComponent, "cx-embed-case", never, { "caseType": { "alias": "caseType"; "required": false; "isSignal": true; }; "startingFields": { "alias": "startingFields"; "required": false; "isSignal": true; }; "pageName": { "alias": "pageName"; "required": false; "isSignal": true; }; }, { "started": "started"; "cancelled": "cancelled"; "completed": "completed"; "failed": "failed"; }, never, never, true, never>;
125
131
  }
126
132
 
133
+ /**
134
+ * Overrides this package ships and maps by default. Keys are Pega's component names.
135
+ * An app's own `localComponentMap` is applied after this one, so it always wins.
136
+ */
137
+ declare const packageComponentMap: LocalComponentMap;
138
+ /**
139
+ * The map handed to the SDK: the package's overrides first (unless turned off), then the app's.
140
+ */
141
+ declare function buildComponentMap(localComponentMap: LocalComponentMap | undefined, useBuiltInOverrides?: boolean): LocalComponentMap;
142
+
143
+ /**
144
+ * Override for the SDK's `TextInput`: same store wiring (extends FieldBase, like the
145
+ * SDK's TextInputComponent), with a bank-style look: a square box with a 2px border,
146
+ * the label inside the box above the value, helper and error text under it.
147
+ * Mapped by default through `packageComponentMap`; an app can still replace it.
148
+ */
149
+ declare class BankTextInputComponent extends FieldBase {
150
+ configProps$: PConnFieldProps;
151
+ protected readonly inputId: string;
152
+ protected readonly helperId: string;
153
+ protected readonly errorId: string;
154
+ updateSelf(): void;
155
+ /** Errors show once the field was left (or the server flagged it), like the SDK's mat-error. */
156
+ protected get showError(): boolean;
157
+ protected get describedBy(): string | null;
158
+ protected get filled(): boolean;
159
+ fieldOnChange(event: Event): void;
160
+ fieldOnBlur(event: Event): void;
161
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<BankTextInputComponent, never>;
162
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<BankTextInputComponent, "cx-bank-text-input", never, {}, {}, never, never, true, never>;
163
+ }
164
+
127
165
  /**
128
166
  * Applies the custom auth modes supported by the Angular SDK embedded sample
129
167
  * (Basic, BasicTO, CustomIdentifier). For the normal OAuth flow it does nothing.
130
168
  */
131
169
  declare function initializeAuthentication(sdkConfigAuth: ConstellationSdkConfig['authConfig']): void;
132
170
 
133
- export { CONSTELLATION_OPTIONS, ConstellationBootstrapService, EmbedCaseComponent, initializeAuthentication, provideConstellation };
171
+ export { BankTextInputComponent, CONSTELLATION_OPTIONS, ConstellationBootstrapService, EmbedCaseComponent, buildComponentMap, initializeAuthentication, packageComponentMap, provideConstellation };
134
172
  export type { ConstellationOptions, ConstellationSdkConfig, LocalComponentMap };