@sitecore-content-sdk/react 2.3.0-canary.20260804090000 → 2.3.0-canary.20260807092858
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/components/Placeholder/AppPlaceholder.js +1 -1
- package/dist/cjs/components/Placeholder/PlaceholderMetadata.js +6 -2
- package/dist/cjs/components/Placeholder/placeholder-utils.js +6 -1
- package/dist/esm/components/Placeholder/AppPlaceholder.js +1 -1
- package/dist/esm/components/Placeholder/PlaceholderMetadata.js +6 -2
- package/dist/esm/components/Placeholder/placeholder-utils.js +6 -1
- package/package.json +7 -7
- package/types/components/Placeholder/PlaceholderMetadata.d.ts.map +1 -1
- package/types/components/Placeholder/placeholder-utils.d.ts +5 -0
- package/types/components/Placeholder/placeholder-utils.d.ts.map +1 -1
|
@@ -59,7 +59,7 @@ const getPlaceholderComponents = (placeholderProps, placeholderRenderings) => {
|
|
|
59
59
|
return transformedComponents;
|
|
60
60
|
}
|
|
61
61
|
return [
|
|
62
|
-
react_1.default.createElement(PlaceholderMetadata_1.PlaceholderMetadata, { key: rendering.uid
|
|
62
|
+
react_1.default.createElement(PlaceholderMetadata_1.PlaceholderMetadata, { key: rendering.uid || `placeholder-metadata-${name}`, placeholderName: name, rendering: rendering }, transformedComponents),
|
|
63
63
|
];
|
|
64
64
|
};
|
|
65
65
|
/**
|
|
@@ -61,9 +61,13 @@ const PlaceholderMetadata = ({ rendering, placeholderName, children, componentRu
|
|
|
61
61
|
}
|
|
62
62
|
return attributes;
|
|
63
63
|
};
|
|
64
|
+
// suppressHydrationWarning: Pages Editor attaches attributes to these chrome markers
|
|
65
|
+
// directly in the DOM (outside of React), which can happen before hydration completes.
|
|
66
|
+
// That mutation is expected in edit mode and isn't something app code can control, so it
|
|
67
|
+
// shouldn't surface as a hydration mismatch.
|
|
64
68
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
65
|
-
react_1.default.createElement("code", Object.assign({}, getCodeBlockAttributes({ kind: editing_1.MetadataKind.Open, id: rendering.uid, placeholderName }))),
|
|
69
|
+
react_1.default.createElement("code", Object.assign({ suppressHydrationWarning: true }, getCodeBlockAttributes({ kind: editing_1.MetadataKind.Open, id: rendering.uid, placeholderName }))),
|
|
66
70
|
children,
|
|
67
|
-
react_1.default.createElement("code", Object.assign({}, getCodeBlockAttributes({ kind: editing_1.MetadataKind.Close, placeholderName })))));
|
|
71
|
+
react_1.default.createElement("code", Object.assign({ suppressHydrationWarning: true }, getCodeBlockAttributes({ kind: editing_1.MetadataKind.Close, placeholderName })))));
|
|
68
72
|
};
|
|
69
73
|
exports.PlaceholderMetadata = PlaceholderMetadata;
|
|
@@ -76,12 +76,17 @@ const getSXAParams = (rendering) => {
|
|
|
76
76
|
exports.getSXAParams = getSXAParams;
|
|
77
77
|
/**
|
|
78
78
|
* Renders the placeholder when it is empty. The required CSS styles are applied to the placeholder in edit mode.
|
|
79
|
+
*
|
|
80
|
+
* `suppressHydrationWarning` is set because Pages Editor attaches chrome (e.g. `cursor: pointer`
|
|
81
|
+
* styling, click handlers) directly to this element outside of React, which can happen before
|
|
82
|
+
* client-side hydration completes. That DOM mutation is expected in edit mode and isn't something
|
|
83
|
+
* app code can control, so it shouldn't surface as a hydration mismatch.
|
|
79
84
|
* @param {React.ReactNode | React.ReactElement[]} node react node
|
|
80
85
|
* @returns react node
|
|
81
86
|
* @public
|
|
82
87
|
*/
|
|
83
88
|
const renderEmptyPlaceholder = (node) => {
|
|
84
|
-
return react_1.default.createElement("div", { className: "sc-jss-empty-placeholder" }, node);
|
|
89
|
+
return (react_1.default.createElement("div", { className: "sc-jss-empty-placeholder", suppressHydrationWarning: true }, node));
|
|
85
90
|
};
|
|
86
91
|
exports.renderEmptyPlaceholder = renderEmptyPlaceholder;
|
|
87
92
|
/**
|
|
@@ -53,7 +53,7 @@ const getPlaceholderComponents = (placeholderProps, placeholderRenderings) => {
|
|
|
53
53
|
return transformedComponents;
|
|
54
54
|
}
|
|
55
55
|
return [
|
|
56
|
-
React.createElement(PlaceholderMetadata, { key: rendering.uid
|
|
56
|
+
React.createElement(PlaceholderMetadata, { key: rendering.uid || `placeholder-metadata-${name}`, placeholderName: name, rendering: rendering }, transformedComponents),
|
|
57
57
|
];
|
|
58
58
|
};
|
|
59
59
|
/**
|
|
@@ -55,8 +55,12 @@ export const PlaceholderMetadata = ({ rendering, placeholderName, children, comp
|
|
|
55
55
|
}
|
|
56
56
|
return attributes;
|
|
57
57
|
};
|
|
58
|
+
// suppressHydrationWarning: Pages Editor attaches attributes to these chrome markers
|
|
59
|
+
// directly in the DOM (outside of React), which can happen before hydration completes.
|
|
60
|
+
// That mutation is expected in edit mode and isn't something app code can control, so it
|
|
61
|
+
// shouldn't surface as a hydration mismatch.
|
|
58
62
|
return (React.createElement(React.Fragment, null,
|
|
59
|
-
React.createElement("code", Object.assign({}, getCodeBlockAttributes({ kind: MetadataKind.Open, id: rendering.uid, placeholderName }))),
|
|
63
|
+
React.createElement("code", Object.assign({ suppressHydrationWarning: true }, getCodeBlockAttributes({ kind: MetadataKind.Open, id: rendering.uid, placeholderName }))),
|
|
60
64
|
children,
|
|
61
|
-
React.createElement("code", Object.assign({}, getCodeBlockAttributes({ kind: MetadataKind.Close, placeholderName })))));
|
|
65
|
+
React.createElement("code", Object.assign({ suppressHydrationWarning: true }, getCodeBlockAttributes({ kind: MetadataKind.Close, placeholderName })))));
|
|
62
66
|
};
|
|
@@ -67,12 +67,17 @@ export const getSXAParams = (rendering) => {
|
|
|
67
67
|
};
|
|
68
68
|
/**
|
|
69
69
|
* Renders the placeholder when it is empty. The required CSS styles are applied to the placeholder in edit mode.
|
|
70
|
+
*
|
|
71
|
+
* `suppressHydrationWarning` is set because Pages Editor attaches chrome (e.g. `cursor: pointer`
|
|
72
|
+
* styling, click handlers) directly to this element outside of React, which can happen before
|
|
73
|
+
* client-side hydration completes. That DOM mutation is expected in edit mode and isn't something
|
|
74
|
+
* app code can control, so it shouldn't surface as a hydration mismatch.
|
|
70
75
|
* @param {React.ReactNode | React.ReactElement[]} node react node
|
|
71
76
|
* @returns react node
|
|
72
77
|
* @public
|
|
73
78
|
*/
|
|
74
79
|
export const renderEmptyPlaceholder = (node) => {
|
|
75
|
-
return React.createElement("div", { className: "sc-jss-empty-placeholder" }, node);
|
|
80
|
+
return (React.createElement("div", { className: "sc-jss-empty-placeholder", suppressHydrationWarning: true }, node));
|
|
76
81
|
};
|
|
77
82
|
/**
|
|
78
83
|
* Merge specific placeholder props with component field and params content props.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sitecore-content-sdk/react",
|
|
3
|
-
"version": "2.3.0-canary.
|
|
3
|
+
"version": "2.3.0-canary.20260807092858",
|
|
4
4
|
"main": "dist/cjs/index.js",
|
|
5
5
|
"module": "dist/esm/index.js",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"url": "https://github.com/sitecore/content-sdk/issues"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
|
-
"@sitecore-content-sdk/analytics-core": "2.1.2-canary.
|
|
35
|
+
"@sitecore-content-sdk/analytics-core": "2.1.2-canary.20260807092858",
|
|
36
36
|
"@sitecore-feaas/clientside": "^0.6.0",
|
|
37
37
|
"@stylistic/eslint-plugin": "^5.2.2",
|
|
38
38
|
"@testing-library/dom": "^10.4.0",
|
|
@@ -71,16 +71,16 @@
|
|
|
71
71
|
"typescript": "~5.8.3"
|
|
72
72
|
},
|
|
73
73
|
"peerDependencies": {
|
|
74
|
-
"@sitecore-content-sdk/analytics-core": "2.1.2-canary.
|
|
75
|
-
"@sitecore-content-sdk/events": "2.1.2-canary.
|
|
74
|
+
"@sitecore-content-sdk/analytics-core": "2.1.2-canary.20260807092858",
|
|
75
|
+
"@sitecore-content-sdk/events": "2.1.2-canary.20260807092858",
|
|
76
76
|
"@sitecore-feaas/clientside": "^0.6.0",
|
|
77
77
|
"react": "^19.2.1",
|
|
78
78
|
"react-dom": "^19.2.1"
|
|
79
79
|
},
|
|
80
80
|
"dependencies": {
|
|
81
|
-
"@sitecore-content-sdk/content": "2.2.2-canary.
|
|
82
|
-
"@sitecore-content-sdk/core": "2.1.3-canary.
|
|
83
|
-
"@sitecore-content-sdk/search": "0.4.0-canary.
|
|
81
|
+
"@sitecore-content-sdk/content": "2.2.2-canary.20260807092858",
|
|
82
|
+
"@sitecore-content-sdk/core": "2.1.3-canary.20260807092858",
|
|
83
|
+
"@sitecore-content-sdk/search": "0.4.0-canary.20260807092858",
|
|
84
84
|
"fast-deep-equal": "^3.1.3"
|
|
85
85
|
},
|
|
86
86
|
"description": "",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlaceholderMetadata.d.ts","sourceRoot":"","sources":["../../../src/components/Placeholder/PlaceholderMetadata.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAC9C,OAAO,EACL,kBAAkB,EAGnB,MAAM,sCAAsC,CAAC;AAG9C;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACvC,SAAS,EAAE,kBAAkB,CAAC;IAC9B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB;;OAEG;IACH,gBAAgB,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAAC;CACxC;AAED,MAAM,MAAM,mBAAmB,GAAG;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,6BAA6B,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAAC;CACrD,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,mBAAmB,GAAI,6DAKjC,wBAAwB,KAAG,GAAG,CAAC,
|
|
1
|
+
{"version":3,"file":"PlaceholderMetadata.d.ts","sourceRoot":"","sources":["../../../src/components/Placeholder/PlaceholderMetadata.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAC9C,OAAO,EACL,kBAAkB,EAGnB,MAAM,sCAAsC,CAAC;AAG9C;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACvC,SAAS,EAAE,kBAAkB,CAAC;IAC9B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB;;OAEG;IACH,gBAAgB,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAAC;CACxC;AAED,MAAM,MAAM,mBAAmB,GAAG;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,6BAA6B,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAAC;CACrD,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,mBAAmB,GAAI,6DAKjC,wBAAwB,KAAG,GAAG,CAAC,OA0EjC,CAAC"}
|
|
@@ -20,6 +20,11 @@ export declare const getSXAParams: (rendering: ComponentRendering) => {
|
|
|
20
20
|
} | undefined;
|
|
21
21
|
/**
|
|
22
22
|
* Renders the placeholder when it is empty. The required CSS styles are applied to the placeholder in edit mode.
|
|
23
|
+
*
|
|
24
|
+
* `suppressHydrationWarning` is set because Pages Editor attaches chrome (e.g. `cursor: pointer`
|
|
25
|
+
* styling, click handlers) directly to this element outside of React, which can happen before
|
|
26
|
+
* client-side hydration completes. That DOM mutation is expected in edit mode and isn't something
|
|
27
|
+
* app code can control, so it shouldn't surface as a hydration mismatch.
|
|
23
28
|
* @param {React.ReactNode | React.ReactElement[]} node react node
|
|
24
29
|
* @returns react node
|
|
25
30
|
* @public
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"placeholder-utils.d.ts","sourceRoot":"","sources":["../../../src/components/Placeholder/placeholder-utils.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAwB,MAAM,OAAO,CAAC;AAE7C,OAAO,EAAE,YAAY,EAAuD,MAAM,gBAAgB,CAAC;AACnG,OAAO,EACL,kBAAkB,EAClB,SAAS,EAIV,MAAM,sCAAsC,CAAC;AAa9C,OAAO,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAExF;;;;;;GAMG;AACH,eAAO,MAAM,wBAAwB,GACnC,WAAW,kBAAkB,GAAG,SAAS,EACzC,MAAM,MAAM,EACZ,WAAW,OAAO,yFA2CnB,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,YAAY,GAAI,WAAW,kBAAkB,KAAG;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,GAAG,SAYjF,CAAC;AAEF
|
|
1
|
+
{"version":3,"file":"placeholder-utils.d.ts","sourceRoot":"","sources":["../../../src/components/Placeholder/placeholder-utils.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAwB,MAAM,OAAO,CAAC;AAE7C,OAAO,EAAE,YAAY,EAAuD,MAAM,gBAAgB,CAAC;AACnG,OAAO,EACL,kBAAkB,EAClB,SAAS,EAIV,MAAM,sCAAsC,CAAC;AAa9C,OAAO,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAExF;;;;;;GAMG;AACH,eAAO,MAAM,wBAAwB,GACnC,WAAW,kBAAkB,GAAG,SAAS,EACzC,MAAM,MAAM,EACZ,WAAW,OAAO,yFA2CnB,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,YAAY,GAAI,WAAW,kBAAkB,KAAG;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,GAAG,SAYjF,CAAC;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,sBAAsB,GAAI,MAAM,KAAK,CAAC,SAAS,GAAG,KAAK,CAAC,YAAY,EAAE,sBAMlF,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,CAAC,SAAS,gBAAgB,EAC/D,gBAAgB,EAAE,CAAC,EACnB,kBAAkB,EAAE,kBAAkB,GACrC,mBAAmB,CAYrB;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,wBAAwB,GACnC,qBAAqB,kBAAkB,EACvC,iBAAiB,MAAM,EACvB,eAAe,YAAY,EAC3B,2BAA2B,KAAK,CAAC,cAAc,GAAG,KAAK,CAAC,EAAE,EAC1D,4BAA4B,KAAK,CAAC,cAAc,GAAG,KAAK,CAAC,EAAE,KAC1D,qBA0GF,CAAC"}
|