@wordpress/block-library
Version:
Block library for the WordPress editor.
156 lines (155 loc) • 3.52 kB
JavaScript
// packages/block-library/src/comments-title/deprecated.js
import migrateTextAlign from "../utils/migrate-text-align.mjs";
var v2 = {
attributes: {
textAlign: {
type: "string"
},
showPostTitle: {
type: "boolean",
default: true
},
showCommentsCount: {
type: "boolean",
default: true
},
level: {
type: "number",
default: 2
},
levelOptions: {
type: "array"
}
},
supports: {
anchor: true,
align: true,
html: false,
__experimentalBorder: {
radius: true,
color: true,
width: true,
style: true
},
color: {
gradients: true,
__experimentalDefaultControls: {
background: true,
text: true
}
},
spacing: {
margin: true,
padding: true
},
typography: {
fontSize: true,
lineHeight: true,
__experimentalFontFamily: true,
__experimentalFontWeight: true,
__experimentalFontStyle: true,
__experimentalTextTransform: true,
__experimentalTextDecoration: true,
__experimentalLetterSpacing: true,
__experimentalDefaultControls: {
fontSize: true,
__experimentalFontFamily: true,
__experimentalFontStyle: true,
__experimentalFontWeight: true
}
},
interactivity: {
clientNavigation: true
}
},
migrate: (oldAttributes) => {
const { singleCommentLabel, multipleCommentsLabel, ...newAttributes } = oldAttributes;
return migrateTextAlign(newAttributes);
},
isEligible(attributes) {
return !!attributes.textAlign || !!attributes.className?.match(
/\bhas-text-align-(left|center|right)\b/
);
},
save: () => null
};
var v1 = {
attributes: {
textAlign: {
type: "string"
},
showPostTitle: {
type: "boolean",
default: true
},
showCommentsCount: {
type: "boolean",
default: true
},
level: {
type: "number",
default: 2
},
levelOptions: {
type: "array"
},
singleCommentLabel: {
type: "string"
},
multipleCommentsLabel: {
type: "string"
}
},
supports: {
anchor: true,
align: true,
html: false,
__experimentalBorder: {
radius: true,
color: true,
width: true,
style: true
},
color: {
gradients: true,
__experimentalDefaultControls: {
background: true,
text: true
}
},
spacing: {
margin: true,
padding: true
},
typography: {
fontSize: true,
lineHeight: true,
__experimentalFontFamily: true,
__experimentalFontWeight: true,
__experimentalFontStyle: true,
__experimentalTextTransform: true,
__experimentalTextDecoration: true,
__experimentalLetterSpacing: true,
__experimentalDefaultControls: {
fontSize: true,
__experimentalFontFamily: true,
__experimentalFontStyle: true,
__experimentalFontWeight: true
}
},
interactivity: {
clientNavigation: true
}
},
migrate: (oldAttributes) => {
const { singleCommentLabel, multipleCommentsLabel, ...newAttributes } = oldAttributes;
return migrateTextAlign(newAttributes);
},
isEligible: ({ multipleCommentsLabel, singleCommentLabel }) => multipleCommentsLabel || singleCommentLabel,
save: () => null
};
var deprecated_default = [v2, v1];
export {
deprecated_default as default
};
//# sourceMappingURL=deprecated.mjs.map