Sindbad~EG File Manager

Current Path : /home/julesbu/www/wp-content/plugins/kk-star-ratings/src/core/public/js/
Upload File :
Current File : /home/julesbu/www/wp-content/plugins/kk-star-ratings/src/core/public/js/blocks.js

/**
 * kk Star Ratings
 * @see https://github.com/kamalkhan/kk-star-ratings
 */

"use strict";

(function (window, blocks) {
  function createRegisterFn(payloads) {
    return function (name, callback) {
      if (name.indexOf("/") < 0) {
        name = "kk-star-ratings/" + name;
      }

      if (!payloads[name]) {
        throw new Error("The '" + name + "' block is not registered.");
      }

      var optionsOrEditFn = callback({
        name,
        data: payloads[name]["data"] || {},
      });

      var options = Object.assign(
        {},
        payloads[name]["meta"] || {},
        optionsOrEditFn instanceof Function
          ? {
              edit: optionsOrEditFn,
            }
          : optionsOrEditFn
      );

      return blocks.registerBlockType(name, options);
    };
  }

  window.kkStarRatingsBlocks = {
    register: createRegisterFn(kk_star_ratings_blocks),
  };
})(window, window.wp.blocks);

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists