create-sitecore-jss 22.2.0-canary.13 → 22.2.0-canary.15
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.
|
@@ -11,4 +11,4 @@ SITECORE_EDGE_CONTEXT_ID=
|
|
|
11
11
|
PROXY_HOST=http://localhost:3001
|
|
12
12
|
|
|
13
13
|
# Your XM Cloud Proxy server path is needed to build the app. The build output will be copied to the proxy server path.
|
|
14
|
-
PROXY_BUILD_PATH=<%- helper.relativeProxyAppDestination %>dist
|
|
14
|
+
PROXY_BUILD_PATH=<%- helper.relativeProxyAppDestination.replace(/\\/g, '/') %>dist
|
|
@@ -1,14 +1,9 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import {
|
|
3
2
|
ComponentParams,
|
|
4
3
|
ComponentRendering,
|
|
5
4
|
Placeholder,
|
|
6
|
-
useSitecoreContext,
|
|
7
5
|
} from '@sitecore-jss/sitecore-jss-nextjs';
|
|
8
|
-
|
|
9
|
-
const BACKGROUND_REG_EXP = new RegExp(
|
|
10
|
-
/[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}/gi
|
|
11
|
-
);
|
|
6
|
+
import React from 'react';
|
|
12
7
|
|
|
13
8
|
interface ComponentProps {
|
|
14
9
|
rendering: ComponentRendering & { params: ComponentParams };
|
|
@@ -16,22 +11,19 @@ interface ComponentProps {
|
|
|
16
11
|
}
|
|
17
12
|
|
|
18
13
|
const DefaultContainer = (props: ComponentProps): JSX.Element => {
|
|
19
|
-
const { sitecoreContext } = useSitecoreContext();
|
|
20
14
|
const containerStyles = props.params && props.params.Styles ? props.params.Styles : '';
|
|
21
15
|
const styles = `${props.params.GridParameters} ${containerStyles}`.trimEnd();
|
|
22
16
|
const phKey = `container-${props.params.DynamicPlaceholderId}`;
|
|
23
17
|
const id = props.params.RenderingIdentifier;
|
|
18
|
+
const mediaUrlPattern = new RegExp(/mediaurl=\"([^"]*)\"/, 'i');
|
|
24
19
|
let backgroundImage = props.params.BackgroundImage as string;
|
|
25
20
|
let backgroundStyle: { [key: string]: string } = {};
|
|
26
21
|
|
|
27
|
-
if (backgroundImage) {
|
|
28
|
-
const
|
|
29
|
-
|
|
30
|
-
?.match(BACKGROUND_REG_EXP)
|
|
31
|
-
?.pop()
|
|
32
|
-
?.replace(/-/gi, '')}`;
|
|
22
|
+
if (backgroundImage && backgroundImage.match(mediaUrlPattern)) {
|
|
23
|
+
const mediaUrl = backgroundImage.match(mediaUrlPattern)?.[1] || '';
|
|
24
|
+
|
|
33
25
|
backgroundStyle = {
|
|
34
|
-
backgroundImage: `url('${
|
|
26
|
+
backgroundImage: `url('${mediaUrl}')`,
|
|
35
27
|
};
|
|
36
28
|
}
|
|
37
29
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-sitecore-jss",
|
|
3
|
-
"version": "22.2.0-canary.
|
|
3
|
+
"version": "22.2.0-canary.15",
|
|
4
4
|
"description": "Sitecore JSS initializer",
|
|
5
5
|
"bin": "./dist/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -63,5 +63,5 @@
|
|
|
63
63
|
"ts-node": "^10.9.1",
|
|
64
64
|
"typescript": "~4.9.5"
|
|
65
65
|
},
|
|
66
|
-
"gitHead": "
|
|
66
|
+
"gitHead": "d8a1d8d58872e83def86d407ccefdbffd164ea5b"
|
|
67
67
|
}
|