@pronto-tools-and-more/components-renderer 9.8.0 → 9.10.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.8.0",
3
+ "version": "9.10.0",
4
4
  "description": "",
5
5
  "main": "src/componentsRendererMain.js",
6
6
  "type": "module",
@@ -16,7 +16,7 @@
16
16
  "@lvce-editor/assert": "^1.3.0",
17
17
  "@lvce-editor/ipc": "^11.1.0",
18
18
  "@lvce-editor/json-rpc": "^5.0.0",
19
- "@lvce-editor/verror": "^1.4.0",
19
+ "@lvce-editor/verror": "^1.5.0",
20
20
  "@swc-node/register": "^1.10.9"
21
21
  },
22
22
  "devDependencies": {
@@ -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
+ };