| 1 |
import { __ } from "@wordpress/i18n"; |
| 2 |
|
| 3 |
import { |
| 4 |
ARTICLE_SUMMARY_TITLE_MARGIN, |
| 5 |
ARTICLE_SUMMARY_TITLE_PADDING, |
| 6 |
ARTICLE_SUMMARY_CONTENT_MARGIN, |
| 7 |
ARTICLE_SUMMARY_CONTENT_PADDING, |
| 8 |
ARTICLE_SUMMARY_BOX_MARGIN, |
| 9 |
ARTICLE_SUMMARY_BOX_PADDING, |
| 10 |
} from './constants'; |
| 11 |
|
| 12 |
import { |
| 13 |
generateTypographyAttributes, |
| 14 |
generateDimensionsAttributes, |
| 15 |
} from '../../../util/helpers'; |
| 16 |
|
| 17 |
import * as prefixes from './typographyPrefixConstants'; |
| 18 |
|
| 19 |
const attributes = { |
| 20 |
// Required attributes for responsive options and asset generation |
| 21 |
resOption: { |
| 22 |
type: 'string', |
| 23 |
default: 'Desktop', |
| 24 |
}, |
| 25 |
blockId: { |
| 26 |
type: 'string', |
| 27 |
}, |
| 28 |
blockRoot: { |
| 29 |
type: 'string', |
| 30 |
default: 'better_docs', |
| 31 |
}, |
| 32 |
blockMeta: { |
| 33 |
type: 'object', |
| 34 |
}, |
| 35 |
|
| 36 |
// Content attributes |
| 37 |
customTitle: { |
| 38 |
type: "string", |
| 39 |
default: "", |
| 40 |
}, |
| 41 |
showTitle: { |
| 42 |
type: "boolean", |
| 43 |
default: true, |
| 44 |
}, |
| 45 |
|
| 46 |
// Typography attributes |
| 47 |
...generateTypographyAttributes(Object.values(prefixes)), |
| 48 |
|
| 49 |
// Color attributes |
| 50 |
titleColor: { |
| 51 |
type: "string", |
| 52 |
default: "#2c3e50", |
| 53 |
}, |
| 54 |
titleBGColor: { |
| 55 |
type: "string", |
| 56 |
default: "#f9fafb", |
| 57 |
}, |
| 58 |
contentColor: { |
| 59 |
type: "string", |
| 60 |
default: "#555555", |
| 61 |
}, |
| 62 |
loadingColor: { |
| 63 |
type: "string", |
| 64 |
default: "#666666", |
| 65 |
}, |
| 66 |
iconColor: { |
| 67 |
type: "string", |
| 68 |
default: "#2c3e50", |
| 69 |
}, |
| 70 |
backgroundColor: { |
| 71 |
type: "string", |
| 72 |
default: "#ffffff", |
| 73 |
}, |
| 74 |
borderColor: { |
| 75 |
type: "string", |
| 76 |
default: "#e1e5e9", |
| 77 |
}, |
| 78 |
|
| 79 |
// Border attributes |
| 80 |
borderWidth: { |
| 81 |
type: "number", |
| 82 |
default: 1, |
| 83 |
}, |
| 84 |
borderRadius: { |
| 85 |
type: "number", |
| 86 |
default: 8, |
| 87 |
}, |
| 88 |
|
| 89 |
// Icon size |
| 90 |
iconSize: { |
| 91 |
type: "number", |
| 92 |
default: 14, |
| 93 |
}, |
| 94 |
|
| 95 |
// Dimension attributes |
| 96 |
...generateDimensionsAttributes(ARTICLE_SUMMARY_TITLE_MARGIN), |
| 97 |
...generateDimensionsAttributes(ARTICLE_SUMMARY_TITLE_PADDING), |
| 98 |
...generateDimensionsAttributes(ARTICLE_SUMMARY_CONTENT_MARGIN), |
| 99 |
...generateDimensionsAttributes(ARTICLE_SUMMARY_CONTENT_PADDING), |
| 100 |
...generateDimensionsAttributes(ARTICLE_SUMMARY_BOX_MARGIN), |
| 101 |
...generateDimensionsAttributes(ARTICLE_SUMMARY_BOX_PADDING), |
| 102 |
}; |
| 103 |
|
| 104 |
export default attributes; |
| 105 |
|