@pronto-tools-and-more/components-renderer 9.7.0 → 9.9.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": "9.7.0",
3
+ "version": "9.9.0",
4
4
  "description": "",
5
5
  "main": "src/componentsRendererMain.js",
6
6
  "type": "module",
@@ -1,7 +1,8 @@
1
+ import * as RenderCustomElementCategoryList from "../RenderCustomElementCategoryList/RenderCustomElementCategoryList.js";
2
+ import * as RenderCustomElementCollection from "../RenderCustomElementCollection/RenderCustomElementCollection.js";
1
3
  import * as RenderCustomElementList from "../RenderCustomElementList/RenderCustomElementList.js";
2
4
  import * as RenderCustomElementSearchResults from "../RenderCustomElementSearchResults/RenderCustomElementSearchResults.js";
3
5
  import * as RenderCustomElementUnknown from "../RenderCustomElementUnknown/RenderCustomElementUnknown.js";
4
- import * as RenderCustomElementCollection from "../RenderCustomElementCollection/RenderCustomElementCollection.js";
5
6
 
6
7
  export const renderCustomElement = (element, renderElement) => {
7
8
  return (
@@ -10,6 +11,10 @@ export const renderCustomElement = (element, renderElement) => {
10
11
  renderElement
11
12
  ) ||
12
13
  RenderCustomElementList.renderCustomElementList(element, renderElement) ||
14
+ RenderCustomElementCategoryList.renderCustomElementCategoryList(
15
+ element,
16
+ renderElement
17
+ ) ||
13
18
  RenderCustomElementSearchResults.renderCustomElementSearchResults(
14
19
  element,
15
20
  renderElement
@@ -0,0 +1,20 @@
1
+ export const renderCustomElementCategoryList = (element, renderElement) => {
2
+ if (
3
+ element.type === "list" &&
4
+ element.class &&
5
+ element.class.includes("data-custom-category-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 final = renderElement(node);
14
+ return {
15
+ ...rest,
16
+ content: final,
17
+ };
18
+ }
19
+ return undefined;
20
+ };
@@ -9,8 +9,8 @@ export const renderCustomElementList = (element, renderElement) => {
9
9
  name: `$functions.id($context, 'content', 'name')`,
10
10
  description: `$functions.id($context, 'content', 'description')`,
11
11
  imageSrc: `$functions.id($context, 'content', 'thumbnails', 'default')`,
12
- slug: `$functions.id($context, 'properties', 'slug')`,
13
- metadataVideoPodcast: `$functions.id($context, 'properties', 'metadataVideoPodcast')`,
12
+ slug: `$functions.id($context, 'content', 'properties', 'slug')`,
13
+ metadataVideoPodcast: `$functions.id($context, 'content', 'properties', 'metadataVideoPodcast')`,
14
14
  });
15
15
  const final = renderElement(node);
16
16
  return {