Skip to content

Commit

Permalink
Remove more leftovers
Browse files Browse the repository at this point in the history
  • Loading branch information
youknowriad committed Jul 9, 2024
1 parent 134a682 commit 259bc6d
Show file tree
Hide file tree
Showing 13 changed files with 3 additions and 57 deletions.
1 change: 0 additions & 1 deletion packages/block-editor/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -780,7 +780,6 @@ _Properties_
- _\_\_experimentalBlockDirectory_ `boolean`: Whether the user has enabled the Block Directory
- _\_\_experimentalBlockPatterns_ `Array`: Array of objects representing the block patterns
- _\_\_experimentalBlockPatternCategories_ `Array`: Array of objects representing the block pattern categories
- _\_\_unstableGalleryWithImageBlocks_ `boolean`: Whether the user has enabled the refactored gallery block which uses InnerBlocks

### SkipToSelectedBlock

Expand Down
2 changes: 0 additions & 2 deletions packages/block-editor/src/store/defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ export const PREFERENCES_DEFAULTS = {
* @property {boolean} __experimentalBlockDirectory Whether the user has enabled the Block Directory
* @property {Array} __experimentalBlockPatterns Array of objects representing the block patterns
* @property {Array} __experimentalBlockPatternCategories Array of objects representing the block pattern categories
* @property {boolean} __unstableGalleryWithImageBlocks Whether the user has enabled the refactored gallery block which uses InnerBlocks
*/
export const SETTINGS_DEFAULTS = {
alignWide: false,
Expand Down Expand Up @@ -168,7 +167,6 @@ export const SETTINGS_DEFAULTS = {
__mobileEnablePageTemplates: false,
__experimentalBlockPatterns: [],
__experimentalBlockPatternCategories: [],
__unstableGalleryWithImageBlocks: false,
__unstableIsPreviewMode: false,

// These settings will be completely revamped in the future.
Expand Down
3 changes: 0 additions & 3 deletions packages/block-editor/src/store/defaults.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ const SETTINGS_DEFAULTS = {
...SETTINGS,
// Don't add the default font sizes for standard themes
fontSizes: undefined,
// FOR TESTING ONLY - Later, this will come from a REST API
// eslint-disable-next-line no-undef
__unstableGalleryWithImageBlocks: __DEV__,
alignWide: true,
supportsLayout: false,
__experimentalFeatures: {
Expand Down
5 changes: 0 additions & 5 deletions packages/edit-post/src/editor.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,6 @@ class Editor extends Component {
constructor( props ) {
super( ...arguments );

// need to set this globally to avoid race with deprecations
// defaulting to true to avoid issues with a not-yet-cached value
const { galleryWithImageBlocks = true } = props;
window.wp.galleryBlockV2Enabled = galleryWithImageBlocks;

if ( props.initialHtmlModeEnabled && props.mode === 'visual' ) {
// Enable html mode if the initial mode the parent wants it but we're not already in it.
this.props.switchEditorMode( 'text' );
Expand Down
14 changes: 3 additions & 11 deletions packages/editor/src/components/provider/index.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,17 +171,9 @@ class NativeEditorProvider extends Component {
);

this.subscriptionParentUpdateEditorSettings =
subscribeUpdateEditorSettings(
( { galleryWithImageBlocks, ...editorSettings } ) => {
if ( typeof galleryWithImageBlocks === 'boolean' ) {
window.wp.galleryBlockV2Enabled =
galleryWithImageBlocks;
}
updateEditorSettings(
this.getThemeColors( editorSettings )
);
}
);
subscribeUpdateEditorSettings( ( { ...editorSettings } ) => {
updateEditorSettings( this.getThemeColors( editorSettings ) );
} );

this.subscriptionParentUpdateCapabilities = subscribeUpdateCapabilities(
( payload ) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ const BLOCK_EDITOR_SETTINGS = [
'__experimentalDiscussionSettings',
'__experimentalFeatures',
'__experimentalGlobalStylesBaseStyles',
'__unstableGalleryWithImageBlocks',
'alignWide',
'blockInspectorTabs',
'allowedMimeTypes',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ public class RNReactNativeGutenbergBridgeModule extends ReactContextBaseJavaModu
private static final String MAP_KEY_THEME_UPDATE_GRADIENTS = "gradients";
private static final String MAP_KEY_THEME_UPDATE_RAW_STYLES = "rawStyles";
private static final String MAP_KEY_THEME_UPDATE_RAW_FEATURES = "rawFeatures";
private static final String MAP_KEY_GALLERY_WITH_IMAGE_BLOCKS = "galleryWithImageBlocks";
public static final String MAP_KEY_MEDIA_FINAL_SAVE_RESULT_SUCCESS_VALUE = "success";

private static final String MAP_KEY_IS_PREFERRED_COLOR_SCHEME_DARK = "isPreferredColorSchemeDark";
Expand Down Expand Up @@ -174,13 +173,6 @@ public void updateTheme(@Nullable Bundle editorTheme) {
Serializable rawStyles = editorTheme.getSerializable(MAP_KEY_THEME_UPDATE_RAW_STYLES);
Serializable rawFeatures = editorTheme.getSerializable(MAP_KEY_THEME_UPDATE_RAW_FEATURES);

// We must assign null here to distinguish between a missing value and false
Boolean galleryWithImageBlocks = null;
if (editorTheme.containsKey(MAP_KEY_GALLERY_WITH_IMAGE_BLOCKS)) {
galleryWithImageBlocks = editorTheme.getBoolean(MAP_KEY_GALLERY_WITH_IMAGE_BLOCKS);
}


if (colors != null) {
writableMap.putArray(MAP_KEY_THEME_UPDATE_COLORS, Arguments.fromList((ArrayList)colors));
}
Expand All @@ -197,10 +189,6 @@ public void updateTheme(@Nullable Bundle editorTheme) {
writableMap.putString(MAP_KEY_THEME_UPDATE_RAW_FEATURES, rawFeatures.toString());
}

if (galleryWithImageBlocks != null) {
writableMap.putBoolean(MAP_KEY_GALLERY_WITH_IMAGE_BLOCKS, galleryWithImageBlocks);
}

emitToJS(EVENT_NAME_UPDATE_EDITOR_SETTINGS, writableMap);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ data class GutenbergProps @JvmOverloads constructor(
private const val PROP_COLORS = "colors"
private const val PROP_GRADIENTS = "gradients"
private const val PROP_IS_FSE_THEME = "isFSETheme"
private const val PROP_GALLERY_WITH_IMAGE_BLOCKS = "galleryWithImageBlocks"
private const val PROP_QUOTE_BLOCK_V2 = "quoteBlockV2"
private const val PROP_LIST_BLOCK_V2 = "listBlockV2"

Expand Down
4 changes: 0 additions & 4 deletions packages/react-native-bridge/ios/Gutenberg.swift
Original file line number Diff line number Diff line change
Expand Up @@ -230,10 +230,6 @@ public class Gutenberg: UIResponder {
private func properties(from editorSettings: GutenbergEditorSettings?) -> [String : Any] {
var settingsUpdates = [String : Any]()
settingsUpdates["isFSETheme"] = editorSettings?.isFSETheme ?? false

if let galleryWithImageBlocks = editorSettings?.galleryWithImageBlocks {
settingsUpdates["galleryWithImageBlocks"] = galleryWithImageBlocks
}

if let quoteBlockV2 = editorSettings?.quoteBlockV2 {
settingsUpdates["quoteBlockV2"] = quoteBlockV2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ public extension GutenbergBridgeDataSource {

public protocol GutenbergEditorSettings {
var isFSETheme: Bool { get }
var galleryWithImageBlocks: Bool { get }
var quoteBlockV2: Bool { get }
var listBlockV2: Bool { get }
var rawStyles: String? { get }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,6 @@ extension GutenbergViewController: GutenbergWebDelegate {
extension GutenbergViewController: GutenbergBridgeDataSource {
class EditorSettings: GutenbergEditorSettings {
var isFSETheme: Bool = true
var galleryWithImageBlocks: Bool = true
var quoteBlockV2: Bool = true
var listBlockV2: Bool = true
var rawStyles: String? = nil
Expand Down
2 changes: 0 additions & 2 deletions packages/react-native-editor/src/setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ const setupInitHooks = () => {
featuredImageId,
rawStyles,
rawFeatures,
galleryWithImageBlocks,
locale,
} = props;

Expand All @@ -94,7 +93,6 @@ const setupInitHooks = () => {
capabilities,
rawStyles,
rawFeatures,
galleryWithImageBlocks,
locale,
};
}
Expand Down
13 changes: 0 additions & 13 deletions test/unit/config/global-mocks.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,6 @@ jest.mock( 'client-zip', () => ( {
downloadZip: jest.fn(),
} ) );

/**
* The new gallery block format is not compatible with the use_BalanceTags option
* so a flag is set in lib/compat.php to allow disabling the new block in this instance.
* This flag needs to be mocked here to ensure tests and fixtures run with the v2
* version of the Gallery block enabled.
*
* Note: This should be removed when the minimum required WP version is >= 5.9.
*
*/
if ( ! window.wp?.galleryBlockV2Enabled ) {
window.wp = { ...window.wp, galleryBlockV2Enabled: true };
}

global.ResizeObserver = require( 'resize-observer-polyfill' );

/**
Expand Down

0 comments on commit 259bc6d

Please sign in to comment.