@wordpress/global-styles-engine 1.10.0 → 1.10.1-next.v.202604091042.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.
@@ -40,7 +40,7 @@ function generatePreviewStateStyles(stateStyles, blockName) {
40
40
  try {
41
41
  const [generatedStyles] = (0, import_render.generateGlobalStyles)(previewConfig, []);
42
42
  return generatedStyles.map((style) => style.css).join("\n");
43
- } catch (error) {
43
+ } catch {
44
44
  return "";
45
45
  }
46
46
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/preview-state-styles.ts"],
4
- "sourcesContent": ["/**\n * Internal dependencies\n */\nimport { generateGlobalStyles } from './core/render';\nimport type { GlobalStylesConfig } from './types';\n\n/**\n * Generates CSS for preview contexts to display a specific state (hover, focus, etc.).\n * Takes state-specific styles and generates CSS as if they were the default styles,\n * allowing previews to show how a block will appear in that state.\n *\n * @param stateStyles - The styles for the specific state (e.g., hover styles)\n * @param blockName - The block name (e.g., 'core/button')\n * @return CSS string for the state preview\n */\nexport function generatePreviewStateStyles(\n\tstateStyles: any,\n\tblockName: string\n): string {\n\tif ( ! stateStyles || ! blockName ) {\n\t\treturn '';\n\t}\n\n\t// Create a minimal theme.json-like config with the state styles\n\t// positioned as if they were the default styles for this block\n\tconst previewConfig: GlobalStylesConfig = {\n\t\tsettings: {}, // Empty settings to satisfy the config structure\n\t\tstyles: {\n\t\t\tblocks: {\n\t\t\t\t[ blockName ]: stateStyles,\n\t\t\t},\n\t\t},\n\t};\n\n\ttry {\n\t\tconst [ generatedStyles ] = generateGlobalStyles( previewConfig, [] );\n\n\t\treturn generatedStyles.map( ( style ) => style.css ).join( '\\n' );\n\t} catch ( error ) {\n\t\t// If generation fails, return empty string to avoid breaking previews\n\t\treturn '';\n\t}\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,oBAAqC;AAY9B,SAAS,2BACf,aACA,WACS;AACT,MAAK,CAAE,eAAe,CAAE,WAAY;AACnC,WAAO;AAAA,EACR;AAIA,QAAM,gBAAoC;AAAA,IACzC,UAAU,CAAC;AAAA;AAAA,IACX,QAAQ;AAAA,MACP,QAAQ;AAAA,QACP,CAAE,SAAU,GAAG;AAAA,MAChB;AAAA,IACD;AAAA,EACD;AAEA,MAAI;AACH,UAAM,CAAE,eAAgB,QAAI,oCAAsB,eAAe,CAAC,CAAE;AAEpE,WAAO,gBAAgB,IAAK,CAAE,UAAW,MAAM,GAAI,EAAE,KAAM,IAAK;AAAA,EACjE,SAAU,OAAQ;AAEjB,WAAO;AAAA,EACR;AACD;",
4
+ "sourcesContent": ["/**\n * Internal dependencies\n */\nimport { generateGlobalStyles } from './core/render';\nimport type { GlobalStylesConfig } from './types';\n\n/**\n * Generates CSS for preview contexts to display a specific state (hover, focus, etc.).\n * Takes state-specific styles and generates CSS as if they were the default styles,\n * allowing previews to show how a block will appear in that state.\n *\n * @param stateStyles - The styles for the specific state (e.g., hover styles)\n * @param blockName - The block name (e.g., 'core/button')\n * @return CSS string for the state preview\n */\nexport function generatePreviewStateStyles(\n\tstateStyles: any,\n\tblockName: string\n): string {\n\tif ( ! stateStyles || ! blockName ) {\n\t\treturn '';\n\t}\n\n\t// Create a minimal theme.json-like config with the state styles\n\t// positioned as if they were the default styles for this block\n\tconst previewConfig: GlobalStylesConfig = {\n\t\tsettings: {}, // Empty settings to satisfy the config structure\n\t\tstyles: {\n\t\t\tblocks: {\n\t\t\t\t[ blockName ]: stateStyles,\n\t\t\t},\n\t\t},\n\t};\n\n\ttry {\n\t\tconst [ generatedStyles ] = generateGlobalStyles( previewConfig, [] );\n\n\t\treturn generatedStyles.map( ( style ) => style.css ).join( '\\n' );\n\t} catch {\n\t\t// If generation fails, return empty string to avoid breaking previews\n\t\treturn '';\n\t}\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,oBAAqC;AAY9B,SAAS,2BACf,aACA,WACS;AACT,MAAK,CAAE,eAAe,CAAE,WAAY;AACnC,WAAO;AAAA,EACR;AAIA,QAAM,gBAAoC;AAAA,IACzC,UAAU,CAAC;AAAA;AAAA,IACX,QAAQ;AAAA,MACP,QAAQ;AAAA,QACP,CAAE,SAAU,GAAG;AAAA,MAChB;AAAA,IACD;AAAA,EACD;AAEA,MAAI;AACH,UAAM,CAAE,eAAgB,QAAI,oCAAsB,eAAe,CAAC,CAAE;AAEpE,WAAO,gBAAgB,IAAK,CAAE,UAAW,MAAM,GAAI,EAAE,KAAM,IAAK;AAAA,EACjE,QAAQ;AAEP,WAAO;AAAA,EACR;AACD;",
6
6
  "names": []
7
7
  }
@@ -16,7 +16,7 @@ function generatePreviewStateStyles(stateStyles, blockName) {
16
16
  try {
17
17
  const [generatedStyles] = generateGlobalStyles(previewConfig, []);
18
18
  return generatedStyles.map((style) => style.css).join("\n");
19
- } catch (error) {
19
+ } catch {
20
20
  return "";
21
21
  }
22
22
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/preview-state-styles.ts"],
4
- "sourcesContent": ["/**\n * Internal dependencies\n */\nimport { generateGlobalStyles } from './core/render';\nimport type { GlobalStylesConfig } from './types';\n\n/**\n * Generates CSS for preview contexts to display a specific state (hover, focus, etc.).\n * Takes state-specific styles and generates CSS as if they were the default styles,\n * allowing previews to show how a block will appear in that state.\n *\n * @param stateStyles - The styles for the specific state (e.g., hover styles)\n * @param blockName - The block name (e.g., 'core/button')\n * @return CSS string for the state preview\n */\nexport function generatePreviewStateStyles(\n\tstateStyles: any,\n\tblockName: string\n): string {\n\tif ( ! stateStyles || ! blockName ) {\n\t\treturn '';\n\t}\n\n\t// Create a minimal theme.json-like config with the state styles\n\t// positioned as if they were the default styles for this block\n\tconst previewConfig: GlobalStylesConfig = {\n\t\tsettings: {}, // Empty settings to satisfy the config structure\n\t\tstyles: {\n\t\t\tblocks: {\n\t\t\t\t[ blockName ]: stateStyles,\n\t\t\t},\n\t\t},\n\t};\n\n\ttry {\n\t\tconst [ generatedStyles ] = generateGlobalStyles( previewConfig, [] );\n\n\t\treturn generatedStyles.map( ( style ) => style.css ).join( '\\n' );\n\t} catch ( error ) {\n\t\t// If generation fails, return empty string to avoid breaking previews\n\t\treturn '';\n\t}\n}\n"],
5
- "mappings": ";AAGA,SAAS,4BAA4B;AAY9B,SAAS,2BACf,aACA,WACS;AACT,MAAK,CAAE,eAAe,CAAE,WAAY;AACnC,WAAO;AAAA,EACR;AAIA,QAAM,gBAAoC;AAAA,IACzC,UAAU,CAAC;AAAA;AAAA,IACX,QAAQ;AAAA,MACP,QAAQ;AAAA,QACP,CAAE,SAAU,GAAG;AAAA,MAChB;AAAA,IACD;AAAA,EACD;AAEA,MAAI;AACH,UAAM,CAAE,eAAgB,IAAI,qBAAsB,eAAe,CAAC,CAAE;AAEpE,WAAO,gBAAgB,IAAK,CAAE,UAAW,MAAM,GAAI,EAAE,KAAM,IAAK;AAAA,EACjE,SAAU,OAAQ;AAEjB,WAAO;AAAA,EACR;AACD;",
4
+ "sourcesContent": ["/**\n * Internal dependencies\n */\nimport { generateGlobalStyles } from './core/render';\nimport type { GlobalStylesConfig } from './types';\n\n/**\n * Generates CSS for preview contexts to display a specific state (hover, focus, etc.).\n * Takes state-specific styles and generates CSS as if they were the default styles,\n * allowing previews to show how a block will appear in that state.\n *\n * @param stateStyles - The styles for the specific state (e.g., hover styles)\n * @param blockName - The block name (e.g., 'core/button')\n * @return CSS string for the state preview\n */\nexport function generatePreviewStateStyles(\n\tstateStyles: any,\n\tblockName: string\n): string {\n\tif ( ! stateStyles || ! blockName ) {\n\t\treturn '';\n\t}\n\n\t// Create a minimal theme.json-like config with the state styles\n\t// positioned as if they were the default styles for this block\n\tconst previewConfig: GlobalStylesConfig = {\n\t\tsettings: {}, // Empty settings to satisfy the config structure\n\t\tstyles: {\n\t\t\tblocks: {\n\t\t\t\t[ blockName ]: stateStyles,\n\t\t\t},\n\t\t},\n\t};\n\n\ttry {\n\t\tconst [ generatedStyles ] = generateGlobalStyles( previewConfig, [] );\n\n\t\treturn generatedStyles.map( ( style ) => style.css ).join( '\\n' );\n\t} catch {\n\t\t// If generation fails, return empty string to avoid breaking previews\n\t\treturn '';\n\t}\n}\n"],
5
+ "mappings": ";AAGA,SAAS,4BAA4B;AAY9B,SAAS,2BACf,aACA,WACS;AACT,MAAK,CAAE,eAAe,CAAE,WAAY;AACnC,WAAO;AAAA,EACR;AAIA,QAAM,gBAAoC;AAAA,IACzC,UAAU,CAAC;AAAA;AAAA,IACX,QAAQ;AAAA,MACP,QAAQ;AAAA,QACP,CAAE,SAAU,GAAG;AAAA,MAChB;AAAA,IACD;AAAA,EACD;AAEA,MAAI;AACH,UAAM,CAAE,eAAgB,IAAI,qBAAsB,eAAe,CAAC,CAAE;AAEpE,WAAO,gBAAgB,IAAK,CAAE,UAAW,MAAM,GAAI,EAAE,KAAM,IAAK;AAAA,EACjE,QAAQ;AAEP,WAAO;AAAA,EACR;AACD;",
6
6
  "names": []
7
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/global-styles-engine",
3
- "version": "1.10.0",
3
+ "version": "1.10.1-next.v.202604091042.0+668146787",
4
4
  "description": "Pure CSS generation engine for WordPress global styles.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -42,10 +42,10 @@
42
42
  "types": "build-types/index.d.ts",
43
43
  "sideEffects": false,
44
44
  "dependencies": {
45
- "@wordpress/blocks": "^15.16.0",
46
- "@wordpress/data": "^10.43.0",
47
- "@wordpress/i18n": "^6.16.0",
48
- "@wordpress/style-engine": "^2.43.0",
45
+ "@wordpress/blocks": "^15.16.1-next.v.202604091042.0+668146787",
46
+ "@wordpress/data": "^10.43.1-next.v.202604091042.0+668146787",
47
+ "@wordpress/i18n": "^6.17.1-next.v.202604091042.0+668146787",
48
+ "@wordpress/style-engine": "^2.43.1-next.v.202604091042.0+668146787",
49
49
  "colord": "^2.9.2",
50
50
  "deepmerge": "^4.3.0",
51
51
  "fast-deep-equal": "^3.1.3",
@@ -59,5 +59,5 @@
59
59
  "publishConfig": {
60
60
  "access": "public"
61
61
  },
62
- "gitHead": "2cea90674d11aa521ec3f71652fb3a6a4c383969"
62
+ "gitHead": "73606df74f1c38a084bfa5db97205259ef817593"
63
63
  }
@@ -36,7 +36,7 @@ export function generatePreviewStateStyles(
36
36
  const [ generatedStyles ] = generateGlobalStyles( previewConfig, [] );
37
37
 
38
38
  return generatedStyles.map( ( style ) => style.css ).join( '\n' );
39
- } catch ( error ) {
39
+ } catch {
40
40
  // If generation fails, return empty string to avoid breaking previews
41
41
  return '';
42
42
  }