Plugin Directory

Changeset 2586331


Ignore:
Timestamp:
08/21/2021 10:12:21 AM (5 years ago)
Author:
Desertsnowman
Message:

Update v2.0.2 - fixed a read error added multisite support.

Location:
plugin-groups/trunk
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • plugin-groups/trunk/classes/class-plugin-groups.php

    r2585989 r2586331  
    5353     * @var string
    5454     */
    55     public static $slug;
     55    public static $slug = 'plugin-groups';
    5656
    5757    /**
     
    9696
    9797        require_once ABSPATH . 'wp-admin/includes/plugin.php';
    98         $plugin            = get_file_data( PLGGRP_CORE, array( 'Plugin Name', 'Version', 'Text Domain' ), 'plugin' );
    99         $this->plugin_name = array_shift( $plugin );
    100         $this->version     = array_shift( $plugin );
    101         self::$slug        = array_shift( $plugin );
     98        $plugin            = get_plugin_data( PLGGRP_CORE );
     99        $this->plugin_name = $plugin['Name'];
     100        $this->version     = $plugin['Version'];
     101
    102102        spl_autoload_register( array( $this, 'autoload_class' ), true, false );
    103103
     
    116116        add_action( 'admin_init', array( $this, 'admin_init' ) );
    117117        add_action( 'admin_menu', array( $this, 'admin_menu' ) );
     118        add_action( 'network_admin_menu', array( $this, 'admin_menu' ) );
    118119        add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_assets' ) );
    119120        add_action( 'rest_api_init', array( $this, 'register_routes' ) );
    120121        add_filter( 'views_plugins', array( $this, 'add_groups' ), PHP_INT_MAX );
    121         add_filter( 'views_plugins-network', array( $this, 'add_groups' ) );
     122        add_filter( 'views_plugins-network', array( $this, 'add_groups' ), PHP_INT_MAX );
    122123        add_filter( 'all_plugins', array( $this, 'catch_selected_group' ) );
    123124        add_filter( 'show_advanced_plugins', array( $this, 'filter_shown_status' ), 10, 2 );
     
    205206    }
    206207
     208    /**
     209     * Add dropdown navigation on bulk actions.
     210     *
     211     * @param array $actions Unchanged actions.
     212     *
     213     * @return array
     214     */
    207215    public function bulk_actions( $actions ) {
    208216
     
    406414         * @return  array
    407415         */
    408         $presets                       = apply_filters( 'get_preset_plugin_groups', $groups );
    409         $this->config['preset_groups'] = array();
     416        $presets       = apply_filters( 'get_preset_plugin_groups', $groups );
     417        $preset_groups = array();
    410418        foreach ( $presets as $name => $keywords ) {
    411             $id                                   = sanitize_title( $name );
    412             $this->config['preset_groups'][ $id ] = array(
     419            $id                   = sanitize_title( $name );
     420            $preset_groups[ $id ] = array(
    413421                'id'       => $id,
    414422                'name'     => $name,
     
    418426        }
    419427
    420         return array_keys( $groups );
     428        return array(
     429            'preset_groups' => $preset_groups,
     430            'presets'       => array_keys( $groups ),
     431        );
    421432    }
    422433
     
    466477        if ( true === $this->config['params']['legacyGrouping'] ) {
    467478            foreach ( $this->groups as $key => $plugins ) {
    468                 if ( isset( $views[ $key ] ) ) {
    469                     $views[ $key ] = $this->make_group_tag( $key );
    470                 }
     479                $views[ $key ] = $this->make_group_tag( $key );
    471480            }
    472481        }
     
    499508                'methods'             => \WP_REST_Server::CREATABLE,
    500509                'args'                => array(),
    501                 'callback'            => array( $this, 'save_config' ),
    502                 'permission_callback' => function() {
    503 
    504                     return current_user_can( 'manage_options' );
     510                'callback'            => array( $this, 'rest_save_config' ),
     511                'permission_callback' => function( \WP_REST_Request $request ) {
     512
     513                    if ( is_multisite() ) {
     514                        $data = $request->get_json_params();
     515                        $can  = current_user_can_for_blog( $data['siteID'], 'manage_options' );
     516                    } else {
     517                        $can = current_user_can( 'manage_options' );
     518                    }
     519
     520                    return $can;
    505521                },
    506522            )
    507523        );
     524
     525        register_rest_route(
     526            self::$slug,
     527            'load',
     528            array(
     529                'methods'             => \WP_REST_Server::READABLE,
     530                'args'                => array(),
     531                'callback'            => array( $this, 'rest_load_config' ),
     532                'permission_callback' => function( \WP_REST_Request $request ) {
     533
     534                    $id = $request->get_param( 'siteID' );
     535
     536                    return current_user_can_for_blog( $id, 'manage_options' );
     537                },
     538            )
     539        );
     540    }
     541
     542    /**
     543     * Load a config for a specific site.
     544     *
     545     * @param \WP_REST_Request $request
     546     *
     547     * @return \WP_Error|\WP_HTTP_Response|\WP_REST_Response
     548     */
     549    public function rest_load_config( \WP_REST_Request $request ) {
     550
     551        $id   = $request->get_param( 'siteID' );
     552        $json = $this->build_config_object( $id );
     553
     554        return rest_ensure_response( json_decode( $json ) );
    508555    }
    509556
     
    515562     * @return \WP_Error|\WP_HTTP_Response|\WP_REST_Response
    516563     */
    517     public function save_config( \WP_REST_Request $request ) {
    518 
    519         $data                            = $request->get_json_params();
    520         $this->config['groups']          = $data['groups'];
    521         $this->config['selectedPresets'] = $data['selectedPresets'];
    522         $this->config['params']          = $data['params'];
    523         $success                         = update_option( self::CONFIG_KEY, $this->config );
     564    public function rest_save_config( \WP_REST_Request $request ) {
     565
     566        $data         = $request->get_json_params();
     567        $this->config = wp_parse_args( $data, $this->config );
     568        if ( is_multisite() ) {
     569            $site_id = get_current_blog_id();
     570            if ( ! empty( $data['siteID'] ) ) {
     571                $site_id = $data['siteID'];
     572                unset( $data['siteID'] );
     573            }
     574            if ( ! empty( $data['sitesEnabled'] ) ) {
     575                // Ensure we have the same types.
     576                $data['sitesEnabled'] = array_map( 'intval', $data['sitesEnabled'] );
     577            }
     578            $success = update_network_option( $site_id, self::CONFIG_KEY, $this->config );
     579        } else {
     580            $success = update_option( self::CONFIG_KEY, $this->config );
     581        }
    524582
    525583        return rest_ensure_response( array( 'success' => $success ) );
     
    619677        $config                             = $this->get_default_config();
    620678        $config['groups']                   = $groups;
    621         $config['selectedPresets']          = $data['presets'];
     679        $config['selectedPresets']          = isset( $data['presets'] ) ? $data['presets'] : array();
    622680        $config['params']['legacyGrouping'] = true;
    623681        $config['params']['navStyle']       = 'subsubsub';
     
    635693
    636694        // Load config.
    637         $this->load_config();
     695        $this->set_config();
    638696
    639697        /**
     
    667725    public function admin_menu() {
    668726
    669         add_submenu_page( 'plugins.php', __( 'Plugin Groups', self::$slug ), __( 'Plugin Groups', self::$slug ), 'manage_options', 'plugin-groups', array( $this, 'render_admin' ), 50 );
     727        if ( ! $this->network_active() || $this->site_enabled() || is_main_site() ) {
     728            add_submenu_page( 'plugins.php', __( 'Plugin Groups', self::$slug ), __( 'Plugin Groups', self::$slug ), 'manage_options', 'plugin-groups', array( $this, 'render_admin' ), 50 );
     729        }
     730    }
     731
     732    /**
     733     * Check if the plugin is network activated.
     734     *
     735     * @return bool
     736     */
     737    protected function network_active() {
     738
     739        return is_plugin_active_for_network( PLGGRP_SLUG );
     740    }
     741
     742    /**
     743     * Check to see if the site is allowed to use this.
     744     *
     745     * @return bool
     746     */
     747    protected function site_enabled() {
     748
     749        $site_id     = get_current_blog_id();
     750        $main_config = get_network_option( get_main_site_id(), self::CONFIG_KEY, $this->get_default_config() );
     751
     752        return in_array( $site_id, $main_config['sitesEnabled'], true );
    670753    }
    671754
     
    726809    protected function prep_config() {
    727810
     811        $data = $this->build_config_object();
     812
     813        // Add config data.
     814        wp_add_inline_script( self::$slug, 'var plgData = ' . $data, 'before' );
     815    }
     816
     817    /**
     818     * Build the json config object.
     819     *
     820     * @param int|null $site_id The site to get config for, ir null for current.
     821     *
     822     * @return string
     823     */
     824    protected function build_config_object( $site_id = null ) {
     825
     826        if ( null === $site_id ) {
     827            $data = $this->config;
     828        } else {
     829            $data = $this->load_config( $site_id );
     830        }
    728831        // Prep config data.
    729         $data              = $this->config;
    730832        $data['saveURL']   = rest_url( self::$slug . '/save' );
    731833        $data['legacyURL'] = add_query_arg( 'reactivate-legacy', true, $this->get_nav_url( 'dashboard' ) );
    732834        $data['restNonce'] = wp_create_nonce( 'wp_rest' );
     835        // Multisite.
     836        if ( $this->network_active() && ( is_network_admin() || defined( 'REST_REQUEST' ) && true === REST_REQUEST ) ) {
     837            $data['loadURL']  = rest_url( self::$slug . '/load' );
     838            $data['sites']    = get_sites();
     839            $data['mainSite'] = get_main_site_id();
     840            if ( ! in_array( $data['mainSite'], $data['sitesEnabled'], true ) ) {
     841                $data['sitesEnabled'][] = get_main_site_id();
     842            }
     843        }
    733844
    734845        // Add plugins.
     
    736847
    737848        // Remove presets from groups for admin.
    738         $data['groups'] = array_diff_key( $data['groups'], $this->config['preset_groups'] );
    739 
    740         // Remove empty groups to allow JS to init them.
    741         if ( empty( $data['groups'] ) ) {
    742             unset( $data['groups'] );
    743         }
    744 
    745         // Add config data.
    746         wp_add_inline_script( self::$slug, 'var plgData = ' . wp_json_encode( $data ), 'before' );
     849        $data['groups'] = array_diff_key( $data['groups'], $data['preset_groups'] );
     850
     851        return wp_json_encode( $data );
    747852    }
    748853
     
    762867                'menuGroups'     => false,
    763868            ),
     869
     870            'sitesEnabled' => array(), // Used for multisite.
    764871        );
    765872    }
     
    767874    /**
    768875     * Load the UI config.
    769      */
    770     protected function load_config() {
     876     *
     877     * @param int|null $site_id The site ID to load. Null for current site.
     878     *
     879     * @return array;
     880     */
     881    protected function load_config( $site_id = null ) {
    771882
    772883        // Load the config.
    773         $this->config               = get_option( self::CONFIG_KEY, $this->get_default_config() );
    774         $this->config['pluginName'] = $this->plugin_name;
    775         $this->config['version']    = $this->version;
    776         $this->config['slug']       = self::$slug;
     884        if ( is_multisite() ) {
     885            if ( ! $site_id ) {
     886                $site_id = get_current_blog_id();
     887            }
     888            $config           = get_network_option( $site_id, self::CONFIG_KEY, $this->get_default_config() );
     889            $config['siteID'] = (int) $site_id;
     890        } else {
     891            $config = get_option( self::CONFIG_KEY, $this->get_default_config() );
     892        }
     893        $config['pluginName'] = $this->plugin_name;
     894        $config['version']    = $this->version;
     895        $config['slug']       = self::$slug;
    777896
    778897        // Load the presets.
    779         $this->config['presets'] = $this->load_presets();
    780 
     898        $config += $this->load_presets();
     899
     900        return $config;
     901    }
     902
     903    /**
     904     * Set the config.
     905     *
     906     * @param int|null $site_id The site ID to load. Null for current site.
     907     */
     908    protected function set_config( $site_id = null ) {
     909
     910        $this->config = $this->load_config( $site_id );
    781911        // Populate groups with plugins.
    782912        array_map( array( $this, 'populate_plugins' ), $this->config['groups'] );
    783913        // register selected presets.
     914
    784915        if ( ! empty( $this->config['selectedPresets'] ) ) {
    785916            array_map( array( $this, 'register_preset' ), $this->config['selectedPresets'] );
  • plugin-groups/trunk/css/plugin-groups-navbar.css.map

    r2585994 r2586331  
    1 {"version":3,"sources":["webpack:///./src/css/navbar.scss","webpack:///./src/css/_variables.scss"],"names":[],"mappings":"AAIC;EACC;EACA;EACA;EACA;EACA;AAHF;AAKE;EACC;AAHH;AAME;EACC,sBCbW;EDcX;AAJH;AAOE;EACC;AALH;AASC;EACC;AAPF;AASE;EACC;EACA;AAPH;AAWC;EACC;EACA;EACA,uBClCY;EDmCZ,wBCnCY;EDoCZ,sBCpCY;EDqCZ;EACA;AATF;AAWE;EACC;EACA;AATH;AAWG;EACC;EACA;EACA;EACA,cC3Cc;ED4Cd;EACA;AATJ;AAWI;EACC,cC9Ca;ED+Cb;AATL;AAYI;EACC,cCpDkB;EDqDlB;AAVL;AAcG;EACC,cC3Dc;AD+ClB,C","file":"../css/plugin-groups-navbar.css","sourcesContent":["@import \"variables\";\n\n.plugin-groups {\n\n\t.nav-settings {\n\t\tcursor        : pointer;\n\t\tpadding       : 8px;\n\t\tmargin-bottom : 20px;\n\t\tmargin-top    : 8px;\n\t\toverflow      : hidden;\n\n\t\tlabel {\n\t\t\tfont-weight : bolder;\n\t\t}\n\n\t\t&.selected {\n\t\t\tbackground-color : $color_white;\n\t\t\tborder           : 1px solid $color_brand_green;\n\t\t}\n\n\t\tselect {\n\t\t\tmargin-top : 6px;\n\t\t}\n\t}\n\n\t.subsubsub {\n\t\tfloat : none;\n\n\t\tli:not(:last-child)::after {\n\t\t\tcontent : '|';\n\t\t\tpadding : 0 3px;\n\t\t}\n\t}\n\n\t.groups-modern {\n\t\tdisplay            : block;\n\t\tborder             : 1px solid $color_light_gray;\n\t\tborder-left-color  : $color_white;\n\t\tborder-right-color : $color_white;\n\t\tbackground-color   : $color_white;\n\t\tmargin             : 10px -20px;\n\t\tpadding            : 0 12px;\n\n\t\tli {\n\t\t\tdisplay : inline-block;\n\t\t\tmargin  : 0;\n\n\t\t\ta {\n\t\t\t\tdisplay         : inline-block;\n\t\t\t\tpadding         : 20px 0 15px;\n\t\t\t\tmargin          : 0 10px;\n\t\t\t\tcolor           : $color_blue_gray;\n\t\t\t\ttext-decoration : none;\n\t\t\t\tborder-bottom   : 5px solid transparent;\n\n\t\t\t\t&:hover {\n\t\t\t\t\tcolor         : $color_link_blue;\n\t\t\t\t\tborder-bottom : 5px solid $color_light_gray;\n\t\t\t\t}\n\n\t\t\t\t&.current {\n\t\t\t\t\tcolor         : $color_dark_blue_gray;\n\t\t\t\t\tborder-bottom : 5px solid $color_blue_gray;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t.count {\n\t\t\t\tcolor : $color_blue_gray;\n\t\t\t}\n\t\t}\n\t}\n}\n","$color_background: #C8CBBC;\n$color_brand_green: #74a008;\n$color_dark_green: #465f05;\n$color_white: #fff;\n$color_white_hover: rgba(255,255,255,0.4);\n$color_shadow: rgba(0,0,0,0.6);\n$color_shadow_light: rgba(0,0,0,0.4);\n$color_light_gray: rgb(208, 208, 208);\n$color_blue_gray: #646970;\n$color_dark_blue_gray: #1d2327;\n$color_link_blue: #135e96;\n"],"sourceRoot":""}
     1{"version":3,"sources":["webpack://///./src/css/navbar.scss","webpack://///./src/css/_variables.scss"],"names":[],"mappings":"AAIC;EACC;EACA;EACA;EACA;EACA;AAHF;AAKE;EACC;AAHH;AAME;EACC,sBCbW;EDcX;AAJH;AAOE;EACC;AALH;AASC;EACC;AAPF;AASE;EACC;EACA;AAPH;AAWC;EACC;EACA;EACA,uBClCY;EDmCZ,wBCnCY;EDoCZ,sBCpCY;EDqCZ;EACA;AATF;AAWE;EACC;EACA;AATH;AAWG;EACC;EACA;EACA;EACA,cC3Cc;ED4Cd;EACA;AATJ;AAWI;EACC,cC9Ca;ED+Cb;AATL;AAYI;EACC,cCpDkB;EDqDlB;AAVL;AAcG;EACC,cC3Dc;AD+ClB,C","file":"../css/plugin-groups-navbar.css","sourcesContent":["@import \"variables\";\n\n.plugin-groups {\n\n\t.nav-settings {\n\t\tcursor        : pointer;\n\t\tpadding       : 8px;\n\t\tmargin-bottom : 20px;\n\t\tmargin-top    : 8px;\n\t\toverflow      : hidden;\n\n\t\tlabel {\n\t\t\tfont-weight : bolder;\n\t\t}\n\n\t\t&.selected {\n\t\t\tbackground-color : $color_white;\n\t\t\tborder           : 1px solid $color_brand_green;\n\t\t}\n\n\t\tselect {\n\t\t\tmargin-top : 6px;\n\t\t}\n\t}\n\n\t.subsubsub {\n\t\tfloat : none;\n\n\t\tli:not(:last-child)::after {\n\t\t\tcontent : '|';\n\t\t\tpadding : 0 3px;\n\t\t}\n\t}\n\n\t.groups-modern {\n\t\tdisplay            : block;\n\t\tborder             : 1px solid $color_light_gray;\n\t\tborder-left-color  : $color_white;\n\t\tborder-right-color : $color_white;\n\t\tbackground-color   : $color_white;\n\t\tmargin             : 10px -20px;\n\t\tpadding            : 0 12px;\n\n\t\tli {\n\t\t\tdisplay : inline-block;\n\t\t\tmargin  : 0;\n\n\t\t\ta {\n\t\t\t\tdisplay         : inline-block;\n\t\t\t\tpadding         : 20px 0 15px;\n\t\t\t\tmargin          : 0 10px;\n\t\t\t\tcolor           : $color_blue_gray;\n\t\t\t\ttext-decoration : none;\n\t\t\t\tborder-bottom   : 5px solid transparent;\n\n\t\t\t\t&:hover {\n\t\t\t\t\tcolor         : $color_link_blue;\n\t\t\t\t\tborder-bottom : 5px solid $color_light_gray;\n\t\t\t\t}\n\n\t\t\t\t&.current {\n\t\t\t\t\tcolor         : $color_dark_blue_gray;\n\t\t\t\t\tborder-bottom : 5px solid $color_blue_gray;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t.count {\n\t\t\t\tcolor : $color_blue_gray;\n\t\t\t}\n\t\t}\n\t}\n}\n","$color_background: #C8CBBC;\n$color_brand_green: #74a008;\n$color_dark_green: #465f05;\n$color_white: #fff;\n$color_white_hover: rgba(255,255,255,0.4);\n$color_shadow: rgba(0,0,0,0.6);\n$color_shadow_light: rgba(0,0,0,0.4);\n$color_light_gray: rgb(208, 208, 208);\n$color_blue_gray: #646970;\n$color_dark_blue_gray: #1d2327;\n$color_link_blue: #135e96;\n"],"sourceRoot":""}
  • plugin-groups/trunk/css/plugin-groups.css

    r2585975 r2586331  
    1 .plugin-groups-main>.plugin-groups{margin-left:-20px}.ui-keyword{border:1px solid #d0d0d0;border-radius:7px;margin:6px 6px 6px 0;padding:3px 6px;display:inline-flex;flex-direction:row;justify-content:space-between}.ui-keyword label{margin-left:3px}.ui-header{display:flex;align-items:center;padding-left:20px;background-color:#74a008;box-shadow:0 1px 1px rgba(0,0,0,.4)}.ui-header h2{margin:0;padding:1em 1em 1em 0;color:#fff;text-shadow:0 1px 1px rgba(0,0,0,.6)}.ui-header-version{font-size:.8em;color:#fff}.ui-header .button{background-color:#465f05;border-color:#74a008;box-shadow:none;margin-left:20px}.ui-header .button:focus{opacity:.4}.ui-header .button input[type=file]{width:0}.ui-navigation{display:flex;background-color:#465f05;margin:0 0 20px;color:#fff;cursor:pointer}.ui-navigation-link{padding:8px 20px;margin:0}.ui-navigation-link:hover,.ui-navigation-link.active{background-color:#74a008}.ui-body{display:flex}.ui-body-sidebar{width:400px;overflow-x:hidden;padding:0 20px 20px}.ui-body-sidebar .search{width:100%;margin:6px 0}.ui-body-sidebar .button{display:flex;align-items:center;justify-content:space-between}.ui-body-sidebar .button .dashicons{margin:0 4px 0 0}.ui-body-sidebar.wide{width:500px;max-width:500px}.ui-body-sidebar.full{width:auto;max-width:100%}.ui-body-sidebar.narrow{width:200px;min-width:200px}.ui-body-sidebar h3{margin:0 0 10px}.plugins-list .ui-body-sidebar-list{max-height:500px;overflow-y:auto}.ui-body-sidebar-list-item{margin-bottom:0;border:1px solid transparent;border-bottom-color:#d0d0d0;margin-top:-1px;overflow-x:hidden;text-overflow:ellipsis;white-space:nowrap;display:flex;justify-content:space-between;padding:.6em 8px}.ui-body-sidebar-list-item.list-control{align-items:center}.ui-body-sidebar-list-item.list-control label{font-weight:bolder}.ui-body-sidebar-list-item.active{background:#fff;border-color:#74a008}@media only screen and (max-width: 1380px){.plugins-list .ui-body-sidebar-list-item{flex-direction:column}.plugins-list .ui-body-sidebar-list-item .button{margin:8px 0}}.ui-body-sidebar-list-item:hover:not(.active){background-color:rgba(255,255,255,.4)}.ui-body-sidebar-list-item-title{cursor:pointer}.ui-body-sidebar-list-item-icons{cursor:pointer}.ui-body-sidebar-list-item-edit{border:1px solid #74a008;border-top:0;padding:10px 20px 20px;background:#fff}.ui-body-sidebar-list-item-section{margin-bottom:20px}.ui-body-edit{margin:0 20px;width:100%}.ui-body-edit h3{margin:0 0 10px}.ui-body-edit-title{border:1px transparent;margin-left:7px;font-size:inherit}.ui-body-edit-title:focus{box-shadow:0 0 0}.ui-body-edit-title:focus-visible{outline:0}.ui-body-edit-plugins{max-height:500px;overflow-y:auto}.ui-body-edit-plugins-item{display:flex;justify-content:space-between;padding:9px 8px 8px;border:1px solid #d0d0d0;margin-top:-1px}.ui-panel{margin-bottom:20px}.ui-panel-header{display:flex;justify-content:space-between;border-bottom:1px solid #74a008}.ui-panel-header.collapsible{cursor:pointer}.ui-panel-header h3{font-size:1rem}.ui-panel .ui-panel .ui-panel-header{padding:6px}.ui-panel .ui-panel .ui-panel-header h3{font-size:.8rem;margin:0}
     1.plugin-groups-main>.plugin-groups{margin-left:-20px}.ui-keyword{border:1px solid #d0d0d0;border-radius:7px;margin:6px 6px 6px 0;padding:3px 6px;display:inline-flex;flex-direction:row;justify-content:space-between}.ui-keyword label{margin-left:3px}.ui-header{display:flex;align-items:center;padding-left:20px;background-color:#74a008;box-shadow:0 1px 1px rgba(0,0,0,.4)}.ui-header h2{margin:0;padding:1em 1em 1em 0;color:#fff;text-shadow:0 1px 1px rgba(0,0,0,.6)}.ui-header-version{font-size:.8em;color:#fff}.ui-header-multisite{margin:0 8px 0 12px}.ui-header .button{background-color:#465f05;border-color:#74a008;box-shadow:none;margin-left:20px}.ui-header .button:focus{opacity:.4}.ui-header .button input[type=file]{width:0}.ui-navigation{display:flex;background-color:#465f05;margin:0 0 20px;color:#fff;cursor:pointer}.ui-navigation-link{padding:8px 20px;margin:0}.ui-navigation-link:hover,.ui-navigation-link.active{background-color:#74a008}.ui-body{display:flex}.ui-body .keywords-input{width:100%}.ui-body-sidebar{width:400px;overflow-x:hidden;padding:0 20px 20px}.ui-body-sidebar .search{width:100%;margin:6px 0}.ui-body-sidebar .button{display:flex;align-items:center;justify-content:space-between}.ui-body-sidebar .button .dashicons{margin:0 4px}.ui-body-sidebar.wide{width:500px;max-width:500px}.ui-body-sidebar.full{width:auto;max-width:100%}.ui-body-sidebar.narrow{width:200px;min-width:200px}.ui-body-sidebar h3{margin:0 0 10px}.plugins-list .ui-body-sidebar-list{max-height:500px;overflow-y:auto}.ui-body-sidebar-list-item{margin-bottom:0;border:1px solid transparent;border-bottom-color:#d0d0d0;margin-top:-1px;display:flex;justify-content:space-between;padding:.6em 8px}.ui-body-sidebar-list-item.list-control{align-items:center}.ui-body-sidebar-list-item.list-control label{font-weight:bolder}.ui-body-sidebar-list-item.active{background:#fff;border-color:#74a008}@media only screen and (max-width: 1150px){.ui-body-sidebar-list-item.list-control .button{margin:8px 0 12px}.ui-body-sidebar-list-item.list-control .button .text{display:none}.ui-body-sidebar-list-item.list-control label{overflow:auto}}.ui-body-sidebar-list-item:hover:not(.active){background-color:rgba(255,255,255,.4)}.ui-body-sidebar-list-item label,.ui-body-sidebar-list-item .version{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ui-body-sidebar-list-item .version{color:#646970}@media only screen and (max-width: 1150px){.ui-body-sidebar-list-item .version{display:none}}.ui-body-sidebar-list-item-title{cursor:pointer}.ui-body-sidebar-list-item-icons{cursor:pointer}.ui-body-sidebar-list-item-edit{border:1px solid #74a008;border-top:0;padding:10px 20px 20px;background:#fff}.ui-body-sidebar-list-item-section{margin-bottom:20px}.ui-body-edit{margin:0 20px;width:100%}.ui-body-edit h3{margin:0 0 10px}.ui-body-edit-title{border:1px transparent;margin-left:7px;font-size:inherit}.ui-body-edit-title:focus{box-shadow:0 0 0}.ui-body-edit-title:focus-visible{outline:0}.ui-body-edit-plugins{max-height:500px;overflow-y:auto}.ui-body-edit-plugins-item{display:flex;justify-content:space-between;padding:9px 8px 8px;border:1px solid #d0d0d0;margin-top:-1px}.ui-panel{margin-bottom:20px}.ui-panel-header{display:flex;justify-content:space-between;border-bottom:1px solid #74a008}.ui-panel-header.collapsible{cursor:pointer}.ui-panel-header h3{font-size:1rem}.ui-panel .ui-panel .ui-panel-header{padding:6px}.ui-panel .ui-panel .ui-panel-header h3{font-size:.8rem;margin:0}
    22.plugin-groups .nav-settings{cursor:pointer;padding:8px;margin-bottom:20px;margin-top:8px;overflow:hidden}.plugin-groups .nav-settings label{font-weight:bolder}.plugin-groups .nav-settings.selected{background-color:#fff;border:1px solid #74a008}.plugin-groups .nav-settings select{margin-top:6px}.plugin-groups .subsubsub{float:none}.plugin-groups .subsubsub li:not(:last-child)::after{content:"|";padding:0 3px}.plugin-groups .groups-modern{display:block;border:1px solid #d0d0d0;border-left-color:#fff;border-right-color:#fff;background-color:#fff;margin:10px -20px;padding:0 12px}.plugin-groups .groups-modern li{display:inline-block;margin:0}.plugin-groups .groups-modern li a{display:inline-block;padding:20px 0 15px;margin:0 10px;color:#646970;text-decoration:none;border-bottom:5px solid transparent}.plugin-groups .groups-modern li a:hover{color:#135e96;border-bottom:5px solid #d0d0d0}.plugin-groups .groups-modern li a.current{color:#1d2327;border-bottom:5px solid #646970}.plugin-groups .groups-modern li .count{color:#646970}
  • plugin-groups/trunk/css/plugin-groups.css.map

    r2585994 r2586331  
    1 {"version":3,"sources":["webpack:///./src/css/main.scss","webpack:///./src/css/_variables.scss","webpack:///./src/css/navbar.scss"],"names":[],"mappings":"AAGC;EACC;AAFF;;AAQC;EACC;EACA;EACA;EACA;EACA;EACA;EACA;AALF;AAOE;EACC;AALH;AASC;EACC;EACA;EACA;EACA,yBC3BkB;ED4BlB;AAPF;AASE;EACC;EACA;EACA,WC/BW;EDgCX;AAPH;AAUE;EACC;EACA,WCrCW;AD6Bd;AAWE;EACC,yBC1CgB;ED2ChB,qBC5CiB;ED6CjB;EACA;AATH;AAWG;EACC;AATJ;AAYG;EACC;AAVJ;AAeC;EACC;EACA,yBC3DiB;ED4DjB;EACA,WC5DY;ED6DZ;AAbF;AAeE;EACC;EACA;AAbH;AAeG;EACC,yBCtEgB;ADyDpB;AAmBC;EACC;AAjBF;AAmBE;EACC;EACA;EACA;AAjBH;AAmBG;EACC;EACA;AAjBJ;AAoBG;EACC;EACA;EACA;AAlBJ;AAoBI;EACC;AAlBL;AAsBG;EACC;EACA;AApBJ;AAuBG;EACC;EACA;AArBJ;AAwBG;EACC;EACA;AAtBJ;AAyBG;EACC;AAvBJ;AA4BI;EACC;EACA;AA1BL;AA6BI;EACC;EACA;EACA,4BC1Hc;ED2Hd;EACA;EACA;EACA;EAeA;EACA;EACA;AAzCL;AA0BK;EACC;AAxBN;AA0BM;EACC;AAxBP;AA4BK;EACC,gBC7IQ;ED8IR,qBChJc;ADsHpB;AAiCK;EACC;IACC;EA/BL;EAiCK;IACC;EA/BN;AACF;AAoCM;EACC,0CChKa;AD8HpB;AA8CK;EACC;AA5CN;AA+CK;EACC;AA7CN;AAgDK;EACC;EACA;EACA;EACA,gBCzLQ;AD2Id;AAiDK;EACC;AA/CN;AAqDE;EACC;EACA;AAnDH;AAqDG;EACC;AAnDJ;AAsDG;EACC;EACA;EACA;AApDJ;AAsDI;EACC;AApDL;AAuDI;EACC;AArDL;AAyDG;EAEC;EACA;AAxDJ;AA0DI;EACC;EACA;EACA;EACA;EACA;AAxDL;AA8DC;EACC;AA5DF;AA8DE;EACC;EACA;EACA;AA5DH;AA8DG;EACC;AA5DJ;AA+DG;EACC;AA7DJ;AAiEE;EACC;AA/DH;AAiEG;EACC;EACA;AA/DJ,C;AE/LC;EACC;EACA;EACA;EACA;EACA;AAHF;AAKE;EACC;AAHH;AAME;EACC,sBDbW;ECcX;AAJH;AAOE;EACC;AALH;AASC;EACC;AAPF;AASE;EACC;EACA;AAPH;AAWC;EACC;EACA;EACA,uBDlCY;ECmCZ,wBDnCY;ECoCZ,sBDpCY;ECqCZ;EACA;AATF;AAWE;EACC;EACA;AATH;AAWG;EACC;EACA;EACA;EACA,cD3Cc;EC4Cd;EACA;AATJ;AAWI;EACC,cD9Ca;EC+Cb;AATL;AAYI;EACC,cDpDkB;ECqDlB;AAVL;AAcG;EACC,cD3Dc;AC+ClB,C","file":"../css/plugin-groups.css","sourcesContent":["@import \"variables\";\n\n.plugin-groups {\n\t&-main > & {\n\t\tmargin-left : -20px;\n\t}\n}\n.ui {\n\n\n\t&-keyword {\n\t\tborder: 1px solid $color_light_gray;\n\t\tborder-radius: 7px;\n\t\tmargin: 6px 6px 6px 0;\n\t\tpadding: 3px 6px;\n\t\tdisplay: inline-flex;\n\t\tflex-direction: row;\n\t\tjustify-content: space-between;\n\n\t\tlabel {\n\t\t\tmargin-left: 3px;\n\t\t}\n\t}\n\n\t&-header {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tpadding-left: 20px;\n\t\tbackground-color: $color_brand_green;\n\t\tbox-shadow: 0 1px 1px $color_shadow_light;\n\n\t\th2 {\n\t\t\tmargin: 0;\n\t\t\tpadding: 1em 1em 1em 0;\n\t\t\tcolor: $color_white;\n\t\t\ttext-shadow: 0 1px 1px $color_shadow;\n\t\t}\n\n\t\t&-version {\n\t\t\tfont-size: 0.8em;\n\t\t\tcolor: $color_white;\n\t\t}\n\n\t\t.button {\n\t\t\tbackground-color: $color_dark_green;\n\t\t\tborder-color: $color_brand_green;\n\t\t\tbox-shadow: none;\n\t\t\tmargin-left: 20px;\n\n\t\t\t&:focus {\n\t\t\t\topacity: 0.4;\n\t\t\t}\n\n\t\t\tinput[type=file] {\n\t\t\t\twidth: 0;\n\t\t\t}\n\t\t}\n\t}\n\n\t&-navigation {\n\t\tdisplay: flex;\n\t\tbackground-color: $color_dark_green;\n\t\tmargin: 0 0 20px;\n\t\tcolor: $color_white;\n\t\tcursor: pointer;\n\n\t\t&-link {\n\t\t\tpadding: 8px 20px;\n\t\t\tmargin: 0;\n\n\t\t\t&:hover, &.active {\n\t\t\t\tbackground-color: $color_brand_green;\n\t\t\t}\n\n\t\t}\n\t}\n\n\t&-body {\n\t\tdisplay: flex;\n\n\t\t&-sidebar {\n\t\t\twidth: 400px;\n\t\t\toverflow-x: hidden;\n\t\t\tpadding: 0 20px 20px;\n\n\t\t\t.search {\n\t\t\t\twidth: 100%;\n\t\t\t\tmargin: 6px 0;\n\t\t\t}\n\n\t\t\t.button {\n\t\t\t\tdisplay: flex;\n\t\t\t\talign-items: center;\n\t\t\t\tjustify-content: space-between;\n\n\t\t\t\t.dashicons {\n\t\t\t\t\tmargin: 0 4px 0 0;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t&.wide {\n\t\t\t\twidth: 500px;\n\t\t\t\tmax-width: 500px;\n\t\t\t}\n\n\t\t\t&.full {\n\t\t\t\twidth: auto;\n\t\t\t\tmax-width: 100%;\n\t\t\t}\n\n\t\t\t&.narrow {\n\t\t\t\twidth: 200px;\n\t\t\t\tmin-width: 200px;\n\t\t\t}\n\n\t\t\th3 {\n\t\t\t\tmargin: 0 0 10px;\n\t\t\t}\n\n\t\t\t&-list {\n\n\t\t\t\t.plugins-list & {\n\t\t\t\t\tmax-height: 500px;\n\t\t\t\t\toverflow-y: auto;\n\t\t\t\t}\n\n\t\t\t\t&-item {\n\t\t\t\t\tmargin-bottom: 0;\n\t\t\t\t\tborder: 1px solid transparent;\n\t\t\t\t\tborder-bottom-color: $color_light_gray;\n\t\t\t\t\tmargin-top: -1px;\n\t\t\t\t\toverflow-x: hidden;\n\t\t\t\t\ttext-overflow: ellipsis;\n\t\t\t\t\twhite-space: nowrap;\n\n\t\t\t\t\t&.list-control {\n\t\t\t\t\t\talign-items: center;\n\n\t\t\t\t\t\tlabel {\n\t\t\t\t\t\t\tfont-weight: bolder;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t&.active {\n\t\t\t\t\t\tbackground: $color_white;\n\t\t\t\t\t\tborder-color: $color_brand_green;\n\t\t\t\t\t}\n\n\t\t\t\t\tdisplay: flex;\n\t\t\t\t\tjustify-content: space-between;\n\t\t\t\t\tpadding: 0.6em 8px;\n\n\t\t\t\t\t@media only screen and (max-width: 1380px) {\n\t\t\t\t\t\t.plugins-list & {\n\t\t\t\t\t\t\tflex-direction: column;\n\n\t\t\t\t\t\t\t.button {\n\t\t\t\t\t\t\t\tmargin: 8px 0;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t&:hover {\n\t\t\t\t\t\t&:not(.active) {\n\t\t\t\t\t\t\tbackground-color: $color_white_hover;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tspan {\n\n\t\t\t\t\t}\n\n\t\t\t\t\tlabel {\n\n\t\t\t\t\t}\n\n\t\t\t\t\t&-title {\n\t\t\t\t\t\tcursor: pointer;\n\t\t\t\t\t}\n\n\t\t\t\t\t&-icons {\n\t\t\t\t\t\tcursor: pointer;\n\t\t\t\t\t}\n\n\t\t\t\t\t&-edit {\n\t\t\t\t\t\tborder: 1px solid $color_brand_green;\n\t\t\t\t\t\tborder-top: 0;\n\t\t\t\t\t\tpadding: 10px 20px 20px;\n\t\t\t\t\t\tbackground: $color_white;\n\t\t\t\t\t}\n\n\t\t\t\t\t&-section {\n\t\t\t\t\t\tmargin-bottom: 20px;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t&-edit {\n\t\t\tmargin: 0 20px;\n\t\t\twidth: 100%;\n\n\t\t\th3 {\n\t\t\t\tmargin: 0 0 10px;\n\t\t\t}\n\n\t\t\t&-title {\n\t\t\t\tborder: 1px transparent;\n\t\t\t\tmargin-left: 7px;\n\t\t\t\tfont-size: inherit;\n\n\t\t\t\t&:focus {\n\t\t\t\t\tbox-shadow: 0 0 0;\n\t\t\t\t}\n\n\t\t\t\t&:focus-visible {\n\t\t\t\t\toutline: 0;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t&-plugins {\n\n\t\t\t\tmax-height: 500px;\n\t\t\t\toverflow-y: auto;\n\n\t\t\t\t&-item {\n\t\t\t\t\tdisplay: flex;\n\t\t\t\t\tjustify-content: space-between;\n\t\t\t\t\tpadding: 9px 8px 8px;\n\t\t\t\t\tborder: 1px solid $color_light_gray;\n\t\t\t\t\tmargin-top: -1px;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t&-panel {\n\t\tmargin-bottom: 20px;\n\n\t\t&-header {\n\t\t\tdisplay: flex;\n\t\t\tjustify-content: space-between;\n\t\t\tborder-bottom: 1px solid $color_brand_green;\n\n\t\t\t&.collapsible {\n\t\t\t\tcursor: pointer;\n\t\t\t}\n\n\t\t\th3 {\n\t\t\t\tfont-size: 1rem;\n\t\t\t}\n\t\t}\n\n\t\t& & &-header {\n\t\t\tpadding: 6px;\n\n\t\t\th3 {\n\t\t\t\tfont-size: 0.8rem;\n\t\t\t\tmargin: 0;\n\t\t\t}\n\t\t}\n\t}\n}\n","$color_background: #C8CBBC;\n$color_brand_green: #74a008;\n$color_dark_green: #465f05;\n$color_white: #fff;\n$color_white_hover: rgba(255,255,255,0.4);\n$color_shadow: rgba(0,0,0,0.6);\n$color_shadow_light: rgba(0,0,0,0.4);\n$color_light_gray: rgb(208, 208, 208);\n$color_blue_gray: #646970;\n$color_dark_blue_gray: #1d2327;\n$color_link_blue: #135e96;\n","@import \"variables\";\n\n.plugin-groups {\n\n\t.nav-settings {\n\t\tcursor        : pointer;\n\t\tpadding       : 8px;\n\t\tmargin-bottom : 20px;\n\t\tmargin-top    : 8px;\n\t\toverflow      : hidden;\n\n\t\tlabel {\n\t\t\tfont-weight : bolder;\n\t\t}\n\n\t\t&.selected {\n\t\t\tbackground-color : $color_white;\n\t\t\tborder           : 1px solid $color_brand_green;\n\t\t}\n\n\t\tselect {\n\t\t\tmargin-top : 6px;\n\t\t}\n\t}\n\n\t.subsubsub {\n\t\tfloat : none;\n\n\t\tli:not(:last-child)::after {\n\t\t\tcontent : '|';\n\t\t\tpadding : 0 3px;\n\t\t}\n\t}\n\n\t.groups-modern {\n\t\tdisplay            : block;\n\t\tborder             : 1px solid $color_light_gray;\n\t\tborder-left-color  : $color_white;\n\t\tborder-right-color : $color_white;\n\t\tbackground-color   : $color_white;\n\t\tmargin             : 10px -20px;\n\t\tpadding            : 0 12px;\n\n\t\tli {\n\t\t\tdisplay : inline-block;\n\t\t\tmargin  : 0;\n\n\t\t\ta {\n\t\t\t\tdisplay         : inline-block;\n\t\t\t\tpadding         : 20px 0 15px;\n\t\t\t\tmargin          : 0 10px;\n\t\t\t\tcolor           : $color_blue_gray;\n\t\t\t\ttext-decoration : none;\n\t\t\t\tborder-bottom   : 5px solid transparent;\n\n\t\t\t\t&:hover {\n\t\t\t\t\tcolor         : $color_link_blue;\n\t\t\t\t\tborder-bottom : 5px solid $color_light_gray;\n\t\t\t\t}\n\n\t\t\t\t&.current {\n\t\t\t\t\tcolor         : $color_dark_blue_gray;\n\t\t\t\t\tborder-bottom : 5px solid $color_blue_gray;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t.count {\n\t\t\t\tcolor : $color_blue_gray;\n\t\t\t}\n\t\t}\n\t}\n}\n"],"sourceRoot":""}
     1{"version":3,"sources":["webpack://///./src/css/main.scss","webpack://///./src/css/_variables.scss","webpack://///./src/css/navbar.scss"],"names":[],"mappings":"AAGC;EACC;AAFF;;AAOC;EACC;EACA;EACA;EACA;EACA;EACA;EACA;AAJF;AAME;EACC;AAJH;AAQC;EACC;EACA;EACA;EACA,yBC1BkB;ED2BlB;AANF;AAQE;EACC;EACA;EACA,WC9BW;ED+BX;AANH;AASE;EACC;EACA,WCpCW;AD6Bd;AASE;EACC;AAPH;AAUE;EACC,yBC5CgB;ED6ChB,qBC9CiB;ED+CjB;EACA;AARH;AAUG;EACC;AARJ;AAWG;EACC;AATJ;AAcC;EACC;EACA,yBC7DiB;ED8DjB;EACA,WC9DY;ED+DZ;AAZF;AAcE;EACC;EACA;AAZH;AAcG;EACC,yBCxEgB;AD4DpB;AAkBC;EACC;AAhBF;AAiBE;EACC;AAfH;AAiBE;EACC;EACA;EACA;AAfH;AAiBG;EACC;EACA;AAfJ;AAkBG;EACC;EACA;EACA;AAhBJ;AAkBI;EACC;AAhBL;AAoBG;EACC;EACA;AAlBJ;AAqBG;EACC;EACA;AAnBJ;AAsBG;EACC;EACA;AApBJ;AAuBG;EACC;AArBJ;AA0BI;EACC;EACA;AAxBL;AA2BI;EACC;EACA;EACA,4BC9Hc;ED+Hd;EAgBA;EACA;EACA;AAxCL;AAyBK;EACC;AAvBN;AAyBM;EACC;AAvBP;AA2BK;EACC,gBC/IQ;EDgJR,qBClJc;ADyHpB;AAgCK;EAEE;IAIC;EAlCN;EA+BM;IACC;EA7BP;EAiCK;IACC;EA/BN;AACF;AAqCM;EACC,0CCvKa;ADoIpB;AA2CK;EACC;EACA;EACA;AAzCN;AA2CK;EACC,cCjLY;ADwIlB;AA0CM;EAFD;IAGE;EAvCL;AACF;AAyCK;EACC;AAvCN;AA0CK;EACC;AAxCN;AA2CK;EACC;EACA;EACA;EACA,gBCvMQ;AD8Jd;AA4CK;EACC;AA1CN;AAgDE;EACC;EACA;AA9CH;AAgDG;EACC;AA9CJ;AAiDG;EACC;EACA;EACA;AA/CJ;AAiDI;EACC;AA/CL;AAkDI;EACC;AAhDL;AAoDG;EAEC;EACA;AAnDJ;AAqDI;EACC;EACA;EACA;EACA;EACA;AAnDL;AAyDC;EACC;AAvDF;AAyDE;EACC;EACA;EACA;AAvDH;AAyDG;EACC;AAvDJ;AA0DG;EACC;AAxDJ;AA4DE;EACC;AA1DH;AA4DG;EACC;EACA;AA1DJ,C;AElNC;EACC;EACA;EACA;EACA;EACA;AAHF;AAKE;EACC;AAHH;AAME;EACC,sBDbW;ECcX;AAJH;AAOE;EACC;AALH;AASC;EACC;AAPF;AASE;EACC;EACA;AAPH;AAWC;EACC;EACA;EACA,uBDlCY;ECmCZ,wBDnCY;ECoCZ,sBDpCY;ECqCZ;EACA;AATF;AAWE;EACC;EACA;AATH;AAWG;EACC;EACA;EACA;EACA,cD3Cc;EC4Cd;EACA;AATJ;AAWI;EACC,cD9Ca;EC+Cb;AATL;AAYI;EACC,cDpDkB;ECqDlB;AAVL;AAcG;EACC,cD3Dc;AC+ClB,C","file":"../css/plugin-groups.css","sourcesContent":["@import \"variables\";\n\n.plugin-groups {\n\t&-main > & {\n\t\tmargin-left : -20px;\n\t}\n}\n.ui {\n\n\t&-keyword {\n\t\tborder: 1px solid $color_light_gray;\n\t\tborder-radius: 7px;\n\t\tmargin: 6px 6px 6px 0;\n\t\tpadding: 3px 6px;\n\t\tdisplay: inline-flex;\n\t\tflex-direction: row;\n\t\tjustify-content: space-between;\n\n\t\tlabel {\n\t\t\tmargin-left: 3px;\n\t\t}\n\t}\n\n\t&-header {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tpadding-left: 20px;\n\t\tbackground-color: $color_brand_green;\n\t\tbox-shadow: 0 1px 1px $color_shadow_light;\n\n\t\th2 {\n\t\t\tmargin: 0;\n\t\t\tpadding: 1em 1em 1em 0;\n\t\t\tcolor: $color_white;\n\t\t\ttext-shadow: 0 1px 1px $color_shadow;\n\t\t}\n\n\t\t&-version {\n\t\t\tfont-size: 0.8em;\n\t\t\tcolor: $color_white;\n\t\t}\n\t\t&-multisite{\n\t\t\tmargin: 0 8px 0 12px;\n\t\t}\n\n\t\t.button {\n\t\t\tbackground-color: $color_dark_green;\n\t\t\tborder-color: $color_brand_green;\n\t\t\tbox-shadow: none;\n\t\t\tmargin-left: 20px;\n\n\t\t\t&:focus {\n\t\t\t\topacity: 0.4;\n\t\t\t}\n\n\t\t\tinput[type=file] {\n\t\t\t\twidth: 0;\n\t\t\t}\n\t\t}\n\t}\n\n\t&-navigation {\n\t\tdisplay: flex;\n\t\tbackground-color: $color_dark_green;\n\t\tmargin: 0 0 20px;\n\t\tcolor: $color_white;\n\t\tcursor: pointer;\n\n\t\t&-link {\n\t\t\tpadding: 8px 20px;\n\t\t\tmargin: 0;\n\n\t\t\t&:hover, &.active {\n\t\t\t\tbackground-color: $color_brand_green;\n\t\t\t}\n\n\t\t}\n\t}\n\n\t&-body {\n\t\tdisplay: flex;\n\t\t.keywords-input{\n\t\t\twidth: 100%;\n\t\t}\n\t\t&-sidebar {\n\t\t\twidth: 400px;\n\t\t\toverflow-x: hidden;\n\t\t\tpadding: 0 20px 20px;\n\n\t\t\t.search {\n\t\t\t\twidth: 100%;\n\t\t\t\tmargin: 6px 0;\n\t\t\t}\n\n\t\t\t.button {\n\t\t\t\tdisplay: flex;\n\t\t\t\talign-items: center;\n\t\t\t\tjustify-content: space-between;\n\n\t\t\t\t.dashicons {\n\t\t\t\t\tmargin: 0 4px;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t&.wide {\n\t\t\t\twidth: 500px;\n\t\t\t\tmax-width: 500px;\n\t\t\t}\n\n\t\t\t&.full {\n\t\t\t\twidth: auto;\n\t\t\t\tmax-width: 100%;\n\t\t\t}\n\n\t\t\t&.narrow {\n\t\t\t\twidth: 200px;\n\t\t\t\tmin-width: 200px;\n\t\t\t}\n\n\t\t\th3 {\n\t\t\t\tmargin: 0 0 10px;\n\t\t\t}\n\n\t\t\t&-list {\n\n\t\t\t\t.plugins-list & {\n\t\t\t\t\tmax-height: 500px;\n\t\t\t\t\toverflow-y: auto;\n\t\t\t\t}\n\n\t\t\t\t&-item {\n\t\t\t\t\tmargin-bottom: 0;\n\t\t\t\t\tborder: 1px solid transparent;\n\t\t\t\t\tborder-bottom-color: $color_light_gray;\n\t\t\t\t\tmargin-top: -1px;\n\n\n\t\t\t\t\t&.list-control {\n\t\t\t\t\t\talign-items: center;\n\n\t\t\t\t\t\tlabel {\n\t\t\t\t\t\t\tfont-weight: bolder;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t&.active {\n\t\t\t\t\t\tbackground: $color_white;\n\t\t\t\t\t\tborder-color: $color_brand_green;\n\t\t\t\t\t}\n\n\t\t\t\t\tdisplay: flex;\n\t\t\t\t\tjustify-content: space-between;\n\t\t\t\t\tpadding: 0.6em 8px;\n\n\t\t\t\t\t@media only screen and (max-width: 1150px) {\n\t\t\t\t\t\t&.list-control{\n\t\t\t\t\t\t\t.button {\n\t\t\t\t\t\t\t\t.text{\n\t\t\t\t\t\t\t\t\tdisplay: none;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tmargin: 8px 0 12px;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tlabel{\n\t\t\t\t\t\t\t\toverflow: auto;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t&:hover {\n\t\t\t\t\t\t&:not(.active) {\n\t\t\t\t\t\t\tbackground-color: $color_white_hover;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tspan {\n\n\t\t\t\t\t}\n\n\t\t\t\t\tlabel, .version {\n\t\t\t\t\t\toverflow: hidden;\n\t\t\t\t\t\ttext-overflow: ellipsis;\n\t\t\t\t\t\twhite-space: nowrap;\n\t\t\t\t\t}\n\t\t\t\t\t.version{\n\t\t\t\t\t\tcolor: $color_blue_gray;\n\t\t\t\t\t\t@media only screen and (max-width: 1150px) {\n\t\t\t\t\t\t\tdisplay: none;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t&-title {\n\t\t\t\t\t\tcursor: pointer;\n\t\t\t\t\t}\n\n\t\t\t\t\t&-icons {\n\t\t\t\t\t\tcursor: pointer;\n\t\t\t\t\t}\n\n\t\t\t\t\t&-edit {\n\t\t\t\t\t\tborder: 1px solid $color_brand_green;\n\t\t\t\t\t\tborder-top: 0;\n\t\t\t\t\t\tpadding: 10px 20px 20px;\n\t\t\t\t\t\tbackground: $color_white;\n\t\t\t\t\t}\n\n\t\t\t\t\t&-section {\n\t\t\t\t\t\tmargin-bottom: 20px;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t&-edit {\n\t\t\tmargin: 0 20px;\n\t\t\twidth: 100%;\n\n\t\t\th3 {\n\t\t\t\tmargin: 0 0 10px;\n\t\t\t}\n\n\t\t\t&-title {\n\t\t\t\tborder: 1px transparent;\n\t\t\t\tmargin-left: 7px;\n\t\t\t\tfont-size: inherit;\n\n\t\t\t\t&:focus {\n\t\t\t\t\tbox-shadow: 0 0 0;\n\t\t\t\t}\n\n\t\t\t\t&:focus-visible {\n\t\t\t\t\toutline: 0;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t&-plugins {\n\n\t\t\t\tmax-height: 500px;\n\t\t\t\toverflow-y: auto;\n\n\t\t\t\t&-item {\n\t\t\t\t\tdisplay: flex;\n\t\t\t\t\tjustify-content: space-between;\n\t\t\t\t\tpadding: 9px 8px 8px;\n\t\t\t\t\tborder: 1px solid $color_light_gray;\n\t\t\t\t\tmargin-top: -1px;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t&-panel {\n\t\tmargin-bottom: 20px;\n\n\t\t&-header {\n\t\t\tdisplay: flex;\n\t\t\tjustify-content: space-between;\n\t\t\tborder-bottom: 1px solid $color_brand_green;\n\n\t\t\t&.collapsible {\n\t\t\t\tcursor: pointer;\n\t\t\t}\n\n\t\t\th3 {\n\t\t\t\tfont-size: 1rem;\n\t\t\t}\n\t\t}\n\n\t\t& & &-header {\n\t\t\tpadding: 6px;\n\n\t\t\th3 {\n\t\t\t\tfont-size: 0.8rem;\n\t\t\t\tmargin: 0;\n\t\t\t}\n\t\t}\n\t}\n}\n","$color_background: #C8CBBC;\n$color_brand_green: #74a008;\n$color_dark_green: #465f05;\n$color_white: #fff;\n$color_white_hover: rgba(255,255,255,0.4);\n$color_shadow: rgba(0,0,0,0.6);\n$color_shadow_light: rgba(0,0,0,0.4);\n$color_light_gray: rgb(208, 208, 208);\n$color_blue_gray: #646970;\n$color_dark_blue_gray: #1d2327;\n$color_link_blue: #135e96;\n","@import \"variables\";\n\n.plugin-groups {\n\n\t.nav-settings {\n\t\tcursor        : pointer;\n\t\tpadding       : 8px;\n\t\tmargin-bottom : 20px;\n\t\tmargin-top    : 8px;\n\t\toverflow      : hidden;\n\n\t\tlabel {\n\t\t\tfont-weight : bolder;\n\t\t}\n\n\t\t&.selected {\n\t\t\tbackground-color : $color_white;\n\t\t\tborder           : 1px solid $color_brand_green;\n\t\t}\n\n\t\tselect {\n\t\t\tmargin-top : 6px;\n\t\t}\n\t}\n\n\t.subsubsub {\n\t\tfloat : none;\n\n\t\tli:not(:last-child)::after {\n\t\t\tcontent : '|';\n\t\t\tpadding : 0 3px;\n\t\t}\n\t}\n\n\t.groups-modern {\n\t\tdisplay            : block;\n\t\tborder             : 1px solid $color_light_gray;\n\t\tborder-left-color  : $color_white;\n\t\tborder-right-color : $color_white;\n\t\tbackground-color   : $color_white;\n\t\tmargin             : 10px -20px;\n\t\tpadding            : 0 12px;\n\n\t\tli {\n\t\t\tdisplay : inline-block;\n\t\t\tmargin  : 0;\n\n\t\t\ta {\n\t\t\t\tdisplay         : inline-block;\n\t\t\t\tpadding         : 20px 0 15px;\n\t\t\t\tmargin          : 0 10px;\n\t\t\t\tcolor           : $color_blue_gray;\n\t\t\t\ttext-decoration : none;\n\t\t\t\tborder-bottom   : 5px solid transparent;\n\n\t\t\t\t&:hover {\n\t\t\t\t\tcolor         : $color_link_blue;\n\t\t\t\t\tborder-bottom : 5px solid $color_light_gray;\n\t\t\t\t}\n\n\t\t\t\t&.current {\n\t\t\t\t\tcolor         : $color_dark_blue_gray;\n\t\t\t\t\tborder-bottom : 5px solid $color_blue_gray;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t.count {\n\t\t\t\tcolor : $color_blue_gray;\n\t\t\t}\n\t\t}\n\t}\n}\n"],"sourceRoot":""}
  • plugin-groups/trunk/js/plugin-groups.asset.php

    r2585994 r2586331  
    1 <?php return array('dependencies' => array('react', 'react-dom', 'wp-element', 'wp-i18n', 'wp-polyfill'), 'version' => '13e7580196c021e4f2b0156ec7ab96be');
     1<?php return array('dependencies' => array('react', 'react-dom', 'wp-element', 'wp-i18n', 'wp-polyfill'), 'version' => '83b3cab6ae9c1872f5857a34cd4a95ca');
  • plugin-groups/trunk/js/plugin-groups.css

    r2585975 r2586331  
    1 .plugin-groups-main>.plugin-groups{margin-left:-20px}.ui-keyword{border:1px solid #d0d0d0;border-radius:7px;margin:6px 6px 6px 0;padding:3px 6px;display:inline-flex;flex-direction:row;justify-content:space-between}.ui-keyword label{margin-left:3px}.ui-header{display:flex;align-items:center;padding-left:20px;background-color:#74a008;box-shadow:0 1px 1px rgba(0,0,0,.4)}.ui-header h2{margin:0;padding:1em 1em 1em 0;color:#fff;text-shadow:0 1px 1px rgba(0,0,0,.6)}.ui-header-version{font-size:.8em;color:#fff}.ui-header .button{background-color:#465f05;border-color:#74a008;box-shadow:none;margin-left:20px}.ui-header .button:focus{opacity:.4}.ui-header .button input[type=file]{width:0}.ui-navigation{display:flex;background-color:#465f05;margin:0 0 20px;color:#fff;cursor:pointer}.ui-navigation-link{padding:8px 20px;margin:0}.ui-navigation-link:hover,.ui-navigation-link.active{background-color:#74a008}.ui-body{display:flex}.ui-body-sidebar{width:400px;overflow-x:hidden;padding:0 20px 20px}.ui-body-sidebar .search{width:100%;margin:6px 0}.ui-body-sidebar .button{display:flex;align-items:center;justify-content:space-between}.ui-body-sidebar .button .dashicons{margin:0 4px 0 0}.ui-body-sidebar.wide{width:500px;max-width:500px}.ui-body-sidebar.full{width:auto;max-width:100%}.ui-body-sidebar.narrow{width:200px;min-width:200px}.ui-body-sidebar h3{margin:0 0 10px}.plugins-list .ui-body-sidebar-list{max-height:500px;overflow-y:auto}.ui-body-sidebar-list-item{margin-bottom:0;border:1px solid transparent;border-bottom-color:#d0d0d0;margin-top:-1px;overflow-x:hidden;text-overflow:ellipsis;white-space:nowrap;display:flex;justify-content:space-between;padding:.6em 8px}.ui-body-sidebar-list-item.list-control{align-items:center}.ui-body-sidebar-list-item.list-control label{font-weight:bolder}.ui-body-sidebar-list-item.active{background:#fff;border-color:#74a008}@media only screen and (max-width: 1380px){.plugins-list .ui-body-sidebar-list-item{flex-direction:column}.plugins-list .ui-body-sidebar-list-item .button{margin:8px 0}}.ui-body-sidebar-list-item:hover:not(.active){background-color:rgba(255,255,255,.4)}.ui-body-sidebar-list-item-title{cursor:pointer}.ui-body-sidebar-list-item-icons{cursor:pointer}.ui-body-sidebar-list-item-edit{border:1px solid #74a008;border-top:0;padding:10px 20px 20px;background:#fff}.ui-body-sidebar-list-item-section{margin-bottom:20px}.ui-body-edit{margin:0 20px;width:100%}.ui-body-edit h3{margin:0 0 10px}.ui-body-edit-title{border:1px transparent;margin-left:7px;font-size:inherit}.ui-body-edit-title:focus{box-shadow:0 0 0}.ui-body-edit-title:focus-visible{outline:0}.ui-body-edit-plugins{max-height:500px;overflow-y:auto}.ui-body-edit-plugins-item{display:flex;justify-content:space-between;padding:9px 8px 8px;border:1px solid #d0d0d0;margin-top:-1px}.ui-panel{margin-bottom:20px}.ui-panel-header{display:flex;justify-content:space-between;border-bottom:1px solid #74a008}.ui-panel-header.collapsible{cursor:pointer}.ui-panel-header h3{font-size:1rem}.ui-panel .ui-panel .ui-panel-header{padding:6px}.ui-panel .ui-panel .ui-panel-header h3{font-size:.8rem;margin:0}
     1.plugin-groups-main>.plugin-groups{margin-left:-20px}.ui-keyword{border:1px solid #d0d0d0;border-radius:7px;margin:6px 6px 6px 0;padding:3px 6px;display:inline-flex;flex-direction:row;justify-content:space-between}.ui-keyword label{margin-left:3px}.ui-header{display:flex;align-items:center;padding-left:20px;background-color:#74a008;box-shadow:0 1px 1px rgba(0,0,0,.4)}.ui-header h2{margin:0;padding:1em 1em 1em 0;color:#fff;text-shadow:0 1px 1px rgba(0,0,0,.6)}.ui-header-version{font-size:.8em;color:#fff}.ui-header-multisite{margin:0 8px 0 12px}.ui-header .button{background-color:#465f05;border-color:#74a008;box-shadow:none;margin-left:20px}.ui-header .button:focus{opacity:.4}.ui-header .button input[type=file]{width:0}.ui-navigation{display:flex;background-color:#465f05;margin:0 0 20px;color:#fff;cursor:pointer}.ui-navigation-link{padding:8px 20px;margin:0}.ui-navigation-link:hover,.ui-navigation-link.active{background-color:#74a008}.ui-body{display:flex}.ui-body .keywords-input{width:100%}.ui-body-sidebar{width:400px;overflow-x:hidden;padding:0 20px 20px}.ui-body-sidebar .search{width:100%;margin:6px 0}.ui-body-sidebar .button{display:flex;align-items:center;justify-content:space-between}.ui-body-sidebar .button .dashicons{margin:0 4px}.ui-body-sidebar.wide{width:500px;max-width:500px}.ui-body-sidebar.full{width:auto;max-width:100%}.ui-body-sidebar.narrow{width:200px;min-width:200px}.ui-body-sidebar h3{margin:0 0 10px}.plugins-list .ui-body-sidebar-list{max-height:500px;overflow-y:auto}.ui-body-sidebar-list-item{margin-bottom:0;border:1px solid transparent;border-bottom-color:#d0d0d0;margin-top:-1px;display:flex;justify-content:space-between;padding:.6em 8px}.ui-body-sidebar-list-item.list-control{align-items:center}.ui-body-sidebar-list-item.list-control label{font-weight:bolder}.ui-body-sidebar-list-item.active{background:#fff;border-color:#74a008}@media only screen and (max-width: 1150px){.ui-body-sidebar-list-item.list-control .button{margin:8px 0 12px}.ui-body-sidebar-list-item.list-control .button .text{display:none}.ui-body-sidebar-list-item.list-control label{overflow:auto}}.ui-body-sidebar-list-item:hover:not(.active){background-color:rgba(255,255,255,.4)}.ui-body-sidebar-list-item label,.ui-body-sidebar-list-item .version{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ui-body-sidebar-list-item .version{color:#646970}@media only screen and (max-width: 1150px){.ui-body-sidebar-list-item .version{display:none}}.ui-body-sidebar-list-item-title{cursor:pointer}.ui-body-sidebar-list-item-icons{cursor:pointer}.ui-body-sidebar-list-item-edit{border:1px solid #74a008;border-top:0;padding:10px 20px 20px;background:#fff}.ui-body-sidebar-list-item-section{margin-bottom:20px}.ui-body-edit{margin:0 20px;width:100%}.ui-body-edit h3{margin:0 0 10px}.ui-body-edit-title{border:1px transparent;margin-left:7px;font-size:inherit}.ui-body-edit-title:focus{box-shadow:0 0 0}.ui-body-edit-title:focus-visible{outline:0}.ui-body-edit-plugins{max-height:500px;overflow-y:auto}.ui-body-edit-plugins-item{display:flex;justify-content:space-between;padding:9px 8px 8px;border:1px solid #d0d0d0;margin-top:-1px}.ui-panel{margin-bottom:20px}.ui-panel-header{display:flex;justify-content:space-between;border-bottom:1px solid #74a008}.ui-panel-header.collapsible{cursor:pointer}.ui-panel-header h3{font-size:1rem}.ui-panel .ui-panel .ui-panel-header{padding:6px}.ui-panel .ui-panel .ui-panel-header h3{font-size:.8rem;margin:0}
    22.plugin-groups .nav-settings{cursor:pointer;padding:8px;margin-bottom:20px;margin-top:8px;overflow:hidden}.plugin-groups .nav-settings label{font-weight:bolder}.plugin-groups .nav-settings.selected{background-color:#fff;border:1px solid #74a008}.plugin-groups .nav-settings select{margin-top:6px}.plugin-groups .subsubsub{float:none}.plugin-groups .subsubsub li:not(:last-child)::after{content:"|";padding:0 3px}.plugin-groups .groups-modern{display:block;border:1px solid #d0d0d0;border-left-color:#fff;border-right-color:#fff;background-color:#fff;margin:10px -20px;padding:0 12px}.plugin-groups .groups-modern li{display:inline-block;margin:0}.plugin-groups .groups-modern li a{display:inline-block;padding:20px 0 15px;margin:0 10px;color:#646970;text-decoration:none;border-bottom:5px solid transparent}.plugin-groups .groups-modern li a:hover{color:#135e96;border-bottom:5px solid #d0d0d0}.plugin-groups .groups-modern li a.current{color:#1d2327;border-bottom:5px solid #646970}.plugin-groups .groups-modern li .count{color:#646970}
  • plugin-groups/trunk/js/plugin-groups.js

    r2585994 r2586331  
    1 !function(e){var t={};function n(c){if(t[c])return t[c].exports;var a=t[c]={i:c,l:!1,exports:{}};return e[c].call(a.exports,a,a.exports,n),a.l=!0,a.exports}n.m=e,n.c=t,n.d=function(e,t,c){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:c})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var c=Object.create(null);if(n.r(c),Object.defineProperty(c,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)n.d(c,a,function(t){return e[t]}.bind(null,a));return c},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=6)}([function(e,t){e.exports=window.wp.element},function(e,t){e.exports=window.wp.i18n},function(e,t){e.exports=window.React},function(e,t){function n(){return e.exports=n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var c in n)Object.prototype.hasOwnProperty.call(n,c)&&(e[c]=n[c])}return e},e.exports.default=e.exports,e.exports.__esModule=!0,n.apply(this,arguments)}e.exports=n,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){"use strict";n.r(t)},function(e,t){e.exports=window.ReactDOM},function(e,t,n){"use strict";n.r(t);var c=n(3),a=n.n(c),l=n(0),s=n(2),r=n.n(s),o=n(5),u=n.n(o),i=n(1);function d(e){const{navTab:t,tab:n,pluginName:c,version:a,handleSave:s,handleExport:r,handleImport:o,saving:u}=e;return Object(l.createElement)(l.Fragment,null,Object(l.createElement)("header",{className:"ui-header"},Object(l.createElement)("span",null,Object(l.createElement)("h2",null,c)),Object(l.createElement)("span",{className:"ui-header-version"},a),Object(l.createElement)("button",{className:"button button-primary",type:"button",onClick:s,disabled:u},Object(i.__)("Save Settings",e.slug)),Object(l.createElement)("button",{className:"button button-primary",type:"button",onClick:r},"Export"),Object(l.createElement)("label",{className:"button button-primary",type:"button",onClick:""},"Import",Object(l.createElement)("input",{className:"importer-input",type:"file",onChange:o}))),Object(l.createElement)("ul",{className:"ui-navigation"},Object(l.createElement)("li",{className:1===n?"ui-navigation-link active":"ui-navigation-link",onClick:()=>t(1)},Object(i.__)("Groups Management",e.slug)),Object(l.createElement)("li",{className:2===n?"ui-navigation-link active":"ui-navigation-link",onClick:()=>t(2)},Object(i.__)("Settings",e.slug))))}function p(e){const{name:t,id:n,changeName:c,editGroup:a,temp:s,focus:r}=e;return Object(l.createElement)("input",{className:"ui-body-edit-title",autoFocus:r,onFocus:e=>{e.target.select()},value:t,onInput:e=>{c(n,e.target.value)},onBlur:e=>{e.target.value.length?e.target.value.length&&"/"!==e.target.value&&a(n):e.target.focus()},type:"text","data-edit":n})}function m(e){const{title:t,collapse:n,height:c}=e,[a,s]=r.a.useState(n||"open"),o="open"===a?"dashicons-arrow-up-alt2":"dashicons-arrow-down-alt2",u=n?"collapsible":"";return Object(l.createElement)("div",{className:"ui-panel"},Object(l.createElement)("div",{className:"ui-panel-header "+u,onClick:()=>{n&&s("open"===a?"closed":"open")}},Object(l.createElement)("h3",{className:"ui-panel-header-title"},t),n&&Object(l.createElement)("span",{className:"dashicons "+o})),"open"===a&&Object(l.createElement)("div",{className:"ui-panel-body "+a},e.children))}function g(e){const{name:t,version:n,id:c,callback:a,checked:s,bold:r,subname:o,className:u}=e;return Object(l.createElement)("div",{className:"ui-body-sidebar-list-item "+u},Object(l.createElement)("label",null,Object(l.createElement)("input",{type:"checkbox",checked:s,value:c,onChange:a}),Object(l.createElement)("span",null,r?Object(l.createElement)("strong",null,t,n&&Object(l.createElement)(l.Fragment,null,": ",n)):Object(l.createElement)("span",null,t,n&&Object(l.createElement)(l.Fragment,null,": ",n)),o&&Object(l.createElement)("div",null,o))),e.children)}function b(e){const{group:t,plugins:n,removePlugins:c,removePlugin:a}=e,[s,o]=r.a.useState([]),u=0<t.plugins.length,d=e=>{const t=[...s];e.target.checked?t.push(e.target.value):t.splice(t.indexOf(e.target.value),1),o(t)};return Object(l.createElement)(m,{title:Object(i.__)("Grouped plugins",e.slug)},u&&Object(l.createElement)(l.Fragment,null,Object(l.createElement)(g,{name:Object(i.__)("Select All",e.slug),className:"list-control",callback:e=>{e.target.checked?o(t.plugins):o([])},checked:s.length===t.plugins.length},Object(l.createElement)("button",{disabled:!s.length,type:"button",className:"button",onClick:e=>{c(t.id,[...s])}},Object(i.__)("Remove selected",e.slug))),Object(l.createElement)("div",{className:"ui-body-edit-plugins"},t.plugins.map((e,c)=>{const r=n[e];return Object(l.createElement)(g,{name:r.Name,version:r.Version,checked:-1<s.indexOf(e),id:e,callback:d},Object(l.createElement)("label",{className:"dashicons dashicons-no-alt",onClick:()=>a(t.id,e)}))}))),!u&&Object(l.createElement)("div",{className:"ui-body-edit-plugins"},Object(l.createElement)("span",{className:"ui-body-edit-plugins-item"},Object(i.__)("No plugins selected",e.slug))))}function O({group:e,removeKeyword:t}){const{id:n,keywords:c}=e;return c.map(e=>Object(l.createElement)("span",{className:"ui-keyword"},e,Object(l.createElement)("label",{className:"dashicons dashicons-no-alt",onClick:()=>t(n,e)})))}function j(e){const{group:t,addKeyword:n,removeKeyword:c}=e;return Object(l.createElement)("div",{className:"ui-body-sidebar-list-item-section"},Object(l.createElement)(m,{title:Object(i.__)("Keywords",e.slug)},Object(l.createElement)(O,{group:t,removeKeyword:c,addKeyword:n}),Object(l.createElement)("hr",null),Object(l.createElement)("input",{className:"regular-text",type:"text",placeholder:Object(i.__)("Add keyword"),"data-keywords":!0,onKeyDown:e=>{const c=e.target.value.trim();"Enter"!==e.key&&","!==e.key||(e.preventDefault(),e.stopPropagation(),e.target.dataset.keywords&&0<c.length&&(n(t.id,c),e.target.value=""))}})))}function h(e){const{group:t}=e;return Object(l.createElement)("div",{className:"ui-body-sidebar-list-item-edit"},Object(l.createElement)(b,e),Object(l.createElement)(j,e))}function E(e){const{selectGroup:t,openGroup:n,group:c,changeName:s,editGroup:r,index:o}=e,{temp:u,name:i,id:d,plugins:m,selected:g,open:b,edit:O,focus:j}=c,E=g?"active":"";return Object(l.createElement)(l.Fragment,null,Object(l.createElement)("div",{className:"ui-body-sidebar-list-item "+E},!O&&Object(l.createElement)(l.Fragment,null,Object(l.createElement)("span",null,Object(l.createElement)("input",{type:"checkbox",checked:g,onClick:e=>t(d)}),Object(l.createElement)("span",{className:"ui-body-sidebar-list-item-title",onClick:e=>n(d)},i)),Object(l.createElement)("span",{className:"ui-body-sidebar-list-item-icons"},Object(l.createElement)("span",{className:"dashicons dashicons-edit",onClick:()=>r(d)}),m.length)),O&&Object(l.createElement)(p,{temp:u,name:i,id:d,changeName:s,editGroup:r,focus:j})),!u&&b&&Object(l.createElement)(h,a()({group:c},e)))}function f(e){const{groups:t,getList:n,edit:c}=e;return n().map((n,s)=>{const r=t[n];return Object(l.createElement)(E,a()({index:s,group:r,editing:n===c},e))})}function v(e){const{getList:t,createGroup:n,deleteGroups:c,selectGroups:a,getSelected:s}=e,r=s().length===Object.keys(e.groups).length;return Object(l.createElement)("div",{className:"ui-body-sidebar wide"},Object(l.createElement)(m,{title:Object(i.__)("Groups")},Object(l.createElement)("div",{className:"ui-body-sidebar-list"},0!==t().length&&Object(l.createElement)(l.Fragment,null,Object(l.createElement)(g,{name:Object(i.__)("Select All"),bold:!0,callback:t=>{a(Object.keys(e.groups),t.target.checked)},checked:r,className:"list-control"},Object(l.createElement)("button",{disabled:!s().length,type:"button",className:"button",onClick:()=>{c(s(),!0)}},Object(i.__)("Delete selected",e.slug))),Object(l.createElement)(f,e)),0===t().length&&Object(l.createElement)("div",{className:"description"},Object(l.createElement)("span",{className:"ui-body-edit-plugins-item"},Object(i.__)("No groups created",e.slug))))),Object(l.createElement)("button",{type:"button",className:"button",onClick:()=>n("",!0)},Object(l.createElement)("span",{className:"dashicons dashicons-plus-alt"}),Object(i.__)("Create new group",e.slug)))}function y(e){const{plugins:t,addPlugins:n}=e,[c,a]=r.a.useState({checkedAll:!1,search:"",checked:[]}),s=Object.keys(t),o=e=>{a({...c,...e})},u=e=>{const n={checked:[]};e&&s.forEach(e=>{const c=t[e];p(c.Name)&&n.checked.push(e)}),n.checkedAll=n.checked.length,o(n)},d=e=>{const t={...c},n=t.checked.indexOf(e.target.value);e.target.checked&&-1===n?t.checked.push(e.target.value):!e.target.checked&&-1<n&&t.checked.splice(n,1),t.checked.length!==t.checkedAll&&(t.checkedAll=0),t.checked.length===s.length?u(!0):o(t)},p=e=>!c.search||-1<e.toLowerCase().indexOf(c.search.toLowerCase()),b=c.checked.length&&(()=>{for(const t in e.groups)if(e.groups[t].selected)return!0;return!1})();return Object(l.createElement)("div",{className:"ui-body-sidebar"},Object(l.createElement)(m,{title:Object(i.__)("Plugins",e.slug)},Object(l.createElement)("input",{className:"regular-text search",placeholder:Object(i.__)("Search",e.slug),type:"search",onInput:e=>{o({search:e.target.value})},value:c.search}),Object(l.createElement)(g,{name:Object(i.__)("Select all",e.slug),id:"all",callback:e=>u(e.target.checked),checked:c.checkedAll,bold:!0,className:"list-control"},Object(l.createElement)("button",{className:"button",type:"button",onClick:()=>{Object.keys(e.groups).forEach(t=>{e.groups[t].selected&&n(t,c.checked)}),u(!1)},disabled:!b},Object(i.__)("Send to Selected Groups"),Object(l.createElement)("span",{className:"dashicons dashicons-arrow-right-alt2"}))),Object(l.createElement)("div",{className:"plugins-list"},Object(l.createElement)("div",{className:"ui-body-sidebar-list"},s.map((e,n)=>{const a=t[e],s=p(a.Name),r=-1<c.checked.indexOf(e)&&p(a.Name);return Object(l.createElement)(l.Fragment,null,s&&Object(l.createElement)(g,{name:a.Name,id:e,version:a.Version,checked:r,callback:d}))})))))}function k(e){const{togglePreset:t,selectedPresets:n,presets:c,slug:a}=e;return Object(l.createElement)("div",{className:"ui-body-sidebar narrow"},Object(l.createElement)(m,{title:Object(i.__)("Presets",a)},c.map(e=>Object(l.createElement)(g,{name:e,id:e,checked:-1<n.indexOf(e),callback:()=>t(e)}))))}function N(e){const{presets:t,getList:n}=e;return Object(l.createElement)("div",null,Object(l.createElement)("select",null,t.map((e,t)=>{if(!(5<t))return Object(l.createElement)("option",null,e," (",t+1,")")})))}function w(e){const{presets:t,className:n,setParam:c,params:a,styleName:s}=e,r=a.navStyle&&n===a.navStyle?" selected":"";return Object(l.createElement)("div",{className:"plugin-groups nav-settings"+r,onClick:()=>{c("navStyle",n)}},Object(l.createElement)("label",null,s),"groups-dropdown"===n&&Object(l.createElement)(N,e),"groups-dropdown"!==n&&Object(l.createElement)("ul",{className:n},t.map((e,t)=>{if(!(5<t))return Object(l.createElement)(l.Fragment,null,Object(l.createElement)("li",null,Object(l.createElement)("a",{className:0===t?"current":""},e,Object(l.createElement)("span",{className:"count"}," (",t+1,")"))))})))}function _(e){const{params:t,setParam:n}=e;return Object(l.createElement)("div",{className:"ui-body"},Object(l.createElement)("div",{className:"ui-body-sidebar"},Object(l.createElement)(m,{title:"Settings"},Object(l.createElement)(g,{name:Object(i.__)("Use Legacy status based grouping",e.slug),checked:t.legacyGrouping,callback:e=>n("legacyGrouping",e.target.checked)}),Object(l.createElement)(g,{name:Object(i.__)("Enable admin menu",e.slug),checked:t.menuGroups,callback:e=>n("menuGroups",e.target.checked)}))),!t.legacyGrouping&&Object(l.createElement)("div",{className:"ui-body-sidebar full"},Object(l.createElement)(m,{title:Object(i.__)("Navigation style",e.slug)},Object(l.createElement)(w,a()({styleName:Object(i.__)("Legacy",e.slug),className:"subsubsub"},e)),Object(l.createElement)(w,a()({styleName:Object(i.__)("Modern",e.slug),className:"groups-modern"},e)),Object(l.createElement)(w,a()({styleName:Object(i.__)("Dropdown",e.slug),className:"groups-dropdown"},e)))))}function x(e){const[t,n]=r.a.useState(e),[c,s]=r.a.useState(1),o=e=>{window.localStorage.setItem("_plgUnsaved",!0),n(e)},u=()=>({...t}),p=e=>{o({...t,...e})},m=e=>{g([e])},g=(e,t)=>{const n=u();e.forEach(e=>{if(null===e)return;const c=void 0!==t?!t:n.groups[e].selected;n.groups[e].selected=!c,c&&(delete n.groups[e].open,delete n.groups[e].edit,delete n.groups[e].focus),n.activeGroup=e}),o(n)},b=(e,t)=>{const n=u();e.forEach(e=>{n.groups[e].open=t}),p(n)},O=(e,t,n)=>{const c=u();n||c.groups[e].prevName?n&&(t=c.groups[e].prevName?c.groups[e].prevName:c.groups[e].name,delete c.groups[e].prevName,delete c.groups[e].edit,delete c.groups[e].selected,delete c.groups[e].open):c.groups[e].prevName=c.groups[e].name,c.groups[e].name=t,o(c)},j=(e,n)=>{const c=u();n&&!confirm(Object(i._n)("Delete the selected group?","Delete the selected groups",e.length,t.slug))||(e.forEach(e=>{delete c.groups[e]}),o(c))},h=e=>{j([e])},E=e=>{const t="pgxxxxx".replace(/x/g,(function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})),n={id:t,name:e,plugins:[],keywords:[],temp:!0,selected:!0,edit:!0,focus:!0},c=u();c.groups||(c.groups={}),c.groups[t]=n,o(c)},f=(e,n)=>{const c=u();n.map(n=>{const a=t.groups[e].plugins.indexOf(n);-1<a&&c.groups[e].plugins.splice(a,1)}),o(c)},N=()=>{const e=u(),{groups:n,selectedPresets:c,params:a}=e,l=JSON.stringify({groups:n,selectedPresets:c,params:a});e.saving=!0,fetch(t.saveURL,{method:"POST",headers:{"Content-Type":"application/json","X-WP-Nonce":t.restNonce},body:l}).then(e=>e.json()).then(n=>{e.saving=!1,o(t),window.localStorage.removeItem("_plgUnsaved")}),o(e)},w=e=>{const n=u();let c=!1;e.forEach(e=>{n.groups[e].edit&&(e=>0<t.groups[e].name.replace(/ /g,"").length)(e)?(delete n.groups[e].edit,n.groups[e].open||delete n.groups[e].selected,delete n.groups[e].focus,delete n.groups[e].temp,delete n.groups[e].prevName):(n.groups[e].edit=!0,c||(n.groups[e].focus=!0,c=!0))}),o(n),S()},x=e=>{w([e])},S=()=>{const e=D();if(e.length){const t=document.querySelector("[data-edit="+e.shift()+"]");t&&t.focus()}},P=(e,t)=>{const n=F(),c=n.indexOf(e),a="n"===t?c+1:c-1;let l=null;return n[a]&&(l=n[a]),l!==e?l:null},G=e=>{const n=[];return Object.keys(t.groups).forEach(c=>{t.groups[c][e]&&n.push(c)}),n},C=()=>G("selected"),D=()=>G("edit"),L=e=>{if("ArrowRight"===e.key)b(C(),!0);else if("ArrowLeft"===e.key)b(C(),!1);else if("ArrowUp"===e.key)e.preventDefault(),e.shiftKey||g(F(),!1),m(P(t.activeGroup,"p"));else if("ArrowDown"===e.key)e.preventDefault(),e.shiftKey||g(F(),!1),m(P(t.activeGroup,"n"));else if("Enter"===e.key&&e.target.dataset.edit)x(e.target.dataset.edit);else if("Enter"===e.key)e.stopPropagation(),e.preventDefault(),w(C());else if("/"===e.key)e.preventDefault(),e.stopPropagation(),E("");else if("Escape"===e.key){const n=e.path[0].dataset.edit;t.groups[n]&&((e=>!!t.groups[e].temp)(n)?h(n):(O(n,"",!0),S()))}else if("Delete"===e.key){const e=C();e.length&&j(e,!0)}else"s"===e.key&&e.metaKey&&(e.preventDefault(),N())},F=()=>t.groups?Object.keys(t.groups):[];r.a.useEffect(()=>(window.addEventListener("keydown",L),()=>{window.removeEventListener("keydown",L)}));const A={selectGroup:m,createGroup:E,deleteGroup:h,deleteGroups:j,changeName:O,handleSave:N,editGroup:x,getList:F,addPlugins:(e,n)=>{if(t.groups[e]){const c=u();n.forEach(n=>{-1===t.groups[e].plugins.indexOf(n)&&c.groups[e].plugins.push(n)}),o(c)}},addKeyword:(e,t)=>{const n=u();n.groups[e].keywords.push(t),o(n)},removeKeyword:(e,t)=>{const n=u(),c=n.groups[e].keywords.indexOf(t);n.groups[e].keywords.splice(c,1),o(n)},removePlugin:(e,t)=>{f(e,[t])},openGroup:e=>{if(t.groups[e]){const t=u();t.groups[e].open=!t.groups[e].open,t.groups[e].selected=!0,t.activeGroup=e,p(t)}},selectGroups:g,getSelected:C,handleExport:()=>{const e=JSON.stringify(new Date).replace(/"/g,"-").replace(/:/g,"-").split(".")[0],n=new Blob([JSON.stringify(t.groups)],{type:"application/json"}),c=URL.createObjectURL(n),a=document.createElement("a");a.href=c,a.download="plugin-groups-export"+e+".json",a.dispatchEvent(new MouseEvent("click",{bubbles:!0,cancelable:!0,view:window}))},handleImport:e=>{const t=new FileReader;t.addEventListener("loadend",e=>{let t=JSON.parse(e.target.result);if(t){t["plugin-groups-setup"]&&(t=(e=>{const t={};return Object.keys(e.group).map(n=>{const c=e.group[n];t[n]={id:n,name:c.config.group_name,plugins:c.config.plugins?c.config.plugins:[],keywords:c.config.keywords.length?c.config.keywords.split(" "):[]}}),console.log(e),t})(t));const e=u();e.groups=t,o(e)}}),t.readAsText(e.target.files[0])},togglePreset:e=>{const t=u();t.selectedPresets||(t.selectedPresets=[]);const n=t.selectedPresets.indexOf(e);-1===n?t.selectedPresets.push(e):t.selectedPresets.splice(n,1),o(t)},removePlugins:f,navTab:e=>{s(e)},tab:c,setParam:(e,t)=>{const n=u();n.params[e]||(n.params[e]=null),n.params[e]=t,o(n)}};return Object(l.createElement)("div",{className:t.slug},1===c&&Object(l.createElement)(l.Fragment,null,Object(l.createElement)(d,a()({},A,t)),Object(l.createElement)("div",{className:"ui-body"},Object(l.createElement)(y,a()({},t,A)),Object(l.createElement)(v,a()({},t,A)),Object(l.createElement)(k,a()({},t,A)))),2===c&&Object(l.createElement)(l.Fragment,null,Object(l.createElement)(d,a()({},A,t)),Object(l.createElement)(_,a()({},A,t))))}var S={init(e){u.a.render(Object(l.createElement)(x,e),document.getElementById("plg-app"))}};n(4);const P={init(){window.localStorage.removeItem("_plgUnsaved"),plgData.groups||(plgData.groups={}),plgData.selectedPresets||(plgData.selectedPresets=[]),plgData.activeGroup=!1,S.init(plgData)}};window.addEventListener("load",()=>P.init()),window.onbeforeunload=function(e){if(window.localStorage.getItem("_plgUnsaved"))return!1}}]);
     1!function(e){var t={};function n(c){if(t[c])return t[c].exports;var a=t[c]={i:c,l:!1,exports:{}};return e[c].call(a.exports,a,a.exports,n),a.l=!0,a.exports}n.m=e,n.c=t,n.d=function(e,t,c){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:c})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var c=Object.create(null);if(n.r(c),Object.defineProperty(c,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)n.d(c,a,function(t){return e[t]}.bind(null,a));return c},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=6)}([function(e,t){e.exports=window.wp.element},function(e,t){e.exports=window.wp.i18n},function(e,t){function n(){return e.exports=n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var c in n)Object.prototype.hasOwnProperty.call(n,c)&&(e[c]=n[c])}return e},e.exports.default=e.exports,e.exports.__esModule=!0,n.apply(this,arguments)}e.exports=n,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=window.React},function(e,t,n){"use strict";n.r(t)},function(e,t){e.exports=window.ReactDOM},function(e,t,n){"use strict";n.r(t);var c=n(2),a=n.n(c),s=n(0),l=n(3),r=n.n(l),o=n(5),i=n.n(o),u=n(1);function d(e){const{loadURL:t,setConfig:n,restNonce:c,navTab:a}=e;return Object(s.createElement)("select",{onChange:e=>{(e=>{const{id:t,loadURL:n,setConfig:c,restNonce:a,navTab:s}=e;window.localStorage.getItem("_plgUnsaved")&&!confirm(Object(u.__)("Changes that you made may not be saved.",e.slug))||(s(0),fetch(n+"?siteID="+t,{method:"GET",headers:{"X-WP-Nonce":a}}).then(e=>e.json()).then(e=>{c(e),window.localStorage.removeItem("_plgUnsaved"),s(1)}))})({id:e.target.value,loadURL:t,setConfig:n,restNonce:c,navTab:a})}},e.sites.map(t=>{const n=parseInt(t.blog_id);return Object(s.createElement)("option",{value:n,selected:n===e.siteID},t.domain)}))}function p(e){const{navTab:t,tab:n,pluginName:c,version:a,handleSave:l,handleExport:r,handleImport:o,saving:i,sites:p}=e;return Object(s.createElement)(s.Fragment,null,Object(s.createElement)("header",{className:"ui-header"},Object(s.createElement)("span",null,Object(s.createElement)("h2",null,c)),Object(s.createElement)("span",{className:"ui-header-version"},a),0===n&&Object(s.createElement)("span",{className:"ui-header-multisite"},Object(u.__)("Loading site config.",e.slug)),0!==n&&Object(s.createElement)(s.Fragment,null,p&&Object(s.createElement)("span",{className:"ui-header-multisite"},Object(s.createElement)(d,e)),Object(s.createElement)("button",{className:"button button-primary",type:"button",onClick:l,disabled:i},Object(u.__)("Save Settings",e.slug)),Object(s.createElement)("button",{className:"button button-primary",type:"button",onClick:r},"Export"),Object(s.createElement)("label",{className:"button button-primary",type:"button",onClick:""},"Import",Object(s.createElement)("input",{className:"importer-input",type:"file",onChange:o})))),0!==n&&Object(s.createElement)("ul",{className:"ui-navigation"},Object(s.createElement)("li",{className:1===n?"ui-navigation-link active":"ui-navigation-link",onClick:()=>t(1)},Object(u.__)("Groups Management",e.slug)),p&&e.mainSite===e.siteID&&Object(s.createElement)("li",{className:3===n?"ui-navigation-link active":"ui-navigation-link",onClick:()=>t(3)},Object(u.__)("Multisite",e.slug)),Object(s.createElement)("li",{className:2===n?"ui-navigation-link active":"ui-navigation-link",onClick:()=>t(2)},Object(u.__)("Settings",e.slug))))}function m(e){const{name:t,id:n,changeName:c,editGroup:a,temp:l,focus:r}=e;return Object(s.createElement)("input",{className:"ui-body-edit-title",autoFocus:r,onFocus:e=>{e.target.select()},value:t,onInput:e=>{c(n,e.target.value)},onBlur:e=>{e.target.value.length?e.target.value.length&&"/"!==e.target.value&&a(n):e.target.focus()},type:"text","data-edit":n})}function g(e){const{title:t,collapse:n,height:c}=e,[a,l]=r.a.useState(n||"open"),o="open"===a?"dashicons-arrow-up-alt2":"dashicons-arrow-down-alt2",i=n?"collapsible":"";return Object(s.createElement)("div",{className:"ui-panel"},Object(s.createElement)("div",{className:"ui-panel-header "+i,onClick:()=>{n&&l("open"===a?"closed":"open")}},Object(s.createElement)("h3",{className:"ui-panel-header-title"},t),n&&Object(s.createElement)("span",{className:"dashicons "+o})),"open"===a&&Object(s.createElement)("div",{className:"ui-panel-body "+a},e.children))}function b(e){const{name:t,version:n,id:c,callback:a,checked:l,bold:r,subname:o,className:i,disabled:u}=e,d=i||"";return Object(s.createElement)("div",{className:"ui-body-sidebar-list-item "+d},Object(s.createElement)("label",null,Object(s.createElement)("input",{type:"checkbox",checked:l,value:c,onChange:a,disabled:u}),Object(s.createElement)("span",null,r?Object(s.createElement)("strong",null,t):Object(s.createElement)("span",null,t),o&&Object(s.createElement)("div",null,o))),Object(s.createElement)("span",{className:"children"},n&&Object(s.createElement)("span",{className:"version"},n),e.children))}function O(e){const{group:t,plugins:n,removePlugins:c,removePlugin:a}=e,[l,o]=r.a.useState([]),i=0<t.plugins.length,d=e=>{const t=[...l];e.target.checked?t.push(e.target.value):t.splice(t.indexOf(e.target.value),1),o(t)};return Object(s.createElement)(g,{title:Object(u.__)("Grouped plugins",e.slug)},i&&Object(s.createElement)(s.Fragment,null,Object(s.createElement)(b,{name:Object(u.__)("Select All",e.slug),className:"list-control",callback:e=>{e.target.checked?o(t.plugins):o([])},checked:l.length===t.plugins.length},Object(s.createElement)("button",{disabled:!l.length,type:"button",className:"button",onClick:e=>{c(t.id,[...l])}},Object(u.__)("Remove selected",e.slug))),Object(s.createElement)("div",{className:"ui-body-edit-plugins"},t.plugins.map((e,c)=>{const r=n[e];return Object(s.createElement)(b,{name:r.Name,version:r.Version,checked:-1<l.indexOf(e),id:e,callback:d},Object(s.createElement)("label",{className:"dashicons dashicons-no-alt",onClick:()=>a(t.id,e)}))}))),!i&&Object(s.createElement)("div",{className:"ui-body-edit-plugins"},Object(s.createElement)("span",{className:"ui-body-edit-plugins-item"},Object(u.__)("No plugins selected",e.slug))))}function j({group:e,removeKeyword:t}){const{id:n,keywords:c}=e;return c.map(e=>Object(s.createElement)("span",{className:"ui-keyword"},e,Object(s.createElement)("label",{className:"dashicons dashicons-no-alt",onClick:()=>t(n,e)})))}function E(e){const{group:t,addKeyword:n,removeKeyword:c}=e;return Object(s.createElement)("div",{className:"ui-body-sidebar-list-item-section"},Object(s.createElement)(g,{title:Object(u.__)("Keywords",e.slug)},Object(s.createElement)(j,{group:t,removeKeyword:c,addKeyword:n}),Object(s.createElement)("hr",null),Object(s.createElement)("input",{className:"regular-text keywords-input",type:"text",placeholder:Object(u.__)("Add keyword"),"data-keywords":!0,onKeyDown:e=>{const c=e.target.value.trim();"Enter"!==e.key&&","!==e.key||(e.preventDefault(),e.stopPropagation(),e.target.dataset.keywords&&0<c.length&&(n(t.id,c),e.target.value=""))}})))}function h(e){const{group:t}=e;return Object(s.createElement)("div",{className:"ui-body-sidebar-list-item-edit"},Object(s.createElement)(O,e),Object(s.createElement)(E,e))}function f(e){const{selectGroup:t,openGroup:n,group:c,changeName:l,editGroup:r,index:o}=e,{temp:i,name:u,id:d,plugins:p,selected:g,open:b,edit:O,focus:j}=c,E=g?"active":"";return Object(s.createElement)(s.Fragment,null,Object(s.createElement)("div",{className:"ui-body-sidebar-list-item "+E},!O&&Object(s.createElement)(s.Fragment,null,Object(s.createElement)("span",null,Object(s.createElement)("input",{type:"checkbox",checked:g,onClick:e=>t(d)}),Object(s.createElement)("span",{className:"ui-body-sidebar-list-item-title",onClick:e=>n(d)},u)),Object(s.createElement)("span",{className:"ui-body-sidebar-list-item-icons"},Object(s.createElement)("span",{className:"dashicons dashicons-edit",onClick:()=>r(d)}),p.length)),O&&Object(s.createElement)(m,{temp:i,name:u,id:d,changeName:l,editGroup:r,focus:j})),!i&&b&&Object(s.createElement)(h,a()({group:c},e)))}function v(e){const{groups:t,getList:n,edit:c}=e;return n().map((n,l)=>{const r=t[n];return Object(s.createElement)(f,a()({index:l,group:r,editing:n===c},e))})}function y(e){const{getList:t,createGroup:n,deleteGroups:c,selectGroups:a,getSelected:l}=e,r=l().length===Object.keys(e.groups).length;return Object(s.createElement)("div",{className:"ui-body-sidebar wide"},Object(s.createElement)(g,{title:Object(u.__)("Groups")},Object(s.createElement)("div",{className:"ui-body-sidebar-list"},0!==t().length&&Object(s.createElement)(s.Fragment,null,Object(s.createElement)(b,{name:Object(u.__)("Select All"),bold:!0,callback:t=>{a(Object.keys(e.groups),t.target.checked)},checked:r,className:"list-control"},Object(s.createElement)("button",{disabled:!l().length,type:"button",className:"button",onClick:()=>{c(l(),!0)}},Object(s.createElement)("span",{className:"text"}," ",Object(u.__)("Delete selected",e.slug)," "),Object(s.createElement)("span",{className:"dashicons dashicons-trash"}))),Object(s.createElement)(v,e)),0===t().length&&Object(s.createElement)("div",{className:"description"},Object(s.createElement)("span",{className:"ui-body-edit-plugins-item"},Object(u.__)("No groups created",e.slug))))),Object(s.createElement)("button",{type:"button",className:"button",onClick:()=>n("",!0)},Object(u.__)("Create new group",e.slug)))}function k(e){const{plugins:t,addPlugins:n}=e,[c,a]=r.a.useState({checkedAll:!1,search:"",checked:[]}),l=Object.keys(t),o=e=>{a({...c,...e})},i=e=>{const n={checked:[]};e&&l.forEach(e=>{const c=t[e];p(c.Name)&&n.checked.push(e)}),n.checkedAll=n.checked.length,o(n)},d=e=>{const t={...c},n=t.checked.indexOf(e.target.value);e.target.checked&&-1===n?t.checked.push(e.target.value):!e.target.checked&&-1<n&&t.checked.splice(n,1),t.checked.length!==t.checkedAll&&(t.checkedAll=0),t.checked.length===l.length?i(!0):o(t)},p=e=>!c.search||-1<e.toLowerCase().indexOf(c.search.toLowerCase()),m=c.checked.length&&(()=>{for(const t in e.groups)if(e.groups[t].selected)return!0;return!1})();return Object(s.createElement)("div",{className:"ui-body-sidebar"},Object(s.createElement)(g,{title:Object(u.__)("Plugins",e.slug)},Object(s.createElement)("input",{className:"regular-text search",placeholder:Object(u.__)("Search",e.slug),type:"search",onInput:e=>{o({search:e.target.value})},value:c.search}),Object(s.createElement)(b,{name:Object(u.__)("Select all",e.slug),id:"all",callback:e=>i(e.target.checked),checked:c.checkedAll,bold:!0,className:"list-control"},Object(s.createElement)("button",{className:"button",type:"button",onClick:()=>{Object.keys(e.groups).forEach(t=>{e.groups[t].selected&&n(t,c.checked)}),i(!1)},disabled:!m},Object(s.createElement)("span",{className:"text"},Object(u.__)("Send to Selected Groups")),Object(s.createElement)("span",{className:"dashicons dashicons-arrow-right-alt2"}))),Object(s.createElement)("div",{className:"plugins-list"},Object(s.createElement)("div",{className:"ui-body-sidebar-list"},l.map((e,n)=>{const a=t[e],l=p(a.Name),r=-1<c.checked.indexOf(e)&&p(a.Name);return Object(s.createElement)(s.Fragment,null,l&&Object(s.createElement)(b,{name:a.Name,id:e,version:a.Version,checked:r,callback:d}))})))))}function N(e){const{togglePreset:t,selectedPresets:n,presets:c,slug:a}=e;return Object(s.createElement)("div",{className:"ui-body-sidebar narrow"},Object(s.createElement)(g,{title:Object(u.__)("Presets",a)},c.map(e=>Object(s.createElement)(b,{name:e,id:e,checked:-1<n.indexOf(e),callback:()=>t(e)}))))}function w(e){const{presets:t,getList:n}=e;return Object(s.createElement)("div",null,Object(s.createElement)("select",null,t.map((e,t)=>{if(!(5<t))return Object(s.createElement)("option",null,e," (",t+1,")")})))}function _(e){const{presets:t,className:n,setParam:c,params:a,styleName:l}=e,r=a.navStyle&&n===a.navStyle?" selected":"";return Object(s.createElement)("div",{className:"plugin-groups nav-settings"+r,onClick:()=>{c("navStyle",n)}},Object(s.createElement)("label",null,l),"groups-dropdown"===n&&Object(s.createElement)(w,e),"groups-dropdown"!==n&&Object(s.createElement)("ul",{className:n},t.map((e,t)=>{if(!(5<t))return Object(s.createElement)(s.Fragment,null,Object(s.createElement)("li",null,Object(s.createElement)("a",{className:0===t?"current":""},e,Object(s.createElement)("span",{className:"count"}," (",t+1,")"))))})))}function x(e){const{params:t,setParam:n}=e;return Object(s.createElement)("div",{className:"ui-body"},Object(s.createElement)("div",{className:"ui-body-sidebar"},Object(s.createElement)(g,{title:"Settings"},Object(s.createElement)(b,{name:Object(u.__)("Use Legacy status based grouping",e.slug),checked:t.legacyGrouping,callback:e=>n("legacyGrouping",e.target.checked)}),Object(s.createElement)(b,{name:Object(u.__)("Enable admin menu",e.slug),checked:t.menuGroups,callback:e=>n("menuGroups",e.target.checked)}))),!t.legacyGrouping&&Object(s.createElement)("div",{className:"ui-body-sidebar full"},Object(s.createElement)(g,{title:Object(u.__)("Navigation style",e.slug)},Object(s.createElement)(_,a()({styleName:Object(u.__)("Legacy",e.slug),className:"subsubsub"},e)),Object(s.createElement)(_,a()({styleName:Object(u.__)("Modern",e.slug),className:"groups-modern"},e)),Object(s.createElement)(_,a()({styleName:Object(u.__)("Dropdown",e.slug),className:"groups-dropdown"},e)))))}function S(e){const{params:t,setSiteAccess:n}=e,c=e.sites.map(e=>parseInt(e.blog_id));return Object(s.createElement)("div",{className:"ui-body"},Object(s.createElement)("div",{className:"ui-body-sidebar"},Object(s.createElement)(g,{title:"Sites with full access"},Object(s.createElement)(b,{name:Object(u.__)("Select All"),bold:!0,callback:e=>n(c,e.target.checked),className:"list-control",checked:e.sites.length===e.sitesEnabled.length}),e.sites.map(t=>{const c=parseInt(t.blog_id);return Object(s.createElement)(b,{name:t.domain,checked:e.mainSite===c||-1<e.sitesEnabled.indexOf(c),disabled:e.mainSite===c,callback:e=>n([c],e.target.checked)},e.mainSite===c&&Object(s.createElement)("span",null,Object(u.__)("Main Site",e.slug)))}))))}function P(e){const[t,n]=r.a.useState(e),[c,l]=r.a.useState(1),o=e=>{window.localStorage.setItem("_plgUnsaved",!0),e.groups&&e.groups.constructor===Array&&(e.groups={...e.groups}),n(e)},i=()=>({...t}),d=e=>{o({...t,...e})},m=e=>{g([e])},g=(e,t)=>{const n=i();e.forEach(e=>{if(null===e)return;const c=void 0!==t?!t:n.groups[e].selected;n.groups[e].selected=!c,c&&(delete n.groups[e].open,delete n.groups[e].edit,delete n.groups[e].focus),n.activeGroup=e}),o(n)},b=(e,t)=>{const n=i();e.forEach(e=>{n.groups[e].open=t}),d(n)},O=(e,t,n)=>{const c=i();n||c.groups[e].prevName?n&&(t=c.groups[e].prevName?c.groups[e].prevName:c.groups[e].name,delete c.groups[e].prevName,delete c.groups[e].edit,delete c.groups[e].selected,delete c.groups[e].open):c.groups[e].prevName=c.groups[e].name,c.groups[e].name=t,o(c)},j=(e,n)=>{const c=i();n&&!confirm(Object(u._n)("Delete the selected group?","Delete the selected groups",e.length,t.slug))||(e.forEach(e=>{delete c.groups[e]}),o(c))},E=e=>{j([e])},h=e=>{const t="pgxxxxx".replace(/x/g,(function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})),n={id:t,name:e,plugins:[],keywords:[],temp:!0,selected:!0,edit:!0,focus:!0},c=i();c.groups||(c.groups={}),c.groups[t]=n,o(c)},f=(e,n)=>{const c=i();n.map(n=>{const a=t.groups[e].plugins.indexOf(n);-1<a&&c.groups[e].plugins.splice(a,1)}),o(c)},v=()=>{const e=i(),{groups:n,selectedPresets:c,params:a,sitesEnabled:s,siteID:l}=e,r=JSON.stringify({groups:n,selectedPresets:c,params:a,sitesEnabled:s,siteID:l});e.saving=!0,fetch(t.saveURL,{method:"POST",headers:{"Content-Type":"application/json","X-WP-Nonce":t.restNonce},body:r}).then(e=>e.json()).then(n=>{e.saving=!1,o(t),window.localStorage.removeItem("_plgUnsaved")}),o(e)},w=e=>{const n=i();let c=!1;e.forEach(e=>{n.groups[e].edit&&(e=>0<t.groups[e].name.replace(/ /g,"").length)(e)?(delete n.groups[e].edit,n.groups[e].open||delete n.groups[e].selected,delete n.groups[e].focus,delete n.groups[e].temp,delete n.groups[e].prevName):(n.groups[e].edit=!0,c||(n.groups[e].focus=!0,c=!0))}),o(n),P()},_=e=>{w([e])},P=()=>{const e=I();if(e.length){const t=document.querySelector("[data-edit="+e.shift()+"]");t&&t.focus()}},G=(e,t)=>{const n=A(),c=n.indexOf(e),a="n"===t?c+1:c-1;let s=null;return n[a]&&(s=n[a]),s!==e?s:null},C=e=>{const n=[];return Object.keys(t.groups).forEach(c=>{t.groups[c][e]&&n.push(c)}),n},D=()=>C("selected"),I=()=>C("edit"),L=e=>{if("ArrowRight"===e.key)b(D(),!0);else if("ArrowLeft"===e.key)b(D(),!1);else if("ArrowUp"===e.key)e.preventDefault(),e.shiftKey||g(A(),!1),m(G(t.activeGroup,"p"));else if("ArrowDown"===e.key)e.preventDefault(),e.shiftKey||g(A(),!1),m(G(t.activeGroup,"n"));else if("Enter"===e.key&&e.target.dataset.edit)_(e.target.dataset.edit);else if("Enter"===e.key)e.stopPropagation(),e.preventDefault(),w(D());else if("/"===e.key)e.preventDefault(),e.stopPropagation(),h("");else if("Escape"===e.key){const n=e.path[0].dataset.edit;t.groups[n]&&((e=>!!t.groups[e].temp)(n)?E(n):(O(n,"",!0),P()))}else if("Delete"===e.key){const e=D();e.length&&j(e,!0)}else"s"===e.key&&e.metaKey&&(e.preventDefault(),v())},A=()=>t.groups?Object.keys(t.groups):[];r.a.useEffect(()=>(window.addEventListener("keydown",L),()=>{window.removeEventListener("keydown",L)}));const F={setConfig:o,selectGroup:m,createGroup:h,deleteGroup:E,deleteGroups:j,changeName:O,handleSave:v,editGroup:_,getList:A,addPlugins:(e,n)=>{if(t.groups[e]){const c=i();n.forEach(n=>{-1===t.groups[e].plugins.indexOf(n)&&c.groups[e].plugins.push(n)}),o(c)}},addKeyword:(e,t)=>{const n=i();n.groups[e].keywords.push(t),o(n)},removeKeyword:(e,t)=>{const n=i(),c=n.groups[e].keywords.indexOf(t);n.groups[e].keywords.splice(c,1),o(n)},removePlugin:(e,t)=>{f(e,[t])},openGroup:e=>{if(t.groups[e]){const t=i();t.groups[e].open=!t.groups[e].open,t.groups[e].selected=!0,t.activeGroup=e,d(t)}},selectGroups:g,getSelected:D,handleExport:()=>{const e=JSON.stringify(new Date).replace(/"/g,"-").replace(/:/g,"-").split(".")[0],n=new Blob([JSON.stringify(t.groups)],{type:"application/json"}),c=URL.createObjectURL(n),a=document.createElement("a");a.href=c,a.download="plugin-groups-export"+e+".json",a.dispatchEvent(new MouseEvent("click",{bubbles:!0,cancelable:!0,view:window}))},handleImport:e=>{const t=new FileReader;t.addEventListener("loadend",e=>{let t=JSON.parse(e.target.result);if(t){t["plugin-groups-setup"]&&(t=(e=>{const t={};return Object.keys(e.group).map(n=>{const c=e.group[n];t[n]={id:n,name:c.config.group_name,plugins:c.config.plugins?c.config.plugins:[],keywords:c.config.keywords.length?c.config.keywords.split(" "):[]}}),t})(t));const e=i();e.groups=t,o(e)}}),t.readAsText(e.target.files[0])},togglePreset:e=>{const t=i();t.selectedPresets||(t.selectedPresets=[]);const n=t.selectedPresets.indexOf(e);-1===n?t.selectedPresets.push(e):t.selectedPresets.splice(n,1),o(t)},removePlugins:f,navTab:e=>{l(e)},tab:c,setParam:(e,t)=>{const n=i();n.params[e]||(n.params[e]=null),n.params[e]=t,o(n)},setSiteAccess:(e,c)=>{const a=i();e.map(e=>{const n=t.sitesEnabled.indexOf(e);e!==t.mainSite&&(!0===c&&-1===n?a.sitesEnabled.push(e):!1===c&&-1<n&&a.sitesEnabled.splice(n,1))}),n(a)}};return Object(s.createElement)("div",{className:t.slug},1===c&&Object(s.createElement)(s.Fragment,null,Object(s.createElement)(p,a()({},F,t)),Object(s.createElement)("div",{className:"ui-body"},Object(s.createElement)(k,a()({},t,F)),Object(s.createElement)(y,a()({},t,F)),Object(s.createElement)(N,a()({},t,F)))),2===c&&Object(s.createElement)(s.Fragment,null,Object(s.createElement)(p,a()({},F,t)),Object(s.createElement)(x,a()({},F,t))),3===c&&Object(s.createElement)(s.Fragment,null,Object(s.createElement)(p,a()({},F,t)),Object(s.createElement)(S,a()({},F,t))),0===c&&Object(s.createElement)(s.Fragment,null,Object(s.createElement)(p,a()({},F,t))))}var G={init(e){i.a.render(Object(s.createElement)(P,e),document.getElementById("plg-app"))}};n(4);const C={init(){window.localStorage.removeItem("_plgUnsaved"),plgData.groups||(plgData.groups={}),plgData.selectedPresets||(plgData.selectedPresets=[]),plgData.activeGroup=!1,G.init(plgData)}};window.addEventListener("load",()=>C.init()),window.onbeforeunload=()=>{if(window.localStorage.getItem("_plgUnsaved"))return!1}}]);
  • plugin-groups/trunk/plugincore.php

    r2586010 r2586331  
    44 * Plugin URI: https://cramer.co.za
    55 * Description: Organize Plugins in groups
    6  * Version: 2.0.1
     6 * Version: 2.0.2
    77 * Author: David Cramer
    88 * Author URI: https://cramer.co.za
     
    2020define( 'PLGGRP_CORE', __FILE__ );
    2121define( 'PLGGRP_URL', plugin_dir_url( __FILE__ ) );
     22define( 'PLGGRP_SLUG', basename( __DIR__ ) . '/' . basename( __FILE__ ) );
    2223
    2324if ( ! version_compare( PHP_VERSION, '5.6', '>=' ) ) {
     
    3132
    3233function plugin_groups_php_ver() {
     34
    3335    $message = __( 'Plugin Groups requires PHP version 5.6 or later. We strongly recommend PHP 5.6 or later for security and performance reasons.', 'plugin-groups' );
    3436    echo sprintf( '<div id="plugin_groups_error" class="error notice notice-error"><p>%s</p></div>', esc_html( $message ) );
  • plugin-groups/trunk/readme.txt

    r2585994 r2586331  
    55Requires at least: 5.3
    66Tested up to: 5.8
    7 Stable tag: 2.0.1
     7Stable tag: 2.0.2
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    1616
    1717A free plugin by [David Cramer](https://cramer.co.za).
     18
     19[Contribute to the development on GitHub](https://github.com/DavidCramer/plugin-groups)
    1820
    1921== Installation ==
     
    3941
    4042== Changelog ==
     43= 2.0.2 =
     44- Fixed an error where the plugin couldn't read the plugin data (I hope).
     45- Added, Multisite support. Multisite admins can now network active, manage each sites groups individually, or give full access to site to create their own groups.
     46
     47
    4148= 2.0.1 =
    4249- Fixed an error where on upgrade and have no presets, UI broke :(
Note: See TracChangeset for help on using the changeset viewer.