| @@ -1,24 +1,20 @@ | ||
| 1 | 1 | import { applyFilters } from '@wordpress/hooks'; |
| 2 | 2 | import defaultThemes from '../defaultThemes.json'; |
| 3 | 3 | |
| 4 | 4 | const themes = () => |
| 5 | - applyFilters('blocks.codeBlockPro.themes', defaultThemes) as Record< | |
| 6 | - string, | |
| 7 | - { name: string; priority?: boolean; custom?: boolean } | |
| 8 | - >; | |
| 5 | + applyFilters('blocks.codeBlockPro.themes', defaultThemes) as Record< | |
| 6 | + string, | |
| 7 | + { name: string; priority?: boolean } | |
| 8 | + >; | |
| 9 | 9 | |
| 10 | 10 | const themesNormalized = () => |
| 11 | - Object.entries(themes()).map(([slug, { name, priority, custom }]) => ({ | |
| 12 | - name, | |
| 13 | - slug, | |
| 14 | - priority, | |
| 15 | - custom, | |
| 16 | - })); | |
| 11 | + Object.entries(themes()).map(([slug, { name, priority }]) => ({ | |
| 12 | + name, | |
| 13 | + slug, | |
| 14 | + priority, | |
| 15 | + })); | |
| 17 | 16 | export const getPriorityThemes = () => |
| 18 | - themesNormalized().filter(({ priority }) => priority); | |
| 17 | + themesNormalized().filter(({ priority }) => priority); | |
| 19 | 18 | |
| 20 | 19 | export const getNormalThemes = () => |
| 21 | - themesNormalized().filter(({ priority, custom }) => !priority && !custom); | |
| 22 | - | |
| 23 | -export const getCustomThemes = () => | |
| 24 | - themesNormalized().filter(({ custom }) => custom); | |
| 20 | + themesNormalized().filter(({ priority }) => !priority); | |