// Using an allow list
// If you want to disable all blocks except an allow list, you can adapt the script above like so:
//
// 1
// 2
// 3
// 4
// 5
// 6
// 7
// 8
// 9
// 10
// 11
// 12
// 13
// 14
// // my-plugin.js

var allowedBlocks = [
    'core/paragraph',
    'core/image',
    'core/html',
    'core/freeform',
];

wp.blocks.getBlockTypes().forEach( function ( blockType ) {
    if ( allowedBlocks.indexOf( blockType.name ) === -1 ) {
        wp.blocks.unregisterBlockType( blockType.name );
    }
} );
//Collapse full source code


( function ( blocks, element, blockEditor ) {
    var el = element.createElement;
    var InnerBlocks = blockEditor.InnerBlocks;
    var useBlockProps = blockEditor.useBlockProps;

    blocks.registerBlockType( 'stepfox/supermenu', {
        title: 'Submenu Group',
        category: 'design',
supports: {
            spacing: {
                margin: true,
                padding: true,
                blockGap: true,
                __experimentalDefaultControls: {
                //__experimentalDimensions:true,
                    margin: true,
                    padding: true,
                    blockGap: true,
                }
            },
            align: ['left', 'right', 'full', 'wide', 'center'],
            color: {
                background: true,
                gradients: true,
                link: true,
                text: true,
                //__experimentalSkipSerialization : true

            },

   typography:{
fontSize:true,
lineHeight: true,
__experimentalFontFamily: true,
__experimentalFontWeight: true,
__experimentalFontStyle: true,
__experimentalTextTransform: true,
__experimentalLetterSpacing: true,
__experimentalTextDecoration: true

   },

  __experimentalBorder:{
color : true,
radius : true,
style : true,
width : true
  },
   //    '__experimentalBorder'=> array(
//      'color' =>true,
//      'radius' => true,
//      'style' =>true,
//      'width' => true
//    ),
//"typography" => array(
//			"fontSize"=> true,
//			"lineHeight"=> true,
//			"__experimentalFontFamily"=> true,
//			"__experimentalFontWeight"=> true,
//			"__experimentalFontStyle"=> true,
//			"__experimentalTextTransform"=> true,
//			"__experimentalLetterSpacing"=> true,
//			"__experimentalDefaultControls"=> array(
//				"fontSize"=> true,
//				"fontAppearance"=> true,
//				"textTransform"=> true
//			)
//		)

//             __experimentalBorder: {
//                 color: true,
//                 radius: true,
//                 style: true,
//                 width: true
//             },
//             __experimentalSelector: '.wp-block > div > .stepfox_looper',
//
            __experimentalLayout: {
                allowSwitching: true,
                allowInheriting: true,
                default: {
                    type: 'flex'
                }
            },
    __experimentalExposeControlsToChildren: true,
             // align: true,
// //            multiple: true,
// //            html: false,
            alignWide: true,
// //            anchor: true,
// //            customClassName: false,

        },
        parent:["core\/navigation", "core\/navigation-submenu"],

        edit: function () {
            var blockProps = useBlockProps();

            return el( 'div', blockProps, el( InnerBlocks ) );
        },

        save: function () {
            var blockProps = useBlockProps.save();

            return el( 'div', blockProps, el( InnerBlocks.Content ) );
        },
    } );
} )( window.wp.blocks, window.wp.element, window.wp.blockEditor );