@wordpress/editor
Version:
Enhanced block editor for WordPress posts.
77 lines (75 loc) • 3.27 kB
JavaScript
;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
// packages/editor/src/hooks/push-changes-to-global-styles/style-labels.js
var style_labels_exports = {};
__export(style_labels_exports, {
STYLE_LABELS: () => STYLE_LABELS,
getStyleLabel: () => getStyleLabel
});
module.exports = __toCommonJS(style_labels_exports);
var import_change_case = require("change-case");
var import_i18n = require("@wordpress/i18n");
var STYLE_LABELS = {
// Typography.
"typography.fontFamily": (0, import_i18n.__)("Font family"),
"typography.fontSize": (0, import_i18n.__)("Font size"),
"typography.fontStyle": (0, import_i18n.__)("Font style"),
"typography.fontWeight": (0, import_i18n.__)("Font weight"),
"typography.lineHeight": (0, import_i18n.__)("Line height"),
"typography.letterSpacing": (0, import_i18n.__)("Letter spacing"),
"typography.textDecoration": (0, import_i18n.__)("Text decoration"),
"typography.textTransform": (0, import_i18n.__)("Letter case"),
"typography.textColumns": (0, import_i18n.__)("Text columns"),
"typography.writingMode": (0, import_i18n.__)("Orientation"),
// Color.
"color.text": (0, import_i18n.__)("Text color"),
"color.background": (0, import_i18n.__)("Background color"),
"color.gradient": (0, import_i18n.__)("Gradient"),
"elements.link.color.text": (0, import_i18n.__)("Link color"),
// Spacing.
"spacing.padding": (0, import_i18n.__)("Padding"),
"spacing.margin": (0, import_i18n.__)("Margin"),
"spacing.blockGap": (0, import_i18n.__)("Block spacing"),
// Border.
border: (0, import_i18n.__)("Border"),
"border.top": (0, import_i18n.__)("Border top"),
"border.right": (0, import_i18n.__)("Border right"),
"border.bottom": (0, import_i18n.__)("Border bottom"),
"border.left": (0, import_i18n.__)("Border left"),
"border.color": (0, import_i18n.__)("Border color"),
"border.width": (0, import_i18n.__)("Border width"),
"border.style": (0, import_i18n.__)("Border style"),
"border.radius": (0, import_i18n.__)("Border radius"),
// Dimensions.
"dimensions.minHeight": (0, import_i18n.__)("Minimum height"),
"dimensions.aspectRatio": (0, import_i18n.__)("Aspect ratio")
};
function getStyleLabel(path) {
const key = path.join(".");
if (STYLE_LABELS[key]) {
return STYLE_LABELS[key];
}
return (0, import_change_case.capitalCase)(path[path.length - 1] ?? "");
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
STYLE_LABELS,
getStyleLabel
});
//# sourceMappingURL=style-labels.cjs.map