@exdst-sitecore-content-sdk/astro 0.0.23 → 0.0.25
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 +9 -14
- package/src/client/sitecore-astro-client.ts +0 -45
- package/src/context.ts +14 -16
- package/src/env.d.ts +1 -1
- package/src/sharedTypes/component-props.ts +0 -10
- package/src/tools/generate-map.ts +9 -21
- package/src/client/sitecore-astro-client.test.ts +0 -292
- package/src/components/AstroImage.astro.test.ts +0 -541
- package/src/components/Date.astro.test.ts +0 -197
- package/src/components/EditingScripts.astro.test.ts +0 -267
- package/src/components/ErrorBoundary.astro.test.ts +0 -252
- package/src/components/ErrorComponent.astro.test.ts +0 -31
- package/src/components/FieldMetadata.astro.test.ts +0 -40
- package/src/components/File.astro.test.ts +0 -68
- package/src/components/HiddenRendering.astro.test.ts +0 -36
- package/src/components/Image.astro.test.ts +0 -438
- package/src/components/Link.astro.test.ts +0 -261
- package/src/components/MissingComponent.astro.test.ts +0 -21
- package/src/components/Placeholder/Placeholder.astro.test.ts +0 -1088
- package/src/components/Placeholder/PlaceholderMetadata.astro.test.ts +0 -228
- package/src/components/Placeholder/PlaceholderUtils.astro.test.ts +0 -149
- package/src/components/Placeholder/placeholder-utils.test.ts +0 -309
- package/src/components/RichText.astro.test.ts +0 -205
- package/src/components/Text.astro.test.ts +0 -273
- package/src/config/define-config.test.ts +0 -526
- package/src/config-cli/define-cli-config.test.ts +0 -88
- package/src/editing/editing-config-middleware.test.ts +0 -164
- package/src/editing/editing-render-middleware.test.ts +0 -1143
- package/src/editing/render-middleware.test.ts +0 -57
- package/src/editing/utils.test.ts +0 -1212
- package/src/enhancers/WithEmptyFieldEditingComponent.astro.test.ts +0 -380
- package/src/enhancers/WithFieldMetadata.astro.test.ts +0 -113
- package/src/middleware/middleware.test.ts +0 -520
- package/src/middleware/multisite-middleware.test.ts +0 -667
- package/src/middleware/robots-middleware.test.ts +0 -129
- package/src/middleware/sitemap-middleware.test.ts +0 -184
- package/src/services/component-props-service.ts +0 -183
- package/src/tests/astro-helpers.ts +0 -61
- package/src/tests/helpers.ts +0 -46
- package/src/tests/personalizeData.ts +0 -63
- package/src/tests/test-components/CustomErrorComponent.astro +0 -3
- package/src/tests/test-components/CustomHiddenRendering.astro +0 -10
- package/src/tests/test-components/CustomMissingComponent.astro +0 -9
- package/src/tests/test-components/DownloadCallout.astro +0 -12
- package/src/tests/test-components/EmptyFieldEditingComponent.astro +0 -5
- package/src/tests/test-components/ErrorBoundaryWithError.astro +0 -10
- package/src/tests/test-components/Home.astro +0 -12
- package/src/tests/test-components/SxaRichText.astro +0 -23
- package/src/tests/test-components/SxaRichTextDefault.astro +0 -7
- package/src/tests/test-components/SxaRichTextWithTitle.astro +0 -8
- package/src/tests/test-components/TestComponent.astro +0 -9
- package/src/tests/test-components/TestComponentWithError.astro +0 -4
- package/src/tests/test-components/TestComponentWithField.astro +0 -17
- package/src/tests/test-components/TestHeader.astro +0 -8
- package/src/tests/test-components/TestLogo.astro +0 -5
- package/src/tests/test-components/TestParentWrapperComponent.astro +0 -5
- package/src/tests/test-components/TestWrapperComponent.astro +0 -5
- package/src/tests/test-components/map-components/Bar.astro +0 -0
- package/src/tests/test-components/map-components/Baz.astro +0 -0
- package/src/tests/test-components/map-components/Foo.astro +0 -0
- package/src/tests/test-components/map-components/Hero.variant.astro +0 -0
- package/src/tests/test-components/map-components/NotComponent.bsx +0 -0
- package/src/tests/test-components/map-components/Qux.astro +0 -0
- package/src/tests/test-components/map-components/folded/Folded.astro +0 -0
- package/src/tests/test-components/map-components/folded/random-file-2.docx +0 -0
- package/src/tests/test-components/map-components/random-file.txt +0 -0
- package/src/tests/test-data/metadata-data.ts +0 -86
- package/src/tests/test-data/normal-mode-data.ts +0 -466
- package/src/tests/vitest.setup.ts +0 -4
- package/src/tools/templating/components.test.ts +0 -318
- package/src/tools/templating/default-component.test.ts +0 -31
- package/src/utils/utils.test.ts +0 -48
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
const props = Astro.props as {
|
|
3
|
-
[prop: string]: unknown;
|
|
4
|
-
fields?: { message?: { value?: string } };
|
|
5
|
-
extraDiv?: boolean;
|
|
6
|
-
};
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
<div class="download-callout-mock">
|
|
10
|
-
{props.fields?.message ? props.fields.message.value : ''}
|
|
11
|
-
{props.extraDiv ? <div class="extra">extra!</div> : null}
|
|
12
|
-
</div>
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
import Placeholder from '../../components/Placeholder/Placeholder.astro';
|
|
3
|
-
|
|
4
|
-
const { rendering, render, renderEach, renderEmpty, ...otherProps } =
|
|
5
|
-
Astro.props;
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
<div class="home-mock">
|
|
9
|
-
<Placeholder name="main" rendering={rendering} />
|
|
10
|
-
<Placeholder name="page-header" rendering={rendering} />
|
|
11
|
-
<Placeholder name="page-content" rendering={rendering} {...otherProps} />
|
|
12
|
-
</div>
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
import { Field } from '@sitecore-content-sdk/content/layout';
|
|
3
|
-
import SxaRichTextDefault from './SxaRichTextDefault.astro';
|
|
4
|
-
import SxaRichTextWithTitle from './SxaRichTextWithTitle.astro';
|
|
5
|
-
|
|
6
|
-
interface Fields {
|
|
7
|
-
Text: Field<string>;
|
|
8
|
-
Title: Field<string>;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
type RichTextProps = {
|
|
12
|
-
params: { [key: string]: string };
|
|
13
|
-
fields: Fields;
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
const props = Astro.props as RichTextProps;
|
|
17
|
-
const variantName = props.params.FieldNames ?? 'Default';
|
|
18
|
-
---
|
|
19
|
-
|
|
20
|
-
<>
|
|
21
|
-
{variantName === 'Default' && <SxaRichTextDefault {...props} />}
|
|
22
|
-
{variantName === 'WithTitle' && <SxaRichTextWithTitle {...props} />}
|
|
23
|
-
</>
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
type TestComponentProps = {
|
|
3
|
-
field?: {
|
|
4
|
-
value?: string;
|
|
5
|
-
metadata?: { [key: string]: unknown };
|
|
6
|
-
};
|
|
7
|
-
editable?: boolean;
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
const props = Astro.props as TestComponentProps;
|
|
11
|
-
---
|
|
12
|
-
|
|
13
|
-
<div>
|
|
14
|
-
<h1>{props.field?.value}</h1>
|
|
15
|
-
<h2>foo</h2>
|
|
16
|
-
<p>bar</p>
|
|
17
|
-
</div>
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
export const layoutData = {
|
|
2
|
-
sitecore: {
|
|
3
|
-
context: {
|
|
4
|
-
pageEditing: true,
|
|
5
|
-
},
|
|
6
|
-
route: {
|
|
7
|
-
name: 'main',
|
|
8
|
-
placeholders: {
|
|
9
|
-
main: [
|
|
10
|
-
{
|
|
11
|
-
uid: 'nested123',
|
|
12
|
-
componentName: 'Header',
|
|
13
|
-
placeholders: {
|
|
14
|
-
logo: [
|
|
15
|
-
{
|
|
16
|
-
uid: 'deep123',
|
|
17
|
-
componentName: 'Logo',
|
|
18
|
-
},
|
|
19
|
-
],
|
|
20
|
-
},
|
|
21
|
-
},
|
|
22
|
-
],
|
|
23
|
-
},
|
|
24
|
-
},
|
|
25
|
-
},
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
export const layoutDataWithEmptyPlaceholder = {
|
|
29
|
-
sitecore: {
|
|
30
|
-
context: {
|
|
31
|
-
pageEditing: true,
|
|
32
|
-
},
|
|
33
|
-
route: {
|
|
34
|
-
name: 'main',
|
|
35
|
-
placeholders: {
|
|
36
|
-
main: [],
|
|
37
|
-
},
|
|
38
|
-
},
|
|
39
|
-
},
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
export const layoutDataWithUnknownComponent = {
|
|
43
|
-
sitecore: {
|
|
44
|
-
context: {
|
|
45
|
-
pageEditing: true,
|
|
46
|
-
},
|
|
47
|
-
route: {
|
|
48
|
-
name: 'main',
|
|
49
|
-
placeholders: {
|
|
50
|
-
main: [
|
|
51
|
-
{
|
|
52
|
-
uid: '123',
|
|
53
|
-
componentName: 'Unknown',
|
|
54
|
-
},
|
|
55
|
-
],
|
|
56
|
-
},
|
|
57
|
-
},
|
|
58
|
-
},
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
export const layoutDataForNestedDynamicPlaceholder = (rootPhKey: string) => ({
|
|
62
|
-
sitecore: {
|
|
63
|
-
context: {
|
|
64
|
-
pageEditing: true,
|
|
65
|
-
},
|
|
66
|
-
route: {
|
|
67
|
-
name: 'main',
|
|
68
|
-
placeholders: {
|
|
69
|
-
[rootPhKey]: [
|
|
70
|
-
{
|
|
71
|
-
uid: 'nested123',
|
|
72
|
-
componentName: 'Header',
|
|
73
|
-
placeholders: {
|
|
74
|
-
logo: [
|
|
75
|
-
{
|
|
76
|
-
uid: 'deep123',
|
|
77
|
-
componentName: 'Logo',
|
|
78
|
-
},
|
|
79
|
-
],
|
|
80
|
-
},
|
|
81
|
-
},
|
|
82
|
-
],
|
|
83
|
-
},
|
|
84
|
-
},
|
|
85
|
-
},
|
|
86
|
-
});
|