@orion-studios/payload-studio 0.5.0-beta.71 → 0.5.0-beta.72

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.
@@ -2124,6 +2124,21 @@ function rgbaFromHex(hex, alpha) {
2124
2124
  }
2125
2125
  return `rgba(${rgb.r}, ${rgb.g}, ${rgb.b}, ${clamped})`;
2126
2126
  }
2127
+ function getThemeColorOverride(tokens, colorKey) {
2128
+ if (!tokens || typeof tokens !== "object") {
2129
+ return null;
2130
+ }
2131
+ const colors = tokens.colors;
2132
+ if (!colors || typeof colors !== "object") {
2133
+ return null;
2134
+ }
2135
+ const value = colors[colorKey];
2136
+ if (typeof value !== "string") {
2137
+ return null;
2138
+ }
2139
+ const normalized = value.trim();
2140
+ return normalized.length > 0 ? normalized : null;
2141
+ }
2127
2142
  var sectionStyleFromBlock = (block, pageDefaults) => {
2128
2143
  const contentWidthRaw = normalizeText(block.contentWidth, defaultSectionStyle.contentWidth);
2129
2144
  const sectionPaddingRaw = normalizeText(block.sectionPaddingY, defaultSectionStyle.sectionPaddingY);
@@ -3087,11 +3102,8 @@ function BuilderPageEditor({ featureFlags, initialDoc, pageID, siteThemeTokens }
3087
3102
  maxTextWidth: blockTypography.maxTextWidth === "sm" || blockTypography.maxTextWidth === "md" || blockTypography.maxTextWidth === "lg" || blockTypography.maxTextWidth === "full" ? blockTypography.maxTextWidth : "auto"
3088
3103
  });
3089
3104
  const headingAlign = blockTypography.headingAlign === "center" || blockTypography.headingAlign === "justify" || blockTypography.headingAlign === "right" ? blockTypography.headingAlign : "left";
3090
- const blockTokens = resolveBuilderThemeTokens({
3091
- block: blockTheme,
3092
- page: pageDefaults.themePage,
3093
- site: siteThemeTokens
3094
- });
3105
+ const headingColor = getThemeColorOverride(blockTheme, "headingText") || getThemeColorOverride(pageDefaults.themePage, "headingText") || getThemeColorOverride(siteThemeTokens, "headingText") || (block.blockType === "hero" ? "#ffffff" : resolvedThemeTokens.colors.headingText);
3106
+ const bodyColor = getThemeColorOverride(blockTheme, "bodyText") || getThemeColorOverride(pageDefaults.themePage, "bodyText") || getThemeColorOverride(siteThemeTokens, "bodyText") || (block.blockType === "hero" ? "#ffffff" : resolvedThemeTokens.colors.bodyText);
3095
3107
  return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("section", { className: `${className} ${shell.sectionClass}`, style: shell.sectionStyle, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { style: shell.sectionInnerStyle, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
3096
3108
  "div",
3097
3109
  {
@@ -3099,8 +3111,8 @@ function BuilderPageEditor({ featureFlags, initialDoc, pageID, siteThemeTokens }
3099
3111
  style: {
3100
3112
  ...shell.contentStyle,
3101
3113
  "--orion-builder-heading-align": headingAlign,
3102
- "--orion-builder-heading-color": blockTokens.colors.headingText || resolvedThemeTokens.colors.headingText,
3103
- color: blockTokens.colors.bodyText || resolvedThemeTokens.colors.bodyText,
3114
+ "--orion-builder-heading-color": headingColor,
3115
+ color: bodyColor,
3104
3116
  ...typographyStyle
3105
3117
  },
3106
3118
  children: content
@@ -2005,6 +2005,21 @@ function rgbaFromHex(hex, alpha) {
2005
2005
  }
2006
2006
  return `rgba(${rgb.r}, ${rgb.g}, ${rgb.b}, ${clamped})`;
2007
2007
  }
2008
+ function getThemeColorOverride(tokens, colorKey) {
2009
+ if (!tokens || typeof tokens !== "object") {
2010
+ return null;
2011
+ }
2012
+ const colors = tokens.colors;
2013
+ if (!colors || typeof colors !== "object") {
2014
+ return null;
2015
+ }
2016
+ const value = colors[colorKey];
2017
+ if (typeof value !== "string") {
2018
+ return null;
2019
+ }
2020
+ const normalized = value.trim();
2021
+ return normalized.length > 0 ? normalized : null;
2022
+ }
2008
2023
  var sectionStyleFromBlock = (block, pageDefaults) => {
2009
2024
  const contentWidthRaw = normalizeText(block.contentWidth, defaultSectionStyle.contentWidth);
2010
2025
  const sectionPaddingRaw = normalizeText(block.sectionPaddingY, defaultSectionStyle.sectionPaddingY);
@@ -2968,11 +2983,8 @@ function BuilderPageEditor({ featureFlags, initialDoc, pageID, siteThemeTokens }
2968
2983
  maxTextWidth: blockTypography.maxTextWidth === "sm" || blockTypography.maxTextWidth === "md" || blockTypography.maxTextWidth === "lg" || blockTypography.maxTextWidth === "full" ? blockTypography.maxTextWidth : "auto"
2969
2984
  });
2970
2985
  const headingAlign = blockTypography.headingAlign === "center" || blockTypography.headingAlign === "justify" || blockTypography.headingAlign === "right" ? blockTypography.headingAlign : "left";
2971
- const blockTokens = resolveBuilderThemeTokens({
2972
- block: blockTheme,
2973
- page: pageDefaults.themePage,
2974
- site: siteThemeTokens
2975
- });
2986
+ const headingColor = getThemeColorOverride(blockTheme, "headingText") || getThemeColorOverride(pageDefaults.themePage, "headingText") || getThemeColorOverride(siteThemeTokens, "headingText") || (block.blockType === "hero" ? "#ffffff" : resolvedThemeTokens.colors.headingText);
2987
+ const bodyColor = getThemeColorOverride(blockTheme, "bodyText") || getThemeColorOverride(pageDefaults.themePage, "bodyText") || getThemeColorOverride(siteThemeTokens, "bodyText") || (block.blockType === "hero" ? "#ffffff" : resolvedThemeTokens.colors.bodyText);
2976
2988
  return /* @__PURE__ */ jsx4("section", { className: `${className} ${shell.sectionClass}`, style: shell.sectionStyle, children: /* @__PURE__ */ jsx4("div", { style: shell.sectionInnerStyle, children: /* @__PURE__ */ jsx4(
2977
2989
  "div",
2978
2990
  {
@@ -2980,8 +2992,8 @@ function BuilderPageEditor({ featureFlags, initialDoc, pageID, siteThemeTokens }
2980
2992
  style: {
2981
2993
  ...shell.contentStyle,
2982
2994
  "--orion-builder-heading-align": headingAlign,
2983
- "--orion-builder-heading-color": blockTokens.colors.headingText || resolvedThemeTokens.colors.headingText,
2984
- color: blockTokens.colors.bodyText || resolvedThemeTokens.colors.bodyText,
2995
+ "--orion-builder-heading-color": headingColor,
2996
+ color: bodyColor,
2985
2997
  ...typographyStyle
2986
2998
  },
2987
2999
  children: content
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@orion-studios/payload-studio",
3
- "version": "0.5.0-beta.71",
3
+ "version": "0.5.0-beta.72",
4
4
  "description": "Unified Payload CMS toolkit for Orion Studios",
5
5
  "types": "./dist/index.d.ts",
6
6
  "main": "./dist/index.js",