@pepperi-addons/ngx-lib 0.4.2-beta.321 → 0.4.2-beta.323
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/core/common/services/addon.service.d.ts +3 -0
- package/esm2020/core/common/services/addon.service.mjs +58 -13
- package/esm2020/core/common/services/utilities.service.mjs +8 -13
- package/esm2020/group-buttons/group-buttons.component.mjs +19 -6
- package/esm2020/list/list.component.mjs +23 -6
- package/esm2020/remote-loader/remote-loader-element.component.mjs +57 -1
- package/fesm2015/pepperi-addons-ngx-lib-group-buttons.mjs +18 -5
- package/fesm2015/pepperi-addons-ngx-lib-group-buttons.mjs.map +1 -1
- package/fesm2015/pepperi-addons-ngx-lib-list.mjs +23 -5
- package/fesm2015/pepperi-addons-ngx-lib-list.mjs.map +1 -1
- package/fesm2015/pepperi-addons-ngx-lib-remote-loader.mjs +61 -5
- package/fesm2015/pepperi-addons-ngx-lib-remote-loader.mjs.map +1 -1
- package/fesm2015/pepperi-addons-ngx-lib.mjs +65 -24
- package/fesm2015/pepperi-addons-ngx-lib.mjs.map +1 -1
- package/fesm2020/pepperi-addons-ngx-lib-group-buttons.mjs +18 -5
- package/fesm2020/pepperi-addons-ngx-lib-group-buttons.mjs.map +1 -1
- package/fesm2020/pepperi-addons-ngx-lib-list.mjs +22 -5
- package/fesm2020/pepperi-addons-ngx-lib-list.mjs.map +1 -1
- package/fesm2020/pepperi-addons-ngx-lib-remote-loader.mjs +56 -1
- package/fesm2020/pepperi-addons-ngx-lib-remote-loader.mjs.map +1 -1
- package/fesm2020/pepperi-addons-ngx-lib.mjs +64 -24
- package/fesm2020/pepperi-addons-ngx-lib.mjs.map +1 -1
- package/group-buttons/group-buttons.component.d.ts +4 -2
- package/list/list.component.d.ts +5 -0
- package/package.json +1 -1
- package/remote-loader/remote-loader-element.component.d.ts +1 -0
|
@@ -2,7 +2,7 @@ import * as i0 from '@angular/core';
|
|
|
2
2
|
import { Injectable, EventEmitter, createNgModuleRef, ViewContainerRef, Component, ViewChild, Input, Output, Optional, TemplateRef, NgModule } from '@angular/core';
|
|
3
3
|
import { coerceNumberProperty } from '@angular/cdk/coercion';
|
|
4
4
|
import * as i1 from '@pepperi-addons/ngx-lib';
|
|
5
|
-
import { PepNgxLibModule } from '@pepperi-addons/ngx-lib';
|
|
5
|
+
import { PepAddonService, PepNgxLibModule } from '@pepperi-addons/ngx-lib';
|
|
6
6
|
import * as i2 from '@angular/common';
|
|
7
7
|
import { CommonModule } from '@angular/common';
|
|
8
8
|
import * as i1$1 from '@pepperi-addons/ngx-lib/dialog';
|
|
@@ -238,6 +238,7 @@ class PepRemoteLoaderElementComponent {
|
|
|
238
238
|
this._elementName = '';
|
|
239
239
|
this._blockType = '';
|
|
240
240
|
this._alreadyLoaded = false;
|
|
241
|
+
this._routeUrlSubscription = null;
|
|
241
242
|
}
|
|
242
243
|
populateProps() {
|
|
243
244
|
for (const prop in this.props) {
|
|
@@ -279,6 +280,11 @@ class PepRemoteLoaderElementComponent {
|
|
|
279
280
|
this.populateProps();
|
|
280
281
|
}
|
|
281
282
|
ngOnDestroy() {
|
|
283
|
+
this._routeUrlSubscription?.unsubscribe();
|
|
284
|
+
this._routeUrlSubscription = null;
|
|
285
|
+
if (this._blockType === 'SettingsBlock' && this._elementName) {
|
|
286
|
+
this.pepAddonService.disconnectInternalRouter(this._elementName);
|
|
287
|
+
}
|
|
282
288
|
if (this.element) {
|
|
283
289
|
try {
|
|
284
290
|
if (this.events) {
|
|
@@ -392,6 +398,30 @@ class PepRemoteLoaderElementComponent {
|
|
|
392
398
|
this.pepAddonService.setAddonStaticFolder(publicPath, this.options.addonId);
|
|
393
399
|
}
|
|
394
400
|
}
|
|
401
|
+
// The remote reads window.location once, synchronously, during its own bootstrap —
|
|
402
|
+
// its internal router-sync (see e.g. @angular-architects/module-federation-tools'
|
|
403
|
+
// connectRouter) assumes a path relative to real root, and uses whatever shape it
|
|
404
|
+
// sees to decide which leading segments are its own fixed "container route" vs. a
|
|
405
|
+
// later-replaceable child segment. If this shell is served under its own base href
|
|
406
|
+
// (e.g. dev-only /angular — see angular.json's baseHref/servePath), briefly present
|
|
407
|
+
// the remote with the base-stripped path for the duration of this one-time load, so
|
|
408
|
+
// it locks in the same container-route shape it would see at real root (e.g. under
|
|
409
|
+
// React) — then restore the real address immediately after. Safe: this component
|
|
410
|
+
// isn't rendering anything until the promise resolves anyway, and replaceState never
|
|
411
|
+
// fires popstate, so this shell's own Router never observes the swap.
|
|
412
|
+
const isSettingsBlock = this._blockType === 'SettingsBlock';
|
|
413
|
+
const originalUrl = `${location.pathname}${location.search}${location.hash}`;
|
|
414
|
+
const strippedPath = PepAddonService.stripBaseHref(location.pathname);
|
|
415
|
+
const shouldSwapUrl = isSettingsBlock && strippedPath !== location.pathname;
|
|
416
|
+
// Bypass this shell's own base-href-restoring history guard (see bootstrap.ts) for
|
|
417
|
+
// this one, deliberate swap — otherwise it silently reverts it before the remote
|
|
418
|
+
// ever reads location.pathname.
|
|
419
|
+
const win = window;
|
|
420
|
+
if (shouldSwapUrl) {
|
|
421
|
+
win.__pepAllowRawHistoryWrite = true;
|
|
422
|
+
history.replaceState(history.state, '', `${strippedPath}${location.search}${location.hash}`);
|
|
423
|
+
win.__pepAllowRawHistoryWrite = false;
|
|
424
|
+
}
|
|
395
425
|
// debugger;
|
|
396
426
|
// this.loadRemoteScript(this.options['remoteEntry']).then(() => {
|
|
397
427
|
loadRemoteModule(this.options).then((m) => {
|
|
@@ -403,8 +433,33 @@ class PepRemoteLoaderElementComponent {
|
|
|
403
433
|
// Fix internal routing bug.
|
|
404
434
|
if (this._blockType === 'SettingsBlock') {
|
|
405
435
|
this.pepAddonService.connectInternalRouter(this._elementName);
|
|
436
|
+
// Angular reuses this SAME component instance across a child-segment-only
|
|
437
|
+
// route change (e.g. settings_block/:uuid/:slug's own '**' child route going
|
|
438
|
+
// from .../pages to .../{pageKey}) — ngAfterContentInit only fires once, so
|
|
439
|
+
// without this the addon's own internal router is only ever told the location
|
|
440
|
+
// at initial mount, and never learns about a later in-place navigation. this
|
|
441
|
+
// .route.url (unlike .snapshot) emits again on exactly that kind of change.
|
|
442
|
+
if (this.route) {
|
|
443
|
+
this._routeUrlSubscription = this.route.url.subscribe(() => {
|
|
444
|
+
this.pepAddonService.connectInternalRouter(this._elementName);
|
|
445
|
+
});
|
|
446
|
+
}
|
|
406
447
|
}
|
|
407
448
|
this.load.emit();
|
|
449
|
+
// The remote's own bootstrap (its custom element's connectedCallback, just
|
|
450
|
+
// triggered by appendChild above) can defer its actual router-sync read of
|
|
451
|
+
// window.location past this synchronous block (zone-scheduled change detection,
|
|
452
|
+
// etc.) — push the restore one macrotask out so it reliably runs after that,
|
|
453
|
+
// not before it.
|
|
454
|
+
if (shouldSwapUrl) {
|
|
455
|
+
setTimeout(() => {
|
|
456
|
+
if (location.pathname === strippedPath) {
|
|
457
|
+
win.__pepAllowRawHistoryWrite = true;
|
|
458
|
+
history.replaceState(history.state, '', originalUrl);
|
|
459
|
+
win.__pepAllowRawHistoryWrite = false;
|
|
460
|
+
}
|
|
461
|
+
}, 0);
|
|
462
|
+
}
|
|
408
463
|
}).catch((error) => {
|
|
409
464
|
throw error;
|
|
410
465
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pepperi-addons-ngx-lib-remote-loader.mjs","sources":["../../../projects/ngx-lib/remote-loader/remote-loader.service.ts","../../../projects/ngx-lib/remote-loader/remote-loader.component.ts","../../../projects/ngx-lib/remote-loader/remote-loader-element.component.ts","../../../projects/ngx-lib/remote-loader/addon-block-loader.component.ts","../../../projects/ngx-lib/remote-loader/addon-block-loader.component.html","../../../projects/ngx-lib/remote-loader/addon-block-loader.service.ts","../../../projects/ngx-lib/remote-loader/remote-loader.module.ts","../../../projects/ngx-lib/remote-loader/public-api.ts","../../../projects/ngx-lib/remote-loader/pepperi-addons-ngx-lib-remote-loader.ts"],"sourcesContent":["import { coerceNumberProperty } from '@angular/cdk/coercion';\nimport { Injectable } from '@angular/core';\nimport { PepAddonService, PepHttpService, PepSessionService} from '@pepperi-addons/ngx-lib';\nimport { IPepRemoteLoaderParamsOptions, PepRemoteLoaderOptions } from './remote-loader.model';\nimport { IBlockLoaderData } from './remote-loader.model';\n\n@Injectable({ \n providedIn: 'root' \n})\nexport class PepRemoteLoaderService {\n constructor(\n private httpService: PepHttpService,\n private sessionService: PepSessionService,\n private addonService: PepAddonService\n ) {\n //\n }\n\n private getBlockLoaderDataUrl(options: IPepRemoteLoaderParamsOptions): string {\n const fileName = 'addon_blocks';\n const pagesAddonUuid = this.addonService.getPagesAddonUUID();\n let pagesBaseUrl;\n\n // For devServer run server on localhost.\n if(options.pagesDevServer?.length > 0) {\n pagesBaseUrl = `${options.pagesDevServer}/${fileName}`;\n } else {\n const baseUrl = this.sessionService.getPapiBaseUrl();\n pagesBaseUrl = `${baseUrl}/addons/api/${pagesAddonUuid}/${fileName}`;\n }\n\n const url = `${pagesBaseUrl}/get_addon_block_loader_data?name=${options.name}&slugName=${options.slugName}&blockType=${options.blockType}&addonUUID=${options.addonUUID}`;\n return url;\n }\n\n getRemoteLoaderOptions(blockLoaderData: IBlockLoaderData, blockRemoteEntry = '', type: 'script' | 'module' | 'manifest' = 'module'): PepRemoteLoaderOptions {\n const loadAsElement = blockLoaderData.relation.ElementName?.length > 0;\n const exposedModule = loadAsElement ? (blockLoaderData.relation.ElementsModule || 'WebComponents') : blockLoaderData.relation.ModuleName;\n const res = {\n type: type,\n remoteEntry: blockRemoteEntry.length > 0 ? blockRemoteEntry : `${blockLoaderData.addonPublicBaseURL}${blockLoaderData.relation.AddonRelativeURL}.js`,\n remoteName: blockLoaderData.relation.AddonRelativeURL, // For script type, this is the name of the script.\n exposedModule: `./${exposedModule}`,\n addonId: blockLoaderData.relation.AddonUUID, // For local use (adding the relative path to the assets).\n }\n\n // If it's web components\n if (loadAsElement) {\n res['elementName'] = blockLoaderData.relation.ElementName;\n } else { // For load the component from the module.\n res['componentName'] = blockLoaderData.relation.ComponentName; \n }\n\n return res;\n }\n\n private getBlockLoaderDataSuccess(data: IBlockLoaderData, options: IPepRemoteLoaderParamsOptions) {\n const ngVersionNumber = coerceNumberProperty(data.relation?.SubType?.toLocaleLowerCase().replace('ng', ''), 14);\n const type = ngVersionNumber >= 14 ? 'module' : 'script';\n\n return this.getRemoteLoaderOptions(data, options.blockRemoteEntry, type);\n }\n\n private getBlockLoaderDataError(options: IPepRemoteLoaderParamsOptions) {\n const nameMsg = options.blockType === 'SettingsBlock' ? `slugName - ${options.slugName}` : `name - ${options.name}`\n return(`Block with ${nameMsg} is not found for type - ${options.blockType}`);\n }\n\n async getBlockRemoteLoaderOptions(options: IPepRemoteLoaderParamsOptions): Promise<PepRemoteLoaderOptions> {\n options.blockType = options.blockType ?? 'AddonBlock';\n options.name = options.name ?? '';\n options.slugName = options.slugName ?? '';\n options.addonUUID = options.addonUUID ?? '';\n \n return new Promise((resolve, reject) => {\n if (options.name?.length > 0 || (options.slugName?.length > 0 && options.blockType === 'SettingsBlock')) {\n\n if (options.blockType === 'SettingsBlock' || options.blockType === 'LogicBlock' || options.pagesDevServer?.length > 0) {\n // Work online for settings blocks or logic blocks or debug only !!!\n const blockLoaderDataUrl = this.getBlockLoaderDataUrl(options);\n this.httpService.getHttpCall(blockLoaderDataUrl).toPromise().then((data: IBlockLoaderData) => {\n resolve(this.getBlockLoaderDataSuccess(data, options));\n }).catch(err => {\n reject(this.getBlockLoaderDataError(options));\n });\n } else {\n // Work offline !!!\n this.addonService.emitEvent(\"GetBlockLoaderData\", {\n Name: options.name,\n // SlugName: options.slugName,\n BlockType: options.blockType,\n // AddonUUID: options.addonUUID\n }).then((res: IBlockLoaderData) => {\n resolve(this.getBlockLoaderDataSuccess(res, options));\n }).catch(err => {\n reject(this.getBlockLoaderDataError(options));\n });\n }\n } else {\n if (options.blockType === 'SettingsBlock') {\n reject(`slugName is not supplied`);\n }\n else {\n reject(`name is not supplied`);\n }\n }\n });\n }\n}\n","import { Component, Input, OnChanges, ViewChild, ViewContainerRef, Injector, EventEmitter, Output, ComponentRef, SimpleChanges, createNgModuleRef } from '@angular/core';\nimport { loadRemoteModule } from '@angular-architects/module-federation';\nimport { PepAddonService } from '@pepperi-addons/ngx-lib';\nimport { PepRemoteLoaderOptions } from './remote-loader.model';\n\n@Component({\n selector: 'pep-remote-loader',\n template: `\n <!-- <mat-spinner *ngIf=\"showSpinner; else placeHolder\"></mat-spinner> -->\n <ng-template #placeHolder></ng-template>\n `\n})\nexport class PepRemoteLoaderComponent implements OnChanges {\n @ViewChild('placeHolder', { read: ViewContainerRef, static: true }) viewContainer: ViewContainerRef;\n \n private _options: PepRemoteLoaderOptions = null;\n @Input()\n set options(value: PepRemoteLoaderOptions) {\n this._options = value;\n if (value) {\n this.loadModule();\n }\n }\n get options(): PepRemoteLoaderOptions {\n return this._options;\n }\n \n // This is the data passed by the API Design documentation.\n private _hostObject: any = null;\n @Input()\n set hostObject(value: any) { \n this._hostObject = value;\n this.setHostComponentIntoComponentRef();\n }\n get hostObject(): any {\n return this._hostObject;\n }\n\n @Output() hostEvents: EventEmitter<any> = new EventEmitter();\n @Output() load: EventEmitter<any> = new EventEmitter();\n // showSpinner = true;\n \n private compRef: ComponentRef<any>;\n\n constructor(\n private injector: Injector,\n private pepAddonService: PepAddonService\n ) { }\n\n private setHostComponentIntoComponentRef() {\n if (this.hostObject && this.compRef?.instance) {\n this.compRef.instance.hostObject = this.hostObject;\n\n // TODO: Check if this is needed?? if not remove this.\n // if (this.compRef?.instance?.ngOnChanges) {\n // this.compRef.instance.ngOnChanges(this.hostObject);\n // }\n }\n }\n\n ngOnChanges(changes: SimpleChanges) {\n // if (changes?.options?.currentValue) {\n // this.loadModule(changes?.options?.currentValue);\n // }\n }\n\n private async loadModule() {\n try {\n this.viewContainer?.clear();\n \n if (this.options.exposedModule?.length > 0) { // Load module\n if (this.options?.addonId && (this.options.type === 'module' || this.options.type === 'script')) {\n const lastSlashIndex = this.options.remoteEntry?.lastIndexOf('/') || -1;\n \n if (lastSlashIndex > 0) {\n const publicPath = this.options.remoteEntry.substring(0, lastSlashIndex + 1);\n this.pepAddonService.setAddonStaticFolder(publicPath, this.options.addonId);\n }\n }\n\n const module = await loadRemoteModule(this.options).then(m => m);\n const moduleRef = createNgModuleRef(module[this.options.exposedModule.replace('./','')], this.injector);\n this.compRef = this.viewContainer.createComponent(module[this.options.componentName], { injector: this.injector, ngModuleRef: moduleRef });\n } \n // Check if this is in use??? (comment out in Angular 14 version)\n // else { // Load Component\n // const componentType = await loadRemoteModule(this.options).then(m => m[this.options.componentName]);\n // this.compRef = this.viewContainer.createComponent(componentType, { injector: this.injector });\n // }\n\n this.load.emit();\n\n if (this.compRef) {\n this.setHostComponentIntoComponentRef();\n \n this.compRef?.instance['hostEvents']?.subscribe(e => {\n // switch(e.action){\n // case 'addon-loaded':\n // this.showSpinner = false;\n // }\n this.hostEvents.emit(e)\n });\n }\n } catch(error) {\n console.error(error);\n }\n }\n\n ngOnDestroy(): void {\n this.compRef?.destroy();\n this.viewContainer?.clear();\n }\n}\n\n","import { AfterContentInit, Component, ElementRef, EventEmitter, Input, OnChanges, OnDestroy, Optional, Output, Renderer2, ViewChild, ViewContainerRef } from '@angular/core';\nimport { ActivatedRoute } from '@angular/router';\nimport { loadRemoteModule } from '@angular-architects/module-federation';\nimport { PepAddonService } from '@pepperi-addons/ngx-lib';\nimport { PepRemoteLoaderOptions } from './remote-loader.model';\nimport { PepRemoteLoaderService } from './remote-loader.service';\nimport { BehaviorSubject, Observable, debounceTime } from 'rxjs';\n\ninterface BlockRemoteLoaderOptionsData { \n name?: string, \n slugName?: string, \n blockType?: string, \n addonUUID?: string, \n blockRemoteEntry?: string \n}\n\n@Component({\n selector: 'pep-remote-loader-element',\n template: `\n <!--<div #vc style=\"height: inherit;\"></div>-->\n `,\n styles: [`\n :host { width:100%; height: inherit; overflow: inherit; }\n :host::ng-deep > * {\n height: inherit;\n }\n `],\n})\nexport class PepRemoteLoaderElementComponent implements AfterContentInit, OnChanges, OnDestroy {\n @Input() options: PepRemoteLoaderOptions;\n @Input() props: { [prop: string]: unknown };\n @Input() events: { [event: string]: (event: Event) => void };\n\n @Output() load: EventEmitter<any> = new EventEmitter();\n\n element: HTMLElement = null;\n\n private _elementName = '';\n private _blockType = '';\n private _alreadyLoaded = false;\n // // This is for debounce.\n // private _getBlockRemoteLoaderOptionsSubject = new BehaviorSubject<BlockRemoteLoaderOptionsData>(null);\n // get getBlockRemoteLoaderOptionsDebouncedSubject$(): Observable<BlockRemoteLoaderOptionsData> {\n // return this._getBlockRemoteLoaderOptionsSubject.asObservable().pipe(debounceTime(250));\n // }\n\n constructor(\n private renderer: Renderer2,\n private el:ElementRef,\n private pepAddonService: PepAddonService,\n private remoteLoaderService: PepRemoteLoaderService,\n @Optional() private route: ActivatedRoute\n ) { \n\n }\n\n private populateProps() {\n for (const prop in this.props) {\n this.element[prop] = this.props[prop];\n }\n }\n\n private setupEvents() {\n for (const event in this.events) {\n this.element.addEventListener(event, this.events[event]);\n }\n }\n\n private async loadOptionsFromRoute() {\n const params = this.route?.snapshot.params;\n const data = this.route?.snapshot.data;\n this._blockType = data?.blockType || 'SettingsBlock';\n\n const slugName = params?.slugName || data?.slugName;\n const blockName = params?.blockName || data?.blockName;\n \n if (blockName?.length > 0 || (slugName?.length > 0 && this._blockType === 'SettingsBlock')) {\n const addonUUID = params?.addonUUID || data?.addonUUID || '';\n const blockRemoteEntry = data?.blockRemoteEntry || '';\n\n this.options = await this.remoteLoaderService.getBlockRemoteLoaderOptions({\n name: blockName,\n slugName,\n blockType: this._blockType,\n addonUUID,\n blockRemoteEntry\n });\n\n const fileName = `${this.options['remoteName']}.js`;\n\n if (window.location.search.indexOf('dev=true') > 0) {\n this.options['remoteEntry'] = `http://localhost:4400/${fileName}`;\n }\n\n // Set the data into the props cause this component is loading from the route.\n this.props = data;\n }\n }\n\n ngOnChanges(): void {\n if (!this.element) return;\n\n this.populateProps();\n }\n\n ngOnDestroy() {\n if (this.element) {\n try {\n if (this.events) {\n for (const event in this.events) {\n try {\n this.element.removeEventListener(event, this.events[event]);\n } catch {\n // ignore\n }\n }\n }\n\n // ADO 1036660: Fix React teardown race in hosted web-components.\n // The host (Angular) may destroy/remove the element subtree while the remote (React) is still\n // unmounting, which can surface as `NotFoundError: Failed to execute 'removeChild' on 'Node'`.\n // If the remote element exposes `pepperiUnmount()`, call it here to let it cleanup before DOM removal.\n\n const elToUnmount = this.element;\n let parkedContainer: HTMLDivElement = null;\n const cleanup = () => {\n try {\n if (parkedContainer?.parentNode) {\n parkedContainer.parentNode.removeChild(parkedContainer);\n }\n } catch {\n // ignore\n }\n };\n\n // Detach the remote element subtree so Angular destroying this host won't remove it while React is still unmounting.\n try {\n if (typeof document !== 'undefined' && elToUnmount?.parentNode && document.body) {\n parkedContainer = document.createElement('div');\n parkedContainer.style.display = 'none';\n document.body.appendChild(parkedContainer);\n parkedContainer.appendChild(elToUnmount);\n }\n } catch {\n // ignore\n }\n\n const anyEl = elToUnmount as any;\n const maybeUnmount = anyEl?.pepperiUnmount;\n if (typeof maybeUnmount === 'function') {\n try {\n const res = maybeUnmount.call(anyEl);\n if (res && typeof res.then === 'function') {\n res.finally(() => cleanup());\n } else {\n cleanup();\n }\n } catch {\n // ignore\n cleanup();\n }\n } else {\n cleanup();\n }\n } catch {\n // ignore\n }\n\n this.element = null;\n }\n }\n\n /**\n * Loads the remote JS bundle as a script tag for web component remotes.\n * If the script is already loaded, resolves immediately.\n */\n // private async loadRemoteScript(remoteEntryUrl: string): Promise<any> {\n // return new Promise<any>((resolve, reject) => {\n // if (document.querySelector(`script[src=\"${remoteEntryUrl}\"]`)) {\n // // If script is already loaded, try to get the module\n // import(remoteEntryUrl).then(module => {\n // if (module && module.init) {\n // module.init();\n // }\n // resolve(module);\n // }).catch(err => reject(err));\n // return;\n // }\n \n // const script = document.createElement('script');\n // script.type = 'module';\n // script.src = remoteEntryUrl;\n \n // script.onload = () => {\n // // After script is loaded, dynamically import it to get the module\n // import(remoteEntryUrl).then(module => {\n // if (module && module.init) {\n // module.init();\n // }\n // resolve(module);\n // }).catch(err => reject(err));\n // };\n \n // script.onerror = (err) => reject(err);\n // document.body.appendChild(script);\n // });\n // }\n\n private loadElementFromModule() {\n\n if (!this.options) {\n // throw new Error('No options supplied to the component.');\n console.info('No options supplied to the component.');\n return;\n } else {\n if (this.options?.addonId && (this.options.type === 'module' || this.options.type === 'script')) {\n const lastSlashIndex = this.options.remoteEntry?.lastIndexOf('/') || -1;\n \n if (lastSlashIndex > 0) {\n const publicPath = this.options.remoteEntry.substring(0, lastSlashIndex + 1);\n this.pepAddonService.setAddonStaticFolder(publicPath, this.options.addonId);\n }\n }\n // debugger;\n // this.loadRemoteScript(this.options['remoteEntry']).then(() => {\n loadRemoteModule(this.options).then((m) => {\n this._elementName = this.options.elementName;\n this.element = this.renderer.createElement(this._elementName);\n this.populateProps();\n this.setupEvents();\n \n this.renderer.appendChild(this.el.nativeElement, this.element);\n \n // Fix internal routing bug.\n if (this._blockType === 'SettingsBlock') {\n this.pepAddonService.connectInternalRouter(this._elementName);\n }\n \n this.load.emit();\n }).catch((error) => {\n throw error;\n });\n }\n }\n\n ngAfterContentInit() {\n try {\n // if (!this.element) { maybe the load of the element is too long so change to flag.\n if (!this._alreadyLoaded) {\n this._alreadyLoaded = true;\n // If the options is not supplied then we need to get it from the route.\n if (!this.options) {\n this.loadOptionsFromRoute().then(() => {\n this.loadElementFromModule();\n });\n } else {\n this.loadElementFromModule();\n }\n }\n }\n catch(error) {\n console.error(error);\n }\n }\n}","import { WebComponentWrapperOptions } from '@angular-architects/module-federation-tools';\nimport { Component, OnInit, Input, Output, EventEmitter, TemplateRef, ViewChild, OnDestroy } from '@angular/core';\nimport { MatDialogRef } from '@angular/material/dialog';\nimport { IPepRemoteLoaderParamsOptions, PepRemoteLoaderOptions } from './remote-loader.model';\nimport { PepRemoteLoaderService } from './remote-loader.service';\n\n@Component({\n selector: 'pep-addon-block-loader',\n templateUrl: './addon-block-loader.component.html',\n styleUrls: ['./addon-block-loader.component.scss']\n})\nexport class PepAddonBlockLoaderComponent implements OnInit, OnDestroy {\n @ViewChild('dialogTemplate', { static: true, read: TemplateRef }) dialogTemplate!: TemplateRef<any>;\n \n @Input() addonId = '';\n @Input() remoteEntry = '';\n @Input() slugName = '';\n\n private _blockType = 'AddonBlock';\n @Input() \n set blockType(value: string) {\n this._blockType = value;\n }\n get blockType(): string {\n return this._blockType;\n }\n\n private _name = '';\n @Input() \n set name(value: string) {\n this._name = value;\n }\n get name(): string {\n return this._name;\n }\n\n @Input() hostObject = null;\n \n private _dialogRef: MatDialogRef<any> = null;\n @Input()\n set dialogRef(value: MatDialogRef<any>) {\n this._dialogRef = value;\n this.inDialog = this._dialogRef != null;\n }\n get dialogRef(): MatDialogRef<any> {\n return this._dialogRef;\n }\n \n private _remoteLoaderOptions: PepRemoteLoaderOptions = null;\n @Input() \n set remoteLoaderOptions(value: PepRemoteLoaderOptions) {\n this._remoteLoaderOptions = value;\n this.loadElement = this.remoteLoaderOptions?.elementName?.length > 0;\n }\n get remoteLoaderOptions(): PepRemoteLoaderOptions {\n return this._remoteLoaderOptions;\n }\n\n @Output() hostEvents: EventEmitter<any> = new EventEmitter<any>();\n @Output() blockLoad: EventEmitter<void> = new EventEmitter<void>();\n \n protected inDialog = false;\n protected loadElement = false;\n\n protected onHostEventsCallback: (event: CustomEvent) => void;\n\n constructor(private remoteLoaderService: PepRemoteLoaderService) {\n this.onHostEventsCallback = (event: CustomEvent) => {\n this.onHostEvents(event.detail);\n }\n }\n \n ngOnInit() {\n if (this.remoteLoaderOptions === null) {\n const rlpOptions: IPepRemoteLoaderParamsOptions = {\n name: this.name,\n slugName: this.slugName,\n blockType: this.blockType,\n addonUUID: this.addonId,\n blockRemoteEntry: this.remoteEntry\n };\n\n this.remoteLoaderService.getBlockRemoteLoaderOptions(rlpOptions).then((options: PepRemoteLoaderOptions) => {\n this.remoteLoaderOptions = options;\n });\n }\n }\n\n ngOnDestroy(): void {\n if (this.dialogRef) {\n this.dialogRef = null;\n }\n\n this.remoteLoaderOptions = null;\n }\n\n onBlockLoad() {\n this.blockLoad.emit();\n }\n\n onHostEvents(event: any) {\n this.hostEvents.emit(event);\n }\n\n closeDialog(event) {\n this.dialogRef?.close(event);\n }\n}","<ng-container *ngIf=\"!inDialog\">\n <ng-container *ngTemplateOutlet=\"remoteLoaderTemplate\"></ng-container>\n</ng-container>\n\n<ng-template #dialogTemplate let-data>\n <pep-dialog [showClose]=\"data?.showClose\" [showHeader]=\"data?.showHeader\" [showFooter]=\"data?.showFooter\" [title]=\"data?.title\" (close)=\"closeDialog($event)\">\n <ng-container pep-dialog-content>\n <ng-container *ngTemplateOutlet=\"remoteLoaderTemplate\"></ng-container>\n </ng-container>\n </pep-dialog>\n</ng-template>\n\n<ng-template #remoteLoaderTemplate>\n <pep-remote-loader class=\"remote-loader-element\" *ngIf=\"remoteLoaderOptions && !loadElement\"\n [options]=\"remoteLoaderOptions\"\n [hostObject]=\"hostObject\"\n (hostEvents)=\"onHostEvents($event);\"\n (load)=\"onBlockLoad()\">\n </pep-remote-loader>\n\n <pep-remote-loader-element class=\"remote-loader-element\" *ngIf=\"remoteLoaderOptions && loadElement\" \n [options]=\"remoteLoaderOptions\"\n [props]=\"{ hostObject: hostObject }\"\n [events]=\"{ hostEvents: onHostEventsCallback }\"\n (load)=\"onBlockLoad()\">\n </pep-remote-loader-element>\n\n</ng-template>","import { ComponentRef, Injectable } from '@angular/core';\nimport { IAddonBlockLoaderDialogOptions, IAddonBlockLoaderOptions, IBlockLoaderData } from './remote-loader.model';\nimport { PepAddonBlockLoaderComponent } from './addon-block-loader.component';\nimport { MatDialogRef } from '@angular/material/dialog';\nimport { PepDialogService } from '@pepperi-addons/ngx-lib/dialog';\n\n@Injectable({ \n providedIn: 'root' \n})\nexport class PepAddonBlockLoaderService {\n constructor(\n private dialogService: PepDialogService,\n ) {\n //\n }\n\n private loadAddonBlockInternal(options: IAddonBlockLoaderDialogOptions): ComponentRef<PepAddonBlockLoaderComponent> | null {\n if (options.container !== null) {\n const componentRef = options.container.createComponent(PepAddonBlockLoaderComponent);\n const addonBlockInstance = componentRef.instance;\n\n addonBlockInstance.name = options.name;\n addonBlockInstance.slugName = options.slugName;\n addonBlockInstance.blockType = options.blockType || 'AddonBlock';\n addonBlockInstance.addonId = options.addonUUID;\n addonBlockInstance.remoteEntry = options.blockRemoteEntry;\n addonBlockInstance.hostObject = options.hostObject;\n\n if (options.remoteLoaderOptions) {\n addonBlockInstance.remoteLoaderOptions = options.remoteLoaderOptions;\n }\n\n addonBlockInstance.hostEvents.subscribe((event) => {\n if (options.hostEventsCallback) {\n options.hostEventsCallback(event);\n }\n });\n\n return componentRef;\n } else {\n return null;\n }\n }\n\n loadAddonBlockInContainer(options: IAddonBlockLoaderOptions): ComponentRef<PepAddonBlockLoaderComponent> | null {\n return this.loadAddonBlockInternal(options);\n }\n\n loadAddonBlockInDialog(options: IAddonBlockLoaderDialogOptions): MatDialogRef<any> | null {\n const componentRef = this.loadAddonBlockInternal(options);\n \n if (componentRef) {\n const addonBlockInstance = componentRef.instance;\n const pepConfig = this.dialogService.getDialogConfig({ disableClose: false, panelClass: 'remote-loader-dialog' }, options.size || 'full-screen');\n const mergeConfig = {...pepConfig, ...options.config}; \n const data = options.data || null;\n addonBlockInstance.dialogRef = this.dialogService.openDialog(addonBlockInstance.dialogTemplate, data, mergeConfig);\n addonBlockInstance.dialogRef.afterClosed().subscribe(() => {\n componentRef.hostView.detach();\n componentRef.hostView.destroy();\n componentRef.destroy();\n });\n return addonBlockInstance.dialogRef;\n\n } else {\n return null;\n }\n }\n}\n","import { HttpClientModule } from '@angular/common/http';\nimport { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\n\nimport { MatDialogModule } from '@angular/material/dialog';\n\nimport { PepNgxLibModule } from '@pepperi-addons/ngx-lib';\nimport { PepDialogModule } from '@pepperi-addons/ngx-lib/dialog';\nimport { ModuleFederationToolsModule } from '@angular-architects/module-federation-tools';\n\nimport { PepAddonBlockLoaderComponent } from './addon-block-loader.component';\nimport { PepAddonBlockLoaderService } from './addon-block-loader.service';\n\nimport { PepRemoteLoaderComponent } from './remote-loader.component';\nimport { PepRemoteLoaderService } from './remote-loader.service';\nimport { PepRemoteLoaderElementComponent } from './remote-loader-element.component';\n\n@NgModule({\n declarations: [\n PepAddonBlockLoaderComponent,\n PepRemoteLoaderComponent,\n PepRemoteLoaderElementComponent,\n ],\n imports: [\n CommonModule,\n HttpClientModule,\n ModuleFederationToolsModule,\n // Material modules,\n MatDialogModule,\n // ngx-lib modules\n PepNgxLibModule,\n PepDialogModule,\n ],\n exports: [\n PepAddonBlockLoaderComponent,\n PepRemoteLoaderComponent,\n PepRemoteLoaderElementComponent\n ],\n providers: [\n PepAddonBlockLoaderService,\n PepRemoteLoaderService\n ]\n})\nexport class PepRemoteLoaderModule {\n\n\n}\n","/*\n * Public API Surface of remote-loader\n */\nexport * from './addon-block-loader.component';\nexport * from './addon-block-loader.service';\nexport * from './remote-loader.component';\nexport * from './remote-loader-element.component';\nexport * from './remote-loader.module';\nexport * from './remote-loader.model';\nexport * from './remote-loader.service';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i2.PepRemoteLoaderService","i1.PepRemoteLoaderService","i3","i4.PepRemoteLoaderComponent","i5.PepRemoteLoaderElementComponent","i1"],"mappings":";;;;;;;;;;;;;;;MASa,sBAAsB,CAAA;AAC/B,IAAA,WAAA,CACY,WAA2B,EAC3B,cAAiC,EACjC,YAA6B,EAAA;QAF7B,IAAW,CAAA,WAAA,GAAX,WAAW,CAAgB;QAC3B,IAAc,CAAA,cAAA,GAAd,cAAc,CAAmB;QACjC,IAAY,CAAA,YAAA,GAAZ,YAAY,CAAiB;;KAGxC;AAEO,IAAA,qBAAqB,CAAC,OAAsC,EAAA;QAChE,MAAM,QAAQ,GAAG,cAAc,CAAC;QAChC,MAAM,cAAc,GAAG,IAAI,CAAC,YAAY,CAAC,iB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EAAA,UAAA,EAAA,CAAA;kBA1BjC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACN,oBAAA,YAAY,EAAE;wBACV,4BAA4B;wBAC5B,wBAAwB;wBACxB,+BAA+B;AAClC,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACL,YAAY;wBACZ,gBAAgB;wBAChB,2BAA2B;;wBAE3B,eAAe;;wBAEf,eAAe;wBACf,eAAe;AAClB,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACL,4BAA4B;wBAC5B,wBAAwB;wBACxB,+BAA+B;AAClC,qBAAA;AACD,oBAAA,SAAS,EAAE;wBACP,0BAA0B;wBAC1B,sBAAsB;AACzB,qBAAA;AACJ,iBAAA,CAAA;;;AC1CD;;AAEG;;ACFH;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"pepperi-addons-ngx-lib-remote-loader.mjs","sources":["../../../projects/ngx-lib/remote-loader/remote-loader.service.ts","../../../projects/ngx-lib/remote-loader/remote-loader.component.ts","../../../projects/ngx-lib/remote-loader/remote-loader-element.component.ts","../../../projects/ngx-lib/remote-loader/addon-block-loader.component.ts","../../../projects/ngx-lib/remote-loader/addon-block-loader.component.html","../../../projects/ngx-lib/remote-loader/addon-block-loader.service.ts","../../../projects/ngx-lib/remote-loader/remote-loader.module.ts","../../../projects/ngx-lib/remote-loader/public-api.ts","../../../projects/ngx-lib/remote-loader/pepperi-addons-ngx-lib-remote-loader.ts"],"sourcesContent":["import { coerceNumberProperty } from '@angular/cdk/coercion';\nimport { Injectable } from '@angular/core';\nimport { PepAddonService, PepHttpService, PepSessionService} from '@pepperi-addons/ngx-lib';\nimport { IPepRemoteLoaderParamsOptions, PepRemoteLoaderOptions } from './remote-loader.model';\nimport { IBlockLoaderData } from './remote-loader.model';\n\n@Injectable({ \n providedIn: 'root' \n})\nexport class PepRemoteLoaderService {\n constructor(\n private httpService: PepHttpService,\n private sessionService: PepSessionService,\n private addonService: PepAddonService\n ) {\n //\n }\n\n private getBlockLoaderDataUrl(options: IPepRemoteLoaderParamsOptions): string {\n const fileName = 'addon_blocks';\n const pagesAddonUuid = this.addonService.getPagesAddonUUID();\n let pagesBaseUrl;\n\n // For devServer run server on localhost.\n if(options.pagesDevServer?.length > 0) {\n pagesBaseUrl = `${options.pagesDevServer}/${fileName}`;\n } else {\n const baseUrl = this.sessionService.getPapiBaseUrl();\n pagesBaseUrl = `${baseUrl}/addons/api/${pagesAddonUuid}/${fileName}`;\n }\n\n const url = `${pagesBaseUrl}/get_addon_block_loader_data?name=${options.name}&slugName=${options.slugName}&blockType=${options.blockType}&addonUUID=${options.addonUUID}`;\n return url;\n }\n\n getRemoteLoaderOptions(blockLoaderData: IBlockLoaderData, blockRemoteEntry = '', type: 'script' | 'module' | 'manifest' = 'module'): PepRemoteLoaderOptions {\n const loadAsElement = blockLoaderData.relation.ElementName?.length > 0;\n const exposedModule = loadAsElement ? (blockLoaderData.relation.ElementsModule || 'WebComponents') : blockLoaderData.relation.ModuleName;\n const res = {\n type: type,\n remoteEntry: blockRemoteEntry.length > 0 ? blockRemoteEntry : `${blockLoaderData.addonPublicBaseURL}${blockLoaderData.relation.AddonRelativeURL}.js`,\n remoteName: blockLoaderData.relation.AddonRelativeURL, // For script type, this is the name of the script.\n exposedModule: `./${exposedModule}`,\n addonId: blockLoaderData.relation.AddonUUID, // For local use (adding the relative path to the assets).\n }\n\n // If it's web components\n if (loadAsElement) {\n res['elementName'] = blockLoaderData.relation.ElementName;\n } else { // For load the component from the module.\n res['componentName'] = blockLoaderData.relation.ComponentName; \n }\n\n return res;\n }\n\n private getBlockLoaderDataSuccess(data: IBlockLoaderData, options: IPepRemoteLoaderParamsOptions) {\n const ngVersionNumber = coerceNumberProperty(data.relation?.SubType?.toLocaleLowerCase().replace('ng', ''), 14);\n const type = ngVersionNumber >= 14 ? 'module' : 'script';\n\n return this.getRemoteLoaderOptions(data, options.blockRemoteEntry, type);\n }\n\n private getBlockLoaderDataError(options: IPepRemoteLoaderParamsOptions) {\n const nameMsg = options.blockType === 'SettingsBlock' ? `slugName - ${options.slugName}` : `name - ${options.name}`\n return(`Block with ${nameMsg} is not found for type - ${options.blockType}`);\n }\n\n async getBlockRemoteLoaderOptions(options: IPepRemoteLoaderParamsOptions): Promise<PepRemoteLoaderOptions> {\n options.blockType = options.blockType ?? 'AddonBlock';\n options.name = options.name ?? '';\n options.slugName = options.slugName ?? '';\n options.addonUUID = options.addonUUID ?? '';\n \n return new Promise((resolve, reject) => {\n if (options.name?.length > 0 || (options.slugName?.length > 0 && options.blockType === 'SettingsBlock')) {\n\n if (options.blockType === 'SettingsBlock' || options.blockType === 'LogicBlock' || options.pagesDevServer?.length > 0) {\n // Work online for settings blocks or logic blocks or debug only !!!\n const blockLoaderDataUrl = this.getBlockLoaderDataUrl(options);\n this.httpService.getHttpCall(blockLoaderDataUrl).toPromise().then((data: IBlockLoaderData) => {\n resolve(this.getBlockLoaderDataSuccess(data, options));\n }).catch(err => {\n reject(this.getBlockLoaderDataError(options));\n });\n } else {\n // Work offline !!!\n this.addonService.emitEvent(\"GetBlockLoaderData\", {\n Name: options.name,\n // SlugName: options.slugName,\n BlockType: options.blockType,\n // AddonUUID: options.addonUUID\n }).then((res: IBlockLoaderData) => {\n resolve(this.getBlockLoaderDataSuccess(res, options));\n }).catch(err => {\n reject(this.getBlockLoaderDataError(options));\n });\n }\n } else {\n if (options.blockType === 'SettingsBlock') {\n reject(`slugName is not supplied`);\n }\n else {\n reject(`name is not supplied`);\n }\n }\n });\n }\n}\n","import { Component, Input, OnChanges, ViewChild, ViewContainerRef, Injector, EventEmitter, Output, ComponentRef, SimpleChanges, createNgModuleRef } from '@angular/core';\nimport { loadRemoteModule } from '@angular-architects/module-federation';\nimport { PepAddonService } from '@pepperi-addons/ngx-lib';\nimport { PepRemoteLoaderOptions } from './remote-loader.model';\n\n@Component({\n selector: 'pep-remote-loader',\n template: `\n <!-- <mat-spinner *ngIf=\"showSpinner; else placeHolder\"></mat-spinner> -->\n <ng-template #placeHolder></ng-template>\n `\n})\nexport class PepRemoteLoaderComponent implements OnChanges {\n @ViewChild('placeHolder', { read: ViewContainerRef, static: true }) viewContainer: ViewContainerRef;\n \n private _options: PepRemoteLoaderOptions = null;\n @Input()\n set options(value: PepRemoteLoaderOptions) {\n this._options = value;\n if (value) {\n this.loadModule();\n }\n }\n get options(): PepRemoteLoaderOptions {\n return this._options;\n }\n \n // This is the data passed by the API Design documentation.\n private _hostObject: any = null;\n @Input()\n set hostObject(value: any) { \n this._hostObject = value;\n this.setHostComponentIntoComponentRef();\n }\n get hostObject(): any {\n return this._hostObject;\n }\n\n @Output() hostEvents: EventEmitter<any> = new EventEmitter();\n @Output() load: EventEmitter<any> = new EventEmitter();\n // showSpinner = true;\n \n private compRef: ComponentRef<any>;\n\n constructor(\n private injector: Injector,\n private pepAddonService: PepAddonService\n ) { }\n\n private setHostComponentIntoComponentRef() {\n if (this.hostObject && this.compRef?.instance) {\n this.compRef.instance.hostObject = this.hostObject;\n\n // TODO: Check if this is needed?? if not remove this.\n // if (this.compRef?.instance?.ngOnChanges) {\n // this.compRef.instance.ngOnChanges(this.hostObject);\n // }\n }\n }\n\n ngOnChanges(changes: SimpleChanges) {\n // if (changes?.options?.currentValue) {\n // this.loadModule(changes?.options?.currentValue);\n // }\n }\n\n private async loadModule() {\n try {\n this.viewContainer?.clear();\n \n if (this.options.exposedModule?.length > 0) { // Load module\n if (this.options?.addonId && (this.options.type === 'module' || this.options.type === 'script')) {\n const lastSlashIndex = this.options.remoteEntry?.lastIndexOf('/') || -1;\n \n if (lastSlashIndex > 0) {\n const publicPath = this.options.remoteEntry.substring(0, lastSlashIndex + 1);\n this.pepAddonService.setAddonStaticFolder(publicPath, this.options.addonId);\n }\n }\n\n const module = await loadRemoteModule(this.options).then(m => m);\n const moduleRef = createNgModuleRef(module[this.options.exposedModule.replace('./','')], this.injector);\n this.compRef = this.viewContainer.createComponent(module[this.options.componentName], { injector: this.injector, ngModuleRef: moduleRef });\n } \n // Check if this is in use??? (comment out in Angular 14 version)\n // else { // Load Component\n // const componentType = await loadRemoteModule(this.options).then(m => m[this.options.componentName]);\n // this.compRef = this.viewContainer.createComponent(componentType, { injector: this.injector });\n // }\n\n this.load.emit();\n\n if (this.compRef) {\n this.setHostComponentIntoComponentRef();\n \n this.compRef?.instance['hostEvents']?.subscribe(e => {\n // switch(e.action){\n // case 'addon-loaded':\n // this.showSpinner = false;\n // }\n this.hostEvents.emit(e)\n });\n }\n } catch(error) {\n console.error(error);\n }\n }\n\n ngOnDestroy(): void {\n this.compRef?.destroy();\n this.viewContainer?.clear();\n }\n}\n\n","import { AfterContentInit, Component, ElementRef, EventEmitter, Input, OnChanges, OnDestroy, Optional, Output, Renderer2, ViewChild, ViewContainerRef } from '@angular/core';\nimport { ActivatedRoute } from '@angular/router';\nimport { loadRemoteModule } from '@angular-architects/module-federation';\nimport { PepAddonService } from '@pepperi-addons/ngx-lib';\nimport { PepRemoteLoaderOptions } from './remote-loader.model';\nimport { PepRemoteLoaderService } from './remote-loader.service';\nimport { BehaviorSubject, Observable, Subscription, debounceTime } from 'rxjs';\n\ninterface BlockRemoteLoaderOptionsData { \n name?: string, \n slugName?: string, \n blockType?: string, \n addonUUID?: string, \n blockRemoteEntry?: string \n}\n\n@Component({\n selector: 'pep-remote-loader-element',\n template: `\n <!--<div #vc style=\"height: inherit;\"></div>-->\n `,\n styles: [`\n :host { width:100%; height: inherit; overflow: inherit; }\n :host::ng-deep > * {\n height: inherit;\n }\n `],\n})\nexport class PepRemoteLoaderElementComponent implements AfterContentInit, OnChanges, OnDestroy {\n @Input() options: PepRemoteLoaderOptions;\n @Input() props: { [prop: string]: unknown };\n @Input() events: { [event: string]: (event: Event) => void };\n\n @Output() load: EventEmitter<any> = new EventEmitter();\n\n element: HTMLElement = null;\n\n private _elementName = '';\n private _blockType = '';\n private _alreadyLoaded = false;\n private _routeUrlSubscription: Subscription = null;\n // // This is for debounce.\n // private _getBlockRemoteLoaderOptionsSubject = new BehaviorSubject<BlockRemoteLoaderOptionsData>(null);\n // get getBlockRemoteLoaderOptionsDebouncedSubject$(): Observable<BlockRemoteLoaderOptionsData> {\n // return this._getBlockRemoteLoaderOptionsSubject.asObservable().pipe(debounceTime(250));\n // }\n\n constructor(\n private renderer: Renderer2,\n private el:ElementRef,\n private pepAddonService: PepAddonService,\n private remoteLoaderService: PepRemoteLoaderService,\n @Optional() private route: ActivatedRoute\n ) { \n\n }\n\n private populateProps() {\n for (const prop in this.props) {\n this.element[prop] = this.props[prop];\n }\n }\n\n private setupEvents() {\n for (const event in this.events) {\n this.element.addEventListener(event, this.events[event]);\n }\n }\n\n private async loadOptionsFromRoute() {\n const params = this.route?.snapshot.params;\n const data = this.route?.snapshot.data;\n this._blockType = data?.blockType || 'SettingsBlock';\n\n const slugName = params?.slugName || data?.slugName;\n const blockName = params?.blockName || data?.blockName;\n\n if (blockName?.length > 0 || (slugName?.length > 0 && this._blockType === 'SettingsBlock')) {\n const addonUUID = params?.addonUUID || data?.addonUUID || '';\n const blockRemoteEntry = data?.blockRemoteEntry || '';\n\n this.options = await this.remoteLoaderService.getBlockRemoteLoaderOptions({\n name: blockName,\n slugName,\n blockType: this._blockType,\n addonUUID,\n blockRemoteEntry\n });\n\n const fileName = `${this.options['remoteName']}.js`;\n\n if (window.location.search.indexOf('dev=true') > 0) {\n this.options['remoteEntry'] = `http://localhost:4400/${fileName}`;\n }\n\n // Set the data into the props cause this component is loading from the route.\n this.props = data;\n }\n }\n\n ngOnChanges(): void {\n if (!this.element) return;\n\n this.populateProps();\n }\n\n ngOnDestroy() {\n this._routeUrlSubscription?.unsubscribe();\n this._routeUrlSubscription = null;\n\n if (this._blockType === 'SettingsBlock' && this._elementName) {\n this.pepAddonService.disconnectInternalRouter(this._elementName);\n }\n\n if (this.element) {\n try {\n if (this.events) {\n for (const event in this.events) {\n try {\n this.element.removeEventListener(event, this.events[event]);\n } catch {\n // ignore\n }\n }\n }\n\n // ADO 1036660: Fix React teardown race in hosted web-components.\n // The host (Angular) may destroy/remove the element subtree while the remote (React) is still\n // unmounting, which can surface as `NotFoundError: Failed to execute 'removeChild' on 'Node'`.\n // If the remote element exposes `pepperiUnmount()`, call it here to let it cleanup before DOM removal.\n\n const elToUnmount = this.element;\n let parkedContainer: HTMLDivElement = null;\n const cleanup = () => {\n try {\n if (parkedContainer?.parentNode) {\n parkedContainer.parentNode.removeChild(parkedContainer);\n }\n } catch {\n // ignore\n }\n };\n\n // Detach the remote element subtree so Angular destroying this host won't remove it while React is still unmounting.\n try {\n if (typeof document !== 'undefined' && elToUnmount?.parentNode && document.body) {\n parkedContainer = document.createElement('div');\n parkedContainer.style.display = 'none';\n document.body.appendChild(parkedContainer);\n parkedContainer.appendChild(elToUnmount);\n }\n } catch {\n // ignore\n }\n\n const anyEl = elToUnmount as any;\n const maybeUnmount = anyEl?.pepperiUnmount;\n if (typeof maybeUnmount === 'function') {\n try {\n const res = maybeUnmount.call(anyEl);\n if (res && typeof res.then === 'function') {\n res.finally(() => cleanup());\n } else {\n cleanup();\n }\n } catch {\n // ignore\n cleanup();\n }\n } else {\n cleanup();\n }\n } catch {\n // ignore\n }\n\n this.element = null;\n }\n }\n\n /**\n * Loads the remote JS bundle as a script tag for web component remotes.\n * If the script is already loaded, resolves immediately.\n */\n // private async loadRemoteScript(remoteEntryUrl: string): Promise<any> {\n // return new Promise<any>((resolve, reject) => {\n // if (document.querySelector(`script[src=\"${remoteEntryUrl}\"]`)) {\n // // If script is already loaded, try to get the module\n // import(remoteEntryUrl).then(module => {\n // if (module && module.init) {\n // module.init();\n // }\n // resolve(module);\n // }).catch(err => reject(err));\n // return;\n // }\n \n // const script = document.createElement('script');\n // script.type = 'module';\n // script.src = remoteEntryUrl;\n \n // script.onload = () => {\n // // After script is loaded, dynamically import it to get the module\n // import(remoteEntryUrl).then(module => {\n // if (module && module.init) {\n // module.init();\n // }\n // resolve(module);\n // }).catch(err => reject(err));\n // };\n \n // script.onerror = (err) => reject(err);\n // document.body.appendChild(script);\n // });\n // }\n\n private loadElementFromModule() {\n\n if (!this.options) {\n // throw new Error('No options supplied to the component.');\n console.info('No options supplied to the component.');\n return;\n } else {\n if (this.options?.addonId && (this.options.type === 'module' || this.options.type === 'script')) {\n const lastSlashIndex = this.options.remoteEntry?.lastIndexOf('/') || -1;\n \n if (lastSlashIndex > 0) {\n const publicPath = this.options.remoteEntry.substring(0, lastSlashIndex + 1);\n this.pepAddonService.setAddonStaticFolder(publicPath, this.options.addonId);\n }\n }\n // The remote reads window.location once, synchronously, during its own bootstrap —\n // its internal router-sync (see e.g. @angular-architects/module-federation-tools'\n // connectRouter) assumes a path relative to real root, and uses whatever shape it\n // sees to decide which leading segments are its own fixed \"container route\" vs. a\n // later-replaceable child segment. If this shell is served under its own base href\n // (e.g. dev-only /angular — see angular.json's baseHref/servePath), briefly present\n // the remote with the base-stripped path for the duration of this one-time load, so\n // it locks in the same container-route shape it would see at real root (e.g. under\n // React) — then restore the real address immediately after. Safe: this component\n // isn't rendering anything until the promise resolves anyway, and replaceState never\n // fires popstate, so this shell's own Router never observes the swap.\n const isSettingsBlock = this._blockType === 'SettingsBlock';\n const originalUrl = `${location.pathname}${location.search}${location.hash}`;\n const strippedPath = PepAddonService.stripBaseHref(location.pathname);\n const shouldSwapUrl = isSettingsBlock && strippedPath !== location.pathname;\n // Bypass this shell's own base-href-restoring history guard (see bootstrap.ts) for\n // this one, deliberate swap — otherwise it silently reverts it before the remote\n // ever reads location.pathname.\n const win = window as any;\n if (shouldSwapUrl) {\n win.__pepAllowRawHistoryWrite = true;\n history.replaceState(history.state, '', `${strippedPath}${location.search}${location.hash}`);\n win.__pepAllowRawHistoryWrite = false;\n }\n\n // debugger;\n // this.loadRemoteScript(this.options['remoteEntry']).then(() => {\n loadRemoteModule(this.options).then((m) => {\n this._elementName = this.options.elementName;\n this.element = this.renderer.createElement(this._elementName);\n this.populateProps();\n this.setupEvents();\n \n this.renderer.appendChild(this.el.nativeElement, this.element);\n \n // Fix internal routing bug.\n if (this._blockType === 'SettingsBlock') {\n this.pepAddonService.connectInternalRouter(this._elementName);\n\n // Angular reuses this SAME component instance across a child-segment-only\n // route change (e.g. settings_block/:uuid/:slug's own '**' child route going\n // from .../pages to .../{pageKey}) — ngAfterContentInit only fires once, so\n // without this the addon's own internal router is only ever told the location\n // at initial mount, and never learns about a later in-place navigation. this\n // .route.url (unlike .snapshot) emits again on exactly that kind of change.\n if (this.route) {\n this._routeUrlSubscription = this.route.url.subscribe(() => {\n this.pepAddonService.connectInternalRouter(this._elementName);\n });\n }\n }\n\n this.load.emit();\n\n // The remote's own bootstrap (its custom element's connectedCallback, just\n // triggered by appendChild above) can defer its actual router-sync read of\n // window.location past this synchronous block (zone-scheduled change detection,\n // etc.) — push the restore one macrotask out so it reliably runs after that,\n // not before it.\n if (shouldSwapUrl) {\n setTimeout(() => {\n if (location.pathname === strippedPath) {\n win.__pepAllowRawHistoryWrite = true;\n history.replaceState(history.state, '', originalUrl);\n win.__pepAllowRawHistoryWrite = false;\n }\n }, 0);\n }\n }).catch((error) => {\n throw error;\n });\n }\n }\n\n ngAfterContentInit() {\n try {\n // if (!this.element) { maybe the load of the element is too long so change to flag.\n if (!this._alreadyLoaded) {\n this._alreadyLoaded = true;\n // If the options is not supplied then we need to get it from the route.\n if (!this.options) {\n this.loadOptionsFromRoute().then(() => {\n this.loadElementFromModule();\n });\n } else {\n this.loadElementFromModule();\n }\n }\n }\n catch(error) {\n console.error(error);\n }\n }\n}","import { WebComponentWrapperOptions } from '@angular-architects/module-federation-tools';\nimport { Component, OnInit, Input, Output, EventEmitter, TemplateRef, ViewChild, OnDestroy } from '@angular/core';\nimport { MatDialogRef } from '@angular/material/dialog';\nimport { IPepRemoteLoaderParamsOptions, PepRemoteLoaderOptions } from './remote-loader.model';\nimport { PepRemoteLoaderService } from './remote-loader.service';\n\n@Component({\n selector: 'pep-addon-block-loader',\n templateUrl: './addon-block-loader.component.html',\n styleUrls: ['./addon-block-loader.component.scss']\n})\nexport class PepAddonBlockLoaderComponent implements OnInit, OnDestroy {\n @ViewChild('dialogTemplate', { static: true, read: TemplateRef }) dialogTemplate!: TemplateRef<any>;\n \n @Input() addonId = '';\n @Input() remoteEntry = '';\n @Input() slugName = '';\n\n private _blockType = 'AddonBlock';\n @Input() \n set blockType(value: string) {\n this._blockType = value;\n }\n get blockType(): string {\n return this._blockType;\n }\n\n private _name = '';\n @Input() \n set name(value: string) {\n this._name = value;\n }\n get name(): string {\n return this._name;\n }\n\n @Input() hostObject = null;\n \n private _dialogRef: MatDialogRef<any> = null;\n @Input()\n set dialogRef(value: MatDialogRef<any>) {\n this._dialogRef = value;\n this.inDialog = this._dialogRef != null;\n }\n get dialogRef(): MatDialogRef<any> {\n return this._dialogRef;\n }\n \n private _remoteLoaderOptions: PepRemoteLoaderOptions = null;\n @Input() \n set remoteLoaderOptions(value: PepRemoteLoaderOptions) {\n this._remoteLoaderOptions = value;\n this.loadElement = this.remoteLoaderOptions?.elementName?.length > 0;\n }\n get remoteLoaderOptions(): PepRemoteLoaderOptions {\n return this._remoteLoaderOptions;\n }\n\n @Output() hostEvents: EventEmitter<any> = new EventEmitter<any>();\n @Output() blockLoad: EventEmitter<void> = new EventEmitter<void>();\n \n protected inDialog = false;\n protected loadElement = false;\n\n protected onHostEventsCallback: (event: CustomEvent) => void;\n\n constructor(private remoteLoaderService: PepRemoteLoaderService) {\n this.onHostEventsCallback = (event: CustomEvent) => {\n this.onHostEvents(event.detail);\n }\n }\n \n ngOnInit() {\n if (this.remoteLoaderOptions === null) {\n const rlpOptions: IPepRemoteLoaderParamsOptions = {\n name: this.name,\n slugName: this.slugName,\n blockType: this.blockType,\n addonUUID: this.addonId,\n blockRemoteEntry: this.remoteEntry\n };\n\n this.remoteLoaderService.getBlockRemoteLoaderOptions(rlpOptions).then((options: PepRemoteLoaderOptions) => {\n this.remoteLoaderOptions = options;\n });\n }\n }\n\n ngOnDestroy(): void {\n if (this.dialogRef) {\n this.dialogRef = null;\n }\n\n this.remoteLoaderOptions = null;\n }\n\n onBlockLoad() {\n this.blockLoad.emit();\n }\n\n onHostEvents(event: any) {\n this.hostEvents.emit(event);\n }\n\n closeDialog(event) {\n this.dialogRef?.close(event);\n }\n}","<ng-container *ngIf=\"!inDialog\">\n <ng-container *ngTemplateOutlet=\"remoteLoaderTemplate\"></ng-container>\n</ng-container>\n\n<ng-template #dialogTemplate let-data>\n <pep-dialog [showClose]=\"data?.showClose\" [showHeader]=\"data?.showHeader\" [showFooter]=\"data?.showFooter\" [title]=\"data?.title\" (close)=\"closeDialog($event)\">\n <ng-container pep-dialog-content>\n <ng-container *ngTemplateOutlet=\"remoteLoaderTemplate\"></ng-container>\n </ng-container>\n </pep-dialog>\n</ng-template>\n\n<ng-template #remoteLoaderTemplate>\n <pep-remote-loader class=\"remote-loader-element\" *ngIf=\"remoteLoaderOptions && !loadElement\"\n [options]=\"remoteLoaderOptions\"\n [hostObject]=\"hostObject\"\n (hostEvents)=\"onHostEvents($event);\"\n (load)=\"onBlockLoad()\">\n </pep-remote-loader>\n\n <pep-remote-loader-element class=\"remote-loader-element\" *ngIf=\"remoteLoaderOptions && loadElement\" \n [options]=\"remoteLoaderOptions\"\n [props]=\"{ hostObject: hostObject }\"\n [events]=\"{ hostEvents: onHostEventsCallback }\"\n (load)=\"onBlockLoad()\">\n </pep-remote-loader-element>\n\n</ng-template>","import { ComponentRef, Injectable } from '@angular/core';\nimport { IAddonBlockLoaderDialogOptions, IAddonBlockLoaderOptions, IBlockLoaderData } from './remote-loader.model';\nimport { PepAddonBlockLoaderComponent } from './addon-block-loader.component';\nimport { MatDialogRef } from '@angular/material/dialog';\nimport { PepDialogService } from '@pepperi-addons/ngx-lib/dialog';\n\n@Injectable({ \n providedIn: 'root' \n})\nexport class PepAddonBlockLoaderService {\n constructor(\n private dialogService: PepDialogService,\n ) {\n //\n }\n\n private loadAddonBlockInternal(options: IAddonBlockLoaderDialogOptions): ComponentRef<PepAddonBlockLoaderComponent> | null {\n if (options.container !== null) {\n const componentRef = options.container.createComponent(PepAddonBlockLoaderComponent);\n const addonBlockInstance = componentRef.instance;\n\n addonBlockInstance.name = options.name;\n addonBlockInstance.slugName = options.slugName;\n addonBlockInstance.blockType = options.blockType || 'AddonBlock';\n addonBlockInstance.addonId = options.addonUUID;\n addonBlockInstance.remoteEntry = options.blockRemoteEntry;\n addonBlockInstance.hostObject = options.hostObject;\n\n if (options.remoteLoaderOptions) {\n addonBlockInstance.remoteLoaderOptions = options.remoteLoaderOptions;\n }\n\n addonBlockInstance.hostEvents.subscribe((event) => {\n if (options.hostEventsCallback) {\n options.hostEventsCallback(event);\n }\n });\n\n return componentRef;\n } else {\n return null;\n }\n }\n\n loadAddonBlockInContainer(options: IAddonBlockLoaderOptions): ComponentRef<PepAddonBlockLoaderComponent> | null {\n return this.loadAddonBlockInternal(options);\n }\n\n loadAddonBlockInDialog(options: IAddonBlockLoaderDialogOptions): MatDialogRef<any> | null {\n const componentRef = this.loadAddonBlockInternal(options);\n \n if (componentRef) {\n const addonBlockInstance = componentRef.instance;\n const pepConfig = this.dialogService.getDialogConfig({ disableClose: false, panelClass: 'remote-loader-dialog' }, options.size || 'full-screen');\n const mergeConfig = {...pepConfig, ...options.config}; \n const data = options.data || null;\n addonBlockInstance.dialogRef = this.dialogService.openDialog(addonBlockInstance.dialogTemplate, data, mergeConfig);\n addonBlockInstance.dialogRef.afterClosed().subscribe(() => {\n componentRef.hostView.detach();\n componentRef.hostView.destroy();\n componentRef.destroy();\n });\n return addonBlockInstance.dialogRef;\n\n } else {\n return null;\n }\n }\n}\n","import { HttpClientModule } from '@angular/common/http';\nimport { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\n\nimport { MatDialogModule } from '@angular/material/dialog';\n\nimport { PepNgxLibModule } from '@pepperi-addons/ngx-lib';\nimport { PepDialogModule } from '@pepperi-addons/ngx-lib/dialog';\nimport { ModuleFederationToolsModule } from '@angular-architects/module-federation-tools';\n\nimport { PepAddonBlockLoaderComponent } from './addon-block-loader.component';\nimport { PepAddonBlockLoaderService } from './addon-block-loader.service';\n\nimport { PepRemoteLoaderComponent } from './remote-loader.component';\nimport { PepRemoteLoaderService } from './remote-loader.service';\nimport { PepRemoteLoaderElementComponent } from './remote-loader-element.component';\n\n@NgModule({\n declarations: [\n PepAddonBlockLoaderComponent,\n PepRemoteLoaderComponent,\n PepRemoteLoaderElementComponent,\n ],\n imports: [\n CommonModule,\n HttpClientModule,\n ModuleFederationToolsModule,\n // Material modules,\n MatDialogModule,\n // ngx-lib modules\n PepNgxLibModule,\n PepDialogModule,\n ],\n exports: [\n PepAddonBlockLoaderComponent,\n PepRemoteLoaderComponent,\n PepRemoteLoaderElementComponent\n ],\n providers: [\n PepAddonBlockLoaderService,\n PepRemoteLoaderService\n ]\n})\nexport class PepRemoteLoaderModule {\n\n\n}\n","/*\n * Public API Surface of remote-loader\n */\nexport * from './addon-block-loader.component';\nexport * from './addon-block-loader.service';\nexport * from './remote-loader.component';\nexport * from './remote-loader-element.component';\nexport * from './remote-loader.module';\nexport * from './remote-loader.model';\nexport * from './remote-loader.service';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i2.PepRemoteLoaderService","i1.PepRemoteLoaderService","i3","i4.PepRemoteLoaderComponent","i5.PepRemoteLoaderElementComponent","i1"],"mappings":";;;;;;;;;;;;;;;MASa,sBAAsB,CAAA;AAC/B,IAAA,WAAA,CACY,WAA2B,EAC3B,cAAiC,EACjC,YAA6B,EAAA;QAF7B,IAAW,CAAA,WAAA,GAAX,WAAW,CAAgB;QAC3B,IAAc,CAAA,cAAA,GAAd,cAAc,CAAmB;QACjC,IAAY,CAAA,YAAA,GAAZ,YAAY,CAAiB;;KAGxC;AAEO,IAAA,qBAAqB,CAAC,OAAsC,EAAA;QAChE,MAAM,QAAQ,GAAG,cAAc,CAAC;QAChC,MAAM,cAAc,GAAG,IAAI,CAAC,YAAY,CAAC,iBAAiB,EAAE,CAAC;AAC7D,QAAA,IAAI,YAAY,CAAC;;AAGjB,QAAA,IAAG,OAA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AA;AAO1B,qBAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,qBAAqB,EALnB,SAAA,EAAA;QACP,0BAA0B;QAC1B,sBAAsB;AACzB,KAAA,EAAA,OAAA,EAAA,CAjBG,YAAY;QACZ,gBAAgB;QAChB,2BAA2B;;QAE3B,eAAe;;QAEf,eAAe;QACf,eAAe,CAAA,EAAA,CAAA,CAAA;2FAYV,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBA1BjC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACN,oBAAA,YAAY,EAAE;wBACV,4BAA4B;wBAC5B,wBAAwB;wBACxB,+BAA+B;AAClC,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACL,YAAY;wBACZ,gBAAgB;wBAChB,2BAA2B;;wBAE3B,eAAe;;wBAEf,eAAe;wBACf,eAAe;AAClB,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACL,4BAA4B;wBAC5B,wBAAwB;wBACxB,+BAA+B;AAClC,qBAAA;AACD,oBAAA,SAAS,EAAE;wBACP,0BAA0B;wBAC1B,sBAAsB;AACzB,qBAAA;AACJ,iBAAA,CAAA;;;AC1CD;;AAEG;;ACFH;;AAEG;;;;"}
|
|
@@ -458,19 +458,14 @@ class PepUtilitiesService {
|
|
|
458
458
|
if (!isDateTime) {
|
|
459
459
|
const index = dateStr.indexOf('T');
|
|
460
460
|
if (index > 0) {
|
|
461
|
-
|
|
462
|
-
// date. Stripping the T-prefix and parsing literally yields the UTC calendar date,
|
|
463
|
-
// which is one day behind for UTC+ users (e.g. NZ UTC+12).
|
|
464
|
-
retVal = new Date(retVal.getFullYear(), retVal.getMonth(), retVal.getDate(), 0, retVal.getTimezoneOffset() * -1);
|
|
461
|
+
dateStr = dateStr.substring(0, index);
|
|
465
462
|
}
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
retVal = new Date(year, month, day, 0, retVal.getTimezoneOffset() * -1);
|
|
473
|
-
}
|
|
463
|
+
const dateText = dateStr.split('-');
|
|
464
|
+
if (dateText.length === 3) {
|
|
465
|
+
const year = Number(dateText[0]);
|
|
466
|
+
const month = Number(dateText[1]) - 1;
|
|
467
|
+
const day = Number(dateText[2]);
|
|
468
|
+
retVal = new Date(year, month, day, 0, retVal.getTimezoneOffset() * -1);
|
|
474
469
|
}
|
|
475
470
|
}
|
|
476
471
|
else {
|
|
@@ -3516,7 +3511,11 @@ class PepAddonService {
|
|
|
3516
3511
|
PepAddonService._customElementsMap.set(elementName, { injector: injector });
|
|
3517
3512
|
}
|
|
3518
3513
|
}
|
|
3519
|
-
// Fix internal routing bug.
|
|
3514
|
+
// Fix internal routing bug. Callable repeatedly (once at mount, then again whenever the
|
|
3515
|
+
// shell's own route changes while the same addon element instance stays mounted — e.g. a
|
|
3516
|
+
// settings_block child segment change) — see PepRemoteLoaderElementComponent's route
|
|
3517
|
+
// subscription, since without a repeat call the addon's own internal router is only ever
|
|
3518
|
+
// told the location once, at initial mount.
|
|
3520
3519
|
connectInternalRouter(elementName) {
|
|
3521
3520
|
const customElementObject = PepAddonService._customElementsMap.get(elementName);
|
|
3522
3521
|
let router = customElementObject?.injector.get(Router);
|
|
@@ -3527,24 +3526,60 @@ class PepAddonService {
|
|
|
3527
3526
|
}
|
|
3528
3527
|
if (router) {
|
|
3529
3528
|
const useHash = location.href.includes('#');
|
|
3530
|
-
this.connectRouter(router, useHash);
|
|
3529
|
+
this.connectRouter(elementName, router, useHash);
|
|
3531
3530
|
}
|
|
3532
3531
|
}
|
|
3533
|
-
connectRouter(
|
|
3534
|
-
|
|
3532
|
+
// Removes the popstate/hashchange listener connectRouter() registered for this element —
|
|
3533
|
+
// call from the hosting component's ngOnDestroy so a destroyed addon instance doesn't keep
|
|
3534
|
+
// reacting to browser navigation.
|
|
3535
|
+
disconnectInternalRouter(elementName) {
|
|
3536
|
+
const existing = PepAddonService._routerConnections.get(elementName);
|
|
3537
|
+
if (!existing)
|
|
3538
|
+
return;
|
|
3539
|
+
window.removeEventListener(existing.eventName, existing.listener);
|
|
3540
|
+
PepAddonService._routerConnections.delete(elementName);
|
|
3541
|
+
}
|
|
3542
|
+
// Strips this app's own base href prefix (e.g. dev-only /angular — see angular.json's
|
|
3543
|
+
// baseHref/servePath) from a path, so it can be handed to code that expects a path
|
|
3544
|
+
// relative to real root — an addon's own internal router (connectRouter below), or a
|
|
3545
|
+
// remote's one-time bootstrap-time location read (see PepRemoteLoaderElementComponent).
|
|
3546
|
+
static stripBaseHref(path) {
|
|
3547
|
+
const basePath = document.querySelector('base')?.getAttribute('href') || '/';
|
|
3548
|
+
if (basePath === '/')
|
|
3549
|
+
return path;
|
|
3550
|
+
const normalizedBase = basePath.endsWith('/') ? basePath.slice(0, -1) : basePath;
|
|
3551
|
+
const prefixRe = new RegExp(`^${normalizedBase}(?=/|$)`);
|
|
3552
|
+
return prefixRe.test(path) ? (path.replace(prefixRe, '') || '/') : path;
|
|
3553
|
+
}
|
|
3554
|
+
connectRouter(elementName, router, useHash = false) {
|
|
3555
|
+
// This app may be served under its own base href (e.g. dev-only /angular — see
|
|
3556
|
+
// angular.json's baseHref/servePath) — strip it before handing the path to the addon's
|
|
3557
|
+
// OWN internal router, which expects a path relative to ITS OWN root, not this shell's.
|
|
3558
|
+
const stripBase = PepAddonService.stripBaseHref;
|
|
3559
|
+
const existing = PepAddonService._routerConnections.get(elementName);
|
|
3535
3560
|
if (!useHash) {
|
|
3536
|
-
url = `${location.pathname.
|
|
3561
|
+
const url = `${stripBase(location.pathname).replace(/^\//, '')}${location.search}`;
|
|
3537
3562
|
router.navigateByUrl(url);
|
|
3538
|
-
|
|
3539
|
-
|
|
3540
|
-
}
|
|
3563
|
+
if (existing) {
|
|
3564
|
+
existing.url = url;
|
|
3565
|
+
}
|
|
3566
|
+
else {
|
|
3567
|
+
const connection = { url, eventName: 'popstate', listener: () => router.navigateByUrl(connection.url) };
|
|
3568
|
+
window.addEventListener('popstate', connection.listener);
|
|
3569
|
+
PepAddonService._routerConnections.set(elementName, connection);
|
|
3570
|
+
}
|
|
3541
3571
|
}
|
|
3542
3572
|
else {
|
|
3543
|
-
url = `${location.hash.
|
|
3573
|
+
const url = `${stripBase(location.hash.replace(/^#/, '')).replace(/^\//, '')}${location.search}`;
|
|
3544
3574
|
router.navigateByUrl(url);
|
|
3545
|
-
|
|
3546
|
-
|
|
3547
|
-
}
|
|
3575
|
+
if (existing) {
|
|
3576
|
+
existing.url = url;
|
|
3577
|
+
}
|
|
3578
|
+
else {
|
|
3579
|
+
const connection = { url, eventName: 'hashchange', listener: () => router.navigateByUrl(connection.url) };
|
|
3580
|
+
window.addEventListener('hashchange', connection.listener);
|
|
3581
|
+
PepAddonService._routerConnections.set(elementName, connection);
|
|
3582
|
+
}
|
|
3548
3583
|
}
|
|
3549
3584
|
}
|
|
3550
3585
|
static createMultiTranslateLoader(addonUUID, addonService, libsName = ['ngx-lib']) {
|
|
@@ -3563,6 +3598,11 @@ class PepAddonService {
|
|
|
3563
3598
|
}
|
|
3564
3599
|
}
|
|
3565
3600
|
PepAddonService._customElementsMap = new Map();
|
|
3601
|
+
// Tracks, per addon element, the popstate/hashchange listener already registered by a
|
|
3602
|
+
// previous connectRouter() call (and the mutable "current url" it reads), so a repeat call
|
|
3603
|
+
// updates that same listener's target instead of piling up a new, independently-stale one on
|
|
3604
|
+
// every navigation.
|
|
3605
|
+
PepAddonService._routerConnections = new Map();
|
|
3566
3606
|
PepAddonService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepAddonService, deps: [{ token: PepSessionService }, { token: PepHttpService }, { token: PepLoaderService }, { token: PepTranslateService }, { token: PepFileService }, { token: i6.Router, optional: true }, { token: i6.ActivatedRoute, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
3567
3607
|
PepAddonService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepAddonService, providedIn: 'root' });
|
|
3568
3608
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepAddonService, decorators: [{
|