@mintlify/og 0.0.80 → 0.0.82

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,7 +7,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
7
7
  step((generator = generator.apply(thisArg, _arguments || [])).next());
8
8
  });
9
9
  };
10
- import { DEFAULT_PRESET } from '../constants.js';
11
10
  import { loadGoogleFont } from '../inputs/fonts.js';
12
11
  import { resolveOgLogoAppearance } from '../inputs/palette.js';
13
12
  const SELF_HOSTED_FONT_WEIGHT = 400;
@@ -27,6 +26,8 @@ export function buildOgCardInput(pageParams, themeParams, loaders) {
27
26
  return __awaiter(this, void 0, void 0, function* () {
28
27
  var _a;
29
28
  const { division, title, description } = pageParams;
29
+ const defaultPreset = themeParams.background ? 'legacy' : 'classic';
30
+ const preset = (_a = themeParams.preset) !== null && _a !== void 0 ? _a : defaultPreset;
30
31
  const theme = {
31
32
  appearance: themeParams.appearance,
32
33
  primaryColor: themeParams.primaryColor,
@@ -36,7 +37,7 @@ export function buildOgCardInput(pageParams, themeParams, loaders) {
36
37
  surface: themeParams.surface,
37
38
  eyebrowColor: themeParams.eyebrowColor,
38
39
  };
39
- const isLight = resolveOgLogoAppearance(theme, (_a = themeParams.preset) !== null && _a !== void 0 ? _a : DEFAULT_PRESET) === 'light';
40
+ const isLight = resolveOgLogoAppearance(theme, preset) === 'light';
40
41
  const logoSrc = isLight ? themeParams.logoLight : themeParams.logoDark;
41
42
  const fontText = [division, title, description].filter(Boolean).join(' ');
42
43
  const [logo, background, font] = yield Promise.all([
@@ -45,7 +46,7 @@ export function buildOgCardInput(pageParams, themeParams, loaders) {
45
46
  loadCardFont(themeParams, fontText, loaders.font),
46
47
  ]);
47
48
  return {
48
- preset: themeParams.preset,
49
+ preset,
49
50
  eyebrowStyle: themeParams.eyebrowStyle,
50
51
  eyebrow: division,
51
52
  title,
@@ -7,4 +7,4 @@ export declare const DEFAULT_FONT_FAMILY = "Inter";
7
7
  export declare const MONO_FONT_FAMILY = "Paper Mono";
8
8
  export declare const LOGO_HEIGHT = 56;
9
9
  export declare const MAX_BRAND_GLOW_ALPHA: Record<OgAppearance, number>;
10
- export declare const OG_RENDERER_REVISION = 4;
10
+ export declare const OG_RENDERER_REVISION = 5;
package/dist/constants.js CHANGED
@@ -7,4 +7,4 @@ export const MONO_FONT_FAMILY = 'Paper Mono';
7
7
  export const LOGO_HEIGHT = 56;
8
8
  export const MAX_BRAND_GLOW_ALPHA = { light: 0.32, dark: 0.52 };
9
9
  // Bump whenever rendered output changes for the same input, so cards get new hashes.
10
- export const OG_RENDERER_REVISION = 4;
10
+ export const OG_RENDERER_REVISION = 5;