@everymatrix/blog-articles-grid 1.94.9 → 1.94.15

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,11 +1,12 @@
1
1
  import { EventEmitter } from '../../stencil-public-runtime';
2
+ import { type Device } from "../../../../../../libs/common/src/device/index";
2
3
  import "../../../../../../dist/packages/stencil/helper-pagination/dist/types/index";
3
4
  import type { BlogPost, BlogPostResponse } from '../../utils/type';
4
5
  export declare class BlogArticlesGrid {
5
6
  /**
6
7
  * Endpoint URL for the source of data
7
8
  */
8
- cmsEndpoint: string;
9
+ cmsEndpoint?: string;
9
10
  /**
10
11
  * Language of the widget
11
12
  */
@@ -21,7 +22,7 @@ export declare class BlogArticlesGrid {
21
22
  /**
22
23
  * Client custom styling via streamStyling
23
24
  */
24
- mbSource: string;
25
+ mbSource?: string;
25
26
  /**
26
27
  * Client custom styling via string
27
28
  */
@@ -65,7 +66,7 @@ export declare class BlogArticlesGrid {
65
66
  /**
66
67
  * Customize pagination: Activate pagination
67
68
  */
68
- paginationActive: boolean;
69
+ paginationActive?: boolean;
69
70
  /**
70
71
  * Customize pagination: Activate pagination arrows
71
72
  */
@@ -90,42 +91,42 @@ export declare class BlogArticlesGrid {
90
91
  * Filter blog post list using eventId from Sport page
91
92
  */
92
93
  eventId?: string;
93
- articleActionButton: EventEmitter<Object>;
94
+ articleActionButton: EventEmitter<Object> | undefined;
94
95
  getArticleId(postId: number, slug: string, customPath: string): void;
95
96
  paginationBlogList: any;
96
97
  currentPage: number;
97
98
  hasErrors: boolean;
98
99
  private isLoading;
99
100
  bannerMatrixReady: boolean;
100
- nextPage: string;
101
- previousPage: string;
102
- device: string;
103
- displayedBlogResponse: BlogPostResponse;
104
- paginationBlogResponse: BlogPostResponse;
105
- allBlogResponse: BlogPostResponse;
101
+ nextPage: string | null;
102
+ previousPage: string | null;
103
+ device: Device;
104
+ displayedBlogResponse?: BlogPostResponse;
105
+ paginationBlogResponse?: BlogPostResponse;
106
+ allBlogResponse?: BlogPostResponse;
106
107
  totalBlogs: number;
107
108
  lastPage: number;
108
- clientStylingContent: string;
109
109
  private isInitialized;
110
110
  handleBannerReady(): void;
111
111
  watchEndpoint(newValue: string, oldValue: string): void;
112
- handleClientStylingChange(newValue: any, oldValue: any): void;
113
- handleClientStylingChangeURL(newValue: any, oldValue: any): void;
114
- private stylingContainer;
112
+ handleClientStylingChange(newValue: string, oldValue: string): void;
113
+ handleClientStylingChangeURL(newValue: string, oldValue: string): void;
114
+ private stylingContainer?;
115
115
  private stylingSubscription;
116
- private defaultStyling;
116
+ private paginationDefaultStyling;
117
117
  hpPageChange(event: CustomEvent<BlogArticlesGrid>): void;
118
118
  sortArticlesByDate(blogItems: BlogPost[]): BlogPost[];
119
119
  findLatestFeatured(blogItems: BlogPost[]): BlogPost;
120
- moveLatestFeatureToStart(blogItems: BlogPost[], latestFeatured: BlogPost): BlogPost[];
120
+ moveLatestFeatureToStart(blogItems: BlogPost[], latestFeatured: BlogPost | null): BlogPost[];
121
121
  fetchBlogPosts(page?: number, allPosts?: boolean): Promise<BlogPostResponse>;
122
122
  getBlogArticleGrid(forceFetch?: boolean, page?: number): Promise<void>;
123
123
  componentWillLoad(): void;
124
+ handleClientStyling(): void;
124
125
  componentDidLoad(): void;
125
126
  disconnectedCallback(): void;
126
127
  setImage: (image: any) => string;
127
- parseDate(dateString: any): Date;
128
- formatDate(dateString: any): string;
129
- renderContentConditionally: (content: string) => HTMLElement;
128
+ parseDate(dateString: string): Date;
129
+ formatDate(dateString: string): string;
130
+ renderContentConditionally: (content: string) => HTMLElement | null;
130
131
  render(): void;
131
132
  }
@@ -26,7 +26,7 @@ export namespace Components {
26
26
  /**
27
27
  * Endpoint URL for the source of data
28
28
  */
29
- "cmsEndpoint": string;
29
+ "cmsEndpoint"?: string;
30
30
  /**
31
31
  * CMS Endpoint stage
32
32
  */
@@ -46,7 +46,7 @@ export namespace Components {
46
46
  /**
47
47
  * Client custom styling via streamStyling
48
48
  */
49
- "mbSource": string;
49
+ "mbSource"?: string;
50
50
  /**
51
51
  * Customize pagination: Activate pagination numbered navigation
52
52
  */
@@ -58,7 +58,7 @@ export namespace Components {
58
58
  /**
59
59
  * Customize pagination: Activate pagination
60
60
  */
61
- "paginationActive": boolean;
61
+ "paginationActive"?: boolean;
62
62
  /**
63
63
  * Event name to be sent when the button is clicked
64
64
  */
@@ -103,7 +103,7 @@ export interface BlogArticlesGridCustomEvent<T> extends CustomEvent<T> {
103
103
  }
104
104
  declare global {
105
105
  interface HTMLBlogArticlesGridElementEventMap {
106
- "articleActionButton": Object;
106
+ "articleActionButton": any;
107
107
  }
108
108
  interface HTMLBlogArticlesGridElement extends Components.BlogArticlesGrid, HTMLStencilElement {
109
109
  addEventListener<K extends keyof HTMLBlogArticlesGridElementEventMap>(type: K, listener: (this: HTMLBlogArticlesGridElement, ev: BlogArticlesGridCustomEvent<HTMLBlogArticlesGridElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
@@ -169,7 +169,7 @@ declare namespace LocalJSX {
169
169
  * Customize pagination: Activate pagination numbered navigation
170
170
  */
171
171
  "numberedNavActive"?: boolean;
172
- "onArticleActionButton"?: (event: BlogArticlesGridCustomEvent<Object>) => void;
172
+ "onArticleActionButton"?: (event: BlogArticlesGridCustomEvent<any>) => void;
173
173
  /**
174
174
  * Page to particularly be opened on start
175
175
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@everymatrix/blog-articles-grid",
3
- "version": "1.94.9",
3
+ "version": "1.94.15",
4
4
  "main": "./dist/index.cjs.js",
5
5
  "module": "./dist/index.js",
6
6
  "es2015": "./dist/esm/index.mjs",
@@ -1,67 +0,0 @@
1
- export function checkDeviceType() {
2
- const userAgent = navigator.userAgent.toLowerCase();
3
- const width = screen.availWidth;
4
- const height = screen.availHeight;
5
- if (userAgent.includes('iphone')) {
6
- return 'mobile';
7
- }
8
- if (userAgent.includes('android')) {
9
- if (height > width && width < 800) {
10
- return 'mobile';
11
- }
12
- if (width > height && height < 800) {
13
- return 'tablet';
14
- }
15
- }
16
- return 'desktop';
17
- }
18
- function checkCustomDeviceWidth() {
19
- const width = screen.availWidth;
20
- if (width < 600) {
21
- return 'mobile';
22
- }
23
- else if (width >= 600 && width < 1100) {
24
- return 'tablet';
25
- }
26
- }
27
- function isIpad() {
28
- const userAgent = navigator.userAgent.toLowerCase();
29
- // Traditional iPad user agent
30
- if (userAgent.includes('ipad')) {
31
- return true;
32
- }
33
- return userAgent.indexOf('macintosh') > -1 && navigator.maxTouchPoints && navigator.maxTouchPoints > 2;
34
- }
35
- export function getDeviceCustom() {
36
- const userAgent = navigator.userAgent.toLowerCase();
37
- let source = '';
38
- source = (userAgent.includes('android') || userAgent.includes('iphone') || isIpad()) ? checkCustomDeviceWidth() : 'desktop';
39
- return source;
40
- }
41
- export const getDevice = () => {
42
- let userAgent = window.navigator.userAgent;
43
- if (userAgent.toLowerCase().match(/android/i)) {
44
- return 'Android';
45
- }
46
- if (userAgent.toLowerCase().match(/iphone/i)) {
47
- return 'iPhone';
48
- }
49
- if (userAgent.toLowerCase().match(/ipad|ipod/i)) {
50
- return 'iPad';
51
- }
52
- return 'PC';
53
- };
54
- export const getDevicePlatform = () => {
55
- const device = getDevice();
56
- if (device) {
57
- if (device === 'PC') {
58
- return 'dk';
59
- }
60
- else if (device === 'iPad' || device === 'iPhone') {
61
- return 'mtWeb';
62
- }
63
- else {
64
- return 'mtWeb';
65
- }
66
- }
67
- };
@@ -1,4 +0,0 @@
1
- export declare function checkDeviceType(): 'mobile' | 'tablet' | 'desktop';
2
- export declare function getDeviceCustom(): string;
3
- export declare const getDevice: () => "Android" | "iPhone" | "iPad" | "PC";
4
- export declare const getDevicePlatform: () => "dk" | "mtWeb";