@pronto-tools-and-more/components-renderer 10.3.0 → 10.4.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.4.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) => {
@@ -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
+ };