@sitecore-content-sdk/react 2.4.0-canary.20260902193616 → 2.4.0-canary.20260904053939

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.
@@ -70,6 +70,8 @@ const Form = ({ params, rendering }) => {
70
70
  const [content, setContent] = (0, react_1.useState)('');
71
71
  const context = (0, SitecoreProvider_1.useSitecore)();
72
72
  const formRef = (0, react_1.useRef)(null);
73
+ /** Page language passed to the Forms publisher and set on the host element. */
74
+ const language = context.page.locale;
73
75
  const isEditing = context.page.mode.isEditing;
74
76
  // fetch form content
75
77
  (0, react_1.useEffect)(() => {
@@ -82,7 +84,7 @@ const Form = ({ params, rendering }) => {
82
84
  console.warn(`${ERROR_MESSAGES.MV_006}. Form cannot be loaded properly on the client`);
83
85
  return;
84
86
  }
85
- loadForm(edgeId, params.FormId, (_d = (_c = context.api) === null || _c === void 0 ? void 0 : _c.edge) === null || _d === void 0 ? void 0 : _d.edgeUrl)
87
+ loadForm(edgeId, params.FormId, (_d = (_c = context.api) === null || _c === void 0 ? void 0 : _c.edge) === null || _d === void 0 ? void 0 : _d.edgeUrl, language)
86
88
  .then(setContent)
87
89
  .catch(() => {
88
90
  if (isEditing) {
@@ -95,6 +97,7 @@ const Form = ({ params, rendering }) => {
95
97
  content,
96
98
  isEditing,
97
99
  params.FormId,
100
+ language,
98
101
  (_b = (_a = context.api) === null || _a === void 0 ? void 0 : _a.edge) === null || _b === void 0 ? void 0 : _b.clientContextId,
99
102
  (_d = (_c = context.api) === null || _c === void 0 ? void 0 : _c.edge) === null || _d === void 0 ? void 0 : _d.edgeUrl,
100
103
  ]);
@@ -112,6 +115,6 @@ const Form = ({ params, rendering }) => {
112
115
  if (isEditing && error) {
113
116
  return react_1.default.createElement(ErrorBoundary_1.ErrorComponent, { message: "There was a problem loading this section" });
114
117
  }
115
- return react_1.default.createElement("div", { ref: formRef, className: (_e = params.styles) === null || _e === void 0 ? void 0 : _e.trimEnd(), id: id ? id : undefined });
118
+ return (react_1.default.createElement("div", { ref: formRef, className: (_e = params.styles) === null || _e === void 0 ? void 0 : _e.trimEnd(), id: id ? id : undefined, lang: language || undefined }));
116
119
  };
117
120
  exports.Form = Form;
@@ -32,6 +32,8 @@ export const Form = ({ params, rendering }) => {
32
32
  const [content, setContent] = useState('');
33
33
  const context = useSitecore();
34
34
  const formRef = useRef(null);
35
+ /** Page language passed to the Forms publisher and set on the host element. */
36
+ const language = context.page.locale;
35
37
  const isEditing = context.page.mode.isEditing;
36
38
  // fetch form content
37
39
  useEffect(() => {
@@ -44,7 +46,7 @@ export const Form = ({ params, rendering }) => {
44
46
  console.warn(`${ERROR_MESSAGES.MV_006}. Form cannot be loaded properly on the client`);
45
47
  return;
46
48
  }
47
- loadForm(edgeId, params.FormId, (_d = (_c = context.api) === null || _c === void 0 ? void 0 : _c.edge) === null || _d === void 0 ? void 0 : _d.edgeUrl)
49
+ loadForm(edgeId, params.FormId, (_d = (_c = context.api) === null || _c === void 0 ? void 0 : _c.edge) === null || _d === void 0 ? void 0 : _d.edgeUrl, language)
48
50
  .then(setContent)
49
51
  .catch(() => {
50
52
  if (isEditing) {
@@ -57,6 +59,7 @@ export const Form = ({ params, rendering }) => {
57
59
  content,
58
60
  isEditing,
59
61
  params.FormId,
62
+ language,
60
63
  (_b = (_a = context.api) === null || _a === void 0 ? void 0 : _a.edge) === null || _b === void 0 ? void 0 : _b.clientContextId,
61
64
  (_d = (_c = context.api) === null || _c === void 0 ? void 0 : _c.edge) === null || _d === void 0 ? void 0 : _d.edgeUrl,
62
65
  ]);
@@ -74,5 +77,5 @@ export const Form = ({ params, rendering }) => {
74
77
  if (isEditing && error) {
75
78
  return React.createElement(ErrorComponent, { message: "There was a problem loading this section" });
76
79
  }
77
- return React.createElement("div", { ref: formRef, className: (_e = params.styles) === null || _e === void 0 ? void 0 : _e.trimEnd(), id: id ? id : undefined });
80
+ return (React.createElement("div", { ref: formRef, className: (_e = params.styles) === null || _e === void 0 ? void 0 : _e.trimEnd(), id: id ? id : undefined, lang: language || undefined }));
78
81
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sitecore-content-sdk/react",
3
- "version": "2.4.0-canary.20260902193616",
3
+ "version": "2.4.0-canary.20260904053939",
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.3-canary.20260902193616",
35
+ "@sitecore-content-sdk/analytics-core": "2.1.3-canary.20260904053939",
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.3-canary.20260902193616",
75
- "@sitecore-content-sdk/events": "2.1.3-canary.20260902193616",
74
+ "@sitecore-content-sdk/analytics-core": "2.1.3-canary.20260904053939",
75
+ "@sitecore-content-sdk/events": "2.1.3-canary.20260904053939",
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.3.0-canary.20260902193616",
82
- "@sitecore-content-sdk/core": "2.1.4-canary.20260902193616",
83
- "@sitecore-content-sdk/search": "0.5.0-canary.20260902193616",
81
+ "@sitecore-content-sdk/content": "2.3.0-canary.20260904053939",
82
+ "@sitecore-content-sdk/core": "2.1.4-canary.20260904053939",
83
+ "@sitecore-content-sdk/search": "0.5.0-canary.20260904053939",
84
84
  "fast-deep-equal": "^3.1.3"
85
85
  },
86
86
  "description": "",
@@ -1 +1 @@
1
- {"version":3,"file":"Form.d.ts","sourceRoot":"","sources":["../../src/components/Form.tsx"],"names":[],"mappings":"AACA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAC3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAY1E;;;GAGG;AACH,eAAO,MAAM,cAAc,GAAI,YAAY,GAAG,SAI7C,CAAC;AAEF,eAAO,MAAM,2BAA2B,GAAI,6BAA6B,GAAG,SAE3E,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,SAAS,GAAG;IACtB,SAAS,EAAE,kBAAkB,CAAC;IAC9B,MAAM,EAAE;QACN;;WAEG;QACH,MAAM,EAAE,MAAM,CAAC;QACf;;WAEG;QACH,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB;;WAEG;QACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;KAC9B,CAAC;CACH,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,IAAI,GAAI,uBAAuB,SAAS,sBA0DpD,CAAC"}
1
+ {"version":3,"file":"Form.d.ts","sourceRoot":"","sources":["../../src/components/Form.tsx"],"names":[],"mappings":"AACA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAC3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAY1E;;;GAGG;AACH,eAAO,MAAM,cAAc,GAAI,YAAY,GAAG,SAI7C,CAAC;AAEF,eAAO,MAAM,2BAA2B,GAAI,6BAA6B,GAAG,SAE3E,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,SAAS,GAAG;IACtB,SAAS,EAAE,kBAAkB,CAAC;IAC9B,MAAM,EAAE;QACN;;WAEG;QACH,MAAM,EAAE,MAAM,CAAC;QACf;;WAEG;QACH,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB;;WAEG;QACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;KAC9B,CAAC;CACH,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,IAAI,GAAI,uBAAuB,SAAS,sBAoEpD,CAAC"}