PluginProbe
Assistant – Every Day Productivity Apps / 1.2.2
Assistant – Every Day Productivity Apps v1.2.2
1.5.5 trunk 0.1.0 0.2.0 0.2.1 0.2.2 0.3.0 0.3.1 0.4 0.4.1 0.4.2 0.5.0 0.5.1 0.6.0 0.7.0 0.7.0.2 0.7.0.3 0.7.0.4 0.7.0.5 0.7.0.6 0.7.0.7 0.7.0.8 0.7.0.9 0.7.1 1.0 All 71 releases
← All changes | backend/src/Data/UserState.php +40 -11 0.4.21.2.2 View file →
@@ -14,33 +14,44 @@
14 14 * Storage key for user meta
15 15 */
16 16 const FL_ASSISTANT_STATE = 'fl_assistant_state';
17 17
18 + private static $frame_defaults = [
19 + 'minWidth' => 460,
20 + 'maxWidth' => 900,
21 + 'defaultWidth' => 520,
22 + 'defaultOrigin' => [ 1, 0 ],
23 + 'breakpoint' => 650,
24 + ];
25 +
18 26 /**
19 27 * Default state for the current user.
20 28 */
21 29 public static $default_state = [
22 - 'appOrder' => [],
23 - 'window' => [
30 + 'appOrder' => [],
31 + 'window' => [
24 32 'origin' => [ 1, 0 ],
25 - 'size' => 'normal',
33 + 'width' => 520,
26 34 'isHidden' => false,
27 35 'hiddenAppearance' => '',
28 - 'overlayToolbar' => false,
29 36 ],
30 - 'appearance' => [
37 + 'appearance' => [
31 38 'brightness' => 'light',
32 39 ],
33 - 'history' => [
40 + 'history' => [
34 41 'index' => 0,
35 42 'entries' => [],
36 43 ],
37 - 'searchHistory' => [],
38 - 'shouldReduceMotion' => false,
39 - 'shouldShowLabels' => true,
40 - 'shouldShowInAdmin' => true,
44 + 'searchHistory' => [],
45 + 'shouldShowInAdmin' => true,
46 + 'isAppHidden' => false,
47 + 'shortcuts' => [],
41 48 ];
42 49
50 + public static function get_default_state() {
51 + return static::$default_state;
52 + }
53 +
43 54 /**
44 55 * Get the saved state for the current user.
45 56 */
46 57 public static function get() {
@@ -50,10 +61,24 @@
50 61 static::FL_ASSISTANT_STATE,
51 62 true
52 63 );
53 64
65 + // Filter Window
66 + if ( isset( $saved['window'] ) ) {
67 + $window = $saved['window'];
68 +
69 + // Remove deprecated
70 + if ( isset( $window['size'] ) ) {
71 + unset( $window['size'] );
72 + }
73 + if ( isset( $window['overlayToolbar'] ) ) {
74 + unset( $window['overlayToolbar'] );
75 + }
76 + $saved['window'] = $window;
77 + }
78 +
54 79 return array_replace_recursive(
55 - static::$default_state,
80 + static::get_default_state(),
56 81 $saved ? (array) $saved : []
57 82 );
58 83 }
59 84
@@ -68,7 +93,11 @@
68 93 wp_get_current_user()->ID,
69 94 static::FL_ASSISTANT_STATE,
70 95 array_merge( $saved, $state )
71 96 );
97 + }
98 +
99 + public static function getFrameDefaults() {
100 + return static::$frame_defaults;
72 101 }
73 102
74 103 }