@elementor/editor-audits 4.4.0-1075 → 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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elementor/editor-audits",
3
- "version": "4.4.0-1075",
3
+ "version": "4.4.0-1076",
4
4
  "private": false,
5
5
  "author": "Elementor Team",
6
6
  "homepage": "https://elementor.com/",
@@ -39,19 +39,19 @@
39
39
  "dev": "tsup --config=../../tsup.dev.ts"
40
40
  },
41
41
  "dependencies": {
42
- "@elementor/editor": "4.4.0-1075",
43
- "@elementor/editor-mcp": "4.4.0-1075",
44
- "@elementor/editor-app-bar": "4.4.0-1075",
45
- "@elementor/editor-elements": "4.4.0-1075",
46
- "@elementor/editor-floating-panels": "4.4.0-1075",
47
- "@elementor/editor-notifications": "4.4.0-1075",
48
- "@elementor/editor-v1-adapters": "4.4.0-1075",
49
- "@elementor/events": "4.4.0-1075",
50
- "@elementor/http-client": "4.4.0-1075",
42
+ "@elementor/editor": "4.4.0-1076",
43
+ "@elementor/editor-mcp": "4.4.0-1076",
44
+ "@elementor/editor-app-bar": "4.4.0-1076",
45
+ "@elementor/editor-elements": "4.4.0-1076",
46
+ "@elementor/editor-floating-panels": "4.4.0-1076",
47
+ "@elementor/editor-notifications": "4.4.0-1076",
48
+ "@elementor/editor-v1-adapters": "4.4.0-1076",
49
+ "@elementor/events": "4.4.0-1076",
50
+ "@elementor/http-client": "4.4.0-1076",
51
51
  "@elementor/icons": "~1.77.0",
52
- "@elementor/locations": "4.4.0-1075",
53
- "@elementor/session": "4.4.0-1075",
54
- "@elementor/store": "4.4.0-1075",
52
+ "@elementor/locations": "4.4.0-1076",
53
+ "@elementor/session": "4.4.0-1076",
54
+ "@elementor/store": "4.4.0-1076",
55
55
  "@elementor/ui": "1.37.5"
56
56
  },
57
57
  "peerDependencies": {
@@ -28,6 +28,7 @@ export const audit: Audit = {
28
28
  auditId: audit.id,
29
29
  label: __( 'No privacy policy page is set.', 'elementor' ),
30
30
  externalUrl: ctx.pageContext.privacy_settings_url,
31
+ ctaLabel: __( 'Create', 'elementor' ),
31
32
  },
32
33
  ],
33
34
  };
@@ -0,0 +1,22 @@
1
+ import * as React from 'react';
2
+ import { Button } from '@elementor/ui';
3
+
4
+ type Props = {
5
+ ctaLabel: string;
6
+ externalUrl: string;
7
+ };
8
+
9
+ export default function ViolationCtaButton( { ctaLabel, externalUrl }: Props ) {
10
+ const handleClick = ( event: React.MouseEvent< HTMLButtonElement > ) => {
11
+ event.stopPropagation();
12
+ event.preventDefault();
13
+
14
+ window.open( externalUrl, '_blank', 'noopener' );
15
+ };
16
+
17
+ return (
18
+ <Button variant="outlined" color="secondary" size="small" onClick={ handleClick }>
19
+ { ctaLabel }
20
+ </Button>
21
+ );
22
+ }
@@ -11,6 +11,7 @@ import { buildAngiePrompt } from '../utils/build-angie-prompt';
11
11
  import { onKeyboardClick } from '../utils/keyboard-click';
12
12
  import FixViolationWithAngie from './fix-violation-with-angie';
13
13
  import SeverityIcon from './severity-icons';
14
+ import ViolationCtaButton from './violation-cta-button';
14
15
  import ViolationIcon from './violation-icons';
15
16
 
16
17
  type Props = {
@@ -157,7 +158,18 @@ export default function ViolationRow( { audit, skipReason, violations }: Props )
157
158
  { violation.angieFix && (
158
159
  <FixViolationWithAngie prompt={ buildAngiePrompt( rowLabel ) } />
159
160
  ) }
160
- <EyeIcon className="violation-hover-icon" fontSize="tiny" aria-hidden={ true } />
161
+ { violation.ctaLabel && violation.externalUrl ? (
162
+ <ViolationCtaButton
163
+ ctaLabel={ violation.ctaLabel }
164
+ externalUrl={ violation.externalUrl }
165
+ />
166
+ ) : (
167
+ <EyeIcon
168
+ className="violation-hover-icon"
169
+ fontSize="tiny"
170
+ aria-hidden={ true }
171
+ />
172
+ ) }
161
173
  </Box>
162
174
  );
163
175
  } ) }
package/src/types.ts CHANGED
@@ -38,6 +38,7 @@ export type AuditViolation = {
38
38
  label: string;
39
39
  detail?: string;
40
40
  angieFix?: boolean;
41
+ ctaLabel?: string;
41
42
  };
42
43
 
43
44
  export type PageContextResponse = {