@blackbaud/skyux-lib-addin-client 14.1.0 → 15.0.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":"blackbaud-skyux-lib-addin-client.mjs","sources":["../../../projects/addin-client/src/src/addin-client-config.service.ts","../../../projects/addin-client/src/src/events/addin-event.ts","../../../projects/addin-client/src/src/events/addin-event-handler-instance.ts","../../../projects/addin-client/src/src/addin-client.service.ts","../../../projects/addin-client/src/src/help-service/addin-client-help.service.ts","../../../projects/addin-client/src/blackbaud-skyux-lib-addin-client.ts"],"sourcesContent":["import { AddinClientConfig } from \"@blackbaud/sky-addin-client\";\n\n/**\n * Implement this class with your own data to initialize the add-in client service. \n */ \nexport abstract class AddinClientConfigService {\n /**\n * Gets the AddinClientConfig object that will be injected the\n * AddinClient instance when instantiated.\n */\n public getAddinClientConfig(): AddinClientConfig {\n return {};\n }\n}\n","/**\n * Contains data for an add-in event and allows you to indicate that an event\n * has been processed\n */\nexport class AddinEvent {\n\n /**\n * The data that an add-in event has returned.\n */\n public context: any;\n\n /**\n * A function to call indicating that the add-in event is processed.\n * Returning any necessary data back to the host.\n */\n public done?: (data?: any) => void;\n}\n","import {\n EventEmitter\n} from '@angular/core';\n\nimport {\n AddinEvent\n} from './addin-event';\n\n/**\n * Allows you to process events from an event handler.\n */\nexport class AddinEventHandlerInstance {\n\n /**\n * An event that emits when a new add-in event has occurred.\n */\n public addinEvent: EventEmitter<AddinEvent>;\n}\n","import {\n EventEmitter,\n Injectable,\n RendererFactory2,\n inject\n} from '@angular/core';\nimport {\n AddinClient,\n AddinClientCloseModalArgs,\n AddinClientEventArgs,\n AddinClientInitArgs,\n AddinClientNavigateArgs,\n AddinClientOpenHelpArgs,\n AddinClientShowConfirmArgs,\n AddinClientShowErrorArgs,\n AddinClientShowFlyoutArgs,\n AddinClientShowFlyoutResult,\n AddinClientShowModalArgs,\n AddinClientShowModalResult,\n AddinClientShowToastArgs,\n AddinClientThemeSettings,\n AddinEventCallback\n} from '@blackbaud/sky-addin-client';\nimport {\n SkyAppConfig, SkyuxConfigAppSupportedTheme\n} from '@skyux/config';\nimport {\n SkyTheme,\n SkyThemeMode,\n SkyThemeService,\n SkyThemeSettings\n} from '@skyux/theme';\nimport {\n AsyncSubject,\n Observable,\n from\n} from 'rxjs';\nimport { AddinClientConfigService } from './addin-client-config.service';\nimport {\n AddinEvent,\n AddinEventHandlerInstance\n} from './events';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class AddinClientService {\n public readonly addinClient: AddinClient;\n\n // Init args\n private _args: AsyncSubject<AddinClientInitArgs> = new AsyncSubject<AddinClientInitArgs>();\n public args: Observable<AddinClientInitArgs> = this._args.asObservable();\n\n // Addin Client Events\n /**\n * Event emitted for box add-ins indicating that a control action button was clicked.\n */\n public actionClick: EventEmitter<string> = new EventEmitter(true);\n\n /**\n * Event emitted for button add-ins indicating that the button was clicked.\n */\n public buttonClick: EventEmitter<any> = new EventEmitter(true);\n\n /**\n * Event emitted for add-ins when context information has been updated\n */\n public updateContext: EventEmitter<any> = new EventEmitter();\n\n /**\n * Event emitted for flyout add-ins indicating that the next button was clicked.\n */\n public flyoutNextClick: EventEmitter<any> = new EventEmitter(true);\n\n /**\n * Event emitted for flyout add-ins indicating that the previous button was clicked.\n */\n public flyoutPreviousClick: EventEmitter<any> = new EventEmitter(true);\n\n /**\n * Event emitted for tile add-ins indicating that the help button was clicked.\n * @deprecated Use tile inline help instead and handle the {@link inlineHelpClick} emitter.\n */\n public helpClick: EventEmitter<any> = new EventEmitter(true);\n\n /**\n * Event emitted indicating that the inline help button was clicked.\n */\n public inlineHelpClick: EventEmitter<any> = new EventEmitter(true);\n\n /**\n * Event emitted for tile add-ins indicating that the settings button was clicked.\n */\n public settingsClick: EventEmitter<any> = new EventEmitter(true);\n\n #config = inject(SkyAppConfig, { optional: true });\n #rendererFactory = inject(RendererFactory2);\n #themeService = inject(SkyThemeService);\n #addinClientConfigService = inject(AddinClientConfigService, { optional: true });\n\n constructor() {\n this.addinClient = new AddinClient({\n callbacks: {\n init: (args: AddinClientInitArgs) => {\n this.initializeTheme(args?.themeSettings);\n\n this._args.next(args);\n this._args.complete();\n },\n actionClick: (action: string) => {\n this.actionClick.emit(action);\n },\n buttonClick: () => {\n this.buttonClick.emit();\n },\n flyoutNextClick: () => {\n this.flyoutNextClick.emit();\n },\n flyoutPreviousClick: () => {\n this.flyoutPreviousClick.emit();\n },\n helpClick: () => {\n this.helpClick.emit();\n },\n inlineHelpClick: () => {\n this.inlineHelpClick.emit();\n },\n settingsClick: () => {\n this.settingsClick.emit();\n },\n updateContext: (context: any) => {\n this.updateContext.emit(context);\n },\n themeChange: (settings: AddinClientThemeSettings) => {\n this.setTheme(settings);\n }\n },\n config: this.#addinClientConfigService?.getAddinClientConfig()\n });\n }\n\n /**\n * Informs the host to close this modal add-in.\n * Should only be used from within the modal add-in and not the parent add-in.\n * @param args Arguments to provide a context object back to the parent add-in.\n */\n public closeModal(args: AddinClientCloseModalArgs): void {\n this.addinClient.closeModal(args);\n }\n\n /**\n * Requests the host page to launch a modal add-in.\n * @param args Arguments for launching the modal.\n * @returns Returns an observable that will publish a value when the modal add-in is closed.\n * Observables will publish values with context data passed from the modal add-in's closeModal call.\n */\n public showModal(args: AddinClientShowModalArgs): Observable<any> {\n let modalReturn: AddinClientShowModalResult = this.addinClient.showModal(args);\n return from(modalReturn.modalClosed);\n }\n\n /**\n * Cleans up the AddinClient, releasing all resources.\n */\n public destroy(): void {\n this.addinClient.destroy();\n }\n\n /**\n * Requests the host page to navigate.\n * @param args Arguments describing the navigation request.\n */\n public navigate(args: AddinClientNavigateArgs): void {\n this.addinClient.navigate(args);\n }\n\n /**\n * Informs the host to open the help tab with the specified help key.\n * @param args Arguments for launching the help tab.\n */\n public openHelp(args: AddinClientOpenHelpArgs): void {\n this.addinClient.openHelp(args);\n }\n\n /**\n * Requests a user identity token for the current user.\n * @returns Returns an observable which will publish the token value.\n */\n public getUserIdentityToken(): Observable<string> {\n return from(this.addinClient.getUserIdentityToken());\n }\n\n /**\n * @deprecated Use getUserIdentityToken\n */\n public getAuthToken(): Observable<string> {\n return from(this.addinClient.getUserIdentityToken());\n }\n\n /**\n * Informs the host to show a toast message.\n * @param args Arguments for showing a toast.\n */\n public showToast(args: AddinClientShowToastArgs): void {\n this.addinClient.showToast(args);\n }\n\n /**\n * Requests the host page to launch a flyout add-in.\n * @param args Arguments for launching the flyout.\n * @returns Returns an observable that will notify when the flyout add-in is closed.\n */\n public showFlyout(args: AddinClientShowFlyoutArgs): Observable<void> {\n const flyoutReturn: AddinClientShowFlyoutResult = this.addinClient.showFlyout(args);\n return from(flyoutReturn.flyoutClosed);\n }\n\n /**\n * Requests the host page to close the flyout add-in.\n */\n public closeFlyout(): void {\n this.addinClient.closeFlyout();\n }\n\n /**\n * Requests the host page to show a confirm dialog.\n * @param args Arguments for showing a confirm dialog.\n * @returns Returns an observable which will publish the confirm action value.\n */\n public showConfirm(args: AddinClientShowConfirmArgs): Observable<string> {\n return from(this.addinClient.showConfirm(args));\n }\n\n /**\n * Informs the host to show an error dialog.\n * @param args Arguments for showing an error dialog.\n */\n public showError(args: AddinClientShowErrorArgs): void {\n this.addinClient.showError(args);\n }\n\n /**\n * Requests the host page to show a page blocking wait indicator.\n */\n public showWait(): void {\n this.addinClient.showWait();\n }\n\n /**\n * Requests the host page to hide a page blocking wait indicator.\n */\n public hideWait(): void {\n this.addinClient.hideWait();\n }\n\n /**\n * Registers an event handler for the provided event type.\n * @param eventType The event type to register.\n * @returns AddinEventHandlerInstance\n */\n public addEventHandler(eventType: string): AddinEventHandlerInstance {\n let eventHandlerInstance = new AddinEventHandlerInstance();\n eventHandlerInstance.addinEvent = new EventEmitter<AddinEvent>();\n\n const eventCallback: AddinEventCallback = (context, done) => {\n eventHandlerInstance.addinEvent.emit({\n context,\n done\n });\n };\n this.addinClient.addEventHandler(eventType, eventCallback);\n\n return eventHandlerInstance;\n }\n\n /**\n * Sends an event to be handled by the host page.\n * @param args The event arguments to be sent to the host page.\n * @returns Returns an observable which will complete when the add-in host page receives the\n * message. The request will fail if a subsequent event occurs, for the same event type, within\n * 200 milliseconds. A failure can also occur if an event type is not one of the supported types\n * from the host page.\n * @see AddinClientInitArgs#supportedEventTypes\n */\n public sendEvent(args: AddinClientEventArgs): Observable<void> {\n return from(this.addinClient.sendEvent(args));\n }\n\n private initializeTheme(themeSettings: AddinClientThemeSettings): void {\n if (!themeSettings) {\n return;\n }\n\n const hostThemeSettings = AddinClientService.toSkyThemeSettings(themeSettings);\n\n if (!this.#config) {\n // no app config, initialize host theme\n this.initializeTheme_(hostThemeSettings);\n return;\n }\n\n const themingConfig = this.#config.skyux.app?.theming;\n\n if (\n themingConfig?.supportedThemes &&\n themingConfig.supportedThemes.indexOf(themeSettings.theme as SkyuxConfigAppSupportedTheme) !== -1\n ) {\n // app supports host theme, initialize host theme\n this.initializeTheme_(hostThemeSettings);\n return;\n }\n\n // app does not support host theme, do nothing to initialize the app's default theme\n }\n\n private initializeTheme_(themeSettings: SkyThemeSettings): void {\n this.#themeService.init(\n document.body,\n this.#rendererFactory.createRenderer(undefined, undefined),\n themeSettings\n );\n }\n\n private setTheme(settings: AddinClientThemeSettings): void {\n if (!settings) {\n return;\n }\n\n const hostThemeSettings = AddinClientService.toSkyThemeSettings(settings);\n\n this.#themeService.setTheme(hostThemeSettings);\n }\n\n private static toSkyThemeSettings(settings: AddinClientThemeSettings): SkyThemeSettings {\n if (settings.skyThemeSettings) {\n // If the settings contain a serialized SkyThemeSettings object, deserialize it.\n return SkyThemeSettings.deserialize(settings.skyThemeSettings);\n }\n\n return new SkyThemeSettings(\n AddinClientService.toSkyTheme(settings.theme),\n AddinClientService.toSkyThemeMode(settings.mode)\n );\n }\n\n private static toSkyTheme(theme: string): SkyTheme {\n switch (theme) {\n case 'modern':\n return SkyTheme.presets.modern;\n default:\n return SkyTheme.presets.default;\n }\n }\n\n private static toSkyThemeMode(mode: string): SkyThemeMode {\n switch (mode) {\n case 'dark':\n return SkyThemeMode.presets.dark;\n default:\n return SkyThemeMode.presets.light;\n }\n }\n}\n","import { inject, Injectable, Provider } from '@angular/core';\nimport { SkyHelpOpenArgs, SkyHelpService } from '@skyux/core';\nimport { AddinClientService } from '../addin-client.service';\n\n@Injectable({ providedIn: 'root' })\nexport class AddinClientHelpService extends SkyHelpService {\n private skyAddinClientService = inject(AddinClientService);\n\n /** @inheritdoc */\n public override openHelp(args?: SkyHelpOpenArgs): void {\n if (!args) {\n return;\n }\n\n this.skyAddinClientService.openHelp(args);\n }\n\n /** @inheritdoc */\n public override updateHelp(): void {\n throw new Error('Not implemented');\n }\n}\n\n/** Provide addin client help service */\nexport function provideAddinClientHelp(): Provider[] {\n return [{ provide: SkyHelpService, useClass: AddinClientHelpService }];\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;AAEA;;AAEG;MACmB,wBAAwB,CAAA;AAC5C;;;AAGG;IACI,oBAAoB,GAAA;AACzB,QAAA,OAAO,EAAE;IACX;AACD;;ACbD;;;AAGG;MACU,UAAU,CAAA;AAYtB;;ACRD;;AAEG;MACU,yBAAyB,CAAA;AAMrC;;MC6BY,kBAAkB,CAAA;AAiD7B,IAAA,OAAO;AACP,IAAA,gBAAgB;AAChB,IAAA,aAAa;AACb,IAAA,yBAAyB;AAEzB,IAAA,WAAA,GAAA;;AAlDQ,QAAA,IAAA,CAAA,KAAK,GAAsC,IAAI,YAAY,EAAuB;AACnF,QAAA,IAAA,CAAA,IAAI,GAAoC,IAAI,CAAC,KAAK,CAAC,YAAY,EAAE;;AAGxE;;AAEG;AACI,QAAA,IAAA,CAAA,WAAW,GAAyB,IAAI,YAAY,CAAC,IAAI,CAAC;AAEjE;;AAEG;AACI,QAAA,IAAA,CAAA,WAAW,GAAsB,IAAI,YAAY,CAAC,IAAI,CAAC;AAE9D;;AAEG;AACI,QAAA,IAAA,CAAA,aAAa,G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,EAAA,IAAA,EAAA,kBAAkB,cAFjB,MAAM,EAAA,CAAA,CAAA;;2FAEP,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBAH9B,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE;AACb,iBAAA;;;ACxCK,MAAO,sBAAuB,SAAQ,cAAc,CAAA;AAD1D,IAAA,WAAA,GAAA;;AAEU,QAAA,IAAA,CAAA,qBAAqB,GAAG,MAAM,CAAC,kBAAkB,CAAC;AAe3D,IAAA;;AAZiB,IAAA,QAAQ,CAAC,IAAsB,EAAA;QAC7C,IAAI,CAAC,IAAI,EAAE;YACT;QACF;AAEA,QAAA,IAAI,CAAC,qBAAqB,CAAC,QAAQ,CAAC,IAAI,CAAC;IAC3C;;IAGgB,UAAU,GAAA;AACxB,QAAA,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC;IACpC;8GAfW,sBAAsB,EAAA,IAAA,EAAA,IAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAtB,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,sBAAsB,cADT,MAAM,EAAA,CAAA,CAAA;;2FACnB,sBAAsB,EAAA,UAAA,EAAA,CAAA;kBADlC,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;AAmBlC;SACgB,sBAAsB,GAAA;IACpC,OAAO,CAAC,EAAE,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,sBAAsB,EAAE,CAAC;AACxE;;AC1BA;;AAEG;;"}
1
+ {"version":3,"file":"blackbaud-skyux-lib-addin-client.mjs","names":[],"sources":["../../../projects/addin-client/src/src/addin-client-config.service.ts","../../../projects/addin-client/src/src/events/addin-event.ts","../../../projects/addin-client/src/src/events/addin-event-handler-instance.ts","../../../projects/addin-client/src/src/hosted-surface-resolver.ts","../../../projects/addin-client/src/src/hosted-surface-style-controller.ts","../../../projects/addin-client/src/src/addin-client.service.ts","../../../projects/addin-client/src/src/help-service/addin-client-help.service.ts"],"sourcesContent":["import {\n AddinClientConfig,\n AddinClientReadyArgs,\n AddinType\n} from \"@blackbaud/sky-addin-client\";\n\n/**\n * How the add-in client styles the add-in document for its hosted surface.\n * - `'automatic'`: adapts the document background to the hosted surface.\n * - `'preserve'`: leaves the add-in's own background styling unchanged.\n * - `'container'`: uses the SKY UX container background, whatever the hosted surface.\n */\nexport type AddinClientHostedSurfaceMode = 'automatic' | 'preserve' | 'container';\n\n/**\n * What the add-in client knows about the hosted surface when it asks for the\n * hosted surface mode.\n */\nexport interface AddinClientHostedSurfaceContext {\n /**\n * The add-in type the host reported, or `undefined` when the host doesn't report one\n * or reports a type this client doesn't recognize.\n */\n readonly addinType: AddinType | undefined;\n\n /**\n * The arguments the add-in passed to `ready()`.\n */\n readonly readyArgs: AddinClientReadyArgs;\n}\n\n/**\n * Implement this class with your own data to initialize the add-in client service.\n */\nexport abstract class AddinClientConfigService {\n /**\n * Gets the AddinClientConfig object that will be injected the\n * AddinClient instance when instantiated.\n */\n public getAddinClientConfig(): AddinClientConfig {\n return {};\n }\n\n /**\n * Gets how the add-in client styles the add-in document for its hosted surface. The\n * client asks on every `ready()` call, so an add-in can choose per add-in type, per\n * route, or per `ready()` call. Return `'preserve'` to keep the add-in's own background\n * styling, or `'container'` to use the SKY UX container background.\n * @param context The hosted surface the add-in is being made ready for.\n */\n public getHostedSurfaceMode(\n context: AddinClientHostedSurfaceContext\n ): AddinClientHostedSurfaceMode {\n return 'automatic';\n }\n}\n","/**\n * Contains data for an add-in event and allows you to indicate that an event\n * has been processed\n */\nexport class AddinEvent {\n\n /**\n * The data that an add-in event has returned.\n */\n public context: any;\n\n /**\n * A function to call indicating that the add-in event is processed.\n * Returning any necessary data back to the host.\n */\n public done?: (data?: any) => void;\n}\n","import {\n EventEmitter\n} from '@angular/core';\n\nimport {\n AddinEvent\n} from './addin-event';\n\n/**\n * Allows you to process events from an event handler.\n */\nexport class AddinEventHandlerInstance {\n\n /**\n * An event that emits when a new add-in event has occurred.\n */\n public addinEvent = new EventEmitter<AddinEvent>();\n}\n","import {\n AddinClientReadyArgs,\n AddinModalStyle,\n AddinType,\n} from '@blackbaud/sky-addin-client';\n\nimport { AddinClientHostedSurfaceMode } from './addin-client-config.service';\n\nexport type HostedSurfaceTreatment =\n 'container' | 'full-page' | 'modal' | 'preserve';\n\nexport type HostedSurfaceBackdrop = 'normal' | 'preserve' | 'transparent';\n\nexport interface HostedSurfaceModalState {\n readonly fullPageModalOpen: boolean;\n readonly modalDepth: number;\n readonly modalOpen: boolean;\n}\n\nexport interface HostedSurfaceResolverInput {\n /**\n * The add-in type reported by the host. The vanilla client passes `undefined` both for\n * an older host that omits the type and for a type it doesn't recognize, so either host\n * is resolved as an older host.\n */\n readonly addinType: AddinType | undefined;\n readonly modalState: HostedSurfaceModalState;\n /**\n * The mode the add-in requested. `'preserve'` and `'container'` replace the resolved\n * treatment; `'automatic'` or `undefined` resolves one.\n */\n readonly mode?: AddinClientHostedSurfaceMode;\n readonly readyArgs: AddinClientReadyArgs;\n}\n\nexport interface HostedSurfaceResolution {\n readonly backdrop: HostedSurfaceBackdrop;\n /**\n * Modal style to send to the vanilla client's `ready()`. Set only when the treatment\n * can't change after `ready()`: the vanilla client applies it as inline `!important`\n * declarations that the controller can't undo when live modal state changes.\n */\n readonly inferredModalStyle?: AddinModalStyle;\n /**\n * Whether the controller may override a historical consumer's `display:none` backdrop\n * styling. This is a distinct policy axis from `backdrop` (which governs color/opacity):\n * automatic modal treatment is currently the only path that owns display, but display\n * ownership and backdrop color ownership are independent and may diverge for future\n * treatments.\n */\n readonly restoreBackdropDisplay: boolean;\n readonly treatment: HostedSurfaceTreatment;\n}\n\n/**\n * Modal depth at which a legacy/older host's backdrop is treated as opaque (\"normal\")\n * rather than transparent, since a nested modal stacked atop another modal already has\n * an intervening backdrop providing contrast.\n */\nconst NESTED_MODAL_BACKDROP_DEPTH = 2;\n\nfunction resolveModalBackdrop(\n modalDepth: number,\n forceNormal: boolean,\n): HostedSurfaceBackdrop {\n return forceNormal || modalDepth >= NESTED_MODAL_BACKDROP_DEPTH\n ? 'normal'\n : 'transparent';\n}\n\n/**\n * Canonical treatment for every `AddinType`, whether a compatible host reports it or it is\n * inferred from `ready()`. `'modal'` is resolved separately because it also depends on\n * `fullPage`, modal depth, and whether the host reports types. Declaring this as\n * `Readonly<Record<AddinType, ...>>` forces any future `AddinType` addition to be given an\n * explicit mapping at compile time.\n *\n * SKY UX boxes, tiles, and flyouts give their content the container background, so add-ins\n * in them get it too. SKY UX tabs don't, so tab content shows whatever is behind the tabset,\n * usually the page, and a tab add-in keeps its own page background. A host reports `generic`\n * for an add-in it embeds without a more specific type, typically as part of a page, so a\n * generic add-in keeps its own background too.\n */\nconst CANONICAL_ADDIN_TYPE_TREATMENT: Readonly<\n Record<AddinType, HostedSurfaceTreatment>\n> = {\n 'action-button': 'preserve',\n box: 'container',\n button: 'preserve',\n dataset: 'preserve',\n flyout: 'container',\n generic: 'preserve',\n modal: 'modal',\n page: 'preserve',\n tab: 'preserve',\n tile: 'container',\n 'vertical-tab-form': 'container',\n};\n\n/**\n * The `ready()` configuration fields that identify an add-in type when the host does not\n * report one, in precedence order. An inferred type is resolved exactly like a reported\n * one, so the two paths cannot drift apart.\n */\nconst READY_ARGS_ADDIN_TYPES: ReadonlyArray<\n readonly [keyof AddinClientReadyArgs, AddinType]\n> = [\n ['modalConfig', 'modal'],\n ['boxConfig', 'box'],\n ['tabConfig', 'tab'],\n ['tileConfig', 'tile'],\n ['buttonConfig', 'button'],\n ['actionButtonConfig', 'action-button'],\n];\n\n/**\n * The resolution for an add-in that neither the host nor `ready()` identifies. Only an\n * older host leaves an add-in unidentified, and the tiles and flyouts such a host can't\n * identify need the container background.\n */\nconst UNIDENTIFIED_RESOLUTION: HostedSurfaceResolution = {\n backdrop: 'preserve',\n restoreBackdropDisplay: false,\n treatment: 'container',\n};\n\nconst FULL_PAGE_RESOLUTION: HostedSurfaceResolution = {\n backdrop: 'preserve',\n restoreBackdropDisplay: false,\n treatment: 'full-page',\n};\n\nfunction inferAddinType(\n readyArgs: AddinClientReadyArgs,\n): AddinType | undefined {\n return READY_ARGS_ADDIN_TYPES.find(\n ([field]) => readyArgs[field] !== undefined,\n )?.[1];\n}\n\n/**\n * Resolves the treatment for an add-in type, whether the host reported it or it was\n * inferred from `ready()`. Only modal treatment depends on whether the host reports types,\n * because only such a host honors `hostOverlay`.\n */\nfunction resolveAddinType(\n addinType: AddinType,\n readyArgs: AddinClientReadyArgs,\n modalDepth: number,\n hostReportsType: boolean,\n): HostedSurfaceResolution {\n if (addinType === 'modal') {\n return readyArgs.modalConfig?.fullPage === true\n ? FULL_PAGE_RESOLUTION\n : modalResolution(hostReportsType, modalDepth);\n }\n\n return {\n backdrop: 'preserve',\n restoreBackdropDisplay: false,\n treatment: CANONICAL_ADDIN_TYPE_TREATMENT[addinType],\n };\n}\n\nfunction modalResolution(\n compatibleHost: boolean,\n modalDepth: number,\n): HostedSurfaceResolution {\n return {\n backdrop: resolveModalBackdrop(modalDepth, compatibleHost),\n inferredModalStyle: compatibleHost\n ? {\n hostOverlay: false,\n transparentBackground: true,\n }\n : { transparentBackground: true },\n restoreBackdropDisplay: true,\n treatment: 'modal',\n };\n}\n\nexport function resolveHostedSurface(\n input: HostedSurfaceResolverInput,\n): HostedSurfaceResolution {\n const { addinType, modalState, mode, readyArgs } = input;\n\n // A requested treatment replaces every resolved one, including the older-host fallback\n // for an explicit modal style.\n if (mode === 'preserve' || mode === 'container') {\n return {\n backdrop: 'preserve',\n restoreBackdropDisplay: false,\n treatment: mode,\n };\n }\n\n const style = readyArgs.modalConfig?.style;\n\n if (style !== undefined) {\n const explicitOlderHostFallback =\n addinType === undefined &&\n style.hostOverlay === false &&\n style.transparentBackground === true;\n\n return {\n backdrop: explicitOlderHostFallback\n ? resolveModalBackdrop(modalState.modalDepth, false)\n : 'preserve',\n restoreBackdropDisplay: false,\n treatment: 'preserve',\n };\n }\n\n if (addinType !== undefined) {\n return resolveAddinType(addinType, readyArgs, modalState.modalDepth, true);\n }\n\n const inferredAddinType = inferAddinType(readyArgs);\n\n if (inferredAddinType !== undefined) {\n return resolveAddinType(\n inferredAddinType,\n readyArgs,\n modalState.modalDepth,\n false,\n );\n }\n\n if (modalState.fullPageModalOpen) {\n return FULL_PAGE_RESOLUTION;\n }\n\n if (modalState.modalOpen) {\n // Live modal markers can change after ready(), so the controller alone owns this\n // treatment and the vanilla client receives no style.\n return {\n backdrop: resolveModalBackdrop(modalState.modalDepth, false),\n restoreBackdropDisplay: true,\n treatment: 'modal',\n };\n }\n\n return UNIDENTIFIED_RESOLUTION;\n}\n\nexport function withInferredModalStyle(\n readyArgs: AddinClientReadyArgs,\n style: AddinModalStyle | undefined,\n): AddinClientReadyArgs {\n if (style === undefined) {\n return readyArgs;\n }\n\n return {\n ...readyArgs,\n modalConfig: {\n ...readyArgs.modalConfig,\n style,\n },\n };\n}\n","import { AddinClientReadyArgs, AddinType } from '@blackbaud/sky-addin-client';\nimport { AddinClientHostedSurfaceMode } from './addin-client-config.service';\nimport {\n HostedSurfaceResolution,\n resolveHostedSurface,\n} from './hosted-surface-resolver';\n\nexport const HOSTED_SURFACE_CLASSES = {\n container: 'bb-skyux-addin-client-container-background',\n restoreBackdrop: 'bb-skyux-addin-client-modal-backdrop-rendered',\n transparent: 'bb-skyux-addin-client-modal-background-transparent',\n transparentBackdrop: 'bb-skyux-addin-client-modal-backdrop-transparent',\n} as const;\n\n/**\n * Marks the style element owned by a controller. An attribute rather than an ID, so it\n * doesn't need to be unique in the document.\n */\nexport const HOSTED_SURFACE_STYLE_ATTRIBUTE =\n 'data-bb-skyux-addin-client-hosted-surface';\n\n/**\n * Body classes that feed `resolveHostedSurface`'s live modal state. A mutation observer\n * refresh is only warranted when one of these markers' presence actually changes; every\n * other body class (including the controller's own {@link HOSTED_SURFACE_CLASSES}) is\n * irrelevant to resolution and must not trigger a refresh.\n */\nconst MODAL_MARKER_CLASSES = [\n 'sky-modal-body-open',\n 'sky-modal-body-full-page',\n] as const;\n\n// SKY UX styles the body as a page; container add-ins use SKY UX's container color for\n// the theme and mode on the body instead. SKY UX defines the documented theme token once\n// a theme is set up, and the root-level variable covers a body without a theme.\nconst STYLE_TEXT = `\nbody.${HOSTED_SURFACE_CLASSES.container} {\n background-color: var(\n --sky-theme-color-background-container-default,\n var(--sky-background-color-container-default)\n ) !important;\n}\n\nbody.${HOSTED_SURFACE_CLASSES.transparent} {\n background-color: transparent !important;\n}\n\nbody.${HOSTED_SURFACE_CLASSES.restoreBackdrop}\n .sky-modal-host-backdrop:not([hidden]) {\n display: block !important;\n}\n\nbody.${HOSTED_SURFACE_CLASSES.transparentBackdrop}\n .sky-modal-host-backdrop {\n --sky-override-modal-host-backdrop-color: transparent;\n}\n`;\n\ninterface ControllerInput {\n readonly addinType: AddinType | undefined;\n readonly mode: AddinClientHostedSurfaceMode;\n readonly readyArgs: AddinClientReadyArgs;\n}\n\nexport class HostedSurfaceStyleController {\n readonly #document: Document;\n readonly #nonce: string | null;\n readonly #ownedClasses = new Set<string>();\n\n #input: ControllerInput | undefined;\n #observer: MutationObserver | undefined;\n #styleElement: HTMLStyleElement | undefined;\n\n /**\n * @param documentRef The add-in document.\n * @param nonce The Content Security Policy nonce for the injected style element, as\n * provided to Angular through `CSP_NONCE` or the `ngCspNonce` attribute.\n */\n constructor(documentRef: Document, nonce: string | null = null) {\n this.#document = documentRef;\n this.#nonce = nonce;\n }\n\n public update(\n addinType: AddinType | undefined,\n readyArgs: AddinClientReadyArgs,\n mode: AddinClientHostedSurfaceMode = 'automatic',\n ): HostedSurfaceResolution {\n const input: ControllerInput = { addinType, mode, readyArgs };\n\n this.#input = input;\n this.#observe();\n\n return this.#applyResolution(input);\n }\n\n public refresh(): void {\n if (this.#input !== undefined) {\n this.#applyResolution(this.#input);\n }\n }\n\n public destroy(): void {\n this.#observer?.disconnect();\n this.#observer = undefined;\n this.#input = undefined;\n\n for (const className of this.#ownedClasses) {\n this.#document.body.classList.remove(className);\n }\n\n this.#ownedClasses.clear();\n this.#styleElement?.remove();\n this.#styleElement = undefined;\n }\n\n #applyResolution(input: ControllerInput): HostedSurfaceResolution {\n const resolution = resolveHostedSurface({\n ...input,\n modalState: {\n fullPageModalOpen: this.#document.body.classList.contains(\n 'sky-modal-body-full-page',\n ),\n modalDepth: this.#document.body.querySelectorAll('sky-modal').length,\n modalOpen: this.#document.body.classList.contains(\n 'sky-modal-body-open',\n ),\n },\n });\n\n this.#setClass(\n HOSTED_SURFACE_CLASSES.container,\n resolution.treatment === 'container',\n );\n this.#setClass(\n HOSTED_SURFACE_CLASSES.transparent,\n resolution.treatment === 'modal',\n );\n this.#setClass(\n HOSTED_SURFACE_CLASSES.restoreBackdrop,\n resolution.restoreBackdropDisplay,\n );\n this.#setClass(\n HOSTED_SURFACE_CLASSES.transparentBackdrop,\n resolution.backdrop === 'transparent',\n );\n\n const needsStyle =\n resolution.treatment === 'container' ||\n resolution.treatment === 'modal' ||\n resolution.restoreBackdropDisplay ||\n resolution.backdrop === 'transparent';\n\n if (needsStyle) {\n this.#ensureStyle();\n } else {\n this.#styleElement?.remove();\n this.#styleElement = undefined;\n }\n\n return resolution;\n }\n\n #ensureStyle(): void {\n if (this.#styleElement?.parentNode) {\n return;\n }\n\n const style = this.#document.createElement('style');\n style.setAttribute(HOSTED_SURFACE_STYLE_ATTRIBUTE, '');\n\n if (this.#nonce) {\n style.setAttribute('nonce', this.#nonce);\n }\n\n style.textContent = STYLE_TEXT;\n this.#document.head.appendChild(style);\n this.#styleElement = style;\n }\n\n #observe(): void {\n if (this.#observer !== undefined) {\n return;\n }\n\n this.#observer = new MutationObserver((records) =>\n this.#handleMutations(records),\n );\n this.#observer.observe(this.#document.body, {\n attributeFilter: ['class'],\n attributeOldValue: true,\n attributes: true,\n childList: true,\n subtree: true,\n });\n }\n\n #handleMutations(records: MutationRecord[]): void {\n for (const record of records) {\n if (this.#isRelevantMutation(record)) {\n this.refresh();\n return;\n }\n }\n }\n\n /**\n * Only two mutation shapes can change what `resolveHostedSurface` computes:\n * - the body's own `class` attribute gaining or losing a {@link MODAL_MARKER_CLASSES}\n * marker (checked against `oldValue`, so the controller's own class writes and\n * unrelated consumer classes are both ignored); and\n * - a `childList` change whose added/removed node is a `sky-modal` element or contains\n * one anywhere in its subtree (nested modals affect `modalDepth`).\n * Attribute mutations on descendants (subtree class changes) and childList changes\n * that touch unrelated DOM are deliberately excluded.\n */\n #isRelevantMutation(record: MutationRecord): boolean {\n if (record.type === 'attributes') {\n return (\n record.target === this.#document.body &&\n this.#modalMarkerPresenceChanged(record.oldValue)\n );\n }\n\n // The observer only watches attributes and child lists, so this is a childList record.\n return (\n this.#containsModalNode(record.addedNodes) ||\n this.#containsModalNode(record.removedNodes)\n );\n }\n\n #modalMarkerPresenceChanged(oldValue: string | null): boolean {\n const previousClasses = new Set(\n (oldValue ?? '').split(/\\s+/).filter((value) => value.length > 0),\n );\n const currentClasses = this.#document.body.classList;\n\n return MODAL_MARKER_CLASSES.some(\n (marker) => previousClasses.has(marker) !== currentClasses.contains(marker),\n );\n }\n\n #containsModalNode(nodes: NodeList): boolean {\n for (let index = 0; index < nodes.length; index++) {\n const node = nodes[index];\n\n if (node.nodeType !== Node.ELEMENT_NODE) {\n continue;\n }\n\n const element = node as Element;\n\n if (element.localName === 'sky-modal' || element.querySelector('sky-modal')) {\n return true;\n }\n }\n\n return false;\n }\n\n #setClass(className: string, enabled: boolean): void {\n if (enabled) {\n if (!this.#document.body.classList.contains(className)) {\n this.#document.body.classList.add(className);\n this.#ownedClasses.add(className);\n }\n\n return;\n }\n\n if (this.#ownedClasses.delete(className)) {\n this.#document.body.classList.remove(className);\n }\n }\n}\n","import { DOCUMENT } from '@angular/common';\nimport {\n CSP_NONCE,\n EventEmitter,\n Injectable,\n RendererFactory2,\n inject\n} from '@angular/core';\nimport {\n AddinClient,\n AddinClientCloseModalArgs,\n AddinClientEventArgs,\n AddinClientInitArgs,\n AddinClientNavigateArgs,\n AddinClientOpenHelpArgs,\n AddinClientReadyArgs,\n AddinClientShowConfirmArgs,\n AddinClientShowErrorArgs,\n AddinClientShowFlyoutArgs,\n AddinClientShowFlyoutResult,\n AddinClientShowModalArgs,\n AddinClientShowModalResult,\n AddinClientShowToastArgs,\n AddinClientThemeSettings,\n AddinEventCallback\n} from '@blackbaud/sky-addin-client';\nimport {\n SkyAppConfig, SkyuxConfigAppSupportedTheme\n} from '@skyux/config';\nimport {\n SkyTheme,\n SkyThemeMode,\n SkyThemeService,\n SkyThemeSettings\n} from '@skyux/theme';\nimport {\n AsyncSubject,\n Observable,\n from\n} from 'rxjs';\nimport {\n AddinClientConfigService,\n AddinClientHostedSurfaceContext,\n AddinClientHostedSurfaceMode\n} from './addin-client-config.service';\nimport {\n AddinEventHandlerInstance\n} from './events';\nimport { HostedSurfaceStyleController } from './hosted-surface-style-controller';\nimport { withInferredModalStyle } from './hosted-surface-resolver';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class AddinClientService {\n public readonly addinClient: AddinClient;\n\n // Init args\n private _args: AsyncSubject<AddinClientInitArgs> = new AsyncSubject<AddinClientInitArgs>();\n public args: Observable<AddinClientInitArgs> = this._args.asObservable();\n\n // Addin Client Events\n /**\n * Event emitted for box add-ins indicating that a control action button was clicked.\n */\n public actionClick: EventEmitter<string> = new EventEmitter(true);\n\n /**\n * Event emitted for button add-ins indicating that the button was clicked.\n */\n public buttonClick: EventEmitter<any> = new EventEmitter(true);\n\n /**\n * Event emitted for add-ins when context information has been updated\n */\n public updateContext: EventEmitter<any> = new EventEmitter();\n\n /**\n * Event emitted for flyout add-ins indicating that the next button was clicked.\n */\n public flyoutNextClick: EventEmitter<any> = new EventEmitter(true);\n\n /**\n * Event emitted for flyout add-ins indicating that the previous button was clicked.\n */\n public flyoutPreviousClick: EventEmitter<any> = new EventEmitter(true);\n\n /**\n * Event emitted for tile add-ins indicating that the help button was clicked.\n * @deprecated Use tile inline help instead and handle the {@link inlineHelpClick} emitter.\n */\n public helpClick: EventEmitter<any> = new EventEmitter(true);\n\n /**\n * Event emitted indicating that the inline help button was clicked.\n */\n public inlineHelpClick: EventEmitter<any> = new EventEmitter(true);\n\n /**\n * Event emitted for tile add-ins indicating that the settings button was clicked.\n */\n public settingsClick: EventEmitter<any> = new EventEmitter(true);\n\n #config = inject(SkyAppConfig, { optional: true });\n #document = inject(DOCUMENT);\n #rendererFactory = inject(RendererFactory2);\n #themeService = inject(SkyThemeService);\n #addinClientConfigService = inject(AddinClientConfigService, { optional: true });\n\n private destroyed = false;\n private readonly hostedSurfaceController =\n new HostedSurfaceStyleController(\n this.#document,\n inject(CSP_NONCE, { optional: true })\n );\n\n constructor() {\n this.addinClient = new AddinClient({\n callbacks: {\n init: (args: AddinClientInitArgs) => {\n const preparedArgs = this.prepareInitArgs(args);\n\n this.initializeTheme(preparedArgs.themeSettings);\n this._args.next(preparedArgs);\n this._args.complete();\n },\n actionClick: (action: string) => {\n this.actionClick.emit(action);\n },\n buttonClick: () => {\n this.buttonClick.emit();\n },\n flyoutNextClick: () => {\n this.flyoutNextClick.emit();\n },\n flyoutPreviousClick: () => {\n this.flyoutPreviousClick.emit();\n },\n helpClick: () => {\n this.helpClick.emit();\n },\n inlineHelpClick: () => {\n this.inlineHelpClick.emit();\n },\n settingsClick: () => {\n this.settingsClick.emit();\n },\n updateContext: (context: any) => {\n this.updateContext.emit(context);\n },\n themeChange: (settings: AddinClientThemeSettings) => {\n this.setTheme(settings);\n }\n },\n config: this.#addinClientConfigService?.getAddinClientConfig()\n });\n }\n\n /**\n * Informs the host to close this modal add-in.\n * Should only be used from within the modal add-in and not the parent add-in.\n * @param args Arguments to provide a context object back to the parent add-in.\n */\n public closeModal(args: AddinClientCloseModalArgs): void {\n this.addinClient.closeModal(args);\n }\n\n /**\n * Requests the host page to launch a modal add-in.\n * @param args Arguments for launching the modal.\n * @returns Returns an observable that will publish a value when the modal add-in is closed.\n * Observables will publish values with context data passed from the modal add-in's closeModal call.\n */\n public showModal(args: AddinClientShowModalArgs): Observable<any> {\n let modalReturn: AddinClientShowModalResult = this.addinClient.showModal(args);\n return from(modalReturn.modalClosed);\n }\n\n /**\n * Cleans up the AddinClient, releasing all resources.\n */\n public destroy(): void {\n if (this.destroyed) {\n return;\n }\n\n this.destroyed = true;\n this.hostedSurfaceController.destroy();\n this.addinClient.destroy();\n }\n\n private prepareInitArgs(args: AddinClientInitArgs): AddinClientInitArgs {\n const ready = args.ready;\n\n args.ready = (readyArgs: AddinClientReadyArgs) => {\n // Pass ready() through untouched when the body doesn't exist yet, so addin-ready\n // is still posted.\n if (this.destroyed || !this.#document.body) {\n ready(readyArgs);\n return;\n }\n\n // Keep application-owned args as the source for later DOM-driven inference.\n const resolution = this.hostedSurfaceController.update(\n args.addinType,\n readyArgs,\n this.getHostedSurfaceMode({ addinType: args.addinType, readyArgs })\n );\n\n ready(\n withInferredModalStyle(\n readyArgs,\n resolution.inferredModalStyle\n )\n );\n };\n\n return args;\n }\n\n private getHostedSurfaceMode(\n context: AddinClientHostedSurfaceContext\n ): AddinClientHostedSurfaceMode {\n // A config provided as a plain object may predate getHostedSurfaceMode().\n return (\n this.#addinClientConfigService?.getHostedSurfaceMode?.(context) ??\n 'automatic'\n );\n }\n\n /**\n * Requests the host page to navigate.\n * @param args Arguments describing the navigation request.\n */\n public navigate(args: AddinClientNavigateArgs): void {\n this.addinClient.navigate(args);\n }\n\n /**\n * Informs the host to open the help tab with the specified help key.\n * @param args Arguments for launching the help tab.\n */\n public openHelp(args: AddinClientOpenHelpArgs): void {\n this.addinClient.openHelp(args);\n }\n\n /**\n * Requests a user identity token for the current user.\n * @returns Returns an observable which will publish the token value.\n */\n public getUserIdentityToken(): Observable<string> {\n return from(this.addinClient.getUserIdentityToken());\n }\n\n /**\n * @deprecated Use getUserIdentityToken\n */\n public getAuthToken(): Observable<string> {\n return from(this.addinClient.getUserIdentityToken());\n }\n\n /**\n * Informs the host to show a toast message.\n * @param args Arguments for showing a toast.\n */\n public showToast(args: AddinClientShowToastArgs): void {\n this.addinClient.showToast(args);\n }\n\n /**\n * Requests the host page to launch a flyout add-in.\n * @param args Arguments for launching the flyout.\n * @returns Returns an observable that will notify when the flyout add-in is closed.\n */\n public showFlyout(args: AddinClientShowFlyoutArgs): Observable<void> {\n const flyoutReturn: AddinClientShowFlyoutResult = this.addinClient.showFlyout(args);\n return from(flyoutReturn.flyoutClosed);\n }\n\n /**\n * Requests the host page to close the flyout add-in.\n */\n public closeFlyout(): void {\n this.addinClient.closeFlyout();\n }\n\n /**\n * Requests the host page to show a confirm dialog.\n * @param args Arguments for showing a confirm dialog.\n * @returns Returns an observable which will publish the confirm action value.\n */\n public showConfirm(args: AddinClientShowConfirmArgs): Observable<string> {\n return from(this.addinClient.showConfirm(args));\n }\n\n /**\n * Informs the host to show an error dialog.\n * @param args Arguments for showing an error dialog.\n */\n public showError(args: AddinClientShowErrorArgs): void {\n this.addinClient.showError(args);\n }\n\n /**\n * Requests the host page to show a page blocking wait indicator.\n */\n public showWait(): void {\n this.addinClient.showWait();\n }\n\n /**\n * Requests the host page to hide a page blocking wait indicator.\n */\n public hideWait(): void {\n this.addinClient.hideWait();\n }\n\n /**\n * Registers an event handler for the provided event type.\n * @param eventType The event type to register.\n * @returns AddinEventHandlerInstance\n */\n public addEventHandler(eventType: string): AddinEventHandlerInstance {\n let eventHandlerInstance = new AddinEventHandlerInstance();\n\n const eventCallback: AddinEventCallback = (context, done) => {\n eventHandlerInstance.addinEvent.emit({\n context,\n done\n });\n };\n this.addinClient.addEventHandler(eventType, eventCallback);\n\n return eventHandlerInstance;\n }\n\n /**\n * Sends an event to be handled by the host page.\n * @param args The event arguments to be sent to the host page.\n * @returns Returns an observable which will complete when the add-in host page receives the\n * message. The request will fail if a subsequent event occurs, for the same event type, within\n * 200 milliseconds. A failure can also occur if an event type is not one of the supported types\n * from the host page.\n * @see AddinClientInitArgs#supportedEventTypes\n */\n public sendEvent(args: AddinClientEventArgs): Observable<void> {\n return from(this.addinClient.sendEvent(args));\n }\n\n private initializeTheme(\n themeSettings: AddinClientThemeSettings | undefined\n ): void {\n if (!themeSettings || !this.supportsHostTheme(themeSettings)) {\n // app does not support host theme, do nothing to initialize the app's default theme\n return;\n }\n\n this.initializeTheme_(AddinClientService.toSkyThemeSettings(themeSettings));\n }\n\n private initializeTheme_(themeSettings: SkyThemeSettings): void {\n this.#themeService.init(\n document.body,\n this.#rendererFactory.createRenderer(null, null),\n themeSettings\n );\n }\n\n private setTheme(settings: AddinClientThemeSettings): void {\n // A host theme change follows the same rule as initialization, so the app is\n // never switched to a theme it does not support.\n if (!settings || !this.supportsHostTheme(settings)) {\n return;\n }\n\n this.#themeService.setTheme(AddinClientService.toSkyThemeSettings(settings));\n }\n\n /**\n * Whether the app supports the host's theme. An app without SKY UX app config supports\n * any host theme; otherwise the theme must be listed in `app.theming.supportedThemes`.\n */\n private supportsHostTheme(settings: AddinClientThemeSettings): boolean {\n if (!this.#config) {\n return true;\n }\n\n const supportedThemes = this.#config.skyux.app?.theming?.supportedThemes;\n\n return !!supportedThemes &&\n supportedThemes.indexOf(settings.theme as SkyuxConfigAppSupportedTheme) !== -1;\n }\n\n private static toSkyThemeSettings(settings: AddinClientThemeSettings): SkyThemeSettings {\n if (settings.skyThemeSettings) {\n // If the settings contain a serialized SkyThemeSettings object, deserialize it.\n return SkyThemeSettings.deserialize(settings.skyThemeSettings);\n }\n\n return new SkyThemeSettings(\n AddinClientService.toSkyTheme(settings.theme),\n AddinClientService.toSkyThemeMode(settings.mode)\n );\n }\n\n private static toSkyTheme(theme: string): SkyTheme {\n switch (theme) {\n case 'modern':\n return SkyTheme.presets.modern;\n default:\n return SkyTheme.presets.default;\n }\n }\n\n private static toSkyThemeMode(mode: string): SkyThemeMode {\n switch (mode) {\n case 'dark':\n return SkyThemeMode.presets.dark;\n default:\n return SkyThemeMode.presets.light;\n }\n }\n}\n","import { inject, Injectable, Provider } from '@angular/core';\nimport { SkyHelpOpenArgs, SkyHelpService } from '@skyux/core';\nimport { AddinClientService } from '../addin-client.service';\n\n@Injectable({ providedIn: 'root' })\nexport class AddinClientHelpService extends SkyHelpService {\n private skyAddinClientService = inject(AddinClientService);\n\n /** @inheritdoc */\n public override openHelp(args?: SkyHelpOpenArgs): void {\n if (!args) {\n return;\n }\n\n this.skyAddinClientService.openHelp(args);\n }\n\n /** @inheritdoc */\n public override updateHelp(): void {\n throw new Error('Not implemented');\n }\n}\n\n/** Provide addin client help service */\nexport function provideAddinClientHelp(): Provider[] {\n return [{ provide: SkyHelpService, useClass: AddinClientHelpService }];\n}\n"],"mappings":";;;;;;;;AAkCA,IAAsB,2BAAtB,MAA8C;CAKrC,uBAAoB;EACzB,OAAO,CAAA;CACT;CASO,qBACL,SAAwC;EAExC,OAAO;CACT;AACD;ACnDD,IAAa,aAAb,MAAuB,CAYtB;ACLD,IAAa,4BAAb,MAAsC;CAAtC,cAAA;EAKS,KAAA,aAAa,IAAI,aAAY;CACtC;AAAC;AC0CD,MAAM,8BAA8B;AAEpC,SAAS,qBACP,YACA,aAAoB;CAEpB,OAAO,eAAe,cAAc,8BAChC,WACA;AACN;AAeA,MAAM,iCAEF;CACF,iBAAiB;CACjB,KAAK;CACL,QAAQ;CACR,SAAS;CACT,QAAQ;CACR,SAAS;CACT,OAAO;CACP,MAAM;CACN,KAAK;CACL,MAAM;CACN,qBAAqB;AACtB;AAOD,MAAM,yBAEF;CACF,CAAC,eAAe,OAAO;CACvB,CAAC,aAAa,KAAK;CACnB,CAAC,aAAa,KAAK;CACnB,CAAC,cAAc,MAAM;CACrB,CAAC,gBAAgB,QAAQ;CACzB,CAAC,sBAAsB,eAAe;AACvC;AAOD,MAAM,0BAAmD;CACvD,UAAU;CACV,wBAAwB;CACxB,WAAW;AACZ;AAED,MAAM,uBAAgD;CACpD,UAAU;CACV,wBAAwB;CACxB,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AA,sBAAA;GAAA,YAAA;GAAA,SAAA;GAAA,UAAA;GAAA,MAAA;GAAkB,YAFjB;EAAM,CAAA;CAAA;;AAEP,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAkB,YAAA,CAAA;EAH9B,MAAA;EAAW,MAAA,CAAA,EACV,YAAY,OACb,CAAA;;;;AChDD,IAAa,yBAAb,MAAa,+BAA+B,eAAc;CAD1D,cAAA;;EAEU,KAAA,wBAAwB,OAAO,kBAAkB;CAe1D;CAZiB,SAAS,MAAsB;EAC7C,IAAI,CAAC,MACH;EAGF,KAAK,sBAAsB,SAAS,IAAI;CAC1C;CAGgB,aAAU;EACxB,MAAM,IAAI,MAAM,iBAAiB;CACnC;CAfW;EAAA,KAAA,OAAA,GAAA,mBAAA;GAAA,YAAA;GAAA,SAAA;GAAA,UAAA;GAAA,MAAA;GAAsB,MAAA;GAAA,QAAA,GAAA,gBAAA;EAAA,CAAA;CAAA;CAAtB;EAAA,KAAA,QAAA,GAAA,sBAAA;GAAA,YAAA;GAAA,SAAA;GAAA,UAAA;GAAA,MAAA;GAAsB,YADT;EAAM,CAAA;CAAA;;AACnB,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAsB,YAAA,CAAA;EADlC,MAAA;EAAW,MAAA,CAAA,EAAE,YAAY,OAAM,CAAE;;;AAoBlC,SAAgB,yBAAsB;CACpC,OAAO,CAAC;EAAE,SAAS;EAAgB,UAAU;CAAsB,CAAE;AACvE"}
package/package.json CHANGED
@@ -1,15 +1,15 @@
1
1
  {
2
2
  "name": "@blackbaud/skyux-lib-addin-client",
3
- "version": "14.1.0",
3
+ "version": "15.0.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/blackbaud/skyux-lib-addin-client.git"
7
7
  },
8
8
  "peerDependencies": {
9
- "@angular/common": "^21.2.8",
10
- "@angular/core": "^21.2.8",
11
- "@skyux/config": "^14.0.1",
12
- "@skyux/theme": "^14.0.1"
9
+ "@angular/common": "^22.1.2",
10
+ "@angular/core": "^22.1.2",
11
+ "@skyux/config": "^15.2.0",
12
+ "@skyux/theme": "^15.2.0"
13
13
  },
14
14
  "dependencies": {
15
15
  "@blackbaud/sky-addin-client": "^1.8.0",
@@ -1,191 +1,223 @@
1
- import * as i0 from '@angular/core';
2
- import { EventEmitter, Provider } from '@angular/core';
3
- import { AddinClient, AddinClientInitArgs, AddinClientCloseModalArgs, AddinClientShowModalArgs, AddinClientNavigateArgs, AddinClientOpenHelpArgs, AddinClientShowToastArgs, AddinClientShowFlyoutArgs, AddinClientShowConfirmArgs, AddinClientShowErrorArgs, AddinClientEventArgs, AddinClientConfig } from '@blackbaud/sky-addin-client';
4
- import { Observable } from 'rxjs';
5
- import { SkyHelpService, SkyHelpOpenArgs } from '@skyux/core';
6
-
1
+ import * as i0 from "@angular/core";
2
+ import { EventEmitter, Provider } from "@angular/core";
3
+ import { AddinClient, AddinClientCloseModalArgs, AddinClientConfig, AddinClientEventArgs, AddinClientInitArgs, AddinClientNavigateArgs, AddinClientOpenHelpArgs, AddinClientReadyArgs, AddinClientShowConfirmArgs, AddinClientShowErrorArgs, AddinClientShowFlyoutArgs, AddinClientShowModalArgs, AddinClientShowToastArgs, AddinType } from "@blackbaud/sky-addin-client";
4
+ import { Observable } from "rxjs";
5
+ import { SkyHelpOpenArgs, SkyHelpService } from "@skyux/core";
7
6
  /**
8
7
  * Contains data for an add-in event and allows you to indicate that an event
9
8
  * has been processed
10
9
  */
11
- declare class AddinEvent {
12
- /**
13
- * The data that an add-in event has returned.
14
- */
15
- context: any;
16
- /**
17
- * A function to call indicating that the add-in event is processed.
18
- * Returning any necessary data back to the host.
19
- */
20
- done?: (data?: any) => void;
10
+ export declare class AddinEvent {
11
+ /**
12
+ * The data that an add-in event has returned.
13
+ */
14
+ context: any;
15
+ /**
16
+ * A function to call indicating that the add-in event is processed.
17
+ * Returning any necessary data back to the host.
18
+ */
19
+ done?: (data?: any) => void;
21
20
  }
22
-
23
21
  /**
24
22
  * Allows you to process events from an event handler.
25
23
  */
26
- declare class AddinEventHandlerInstance {
27
- /**
28
- * An event that emits when a new add-in event has occurred.
29
- */
30
- addinEvent: EventEmitter<AddinEvent>;
24
+ export declare class AddinEventHandlerInstance {
25
+ /**
26
+ * An event that emits when a new add-in event has occurred.
27
+ */
28
+ addinEvent: EventEmitter<AddinEvent>;
31
29
  }
32
-
33
- declare class AddinClientService {
34
- #private;
35
- readonly addinClient: AddinClient;
36
- private _args;
37
- args: Observable<AddinClientInitArgs>;
38
- /**
39
- * Event emitted for box add-ins indicating that a control action button was clicked.
40
- */
41
- actionClick: EventEmitter<string>;
42
- /**
43
- * Event emitted for button add-ins indicating that the button was clicked.
44
- */
45
- buttonClick: EventEmitter<any>;
46
- /**
47
- * Event emitted for add-ins when context information has been updated
48
- */
49
- updateContext: EventEmitter<any>;
50
- /**
51
- * Event emitted for flyout add-ins indicating that the next button was clicked.
52
- */
53
- flyoutNextClick: EventEmitter<any>;
54
- /**
55
- * Event emitted for flyout add-ins indicating that the previous button was clicked.
56
- */
57
- flyoutPreviousClick: EventEmitter<any>;
58
- /**
59
- * Event emitted for tile add-ins indicating that the help button was clicked.
60
- * @deprecated Use tile inline help instead and handle the {@link inlineHelpClick} emitter.
61
- */
62
- helpClick: EventEmitter<any>;
63
- /**
64
- * Event emitted indicating that the inline help button was clicked.
65
- */
66
- inlineHelpClick: EventEmitter<any>;
67
- /**
68
- * Event emitted for tile add-ins indicating that the settings button was clicked.
69
- */
70
- settingsClick: EventEmitter<any>;
71
- constructor();
72
- /**
73
- * Informs the host to close this modal add-in.
74
- * Should only be used from within the modal add-in and not the parent add-in.
75
- * @param args Arguments to provide a context object back to the parent add-in.
76
- */
77
- closeModal(args: AddinClientCloseModalArgs): void;
78
- /**
79
- * Requests the host page to launch a modal add-in.
80
- * @param args Arguments for launching the modal.
81
- * @returns Returns an observable that will publish a value when the modal add-in is closed.
82
- * Observables will publish values with context data passed from the modal add-in's closeModal call.
83
- */
84
- showModal(args: AddinClientShowModalArgs): Observable<any>;
85
- /**
86
- * Cleans up the AddinClient, releasing all resources.
87
- */
88
- destroy(): void;
89
- /**
90
- * Requests the host page to navigate.
91
- * @param args Arguments describing the navigation request.
92
- */
93
- navigate(args: AddinClientNavigateArgs): void;
94
- /**
95
- * Informs the host to open the help tab with the specified help key.
96
- * @param args Arguments for launching the help tab.
97
- */
98
- openHelp(args: AddinClientOpenHelpArgs): void;
99
- /**
100
- * Requests a user identity token for the current user.
101
- * @returns Returns an observable which will publish the token value.
102
- */
103
- getUserIdentityToken(): Observable<string>;
104
- /**
105
- * @deprecated Use getUserIdentityToken
106
- */
107
- getAuthToken(): Observable<string>;
108
- /**
109
- * Informs the host to show a toast message.
110
- * @param args Arguments for showing a toast.
111
- */
112
- showToast(args: AddinClientShowToastArgs): void;
113
- /**
114
- * Requests the host page to launch a flyout add-in.
115
- * @param args Arguments for launching the flyout.
116
- * @returns Returns an observable that will notify when the flyout add-in is closed.
117
- */
118
- showFlyout(args: AddinClientShowFlyoutArgs): Observable<void>;
119
- /**
120
- * Requests the host page to close the flyout add-in.
121
- */
122
- closeFlyout(): void;
123
- /**
124
- * Requests the host page to show a confirm dialog.
125
- * @param args Arguments for showing a confirm dialog.
126
- * @returns Returns an observable which will publish the confirm action value.
127
- */
128
- showConfirm(args: AddinClientShowConfirmArgs): Observable<string>;
129
- /**
130
- * Informs the host to show an error dialog.
131
- * @param args Arguments for showing an error dialog.
132
- */
133
- showError(args: AddinClientShowErrorArgs): void;
134
- /**
135
- * Requests the host page to show a page blocking wait indicator.
136
- */
137
- showWait(): void;
138
- /**
139
- * Requests the host page to hide a page blocking wait indicator.
140
- */
141
- hideWait(): void;
142
- /**
143
- * Registers an event handler for the provided event type.
144
- * @param eventType The event type to register.
145
- * @returns AddinEventHandlerInstance
146
- */
147
- addEventHandler(eventType: string): AddinEventHandlerInstance;
148
- /**
149
- * Sends an event to be handled by the host page.
150
- * @param args The event arguments to be sent to the host page.
151
- * @returns Returns an observable which will complete when the add-in host page receives the
152
- * message. The request will fail if a subsequent event occurs, for the same event type, within
153
- * 200 milliseconds. A failure can also occur if an event type is not one of the supported types
154
- * from the host page.
155
- * @see AddinClientInitArgs#supportedEventTypes
156
- */
157
- sendEvent(args: AddinClientEventArgs): Observable<void>;
158
- private initializeTheme;
159
- private initializeTheme_;
160
- private setTheme;
161
- private static toSkyThemeSettings;
162
- private static toSkyTheme;
163
- private static toSkyThemeMode;
164
- static ɵfac: i0.ɵɵFactoryDeclaration<AddinClientService, never>;
165
- static ɵprov: i0.ɵɵInjectableDeclaration<AddinClientService>;
30
+ export declare class AddinClientService {
31
+ #private;
32
+ readonly addinClient: AddinClient;
33
+ private _args;
34
+ args: Observable<AddinClientInitArgs>;
35
+ /**
36
+ * Event emitted for box add-ins indicating that a control action button was clicked.
37
+ */
38
+ actionClick: EventEmitter<string>;
39
+ /**
40
+ * Event emitted for button add-ins indicating that the button was clicked.
41
+ */
42
+ buttonClick: EventEmitter<any>;
43
+ /**
44
+ * Event emitted for add-ins when context information has been updated
45
+ */
46
+ updateContext: EventEmitter<any>;
47
+ /**
48
+ * Event emitted for flyout add-ins indicating that the next button was clicked.
49
+ */
50
+ flyoutNextClick: EventEmitter<any>;
51
+ /**
52
+ * Event emitted for flyout add-ins indicating that the previous button was clicked.
53
+ */
54
+ flyoutPreviousClick: EventEmitter<any>;
55
+ /**
56
+ * Event emitted for tile add-ins indicating that the help button was clicked.
57
+ * @deprecated Use tile inline help instead and handle the {@link inlineHelpClick} emitter.
58
+ */
59
+ helpClick: EventEmitter<any>;
60
+ /**
61
+ * Event emitted indicating that the inline help button was clicked.
62
+ */
63
+ inlineHelpClick: EventEmitter<any>;
64
+ /**
65
+ * Event emitted for tile add-ins indicating that the settings button was clicked.
66
+ */
67
+ settingsClick: EventEmitter<any>;
68
+ private destroyed;
69
+ private readonly hostedSurfaceController;
70
+ constructor();
71
+ /**
72
+ * Informs the host to close this modal add-in.
73
+ * Should only be used from within the modal add-in and not the parent add-in.
74
+ * @param args Arguments to provide a context object back to the parent add-in.
75
+ */
76
+ closeModal(args: AddinClientCloseModalArgs): void;
77
+ /**
78
+ * Requests the host page to launch a modal add-in.
79
+ * @param args Arguments for launching the modal.
80
+ * @returns Returns an observable that will publish a value when the modal add-in is closed.
81
+ * Observables will publish values with context data passed from the modal add-in's closeModal call.
82
+ */
83
+ showModal(args: AddinClientShowModalArgs): Observable<any>;
84
+ /**
85
+ * Cleans up the AddinClient, releasing all resources.
86
+ */
87
+ destroy(): void;
88
+ private prepareInitArgs;
89
+ private getHostedSurfaceMode;
90
+ /**
91
+ * Requests the host page to navigate.
92
+ * @param args Arguments describing the navigation request.
93
+ */
94
+ navigate(args: AddinClientNavigateArgs): void;
95
+ /**
96
+ * Informs the host to open the help tab with the specified help key.
97
+ * @param args Arguments for launching the help tab.
98
+ */
99
+ openHelp(args: AddinClientOpenHelpArgs): void;
100
+ /**
101
+ * Requests a user identity token for the current user.
102
+ * @returns Returns an observable which will publish the token value.
103
+ */
104
+ getUserIdentityToken(): Observable<string>;
105
+ /**
106
+ * @deprecated Use getUserIdentityToken
107
+ */
108
+ getAuthToken(): Observable<string>;
109
+ /**
110
+ * Informs the host to show a toast message.
111
+ * @param args Arguments for showing a toast.
112
+ */
113
+ showToast(args: AddinClientShowToastArgs): void;
114
+ /**
115
+ * Requests the host page to launch a flyout add-in.
116
+ * @param args Arguments for launching the flyout.
117
+ * @returns Returns an observable that will notify when the flyout add-in is closed.
118
+ */
119
+ showFlyout(args: AddinClientShowFlyoutArgs): Observable<void>;
120
+ /**
121
+ * Requests the host page to close the flyout add-in.
122
+ */
123
+ closeFlyout(): void;
124
+ /**
125
+ * Requests the host page to show a confirm dialog.
126
+ * @param args Arguments for showing a confirm dialog.
127
+ * @returns Returns an observable which will publish the confirm action value.
128
+ */
129
+ showConfirm(args: AddinClientShowConfirmArgs): Observable<string>;
130
+ /**
131
+ * Informs the host to show an error dialog.
132
+ * @param args Arguments for showing an error dialog.
133
+ */
134
+ showError(args: AddinClientShowErrorArgs): void;
135
+ /**
136
+ * Requests the host page to show a page blocking wait indicator.
137
+ */
138
+ showWait(): void;
139
+ /**
140
+ * Requests the host page to hide a page blocking wait indicator.
141
+ */
142
+ hideWait(): void;
143
+ /**
144
+ * Registers an event handler for the provided event type.
145
+ * @param eventType The event type to register.
146
+ * @returns AddinEventHandlerInstance
147
+ */
148
+ addEventHandler(eventType: string): AddinEventHandlerInstance;
149
+ /**
150
+ * Sends an event to be handled by the host page.
151
+ * @param args The event arguments to be sent to the host page.
152
+ * @returns Returns an observable which will complete when the add-in host page receives the
153
+ * message. The request will fail if a subsequent event occurs, for the same event type, within
154
+ * 200 milliseconds. A failure can also occur if an event type is not one of the supported types
155
+ * from the host page.
156
+ * @see AddinClientInitArgs#supportedEventTypes
157
+ */
158
+ sendEvent(args: AddinClientEventArgs): Observable<void>;
159
+ private initializeTheme;
160
+ private initializeTheme_;
161
+ private setTheme;
162
+ /**
163
+ * Whether the app supports the host's theme. An app without SKY UX app config supports
164
+ * any host theme; otherwise the theme must be listed in `app.theming.supportedThemes`.
165
+ */
166
+ private supportsHostTheme;
167
+ private static toSkyThemeSettings;
168
+ private static toSkyTheme;
169
+ private static toSkyThemeMode;
170
+ static ɵfac: i0.ɵɵFactoryDeclaration<AddinClientService, never>;
171
+ static ɵprov: i0.ɵɵInjectableDeclaration<AddinClientService>;
172
+ }
173
+ /**
174
+ * How the add-in client styles the add-in document for its hosted surface.
175
+ * - `'automatic'`: adapts the document background to the hosted surface.
176
+ * - `'preserve'`: leaves the add-in's own background styling unchanged.
177
+ * - `'container'`: uses the SKY UX container background, whatever the hosted surface.
178
+ */
179
+ export type AddinClientHostedSurfaceMode = 'automatic' | 'preserve' | 'container';
180
+ /**
181
+ * What the add-in client knows about the hosted surface when it asks for the
182
+ * hosted surface mode.
183
+ */
184
+ export interface AddinClientHostedSurfaceContext {
185
+ /**
186
+ * The add-in type the host reported, or `undefined` when the host doesn't report one
187
+ * or reports a type this client doesn't recognize.
188
+ */
189
+ readonly addinType: AddinType | undefined;
190
+ /**
191
+ * The arguments the add-in passed to `ready()`.
192
+ */
193
+ readonly readyArgs: AddinClientReadyArgs;
166
194
  }
167
-
168
195
  /**
169
196
  * Implement this class with your own data to initialize the add-in client service.
170
197
  */
171
- declare abstract class AddinClientConfigService {
172
- /**
173
- * Gets the AddinClientConfig object that will be injected the
174
- * AddinClient instance when instantiated.
175
- */
176
- getAddinClientConfig(): AddinClientConfig;
198
+ export declare abstract class AddinClientConfigService {
199
+ /**
200
+ * Gets the AddinClientConfig object that will be injected the
201
+ * AddinClient instance when instantiated.
202
+ */
203
+ getAddinClientConfig(): AddinClientConfig;
204
+ /**
205
+ * Gets how the add-in client styles the add-in document for its hosted surface. The
206
+ * client asks on every `ready()` call, so an add-in can choose per add-in type, per
207
+ * route, or per `ready()` call. Return `'preserve'` to keep the add-in's own background
208
+ * styling, or `'container'` to use the SKY UX container background.
209
+ * @param context The hosted surface the add-in is being made ready for.
210
+ */
211
+ getHostedSurfaceMode(context: AddinClientHostedSurfaceContext): AddinClientHostedSurfaceMode;
177
212
  }
178
-
179
- declare class AddinClientHelpService extends SkyHelpService {
180
- private skyAddinClientService;
181
- /** @inheritdoc */
182
- openHelp(args?: SkyHelpOpenArgs): void;
183
- /** @inheritdoc */
184
- updateHelp(): void;
185
- static ɵfac: i0.ɵɵFactoryDeclaration<AddinClientHelpService, never>;
186
- static ɵprov: i0.ɵɵInjectableDeclaration<AddinClientHelpService>;
213
+ export declare class AddinClientHelpService extends SkyHelpService {
214
+ private skyAddinClientService;
215
+ /** @inheritdoc */
216
+ openHelp(args?: SkyHelpOpenArgs): void;
217
+ /** @inheritdoc */
218
+ updateHelp(): void;
219
+ static ɵfac: i0.ɵɵFactoryDeclaration<AddinClientHelpService, never>;
220
+ static ɵprov: i0.ɵɵInjectableDeclaration<AddinClientHelpService>;
187
221
  }
188
222
  /** Provide addin client help service */
189
- declare function provideAddinClientHelp(): Provider[];
190
-
191
- export { AddinClientConfigService, AddinClientHelpService, AddinClientService, AddinEvent, AddinEventHandlerInstance, provideAddinClientHelp };
223
+ export declare function provideAddinClientHelp(): Provider[];