@sitecore-content-sdk/nextjs 1.3.0-canary.9 → 1.4.0-canary.2

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 (234) hide show
  1. package/README.md +11 -11
  2. package/dist/cjs/client/index.js +10 -10
  3. package/dist/cjs/client/models.js +2 -2
  4. package/dist/cjs/client/sitecore-nextjs-client.js +160 -156
  5. package/dist/cjs/components/BYOCWrapper.js +31 -30
  6. package/dist/cjs/components/ComponentPropsContext.js +66 -59
  7. package/dist/cjs/components/FEaaSWrapper.js +33 -32
  8. package/dist/cjs/components/Link.js +117 -90
  9. package/dist/cjs/components/NextImage.js +66 -62
  10. package/dist/cjs/components/Placeholder.js +55 -50
  11. package/dist/cjs/components/RichText.js +133 -128
  12. package/dist/cjs/config/define-config.js +26 -25
  13. package/dist/cjs/config/index.js +5 -5
  14. package/dist/cjs/config-cli/define-cli-config.js +40 -39
  15. package/dist/cjs/config-cli/index.js +5 -5
  16. package/dist/cjs/editing/codegen/import-map.js +129 -118
  17. package/dist/cjs/editing/codegen/index.js +6 -6
  18. package/dist/cjs/editing/constants.js +10 -10
  19. package/dist/cjs/editing/editing-config-middleware.js +70 -69
  20. package/dist/cjs/editing/editing-render-middleware.js +145 -144
  21. package/dist/cjs/editing/feaas-render-middleware.js +102 -101
  22. package/dist/cjs/editing/index.js +19 -19
  23. package/dist/cjs/editing/render-middleware.js +46 -46
  24. package/dist/cjs/editing/utils.js +260 -257
  25. package/dist/cjs/index.js +132 -131
  26. package/dist/cjs/middleware/app-router-multisite-middleware.js +41 -20
  27. package/dist/cjs/middleware/index.js +30 -30
  28. package/dist/cjs/middleware/locale-middleware.js +85 -84
  29. package/dist/cjs/middleware/middleware.js +195 -192
  30. package/dist/cjs/middleware/multisite-middleware.js +141 -118
  31. package/dist/cjs/middleware/personalize-middleware.js +240 -236
  32. package/dist/cjs/middleware/redirects-middleware.js +323 -297
  33. package/dist/cjs/middleware/robots-middleware.js +45 -44
  34. package/dist/cjs/middleware/sitemap-middleware.js +50 -49
  35. package/dist/cjs/monitoring/healthcheck-middleware.js +31 -30
  36. package/dist/cjs/monitoring/index.js +5 -5
  37. package/dist/cjs/route-handler/editing-config-route-handler.js +110 -106
  38. package/dist/cjs/route-handler/editing-render-route-handler.js +270 -165
  39. package/dist/cjs/route-handler/index.js +11 -11
  40. package/dist/cjs/route-handler/robots-route-handler.js +69 -68
  41. package/dist/cjs/route-handler/sitemap-route-handler.js +66 -65
  42. package/dist/cjs/search/index.js +17 -0
  43. package/dist/cjs/services/component-props-service.js +142 -138
  44. package/dist/cjs/sharedTypes/component-props.js +2 -2
  45. package/dist/cjs/sharedTypes/sitecore-page-props.js +2 -2
  46. package/dist/cjs/site/index.js +5 -5
  47. package/dist/cjs/tools/codegen/import-map.js +15 -0
  48. package/dist/cjs/tools/component-props.loader.js +95 -95
  49. package/dist/cjs/tools/generate-map.js +317 -317
  50. package/dist/cjs/tools/index.js +14 -13
  51. package/dist/cjs/tools/templating/byoc-component.js +36 -36
  52. package/dist/cjs/tools/templating/constants.js +7 -7
  53. package/dist/cjs/tools/templating/default-component.js +35 -35
  54. package/dist/cjs/tools/templating/utils.js +200 -0
  55. package/dist/cjs/utils/index.js +14 -14
  56. package/dist/cjs/utils/utils.js +82 -73
  57. package/dist/esm/client/index.js +2 -2
  58. package/dist/esm/client/models.js +1 -1
  59. package/dist/esm/client/sitecore-nextjs-client.js +156 -152
  60. package/dist/esm/components/BYOCWrapper.js +27 -26
  61. package/dist/esm/components/ComponentPropsContext.js +28 -21
  62. package/dist/esm/components/FEaaSWrapper.js +29 -28
  63. package/dist/esm/components/Link.js +78 -51
  64. package/dist/esm/components/NextImage.js +60 -56
  65. package/dist/esm/components/Placeholder.js +18 -13
  66. package/dist/esm/components/RichText.js +96 -91
  67. package/dist/esm/config/define-config.js +21 -20
  68. package/dist/esm/config/index.js +1 -1
  69. package/dist/esm/config-cli/define-cli-config.js +36 -35
  70. package/dist/esm/config-cli/index.js +1 -1
  71. package/dist/esm/editing/codegen/import-map.js +92 -81
  72. package/dist/esm/editing/codegen/index.js +1 -1
  73. package/dist/esm/editing/constants.js +7 -7
  74. package/dist/esm/editing/editing-config-middleware.js +66 -65
  75. package/dist/esm/editing/editing-render-middleware.js +141 -140
  76. package/dist/esm/editing/feaas-render-middleware.js +98 -97
  77. package/dist/esm/editing/index.js +6 -6
  78. package/dist/esm/editing/render-middleware.js +42 -42
  79. package/dist/esm/editing/utils.js +246 -243
  80. package/dist/esm/index.js +25 -25
  81. package/dist/esm/middleware/app-router-multisite-middleware.js +37 -16
  82. package/dist/esm/middleware/index.js +11 -11
  83. package/dist/esm/middleware/locale-middleware.js +81 -80
  84. package/dist/esm/middleware/middleware.js +189 -186
  85. package/dist/esm/middleware/multisite-middleware.js +137 -114
  86. package/dist/esm/middleware/personalize-middleware.js +236 -232
  87. package/dist/esm/middleware/redirects-middleware.js +316 -290
  88. package/dist/esm/middleware/robots-middleware.js +41 -40
  89. package/dist/esm/middleware/sitemap-middleware.js +46 -45
  90. package/dist/esm/monitoring/healthcheck-middleware.js +27 -26
  91. package/dist/esm/monitoring/index.js +1 -1
  92. package/dist/esm/route-handler/editing-config-route-handler.js +106 -102
  93. package/dist/esm/route-handler/editing-render-route-handler.js +265 -160
  94. package/dist/esm/route-handler/index.js +4 -4
  95. package/dist/esm/route-handler/robots-route-handler.js +65 -64
  96. package/dist/esm/route-handler/sitemap-route-handler.js +63 -62
  97. package/dist/esm/search/index.js +1 -0
  98. package/dist/esm/services/component-props-service.js +135 -131
  99. package/dist/esm/sharedTypes/component-props.js +1 -1
  100. package/dist/esm/sharedTypes/sitecore-page-props.js +1 -1
  101. package/dist/esm/site/index.js +1 -1
  102. package/dist/esm/tools/codegen/import-map.js +11 -0
  103. package/dist/esm/tools/component-props.loader.js +59 -59
  104. package/dist/esm/tools/generate-map.js +279 -279
  105. package/dist/esm/tools/index.js +3 -2
  106. package/dist/esm/tools/templating/byoc-component.js +30 -30
  107. package/dist/esm/tools/templating/constants.js +4 -4
  108. package/dist/esm/tools/templating/default-component.js +29 -29
  109. package/dist/esm/tools/templating/utils.js +190 -0
  110. package/dist/esm/utils/index.js +3 -3
  111. package/dist/esm/utils/utils.js +74 -65
  112. package/package.json +87 -13
  113. package/search.d.ts +1 -0
  114. package/types/client/index.d.ts +3 -2
  115. package/types/client/index.d.ts.map +1 -0
  116. package/types/client/models.d.ts +9 -8
  117. package/types/client/models.d.ts.map +1 -0
  118. package/types/client/sitecore-nextjs-client.d.ts +68 -63
  119. package/types/client/sitecore-nextjs-client.d.ts.map +1 -0
  120. package/types/components/BYOCWrapper.d.ts +16 -14
  121. package/types/components/BYOCWrapper.d.ts.map +1 -0
  122. package/types/components/ComponentPropsContext.d.ts +30 -18
  123. package/types/components/ComponentPropsContext.d.ts.map +1 -0
  124. package/types/components/FEaaSWrapper.d.ts +17 -15
  125. package/types/components/FEaaSWrapper.d.ts.map +1 -0
  126. package/types/components/Link.d.ts +25 -15
  127. package/types/components/Link.d.ts.map +1 -0
  128. package/types/components/NextImage.d.ts +11 -6
  129. package/types/components/NextImage.d.ts.map +1 -0
  130. package/types/components/Placeholder.d.ts +14 -8
  131. package/types/components/Placeholder.d.ts.map +1 -0
  132. package/types/components/RichText.d.ts +35 -25
  133. package/types/components/RichText.d.ts.map +1 -0
  134. package/types/config/define-config.d.ts +42 -38
  135. package/types/config/define-config.d.ts.map +1 -0
  136. package/types/config/index.d.ts +2 -1
  137. package/types/config/index.d.ts.map +1 -0
  138. package/types/config-cli/define-cli-config.d.ts +10 -8
  139. package/types/config-cli/define-cli-config.d.ts.map +1 -0
  140. package/types/config-cli/index.d.ts +2 -1
  141. package/types/config-cli/index.d.ts.map +1 -0
  142. package/types/editing/codegen/import-map.d.ts +15 -3
  143. package/types/editing/codegen/import-map.d.ts.map +1 -0
  144. package/types/editing/codegen/index.d.ts +3 -2
  145. package/types/editing/codegen/index.d.ts.map +1 -0
  146. package/types/editing/constants.d.ts +8 -7
  147. package/types/editing/constants.d.ts.map +1 -0
  148. package/types/editing/editing-config-middleware.d.ts +37 -31
  149. package/types/editing/editing-config-middleware.d.ts.map +1 -0
  150. package/types/editing/editing-render-middleware.d.ts +47 -44
  151. package/types/editing/editing-render-middleware.d.ts.map +1 -0
  152. package/types/editing/feaas-render-middleware.d.ts +35 -32
  153. package/types/editing/feaas-render-middleware.d.ts.map +1 -0
  154. package/types/editing/index.d.ts +7 -6
  155. package/types/editing/index.d.ts.map +1 -0
  156. package/types/editing/render-middleware.d.ts +26 -25
  157. package/types/editing/render-middleware.d.ts.map +1 -0
  158. package/types/editing/utils.d.ts +110 -106
  159. package/types/editing/utils.d.ts.map +1 -0
  160. package/types/index.d.ts +25 -24
  161. package/types/index.d.ts.map +1 -0
  162. package/types/middleware/app-router-multisite-middleware.d.ts +28 -13
  163. package/types/middleware/app-router-multisite-middleware.d.ts.map +1 -0
  164. package/types/middleware/index.d.ts +12 -11
  165. package/types/middleware/index.d.ts.map +1 -0
  166. package/types/middleware/locale-middleware.d.ts +35 -32
  167. package/types/middleware/locale-middleware.d.ts.map +1 -0
  168. package/types/middleware/middleware.d.ts +135 -127
  169. package/types/middleware/middleware.d.ts.map +1 -0
  170. package/types/middleware/multisite-middleware.d.ts +54 -37
  171. package/types/middleware/multisite-middleware.d.ts.map +1 -0
  172. package/types/middleware/personalize-middleware.d.ts +81 -65
  173. package/types/middleware/personalize-middleware.d.ts.map +1 -0
  174. package/types/middleware/redirects-middleware.d.ts +68 -65
  175. package/types/middleware/redirects-middleware.d.ts.map +1 -0
  176. package/types/middleware/robots-middleware.d.ts +15 -13
  177. package/types/middleware/robots-middleware.d.ts.map +1 -0
  178. package/types/middleware/sitemap-middleware.d.ts +16 -14
  179. package/types/middleware/sitemap-middleware.d.ts.map +1 -0
  180. package/types/monitoring/healthcheck-middleware.d.ts +14 -12
  181. package/types/monitoring/healthcheck-middleware.d.ts.map +1 -0
  182. package/types/monitoring/index.d.ts +2 -1
  183. package/types/monitoring/index.d.ts.map +1 -0
  184. package/types/route-handler/editing-config-route-handler.d.ts +30 -24
  185. package/types/route-handler/editing-config-route-handler.d.ts.map +1 -0
  186. package/types/route-handler/editing-render-route-handler.d.ts +33 -25
  187. package/types/route-handler/editing-render-route-handler.d.ts.map +1 -0
  188. package/types/route-handler/index.d.ts +5 -4
  189. package/types/route-handler/index.d.ts.map +1 -0
  190. package/types/route-handler/robots-route-handler.d.ts +30 -28
  191. package/types/route-handler/robots-route-handler.d.ts.map +1 -0
  192. package/types/route-handler/sitemap-route-handler.d.ts +30 -28
  193. package/types/route-handler/sitemap-route-handler.d.ts.map +1 -0
  194. package/types/search/index.d.ts +2 -0
  195. package/types/search/index.d.ts.map +1 -0
  196. package/types/services/component-props-service.d.ts +62 -57
  197. package/types/services/component-props-service.d.ts.map +1 -0
  198. package/types/sharedTypes/component-props.d.ts +62 -47
  199. package/types/sharedTypes/component-props.d.ts.map +1 -0
  200. package/types/sharedTypes/sitecore-page-props.d.ts +14 -9
  201. package/types/sharedTypes/sitecore-page-props.d.ts.map +1 -0
  202. package/types/site/index.d.ts +2 -1
  203. package/types/site/index.d.ts.map +1 -0
  204. package/types/tools/codegen/import-map.d.ts +10 -0
  205. package/types/tools/codegen/import-map.d.ts.map +1 -0
  206. package/types/tools/component-props.loader.d.ts +8 -7
  207. package/types/tools/component-props.loader.d.ts.map +1 -0
  208. package/types/tools/generate-map.d.ts +26 -24
  209. package/types/tools/generate-map.d.ts.map +1 -0
  210. package/types/tools/index.d.ts +4 -2
  211. package/types/tools/index.d.ts.map +1 -0
  212. package/types/tools/templating/byoc-component.d.ts +3 -2
  213. package/types/tools/templating/byoc-component.d.ts.map +1 -0
  214. package/types/tools/templating/constants.d.ts +5 -4
  215. package/types/tools/templating/constants.d.ts.map +1 -0
  216. package/types/tools/templating/default-component.d.ts +3 -2
  217. package/types/tools/templating/default-component.d.ts.map +1 -0
  218. package/types/tools/templating/utils.d.ts +44 -0
  219. package/types/tools/templating/utils.d.ts.map +1 -0
  220. package/types/utils/index.d.ts +4 -3
  221. package/types/utils/index.d.ts.map +1 -0
  222. package/types/utils/utils.d.ts +34 -24
  223. package/types/utils/utils.d.ts.map +1 -0
  224. package/client.js +0 -1
  225. package/codegen.js +0 -1
  226. package/config-cli.js +0 -1
  227. package/config.js +0 -1
  228. package/editing.js +0 -1
  229. package/middleware.js +0 -1
  230. package/monitoring.js +0 -1
  231. package/route-handler.js +0 -1
  232. package/site.js +0 -1
  233. package/tools.js +0 -1
  234. package/utils.js +0 -1
@@ -1,28 +1,30 @@
1
- import { SitecoreClient } from "@sitecore-content-sdk/core/client";
2
- import { SiteInfo } from "@sitecore-content-sdk/core/site";
3
- import { NextRequest } from "next/server";
4
- type RouteHandlerOptions = {
5
- /**
6
- * Sitecore client instance.
7
- */
8
- client: SitecoreClient;
9
- /**
10
- * Sites configuration for resolving the site by host.
11
- */
12
- sites: SiteInfo[];
13
- /**
14
- * The number of seconds after which the cache should be revalidated.
15
- * Pass false to cache indefinitely.
16
- * Default is 60 seconds.
17
- */
18
- revalidate?: number | false;
19
- };
20
- /**
21
- * Creates a route handler to serve the sitemap.xml file.
22
- * @param {RouteHandlerOptions} options - The options for the route handler.
23
- * @returns The route handler.
24
- */
25
- export declare function createSitemapRouteHandler(options: RouteHandlerOptions): {
26
- GET: (req: NextRequest) => Promise<Response>;
27
- };
28
- export {};
1
+ import { SitecoreClient } from "@sitecore-content-sdk/core/client";
2
+ import { SiteInfo } from "@sitecore-content-sdk/core/site";
3
+ import { NextRequest } from "next/server";
4
+ type RouteHandlerOptions = {
5
+ /**
6
+ * Sitecore client instance.
7
+ */
8
+ client: SitecoreClient;
9
+ /**
10
+ * Sites configuration for resolving the site by host.
11
+ */
12
+ sites: SiteInfo[];
13
+ /**
14
+ * The number of seconds after which the cache should be revalidated.
15
+ * Pass false to cache indefinitely.
16
+ * Default is 60 seconds.
17
+ */
18
+ revalidate?: number | false;
19
+ };
20
+ /**
21
+ * Creates a route handler to serve the sitemap.xml file.
22
+ * @param {RouteHandlerOptions} options - The options for the route handler.
23
+ * @returns The route handler.
24
+ * @public
25
+ */
26
+ export declare function createSitemapRouteHandler(options: RouteHandlerOptions): {
27
+ GET: (req: NextRequest) => Promise<Response>;
28
+ };
29
+ export {};
30
+ //# sourceMappingURL=sitemap-route-handler.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sitemap-route-handler.d.ts","sourceRoot":"","sources":["../../src/route-handler/sitemap-route-handler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAqB,MAAM,mCAAmC,CAAC;AACtF,OAAO,EAAE,QAAQ,EAAgB,MAAM,iCAAiC,CAAC;AAEzE,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAG1C,KAAK,mBAAmB,GAAG;IACzB;;OAEG;IACH,MAAM,EAAE,cAAc,CAAC;IACvB;;OAEG;IACH,KAAK,EAAE,QAAQ,EAAE,CAAC;IAClB;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC;CAC7B,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,mBAAmB;eAyB5C,WAAW;EAgCpC"}
@@ -0,0 +1,2 @@
1
+ export * from '@sitecore-content-sdk/react/search';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/search/index.ts"],"names":[],"mappings":"AAAA,cAAc,oCAAoC,CAAC"}
@@ -1,57 +1,62 @@
1
- import { LayoutServiceData, ComponentRendering, PlaceholdersData } from '@sitecore-content-sdk/core/layout';
2
- import { ComponentPropsCollection, ComponentPropsFetchFunction, NextContext, NextjsContentSdkComponent } from '../sharedTypes/component-props';
3
- import { ComponentMap } from '@sitecore-content-sdk/react';
4
- export type FetchComponentPropsArguments = {
5
- layoutData: LayoutServiceData;
6
- context: NextContext;
7
- components: ComponentMap<NextjsContentSdkComponent>;
8
- };
9
- export type ComponentPropsRequest = {
10
- fetch: ComponentPropsFetchFunction;
11
- layoutData: LayoutServiceData;
12
- rendering: ComponentRendering;
13
- context: NextContext;
14
- };
15
- export declare class ComponentPropsService {
16
- fetchComponentProps(params: FetchComponentPropsArguments): Promise<ComponentPropsCollection>;
17
- /**
18
- * Go through layout service data, check all renderings using displayName, which should make some side effects.
19
- * Write result in requests variable
20
- * @param {object} params params
21
- * @param {PlaceholdersData} [params.placeholders]
22
- * @param {ComponentMap} params.components
23
- * @param {LayoutServiceData} params.layoutData
24
- * @param {NextContext} params.context
25
- * @param {ComponentPropsRequest[]} params.requests
26
- * @returns {ComponentPropsRequest[]} array of requests
27
- */
28
- protected collectRequests(params: {
29
- placeholders?: PlaceholdersData;
30
- components: ComponentMap<NextjsContentSdkComponent>;
31
- layoutData: LayoutServiceData;
32
- context: NextContext;
33
- requests?: ComponentPropsRequest[];
34
- }): Promise<ComponentPropsRequest[]>;
35
- /**
36
- * Execute request for component props
37
- * @param {ComponentPropsRequest[]} requests requests
38
- * @returns {Promise<ComponentPropsCollection>} requests result
39
- */
40
- protected execRequests(requests: ComponentPropsRequest[]): Promise<ComponentPropsCollection>;
41
- /**
42
- * Take renderings from all placeholders and returns a flat array of renderings.
43
- * @example
44
- * const placeholders = {
45
- * x1: [{ uid: 1 }, { uid: 2 }],
46
- * x2: [{ uid: 11 }, { uid: 22 }]
47
- * }
48
- *
49
- * flatRenderings(placeholders);
50
- *
51
- * RESULT: [{ uid: 1 }, { uid: 2 }, { uid: 11 }, { uid: 22 }]
52
- * @param {PlaceholdersData} placeholders placeholders
53
- * @returns {ComponentRendering[]} renderings
54
- */
55
- protected flatRenderings(placeholders: PlaceholdersData): ComponentRendering[];
56
- private getModule;
57
- }
1
+ import { LayoutServiceData, ComponentRendering, PlaceholdersData } from '@sitecore-content-sdk/core/layout';
2
+ import { ComponentPropsCollection, ComponentPropsFetchFunction, NextContext, NextjsContentSdkComponent } from '../sharedTypes/component-props';
3
+ import { ComponentMap } from '@sitecore-content-sdk/react';
4
+ export type FetchComponentPropsArguments = {
5
+ layoutData: LayoutServiceData;
6
+ context: NextContext;
7
+ components: ComponentMap<NextjsContentSdkComponent>;
8
+ };
9
+ export type ComponentPropsRequest = {
10
+ fetch: ComponentPropsFetchFunction;
11
+ layoutData: LayoutServiceData;
12
+ rendering: ComponentRendering;
13
+ context: NextContext;
14
+ };
15
+ /**
16
+ * The service for fetching component props.
17
+ * @public
18
+ */
19
+ export declare class ComponentPropsService {
20
+ fetchComponentProps(params: FetchComponentPropsArguments): Promise<ComponentPropsCollection>;
21
+ /**
22
+ * Go through layout service data, check all renderings using displayName, which should make some side effects.
23
+ * Write result in requests variable
24
+ * @param {object} params params
25
+ * @param {PlaceholdersData} [params.placeholders]
26
+ * @param {ComponentMap} params.components
27
+ * @param {LayoutServiceData} params.layoutData
28
+ * @param {NextContext} params.context
29
+ * @param {ComponentPropsRequest[]} params.requests
30
+ * @returns {ComponentPropsRequest[]} array of requests
31
+ */
32
+ protected collectRequests(params: {
33
+ placeholders?: PlaceholdersData;
34
+ components: ComponentMap<NextjsContentSdkComponent>;
35
+ layoutData: LayoutServiceData;
36
+ context: NextContext;
37
+ requests?: ComponentPropsRequest[];
38
+ }): Promise<ComponentPropsRequest[]>;
39
+ /**
40
+ * Execute request for component props
41
+ * @param {ComponentPropsRequest[]} requests requests
42
+ * @returns {Promise<ComponentPropsCollection>} requests result
43
+ */
44
+ protected execRequests(requests: ComponentPropsRequest[]): Promise<ComponentPropsCollection>;
45
+ /**
46
+ * Take renderings from all placeholders and returns a flat array of renderings.
47
+ * @example
48
+ * const placeholders = {
49
+ * x1: [{ uid: 1 }, { uid: 2 }],
50
+ * x2: [{ uid: 11 }, { uid: 22 }]
51
+ * }
52
+ *
53
+ * flatRenderings(placeholders);
54
+ *
55
+ * RESULT: [{ uid: 1 }, { uid: 2 }, { uid: 11 }, { uid: 22 }]
56
+ * @param {PlaceholdersData} placeholders placeholders
57
+ * @returns {ComponentRendering[]} renderings
58
+ */
59
+ protected flatRenderings(placeholders: PlaceholdersData): ComponentRendering[];
60
+ private getModule;
61
+ }
62
+ //# sourceMappingURL=component-props-service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"component-props-service.d.ts","sourceRoot":"","sources":["../../src/services/component-props-service.ts"],"names":[],"mappings":"AACA,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,gBAAgB,EACjB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EACL,wBAAwB,EACxB,2BAA2B,EAC3B,WAAW,EACX,yBAAyB,EAC1B,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAE3D,MAAM,MAAM,4BAA4B,GAAG;IACzC,UAAU,EAAE,iBAAiB,CAAC;IAC9B,OAAO,EAAE,WAAW,CAAC;IACrB,UAAU,EAAE,YAAY,CAAC,yBAAyB,CAAC,CAAC;CACrD,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG;IAClC,KAAK,EAAE,2BAA2B,CAAC;IACnC,UAAU,EAAE,iBAAiB,CAAC;IAC9B,SAAS,EAAE,kBAAkB,CAAC;IAC9B,OAAO,EAAE,WAAW,CAAC;CACtB,CAAC;AAEF;;;GAGG;AACH,qBAAa,qBAAqB;IAC1B,mBAAmB,CACvB,MAAM,EAAE,4BAA4B,GACnC,OAAO,CAAC,wBAAwB,CAAC;IAWpC;;;;;;;;;;OAUG;cACa,eAAe,CAAC,MAAM,EAAE;QACtC,YAAY,CAAC,EAAE,gBAAgB,CAAC;QAChC,UAAU,EAAE,YAAY,CAAC,yBAAyB,CAAC,CAAC;QACpD,UAAU,EAAE,iBAAiB,CAAC;QAC9B,OAAO,EAAE,WAAW,CAAC;QACrB,QAAQ,CAAC,EAAE,qBAAqB,EAAE,CAAC;KACpC,GAAG,OAAO,CAAC,qBAAqB,EAAE,CAAC;IAsCpC;;;;OAIG;cACa,YAAY,CAC1B,QAAQ,EAAE,qBAAqB,EAAE,GAChC,OAAO,CAAC,wBAAwB,CAAC;IAsCpC;;;;;;;;;;;;;OAaG;IACH,SAAS,CAAC,cAAc,CAAC,YAAY,EAAE,gBAAgB,GAAG,kBAAkB,EAAE;YAYhE,SAAS;CAWxB"}
@@ -1,47 +1,62 @@
1
- import { GetServerSidePropsContext, GetStaticPropsContext } from 'next';
2
- import { ComponentRendering, LayoutServiceData } from '@sitecore-content-sdk/core/layout';
3
- import { ReactContentSdkComponent } from '@sitecore-content-sdk/react';
4
- export type ComponentPropsError = {
5
- error: string;
6
- componentName: string;
7
- };
8
- /**
9
- * Shape of component props storage
10
- */
11
- export type ComponentPropsCollection = {
12
- [componentUid: string]: unknown | ComponentPropsError;
13
- };
14
- export type NextContext = GetServerSidePropsContext | GetStaticPropsContext;
15
- /**
16
- * Type of side effect function which could be invoked on component level (getComponentServerProps)
17
- */
18
- export type ComponentPropsFetchFunction<FetchedProps = unknown> = {
19
- (rendering: ComponentRendering, layoutData: LayoutServiceData, context: NextContext): Promise<FetchedProps>;
20
- };
21
- /**
22
- * Defines the shape of a data-fetching function used at the component level.
23
- *
24
- * This function can be used in both **Server-Side Rendering (SSR)** and **Static Site Generation (SSG)** contexts.
25
- * It enables component-specific data loading that integrates with Next.js rendering flows.
26
- *
27
- * The returned props are passed directly to the component at render time.
28
- */
29
- export type GetComponentServerProps = ComponentPropsFetchFunction;
30
- /**
31
- * Represents a nextjs component import
32
- */
33
- export type NextjsContentSdkComponent = ReactContentSdkComponent & {
34
- /**
35
- * Defines the shape of a data-fetching function used at the component level.
36
- *
37
- * This function can be used in both **Server-Side Rendering (SSR)** and **Static Site Generation (SSG)** contexts.
38
- * It enables component-specific data loading that integrates with Next.js rendering flows.
39
- *
40
- * The returned props are passed directly to the component at render time.
41
- */
42
- getComponentServerProps?: GetComponentServerProps;
43
- /**
44
- * Optional dynamic import for lazy components - allows component props retrieval
45
- */
46
- dynamicModule?: () => Promise<ReactContentSdkComponent>;
47
- };
1
+ import { GetServerSidePropsContext, GetStaticPropsContext } from 'next';
2
+ import { ComponentRendering, LayoutServiceData } from '@sitecore-content-sdk/core/layout';
3
+ import { ReactContentSdkComponent } from '@sitecore-content-sdk/react';
4
+ /**
5
+ * The interface for the component props error.
6
+ * @public
7
+ */
8
+ export type ComponentPropsError = {
9
+ error: string;
10
+ componentName: string;
11
+ };
12
+ /**
13
+ * Shape of component props storage
14
+ * @public
15
+ */
16
+ export type ComponentPropsCollection = {
17
+ [componentUid: string]: unknown | ComponentPropsError;
18
+ };
19
+ export type NextContext = GetServerSidePropsContext | GetStaticPropsContext;
20
+ /**
21
+ * Type of side effect function which could be invoked on component level (getComponentServerProps)
22
+ */
23
+ export type ComponentPropsFetchFunction<FetchedProps = unknown> = {
24
+ (rendering: ComponentRendering, layoutData: LayoutServiceData, context: NextContext): Promise<FetchedProps>;
25
+ };
26
+ /**
27
+ * Defines the shape of a data-fetching function used at the component level.
28
+ *
29
+ * This function can be used in both **Server-Side Rendering (SSR)** and **Static Site Generation (SSG)** contexts.
30
+ * It enables component-specific data loading that integrates with Next.js rendering flows.
31
+ *
32
+ * The returned props are passed directly to the component at render time.
33
+ * @public
34
+ */
35
+ export type GetComponentServerProps = ComponentPropsFetchFunction;
36
+ /**
37
+ * Represents a nextjs component import
38
+ * @public
39
+ */
40
+ export type NextjsContentSdkComponent = ReactContentSdkComponent & {
41
+ /**
42
+ * Defines the shape of a data-fetching function used at the component level.
43
+ *
44
+ * This function can be used in both **Server-Side Rendering (SSR)** and **Static Site Generation (SSG)** contexts.
45
+ * It enables component-specific data loading that integrates with Next.js rendering flows.
46
+ *
47
+ * The returned props are passed directly to the component at render time.
48
+ */
49
+ getComponentServerProps?: GetComponentServerProps;
50
+ /**
51
+ * Optional dynamic import for lazy components - allows component props retrieval
52
+ */
53
+ dynamicModule?: () => Promise<ReactContentSdkComponent>;
54
+ /**
55
+ * Indicates the type of the component in a Next.js app router context.
56
+ * - 'client': The component contains client only api's and will be rendered on the client side.
57
+ * - 'server': The component contains server only api's and will be rendered on the server side.
58
+ * - 'universal': The component is isomorphic and can be rendered on both server and client.
59
+ */
60
+ componentType?: 'client' | 'server' | 'universal';
61
+ };
62
+ //# sourceMappingURL=component-props.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"component-props.d.ts","sourceRoot":"","sources":["../../src/sharedTypes/component-props.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,qBAAqB,EAAE,MAAM,MAAM,CAAC;AACxE,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAC1F,OAAO,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAC;AAEvE;;;GAGG;AACH,MAAM,MAAM,mBAAmB,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,aAAa,EAAE,MAAM,CAAA;CAAE,CAAC;AAE3E;;;GAGG;AACH,MAAM,MAAM,wBAAwB,GAAG;IACrC,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,GAAG,mBAAmB,CAAC;CACvD,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG,yBAAyB,GAAG,qBAAqB,CAAC;AAE5E;;GAEG;AACH,MAAM,MAAM,2BAA2B,CAAC,YAAY,GAAG,OAAO,IAAI;IAChE,CACE,SAAS,EAAE,kBAAkB,EAC7B,UAAU,EAAE,iBAAiB,EAC7B,OAAO,EAAE,WAAW,GACnB,OAAO,CAAC,YAAY,CAAC,CAAC;CAC1B,CAAC;AAEF;;;;;;;;GAQG;AACH,MAAM,MAAM,uBAAuB,GAAG,2BAA2B,CAAC;AAElE;;;GAGG;AACH,MAAM,MAAM,yBAAyB,GAAG,wBAAwB,GAAG;IACjE;;;;;;;OAOG;IACH,uBAAuB,CAAC,EAAE,uBAAuB,CAAC;IAClD;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,OAAO,CAAC,wBAAwB,CAAC,CAAC;IACxD;;;;;OAKG;IACH,aAAa,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,WAAW,CAAC;CACnD,CAAC"}
@@ -1,9 +1,14 @@
1
- import { DictionaryPhrases } from '@sitecore-content-sdk/core/i18n';
2
- import { Page } from '@sitecore-content-sdk/core/client';
3
- import { ComponentPropsCollection } from './component-props';
4
- export type SitecorePageProps = {
5
- page: Page | null;
6
- dictionary?: DictionaryPhrases;
7
- componentProps?: ComponentPropsCollection;
8
- notFound?: boolean;
9
- };
1
+ import { DictionaryPhrases } from '@sitecore-content-sdk/core/i18n';
2
+ import { Page } from '@sitecore-content-sdk/core/client';
3
+ import { ComponentPropsCollection } from './component-props';
4
+ /**
5
+ * The interface for the application page props.
6
+ * @public
7
+ */
8
+ export type SitecorePageProps = {
9
+ page: Page | null;
10
+ dictionary?: DictionaryPhrases;
11
+ componentProps?: ComponentPropsCollection;
12
+ notFound?: boolean;
13
+ };
14
+ //# sourceMappingURL=sitecore-page-props.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sitecore-page-props.d.ts","sourceRoot":"","sources":["../../src/sharedTypes/sitecore-page-props.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,EAAE,IAAI,EAAE,MAAM,mCAAmC,CAAC;AACzD,OAAO,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAE7D;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC9B,IAAI,EAAE,IAAI,GAAG,IAAI,CAAC;IAClB,UAAU,CAAC,EAAE,iBAAiB,CAAC;IAC/B,cAAc,CAAC,EAAE,wBAAwB,CAAC;IAC1C,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC"}
@@ -1 +1,2 @@
1
- export { SiteResolver, SiteInfo } from '@sitecore-content-sdk/core/site';
1
+ export { SiteResolver, SiteInfo } from '@sitecore-content-sdk/core/site';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/site/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC"}
@@ -0,0 +1,10 @@
1
+ import { WriteImportMapArgs } from '@sitecore-content-sdk/core/tools';
2
+ /**
3
+ * Entry point function for generating import-map. Parses provided paths and outputs the modules and imports from those files into .sitecore/import-map.ts
4
+ * @param {WriteImportMapArgs} args include/exclude paths settings to be processed for import-map, and the Sitecore configuration.
5
+ * @public
6
+ */
7
+ export declare const writeImportMap: (args: WriteImportMapArgs) => ({ scConfig }?: {
8
+ scConfig?: import("@sitecore-content-sdk/core/config").SitecoreConfig;
9
+ }) => Promise<void>;
10
+ //# sourceMappingURL=import-map.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"import-map.d.ts","sourceRoot":"","sources":["../../../src/tools/codegen/import-map.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,kBAAkB,EACnB,MAAM,kCAAkC,CAAC;AAO1C;;;;GAIG;AACH,eAAO,MAAM,cAAc,GAAI,MAAM,kBAAkB;YAS4jH,CAAC;mBADnnH,CAAC"}
@@ -1,7 +1,8 @@
1
- /**
2
- * Webpack loader to strip functions from the source code
3
- * Strips the `getComponentServerProps` function from the source code
4
- * @param {string} source file source code
5
- * @returns {string} output file source code with stripped functions
6
- */
7
- export default function componentPropsLoader(source: string): string;
1
+ /**
2
+ * Webpack loader to strip functions from the source code
3
+ * Strips the `getComponentServerProps` function from the source code
4
+ * @param {string} source file source code
5
+ * @returns {string} output file source code with stripped functions
6
+ */
7
+ export default function componentPropsLoader(source: string): string;
8
+ //# sourceMappingURL=component-props.loader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"component-props.loader.d.ts","sourceRoot":"","sources":["../../src/tools/component-props.loader.ts"],"names":[],"mappings":"AAIA;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,oBAAoB,CAAC,MAAM,EAAE,MAAM,UAiE1D"}
@@ -1,24 +1,26 @@
1
- import { GenerateMapFunction, EnhancedComponentMapTemplate } from '@sitecore-content-sdk/core/tools';
2
- export declare const defaultClientMapTemplate: EnhancedComponentMapTemplate;
3
- export type CollectFilter = 'all' | 'client' | 'server' | 'universal';
4
- /**
5
- * Generate and write componentMap.ts files based on provided params.
6
- *
7
- * When clientComponentMap is true, generates:
8
- * - component-map.ts : Full component map with all components (server, client, universal)
9
- * - component-map.client.ts : Client-safe map with only client + universal components
10
- *
11
- * When clientComponentMap is false, generates:
12
- * - component-map.ts : Single component map (traditional behavior)
13
- *
14
- * When includeVariants is true (in either mode):
15
- * - Includes component **variants** in the generated map(s) alongside base components
16
- * - Preserves the same client/server filtering rules (variants obey clientComponentMap filtering)
17
- * - Variant entries are emitted using the same naming/keys convention as their base components
18
- *
19
- * Template Customization:
20
- * - mapTemplate: Custom template for main component map (works for both single and dual map modes)
21
- * - clientMapTemplate: Custom template for client component map (only used when clientComponentMap is true)
22
- * @param {GenerateMapArgs} param0 params for generateMap
23
- */
24
- export declare const generateMap: GenerateMapFunction;
1
+ import { GenerateMapFunction, EnhancedComponentMapTemplate } from '@sitecore-content-sdk/core/tools';
2
+ export declare const defaultClientMapTemplate: EnhancedComponentMapTemplate;
3
+ export type CollectFilter = 'all' | 'client' | 'server' | 'universal';
4
+ /**
5
+ * Generate and write componentMap.ts files based on provided params.
6
+ *
7
+ * When clientComponentMap is true, generates:
8
+ * - component-map.ts : Full component map with all components (server, client, universal)
9
+ * - component-map.client.ts : Client-safe map with only client + universal components
10
+ *
11
+ * When clientComponentMap is false, generates:
12
+ * - component-map.ts : Single component map (traditional behavior)
13
+ *
14
+ * When includeVariants is true (in either mode):
15
+ * - Includes component **variants** in the generated map(s) alongside base components
16
+ * - Preserves the same client/server filtering rules (variants obey clientComponentMap filtering)
17
+ * - Variant entries are emitted using the same naming/keys convention as their base components
18
+ *
19
+ * Template Customization:
20
+ * - mapTemplate: Custom template for main component map (works for both single and dual map modes)
21
+ * - clientMapTemplate: Custom template for client component map (only used when clientComponentMap is true)
22
+ * @param {GenerateMapArgs} params - The parameters for the generateMap function.
23
+ * @public
24
+ */
25
+ export declare const generateMap: GenerateMapFunction;
26
+ //# sourceMappingURL=generate-map.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generate-map.d.ts","sourceRoot":"","sources":["../../src/tools/generate-map.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,mBAAmB,EAInB,4BAA4B,EAG7B,MAAM,kCAAkC,CAAC;AAsM1C,eAAO,MAAM,wBAAwB,EAAE,4BA4BtC,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG,KAAK,GAAG,QAAQ,GAAG,QAAQ,GAAG,WAAW,CAAC;AA6BtE;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,WAAW,EAAE,mBAkIzB,CAAC"}
@@ -1,2 +1,4 @@
1
- export { generateSites, GenerateSitesConfig, generateMetadata, ComponentFile, ComponentImport, getComponentList, PluginDefinition, generatePlugins, ModuleType, GenerateMapArgs, extractFiles, writeImportMap, } from '@sitecore-content-sdk/core/tools';
2
- export { generateMap } from './generate-map';
1
+ export { generateSites, GenerateSitesConfig, generateMetadata, ComponentFile, ComponentImport, getComponentList, PluginDefinition, generatePlugins, ModuleType, GenerateMapArgs, extractFiles, } from '@sitecore-content-sdk/core/tools';
2
+ export { generateMap } from './generate-map';
3
+ export { writeImportMap } from './codegen/import-map';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EACb,mBAAmB,EACnB,gBAAgB,EAChB,aAAa,EACb,eAAe,EACf,gBAAgB,EAChB,gBAAgB,EAChB,eAAe,EACf,UAAU,EACV,eAAe,EACf,YAAY,GACb,MAAM,kCAAkC,CAAC;AAE1C,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC"}
@@ -1,2 +1,3 @@
1
- import { ScaffoldTemplate } from '@sitecore-content-sdk/core/config';
2
- export declare const byocTemplate: ScaffoldTemplate;
1
+ import { ScaffoldTemplate } from '@sitecore-content-sdk/core/config';
2
+ export declare const byocTemplate: ScaffoldTemplate;
3
+ //# sourceMappingURL=byoc-component.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"byoc-component.d.ts","sourceRoot":"","sources":["../../../src/tools/templating/byoc-component.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAyB,MAAM,mCAAmC,CAAC;AAsE5F,eAAO,MAAM,YAAY,EAAE,gBAK1B,CAAC"}
@@ -1,4 +1,5 @@
1
- /**
2
- * The file extension for nextjs components
3
- */
4
- export declare const COMPONENT_FILE_EXTENSION = "tsx";
1
+ /**
2
+ * The file extension for nextjs components
3
+ */
4
+ export declare const COMPONENT_FILE_EXTENSION = "tsx";
5
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/tools/templating/constants.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,wBAAwB,QAAQ,CAAC"}
@@ -1,2 +1,3 @@
1
- import { ScaffoldTemplate } from '@sitecore-content-sdk/core/config';
2
- export declare const defaultTemplate: ScaffoldTemplate;
1
+ import { ScaffoldTemplate } from '@sitecore-content-sdk/core/config';
2
+ export declare const defaultTemplate: ScaffoldTemplate;
3
+ //# sourceMappingURL=default-component.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"default-component.d.ts","sourceRoot":"","sources":["../../../src/tools/templating/default-component.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAyB,MAAM,mCAAmC,CAAC;AA8C5F,eAAO,MAAM,eAAe,EAAE,gBAK7B,CAAC"}
@@ -0,0 +1,44 @@
1
+ import { ComponentFileWithType, ComponentType, RouterType } from '@sitecore-content-sdk/core/tools';
2
+ import { ModuleExports } from '@sitecore-content-sdk/core/tools';
3
+ /**
4
+ * Detects the Next.js router type (App Router or Pages Router) based on directory structure.
5
+ * @param {string} projectRoot - The project root directory. Defaults to current working directory.
6
+ * @returns {RouterType} 'app' if App Router is detected, 'pages' otherwise
7
+ * @internal
8
+ */
9
+ export declare function detectRouterType(projectRoot?: string): RouterType;
10
+ /**
11
+ * Detects the component type based on directives, imports, and router context.
12
+ * - Checks for 'use client' directive
13
+ * - Checks for explicit componentType export
14
+ * - Checks for server-only imports (next/headers, etc.)
15
+ * - Defaults to 'server' for App Router, 'universal' for Pages Router
16
+ * @param {string} filePath - Path to the component file
17
+ * @param {RouterType} [routerType] - Optional router type override. Auto-detected if not provided.
18
+ * @returns {ComponentType} 'server', 'client', or 'universal'
19
+ * @internal
20
+ */
21
+ export declare function detectComponentType(filePath: string, routerType?: RouterType): ComponentType;
22
+ /**
23
+ * Get list of components with detected types (server, client, or universal).
24
+ * @param {string[]} paths - Paths to search for components
25
+ * @param {string[]} [exclude] - Paths and glob patterns to exclude from final result
26
+ * @param {boolean} includeVariants - Whether to include variant components
27
+ * @param {RouterType} [routerType] - Optional router type override for type detection. Auto-detected if not provided.
28
+ * @returns {ComponentFileWithType[]} Array of components with their detected types
29
+ * @internal
30
+ */
31
+ export declare function getComponentListWithTypes(paths: string[], exclude?: string[], includeVariants?: boolean, routerType?: RouterType): ComponentFileWithType[];
32
+ /**
33
+ * React-specific import map template with 'use client' directive. Used in App Router.
34
+ * @param {Map<string, ModuleExports>} indexedImportMap import map to be processed into final import-map.client.ts file
35
+ * @returns {string} contents for resulting import map file
36
+ */
37
+ export declare function nextjsClientMapTemplate(indexedImportMap: Map<string, ModuleExports>): string;
38
+ /**
39
+ * React-specific import map template with 'use client' directive. Used in App Router.
40
+ * @param {Map<string, ModuleExports>} indexedImportMap import map to be processed into final import-map.client.ts file
41
+ * @returns {string} contents for resulting import map file
42
+ */
43
+ export declare function nextjsDefaultMapTemplate(indexedImportMap: Map<string, ModuleExports>): string;
44
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/tools/templating/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,aAAa,EAEb,UAAU,EACX,MAAM,kCAAkC,CAAC;AAG1C,OAAO,EAA4B,aAAa,EAAE,MAAM,kCAAkC,CAAC;AAE3F;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,WAAW,GAAE,MAAsB,GAAG,UAAU,CAehF;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,UAAU,GAAG,aAAa,CA0J5F;AAED;;;;;;;;GAQG;AACH,wBAAgB,yBAAyB,CACvC,KAAK,EAAE,MAAM,EAAE,EACf,OAAO,CAAC,EAAE,MAAM,EAAE,EAClB,eAAe,CAAC,EAAE,OAAO,EACzB,UAAU,CAAC,EAAE,UAAU,GACtB,qBAAqB,EAAE,CAQzB;AAED;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,gBAAgB,EAAE,GAAG,CAAC,MAAM,EAAE,aAAa,CAAC,UAGnF;AAED;;;;GAIG;AACH,wBAAgB,wBAAwB,CAAC,gBAAgB,EAAE,GAAG,CAAC,MAAM,EAAE,aAAa,CAAC,UAEpF"}
@@ -1,3 +1,4 @@
1
- export { handleEditorFastRefresh, extractPath, isServerSidePropsContext, parseRewriteHeader, } from './utils';
2
- export { tryParseEnvValue, resolveUrl } from '@sitecore-content-sdk/core/utils';
3
- export { isEditorActive, resetEditorChromes } from '@sitecore-content-sdk/core/editing';
1
+ export { handleEditorFastRefresh, extractPath, isServerSidePropsContext, parseRewriteHeader, } from './utils';
2
+ export { tryParseEnvValue, resolveUrl } from '@sitecore-content-sdk/core/utils';
3
+ export { isEditorActive, resetEditorChromes } from '@sitecore-content-sdk/core/editing';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EACvB,WAAW,EACX,wBAAwB,EACxB,kBAAkB,GACnB,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AAChF,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAC"}
@@ -1,24 +1,34 @@
1
- import { GetServerSidePropsContext, GetStaticPropsContext } from 'next';
2
- /**
3
- * Since Sitecore editors do not support Fast Refresh:
4
- * 1. Subscribe on events provided by webpack.
5
- * 2. Reset editor chromes when build is finished
6
- * @param {boolean} [forceReload] force page reload instead of reset chromes
7
- */
8
- export declare const handleEditorFastRefresh: (forceReload?: boolean) => void;
9
- export declare const getEditingSecret: () => string;
10
- export declare const extractPath: (context: GetStaticPropsContext | GetServerSidePropsContext) => string;
11
- /**
12
- * Determines whether context is GetServerSidePropsContext (SSR) or GetStaticPropsContext (SSG)
13
- * @param {GetServerSidePropsContext | GetStaticPropsContext} context
14
- */
15
- export declare const isServerSidePropsContext: (context: GetServerSidePropsContext | GetStaticPropsContext) => context is GetServerSidePropsContext;
16
- /**
17
- * For App Router application, extracts the site and locale information from the rewrite header which is in format /[site]/[locale]/[...path].
18
- * @param {Headers} headers - The `Headers` object containing the rewrite header.
19
- * @returns An object containing the `site` and `locale` extracted from the rewrite header.
20
- */
21
- export declare const parseRewriteHeader: (headers: Headers) => {
22
- site: string;
23
- locale: string;
24
- };
1
+ import { GetServerSidePropsContext, GetStaticPropsContext } from 'next';
2
+ /**
3
+ * Since Sitecore editors do not support Fast Refresh:
4
+ * 1. Subscribe on events provided by webpack.
5
+ * 2. Reset editor chromes when build is finished
6
+ * @param {boolean} [forceReload] force page reload instead of reset chromes
7
+ * @public
8
+ */
9
+ export declare const handleEditorFastRefresh: (forceReload?: boolean) => void;
10
+ export declare const getEditingSecret: () => string;
11
+ /**
12
+ * Extracts the path from the Next.js context parameters.
13
+ * @param {GetStaticPropsContext | GetServerSidePropsContext} context - The Next.js context parameters.
14
+ * @returns The extracted path.
15
+ * @public
16
+ */
17
+ export declare const extractPath: (context: GetStaticPropsContext | GetServerSidePropsContext) => string;
18
+ /**
19
+ * Determines whether context is GetServerSidePropsContext (SSR) or GetStaticPropsContext (SSG)
20
+ * @param {GetServerSidePropsContext | GetStaticPropsContext} context
21
+ * @public
22
+ */
23
+ export declare const isServerSidePropsContext: (context: GetServerSidePropsContext | GetStaticPropsContext) => context is GetServerSidePropsContext;
24
+ /**
25
+ * For App Router application, extracts the site and locale information from the rewrite header which is in format /[site]/[locale]/[...path].
26
+ * @param {Headers} headers - The `Headers` object containing the rewrite header.
27
+ * @returns An object containing the `site` and `locale` extracted from the rewrite header.
28
+ * @public
29
+ */
30
+ export declare const parseRewriteHeader: (headers: Headers) => {
31
+ site: string;
32
+ locale: string;
33
+ };
34
+ //# sourceMappingURL=utils.d.ts.map