@sitecore-content-sdk/nextjs 1.3.0-canary.21 → 1.3.0-canary.22
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/cjs/route-handler/editing-config-route-handler.js +4 -1
- package/dist/esm/route-handler/editing-config-route-handler.js +4 -1
- package/package.json +4 -4
- package/types/route-handler/editing-config-route-handler.d.ts +4 -0
- package/types/route-handler/editing-config-route-handler.d.ts.map +1 -1
|
@@ -23,7 +23,7 @@ const utils_2 = require("../utils/utils");
|
|
|
23
23
|
* @public
|
|
24
24
|
*/
|
|
25
25
|
const createEditingConfigRouteHandler = (options) => {
|
|
26
|
-
const { components, metadata } = options;
|
|
26
|
+
const { components, metadata, clientComponents } = options;
|
|
27
27
|
const validateRequest = (req) => {
|
|
28
28
|
const secret = req.nextUrl.searchParams.get(editing_1.QUERY_PARAM_EDITING_SECRET);
|
|
29
29
|
const corsHeaders = (0, utils_1.getEnforcedCorsHeaders)({
|
|
@@ -56,8 +56,11 @@ const createEditingConfigRouteHandler = (options) => {
|
|
|
56
56
|
});
|
|
57
57
|
}
|
|
58
58
|
const componentNames = Array.from(components.keys());
|
|
59
|
+
const clientComponentNames = clientComponents ? Array.from(clientComponents.keys()) : [];
|
|
59
60
|
const responseData = {
|
|
61
|
+
framework: 'nextjs-approuter',
|
|
60
62
|
components: componentNames,
|
|
63
|
+
clientComponents: clientComponentNames,
|
|
61
64
|
packages: metadata.packages,
|
|
62
65
|
editMode: layout_1.EditMode.Metadata,
|
|
63
66
|
};
|
|
@@ -20,7 +20,7 @@ import { getEditingSecret } from '../utils/utils';
|
|
|
20
20
|
* @public
|
|
21
21
|
*/
|
|
22
22
|
export const createEditingConfigRouteHandler = (options) => {
|
|
23
|
-
const { components, metadata } = options;
|
|
23
|
+
const { components, metadata, clientComponents } = options;
|
|
24
24
|
const validateRequest = (req) => {
|
|
25
25
|
const secret = req.nextUrl.searchParams.get(QUERY_PARAM_EDITING_SECRET);
|
|
26
26
|
const corsHeaders = getEnforcedCorsHeaders({
|
|
@@ -53,8 +53,11 @@ export const createEditingConfigRouteHandler = (options) => {
|
|
|
53
53
|
});
|
|
54
54
|
}
|
|
55
55
|
const componentNames = Array.from(components.keys());
|
|
56
|
+
const clientComponentNames = clientComponents ? Array.from(clientComponents.keys()) : [];
|
|
56
57
|
const responseData = {
|
|
58
|
+
framework: 'nextjs-approuter',
|
|
57
59
|
components: componentNames,
|
|
60
|
+
clientComponents: clientComponentNames,
|
|
58
61
|
packages: metadata.packages,
|
|
59
62
|
editMode: EditMode.Metadata,
|
|
60
63
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sitecore-content-sdk/nextjs",
|
|
3
|
-
"version": "1.3.0-canary.
|
|
3
|
+
"version": "1.3.0-canary.22",
|
|
4
4
|
"main": "dist/cjs/index.js",
|
|
5
5
|
"module": "dist/esm/index.js",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -91,15 +91,15 @@
|
|
|
91
91
|
},
|
|
92
92
|
"dependencies": {
|
|
93
93
|
"@babel/parser": "^7.27.2",
|
|
94
|
-
"@sitecore-content-sdk/core": "1.3.0-canary.
|
|
95
|
-
"@sitecore-content-sdk/react": "1.3.0-canary.
|
|
94
|
+
"@sitecore-content-sdk/core": "1.3.0-canary.22",
|
|
95
|
+
"@sitecore-content-sdk/react": "1.3.0-canary.22",
|
|
96
96
|
"recast": "^0.23.11",
|
|
97
97
|
"regex-parser": "^2.3.1",
|
|
98
98
|
"sync-disk-cache": "^2.1.0"
|
|
99
99
|
},
|
|
100
100
|
"description": "",
|
|
101
101
|
"types": "types/index.d.ts",
|
|
102
|
-
"gitHead": "
|
|
102
|
+
"gitHead": "a4694b7c21fb202316c9521f1c160e0b9075152b",
|
|
103
103
|
"files": [
|
|
104
104
|
"dist",
|
|
105
105
|
"types",
|
|
@@ -11,6 +11,10 @@ export type EditingConfigRouteHandlerOptions = {
|
|
|
11
11
|
* Application metadata
|
|
12
12
|
*/
|
|
13
13
|
metadata: Metadata;
|
|
14
|
+
/**
|
|
15
|
+
* Contains only client and universal components that can be used in client bundles
|
|
16
|
+
*/
|
|
17
|
+
clientComponents?: ComponentMap<NextjsContentSdkComponent>;
|
|
14
18
|
};
|
|
15
19
|
/**
|
|
16
20
|
* Creates a route handler for the editing config API route (e.g. '/api/editing/config')
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editing-config-route-handler.d.ts","sourceRoot":"","sources":["../../src/route-handler/editing-config-route-handler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAM1C,OAAO,EAAE,QAAQ,EAAE,MAAM,oCAAoC,CAAC;AAI9D,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAE3E,MAAM,MAAM,gCAAgC,GAAG;IAC7C;;OAEG;IACH,UAAU,EAAE,YAAY,CAAC,yBAAyB,CAAC,CAAC;IACpD;;OAEG;IACH,QAAQ,EAAE,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"editing-config-route-handler.d.ts","sourceRoot":"","sources":["../../src/route-handler/editing-config-route-handler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAM1C,OAAO,EAAE,QAAQ,EAAE,MAAM,oCAAoC,CAAC;AAI9D,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAE3E,MAAM,MAAM,gCAAgC,GAAG;IAC7C;;OAEG;IACH,UAAU,EAAE,YAAY,CAAC,yBAAyB,CAAC,CAAC;IACpD;;OAEG;IACH,QAAQ,EAAE,QAAQ,CAAC;IACnB;;OAEG;IACH,gBAAgB,CAAC,EAAE,YAAY,CAAC,yBAAyB,CAAC,CAAC;CAC5D,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,+BAA+B,GAAI,SAAS,gCAAgC;eAe/D,WAAW;mBAkEP,WAAW;CAkCxC,CAAC"}
|