@elementor/editor-audits 4.5.0-1150 → 4.5.0-1153
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 +261 -59
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +247 -45
- package/dist/index.mjs.map +1 -1
- package/package.json +16 -15
- package/src/audits/accessibility-statement.ts +1 -0
- package/src/audits/accessibility-widget.ts +1 -0
- package/src/audits/cookie-policy.ts +1 -0
- package/src/audits/google-consent-mode.ts +1 -0
- package/src/audits/images-alt-text.ts +1 -0
- package/src/audits/images-inefficient-format.ts +1 -0
- package/src/audits/images-too-large.ts +1 -0
- package/src/audits/scan-for-cookies.ts +1 -0
- package/src/components/audit-panel.tsx +6 -1
- package/src/components/fix-violation-with-angie.tsx +10 -1
- package/src/components/promotions.tsx +9 -2
- package/src/components/violation-cta-button.tsx +9 -1
- package/src/components/violation-row.tsx +28 -4
- package/src/constants.ts +13 -0
- package/src/hooks/focus-violation.ts +9 -5
- package/src/hooks/use-audit-report.ts +6 -1
- package/src/hooks/use-track-panel-viewed.ts +31 -0
- package/src/types.ts +1 -0
- package/src/utils/build-run-summary.ts +45 -0
- package/src/utils/tracking-names.ts +12 -0
- package/src/utils/tracking.ts +130 -0
package/dist/index.mjs
CHANGED
|
@@ -92,7 +92,7 @@ import { createFloatingPanel } from "@elementor/editor-floating-panels";
|
|
|
92
92
|
|
|
93
93
|
// src/components/audit-panel.tsx
|
|
94
94
|
import * as React21 from "react";
|
|
95
|
-
import { getHostDocumentId as
|
|
95
|
+
import { getHostDocumentId as getHostDocumentId4 } from "@elementor/editor-elements";
|
|
96
96
|
import { FloatingPanelBody, FloatingPanelFooter, FloatingPanelHeader } from "@elementor/editor-floating-panels";
|
|
97
97
|
import { Box as Box15, Typography as Typography12 } from "@elementor/ui";
|
|
98
98
|
import { __ as __17 } from "@wordpress/i18n";
|
|
@@ -109,6 +109,16 @@ var FEEDBACK_CLICKED_EVENT = "audit_feedback_clicked";
|
|
|
109
109
|
var FEEDBACK_SENT_EVENT = "audit_feedback_sent";
|
|
110
110
|
var FEEDBACK_CANCELLED_EVENT = "audit_feedback_cancelled";
|
|
111
111
|
var FEEDBACK_CLOSED_EVENT = "audit_feedback_closed";
|
|
112
|
+
var PANEL_VIEWED_EVENT = "page_audit_panel_viewed";
|
|
113
|
+
var PANEL_CLOSED_EVENT = "page_audit_panel_closed";
|
|
114
|
+
var RUN_STARTED_EVENT = "page_audit_run_started";
|
|
115
|
+
var RUN_COMPLETED_EVENT = "page_audit_run_completed";
|
|
116
|
+
var FINDING_CLICKED_EVENT = "page_audit_finding_clicked";
|
|
117
|
+
var TRACKING_WINDOW_NAME = "page_audit";
|
|
118
|
+
var TRACKING_TARGET_LOCATION = "panel";
|
|
119
|
+
var TRACKING_LOCATION_L1 = "audit_panel";
|
|
120
|
+
var FIRST_OPEN_MESSAGE_KEY = "page-audit-panel-opened";
|
|
121
|
+
var AUDIT_ID_PREFIX = "audits/";
|
|
112
122
|
var ALL_CATEGORIES = [
|
|
113
123
|
"best-practices",
|
|
114
124
|
"seo",
|
|
@@ -636,13 +646,125 @@ function persistReport(documentId, report) {
|
|
|
636
646
|
setSessionStorageItem(getStorageKey(documentId), report);
|
|
637
647
|
}
|
|
638
648
|
|
|
649
|
+
// src/utils/tracking.ts
|
|
650
|
+
import { getMixpanel } from "@elementor/events";
|
|
651
|
+
|
|
652
|
+
// src/utils/tracking-names.ts
|
|
653
|
+
function toTrackingSeverity(severity) {
|
|
654
|
+
return severity === "info" ? "suggestion" : severity;
|
|
655
|
+
}
|
|
656
|
+
function toCheckName(auditId) {
|
|
657
|
+
return auditId.replace(AUDIT_ID_PREFIX, "").replace(/-/g, "_");
|
|
658
|
+
}
|
|
659
|
+
|
|
660
|
+
// src/utils/build-run-summary.ts
|
|
661
|
+
var SEVERITY_PRIORITY = ["error", "warning", "suggestion"];
|
|
662
|
+
function buildRunSummary(report) {
|
|
663
|
+
const requiredFixes = report.auditResults.filter(({ audit: audit25, result }) => result.status === "fail" && isScoredAudit(audit25)).map(({ audit: audit25 }) => ({ check: toCheckName(audit25.id), severity: toTrackingSeverity(audit25.severity) }));
|
|
664
|
+
const countBySeverity = (severity) => requiredFixes.filter((fix) => fix.severity === severity).length;
|
|
665
|
+
const highestSeverity = SEVERITY_PRIORITY.find((severity) => countBySeverity(severity) > 0);
|
|
666
|
+
return {
|
|
667
|
+
state: highestSeverity ?? "success",
|
|
668
|
+
metadata: {
|
|
669
|
+
score: report.overall,
|
|
670
|
+
fix_count: requiredFixes.length,
|
|
671
|
+
error_count: countBySeverity("error"),
|
|
672
|
+
warning_count: countBySeverity("warning"),
|
|
673
|
+
suggestion_count: countBySeverity("suggestion"),
|
|
674
|
+
required_fixes: requiredFixes
|
|
675
|
+
}
|
|
676
|
+
};
|
|
677
|
+
}
|
|
678
|
+
|
|
679
|
+
// src/utils/tracking.ts
|
|
680
|
+
var dispatch = (eventName, payload) => {
|
|
681
|
+
getMixpanel().dispatchEvent?.(eventName, {
|
|
682
|
+
window_name: TRACKING_WINDOW_NAME,
|
|
683
|
+
target_location: TRACKING_TARGET_LOCATION,
|
|
684
|
+
location_l1: TRACKING_LOCATION_L1,
|
|
685
|
+
...payload
|
|
686
|
+
});
|
|
687
|
+
};
|
|
688
|
+
var trackPanelViewed = ({
|
|
689
|
+
hasPriorReport,
|
|
690
|
+
isFirstOpen
|
|
691
|
+
}) => {
|
|
692
|
+
dispatch(PANEL_VIEWED_EVENT, {
|
|
693
|
+
interaction_type: "view",
|
|
694
|
+
target_type: "panel",
|
|
695
|
+
target_name: "page_audit_panel",
|
|
696
|
+
interaction_result: "panel_viewed",
|
|
697
|
+
metadata: { has_prior_report: hasPriorReport, is_first_open: isFirstOpen }
|
|
698
|
+
});
|
|
699
|
+
};
|
|
700
|
+
var trackPanelClosed = () => {
|
|
701
|
+
dispatch(PANEL_CLOSED_EVENT, {
|
|
702
|
+
interaction_type: "click",
|
|
703
|
+
target_type: "button",
|
|
704
|
+
target_name: "close",
|
|
705
|
+
interaction_result: "panel_closed"
|
|
706
|
+
});
|
|
707
|
+
};
|
|
708
|
+
var trackRunStarted = (trigger) => {
|
|
709
|
+
dispatch(RUN_STARTED_EVENT, {
|
|
710
|
+
interaction_type: "click",
|
|
711
|
+
target_type: "button",
|
|
712
|
+
target_name: trigger,
|
|
713
|
+
interaction_result: "run_initiated"
|
|
714
|
+
});
|
|
715
|
+
};
|
|
716
|
+
var trackRunOutcome = (interactionResult, details) => {
|
|
717
|
+
dispatch(RUN_COMPLETED_EVENT, {
|
|
718
|
+
interaction_type: "view",
|
|
719
|
+
target_type: "report",
|
|
720
|
+
target_name: "audit_report",
|
|
721
|
+
interaction_result: interactionResult,
|
|
722
|
+
...details
|
|
723
|
+
});
|
|
724
|
+
};
|
|
725
|
+
var trackRunCompleted = (report) => {
|
|
726
|
+
const { state, metadata } = buildRunSummary(report);
|
|
727
|
+
trackRunOutcome("run_completed", { state, metadata });
|
|
728
|
+
};
|
|
729
|
+
var trackRunFailed = () => {
|
|
730
|
+
trackRunOutcome("run_failed", {});
|
|
731
|
+
};
|
|
732
|
+
var trackFixWithApp = (audit25, violation, locationL2) => {
|
|
733
|
+
if (violation.appInstalled === void 0) {
|
|
734
|
+
return;
|
|
735
|
+
}
|
|
736
|
+
trackFindingClicked({
|
|
737
|
+
audit: audit25,
|
|
738
|
+
locationL2,
|
|
739
|
+
actionType: "fix_with_app",
|
|
740
|
+
interactionResult: "app_opened",
|
|
741
|
+
appInstalled: violation.appInstalled
|
|
742
|
+
});
|
|
743
|
+
};
|
|
744
|
+
var trackFindingClicked = (click) => {
|
|
745
|
+
const { audit: audit25, locationL2, actionType, interactionResult } = click;
|
|
746
|
+
dispatch(FINDING_CLICKED_EVENT, {
|
|
747
|
+
interaction_type: "click",
|
|
748
|
+
target_type: "row",
|
|
749
|
+
target_name: "finding_row",
|
|
750
|
+
action_type: actionType,
|
|
751
|
+
target_value: toCheckName(audit25.id),
|
|
752
|
+
interaction_result: interactionResult,
|
|
753
|
+
state: toTrackingSeverity(audit25.severity),
|
|
754
|
+
location_l2: locationL2,
|
|
755
|
+
...click.actionType === "fix_with_app" && {
|
|
756
|
+
app_status: click.appInstalled ? "installed" : "not_installed"
|
|
757
|
+
}
|
|
758
|
+
});
|
|
759
|
+
};
|
|
760
|
+
|
|
639
761
|
// src/hooks/use-audit-report.ts
|
|
640
762
|
function useAuditReport() {
|
|
641
763
|
const status = useSelector2((state) => selectStatus(state));
|
|
642
764
|
const report = useSelector2((state) => selectReport(state));
|
|
643
765
|
const error = useSelector2((state) => selectError(state));
|
|
644
766
|
const isStale = useSelector2((state) => selectIsStale(state));
|
|
645
|
-
const
|
|
767
|
+
const dispatch3 = useDispatch();
|
|
646
768
|
const documentId = getHostDocumentId2() ?? 0;
|
|
647
769
|
useEffect(() => {
|
|
648
770
|
if (!documentId || report?.documentId === documentId) {
|
|
@@ -650,31 +772,59 @@ function useAuditReport() {
|
|
|
650
772
|
}
|
|
651
773
|
const persisted = getPersistedReport(documentId);
|
|
652
774
|
if (persisted) {
|
|
653
|
-
|
|
775
|
+
dispatch3(slice.actions.reportRestored(persisted));
|
|
654
776
|
} else if (report) {
|
|
655
|
-
|
|
777
|
+
dispatch3(slice.actions.reportCleared());
|
|
656
778
|
}
|
|
657
|
-
}, [documentId, report,
|
|
658
|
-
const run = async (documentIdToRun) => {
|
|
659
|
-
|
|
779
|
+
}, [documentId, report, dispatch3]);
|
|
780
|
+
const run = async (documentIdToRun, trigger) => {
|
|
781
|
+
dispatch3(slice.actions.runStarted());
|
|
782
|
+
trackRunStarted(trigger);
|
|
660
783
|
try {
|
|
661
784
|
const nextReport = await runPageAudit(documentIdToRun);
|
|
662
|
-
|
|
785
|
+
dispatch3(slice.actions.runSucceeded(nextReport));
|
|
663
786
|
persistReport(documentIdToRun, nextReport);
|
|
787
|
+
trackRunCompleted(nextReport);
|
|
664
788
|
} catch (e) {
|
|
665
789
|
if (e instanceof SessionExpiredError) {
|
|
666
|
-
|
|
790
|
+
dispatch3(slice.actions.runAborted());
|
|
791
|
+
trackRunFailed();
|
|
667
792
|
return;
|
|
668
793
|
}
|
|
669
|
-
|
|
794
|
+
dispatch3(slice.actions.runFailed(e instanceof Error ? e.message : "Unknown error"));
|
|
795
|
+
trackRunFailed();
|
|
670
796
|
}
|
|
671
797
|
};
|
|
672
798
|
return { status, report, error, isStale, run };
|
|
673
799
|
}
|
|
674
800
|
|
|
801
|
+
// src/hooks/use-track-panel-viewed.ts
|
|
802
|
+
import { useEffect as useEffect2, useRef, useState } from "react";
|
|
803
|
+
import { useCurrentUser, useSuppressedMessage } from "@elementor/editor-current-user";
|
|
804
|
+
import { getHostDocumentId as getHostDocumentId3 } from "@elementor/editor-elements";
|
|
805
|
+
import { __useSelector as useSelector3 } from "@elementor/store";
|
|
806
|
+
function useTrackPanelViewed() {
|
|
807
|
+
const { data: currentUser } = useCurrentUser();
|
|
808
|
+
const [isFirstOpenMessageSuppressed, suppressFirstOpenMessage] = useSuppressedMessage(FIRST_OPEN_MESSAGE_KEY);
|
|
809
|
+
const report = useSelector3((state) => selectReport(state));
|
|
810
|
+
const [hasPriorReport] = useState(() => {
|
|
811
|
+
const documentId = getHostDocumentId3() ?? 0;
|
|
812
|
+
return Boolean(report) || Boolean(documentId && getPersistedReport(documentId));
|
|
813
|
+
});
|
|
814
|
+
const hasTracked = useRef(false);
|
|
815
|
+
useEffect2(() => {
|
|
816
|
+
if (!currentUser || hasTracked.current) {
|
|
817
|
+
return;
|
|
818
|
+
}
|
|
819
|
+
hasTracked.current = true;
|
|
820
|
+
trackPanelViewed({ hasPriorReport, isFirstOpen: !isFirstOpenMessageSuppressed });
|
|
821
|
+
suppressFirstOpenMessage();
|
|
822
|
+
}, [currentUser, hasPriorReport, isFirstOpenMessageSuppressed, suppressFirstOpenMessage]);
|
|
823
|
+
}
|
|
824
|
+
|
|
675
825
|
// src/components/audit-feedback.tsx
|
|
676
826
|
import * as React2 from "react";
|
|
677
|
-
import { useState } from "react";
|
|
827
|
+
import { useState as useState2 } from "react";
|
|
678
828
|
import { useFloatingPanelZIndex } from "@elementor/editor-floating-panels";
|
|
679
829
|
import { notify } from "@elementor/editor-notifications";
|
|
680
830
|
import { isExperimentActive } from "@elementor/editor-v1-adapters";
|
|
@@ -713,9 +863,9 @@ var notifyError = () => notify({
|
|
|
713
863
|
message: __2("Something went wrong. Please try sending your feedback again.", "elementor")
|
|
714
864
|
});
|
|
715
865
|
function AuditFeedback() {
|
|
716
|
-
const [isOpen, setIsOpen] =
|
|
717
|
-
const [feedbackText, setFeedbackText] =
|
|
718
|
-
const [isSubmitting, setIsSubmitting] =
|
|
866
|
+
const [isOpen, setIsOpen] = useState2(false);
|
|
867
|
+
const [feedbackText, setFeedbackText] = useState2("");
|
|
868
|
+
const [isSubmitting, setIsSubmitting] = useState2(false);
|
|
719
869
|
const { dispatchEvent: trackEvent = (...args) => void args } = useMixpanel();
|
|
720
870
|
const panelZIndex = useFloatingPanelZIndex(AUDIT_PANEL_ID);
|
|
721
871
|
if (!isExperimentActive(FEEDBACK_EXPERIMENT_NAME)) {
|
|
@@ -854,7 +1004,7 @@ function WelcomePage() {
|
|
|
854
1004
|
|
|
855
1005
|
// src/components/report-shell.tsx
|
|
856
1006
|
import * as React19 from "react";
|
|
857
|
-
import { useState as
|
|
1007
|
+
import { useState as useState5 } from "react";
|
|
858
1008
|
import { Box as Box14 } from "@elementor/ui";
|
|
859
1009
|
|
|
860
1010
|
// src/components/pages/category-page.tsx
|
|
@@ -863,9 +1013,9 @@ import { Box as Box8 } from "@elementor/ui";
|
|
|
863
1013
|
import { __ as __11 } from "@wordpress/i18n";
|
|
864
1014
|
|
|
865
1015
|
// src/hooks/use-single-expanded-card.ts
|
|
866
|
-
import { useState as
|
|
1016
|
+
import { useState as useState3 } from "react";
|
|
867
1017
|
function useSingleExpandedCard(initialId = null) {
|
|
868
|
-
const [expandedId, setExpandedId] =
|
|
1018
|
+
const [expandedId, setExpandedId] = useState3(initialId);
|
|
869
1019
|
const toggle = (id) => {
|
|
870
1020
|
setExpandedId((current) => current === id ? null : id);
|
|
871
1021
|
};
|
|
@@ -884,12 +1034,12 @@ var CATEGORY_ICONS = {
|
|
|
884
1034
|
|
|
885
1035
|
// src/components/status-section.tsx
|
|
886
1036
|
import * as React6 from "react";
|
|
887
|
-
import { useState as
|
|
1037
|
+
import { useState as useState4 } from "react";
|
|
888
1038
|
import { ChevronDownIcon } from "@elementor/icons";
|
|
889
1039
|
import { Box as Box4, Chip, Collapse, IconButton as IconButton2 } from "@elementor/ui";
|
|
890
1040
|
import { __ as __6 } from "@wordpress/i18n";
|
|
891
1041
|
function StatusSection({ label, count, color = "default", defaultExpanded = false, children }) {
|
|
892
|
-
const [expanded, setExpanded] =
|
|
1042
|
+
const [expanded, setExpanded] = useState4(defaultExpanded);
|
|
893
1043
|
if (React6.Children.count(children) === 0) {
|
|
894
1044
|
return null;
|
|
895
1045
|
}
|
|
@@ -955,25 +1105,27 @@ function focusViolation(violation) {
|
|
|
955
1105
|
if (violation.targetHint === "element-settings") {
|
|
956
1106
|
runCommand("panel/editor/open");
|
|
957
1107
|
}
|
|
958
|
-
return;
|
|
1108
|
+
return container ? "element_focused" : null;
|
|
959
1109
|
}
|
|
960
1110
|
if (violation.externalUrl) {
|
|
961
1111
|
window.open(violation.externalUrl, "_blank");
|
|
962
|
-
return;
|
|
1112
|
+
return "external_url_opened";
|
|
963
1113
|
}
|
|
964
1114
|
if (violation.targetHint === "page-settings") {
|
|
965
1115
|
openRoute("panel/page-settings/settings");
|
|
966
|
-
return;
|
|
1116
|
+
return "page_settings_opened";
|
|
967
1117
|
}
|
|
968
1118
|
if (violation.targetHint === "site-settings") {
|
|
969
1119
|
runCommand("panel/global/open");
|
|
970
|
-
return;
|
|
1120
|
+
return "site_settings_opened";
|
|
971
1121
|
}
|
|
972
1122
|
if (violation.targetHint === "site-identity-settings") {
|
|
973
1123
|
void runCommand("panel/global/open").then(() => {
|
|
974
1124
|
openRoute("panel/global/settings-site-identity");
|
|
975
1125
|
});
|
|
1126
|
+
return "site_settings_opened";
|
|
976
1127
|
}
|
|
1128
|
+
return null;
|
|
977
1129
|
}
|
|
978
1130
|
|
|
979
1131
|
// src/utils/build-angie-prompt.ts
|
|
@@ -1002,7 +1154,7 @@ import { isAngieAvailable, sendPromptToAngie } from "@elementor/editor-mcp";
|
|
|
1002
1154
|
import { AngieIcon } from "@elementor/icons";
|
|
1003
1155
|
import { Button as Button3, IconButton as IconButton4, Tooltip as Tooltip2 } from "@elementor/ui";
|
|
1004
1156
|
import { __ as __9 } from "@wordpress/i18n";
|
|
1005
|
-
function FixViolationWithAngie({ prompt, panelZIndex, variant = "icon" }) {
|
|
1157
|
+
function FixViolationWithAngie({ audit: audit25, prompt, panelZIndex, variant = "icon" }) {
|
|
1006
1158
|
const label = __9("Fix with Angie", "elementor");
|
|
1007
1159
|
const href = `#angie-prompt=${encodeURIComponent(prompt)}`;
|
|
1008
1160
|
const handleClick = (event) => {
|
|
@@ -1010,6 +1162,12 @@ function FixViolationWithAngie({ prompt, panelZIndex, variant = "icon" }) {
|
|
|
1010
1162
|
event.preventDefault();
|
|
1011
1163
|
if (isAngieAvailable()) {
|
|
1012
1164
|
sendPromptToAngie(prompt);
|
|
1165
|
+
trackFindingClicked({
|
|
1166
|
+
audit: audit25,
|
|
1167
|
+
locationL2: "issues",
|
|
1168
|
+
actionType: "fix_with_angie",
|
|
1169
|
+
interactionResult: "angie_prompt_sent"
|
|
1170
|
+
});
|
|
1013
1171
|
return;
|
|
1014
1172
|
}
|
|
1015
1173
|
window.dispatchEvent(
|
|
@@ -1058,11 +1216,18 @@ function SeverityIcon({ severity }) {
|
|
|
1058
1216
|
import * as React10 from "react";
|
|
1059
1217
|
import { WandIcon } from "@elementor/icons";
|
|
1060
1218
|
import { Button as Button4 } from "@elementor/ui";
|
|
1061
|
-
function ViolationCtaButton({
|
|
1219
|
+
function ViolationCtaButton({
|
|
1220
|
+
ctaLabel,
|
|
1221
|
+
externalUrl,
|
|
1222
|
+
variant = "outlined",
|
|
1223
|
+
withIcon = false,
|
|
1224
|
+
onOpen
|
|
1225
|
+
}) {
|
|
1062
1226
|
const handleClick = (event) => {
|
|
1063
1227
|
event.stopPropagation();
|
|
1064
1228
|
event.preventDefault();
|
|
1065
1229
|
window.open(externalUrl, "_blank", "noopener");
|
|
1230
|
+
onOpen?.();
|
|
1066
1231
|
};
|
|
1067
1232
|
return /* @__PURE__ */ React10.createElement(
|
|
1068
1233
|
Button4,
|
|
@@ -1113,6 +1278,7 @@ function StatusIndicator({ audit: audit25, violations }) {
|
|
|
1113
1278
|
return /* @__PURE__ */ React12.createElement(CheckIcon, { fontSize: "small", color: "success" });
|
|
1114
1279
|
}
|
|
1115
1280
|
function GuidanceAction({
|
|
1281
|
+
audit: audit25,
|
|
1116
1282
|
violation,
|
|
1117
1283
|
sharedAngiePrompt,
|
|
1118
1284
|
panelZIndex
|
|
@@ -1126,7 +1292,8 @@ function GuidanceAction({
|
|
|
1126
1292
|
{
|
|
1127
1293
|
ctaLabel: violation.ctaLabel,
|
|
1128
1294
|
externalUrl: violation.externalUrl,
|
|
1129
|
-
withIcon: true
|
|
1295
|
+
withIcon: true,
|
|
1296
|
+
onOpen: () => trackFixWithApp(audit25, violation, "issues")
|
|
1130
1297
|
}
|
|
1131
1298
|
), hasPrimaryCta && violation.secondaryCtaLabel && violation.secondaryCtaUrl && /* @__PURE__ */ React12.createElement(
|
|
1132
1299
|
ViolationCtaButton,
|
|
@@ -1135,7 +1302,15 @@ function GuidanceAction({
|
|
|
1135
1302
|
externalUrl: violation.secondaryCtaUrl,
|
|
1136
1303
|
variant: "text"
|
|
1137
1304
|
}
|
|
1138
|
-
), sharedAngiePrompt && /* @__PURE__ */ React12.createElement(
|
|
1305
|
+
), sharedAngiePrompt && /* @__PURE__ */ React12.createElement(
|
|
1306
|
+
FixViolationWithAngie,
|
|
1307
|
+
{
|
|
1308
|
+
audit: audit25,
|
|
1309
|
+
prompt: sharedAngiePrompt,
|
|
1310
|
+
panelZIndex,
|
|
1311
|
+
variant: "button"
|
|
1312
|
+
}
|
|
1313
|
+
));
|
|
1139
1314
|
}
|
|
1140
1315
|
function getSharedAngiePrompt(violations) {
|
|
1141
1316
|
if (!violations || violations.length < 2) {
|
|
@@ -1155,9 +1330,20 @@ function ViolationRow({ audit: audit25, expanded, onToggleExpand, skipReason, vi
|
|
|
1155
1330
|
const isGuidanceFocusable = !!primaryViolation;
|
|
1156
1331
|
const panelZIndex = useFloatingPanelZIndex2(AUDIT_PANEL_ID);
|
|
1157
1332
|
const sharedAngiePrompt = getSharedAngiePrompt(violations);
|
|
1333
|
+
const viewIssue = (violation) => {
|
|
1334
|
+
const interactionResult = focusViolation(violation);
|
|
1335
|
+
if (interactionResult) {
|
|
1336
|
+
trackFindingClicked({
|
|
1337
|
+
audit: audit25,
|
|
1338
|
+
locationL2: "issues",
|
|
1339
|
+
actionType: "view_issue",
|
|
1340
|
+
interactionResult
|
|
1341
|
+
});
|
|
1342
|
+
}
|
|
1343
|
+
};
|
|
1158
1344
|
const handleGuidanceClick = () => {
|
|
1159
1345
|
if (isGuidanceFocusable && primaryViolation) {
|
|
1160
|
-
|
|
1346
|
+
viewIssue(primaryViolation);
|
|
1161
1347
|
}
|
|
1162
1348
|
};
|
|
1163
1349
|
return /* @__PURE__ */ React12.createElement(Box7, { sx: { borderBottom: 1, borderColor: "divider", paddingBlock: 0.5 } }, /* @__PURE__ */ React12.createElement(Box7, { sx: { display: "flex", alignItems: "center", gap: 0.5 } }, /* @__PURE__ */ React12.createElement(
|
|
@@ -1207,6 +1393,7 @@ function ViolationRow({ audit: audit25, expanded, onToggleExpand, skipReason, vi
|
|
|
1207
1393
|
primaryViolation && /* @__PURE__ */ React12.createElement(
|
|
1208
1394
|
GuidanceAction,
|
|
1209
1395
|
{
|
|
1396
|
+
audit: audit25,
|
|
1210
1397
|
violation: primaryViolation,
|
|
1211
1398
|
sharedAngiePrompt,
|
|
1212
1399
|
panelZIndex
|
|
@@ -1224,8 +1411,8 @@ function ViolationRow({ audit: audit25, expanded, onToggleExpand, skipReason, vi
|
|
|
1224
1411
|
key: idx,
|
|
1225
1412
|
role: "button",
|
|
1226
1413
|
tabIndex: 0,
|
|
1227
|
-
onClick: () =>
|
|
1228
|
-
onKeyDown: onKeyboardClick(() =>
|
|
1414
|
+
onClick: () => viewIssue(violation),
|
|
1415
|
+
onKeyDown: onKeyboardClick(() => viewIssue(violation)),
|
|
1229
1416
|
sx: {
|
|
1230
1417
|
display: "flex",
|
|
1231
1418
|
alignItems: "center",
|
|
@@ -1251,6 +1438,7 @@ function ViolationRow({ audit: audit25, expanded, onToggleExpand, skipReason, vi
|
|
|
1251
1438
|
/* @__PURE__ */ React12.createElement(
|
|
1252
1439
|
FixViolationWithAngie,
|
|
1253
1440
|
{
|
|
1441
|
+
audit: audit25,
|
|
1254
1442
|
prompt: violation.angiePrompt ?? buildAngiePrompt(angiePromptContext),
|
|
1255
1443
|
panelZIndex
|
|
1256
1444
|
}
|
|
@@ -1514,8 +1702,12 @@ function Promotions({ report }) {
|
|
|
1514
1702
|
ctaLabel: config.ctaLabel,
|
|
1515
1703
|
ctaDisabled: !ctaUrl,
|
|
1516
1704
|
onCtaClick: () => {
|
|
1517
|
-
if (ctaUrl) {
|
|
1518
|
-
|
|
1705
|
+
if (!ctaUrl) {
|
|
1706
|
+
return;
|
|
1707
|
+
}
|
|
1708
|
+
window.open(ctaUrl, "_blank", "noopener");
|
|
1709
|
+
if (run.result.status === "fail") {
|
|
1710
|
+
trackFixWithApp(run.audit, run.result.violations[0], "overview");
|
|
1519
1711
|
}
|
|
1520
1712
|
}
|
|
1521
1713
|
}
|
|
@@ -1568,7 +1760,7 @@ function isCategoryPage(page) {
|
|
|
1568
1760
|
return typeof page === "object" && "category" in page;
|
|
1569
1761
|
}
|
|
1570
1762
|
function ReportShell({ report }) {
|
|
1571
|
-
const [activePage, setActivePage] =
|
|
1763
|
+
const [activePage, setActivePage] = useState5("overview");
|
|
1572
1764
|
const openCategory = (category) => setActivePage({ category });
|
|
1573
1765
|
const backToOverview = () => setActivePage("overview");
|
|
1574
1766
|
return /* @__PURE__ */ React19.createElement(Box14, { sx: { flex: 1, minHeight: 0, overflowY: "auto" } }, activePage === "overview" && /* @__PURE__ */ React19.createElement(OverviewPage, { report, onCategoryClick: openCategory }), isCategoryPage(activePage) && /* @__PURE__ */ React19.createElement(CategoryPage, { category: activePage.category, report, onBack: backToOverview }));
|
|
@@ -1606,8 +1798,9 @@ function RescanButton({ hasScanned, isStale, disabled, onClick }) {
|
|
|
1606
1798
|
// src/components/audit-panel.tsx
|
|
1607
1799
|
function AuditPanel() {
|
|
1608
1800
|
const { status, report, error, isStale, run } = useAuditReport();
|
|
1609
|
-
|
|
1610
|
-
const
|
|
1801
|
+
useTrackPanelViewed();
|
|
1802
|
+
const hostDocumentId = getHostDocumentId4() ?? 0;
|
|
1803
|
+
const onRun = () => run(hostDocumentId, report ? "rescan" : "run_audit");
|
|
1611
1804
|
const lastScanLabel = report ? new Date(report.runAt).toLocaleTimeString() : null;
|
|
1612
1805
|
return /* @__PURE__ */ React21.createElement(React21.Fragment, null, /* @__PURE__ */ React21.createElement(
|
|
1613
1806
|
FloatingPanelHeader,
|
|
@@ -1615,7 +1808,8 @@ function AuditPanel() {
|
|
|
1615
1808
|
panelId: AUDIT_PANEL_ID,
|
|
1616
1809
|
title: __17("Page Audit", "elementor"),
|
|
1617
1810
|
badge: __17("Beta", "elementor"),
|
|
1618
|
-
titleVariant: "subtitle2"
|
|
1811
|
+
titleVariant: "subtitle2",
|
|
1812
|
+
onClose: trackPanelClosed
|
|
1619
1813
|
}
|
|
1620
1814
|
), /* @__PURE__ */ React21.createElement(
|
|
1621
1815
|
FloatingPanelBody,
|
|
@@ -1732,7 +1926,8 @@ var audit2 = {
|
|
|
1732
1926
|
externalUrl: isReady ? ctx.pageContext.ally_accessibility_statement_url : ctx.pageContext.ally_plugin_url,
|
|
1733
1927
|
ctaLabel: __20("Create", "elementor"),
|
|
1734
1928
|
secondaryCtaLabel: __20("Learn more", "elementor"),
|
|
1735
|
-
secondaryCtaUrl: "https://elementor.com/help/start-using-ally/#statement"
|
|
1929
|
+
secondaryCtaUrl: "https://elementor.com/help/start-using-ally/#statement",
|
|
1930
|
+
appInstalled: isReady
|
|
1736
1931
|
}
|
|
1737
1932
|
]
|
|
1738
1933
|
};
|
|
@@ -1775,7 +1970,8 @@ var audit3 = {
|
|
|
1775
1970
|
auditId: audit3.id,
|
|
1776
1971
|
label: __21("No accessibility widget is active on this site.", "elementor"),
|
|
1777
1972
|
externalUrl: isReady ? ctx.pageContext.ally_widget_settings_url : ctx.pageContext.ally_plugin_url,
|
|
1778
|
-
ctaLabel: __21("Activate", "elementor")
|
|
1973
|
+
ctaLabel: __21("Activate", "elementor"),
|
|
1974
|
+
appInstalled: isReady
|
|
1779
1975
|
}
|
|
1780
1976
|
]
|
|
1781
1977
|
};
|
|
@@ -1806,7 +2002,8 @@ var audit4 = {
|
|
|
1806
2002
|
auditId: audit4.id,
|
|
1807
2003
|
label: __22("Cookiez plugin is not installed or active.", "elementor"),
|
|
1808
2004
|
externalUrl: ctx.pageContext.cookiez_plugin_url,
|
|
1809
|
-
ctaLabel: __22("Set up cookie consent", "elementor")
|
|
2005
|
+
ctaLabel: __22("Set up cookie consent", "elementor"),
|
|
2006
|
+
appInstalled: ctx.pageContext.cookiez_plugin_active
|
|
1810
2007
|
}
|
|
1811
2008
|
]
|
|
1812
2009
|
};
|
|
@@ -1992,6 +2189,7 @@ var audit8 = {
|
|
|
1992
2189
|
auditId: audit8.id,
|
|
1993
2190
|
label,
|
|
1994
2191
|
ctaLabel: __26("Enable", "elementor"),
|
|
2192
|
+
appInstalled: true,
|
|
1995
2193
|
externalUrl: ctx.pageContext.cookiez_consent_mode_settings_url
|
|
1996
2194
|
}
|
|
1997
2195
|
]
|
|
@@ -2335,7 +2533,8 @@ var audit11 = {
|
|
|
2335
2533
|
targetHint: "element-settings",
|
|
2336
2534
|
label: __29("Image is missing alt text.", "elementor"),
|
|
2337
2535
|
externalUrl: isReady ? ctx.pageContext.ally_scan_url : ctx.pageContext.ally_plugin_url,
|
|
2338
|
-
ctaLabel: __29("Fix with Ally", "elementor")
|
|
2536
|
+
ctaLabel: __29("Fix with Ally", "elementor"),
|
|
2537
|
+
appInstalled: isReady
|
|
2339
2538
|
});
|
|
2340
2539
|
}
|
|
2341
2540
|
});
|
|
@@ -2384,7 +2583,8 @@ var audit12 = {
|
|
|
2384
2583
|
targetHint: "element-settings",
|
|
2385
2584
|
label: __30("Image isn't served in a modern format like WebP or AVIF.", "elementor"),
|
|
2386
2585
|
externalUrl: isReady ? ctx.pageContext.image_optimization_settings_url : ctx.pageContext.image_optimization_plugin_url,
|
|
2387
|
-
ctaLabel: __30("Optimize all", "elementor")
|
|
2586
|
+
ctaLabel: __30("Optimize all", "elementor"),
|
|
2587
|
+
appInstalled: isReady
|
|
2388
2588
|
}));
|
|
2389
2589
|
return violations.length === 0 ? { status: "pass" } : { status: "fail", violations, metadata: { inefficientImageFormatCount } };
|
|
2390
2590
|
}
|
|
@@ -2438,7 +2638,8 @@ var audit13 = {
|
|
|
2438
2638
|
kb
|
|
2439
2639
|
),
|
|
2440
2640
|
externalUrl: isReady ? ctx.pageContext.image_optimization_settings_url : ctx.pageContext.image_optimization_plugin_url,
|
|
2441
|
-
ctaLabel: __31("Optimize all", "elementor")
|
|
2641
|
+
ctaLabel: __31("Optimize all", "elementor"),
|
|
2642
|
+
appInstalled: isReady
|
|
2442
2643
|
}));
|
|
2443
2644
|
return violations.length === 0 ? { status: "pass" } : { status: "fail", violations, metadata: { oversizedImageCount } };
|
|
2444
2645
|
}
|
|
@@ -2879,7 +3080,8 @@ var audit22 = {
|
|
|
2879
3080
|
{
|
|
2880
3081
|
auditId: audit22.id,
|
|
2881
3082
|
label: __40("This page has not been scanned for cookies yet.", "elementor"),
|
|
2882
|
-
externalUrl: isReady ? ctx.pageContext.cookiez_scan_url : ctx.pageContext.cookiez_plugin_action_url
|
|
3083
|
+
externalUrl: isReady ? ctx.pageContext.cookiez_scan_url : ctx.pageContext.cookiez_plugin_action_url,
|
|
3084
|
+
appInstalled: isReady
|
|
2883
3085
|
}
|
|
2884
3086
|
]
|
|
2885
3087
|
};
|
|
@@ -3007,12 +3209,12 @@ function registerAllAudits() {
|
|
|
3007
3209
|
|
|
3008
3210
|
// src/sync-report-staleness.ts
|
|
3009
3211
|
import { __privateListenTo as listenTo, commandEndEvent } from "@elementor/editor-v1-adapters";
|
|
3010
|
-
import { __dispatch as
|
|
3212
|
+
import { __dispatch as dispatch2 } from "@elementor/store";
|
|
3011
3213
|
function syncReportStaleness() {
|
|
3012
3214
|
listenTo(commandEndEvent("document/save/set-is-modified"), (e) => {
|
|
3013
3215
|
const event = e;
|
|
3014
3216
|
if (event.args?.status) {
|
|
3015
|
-
|
|
3217
|
+
dispatch2(slice.actions.reportStale());
|
|
3016
3218
|
}
|
|
3017
3219
|
});
|
|
3018
3220
|
}
|