@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.
Files changed (72) hide show
  1. package/package.json +9 -14
  2. package/src/client/sitecore-astro-client.ts +0 -45
  3. package/src/context.ts +14 -16
  4. package/src/env.d.ts +1 -1
  5. package/src/sharedTypes/component-props.ts +0 -10
  6. package/src/tools/generate-map.ts +9 -21
  7. package/src/client/sitecore-astro-client.test.ts +0 -292
  8. package/src/components/AstroImage.astro.test.ts +0 -541
  9. package/src/components/Date.astro.test.ts +0 -197
  10. package/src/components/EditingScripts.astro.test.ts +0 -267
  11. package/src/components/ErrorBoundary.astro.test.ts +0 -252
  12. package/src/components/ErrorComponent.astro.test.ts +0 -31
  13. package/src/components/FieldMetadata.astro.test.ts +0 -40
  14. package/src/components/File.astro.test.ts +0 -68
  15. package/src/components/HiddenRendering.astro.test.ts +0 -36
  16. package/src/components/Image.astro.test.ts +0 -438
  17. package/src/components/Link.astro.test.ts +0 -261
  18. package/src/components/MissingComponent.astro.test.ts +0 -21
  19. package/src/components/Placeholder/Placeholder.astro.test.ts +0 -1088
  20. package/src/components/Placeholder/PlaceholderMetadata.astro.test.ts +0 -228
  21. package/src/components/Placeholder/PlaceholderUtils.astro.test.ts +0 -149
  22. package/src/components/Placeholder/placeholder-utils.test.ts +0 -309
  23. package/src/components/RichText.astro.test.ts +0 -205
  24. package/src/components/Text.astro.test.ts +0 -273
  25. package/src/config/define-config.test.ts +0 -526
  26. package/src/config-cli/define-cli-config.test.ts +0 -88
  27. package/src/editing/editing-config-middleware.test.ts +0 -164
  28. package/src/editing/editing-render-middleware.test.ts +0 -1143
  29. package/src/editing/render-middleware.test.ts +0 -57
  30. package/src/editing/utils.test.ts +0 -1212
  31. package/src/enhancers/WithEmptyFieldEditingComponent.astro.test.ts +0 -380
  32. package/src/enhancers/WithFieldMetadata.astro.test.ts +0 -113
  33. package/src/middleware/middleware.test.ts +0 -520
  34. package/src/middleware/multisite-middleware.test.ts +0 -667
  35. package/src/middleware/robots-middleware.test.ts +0 -129
  36. package/src/middleware/sitemap-middleware.test.ts +0 -184
  37. package/src/services/component-props-service.ts +0 -183
  38. package/src/tests/astro-helpers.ts +0 -61
  39. package/src/tests/helpers.ts +0 -46
  40. package/src/tests/personalizeData.ts +0 -63
  41. package/src/tests/test-components/CustomErrorComponent.astro +0 -3
  42. package/src/tests/test-components/CustomHiddenRendering.astro +0 -10
  43. package/src/tests/test-components/CustomMissingComponent.astro +0 -9
  44. package/src/tests/test-components/DownloadCallout.astro +0 -12
  45. package/src/tests/test-components/EmptyFieldEditingComponent.astro +0 -5
  46. package/src/tests/test-components/ErrorBoundaryWithError.astro +0 -10
  47. package/src/tests/test-components/Home.astro +0 -12
  48. package/src/tests/test-components/SxaRichText.astro +0 -23
  49. package/src/tests/test-components/SxaRichTextDefault.astro +0 -7
  50. package/src/tests/test-components/SxaRichTextWithTitle.astro +0 -8
  51. package/src/tests/test-components/TestComponent.astro +0 -9
  52. package/src/tests/test-components/TestComponentWithError.astro +0 -4
  53. package/src/tests/test-components/TestComponentWithField.astro +0 -17
  54. package/src/tests/test-components/TestHeader.astro +0 -8
  55. package/src/tests/test-components/TestLogo.astro +0 -5
  56. package/src/tests/test-components/TestParentWrapperComponent.astro +0 -5
  57. package/src/tests/test-components/TestWrapperComponent.astro +0 -5
  58. package/src/tests/test-components/map-components/Bar.astro +0 -0
  59. package/src/tests/test-components/map-components/Baz.astro +0 -0
  60. package/src/tests/test-components/map-components/Foo.astro +0 -0
  61. package/src/tests/test-components/map-components/Hero.variant.astro +0 -0
  62. package/src/tests/test-components/map-components/NotComponent.bsx +0 -0
  63. package/src/tests/test-components/map-components/Qux.astro +0 -0
  64. package/src/tests/test-components/map-components/folded/Folded.astro +0 -0
  65. package/src/tests/test-components/map-components/folded/random-file-2.docx +0 -0
  66. package/src/tests/test-components/map-components/random-file.txt +0 -0
  67. package/src/tests/test-data/metadata-data.ts +0 -86
  68. package/src/tests/test-data/normal-mode-data.ts +0 -466
  69. package/src/tests/vitest.setup.ts +0 -4
  70. package/src/tools/templating/components.test.ts +0 -318
  71. package/src/tools/templating/default-component.test.ts +0 -31
  72. 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,5 +0,0 @@
1
- ---
2
-
3
- ---
4
-
5
- <span class="empty-field-value-placeholder">Custom Empty field value</span>
@@ -1,10 +0,0 @@
1
- ---
2
- import ErrorBoundary from '../../components/ErrorBoundary.astro';
3
- import TestComponentWithError from './TestComponentWithError.astro';
4
-
5
- const props = Astro.props;
6
-
7
- ---
8
- <ErrorBoundary {...props}>
9
- <TestComponentWithError />
10
- </ErrorBoundary>
@@ -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,7 +0,0 @@
1
- ---
2
- const props = Astro.props;
3
- ---
4
-
5
- <div class={`rendering-variant ${props.params.styles}`}>
6
- <span class="default">Rich text</span>
7
- </div>
@@ -1,8 +0,0 @@
1
- ---
2
- const props = Astro.props;
3
- ---
4
-
5
- <div class={`rendering-variant ${props.params.styles}`}>
6
- <div class="title">{props.fields.Title.value}</div>
7
- <span class="text">{props.fields.Text.value}</span>
8
- </div>
@@ -1,9 +0,0 @@
1
- ---
2
-
3
- ---
4
-
5
- <div>
6
- <h1>hi</h1>
7
- <h2>foo</h2>
8
- <p>bar</p>
9
- </div>
@@ -1,4 +0,0 @@
1
- ---
2
- throw Error("an error occured");
3
- ---
4
- <></>
@@ -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>
@@ -1,8 +0,0 @@
1
- ---
2
- import Placeholder from '../../components/Placeholder/Placeholder.astro';
3
- const { rendering } = Astro.props;
4
-
5
- ---
6
- <div class="header-wrapper">
7
- <Placeholder name="logo" rendering={rendering} />
8
- </div>
@@ -1,5 +0,0 @@
1
- ---
2
-
3
- ---
4
-
5
- <div class="Logo-mock"></div>
@@ -1,5 +0,0 @@
1
- ---
2
- ---
3
- <div class="parent-wrapper">
4
- <slot />
5
- </div>
@@ -1,5 +0,0 @@
1
- ---
2
- ---
3
- <div class="wrapper">
4
- <slot />
5
- </div>
@@ -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
- });