@google-psat/report 0.9.0-2 → 0.10.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 (79) hide show
  1. package/dist/dashboard/components/cookiesWithIssues/index.js +43 -0
  2. package/dist/dashboard/components/header/index.js +26 -0
  3. package/dist/dashboard/components/siteMapReport/cookies.js +73 -0
  4. package/dist/dashboard/components/siteMapReport/index.js +31 -0
  5. package/dist/dashboard/components/siteMapReport/layout.js +140 -0
  6. package/dist/dashboard/components/siteMapReport/sidebarData.js +46 -0
  7. package/dist/dashboard/components/siteMapReport/sitemapCookiesWithIssues.js +9 -0
  8. package/dist/dashboard/components/siteReport/components/layout.js +145 -0
  9. package/dist/dashboard/components/siteReport/index.js +33 -0
  10. package/dist/dashboard/components/siteReport/stateProviders/contentStore/index.js +55 -0
  11. package/dist/dashboard/components/siteReport/tabs/cookies/cookiesLandingContainer/cookieLanding/blockedCookiesSection.js +79 -0
  12. package/dist/dashboard/components/siteReport/tabs/cookies/cookiesLandingContainer/cookieLanding/cookiesSection.js +38 -0
  13. package/dist/dashboard/components/siteReport/tabs/cookies/cookiesLandingContainer/cookieLanding/exemptedCookiesSection.js +63 -0
  14. package/dist/dashboard/components/siteReport/tabs/cookies/cookiesLandingContainer/cookieLanding/framesSection.js +38 -0
  15. package/dist/dashboard/components/siteReport/tabs/cookies/cookiesLandingContainer/cookieLanding/index.js +17 -0
  16. package/dist/dashboard/components/siteReport/tabs/cookies/cookiesLandingContainer/cookieLanding/knownBreakages.js +53 -0
  17. package/dist/dashboard/components/siteReport/tabs/cookies/cookiesLandingContainer/cookieLanding/landing.js +106 -0
  18. package/dist/dashboard/components/siteReport/tabs/cookies/cookiesLandingContainer/index.js +58 -0
  19. package/dist/dashboard/components/siteReport/tabs/cookies/cookiesListing/index.js +47 -0
  20. package/dist/dashboard/components/siteReport/tabs/cookies/index.js +56 -0
  21. package/dist/dashboard/components/siteReport/tabs/index.js +54 -0
  22. package/dist/dashboard/components/siteReport/tabs/siteCookiesWithIssues/index.js +29 -0
  23. package/dist/dashboard/components/siteReport/tabs/technologies/index.js +91 -0
  24. package/dist/dashboard/components/utils/NamePrefixIconSelector.js +67 -0
  25. package/dist/dashboard/components/utils/extractCookies.js +36 -0
  26. package/dist/dashboard/components/utils/extractReportData.js +56 -0
  27. package/dist/dashboard/components/utils/reportDownloader/generateSiteMapReportandDownload.js +44 -0
  28. package/dist/dashboard/components/utils/reportDownloader/generateSiteReportandDownload.js +52 -0
  29. package/dist/dashboard/components/utils/reportDownloader/index.js +17 -0
  30. package/dist/dashboard/components/utils/reportDownloader/utils.js +148 -0
  31. package/dist/dashboard/components/utils/reshapeCookies.js +97 -0
  32. package/dist/dashboard/components/utils/tests/data.mock.js +176 -0
  33. package/dist/dashboard/components/utils/tests/extractCookies.js +84 -0
  34. package/dist/dashboard/components/utils/tests/extractReportData.js +64 -0
  35. package/dist/dashboard/components/utils/tests/reshapeCookies.js +89 -0
  36. package/dist/dashboard/hooks/useCookieListing/index.js +412 -0
  37. package/dist/dashboard/index.js +19 -0
  38. package/dist/index.js +16 -0
  39. package/dist-types/dashboard/components/cookiesWithIssues/index.d.ts +8 -0
  40. package/dist-types/dashboard/components/header/index.d.ts +6 -0
  41. package/dist-types/dashboard/components/siteMapReport/cookies.d.ts +15 -0
  42. package/dist-types/dashboard/components/siteMapReport/index.d.ts +11 -0
  43. package/dist-types/dashboard/components/siteMapReport/layout.d.ts +18 -0
  44. package/dist-types/dashboard/components/siteMapReport/sidebarData.d.ts +3 -0
  45. package/dist-types/dashboard/components/siteMapReport/sitemapCookiesWithIssues.d.ts +10 -0
  46. package/dist-types/dashboard/components/siteReport/components/layout.d.ts +13 -0
  47. package/dist-types/dashboard/components/siteReport/index.d.ts +17 -0
  48. package/dist-types/dashboard/components/siteReport/stateProviders/contentStore/index.d.ts +32 -0
  49. package/dist-types/dashboard/components/siteReport/tabs/cookies/cookiesLandingContainer/cookieLanding/blockedCookiesSection.d.ts +8 -0
  50. package/dist-types/dashboard/components/siteReport/tabs/cookies/cookiesLandingContainer/cookieLanding/cookiesSection.d.ts +7 -0
  51. package/dist-types/dashboard/components/siteReport/tabs/cookies/cookiesLandingContainer/cookieLanding/exemptedCookiesSection.d.ts +7 -0
  52. package/dist-types/dashboard/components/siteReport/tabs/cookies/cookiesLandingContainer/cookieLanding/framesSection.d.ts +2 -0
  53. package/dist-types/dashboard/components/siteReport/tabs/cookies/cookiesLandingContainer/cookieLanding/index.d.ts +2 -0
  54. package/dist-types/dashboard/components/siteReport/tabs/cookies/cookiesLandingContainer/cookieLanding/knownBreakages.d.ts +9 -0
  55. package/dist-types/dashboard/components/siteReport/tabs/cookies/cookiesLandingContainer/cookieLanding/landing.d.ts +15 -0
  56. package/dist-types/dashboard/components/siteReport/tabs/cookies/cookiesLandingContainer/index.d.ts +23 -0
  57. package/dist-types/dashboard/components/siteReport/tabs/cookies/cookiesListing/index.d.ts +9 -0
  58. package/dist-types/dashboard/components/siteReport/tabs/cookies/index.d.ts +9 -0
  59. package/dist-types/dashboard/components/siteReport/tabs/index.d.ts +3 -0
  60. package/dist-types/dashboard/components/siteReport/tabs/siteCookiesWithIssues/index.d.ts +5 -0
  61. package/dist-types/dashboard/components/siteReport/tabs/technologies/index.d.ts +5 -0
  62. package/dist-types/dashboard/components/utils/NamePrefixIconSelector.d.ts +3 -0
  63. package/dist-types/dashboard/components/utils/extractCookies.d.ts +6 -0
  64. package/dist-types/dashboard/components/utils/extractReportData.d.ts +11 -0
  65. package/dist-types/dashboard/components/utils/reportDownloader/generateSiteMapReportandDownload.d.ts +4 -0
  66. package/dist-types/dashboard/components/utils/reportDownloader/generateSiteReportandDownload.d.ts +4 -0
  67. package/dist-types/dashboard/components/utils/reportDownloader/index.d.ts +2 -0
  68. package/dist-types/dashboard/components/utils/reportDownloader/utils.d.ts +9 -0
  69. package/dist-types/dashboard/components/utils/reshapeCookies.d.ts +8 -0
  70. package/dist-types/dashboard/components/utils/tests/data.mock.d.ts +6 -0
  71. package/dist-types/dashboard/components/utils/tests/extractCookies.d.ts +1 -0
  72. package/dist-types/dashboard/components/utils/tests/extractReportData.d.ts +1 -0
  73. package/dist-types/dashboard/components/utils/tests/reshapeCookies.d.ts +1 -0
  74. package/dist-types/dashboard/hooks/useCookieListing/index.d.ts +10 -0
  75. package/dist-types/dashboard/index.d.ts +4 -0
  76. package/dist-types/index.d.ts +1 -0
  77. package/package.json +10 -4
  78. package/public/index.html +1 -0
  79. package/tsconfig.json +19 -3
@@ -0,0 +1,412 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ /*
3
+ * Copyright 2023 Google LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * https://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ /**
18
+ * External dependencies
19
+ */
20
+ import { useMemo } from 'react';
21
+ import { I18n } from '@google-psat/i18n';
22
+ import { BLOCK_STATUS } from '@google-psat/common';
23
+ import { useSidebar, calculateBlockedReasonsFilterValues, calculateDynamicFilterValues, calculateExemptionReason, evaluateSelectAllOption, evaluateStaticFilterValues, } from '@google-psat/design-system';
24
+ /**
25
+ * Internal dependencies
26
+ */
27
+ import NamePrefixIconSelector from '../../components/utils/NamePrefixIconSelector';
28
+ const useCookieListing = (tabCookies, selectedFrameUrl, persistenceKey = 'cookiesListing', selectedSite) => {
29
+ const { activePanelQuery, clearActivePanelQuery } = useSidebar(({ state }) => ({
30
+ activePanelQuery: state.activePanel.query,
31
+ clearActivePanelQuery: state.activePanel.clearQuery,
32
+ }));
33
+ //@ts-ignore -- PSAT_EXTENSTION is added only when the report is downloaded from the extension. Since optional chaining is done it will return false if it doesnt exist.
34
+ const isExtension = Boolean(globalThis?.PSAT_EXTENSION);
35
+ const parsedQuery = useMemo(() => JSON.parse(activePanelQuery || '{}'), [activePanelQuery]);
36
+ const tablePersistentSettingsKey = useMemo(() => {
37
+ if (selectedSite) {
38
+ return persistenceKey + '#' + selectedSite + selectedFrameUrl;
39
+ }
40
+ return persistenceKey + '#' + selectedFrameUrl;
41
+ }, [persistenceKey, selectedFrameUrl, selectedSite]);
42
+ const tableColumns = useMemo(() => {
43
+ const baseColumns = [
44
+ {
45
+ header: I18n.getMessage('name'),
46
+ accessorKey: 'parsedCookie.name',
47
+ cell: (info) => info,
48
+ enableHiding: false,
49
+ widthWeightagePercentage: 13,
50
+ enableBodyCellPrefixIcon: true,
51
+ bodyCellPrefixIcon: {
52
+ Element: NamePrefixIconSelector,
53
+ },
54
+ showBodyCellPrefixIcon: (row) => {
55
+ const isBlocked = Boolean(row.originalData?.blockingStatus
56
+ ?.inboundBlock !== BLOCK_STATUS.NOT_BLOCKED ||
57
+ row.originalData?.blockingStatus
58
+ ?.outboundBlock !== BLOCK_STATUS.NOT_BLOCKED);
59
+ const isDomainInAllowList = Boolean(row.originalData?.isDomainInAllowList);
60
+ return isBlocked || isDomainInAllowList;
61
+ },
62
+ },
63
+ {
64
+ header: I18n.getMessage('scope'),
65
+ accessorKey: 'isFirstParty',
66
+ cell: (info) => !info ? I18n.getMessage('thirdParty') : I18n.getMessage('firstParty'),
67
+ widthWeightagePercentage: 8,
68
+ },
69
+ {
70
+ header: I18n.getMessage('domain'),
71
+ accessorKey: 'parsedCookie.domain',
72
+ cell: (info) => info,
73
+ widthWeightagePercentage: 9,
74
+ },
75
+ {
76
+ header: I18n.getMessage('partitionKey'),
77
+ accessorKey: 'parsedCookie.partitionKey',
78
+ cell: (info) => info,
79
+ widthWeightagePercentage: 9,
80
+ },
81
+ {
82
+ header: I18n.getMessage('sameSite'),
83
+ accessorKey: 'parsedCookie.sameSite',
84
+ cell: (info) => I18n.getMessage((info?.toString() || '').toLowerCase()),
85
+ widthWeightagePercentage: 8,
86
+ },
87
+ {
88
+ header: I18n.getMessage('category'),
89
+ accessorKey: 'analytics.category',
90
+ cell: (info) => I18n.getMessage(info.toLowerCase() || 'uncategorized'),
91
+ widthWeightagePercentage: 10,
92
+ },
93
+ {
94
+ header: I18n.getMessage('platform'),
95
+ accessorKey: 'analytics.platform',
96
+ cell: (info) => (info ? info : I18n.getMessage('unknown')),
97
+ widthWeightagePercentage: 10,
98
+ },
99
+ {
100
+ header: I18n.getMessage('httpOnly'),
101
+ accessorKey: 'parsedCookie.httponly',
102
+ cell: (info) => (_jsx("p", { className: "flex justify-center items-center", children: info ? _jsx("span", { className: "font-serif", children: "\u2713" }) : '' })),
103
+ widthWeightagePercentage: 5,
104
+ },
105
+ {
106
+ header: I18n.getMessage('secure'),
107
+ accessorKey: 'parsedCookie.secure',
108
+ cell: (info) => (_jsx("p", { className: "flex justify-center items-center", children: info ? _jsx("span", { className: "font-serif", children: "\u2713" }) : '' })),
109
+ widthWeightagePercentage: 5,
110
+ },
111
+ {
112
+ header: I18n.getMessage('value'),
113
+ accessorKey: 'parsedCookie.value',
114
+ cell: (info) => info,
115
+ widthWeightagePercentage: 10,
116
+ },
117
+ {
118
+ header: I18n.getMessage('path'),
119
+ accessorKey: 'parsedCookie.path',
120
+ cell: (info) => info,
121
+ widthWeightagePercentage: 4,
122
+ },
123
+ {
124
+ header: I18n.getMessage('expires'),
125
+ accessorKey: 'parsedCookie.expires',
126
+ cell: (info) => info === 'Session' || !info ? I18n.getMessage('session') : info,
127
+ widthWeightagePercentage: 7,
128
+ },
129
+ ];
130
+ if (isExtension) {
131
+ baseColumns.push({
132
+ header: I18n.getMessage('priority'),
133
+ accessorKey: 'parsedCookie.priority',
134
+ isHiddenByDefault: true,
135
+ cell: (info) => I18n.getMessage(info?.toLowerCase()),
136
+ widthWeightagePercentage: 4,
137
+ }, {
138
+ header: I18n.getMessage('size'),
139
+ accessorKey: 'parsedCookie.size',
140
+ isHiddenByDefault: true,
141
+ cell: (info) => info,
142
+ widthWeightagePercentage: 3,
143
+ });
144
+ }
145
+ return baseColumns;
146
+ }, [isExtension]);
147
+ const filters = useMemo(() => {
148
+ let baseFilters = {
149
+ 'analytics.category': {
150
+ title: I18n.getMessage('category'),
151
+ hasStaticFilterValues: true,
152
+ hasPrecalculatedFilterValues: true,
153
+ filterValues: evaluateStaticFilterValues({
154
+ [I18n.getMessage('analytics')]: {
155
+ selected: false,
156
+ },
157
+ [I18n.getMessage('functional')]: {
158
+ selected: false,
159
+ },
160
+ [I18n.getMessage('marketing')]: {
161
+ selected: false,
162
+ },
163
+ [I18n.getMessage('uncategorized')]: {
164
+ selected: false,
165
+ },
166
+ }, 'analytics.category', parsedQuery, clearActivePanelQuery),
167
+ sortValues: true,
168
+ useGenericPersistenceKey: true,
169
+ comparator: (value, filterValue) => {
170
+ const val = value;
171
+ return (I18n.getMessage(val?.toLowerCase() || 'uncategorized') ===
172
+ filterValue);
173
+ },
174
+ },
175
+ isFirstParty: {
176
+ title: I18n.getMessage('scope'),
177
+ hasStaticFilterValues: true,
178
+ hasPrecalculatedFilterValues: true,
179
+ filterValues: evaluateStaticFilterValues({
180
+ [I18n.getMessage('firstParty')]: {
181
+ selected: false,
182
+ },
183
+ [I18n.getMessage('thirdParty')]: {
184
+ selected: false,
185
+ },
186
+ }, 'isFirstParty', parsedQuery, clearActivePanelQuery),
187
+ useGenericPersistenceKey: true,
188
+ comparator: (value, filterValue) => {
189
+ const val = Boolean(value);
190
+ return val === (filterValue === I18n.getMessage('firstParty'));
191
+ },
192
+ },
193
+ 'parsedCookie.domain': {
194
+ title: I18n.getMessage('domain'),
195
+ },
196
+ 'parsedCookie.httponly': {
197
+ title: I18n.getMessage('httpOnly'),
198
+ hasStaticFilterValues: true,
199
+ filterValues: {
200
+ [I18n.getMessage('true')]: {
201
+ selected: false,
202
+ },
203
+ [I18n.getMessage('false')]: {
204
+ selected: false,
205
+ },
206
+ },
207
+ useGenericPersistenceKey: true,
208
+ comparator: (value, filterValue) => {
209
+ const val = Boolean(value);
210
+ return val === (filterValue === I18n.getMessage('true'));
211
+ },
212
+ },
213
+ 'parsedCookie.sameSite': {
214
+ title: I18n.getMessage('sameSite'),
215
+ hasStaticFilterValues: true,
216
+ filterValues: {
217
+ [I18n.getMessage('none')]: {
218
+ selected: false,
219
+ },
220
+ [I18n.getMessage('lax')]: {
221
+ selected: false,
222
+ },
223
+ [I18n.getMessage('strict')]: {
224
+ selected: false,
225
+ },
226
+ },
227
+ useGenericPersistenceKey: true,
228
+ comparator: (value, filterValue) => {
229
+ const val = value;
230
+ return val?.toLowerCase() === filterValue.toLowerCase();
231
+ },
232
+ },
233
+ 'parsedCookie.secure': {
234
+ title: I18n.getMessage('secure'),
235
+ hasStaticFilterValues: true,
236
+ filterValues: {
237
+ [I18n.getMessage('true')]: {
238
+ selected: false,
239
+ },
240
+ [I18n.getMessage('false')]: {
241
+ selected: false,
242
+ },
243
+ },
244
+ useGenericPersistenceKey: true,
245
+ comparator: (value, filterValue) => {
246
+ const val = Boolean(value);
247
+ return val === (filterValue === I18n.getMessage('true'));
248
+ },
249
+ },
250
+ 'parsedCookie.path': {
251
+ title: I18n.getMessage('path'),
252
+ },
253
+ 'parsedCookie.expires': {
254
+ title: I18n.getMessage('retentionPeriod'),
255
+ hasStaticFilterValues: true,
256
+ filterValues: {
257
+ [I18n.getMessage('session')]: {
258
+ selected: false,
259
+ },
260
+ [I18n.getMessage('shortTerm')]: {
261
+ selected: false,
262
+ },
263
+ [I18n.getMessage('mediumTerm')]: {
264
+ selected: false,
265
+ },
266
+ [I18n.getMessage('longTerm')]: {
267
+ selected: false,
268
+ },
269
+ [I18n.getMessage('extentedTerm')]: {
270
+ selected: false,
271
+ },
272
+ },
273
+ useGenericPersistenceKey: true,
274
+ comparator: (value, filterValue) => {
275
+ let diff = 0;
276
+ const val = value;
277
+ switch (filterValue) {
278
+ case I18n.getMessage('session'):
279
+ return val === 'Session';
280
+ case I18n.getMessage('shortTerm'):
281
+ diff = Date.parse(val) - Date.now();
282
+ return diff < 86400000;
283
+ case I18n.getMessage('mediumTerm'):
284
+ diff = Date.parse(val) - Date.now();
285
+ return diff >= 86400000 && diff < 604800000;
286
+ case I18n.getMessage('longTerm'):
287
+ diff = Date.parse(val) - Date.now();
288
+ return diff >= 604800000 && diff < 2629743833;
289
+ case I18n.getMessage('extentedTerm'):
290
+ diff = Date.parse(val) - Date.now();
291
+ return diff >= 2629743833;
292
+ default:
293
+ return false;
294
+ }
295
+ },
296
+ },
297
+ 'analytics.platform': {
298
+ title: I18n.getMessage('platform'),
299
+ hasStaticFilterValues: true,
300
+ hasPrecalculatedFilterValues: true,
301
+ filterValues: calculateDynamicFilterValues('analytics.platform', tabCookies, parsedQuery?.filter?.['analytics.platform'], clearActivePanelQuery),
302
+ sortValues: true,
303
+ useGenericPersistenceKey: true,
304
+ },
305
+ blockedReasons: {
306
+ title: I18n.getMessage('blockedReasons'),
307
+ hasStaticFilterValues: true,
308
+ hasPrecalculatedFilterValues: true,
309
+ enableSelectAllOption: true,
310
+ isSelectAllOptionSelected: evaluateSelectAllOption('blockedReasons', parsedQuery, clearActivePanelQuery),
311
+ filterValues: calculateBlockedReasonsFilterValues(tabCookies, parsedQuery?.filter?.blockedReasons, clearActivePanelQuery),
312
+ sortValues: true,
313
+ useGenericPersistenceKey: true,
314
+ comparator: (value, filterValue) => {
315
+ return value?.includes(filterValue);
316
+ },
317
+ },
318
+ exemptionReason: {
319
+ title: I18n.getMessage('exemptionReasons'),
320
+ hasStaticFilterValues: true,
321
+ hasPrecalculatedFilterValues: true,
322
+ enableSelectAllOption: true,
323
+ isSelectAllOptionSelected: evaluateSelectAllOption('exemptionReason', parsedQuery, clearActivePanelQuery),
324
+ filterValues: calculateExemptionReason(tabCookies, clearActivePanelQuery, parsedQuery?.filter?.exemptionReason),
325
+ comparator: (value, filterValue) => {
326
+ const val = value;
327
+ return val === filterValue;
328
+ },
329
+ useGenericPersistenceKey: true,
330
+ },
331
+ };
332
+ if (isExtension) {
333
+ const { exemptionReason, ...rest } = baseFilters;
334
+ baseFilters = {
335
+ ...rest,
336
+ 'parsedCookie.partitionKey': {
337
+ title: I18n.getMessage('partitionKey'),
338
+ hasStaticFilterValues: true,
339
+ filterValues: {
340
+ [I18n.getMessage('set')]: {
341
+ selected: false,
342
+ },
343
+ [I18n.getMessage('notSet')]: {
344
+ selected: false,
345
+ },
346
+ },
347
+ useGenericPersistenceKey: true,
348
+ comparator: (value, filterValue) => {
349
+ const val = value;
350
+ return val
351
+ ? filterValue === I18n.getMessage('set')
352
+ : filterValue === I18n.getMessage('notSet');
353
+ },
354
+ },
355
+ headerType: {
356
+ title: I18n.getMessage('setVia'),
357
+ hasStaticFilterValues: true,
358
+ filterValues: {
359
+ [I18n.getMessage('http')]: {
360
+ selected: false,
361
+ },
362
+ [I18n.getMessage('jS')]: {
363
+ selected: false,
364
+ },
365
+ },
366
+ useGenericPersistenceKey: true,
367
+ comparator: (value, filterValue) => {
368
+ switch (filterValue) {
369
+ case I18n.getMessage('jS'):
370
+ return value === 'javascript';
371
+ case I18n.getMessage('http'):
372
+ return value === 'request' || value === 'response';
373
+ default:
374
+ return true;
375
+ }
376
+ },
377
+ },
378
+ 'parsedCookie.priority': {
379
+ title: I18n.getMessage('priority'),
380
+ hasStaticFilterValues: true,
381
+ filterValues: {
382
+ [I18n.getMessage('low')]: {
383
+ selected: false,
384
+ },
385
+ [I18n.getMessage('medium')]: {
386
+ selected: false,
387
+ },
388
+ [I18n.getMessage('high')]: {
389
+ selected: false,
390
+ },
391
+ },
392
+ useGenericPersistenceKey: true,
393
+ comparator: (value, filterValue) => {
394
+ const val = I18n.getMessage(value?.toLowerCase());
395
+ return val === filterValue;
396
+ },
397
+ },
398
+ exemptionReason,
399
+ };
400
+ }
401
+ return baseFilters;
402
+ }, [clearActivePanelQuery, parsedQuery, tabCookies, isExtension]);
403
+ const searchKeys = useMemo(() => ['parsedCookie.name', 'parsedCookie.domain'], []);
404
+ return {
405
+ tableColumns,
406
+ filters,
407
+ searchKeys,
408
+ tablePersistentSettingsKey,
409
+ isSidebarOpen: parsedQuery?.filter ? true : false,
410
+ };
411
+ };
412
+ export default useCookieListing;
@@ -0,0 +1,19 @@
1
+ /*
2
+ * Copyright 2024 Google LLC
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * https://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ export { default as SiteReport } from './components/siteReport';
17
+ export { default as SiteMapReport } from './components/siteMapReport';
18
+ export { default as extractReportData } from './components/utils/extractReportData';
19
+ export { default as extractCookies } from './components/utils/extractCookies';
package/dist/index.js ADDED
@@ -0,0 +1,16 @@
1
+ /*
2
+ * Copyright 2023 Google LLC
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * https://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ export * from './dashboard';
@@ -0,0 +1,8 @@
1
+ import { type CookieTableData } from '@google-psat/common';
2
+ interface CookiesWithIssuesProps {
3
+ cookies: CookieTableData[];
4
+ selectedSite: string | null;
5
+ hostName: string;
6
+ }
7
+ declare const CookiesWithIssues: ({ cookies, selectedSite, hostName, }: CookiesWithIssuesProps) => import("react/jsx-runtime").JSX.Element;
8
+ export default CookiesWithIssues;
@@ -0,0 +1,6 @@
1
+ interface HeaderProps {
2
+ url: string | undefined | null;
3
+ dateTime: string;
4
+ }
5
+ declare const Header: ({ url, dateTime }: HeaderProps) => import("react/jsx-runtime").JSX.Element;
6
+ export default Header;
@@ -0,0 +1,15 @@
1
+ import { type CompleteJson, type LibraryData, type TabCookies, type TabFrames } from '@google-psat/common';
2
+ interface CookiesTabProps {
3
+ selectedSite?: string;
4
+ tabCookies: TabCookies;
5
+ tabFrames: TabFrames;
6
+ completeJson: CompleteJson[] | null;
7
+ path: string;
8
+ libraryMatches: {
9
+ [url: string]: LibraryData;
10
+ } | null;
11
+ query?: string;
12
+ clearQuery?: () => void;
13
+ }
14
+ declare const CookiesTab: ({ selectedSite, tabCookies, tabFrames, completeJson, path, libraryMatches, query, clearQuery, }: CookiesTabProps) => import("react/jsx-runtime").JSX.Element;
15
+ export default CookiesTab;
@@ -0,0 +1,11 @@
1
+ import type { CookieFrameStorageType, CompleteJson, LibraryData } from '@google-psat/common';
2
+ interface SiteMapReportProps {
3
+ landingPageCookies: CookieFrameStorageType;
4
+ completeJson: CompleteJson[] | null;
5
+ path: string;
6
+ libraryMatches: {
7
+ [url: string]: LibraryData;
8
+ } | null;
9
+ }
10
+ declare const SiteMapReport: ({ landingPageCookies, completeJson, path, libraryMatches, }: SiteMapReportProps) => import("react/jsx-runtime").JSX.Element;
11
+ export default SiteMapReport;
@@ -0,0 +1,18 @@
1
+ /**
2
+ * External dependencies.
3
+ */
4
+ import React from 'react';
5
+ import { type CookieFrameStorageType, type CompleteJson, type LibraryData } from '@google-psat/common';
6
+ import { type SidebarItems } from '@google-psat/design-system';
7
+ interface LayoutProps {
8
+ landingPageCookies: CookieFrameStorageType;
9
+ completeJson: CompleteJson[] | null;
10
+ sidebarData: SidebarItems;
11
+ setSidebarData: React.Dispatch<React.SetStateAction<SidebarItems>>;
12
+ path: string;
13
+ libraryMatches: {
14
+ [url: string]: LibraryData;
15
+ } | null;
16
+ }
17
+ declare const Layout: ({ landingPageCookies, completeJson, sidebarData, setSidebarData, path, libraryMatches, }: LayoutProps) => import("react/jsx-runtime").JSX.Element;
18
+ export default Layout;
@@ -0,0 +1,3 @@
1
+ import { type SidebarItems } from '@google-psat/design-system';
2
+ declare const sidebarData: SidebarItems;
3
+ export default sidebarData;
@@ -0,0 +1,10 @@
1
+ /**
2
+ * External dependencies.
3
+ */
4
+ import type { CookieTableData } from '@google-psat/common';
5
+ interface SiteMapCookiesWithIssuesProps {
6
+ cookies: CookieTableData[];
7
+ path: string;
8
+ }
9
+ declare const SiteMapCookiesWithIssues: ({ cookies, path, }: SiteMapCookiesWithIssuesProps) => import("react/jsx-runtime").JSX.Element;
10
+ export default SiteMapCookiesWithIssues;
@@ -0,0 +1,13 @@
1
+ /**
2
+ * External dependencies.
3
+ */
4
+ import React from 'react';
5
+ import { type SidebarItems } from '@google-psat/design-system';
6
+ interface LayoutProps {
7
+ selectedSite: string | null;
8
+ setSidebarData: React.Dispatch<React.SetStateAction<SidebarItems>>;
9
+ query?: string;
10
+ clearQuery?: () => void;
11
+ }
12
+ declare const Layout: ({ selectedSite, setSidebarData, query, clearQuery, }: LayoutProps) => import("react/jsx-runtime").JSX.Element;
13
+ export default Layout;
@@ -0,0 +1,17 @@
1
+ import { type CompleteJson, type CookieJsonDataType, type LibraryData, type TechnologyData } from '@google-psat/common';
2
+ interface SiteReportProps {
3
+ cookies: {
4
+ [frame: string]: {
5
+ [key: string]: CookieJsonDataType;
6
+ };
7
+ };
8
+ technologies: TechnologyData[];
9
+ completeJson: CompleteJson[] | null;
10
+ selectedSite: string | null;
11
+ path: string;
12
+ libraryMatches: LibraryData | null;
13
+ query?: string;
14
+ clearQuery?: () => void;
15
+ }
16
+ declare const SiteReport: ({ cookies, technologies, completeJson, selectedSite, path, libraryMatches, query, clearQuery, }: SiteReportProps) => import("react/jsx-runtime").JSX.Element;
17
+ export default SiteReport;
@@ -0,0 +1,32 @@
1
+ /**
2
+ * External dependencies.
3
+ */
4
+ import { type PropsWithChildren } from 'react';
5
+ import { type CompleteJson, type CookieJsonDataType, type CookieTableData, type TechnologyData, type LibraryData } from '@google-psat/common';
6
+ export interface ContentStore {
7
+ state: {
8
+ tabCookies: {
9
+ [key: string]: CookieTableData;
10
+ };
11
+ technologies: TechnologyData[] | undefined;
12
+ completeJson: CompleteJson[] | null;
13
+ path: string;
14
+ libraryMatches: LibraryData | null;
15
+ };
16
+ }
17
+ export declare const Context: import("use-context-selector").Context<ContentStore>;
18
+ interface ContentStoreProviderProps {
19
+ cookies: {
20
+ [frame: string]: {
21
+ [key: string]: CookieJsonDataType;
22
+ };
23
+ };
24
+ technologies?: TechnologyData[];
25
+ completeJson: CompleteJson[] | null;
26
+ path: string;
27
+ libraryMatches: LibraryData | null;
28
+ }
29
+ export declare const Provider: ({ cookies, technologies, completeJson, children, path, libraryMatches, }: PropsWithChildren<ContentStoreProviderProps>) => import("react/jsx-runtime").JSX.Element;
30
+ export declare function useContentStore(): ContentStore;
31
+ export declare function useContentStore<T>(selector: (state: ContentStore) => T): T;
32
+ export {};
@@ -0,0 +1,8 @@
1
+ import { type TabCookies, type TabFrames } from '@google-psat/common';
2
+ interface BlockedCookiesSectionProps {
3
+ tabCookies: TabCookies | null;
4
+ cookiesWithIssues: TabCookies | null;
5
+ tabFrames: TabFrames | null;
6
+ }
7
+ declare const BlockedCookiesSection: ({ tabCookies, cookiesWithIssues, tabFrames, }: BlockedCookiesSectionProps) => import("react/jsx-runtime").JSX.Element;
8
+ export default BlockedCookiesSection;
@@ -0,0 +1,7 @@
1
+ import type { TabCookies, TabFrames } from '@google-psat/common';
2
+ interface CookiesSectionProps {
3
+ tabCookies: TabCookies | null;
4
+ tabFrames: TabFrames | null;
5
+ }
6
+ declare const CookiesSection: ({ tabCookies, tabFrames }: CookiesSectionProps) => import("react/jsx-runtime").JSX.Element;
7
+ export default CookiesSection;
@@ -0,0 +1,7 @@
1
+ import { type TabFrames, type TabCookies } from '@google-psat/common';
2
+ interface ExemptedCookiesSectionProps {
3
+ tabCookies: TabCookies | null;
4
+ tabFrames: TabFrames | null;
5
+ }
6
+ declare const ExemptedCookiesSection: ({ tabCookies, tabFrames, }: ExemptedCookiesSectionProps) => import("react/jsx-runtime").JSX.Element;
7
+ export default ExemptedCookiesSection;
@@ -0,0 +1,2 @@
1
+ declare const FramesSection: () => import("react/jsx-runtime").JSX.Element;
2
+ export default FramesSection;
@@ -0,0 +1,2 @@
1
+ export { default as CookiesSection } from './cookiesSection';
2
+ export { default as BlockedCookiesSection } from './blockedCookiesSection';
@@ -0,0 +1,9 @@
1
+ import type { LibraryData } from '@google-psat/common';
2
+ interface KnownBreakagesProps {
3
+ libraryMatches: LibraryData;
4
+ libraryMatchesUrlCount?: {
5
+ [url: string]: number;
6
+ };
7
+ }
8
+ declare const KnownBreakages: ({ libraryMatches, libraryMatchesUrlCount, }: KnownBreakagesProps) => import("react/jsx-runtime").JSX.Element;
9
+ export default KnownBreakages;
@@ -0,0 +1,15 @@
1
+ import type { LibraryData, TabCookies, TabFrames } from '@google-psat/common';
2
+ interface LandingProps {
3
+ tabFrames: TabFrames;
4
+ tabCookies: TabCookies;
5
+ cookiesWithIssues: TabCookies;
6
+ downloadReport?: () => Promise<void>;
7
+ libraryMatches: LibraryData | null;
8
+ isSiteMapLandingContainer?: boolean;
9
+ menuBarScrollContainerId?: string;
10
+ libraryMatchesUrlCount?: {
11
+ [url: string]: number;
12
+ };
13
+ }
14
+ declare const Landing: ({ tabFrames, tabCookies, cookiesWithIssues, downloadReport, libraryMatches, libraryMatchesUrlCount, menuBarScrollContainerId, }: LandingProps) => import("react/jsx-runtime").JSX.Element;
15
+ export default Landing;