[ Index ]

PHP Cross Reference of BuddyPress

title

Body

[close]

/src/bp-members/js/blocks/ -> active-members.js (source)

   1  // modules are defined as an array
   2  // [ module function, map of requires ]
   3  //
   4  // map of requires is short require name -> numeric require
   5  //
   6  // anything defined in a previous bundle is accessed via the
   7  // orig method which is the require for previous bundles
   8  parcelRequire = (function (modules, cache, entry, globalName) {
   9    // Save the require from previous bundle to this closure if any
  10    var previousRequire = typeof parcelRequire === 'function' && parcelRequire;
  11    var nodeRequire = typeof require === 'function' && require;
  12  
  13    function newRequire(name, jumped) {
  14      if (!cache[name]) {
  15        if (!modules[name]) {
  16          // if we cannot find the module within our internal map or
  17          // cache jump to the current global require ie. the last bundle
  18          // that was added to the page.
  19          var currentRequire = typeof parcelRequire === 'function' && parcelRequire;
  20          if (!jumped && currentRequire) {
  21            return currentRequire(name, true);
  22          }
  23  
  24          // If there are other bundles on this page the require from the
  25          // previous one is saved to 'previousRequire'. Repeat this as
  26          // many times as there are bundles until the module is found or
  27          // we exhaust the require chain.
  28          if (previousRequire) {
  29            return previousRequire(name, true);
  30          }
  31  
  32          // Try the node require function if it exists.
  33          if (nodeRequire && typeof name === 'string') {
  34            return nodeRequire(name);
  35          }
  36  
  37          var err = new Error('Cannot find module \'' + name + '\'');
  38          err.code = 'MODULE_NOT_FOUND';
  39          throw err;
  40        }
  41  
  42        localRequire.resolve = resolve;
  43        localRequire.cache = {};
  44  
  45        var module = cache[name] = new newRequire.Module(name);
  46  
  47        modules[name][0].call(module.exports, localRequire, module, module.exports, this);
  48      }
  49  
  50      return cache[name].exports;
  51  
  52      function localRequire(x){
  53        return newRequire(localRequire.resolve(x));
  54      }
  55  
  56      function resolve(x){
  57        return modules[name][1][x] || x;
  58      }
  59    }
  60  
  61    function Module(moduleName) {
  62      this.id = moduleName;
  63      this.bundle = newRequire;
  64      this.exports = {};
  65    }
  66  
  67    newRequire.isParcelRequire = true;
  68    newRequire.Module = Module;
  69    newRequire.modules = modules;
  70    newRequire.cache = cache;
  71    newRequire.parent = previousRequire;
  72    newRequire.register = function (id, exports) {
  73      modules[id] = [function (require, module) {
  74        module.exports = exports;
  75      }, {}];
  76    };
  77  
  78    var error;
  79    for (var i = 0; i < entry.length; i++) {
  80      try {
  81        newRequire(entry[i]);
  82      } catch (e) {
  83        // Save first error but execute all entries
  84        if (!error) {
  85          error = e;
  86        }
  87      }
  88    }
  89  
  90    if (entry.length) {
  91      // Expose entry point to Node, AMD or browser globals
  92      // Based on https://github.com/ForbesLindesay/umd/blob/master/template.js
  93      var mainExports = newRequire(entry[entry.length - 1]);
  94  
  95      // CommonJS
  96      if (typeof exports === "object" && typeof module !== "undefined") {
  97        module.exports = mainExports;
  98  
  99      // RequireJS
 100      } else if (typeof define === "function" && define.amd) {
 101       define(function () {
 102         return mainExports;
 103       });
 104  
 105      // <script>
 106      } else if (globalName) {
 107        this[globalName] = mainExports;
 108      }
 109    }
 110  
 111    // Override the current require with this new one
 112    parcelRequire = newRequire;
 113  
 114    if (error) {
 115      // throw error from earlier, _after updating parcelRequire_
 116      throw error;
 117    }
 118  
 119    return newRequire;
 120  })({"TOWc":[function(require,module,exports) {
 121  "use strict";
 122  
 123  Object.defineProperty(exports, "__esModule", {
 124    value: true
 125  });
 126  exports.default = void 0;
 127  
 128  /**
 129   * WordPress dependencies.
 130   */
 131  const {
 132    blockEditor: {
 133      InspectorControls
 134    },
 135    components: {
 136      Disabled,
 137      PanelBody,
 138      RangeControl,
 139      TextControl
 140    },
 141    element: {
 142      Fragment,
 143      createElement
 144    },
 145    i18n: {
 146      __
 147    },
 148    serverSideRender: ServerSideRender
 149  } = wp;
 150  
 151  const editActiveMembersBlock = ({
 152    attributes,
 153    setAttributes
 154  }) => {
 155    const {
 156      title,
 157      maxMembers
 158    } = attributes;
 159    return createElement(Fragment, null, createElement(InspectorControls, null, createElement(PanelBody, {
 160      title: __('Settings', 'buddypress'),
 161      initialOpen: true
 162    }, createElement(TextControl, {
 163      label: __('Title', 'buddypress'),
 164      value: title,
 165      onChange: text => {
 166        setAttributes({
 167          title: text
 168        });
 169      }
 170    }), createElement(RangeControl, {
 171      label: __('Max members to show', 'buddypress'),
 172      value: maxMembers,
 173      onChange: value => setAttributes({
 174        maxMembers: value
 175      }),
 176      min: 1,
 177      max: 15,
 178      required: true
 179    }))), createElement(Disabled, null, createElement(ServerSideRender, {
 180      block: "bp/active-members",
 181      attributes: attributes
 182    })));
 183  };
 184  
 185  var _default = editActiveMembersBlock;
 186  exports.default = _default;
 187  },{}],"y7A5":[function(require,module,exports) {
 188  "use strict";
 189  
 190  Object.defineProperty(exports, "__esModule", {
 191    value: true
 192  });
 193  exports.default = void 0;
 194  
 195  /**
 196   * WordPress dependencies.
 197   */
 198  const {
 199    blocks: {
 200      createBlock
 201    }
 202  } = wp;
 203  /**
 204   * Transforms Legacy Widget to Active Members Block.
 205   *
 206   * @type {Object}
 207   */
 208  
 209  const transforms = {
 210    from: [{
 211      type: 'block',
 212      blocks: ['core/legacy-widget'],
 213      isMatch: ({
 214        idBase,
 215        instance
 216      }) => {
 217        if (!(instance !== null && instance !== void 0 && instance.raw)) {
 218          return false;
 219        }
 220  
 221        return idBase === 'bp_core_recently_active_widget';
 222      },
 223      transform: ({
 224        instance
 225      }) => {
 226        return createBlock('bp/active-members', {
 227          title: instance.raw.title,
 228          maxMembers: instance.raw.max_members
 229        });
 230      }
 231    }]
 232  };
 233  var _default = transforms;
 234  exports.default = _default;
 235  },{}],"dkrW":[function(require,module,exports) {
 236  "use strict";
 237  
 238  var _edit = _interopRequireDefault(require("./active-members/edit"));
 239  
 240  var _transforms = _interopRequireDefault(require("./active-members/transforms"));
 241  
 242  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
 243  
 244  /**
 245   * WordPress dependencies.
 246   */
 247  const {
 248    blocks: {
 249      registerBlockType
 250    },
 251    i18n: {
 252      __
 253    }
 254  } = wp;
 255  /**
 256   * Internal dependencies.
 257   */
 258  
 259  registerBlockType('bp/active-members', {
 260    title: __('Recently Active Members', 'buddypress'),
 261    description: __('Profile photos of recently active members.', 'buddypress'),
 262    icon: {
 263      background: '#fff',
 264      foreground: '#d84800',
 265      src: 'groups'
 266    },
 267    category: 'buddypress',
 268    attributes: {
 269      title: {
 270        type: 'string',
 271        default: __('Recently Active Members', 'buddypress')
 272      },
 273      maxMembers: {
 274        type: 'number',
 275        default: 15
 276      }
 277    },
 278    edit: _edit.default,
 279    transforms: _transforms.default
 280  });
 281  },{"./active-members/edit":"TOWc","./active-members/transforms":"y7A5"}]},{},["dkrW"], null)


Generated: Wed Jan 19 01:01:00 2022 Cross-referenced by PHPXref 0.7.1