UNPKG

@bloomreach/ng-sdk

Version:

Bloomreach SPA SDK for Angular

1 lines 69.2 kB
{"version":3,"file":"index.mjs","sources":["../../src/lib/br-container-item-undefined/br-container-item-undefined.component.ts","../../src/lib/br-container-item-undefined/br-container-item-undefined.component.html","../../src/lib/br-node.directive.ts","../../src/lib/br-page/br-page.service.ts","../../src/lib/br-component.directive.ts","../../src/lib/br-container-box/br-container-box.component.ts","../../src/lib/br-container-box/br-container-box.component.html","../../src/lib/br-container-inline/br-container-inline.component.ts","../../src/lib/br-container-inline/br-container-inline.component.html","../../src/lib/br-container-ordered-list/br-container-ordered-list.component.ts","../../src/lib/br-container-ordered-list/br-container-ordered-list.component.html","../../src/lib/br-container-unordered-list/br-container-unordered-list.component.ts","../../src/lib/br-container-unordered-list/br-container-unordered-list.component.html","../../src/lib/br-meta.directive.ts","../../src/lib/br-node-component.directive.ts","../../src/lib/br-node-container.directive.ts","../../src/lib/br-node-container-item.directive.ts","../../src/lib/br-node-type.pipe.ts","../../src/lib/br-page/br-page.component.ts","../../src/lib/br-page/br-page.component.html","../../src/lib/br-manage-content-button.directive.ts","../../src/lib/br-manage-menu-button.directive.ts","../../src/lib/br-sdk.module.ts","../../src/lib/br-props.model.ts","../../src/public-api.ts","../../src/index.ts"],"sourcesContent":["/*\n * Copyright 2020-2025 Bloomreach\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Component, Input } from '@angular/core';\nimport { ContainerItem } from '@bloomreach/spa-sdk';\n\n@Component({\n selector: 'br-container-item-undefined',\n templateUrl: './br-container-item-undefined.component.html',\n standalone: false,\n})\nexport class BrContainerItemUndefinedComponent {\n @Input() component!: ContainerItem;\n}\n","<!--\n Copyright 2020-2025 Bloomreach\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n https://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n -->\n\n<div>{{ 'Component \"' + component.getType() + '\" is not defined.' }}</div>\n","/*\n * Copyright 2020-2025 Bloomreach\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Directive, Input, TemplateRef } from '@angular/core';\nimport { Component } from '@bloomreach/spa-sdk';\nimport type { BrComponentContext } from './br-component.directive';\n\n@Directive({\n selector: '[brNode]',\n standalone: false,\n})\nexport class BrNodeDirective {\n @Input('brNode') component!: Component;\n\n @Input('brNodeTemplate') template?: TemplateRef<BrComponentContext>;\n}\n","/*\n * Copyright 2023-2025 Bloomreach\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Injectable, TemplateRef, Type } from '@angular/core';\nimport { Page } from '@bloomreach/spa-sdk';\nimport { BehaviorSubject } from 'rxjs';\nimport type { BrComponentContext } from '../br-component.directive';\nimport { BrProps } from '../br-props.model';\n\nexport interface BrNodeContext extends BrComponentContext {\n template?: TemplateRef<BrComponentContext>;\n}\n\n@Injectable()\nexport class BrPageService {\n private _mapping: Record<keyof any, Type<BrProps>> = {};\n private _node!: TemplateRef<BrNodeContext>;\n private readonly state$: BehaviorSubject<Page | undefined>;\n\n constructor() {\n this.state$ = new BehaviorSubject<Page | undefined>(undefined);\n }\n\n get mapping(): Record<keyof any, Type<BrProps>> {\n return this._mapping;\n }\n\n set mapping(mapping: Record<keyof any, Type<BrProps>>) {\n this._mapping = mapping;\n }\n\n get node(): TemplateRef<BrNodeContext> {\n return this._node;\n }\n\n set node(node: TemplateRef<BrNodeContext>) {\n this._node = node;\n }\n\n get state(): BehaviorSubject<Page | undefined> {\n return this.state$;\n }\n}\n","/*\n * Copyright 2020-2025 Bloomreach\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n Directive,\n Input,\n OnChanges,\n OnDestroy,\n OnInit,\n Optional,\n SimpleChanges,\n TemplateRef,\n ViewContainerRef,\n} from '@angular/core';\nimport { isComponent, Component, Page } from '@bloomreach/spa-sdk';\nimport { BrNodeDirective } from './br-node.directive';\nimport { BrPageService } from './br-page/br-page.service';\n\n/**\n * The template context holding the current brXM Component.\n */\nexport interface BrComponentContext {\n /**\n * The implicit value of the context is pointing to the current component.\n */\n $implicit?: Component;\n\n /**\n * The current component.\n */\n component?: Component;\n\n /**\n * The current page.\n */\n page?: Page;\n}\n\n/**\n * The brXM component.\n */\n@Directive({\n selector: '[brComponent]',\n standalone: false,\n})\nexport class BrComponentDirective implements OnChanges, OnDestroy, OnInit {\n /**\n * The component instance or a path to a component.\n * The path is defined as a slash-separated components name chain\n * relative to the current component (e.g. `main/container`).\n * If it is omitted, all the children will be rendered.\n */\n @Input('brComponent') component?: Component | string;\n\n constructor(\n private container: ViewContainerRef,\n @Optional() private template?: TemplateRef<BrComponentContext>,\n @Optional() private node?: BrNodeDirective,\n @Optional() private page?: BrPageService,\n ) {\n // Constructor intentionally left empty\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n if (!changes.component || changes.component.isFirstChange()) {\n return;\n }\n\n this.ngOnDestroy();\n this.ngOnInit();\n }\n\n ngOnDestroy(): void {\n this.container.clear();\n }\n\n ngOnInit(): void {\n const page = this.page?.state.getValue();\n\n if (!page) {\n return;\n }\n\n this.components?.forEach((component) => {\n this.container.createEmbeddedView(this.page!.node, {\n component,\n page,\n $implicit: component,\n template: this.template,\n });\n });\n }\n\n private get context(): Component | undefined {\n if (this.node) {\n return this.node.component;\n }\n\n return this.page?.state.getValue()?.getComponent();\n }\n\n private get components(): Component[] | undefined {\n if (isComponent(this.component)) {\n return [this.component];\n }\n\n if (!this.component) {\n return this.context?.getChildren();\n }\n\n const component = this.context?.getComponent(...this.component.split('/'));\n\n return component && [component];\n }\n}\n","/*\n * Copyright 2020-2025 Bloomreach\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Component, HostBinding, Input } from '@angular/core';\nimport { Container, Page } from '@bloomreach/spa-sdk';\n\n@Component({\n // eslint-disable-next-line @angular-eslint/component-selector\n selector: 'div.br-container-box',\n templateUrl: './br-container-box.component.html',\n standalone: false,\n})\nexport class BrContainerBoxComponent {\n @Input() component!: Container;\n\n @Input() page!: Page;\n\n @HostBinding('class.hst-container')\n get isPreview(): boolean {\n return this.page?.isPreview();\n }\n}\n","<!--\n Copyright 2020-2025 Bloomreach\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n https://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n -->\n@for (child of component.getChildren(); track $index) {\n<div [ngClass]=\"{ 'hst-container-item': page.isPreview() }\">\n <ng-container [brComponent]=\"child\"></ng-container>\n</div>\n}","/*\n * Copyright 2020-2025 Bloomreach\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Component, HostBinding, Input } from '@angular/core';\nimport { Container, Page } from '@bloomreach/spa-sdk';\n\n@Component({\n // eslint-disable-next-line @angular-eslint/component-selector\n selector: 'div.br-container-inline',\n templateUrl: './br-container-inline.component.html',\n standalone: false,\n})\nexport class BrContainerInlineComponent {\n @Input() component!: Container;\n\n @Input() page!: Page;\n\n @HostBinding('class.hst-container')\n get isPreview(): boolean {\n return this.page?.isPreview();\n }\n}\n","<!--\n Copyright 2020-2025 Bloomreach\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n https://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n -->\n@for (child of component.getChildren(); track $index) {\n<span [ngClass]=\"{ 'hst-container-item': page.isPreview() }\">\n <ng-container [brComponent]=\"child\"></ng-container>\n</span>\n}","/*\n * Copyright 2020-2025 Bloomreach\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Component, HostBinding, Input } from '@angular/core';\nimport { Container, Page } from '@bloomreach/spa-sdk';\n\n@Component({\n // eslint-disable-next-line @angular-eslint/component-selector\n selector: 'ol.br-container-ordered-list',\n templateUrl: './br-container-ordered-list.component.html',\n standalone: false,\n})\nexport class BrContainerOrderedListComponent {\n @Input() component!: Container;\n\n @Input() page!: Page;\n\n @HostBinding('class.hst-container')\n get isPreview(): boolean {\n return this.page?.isPreview();\n }\n}\n","<!--\n Copyright 2020-2025 Bloomreach\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n https://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n -->\n@for (child of component.getChildren(); track $index) {\n<li [ngClass]=\"{ 'hst-container-item': page.isPreview() }\">\n <ng-container [brComponent]=\"child\"></ng-container>\n</li>\n}","/*\n * Copyright 2020-2025 Bloomreach\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Component, HostBinding, Input } from '@angular/core';\nimport { Container, Page } from '@bloomreach/spa-sdk';\n\n@Component({\n // eslint-disable-next-line @angular-eslint/component-selector\n selector: 'ul.br-container-unordered-list',\n templateUrl: './br-container-unordered-list.component.html',\n standalone: false,\n})\nexport class BrContainerUnorderedListComponent {\n @Input() component!: Container;\n\n @Input() page!: Page;\n\n @HostBinding('class.hst-container')\n get isPreview(): boolean {\n return this.page?.isPreview();\n }\n}\n","<!--\n Copyright 2020-2025 Bloomreach\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n https://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n -->\n\n@for (child of component.getChildren(); track $index) {\n<li [ngClass]=\"{ 'hst-container-item': page.isPreview() }\">\n <ng-container [brComponent]=\"child\"></ng-container>\n</li>\n}","/*\n * Copyright 2020-2025 Bloomreach\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n Directive,\n OnChanges,\n OnDestroy,\n Optional,\n SimpleChanges,\n TemplateRef,\n ViewContainerRef,\n} from '@angular/core';\nimport { MetaCollection } from '@bloomreach/spa-sdk';\n\n@Directive({\n standalone: false,\n})\nexport abstract class BrMetaDirective implements OnChanges, OnDestroy {\n protected meta?: MetaCollection | undefined;\n\n private clear?: ReturnType<MetaCollection['render']>;\n\n constructor(private container: ViewContainerRef, @Optional() private template?: TemplateRef<never>) {\n // Constructor intentionally left empty\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n ngOnChanges(changes: SimpleChanges): void {\n this.clear?.();\n this.container.clear();\n\n const { head, tail } = this.render();\n this.clear = head && tail && this.meta?.render(head, tail);\n }\n\n ngOnDestroy(): void {\n this.clear?.();\n this.container.clear();\n }\n\n private render(): { head: any; tail: any } {\n if (!this.template) {\n return {\n head: this.container.element.nativeElement,\n tail: this.container.element.nativeElement,\n };\n }\n\n const embeddedViewRef = this.container.createEmbeddedView(this.template);\n const [head] = embeddedViewRef.rootNodes;\n const [tail] = embeddedViewRef.rootNodes.slice(-1);\n\n return { head, tail };\n }\n}\n","/*\n * Copyright 2020-2025 Bloomreach\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n Directive,\n Injector,\n Input,\n OnChanges,\n OnDestroy,\n SimpleChanges,\n Type,\n ViewContainerRef,\n} from '@angular/core';\nimport { Component, MetaCollection } from '@bloomreach/spa-sdk';\nimport { BrNodeDirective } from './br-node.directive';\nimport { BrPageService } from './br-page/br-page.service';\nimport { BrProps } from './br-props.model';\n\n@Directive({\n selector: '[brNodeComponent]',\n standalone: false,\n})\nexport class BrNodeComponentDirective implements OnChanges, OnDestroy {\n @Input('brNodeComponent') component?: Component;\n\n private clear?: ReturnType<MetaCollection['render']>;\n\n constructor(\n private container: ViewContainerRef,\n private injector: Injector,\n private node: BrNodeDirective,\n protected page: BrPageService,\n ) {\n // Constructor intentionally left empty\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n ngOnChanges(changes: SimpleChanges): void {\n this.clear?.();\n this.container.clear();\n\n const { head, tail } = this.render();\n\n this.clear = head && tail && this.component?.getMeta()?.render(head, tail);\n }\n\n protected getMapping(): Type<BrProps> | undefined {\n return this.component && this.page.mapping[this.component.getName()];\n }\n\n private render(): { head: any; tail: any } {\n if (this.node.template) {\n return this.renderTemplate();\n }\n\n const component = this.getMapping();\n if (!component) {\n return this.renderChildren();\n }\n\n return this.renderMapping(component);\n }\n\n private renderTemplate(): { head: any; tail: any } {\n const embeddedViewRef = this.container.createEmbeddedView(this.node.template!, {\n $implicit: this.component,\n component: this.component,\n page: this.page.state.getValue(),\n });\n const [head] = embeddedViewRef.rootNodes;\n const [tail] = embeddedViewRef.rootNodes.slice(-1);\n\n return { head, tail };\n }\n\n private renderChildren(): { head: any; tail: any } {\n const nodes = this.component\n ?.getChildren()\n ?.map((component) => this.container.createEmbeddedView(\n this.page.node,\n {\n component,\n $implicit: component,\n page: this.page.state.getValue()!,\n },\n ))\n .flatMap((view) => view.rootNodes);\n\n const head = nodes?.[0] ?? this.container.element.nativeElement;\n const tail = nodes?.[nodes.length - 1] ?? head;\n\n return { head, tail };\n }\n\n private renderMapping(component: Type<BrProps>): { head: any; tail: any } {\n const componentRef = this.container.createComponent(component);\n\n componentRef.instance.component = this.component;\n componentRef.instance.page = this.page.state.getValue();\n\n return {\n head: componentRef.location.nativeElement,\n tail: componentRef.location.nativeElement,\n };\n }\n\n ngOnDestroy(): void {\n this.clear?.();\n this.container.clear();\n }\n}\n","/*\n * Copyright 2020-2025 Bloomreach\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Directive, Input, Type } from '@angular/core';\nimport {\n Container,\n TYPE_CONTAINER_INLINE,\n TYPE_CONTAINER_NO_MARKUP,\n TYPE_CONTAINER_ORDERED_LIST,\n TYPE_CONTAINER_UNORDERED_LIST,\n} from '@bloomreach/spa-sdk';\nimport { BrContainerBoxComponent } from './br-container-box/br-container-box.component';\nimport { BrContainerInlineComponent } from './br-container-inline/br-container-inline.component';\nimport { BrContainerOrderedListComponent } from './br-container-ordered-list/br-container-ordered-list.component';\nimport { BrContainerUnorderedListComponent } from './br-container-unordered-list/br-container-unordered-list.component';\nimport { BrNodeComponentDirective } from './br-node-component.directive';\nimport { BrProps } from './br-props.model';\n\n@Directive({\n selector: '[brNodeContainer]',\n standalone: false,\n})\nexport class BrNodeContainerDirective extends BrNodeComponentDirective {\n @Input('brNodeContainer') component?: Container;\n\n protected getMapping(): Type<BrProps> | undefined {\n const type = this.component?.getType();\n\n if (type && type in this.page.mapping) {\n return this.page.mapping[type];\n }\n\n switch (type) {\n case TYPE_CONTAINER_INLINE:\n return BrContainerInlineComponent;\n case TYPE_CONTAINER_ORDERED_LIST:\n return BrContainerOrderedListComponent;\n case TYPE_CONTAINER_UNORDERED_LIST:\n return BrContainerUnorderedListComponent;\n case TYPE_CONTAINER_NO_MARKUP:\n return undefined;\n default:\n return BrContainerBoxComponent;\n }\n }\n}\n","/*\n * Copyright 2020-2025 Bloomreach\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n ChangeDetectorRef,\n Directive,\n Injector,\n Input,\n OnChanges,\n OnDestroy,\n SimpleChanges,\n Type,\n ViewContainerRef,\n} from '@angular/core';\nimport { ContainerItem, TYPE_CONTAINER_ITEM_UNDEFINED } from '@bloomreach/spa-sdk';\nimport { BrContainerItemUndefinedComponent } from './br-container-item-undefined/br-container-item-undefined.component';\nimport { BrNodeComponentDirective } from './br-node-component.directive';\nimport { BrNodeDirective } from './br-node.directive';\nimport { BrPageService } from './br-page/br-page.service';\nimport { BrProps } from './br-props.model';\n\n@Directive({\n selector: '[brNodeContainerItem]',\n standalone: false,\n})\nexport class BrNodeContainerItemDirective extends BrNodeComponentDirective implements OnChanges, OnDestroy {\n constructor(\n container: ViewContainerRef,\n injector: Injector,\n node: BrNodeDirective,\n page: BrPageService,\n private changeDetectorRef: ChangeDetectorRef,\n ) {\n super(container, injector, node, page);\n\n this.onUpdate = this.onUpdate.bind(this);\n }\n\n @Input('brNodeContainerItem') component?: ContainerItem;\n\n ngOnChanges(changes: SimpleChanges): void {\n changes.component?.previousValue?.off('update', this.onUpdate);\n\n super.ngOnChanges(changes);\n\n this.component?.on('update', this.onUpdate);\n }\n\n ngOnDestroy(): void {\n this.component?.off('update', this.onUpdate);\n }\n\n private onUpdate(): void {\n this.changeDetectorRef.markForCheck();\n this.ngOnChanges({});\n this.page.state.getValue()?.sync();\n }\n\n protected getMapping(): Type<BrProps> | undefined {\n const type = this.component?.getType();\n\n if (type && type in this.page.mapping) {\n return this.page.mapping[type];\n }\n\n return this.page.mapping[TYPE_CONTAINER_ITEM_UNDEFINED as any] ?? BrContainerItemUndefinedComponent;\n }\n}\n","/*\n * Copyright 2020-2025 Bloomreach\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Pipe, PipeTransform } from '@angular/core';\nimport { isContainer, isContainerItem, Component } from '@bloomreach/spa-sdk';\n\n@Pipe({\n name: 'brNodeType',\n standalone: false,\n})\nexport class BrNodeTypePipe implements PipeTransform {\n transform(component: Component): string {\n if (isContainerItem(component)) {\n return 'container-item';\n }\n\n if (isContainer(component)) {\n return 'container';\n }\n\n return 'component';\n }\n}\n","/*\n * Copyright 2020-2025 Bloomreach\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { isPlatformBrowser, isPlatformServer } from '@angular/common';\nimport { HttpClient, HttpErrorResponse } from '@angular/common/http';\nimport {\n AfterContentChecked,\n AfterContentInit,\n Component,\n ContentChild,\n EventEmitter,\n Inject,\n Input,\n NgZone,\n OnChanges,\n OnDestroy,\n Optional,\n Output,\n PLATFORM_ID,\n SimpleChanges,\n TemplateRef,\n Type,\n ViewChild,\n makeStateKey,\n StateKey,\n TransferState,\n} from '@angular/core';\nimport {\n Configuration,\n initialize,\n isPage,\n Page,\n PageModel,\n} from '@bloomreach/spa-sdk';\nimport { from, of, Subject } from 'rxjs';\nimport {\n filter,\n map,\n mapTo,\n switchMap,\n take,\n} from 'rxjs/operators';\nimport type { BrComponentContext } from '../br-component.directive';\nimport { BrProps } from '../br-props.model';\nimport { BrNodeContext, BrPageService } from './br-page.service';\n\n/**\n * The brXM page.\n */\n@Component({\n selector: 'br-page',\n templateUrl: './br-page.component.html',\n providers: [BrPageService],\n host: { ngSkipHydration: 'true' },\n standalone: false,\n})\nexport class BrPageComponent implements AfterContentChecked, AfterContentInit, OnChanges, OnDestroy {\n /**\n * The configuration of the SPA SDK.\n * @see https://www.npmjs.com/package/@bloomreach/spa-sdk#configuration\n */\n @Input() configuration!: Omit<Configuration, 'httpClient'>;\n\n /**\n * The brXM and Angular components mapping.\n */\n @Input() mapping: Record<keyof any, Type<BrProps>> = {};\n\n /**\n * The pre-initialized page instance or prefetched page model.\n * Mostly this property should be used to transfer state from the server-side to the client-side.\n */\n @Input() page?: Page | PageModel;\n\n /**\n * The TransferState key is used to transfer the state from the server-side to the client-side.\n * By default, it equals to `brPage`.\n * If `false` is passed then the state transferring feature will be disabled.\n */\n @Input() stateKey: StateKey<PageModel | undefined> | false = makeStateKey('brPage');\n\n /**\n * The current state of the page component.\n */\n @Output() state = this.pageService.state;\n\n /**\n * Http error handling\n */\n @Output() httpError = new EventEmitter<HttpErrorResponse>();\n\n @ViewChild('brNode', { static: true }) node!: TemplateRef<BrNodeContext>;\n\n @ContentChild(TemplateRef, { static: true })\n private template?: TemplateRef<BrComponentContext>;\n\n private afterContentChecked$ = new Subject();\n\n constructor(\n private httpClient: HttpClient,\n private pageService: BrPageService,\n zone: NgZone,\n @Inject(PLATFORM_ID) private platform: any,\n @Optional() private transferState?: TransferState,\n ) {\n this.request = this.request.bind(this);\n\n this.state\n .pipe(\n filter(isPage),\n switchMap((page) => this.afterContentChecked$.pipe(take(1), mapTo(page))),\n )\n .subscribe((page) => zone.runOutsideAngular(() => page.sync()));\n\n this.state\n .pipe(\n filter(() => this.isPlatformServer(this.platform)),\n filter(isPage),\n )\n .subscribe(\n (page) => this.stateKey\n && this.transferState?.set(this.stateKey, page.toJSON()),\n );\n }\n\n get context(): BrNodeContext {\n const page = this.state.getValue();\n const component = page?.getComponent();\n const pageOrNBR = page || this.configuration?.NBRMode;\n\n return {\n component,\n page,\n $implicit: component,\n template: pageOrNBR ? this.template : undefined,\n };\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n if (changes.configuration || changes.page) {\n this.initialize(changes.page?.currentValue);\n }\n\n if (changes.mapping?.currentValue !== this.pageService.mapping) {\n this.pageService.mapping = this.mapping;\n }\n\n if (\n changes.stateKey?.previousValue\n && this.isPlatformServer(this.platform)\n ) {\n if (\n changes.stateKey.currentValue\n && this.transferState?.hasKey(changes.stateKey.previousValue)\n ) {\n this.transferState?.set(\n changes.stateKey.currentValue,\n this.transferState?.get(changes.stateKey.previousValue, undefined),\n );\n }\n\n this.transferState?.remove(changes.stateKey.previousValue);\n }\n }\n\n ngAfterContentChecked(): void {\n this.afterContentChecked$.next(null);\n }\n\n ngAfterContentInit(): void {\n this.pageService.node = this.node;\n }\n\n ngOnDestroy(): void {\n this.state.next(undefined);\n this.state.complete();\n this.afterContentChecked$.complete();\n }\n\n private initialize(page: Page | PageModel | undefined): void {\n if (\n this.stateKey\n && this.isPlatformBrowser(this.platform)\n && this.transferState?.hasKey(this.stateKey)\n ) {\n page = page ?? this.transferState?.get(this.stateKey, undefined);\n this.transferState?.remove(this.stateKey);\n }\n\n const configuration = {\n httpClient: this.request,\n ...this.configuration,\n } as Configuration;\n const observable = page\n ? of(initialize(configuration, page))\n : from(initialize(configuration));\n\n observable.pipe(take(1)).subscribe((state) => {\n this.state.next(state);\n });\n }\n\n private request(\n ...[{ data: body, headers, method, url }]: Parameters<\n Configuration['httpClient']\n >\n ): Promise<void | {\n data: PageModel;\n }> {\n return this.httpClient\n .request<PageModel>(method, url, {\n body,\n headers: headers as Record<string, string | string[]>,\n responseType: 'json',\n })\n .pipe(map((data) => ({ data })))\n .toPromise()\n .catch((error) => this.httpError.emit(error));\n }\n\n isPlatformBrowser(platform: object): boolean {\n return isPlatformBrowser(platform);\n }\n\n isPlatformServer(platform: object): boolean {\n return isPlatformServer(platform);\n }\n}\n","<!--\n Copyright 2020-2025 Bloomreach\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n https://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n -->\n\n<ng-template #brNode let-component let-template=\"template\">\n <ng-container [brNode]=\"component\" [brNodeTemplate]=\"template\">\n <ng-container [ngSwitch]=\"component | brNodeType\">\n <ng-container *ngSwitchCase=\"'container-item'\" [brNodeContainerItem]=\"component\"></ng-container>\n <ng-container *ngSwitchCase=\"'container'\" [brNodeContainer]=\"component\"></ng-container>\n <ng-container *ngSwitchDefault [brNodeComponent]=\"component\"></ng-container>\n </ng-container>\n </ng-container>\n</ng-template>\n\n@if (context?.template) {\n<ng-template [ngTemplateOutlet]=\"brNode\" [ngTemplateOutletContext]=\"context\"></ng-template>\n}","/*\n * Copyright 2020-2025 Bloomreach\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n Directive,\n Input,\n OnChanges,\n Optional,\n SimpleChanges,\n TemplateRef,\n ViewContainerRef,\n} from '@angular/core';\nimport { ManageContentButton, TYPE_MANAGE_CONTENT_BUTTON } from '@bloomreach/spa-sdk';\nimport { BrMetaDirective } from './br-meta.directive';\nimport { BrPageComponent } from './br-page/br-page.component';\n\n/**\n * The button directive that opens for editing a content.\n */\n@Directive({\n selector: '[brManageContentButton]',\n standalone: false,\n})\nexport class BrManageContentButtonDirective extends BrMetaDirective implements OnChanges, ManageContentButton {\n @Input('brManageContentButton') content?: ManageContentButton['content'];\n\n @Input() documentTemplateQuery?: ManageContentButton['documentTemplateQuery'];\n\n @Input() folderTemplateQuery?: ManageContentButton['folderTemplateQuery'];\n\n @Input() path?: ManageContentButton['path'];\n\n @Input() parameter?: ManageContentButton['parameter'];\n\n @Input() pickerConfiguration?: ManageContentButton['pickerConfiguration'];\n\n @Input() pickerEnableUpload?: ManageContentButton['pickerEnableUpload'];\n\n @Input() pickerInitialPath?: ManageContentButton['pickerInitialPath'];\n\n @Input() pickerRemembersLastVisited?: ManageContentButton['pickerRemembersLastVisited'];\n\n @Input() pickerRootPath?: ManageContentButton['pickerRootPath'];\n\n @Input() pickerSelectableNodeTypes?: ManageContentButton['pickerSelectableNodeTypes'];\n\n @Input() relative?: ManageContentButton['relative'];\n\n @Input() root?: ManageContentButton['root'];\n\n constructor(\n container: ViewContainerRef,\n @Optional() template?: TemplateRef<never>,\n @Optional() private page?: BrPageComponent,\n ) {\n super(container, template);\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n this.meta = this.page?.state.getValue()?.getButton(TYPE_MANAGE_CONTENT_BUTTON, this);\n\n super.ngOnChanges(changes);\n }\n}\n","/*\n * Copyright 2020-2025 Bloomreach\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n Directive,\n Input,\n OnChanges,\n Optional,\n SimpleChanges,\n TemplateRef,\n ViewContainerRef,\n} from '@angular/core';\nimport { Menu, TYPE_MANAGE_MENU_BUTTON } from '@bloomreach/spa-sdk';\nimport { BrMetaDirective } from './br-meta.directive';\nimport { BrPageComponent } from './br-page/br-page.component';\n\n/**\n * The button directive that opens a menu editor.\n */\n@Directive({\n selector: '[brManageMenuButton]',\n standalone: false,\n})\nexport class BrManageMenuButtonDirective extends BrMetaDirective implements OnChanges {\n /**\n * The related menu model.\n */\n @Input('brManageMenuButton') menu!: Menu;\n\n constructor(\n container: ViewContainerRef,\n @Optional() template?: TemplateRef<never>,\n @Optional() private page?: BrPageComponent,\n ) {\n super(container, template);\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n this.meta = this.page?.state.getValue()?.getButton(TYPE_MANAGE_MENU_BUTTON, this.menu);\n\n super.ngOnChanges(changes);\n }\n}\n","/*\n * Copyright 2020-2025 Bloomreach\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { CommonModule } from '@angular/common';\nimport { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';\nimport { NgModule } from '@angular/core';\n\nimport { BrContainerItemUndefinedComponent } from './br-container-item-undefined/br-container-item-undefined.component';\nimport { BrContainerBoxComponent } from './br-container-box/br-container-box.component';\nimport { BrContainerInlineComponent } from './br-container-inline/br-container-inline.component';\nimport { BrContainerOrderedListComponent } from './br-container-ordered-list/br-container-ordered-list.component';\nimport { BrContainerUnorderedListComponent } from './br-container-unordered-list/br-container-unordered-list.component';\nimport { BrComponentDirective } from './br-component.directive';\nimport { BrManageContentButtonDirective } from './br-manage-content-button.directive';\nimport { BrManageMenuButtonDirective } from './br-manage-menu-button.directive';\nimport { BrNodeTypePipe } from './br-node-type.pipe';\nimport { BrNodeComponentDirective } from './br-node-component.directive';\nimport { BrNodeContainerDirective } from './br-node-container.directive';\nimport { BrNodeContainerItemDirective } from './br-node-container-item.directive';\nimport { BrNodeDirective } from './br-node.directive';\nimport { BrPageComponent } from './br-page/br-page.component';\n\n@NgModule({\n declarations: [\n BrComponentDirective,\n BrContainerBoxComponent,\n BrContainerInlineComponent,\n BrContainerOrderedListComponent,\n BrContainerUnorderedListComponent,\n BrContainerItemUndefinedComponent,\n BrManageContentButtonDirective,\n BrManageMenuButtonDirective,\n BrNodeComponentDirective,\n BrNodeContainerDirective,\n BrNodeContainerItemDirective,\n BrNodeDirective,\n BrNodeTypePipe,\n BrPageComponent,\n ],\n exports: [BrComponentDirective, BrManageContentButtonDirective, BrManageMenuButtonDirective, BrPageComponent],\n imports: [CommonModule],\n providers: [provideHttpClient(withInterceptorsFromDi())],\n})\nexport class BrSdkModule {}\n","/*\n * Copyright 2020-2025 Bloomreach\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Component, Page } from '@bloomreach/spa-sdk';\n\n/**\n * The mapped component properties.\n */\nexport interface BrProps<T extends Component = Component> {\n /**\n * The mapped component.\n */\n component?: T;\n\n /**\n * The current page.\n */\n page?: Page;\n}\n","/*\n * Copyright 2020-2025 Bloomreach\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport * from './lib/br-sdk.module';\nexport * from './lib/br-component.directive';\nexport * from './lib/br-manage-content-button.directive';\nexport * from './lib/br-manage-menu-button.directive';\nexport * from './lib/br-page/br-page.component';\nexport * from './lib/br-page/br-page.service';\nexport * from './lib/br-props.model';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1.BrNodeDirective","i2.BrPageService","i2.BrComponentDirective","i3","i4.BrNodeComponentDirective","i5.BrNodeContainerDirective","i6.BrNodeContainerItemDirective","i7.BrNodeDirective","i8.BrNodeTypePipe","i1.BrPageComponent"],"mappings":";;;;;;;;;;AAAA;;;;;;;;;;;;;;AAcG;MAUU,iCAAiC,CAAA;8GAAjC,iCAAiC,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAAjC,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,iCAAiC,4HCxB9C,8qBAiBA,EAAA,CAAA,CAAA;;2FDOa,iCAAiC,EAAA,UAAA,EAAA,CAAA;kBAL7C,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,6BAA6B,cAE3B,KAAK,EAAA,QAAA,EAAA,8qBAAA,EAAA;8BAGR,SAAS,EAAA,CAAA;sBAAjB;;;AEzBH;;;;;;;;;;;;;;AAcG;MAUU,eAAe,CAAA;8GAAf,eAAe,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;kGAAf,eAAe,EAAA,YAAA,EAAA,KAAA,EAAA,QAAA,EAAA,UAAA,EAAA,MAAA,EAAA,EAAA,SAAA,EAAA,CAAA,QAAA,EAAA,WAAA,CAAA,EAAA,QAAA,EAAA,CAAA,gBAAA,EAAA,UAAA,CAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;2FAAf,eAAe,EAAA,UAAA,EAAA,CAAA;kBAJ3B,SAAS;AAAC,YAAA,IAAA,EAAA,C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