@pronto-tools-and-more/components-renderer 10.3.0 → 10.5.0

Sign up to get free protection for your applications and to get access to all the features.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pronto-tools-and-more/components-renderer",
3
- "version": "10.3.0",
3
+ "version": "10.5.0",
4
4
  "description": "",
5
5
  "main": "src/componentsRendererMain.js",
6
6
  "type": "module",
@@ -3,6 +3,7 @@ import * as RenderCustomElementCollection from "../RenderCustomElementCollection
3
3
  import * as RenderCustomElementList from "../RenderCustomElementList/RenderCustomElementList.js";
4
4
  import * as RenderCustomElementSearchResults from "../RenderCustomElementSearchResults/RenderCustomElementSearchResults.js";
5
5
  import * as RenderCustomElementUnknown from "../RenderCustomElementUnknown/RenderCustomElementUnknown.js";
6
+ import * as RenderCustomElementTagList from "../RenderCustomElementTagList/RenderCustomElementTagList.js";
6
7
  import * as RenderCustomElementAuthorList from "../RenderCustomElementAuthorList/RenderCustomElementAuthorList.js";
7
8
 
8
9
  const renderers = [
@@ -11,6 +12,7 @@ const renderers = [
11
12
  RenderCustomElementCollection.renderCustomElementCollection,
12
13
  RenderCustomElementList.renderCustomElementList,
13
14
  RenderCustomElementSearchResults.renderCustomElementSearchResults,
15
+ RenderCustomElementTagList.renderCustomElementTagList,
14
16
  ];
15
17
 
16
18
  export const renderCustomElement = (element, renderElement) => {
@@ -11,6 +11,7 @@ export const renderCustomElementCollection = (element, renderElement) => {
11
11
  imageSrc: `$functions.id($context, 'collection-content', 'thumbnails', 'default')`,
12
12
  slug: `$functions.id($context, 'collection-content', 'properties', 'slug')`,
13
13
  metadataVideoPodcast: `$functions.id($context, 'collection-content', 'properties', 'metadataVideoPodcast')`,
14
+ publicationDate: `$functions.id($context, 'collection-content', 'publicationDate')`,
14
15
  });
15
16
  const final = renderElement(node);
16
17
  return {
@@ -0,0 +1,28 @@
1
+ export const renderCustomElementTagList = (element, renderElement) => {
2
+ if (
3
+ element.type === "list" &&
4
+ element.class &&
5
+ element.class.includes("data-custom-tag-list")
6
+ ) {
7
+ const { render, ...rest } = element;
8
+ const node = render({
9
+ id: `$functions.id($context, 'context', 'id')`,
10
+ name: `$functions.id($context, 'context', 'name')`,
11
+ language: `$functions.id($context, 'context', 'properties', 'lang')`,
12
+ });
13
+ const condition = {
14
+ value: "$context.context.type",
15
+ operation: "EQUALS",
16
+ compareValue: "tag",
17
+ };
18
+ const final = {
19
+ ...renderElement(node),
20
+ condition,
21
+ };
22
+ return {
23
+ ...rest,
24
+ content: final,
25
+ };
26
+ }
27
+ return undefined;
28
+ };