| 1 |
( function () { |
| 2 |
var el = wp.element.createElement; |
| 3 |
var Fragment = wp.element.Fragment; |
| 4 |
var registerBlockType = wp.blocks.registerBlockType; |
| 5 |
var InspectorControls = wp.blockEditor.InspectorControls; |
| 6 |
var useBlockProps = wp.blockEditor.useBlockProps; |
| 7 |
var PanelBody = wp.components.PanelBody; |
| 8 |
var PanelColorSettings = wp.blockEditor.PanelColorSettings; |
| 9 |
var ToggleControl = wp.components.ToggleControl; |
| 10 |
var RangeControl = wp.components.RangeControl; |
| 11 |
var TextControl = wp.components.TextControl; |
| 12 |
var TextareaControl = wp.components.TextareaControl; |
| 13 |
var Button = wp.components.Button; |
| 14 |
|
| 15 |
var resIcon = { article: '📄', video: '🎥', tool: '🛠️', download: '⬇️', link: '🔗' }; |
| 16 |
|
| 17 |
var _tc, _tv; |
| 18 |
function getTC() { return _tc || (_tc = window.bkbgTypographyControl); } |
| 19 |
function getTV() { return _tv || (_tv = window.bkbgTypoCssVars); } |
| 20 |
|
| 21 |
function upd(arr, idx, field, val) { |
| 22 |
return arr.map(function (e, i) { |
| 23 |
if (i !== idx) return e; |
| 24 |
var u = {}; u[field] = val; |
| 25 |
return Object.assign({}, e, u); |
| 26 |
}); |
| 27 |
} |
| 28 |
|
| 29 |
function sectionHead(label, a) { |
| 30 |
return el('div', { style: { fontSize: 10, fontWeight: 700, textTransform: 'uppercase', letterSpacing: '.09em', color: a.accentColor, borderBottom: '2px solid ' + a.accentColor, paddingBottom: 5, marginBottom: 10 } }, label); |
| 31 |
} |
| 32 |
|
| 33 |
registerBlockType('blockenberg/show-notes', { |
| 34 |
edit: function (props) { |
| 35 |
var a = props.attributes; |
| 36 |
var set = props.setAttributes; |
| 37 |
var blockProps = useBlockProps((function () { |
| 38 |
var _tvf = getTV(); |
| 39 |
var s = {}; |
| 40 |
if (_tvf) { |
| 41 |
Object.assign(s, _tvf(a.titleTypo, '--bksn-tt-')); |
| 42 |
Object.assign(s, _tvf(a.bodyTypo, '--bksn-bt-')); |
| 43 |
Object.assign(s, _tvf(a.typoQuote, '--bksn-qt-')); |
| 44 |
} |
| 45 |
return { className: 'bkbg-sn-editor-wrap', style: s }; |
| 46 |
})()); |
| 47 |
|
| 48 |
var preview = el('div', { style: { border: '1px solid ' + a.borderColor, borderRadius: a.borderRadius + 'px', overflow: 'hidden', background: a.bgColor, fontSize: a.fontSize + 'px', lineHeight: (a.lineHeight / 100).toFixed(2) } }, |
| 49 |
// Header |
| 50 |
el('div', { style: { background: a.headerBg, padding: '18px 24px' } }, |
| 51 |
a.showEpisodeMeta && el('div', { style: { display: 'flex', gap: 10, alignItems: 'center', marginBottom: 8, flexWrap: 'wrap' } }, |
| 52 |
el('span', { style: { fontSize: a.podcastNameSize || 11, color: a.metaColor, fontWeight: 600 } }, a.podcastName), |
| 53 |
el('span', { style: { color: a.metaColor, opacity: .35 } }, '·'), |
| 54 |
el('span', { style: { fontSize: 11, color: a.metaColor } }, a.episodeNumber), |
| 55 |
a.season && el('span', { style: { fontSize: 11, color: a.metaColor } }, ' / ' + a.season) |
| 56 |
), |
| 57 |
el('h2', { className: 'bkbg-sn-title', style: { margin: '0 0 10px', color: a.headerColor } }, a.episodeTitle), |
| 58 |
a.showMeta && el('div', { style: { display: 'flex', gap: 14, flexWrap: 'wrap' } }, |
| 59 |
a.publishDate && el('span', { style: { fontSize: 12, color: a.metaColor } }, '� |
| 60 |
' + a.publishDate), |
| 61 |
a.duration && el('span', { style: { fontSize: 12, color: a.metaColor } }, '⏱ ' + a.duration) |
| 62 |
) |
| 63 |
), |
| 64 |
// Body |
| 65 |
el('div', { style: { padding: '18px 24px', display: 'grid', gap: 20 } }, |
| 66 |
// Intro |
| 67 |
a.showIntro && a.intro && el('div', { style: { background: a.introBg, borderRadius: 8, padding: '12px 16px' } }, |
| 68 |
el('p', { style: { margin: 0, color: a.introColor, lineHeight: (a.lineHeight / 100).toFixed(2) } }, a.intro) |
| 69 |
), |
| 70 |
// Quote |
| 71 |
a.showQuote && a.quoteHighlight && el('figure', { style: { margin: 0, background: a.quoteBg, borderLeft: '4px solid ' + a.quoteBorder, borderRadius: '0 8px 8px 0', padding: '14px 18px' } }, |
| 72 |
el('blockquote', { style: { margin: 0, fontSize: (a.fontSize + 1) + 'px', fontStyle: 'italic', color: a.quoteColor, lineHeight: (a.lineHeight / 100).toFixed(2) } }, '"' + a.quoteHighlight + '"'), |
| 73 |
a.quoteSpeaker && el('figcaption', { style: { marginTop: 8, fontSize: 12, fontWeight: 700, color: a.quoteColor, opacity: .8 } }, '— ' + a.quoteSpeaker) |
| 74 |
), |
| 75 |
// Sponsors |
| 76 |
a.showSponsors && a.sponsors.length > 0 && el('div', null, |
| 77 |
sectionHead(a.sponsorsLabel, a), |
| 78 |
el('div', { style: { display: 'grid', gap: 8 } }, |
| 79 |
a.sponsors.map(function (sp, i) { |
| 80 |
return el('div', { key: i, style: { background: a.sponsorBg, border: '1px solid ' + a.sponsorBorder, borderRadius: 8, padding: '10px 14px' } }, |
| 81 |
el('div', { style: { display: 'flex', justifyContent: 'space-between', alignItems: 'baseline', marginBottom: 4, flexWrap: 'wrap', gap: 6 } }, |
| 82 |
el('strong', { style: { color: '#713f12' } }, sp.name), |
| 83 |
sp.code && el('span', { style: { fontSize: 11, background: '#fef9c3', color: '#713f12', padding: '2px 8px', borderRadius: 100, fontWeight: 700 } }, 'Code: ' + sp.code) |
| 84 |
), |
| 85 |
el('p', { style: { margin: 0, fontSize: (a.fontSize - 1) + 'px', color: a.sponsorColor } }, sp.description) |
| 86 |
); |
| 87 |
}) |
| 88 |
) |
| 89 |
), |
| 90 |
// Chapters |
| 91 |
a.showChapters && a.chapters.length > 0 && el('div', null, |
| 92 |
sectionHead(a.chaptersLabel, a), |
| 93 |
el('div', null, |
| 94 |
a.chapters.map(function (ch, i) { |
| 95 |
return el('div', { key: i, style: { display: 'flex', gap: 12, alignItems: 'baseline', padding: '7px 0', borderBottom: i < a.chapters.length - 1 ? '1px dashed ' + a.borderColor : 'none' } }, |
| 96 |
el('span', { style: { fontFamily: 'monospace', fontSize: 11, fontWeight: 700, background: a.chapterTimeBg, color: a.chapterTimeColor, padding: '2px 7px', borderRadius: 4, flexShrink: 0 } }, ch.time), |
| 97 |
el('span', { style: { color: a.chapterTitleColor, fontSize: a.fontSize + 'px' } }, ch.title) |
| 98 |
); |
| 99 |
}) |
| 100 |
) |
| 101 |
), |
| 102 |
// Links Mentioned |
| 103 |
a.showLinks && a.links.length > 0 && el('div', null, |
| 104 |
sectionHead(a.linksLabel, a), |
| 105 |
el('div', null, |
| 106 |
a.links.map(function (lnk, i) { |
| 107 |
return el('div', { key: i, style: { padding: '7px 0', borderBottom: i < a.links.length - 1 ? '1px solid ' + a.borderColor : 'none' } }, |
| 108 |
el('div', { style: { fontWeight: 600, color: a.linkColor, marginBottom: 2 } }, lnk.title), |
| 109 |
lnk.description && el('div', { style: { fontSize: (a.fontSize - 1) + 'px', color: a.linkDescColor } }, lnk.description) |
| 110 |
); |
| 111 |
}) |
| 112 |
) |
| 113 |
), |
| 114 |
// Resources |
| 115 |
a.showResources && a.resources.length > 0 && el('div', null, |
| 116 |
sectionHead(a.resourcesLabel, a), |
| 117 |
el('div', { style: { display: 'grid', gap: 6 } }, |
| 118 |
a.resources.map(function (r, i) { |
| 119 |
return el('div', { key: i, style: { display: 'flex', gap: 10, alignItems: 'center', padding: '8px 12px', background: '#f8fafc', borderRadius: 8, borderLeft: '3px solid ' + a.accentColor } }, |
| 120 |
el('span', null, resIcon[r.type] || '🔗'), |
| 121 |
el('span', { style: { color: a.linkColor, fontWeight: 500, fontSize: a.fontSize + 'px' } }, r.title) |
| 122 |
); |
| 123 |
}) |
| 124 |
) |
| 125 |
), |
| 126 |
// Tags |
| 127 |
a.showTags && a.tags.length > 0 && el('div', { style: { display: 'flex', gap: 6, flexWrap: 'wrap' } }, |
| 128 |
a.tags.map(function (tag, i) { |
| 129 |
return el('span', { key: i, style: { background: a.tagBg, color: a.tagColor, padding: '3px 10px', borderRadius: 100, fontSize: 11, fontWeight: 600 } }, tag); |
| 130 |
}) |
| 131 |
) |
| 132 |
) |
| 133 |
); |
| 134 |
|
| 135 |
return el(Fragment, null, |
| 136 |
el('div', blockProps, preview), |
| 137 |
el(InspectorControls, null, |
| 138 |
el(PanelBody, { title: 'Episode Info', initialOpen: true }, |
| 139 |
el(TextControl, { label: 'Podcast Name', value: a.podcastName, __nextHasNoMarginBottom: true, onChange: function (v) { set({ podcastName: v }); } }), |
| 140 |
el('div', { style: { marginTop: 8 } }, |
| 141 |
el(TextControl, { label: 'Episode Title', value: a.episodeTitle, __nextHasNoMarginBottom: true, onChange: function (v) { set({ episodeTitle: v }); } }) |
| 142 |
), |
| 143 |
el('div', { style: { marginTop: 8, display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 8 } }, |
| 144 |
el(TextControl, { label: 'Episode #', value: a.episodeNumber, __nextHasNoMarginBottom: true, onChange: function (v) { set({ episodeNumber: v }); } }), |
| 145 |
el(TextControl, { label: 'Season', value: a.season, __nextHasNoMarginBottom: true, onChange: function (v) { set({ season: v }); } }) |
| 146 |
), |
| 147 |
el('div', { style: { marginTop: 8, display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 8 } }, |
| 148 |
el(TextControl, { label: 'Date', value: a.publishDate, __nextHasNoMarginBottom: true, onChange: function (v) { set({ publishDate: v }); } }), |
| 149 |
el(TextControl, { label: 'Duration', value: a.duration, __nextHasNoMarginBottom: true, onChange: function (v) { set({ duration: v }); } }) |
| 150 |
), |
| 151 |
el('div', { style: { marginTop: 8, display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 8 } }, |
| 152 |
el(ToggleControl, { label: 'Show Ep #', checked: a.showEpisodeMeta, __nextHasNoMarginBottom: true, onChange: function (v) { set({ showEpisodeMeta: v }); } }), |
| 153 |
el(ToggleControl, { label: 'Show Date/Dur', checked: a.showMeta, __nextHasNoMarginBottom: true, onChange: function (v) { set({ showMeta: v }); } }) |
| 154 |
) |
| 155 |
), |
| 156 |
el(PanelBody, { title: 'Introduction', initialOpen: false }, |
| 157 |
el(ToggleControl, { label: 'Show Introduction', checked: a.showIntro, __nextHasNoMarginBottom: true, onChange: function (v) { set({ showIntro: v }); } }), |
| 158 |
el('div', { style: { marginTop: 8 } }, |
| 159 |
el(TextareaControl, { label: 'Intro Text', value: a.intro, rows: 4, __nextHasNoMarginBottom: true, onChange: function (v) { set({ intro: v }); } }) |
| 160 |
) |
| 161 |
), |
| 162 |
el(PanelBody, { title: 'Featured Quote', initialOpen: false }, |
| 163 |
el(ToggleControl, { label: 'Show Quote', checked: a.showQuote, __nextHasNoMarginBottom: true, onChange: function (v) { set({ showQuote: v }); } }), |
| 164 |
el('div', { style: { marginTop: 8 } }, |
| 165 |
el(TextareaControl, { label: 'Quote', value: a.quoteHighlight, rows: 3, __nextHasNoMarginBottom: true, onChange: function (v) { set({ quoteHighlight: v }); } }) |
| 166 |
), |
| 167 |
el('div', { style: { marginTop: 8 } }, |
| 168 |
el(TextControl, { label: 'Speaker', value: a.quoteSpeaker, __nextHasNoMarginBottom: true, onChange: function (v) { set({ quoteSpeaker: v }); } }) |
| 169 |
) |
| 170 |
), |
| 171 |
el(PanelBody, { title: 'Sponsors', initialOpen: false }, |
| 172 |
el(ToggleControl, { label: 'Show Sponsors', checked: a.showSponsors, __nextHasNoMarginBottom: true, onChange: function (v) { set({ showSponsors: v }); } }), |
| 173 |
el('div', { style: { marginTop: 8 } }, |
| 174 |
el(TextControl, { label: 'Section Label', value: a.sponsorsLabel, __nextHasNoMarginBottom: true, onChange: function (v) { set({ sponsorsLabel: v }); } }) |
| 175 |
), |
| 176 |
el('div', { style: { marginTop: 8 } }, |
| 177 |
a.sponsors.map(function (sp, i) { |
| 178 |
return el('div', { key: i, style: { marginBottom: 10, padding: '8px 10px', border: '1px solid #e5e7eb', borderRadius: 8, background: '#f8fafc' } }, |
| 179 |
el('div', { style: { display: 'flex', justifyContent: 'flex-end', marginBottom: 4 } }, |
| 180 |
el(Button, { isDestructive: true, variant: 'link', style: { fontSize: 11 }, onClick: function () { set({ sponsors: a.sponsors.filter(function (_, j) { return j !== i; }) }); } }, '✕') |
| 181 |
), |
| 182 |
el(TextControl, { label: 'Sponsor Name', value: sp.name, __nextHasNoMarginBottom: true, onChange: function (v) { set({ sponsors: upd(a.sponsors, i, 'name', v) }); } }), |
| 183 |
el('div', { style: { marginTop: 8 } }, |
| 184 |
el(TextareaControl, { label: 'Description', value: sp.description, rows: 2, __nextHasNoMarginBottom: true, onChange: function (v) { set({ sponsors: upd(a.sponsors, i, 'description', v) }); } }) |
| 185 |
), |
| 186 |
el('div', { style: { marginTop: 8, display: 'grid', gridTemplateColumns: '2fr 1fr', gap: 8 } }, |
| 187 |
el(TextControl, { label: 'URL', value: sp.url, __nextHasNoMarginBottom: true, onChange: function (v) { set({ sponsors: upd(a.sponsors, i, 'url', v) }); } }), |
| 188 |
el(TextControl, { label: 'Promo Code', value: sp.code, __nextHasNoMarginBottom: true, onChange: function (v) { set({ sponsors: upd(a.sponsors, i, 'code', v) }); } }) |
| 189 |
) |
| 190 |
); |
| 191 |
}), |
| 192 |
el(Button, { variant: 'primary', style: { width: '100%', justifyContent: 'center', marginTop: 4 }, onClick: function () { set({ sponsors: a.sponsors.concat([{ name: 'Sponsor', description: '', url: '#', code: '' }]) }); } }, '+ Add Sponsor') |
| 193 |
) |
| 194 |
), |
| 195 |
el(PanelBody, { title: 'Chapters', initialOpen: false }, |
| 196 |
el(ToggleControl, { label: 'Show Chapters', checked: a.showChapters, __nextHasNoMarginBottom: true, onChange: function (v) { set({ showChapters: v }); } }), |
| 197 |
el('div', { style: { marginTop: 8 } }, |
| 198 |
el(TextControl, { label: 'Section Label', value: a.chaptersLabel, __nextHasNoMarginBottom: true, onChange: function (v) { set({ chaptersLabel: v }); } }) |
| 199 |
), |
| 200 |
el('div', { style: { marginTop: 8 } }, |
| 201 |
a.chapters.map(function (ch, i) { |
| 202 |
return el('div', { key: i, style: { display: 'grid', gridTemplateColumns: '80px 1fr auto', gap: 6, marginBottom: 6, alignItems: 'center' } }, |
| 203 |
el(TextControl, { label: '', value: ch.time, placeholder: '00:00', __nextHasNoMarginBottom: true, onChange: function (v) { set({ chapters: upd(a.chapters, i, 'time', v) }); } }), |
| 204 |
el(TextControl, { label: '', value: ch.title, __nextHasNoMarginBottom: true, onChange: function (v) { set({ chapters: upd(a.chapters, i, 'title', v) }); } }), |
| 205 |
el(Button, { isDestructive: true, variant: 'link', onClick: function () { set({ chapters: a.chapters.filter(function (_, j) { return j !== i; }) }); } }, '✕') |
| 206 |
); |
| 207 |
}), |
| 208 |
el(Button, { variant: 'primary', style: { width: '100%', justifyContent: 'center', marginTop: 4 }, onClick: function () { set({ chapters: a.chapters.concat([{ time: '00:00', title: 'New chapter' }]) }); } }, '+ Add Chapter') |
| 209 |
) |
| 210 |
), |
| 211 |
el(PanelBody, { title: 'Links Mentioned', initialOpen: false }, |
| 212 |
el(ToggleControl, { label: 'Show Links', checked: a.showLinks, __nextHasNoMarginBottom: true, onChange: function (v) { set({ showLinks: v }); } }), |
| 213 |
el('div', { style: { marginTop: 8 } }, |
| 214 |
el(TextControl, { label: 'Section Label', value: a.linksLabel, __nextHasNoMarginBottom: true, onChange: function (v) { set({ linksLabel: v }); } }) |
| 215 |
), |
| 216 |
el('div', { style: { marginTop: 8 } }, |
| 217 |
a.links.map(function (lnk, i) { |
| 218 |
return el('div', { key: i, style: { marginBottom: 10, padding: '8px 10px', border: '1px solid #e5e7eb', borderRadius: 8, background: '#f8fafc' } }, |
| 219 |
el('div', { style: { display: 'flex', justifyContent: 'flex-end', marginBottom: 4 } }, |
| 220 |
el(Button, { isDestructive: true, variant: 'link', style: { fontSize: 11 }, onClick: function () { set({ links: a.links.filter(function (_, j) { return j !== i; }) }); } }, '✕') |
| 221 |
), |
| 222 |
el(TextControl, { label: 'Title', value: lnk.title, __nextHasNoMarginBottom: true, onChange: function (v) { set({ links: upd(a.links, i, 'title', v) }); } }), |
| 223 |
el('div', { style: { marginTop: 8 } }, |
| 224 |
el(TextControl, { label: 'URL', value: lnk.url, __nextHasNoMarginBottom: true, onChange: function (v) { set({ links: upd(a.links, i, 'url', v) }); } }) |
| 225 |
), |
| 226 |
el('div', { style: { marginTop: 8 } }, |
| 227 |
el(TextControl, { label: 'Description', value: lnk.description, __nextHasNoMarginBottom: true, onChange: function (v) { set({ links: upd(a.links, i, 'description', v) }); } }) |
| 228 |
) |
| 229 |
); |
| 230 |
}), |
| 231 |
el(Button, { variant: 'primary', style: { width: '100%', justifyContent: 'center', marginTop: 4 }, onClick: function () { set({ links: a.links.concat([{ title: 'Link', url: '#', description: '' }]) }); } }, '+ Add Link') |
| 232 |
) |
| 233 |
), |
| 234 |
el(PanelBody, { title: 'Resources', initialOpen: false }, |
| 235 |
el(ToggleControl, { label: 'Show Resources', checked: a.showResources, __nextHasNoMarginBottom: true, onChange: function (v) { set({ showResources: v }); } }), |
| 236 |
el('div', { style: { marginTop: 8 } }, |
| 237 |
el(TextControl, { label: 'Section Label', value: a.resourcesLabel, __nextHasNoMarginBottom: true, onChange: function (v) { set({ resourcesLabel: v }); } }) |
| 238 |
), |
| 239 |
el('div', { style: { marginTop: 8 } }, |
| 240 |
a.resources.map(function (r, i) { |
| 241 |
return el('div', { key: i, style: { display: 'flex', gap: 6, marginBottom: 6, alignItems: 'center' } }, |
| 242 |
el(TextControl, { label: '', value: r.title, __nextHasNoMarginBottom: true, onChange: function (v) { set({ resources: upd(a.resources, i, 'title', v) }); } }), |
| 243 |
el(Button, { isDestructive: true, variant: 'link', onClick: function () { set({ resources: a.resources.filter(function (_, j) { return j !== i; }) }); } }, '✕') |
| 244 |
); |
| 245 |
}), |
| 246 |
el(Button, { variant: 'primary', style: { width: '100%', justifyContent: 'center', marginTop: 4 }, onClick: function () { set({ resources: a.resources.concat([{ title: 'Resource', url: '#', type: 'article' }]) }); } }, '+ Add Resource') |
| 247 |
) |
| 248 |
), |
| 249 |
el(PanelBody, { title: 'Tags', initialOpen: false }, |
| 250 |
el(ToggleControl, { label: 'Show Tags', checked: a.showTags, __nextHasNoMarginBottom: true, onChange: function (v) { set({ showTags: v }); } }), |
| 251 |
el('div', { style: { marginTop: 8 } }, |
| 252 |
a.tags.map(function (tag, i) { |
| 253 |
return el('div', { key: i, style: { display: 'flex', gap: 6, marginBottom: 6, alignItems: 'center' } }, |
| 254 |
el(TextControl, { label: '', value: tag, __nextHasNoMarginBottom: true, onChange: function (v) { set({ tags: a.tags.map(function (x, j) { return j === i ? v : x; }) }); } }), |
| 255 |
el(Button, { isDestructive: true, variant: 'link', onClick: function () { set({ tags: a.tags.filter(function (_, j) { return j !== i; }) }); } }, '✕') |
| 256 |
); |
| 257 |
}), |
| 258 |
el(Button, { variant: 'secondary', style: { width: '100%', justifyContent: 'center', marginTop: 4 }, onClick: function () { set({ tags: a.tags.concat(['new tag']) }); } }, '+ Add Tag') |
| 259 |
) |
| 260 |
), |
| 261 |
el(PanelBody, { title: 'Typography', initialOpen: false }, |
| 262 |
el(getTC(), { label: 'Title', value: a.titleTypo, onChange: function (v) { set({ titleTypo: v }); } }), |
| 263 |
el(getTC(), { label: 'Body Text', value: a.bodyTypo, onChange: function (v) { set({ bodyTypo: v }); } }), |
| 264 |
el(getTC(), { label: __('Featured Quote', 'blockenberg'), value: a.typoQuote, onChange: function (v) { set({ typoQuote: v }); } }), |
| 265 |
el('div', { style: { marginTop: 8 } }, |
| 266 |
el(RangeControl, { label: 'Podcast Name Size (px)', value: a.podcastNameSize, min: 9, max: 18, __nextHasNoMarginBottom: true, onChange: function (v) { set({ podcastNameSize: v }); } }) |
| 267 |
) |
| 268 |
), |
| 269 |
el(PanelBody, { title: 'Spacing', initialOpen: false }, |
| 270 |
el(RangeControl, { label: 'Border Radius (px)', value: a.borderRadius, min: 0, max: 24, __nextHasNoMarginBottom: true, onChange: function (v) { set({ borderRadius: v }); } }) |
| 271 |
), |
| 272 |
el(PanelColorSettings, { |
| 273 |
title: 'Header & Layout Colors', |
| 274 |
initialOpen: false, |
| 275 |
colorSettings: [ |
| 276 |
{ label: 'Header BG', value: a.headerBg, onChange: function (v) { set({ headerBg: v || '#0f172a' }); } }, |
| 277 |
{ label: 'Header Text', value: a.headerColor, onChange: function (v) { set({ headerColor: v || '#ffffff' }); } }, |
| 278 |
{ label: 'Meta Text', value: a.metaColor, onChange: function (v) { set({ metaColor: v || '#94a3b8' }); } }, |
| 279 |
{ label: 'Block BG', value: a.bgColor, onChange: function (v) { set({ bgColor: v || '#ffffff' }); } }, |
| 280 |
{ label: 'Border', value: a.borderColor, onChange: function (v) { set({ borderColor: v || '#e5e7eb' }); } }, |
| 281 |
{ label: 'Accent', value: a.accentColor, onChange: function (v) { set({ accentColor: v || '#3b82f6' }); } } |
| 282 |
] |
| 283 |
}), |
| 284 |
el(PanelColorSettings, { |
| 285 |
title: 'Content Colors', |
| 286 |
initialOpen: false, |
| 287 |
colorSettings: [ |
| 288 |
{ label: 'Intro BG', value: a.introBg, onChange: function (v) { set({ introBg: v || '#f8fafc' }); } }, |
| 289 |
{ label: 'Intro Text', value: a.introColor, onChange: function (v) { set({ introColor: v || '#374151' }); } }, |
| 290 |
{ label: 'Sponsor BG', value: a.sponsorBg, onChange: function (v) { set({ sponsorBg: v || '#fffbeb' }); } }, |
| 291 |
{ label: 'Sponsor Border', value: a.sponsorBorder, onChange: function (v) { set({ sponsorBorder: v || '#fbbf24' }); } }, |
| 292 |
{ label: 'Chapter Time BG', value: a.chapterTimeBg, onChange: function (v) { set({ chapterTimeBg: v || '#f1f5f9' }); } }, |
| 293 |
{ label: 'Chapter Time', value: a.chapterTimeColor,onChange: function (v) { set({ chapterTimeColor: v || '#475569' }); } }, |
| 294 |
{ label: 'Link Color', value: a.linkColor, onChange: function (v) { set({ linkColor: v || '#2563eb' }); } }, |
| 295 |
{ label: 'Quote BG', value: a.quoteBg, onChange: function (v) { set({ quoteBg: v || '#f0f9ff' }); } }, |
| 296 |
{ label: 'Quote Text', value: a.quoteColor, onChange: function (v) { set({ quoteColor: v || '#0369a1' }); } }, |
| 297 |
{ label: 'Quote Border', value: a.quoteBorder, onChange: function (v) { set({ quoteBorder: v || '#3b82f6' }); } }, |
| 298 |
{ label: 'Tag BG', value: a.tagBg, onChange: function (v) { set({ tagBg: v || '#eff6ff' }); } }, |
| 299 |
{ label: 'Tag Text', value: a.tagColor, onChange: function (v) { set({ tagColor: v || '#1d4ed8' }); } } |
| 300 |
] |
| 301 |
}) |
| 302 |
) |
| 303 |
); |
| 304 |
}, |
| 305 |
|
| 306 |
save: function (props) { |
| 307 |
var useBlockProps = wp.blockEditor.useBlockProps; |
| 308 |
return wp.element.createElement('div', useBlockProps.save(), |
| 309 |
wp.element.createElement('div', { |
| 310 |
className: 'bkbg-show-notes-app', |
| 311 |
'data-opts': JSON.stringify(props.attributes) |
| 312 |
}) |
| 313 |
); |
| 314 |
} |
| 315 |
}); |
| 316 |
}() ); |
| 317 |
|