diff --git a/MIGRATIONS.md b/MIGRATIONS.md index 6e7dda91a971..f6b165aac8fe 100644 --- a/MIGRATIONS.md +++ b/MIGRATIONS.md @@ -3,6 +3,17 @@ This file documents changes in the data model. Please explain any changes to the data model as well as any custom migrations. +## WordPress 127 + +@chipsnyder 2021-07-1 + +- `BlockEditorSettings`: added the attribute + - `rawStyles` (optional, no default, `String`) + - `rawFeatures` (optional, no default, `String`) + +- `BlockEditorSettingElement`: added the attribute + - `order` (required, 0, `Int`) + ## WordPress 126 @scoutharris 2021-06-28 diff --git a/Podfile b/Podfile index 3d95b2d2be26..fd51033f72c2 100644 --- a/Podfile +++ b/Podfile @@ -166,7 +166,7 @@ abstract_target 'Apps' do ## Gutenberg (React Native) ## ===================== ## - gutenberg :tag => 'v1.56.0' + gutenberg :tag => 'v1.57.0-alpha1' ## Third party libraries ## ===================== diff --git a/Podfile.lock b/Podfile.lock index df439b950ea6..049cb622c5ae 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -452,7 +452,7 @@ PODS: - WordPressKit (~> 4.18-beta) - WordPressShared (~> 1.12-beta) - WordPressUI (~> 1.7-beta) - - WordPressKit (4.37.0-beta.3): + - WordPressKit (4.37.0-beta.4): - Alamofire (~> 4.8.0) - CocoaLumberjack (~> 3.4) - NSObject-SafeExpectations (= 0.0.4) @@ -490,18 +490,18 @@ DEPENDENCIES: - AppCenter (= 4.1.1) - AppCenter/Distribute (= 4.1.1) - Automattic-Tracks-iOS (~> 0.9.0) - - BVLinearGradient (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.56.0/third-party-podspecs/BVLinearGradient.podspec.json`) + - BVLinearGradient (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.57.0-alpha1/third-party-podspecs/BVLinearGradient.podspec.json`) - Charts (~> 3.2.2) - CocoaLumberjack (~> 3.0) - CropViewController (= 2.5.3) - Down (~> 0.6.6) - - FBLazyVector (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.56.0/third-party-podspecs/FBLazyVector.podspec.json`) - - FBReactNativeSpec (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.56.0/third-party-podspecs/FBReactNativeSpec/FBReactNativeSpec.podspec.json`) + - FBLazyVector (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.57.0-alpha1/third-party-podspecs/FBLazyVector.podspec.json`) + - FBReactNativeSpec (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.57.0-alpha1/third-party-podspecs/FBReactNativeSpec/FBReactNativeSpec.podspec.json`) - FSInteractiveMap (from `https://github.com/wordpress-mobile/FSInteractiveMap.git`, tag `0.2.0`) - Gifu (= 3.2.0) - - glog (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.56.0/third-party-podspecs/glog.podspec.json`) + - glog (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.57.0-alpha1/third-party-podspecs/glog.podspec.json`) - Gridicons (~> 1.1.0) - - Gutenberg (from `https://github.com/wordpress-mobile/gutenberg-mobile.git`, tag `v1.56.0`) + - Gutenberg (from `https://github.com/wordpress-mobile/gutenberg-mobile.git`, tag `v1.57.0-alpha1`) - JTAppleCalendar (~> 8.0.2) - Kanvas (~> 1.2.7) - MediaEditor (~> 1.2.1) @@ -511,44 +511,44 @@ DEPENDENCIES: - "NSURL+IDN (~> 0.4)" - OCMock (~> 3.4.3) - OHHTTPStubs/Swift (~> 9.1.0) - - RCT-Folly (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.56.0/third-party-podspecs/RCT-Folly.podspec.json`) - - RCTRequired (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.56.0/third-party-podspecs/RCTRequired.podspec.json`) - - RCTTypeSafety (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.56.0/third-party-podspecs/RCTTypeSafety.podspec.json`) + - RCT-Folly (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.57.0-alpha1/third-party-podspecs/RCT-Folly.podspec.json`) + - RCTRequired (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.57.0-alpha1/third-party-podspecs/RCTRequired.podspec.json`) + - RCTTypeSafety (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.57.0-alpha1/third-party-podspecs/RCTTypeSafety.podspec.json`) - Reachability (= 3.2) - - React (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.56.0/third-party-podspecs/React.podspec.json`) - - React-callinvoker (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.56.0/third-party-podspecs/React-callinvoker.podspec.json`) - - React-Core (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.56.0/third-party-podspecs/React-Core.podspec.json`) - - React-CoreModules (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.56.0/third-party-podspecs/React-CoreModules.podspec.json`) - - React-cxxreact (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.56.0/third-party-podspecs/React-cxxreact.podspec.json`) - - React-jsi (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.56.0/third-party-podspecs/React-jsi.podspec.json`) - - React-jsiexecutor (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.56.0/third-party-podspecs/React-jsiexecutor.podspec.json`) - - React-jsinspector (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.56.0/third-party-podspecs/React-jsinspector.podspec.json`) - - react-native-blur (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.56.0/third-party-podspecs/react-native-blur.podspec.json`) - - react-native-get-random-values (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.56.0/third-party-podspecs/react-native-get-random-values.podspec.json`) - - react-native-keyboard-aware-scroll-view (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.56.0/third-party-podspecs/react-native-keyboard-aware-scroll-view.podspec.json`) - - react-native-safe-area (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.56.0/third-party-podspecs/react-native-safe-area.podspec.json`) - - react-native-safe-area-context (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.56.0/third-party-podspecs/react-native-safe-area-context.podspec.json`) - - react-native-slider (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.56.0/third-party-podspecs/react-native-slider.podspec.json`) - - react-native-video (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.56.0/third-party-podspecs/react-native-video.podspec.json`) - - React-perflogger (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.56.0/third-party-podspecs/React-perflogger.podspec.json`) - - React-RCTActionSheet (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.56.0/third-party-podspecs/React-RCTActionSheet.podspec.json`) - - React-RCTAnimation (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.56.0/third-party-podspecs/React-RCTAnimation.podspec.json`) - - React-RCTBlob (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.56.0/third-party-podspecs/React-RCTBlob.podspec.json`) - - React-RCTImage (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.56.0/third-party-podspecs/React-RCTImage.podspec.json`) - - React-RCTLinking (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.56.0/third-party-podspecs/React-RCTLinking.podspec.json`) - - React-RCTNetwork (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.56.0/third-party-podspecs/React-RCTNetwork.podspec.json`) - - React-RCTSettings (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.56.0/third-party-podspecs/React-RCTSettings.podspec.json`) - - React-RCTText (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.56.0/third-party-podspecs/React-RCTText.podspec.json`) - - React-RCTVibration (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.56.0/third-party-podspecs/React-RCTVibration.podspec.json`) - - React-runtimeexecutor (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.56.0/third-party-podspecs/React-runtimeexecutor.podspec.json`) - - ReactCommon (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.56.0/third-party-podspecs/ReactCommon.podspec.json`) - - ReactNativeDarkMode (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.56.0/third-party-podspecs/ReactNativeDarkMode.podspec.json`) - - RNCMaskedView (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.56.0/third-party-podspecs/RNCMaskedView.podspec.json`) - - RNGestureHandler (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.56.0/third-party-podspecs/RNGestureHandler.podspec.json`) - - RNReanimated (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.56.0/third-party-podspecs/RNReanimated.podspec.json`) - - RNScreens (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.56.0/third-party-podspecs/RNScreens.podspec.json`) - - RNSVG (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.56.0/third-party-podspecs/RNSVG.podspec.json`) - - RNTAztecView (from `https://github.com/wordpress-mobile/gutenberg-mobile.git`, tag `v1.56.0`) + - React (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.57.0-alpha1/third-party-podspecs/React.podspec.json`) + - React-callinvoker (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.57.0-alpha1/third-party-podspecs/React-callinvoker.podspec.json`) + - React-Core (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.57.0-alpha1/third-party-podspecs/React-Core.podspec.json`) + - React-CoreModules (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.57.0-alpha1/third-party-podspecs/React-CoreModules.podspec.json`) + - React-cxxreact (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.57.0-alpha1/third-party-podspecs/React-cxxreact.podspec.json`) + - React-jsi (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.57.0-alpha1/third-party-podspecs/React-jsi.podspec.json`) + - React-jsiexecutor (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.57.0-alpha1/third-party-podspecs/React-jsiexecutor.podspec.json`) + - React-jsinspector (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.57.0-alpha1/third-party-podspecs/React-jsinspector.podspec.json`) + - react-native-blur (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.57.0-alpha1/third-party-podspecs/react-native-blur.podspec.json`) + - react-native-get-random-values (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.57.0-alpha1/third-party-podspecs/react-native-get-random-values.podspec.json`) + - react-native-keyboard-aware-scroll-view (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.57.0-alpha1/third-party-podspecs/react-native-keyboard-aware-scroll-view.podspec.json`) + - react-native-safe-area (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.57.0-alpha1/third-party-podspecs/react-native-safe-area.podspec.json`) + - react-native-safe-area-context (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.57.0-alpha1/third-party-podspecs/react-native-safe-area-context.podspec.json`) + - react-native-slider (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.57.0-alpha1/third-party-podspecs/react-native-slider.podspec.json`) + - react-native-video (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.57.0-alpha1/third-party-podspecs/react-native-video.podspec.json`) + - React-perflogger (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.57.0-alpha1/third-party-podspecs/React-perflogger.podspec.json`) + - React-RCTActionSheet (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.57.0-alpha1/third-party-podspecs/React-RCTActionSheet.podspec.json`) + - React-RCTAnimation (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.57.0-alpha1/third-party-podspecs/React-RCTAnimation.podspec.json`) + - React-RCTBlob (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.57.0-alpha1/third-party-podspecs/React-RCTBlob.podspec.json`) + - React-RCTImage (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.57.0-alpha1/third-party-podspecs/React-RCTImage.podspec.json`) + - React-RCTLinking (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.57.0-alpha1/third-party-podspecs/React-RCTLinking.podspec.json`) + - React-RCTNetwork (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.57.0-alpha1/third-party-podspecs/React-RCTNetwork.podspec.json`) + - React-RCTSettings (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.57.0-alpha1/third-party-podspecs/React-RCTSettings.podspec.json`) + - React-RCTText (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.57.0-alpha1/third-party-podspecs/React-RCTText.podspec.json`) + - React-RCTVibration (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.57.0-alpha1/third-party-podspecs/React-RCTVibration.podspec.json`) + - React-runtimeexecutor (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.57.0-alpha1/third-party-podspecs/React-runtimeexecutor.podspec.json`) + - ReactCommon (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.57.0-alpha1/third-party-podspecs/ReactCommon.podspec.json`) + - ReactNativeDarkMode (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.57.0-alpha1/third-party-podspecs/ReactNativeDarkMode.podspec.json`) + - RNCMaskedView (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.57.0-alpha1/third-party-podspecs/RNCMaskedView.podspec.json`) + - RNGestureHandler (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.57.0-alpha1/third-party-podspecs/RNGestureHandler.podspec.json`) + - RNReanimated (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.57.0-alpha1/third-party-podspecs/RNReanimated.podspec.json`) + - RNScreens (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.57.0-alpha1/third-party-podspecs/RNScreens.podspec.json`) + - RNSVG (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.57.0-alpha1/third-party-podspecs/RNSVG.podspec.json`) + - RNTAztecView (from `https://github.com/wordpress-mobile/gutenberg-mobile.git`, tag `v1.57.0-alpha1`) - Starscream (= 3.0.6) - SVProgressHUD (= 2.2.5) - WordPress-Editor-iOS (~> 1.19.4) @@ -558,14 +558,13 @@ DEPENDENCIES: - WordPressShared (~> 1.16.0) - WordPressUI (~> 1.12.1) - WPMediaPicker (~> 1.7.2) - - Yoga (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.56.0/third-party-podspecs/Yoga.podspec.json`) + - Yoga (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.57.0-alpha1/third-party-podspecs/Yoga.podspec.json`) - ZendeskSupportSDK (= 5.3.0) - ZIPFoundation (~> 0.9.8) SPEC REPOS: https://github.com/wordpress-mobile/cocoapods-specs.git: - WordPressAuthenticator - - WordPressKit - WordPressUI trunk: - 1PasswordExtension @@ -606,6 +605,7 @@ SPEC REPOS: - UIDeviceIdentifier - WordPress-Aztec-iOS - WordPress-Editor-iOS + - WordPressKit - WordPressMocks - WordPressShared - WPMediaPicker @@ -621,98 +621,98 @@ SPEC REPOS: EXTERNAL SOURCES: BVLinearGradient: - :podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.56.0/third-party-podspecs/BVLinearGradient.podspec.json + :podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.57.0-alpha1/third-party-podspecs/BVLinearGradient.podspec.json FBLazyVector: - :podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.56.0/third-party-podspecs/FBLazyVector.podspec.json + :podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.57.0-alpha1/third-party-podspecs/FBLazyVector.podspec.json FBReactNativeSpec: - :podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.56.0/third-party-podspecs/FBReactNativeSpec/FBReactNativeSpec.podspec.json + :podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.57.0-alpha1/third-party-podspecs/FBReactNativeSpec/FBReactNativeSpec.podspec.json FSInteractiveMap: :git: https://github.com/wordpress-mobile/FSInteractiveMap.git :tag: 0.2.0 glog: - :podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.56.0/third-party-podspecs/glog.podspec.json + :podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.57.0-alpha1/third-party-podspecs/glog.podspec.json Gutenberg: :git: https://github.com/wordpress-mobile/gutenberg-mobile.git :submodules: true - :tag: v1.56.0 + :tag: v1.57.0-alpha1 RCT-Folly: - :podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.56.0/third-party-podspecs/RCT-Folly.podspec.json + :podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.57.0-alpha1/third-party-podspecs/RCT-Folly.podspec.json RCTRequired: - :podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.56.0/third-party-podspecs/RCTRequired.podspec.json + :podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.57.0-alpha1/third-party-podspecs/RCTRequired.podspec.json RCTTypeSafety: - :podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.56.0/third-party-podspecs/RCTTypeSafety.podspec.json + :podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.57.0-alpha1/third-party-podspecs/RCTTypeSafety.podspec.json React: - :podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.56.0/third-party-podspecs/React.podspec.json + :podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.57.0-alpha1/third-party-podspecs/React.podspec.json React-callinvoker: - :podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.56.0/third-party-podspecs/React-callinvoker.podspec.json + :podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.57.0-alpha1/third-party-podspecs/React-callinvoker.podspec.json React-Core: - :podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.56.0/third-party-podspecs/React-Core.podspec.json + :podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.57.0-alpha1/third-party-podspecs/React-Core.podspec.json React-CoreModules: - :podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.56.0/third-party-podspecs/React-CoreModules.podspec.json + :podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.57.0-alpha1/third-party-podspecs/React-CoreModules.podspec.json React-cxxreact: - :podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.56.0/third-party-podspecs/React-cxxreact.podspec.json + :podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.57.0-alpha1/third-party-podspecs/React-cxxreact.podspec.json React-jsi: - :podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.56.0/third-party-podspecs/React-jsi.podspec.json + :podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.57.0-alpha1/third-party-podspecs/React-jsi.podspec.json React-jsiexecutor: - :podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.56.0/third-party-podspecs/React-jsiexecutor.podspec.json + :podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.57.0-alpha1/third-party-podspecs/React-jsiexecutor.podspec.json React-jsinspector: - :podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.56.0/third-party-podspecs/React-jsinspector.podspec.json + :podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.57.0-alpha1/third-party-podspecs/React-jsinspector.podspec.json react-native-blur: - :podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.56.0/third-party-podspecs/react-native-blur.podspec.json + :podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.57.0-alpha1/third-party-podspecs/react-native-blur.podspec.json react-native-get-random-values: - :podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.56.0/third-party-podspecs/react-native-get-random-values.podspec.json + :podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.57.0-alpha1/third-party-podspecs/react-native-get-random-values.podspec.json react-native-keyboard-aware-scroll-view: - :podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.56.0/third-party-podspecs/react-native-keyboard-aware-scroll-view.podspec.json + :podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.57.0-alpha1/third-party-podspecs/react-native-keyboard-aware-scroll-view.podspec.json react-native-safe-area: - :podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.56.0/third-party-podspecs/react-native-safe-area.podspec.json + :podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.57.0-alpha1/third-party-podspecs/react-native-safe-area.podspec.json react-native-safe-area-context: - :podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.56.0/third-party-podspecs/react-native-safe-area-context.podspec.json + :podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.57.0-alpha1/third-party-podspecs/react-native-safe-area-context.podspec.json react-native-slider: - :podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.56.0/third-party-podspecs/react-native-slider.podspec.json + :podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.57.0-alpha1/third-party-podspecs/react-native-slider.podspec.json react-native-video: - :podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.56.0/third-party-podspecs/react-native-video.podspec.json + :podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.57.0-alpha1/third-party-podspecs/react-native-video.podspec.json React-perflogger: - :podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.56.0/third-party-podspecs/React-perflogger.podspec.json + :podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.57.0-alpha1/third-party-podspecs/React-perflogger.podspec.json React-RCTActionSheet: - :podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.56.0/third-party-podspecs/React-RCTActionSheet.podspec.json + :podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.57.0-alpha1/third-party-podspecs/React-RCTActionSheet.podspec.json React-RCTAnimation: - :podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.56.0/third-party-podspecs/React-RCTAnimation.podspec.json + :podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.57.0-alpha1/third-party-podspecs/React-RCTAnimation.podspec.json React-RCTBlob: - :podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.56.0/third-party-podspecs/React-RCTBlob.podspec.json + :podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.57.0-alpha1/third-party-podspecs/React-RCTBlob.podspec.json React-RCTImage: - :podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.56.0/third-party-podspecs/React-RCTImage.podspec.json + :podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.57.0-alpha1/third-party-podspecs/React-RCTImage.podspec.json React-RCTLinking: - :podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.56.0/third-party-podspecs/React-RCTLinking.podspec.json + :podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.57.0-alpha1/third-party-podspecs/React-RCTLinking.podspec.json React-RCTNetwork: - :podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.56.0/third-party-podspecs/React-RCTNetwork.podspec.json + :podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.57.0-alpha1/third-party-podspecs/React-RCTNetwork.podspec.json React-RCTSettings: - :podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.56.0/third-party-podspecs/React-RCTSettings.podspec.json + :podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.57.0-alpha1/third-party-podspecs/React-RCTSettings.podspec.json React-RCTText: - :podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.56.0/third-party-podspecs/React-RCTText.podspec.json + :podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.57.0-alpha1/third-party-podspecs/React-RCTText.podspec.json React-RCTVibration: - :podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.56.0/third-party-podspecs/React-RCTVibration.podspec.json + :podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.57.0-alpha1/third-party-podspecs/React-RCTVibration.podspec.json React-runtimeexecutor: - :podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.56.0/third-party-podspecs/React-runtimeexecutor.podspec.json + :podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.57.0-alpha1/third-party-podspecs/React-runtimeexecutor.podspec.json ReactCommon: - :podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.56.0/third-party-podspecs/ReactCommon.podspec.json + :podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.57.0-alpha1/third-party-podspecs/ReactCommon.podspec.json ReactNativeDarkMode: - :podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.56.0/third-party-podspecs/ReactNativeDarkMode.podspec.json + :podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.57.0-alpha1/third-party-podspecs/ReactNativeDarkMode.podspec.json RNCMaskedView: - :podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.56.0/third-party-podspecs/RNCMaskedView.podspec.json + :podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.57.0-alpha1/third-party-podspecs/RNCMaskedView.podspec.json RNGestureHandler: - :podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.56.0/third-party-podspecs/RNGestureHandler.podspec.json + :podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.57.0-alpha1/third-party-podspecs/RNGestureHandler.podspec.json RNReanimated: - :podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.56.0/third-party-podspecs/RNReanimated.podspec.json + :podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.57.0-alpha1/third-party-podspecs/RNReanimated.podspec.json RNScreens: - :podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.56.0/third-party-podspecs/RNScreens.podspec.json + :podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.57.0-alpha1/third-party-podspecs/RNScreens.podspec.json RNSVG: - :podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.56.0/third-party-podspecs/RNSVG.podspec.json + :podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.57.0-alpha1/third-party-podspecs/RNSVG.podspec.json RNTAztecView: :git: https://github.com/wordpress-mobile/gutenberg-mobile.git :submodules: true - :tag: v1.56.0 + :tag: v1.57.0-alpha1 Yoga: - :podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.56.0/third-party-podspecs/Yoga.podspec.json + :podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.57.0-alpha1/third-party-podspecs/Yoga.podspec.json CHECKOUT OPTIONS: FSInteractiveMap: @@ -721,11 +721,11 @@ CHECKOUT OPTIONS: Gutenberg: :git: https://github.com/wordpress-mobile/gutenberg-mobile.git :submodules: true - :tag: v1.56.0 + :tag: v1.57.0-alpha1 RNTAztecView: :git: https://github.com/wordpress-mobile/gutenberg-mobile.git :submodules: true - :tag: v1.56.0 + :tag: v1.57.0-alpha1 SPEC CHECKSUMS: 1PasswordExtension: f97cc80ae58053c331b2b6dc8843ba7103b33794 @@ -810,7 +810,7 @@ SPEC CHECKSUMS: WordPress-Aztec-iOS: 870c93297849072aadfc2223e284094e73023e82 WordPress-Editor-iOS: 068b32d02870464ff3cb9e3172e74234e13ed88c WordPressAuthenticator: c50b9737d6f459b1010bd07daa9885d19505c504 - WordPressKit: edbeed379872d4e531da4a36496b8402fef98b99 + WordPressKit: 3bfdfb739d6f5354144ee35f9fa7f27b266be9c8 WordPressMocks: dfac50a938ac74dddf5f7cce5a9110126408dd19 WordPressShared: 5477f179c7fe03b5d574f91adda66f67d131827e WordPressUI: 7cd64cfaf76ce0cfd78d6a544702c4c774a29919 @@ -826,6 +826,6 @@ SPEC CHECKSUMS: ZendeskSupportSDK: 3a8e508ab1d9dd22dc038df6c694466414e037ba ZIPFoundation: e27423c004a5a1410c15933407747374e7c6cb6e -PODFILE CHECKSUM: ca63e621bebf0397df635becef9ff291c12c756c +PODFILE CHECKSUM: 8b2c79935a27e464f11211a1f22df322659267d1 COCOAPODS: 1.10.1 diff --git a/WordPress/Classes/Models/BlockEditorSettingElement+CoreDataProperties.swift b/WordPress/Classes/Models/BlockEditorSettingElement+CoreDataProperties.swift index d25a6ff80330..a5a93fd4a2c6 100644 --- a/WordPress/Classes/Models/BlockEditorSettingElement+CoreDataProperties.swift +++ b/WordPress/Classes/Models/BlockEditorSettingElement+CoreDataProperties.swift @@ -33,6 +33,10 @@ extension BlockEditorSettingElement { /// @NSManaged public var name: String + /// Stores maintains the order as passed from the API + /// + @NSManaged public var order: Int + /// Stores a reference back to the parent `BlockEditorSettings`. /// @NSManaged public var settings: BlockEditorSettings @@ -48,12 +52,13 @@ extension BlockEditorSettingElement: Identifiable { ] } - convenience init(fromRawRepresentation rawObject: [String: String], type: BlockEditorSettingElementTypes, context: NSManagedObjectContext) { + convenience init(fromRawRepresentation rawObject: [String: String], type: BlockEditorSettingElementTypes, order: Int, context: NSManagedObjectContext) { self.init(context: context) self.type = type.rawValue self.value = rawObject[type.valueKey] ?? "" self.slug = rawObject[#keyPath(BlockEditorSettingElement.slug)] ?? "" self.name = rawObject[ #keyPath(BlockEditorSettingElement.name)] ?? "" + self.order = order } } diff --git a/WordPress/Classes/Models/BlockEditorSettings+CoreDataProperties.swift b/WordPress/Classes/Models/BlockEditorSettings+CoreDataProperties.swift index eabdf0c8532b..7bdbeb71fd69 100644 --- a/WordPress/Classes/Models/BlockEditorSettings+CoreDataProperties.swift +++ b/WordPress/Classes/Models/BlockEditorSettings+CoreDataProperties.swift @@ -20,6 +20,14 @@ extension BlockEditorSettings { /// @NSManaged public var lastUpdated: Date + /// Stores the raw JSON string that comes from the Global Styles Setting Request. + /// + @NSManaged public var rawStyles: String? + + /// Stores the raw JSON string that comes from the Global Styles Setting Request. + /// + @NSManaged public var rawFeatures: String? + /// Stores a set of attributes describing values that are represented with arrays in the API request. /// Available types are defined in `BlockEditorSettingElementTypes` /// diff --git a/WordPress/Classes/Models/BlockEditorSettings+GutenbergEditorSettings.swift b/WordPress/Classes/Models/BlockEditorSettings+GutenbergEditorSettings.swift new file mode 100644 index 000000000000..8fbc10e0077d --- /dev/null +++ b/WordPress/Classes/Models/BlockEditorSettings+GutenbergEditorSettings.swift @@ -0,0 +1,65 @@ +import Foundation +import WordPressKit +import Gutenberg + +extension BlockEditorSettings: GutenbergEditorSettings { + public var colors: [[String: String]]? { + elementsByType(.color) + } + + public var gradients: [[String: String]]? { + elementsByType(.gradient) + } + + private func elementsByType(_ type: BlockEditorSettingElementTypes) -> [[String: String]]? { + return elements?.sorted(by: { (lhs, rhs) -> Bool in + return lhs.order >= rhs.order + }).compactMap({ (element) -> [String: String]? in + guard element.type == type.rawValue else { return nil } + return element.rawRepresentation + }) + } +} + +extension BlockEditorSettings { + convenience init?(editorTheme: RemoteEditorTheme, context: NSManagedObjectContext) { + self.init(context: context) + self.isFSETheme = false + self.lastUpdated = Date() + self.checksum = editorTheme.checksum + + var parsedElements = Set() + if let themeSupport = editorTheme.themeSupport { + themeSupport.colors?.enumerated().forEach({ (index, color) in + parsedElements.insert(BlockEditorSettingElement(fromRawRepresentation: color, type: .color, order: index, context: context)) + }) + + themeSupport.gradients?.enumerated().forEach({ (index, gradient) in + parsedElements.insert(BlockEditorSettingElement(fromRawRepresentation: gradient, type: .gradient, order: index, context: context)) + }) + } + + self.elements = parsedElements + } + + convenience init?(remoteSettings: RemoteBlockEditorSettings, context: NSManagedObjectContext) { + self.init(context: context) + self.isFSETheme = remoteSettings.isFSETheme + self.lastUpdated = Date() + self.checksum = remoteSettings.checksum + self.rawStyles = remoteSettings.rawStyles + self.rawFeatures = remoteSettings.rawFeatures + + var parsedElements = Set() + + remoteSettings.colors?.enumerated().forEach({ (index, color) in + parsedElements.insert(BlockEditorSettingElement(fromRawRepresentation: color, type: .color, order: index, context: context)) + }) + + remoteSettings.gradients?.enumerated().forEach({ (index, gradient) in + parsedElements.insert(BlockEditorSettingElement(fromRawRepresentation: gradient, type: .gradient, order: index, context: context)) + }) + + self.elements = parsedElements + } +} diff --git a/WordPress/Classes/Models/BlockEditorSettings+GutenbergEditorTheme.swift b/WordPress/Classes/Models/BlockEditorSettings+GutenbergEditorTheme.swift deleted file mode 100644 index 8acd091e6c94..000000000000 --- a/WordPress/Classes/Models/BlockEditorSettings+GutenbergEditorTheme.swift +++ /dev/null @@ -1,40 +0,0 @@ -import Foundation -import Gutenberg - -extension BlockEditorSettings: GutenbergEditorTheme { - public var colors: [[String: String]]? { - elementsByType(.color) - } - - public var gradients: [[String: String]]? { - elementsByType(.gradient) - } - - private func elementsByType(_ type: BlockEditorSettingElementTypes) -> [[String: String]]? { - return elements?.compactMap({ (element) -> [String: String]? in - guard element.type == type.rawValue else { return nil } - return element.rawRepresentation - }) - } -} - -extension BlockEditorSettings { - convenience init?(editorTheme: EditorTheme, context: NSManagedObjectContext) { - self.init(context: context) - self.lastUpdated = Date() - self.checksum = editorTheme.checksum - - var parsedElements = Set() - if let themeSupport = editorTheme.themeSupport { - themeSupport.colors?.forEach({ (color) in - parsedElements.insert(BlockEditorSettingElement(fromRawRepresentation: color, type: .color, context: context)) - }) - - themeSupport.gradients?.forEach({ (gradient) in - parsedElements.insert(BlockEditorSettingElement(fromRawRepresentation: gradient, type: .gradient, context: context)) - }) - } - - self.elements = parsedElements - } -} diff --git a/WordPress/Classes/Models/Blog+BlockEditorSettings.swift b/WordPress/Classes/Models/Blog+BlockEditorSettings.swift index 61e0f805fde5..7fd364e9e6cf 100644 --- a/WordPress/Classes/Models/Blog+BlockEditorSettings.swift +++ b/WordPress/Classes/Models/Blog+BlockEditorSettings.swift @@ -7,4 +7,10 @@ extension Blog { /// such as Global Styles and Full Site Editing settings and capabilities. /// @NSManaged public var blockEditorSettings: BlockEditorSettings? + + @objc + func supportsBlockEditorSettings() -> Bool { + guard FeatureFlag.globalStyleSettings.enabled else { return false } + return hasRequiredWordPressVersion("5.8") + } } diff --git a/WordPress/Classes/Models/Blog.h b/WordPress/Classes/Models/Blog.h index f2bd8ade010d..ef029487d333 100644 --- a/WordPress/Classes/Models/Blog.h +++ b/WordPress/Classes/Models/Blog.h @@ -82,6 +82,7 @@ typedef NS_ENUM(NSUInteger, BlogFeature) { BlogFeatureStories, /// Does the blog support Jetpack contact info block? BlogFeatureContactInfo, + BlogFeatureBlockEditorSettings, /// Does the blog support the Layout grid block? BlogFeatureLayoutGrid, }; @@ -280,6 +281,10 @@ typedef NS_ENUM(NSInteger, SiteVisibility) { */ - (BOOL)isBasicAuthCredentialStored; +/// Checks the blogs installed WordPress version is more than or equal to the requiredVersion +/// @param requiredVersion The minimum version to check for +- (BOOL)hasRequiredWordPressVersion:(NSString *)requiredVersion; + @end NS_ASSUME_NONNULL_END diff --git a/WordPress/Classes/Models/Blog.m b/WordPress/Classes/Models/Blog.m index e1bb8dfb38d0..0c2f12b6adbf 100644 --- a/WordPress/Classes/Models/Blog.m +++ b/WordPress/Classes/Models/Blog.m @@ -567,6 +567,8 @@ - (BOOL)supports:(BlogFeature)feature return [self supportsStories]; case BlogFeatureContactInfo: return [self supportsContactInfo]; + case BlogFeatureBlockEditorSettings: + return [self supportsBlockEditorSettings]; case BlogFeatureLayoutGrid: return [self supportsLayoutGrid]; } diff --git a/WordPress/Classes/Models/EditorTheme.swift b/WordPress/Classes/Models/EditorTheme.swift deleted file mode 100644 index e5ff9fde022b..000000000000 --- a/WordPress/Classes/Models/EditorTheme.swift +++ /dev/null @@ -1,51 +0,0 @@ -import Foundation -import Gutenberg - -struct EditorTheme: Codable { - static func == (lhs: EditorTheme, rhs: EditorTheme) -> Bool { - return lhs.checksum == rhs.checksum - } - - enum CodingKeys: String, CodingKey { - case themeSupport = "theme_supports" - } - - let themeSupport: EditorThemeSupport? - let checksum: String - - init(from decoder: Decoder) throws { - let map = try decoder.container(keyedBy: CodingKeys.self) - let parsedTheme = try? map.decode(EditorThemeSupport.self, forKey: .themeSupport) - self.themeSupport = parsedTheme - self.checksum = { - guard let parsedTheme = parsedTheme else { return "" } - let encoder = JSONEncoder() - encoder.outputFormatting = .sortedKeys - let result: String - do { - let data = try encoder.encode(parsedTheme) - result = String(data: data, encoding: .utf8) ?? "" - } catch { - result = "" - } - return result.md5() - }() - } -} - -struct EditorThemeSupport: Codable, GutenbergEditorTheme { - - enum CodingKeys: String, CodingKey { - case colors = "editor-color-palette" - case gradients = "editor-gradient-presets" - } - - let colors: [[String: String]]? - let gradients: [[String: String]]? - - init(from decoder: Decoder) throws { - let map = try decoder.container(keyedBy: CodingKeys.self) - self.colors = try? map.decode([[String: String]].self, forKey: .colors) - self.gradients = try? map.decode([[String: String]].self, forKey: .gradients) - } -} diff --git a/WordPress/Classes/Services/BlockEditorSettingsService.swift b/WordPress/Classes/Services/BlockEditorSettingsService.swift index 1cecc1460a4a..0127c38500e3 100644 --- a/WordPress/Classes/Services/BlockEditorSettingsService.swift +++ b/WordPress/Classes/Services/BlockEditorSettingsService.swift @@ -5,7 +5,7 @@ class BlockEditorSettingsService { typealias BlockEditorSettingsServiceCompletion = (_ hasChanges: Bool, _ blockEditorSettings: BlockEditorSettings?) -> Void let blog: Blog - let remoteAPI: WordPressRestApi + let remote: BlockEditorSettingsServiceRemote let context: NSManagedObjectContext var cachedSettings: BlockEditorSettings? { @@ -30,29 +30,29 @@ class BlockEditorSettingsService { init(blog: Blog, remoteAPI: WordPressRestApi, context: NSManagedObjectContext) { self.blog = blog - self.remoteAPI = remoteAPI self.context = context + self.remote = BlockEditorSettingsServiceRemote(remoteAPI: remoteAPI) } func fetchSettings(_ completion: @escaping BlockEditorSettingsServiceCompletion) { - fetchTheme(completion) + if blog.supports(.blockEditorSettings) { + fetchBlockEditorSettings(completion) + } else { + fetchTheme(completion) + } } } // MARK: Editor `theme_supports` support private extension BlockEditorSettingsService { func fetchTheme(_ completion: @escaping BlockEditorSettingsServiceCompletion) { - let requestPath = "/wp/v2/themes?status=active" - let modifiedPath = remoteAPI.requestPath(fromOrgPath: requestPath, with: blog.dotComID?.intValue) - remoteAPI.GET(modifiedPath, parameters: nil) { [weak self] (result, _) in + remote.fetchTheme(forSiteID: blog.dotComID?.intValue) { [weak self] (response) in guard let `self` = self else { return } - switch result { - case .success(let response): - self.processResponse(response) { editorTheme in - self.context.perform { - let originalChecksum = self.blog.blockEditorSettings?.checksum ?? "" - self.updateCache(originalChecksum: originalChecksum, editorTheme: editorTheme, completion: completion) - } + switch response { + case .success(let editorTheme): + self.context.perform { + let originalChecksum = self.blog.blockEditorSettings?.checksum ?? "" + self.updateEditorThemeCache(originalChecksum: originalChecksum, editorTheme: editorTheme, completion: completion) } case .failure(let error): DDLogError("Error loading active theme: \(error)") @@ -60,16 +60,7 @@ private extension BlockEditorSettingsService { } } - func processResponse(_ response: Any, completion: (_ editorTheme: EditorTheme?) -> Void) { - guard let responseData = try? JSONSerialization.data(withJSONObject: response, options: []), - let editorThemes = try? JSONDecoder().decode([EditorTheme].self, from: responseData) else { - completion(nil) - return - } - completion(editorThemes.first) - } - - func updateCache(originalChecksum: String, editorTheme: EditorTheme?, completion: @escaping BlockEditorSettingsServiceCompletion) { + func updateEditorThemeCache(originalChecksum: String, editorTheme: RemoteEditorTheme?, completion: @escaping BlockEditorSettingsServiceCompletion) { let newChecksum = editorTheme?.checksum ?? "" guard originalChecksum != newChecksum else { /// The fetched Editor Theme is the same as the cached one so respond with no new changes. @@ -78,14 +69,14 @@ private extension BlockEditorSettingsService { } guard let editorTheme = editorTheme else { - /// The original checksum is different than an empty one so we need to claer the old settings. + /// The original checksum is different than an empty one so we need to clear the old settings. clearCoreData(completion: completion) return } /// The fetched Editor Theme is different than the cached one so persist the new one and delete the old one. context.perform { - self.persistToCoreData(blogID: self.blog.objectID, editorTheme: editorTheme) { success in + self.persistEditorThemeToCoreData(blogID: self.blog.objectID, editorTheme: editorTheme) { success in guard success else { completion(false, nil) return @@ -98,7 +89,7 @@ private extension BlockEditorSettingsService { } } - func persistToCoreData(blogID: NSManagedObjectID, editorTheme: EditorTheme, completion: @escaping (_ success: Bool) -> Void) { + func persistEditorThemeToCoreData(blogID: NSManagedObjectID, editorTheme: RemoteEditorTheme, completion: @escaping (_ success: Bool) -> Void) { let parsingContext = NSManagedObjectContext(concurrencyType: .privateQueueConcurrencyType) parsingContext.parent = context parsingContext.mergePolicy = NSMergePolicy.mergeByPropertyObjectTrump @@ -123,7 +114,71 @@ private extension BlockEditorSettingsService { // MARK: Editor Global Styles support private extension BlockEditorSettingsService { -// ToDo: Add support for Global Styles https://github.com/wordpress-mobile/gutenberg-mobile/issues/3163 + func fetchBlockEditorSettings(_ completion: @escaping BlockEditorSettingsServiceCompletion) { + remote.fetchBlockEditorSettings { [weak self] (response) in + guard let `self` = self else { return } + switch response { + case .success(let remoteSettings): + self.context.perform { + let originalChecksum = self.blog.blockEditorSettings?.checksum ?? "" + self.updateBlockEditorSettingsCache(originalChecksum: originalChecksum, remoteSettings: remoteSettings, completion: completion) + } + case .failure(let error): + DDLogError("Error loading Block Editor Settings: \(error)") + } + } + } + + func updateBlockEditorSettingsCache(originalChecksum: String, remoteSettings: RemoteBlockEditorSettings?, completion: @escaping BlockEditorSettingsServiceCompletion) { + let newChecksum = remoteSettings?.checksum ?? "" + guard originalChecksum != newChecksum else { + /// The fetched Block Editor Settings is the same as the cached one so respond with no new changes. + completion(false, self.blog.blockEditorSettings) + return + } + + guard let remoteSettings = remoteSettings else { + /// The original checksum is different than an empty one so we need to clear the old settings. + clearCoreData(completion: completion) + return + } + + /// The fetched Block Editor Settings is different than the cached one so persist the new one and delete the old one. + context.perform { + self.persistBlockEditorSettingsToCoreData(blogID: self.blog.objectID, remoteSettings: remoteSettings) { success in + guard success else { + completion(false, nil) + return + } + + self.context.perform { + completion(true, self.blog.blockEditorSettings) + } + } + } + } + + func persistBlockEditorSettingsToCoreData(blogID: NSManagedObjectID, remoteSettings: RemoteBlockEditorSettings, completion: @escaping (_ success: Bool) -> Void) { + let parsingContext = NSManagedObjectContext(concurrencyType: .privateQueueConcurrencyType) + parsingContext.parent = context + parsingContext.mergePolicy = NSMergePolicy.mergeByPropertyObjectTrump + + parsingContext.perform { + guard let blog = parsingContext.object(with: blogID) as? Blog else { + completion(false) + return + } + + if let blockEditorSettings = blog.blockEditorSettings { + // Block Editor Settings nullify on delete + parsingContext.delete(blockEditorSettings) + } + + blog.blockEditorSettings = BlockEditorSettings(remoteSettings: remoteSettings, context: parsingContext) + try? parsingContext.save() + completion(true) + } + } } // MARK: Shared Core Data Support diff --git a/WordPress/Classes/Utility/BuildInformation/FeatureFlag.swift b/WordPress/Classes/Utility/BuildInformation/FeatureFlag.swift index 0331963268fa..018a52f7f3d3 100644 --- a/WordPress/Classes/Utility/BuildInformation/FeatureFlag.swift +++ b/WordPress/Classes/Utility/BuildInformation/FeatureFlag.swift @@ -19,6 +19,7 @@ enum FeatureFlag: Int, CaseIterable, OverrideableFlag { case bloggingReminders case readerPostLikes case siteIconCreator + case globalStyleSettings /// Returns a boolean indicating if the feature is enabled var enabled: Bool { @@ -61,6 +62,8 @@ enum FeatureFlag: Int, CaseIterable, OverrideableFlag { return true case .siteIconCreator: return BuildConfiguration.current != .appStore + case .globalStyleSettings: + return false } } @@ -121,6 +124,8 @@ extension FeatureFlag { return "Reader Post Likes" case .siteIconCreator: return "Site Icon Creator" + case .globalStyleSettings: + return "Global Style Settings" } } diff --git a/WordPress/Classes/ViewRelated/Gutenberg/GutenbergViewController.swift b/WordPress/Classes/ViewRelated/Gutenberg/GutenbergViewController.swift index 5c7dc849f697..f68c29baaf5e 100644 --- a/WordPress/Classes/ViewRelated/Gutenberg/GutenbergViewController.swift +++ b/WordPress/Classes/ViewRelated/Gutenberg/GutenbergViewController.swift @@ -1201,14 +1201,14 @@ private extension GutenbergViewController { extension GutenbergViewController { // GutenbergBridgeDataSource - func gutenbergEditorTheme() -> GutenbergEditorTheme? { + func gutenbergEditorSettings() -> GutenbergEditorSettings? { return editorSettingsService?.cachedSettings } private func fetchBlockSettings() { editorSettingsService?.fetchSettings({ [weak self] (hasChanges, settings) in guard hasChanges, let `self` = self else { return } - self.gutenberg.updateTheme(settings) + self.gutenberg.updateEditorSettings(settings) }) } } diff --git a/WordPress/Classes/WordPress.xcdatamodeld/.xccurrentversion b/WordPress/Classes/WordPress.xcdatamodeld/.xccurrentversion index 838c132f0d94..8ef46cff38a6 100644 --- a/WordPress/Classes/WordPress.xcdatamodeld/.xccurrentversion +++ b/WordPress/Classes/WordPress.xcdatamodeld/.xccurrentversion @@ -3,6 +3,6 @@ _XCCurrentVersionName - WordPress 126.xcdatamodel + WordPress 127.xcdatamodel diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 127.xcdatamodel/contents b/WordPress/Classes/WordPress.xcdatamodeld/WordPress 127.xcdatamodel/contents new file mode 100644 index 000000000000..bda4f0acb237 --- /dev/null +++ b/WordPress/Classes/WordPress.xcdatamodeld/WordPress 127.xcdatamodel/contents @@ -0,0 +1,1053 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/WordPress/WordPress.xcodeproj/project.pbxproj b/WordPress/WordPress.xcodeproj/project.pbxproj index b06a24d1486a..0a0312274557 100644 --- a/WordPress/WordPress.xcodeproj/project.pbxproj +++ b/WordPress/WordPress.xcodeproj/project.pbxproj @@ -768,11 +768,12 @@ 464688D8255C71D200ECA61C /* SiteDesignPreviewViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 464688D6255C71D200ECA61C /* SiteDesignPreviewViewController.swift */; }; 464688D9255C71D200ECA61C /* TemplatePreviewViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 464688D7255C71D200ECA61C /* TemplatePreviewViewController.xib */; }; 465B097A24C877E500336B6C /* GutenbergLightNavigationController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 465B097924C877E500336B6C /* GutenbergLightNavigationController.swift */; }; + 465F89F7263B690C00F4C950 /* wp-block-editor-v1-settings-success-NotThemeJSON.json in Resources */ = {isa = PBXBuildFile; fileRef = 465F89F6263B690C00F4C950 /* wp-block-editor-v1-settings-success-NotThemeJSON.json */; }; + 465F8A0A263B692600F4C950 /* wp-block-editor-v1-settings-success-ThemeJSON.json in Resources */ = {isa = PBXBuildFile; fileRef = 465F8A09263B692600F4C950 /* wp-block-editor-v1-settings-success-ThemeJSON.json */; }; 46638DF6244904A3006E8439 /* GutenbergBlockProcessor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 46638DF5244904A3006E8439 /* GutenbergBlockProcessor.swift */; }; 4666534A2501552A00165DD4 /* LayoutPreviewViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 466653492501552A00165DD4 /* LayoutPreviewViewController.swift */; }; 467D3DFA25E4436000EB9CB0 /* SitePromptView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 467D3DF925E4436000EB9CB0 /* SitePromptView.swift */; }; 467D3E0C25E4436D00EB9CB0 /* SitePromptView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 467D3E0B25E4436D00EB9CB0 /* SitePromptView.xib */; }; - 46963F5924649542000D356D /* EditorTheme.swift in Sources */ = {isa = PBXBuildFile; fileRef = 46963F5824649542000D356D /* EditorTheme.swift */; }; 469CE06D24BCED75003BDC8B /* CategorySectionTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 469CE06B24BCED75003BDC8B /* CategorySectionTableViewCell.swift */; }; 469CE06E24BCED75003BDC8B /* CategorySectionTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 469CE06C24BCED75003BDC8B /* CategorySectionTableViewCell.xib */; }; 469CE07124BCFB04003BDC8B /* CollapsableHeaderCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 469CE06F24BCFB04003BDC8B /* CollapsableHeaderCollectionViewCell.swift */; }; @@ -799,9 +800,8 @@ 46F583D52624D0BC0010A723 /* Blog+BlockEditorSettings.swift in Sources */ = {isa = PBXBuildFile; fileRef = 46F583D32624D0BC0010A723 /* Blog+BlockEditorSettings.swift */; }; 46F584822624DCC80010A723 /* BlockEditorSettingsService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 46F584812624DCC80010A723 /* BlockEditorSettingsService.swift */; }; 46F584832624DCC80010A723 /* BlockEditorSettingsService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 46F584812624DCC80010A723 /* BlockEditorSettingsService.swift */; }; - 46F584B82624E6380010A723 /* BlockEditorSettings+GutenbergEditorTheme.swift in Sources */ = {isa = PBXBuildFile; fileRef = 46F584B72624E6380010A723 /* BlockEditorSettings+GutenbergEditorTheme.swift */; }; - 46F584B92624E6380010A723 /* BlockEditorSettings+GutenbergEditorTheme.swift in Sources */ = {isa = PBXBuildFile; fileRef = 46F584B72624E6380010A723 /* BlockEditorSettings+GutenbergEditorTheme.swift */; }; - 46F584EE2625FF100010A723 /* EditorThemeTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 46F584ED2625FF100010A723 /* EditorThemeTests.swift */; }; + 46F584B82624E6380010A723 /* BlockEditorSettings+GutenbergEditorSettings.swift in Sources */ = {isa = PBXBuildFile; fileRef = 46F584B72624E6380010A723 /* BlockEditorSettings+GutenbergEditorSettings.swift */; }; + 46F584B92624E6380010A723 /* BlockEditorSettings+GutenbergEditorSettings.swift in Sources */ = {isa = PBXBuildFile; fileRef = 46F584B72624E6380010A723 /* BlockEditorSettings+GutenbergEditorSettings.swift */; }; 46F58501262605930010A723 /* BlockEditorSettingsServiceTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 46F58500262605930010A723 /* BlockEditorSettingsServiceTests.swift */; }; 4B2DD0F29CD6AC353C056D41 /* Pods_WordPressUITests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8DCE7542239FBC709B90EA85 /* Pods_WordPressUITests.framework */; }; 4C8A715EBCE7E73AEE216293 /* Pods_WordPressShareExtension.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F47DB4A8EC2E6844E213A3FA /* Pods_WordPressShareExtension.framework */; }; @@ -2870,7 +2870,6 @@ FABB20FB2602FC2C00C8785C /* WebViewControllerFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = E1222B661F878E4700D23173 /* WebViewControllerFactory.swift */; }; FABB20FC2602FC2C00C8785C /* WordPress-32-33.xcmappingmodel in Sources */ = {isa = PBXBuildFile; fileRef = E1D86E681B2B414300DD2192 /* WordPress-32-33.xcmappingmodel */; }; FABB20FD2602FC2C00C8785C /* ShowRevisionsListManger.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A2B28E7219046ED00458F2A /* ShowRevisionsListManger.swift */; }; - FABB20FE2602FC2C00C8785C /* EditorTheme.swift in Sources */ = {isa = PBXBuildFile; fileRef = 46963F5824649542000D356D /* EditorTheme.swift */; }; FABB20FF2602FC2C00C8785C /* WidgetStyles.swift in Sources */ = {isa = PBXBuildFile; fileRef = 985ED0E323C6950600B8D06A /* WidgetStyles.swift */; }; FABB21002602FC2C00C8785C /* WordPress-91-92.xcmappingmodel in Sources */ = {isa = PBXBuildFile; fileRef = 57CCB3802358ED07003ECD0C /* WordPress-91-92.xcmappingmodel */; }; FABB21012602FC2C00C8785C /* ReaderCardDiscoverAttributionView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5D2B30B81B7411C700DA15F3 /* ReaderCardDiscoverAttributionView.swift */; }; @@ -5290,6 +5289,7 @@ 43FB3F401EBD215C00FC8A62 /* LoginEpilogueBlogCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LoginEpilogueBlogCell.swift; sourceTree = ""; }; 43FB3F461EC10F1E00FC8A62 /* LoginEpilogueTableViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LoginEpilogueTableViewController.swift; sourceTree = ""; }; 43FF64EE20DAA0840060A69A /* GravatarUploader.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GravatarUploader.swift; sourceTree = ""; }; + 46122253268E0416001134D7 /* WordPress 127.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = "WordPress 127.xcdatamodel"; sourceTree = ""; }; 46183CF1251BD5F1004F9AFD /* WordPress 99.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = "WordPress 99.xcdatamodel"; sourceTree = ""; }; 46183CF2251BD658004F9AFD /* PageTemplateLayout+CoreDataClass.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "PageTemplateLayout+CoreDataClass.swift"; sourceTree = ""; }; 46183CF3251BD658004F9AFD /* PageTemplateLayout+CoreDataProperties.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "PageTemplateLayout+CoreDataProperties.swift"; sourceTree = ""; }; @@ -5310,11 +5310,12 @@ 464688D6255C71D200ECA61C /* SiteDesignPreviewViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SiteDesignPreviewViewController.swift; sourceTree = ""; }; 464688D7255C71D200ECA61C /* TemplatePreviewViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = TemplatePreviewViewController.xib; sourceTree = ""; }; 465B097924C877E500336B6C /* GutenbergLightNavigationController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GutenbergLightNavigationController.swift; sourceTree = ""; }; + 465F89F6263B690C00F4C950 /* wp-block-editor-v1-settings-success-NotThemeJSON.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = "wp-block-editor-v1-settings-success-NotThemeJSON.json"; sourceTree = ""; }; + 465F8A09263B692600F4C950 /* wp-block-editor-v1-settings-success-ThemeJSON.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = "wp-block-editor-v1-settings-success-ThemeJSON.json"; sourceTree = ""; }; 46638DF5244904A3006E8439 /* GutenbergBlockProcessor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GutenbergBlockProcessor.swift; sourceTree = ""; }; 466653492501552A00165DD4 /* LayoutPreviewViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LayoutPreviewViewController.swift; sourceTree = ""; }; 467D3DF925E4436000EB9CB0 /* SitePromptView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SitePromptView.swift; sourceTree = ""; }; 467D3E0B25E4436D00EB9CB0 /* SitePromptView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = SitePromptView.xib; sourceTree = ""; }; - 46963F5824649542000D356D /* EditorTheme.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EditorTheme.swift; sourceTree = ""; }; 469CE06B24BCED75003BDC8B /* CategorySectionTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CategorySectionTableViewCell.swift; sourceTree = ""; }; 469CE06C24BCED75003BDC8B /* CategorySectionTableViewCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = CategorySectionTableViewCell.xib; sourceTree = ""; }; 469CE06F24BCFB04003BDC8B /* CollapsableHeaderCollectionViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CollapsableHeaderCollectionViewCell.swift; sourceTree = ""; }; @@ -5336,8 +5337,7 @@ 46F583A82624CE790010A723 /* BlockEditorSettingElement+CoreDataProperties.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "BlockEditorSettingElement+CoreDataProperties.swift"; sourceTree = ""; }; 46F583D32624D0BC0010A723 /* Blog+BlockEditorSettings.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Blog+BlockEditorSettings.swift"; sourceTree = ""; }; 46F584812624DCC80010A723 /* BlockEditorSettingsService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BlockEditorSettingsService.swift; sourceTree = ""; }; - 46F584B72624E6380010A723 /* BlockEditorSettings+GutenbergEditorTheme.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "BlockEditorSettings+GutenbergEditorTheme.swift"; sourceTree = ""; }; - 46F584ED2625FF100010A723 /* EditorThemeTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EditorThemeTests.swift; sourceTree = ""; }; + 46F584B72624E6380010A723 /* BlockEditorSettings+GutenbergEditorSettings.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "BlockEditorSettings+GutenbergEditorSettings.swift"; sourceTree = ""; }; 46F58500262605930010A723 /* BlockEditorSettingsServiceTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BlockEditorSettingsServiceTests.swift; sourceTree = ""; }; 46F84612185A8B7E009D0DA5 /* PostContentProvider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PostContentProvider.h; sourceTree = ""; }; 48690E659987FD4472EEDE5F /* Pods-WordPressNotificationContentExtension.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-WordPressNotificationContentExtension.release.xcconfig"; path = "../Pods/Target Support Files/Pods-WordPressNotificationContentExtension/Pods-WordPressNotificationContentExtension.release.xcconfig"; sourceTree = ""; }; @@ -9605,8 +9605,7 @@ 46F583A82624CE790010A723 /* BlockEditorSettingElement+CoreDataProperties.swift */, 46F583A52624CE790010A723 /* BlockEditorSettings+CoreDataClass.swift */, 46F583A62624CE790010A723 /* BlockEditorSettings+CoreDataProperties.swift */, - 46F584B72624E6380010A723 /* BlockEditorSettings+GutenbergEditorTheme.swift */, - 46963F5824649542000D356D /* EditorTheme.swift */, + 46F584B72624E6380010A723 /* BlockEditorSettings+GutenbergEditorSettings.swift */, 46183D1D251BD6A0004F9AFD /* PageTemplateCategory+CoreDataClass.swift */, 46183D1E251BD6A0004F9AFD /* PageTemplateCategory+CoreDataProperties.swift */, 46183CF2251BD658004F9AFD /* PageTemplateLayout+CoreDataClass.swift */, @@ -9620,6 +9619,8 @@ children = ( 46CFA7BE262745F70077BAD9 /* get_wp_v2_themes_twentytwentyone.json */, 46CFA7E2262746940077BAD9 /* get_wp_v2_themes_twentytwenty.json */, + 465F89F6263B690C00F4C950 /* wp-block-editor-v1-settings-success-NotThemeJSON.json */, + 465F8A09263B692600F4C950 /* wp-block-editor-v1-settings-success-ThemeJSON.json */, ); name = "BlockEditorSettings and Styles"; sourceTree = ""; @@ -9874,7 +9875,6 @@ children = ( F1B1E7A224098FA100549E2A /* BlogTests.swift */, 246D0A0225E97D5D0028B83F /* Blog+ObjcTests.m */, - 46F584ED2625FF100010A723 /* EditorThemeTests.swift */, D848CC1620FF38EA00A9038F /* FormattableCommentRangeTests.swift */, D848CC1420FF33FC00A9038F /* NotificationContentRangeTests.swift */, 8BBBEBB124B8F8C0005E358E /* ReaderCardTests.swift */, @@ -15335,6 +15335,7 @@ D821C819210037F8002ED995 /* activity-log-activity-content.json in Resources */, 3211055D250C027D0048446F /* 100x100.gif in Resources */, 748437EB1F1D4A4800E8DDAF /* gallery-reader-post-private.json in Resources */, + 465F8A0A263B692600F4C950 /* wp-block-editor-v1-settings-success-ThemeJSON.json in Resources */, D848CBFB20FEFA4800A9038F /* notifications-comment-content.json in Resources */, E1E4CE0617739FAB00430844 /* test-image.jpg in Resources */, 7E4A772120F7BBBD001C706D /* activity-log-post-content.json in Resources */, @@ -15363,6 +15364,7 @@ 08F8CD361EBD2AA80049D0C0 /* test-image-device-photo-gps-portrait.jpg in Resources */, B5AEEC7D1ACACFDA008BF2A4 /* notifications-replied-comment.json in Resources */, 46CFA7BF262745F70077BAD9 /* get_wp_v2_themes_twentytwentyone.json in Resources */, + 465F89F7263B690C00F4C950 /* wp-block-editor-v1-settings-success-NotThemeJSON.json in Resources */, 3211055C250C027D0048446F /* valid-gif-header.gif in Resources */, D848CC0920FF2D4400A9038F /* notifications-icon-range.json in Resources */, E131CB5816CACFB4004B0314 /* get-user-blogs_doesnt-have-blog.json in Resources */, @@ -16585,7 +16587,6 @@ E1222B671F878E4700D23173 /* WebViewControllerFactory.swift in Sources */, E1D86E691B2B414300DD2192 /* WordPress-32-33.xcmappingmodel in Sources */, 9A2B28E8219046ED00458F2A /* ShowRevisionsListManger.swift in Sources */, - 46963F5924649542000D356D /* EditorTheme.swift in Sources */, 985ED0E423C6950600B8D06A /* WidgetStyles.swift in Sources */, 57CCB3812358ED07003ECD0C /* WordPress-91-92.xcmappingmodel in Sources */, 5D2B30B91B7411C700DA15F3 /* ReaderCardDiscoverAttributionView.swift in Sources */, @@ -17262,7 +17263,7 @@ 1716AEFC25F2927600CF49EC /* MySiteViewController.swift in Sources */, F18CB8962642E58700B90794 /* FixedSizeImageView.swift in Sources */, 7E3E7A6020E44E490075D159 /* FooterContentGroup.swift in Sources */, - 46F584B82624E6380010A723 /* BlockEditorSettings+GutenbergEditorTheme.swift in Sources */, + 46F584B82624E6380010A723 /* BlockEditorSettings+GutenbergEditorSettings.swift in Sources */, 59A3CADD1CD2FF0C009BFA1B /* BasePageListCell.m in Sources */, 436D56202117312700CEAA33 /* RegisterDomainSuggestionsTableViewController.swift in Sources */, E114D79A153D85A800984182 /* WPError.m in Sources */, @@ -18384,7 +18385,6 @@ 73178C2C21BEE09300E37C9A /* SiteCreationHeaderDataTests.swift in Sources */, F9941D1822A805F600788F33 /* UIImage+XCAssetTests.swift in Sources */, 400199AD22259FF300EB0906 /* AnnualAndMostPopularTimeStatsRecordValueTests.swift in Sources */, - 46F584EE2625FF100010A723 /* EditorThemeTests.swift in Sources */, 08A2AD7B1CCED8E500E84454 /* PostCategoryServiceTests.m in Sources */, D88A64A8208D9733008AE9BC /* ThumbnailCollectionTests.swift in Sources */, 572FB401223A806000933C76 /* NoticeStoreTests.swift in Sources */, @@ -18733,7 +18733,6 @@ FABB20FB2602FC2C00C8785C /* WebViewControllerFactory.swift in Sources */, FABB20FC2602FC2C00C8785C /* WordPress-32-33.xcmappingmodel in Sources */, FABB20FD2602FC2C00C8785C /* ShowRevisionsListManger.swift in Sources */, - FABB20FE2602FC2C00C8785C /* EditorTheme.swift in Sources */, FABB20FF2602FC2C00C8785C /* WidgetStyles.swift in Sources */, FABB21002602FC2C00C8785C /* WordPress-91-92.xcmappingmodel in Sources */, FABB21012602FC2C00C8785C /* ReaderCardDiscoverAttributionView.swift in Sources */, @@ -19419,7 +19418,7 @@ FABB237F2602FC2C00C8785C /* SearchAdsAttribution.swift in Sources */, FABB23802602FC2C00C8785C /* ReaderCommentsViewController.m in Sources */, FABB23812602FC2C00C8785C /* MySiteViewController.swift in Sources */, - 46F584B92624E6380010A723 /* BlockEditorSettings+GutenbergEditorTheme.swift in Sources */, + 46F584B92624E6380010A723 /* BlockEditorSettings+GutenbergEditorSettings.swift in Sources */, FABB23822602FC2C00C8785C /* FooterContentGroup.swift in Sources */, FABB23832602FC2C00C8785C /* BasePageListCell.m in Sources */, FABB23842602FC2C00C8785C /* RegisterDomainSuggestionsTableViewController.swift in Sources */, @@ -24613,6 +24612,7 @@ E125443B12BF5A7200D87A0A /* WordPress.xcdatamodeld */ = { isa = XCVersionGroup; children = ( + 46122253268E0416001134D7 /* WordPress 127.xcdatamodel */, 987044AD268A9A5300BD0571 /* WordPress 126.xcdatamodel */, E6EE8807266ABE9F009BC219 /* WordPress 125.xcdatamodel */, 984FB2B22646001E00878DE0 /* WordPress 124.xcdatamodel */, @@ -24740,7 +24740,7 @@ 8350E15911D28B4A00A7B073 /* WordPress.xcdatamodel */, E125443D12BF5A7200D87A0A /* WordPress 2.xcdatamodel */, ); - currentVersion = 987044AD268A9A5300BD0571 /* WordPress 126.xcdatamodel */; + currentVersion = 46122253268E0416001134D7 /* WordPress 127.xcdatamodel */; name = WordPress.xcdatamodeld; path = Classes/WordPress.xcdatamodeld; sourceTree = ""; diff --git a/WordPress/WordPressTest/BlockEditorSettingsServiceTests.swift b/WordPress/WordPressTest/BlockEditorSettingsServiceTests.swift index 8abaa8e183ce..b1a1f469afe0 100644 --- a/WordPress/WordPressTest/BlockEditorSettingsServiceTests.swift +++ b/WordPress/WordPressTest/BlockEditorSettingsServiceTests.swift @@ -3,96 +3,214 @@ import Nimble @testable import WordPress class BlockEditorSettingsServiceTests: XCTestCase { - + let expectationTimeout = TimeInterval(1) private let twentytwentyResponseFilename = "get_wp_v2_themes_twentytwenty" private let twentytwentyoneResponseFilename = "get_wp_v2_themes_twentytwentyone" + private let blockSettingsNOTThemeJSONResponseFilename = "wp-block-editor-v1-settings-success-NotThemeJSON" + private let blockSettingsThemeJSONResponseFilename = "wp-block-editor-v1-settings-success-ThemeJSON" private var service: BlockEditorSettingsService! private var contextManager: TestContextManager! private var context: NSManagedObjectContext! var mockRemoteApi: MockWordPressComRestApi! + var gssOriginalValue: Bool! private var blog: Blog! override func setUp() { contextManager = TestContextManager() - context = contextManager.newDerivedContext() + context = contextManager.mainContext mockRemoteApi = MockWordPressComRestApi() blog = ModelTestHelper.insertDotComBlog(context: context) blog.dotComID = NSNumber(value: 1) blog.account?.authToken = "auth" + blog.setValue("5.8", forOption: "software_version") service = BlockEditorSettingsService(blog: blog, remoteAPI: mockRemoteApi, context: context) + + try! FeatureFlagOverrideStore().override(FeatureFlag.globalStyleSettings, withValue: false) } // MARK: Editor `theme_supports` support func testThemeSupportsNewTheme() { - let waitExpectation = expectation(description: "Theme should be successfully fetched") let mockedResponse = mockedData(withFilename: twentytwentyoneResponseFilename) + let waitExpectation = expectation(description: "Theme should be successfully fetched") service.fetchSettings { (hasChanges, result) in - expect(hasChanges).to(beTrue()) - expect(result).toNot(beNil()) + XCTAssertTrue(hasChanges) + XCTAssertNotNil(result) waitExpectation.fulfill() } - expect(self.mockRemoteApi.getMethodCalled).to(beTrue()) mockRemoteApi.successBlockPassedIn!(mockedResponse, HTTPURLResponse()) - waitForExpectations(timeout: 0.1) - validateResponse() - expect(self.blog.blockEditorSettings?.checksum).toNot(beNil()) + waitForExpectations(timeout: expectationTimeout) + validateThemeResponse() + XCTAssertNotNil(self.blog.blockEditorSettings?.checksum) } func testThemeSupportsThemeChange() { setData(withFilename: twentytwentyResponseFilename) let originalChecksum = blog.blockEditorSettings?.checksum ?? "" - let waitExpectation = expectation(description: "Theme should be successfully fetched") let mockedResponse = mockedData(withFilename: twentytwentyoneResponseFilename) + let waitExpectation = expectation(description: "Theme should be successfully fetched") service.fetchSettings { (hasChanges, result) in - expect(hasChanges).to(beTrue()) - expect(result).toNot(beNil()) + XCTAssertTrue(hasChanges) + XCTAssertNotNil(result) waitExpectation.fulfill() } - expect(self.mockRemoteApi.getMethodCalled).to(beTrue()) mockRemoteApi.successBlockPassedIn!(mockedResponse, HTTPURLResponse()) - waitForExpectations(timeout: 0.1) - validateResponse() - expect(self.blog.blockEditorSettings?.checksum).toNot(equal(originalChecksum)) + waitForExpectations(timeout: expectationTimeout) + validateThemeResponse() + XCTAssertNotEqual(self.blog.blockEditorSettings?.checksum, originalChecksum) } func testThemeSupportsThemeIsTheSame() { setData(withFilename: twentytwentyoneResponseFilename) let originalChecksum = blog.blockEditorSettings?.checksum ?? "" + let mockedResponse = mockedData(withFilename: twentytwentyoneResponseFilename) let waitExpectation = expectation(description: "Theme should be successfully fetched") - let mockedResponse = mockedData(withFilename: twentytwentyoneResponseFilename) service.fetchSettings { (hasChanges, result) in - expect(hasChanges).to(beFalse()) - expect(result).toNot(beNil()) + XCTAssertFalse(hasChanges) + XCTAssertNotNil(result) + waitExpectation.fulfill() + } + mockRemoteApi.successBlockPassedIn!(mockedResponse, HTTPURLResponse()) + + waitForExpectations(timeout: expectationTimeout) + validateThemeResponse() + XCTAssertEqual(self.blog.blockEditorSettings?.checksum, originalChecksum) + } + + private func validateThemeResponse() { + XCTAssertTrue(self.mockRemoteApi.getMethodCalled) + XCTAssertEqual(self.mockRemoteApi.URLStringPassedIn!, "/wp/v2/sites/1/themes") + XCTAssertEqual((self.mockRemoteApi.parametersPassedIn as! [String: String])["status"], "active") + XCTAssertGreaterThan(self.blog.blockEditorSettings!.colors!.count, 0) + XCTAssertGreaterThan(self.blog.blockEditorSettings!.gradients!.count, 0) + } + + // MARK: Editor Global Styles support + func testFetchBlockEditorSettingsNotThemeJSON() { + try! FeatureFlagOverrideStore().override(FeatureFlag.globalStyleSettings, withValue: true) + let mockedResponse = mockedData(withFilename: blockSettingsNOTThemeJSONResponseFilename) + let waitExpectation = expectation(description: "Theme should be successfully fetched") + service.fetchSettings { (hasChanges, result) in + XCTAssertTrue(hasChanges) + XCTAssertNotNil(result) + waitExpectation.fulfill() + } + mockRemoteApi.successBlockPassedIn!(mockedResponse, HTTPURLResponse()) + + waitForExpectations(timeout: expectationTimeout) + validateBlockEditorSettingsResponse(isGlobalStyles: false) + XCTAssertNotNil(self.blog.blockEditorSettings?.checksum) + } + + func testFetchBlockEditorSettingsThemeJSON() { + try! FeatureFlagOverrideStore().override(FeatureFlag.globalStyleSettings, withValue: true) + let mockedResponse = mockedData(withFilename: blockSettingsThemeJSONResponseFilename) + let waitExpectation = expectation(description: "Theme should be successfully fetched") + service.fetchSettings { (hasChanges, result) in + XCTAssertTrue(hasChanges) + XCTAssertNotNil(result) + waitExpectation.fulfill() + } + + mockRemoteApi.successBlockPassedIn!(mockedResponse, HTTPURLResponse()) + + waitForExpectations(timeout: expectationTimeout) + validateBlockEditorSettingsResponse() + XCTAssertNotNil(self.blog.blockEditorSettings?.checksum) + } + + func testFetchBlockEditorSettingsThemeJSONChangeFromOldEndpointToNew() { + setData(withFilename: twentytwentyoneResponseFilename) + let originalChecksum = blog.blockEditorSettings?.checksum ?? "" + + try! FeatureFlagOverrideStore().override(FeatureFlag.globalStyleSettings, withValue: true) + let mockedResponse = mockedData(withFilename: blockSettingsThemeJSONResponseFilename) + let waitExpectation = expectation(description: "Theme should be successfully fetched") + service.fetchSettings { (hasChanges, result) in + XCTAssertTrue(hasChanges) + XCTAssertNotNil(result) + waitExpectation.fulfill() + } + + mockRemoteApi.successBlockPassedIn!(mockedResponse, HTTPURLResponse()) + + waitForExpectations(timeout: expectationTimeout) + validateBlockEditorSettingsResponse() + XCTAssertNotNil(self.blog.blockEditorSettings?.checksum) + XCTAssertNotEqual(self.blog.blockEditorSettings?.checksum, originalChecksum) + } + + + func testFetchBlockEditorSettingsThemeJSONChangeSettings() { + setData(withFilename: blockSettingsNOTThemeJSONResponseFilename) + let originalChecksum = blog.blockEditorSettings?.checksum ?? "" + + try! FeatureFlagOverrideStore().override(FeatureFlag.globalStyleSettings, withValue: true) + let mockedResponse = mockedData(withFilename: blockSettingsThemeJSONResponseFilename) + let waitExpectation = expectation(description: "Theme should be successfully fetched") + service.fetchSettings { (hasChanges, result) in + XCTAssertTrue(hasChanges) + XCTAssertNotNil(result) + waitExpectation.fulfill() + } + + mockRemoteApi.successBlockPassedIn!(mockedResponse, HTTPURLResponse()) + + waitForExpectations(timeout: expectationTimeout) + validateBlockEditorSettingsResponse() + XCTAssertNotNil(self.blog.blockEditorSettings?.checksum) + XCTAssertNotEqual(self.blog.blockEditorSettings?.checksum, originalChecksum) + } + + func testFetchBlockEditorSettingsNoChange() { + try! FeatureFlagOverrideStore().override(FeatureFlag.globalStyleSettings, withValue: true) + + setData(withFilename: blockSettingsThemeJSONResponseFilename) + let originalChecksum = blog.blockEditorSettings?.checksum ?? "" + + let mockedResponse = mockedData(withFilename: blockSettingsThemeJSONResponseFilename) + let waitExpectation = expectation(description: "Theme should be successfully fetched") + service.fetchSettings { (hasChanges, result) in + XCTAssertFalse(hasChanges) + XCTAssertNotNil(result) waitExpectation.fulfill() } - expect(self.mockRemoteApi.getMethodCalled).to(beTrue()) mockRemoteApi.successBlockPassedIn!(mockedResponse, HTTPURLResponse()) - waitForExpectations(timeout: 0.1) - validateResponse() - expect(self.blog.blockEditorSettings?.checksum).to(equal(originalChecksum)) + waitForExpectations(timeout: expectationTimeout) + validateBlockEditorSettingsResponse() + XCTAssertNotNil(self.blog.blockEditorSettings?.checksum) + XCTAssertEqual(self.blog.blockEditorSettings?.checksum, originalChecksum) } - private func validateResponse() { - expect(self.mockRemoteApi.URLStringPassedIn!).to(equal("/wp/v2/sites/1/themes?status=active")) - expect(self.blog.blockEditorSettings?.colors?.count).to(beGreaterThan(0)) - expect(self.blog.blockEditorSettings?.gradients?.count).to(beGreaterThan(0)) + private func validateBlockEditorSettingsResponse(isGlobalStyles: Bool = true) { + XCTAssertTrue(self.mockRemoteApi.getMethodCalled) + XCTAssertEqual(self.mockRemoteApi.URLStringPassedIn!, "/__experimental/wp-block-editor/v1/settings") + XCTAssertEqual((self.mockRemoteApi.parametersPassedIn as! [String: String])["context"], "mobile") + + if isGlobalStyles { + XCTAssertNotNil(self.blog.blockEditorSettings?.rawStyles) + XCTAssertNotNil(self.blog.blockEditorSettings?.rawFeatures) + } else { + XCTAssertNil(self.blog.blockEditorSettings?.rawStyles) + } + XCTAssertGreaterThan(self.blog.blockEditorSettings!.colors!.count, 0) + XCTAssertGreaterThan(self.blog.blockEditorSettings!.gradients!.count, 0) } } extension BlockEditorSettingsServiceTests { func mockedData(withFilename filename: String) -> AnyObject { - let json = Bundle(for: SiteSegmentTests.self).url(forResource: filename, withExtension: "json")! + let json = Bundle(for: BlockEditorSettingsServiceTests.self).url(forResource: filename, withExtension: "json")! let data = try! Data(contentsOf: json) return try! JSONSerialization.jsonObject(with: data, options: .allowFragments) as AnyObject } @@ -104,6 +222,6 @@ extension BlockEditorSettingsServiceTests { waitExpectation.fulfill() } mockRemoteApi.successBlockPassedIn!(mockedResponse, HTTPURLResponse()) - waitForExpectations(timeout: 0.1) + waitForExpectations(timeout: expectationTimeout) } } diff --git a/WordPress/WordPressTest/EditorThemeTests.swift b/WordPress/WordPressTest/EditorThemeTests.swift deleted file mode 100644 index 24e2b802d270..000000000000 --- a/WordPress/WordPressTest/EditorThemeTests.swift +++ /dev/null @@ -1,36 +0,0 @@ -import XCTest -import Nimble -@testable import WordPress - -class EditorThemeTests: XCTestCase { - - func testParseEquivalentObjects() throws { - let testJSON: String = """ - [{"stylesheet":"twentytwentyone","template":"twentytwentyone","textdomain":"twentytwentyone","version":"1.2","theme_supports":{"editor-color-palette":[{"name":"Black","slug":"black","color":"#000000"}],"editor-gradient-presets":[{"name":"Purple to yellow","gradient":"linear-gradient(160deg, #D1D1E4 0%, #EEEADD 100%)","slug":"purple-to-yellow"}]}}] - """ - - /// The data is the same here but the keys are rearranged for dictionary objects. This is used to validate that the order won't effect the checksum. - let testJSONModifiedKeyOrder: String = """ - [{"version":"1.2","stylesheet":"twentytwentyone","textdomain":"twentytwentyone","template":"twentytwentyone","theme_supports":{"editor-gradient-presets":[{"gradient":"linear-gradient(160deg, #D1D1E4 0%, #EEEADD 100%)","name":"Purple to yellow","slug":"purple-to-yellow"}],"editor-color-palette":[{"slug":"black","name":"Black","color":"#000000"}]}}] - """ - - let editorTheme1 = try JSONDecoder().decode([EditorTheme].self, from: testJSON.data(using: .utf8)!).first! - let editorTheme2 = try JSONDecoder().decode([EditorTheme].self, from: testJSONModifiedKeyOrder.data(using: .utf8)!).first! - expect(editorTheme1.checksum).to(equal(editorTheme2.checksum)) - } - - func testParseDifferentObjects() throws { - let testJSON: String = """ - [{"stylesheet":"twentytwentyone","template":"twentytwentyone","textdomain":"twentytwentyone","version":"1.2","theme_supports":{"editor-color-palette":[{"name":"Black","slug":"black","color":"#000000"}],"editor-gradient-presets":[{"name":"Purple to yellow","gradient":"linear-gradient(160deg, #D1D1E4 0%, #EEEADD 100%)","slug":"purple-to-yellow"}]}}] - """ - - /// The data is almost the same here but has a small modification in hopes it will registes a change to the checksum - let testJSONModifiedKeyOrder: String = """ - [{"version":"1.2","stylesheet":"twentytwentyone","textdomain":"twentytwentyone","template":"twentytwentyone","theme_supports":{"editor-gradient-presets":[{"gradient":"linear-gradient(160deg, #D1D1E4 0%, #EEEADD 100%)","name":"Purple to yellowish","slug":"purple-to-yellow"}],"editor-color-palette":[{"slug":"black","name":"Black","color":"#000000"}]}}] - """ - - let editorTheme1 = try JSONDecoder().decode([EditorTheme].self, from: testJSON.data(using: .utf8)!).first! - let editorTheme2 = try JSONDecoder().decode([EditorTheme].self, from: testJSONModifiedKeyOrder.data(using: .utf8)!).first! - expect(editorTheme1.checksum).toNot(equal(editorTheme2.checksum)) - } -} diff --git a/WordPress/WordPressTest/Test Data/wp-block-editor-v1-settings-success-NotThemeJSON.json b/WordPress/WordPressTest/Test Data/wp-block-editor-v1-settings-success-NotThemeJSON.json new file mode 100644 index 000000000000..06c877b01355 --- /dev/null +++ b/WordPress/WordPressTest/Test Data/wp-block-editor-v1-settings-success-NotThemeJSON.json @@ -0,0 +1,604 @@ +{ + "__unstableEnableFullSiteEditingBlocks": true, + "alignWide": true, + "allowedBlockTypes": true, + "allowedMimeTypes": { + "jpg|jpeg|jpe": "image/jpeg", + "gif": "image/gif", + "png": "image/png", + "bmp": "image/bmp", + "tiff|tif": "image/tiff", + "webp": "image/webp", + "ico": "image/x-icon", + "heic": "image/heic", + "asf|asx": "video/x-ms-asf", + "wmv": "video/x-ms-wmv", + "wmx": "video/x-ms-wmx", + "wm": "video/x-ms-wm", + "avi": "video/avi", + "divx": "video/divx", + "flv": "video/x-flv", + "mov|qt": "video/quicktime", + "mpeg|mpg|mpe": "video/mpeg", + "mp4|m4v": "video/mp4", + "ogv": "video/ogg", + "webm": "video/webm", + "mkv": "video/x-matroska", + "3gp|3gpp": "video/3gpp", + "3g2|3gp2": "video/3gpp2", + "txt|asc|c|cc|h|srt": "text/plain", + "csv": "text/csv", + "tsv": "text/tab-separated-values", + "ics": "text/calendar", + "rtx": "text/richtext", + "css": "text/css", + "htm|html": "text/html", + "vtt": "text/vtt", + "dfxp": "application/ttaf+xml", + "mp3|m4a|m4b": "audio/mpeg", + "aac": "audio/aac", + "ra|ram": "audio/x-realaudio", + "wav": "audio/wav", + "ogg|oga": "audio/ogg", + "flac": "audio/flac", + "mid|midi": "audio/midi", + "wma": "audio/x-ms-wma", + "wax": "audio/x-ms-wax", + "mka": "audio/x-matroska", + "rtf": "application/rtf", + "js": "application/javascript", + "pdf": "application/pdf", + "class": "application/java", + "tar": "application/x-tar", + "zip": "application/zip", + "gz|gzip": "application/x-gzip", + "rar": "application/rar", + "7z": "application/x-7z-compressed", + "psd": "application/octet-stream", + "xcf": "application/octet-stream", + "doc": "application/msword", + "pot|pps|ppt": "application/vnd.ms-powerpoint", + "wri": "application/vnd.ms-write", + "xla|xls|xlt|xlw": "application/vnd.ms-excel", + "mdb": "application/vnd.ms-access", + "mpp": "application/vnd.ms-project", + "docx": "application/vnd.openxmlformats-officedocument.wordprocessingml.document", + "docm": "application/vnd.ms-word.document.macroEnabled.12", + "dotx": "application/vnd.openxmlformats-officedocument.wordprocessingml.template", + "dotm": "application/vnd.ms-word.template.macroEnabled.12", + "xlsx": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", + "xlsm": "application/vnd.ms-excel.sheet.macroEnabled.12", + "xlsb": "application/vnd.ms-excel.sheet.binary.macroEnabled.12", + "xltx": "application/vnd.openxmlformats-officedocument.spreadsheetml.template", + "xltm": "application/vnd.ms-excel.template.macroEnabled.12", + "xlam": "application/vnd.ms-excel.addin.macroEnabled.12", + "pptx": "application/vnd.openxmlformats-officedocument.presentationml.presentation", + "pptm": "application/vnd.ms-powerpoint.presentation.macroEnabled.12", + "ppsx": "application/vnd.openxmlformats-officedocument.presentationml.slideshow", + "ppsm": "application/vnd.ms-powerpoint.slideshow.macroEnabled.12", + "potx": "application/vnd.openxmlformats-officedocument.presentationml.template", + "potm": "application/vnd.ms-powerpoint.template.macroEnabled.12", + "ppam": "application/vnd.ms-powerpoint.addin.macroEnabled.12", + "sldx": "application/vnd.openxmlformats-officedocument.presentationml.slide", + "sldm": "application/vnd.ms-powerpoint.slide.macroEnabled.12", + "onetoc|onetoc2|onetmp|onepkg": "application/onenote", + "oxps": "application/oxps", + "xps": "application/vnd.ms-xpsdocument", + "odt": "application/vnd.oasis.opendocument.text", + "odp": "application/vnd.oasis.opendocument.presentation", + "ods": "application/vnd.oasis.opendocument.spreadsheet", + "odg": "application/vnd.oasis.opendocument.graphics", + "odc": "application/vnd.oasis.opendocument.chart", + "odb": "application/vnd.oasis.opendocument.database", + "odf": "application/vnd.oasis.opendocument.formula", + "wp|wpd": "application/wordperfect", + "key": "application/vnd.apple.keynote", + "numbers": "application/vnd.apple.numbers", + "pages": "application/vnd.apple.pages" + }, + "blockCategories": [ + { + "slug": "text", + "title": "Text", + "icon": null + }, + { + "slug": "media", + "title": "Media", + "icon": null + }, + { + "slug": "design", + "title": "Design", + "icon": null + }, + { + "slug": "widgets", + "title": "Widgets", + "icon": null + }, + { + "slug": "theme", + "title": "Theme", + "icon": null + }, + { + "slug": "embed", + "title": "Embeds", + "icon": null + }, + { + "slug": "reusable", + "title": "Reusable Blocks", + "icon": null + } + ], + "disableCustomColors": false, + "disableCustomFontSizes": false, + "disableCustomGradients": false, + "enableCustomLineHeight": false, + "enableCustomSpacing": false, + "enableCustomUnits": false, + "isRTL": false, + "imageDefaultSize": "large", + "imageDimensions": { + "thumbnail": { + "width": 150, + "height": 150, + "crop": true + }, + "medium": { + "width": 300, + "height": 300, + "crop": false + }, + "large": { + "width": 1024, + "height": 1024, + "crop": false + } + }, + "imageEditing": true, + "imageSizes": [ + { + "slug": "thumbnail", + "name": "Thumbnail" + }, + { + "slug": "medium", + "name": "Medium" + }, + { + "slug": "large", + "name": "Large" + }, + { + "slug": "full", + "name": "Full Size" + } + ], + "maxUploadFileSize": 536870912, + "colors": [ + { + "name": "Accent Color", + "slug": "accent", + "color": "#cd2653" + }, + { + "name": "Primary", + "slug": "primary", + "color": "#000000" + }, + { + "name": "Secondary", + "slug": "secondary", + "color": "#6d6d6d" + }, + { + "name": "Subtle Background", + "slug": "subtle-background", + "color": "#dcd7ca" + }, + { + "name": "Background Color", + "slug": "background", + "color": "#f5efe0" + } + ], + "fontSizes": [ + { + "name": "Small", + "shortName": "S", + "size": "18px", + "slug": "small" + }, + { + "name": "Regular", + "shortName": "M", + "size": "21px", + "slug": "normal" + }, + { + "name": "Large", + "shortName": "L", + "size": "26.25px", + "slug": "large" + }, + { + "name": "Larger", + "shortName": "XL", + "size": "32px", + "slug": "larger" + } + ], + "styles": [], + "supportsTemplateMode": true, + "supportsLayout": false, + "__experimentalFeatures": { + "color": { + "palette": { + "core": [ + { + "name": "Black", + "slug": "black", + "color": "#000000" + }, + { + "name": "Cyan bluish gray", + "slug": "cyan-bluish-gray", + "color": "#abb8c3" + }, + { + "name": "White", + "slug": "white", + "color": "#ffffff" + }, + { + "name": "Pale pink", + "slug": "pale-pink", + "color": "#f78da7" + }, + { + "name": "Vivid red", + "slug": "vivid-red", + "color": "#cf2e2e" + }, + { + "name": "Luminous vivid orange", + "slug": "luminous-vivid-orange", + "color": "#ff6900" + }, + { + "name": "Luminous vivid amber", + "slug": "luminous-vivid-amber", + "color": "#fcb900" + }, + { + "name": "Light green cyan", + "slug": "light-green-cyan", + "color": "#7bdcb5" + }, + { + "name": "Vivid green cyan", + "slug": "vivid-green-cyan", + "color": "#00d084" + }, + { + "name": "Pale cyan blue", + "slug": "pale-cyan-blue", + "color": "#8ed1fc" + }, + { + "name": "Vivid cyan blue", + "slug": "vivid-cyan-blue", + "color": "#0693e3" + }, + { + "name": "Vivid purple", + "slug": "vivid-purple", + "color": "#9b51e0" + } + ], + "theme": [ + { + "name": "Accent Color", + "slug": "accent", + "color": "#cd2653" + }, + { + "name": "Primary", + "slug": "primary", + "color": "#000000" + }, + { + "name": "Secondary", + "slug": "secondary", + "color": "#6d6d6d" + }, + { + "name": "Subtle Background", + "slug": "subtle-background", + "color": "#dcd7ca" + }, + { + "name": "Background Color", + "slug": "background", + "color": "#f5efe0" + } + ] + }, + "gradients": { + "core": [ + { + "name": "Vivid cyan blue to vivid purple", + "gradient": "linear-gradient(135deg,rgba(6,147,227,1) 0%,rgb(155,81,224) 100%)", + "slug": "vivid-cyan-blue-to-vivid-purple" + }, + { + "name": "Light green cyan to vivid green cyan", + "gradient": "linear-gradient(135deg,rgb(122,220,180) 0%,rgb(0,208,130) 100%)", + "slug": "light-green-cyan-to-vivid-green-cyan" + }, + { + "name": "Luminous vivid amber to luminous vivid orange", + "gradient": "linear-gradient(135deg,rgba(252,185,0,1) 0%,rgba(255,105,0,1) 100%)", + "slug": "luminous-vivid-amber-to-luminous-vivid-orange" + }, + { + "name": "Luminous vivid orange to vivid red", + "gradient": "linear-gradient(135deg,rgba(255,105,0,1) 0%,rgb(207,46,46) 100%)", + "slug": "luminous-vivid-orange-to-vivid-red" + }, + { + "name": "Very light gray to cyan bluish gray", + "gradient": "linear-gradient(135deg,rgb(238,238,238) 0%,rgb(169,184,195) 100%)", + "slug": "very-light-gray-to-cyan-bluish-gray" + }, + { + "name": "Cool to warm spectrum", + "gradient": "linear-gradient(135deg,rgb(74,234,220) 0%,rgb(151,120,209) 20%,rgb(207,42,186) 40%,rgb(238,44,130) 60%,rgb(251,105,98) 80%,rgb(254,248,76) 100%)", + "slug": "cool-to-warm-spectrum" + }, + { + "name": "Blush light purple", + "gradient": "linear-gradient(135deg,rgb(255,206,236) 0%,rgb(152,150,240) 100%)", + "slug": "blush-light-purple" + }, + { + "name": "Blush bordeaux", + "gradient": "linear-gradient(135deg,rgb(254,205,165) 0%,rgb(254,45,45) 50%,rgb(107,0,62) 100%)", + "slug": "blush-bordeaux" + }, + { + "name": "Luminous dusk", + "gradient": "linear-gradient(135deg,rgb(255,203,112) 0%,rgb(199,81,192) 50%,rgb(65,88,208) 100%)", + "slug": "luminous-dusk" + }, + { + "name": "Pale ocean", + "gradient": "linear-gradient(135deg,rgb(255,245,203) 0%,rgb(182,227,212) 50%,rgb(51,167,181) 100%)", + "slug": "pale-ocean" + }, + { + "name": "Electric grass", + "gradient": "linear-gradient(135deg,rgb(202,248,128) 0%,rgb(113,206,126) 100%)", + "slug": "electric-grass" + }, + { + "name": "Midnight", + "gradient": "linear-gradient(135deg,rgb(2,3,129) 0%,rgb(40,116,252) 100%)", + "slug": "midnight" + } + ] + }, + "duotone": [ + { + "name": "Dark grayscale", + "colors": [ + "#000000", + "#7f7f7f" + ], + "slug": "dark-grayscale" + }, + { + "name": "Grayscale", + "colors": [ + "#000000", + "#ffffff" + ], + "slug": "grayscale" + }, + { + "name": "Purple and yellow", + "colors": [ + "#8c00b7", + "#fcff41" + ], + "slug": "purple-yellow" + }, + { + "name": "Blue and red", + "colors": [ + "#000097", + "#ff4747" + ], + "slug": "blue-red" + }, + { + "name": "Midnight", + "colors": [ + "#000000", + "#00a5ff" + ], + "slug": "midnight" + }, + { + "name": "Magenta and yellow", + "colors": [ + "#c7005a", + "#fff278" + ], + "slug": "magenta-yellow" + }, + { + "name": "Purple and green", + "colors": [ + "#a60072", + "#67ff66" + ], + "slug": "purple-green" + }, + { + "name": "Blue and orange", + "colors": [ + "#1900d8", + "#ffa96b" + ], + "slug": "blue-orange" + } + ], + "link": false + }, + "typography": { + "dropCap": true, + "customFontStyle": true, + "customFontWeight": true, + "customTextTransforms": true, + "customTextDecorations": true, + "customLetterSpacing": true, + "fontSizes": { + "core": [ + { + "name": "Small", + "slug": "small", + "size": "13px" + }, + { + "name": "Normal", + "slug": "normal", + "size": "16px" + }, + { + "name": "Medium", + "slug": "medium", + "size": "20px" + }, + { + "name": "Large", + "slug": "large", + "size": "36px" + }, + { + "name": "Huge", + "slug": "huge", + "size": "42px" + } + ], + "theme": [ + { + "name": "Small", + "shortName": "S", + "size": "18px", + "slug": "small" + }, + { + "name": "Regular", + "shortName": "M", + "size": "21px", + "slug": "normal" + }, + { + "name": "Large", + "shortName": "L", + "size": "26.25px", + "slug": "large" + }, + { + "name": "Larger", + "shortName": "XL", + "size": "32px", + "slug": "larger" + } + ] + } + }, + "spacing": { + "customMargin": false + }, + "border": { + "customColor": false, + "customRadius": false, + "customStyle": false, + "customWidth": false + }, + "blocks": { + "core/button": { + "border": { + "customRadius": true + } + } + } + }, + "gradients": [ + { + "name": "Vivid cyan blue to vivid purple", + "gradient": "linear-gradient(135deg,rgba(6,147,227,1) 0%,rgb(155,81,224) 100%)", + "slug": "vivid-cyan-blue-to-vivid-purple" + }, + { + "name": "Light green cyan to vivid green cyan", + "gradient": "linear-gradient(135deg,rgb(122,220,180) 0%,rgb(0,208,130) 100%)", + "slug": "light-green-cyan-to-vivid-green-cyan" + }, + { + "name": "Luminous vivid amber to luminous vivid orange", + "gradient": "linear-gradient(135deg,rgba(252,185,0,1) 0%,rgba(255,105,0,1) 100%)", + "slug": "luminous-vivid-amber-to-luminous-vivid-orange" + }, + { + "name": "Luminous vivid orange to vivid red", + "gradient": "linear-gradient(135deg,rgba(255,105,0,1) 0%,rgb(207,46,46) 100%)", + "slug": "luminous-vivid-orange-to-vivid-red" + }, + { + "name": "Very light gray to cyan bluish gray", + "gradient": "linear-gradient(135deg,rgb(238,238,238) 0%,rgb(169,184,195) 100%)", + "slug": "very-light-gray-to-cyan-bluish-gray" + }, + { + "name": "Cool to warm spectrum", + "gradient": "linear-gradient(135deg,rgb(74,234,220) 0%,rgb(151,120,209) 20%,rgb(207,42,186) 40%,rgb(238,44,130) 60%,rgb(251,105,98) 80%,rgb(254,248,76) 100%)", + "slug": "cool-to-warm-spectrum" + }, + { + "name": "Blush light purple", + "gradient": "linear-gradient(135deg,rgb(255,206,236) 0%,rgb(152,150,240) 100%)", + "slug": "blush-light-purple" + }, + { + "name": "Blush bordeaux", + "gradient": "linear-gradient(135deg,rgb(254,205,165) 0%,rgb(254,45,45) 50%,rgb(107,0,62) 100%)", + "slug": "blush-bordeaux" + }, + { + "name": "Luminous dusk", + "gradient": "linear-gradient(135deg,rgb(255,203,112) 0%,rgb(199,81,192) 50%,rgb(65,88,208) 100%)", + "slug": "luminous-dusk" + }, + { + "name": "Pale ocean", + "gradient": "linear-gradient(135deg,rgb(255,245,203) 0%,rgb(182,227,212) 50%,rgb(51,167,181) 100%)", + "slug": "pale-ocean" + }, + { + "name": "Electric grass", + "gradient": "linear-gradient(135deg,rgb(202,248,128) 0%,rgb(113,206,126) 100%)", + "slug": "electric-grass" + }, + { + "name": "Midnight", + "gradient": "linear-gradient(135deg,rgb(2,3,129) 0%,rgb(40,116,252) 100%)", + "slug": "midnight" + } + ] +} diff --git a/WordPress/WordPressTest/Test Data/wp-block-editor-v1-settings-success-ThemeJSON.json b/WordPress/WordPressTest/Test Data/wp-block-editor-v1-settings-success-ThemeJSON.json new file mode 100644 index 000000000000..56b4bc92dc6d --- /dev/null +++ b/WordPress/WordPressTest/Test Data/wp-block-editor-v1-settings-success-ThemeJSON.json @@ -0,0 +1,885 @@ +{ + "__unstableEnableFullSiteEditingBlocks": true, + "alignWide": false, + "allowedBlockTypes": true, + "allowedMimeTypes": { + "jpg|jpeg|jpe": "image/jpeg", + "gif": "image/gif", + "png": "image/png", + "bmp": "image/bmp", + "tiff|tif": "image/tiff", + "webp": "image/webp", + "ico": "image/x-icon", + "heic": "image/heic", + "asf|asx": "video/x-ms-asf", + "wmv": "video/x-ms-wmv", + "wmx": "video/x-ms-wmx", + "wm": "video/x-ms-wm", + "avi": "video/avi", + "divx": "video/divx", + "flv": "video/x-flv", + "mov|qt": "video/quicktime", + "mpeg|mpg|mpe": "video/mpeg", + "mp4|m4v": "video/mp4", + "ogv": "video/ogg", + "webm": "video/webm", + "mkv": "video/x-matroska", + "3gp|3gpp": "video/3gpp", + "3g2|3gp2": "video/3gpp2", + "txt|asc|c|cc|h|srt": "text/plain", + "csv": "text/csv", + "tsv": "text/tab-separated-values", + "ics": "text/calendar", + "rtx": "text/richtext", + "css": "text/css", + "htm|html": "text/html", + "vtt": "text/vtt", + "dfxp": "application/ttaf+xml", + "mp3|m4a|m4b": "audio/mpeg", + "aac": "audio/aac", + "ra|ram": "audio/x-realaudio", + "wav": "audio/wav", + "ogg|oga": "audio/ogg", + "flac": "audio/flac", + "mid|midi": "audio/midi", + "wma": "audio/x-ms-wma", + "wax": "audio/x-ms-wax", + "mka": "audio/x-matroska", + "rtf": "application/rtf", + "js": "application/javascript", + "pdf": "application/pdf", + "class": "application/java", + "tar": "application/x-tar", + "zip": "application/zip", + "gz|gzip": "application/x-gzip", + "rar": "application/rar", + "7z": "application/x-7z-compressed", + "psd": "application/octet-stream", + "xcf": "application/octet-stream", + "doc": "application/msword", + "pot|pps|ppt": "application/vnd.ms-powerpoint", + "wri": "application/vnd.ms-write", + "xla|xls|xlt|xlw": "application/vnd.ms-excel", + "mdb": "application/vnd.ms-access", + "mpp": "application/vnd.ms-project", + "docx": "application/vnd.openxmlformats-officedocument.wordprocessingml.document", + "docm": "application/vnd.ms-word.document.macroEnabled.12", + "dotx": "application/vnd.openxmlformats-officedocument.wordprocessingml.template", + "dotm": "application/vnd.ms-word.template.macroEnabled.12", + "xlsx": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", + "xlsm": "application/vnd.ms-excel.sheet.macroEnabled.12", + "xlsb": "application/vnd.ms-excel.sheet.binary.macroEnabled.12", + "xltx": "application/vnd.openxmlformats-officedocument.spreadsheetml.template", + "xltm": "application/vnd.ms-excel.template.macroEnabled.12", + "xlam": "application/vnd.ms-excel.addin.macroEnabled.12", + "pptx": "application/vnd.openxmlformats-officedocument.presentationml.presentation", + "pptm": "application/vnd.ms-powerpoint.presentation.macroEnabled.12", + "ppsx": "application/vnd.openxmlformats-officedocument.presentationml.slideshow", + "ppsm": "application/vnd.ms-powerpoint.slideshow.macroEnabled.12", + "potx": "application/vnd.openxmlformats-officedocument.presentationml.template", + "potm": "application/vnd.ms-powerpoint.template.macroEnabled.12", + "ppam": "application/vnd.ms-powerpoint.addin.macroEnabled.12", + "sldx": "application/vnd.openxmlformats-officedocument.presentationml.slide", + "sldm": "application/vnd.ms-powerpoint.slide.macroEnabled.12", + "onetoc|onetoc2|onetmp|onepkg": "application/onenote", + "oxps": "application/oxps", + "xps": "application/vnd.ms-xpsdocument", + "odt": "application/vnd.oasis.opendocument.text", + "odp": "application/vnd.oasis.opendocument.presentation", + "ods": "application/vnd.oasis.opendocument.spreadsheet", + "odg": "application/vnd.oasis.opendocument.graphics", + "odc": "application/vnd.oasis.opendocument.chart", + "odb": "application/vnd.oasis.opendocument.database", + "odf": "application/vnd.oasis.opendocument.formula", + "wp|wpd": "application/wordperfect", + "key": "application/vnd.apple.keynote", + "numbers": "application/vnd.apple.numbers", + "pages": "application/vnd.apple.pages" + }, + "blockCategories": [ + { + "slug": "text", + "title": "Text", + "icon": null + }, + { + "slug": "media", + "title": "Media", + "icon": null + }, + { + "slug": "design", + "title": "Design", + "icon": null + }, + { + "slug": "widgets", + "title": "Widgets", + "icon": null + }, + { + "slug": "theme", + "title": "Theme", + "icon": null + }, + { + "slug": "embed", + "title": "Embeds", + "icon": null + }, + { + "slug": "reusable", + "title": "Reusable Blocks", + "icon": null + } + ], + "disableCustomColors": false, + "disableCustomFontSizes": false, + "disableCustomGradients": false, + "enableCustomLineHeight": true, + "enableCustomSpacing": true, + "enableCustomUnits": true, + "isRTL": false, + "imageDefaultSize": "large", + "imageDimensions": { + "thumbnail": { + "width": 150, + "height": 150, + "crop": true + }, + "medium": { + "width": 300, + "height": 300, + "crop": false + }, + "large": { + "width": 1024, + "height": 1024, + "crop": false + } + }, + "imageEditing": true, + "imageSizes": [ + { + "slug": "thumbnail", + "name": "Thumbnail" + }, + { + "slug": "medium", + "name": "Medium" + }, + { + "slug": "large", + "name": "Large" + }, + { + "slug": "full", + "name": "Full Size" + } + ], + "maxUploadFileSize": 536870912, + "defaultTemplatePartAreas": [ + { + "area": "uncategorized", + "label": "General", + "description": "General templates often perform a specific role like displaying post content, and are not tied to any particular area.", + "icon": "layout", + "area_tag": "div" + }, + { + "area": "header", + "label": "Header", + "description": "The Header template defines a page area that typically contains a title, logo, and main navigation.", + "icon": "header", + "area_tag": "header" + }, + { + "area": "footer", + "label": "Footer", + "description": "The Footer template defines a page area that typically contains site credits, social links, or any other combination of blocks.", + "icon": "footer", + "area_tag": "footer" + } + ], + "styles": [], + "supportsTemplateMode": true, + "supportsLayout": true, + "__experimentalStyles": { + "color": { + "background": "var(--wp--preset--color--green)", + "text": "var(--wp--preset--color--dark-gray)" + }, + "typography": { + "fontSize": "var(--wp--preset--font-size--normal)", + "lineHeight": "var(--wp--custom--line-height--body)" + }, + "elements": { + "link": { + "color": { + "text": "var(--wp--preset--color--dark-gray)" + } + }, + "h1": { + "typography": { + "fontSize": "var(--wp--preset--font-size--gigantic)", + "lineHeight": "var(--wp--custom--line-height--page-title)", + "fontWeight": "var(--wp--custom--font-weight--normal)" + } + }, + "h2": { + "typography": { + "fontSize": "var(--wp--preset--font-size--extra-large)", + "lineHeight": "var(--wp--custom--line-height--heading)", + "fontWeight": "var(--wp--custom--font-weight--normal)" + } + }, + "h3": { + "typography": { + "fontSize": "calc(1.25 * var(--wp--preset--font-size--large))", + "lineHeight": "var(--wp--custom--line-height--heading)", + "fontWeight": "var(--wp--custom--font-weight--normal)" + } + }, + "h4": { + "typography": { + "fontSize": "var(--wp--preset--font-size--large)", + "lineHeight": "var(--wp--custom--line-height--heading)" + } + }, + "h5": { + "typography": { + "fontSize": "var(--wp--preset--font-size--small)", + "lineHeight": "var(--wp--custom--line-height--heading)" + } + }, + "h6": { + "typography": { + "fontSize": "var(--wp--preset--font-size--extra-small)", + "lineHeight": "var(--wp--custom--line-height--heading)" + } + } + }, + "blocks": { + "core/site-tagline": { + "typography": { + "fontSize": "var(--wp--preset--font-size--small)", + "lineHeight": 1.4 + } + }, + "core/button": { + "border": { + "radius": "0px" + }, + "color": { + "background": "var(--wp--preset--color--gray)", + "text": "var(--wp--preset--color--green)" + }, + "typography": { + "fontSize": "var(--wp--preset--font-size--normal)", + "fontWeight": 500 + } + }, + "core/post-author": { + "typography": { + "fontSize": "var(--wp--preset--font-size--extra-small)", + "lineHeight": "var(--wp--custom--line-height--body)" + } + }, + "core/post-date": { + "typography": { + "fontSize": "var(--wp--preset--font-size--extra-small)", + "lineHeight": "var(--wp--custom--line-height--body)" + } + }, + "core/post-terms": { + "typography": { + "fontSize": "var(--wp--preset--font-size--extra-small)", + "lineHeight": "var(--wp--custom--line-height--body)" + } + }, + "core/site-title": { + "typography": { + "fontSize": "var(--wp--preset--font-size--large)", + "fontWeight": "var(--wp--custom--font-weight--normal)", + "textTransform": "uppercase" + } + }, + "core/code": { + "spacing": { + "padding": { + "top": "var(--wp--custom--spacing--unit)", + "bottom": "var(--wp--custom--spacing--unit)", + "left": "var(--wp--custom--spacing--unit)", + "right": "var(--wp--custom--spacing--unit)" + } + }, + "border": { + "radius": "0px", + "color": "var(--wp--preset--color--dark-gray)", + "style": "solid", + "width": "1.5px" + } + } + } + }, + "__experimentalFeatures": { + "color": { + "palette": { + "core": [ + { + "name": "Black", + "slug": "black", + "color": "#000000" + }, + { + "name": "Cyan bluish gray", + "slug": "cyan-bluish-gray", + "color": "#abb8c3" + }, + { + "name": "White", + "slug": "white", + "color": "#ffffff" + }, + { + "name": "Pale pink", + "slug": "pale-pink", + "color": "#f78da7" + }, + { + "name": "Vivid red", + "slug": "vivid-red", + "color": "#cf2e2e" + }, + { + "name": "Luminous vivid orange", + "slug": "luminous-vivid-orange", + "color": "#ff6900" + }, + { + "name": "Luminous vivid amber", + "slug": "luminous-vivid-amber", + "color": "#fcb900" + }, + { + "name": "Light green cyan", + "slug": "light-green-cyan", + "color": "#7bdcb5" + }, + { + "name": "Vivid green cyan", + "slug": "vivid-green-cyan", + "color": "#00d084" + }, + { + "name": "Pale cyan blue", + "slug": "pale-cyan-blue", + "color": "#8ed1fc" + }, + { + "name": "Vivid cyan blue", + "slug": "vivid-cyan-blue", + "color": "#0693e3" + }, + { + "name": "Vivid purple", + "slug": "vivid-purple", + "color": "#9b51e0" + } + ], + "theme": [ + { + "slug": "black", + "color": "#000000", + "name": "Black" + }, + { + "slug": "dark-gray", + "color": "#28303D", + "name": "Dark Gray" + }, + { + "slug": "gray", + "color": "#39414D", + "name": "Gray" + }, + { + "slug": "green", + "color": "#D1E4DD", + "name": "Green" + }, + { + "slug": "blue", + "color": "#D1DFE4", + "name": "Blue" + }, + { + "slug": "purple", + "color": "#D1D1E4", + "name": "Purple" + }, + { + "slug": "red", + "color": "#E4D1D1", + "name": "Red" + }, + { + "slug": "orange", + "color": "#E4DAD1", + "name": "Orange" + }, + { + "slug": "yellow", + "color": "#EEEADD", + "name": "Yellow" + }, + { + "slug": "white", + "color": "#FFFFFF", + "name": "White" + } + ] + }, + "gradients": { + "core": [ + { + "name": "Vivid cyan blue to vivid purple", + "gradient": "linear-gradient(135deg,rgba(6,147,227,1) 0%,rgb(155,81,224) 100%)", + "slug": "vivid-cyan-blue-to-vivid-purple" + }, + { + "name": "Light green cyan to vivid green cyan", + "gradient": "linear-gradient(135deg,rgb(122,220,180) 0%,rgb(0,208,130) 100%)", + "slug": "light-green-cyan-to-vivid-green-cyan" + }, + { + "name": "Luminous vivid amber to luminous vivid orange", + "gradient": "linear-gradient(135deg,rgba(252,185,0,1) 0%,rgba(255,105,0,1) 100%)", + "slug": "luminous-vivid-amber-to-luminous-vivid-orange" + }, + { + "name": "Luminous vivid orange to vivid red", + "gradient": "linear-gradient(135deg,rgba(255,105,0,1) 0%,rgb(207,46,46) 100%)", + "slug": "luminous-vivid-orange-to-vivid-red" + }, + { + "name": "Very light gray to cyan bluish gray", + "gradient": "linear-gradient(135deg,rgb(238,238,238) 0%,rgb(169,184,195) 100%)", + "slug": "very-light-gray-to-cyan-bluish-gray" + }, + { + "name": "Cool to warm spectrum", + "gradient": "linear-gradient(135deg,rgb(74,234,220) 0%,rgb(151,120,209) 20%,rgb(207,42,186) 40%,rgb(238,44,130) 60%,rgb(251,105,98) 80%,rgb(254,248,76) 100%)", + "slug": "cool-to-warm-spectrum" + }, + { + "name": "Blush light purple", + "gradient": "linear-gradient(135deg,rgb(255,206,236) 0%,rgb(152,150,240) 100%)", + "slug": "blush-light-purple" + }, + { + "name": "Blush bordeaux", + "gradient": "linear-gradient(135deg,rgb(254,205,165) 0%,rgb(254,45,45) 50%,rgb(107,0,62) 100%)", + "slug": "blush-bordeaux" + }, + { + "name": "Luminous dusk", + "gradient": "linear-gradient(135deg,rgb(255,203,112) 0%,rgb(199,81,192) 50%,rgb(65,88,208) 100%)", + "slug": "luminous-dusk" + }, + { + "name": "Pale ocean", + "gradient": "linear-gradient(135deg,rgb(255,245,203) 0%,rgb(182,227,212) 50%,rgb(51,167,181) 100%)", + "slug": "pale-ocean" + }, + { + "name": "Electric grass", + "gradient": "linear-gradient(135deg,rgb(202,248,128) 0%,rgb(113,206,126) 100%)", + "slug": "electric-grass" + }, + { + "name": "Midnight", + "gradient": "linear-gradient(135deg,rgb(2,3,129) 0%,rgb(40,116,252) 100%)", + "slug": "midnight" + } + ], + "theme": [ + { + "slug": "purple-to-yellow", + "gradient": "linear-gradient(160deg, var(--wp--preset--color--purple), var(--wp--preset--color--yellow))", + "name": "Purple to Yellow" + }, + { + "slug": "yellow-to-purple", + "gradient": "linear-gradient(160deg, var(--wp--preset--color--yellow), var(--wp--preset--color--purple))", + "name": "Yellow to Purple" + }, + { + "slug": "green-to-yellow", + "gradient": "linear-gradient(160deg, var(--wp--preset--color--green), var(--wp--preset--color--yellow))", + "name": "Green to Yellow" + }, + { + "slug": "yellow-to-green", + "gradient": "linear-gradient(160deg, var(--wp--preset--color--yellow), var(--wp--preset--color--green))", + "name": "Yellow to Green" + }, + { + "slug": "red-to-yellow", + "gradient": "linear-gradient(160deg, var(--wp--preset--color--red), var(--wp--preset--color--yellow))", + "name": "Red to Yellow" + }, + { + "slug": "yellow-to-red", + "gradient": "linear-gradient(160deg, var(--wp--preset--color--yellow), var(--wp--preset--color--red))", + "name": "Yellow to Red" + }, + { + "slug": "purple-to-red", + "gradient": "linear-gradient(160deg, var(--wp--preset--color--purple), var(--wp--preset--color--red))", + "name": "Purple to Red" + }, + { + "slug": "red-to-purple", + "gradient": "linear-gradient(160deg, var(--wp--preset--color--red), var(--wp--preset--color--purple))", + "name": "Red to Purple" + } + ] + }, + "duotone": [ + { + "name": "Dark grayscale", + "colors": [ + "#000000", + "#7f7f7f" + ], + "slug": "dark-grayscale" + }, + { + "name": "Grayscale", + "colors": [ + "#000000", + "#ffffff" + ], + "slug": "grayscale" + }, + { + "name": "Purple and yellow", + "colors": [ + "#8c00b7", + "#fcff41" + ], + "slug": "purple-yellow" + }, + { + "name": "Blue and red", + "colors": [ + "#000097", + "#ff4747" + ], + "slug": "blue-red" + }, + { + "name": "Midnight", + "colors": [ + "#000000", + "#00a5ff" + ], + "slug": "midnight" + }, + { + "name": "Magenta and yellow", + "colors": [ + "#c7005a", + "#fff278" + ], + "slug": "magenta-yellow" + }, + { + "name": "Purple and green", + "colors": [ + "#a60072", + "#67ff66" + ], + "slug": "purple-green" + }, + { + "name": "Blue and orange", + "colors": [ + "#1900d8", + "#ffa96b" + ], + "slug": "blue-orange" + } + ], + "link": true + }, + "typography": { + "dropCap": true, + "customFontStyle": true, + "customFontWeight": true, + "customTextTransforms": true, + "customTextDecorations": true, + "customLetterSpacing": true, + "fontSizes": { + "core": [ + { + "name": "Small", + "slug": "small", + "size": "13px" + }, + { + "name": "Normal", + "slug": "normal", + "size": "16px" + }, + { + "name": "Medium", + "slug": "medium", + "size": "20px" + }, + { + "name": "Large", + "slug": "large", + "size": "36px" + }, + { + "name": "Huge", + "slug": "huge", + "size": "42px" + } + ], + "theme": [ + { + "slug": "extra-small", + "size": "16px", + "name": "Extra small" + }, + { + "slug": "small", + "size": "18px", + "name": "Small" + }, + { + "slug": "normal", + "size": "20px", + "name": "Normal" + }, + { + "slug": "large", + "size": "24px", + "name": "Large" + }, + { + "slug": "extra-large", + "size": "40px", + "name": "Extra large" + }, + { + "slug": "huge", + "size": "96px", + "name": "Huge" + }, + { + "slug": "gigantic", + "size": "144px", + "name": "Gigantic" + } + ] + }, + "fontFamilies": { + "theme": [ + { + "fontFamily": "-apple-system,BlinkMacSystemFont,\"Segoe UI\",Roboto,Oxygen-Sans,Ubuntu,Cantarell,\"Helvetica Neue\",sans-serif", + "slug": "system-font", + "name": "System Font" + }, + { + "fontFamily": "Helvetica Neue, Helvetica, Arial, sans-serif", + "slug": "helvetica-arial" + }, + { + "fontFamily": "Geneva, Tahoma, Verdana, sans-serif", + "slug": "geneva-verdana" + }, + { + "fontFamily": "Cambria, Georgia, serif", + "slug": "cambria-georgia" + }, + { + "fontFamily": "Hoefler Text, Baskerville Old Face, Garamond, Times New Roman, serif", + "slug": "hoefler-times-new-roman" + } + ] + } + }, + "spacing": { + "customMargin": false + }, + "border": { + "customColor": true, + "customRadius": true, + "customStyle": true, + "customWidth": true + }, + "blocks": { + "core/button": { + "border": { + "customRadius": true + } + } + }, + "layout": { + "contentSize": "610px", + "wideSize": "1240px" + }, + "custom": { + "font-primary": "-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif", + "line-height": { + "body": 1.7, + "heading": 1.3, + "page-title": 1.1 + }, + "spacing": { + "unit": "20px", + "horizontal": "25px", + "vertical": "30px" + }, + "font-weight": { + "light": "300", + "normal": "normal" + } + } + }, + "colors": [ + { + "slug": "black", + "color": "#000000", + "name": "Black" + }, + { + "slug": "dark-gray", + "color": "#28303D", + "name": "Dark Gray" + }, + { + "slug": "gray", + "color": "#39414D", + "name": "Gray" + }, + { + "slug": "green", + "color": "#D1E4DD", + "name": "Green" + }, + { + "slug": "blue", + "color": "#D1DFE4", + "name": "Blue" + }, + { + "slug": "purple", + "color": "#D1D1E4", + "name": "Purple" + }, + { + "slug": "red", + "color": "#E4D1D1", + "name": "Red" + }, + { + "slug": "orange", + "color": "#E4DAD1", + "name": "Orange" + }, + { + "slug": "yellow", + "color": "#EEEADD", + "name": "Yellow" + }, + { + "slug": "white", + "color": "#FFFFFF", + "name": "White" + } + ], + "gradients": [ + { + "slug": "purple-to-yellow", + "gradient": "linear-gradient(160deg, var(--wp--preset--color--purple), var(--wp--preset--color--yellow))", + "name": "Purple to Yellow" + }, + { + "slug": "yellow-to-purple", + "gradient": "linear-gradient(160deg, var(--wp--preset--color--yellow), var(--wp--preset--color--purple))", + "name": "Yellow to Purple" + }, + { + "slug": "green-to-yellow", + "gradient": "linear-gradient(160deg, var(--wp--preset--color--green), var(--wp--preset--color--yellow))", + "name": "Green to Yellow" + }, + { + "slug": "yellow-to-green", + "gradient": "linear-gradient(160deg, var(--wp--preset--color--yellow), var(--wp--preset--color--green))", + "name": "Yellow to Green" + }, + { + "slug": "red-to-yellow", + "gradient": "linear-gradient(160deg, var(--wp--preset--color--red), var(--wp--preset--color--yellow))", + "name": "Red to Yellow" + }, + { + "slug": "yellow-to-red", + "gradient": "linear-gradient(160deg, var(--wp--preset--color--yellow), var(--wp--preset--color--red))", + "name": "Yellow to Red" + }, + { + "slug": "purple-to-red", + "gradient": "linear-gradient(160deg, var(--wp--preset--color--purple), var(--wp--preset--color--red))", + "name": "Purple to Red" + }, + { + "slug": "red-to-purple", + "gradient": "linear-gradient(160deg, var(--wp--preset--color--red), var(--wp--preset--color--purple))", + "name": "Red to Purple" + } + ], + "fontSizes": [ + { + "slug": "extra-small", + "size": "16px", + "name": "Extra small" + }, + { + "slug": "small", + "size": "18px", + "name": "Small" + }, + { + "slug": "normal", + "size": "20px", + "name": "Normal" + }, + { + "slug": "large", + "size": "24px", + "name": "Large" + }, + { + "slug": "extra-large", + "size": "40px", + "name": "Extra large" + }, + { + "slug": "huge", + "size": "96px", + "name": "Huge" + }, + { + "slug": "gigantic", + "size": "144px", + "name": "Gigantic" + } + ] +}