@pronto-tools-and-more/components 15.38.0 → 15.40.0
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/main.js
CHANGED
@@ -367,6 +367,7 @@ var getContentKey = (element) => {
|
|
367
367
|
var getNodeInfo = (element) => {
|
368
368
|
const { render, ...rest } = element;
|
369
369
|
const contentKey = getContentKey(element);
|
370
|
+
const contextKey = contentKey.slice(1, -1);
|
370
371
|
const isBookmarks = element.dataSource.data === "$context.bookmarks";
|
371
372
|
if (isBookmarks) {
|
372
373
|
return {
|
@@ -384,7 +385,8 @@ var getNodeInfo = (element) => {
|
|
384
385
|
properties: createPropertiesProxy({
|
385
386
|
original: {},
|
386
387
|
contentKey
|
387
|
-
})
|
388
|
+
}),
|
389
|
+
contextKey
|
388
390
|
};
|
389
391
|
}
|
390
392
|
return {
|
@@ -404,7 +406,8 @@ var getNodeInfo = (element) => {
|
|
404
406
|
properties: createPropertiesProxy({
|
405
407
|
original: {},
|
406
408
|
contentKey
|
407
|
-
})
|
409
|
+
}),
|
410
|
+
contextKey
|
408
411
|
};
|
409
412
|
};
|
410
413
|
var unrender2 = (element, renderElement) => {
|
@@ -1461,16 +1464,25 @@ var Image = ({
|
|
1461
1464
|
className,
|
1462
1465
|
width,
|
1463
1466
|
resize,
|
1464
|
-
style
|
1467
|
+
style,
|
1468
|
+
ContentImageContext
|
1465
1469
|
}) => {
|
1466
|
-
|
1467
|
-
|
1468
|
-
|
1469
|
-
|
1470
|
-
|
1471
|
-
|
1472
|
-
|
1473
|
-
|
1470
|
+
if (!ContentImageContext) {
|
1471
|
+
const webp = webP;
|
1472
|
+
const actualWidth = width || defaultWidth;
|
1473
|
+
const resizeString = resize ? JSON.stringify(resize) : void 0;
|
1474
|
+
const optimizedSrc = `$functions.getOptimizedImageSrc("${src}", ${webp}, ${actualWidth}, ${resizeString})`;
|
1475
|
+
return (
|
1476
|
+
//@ts-ignore
|
1477
|
+
/* @__PURE__ */ React.createElement("img", { src: optimizedSrc, alt, loading, className, style })
|
1478
|
+
);
|
1479
|
+
}
|
1480
|
+
const json = {
|
1481
|
+
type: "content-featured-image",
|
1482
|
+
contextKey: ContentImageContext,
|
1483
|
+
class: className
|
1484
|
+
};
|
1485
|
+
return /* @__PURE__ */ React.createElement(JsonComponent, { json });
|
1474
1486
|
};
|
1475
1487
|
|
1476
1488
|
// src/parts/Language/Language.ts
|
@@ -1,9 +1,10 @@
|
|
1
|
-
export declare const Image: ({ src, alt, loading, className, width, resize, style, }: {
|
2
|
-
src
|
1
|
+
export declare const Image: ({ src, alt, loading, className, width, resize, style, ContentImageContext }: {
|
2
|
+
src?: string;
|
3
3
|
alt?: string;
|
4
4
|
className?: string;
|
5
5
|
loading?: "lazy";
|
6
6
|
width?: number;
|
7
7
|
resize?: string;
|
8
8
|
style?: string;
|
9
|
+
ContentImageContext?: string;
|
9
10
|
}) => import("react").JSX.Element;
|