@pronto-tools-and-more/components 15.9.0 → 15.10.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) => {
@@ -1829,7 +1848,11 @@ var getNodeInfo3 = (element) => {
1829
1848
  primaryCategoryLanguage: `$functions.getLanguage($functions.getPrimaryCategoryProperty($context[${contentKey}]['issue'], 'properties', 'lang'))`,
1830
1849
  metadataVideoPodcast: `$functions.id($context, ${contentKey}, 'issue', 'metadataVideoPodcast')`,
1831
1850
  readTime: `$functions.getReadTime($functions.id($context, ${contentKey}, 'issue'))`,
1832
- access: `$functions.id($context, ${contentKey}, 'issue', 'access')`
1851
+ access: `$functions.id($context, ${contentKey}, 'issue', 'access')`,
1852
+ properties: createPropertiesProxy({
1853
+ original: {},
1854
+ contentKey
1855
+ })
1833
1856
  };
1834
1857
  };
1835
1858
  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
+ }
@@ -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.10.0",
4
4
  "description": "",
5
5
  "main": "dist/main.js",
6
6
  "types": "dist/main.d.ts",