# extendify/3.2.1/src/Shared/lib/vibe-globals.js

Extendify, version 3.2.1. 55 lines.

- Page: https://pluginprobe.com/plugins/extendify/3.2.1/code/src/Shared/lib/vibe-globals.js
- Raw: https://pluginprobe.com/plugins/extendify/3.2.1/raw/src/Shared/lib/vibe-globals.js
- Modified: 2026-09-09T18:23:40+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/extendify/3.2.1/code/src/Shared/lib/vibe-globals.js#L10-L20`.

```javascript
import {
	applyOwnedSection,
	collectOwnedPaths,
} from '@shared/lib/owned-globals';

const ownedSettings = ['layout', 'typography', 'custom'];
// Per-leaf, so clearing a heading size leaves fontFamily to the fonts layer.
// WordPress reads duotone per block name, never per variation, so blocks is owned here.
const ownedStyles = ['typography', 'elements', 'blocks'];

// The fonts and palette layers own these; a declaring payload is ignored.
const isExcludedPath = (section, path) => {
	if (path[path.length - 1] === 'fontFamily') return true;
	if (section !== 'settings') return false;
	if (path[0] === 'color') return true;
	return path[0] === 'typography' && path[1] === 'fontFamilies';
};

export const ownedSettingPaths = (vibes) =>
	collectOwnedPaths({
		payloads: vibes,
		section: 'settings',
		roots: ownedSettings,
		exclude: isExcludedPath,
	});

export const ownedStylePaths = (vibes) =>
	collectOwnedPaths({
		payloads: vibes,
		section: 'styles',
		roots: ownedStyles,
		exclude: isExcludedPath,
	});

export const applyVibeGlobals = ({ currentSettings, vibeSettings, vibes }) =>
	applyOwnedSection(currentSettings, vibeSettings, ownedSettingPaths(vibes));

export const applyVibeStyles = ({ currentStyles, vibeStyles, vibes }) =>
	applyOwnedSection(currentStyles, vibeStyles, ownedStylePaths(vibes));

// A fonts or colors write may not move vibe-owned leaves.
export const preserveVibeSettings = ({
	mergedSettings,
	currentSettings,
	vibes,
}) =>
	applyOwnedSection(mergedSettings, currentSettings, ownedSettingPaths(vibes));

export const preserveVibeStyles = ({ mergedStyles, currentStyles, vibes }) =>
	applyOwnedSection(mergedStyles, currentStyles, ownedStylePaths(vibes));

// natural-1 is what the theme ships, so writing it would only restate the theme.
export const vibeGlobalsEntry = (vibes, selectedVibe) =>
	selectedVibe === 'natural-1' ? undefined : vibes?.[selectedVibe];

```
