@contentful/experiences-sdk-react 3.6.2-dev-20250912T1252-251a338.0 → 3.6.2-dev-20250912T1534-a44407f.0

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.
@@ -7,18 +7,18 @@ import { toMediaQuery } from '@contentful/experiences-core';
7
7
  * **Example Input:**
8
8
  * ```
9
9
  * [
10
- * { className: 'cfstyles-123', breakpointCondition: '*', css: 'color:red;' },
10
+ * { className: 'cfstyles-123', breakpointCondition: '*', css: 'color:red;', visibilityCss: 'display:none !important;' },
11
11
  * { className: 'cfstyles-456', breakpointCondition: '<768px', css: 'color:blue;' },
12
12
  * ]
13
13
  * ```
14
14
  *
15
15
  * **Example Output:**
16
16
  * ```
17
- * '.cfstyles-123{color:red;}@media(max-width:768px){.cfstyles-456{color:blue;}}'
17
+ * '.cfstyles-123{color:red;}@media not (max-width:768px){.cfstyles-123{display:none !important;}}@media(max-width:768px){.cfstyles-456{color:blue;}}'
18
18
  * ```
19
19
  */
20
20
  const convertResolvedDesignValuesToMediaQuery = (stylesheetData) => {
21
- const stylesheet = stylesheetData.reduce((acc, { breakpointCondition, className, css }) => {
21
+ const stylesheet = stylesheetData.reduce((acc, { breakpointCondition, className, css, visibilityCss }, index) => {
22
22
  if (acc.classNames.includes(className)) {
23
23
  return acc;
24
24
  }
@@ -26,9 +26,15 @@ const convertResolvedDesignValuesToMediaQuery = (stylesheetData) => {
26
26
  condition: breakpointCondition,
27
27
  cssByClassName: { [className]: css },
28
28
  });
29
+ const visibilityMediaQueryCss = toMediaQuery({
30
+ condition: breakpointCondition,
31
+ cssByClassName: { [className]: visibilityCss ?? '' },
32
+ // Validation ensures that it starts with the '*' breakpoint
33
+ nextCondition: stylesheetData[index + 1]?.breakpointCondition,
34
+ });
29
35
  return {
30
36
  classNames: [...acc.classNames, className],
31
- css: `${acc.css}${mediaQueryCss}`,
37
+ css: `${acc.css}${mediaQueryCss}${visibilityMediaQueryCss}`,
32
38
  };
33
39
  }, {
34
40
  classNames: [],
@@ -1 +1 @@
1
- {"version":3,"file":"convertResolvedDesignValuesToMediaQuery.js","sources":["../../../../src/core/styles/convertResolvedDesignValuesToMediaQuery.ts"],"sourcesContent":["import { toMediaQuery } from '@contentful/experiences-core';\nimport { ResolvedStylesheetData } from './createStylesheetsForBuiltInStyles';\n\n/**\n * Takes the CSS code for each breakpoint and merges them into a single CSS string.\n * It will wrap each breakpoint's CSS code in a media query (exception: default breakpoint with '*').\n *\n * **Example Input:**\n * ```\n * [\n * { className: 'cfstyles-123', breakpointCondition: '*', css: 'color:red;' },\n * { className: 'cfstyles-456', breakpointCondition: '<768px', css: 'color:blue;' },\n * ]\n * ```\n *\n * **Example Output:**\n * ```\n * '.cfstyles-123{color:red;}@media(max-width:768px){.cfstyles-456{color:blue;}}'\n * ```\n */\nexport const convertResolvedDesignValuesToMediaQuery = (stylesheetData: ResolvedStylesheetData) => {\n const stylesheet = stylesheetData.reduce(\n (acc, { breakpointCondition, className, css }) => {\n if (acc.classNames.includes(className)) {\n return acc;\n }\n\n const mediaQueryCss = toMediaQuery({\n condition: breakpointCondition,\n cssByClassName: { [className]: css },\n });\n return {\n classNames: [...acc.classNames, className],\n css: `${acc.css}${mediaQueryCss}`,\n };\n },\n {\n classNames: [] as string[],\n css: '',\n },\n );\n\n return {\n css: stylesheet.css,\n className: stylesheet.classNames.join(' '),\n };\n};\n"],"names":[],"mappings":";;AAGA;;;;;;;;;;;;;;;;AAgBG;AACU,MAAA,uCAAuC,GAAG,CAAC,cAAsC,KAAI;AAChG,IAAA,MAAM,UAAU,GAAG,cAAc,CAAC,MAAM,CACtC,CAAC,GAAG,EAAE,EAAE,mBAAmB,EAAE,SAAS,EAAE,GAAG,EAAE,KAAI;QAC/C,IAAI,GAAG,CAAC,UAAU,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE;AACtC,YAAA,OAAO,GAAG,CAAC;SACZ;QAED,MAAM,aAAa,GAAG,YAAY,CAAC;AACjC,YAAA,SAAS,EAAE,mBAAmB;AAC9B,YAAA,cAAc,EAAE,EAAE,CAAC,SAAS,GAAG,GAAG,EAAE;AACrC,SAAA,CAAC,CAAC;QACH,OAAO;YACL,UAAU,EAAE,CAAC,GAAG,GAAG,CAAC,UAAU,EAAE,SAAS,CAAC;AAC1C,YAAA,GAAG,EAAE,CAAG,EAAA,GAAG,CAAC,GAAG,CAAA,EAAG,aAAa,CAAE,CAAA;SAClC,CAAC;AACJ,KAAC,EACD;AACE,QAAA,UAAU,EAAE,EAAc;AAC1B,QAAA,GAAG,EAAE,EAAE;AACR,KAAA,CACF,CAAC;IAEF,OAAO;QACL,GAAG,EAAE,UAAU,CAAC,GAAG;QACnB,SAAS,EAAE,UAAU,CAAC,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC;KAC3C,CAAC;AACJ;;;;"}
1
+ {"version":3,"file":"convertResolvedDesignValuesToMediaQuery.js","sources":["../../../../src/core/styles/convertResolvedDesignValuesToMediaQuery.ts"],"sourcesContent":["import { toMediaQuery } from '@contentful/experiences-core';\nimport { ResolvedStylesheetData } from './createStylesheetsForBuiltInStyles';\n\n/**\n * Takes the CSS code for each breakpoint and merges them into a single CSS string.\n * It will wrap each breakpoint's CSS code in a media query (exception: default breakpoint with '*').\n *\n * **Example Input:**\n * ```\n * [\n * { className: 'cfstyles-123', breakpointCondition: '*', css: 'color:red;', visibilityCss: 'display:none !important;' },\n * { className: 'cfstyles-456', breakpointCondition: '<768px', css: 'color:blue;' },\n * ]\n * ```\n *\n * **Example Output:**\n * ```\n * '.cfstyles-123{color:red;}@media not (max-width:768px){.cfstyles-123{display:none !important;}}@media(max-width:768px){.cfstyles-456{color:blue;}}'\n * ```\n */\nexport const convertResolvedDesignValuesToMediaQuery = (stylesheetData: ResolvedStylesheetData) => {\n const stylesheet = stylesheetData.reduce(\n (acc, { breakpointCondition, className, css, visibilityCss }, index) => {\n if (acc.classNames.includes(className)) {\n return acc;\n }\n\n const mediaQueryCss = toMediaQuery({\n condition: breakpointCondition,\n cssByClassName: { [className]: css },\n });\n const visibilityMediaQueryCss = toMediaQuery({\n condition: breakpointCondition,\n cssByClassName: { [className]: visibilityCss ?? '' },\n // Validation ensures that it starts with the '*' breakpoint\n nextCondition: stylesheetData[index + 1]?.breakpointCondition,\n });\n return {\n classNames: [...acc.classNames, className],\n css: `${acc.css}${mediaQueryCss}${visibilityMediaQueryCss}`,\n };\n },\n {\n classNames: [] as string[],\n css: '',\n },\n );\n\n return {\n css: stylesheet.css,\n className: stylesheet.classNames.join(' '),\n };\n};\n"],"names":[],"mappings":";;AAGA;;;;;;;;;;;;;;;;AAgBG;AACU,MAAA,uCAAuC,GAAG,CAAC,cAAsC,KAAI;IAChG,MAAM,UAAU,GAAG,cAAc,CAAC,MAAM,CACtC,CAAC,GAAG,EAAE,EAAE,mBAAmB,EAAE,SAAS,EAAE,GAAG,EAAE,aAAa,EAAE,EAAE,KAAK,KAAI;QACrE,IAAI,GAAG,CAAC,UAAU,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE;AACtC,YAAA,OAAO,GAAG,CAAC;SACZ;QAED,MAAM,aAAa,GAAG,YAAY,CAAC;AACjC,YAAA,SAAS,EAAE,mBAAmB;AAC9B,YAAA,cAAc,EAAE,EAAE,CAAC,SAAS,GAAG,GAAG,EAAE;AACrC,SAAA,CAAC,CAAC;QACH,MAAM,uBAAuB,GAAG,YAAY,CAAC;AAC3C,YAAA,SAAS,EAAE,mBAAmB;YAC9B,cAAc,EAAE,EAAE,CAAC,SAAS,GAAG,aAAa,IAAI,EAAE,EAAE;;YAEpD,aAAa,EAAE,cAAc,CAAC,KAAK,GAAG,CAAC,CAAC,EAAE,mBAAmB;AAC9D,SAAA,CAAC,CAAC;QACH,OAAO;YACL,UAAU,EAAE,CAAC,GAAG,GAAG,CAAC,UAAU,EAAE,SAAS,CAAC;YAC1C,GAAG,EAAE,GAAG,GAAG,CAAC,GAAG,CAAG,EAAA,aAAa,CAAG,EAAA,uBAAuB,CAAE,CAAA;SAC5D,CAAC;AACJ,KAAC,EACD;AACE,QAAA,UAAU,EAAE,EAAc;AAC1B,QAAA,GAAG,EAAE,EAAE;AACR,KAAA,CACF,CAAC;IAEF,OAAO;QACL,GAAG,EAAE,UAAU,CAAC,GAAG;QACnB,SAAS,EAAE,UAAU,CAAC,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC;KAC3C,CAAC;AACJ;;;;"}
package/dist/index.d.ts CHANGED
@@ -9,7 +9,7 @@ import * as _contentful_experiences_core_constants from '@contentful/experiences
9
9
  export { CF_STYLE_ATTRIBUTES, CONTENTFUL_COMPONENTS, LATEST_SCHEMA_VERSION } from '@contentful/experiences-core/constants';
10
10
  import { ContentfulClientApi } from 'contentful';
11
11
 
12
- declare const SDK_VERSION = "3.6.2-dev-20250912T1252-251a338.0";
12
+ declare const SDK_VERSION = "3.6.2-dev-20250912T1534-a44407f.0";
13
13
 
14
14
  type ExperienceRootProps = {
15
15
  experience?: Experience<EntityStore> | string | null;
@@ -1,4 +1,4 @@
1
- const SDK_VERSION = '3.6.2-dev-20250912T1252-251a338.0';
1
+ const SDK_VERSION = '3.6.2-dev-20250912T1534-a44407f.0';
2
2
 
3
3
  export { SDK_VERSION };
4
4
  //# sourceMappingURL=sdkVersion.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"sdkVersion.js","sources":["../../src/sdkVersion.ts"],"sourcesContent":["export const SDK_VERSION = '3.6.2-dev-20250912T1252-251a338.0';\n"],"names":[],"mappings":"AAAO,MAAM,WAAW,GAAG;;;;"}
1
+ {"version":3,"file":"sdkVersion.js","sources":["../../src/sdkVersion.ts"],"sourcesContent":["export const SDK_VERSION = '3.6.2-dev-20250912T1534-a44407f.0';\n"],"names":[],"mappings":"AAAO,MAAM,WAAW,GAAG;;;;"}
@@ -6,14 +6,14 @@ import { ResolvedStylesheetData } from './createStylesheetsForBuiltInStyles';
6
6
  * **Example Input:**
7
7
  * ```
8
8
  * [
9
- * { className: 'cfstyles-123', breakpointCondition: '*', css: 'color:red;' },
9
+ * { className: 'cfstyles-123', breakpointCondition: '*', css: 'color:red;', visibilityCss: 'display:none !important;' },
10
10
  * { className: 'cfstyles-456', breakpointCondition: '<768px', css: 'color:blue;' },
11
11
  * ]
12
12
  * ```
13
13
  *
14
14
  * **Example Output:**
15
15
  * ```
16
- * '.cfstyles-123{color:red;}@media(max-width:768px){.cfstyles-456{color:blue;}}'
16
+ * '.cfstyles-123{color:red;}@media not (max-width:768px){.cfstyles-123{display:none !important;}}@media(max-width:768px){.cfstyles-456{color:blue;}}'
17
17
  * ```
18
18
  */
19
19
  export declare const convertResolvedDesignValuesToMediaQuery: (stylesheetData: ResolvedStylesheetData) => {
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "3.6.2-dev-20250912T1252-251a338.0";
1
+ export declare const SDK_VERSION = "3.6.2-dev-20250912T1534-a44407f.0";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contentful/experiences-sdk-react",
3
- "version": "3.6.2-dev-20250912T1252-251a338.0",
3
+ "version": "3.6.2-dev-20250912T1534-a44407f.0",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.js",
6
6
  "typings": "./dist/src/index.d.ts",
@@ -41,10 +41,10 @@
41
41
  "depcruise": "depcruise src"
42
42
  },
43
43
  "dependencies": {
44
- "@contentful/experiences-components-react": "3.6.2-dev-20250912T1252-251a338.0",
45
- "@contentful/experiences-core": "3.6.2-dev-20250912T1252-251a338.0",
46
- "@contentful/experiences-validators": "3.6.2-dev-20250912T1252-251a338.0",
47
- "@contentful/experiences-visual-editor-react": "3.6.2-dev-20250912T1252-251a338.0",
44
+ "@contentful/experiences-components-react": "3.6.2-dev-20250912T1534-a44407f.0",
45
+ "@contentful/experiences-core": "3.6.2-dev-20250912T1534-a44407f.0",
46
+ "@contentful/experiences-validators": "3.6.2-dev-20250912T1534-a44407f.0",
47
+ "@contentful/experiences-visual-editor-react": "3.6.2-dev-20250912T1534-a44407f.0",
48
48
  "@contentful/rich-text-types": "^17.0.0",
49
49
  "csstype": "^3.1.2",
50
50
  "immer": "^10.0.3",
@@ -98,5 +98,5 @@
98
98
  "dist",
99
99
  "package.json"
100
100
  ],
101
- "gitHead": "9903894eb7b93f544b3f311551c6118f2f032def"
101
+ "gitHead": "b08ef8ba5e6a39110a49380e3ac53fe6d72bde60"
102
102
  }