@elementor/editor-audits 4.4.0-1074 → 4.4.0-1076
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/index.d.mts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +225 -144
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +188 -107
- package/dist/index.mjs.map +1 -1
- package/package.json +13 -13
- package/src/api/page-context-client.ts +27 -8
- package/src/audits/privacy-policy.ts +1 -0
- package/src/components/violation-cta-button.tsx +22 -0
- package/src/components/violation-row.tsx +13 -1
- package/src/hooks/use-audit-report.ts +6 -0
- package/src/store/slice.ts +3 -0
- package/src/types.ts +1 -0
- package/src/utils/session-expiration.ts +63 -0
package/dist/index.js
CHANGED
|
@@ -51,10 +51,10 @@ var import_i18n22 = require("@wordpress/i18n");
|
|
|
51
51
|
var import_editor_floating_panels2 = require("@elementor/editor-floating-panels");
|
|
52
52
|
|
|
53
53
|
// src/components/audit-panel.tsx
|
|
54
|
-
var
|
|
54
|
+
var React23 = __toESM(require("react"));
|
|
55
55
|
var import_editor_elements5 = require("@elementor/editor-elements");
|
|
56
56
|
var import_editor_floating_panels = require("@elementor/editor-floating-panels");
|
|
57
|
-
var
|
|
57
|
+
var import_ui22 = require("@elementor/ui");
|
|
58
58
|
var import_i18n21 = require("@wordpress/i18n");
|
|
59
59
|
|
|
60
60
|
// src/hooks/use-audit-report.ts
|
|
@@ -77,18 +77,66 @@ function getWindowConfig() {
|
|
|
77
77
|
return config;
|
|
78
78
|
}
|
|
79
79
|
|
|
80
|
+
// src/utils/session-expiration.ts
|
|
81
|
+
var NONCE_INVALID_CODE = "rest_cookie_invalid_nonce";
|
|
82
|
+
var DEFAULT_AJAX_URL = "/wp-admin/admin-ajax.php";
|
|
83
|
+
var SessionExpiredError = class extends Error {
|
|
84
|
+
};
|
|
85
|
+
var nonceRefreshPromise = null;
|
|
86
|
+
function isNonceInvalidError(error) {
|
|
87
|
+
const response = error?.response;
|
|
88
|
+
return response?.status === 403 && response?.data?.code === NONCE_INVALID_CODE;
|
|
89
|
+
}
|
|
90
|
+
async function refreshAuditsNonce() {
|
|
91
|
+
if (nonceRefreshPromise) {
|
|
92
|
+
return nonceRefreshPromise;
|
|
93
|
+
}
|
|
94
|
+
nonceRefreshPromise = requestFreshNonce();
|
|
95
|
+
try {
|
|
96
|
+
return await nonceRefreshPromise;
|
|
97
|
+
} finally {
|
|
98
|
+
nonceRefreshPromise = null;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
async function requestFreshNonce() {
|
|
102
|
+
const ajaxUrl = window.elementorCommon?.ajax?.config?.url ?? DEFAULT_AJAX_URL;
|
|
103
|
+
const url = new URL(ajaxUrl, window.location.origin);
|
|
104
|
+
url.searchParams.set("action", "rest-nonce");
|
|
105
|
+
const response = await fetch(url.toString(), { credentials: "same-origin" });
|
|
106
|
+
if (!response.ok) {
|
|
107
|
+
throw new Error(`Failed to refresh audits nonce: HTTP ${response.status}`);
|
|
108
|
+
}
|
|
109
|
+
const nonce = await response.text();
|
|
110
|
+
if (!nonce || "0" === nonce) {
|
|
111
|
+
throw new SessionExpiredError("Session expired \u2014 received invalid nonce");
|
|
112
|
+
}
|
|
113
|
+
window.elementorAudits = { ...getWindowConfig(), nonce };
|
|
114
|
+
return nonce;
|
|
115
|
+
}
|
|
116
|
+
|
|
80
117
|
// src/api/page-context-client.ts
|
|
81
118
|
async function fetchPageContext(documentId, attachmentIds) {
|
|
119
|
+
return requestPageContext(documentId, attachmentIds, true);
|
|
120
|
+
}
|
|
121
|
+
async function requestPageContext(documentId, attachmentIds, allowNonceRetry) {
|
|
82
122
|
const { restNamespace, nonce } = getWindowConfig();
|
|
83
123
|
const url = `${restNamespace}/audits/page-context`;
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
124
|
+
try {
|
|
125
|
+
const response = await (0, import_http_client.httpService)().get(url, {
|
|
126
|
+
params: {
|
|
127
|
+
document_id: documentId,
|
|
128
|
+
attachment_ids: attachmentIds
|
|
129
|
+
},
|
|
130
|
+
headers: { "X-WP-Nonce": nonce }
|
|
131
|
+
});
|
|
132
|
+
return response.data;
|
|
133
|
+
} catch (error) {
|
|
134
|
+
if (!allowNonceRetry || !isNonceInvalidError(error)) {
|
|
135
|
+
throw error;
|
|
136
|
+
}
|
|
137
|
+
await refreshAuditsNonce();
|
|
138
|
+
return requestPageContext(documentId, attachmentIds, false);
|
|
139
|
+
}
|
|
92
140
|
}
|
|
93
141
|
|
|
94
142
|
// src/registry.ts
|
|
@@ -460,6 +508,9 @@ var slice = (0, import_store.__createSlice)({
|
|
|
460
508
|
state.status = "error";
|
|
461
509
|
state.error = action.payload;
|
|
462
510
|
},
|
|
511
|
+
runAborted(state) {
|
|
512
|
+
state.status = state.report ? "ready" : "idle";
|
|
513
|
+
},
|
|
463
514
|
reportRestored(state, action) {
|
|
464
515
|
state.status = "ready";
|
|
465
516
|
state.report = action.payload;
|
|
@@ -521,6 +572,10 @@ function useAuditReport() {
|
|
|
521
572
|
dispatch(slice.actions.runSucceeded(nextReport));
|
|
522
573
|
persistReport(documentIdToRun, nextReport);
|
|
523
574
|
} catch (e) {
|
|
575
|
+
if (e instanceof SessionExpiredError) {
|
|
576
|
+
dispatch(slice.actions.runAborted());
|
|
577
|
+
return;
|
|
578
|
+
}
|
|
524
579
|
dispatch(slice.actions.runFailed(e instanceof Error ? e.message : "Unknown error"));
|
|
525
580
|
}
|
|
526
581
|
};
|
|
@@ -694,14 +749,14 @@ function WelcomePage() {
|
|
|
694
749
|
}
|
|
695
750
|
|
|
696
751
|
// src/components/report-shell.tsx
|
|
697
|
-
var
|
|
752
|
+
var React22 = __toESM(require("react"));
|
|
698
753
|
var import_react5 = require("react");
|
|
699
|
-
var
|
|
754
|
+
var import_ui21 = require("@elementor/ui");
|
|
700
755
|
var import_i18n20 = require("@wordpress/i18n");
|
|
701
756
|
|
|
702
757
|
// src/components/pages/all-audits-page.tsx
|
|
703
|
-
var
|
|
704
|
-
var
|
|
758
|
+
var React12 = __toESM(require("react"));
|
|
759
|
+
var import_ui11 = require("@elementor/ui");
|
|
705
760
|
var import_i18n12 = require("@wordpress/i18n");
|
|
706
761
|
|
|
707
762
|
// src/components/status-section.tsx
|
|
@@ -753,11 +808,11 @@ function SubpageHeader({ title, onBack, backLabel, icon }) {
|
|
|
753
808
|
}
|
|
754
809
|
|
|
755
810
|
// src/components/violation-row.tsx
|
|
756
|
-
var
|
|
811
|
+
var React11 = __toESM(require("react"));
|
|
757
812
|
var import_react4 = require("react");
|
|
758
813
|
var import_editor_elements4 = require("@elementor/editor-elements");
|
|
759
814
|
var import_icons7 = require("@elementor/icons");
|
|
760
|
-
var
|
|
815
|
+
var import_ui10 = require("@elementor/ui");
|
|
761
816
|
var import_i18n11 = require("@wordpress/i18n");
|
|
762
817
|
|
|
763
818
|
// src/hooks/focus-violation.ts
|
|
@@ -870,14 +925,26 @@ function SeverityIcon({ severity }) {
|
|
|
870
925
|
return /* @__PURE__ */ React8.createElement(Icon, { fontSize: "small", color });
|
|
871
926
|
}
|
|
872
927
|
|
|
873
|
-
// src/components/violation-
|
|
928
|
+
// src/components/violation-cta-button.tsx
|
|
874
929
|
var React9 = __toESM(require("react"));
|
|
875
|
-
var import_icons6 = require("@elementor/icons");
|
|
876
930
|
var import_ui8 = require("@elementor/ui");
|
|
931
|
+
function ViolationCtaButton({ ctaLabel, externalUrl }) {
|
|
932
|
+
const handleClick = (event) => {
|
|
933
|
+
event.stopPropagation();
|
|
934
|
+
event.preventDefault();
|
|
935
|
+
window.open(externalUrl, "_blank", "noopener");
|
|
936
|
+
};
|
|
937
|
+
return /* @__PURE__ */ React9.createElement(import_ui8.Button, { variant: "outlined", color: "secondary", size: "small", onClick: handleClick }, ctaLabel);
|
|
938
|
+
}
|
|
939
|
+
|
|
940
|
+
// src/components/violation-icons.tsx
|
|
941
|
+
var React10 = __toESM(require("react"));
|
|
942
|
+
var import_icons6 = require("@elementor/icons");
|
|
943
|
+
var import_ui9 = require("@elementor/ui");
|
|
877
944
|
function ViolationIcon({ violation, widgetIcon }) {
|
|
878
945
|
if (widgetIcon) {
|
|
879
|
-
return /* @__PURE__ */
|
|
880
|
-
|
|
946
|
+
return /* @__PURE__ */ React10.createElement(
|
|
947
|
+
import_ui9.Box,
|
|
881
948
|
{
|
|
882
949
|
component: "i",
|
|
883
950
|
className: widgetIcon,
|
|
@@ -887,29 +954,29 @@ function ViolationIcon({ violation, widgetIcon }) {
|
|
|
887
954
|
);
|
|
888
955
|
}
|
|
889
956
|
if (violation.targetHint === "page-settings") {
|
|
890
|
-
return /* @__PURE__ */
|
|
957
|
+
return /* @__PURE__ */ React10.createElement(import_icons6.FileSettingsIcon, { fontSize: "inherit", "aria-hidden": true });
|
|
891
958
|
}
|
|
892
959
|
if (violation.targetHint === "site-settings" || violation.targetHint === "site-identity-settings") {
|
|
893
|
-
return /* @__PURE__ */
|
|
960
|
+
return /* @__PURE__ */ React10.createElement(import_icons6.SettingsIcon, { fontSize: "inherit", "aria-hidden": true });
|
|
894
961
|
}
|
|
895
|
-
return /* @__PURE__ */
|
|
962
|
+
return /* @__PURE__ */ React10.createElement(import_icons6.ShieldCheckIcon, { fontSize: "inherit", "aria-hidden": true });
|
|
896
963
|
}
|
|
897
964
|
|
|
898
965
|
// src/components/violation-row.tsx
|
|
899
966
|
function SkipReasonTooltip({ reason }) {
|
|
900
|
-
return /* @__PURE__ */
|
|
967
|
+
return /* @__PURE__ */ React11.createElement(import_ui10.Tooltip, { title: reason, placement: "top" }, /* @__PURE__ */ React11.createElement(import_ui10.Box, { "aria-label": reason, component: "span", sx: { display: "inline-flex", alignItems: "center" } }, /* @__PURE__ */ React11.createElement(import_icons7.HelpIcon, { fontSize: "small", color: "action" })));
|
|
901
968
|
}
|
|
902
969
|
function StatusIndicator({ audit: audit21, violations }) {
|
|
903
970
|
if (violations) {
|
|
904
|
-
return /* @__PURE__ */
|
|
971
|
+
return /* @__PURE__ */ React11.createElement(React11.Fragment, null, /* @__PURE__ */ React11.createElement(import_ui10.Typography, { variant: "caption", color: "text.secondary", fontWeight: "bold" }, violations.length), /* @__PURE__ */ React11.createElement(SeverityIcon, { severity: audit21.severity }));
|
|
905
972
|
}
|
|
906
|
-
return /* @__PURE__ */
|
|
973
|
+
return /* @__PURE__ */ React11.createElement(import_icons7.CheckIcon, { fontSize: "small", color: "success" });
|
|
907
974
|
}
|
|
908
975
|
function ViolationRow({ audit: audit21, skipReason, violations }) {
|
|
909
976
|
const [expanded, setExpanded] = (0, import_react4.useState)(false);
|
|
910
977
|
const toggleExpanded = () => setExpanded((value) => !value);
|
|
911
|
-
return /* @__PURE__ */
|
|
912
|
-
|
|
978
|
+
return /* @__PURE__ */ React11.createElement(import_ui10.Box, { sx: { borderBottom: 1, borderColor: "divider", paddingBlock: 0.5 } }, /* @__PURE__ */ React11.createElement(import_ui10.Box, { sx: { display: "flex", alignItems: "center", gap: 0.5 } }, /* @__PURE__ */ React11.createElement(
|
|
979
|
+
import_ui10.Box,
|
|
913
980
|
{
|
|
914
981
|
sx: {
|
|
915
982
|
alignItems: "center",
|
|
@@ -921,16 +988,16 @@ function ViolationRow({ audit: audit21, skipReason, violations }) {
|
|
|
921
988
|
},
|
|
922
989
|
onClick: toggleExpanded
|
|
923
990
|
},
|
|
924
|
-
/* @__PURE__ */
|
|
925
|
-
!skipReason && /* @__PURE__ */
|
|
926
|
-
), skipReason && /* @__PURE__ */
|
|
927
|
-
|
|
991
|
+
/* @__PURE__ */ React11.createElement(import_ui10.Typography, { variant: "body2", sx: { flex: 1 } }, audit21.title),
|
|
992
|
+
!skipReason && /* @__PURE__ */ React11.createElement(StatusIndicator, { audit: audit21, violations })
|
|
993
|
+
), skipReason && /* @__PURE__ */ React11.createElement(SkipReasonTooltip, { reason: skipReason }), /* @__PURE__ */ React11.createElement(
|
|
994
|
+
import_ui10.IconButton,
|
|
928
995
|
{
|
|
929
996
|
size: "small",
|
|
930
997
|
"aria-label": expanded ? (0, import_i18n11.__)("Collapse", "elementor") : (0, import_i18n11.__)("Expand", "elementor"),
|
|
931
998
|
onClick: toggleExpanded
|
|
932
999
|
},
|
|
933
|
-
/* @__PURE__ */
|
|
1000
|
+
/* @__PURE__ */ React11.createElement(
|
|
934
1001
|
import_icons7.ChevronDownIcon,
|
|
935
1002
|
{
|
|
936
1003
|
fontSize: "small",
|
|
@@ -940,30 +1007,30 @@ function ViolationRow({ audit: audit21, skipReason, violations }) {
|
|
|
940
1007
|
}
|
|
941
1008
|
}
|
|
942
1009
|
)
|
|
943
|
-
)), /* @__PURE__ */
|
|
944
|
-
|
|
1010
|
+
)), /* @__PURE__ */ React11.createElement(import_ui10.Collapse, { in: expanded }, /* @__PURE__ */ React11.createElement(import_ui10.Box, { sx: { display: "flex", flexDirection: "column", gap: 1, paddingBlock: 1 } }, /* @__PURE__ */ React11.createElement(
|
|
1011
|
+
import_ui10.Alert,
|
|
945
1012
|
{
|
|
946
1013
|
severity: "secondary",
|
|
947
1014
|
sx: { p: 1 },
|
|
948
|
-
icon: /* @__PURE__ */
|
|
1015
|
+
icon: /* @__PURE__ */ React11.createElement(import_icons7.AlertCircleIcon, { fontSize: "small", color: "secondary", "aria-hidden": true })
|
|
949
1016
|
},
|
|
950
|
-
/* @__PURE__ */
|
|
951
|
-
/* @__PURE__ */
|
|
952
|
-
), /* @__PURE__ */
|
|
953
|
-
|
|
1017
|
+
/* @__PURE__ */ React11.createElement(import_ui10.AlertTitle, null, /* @__PURE__ */ React11.createElement(import_ui10.Typography, { variant: "caption", component: "p", color: "text.primary", fontWeight: "bold" }, (0, import_i18n11.__)("What's the issue", "elementor"))),
|
|
1018
|
+
/* @__PURE__ */ React11.createElement(import_ui10.Typography, { variant: "caption", component: "p", color: "text.secondary" }, audit21.description)
|
|
1019
|
+
), /* @__PURE__ */ React11.createElement(
|
|
1020
|
+
import_ui10.Alert,
|
|
954
1021
|
{
|
|
955
1022
|
severity: "info",
|
|
956
1023
|
sx: { p: 1 },
|
|
957
|
-
icon: /* @__PURE__ */
|
|
1024
|
+
icon: /* @__PURE__ */ React11.createElement(import_icons7.BulbIcon, { fontSize: "small", color: "info", "aria-hidden": true })
|
|
958
1025
|
},
|
|
959
|
-
/* @__PURE__ */
|
|
960
|
-
/* @__PURE__ */
|
|
961
|
-
)), violations && violations.length > 0 && /* @__PURE__ */
|
|
1026
|
+
/* @__PURE__ */ React11.createElement(import_ui10.AlertTitle, null, /* @__PURE__ */ React11.createElement(import_ui10.Typography, { variant: "caption", component: "p", color: "text.primary", fontWeight: "bold" }, (0, import_i18n11.__)("How to resolve", "elementor"))),
|
|
1027
|
+
/* @__PURE__ */ React11.createElement(import_ui10.Typography, { variant: "caption", component: "p", color: "text.secondary" }, audit21.fixHint)
|
|
1028
|
+
)), violations && violations.length > 0 && /* @__PURE__ */ React11.createElement(import_ui10.Box, { role: "list", sx: { paddingBlockEnd: 1, paddingInlineStart: 2 } }, violations.map((violation, idx) => {
|
|
962
1029
|
const widgetIcon = violation.elementId ? (0, import_editor_elements4.getElementIcon)(violation.elementId) : null;
|
|
963
1030
|
const elementTitle = violation.elementId ? (0, import_editor_elements4.getElementTitle)(violation.elementId) : null;
|
|
964
1031
|
const rowLabel = elementTitle ? `${elementTitle} - ${violation.label}` : violation.label;
|
|
965
|
-
return /* @__PURE__ */
|
|
966
|
-
|
|
1032
|
+
return /* @__PURE__ */ React11.createElement(
|
|
1033
|
+
import_ui10.Box,
|
|
967
1034
|
{
|
|
968
1035
|
key: idx,
|
|
969
1036
|
role: "button",
|
|
@@ -985,10 +1052,23 @@ function ViolationRow({ audit: audit21, skipReason, violations }) {
|
|
|
985
1052
|
}
|
|
986
1053
|
}
|
|
987
1054
|
},
|
|
988
|
-
/* @__PURE__ */
|
|
989
|
-
/* @__PURE__ */
|
|
990
|
-
violation.angieFix && /* @__PURE__ */
|
|
991
|
-
/* @__PURE__ */
|
|
1055
|
+
/* @__PURE__ */ React11.createElement(ViolationIcon, { violation, widgetIcon }),
|
|
1056
|
+
/* @__PURE__ */ React11.createElement(import_ui10.Box, { sx: { flex: 1 } }, /* @__PURE__ */ React11.createElement(import_ui10.Typography, { variant: "caption" }, rowLabel), violation.detail && /* @__PURE__ */ React11.createElement(import_ui10.Typography, { variant: "caption", color: "text.secondary" }, violation.detail)),
|
|
1057
|
+
violation.angieFix && /* @__PURE__ */ React11.createElement(FixViolationWithAngie, { prompt: buildAngiePrompt(rowLabel) }),
|
|
1058
|
+
violation.ctaLabel && violation.externalUrl ? /* @__PURE__ */ React11.createElement(
|
|
1059
|
+
ViolationCtaButton,
|
|
1060
|
+
{
|
|
1061
|
+
ctaLabel: violation.ctaLabel,
|
|
1062
|
+
externalUrl: violation.externalUrl
|
|
1063
|
+
}
|
|
1064
|
+
) : /* @__PURE__ */ React11.createElement(
|
|
1065
|
+
import_icons7.EyeIcon,
|
|
1066
|
+
{
|
|
1067
|
+
className: "violation-hover-icon",
|
|
1068
|
+
fontSize: "tiny",
|
|
1069
|
+
"aria-hidden": true
|
|
1070
|
+
}
|
|
1071
|
+
)
|
|
992
1072
|
);
|
|
993
1073
|
}))));
|
|
994
1074
|
}
|
|
@@ -999,7 +1079,7 @@ function AllAuditsPage({ initialExpandedStatus, onBack, report }) {
|
|
|
999
1079
|
const expandFail = !initialExpandedStatus || initialExpandedStatus === "fail";
|
|
1000
1080
|
const expandPass = initialExpandedStatus === "pass";
|
|
1001
1081
|
const expandSkipped = initialExpandedStatus === "skipped";
|
|
1002
|
-
return /* @__PURE__ */
|
|
1082
|
+
return /* @__PURE__ */ React12.createElement(import_ui11.Box, { key: initialExpandedStatus ?? "default" }, /* @__PURE__ */ React12.createElement(SubpageHeader, { title: (0, import_i18n12.__)("All audits", "elementor"), onBack }), /* @__PURE__ */ React12.createElement(import_ui11.Box, { sx: { p: 1 } }, /* @__PURE__ */ React12.createElement(
|
|
1003
1083
|
StatusSection,
|
|
1004
1084
|
{
|
|
1005
1085
|
label: auditStatusLabel("fail"),
|
|
@@ -1007,8 +1087,8 @@ function AllAuditsPage({ initialExpandedStatus, onBack, report }) {
|
|
|
1007
1087
|
color: auditStatusColor("fail"),
|
|
1008
1088
|
defaultExpanded: expandFail
|
|
1009
1089
|
},
|
|
1010
|
-
failed.map((r) => /* @__PURE__ */
|
|
1011
|
-
), /* @__PURE__ */
|
|
1090
|
+
failed.map((r) => /* @__PURE__ */ React12.createElement(ViolationRow, { key: r.audit.id, audit: r.audit, violations: r.result.violations }))
|
|
1091
|
+
), /* @__PURE__ */ React12.createElement(
|
|
1012
1092
|
StatusSection,
|
|
1013
1093
|
{
|
|
1014
1094
|
label: auditStatusLabel("pass"),
|
|
@@ -1016,8 +1096,8 @@ function AllAuditsPage({ initialExpandedStatus, onBack, report }) {
|
|
|
1016
1096
|
color: auditStatusColor("pass"),
|
|
1017
1097
|
defaultExpanded: expandPass
|
|
1018
1098
|
},
|
|
1019
|
-
passed.map((r) => /* @__PURE__ */
|
|
1020
|
-
), /* @__PURE__ */
|
|
1099
|
+
passed.map((r) => /* @__PURE__ */ React12.createElement(ViolationRow, { key: r.audit.id, audit: r.audit }))
|
|
1100
|
+
), /* @__PURE__ */ React12.createElement(
|
|
1021
1101
|
StatusSection,
|
|
1022
1102
|
{
|
|
1023
1103
|
label: auditStatusLabel("skipped"),
|
|
@@ -1025,13 +1105,13 @@ function AllAuditsPage({ initialExpandedStatus, onBack, report }) {
|
|
|
1025
1105
|
color: auditStatusColor("skipped"),
|
|
1026
1106
|
defaultExpanded: expandSkipped
|
|
1027
1107
|
},
|
|
1028
|
-
skipped.map((r) => /* @__PURE__ */
|
|
1108
|
+
skipped.map((r) => /* @__PURE__ */ React12.createElement(ViolationRow, { key: r.audit.id, audit: r.audit, skipReason: r.result.reason }))
|
|
1029
1109
|
)));
|
|
1030
1110
|
}
|
|
1031
1111
|
|
|
1032
1112
|
// src/components/pages/category-page.tsx
|
|
1033
|
-
var
|
|
1034
|
-
var
|
|
1113
|
+
var React13 = __toESM(require("react"));
|
|
1114
|
+
var import_ui12 = require("@elementor/ui");
|
|
1035
1115
|
var import_i18n13 = require("@wordpress/i18n");
|
|
1036
1116
|
|
|
1037
1117
|
// src/components/category-icons.ts
|
|
@@ -1048,15 +1128,15 @@ var CATEGORY_ICONS = {
|
|
|
1048
1128
|
function CategoryPage({ category, report, onBack }) {
|
|
1049
1129
|
const Icon = CATEGORY_ICONS[category];
|
|
1050
1130
|
const { failed, passed, totalViolations } = partitionAuditResults(report, { category });
|
|
1051
|
-
return /* @__PURE__ */
|
|
1131
|
+
return /* @__PURE__ */ React13.createElement(React13.Fragment, null, /* @__PURE__ */ React13.createElement(
|
|
1052
1132
|
SubpageHeader,
|
|
1053
1133
|
{
|
|
1054
1134
|
title: CATEGORY_LABELS[category],
|
|
1055
1135
|
onBack,
|
|
1056
1136
|
backLabel: (0, import_i18n13.__)("Back to all issues", "elementor"),
|
|
1057
|
-
icon: /* @__PURE__ */
|
|
1137
|
+
icon: /* @__PURE__ */ React13.createElement(Icon, { fontSize: "small", color: "action" })
|
|
1058
1138
|
}
|
|
1059
|
-
), /* @__PURE__ */
|
|
1139
|
+
), /* @__PURE__ */ React13.createElement(import_ui12.Box, { sx: { p: 1 } }, /* @__PURE__ */ React13.createElement(
|
|
1060
1140
|
StatusSection,
|
|
1061
1141
|
{
|
|
1062
1142
|
label: (0, import_i18n13.__)("Failed audits", "elementor"),
|
|
@@ -1064,13 +1144,13 @@ function CategoryPage({ category, report, onBack }) {
|
|
|
1064
1144
|
color: "error",
|
|
1065
1145
|
defaultExpanded: true
|
|
1066
1146
|
},
|
|
1067
|
-
failed.map((r) => /* @__PURE__ */
|
|
1068
|
-
), /* @__PURE__ */
|
|
1147
|
+
failed.map((r) => /* @__PURE__ */ React13.createElement(ViolationRow, { key: r.audit.id, audit: r.audit, violations: r.result.violations }))
|
|
1148
|
+
), /* @__PURE__ */ React13.createElement(StatusSection, { label: (0, import_i18n13.__)("Passed audits", "elementor"), count: passed.length, color: "success" }, passed.map((r) => /* @__PURE__ */ React13.createElement(ViolationRow, { key: r.audit.id, audit: r.audit })))));
|
|
1069
1149
|
}
|
|
1070
1150
|
|
|
1071
1151
|
// src/components/pages/issues-page.tsx
|
|
1072
|
-
var
|
|
1073
|
-
var
|
|
1152
|
+
var React17 = __toESM(require("react"));
|
|
1153
|
+
var import_ui16 = require("@elementor/ui");
|
|
1074
1154
|
var import_i18n17 = require("@wordpress/i18n");
|
|
1075
1155
|
|
|
1076
1156
|
// src/utils/severity-counts.ts
|
|
@@ -1123,14 +1203,14 @@ function severityRemainingCountLabel(severity, count) {
|
|
|
1123
1203
|
}
|
|
1124
1204
|
|
|
1125
1205
|
// src/components/issues-category-row.tsx
|
|
1126
|
-
var
|
|
1206
|
+
var React14 = __toESM(require("react"));
|
|
1127
1207
|
var import_icons9 = require("@elementor/icons");
|
|
1128
|
-
var
|
|
1208
|
+
var import_ui13 = require("@elementor/ui");
|
|
1129
1209
|
function IssuesCategoryRow({ category, label, counts, onClick }) {
|
|
1130
|
-
const isRtl = "rtl" === (0,
|
|
1210
|
+
const isRtl = "rtl" === (0, import_ui13.useTheme)().direction;
|
|
1131
1211
|
const Icon = CATEGORY_ICONS[category];
|
|
1132
|
-
return /* @__PURE__ */
|
|
1133
|
-
|
|
1212
|
+
return /* @__PURE__ */ React14.createElement(
|
|
1213
|
+
import_ui13.Box,
|
|
1134
1214
|
{
|
|
1135
1215
|
role: "button",
|
|
1136
1216
|
tabIndex: 0,
|
|
@@ -1151,16 +1231,16 @@ function IssuesCategoryRow({ category, label, counts, onClick }) {
|
|
|
1151
1231
|
"&:focus-visible": { outline: "2px solid", outlineColor: "primary.main" }
|
|
1152
1232
|
}
|
|
1153
1233
|
},
|
|
1154
|
-
/* @__PURE__ */
|
|
1155
|
-
/* @__PURE__ */
|
|
1156
|
-
/* @__PURE__ */
|
|
1157
|
-
/* @__PURE__ */
|
|
1234
|
+
/* @__PURE__ */ React14.createElement(Icon, { fontSize: "small", color: "action" }),
|
|
1235
|
+
/* @__PURE__ */ React14.createElement(import_ui13.Typography, { variant: "body2", fontWeight: "bold", sx: { flex: 1 } }, label),
|
|
1236
|
+
/* @__PURE__ */ React14.createElement(import_ui13.Box, { sx: { display: "flex", alignItems: "center", gap: 0.5 } }, ALL_SEVERITIES.filter((s) => counts[s] > 0).map((severity) => /* @__PURE__ */ React14.createElement(import_ui13.Box, { key: severity, sx: { display: "flex", alignItems: "center", gap: 0.25 } }, /* @__PURE__ */ React14.createElement(SeverityIcon, { severity }), /* @__PURE__ */ React14.createElement(import_ui13.Typography, { variant: "caption", color: "text.primary", fontWeight: "bold" }, counts[severity])))),
|
|
1237
|
+
/* @__PURE__ */ React14.createElement(import_ui13.Rotate, { in: isRtl }, /* @__PURE__ */ React14.createElement(import_icons9.ChevronRightIcon, { fontSize: "small", color: "action" }))
|
|
1158
1238
|
);
|
|
1159
1239
|
}
|
|
1160
1240
|
|
|
1161
1241
|
// src/components/promotions.tsx
|
|
1162
|
-
var
|
|
1163
|
-
var
|
|
1242
|
+
var React16 = __toESM(require("react"));
|
|
1243
|
+
var import_ui15 = require("@elementor/ui");
|
|
1164
1244
|
var import_i18n16 = require("@wordpress/i18n");
|
|
1165
1245
|
|
|
1166
1246
|
// src/register-promotions.ts
|
|
@@ -1225,11 +1305,11 @@ function findAuditRun(report, auditId) {
|
|
|
1225
1305
|
}
|
|
1226
1306
|
|
|
1227
1307
|
// src/components/promotion-card.tsx
|
|
1228
|
-
var
|
|
1229
|
-
var
|
|
1308
|
+
var React15 = __toESM(require("react"));
|
|
1309
|
+
var import_ui14 = require("@elementor/ui");
|
|
1230
1310
|
function PromotionCard({ ctaDisabled, ctaLabel, icon: Icon, onCtaClick, subtitle, title }) {
|
|
1231
|
-
return /* @__PURE__ */
|
|
1232
|
-
|
|
1311
|
+
return /* @__PURE__ */ React15.createElement(
|
|
1312
|
+
import_ui14.Box,
|
|
1233
1313
|
{
|
|
1234
1314
|
sx: {
|
|
1235
1315
|
alignItems: "center",
|
|
@@ -1242,9 +1322,9 @@ function PromotionCard({ ctaDisabled, ctaLabel, icon: Icon, onCtaClick, subtitle
|
|
|
1242
1322
|
py: 1.5
|
|
1243
1323
|
}
|
|
1244
1324
|
},
|
|
1245
|
-
/* @__PURE__ */
|
|
1246
|
-
/* @__PURE__ */
|
|
1247
|
-
/* @__PURE__ */
|
|
1325
|
+
/* @__PURE__ */ React15.createElement(Icon, { fontSize: "small", color: "action" }),
|
|
1326
|
+
/* @__PURE__ */ React15.createElement(import_ui14.Box, { sx: { display: "flex", flex: 1, flexDirection: "column", gap: 0.25, minWidth: 0 } }, /* @__PURE__ */ React15.createElement(import_ui14.Typography, { variant: "body2", fontWeight: "bold" }, title), /* @__PURE__ */ React15.createElement(import_ui14.Typography, { variant: "caption", color: "text.secondary" }, subtitle)),
|
|
1327
|
+
/* @__PURE__ */ React15.createElement(import_ui14.Button, { variant: "outlined", color: "secondary", size: "small", disabled: ctaDisabled, onClick: onCtaClick }, ctaLabel)
|
|
1248
1328
|
);
|
|
1249
1329
|
}
|
|
1250
1330
|
|
|
@@ -1273,7 +1353,7 @@ function Promotions({ report }) {
|
|
|
1273
1353
|
if (cards.length === 0) {
|
|
1274
1354
|
return null;
|
|
1275
1355
|
}
|
|
1276
|
-
return /* @__PURE__ */
|
|
1356
|
+
return /* @__PURE__ */ React16.createElement(React16.Fragment, null, /* @__PURE__ */ React16.createElement(import_ui15.Typography, { variant: "subtitle1", fontWeight: "bold" }, (0, import_i18n16.__)("Quick wins", "elementor")), /* @__PURE__ */ React16.createElement(import_ui15.Box, { sx: { display: "flex", flexDirection: "column", gap: 1 } }, cards.map(({ config, ctaUrl, key, run, subtitle }) => /* @__PURE__ */ React16.createElement(
|
|
1277
1357
|
PromotionCard,
|
|
1278
1358
|
{
|
|
1279
1359
|
key,
|
|
@@ -1294,8 +1374,8 @@ function Promotions({ report }) {
|
|
|
1294
1374
|
// src/components/pages/issues-page.tsx
|
|
1295
1375
|
function IssuesPage({ report, onCategoryClick, onAllAuditsClick }) {
|
|
1296
1376
|
const populatedCategories = getPopulatedCategories(report.categories, ALL_CATEGORIES);
|
|
1297
|
-
return /* @__PURE__ */
|
|
1298
|
-
|
|
1377
|
+
return /* @__PURE__ */ React17.createElement(import_ui16.Box, { sx: { display: "flex", flexDirection: "column", gap: 4, p: 2 } }, /* @__PURE__ */ React17.createElement(
|
|
1378
|
+
import_ui16.Link,
|
|
1299
1379
|
{
|
|
1300
1380
|
component: "button",
|
|
1301
1381
|
underline: "none",
|
|
@@ -1303,8 +1383,8 @@ function IssuesPage({ report, onCategoryClick, onAllAuditsClick }) {
|
|
|
1303
1383
|
onClick: onAllAuditsClick,
|
|
1304
1384
|
sx: { textAlign: "start" }
|
|
1305
1385
|
},
|
|
1306
|
-
/* @__PURE__ */
|
|
1307
|
-
), /* @__PURE__ */
|
|
1386
|
+
/* @__PURE__ */ React17.createElement(import_ui16.Typography, { variant: "subtitle1", component: "h2" }, (0, import_i18n17.__)("All issues", "elementor"))
|
|
1387
|
+
), /* @__PURE__ */ React17.createElement(import_ui16.Box, { sx: { display: "flex", flexDirection: "column", gap: 1 } }, populatedCategories.map((category) => /* @__PURE__ */ React17.createElement(
|
|
1308
1388
|
IssuesCategoryRow,
|
|
1309
1389
|
{
|
|
1310
1390
|
key: category,
|
|
@@ -1313,12 +1393,12 @@ function IssuesPage({ report, onCategoryClick, onAllAuditsClick }) {
|
|
|
1313
1393
|
counts: countSeverities(report, category),
|
|
1314
1394
|
onClick: () => onCategoryClick(category)
|
|
1315
1395
|
}
|
|
1316
|
-
))), /* @__PURE__ */
|
|
1396
|
+
))), /* @__PURE__ */ React17.createElement(Promotions, { report }));
|
|
1317
1397
|
}
|
|
1318
1398
|
|
|
1319
1399
|
// src/components/pages/overview-page.tsx
|
|
1320
|
-
var
|
|
1321
|
-
var
|
|
1400
|
+
var React21 = __toESM(require("react"));
|
|
1401
|
+
var import_ui20 = require("@elementor/ui");
|
|
1322
1402
|
var import_i18n19 = require("@wordpress/i18n");
|
|
1323
1403
|
|
|
1324
1404
|
// src/utils/score-thresholds.ts
|
|
@@ -1336,8 +1416,8 @@ function getScoreTier(score) {
|
|
|
1336
1416
|
}
|
|
1337
1417
|
|
|
1338
1418
|
// src/components/count-summary-circle.tsx
|
|
1339
|
-
var
|
|
1340
|
-
var
|
|
1419
|
+
var React18 = __toESM(require("react"));
|
|
1420
|
+
var import_ui17 = require("@elementor/ui");
|
|
1341
1421
|
var COUNT_SUMMARY_CIRCLE_SIZE = 64;
|
|
1342
1422
|
var COUNT_SUMMARY_BORDER_WIDTH = 4;
|
|
1343
1423
|
function chipBorderColor(theme, color) {
|
|
@@ -1347,8 +1427,8 @@ function chipBorderColor(theme, color) {
|
|
|
1347
1427
|
return theme.palette[color].main;
|
|
1348
1428
|
}
|
|
1349
1429
|
function CountSummaryCircle({ ariaLabel, color, count, label, onClick }) {
|
|
1350
|
-
return /* @__PURE__ */
|
|
1351
|
-
|
|
1430
|
+
return /* @__PURE__ */ React18.createElement(
|
|
1431
|
+
import_ui17.Box,
|
|
1352
1432
|
{
|
|
1353
1433
|
"aria-label": ariaLabel,
|
|
1354
1434
|
component: "button",
|
|
@@ -1366,8 +1446,8 @@ function CountSummaryCircle({ ariaLabel, color, count, label, onClick }) {
|
|
|
1366
1446
|
padding: 0
|
|
1367
1447
|
}
|
|
1368
1448
|
},
|
|
1369
|
-
/* @__PURE__ */
|
|
1370
|
-
|
|
1449
|
+
/* @__PURE__ */ React18.createElement(
|
|
1450
|
+
import_ui17.Chip,
|
|
1371
1451
|
{
|
|
1372
1452
|
color,
|
|
1373
1453
|
label: count,
|
|
@@ -1388,18 +1468,18 @@ function CountSummaryCircle({ ariaLabel, color, count, label, onClick }) {
|
|
|
1388
1468
|
})
|
|
1389
1469
|
}
|
|
1390
1470
|
),
|
|
1391
|
-
/* @__PURE__ */
|
|
1471
|
+
/* @__PURE__ */ React18.createElement(import_ui17.Typography, { color: "text.secondary", sx: { textAlign: "center" }, variant: "caption" }, label)
|
|
1392
1472
|
);
|
|
1393
1473
|
}
|
|
1394
1474
|
|
|
1395
1475
|
// src/components/score-bar.tsx
|
|
1396
|
-
var
|
|
1476
|
+
var React19 = __toESM(require("react"));
|
|
1397
1477
|
var import_icons11 = require("@elementor/icons");
|
|
1398
|
-
var
|
|
1478
|
+
var import_ui18 = require("@elementor/ui");
|
|
1399
1479
|
function ScoreBar({ label, score, onClick }) {
|
|
1400
|
-
const isRtl = "rtl" === (0,
|
|
1401
|
-
return /* @__PURE__ */
|
|
1402
|
-
|
|
1480
|
+
const isRtl = "rtl" === (0, import_ui18.useTheme)().direction;
|
|
1481
|
+
return /* @__PURE__ */ React19.createElement(
|
|
1482
|
+
import_ui18.Box,
|
|
1403
1483
|
{
|
|
1404
1484
|
role: onClick ? "button" : void 0,
|
|
1405
1485
|
tabIndex: onClick ? 0 : void 0,
|
|
@@ -1415,9 +1495,9 @@ function ScoreBar({ label, score, onClick }) {
|
|
|
1415
1495
|
py: 0.5
|
|
1416
1496
|
}
|
|
1417
1497
|
},
|
|
1418
|
-
/* @__PURE__ */
|
|
1419
|
-
/* @__PURE__ */
|
|
1420
|
-
|
|
1498
|
+
/* @__PURE__ */ React19.createElement(import_ui18.Typography, { variant: "body2", sx: { minWidth: 96 } }, label),
|
|
1499
|
+
/* @__PURE__ */ React19.createElement(
|
|
1500
|
+
import_ui18.LinearProgress,
|
|
1421
1501
|
{
|
|
1422
1502
|
variant: "determinate",
|
|
1423
1503
|
value: score,
|
|
@@ -1425,8 +1505,8 @@ function ScoreBar({ label, score, onClick }) {
|
|
|
1425
1505
|
sx: { flex: 1, height: 6, borderRadius: 4, bgcolor: "action.disabledBackground" }
|
|
1426
1506
|
}
|
|
1427
1507
|
),
|
|
1428
|
-
/* @__PURE__ */
|
|
1429
|
-
|
|
1508
|
+
/* @__PURE__ */ React19.createElement(
|
|
1509
|
+
import_ui18.Typography,
|
|
1430
1510
|
{
|
|
1431
1511
|
variant: "body2",
|
|
1432
1512
|
color: "text.primary",
|
|
@@ -1434,19 +1514,19 @@ function ScoreBar({ label, score, onClick }) {
|
|
|
1434
1514
|
},
|
|
1435
1515
|
score
|
|
1436
1516
|
),
|
|
1437
|
-
onClick && /* @__PURE__ */
|
|
1517
|
+
onClick && /* @__PURE__ */ React19.createElement(import_ui18.Rotate, { in: isRtl }, /* @__PURE__ */ React19.createElement(import_icons11.ChevronRightIcon, { fontSize: "small", color: "action" }))
|
|
1438
1518
|
);
|
|
1439
1519
|
}
|
|
1440
1520
|
|
|
1441
1521
|
// src/components/score-circle.tsx
|
|
1442
|
-
var
|
|
1443
|
-
var
|
|
1522
|
+
var React20 = __toESM(require("react"));
|
|
1523
|
+
var import_ui19 = require("@elementor/ui");
|
|
1444
1524
|
var SCORE_CIRCLE_SIZE = 88;
|
|
1445
1525
|
var SCORE_CIRCLE_THICKNESS = 3;
|
|
1446
1526
|
function ScoreCircle({ color, score }) {
|
|
1447
1527
|
const progressColor = color ?? getScoreTier(score).color;
|
|
1448
|
-
return /* @__PURE__ */
|
|
1449
|
-
|
|
1528
|
+
return /* @__PURE__ */ React20.createElement(
|
|
1529
|
+
import_ui19.Box,
|
|
1450
1530
|
{
|
|
1451
1531
|
role: "progressbar",
|
|
1452
1532
|
"aria-valuenow": score,
|
|
@@ -1454,8 +1534,8 @@ function ScoreCircle({ color, score }) {
|
|
|
1454
1534
|
"aria-valuemax": 100,
|
|
1455
1535
|
sx: { position: "relative", display: "inline-flex" }
|
|
1456
1536
|
},
|
|
1457
|
-
/* @__PURE__ */
|
|
1458
|
-
|
|
1537
|
+
/* @__PURE__ */ React20.createElement(
|
|
1538
|
+
import_ui19.CircularProgress,
|
|
1459
1539
|
{
|
|
1460
1540
|
variant: "determinate",
|
|
1461
1541
|
value: 100,
|
|
@@ -1464,8 +1544,8 @@ function ScoreCircle({ color, score }) {
|
|
|
1464
1544
|
sx: { color: "action.disabledBackground" }
|
|
1465
1545
|
}
|
|
1466
1546
|
),
|
|
1467
|
-
/* @__PURE__ */
|
|
1468
|
-
|
|
1547
|
+
/* @__PURE__ */ React20.createElement(
|
|
1548
|
+
import_ui19.CircularProgress,
|
|
1469
1549
|
{
|
|
1470
1550
|
variant: "determinate",
|
|
1471
1551
|
value: score,
|
|
@@ -1475,8 +1555,8 @@ function ScoreCircle({ color, score }) {
|
|
|
1475
1555
|
sx: { position: "absolute", left: 0 }
|
|
1476
1556
|
}
|
|
1477
1557
|
),
|
|
1478
|
-
/* @__PURE__ */
|
|
1479
|
-
|
|
1558
|
+
/* @__PURE__ */ React20.createElement(
|
|
1559
|
+
import_ui19.Box,
|
|
1480
1560
|
{
|
|
1481
1561
|
sx: {
|
|
1482
1562
|
position: "absolute",
|
|
@@ -1486,8 +1566,8 @@ function ScoreCircle({ color, score }) {
|
|
|
1486
1566
|
justifyContent: "center"
|
|
1487
1567
|
}
|
|
1488
1568
|
},
|
|
1489
|
-
/* @__PURE__ */
|
|
1490
|
-
|
|
1569
|
+
/* @__PURE__ */ React20.createElement(
|
|
1570
|
+
import_ui19.Typography,
|
|
1491
1571
|
{
|
|
1492
1572
|
variant: "h4",
|
|
1493
1573
|
component: "span",
|
|
@@ -1524,8 +1604,8 @@ function OverviewPage({ onCategoryClick, onStatusClick, report }) {
|
|
|
1524
1604
|
const severityCounts = countSeverities(report);
|
|
1525
1605
|
const statusCounts = auditStatusDisplayCounts(report);
|
|
1526
1606
|
const overallScore = getScoreTier(report.overall);
|
|
1527
|
-
return /* @__PURE__ */
|
|
1528
|
-
|
|
1607
|
+
return /* @__PURE__ */ React21.createElement(import_ui20.Box, { sx: { display: "flex", flexDirection: "column", gap: 4, p: 2 } }, /* @__PURE__ */ React21.createElement(import_ui20.Box, { sx: { display: "flex", alignItems: "center", gap: 2 } }, /* @__PURE__ */ React21.createElement(ScoreCircle, { color: overallScore.color, score: report.overall }), /* @__PURE__ */ React21.createElement(import_ui20.Box, { sx: { display: "flex", flexDirection: "column", gap: 0.5 } }, /* @__PURE__ */ React21.createElement(
|
|
1608
|
+
import_ui20.Chip,
|
|
1529
1609
|
{
|
|
1530
1610
|
label: overallScore.label,
|
|
1531
1611
|
color: overallScore.color,
|
|
@@ -1533,7 +1613,7 @@ function OverviewPage({ onCategoryClick, onStatusClick, report }) {
|
|
|
1533
1613
|
size: "small",
|
|
1534
1614
|
sx: { fontWeight: 600, alignSelf: "flex-start" }
|
|
1535
1615
|
}
|
|
1536
|
-
), /* @__PURE__ */
|
|
1616
|
+
), /* @__PURE__ */ React21.createElement(import_ui20.Typography, { variant: "body2", color: "text.secondary" }, (0, import_i18n19.__)("Overall score", "elementor")))), /* @__PURE__ */ React21.createElement(import_ui20.Box, { sx: { display: "flex", flexDirection: "column", gap: 2 } }, populatedCategories.map((category) => /* @__PURE__ */ React21.createElement(
|
|
1537
1617
|
ScoreBar,
|
|
1538
1618
|
{
|
|
1539
1619
|
key: category,
|
|
@@ -1541,7 +1621,7 @@ function OverviewPage({ onCategoryClick, onStatusClick, report }) {
|
|
|
1541
1621
|
score: report.categories[category].score,
|
|
1542
1622
|
onClick: () => onCategoryClick(category)
|
|
1543
1623
|
}
|
|
1544
|
-
))), /* @__PURE__ */
|
|
1624
|
+
))), /* @__PURE__ */ React21.createElement(import_ui20.Divider, null), /* @__PURE__ */ React21.createElement(import_ui20.Typography, { variant: "subtitle1", fontWeight: "bold" }, (0, import_i18n19.__)("Audit statuses", "elementor")), /* @__PURE__ */ React21.createElement(import_ui20.Box, { sx: { display: "flex", justifyContent: "space-around", gap: 2 } }, STATUS_GROUPS.map((status) => /* @__PURE__ */ React21.createElement(
|
|
1545
1625
|
CountSummaryCircle,
|
|
1546
1626
|
{
|
|
1547
1627
|
key: status,
|
|
@@ -1551,8 +1631,8 @@ function OverviewPage({ onCategoryClick, onStatusClick, report }) {
|
|
|
1551
1631
|
label: auditStatusLabel(status),
|
|
1552
1632
|
onClick: () => onStatusClick(status)
|
|
1553
1633
|
}
|
|
1554
|
-
))), /* @__PURE__ */
|
|
1555
|
-
|
|
1634
|
+
))), /* @__PURE__ */ React21.createElement(import_ui20.Divider, null), /* @__PURE__ */ React21.createElement(import_ui20.Typography, { variant: "subtitle1", fontWeight: "bold" }, (0, import_i18n19.__)("Remaining issues", "elementor")), /* @__PURE__ */ React21.createElement(
|
|
1635
|
+
import_ui20.Box,
|
|
1556
1636
|
{
|
|
1557
1637
|
component: "ul",
|
|
1558
1638
|
sx: {
|
|
@@ -1566,17 +1646,17 @@ function OverviewPage({ onCategoryClick, onStatusClick, report }) {
|
|
|
1566
1646
|
},
|
|
1567
1647
|
ALL_SEVERITIES.map((severity) => {
|
|
1568
1648
|
const count = severityCounts[severity];
|
|
1569
|
-
return /* @__PURE__ */
|
|
1570
|
-
|
|
1649
|
+
return /* @__PURE__ */ React21.createElement(
|
|
1650
|
+
import_ui20.Box,
|
|
1571
1651
|
{
|
|
1572
1652
|
"aria-label": severityRemainingCountLabel(severity, count),
|
|
1573
1653
|
component: "li",
|
|
1574
1654
|
key: severity,
|
|
1575
1655
|
sx: { alignItems: "center", display: "flex", gap: 0.5 }
|
|
1576
1656
|
},
|
|
1577
|
-
/* @__PURE__ */
|
|
1578
|
-
/* @__PURE__ */
|
|
1579
|
-
/* @__PURE__ */
|
|
1657
|
+
/* @__PURE__ */ React21.createElement(SeverityIcon, { severity }),
|
|
1658
|
+
/* @__PURE__ */ React21.createElement(import_ui20.Typography, { variant: "body2", fontWeight: "bold" }, count),
|
|
1659
|
+
/* @__PURE__ */ React21.createElement(import_ui20.Typography, { variant: "body2" }, severityPluralLabel(severity))
|
|
1580
1660
|
);
|
|
1581
1661
|
})
|
|
1582
1662
|
));
|
|
@@ -1615,8 +1695,8 @@ function ReportShell({ report }) {
|
|
|
1615
1695
|
setActivePage(activePage.backTo);
|
|
1616
1696
|
}
|
|
1617
1697
|
};
|
|
1618
|
-
return /* @__PURE__ */
|
|
1619
|
-
|
|
1698
|
+
return /* @__PURE__ */ React22.createElement(import_ui21.Box, null, /* @__PURE__ */ React22.createElement(
|
|
1699
|
+
import_ui21.Tabs,
|
|
1620
1700
|
{
|
|
1621
1701
|
"aria-label": (0, import_i18n20.__)("Audit navigation", "elementor"),
|
|
1622
1702
|
value: currentTab,
|
|
@@ -1627,30 +1707,30 @@ function ReportShell({ report }) {
|
|
|
1627
1707
|
centered: true,
|
|
1628
1708
|
variant: "fullWidth"
|
|
1629
1709
|
},
|
|
1630
|
-
/* @__PURE__ */
|
|
1631
|
-
/* @__PURE__ */
|
|
1632
|
-
), /* @__PURE__ */
|
|
1710
|
+
/* @__PURE__ */ React22.createElement(import_ui21.Tab, { value: "overview", label: (0, import_i18n20.__)("Overview", "elementor") }),
|
|
1711
|
+
/* @__PURE__ */ React22.createElement(import_ui21.Tab, { value: "issues", label: (0, import_i18n20.__)("Issues", "elementor") })
|
|
1712
|
+
), /* @__PURE__ */ React22.createElement(import_ui21.Divider, null), activePage === "overview" && /* @__PURE__ */ React22.createElement(
|
|
1633
1713
|
OverviewPage,
|
|
1634
1714
|
{
|
|
1635
1715
|
report,
|
|
1636
1716
|
onCategoryClick: (category) => openCategory(category, "overview"),
|
|
1637
1717
|
onStatusClick: (status) => openAllAudits(status, "overview")
|
|
1638
1718
|
}
|
|
1639
|
-
), activePage === "issues" && /* @__PURE__ */
|
|
1719
|
+
), activePage === "issues" && /* @__PURE__ */ React22.createElement(
|
|
1640
1720
|
IssuesPage,
|
|
1641
1721
|
{
|
|
1642
1722
|
report,
|
|
1643
1723
|
onCategoryClick: (category) => openCategory(category, "issues"),
|
|
1644
1724
|
onAllAuditsClick: () => openAllAudits()
|
|
1645
1725
|
}
|
|
1646
|
-
), isAllAuditsPage(activePage) && /* @__PURE__ */
|
|
1726
|
+
), isAllAuditsPage(activePage) && /* @__PURE__ */ React22.createElement(
|
|
1647
1727
|
AllAuditsPage,
|
|
1648
1728
|
{
|
|
1649
1729
|
report,
|
|
1650
1730
|
initialExpandedStatus: activePage.expand,
|
|
1651
1731
|
onBack: backFromSubPage
|
|
1652
1732
|
}
|
|
1653
|
-
), isCategoryPage(activePage) && /* @__PURE__ */
|
|
1733
|
+
), isCategoryPage(activePage) && /* @__PURE__ */ React22.createElement(CategoryPage, { category: activePage.category, report, onBack: backFromSubPage }));
|
|
1654
1734
|
}
|
|
1655
1735
|
|
|
1656
1736
|
// src/components/audit-panel.tsx
|
|
@@ -1659,7 +1739,7 @@ function AuditPanel() {
|
|
|
1659
1739
|
const currentDocumentId = (0, import_editor_elements5.getCurrentDocumentId)() ?? 0;
|
|
1660
1740
|
const onRun = () => run(currentDocumentId);
|
|
1661
1741
|
const lastScanLabel = report ? new Date(report.runAt).toLocaleTimeString() : null;
|
|
1662
|
-
return /* @__PURE__ */
|
|
1742
|
+
return /* @__PURE__ */ React23.createElement(React23.Fragment, null, /* @__PURE__ */ React23.createElement(
|
|
1663
1743
|
import_editor_floating_panels.FloatingPanelHeader,
|
|
1664
1744
|
{
|
|
1665
1745
|
panelId: "audit-panel",
|
|
@@ -1667,8 +1747,8 @@ function AuditPanel() {
|
|
|
1667
1747
|
badge: (0, import_i18n21.__)("Beta", "elementor"),
|
|
1668
1748
|
titleVariant: "subtitle2"
|
|
1669
1749
|
}
|
|
1670
|
-
), /* @__PURE__ */
|
|
1671
|
-
|
|
1750
|
+
), /* @__PURE__ */ React23.createElement(import_editor_floating_panels.FloatingPanelBody, null, status === "idle" && /* @__PURE__ */ React23.createElement(WelcomePage, null), status === "loading" && /* @__PURE__ */ React23.createElement(LoadingPage, null), status === "error" && /* @__PURE__ */ React23.createElement(ErrorPage, { message: error ?? "", onRetry: onRun }), status === "ready" && report && /* @__PURE__ */ React23.createElement(ReportShell, { report })), /* @__PURE__ */ React23.createElement(import_editor_floating_panels.FloatingPanelFooter, null, lastScanLabel ? /* @__PURE__ */ React23.createElement(import_ui22.Typography, { variant: "caption", sx: { flex: 1 } }, (0, import_i18n21.__)("Last scan:", "elementor"), " ", lastScanLabel) : /* @__PURE__ */ React23.createElement(import_ui22.Box, { sx: { flex: 1 } }), lastScanLabel && /* @__PURE__ */ React23.createElement(AuditFeedback, null), /* @__PURE__ */ React23.createElement(
|
|
1751
|
+
import_ui22.Button,
|
|
1672
1752
|
{
|
|
1673
1753
|
variant: "contained",
|
|
1674
1754
|
size: "small",
|
|
@@ -2615,7 +2695,8 @@ var audit16 = {
|
|
|
2615
2695
|
{
|
|
2616
2696
|
auditId: audit16.id,
|
|
2617
2697
|
label: (0, import_i18n38.__)("No privacy policy page is set.", "elementor"),
|
|
2618
|
-
externalUrl: ctx.pageContext.privacy_settings_url
|
|
2698
|
+
externalUrl: ctx.pageContext.privacy_settings_url,
|
|
2699
|
+
ctaLabel: (0, import_i18n38.__)("Create", "elementor")
|
|
2619
2700
|
}
|
|
2620
2701
|
]
|
|
2621
2702
|
};
|