@smartsoft001-mobilems/articles-shell-angular 2.99.0 → 2.101.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Injectable, inject, contentChild, ChangeDetectionStrategy, Component, NgModule, Directive, effect } from '@angular/core';
|
|
2
|
+
import { Injectable, inject, contentChild, ChangeDetectionStrategy, Component, NgModule, Directive, effect, PLATFORM_ID, signal, computed } from '@angular/core';
|
|
3
3
|
import { FILE_SERVICE_CONFIG } from '@smartsoft001/angular';
|
|
4
4
|
import { CrudFacade, initialState as initialState$1, getReducer as getReducer$1, CrudService, CrudConfig, CrudFullConfig, CrudFullModule, CrudModule, CrudListPageBaseComponent, CrudItemPageBaseComponent } from '@smartsoft001/crud-shell-angular';
|
|
5
5
|
import { CrudBaseService, FiltersBaseComponent, SharedConfig, SharedModule, SeoService, TranslationService } from '@smartsoft001-mobilems/angular';
|
|
6
|
-
import { NgTemplateOutlet, CommonModule } from '@angular/common';
|
|
6
|
+
import { NgTemplateOutlet, CommonModule, isPlatformBrowser } from '@angular/common';
|
|
7
7
|
import { createFeatureSelector } from '@ngrx/store';
|
|
8
8
|
import { toSignal } from '@angular/core/rxjs-interop';
|
|
9
|
-
import { ActivatedRoute } from '@angular/router';
|
|
9
|
+
import { ActivatedRoute, Router } from '@angular/router';
|
|
10
|
+
import { HttpClient } from '@angular/common/http';
|
|
11
|
+
import { map, catchError, of } from 'rxjs';
|
|
10
12
|
|
|
11
13
|
class ArticlesService extends CrudBaseService {
|
|
12
14
|
getUrlNameForDetails() {
|
|
@@ -220,9 +222,101 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImpor
|
|
|
220
222
|
type: Directive
|
|
221
223
|
}], ctorParameters: () => [] });
|
|
222
224
|
|
|
225
|
+
/**
|
|
226
|
+
* CMS preview of an unpublished article.
|
|
227
|
+
*
|
|
228
|
+
* The CMS opens `/article-preview?dataUrl=...` in the editor's browser and the
|
|
229
|
+
* page fetches `dataUrl` with the CMS session cookie, so the route must be
|
|
230
|
+
* rendered on the client (`RenderMode.Client`). A `viewType=thematic-path`
|
|
231
|
+
* preview is forwarded to `thematicPathRoute`. Subclass with the app's own
|
|
232
|
+
* template; the subclass owns only the view.
|
|
233
|
+
*/
|
|
234
|
+
class ArticlesPreviewComponent {
|
|
235
|
+
constructor() {
|
|
236
|
+
this.http = inject(HttpClient);
|
|
237
|
+
this.route = inject(ActivatedRoute);
|
|
238
|
+
this.router = inject(Router);
|
|
239
|
+
this.platformId = inject(PLATFORM_ID);
|
|
240
|
+
this.queryParams = toSignal(this.route.queryParams);
|
|
241
|
+
/** Route a `thematic-path` preview is forwarded to; override per app. */
|
|
242
|
+
this.thematicPathRoute = '/sciezki-tematyczne';
|
|
243
|
+
this.loading = signal(true, /* @ts-ignore */
|
|
244
|
+
...(ngDevMode ? [{ debugName: "loading" }] : /* istanbul ignore next */ []));
|
|
245
|
+
this.noQueryParams = signal(false, /* @ts-ignore */
|
|
246
|
+
...(ngDevMode ? [{ debugName: "noQueryParams" }] : /* istanbul ignore next */ []));
|
|
247
|
+
this.noLogin = signal(false, /* @ts-ignore */
|
|
248
|
+
...(ngDevMode ? [{ debugName: "noLogin" }] : /* istanbul ignore next */ []));
|
|
249
|
+
this.item = signal(null, /* @ts-ignore */
|
|
250
|
+
...(ngDevMode ? [{ debugName: "item" }] : /* istanbul ignore next */ []));
|
|
251
|
+
this.plainTitle = computed(() => (this.item()?.title ?? '').replace(/<[^>]*>/g, ''), /* @ts-ignore */
|
|
252
|
+
...(ngDevMode ? [{ debugName: "plainTitle" }] : /* istanbul ignore next */ []));
|
|
253
|
+
this.widgets = computed(() => {
|
|
254
|
+
const widgets = this.item()?.bottomWidgets;
|
|
255
|
+
if (!widgets)
|
|
256
|
+
return [];
|
|
257
|
+
return [...widgets].sort((a, b) => a.position - b.position);
|
|
258
|
+
}, /* @ts-ignore */
|
|
259
|
+
...(ngDevMode ? [{ debugName: "widgets" }] : /* istanbul ignore next */ []));
|
|
260
|
+
this.authorsText = computed(() => this.item()
|
|
261
|
+
?.authors?.map((author) => author.name)
|
|
262
|
+
.filter(Boolean)
|
|
263
|
+
.join(', ') ?? '', /* @ts-ignore */
|
|
264
|
+
...(ngDevMode ? [{ debugName: "authorsText" }] : /* istanbul ignore next */ []));
|
|
265
|
+
effect(() => {
|
|
266
|
+
const params = (this.queryParams() ?? {});
|
|
267
|
+
if (params.viewType === 'thematic-path' && params.pathUrl) {
|
|
268
|
+
this.forwardThematicPath(params);
|
|
269
|
+
return;
|
|
270
|
+
}
|
|
271
|
+
if (params.dataUrl) {
|
|
272
|
+
this.fetchArticle(params.dataUrl);
|
|
273
|
+
}
|
|
274
|
+
else {
|
|
275
|
+
this.noQueryParams.set(true);
|
|
276
|
+
this.loading.set(false);
|
|
277
|
+
}
|
|
278
|
+
});
|
|
279
|
+
effect(() => {
|
|
280
|
+
if (this.item() && isPlatformBrowser(this.platformId)) {
|
|
281
|
+
window.scrollTo({ top: 0, behavior: 'instant' });
|
|
282
|
+
}
|
|
283
|
+
});
|
|
284
|
+
}
|
|
285
|
+
forwardThematicPath(params) {
|
|
286
|
+
const id = params.pathUrl?.split('/').pop();
|
|
287
|
+
this.router.navigate([this.thematicPathRoute, id], {
|
|
288
|
+
queryParams: {
|
|
289
|
+
pathUrl: params.pathUrl,
|
|
290
|
+
pageUrl: params.pageUrl,
|
|
291
|
+
mediaUrl: params.mediaUrl,
|
|
292
|
+
},
|
|
293
|
+
});
|
|
294
|
+
}
|
|
295
|
+
fetchArticle(dataUrl) {
|
|
296
|
+
this.loading.set(true);
|
|
297
|
+
this.noLogin.set(false);
|
|
298
|
+
this.http
|
|
299
|
+
.get(dataUrl, { withCredentials: true })
|
|
300
|
+
.pipe(map((response) => response?.data ?? null), catchError((error) => {
|
|
301
|
+
console.error('Error fetching preview data:', error);
|
|
302
|
+
this.noLogin.set(true);
|
|
303
|
+
return of(null);
|
|
304
|
+
}))
|
|
305
|
+
.subscribe((article) => {
|
|
306
|
+
this.item.set(article);
|
|
307
|
+
this.loading.set(false);
|
|
308
|
+
});
|
|
309
|
+
}
|
|
310
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: ArticlesPreviewComponent, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
311
|
+
/** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.3", type: ArticlesPreviewComponent, isStandalone: true, ngImport: i0 }); }
|
|
312
|
+
}
|
|
313
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: ArticlesPreviewComponent, decorators: [{
|
|
314
|
+
type: Directive
|
|
315
|
+
}], ctorParameters: () => [] });
|
|
316
|
+
|
|
223
317
|
/**
|
|
224
318
|
* Generated bundle index. Do not edit.
|
|
225
319
|
*/
|
|
226
320
|
|
|
227
|
-
export { ArticlesFacade, ArticlesItemComponent, ArticlesListComponent, ArticlesModule, ArticlesService, ArticlesSharedModule, ComponentsModule, FiltersComponent, ListComponent, SERVICES, getArticlesState, getReducer, initialState };
|
|
321
|
+
export { ArticlesFacade, ArticlesItemComponent, ArticlesListComponent, ArticlesModule, ArticlesPreviewComponent, ArticlesService, ArticlesSharedModule, ComponentsModule, FiltersComponent, ListComponent, SERVICES, getArticlesState, getReducer, initialState };
|
|
228
322
|
//# sourceMappingURL=smartsoft001-mobilems-articles-shell-angular.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"smartsoft001-mobilems-articles-shell-angular.mjs","sources":["../../../../../../packages/articles/shell/angular/src/lib/services/articles/articles.service.ts","../../../../../../packages/articles/shell/angular/src/lib/+state/articles.facade.ts","../../../../../../packages/articles/shell/angular/src/lib/+state/articles.reducer.ts","../../../../../../packages/articles/shell/angular/src/lib/components/list/list.component.ts","../../../../../../packages/articles/shell/angular/src/lib/components/list/list.component.html","../../../../../../packages/articles/shell/angular/src/lib/components/filters/filters.component.ts","../../../../../../packages/articles/shell/angular/src/lib/components/filters/filters.component.html","../../../../../../packages/articles/shell/angular/src/lib/components/components.module.ts","../../../../../../packages/articles/shell/angular/src/lib/services/index.ts","../../../../../../packages/articles/shell/angular/src/lib/articles.module.ts","../../../../../../packages/articles/shell/angular/src/lib/articles-shared.module.ts","../../../../../../packages/articles/shell/angular/src/lib/+state/articles.selectors.ts","../../../../../../packages/articles/shell/angular/src/lib/pages/list/list.component.ts","../../../../../../packages/articles/shell/angular/src/lib/pages/item/item.component.ts","../../../../../../packages/articles/shell/angular/src/smartsoft001-mobilems-articles-shell-angular.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\n\nimport { CrudBaseService } from '@smartsoft001-mobilems/angular';\nimport { Article } from '@smartsoft001-mobilems/articles-domain';\n\n@Injectable()\nexport class ArticlesService extends CrudBaseService<Article> {\n getUrlNameForDetails(): string {\n return 'article';\n }\n\n getUrlNameForList(): string {\n return 'Article';\n }\n}\n","import { inject, Injectable } from '@angular/core';\nimport { CrudFacade } from '@smartsoft001/crud-shell-angular';\n\nimport { Article } from '@smartsoft001-mobilems/articles-domain';\n\nimport { ArticlesService } from '../services/articles/articles.service';\n\n@Injectable()\nexport class ArticlesFacade extends CrudFacade<Article> {\n protected service = inject(ArticlesService);\n\n async downloadPdf(item: { title: string; id: string }): Promise<void> {\n await this.service.downloadPdf(item.title, item.id);\n }\n}\n","import { Action } from '@ngrx/store';\nimport {\n State as SmartState,\n initialState as smartInitialState,\n getReducer as smartGetReducer,\n} from '@smartsoft001/crud-shell-angular';\n\nimport { Article } from '@smartsoft001-mobilems/articles-domain';\n\n// import {ArticlesFacade} from \"./articles.facade\";\n\nexport type State = SmartState<Article>;\n\nexport const initialState = {\n ...smartInitialState,\n};\n\nconst articlesReducer = (state = initialState, action: any) => {\n switch (action.type) {\n //case ArticlesFacade.name + ' test':\n // return {\n // ...state,\n // loaded: false,\n // }\n\n default:\n return smartGetReducer('articles')(state, action);\n }\n};\n\nexport function getReducer() {\n return (state: any, action: Action) => {\n return articlesReducer(state, action);\n };\n}\n","import { NgTemplateOutlet } from '@angular/common';\nimport {\n Component,\n TemplateRef,\n contentChild,\n inject,\n ChangeDetectionStrategy,\n} from '@angular/core';\n\nimport { ArticlesFacade } from '../../+state/articles.facade';\n\n@Component({\n selector: 'smart-mobilems-articles-list',\n templateUrl: './list.component.html',\n changeDetection: ChangeDetectionStrategy.Eager,\n imports: [NgTemplateOutlet],\n})\nexport class ListComponent {\n private facade = inject(ArticlesFacade);\n\n list = this.facade.list;\n loading = this.facade.loading;\n\n itemTpl = contentChild<TemplateRef<any>>('itemTpl');\n loadingTpl = contentChild<TemplateRef<any>>('loadingTpl');\n}\n","@if (list(); as listData) {\n @if (listData && itemTpl()) {\n @for (item of listData; track item) {\n <ng-container\n *ngTemplateOutlet=\"itemTpl(); context: { $implicit: item }\"\n ></ng-container>\n }\n }\n}\n\n@if (loading()) {\n @if (loadingTpl()) {\n <ng-container *ngTemplateOutlet=\"loadingTpl()\"></ng-container>\n }\n}\n","import { NgTemplateOutlet } from '@angular/common';\nimport { Component, ChangeDetectionStrategy } from '@angular/core';\n\nimport { FiltersBaseComponent } from '@smartsoft001-mobilems/angular';\nimport { Article } from '@smartsoft001-mobilems/articles-domain';\n\n@Component({\n selector: 'smart-mobilems-articles-filters',\n templateUrl: './filters.component.html',\n changeDetection: ChangeDetectionStrategy.Eager,\n imports: [NgTemplateOutlet],\n})\nexport class FiltersComponent extends FiltersBaseComponent<Article> {}\n","<ng-container\n *ngTemplateOutlet=\"contentTpl(); context: { $implicit: context }\"\n></ng-container>\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\n\nimport { FiltersComponent } from './filters/filters.component';\nimport { ListComponent } from './list/list.component';\n\nconst COMPONENTS = [FiltersComponent, ListComponent];\n\n@NgModule({\n imports: [CommonModule, COMPONENTS],\n exports: [...COMPONENTS],\n})\nexport class ComponentsModule {}\n","import { CrudService } from '@smartsoft001/crud-shell-angular';\n\nimport { ArticlesService } from './articles/articles.service';\n\nexport * from './articles/articles.service';\n\nexport const SERVICES = [\n ArticlesService,\n {\n provide: CrudService,\n useClass: ArticlesService,\n },\n];\n","import { ModuleWithProviders, NgModule } from '@angular/core';\nimport { FILE_SERVICE_CONFIG, IFileServiceConfig } from '@smartsoft001/angular';\nimport {\n CrudConfig,\n CrudFullConfig,\n CrudFullModule,\n ICrudModuleOptionsWithoutRoutng,\n} from '@smartsoft001/crud-shell-angular';\nimport { IEntity } from '@smartsoft001/domain-core';\n\nimport { SharedConfig } from '@smartsoft001-mobilems/angular';\nimport { SharedModule } from '@smartsoft001-mobilems/angular';\n\nimport { ArticlesFacade } from './+state/articles.facade';\nimport { getReducer } from './+state/articles.reducer';\nimport { ComponentsModule } from './components';\nimport { SERVICES } from './services';\n\n@NgModule({\n declarations: [],\n providers: [...SERVICES, ArticlesFacade],\n imports: [SharedModule, ComponentsModule, CrudFullModule],\n exports: [ComponentsModule],\n})\nexport class ArticlesModule {\n static forFeature<T extends IEntity<string>>(\n options: ICrudModuleOptionsWithoutRoutng<T>,\n ): ModuleWithProviders<ArticlesModule> {\n if (!options.config.reducerFactory)\n options.config.reducerFactory = getReducer;\n return {\n ngModule: ArticlesModule,\n providers: [\n {\n provide: SharedConfig,\n useValue: { apiUrl: options.config.apiUrl } as SharedConfig,\n },\n { provide: CrudConfig, useValue: options.config },\n { provide: CrudFullConfig, useValue: options.config },\n {\n provide: FILE_SERVICE_CONFIG,\n useValue: { apiUrl: options.config.apiUrl } as IFileServiceConfig,\n },\n ],\n };\n }\n}\n","import { ModuleWithProviders, NgModule } from '@angular/core';\nimport { FILE_SERVICE_CONFIG, IFileServiceConfig } from '@smartsoft001/angular';\nimport {\n CrudConfig,\n CrudFullConfig,\n CrudModule,\n ICrudModuleOptionsWithoutRoutng,\n} from '@smartsoft001/crud-shell-angular';\nimport { IEntity } from '@smartsoft001/domain-core';\n\nimport { SharedConfig } from '@smartsoft001-mobilems/angular';\nimport { SharedModule } from '@smartsoft001-mobilems/angular';\n\nimport { ArticlesFacade } from './+state/articles.facade';\nimport { getReducer } from './+state/articles.reducer';\nimport { ComponentsModule } from './components';\nimport { SERVICES } from './services';\n\n@NgModule({\n declarations: [],\n providers: [...SERVICES, ArticlesFacade],\n imports: [SharedModule, ComponentsModule, CrudModule],\n exports: [ComponentsModule],\n})\nexport class ArticlesSharedModule {\n static forFeature<T extends IEntity<string>>(\n options: ICrudModuleOptionsWithoutRoutng<T>,\n ): ModuleWithProviders<ArticlesSharedModule> {\n if (!options.config.reducerFactory)\n options.config.reducerFactory = getReducer;\n return {\n ngModule: ArticlesSharedModule,\n providers: [\n {\n provide: SharedConfig,\n useValue: { apiUrl: options.config.apiUrl } as SharedConfig,\n },\n { provide: CrudConfig, useValue: options.config },\n { provide: CrudFullConfig, useValue: options.config },\n {\n provide: FILE_SERVICE_CONFIG,\n useValue: { apiUrl: options.config.apiUrl } as IFileServiceConfig,\n },\n ],\n };\n }\n}\n","import {\n createFeatureSelector,\n //createSelector\n} from '@ngrx/store';\n\nimport { State } from './articles.reducer';\n\nexport const getArticlesState = createFeatureSelector<State>('articles');\n\n//export const getArticlesTest = createSelector(\n// getArticlesState,\n// (state) => state.test\n//);\n","import { inject, Directive, Signal } from '@angular/core';\nimport { CrudListPageBaseComponent } from '@smartsoft001/crud-shell-angular';\n\nimport { Article } from '@smartsoft001-mobilems/articles-domain';\n\nimport { ArticlesFacade } from '../../+state';\n\n@Directive()\nexport abstract class ArticlesListComponent extends CrudListPageBaseComponent<Article> {\n protected readonly facade = inject(ArticlesFacade);\n\n list = this.facade.list as Signal<Article[]>;\n loading = this.facade.loading;\n filter = this.facade.filter;\n}\n","import { Directive, effect, inject } from '@angular/core';\nimport { toSignal } from '@angular/core/rxjs-interop';\nimport { ActivatedRoute } from '@angular/router';\nimport { CrudItemPageBaseComponent } from '@smartsoft001/crud-shell-angular';\n\nimport { SeoService, TranslationService } from '@smartsoft001-mobilems/angular';\nimport { Article } from '@smartsoft001-mobilems/articles-domain';\n\nimport { ArticlesFacade } from '../../+state';\n\n@Directive()\nexport abstract class ArticlesItemComponent extends CrudItemPageBaseComponent<Article> {\n protected readonly route = inject(ActivatedRoute);\n protected readonly seoService = inject(SeoService);\n protected readonly translationService = inject(TranslationService);\n protected readonly params = toSignal(this.route.params);\n\n override facade = inject(ArticlesFacade);\n\n readonly loading = this.facade.loading;\n readonly item = this.facade.selected;\n\n protected constructor() {\n super();\n\n effect(() => {\n const params = this.params();\n\n const id = params['id'];\n if (id) {\n this.facade.select(id);\n }\n });\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["smartInitialState","smartGetReducer"],"mappings":";;;;;;;;;;AAMM,MAAO,eAAgB,SAAQ,eAAwB,CAAA;IAC3D,oBAAoB,GAAA;AAClB,QAAA,OAAO,SAAS;IAClB;IAEA,iBAAiB,GAAA;AACf,QAAA,OAAO,SAAS;IAClB;iIAPW,eAAe,EAAA,IAAA,EAAA,IAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;qIAAf,eAAe,EAAA,CAAA,CAAA;;2FAAf,eAAe,EAAA,UAAA,EAAA,CAAA;kBAD3B;;;ACGK,MAAO,cAAe,SAAQ,UAAmB,CAAA;AADvD,IAAA,WAAA,GAAA;;AAEY,QAAA,IAAA,CAAA,OAAO,GAAG,MAAM,CAAC,eAAe,CAAC;AAK5C,IAAA;IAHC,MAAM,WAAW,CAAC,IAAmC,EAAA;AACnD,QAAA,MAAM,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,EAAE,CAAC;IACrD;iIALW,cAAc,EAAA,IAAA,EAAA,IAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UA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AA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;2FAArB,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBAD1C;;;ACVD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"smartsoft001-mobilems-articles-shell-angular.mjs","sources":["../../../../../../packages/articles/shell/angular/src/lib/services/articles/articles.service.ts","../../../../../../packages/articles/shell/angular/src/lib/+state/articles.facade.ts","../../../../../../packages/articles/shell/angular/src/lib/+state/articles.reducer.ts","../../../../../../packages/articles/shell/angular/src/lib/components/list/list.component.ts","../../../../../../packages/articles/shell/angular/src/lib/components/list/list.component.html","../../../../../../packages/articles/shell/angular/src/lib/components/filters/filters.component.ts","../../../../../../packages/articles/shell/angular/src/lib/components/filters/filters.component.html","../../../../../../packages/articles/shell/angular/src/lib/components/components.module.ts","../../../../../../packages/articles/shell/angular/src/lib/services/index.ts","../../../../../../packages/articles/shell/angular/src/lib/articles.module.ts","../../../../../../packages/articles/shell/angular/src/lib/articles-shared.module.ts","../../../../../../packages/articles/shell/angular/src/lib/+state/articles.selectors.ts","../../../../../../packages/articles/shell/angular/src/lib/pages/list/list.component.ts","../../../../../../packages/articles/shell/angular/src/lib/pages/item/item.component.ts","../../../../../../packages/articles/shell/angular/src/lib/pages/preview/preview.component.ts","../../../../../../packages/articles/shell/angular/src/smartsoft001-mobilems-articles-shell-angular.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\n\nimport { CrudBaseService } from '@smartsoft001-mobilems/angular';\nimport { Article } from '@smartsoft001-mobilems/articles-domain';\n\n@Injectable()\nexport class ArticlesService extends CrudBaseService<Article> {\n getUrlNameForDetails(): string {\n return 'article';\n }\n\n getUrlNameForList(): string {\n return 'Article';\n }\n}\n","import { inject, Injectable } from '@angular/core';\nimport { CrudFacade } from '@smartsoft001/crud-shell-angular';\n\nimport { Article } from '@smartsoft001-mobilems/articles-domain';\n\nimport { ArticlesService } from '../services/articles/articles.service';\n\n@Injectable()\nexport class ArticlesFacade extends CrudFacade<Article> {\n protected service = inject(ArticlesService);\n\n async downloadPdf(item: { title: string; id: string }): Promise<void> {\n await this.service.downloadPdf(item.title, item.id);\n }\n}\n","import { Action } from '@ngrx/store';\nimport {\n State as SmartState,\n initialState as smartInitialState,\n getReducer as smartGetReducer,\n} from '@smartsoft001/crud-shell-angular';\n\nimport { Article } from '@smartsoft001-mobilems/articles-domain';\n\n// import {ArticlesFacade} from \"./articles.facade\";\n\nexport type State = SmartState<Article>;\n\nexport const initialState = {\n ...smartInitialState,\n};\n\nconst articlesReducer = (state = initialState, action: any) => {\n switch (action.type) {\n //case ArticlesFacade.name + ' test':\n // return {\n // ...state,\n // loaded: false,\n // }\n\n default:\n return smartGetReducer('articles')(state, action);\n }\n};\n\nexport function getReducer() {\n return (state: any, action: Action) => {\n return articlesReducer(state, action);\n };\n}\n","import { NgTemplateOutlet } from '@angular/common';\nimport {\n Component,\n TemplateRef,\n contentChild,\n inject,\n ChangeDetectionStrategy,\n} from '@angular/core';\n\nimport { ArticlesFacade } from '../../+state/articles.facade';\n\n@Component({\n selector: 'smart-mobilems-articles-list',\n templateUrl: './list.component.html',\n changeDetection: ChangeDetectionStrategy.Eager,\n imports: [NgTemplateOutlet],\n})\nexport class ListComponent {\n private facade = inject(ArticlesFacade);\n\n list = this.facade.list;\n loading = this.facade.loading;\n\n itemTpl = contentChild<TemplateRef<any>>('itemTpl');\n loadingTpl = contentChild<TemplateRef<any>>('loadingTpl');\n}\n","@if (list(); as listData) {\n @if (listData && itemTpl()) {\n @for (item of listData; track item) {\n <ng-container\n *ngTemplateOutlet=\"itemTpl(); context: { $implicit: item }\"\n ></ng-container>\n }\n }\n}\n\n@if (loading()) {\n @if (loadingTpl()) {\n <ng-container *ngTemplateOutlet=\"loadingTpl()\"></ng-container>\n }\n}\n","import { NgTemplateOutlet } from '@angular/common';\nimport { Component, ChangeDetectionStrategy } from '@angular/core';\n\nimport { FiltersBaseComponent } from '@smartsoft001-mobilems/angular';\nimport { Article } from '@smartsoft001-mobilems/articles-domain';\n\n@Component({\n selector: 'smart-mobilems-articles-filters',\n templateUrl: './filters.component.html',\n changeDetection: ChangeDetectionStrategy.Eager,\n imports: [NgTemplateOutlet],\n})\nexport class FiltersComponent extends FiltersBaseComponent<Article> {}\n","<ng-container\n *ngTemplateOutlet=\"contentTpl(); context: { $implicit: context }\"\n></ng-container>\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\n\nimport { FiltersComponent } from './filters/filters.component';\nimport { ListComponent } from './list/list.component';\n\nconst COMPONENTS = [FiltersComponent, ListComponent];\n\n@NgModule({\n imports: [CommonModule, COMPONENTS],\n exports: [...COMPONENTS],\n})\nexport class ComponentsModule {}\n","import { CrudService } from '@smartsoft001/crud-shell-angular';\n\nimport { ArticlesService } from './articles/articles.service';\n\nexport * from './articles/articles.service';\n\nexport const SERVICES = [\n ArticlesService,\n {\n provide: CrudService,\n useClass: ArticlesService,\n },\n];\n","import { ModuleWithProviders, NgModule } from '@angular/core';\nimport { FILE_SERVICE_CONFIG, IFileServiceConfig } from '@smartsoft001/angular';\nimport {\n CrudConfig,\n CrudFullConfig,\n CrudFullModule,\n ICrudModuleOptionsWithoutRoutng,\n} from '@smartsoft001/crud-shell-angular';\nimport { IEntity } from '@smartsoft001/domain-core';\n\nimport { SharedConfig } from '@smartsoft001-mobilems/angular';\nimport { SharedModule } from '@smartsoft001-mobilems/angular';\n\nimport { ArticlesFacade } from './+state/articles.facade';\nimport { getReducer } from './+state/articles.reducer';\nimport { ComponentsModule } from './components';\nimport { SERVICES } from './services';\n\n@NgModule({\n declarations: [],\n providers: [...SERVICES, ArticlesFacade],\n imports: [SharedModule, ComponentsModule, CrudFullModule],\n exports: [ComponentsModule],\n})\nexport class ArticlesModule {\n static forFeature<T extends IEntity<string>>(\n options: ICrudModuleOptionsWithoutRoutng<T>,\n ): ModuleWithProviders<ArticlesModule> {\n if (!options.config.reducerFactory)\n options.config.reducerFactory = getReducer;\n return {\n ngModule: ArticlesModule,\n providers: [\n {\n provide: SharedConfig,\n useValue: { apiUrl: options.config.apiUrl } as SharedConfig,\n },\n { provide: CrudConfig, useValue: options.config },\n { provide: CrudFullConfig, useValue: options.config },\n {\n provide: FILE_SERVICE_CONFIG,\n useValue: { apiUrl: options.config.apiUrl } as IFileServiceConfig,\n },\n ],\n };\n }\n}\n","import { ModuleWithProviders, NgModule } from '@angular/core';\nimport { FILE_SERVICE_CONFIG, IFileServiceConfig } from '@smartsoft001/angular';\nimport {\n CrudConfig,\n CrudFullConfig,\n CrudModule,\n ICrudModuleOptionsWithoutRoutng,\n} from '@smartsoft001/crud-shell-angular';\nimport { IEntity } from '@smartsoft001/domain-core';\n\nimport { SharedConfig } from '@smartsoft001-mobilems/angular';\nimport { SharedModule } from '@smartsoft001-mobilems/angular';\n\nimport { ArticlesFacade } from './+state/articles.facade';\nimport { getReducer } from './+state/articles.reducer';\nimport { ComponentsModule } from './components';\nimport { SERVICES } from './services';\n\n@NgModule({\n declarations: [],\n providers: [...SERVICES, ArticlesFacade],\n imports: [SharedModule, ComponentsModule, CrudModule],\n exports: [ComponentsModule],\n})\nexport class ArticlesSharedModule {\n static forFeature<T extends IEntity<string>>(\n options: ICrudModuleOptionsWithoutRoutng<T>,\n ): ModuleWithProviders<ArticlesSharedModule> {\n if (!options.config.reducerFactory)\n options.config.reducerFactory = getReducer;\n return {\n ngModule: ArticlesSharedModule,\n providers: [\n {\n provide: SharedConfig,\n useValue: { apiUrl: options.config.apiUrl } as SharedConfig,\n },\n { provide: CrudConfig, useValue: options.config },\n { provide: CrudFullConfig, useValue: options.config },\n {\n provide: FILE_SERVICE_CONFIG,\n useValue: { apiUrl: options.config.apiUrl } as IFileServiceConfig,\n },\n ],\n };\n }\n}\n","import {\n createFeatureSelector,\n //createSelector\n} from '@ngrx/store';\n\nimport { State } from './articles.reducer';\n\nexport const getArticlesState = createFeatureSelector<State>('articles');\n\n//export const getArticlesTest = createSelector(\n// getArticlesState,\n// (state) => state.test\n//);\n","import { inject, Directive, Signal } from '@angular/core';\nimport { CrudListPageBaseComponent } from '@smartsoft001/crud-shell-angular';\n\nimport { Article } from '@smartsoft001-mobilems/articles-domain';\n\nimport { ArticlesFacade } from '../../+state';\n\n@Directive()\nexport abstract class ArticlesListComponent extends CrudListPageBaseComponent<Article> {\n protected readonly facade = inject(ArticlesFacade);\n\n list = this.facade.list as Signal<Article[]>;\n loading = this.facade.loading;\n filter = this.facade.filter;\n}\n","import { Directive, effect, inject } from '@angular/core';\nimport { toSignal } from '@angular/core/rxjs-interop';\nimport { ActivatedRoute } from '@angular/router';\nimport { CrudItemPageBaseComponent } from '@smartsoft001/crud-shell-angular';\n\nimport { SeoService, TranslationService } from '@smartsoft001-mobilems/angular';\nimport { Article } from '@smartsoft001-mobilems/articles-domain';\n\nimport { ArticlesFacade } from '../../+state';\n\n@Directive()\nexport abstract class ArticlesItemComponent extends CrudItemPageBaseComponent<Article> {\n protected readonly route = inject(ActivatedRoute);\n protected readonly seoService = inject(SeoService);\n protected readonly translationService = inject(TranslationService);\n protected readonly params = toSignal(this.route.params);\n\n override facade = inject(ArticlesFacade);\n\n readonly loading = this.facade.loading;\n readonly item = this.facade.selected;\n\n protected constructor() {\n super();\n\n effect(() => {\n const params = this.params();\n\n const id = params['id'];\n if (id) {\n this.facade.select(id);\n }\n });\n }\n}\n","import { isPlatformBrowser } from '@angular/common';\nimport { HttpClient } from '@angular/common/http';\nimport {\n computed,\n Directive,\n effect,\n inject,\n PLATFORM_ID,\n signal,\n} from '@angular/core';\nimport { toSignal } from '@angular/core/rxjs-interop';\nimport { ActivatedRoute, Router } from '@angular/router';\nimport { catchError, map, of } from 'rxjs';\n\nimport { Article } from '@smartsoft001-mobilems/articles-domain';\nimport { ArticleWidget } from '@smartsoft001-mobilems/models';\n\n/** Query params the CMS appends when it opens `/article-preview`. */\nexport interface ArticlePreviewQueryParams {\n apiHost?: string;\n dataUrl?: string;\n pathUrl?: string;\n pageUrl?: string;\n mediaUrl?: string;\n templateName?: string;\n viewType?: string;\n}\n\n/**\n * CMS preview of an unpublished article.\n *\n * The CMS opens `/article-preview?dataUrl=...` in the editor's browser and the\n * page fetches `dataUrl` with the CMS session cookie, so the route must be\n * rendered on the client (`RenderMode.Client`). A `viewType=thematic-path`\n * preview is forwarded to `thematicPathRoute`. Subclass with the app's own\n * template; the subclass owns only the view.\n */\n@Directive()\nexport abstract class ArticlesPreviewComponent {\n protected readonly http = inject(HttpClient);\n protected readonly route = inject(ActivatedRoute);\n protected readonly router = inject(Router);\n protected readonly platformId = inject(PLATFORM_ID);\n protected readonly queryParams = toSignal(this.route.queryParams);\n\n /** Route a `thematic-path` preview is forwarded to; override per app. */\n protected readonly thematicPathRoute: string = '/sciezki-tematyczne';\n\n readonly loading = signal(true);\n readonly noQueryParams = signal(false);\n readonly noLogin = signal(false);\n readonly item = signal<Article | null>(null);\n\n readonly plainTitle = computed(() =>\n (this.item()?.title ?? '').replace(/<[^>]*>/g, ''),\n );\n\n readonly widgets = computed<ArticleWidget[]>(() => {\n const widgets = this.item()?.bottomWidgets;\n if (!widgets) return [];\n\n return [...widgets].sort((a, b) => a.position - b.position);\n });\n\n readonly authorsText = computed(\n () =>\n this.item()\n ?.authors?.map((author) => author.name)\n .filter(Boolean)\n .join(', ') ?? '',\n );\n\n protected constructor() {\n effect(() => {\n const params = (this.queryParams() ?? {}) as ArticlePreviewQueryParams;\n\n if (params.viewType === 'thematic-path' && params.pathUrl) {\n this.forwardThematicPath(params);\n return;\n }\n\n if (params.dataUrl) {\n this.fetchArticle(params.dataUrl);\n } else {\n this.noQueryParams.set(true);\n this.loading.set(false);\n }\n });\n\n effect(() => {\n if (this.item() && isPlatformBrowser(this.platformId)) {\n window.scrollTo({ top: 0, behavior: 'instant' });\n }\n });\n }\n\n private forwardThematicPath(params: ArticlePreviewQueryParams): void {\n const id = params.pathUrl?.split('/').pop();\n this.router.navigate([this.thematicPathRoute, id], {\n queryParams: {\n pathUrl: params.pathUrl,\n pageUrl: params.pageUrl,\n mediaUrl: params.mediaUrl,\n },\n });\n }\n\n private fetchArticle(dataUrl: string): void {\n this.loading.set(true);\n this.noLogin.set(false);\n\n this.http\n .get<{ data?: Article | null }>(dataUrl, { withCredentials: true })\n .pipe(\n map((response) => response?.data ?? null),\n catchError((error) => {\n console.error('Error fetching preview data:', error);\n this.noLogin.set(true);\n return of(null);\n }),\n )\n .subscribe((article) => {\n this.item.set(article);\n this.loading.set(false);\n });\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["smartInitialState","smartGetReducer"],"mappings":";;;;;;;;;;;;AAMM,MAAO,eAAgB,SAAQ,eAAwB,CAAA;IAC3D,oBAAoB,GAAA;AAClB,QAAA,OAAO,SAAS;IAClB;IAEA,iBAAiB,GAAA;AACf,QAAA,OAAO,SAAS;IAClB;iIAPW,eAAe,EAAA,IAAA,EAAA,IAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;qIAAf,eAAe,EAAA,CAAA,CAAA;;2FAAf,eAAe,EAAA,UAAA,EAAA,CAAA;kBAD3B;;;ACGK,MAAO,cAAe,SAAQ,UAAmB,CAAA;AADvD,IAAA,WAAA,GAAA;;AAEY,QAAA,IAAA,CAAA,OAAO,GAAG,MAAM,CAAC,eAAe,CAAC;AAK5C,IAAA;IAHC,MAAM,WAAW,CAAC,IAAmC,EAAA;AACnD,QAAA,MAAM,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,EAAE,CAAC;IACrD;iIALW,cAAc,EAAA,IAAA,EAAA,IAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;qIAAd,cAAc,EAAA,CAAA,CAAA;;2FAAd,cAAc,EAAA,UAAA,EAAA,CAAA;kBAD1B;;;ACMM,MAAM,YAAY,GAAG;AAC1B,IAAA,GAAGA,cAAiB;;AAGtB,MAAM,eAAe,GAAG,CAAC,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e,EAAA;AAClC,QAAA,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC;AACtB,QAAA,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC;AAEvB,QAAA,IAAI,CAAC;aACF,GAAG,CAA4B,OAAO,EAAE,EAAE,eAAe,EAAE,IAAI,EAAE;aACjE,IAAI,CACH,GAAG,CAAC,CAAC,QAAQ,KAAK,QAAQ,EAAE,IAAI,IAAI,IAAI,CAAC,EACzC,UAAU,CAAC,CAAC,KAAK,KAAI;AACnB,YAAA,OAAO,CAAC,KAAK,CAAC,8BAA8B,EAAE,KAAK,CAAC;AACpD,YAAA,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC;AACtB,YAAA,OAAO,EAAE,CAAC,IAAI,CAAC;AACjB,QAAA,CAAC,CAAC;AAEH,aAAA,SAAS,CAAC,CAAC,OAAO,KAAI;AACrB,YAAA,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC;AACtB,YAAA,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC;AACzB,QAAA,CAAC,CAAC;IACN;iIAvFoB,wBAAwB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;qHAAxB,wBAAwB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;2FAAxB,wBAAwB,EAAA,UAAA,EAAA,CAAA;kBAD7C;;;ACrCD;;AAEG;;;;"}
|
package/package.json
CHANGED
|
@@ -9,7 +9,9 @@ import * as i1 from '@angular/common';
|
|
|
9
9
|
import { Article } from '@smartsoft001-mobilems/articles-domain';
|
|
10
10
|
import * as dist_packages_articles_domain_src from 'dist/packages/articles/domain/src';
|
|
11
11
|
import * as _angular_router from '@angular/router';
|
|
12
|
-
import { ActivatedRoute } from '@angular/router';
|
|
12
|
+
import { ActivatedRoute, Router } from '@angular/router';
|
|
13
|
+
import { HttpClient } from '@angular/common/http';
|
|
14
|
+
import { ArticleWidget } from '@smartsoft001-mobilems/models';
|
|
13
15
|
import * as _ngrx_store from '@ngrx/store';
|
|
14
16
|
import { Action } from '@ngrx/store';
|
|
15
17
|
|
|
@@ -129,10 +131,51 @@ declare abstract class ArticlesItemComponent extends CrudItemPageBaseComponent<A
|
|
|
129
131
|
static ɵdir: i0.ɵɵDirectiveDeclaration<ArticlesItemComponent, never, never, {}, {}, never, never, true, never>;
|
|
130
132
|
}
|
|
131
133
|
|
|
134
|
+
/** Query params the CMS appends when it opens `/article-preview`. */
|
|
135
|
+
interface ArticlePreviewQueryParams {
|
|
136
|
+
apiHost?: string;
|
|
137
|
+
dataUrl?: string;
|
|
138
|
+
pathUrl?: string;
|
|
139
|
+
pageUrl?: string;
|
|
140
|
+
mediaUrl?: string;
|
|
141
|
+
templateName?: string;
|
|
142
|
+
viewType?: string;
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* CMS preview of an unpublished article.
|
|
146
|
+
*
|
|
147
|
+
* The CMS opens `/article-preview?dataUrl=...` in the editor's browser and the
|
|
148
|
+
* page fetches `dataUrl` with the CMS session cookie, so the route must be
|
|
149
|
+
* rendered on the client (`RenderMode.Client`). A `viewType=thematic-path`
|
|
150
|
+
* preview is forwarded to `thematicPathRoute`. Subclass with the app's own
|
|
151
|
+
* template; the subclass owns only the view.
|
|
152
|
+
*/
|
|
153
|
+
declare abstract class ArticlesPreviewComponent {
|
|
154
|
+
protected readonly http: HttpClient;
|
|
155
|
+
protected readonly route: ActivatedRoute;
|
|
156
|
+
protected readonly router: Router;
|
|
157
|
+
protected readonly platformId: Object;
|
|
158
|
+
protected readonly queryParams: i0.Signal<_angular_router.Params>;
|
|
159
|
+
/** Route a `thematic-path` preview is forwarded to; override per app. */
|
|
160
|
+
protected readonly thematicPathRoute: string;
|
|
161
|
+
readonly loading: i0.WritableSignal<boolean>;
|
|
162
|
+
readonly noQueryParams: i0.WritableSignal<boolean>;
|
|
163
|
+
readonly noLogin: i0.WritableSignal<boolean>;
|
|
164
|
+
readonly item: i0.WritableSignal<Article>;
|
|
165
|
+
readonly plainTitle: i0.Signal<string>;
|
|
166
|
+
readonly widgets: i0.Signal<ArticleWidget[]>;
|
|
167
|
+
readonly authorsText: i0.Signal<string>;
|
|
168
|
+
protected constructor();
|
|
169
|
+
private forwardThematicPath;
|
|
170
|
+
private fetchArticle;
|
|
171
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ArticlesPreviewComponent, never>;
|
|
172
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<ArticlesPreviewComponent, never, never, {}, {}, never, never, true, never>;
|
|
173
|
+
}
|
|
174
|
+
|
|
132
175
|
declare const SERVICES: (typeof ArticlesService | {
|
|
133
176
|
provide: typeof CrudService;
|
|
134
177
|
useClass: typeof ArticlesService;
|
|
135
178
|
})[];
|
|
136
179
|
|
|
137
|
-
export { ArticlesFacade, ArticlesItemComponent, ArticlesListComponent, ArticlesModule, ArticlesService, ArticlesSharedModule, ComponentsModule, FiltersComponent, ListComponent, SERVICES, getArticlesState, getReducer, initialState };
|
|
138
|
-
export type { State };
|
|
180
|
+
export { ArticlesFacade, ArticlesItemComponent, ArticlesListComponent, ArticlesModule, ArticlesPreviewComponent, ArticlesService, ArticlesSharedModule, ComponentsModule, FiltersComponent, ListComponent, SERVICES, getArticlesState, getReducer, initialState };
|
|
181
|
+
export type { ArticlePreviewQueryParams, State };
|