@elementor/editor-canvas 4.1.0-819 → 4.1.0-821
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.js
CHANGED
|
@@ -1551,7 +1551,8 @@ var queryTransformer = createTransformer(({ id }) => {
|
|
|
1551
1551
|
// src/transformers/shared/image-src-transformer.ts
|
|
1552
1552
|
var imageSrcTransformer = createTransformer((value) => ({
|
|
1553
1553
|
id: value.id ?? null,
|
|
1554
|
-
url: value.url ?? null
|
|
1554
|
+
url: value.url ?? null,
|
|
1555
|
+
alt: value.alt ?? null
|
|
1555
1556
|
}));
|
|
1556
1557
|
|
|
1557
1558
|
// src/transformers/shared/image-transformer.ts
|
|
@@ -1559,7 +1560,7 @@ var import_wp_media = require("@elementor/wp-media");
|
|
|
1559
1560
|
var imageTransformer = createTransformer(async (value) => {
|
|
1560
1561
|
const { src, size: size2 } = value;
|
|
1561
1562
|
if (!src?.id) {
|
|
1562
|
-
return src?.url ? { src: src.url } : null;
|
|
1563
|
+
return src?.url ? { src: src.url, alt: src.alt ?? "" } : null;
|
|
1563
1564
|
}
|
|
1564
1565
|
const attachment = await (0, import_wp_media.getMediaAttachment)({ id: src.id });
|
|
1565
1566
|
const sizedAttachment = attachment?.sizes?.[size2 ?? ""];
|
|
@@ -1567,14 +1568,16 @@ var imageTransformer = createTransformer(async (value) => {
|
|
|
1567
1568
|
return {
|
|
1568
1569
|
src: sizedAttachment.url,
|
|
1569
1570
|
height: sizedAttachment.height,
|
|
1570
|
-
width: sizedAttachment.width
|
|
1571
|
+
width: sizedAttachment.width,
|
|
1572
|
+
alt: attachment.alt
|
|
1571
1573
|
};
|
|
1572
1574
|
}
|
|
1573
1575
|
if (attachment) {
|
|
1574
1576
|
return {
|
|
1575
1577
|
src: attachment.url,
|
|
1576
1578
|
height: attachment.height,
|
|
1577
|
-
width: attachment.width
|
|
1579
|
+
width: attachment.width,
|
|
1580
|
+
alt: attachment.alt
|
|
1578
1581
|
};
|
|
1579
1582
|
}
|
|
1580
1583
|
return null;
|
package/dist/index.mjs
CHANGED
|
@@ -1516,7 +1516,8 @@ var queryTransformer = createTransformer(({ id }) => {
|
|
|
1516
1516
|
// src/transformers/shared/image-src-transformer.ts
|
|
1517
1517
|
var imageSrcTransformer = createTransformer((value) => ({
|
|
1518
1518
|
id: value.id ?? null,
|
|
1519
|
-
url: value.url ?? null
|
|
1519
|
+
url: value.url ?? null,
|
|
1520
|
+
alt: value.alt ?? null
|
|
1520
1521
|
}));
|
|
1521
1522
|
|
|
1522
1523
|
// src/transformers/shared/image-transformer.ts
|
|
@@ -1524,7 +1525,7 @@ import { getMediaAttachment } from "@elementor/wp-media";
|
|
|
1524
1525
|
var imageTransformer = createTransformer(async (value) => {
|
|
1525
1526
|
const { src, size: size2 } = value;
|
|
1526
1527
|
if (!src?.id) {
|
|
1527
|
-
return src?.url ? { src: src.url } : null;
|
|
1528
|
+
return src?.url ? { src: src.url, alt: src.alt ?? "" } : null;
|
|
1528
1529
|
}
|
|
1529
1530
|
const attachment = await getMediaAttachment({ id: src.id });
|
|
1530
1531
|
const sizedAttachment = attachment?.sizes?.[size2 ?? ""];
|
|
@@ -1532,14 +1533,16 @@ var imageTransformer = createTransformer(async (value) => {
|
|
|
1532
1533
|
return {
|
|
1533
1534
|
src: sizedAttachment.url,
|
|
1534
1535
|
height: sizedAttachment.height,
|
|
1535
|
-
width: sizedAttachment.width
|
|
1536
|
+
width: sizedAttachment.width,
|
|
1537
|
+
alt: attachment.alt
|
|
1536
1538
|
};
|
|
1537
1539
|
}
|
|
1538
1540
|
if (attachment) {
|
|
1539
1541
|
return {
|
|
1540
1542
|
src: attachment.url,
|
|
1541
1543
|
height: attachment.height,
|
|
1542
|
-
width: attachment.width
|
|
1544
|
+
width: attachment.width,
|
|
1545
|
+
alt: attachment.alt
|
|
1543
1546
|
};
|
|
1544
1547
|
}
|
|
1545
1548
|
return null;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elementor/editor-canvas",
|
|
3
3
|
"description": "Elementor Editor Canvas",
|
|
4
|
-
"version": "4.1.0-
|
|
4
|
+
"version": "4.1.0-821",
|
|
5
5
|
"private": false,
|
|
6
6
|
"author": "Elementor Team",
|
|
7
7
|
"homepage": "https://elementor.com/",
|
|
@@ -37,25 +37,25 @@
|
|
|
37
37
|
"react-dom": "^18.3.1"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@elementor/editor": "4.1.0-
|
|
40
|
+
"@elementor/editor": "4.1.0-821",
|
|
41
41
|
"dompurify": "^3.2.6",
|
|
42
|
-
"@elementor/editor-controls": "4.1.0-
|
|
43
|
-
"@elementor/editor-documents": "4.1.0-
|
|
44
|
-
"@elementor/editor-elements": "4.1.0-
|
|
45
|
-
"@elementor/editor-interactions": "4.1.0-
|
|
46
|
-
"@elementor/editor-mcp": "4.1.0-
|
|
47
|
-
"@elementor/editor-notifications": "4.1.0-
|
|
48
|
-
"@elementor/editor-props": "4.1.0-
|
|
49
|
-
"@elementor/editor-responsive": "4.1.0-
|
|
50
|
-
"@elementor/editor-styles": "4.1.0-
|
|
51
|
-
"@elementor/editor-styles-repository": "4.1.0-
|
|
52
|
-
"@elementor/editor-ui": "4.1.0-
|
|
53
|
-
"@elementor/editor-v1-adapters": "4.1.0-
|
|
54
|
-
"@elementor/schema": "4.1.0-
|
|
55
|
-
"@elementor/twing": "4.1.0-
|
|
42
|
+
"@elementor/editor-controls": "4.1.0-821",
|
|
43
|
+
"@elementor/editor-documents": "4.1.0-821",
|
|
44
|
+
"@elementor/editor-elements": "4.1.0-821",
|
|
45
|
+
"@elementor/editor-interactions": "4.1.0-821",
|
|
46
|
+
"@elementor/editor-mcp": "4.1.0-821",
|
|
47
|
+
"@elementor/editor-notifications": "4.1.0-821",
|
|
48
|
+
"@elementor/editor-props": "4.1.0-821",
|
|
49
|
+
"@elementor/editor-responsive": "4.1.0-821",
|
|
50
|
+
"@elementor/editor-styles": "4.1.0-821",
|
|
51
|
+
"@elementor/editor-styles-repository": "4.1.0-821",
|
|
52
|
+
"@elementor/editor-ui": "4.1.0-821",
|
|
53
|
+
"@elementor/editor-v1-adapters": "4.1.0-821",
|
|
54
|
+
"@elementor/schema": "4.1.0-821",
|
|
55
|
+
"@elementor/twing": "4.1.0-821",
|
|
56
56
|
"@elementor/ui": "1.37.5",
|
|
57
|
-
"@elementor/utils": "4.1.0-
|
|
58
|
-
"@elementor/wp-media": "4.1.0-
|
|
57
|
+
"@elementor/utils": "4.1.0-821",
|
|
58
|
+
"@elementor/wp-media": "4.1.0-821",
|
|
59
59
|
"@floating-ui/react": "^0.27.5",
|
|
60
60
|
"@wordpress/i18n": "^5.13.0"
|
|
61
61
|
},
|
|
@@ -103,6 +103,7 @@ describe( 'settings props resolver', () => {
|
|
|
103
103
|
expected: {
|
|
104
104
|
image: {
|
|
105
105
|
src: 'https://localhost.test/test-image.png',
|
|
106
|
+
alt: '',
|
|
106
107
|
},
|
|
107
108
|
},
|
|
108
109
|
},
|
|
@@ -130,6 +131,7 @@ describe( 'settings props resolver', () => {
|
|
|
130
131
|
src: 'large-image-url-123',
|
|
131
132
|
height: 3,
|
|
132
133
|
width: 3,
|
|
134
|
+
alt: undefined,
|
|
133
135
|
},
|
|
134
136
|
},
|
|
135
137
|
},
|
|
@@ -157,6 +159,7 @@ describe( 'settings props resolver', () => {
|
|
|
157
159
|
src: 'original-image-url-123',
|
|
158
160
|
height: 0,
|
|
159
161
|
width: 0,
|
|
162
|
+
alt: undefined,
|
|
160
163
|
},
|
|
161
164
|
},
|
|
162
165
|
},
|
|
@@ -3,9 +3,11 @@ import { createTransformer } from '../create-transformer';
|
|
|
3
3
|
type ImageSrc = {
|
|
4
4
|
id?: unknown;
|
|
5
5
|
url?: unknown;
|
|
6
|
+
alt?: unknown;
|
|
6
7
|
};
|
|
7
8
|
|
|
8
9
|
export const imageSrcTransformer = createTransformer( ( value: ImageSrc ) => ( {
|
|
9
10
|
id: value.id ?? null,
|
|
10
11
|
url: value.url ?? null,
|
|
12
|
+
alt: value.alt ?? null,
|
|
11
13
|
} ) );
|
|
@@ -6,6 +6,7 @@ type Image = {
|
|
|
6
6
|
src?: {
|
|
7
7
|
id: number | null;
|
|
8
8
|
url: string | null;
|
|
9
|
+
alt?: string | null;
|
|
9
10
|
};
|
|
10
11
|
size?: string;
|
|
11
12
|
};
|
|
@@ -14,7 +15,7 @@ export const imageTransformer = createTransformer( async ( value: Image ) => {
|
|
|
14
15
|
const { src, size } = value;
|
|
15
16
|
|
|
16
17
|
if ( ! src?.id ) {
|
|
17
|
-
return src?.url ? { src: src.url } : null;
|
|
18
|
+
return src?.url ? { src: src.url, alt: src.alt ?? '' } : null;
|
|
18
19
|
}
|
|
19
20
|
|
|
20
21
|
const attachment = await getMediaAttachment( { id: src.id } );
|
|
@@ -26,6 +27,7 @@ export const imageTransformer = createTransformer( async ( value: Image ) => {
|
|
|
26
27
|
src: sizedAttachment.url,
|
|
27
28
|
height: sizedAttachment.height,
|
|
28
29
|
width: sizedAttachment.width,
|
|
30
|
+
alt: attachment.alt,
|
|
29
31
|
};
|
|
30
32
|
}
|
|
31
33
|
|
|
@@ -34,6 +36,7 @@ export const imageTransformer = createTransformer( async ( value: Image ) => {
|
|
|
34
36
|
src: attachment.url,
|
|
35
37
|
height: attachment.height,
|
|
36
38
|
width: attachment.width,
|
|
39
|
+
alt: attachment.alt,
|
|
37
40
|
};
|
|
38
41
|
}
|
|
39
42
|
|