PluginProbe
Code Block Pro – Beautiful Syntax Highlighting / 1.13.0
Code Block Pro – Beautiful Syntax Highlighting v1.13.0
1.27.1 1.27.2 1.27.3 1.27.4 1.27.5 1.27.6 1.27.7 1.28.0 1.3.0 1.4.0 1.5.0 1.5.1 1.5.2 1.6.0 1.7.0 1.8.0 1.9.0 1.9.1 1.9.2 1.9.3 trunk 1.1.0 1.10.0 1.11.0 1.11.1 All 63 releases
← All changes | src/state/theme.ts +15 -3 1.4.01.13.0 View file →
@@ -5,11 +5,15 @@
5 5
6 6 type ThemeType = {
7 7 previousTheme: string;
8 8 previousLineHeight: string;
9 - previousFontFamily: string;
9 + previousFontFamily?: string;
10 10 previousFontSize: string;
11 11 previousHeaderType: string;
12 + previousFooterType?: string;
13 + previousClampFonts?: boolean;
14 + previousDisablePadding?: boolean;
15 + previousLineNumbers?: boolean;
12 16 updateThemeHistory: (settings: Partial<Attributes>) => void;
13 17 };
14 18 const path = '/wp/v2/settings';
15 19 const getSettings = async (name: string) => {
@@ -23,11 +27,15 @@
23 27 devtools(
24 28 (set) => ({
25 29 previousTheme: 'nord',
26 30 previousLineHeight: '1.25rem',
27 - previousFontFamily: '',
31 + previousFontFamily: undefined,
28 32 previousFontSize: '.875rem',
29 33 previousHeaderType: 'headlights',
34 + previousFooterType: undefined,
35 + previousClampFonts: undefined,
36 + previousDisablePadding: undefined,
37 + previousLineNumbers: undefined,
30 38 updateThemeHistory(attributes) {
31 39 set((state) => ({
32 40 ...state,
33 41 previousTheme: attributes.theme,
@@ -34,8 +42,12 @@
34 42 previousLineHeight: attributes.lineHeight,
35 43 previousFontFamily: attributes.fontFamily,
36 44 previousFontSize: attributes.fontSize,
37 45 previousHeaderType: attributes.headerType,
46 + previousFooterType: attributes.footerType,
47 + previousClampFonts: attributes.clampFonts,
48 + previousDisablePadding: attributes.disablePadding,
49 + previousLineNumbers: attributes.lineNumbers,
38 50 }));
39 51 },
40 52 }),
41 53 { name: 'Code Block Pro Theme Settings' },
@@ -45,9 +57,9 @@
45 57 getStorage: () => ({
46 58 getItem: async (name: string) => {
47 59 const settings = await getSettings(name);
48 60 return JSON.stringify({
49 - version: settings.version,
61 + version: settings?.version ?? 0,
50 62 state: settings,
51 63 });
52 64 },
53 65 setItem: async (name: string, value: string) => {