@salesforcedevs/dw-components 0.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/LICENSE +12 -0
  2. package/lwc.config.json +24 -0
  3. package/package.json +26 -0
  4. package/src/modules/dw/blogsGrid/blogsGrid.css +89 -0
  5. package/src/modules/dw/blogsGrid/blogsGrid.html +73 -0
  6. package/src/modules/dw/blogsGrid/blogsGrid.ts +28 -0
  7. package/src/modules/dw/cardBlogPostProvider/cardBlogPostProvider.css +3 -0
  8. package/src/modules/dw/cardBlogPostProvider/cardBlogPostProvider.html +16 -0
  9. package/src/modules/dw/cardBlogPostProvider/cardBlogPostProvider.ts +29 -0
  10. package/src/modules/dw/cardPodcastEpisodeProvider/cardPodcastEpisodeProvider.css +3 -0
  11. package/src/modules/dw/cardPodcastEpisodeProvider/cardPodcastEpisodeProvider.html +12 -0
  12. package/src/modules/dw/cardPodcastEpisodeProvider/cardPodcastEpisodeProvider.ts +29 -0
  13. package/src/modules/dw/codeSamplesGrid/codeSamplesGrid.css +171 -0
  14. package/src/modules/dw/codeSamplesGrid/codeSamplesGrid.html +138 -0
  15. package/src/modules/dw/codeSamplesGrid/codeSamplesGrid.ts +431 -0
  16. package/src/modules/dw/contentArchive/altData.js +3 -0
  17. package/src/modules/dw/contentArchive/contentArchive.css +242 -0
  18. package/src/modules/dw/contentArchive/contentArchive.html +340 -0
  19. package/src/modules/dw/contentArchive/contentArchive.ts +519 -0
  20. package/src/modules/dw/contentArchive/contentArchive.types.ts +98 -0
  21. package/src/modules/dw/contentArchive/utils.ts +193 -0
  22. package/src/modules/dw/deSignupForm/deSignupForm.css +75 -0
  23. package/src/modules/dw/deSignupForm/deSignupForm.html +117 -0
  24. package/src/modules/dw/deSignupForm/deSignupForm.ts +269 -0
  25. package/src/modules/dw/deSignupForm/submitForm.ts +93 -0
  26. package/src/modules/dw/docsGrid/docsGrid.css +83 -0
  27. package/src/modules/dw/docsGrid/docsGrid.html +89 -0
  28. package/src/modules/dw/docsGrid/docsGrid.ts +540 -0
  29. package/src/modules/dw/eventsList/eventsList.css +113 -0
  30. package/src/modules/dw/eventsList/eventsList.html +98 -0
  31. package/src/modules/dw/eventsList/eventsList.ts +192 -0
  32. package/src/modules/dw/instrumentation/instrumentation.html +1 -0
  33. package/src/modules/dw/instrumentation/instrumentation.ts +97 -0
  34. package/src/modules/dw/newsletterForm/newsletterForm.css +74 -0
  35. package/src/modules/dw/newsletterForm/newsletterForm.html +67 -0
  36. package/src/modules/dw/newsletterForm/newsletterForm.ts +233 -0
  37. package/src/modules/dw/podcastSubscription/podcastSubscription.css +91 -0
  38. package/src/modules/dw/podcastSubscription/podcastSubscription.html +24 -0
  39. package/src/modules/dw/podcastSubscription/podcastSubscription.ts +52 -0
  40. package/src/modules/dw/podcastsGrid/podcastsGrid.css +5 -0
  41. package/src/modules/dw/podcastsGrid/podcastsGrid.html +29 -0
  42. package/src/modules/dw/podcastsGrid/podcastsGrid.ts +9 -0
  43. package/src/modules/dw/podcastsPromo/podcastsPromo.css +32 -0
  44. package/src/modules/dw/podcastsPromo/podcastsPromo.html +36 -0
  45. package/src/modules/dw/podcastsPromo/podcastsPromo.ts +3 -0
  46. package/src/modules/dw/rcgTable/altData.ts +78 -0
  47. package/src/modules/dw/rcgTable/getTableData.ts +10 -0
  48. package/src/modules/dw/rcgTable/rcgTable.css +39 -0
  49. package/src/modules/dw/rcgTable/rcgTable.html +31 -0
  50. package/src/modules/dw/rcgTable/rcgTable.ts +34 -0
  51. package/src/modules/dw/slackCta/slackCta.css +47 -0
  52. package/src/modules/dw/slackCta/slackCta.html +17 -0
  53. package/src/modules/dw/slackCta/slackCta.ts +12 -0
  54. package/src/modules/dw/slackSuccess/slackSuccess.css +65 -0
  55. package/src/modules/dw/slackSuccess/slackSuccess.html +32 -0
  56. package/src/modules/dw/slackSuccess/slackSuccess.ts +34 -0
  57. package/src/modules/dwBaseElements/postsGrid/postsGrid.ts +80 -0
  58. package/src/modules/dwHelpers/postsGrid/postsGrid.css +9 -0
@@ -0,0 +1,519 @@
1
+ import { LightningElement } from "lwc";
2
+ import cx from "classnames";
3
+ import { PER_PAGE_COUNT, getArchivePosts, getArchiveFilterList } from "./utils";
4
+ import { sortSplittedPostsByMonth } from "dxUtils/dates";
5
+ import { getUrlParamValue, setUrlParamValue } from "dxUtils/queryCoordinator";
6
+ import {
7
+ Filters,
8
+ FilterMenuData,
9
+ FilterMenuNames,
10
+ FilterMenuItem
11
+ } from "./contentArchive.types";
12
+
13
+ const MOBILE_MATCH = "767px";
14
+
15
+ enum FilterNames {
16
+ QUERY_CONTENT_FILTER = "contentType",
17
+ QUERY_AUTHOR_FILTER = "authors",
18
+ QUERY_DATES_FILTER = "dates",
19
+ QUERY_CATEGORIES_FILTER = "categories"
20
+ }
21
+
22
+ const PODCASTS = { id: 2, name: "Podcasts" };
23
+ const BLOGS = { id: 1, name: "Blogs" };
24
+ export default class ContentArchive extends LightningElement {
25
+ private _contentTypeList = [
26
+ { ...BLOGS, checked: false },
27
+ { ...PODCASTS, checked: false }
28
+ ];
29
+ private totalResults: number | null = null;
30
+ private currentPage: number = 1;
31
+ private totalPages: number = 1;
32
+ private loading: boolean = true;
33
+ private filtersLoading: boolean = true;
34
+ private filtersDatesLoading: boolean = false;
35
+ private modalOpen: boolean = false;
36
+ private cardType: "expanded" | "minimal" = "expanded";
37
+
38
+ private postsByDate: {} = {};
39
+ private dateList: any[] = [];
40
+ private authorList: any[] = [];
41
+ private categoryList: any[] = [];
42
+
43
+ private isMobile: boolean = false;
44
+ private mobileMatchMedia!: MediaQueryList;
45
+
46
+ private selectedFilterMenuData: Filters = {
47
+ contentType: [],
48
+ dates: [],
49
+ authors: [],
50
+ categories: []
51
+ };
52
+
53
+ private posts: any[] = [];
54
+
55
+ get isEmptyState() {
56
+ return this.totalResults === 0 && !this.loading;
57
+ }
58
+
59
+ get currentPageLength() {
60
+ if (this.loading) {
61
+ return "Loading Results...";
62
+ }
63
+ let currentFirstResultNumber = (this.currentPage - 1) * PER_PAGE_COUNT;
64
+ const currentLastResultNumber =
65
+ currentFirstResultNumber + this.posts.length;
66
+ currentFirstResultNumber += 1;
67
+
68
+ return `Showing ${currentFirstResultNumber} - ${currentLastResultNumber} of ${this.totalResults}`;
69
+ }
70
+
71
+ get showPagination() {
72
+ return this.totalPages > 1;
73
+ }
74
+
75
+ get resultsHeading() {
76
+ let pageInfo = "";
77
+
78
+ if (this.currentPage !== 1) {
79
+ pageInfo = `- Page ${this.currentPage}`;
80
+ }
81
+ return this.totalResults ? `Archive Results ${pageInfo}` : "No results";
82
+ }
83
+
84
+ get spinnerSize() {
85
+ return this.isMobile ? "medium" : "large";
86
+ }
87
+
88
+ get isMinimalCard() {
89
+ return this.cardType === "minimal";
90
+ }
91
+
92
+ get minimalCardClass() {
93
+ return cx("min-card-btn", this.cardType === "minimal" && "btn-active");
94
+ }
95
+
96
+ get expandedCardClass() {
97
+ return cx("exp-card-btn", this.cardType === "expanded" && "btn-active");
98
+ }
99
+
100
+ get postsByMonth() {
101
+ const posts = this.splitPostsByMonth(this.posts);
102
+
103
+ return Object.keys(posts).map((key) => [key, [...posts[key]]]);
104
+ }
105
+
106
+ get contentTypeList() {
107
+ return this._contentTypeList;
108
+ }
109
+
110
+ get hideBlogFilters() {
111
+ return (
112
+ this.selectedFilterMenuData.contentType.length === 1 &&
113
+ this.selectedFilterMenuData.contentType[0].id === 2
114
+ );
115
+ }
116
+
117
+ get contentTypeTitle() {
118
+ return `Content Type ${
119
+ this.selectedFilterMenuData.contentType.length > 0
120
+ ? `(${this.selectedFilterMenuData.contentType.length})`
121
+ : ""
122
+ }`;
123
+ }
124
+ get dateTitle() {
125
+ return `Date ${
126
+ this.selectedFilterMenuData.dates.length > 0
127
+ ? `(${this.selectedFilterMenuData.dates.length})`
128
+ : ""
129
+ }`;
130
+ }
131
+ get authorTitle() {
132
+ return `Blog Author ${
133
+ this.selectedFilterMenuData.authors.length > 0
134
+ ? `(${this.selectedFilterMenuData.authors.length})`
135
+ : ""
136
+ }`;
137
+ }
138
+ get categoryTitle() {
139
+ return `Topic ${
140
+ this.selectedFilterMenuData.categories.length > 0
141
+ ? `(${this.selectedFilterMenuData.categories.length})`
142
+ : ""
143
+ }`;
144
+ }
145
+
146
+ get selectedPostType() {
147
+ return this.selectedFilterMenuData.contentType.length === 1
148
+ ? this.selectedFilterMenuData.contentType[0].name.toLowerCase()
149
+ : "all";
150
+ }
151
+
152
+ private filterSelectedDates(
153
+ selectedDate: string,
154
+ toRemove: boolean = false
155
+ ) {
156
+ const currentDateList = this.selectedFilterMenuData.dates;
157
+ return currentDateList.filter((currentDateItem: { name: string }) => {
158
+ const year = currentDateItem.name.slice(-4);
159
+
160
+ if (toRemove) {
161
+ return selectedDate.slice(-4) !== currentDateItem.name;
162
+ }
163
+
164
+ return year !== selectedDate;
165
+ });
166
+ }
167
+
168
+ private handleUpdateSiteFilter(e: CustomEvent) {
169
+ const { value, name, checked } = e.detail;
170
+
171
+ let selectedFilters: string[] | null = [];
172
+ this._contentTypeList.forEach((option) => {
173
+ if (option.name === value.name) {
174
+ option.checked = checked;
175
+ }
176
+ if (option.checked) {
177
+ selectedFilters?.push(option.name);
178
+ }
179
+ });
180
+
181
+ if (selectedFilters?.length === 0) {
182
+ selectedFilters = null;
183
+ }
184
+
185
+ this.updateSelectedFilters(value, name, checked);
186
+ this.fetchArchiveFilterDateList();
187
+ }
188
+
189
+ private handleFiltersEvent(e: CustomEvent) {
190
+ const { value, name, checked } = e.detail;
191
+ this.updateSelectedFilters(value, name, checked);
192
+ }
193
+
194
+ private updateSelectedFilters(
195
+ value: any,
196
+ name: FilterMenuNames,
197
+ checked: any,
198
+ suppressFetch: boolean = false
199
+ ) {
200
+ let copy = {
201
+ ...this.selectedFilterMenuData
202
+ };
203
+
204
+ if (!checked) {
205
+ copy[name] = copy[name].filter(
206
+ (selectedFilterItem: { name: string }) => {
207
+ return selectedFilterItem.name !== value.name;
208
+ }
209
+ );
210
+ } else if (!copy[name].includes(value)) {
211
+ const regex = /^(\d{4})$/g;
212
+
213
+ if (regex.test(value.name) && copy[name].length > 0) {
214
+ copy[name] = this.filterSelectedDates(value.name);
215
+ } else if (regex.test(value.name.slice(-4))) {
216
+ copy[name] = this.filterSelectedDates(value.name, true);
217
+ }
218
+
219
+ if (!copy[name].find((item) => item.name === value.name)) {
220
+ copy[name].push(value);
221
+ }
222
+ }
223
+
224
+ // Remove filters when only podcast is selected
225
+ if (
226
+ name === FilterNames.QUERY_CONTENT_FILTER &&
227
+ copy[name].length === 1 &&
228
+ !copy[name].some((item: { id: number }) => item.id === 1)
229
+ ) {
230
+ setUrlParamValue({ QUERY_AUTHOR_FILTER: [] });
231
+ copy = {
232
+ contentType: [...copy.contentType],
233
+ categories: [...copy.categories],
234
+ dates: [...copy.dates],
235
+ authors: []
236
+ };
237
+ }
238
+
239
+ // Checkmark the blog type if value is a blog author
240
+ if (name === "authors" && checked) {
241
+ setUrlParamValue({ [FilterNames.QUERY_CONTENT_FILTER]: ["Blogs"] });
242
+ copy = {
243
+ contentType: [{ id: 1, name: "Blogs" }],
244
+ categories: [...copy.categories],
245
+ dates: [...copy.dates],
246
+ authors: [...copy.authors]
247
+ };
248
+ }
249
+
250
+ setUrlParamValue({ [name]: copy[name].map((a) => a.name) });
251
+
252
+ this.selectedFilterMenuData = copy;
253
+ this.currentPage = 1;
254
+ this.updateCheckedStatus();
255
+ if (!suppressFetch) {
256
+ this.fetchPostsByCardType();
257
+ }
258
+ }
259
+
260
+ private async updateCheckedStatus() {
261
+ const filterMenuElements =
262
+ this.template.querySelectorAll("dx-filter-menu");
263
+
264
+ filterMenuElements.forEach((filterMenuElement: any) =>
265
+ filterMenuElement.updateCheckedStatus(this.selectedFilterMenuData)
266
+ );
267
+ }
268
+
269
+ private removeFilterItem(e: any) {
270
+ const { name, value } = e.target;
271
+
272
+ this.handleUpdateSiteFilter(
273
+ new CustomEvent("updateselectedfilters", {
274
+ detail: {
275
+ name,
276
+ value,
277
+ checked: false
278
+ }
279
+ })
280
+ );
281
+ }
282
+
283
+ private toggleModal() {
284
+ this.modalOpen = !this.modalOpen;
285
+ }
286
+
287
+ // split posts by month for the minimal view date header
288
+ private splitPostsByMonth(posts: any[]) {
289
+ const postsByMonth: { [key: string]: Array<{}> } = {};
290
+
291
+ posts.forEach((post) => {
292
+ const date = new Date(post.date);
293
+ const month = new Intl.DateTimeFormat("en-US", {
294
+ month: "long"
295
+ }).format(date);
296
+ const year = date.getFullYear();
297
+
298
+ if (!postsByMonth[`${month} ${year}`]) {
299
+ postsByMonth[`${month} ${year}`] = [];
300
+ }
301
+
302
+ postsByMonth[`${month} ${year}`].push({ ...post });
303
+ });
304
+
305
+ return sortSplittedPostsByMonth(postsByMonth);
306
+ }
307
+
308
+ private handleCardTypeChange(e: any) {
309
+ const selectedCardType = e.target.value;
310
+ if (this.cardType !== selectedCardType) {
311
+ this.cardType = selectedCardType;
312
+
313
+ this.fetchPostsByCardType();
314
+ }
315
+ }
316
+
317
+ private handleFilterClear() {
318
+ this.selectedFilterMenuData = {
319
+ contentType: [],
320
+ dates: [],
321
+ authors: [],
322
+ categories: []
323
+ };
324
+
325
+ this.updateCheckedStatus();
326
+ this.fetchPostsByCardType();
327
+
328
+ setUrlParamValue({
329
+ [FilterNames.QUERY_CONTENT_FILTER]: [],
330
+ [FilterNames.QUERY_AUTHOR_FILTER]: [],
331
+ [FilterNames.QUERY_CATEGORIES_FILTER]: [],
332
+ [FilterNames.QUERY_DATES_FILTER]: []
333
+ });
334
+ }
335
+
336
+ private goToPage(e: CustomEvent) {
337
+ const page = e.detail;
338
+ this.currentPage = page;
339
+ this.totalResults = 0;
340
+ this.totalPages = 0;
341
+
342
+ this.fetchPostsByCardType();
343
+ }
344
+
345
+ private fetchPostsByCardType() {
346
+ if (this.cardType === "minimal") {
347
+ this.fetchPosts(20);
348
+ } else {
349
+ this.fetchPosts(10);
350
+ }
351
+ }
352
+
353
+ private async fetchArchiveFilterList() {
354
+ if (!this.dateList.length) {
355
+ this.filtersLoading = true;
356
+
357
+ const { dates, authors, categories } = await getArchiveFilterList(
358
+ this.selectedPostType
359
+ );
360
+
361
+ this.dateList = this.splitOptionsByDate(dates);
362
+ this.authorList = authors;
363
+ this.categoryList = categories;
364
+ this.filtersLoading = false;
365
+
366
+ requestAnimationFrame(() => this.updateAllFiltersFromUrl());
367
+ }
368
+ }
369
+
370
+ private async fetchArchiveFilterDateList() {
371
+ this.filtersDatesLoading = true;
372
+
373
+ const { dates } = await getArchiveFilterList(this.selectedPostType);
374
+
375
+ this.dateList = this.splitOptionsByDate(dates);
376
+
377
+ this.filtersDatesLoading = false;
378
+ }
379
+
380
+ private async fetchPosts(numberOfPosts: number) {
381
+ this.loading = true;
382
+
383
+ const { posts, totalResults, totalPages } = await getArchivePosts({
384
+ count: numberOfPosts,
385
+ page: this.currentPage,
386
+ contentType: this.cardType,
387
+ filterMenuData: this.selectedFilterMenuData
388
+ });
389
+
390
+ this.posts = posts;
391
+ this.totalResults = totalResults;
392
+ this.totalPages = totalPages;
393
+ this.loading = false;
394
+ }
395
+
396
+ private paddedMonth(date: Date) {
397
+ return `${(date.getMonth() + 1).toString().padStart(2, "0")}`;
398
+ }
399
+
400
+ // split filter options by year/month for nested checkboxes
401
+ private splitOptionsByDate(dateOptions: any) {
402
+ return dateOptions?.reduce((acc: any, curr: any) => {
403
+ const date = new Date(curr.replace(/-/g, "/"));
404
+ const month = new Intl.DateTimeFormat("en-US", {
405
+ month: "long"
406
+ }).format(date);
407
+ const year = String(date.getFullYear());
408
+
409
+ const foundYear = acc.find((post: any) => post.name === year);
410
+ const foundMonth = foundYear?.months.find(
411
+ (m: any) => m.id === month
412
+ );
413
+
414
+ if (!foundYear) {
415
+ acc.push({
416
+ id: year,
417
+ name: year,
418
+ isYear: true,
419
+ months: [
420
+ {
421
+ id: month,
422
+ name: `${month} ${year}`,
423
+ shortName: `${year},${date.getMonth() + 1}`,
424
+ isYear: false,
425
+ numberOfPosts: 1
426
+ }
427
+ ],
428
+ totalNumberOfPosts: 1
429
+ });
430
+
431
+ return acc;
432
+ }
433
+
434
+ if (!foundMonth) {
435
+ foundYear.months.push({
436
+ id: month,
437
+ name: `${month} ${year}`,
438
+ shortName: `${year},${date.getMonth() + 1}`,
439
+ isYear: false,
440
+ numberOfPosts: 1
441
+ });
442
+ foundYear.totalNumberOfPosts += 1;
443
+
444
+ return acc;
445
+ }
446
+
447
+ foundMonth.numberOfPosts += 1;
448
+ foundYear.totalNumberOfPosts += 1;
449
+
450
+ return acc;
451
+ }, []);
452
+ }
453
+
454
+ private onMobileChange = (e: MediaQueryListEvent | MediaQueryList) => {
455
+ this.isMobile = e.matches;
456
+
457
+ requestAnimationFrame(() => this.updateCheckedStatus());
458
+ };
459
+
460
+ connectedCallback(): void {
461
+ this.mobileMatchMedia = window.matchMedia(
462
+ `(max-width: ${MOBILE_MATCH})`
463
+ );
464
+ this.onMobileChange(this.mobileMatchMedia);
465
+ this.mobileMatchMedia.addEventListener("change", this.onMobileChange);
466
+
467
+ if (this.posts.length === 0) {
468
+ this.fetchArchiveFilterList();
469
+ this.fetchPostsByCardType();
470
+ }
471
+ }
472
+
473
+ private findDateFromList(nameToFind: string, list: FilterMenuItem[]) {
474
+ return (
475
+ list
476
+ .map((item: any) => item.months)
477
+ .flat()
478
+ .find(
479
+ (month) =>
480
+ month.name.toLowerCase() === nameToFind.toLowerCase()
481
+ ) ||
482
+ list.find(
483
+ (item: any) =>
484
+ item.name.toLowerCase() === nameToFind.toLowerCase()
485
+ )
486
+ );
487
+ }
488
+
489
+ private updateAllFiltersFromUrl() {
490
+ const filters: FilterMenuData = {
491
+ [FilterNames.QUERY_AUTHOR_FILTER]: this.authorList,
492
+ [FilterNames.QUERY_DATES_FILTER]: this.dateList,
493
+ [FilterNames.QUERY_CATEGORIES_FILTER]: this.categoryList,
494
+ [FilterNames.QUERY_CONTENT_FILTER]: this.contentTypeList
495
+ };
496
+
497
+ for (const [key, items] of Object.entries(filters)) {
498
+ const presetFilter: Array<string> = getUrlParamValue(key);
499
+
500
+ presetFilter.forEach((item) => {
501
+ const value =
502
+ key === "dates"
503
+ ? this.findDateFromList(item, items)
504
+ : items.find(
505
+ (i) => i.name.toLowerCase() === item.toLowerCase()
506
+ );
507
+
508
+ if (value) {
509
+ this.updateSelectedFilters(
510
+ value,
511
+ key as FilterMenuNames,
512
+ true,
513
+ true
514
+ );
515
+ }
516
+ });
517
+ }
518
+ }
519
+ }
@@ -0,0 +1,98 @@
1
+ export type ArchivePostAuthor = {
2
+ id: number;
3
+ link: string;
4
+ name: string;
5
+ slug: string;
6
+ url: string;
7
+ avatar_urls: {
8
+ [key: string]: string;
9
+ };
10
+ };
11
+
12
+ export type ArchivePost = {
13
+ id: number;
14
+ date: string;
15
+ title: {
16
+ rendered: string;
17
+ };
18
+ type: string;
19
+ link: string;
20
+ excerpt: string;
21
+ sitename: string;
22
+ podcast_audio: {
23
+ audio_url: string;
24
+ duration: string;
25
+ };
26
+ _embedded: {
27
+ author: Array<ArchivePostAuthor>;
28
+ ["wp:term"]: Array<
29
+ Array<{
30
+ id: number;
31
+ link: string;
32
+ name: string;
33
+ slug: string;
34
+ taxonomy: string;
35
+ _links: any;
36
+ }>
37
+ >;
38
+ };
39
+ _links: [
40
+ {
41
+ embeddable: boolean;
42
+ href: string;
43
+ }
44
+ ];
45
+ };
46
+
47
+ export type ArchivePostNormalized = {
48
+ posts: Array<{
49
+ id: number;
50
+ title: string;
51
+ date: string;
52
+ contentType: string;
53
+ href: string;
54
+ excerpt?: string;
55
+ author?: ArchivePostAuthor;
56
+ authorImgSrc?: string;
57
+ topics?: Array<string>;
58
+ }>;
59
+ totalPages: number;
60
+ totalResults: number;
61
+ };
62
+
63
+ export type ArchiveContent = {
64
+ posts: Array<ArchivePost>;
65
+ totalResults: number;
66
+ totalPages: number;
67
+ };
68
+
69
+ export type FilterMenuNames =
70
+ | "contentType"
71
+ | "dates"
72
+ | "authors"
73
+ | "categories";
74
+
75
+ export type Filters = {
76
+ [key in FilterMenuNames]: any[];
77
+ };
78
+
79
+ export type FilterMenuItem = {
80
+ id: string | number;
81
+ name: string;
82
+ shortName?: string;
83
+ checked?: boolean;
84
+ months?: Array<{
85
+ id: string;
86
+ name: string;
87
+ shortName: string;
88
+ isYear: boolean;
89
+ numberOfPosts: number;
90
+ }>;
91
+ };
92
+
93
+ export type FilterMenuData = {
94
+ contentType: Array<FilterMenuItem>;
95
+ dates: Array<FilterMenuItem>;
96
+ categories: Array<FilterMenuItem>;
97
+ authors: Array<FilterMenuItem>;
98
+ };