@google-psat/design-system 0.10.0 → 0.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/circlePieChart/emptyCirclePieChart.jsx +1 -1
- package/dist/components/circlePieChart/emptyCirclePieChart.jsx.map +1 -1
- package/dist/components/circlePieChart/index.jsx +1 -1
- package/dist/components/circlePieChart/index.jsx.map +1 -1
- package/dist/components/cookieTable/utils/exportCookies.js +2 -3
- package/dist/components/cookieTable/utils/exportCookies.js.map +1 -1
- package/dist/components/cookiesLanding/landingHeader/index.jsx +2 -2
- package/dist/components/cookiesLanding/landingHeader/index.jsx.map +1 -1
- package/dist/components/table/utils/index.js +15 -23
- package/dist/components/table/utils/index.js.map +1 -1
- package/dist/utils/prepareFrameStatsComponentForExtensionDashboard.js +26 -5
- package/dist/utils/prepareFrameStatsComponentForExtensionDashboard.js.map +1 -1
- package/dist-types/components/table/utils/index.d.ts +0 -2
- package/dist-types/utils/prepareFrameStatsComponentForExtensionDashboard.d.ts +3 -2
- package/package.json +1 -1
- package/dist/components/table/utils/generatExtensionCookietableCSV.js +0 -81
- package/dist/components/table/utils/generatExtensionCookietableCSV.js.map +0 -1
- package/dist/components/table/utils/generateCLICookieTableCSV.js +0 -76
- package/dist/components/table/utils/generateCLICookieTableCSV.js.map +0 -1
- package/dist-types/components/table/utils/generatExtensionCookietableCSV.d.ts +0 -6
- package/dist-types/components/table/utils/generateCLICookieTableCSV.d.ts +0 -6
|
@@ -30,7 +30,7 @@ const colors_1 = require("../../theme/colors");
|
|
|
30
30
|
const EmptyCirclePieChart = () => {
|
|
31
31
|
return (<div className="w-full h-full relative">
|
|
32
32
|
<victory_1.VictoryPie padding={0} innerRadius={0} colorScale={[colors_1.COLOR_MAP.brightGray.color]} data={[{ x: '', y: 100 }]}/>
|
|
33
|
-
<p className="absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 text-center opacity-40 text-2xl leading-4
|
|
33
|
+
<p className="absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 text-center opacity-40 text-2xl leading-4 dark:text-black">
|
|
34
34
|
0
|
|
35
35
|
</p>
|
|
36
36
|
</div>);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"emptyCirclePieChart.jsx","sourceRoot":"","sources":["../../../src/components/circlePieChart/emptyCirclePieChart.tsx"],"names":[],"mappings":";;;;;AAAA;;;;;;;;;;;;;;GAcG;AACH;;GAEG;AACH,kDAA0B;AAC1B,qCAAqC;AACrC;;GAEG;AACH,+CAA+C;AAE/C,MAAM,mBAAmB,GAAG,GAAG,EAAE;IAC/B,OAAO,CACL,CAAC,GAAG,CAAC,SAAS,CAAC,wBAAwB,CACrC;MAAA,CAAC,oBAAU,CACT,OAAO,CAAC,CAAC,CAAC,CAAC,CACX,WAAW,CAAC,CAAC,CAAC,CAAC,CACf,UAAU,CAAC,CAAC,CAAC,kBAAS,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CACzC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,EAE5B;MAAA,CAAC,CAAC,CAAC,SAAS,CAAC,
|
|
1
|
+
{"version":3,"file":"emptyCirclePieChart.jsx","sourceRoot":"","sources":["../../../src/components/circlePieChart/emptyCirclePieChart.tsx"],"names":[],"mappings":";;;;;AAAA;;;;;;;;;;;;;;GAcG;AACH;;GAEG;AACH,kDAA0B;AAC1B,qCAAqC;AACrC;;GAEG;AACH,+CAA+C;AAE/C,MAAM,mBAAmB,GAAG,GAAG,EAAE;IAC/B,OAAO,CACL,CAAC,GAAG,CAAC,SAAS,CAAC,wBAAwB,CACrC;MAAA,CAAC,oBAAU,CACT,OAAO,CAAC,CAAC,CAAC,CAAC,CACX,WAAW,CAAC,CAAC,CAAC,CAAC,CACf,UAAU,CAAC,CAAC,CAAC,kBAAS,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CACzC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,EAE5B;MAAA,CAAC,CAAC,CAAC,SAAS,CAAC,uHAAuH,CAClI;;MACF,EAAE,CAAC,CACL;IAAA,EAAE,GAAG,CAAC,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,mBAAmB,CAAC"}
|
|
@@ -35,7 +35,7 @@ const CirclePieChart = ({ centerCount, data, title, centerTitleExtraClasses = ''
|
|
|
35
35
|
return (<div className="w-full h-full flex flex-col items-center justify-start">
|
|
36
36
|
<div className="inline-block align-bottom w-16">
|
|
37
37
|
{centerCount <= 0 ? (<emptyCirclePieChart_1.default />) : (<div className={`w-full h-full relative ${pieChartExtraClasses}`}>
|
|
38
|
-
<victory_1.VictoryPie padding={0} innerRadius={175}
|
|
38
|
+
<victory_1.VictoryPie padding={0} innerRadius={175} data={data.map(({ count }) => ({ x: '', y: count }))} labels={() => ''} colorScale={data.map(({ color }) => color)}/>
|
|
39
39
|
<p className={(0, classnames_1.default)('absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 font-regular dark:text-bright-gray', centerTitleClasses, centerTitleExtraClasses)}>
|
|
40
40
|
{centerCount <= exports.MAX_COUNT ? centerCount : exports.MAX_COUNT + '+'}
|
|
41
41
|
</p>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.jsx","sourceRoot":"","sources":["../../../src/components/circlePieChart/index.tsx"],"names":[],"mappings":";;;;;;AAAA;;;;;;;;;;;;;;GAcG;AACH;;GAEG;AACH,kDAA0B;AAC1B,qCAAqC;AACrC,4DAAoC;AAEpC;;GAEG;AACH,gFAAwD;AAY3C,QAAA,SAAS,GAAG,GAAG,CAAC;AAE7B,MAAM,cAAc,GAAG,CAAC,EACtB,WAAW,EACX,IAAI,EACJ,KAAK,EACL,uBAAuB,GAAG,EAAE,EAC5B,oBAAoB,GAAG,EAAE,GACL,EAAE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AAS,CAAC,CAAC,0BAA0B,oBAAoB,EAAE,CAAC,CAC/D;YAAA,CAAC,oBAAU,CACT,OAAO,CAAC,CAAC,CAAC,CAAC,CACX,WAAW,CAAC,CAAC,GAAG,CAAC,CACjB,IAAI,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,CACrD,MAAM,CAAC,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,CACjB,UAAU,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC,EAE7C;YAAA,CAAC,CAAC,CACA,SAAS,CAAC,CAAC,IAAA,oBAAU,EACnB,gGAAgG,EAChG,kBAAkB,EAClB,uBAAuB,CACxB,CAAC,CAEF;cAAA,CAAC,WAAW,IAAI,iBAAS,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,iBAAS,GAAG,GAAG,CAC3D;YAAA,EAAE,CAAC,CACL;UAAA,EAAE,GAAG,CAAC,CACP,CACH;MAAA,EAAE,GAAG,CACL;MAAA,CAAC,KAAK,IAAI,CACR,CAAC,GAAG,CAAC,SAAS,CAAC,sDAAsD,CACnE;UAAA,CAAC,CAAC,CAAC,SAAS,CAAC,yEAAyE,CACpF;YAAA,CAAC,KAAK,CACR;UAAA,EAAE,CAAC,CACL;QAAA,EAAE,GAAG,CAAC,CACP,CACH;IAAA,EAAE,GAAG,CAAC,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,cAAc,CAAC"}
|
|
@@ -20,12 +20,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
20
20
|
*/
|
|
21
21
|
const common_1 = require("@google-psat/common");
|
|
22
22
|
const file_saver_1 = require("file-saver");
|
|
23
|
-
const utils_1 = require("../../table/utils");
|
|
24
23
|
const exportCookies = (isCLI = false, rows, hostname) => {
|
|
25
24
|
const _cookies = rows.map(({ originalData }) => originalData);
|
|
26
25
|
const generateCookieTableCSV = isCLI
|
|
27
|
-
?
|
|
28
|
-
:
|
|
26
|
+
? common_1.generateCLICookieTableCSV
|
|
27
|
+
: common_1.generateExtensionCookieTableCSV;
|
|
29
28
|
if (_cookies.length > 0 && 'parsedCookie' in _cookies[0]) {
|
|
30
29
|
const csvTextBlob = generateCookieTableCSV(_cookies);
|
|
31
30
|
const fileName = hostname.split('.').join('-');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exportCookies.js","sourceRoot":"","sources":["../../../../src/components/cookieTable/utils/exportCookies.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;AAEH;;GAEG;AACH,
|
|
1
|
+
{"version":3,"file":"exportCookies.js","sourceRoot":"","sources":["../../../../src/components/cookieTable/utils/exportCookies.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;AAEH;;GAEG;AACH,gDAK6B;AAC7B,2CAAoC;AAOpC,MAAM,aAAa,GAAG,CAAC,KAAK,GAAG,KAAK,EAAE,IAAgB,EAAE,QAAgB,EAAE,EAAE;IAC1E,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,YAAY,EAAE,EAAE,EAAE,CAAC,YAAY,CAAC,CAAC;IAE9D,MAAM,sBAAsB,GAAG,KAAK;QAClC,CAAC,CAAC,kCAAyB;QAC3B,CAAC,CAAC,wCAA+B,CAAC;IAEpC,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,IAAI,cAAc,IAAI,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC;QACzD,MAAM,WAAW,GAAG,sBAAsB,CAAC,QAA6B,CAAC,CAAC;QAC1E,MAAM,QAAQ,GAAG,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAC/C,IAAA,mBAAM,EACJ,WAAW,EACX,GAAG,QAAQ,WAAW,IAAA,8BAAqB,EAAC,qBAAqB,CAAC,MAAM,CACzE,CAAC;IACJ,CAAC;AACH,CAAC,CAAC;AAEF,kBAAe,aAAa,CAAC"}
|
|
@@ -31,9 +31,9 @@ const LandingHeader = ({ dataMapping = [], extraClasses = '', }) => {
|
|
|
31
31
|
return (<div className={(0, classnames_1.default)('flex justify-center border-hex-gray pt-5 dark:border-quartz border-t', {
|
|
32
32
|
[extraClasses]: Boolean(extraClasses),
|
|
33
33
|
})} data-testid="cookies-landing-header">
|
|
34
|
-
<div className="lg:max-w-[729px] flex gap-9
|
|
34
|
+
<div className="lg:max-w-[729px] flex gap-9">
|
|
35
35
|
{dataMapping.map((circleData, index) => {
|
|
36
|
-
return (<div key={index} className="text-center w-
|
|
36
|
+
return (<div key={index} className="text-center w-fit h-fit">
|
|
37
37
|
<button key={index} className={(0, classnames_1.default)('group text-center w-20 p-2 h-full', {
|
|
38
38
|
'active:opacity-50 hover:scale-95 transition-all duration-300 ease-in-out cursor-pointer ': circleData.onClick,
|
|
39
39
|
'cursor-default': !circleData.onClick,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.jsx","sourceRoot":"","sources":["../../../../src/components/cookiesLanding/landingHeader/index.tsx"],"names":[],"mappings":";;;;;AAAA;;;;;;;;;;;;;;GAcG;AACH;;GAEG;AACH,kDAA0B;AAE1B,4DAAoC;AAEpC;;GAEG;AACH,0EAAkD;AAMlD,MAAM,aAAa,GAAG,CAAC,EACrB,WAAW,GAAG,EAAE,EAChB,YAAY,GAAG,EAAE,GACE,EAAE,EAAE;IACvB,OAAO,CACL,CAAC,GAAG,CACF,SAAS,CAAC,CAAC,IAAA,oBAAU,EACnB,sEAAsE,EACtE;YACE,CAAC,YAAY,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC;SACtC,CACF,CAAC,CACF,WAAW,CAAC,wBAAwB,CAEpC;MAAA,CAAC,GAAG,CAAC,SAAS,CAAC,
|
|
1
|
+
{"version":3,"file":"index.jsx","sourceRoot":"","sources":["../../../../src/components/cookiesLanding/landingHeader/index.tsx"],"names":[],"mappings":";;;;;AAAA;;;;;;;;;;;;;;GAcG;AACH;;GAEG;AACH,kDAA0B;AAE1B,4DAAoC;AAEpC;;GAEG;AACH,0EAAkD;AAMlD,MAAM,aAAa,GAAG,CAAC,EACrB,WAAW,GAAG,EAAE,EAChB,YAAY,GAAG,EAAE,GACE,EAAE,EAAE;IACvB,OAAO,CACL,CAAC,GAAG,CACF,SAAS,CAAC,CAAC,IAAA,oBAAU,EACnB,sEAAsE,EACtE;YACE,CAAC,YAAY,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC;SACtC,CACF,CAAC,CACF,WAAW,CAAC,wBAAwB,CAEpC;MAAA,CAAC,GAAG,CAAC,SAAS,CAAC,6BAA6B,CAC1C;QAAA,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,UAAU,EAAE,KAAK,EAAE,EAAE;YACrC,OAAO,CACL,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,SAAS,CAAC,yBAAyB,CAClD;cAAA,CAAC,MAAM,CACL,GAAG,CAAC,CAAC,KAAK,CAAC,CACX,SAAS,CAAC,CAAC,IAAA,oBAAU,EAAC,mCAAmC,EAAE;oBACzD,0FAA0F,EACxF,UAAU,CAAC,OAAO;oBACpB,gBAAgB,EAAE,CAAC,UAAU,CAAC,OAAO;iBACtC,CAAC,CAAC,CACH,OAAO,CAAC,CAAC,GAAG,EAAE;;oBACZ,MAAA,UAAU,CAAC,OAAO,0DAAI,CAAC;gBACzB,CAAC,CAAC,CAEF;gBAAA,CAAC,wBAAc,CACb,KAAK,CAAC,CAAC,UAAU,CAAC,KAAK,CAAC,CACxB,WAAW,CAAC,CAAC,UAAU,CAAC,KAAK,CAAC,CAC9B,IAAI,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC,CACtB,iBAAiB,CAAC,mBAAmB,CACrC,uBAAuB,CAAC,CAAC,IAAA,oBAAU,EAAC;oBAClC,+DAA+D,EAC7D,UAAU,CAAC,OAAO;iBACrB,CAAC,CAAC,CACH,oBAAoB,CAAC,CAAC,IAAA,oBAAU,EAAC;oBAC/B,sIAAsI,EACpI,UAAU,CAAC,OAAO;iBACrB,CAAC,CAAC,EAEP;cAAA,EAAE,MAAM,CACV;YAAA,EAAE,GAAG,CAAC,CACP,CAAC;QACJ,CAAC,CAAC,CACJ;MAAA,EAAE,GAAG,CACP;IAAA,EAAE,GAAG,CAAC,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,aAAa,CAAC"}
|
|
@@ -1,19 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
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
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
18
3
|
if (k2 === undefined) k2 = k;
|
|
19
4
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
@@ -28,14 +13,21 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
|
|
|
28
13
|
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
29
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
30
15
|
};
|
|
31
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
32
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
33
|
-
};
|
|
34
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
17
|
+
/*
|
|
18
|
+
* Copyright 2023 Google LLC
|
|
19
|
+
*
|
|
20
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
21
|
+
* you may not use this file except in compliance with the License.
|
|
22
|
+
* You may obtain a copy of the License at
|
|
23
|
+
*
|
|
24
|
+
* https://www.apache.org/licenses/LICENSE-2.0
|
|
25
|
+
*
|
|
26
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
27
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
28
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
29
|
+
* See the License for the specific language governing permissions and
|
|
30
|
+
* limitations under the License.
|
|
31
|
+
*/
|
|
40
32
|
__exportStar(require("./precalculatedFiltersUtils"), exports);
|
|
41
33
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/table/utils/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/table/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;GAcG;AACH,8DAA4C"}
|
|
@@ -9,9 +9,10 @@ const constants_1 = require("../constants");
|
|
|
9
9
|
/**
|
|
10
10
|
* Calcualte insights about frames to be shown on cookies landing page.
|
|
11
11
|
* @param json Complete json for the Dashboard.
|
|
12
|
+
* @param tabCookies
|
|
12
13
|
* @returns object
|
|
13
14
|
*/
|
|
14
|
-
function prepareFrameStatsComponentForExtensionDashboard(json) {
|
|
15
|
+
function prepareFrameStatsComponentForExtensionDashboard(json, tabCookies) {
|
|
15
16
|
if (!json) {
|
|
16
17
|
return {
|
|
17
18
|
dataMapping: constants_1.EMPTY_FRAME_COUNT,
|
|
@@ -21,14 +22,34 @@ function prepareFrameStatsComponentForExtensionDashboard(json) {
|
|
|
21
22
|
const blockedCookieFrame = new Set();
|
|
22
23
|
const unBlockedCookieFrame = new Set();
|
|
23
24
|
const cookieFrame = new Set();
|
|
25
|
+
const filteredCookiesKey = new Set();
|
|
26
|
+
Object.keys(tabCookies || {}).forEach((key) => {
|
|
27
|
+
filteredCookiesKey.add(key);
|
|
28
|
+
});
|
|
29
|
+
const cookiesToBeUsed = {};
|
|
24
30
|
Object.keys(json.cookieData || {}).forEach((frame) => {
|
|
31
|
+
var _a, _b;
|
|
32
|
+
cookiesToBeUsed[frame] = {
|
|
33
|
+
frameCookies: {},
|
|
34
|
+
frameType: (_b = (_a = json.cookieData[frame]) === null || _a === void 0 ? void 0 : _a.frameType) !== null && _b !== void 0 ? _b : '',
|
|
35
|
+
};
|
|
36
|
+
if (Object.keys(json.cookieData[frame].frameCookies).length > 0) {
|
|
37
|
+
Object.keys(json.cookieData[frame].frameCookies).forEach((cookieKey) => {
|
|
38
|
+
if (filteredCookiesKey.has(cookieKey)) {
|
|
39
|
+
cookiesToBeUsed[frame].frameCookies[cookieKey] =
|
|
40
|
+
json.cookieData[frame].frameCookies[cookieKey];
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
Object.keys(cookiesToBeUsed || {}).forEach((frame) => {
|
|
25
46
|
let hasBlockedCookie = false;
|
|
26
47
|
let hasUnblockedCookie = false;
|
|
27
|
-
if (Object.keys(
|
|
48
|
+
if (Object.keys(cookiesToBeUsed[frame].frameCookies).length > 0) {
|
|
28
49
|
cookieFrame.add(frame);
|
|
29
|
-
Object.keys(
|
|
50
|
+
Object.keys(cookiesToBeUsed[frame].frameCookies).forEach((cookieKey) => {
|
|
30
51
|
var _a, _b;
|
|
31
|
-
const cookie =
|
|
52
|
+
const cookie = cookiesToBeUsed[frame].frameCookies[cookieKey];
|
|
32
53
|
if ((cookie === null || cookie === void 0 ? void 0 : cookie.blockedReasons) && ((_a = cookie === null || cookie === void 0 ? void 0 : cookie.blockedReasons) === null || _a === void 0 ? void 0 : _a.length) > 0) {
|
|
33
54
|
hasBlockedCookie = true;
|
|
34
55
|
}
|
|
@@ -77,7 +98,7 @@ function prepareFrameStatsComponentForExtensionDashboard(json) {
|
|
|
77
98
|
{
|
|
78
99
|
label: i18n_1.I18n.getMessage('totalFrames'),
|
|
79
100
|
descriptionKey: 'Total frames',
|
|
80
|
-
count: Object.keys(
|
|
101
|
+
count: Object.keys(cookiesToBeUsed || {}).length,
|
|
81
102
|
color: '#25ACAD',
|
|
82
103
|
countClassName: 'text-greenland-green',
|
|
83
104
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prepareFrameStatsComponentForExtensionDashboard.js","sourceRoot":"","sources":["../../src/utils/prepareFrameStatsComponentForExtensionDashboard.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"prepareFrameStatsComponentForExtensionDashboard.js","sourceRoot":"","sources":["../../src/utils/prepareFrameStatsComponentForExtensionDashboard.ts"],"names":[],"mappings":";;AAgCA,kEAsIC;AAnJD,4CAAyC;AAEzC;;GAEG;AACH,4CAAqE;AAErE;;;;;GAKG;AACH,SAAwB,+CAA+C,CACrE,IAAyB,EACzB,UAA6B;IAE7B,IAAI,CAAC,IAAI,EAAE,CAAC;QACV,OAAO;YACL,WAAW,EAAE,6BAAiB;YAC9B,MAAM,EAAE,8BAAkB;SAC3B,CAAC;IACJ,CAAC;IAED,MAAM,kBAAkB,GAAG,IAAI,GAAG,EAAE,CAAC;IACrC,MAAM,oBAAoB,GAAG,IAAI,GAAG,EAAE,CAAC;IACvC,MAAM,WAAW,GAAG,IAAI,GAAG,EAAE,CAAC;IAC9B,MAAM,kBAAkB,GAAG,IAAI,GAAG,EAAE,CAAC;IAEr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AAI;gBAChC,KAAK,EAAE,SAAS;gBAChB,cAAc,EAAE,6BAA6B;aAC9C;YACD;gBACE,KAAK,EAAE,WAAI,CAAC,UAAU,CAAC,cAAc,CAAC;gBACtC,cAAc,EAAE,eAAe;gBAC/B,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,UAAU,IAAI,EAAE,CAAC,CAAC,MAAM,CAChD,CAAC,KAAK,EAAE,EAAE,CAAC,CAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,SAAS,MAAK,cAAc,CAC/C,CAAC,MAAM;gBACR,KAAK,EAAE,SAAS;gBAChB,cAAc,EAAE,oBAAoB;aACrC;SACF;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
|
-
import type { CompleteJson } from '@google-psat/common';
|
|
4
|
+
import type { CompleteJson, TabCookies } from '@google-psat/common';
|
|
5
5
|
/**
|
|
6
6
|
* Calcualte insights about frames to be shown on cookies landing page.
|
|
7
7
|
* @param json Complete json for the Dashboard.
|
|
8
|
+
* @param tabCookies
|
|
8
9
|
* @returns object
|
|
9
10
|
*/
|
|
10
|
-
export default function prepareFrameStatsComponentForExtensionDashboard(json: CompleteJson | null): {
|
|
11
|
+
export default function prepareFrameStatsComponentForExtensionDashboard(json: CompleteJson | null, tabCookies: TabCookies | null): {
|
|
11
12
|
dataMapping: {
|
|
12
13
|
title: string;
|
|
13
14
|
count: number;
|
package/package.json
CHANGED
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
/*
|
|
4
|
-
* Copyright 2023 Google LLC
|
|
5
|
-
*
|
|
6
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
|
-
* you may not use this file except in compliance with the License.
|
|
8
|
-
* You may obtain a copy of the License at
|
|
9
|
-
*
|
|
10
|
-
* https://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
-
*
|
|
12
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
13
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
14
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
-
* See the License for the specific language governing permissions and
|
|
16
|
-
* limitations under the License.
|
|
17
|
-
*/
|
|
18
|
-
/**
|
|
19
|
-
* External dependencies.
|
|
20
|
-
*/
|
|
21
|
-
const common_1 = require("@google-psat/common");
|
|
22
|
-
const i18n_1 = require("@google-psat/i18n");
|
|
23
|
-
const COOKIES_TABLE_DATA_HEADER_EXTENSION = [
|
|
24
|
-
() => i18n_1.I18n.getMessage('name'),
|
|
25
|
-
() => i18n_1.I18n.getMessage('scope'),
|
|
26
|
-
() => i18n_1.I18n.getMessage('domain'),
|
|
27
|
-
() => i18n_1.I18n.getMessage('partitionKey'),
|
|
28
|
-
() => i18n_1.I18n.getMessage('sameSite'),
|
|
29
|
-
() => i18n_1.I18n.getMessage('category'),
|
|
30
|
-
() => i18n_1.I18n.getMessage('platform'),
|
|
31
|
-
() => i18n_1.I18n.getMessage('httpOnly'),
|
|
32
|
-
() => i18n_1.I18n.getMessage('secure'),
|
|
33
|
-
() => i18n_1.I18n.getMessage('value'),
|
|
34
|
-
() => i18n_1.I18n.getMessage('path'),
|
|
35
|
-
() => i18n_1.I18n.getMessage('expires'),
|
|
36
|
-
() => i18n_1.I18n.getMessage('issues'),
|
|
37
|
-
() => i18n_1.I18n.getMessage('gdpr'),
|
|
38
|
-
() => i18n_1.I18n.getMessage('priority'),
|
|
39
|
-
() => i18n_1.I18n.getMessage('size'),
|
|
40
|
-
];
|
|
41
|
-
const generateExtensionCookieTableCSV = (cookies) => {
|
|
42
|
-
var _a, _b, _c, _d, _e, _f;
|
|
43
|
-
let cookieRecords = '';
|
|
44
|
-
for (const cookie of cookies) {
|
|
45
|
-
//This should be in the same order as cookieDataHeader
|
|
46
|
-
const recordsArray = [
|
|
47
|
-
cookie.parsedCookie.name,
|
|
48
|
-
cookie.isFirstParty
|
|
49
|
-
? i18n_1.I18n.getMessage('firstParty')
|
|
50
|
-
: i18n_1.I18n.getMessage('thirdParty'),
|
|
51
|
-
cookie.parsedCookie.domain || ' ',
|
|
52
|
-
cookie.parsedCookie.partitionKey || ' ',
|
|
53
|
-
cookie.parsedCookie.samesite,
|
|
54
|
-
i18n_1.I18n.getMessage(((_b = (_a = cookie.analytics) === null || _a === void 0 ? void 0 : _a.category) === null || _b === void 0 ? void 0 : _b.toLowerCase()) || 'uncategorized'),
|
|
55
|
-
(_c = cookie.analytics) === null || _c === void 0 ? void 0 : _c.platform,
|
|
56
|
-
cookie.parsedCookie.httponly
|
|
57
|
-
? i18n_1.I18n.getMessage('yes')
|
|
58
|
-
: i18n_1.I18n.getMessage('no'),
|
|
59
|
-
cookie.parsedCookie.secure
|
|
60
|
-
? i18n_1.I18n.getMessage('yes')
|
|
61
|
-
: i18n_1.I18n.getMessage('no'),
|
|
62
|
-
cookie.parsedCookie.value,
|
|
63
|
-
cookie.parsedCookie.path,
|
|
64
|
-
cookie.parsedCookie.expires === 'Session'
|
|
65
|
-
? i18n_1.I18n.getMessage('session')
|
|
66
|
-
: cookie.parsedCookie.expires,
|
|
67
|
-
cookie.isBlocked ? i18n_1.I18n.getMessage('yes') : i18n_1.I18n.getMessage('no'),
|
|
68
|
-
((_d = cookie.analytics) === null || _d === void 0 ? void 0 : _d.gdprUrl) || 'NA',
|
|
69
|
-
i18n_1.I18n.getMessage((((_e = cookie.parsedCookie) === null || _e === void 0 ? void 0 : _e.priority) || '').toLowerCase()),
|
|
70
|
-
(_f = cookie.parsedCookie.size) === null || _f === void 0 ? void 0 : _f.toString(),
|
|
71
|
-
].map(common_1.sanitizeCsvRecord);
|
|
72
|
-
cookieRecords += recordsArray.join(',') + '\r\n';
|
|
73
|
-
}
|
|
74
|
-
return new Blob([
|
|
75
|
-
COOKIES_TABLE_DATA_HEADER_EXTENSION.map((header) => header()).join(',') +
|
|
76
|
-
'\r\n' +
|
|
77
|
-
cookieRecords,
|
|
78
|
-
]);
|
|
79
|
-
};
|
|
80
|
-
exports.default = generateExtensionCookieTableCSV;
|
|
81
|
-
//# sourceMappingURL=generatExtensionCookietableCSV.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"generatExtensionCookietableCSV.js","sourceRoot":"","sources":["../../../../src/components/table/utils/generatExtensionCookietableCSV.ts"],"names":[],"mappings":";;AAAA;;;;;;;;;;;;;;GAcG;AACH;;GAEG;AACH,gDAA8E;AAC9E,4CAAyC;AAEzC,MAAM,mCAAmC,GAAG;IAC1C,GAAG,EAAE,CAAC,WAAI,CAAC,UAAU,CAAC,MAAM,CAAC;IAC7B,GAAG,EAAE,CAAC,WAAI,CAAC,UAAU,CAAC,OAAO,CAAC;IAC9B,GAAG,EAAE,CAAC,WAAI,CAAC,UAAU,CAAC,QAAQ,CAAC;IAC/B,GAAG,EAAE,CAAC,WAAI,CAAC,UAAU,CAAC,cAAc,CAAC;IACrC,GAAG,EAAE,CAAC,WAAI,CAAC,UAAU,CAAC,UAAU,CAAC;IACjC,GAAG,EAAE,CAAC,WAAI,CAAC,UAAU,CAAC,UAAU,CAAC;IACjC,GAAG,EAAE,CAAC,WAAI,CAAC,UAAU,CAAC,UAAU,CAAC;IACjC,GAAG,EAAE,CAAC,WAAI,CAAC,UAAU,CAAC,UAAU,CAAC;IACjC,GAAG,EAAE,CAAC,WAAI,CAAC,UAAU,CAAC,QAAQ,CAAC;IAC/B,GAAG,EAAE,CAAC,WAAI,CAAC,UAAU,CAAC,OAAO,CAAC;IAC9B,GAAG,EAAE,CAAC,WAAI,CAAC,UAAU,CAAC,MAAM,CAAC;IAC7B,GAAG,EAAE,CAAC,WAAI,CAAC,UAAU,CAAC,SAAS,CAAC;IAChC,GAAG,EAAE,CAAC,WAAI,CAAC,UAAU,CAAC,QAAQ,CAAC;IAC/B,GAAG,EAAE,C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AK,SAAS;gBACvC,CAAC,CAAC,WAAI,CAAC,UAAU,CAAC,SAAS,CAAC;gBAC5B,CAAC,CAAC,MAAM,CAAC,YAAY,CAAC,OAAO;YAC/B,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,WAAI,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,WAAI,CAAC,UAAU,CAAC,IAAI,CAAC;YACjE,CAAA,MAAA,MAAM,CAAC,SAAS,0CAAE,OAAO,KAAI,IAAI;YACjC,WAAI,CAAC,UAAU,CAAC,CAAC,CAAA,MAAA,MAAM,CAAC,YAAY,0CAAE,QAAQ,KAAI,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC;YACpE,MAAA,MAAM,CAAC,YAAY,CAAC,IAAI,0CAAE,QAAQ,EAAE;SACrC,CAAC,GAAG,CAAC,0BAAiB,CAAC,CAAC;QAEzB,aAAa,IAAI,YAAY,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC;IACnD,CAAC;IAED,OAAO,IAAI,IAAI,CAAC;QACd,mCAAmC,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;YACrE,MAAM;YACN,aAAa;KAChB,CAAC,CAAC;AACL,CAAC,CAAC;AAEF,kBAAe,+BAA+B,CAAC"}
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
/*
|
|
4
|
-
* Copyright 2023 Google LLC
|
|
5
|
-
*
|
|
6
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
|
-
* you may not use this file except in compliance with the License.
|
|
8
|
-
* You may obtain a copy of the License at
|
|
9
|
-
*
|
|
10
|
-
* https://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
-
*
|
|
12
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
13
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
14
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
-
* See the License for the specific language governing permissions and
|
|
16
|
-
* limitations under the License.
|
|
17
|
-
*/
|
|
18
|
-
/**
|
|
19
|
-
* External dependencies.
|
|
20
|
-
*/
|
|
21
|
-
const common_1 = require("@google-psat/common");
|
|
22
|
-
const i18n_1 = require("@google-psat/i18n");
|
|
23
|
-
const COOKIES_TABLE_DATA_HEADER_CLI = [
|
|
24
|
-
() => i18n_1.I18n.getMessage('name'),
|
|
25
|
-
() => i18n_1.I18n.getMessage('scope'),
|
|
26
|
-
() => i18n_1.I18n.getMessage('domain'),
|
|
27
|
-
() => i18n_1.I18n.getMessage('partitionKey'),
|
|
28
|
-
() => i18n_1.I18n.getMessage('sameSite'),
|
|
29
|
-
() => i18n_1.I18n.getMessage('category'),
|
|
30
|
-
() => i18n_1.I18n.getMessage('platform'),
|
|
31
|
-
() => i18n_1.I18n.getMessage('httpOnly'),
|
|
32
|
-
() => i18n_1.I18n.getMessage('secure'),
|
|
33
|
-
() => i18n_1.I18n.getMessage('value'),
|
|
34
|
-
() => i18n_1.I18n.getMessage('path'),
|
|
35
|
-
() => i18n_1.I18n.getMessage('expires'),
|
|
36
|
-
() => i18n_1.I18n.getMessage('issues'),
|
|
37
|
-
() => i18n_1.I18n.getMessage('gdpr'),
|
|
38
|
-
];
|
|
39
|
-
const generateCLICookieTableCSV = (cookies) => {
|
|
40
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
41
|
-
let cookieRecords = '';
|
|
42
|
-
for (const cookie of cookies) {
|
|
43
|
-
//This should be in the same order as cookieDataHeader
|
|
44
|
-
const recordsArray = [
|
|
45
|
-
cookie.parsedCookie.name,
|
|
46
|
-
cookie.isFirstParty
|
|
47
|
-
? i18n_1.I18n.getMessage('firstParty')
|
|
48
|
-
: i18n_1.I18n.getMessage('thirdParty'),
|
|
49
|
-
cookie.parsedCookie.domain || ' ',
|
|
50
|
-
cookie.parsedCookie.partitionKey || ' ',
|
|
51
|
-
//@ts-ignore
|
|
52
|
-
(_b = (_a = cookie.parsedCookie) === null || _a === void 0 ? void 0 : _a.sameSite) !== null && _b !== void 0 ? _b : (_c = cookie.parsedCookie) === null || _c === void 0 ? void 0 : _c.samesite,
|
|
53
|
-
i18n_1.I18n.getMessage(((_e = (_d = cookie.analytics) === null || _d === void 0 ? void 0 : _d.category) === null || _e === void 0 ? void 0 : _e.toLowerCase()) || 'uncategorized'),
|
|
54
|
-
(_f = cookie.analytics) === null || _f === void 0 ? void 0 : _f.platform,
|
|
55
|
-
cookie.parsedCookie.httponly
|
|
56
|
-
? i18n_1.I18n.getMessage('yes')
|
|
57
|
-
: i18n_1.I18n.getMessage('no'),
|
|
58
|
-
cookie.parsedCookie.secure
|
|
59
|
-
? i18n_1.I18n.getMessage('yes')
|
|
60
|
-
: i18n_1.I18n.getMessage('no'),
|
|
61
|
-
cookie.parsedCookie.value,
|
|
62
|
-
cookie.parsedCookie.path,
|
|
63
|
-
cookie.parsedCookie.expires,
|
|
64
|
-
cookie.isBlocked ? i18n_1.I18n.getMessage('yes') : i18n_1.I18n.getMessage('no'),
|
|
65
|
-
((_g = cookie.analytics) === null || _g === void 0 ? void 0 : _g.gdprUrl) || 'NA',
|
|
66
|
-
].map(common_1.sanitizeCsvRecord);
|
|
67
|
-
cookieRecords += recordsArray.join(',') + '\r\n';
|
|
68
|
-
}
|
|
69
|
-
return new Blob([
|
|
70
|
-
COOKIES_TABLE_DATA_HEADER_CLI.map((header) => header()).join(',') +
|
|
71
|
-
'\r\n' +
|
|
72
|
-
cookieRecords,
|
|
73
|
-
]);
|
|
74
|
-
};
|
|
75
|
-
exports.default = generateCLICookieTableCSV;
|
|
76
|
-
//# sourceMappingURL=generateCLICookieTableCSV.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"generateCLICookieTableCSV.js","sourceRoot":"","sources":["../../../../src/components/table/utils/generateCLICook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