@pronto-tools-and-more/components-renderer 9.6.0 → 9.8.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": "9.6.0",
3
+ "version": "9.8.0",
4
4
  "description": "",
5
5
  "main": "src/componentsRendererMain.js",
6
6
  "type": "module",
@@ -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 {
@@ -4,8 +4,16 @@ import * as LoadRoutes from "../LoadRoutes/LoadRoutes.js";
4
4
  import * as LoadSwc from "../LoadSwc/LoadSwc.js";
5
5
  import * as RenderView from "../RenderView/RenderView.js";
6
6
  import * as SetAssetDir from "../SetAssetDir/SetAssetDir.js";
7
+ import * as SetPathPrefix from "../SetPathPrefix/SetPathPrefix.js";
7
8
  import * as SwcNodePath from "../SwcNodePath/SwcNodePath.js";
8
9
 
10
+ const getRealPathPrefix = (isBuild, pathPrefix) => {
11
+ if (!isBuild) {
12
+ return "/#";
13
+ }
14
+ return pathPrefix;
15
+ };
16
+
9
17
  export const renderViews = async (
10
18
  componentsPathMain,
11
19
  tsconfigPath,
@@ -20,6 +28,9 @@ export const renderViews = async (
20
28
  const assetDir = isBuild ? "resource://dynamic/storefront/assets" : "";
21
29
  SetAssetDir.setAssetDir(assetDir);
22
30
 
31
+ const realPathPrefix = getRealPathPrefix(isBuild, pathPrefix);
32
+ SetPathPrefix.setPathPrefix(realPathPrefix);
33
+
23
34
  const module = await LoadRoutes.loadRoutes(componentsPathMain);
24
35
  const values = Object.values(module);
25
36
  // TODO return views string instead of json for faster performance?
@@ -0,0 +1,8 @@
1
+ import * as Assert from "../Assert/Assert.js";
2
+
3
+ export const setPathPrefix = (path) => {
4
+ Assert.string(path);
5
+ // TODO use import meta env once supported
6
+ // @ts-ignore
7
+ process.env.PATH_PREFIX = path;
8
+ };