@pronto-tools-and-more/components-renderer 9.5.0 → 9.7.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.5.0",
3
+ "version": "9.7.0",
4
4
  "description": "",
5
5
  "main": "src/componentsRendererMain.js",
6
6
  "type": "module",
@@ -9,6 +9,8 @@ export const renderCustomElementCollection = (element, renderElement) => {
9
9
  name: `$functions.id($context, 'collection-content', 'name')`,
10
10
  description: `$functions.id($context, 'collection-content', 'description')`,
11
11
  imageSrc: `$functions.id($context, 'collection-content', 'thumbnails', 'default')`,
12
+ slug: `$functions.id($context, 'collection-content', 'properties', 'slug')`,
13
+ metadataVideoPodcast: `$functions.id($context, 'collection-content', 'properties', 'metadataVideoPodcast')`,
12
14
  });
13
15
  const final = renderElement(node);
14
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
+ };