@pronto-tools-and-more/components-renderer 14.18.0 → 14.20.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pronto-tools-and-more/components-renderer",
3
- "version": "14.18.0",
3
+ "version": "14.20.0",
4
4
  "description": "",
5
5
  "main": "src/componentsRendererMain.js",
6
6
  "type": "module",
@@ -1,6 +1,22 @@
1
1
  import { leanDom } from "../Config/Config.js";
2
2
  import * as FakeNode from "../FakeNode/FakeNode.js";
3
3
 
4
+ const getTap = (parent) => {
5
+ if (parent && parent.attributes && parent.attributes.href) {
6
+ if (parent.attributes.href.startsWith("https://")) {
7
+ return {
8
+ url: parent.attributes.href,
9
+ type: "navigate",
10
+ };
11
+ }
12
+ return {
13
+ path: parent.attributes.href,
14
+ type: "navigate",
15
+ };
16
+ }
17
+ return undefined;
18
+ };
19
+
4
20
  export const createFakeSection = (children) => {
5
21
  if (leanDom) {
6
22
  const [parent, ...realChildren] = children;
@@ -13,11 +29,13 @@ export const createFakeSection = (children) => {
13
29
  content: parent.content,
14
30
  };
15
31
  }
32
+ const tap = getTap(parent);
16
33
  return {
17
34
  type: "section",
18
35
  tag: parent.tag,
19
36
  class: parent.class,
20
- // attributes: parent.attributes, not supported sadly
37
+ tap,
38
+ // attributes: parent.attributes, //not supported sadly
21
39
  content: [...realChildren],
22
40
  };
23
41
  }
@@ -1,6 +1,9 @@
1
1
  import * as Assert from "../Assert/Assert.js";
2
2
 
3
3
  export const setPathPrefix = (path) => {
4
+ if (!path) {
5
+ return;
6
+ }
4
7
  Assert.string(path);
5
8
  // TODO use import meta env once supported
6
9
  // @ts-ignore