@pronto-tools-and-more/components 15.9.0 → 15.11.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
@@ -316,6 +316,17 @@ var getArticleListDataSource = ({
316
316
  return dataSource;
317
317
  };
318
318
 
319
+ // src/parts/PropertiesProxy/PropertiesProxy.ts
320
+ var createPropertiesProxy = ({ original, contentKey }) => {
321
+ const handler = {
322
+ get: (target, key) => {
323
+ return `$functions.id($context, ${contentKey}, 'properties', '${key}')`;
324
+ }
325
+ };
326
+ const proxy = new Proxy(original, handler);
327
+ return proxy;
328
+ };
329
+
319
330
  // src/parts/ArticleList/ArticleList.tsx
320
331
  var getContentKey = (element) => {
321
332
  if (element.dataSource.contextKey) {
@@ -348,7 +359,11 @@ var getNodeInfo = (element) => {
348
359
  id: `$functions.id($context, ${contentKey}, 'id')`,
349
360
  primaryCategoryName: `$functions.id($context, ${contentKey}, 'primaryCategoryName')`,
350
361
  primaryCategoryId: `$functions.id($context, ${contentKey}, 'primaryCategoryId')`,
351
- language: `$functions.getLanguage($functions.id($context, ${contentKey}))`
362
+ language: `$functions.getLanguage($functions.id($context, ${contentKey}))`,
363
+ properties: createPropertiesProxy({
364
+ original: {},
365
+ contentKey
366
+ })
352
367
  };
353
368
  }
354
369
  return {
@@ -364,7 +379,11 @@ var getNodeInfo = (element) => {
364
379
  primaryCategoryName: `$functions.getPrimaryCategoryProperty($context[${contentKey}], 'name')`,
365
380
  primaryCategoryLanguage: `$functions.getLanguage($functions.getPrimaryCategoryProperty($context[${contentKey}], 'properties', 'lang'))`,
366
381
  access: `$functions.id($context, ${contentKey}, 'access')`,
367
- language: `$functions.getLanguage($functions.id($context, ${contentKey}))`
382
+ language: `$functions.getLanguage($functions.id($context, ${contentKey}))`,
383
+ properties: createPropertiesProxy({
384
+ original: {},
385
+ contentKey
386
+ })
368
387
  };
369
388
  };
370
389
  var unrender2 = (element, renderElement) => {
@@ -1309,11 +1328,13 @@ var Image = ({
1309
1328
  alt,
1310
1329
  loading,
1311
1330
  className,
1312
- width
1331
+ width,
1332
+ resize
1313
1333
  }) => {
1314
1334
  const webp = webP;
1315
1335
  const actualWidth = width || defaultWidth;
1316
- const optimizedSrc = `$functions.getOptimizedImageSrc("${src}", ${webp}, ${actualWidth})`;
1336
+ const resizeString = resize ? JSON.stringify(resize) : void 0;
1337
+ const optimizedSrc = `$functions.getOptimizedImageSrc("${src}", ${webp}, ${actualWidth}, ${resizeString})`;
1317
1338
  return /* @__PURE__ */ React.createElement("img", { src: optimizedSrc, alt, loading, className });
1318
1339
  };
1319
1340
 
@@ -1829,7 +1850,11 @@ var getNodeInfo3 = (element) => {
1829
1850
  primaryCategoryLanguage: `$functions.getLanguage($functions.getPrimaryCategoryProperty($context[${contentKey}]['issue'], 'properties', 'lang'))`,
1830
1851
  metadataVideoPodcast: `$functions.id($context, ${contentKey}, 'issue', 'metadataVideoPodcast')`,
1831
1852
  readTime: `$functions.getReadTime($functions.id($context, ${contentKey}, 'issue'))`,
1832
- access: `$functions.id($context, ${contentKey}, 'issue', 'access')`
1853
+ access: `$functions.id($context, ${contentKey}, 'issue', 'access')`,
1854
+ properties: createPropertiesProxy({
1855
+ original: {},
1856
+ contentKey
1857
+ })
1833
1858
  };
1834
1859
  };
1835
1860
  var unrender15 = (element, renderElement) => {
@@ -0,0 +1,16 @@
1
+ export interface IArticleNodeInfo {
2
+ readonly name: string;
3
+ readonly description: string;
4
+ readonly imageSrc: string;
5
+ readonly properties: any;
6
+ readonly slug: string;
7
+ readonly metadataVideoPodcast?: string;
8
+ readonly readTime?: string;
9
+ readonly publicationDate: string;
10
+ readonly id: string;
11
+ readonly primaryCategoryName?: string;
12
+ readonly primaryCategoryId?: string;
13
+ readonly primaryCategoryLanguage?: string;
14
+ readonly access?: string;
15
+ readonly language: string;
16
+ }
@@ -1,7 +1,8 @@
1
- export declare const Image: ({ src, alt, loading, className, width, }: {
1
+ export declare const Image: ({ src, alt, loading, className, width, resize, }: {
2
2
  src: string;
3
3
  alt?: string;
4
4
  className?: string;
5
5
  loading?: "lazy";
6
6
  width?: number;
7
+ resize?: string;
7
8
  }) => import("react").JSX.Element;
@@ -0,0 +1,4 @@
1
+ export declare const createPropertiesProxy: ({ original, contentKey }: {
2
+ original: any;
3
+ contentKey: any;
4
+ }) => any;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pronto-tools-and-more/components",
3
- "version": "15.9.0",
3
+ "version": "15.11.0",
4
4
  "description": "",
5
5
  "main": "dist/main.js",
6
6
  "types": "dist/main.d.ts",