create-sitecore-jss 22.6.0-canary.4 → 22.6.0-canary.6
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/dist/templates/nextjs-sxa/src/components/ColumnSplitter.tsx +1 -1
- package/dist/templates/nextjs-sxa/src/components/Container.tsx +5 -5
- package/dist/templates/nextjs-sxa/src/components/Image.tsx +9 -9
- package/dist/templates/nextjs-sxa/src/components/LinkList.tsx +1 -1
- package/dist/templates/nextjs-sxa/src/components/Navigation.tsx +2 -2
- package/dist/templates/nextjs-sxa/src/components/PageContent.tsx +3 -3
- package/dist/templates/nextjs-sxa/src/components/Promo.tsx +3 -3
- package/dist/templates/nextjs-sxa/src/components/RichText.tsx +1 -1
- package/dist/templates/nextjs-sxa/src/components/RowSplitter.tsx +1 -1
- package/dist/templates/nextjs-sxa/src/components/Title.tsx +2 -2
- package/package.json +2 -2
|
@@ -11,7 +11,7 @@ interface ComponentProps {
|
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
export const Default = (props: ComponentProps): JSX.Element => {
|
|
14
|
-
const styles = `${props
|
|
14
|
+
const styles = `${props?.params?.GridParameters ?? ''} ${props?.params?.Styles ?? ''}`.trimEnd();
|
|
15
15
|
const columnWidths = [
|
|
16
16
|
props.params.ColumnWidth1,
|
|
17
17
|
props.params.ColumnWidth2,
|
|
@@ -11,12 +11,12 @@ interface ComponentProps {
|
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
const DefaultContainer = (props: ComponentProps): JSX.Element => {
|
|
14
|
-
const containerStyles = props
|
|
15
|
-
const styles = `${props
|
|
16
|
-
const phKey = `container-${props
|
|
17
|
-
const id = props
|
|
14
|
+
const containerStyles = props?.params?.Styles ?? '';
|
|
15
|
+
const styles = `${props?.params?.GridParameters} ${containerStyles}`.trimEnd();
|
|
16
|
+
const phKey = `container-${props?.params?.DynamicPlaceholderId}`;
|
|
17
|
+
const id = props?.params?.RenderingIdentifier;
|
|
18
18
|
const mediaUrlPattern = new RegExp(/mediaurl=\"([^"]*)\"/, 'i');
|
|
19
|
-
let backgroundImage = props
|
|
19
|
+
let backgroundImage = props?.params?.BackgroundImage as string;
|
|
20
20
|
let backgroundStyle: { [key: string]: string } = {};
|
|
21
21
|
|
|
22
22
|
if (backgroundImage && backgroundImage.match(mediaUrlPattern)) {
|
|
@@ -22,7 +22,7 @@ type ImageProps = {
|
|
|
22
22
|
};
|
|
23
23
|
|
|
24
24
|
const ImageDefault = (props: ImageProps): JSX.Element => (
|
|
25
|
-
<div className={`component image ${props
|
|
25
|
+
<div className={`component image ${props?.params?.styles}`.trimEnd()}>
|
|
26
26
|
<div className="component-content">
|
|
27
27
|
<span className="is-empty-hint">Image</span>
|
|
28
28
|
</div>
|
|
@@ -49,16 +49,16 @@ export const Banner = (props: ImageProps): JSX.Element => {
|
|
|
49
49
|
.replace(`height="${props?.fields?.Image?.value?.height}"`, 'height="100%"'),
|
|
50
50
|
}
|
|
51
51
|
: {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
52
|
+
...props.fields.Image,
|
|
53
|
+
value: {
|
|
54
|
+
...props.fields.Image.value,
|
|
55
|
+
style: { width: '100%', height: '100%' },
|
|
56
|
+
},
|
|
57
|
+
};
|
|
58
58
|
|
|
59
59
|
return (
|
|
60
60
|
<div
|
|
61
|
-
className={`component hero-banner ${props
|
|
61
|
+
className={`component hero-banner ${props?.params?.styles} ${classHeroBannerEmpty}`}
|
|
62
62
|
id={id ? id : undefined}
|
|
63
63
|
>
|
|
64
64
|
<div className="component-content sc-sxa-image-hero-banner" style={backgroundStyle}>
|
|
@@ -76,7 +76,7 @@ export const Default = (props: ImageProps): JSX.Element => {
|
|
|
76
76
|
const id = props.params.RenderingIdentifier;
|
|
77
77
|
|
|
78
78
|
return (
|
|
79
|
-
<div className={`component image ${props
|
|
79
|
+
<div className={`component image ${props?.params?.styles}`} id={id ? id : undefined}>
|
|
80
80
|
<div className="component-content">
|
|
81
81
|
{sitecoreContext.pageState === 'edit' || !props.fields.TargetUrl?.value?.href ? (
|
|
82
82
|
<Image />
|
|
@@ -52,7 +52,7 @@ const LinkListItem = (props: LinkListItemProps) => {
|
|
|
52
52
|
|
|
53
53
|
export const Default = (props: LinkListProps): JSX.Element => {
|
|
54
54
|
const datasource = props.fields?.data?.datasource;
|
|
55
|
-
const styles = `component link-list ${props
|
|
55
|
+
const styles = `component link-list ${props?.params?.styles}`.trimEnd();
|
|
56
56
|
const id = props.params.RenderingIdentifier;
|
|
57
57
|
|
|
58
58
|
if (datasource) {
|
|
@@ -52,7 +52,7 @@ export const Default = (props: NavigationProps): JSX.Element => {
|
|
|
52
52
|
const { sitecoreContext } = useSitecoreContext();
|
|
53
53
|
const styles =
|
|
54
54
|
props.params != null
|
|
55
|
-
? `${props.params.GridParameters ?? ''} ${props
|
|
55
|
+
? `${props.params.GridParameters ?? ''} ${props?.params?.Styles ?? ''}`.trimEnd()
|
|
56
56
|
: '';
|
|
57
57
|
const id = props.params != null ? props.params.RenderingIdentifier : null;
|
|
58
58
|
|
|
@@ -110,7 +110,7 @@ export const Default = (props: NavigationProps): JSX.Element => {
|
|
|
110
110
|
const NavigationList = (props: NavigationProps) => {
|
|
111
111
|
const { sitecoreContext } = useSitecoreContext();
|
|
112
112
|
const [active, setActive] = useState(false);
|
|
113
|
-
const classNameList = `${props
|
|
113
|
+
const classNameList = `${props?.fields?.Styles.concat('rel-level' + props.relativeLevel).join(
|
|
114
114
|
' '
|
|
115
115
|
)}`;
|
|
116
116
|
|
|
@@ -23,7 +23,7 @@ type ComponentContentProps = {
|
|
|
23
23
|
const ComponentContent = (props: ComponentContentProps) => {
|
|
24
24
|
const id = props.id;
|
|
25
25
|
return (
|
|
26
|
-
<div className={`component content ${props
|
|
26
|
+
<div className={`component content ${props?.styles}`} id={id ? id : undefined}>
|
|
27
27
|
<div className="component-content">
|
|
28
28
|
<div className="field-content">{props.children}</div>
|
|
29
29
|
</div>
|
|
@@ -37,7 +37,7 @@ export const Default = (props: PageContentProps): JSX.Element => {
|
|
|
37
37
|
|
|
38
38
|
if (!(props.fields && props.fields.Content) && !sitecoreContext?.route?.fields?.Content) {
|
|
39
39
|
return (
|
|
40
|
-
<div className={`component content ${props
|
|
40
|
+
<div className={`component content ${props?.params?.styles}`} id={id ? id : undefined}>
|
|
41
41
|
<div className="component-content">
|
|
42
42
|
<div className="field-content">[Content]</div>
|
|
43
43
|
</div>
|
|
@@ -50,7 +50,7 @@ export const Default = (props: PageContentProps): JSX.Element => {
|
|
|
50
50
|
: sitecoreContext?.route?.fields?.Content) as RichTextField;
|
|
51
51
|
|
|
52
52
|
return (
|
|
53
|
-
<ComponentContent styles={props
|
|
53
|
+
<ComponentContent styles={props?.params?.styles} id={id}>
|
|
54
54
|
<JssRichText field={field} />
|
|
55
55
|
</ComponentContent>
|
|
56
56
|
);
|
|
@@ -21,7 +21,7 @@ type PromoProps = {
|
|
|
21
21
|
};
|
|
22
22
|
|
|
23
23
|
const PromoDefaultComponent = (props: PromoProps): JSX.Element => (
|
|
24
|
-
<div className={`component promo ${props
|
|
24
|
+
<div className={`component promo ${props?.params?.styles}`}>
|
|
25
25
|
<div className="component-content">
|
|
26
26
|
<span className="is-empty-hint">Promo</span>
|
|
27
27
|
</div>
|
|
@@ -32,7 +32,7 @@ export const Default = (props: PromoProps): JSX.Element => {
|
|
|
32
32
|
const id = props.params.RenderingIdentifier;
|
|
33
33
|
if (props.fields) {
|
|
34
34
|
return (
|
|
35
|
-
<div className={`component promo ${props
|
|
35
|
+
<div className={`component promo ${props?.params?.styles}`} id={id ? id : undefined}>
|
|
36
36
|
<div className="component-content">
|
|
37
37
|
<div className="field-promoicon">
|
|
38
38
|
<JssImage field={props.fields.PromoIcon} />
|
|
@@ -59,7 +59,7 @@ export const WithText = (props: PromoProps): JSX.Element => {
|
|
|
59
59
|
const id = props.params.RenderingIdentifier;
|
|
60
60
|
if (props.fields) {
|
|
61
61
|
return (
|
|
62
|
-
<div className={`component promo ${props
|
|
62
|
+
<div className={`component promo ${props?.params?.styles}`} id={id ? id : undefined}>
|
|
63
63
|
<div className="component-content">
|
|
64
64
|
<div className="field-promoicon">
|
|
65
65
|
<JssImage field={props.fields.PromoIcon} />
|
|
@@ -20,7 +20,7 @@ export const Default = (props: RichTextProps): JSX.Element => {
|
|
|
20
20
|
|
|
21
21
|
return (
|
|
22
22
|
<div
|
|
23
|
-
className={`component rich-text ${props
|
|
23
|
+
className={`component rich-text ${props?.params?.styles.trimEnd()}`}
|
|
24
24
|
id={id ? id : undefined}
|
|
25
25
|
>
|
|
26
26
|
<div className="component-content">{text}</div>
|
|
@@ -11,7 +11,7 @@ interface ComponentProps {
|
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
export const Default = (props: ComponentProps): JSX.Element => {
|
|
14
|
-
const styles = `${props
|
|
14
|
+
const styles = `${props?.params?.GridParameters ?? ''} ${props?.params?.Styles ?? ''}`.trimEnd();
|
|
15
15
|
const rowStyles = [
|
|
16
16
|
props.params.Styles1,
|
|
17
17
|
props.params.Styles2,
|
|
@@ -52,7 +52,7 @@ type ComponentContentProps = {
|
|
|
52
52
|
const ComponentContent = (props: ComponentContentProps) => {
|
|
53
53
|
const id = props.id;
|
|
54
54
|
return (
|
|
55
|
-
<div className={`component title ${props
|
|
55
|
+
<div className={`component title ${props?.styles}`} id={id ? id : undefined}>
|
|
56
56
|
<div className="component-content">
|
|
57
57
|
<div className="field-title">{props.children}</div>
|
|
58
58
|
</div>
|
|
@@ -79,7 +79,7 @@ export const Default = (props: TitleProps): JSX.Element => {
|
|
|
79
79
|
}
|
|
80
80
|
|
|
81
81
|
return (
|
|
82
|
-
<ComponentContent styles={props
|
|
82
|
+
<ComponentContent styles={props?.params?.styles} id={props?.params?.RenderingIdentifier}>
|
|
83
83
|
<>
|
|
84
84
|
{sitecoreContext.pageEditing ? (
|
|
85
85
|
<Text field={text} />
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-sitecore-jss",
|
|
3
|
-
"version": "22.6.0-canary.
|
|
3
|
+
"version": "22.6.0-canary.6",
|
|
4
4
|
"description": "Sitecore JSS initializer",
|
|
5
5
|
"bin": "./dist/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -65,5 +65,5 @@
|
|
|
65
65
|
"ts-node": "^10.9.1",
|
|
66
66
|
"typescript": "~5.6.3"
|
|
67
67
|
},
|
|
68
|
-
"gitHead": "
|
|
68
|
+
"gitHead": "0c0ae9af266a3f50b304bda295730c42eea38c12"
|
|
69
69
|
}
|