@sitecore-content-sdk/react 2.0.0-canary.10 → 2.0.0-canary.13

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.
@@ -37,8 +37,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
37
37
  exports.Form = exports.mockFormModule = void 0;
38
38
  const react_1 = __importStar(require("react"));
39
39
  const content_1 = require("@sitecore-content-sdk/content");
40
+ const core_1 = require("@sitecore-content-sdk/core");
40
41
  const SitecoreProvider_1 = require("./SitecoreProvider");
41
42
  const ErrorBoundary_1 = require("./ErrorBoundary");
43
+ const { ERROR_MESSAGES } = core_1.constants;
42
44
  let { executeScriptElements, loadForm, subscribeToFormSubmitEvent } = content_1.form;
43
45
  /**
44
46
  * Mock function to replace the form module functions for `testing` purposes.
@@ -70,14 +72,14 @@ const Form = ({ params, rendering }) => {
70
72
  const edgeId = (_b = (_a = context.api) === null || _a === void 0 ? void 0 : _a.edge) === null || _b === void 0 ? void 0 : _b.clientContextId;
71
73
  if (!edgeId) {
72
74
  /* eslint-disable no-console */
73
- console.warn('Warning: clientContextId is missing – form cannot be loaded properly on the client');
75
+ console.warn(`${ERROR_MESSAGES.MV_006}. Form cannot be loaded properly on the client`);
74
76
  return;
75
77
  }
76
78
  loadForm(edgeId, params.FormId, (_d = (_c = context.api) === null || _c === void 0 ? void 0 : _c.edge) === null || _d === void 0 ? void 0 : _d.edgeUrl)
77
79
  .then(setContent)
78
80
  .catch(() => {
79
81
  if (isEditing) {
80
- console.error(`Failed to load form with id ${params.FormId}. Check debug logs for content-sdk:form for more details.`);
82
+ console.error(`Failed to load form with id ${params.FormId}. Check debug logs for content-sdk:form for more details. ${ERROR_MESSAGES.CONTACT_SUPPORT}`);
81
83
  }
82
84
  setError(true);
83
85
  });
@@ -1,8 +1,10 @@
1
1
  'use client';
2
2
  import React, { useEffect, useRef, useState } from 'react';
3
3
  import { form } from '@sitecore-content-sdk/content';
4
+ import { constants } from '@sitecore-content-sdk/core';
4
5
  import { useSitecore } from './SitecoreProvider';
5
6
  import { ErrorComponent } from './ErrorBoundary';
7
+ const { ERROR_MESSAGES } = constants;
6
8
  let { executeScriptElements, loadForm, subscribeToFormSubmitEvent } = form;
7
9
  /**
8
10
  * Mock function to replace the form module functions for `testing` purposes.
@@ -33,14 +35,14 @@ export const Form = ({ params, rendering }) => {
33
35
  const edgeId = (_b = (_a = context.api) === null || _a === void 0 ? void 0 : _a.edge) === null || _b === void 0 ? void 0 : _b.clientContextId;
34
36
  if (!edgeId) {
35
37
  /* eslint-disable no-console */
36
- console.warn('Warning: clientContextId is missing – form cannot be loaded properly on the client');
38
+ console.warn(`${ERROR_MESSAGES.MV_006}. Form cannot be loaded properly on the client`);
37
39
  return;
38
40
  }
39
41
  loadForm(edgeId, params.FormId, (_d = (_c = context.api) === null || _c === void 0 ? void 0 : _c.edge) === null || _d === void 0 ? void 0 : _d.edgeUrl)
40
42
  .then(setContent)
41
43
  .catch(() => {
42
44
  if (isEditing) {
43
- console.error(`Failed to load form with id ${params.FormId}. Check debug logs for content-sdk:form for more details.`);
45
+ console.error(`Failed to load form with id ${params.FormId}. Check debug logs for content-sdk:form for more details. ${ERROR_MESSAGES.CONTACT_SUPPORT}`);
44
46
  }
45
47
  setError(true);
46
48
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sitecore-content-sdk/react",
3
- "version": "2.0.0-canary.10",
3
+ "version": "2.0.0-canary.13",
4
4
  "main": "dist/cjs/index.js",
5
5
  "module": "dist/esm/index.js",
6
6
  "sideEffects": false,
@@ -70,20 +70,21 @@
70
70
  "typescript": "~5.8.3"
71
71
  },
72
72
  "peerDependencies": {
73
- "@sitecore-cloudsdk/events": "^0.5.1",
73
+ "@sitecore-content-sdk/analytics-core": "2.0.0-canary.12",
74
+ "@sitecore-content-sdk/events": "2.0.0-canary.12",
74
75
  "@sitecore-feaas/clientside": "^0.6.0",
75
76
  "react": "^19.2.1",
76
77
  "react-dom": "^19.2.1"
77
78
  },
78
79
  "dependencies": {
79
- "@sitecore-content-sdk/content": "2.0.0-canary.10",
80
- "@sitecore-content-sdk/core": "2.0.0-canary.10",
81
- "@sitecore-content-sdk/search": "0.2.0-canary.20",
80
+ "@sitecore-content-sdk/content": "2.0.0-canary.13",
81
+ "@sitecore-content-sdk/core": "2.0.0-canary.13",
82
+ "@sitecore-content-sdk/search": "0.2.0-canary.23",
82
83
  "fast-deep-equal": "^3.1.3"
83
84
  },
84
85
  "description": "",
85
86
  "types": "types/index.d.ts",
86
- "gitHead": "6246e4787e22778e64c90bcd9292a9988b3552a8",
87
+ "gitHead": "414b181508e47177e1818381ad4f555c189b9e4a",
87
88
  "files": [
88
89
  "dist",
89
90
  "types",
@@ -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;AAO1E;;;GAGG;AACH,eAAO,MAAM,cAAc,GAAI,YAAY,GAAG,SAI7C,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,sBA+DpD,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;AAU1E;;;GAGG;AACH,eAAO,MAAM,cAAc,GAAI,YAAY,GAAG,SAI7C,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,sBA6DpD,CAAC"}