Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions _playground/blueprint-github.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@
"step": "installPlugin",
"pluginData": {
"resource": "git:directory",
"url": "https://github.com/lubusIN/visual-blueprint-builder/",
"ref": "playground"
}
"url": "https: //github.com/lubusIN/visual-blueprint-builder/",
"ref": "HEAD"
Comment thread
Verma-Punit marked this conversation as resolved.
Outdated
}
}
]
}
}
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "wp/playground-blueprint-editor",
"name": "wp/visual-blueprint-builder",
"description": "Design playground blueprints with a specialized block editor interface in WordPress.",
"autoload": {
"classmap": [
Expand Down
30 changes: 18 additions & 12 deletions inc/admin/class-enqueue-scripts.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,27 @@
/**
* This class handles registering and enqueueing scripts and styles.
*
* @package wp-playground-blueprint-editor
* @package visual-blueprint-builder
*/

namespace WP\Admin\PlaygroundBlueprintEditor;
namespace WP\Admin\VisualBlueprintBuilder;

class EnqueueScripts {
class EnqueueScripts
{
/**
* Constructor to initialize WordPress hooks.
*/
public function __construct() {
public function __construct()
{
add_action('enqueue_block_editor_assets', [$this, 'enqueue_editor_scripts']);
add_action('init', [$this, 'set_script_translations']);
}

/**
* Enqueues scripts and styles for the block editor based on a specific post type.
*/
public function enqueue_editor_scripts() {
public function enqueue_editor_scripts()
{
$screen = get_current_screen();

// Only enqueue scripts/styles for the 'blueprint' post type in the editor
Expand All @@ -34,20 +37,21 @@ public function enqueue_editor_scripts() {
/**
* Enqueues the editor-specific assets.
*/
private function enqueue_editor_assets() {
private function enqueue_editor_assets()
{
$assetFile = $this->get_asset_file();

wp_enqueue_script(
'blueprint-editor',
BEPB_PLUGIN_URL . 'build/editor.js',
VBB_PLUGIN_URL . 'build/editor.js',
$assetFile['dependencies'],
$assetFile['version'],
true
);

wp_enqueue_style(
'blueprint-editor',
BEPB_PLUGIN_URL . 'assets/css/editor.css',
VBB_PLUGIN_URL . 'assets/css/editor.css',
[],
'1.0.0'
);
Expand All @@ -58,8 +62,9 @@ private function enqueue_editor_assets() {
*
* @return array|false The asset file array or false on failure.
*/
private function get_asset_file() {
$assetFilePath = BEPB_PLUGIN_DIR . 'build/editor.asset.php';
private function get_asset_file()
{
$assetFilePath = VBB_PLUGIN_DIR . 'build/editor.asset.php';

if (file_exists($assetFilePath)) {
return require $assetFilePath;
Expand All @@ -71,10 +76,11 @@ private function get_asset_file() {
/**
* set script translations function
*/
public function set_script_translations() {
public function set_script_translations()
{
wp_set_script_translations(
'blueprint-editor', // script handle
'wp-playground-blueprint-editor', // Text domain for translations*
'visual-blueprint-builder', // Text domain for translations*
plugin_dir_path(__FILE__) . 'languages' // Path to the language files
);
}
Expand Down
4 changes: 2 additions & 2 deletions inc/admin/class-register-post-type.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
/**
* This class defines a custom post type for creating and managing blueprint.
*
* @package wp-playground-blueprint-editor
* @package visual-blueprint-builder
*/

namespace WP\Admin\PlaygroundBlueprintEditor;
namespace WP\Admin\VisualBlueprintBuilder;

class BlueprintPostType
{
Expand Down
15 changes: 9 additions & 6 deletions inc/admin/class-register-steps.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,26 @@
/**
* This class defines a custom blueprint steps.
*
* @package wp-playground-blueprint-editor
* @package visual-blueprint-builder
*/

namespace WP\Admin\PlaygroundBlueprintEditor;
namespace WP\Admin\VisualBlueprintBuilder;

class BlueprintSteps {
class BlueprintSteps
{
/**
* Construct that hooks into WordPress to initialize blueprint steps.
*/
public function __construct() {
public function __construct()
{
add_action('init', [$this, 'register_blueprint_steps']);
}

/**
* Registers the 'blueprint steps' with necessary arguments and labels.
*/
public function register_blueprint_steps() {
public function register_blueprint_steps()
{
$blueprint_steps = [
'login',
'install-plugin',
Expand Down Expand Up @@ -48,7 +51,7 @@ public function register_blueprint_steps() {
];

foreach ($blueprint_steps as $step) {
register_block_type(BEPB_PLUGIN_DIR . 'build/steps/' . $step);
register_block_type(VBB_PLUGIN_DIR . 'build/steps/' . $step);
}
}
}
4 changes: 2 additions & 2 deletions inc/admin/register-meta.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
/**
* This class for registering a custom meta fields for block editor for playground blueprint.
*
* @package wp-playground-blueprint-editor
* @package visual-blueprint-builder
*/

namespace WP\Admin\PlaygroundBlueprintEditor;
namespace WP\Admin\VisualBlueprintBuilder;

class RegisterCustomMeta
{
Expand Down
4 changes: 2 additions & 2 deletions inc/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
*
* @return array The array of allowed block types.
*/
function filter_allowed_block_types($allowed_block_types, $block_editor_context)
function vbb_filter_allowed_block_types($allowed_block_types, $block_editor_context)
{
// Get all registered block types
$all_blocks = WP_Block_Type_Registry::get_instance()->get_all_registered();
Expand Down Expand Up @@ -68,7 +68,7 @@ function filter_allowed_block_types($allowed_block_types, $block_editor_context)
// Return the filtered list of allowed blocks
return $filtered_blocks;
}
add_filter('allowed_block_types_all', 'filter_allowed_block_types', 10000, 2);
add_filter('allowed_block_types_all', 'vbb_filter_allowed_block_types', 10000, 2);

/**
* Adds a custom block category 'Steps' to the block editor.
Expand Down
35 changes: 35 additions & 0 deletions languages/visual-blueprint-builder.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Copyright (C) 2025 Lubus
# This file is distributed under the same license as the Visual blueprint builder plugin.
msgid ""
msgstr ""
"Project-Id-Version: Visual blueprint builder 1.0.0\n"
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/visual-blueprint-builder\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"POT-Creation-Date: 2025-10-17T06:40:25+00:00\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"X-Generator: WP-CLI 2.11.0\n"
"X-Domain: visual-blueprint-builder\n"

#. Plugin Name of the plugin
#: visual-blueprint-builder.php
msgid "Visual blueprint builder"
msgstr ""

#. Description of the plugin
#: visual-blueprint-builder.php
msgid "Design playground blueprints with a specialized block editor interface in WordPress."
msgstr ""

#. Author of the plugin
#: visual-blueprint-builder.php
msgid "Lubus"
msgstr ""

#. Author URI of the plugin
#: visual-blueprint-builder.php
msgid "https://lubus.in/"
msgstr ""
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "wp-playground-blueprint-editor",
"name": "visual-blueprint-builder",
"version": "1.0.0",
"description": "Design playground blueprints with a specialized block editor interface in WordPress.",
"main": "build/index.js",
Expand All @@ -25,4 +25,4 @@
"ajv": "^8.17.1",
"react-loading-skeleton": "^3.5.0"
}
}
}
16 changes: 12 additions & 4 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
<!-- @format -->

<p align="center"><img width="300" src=".github/vbb-logo.svg"></p>

![Visual Blueprint Builder](.github/visual-blueprint-builder.jpg)

[![Playground Demo Link](https://img.shields.io/badge/Live%20Preview-3858e9?style=for-the-badge&logo=data%3Aimage%2Fsvg%2Bxml%3Bbase64%2CCjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB3aWR0aD0iMTAwIiBoZWlnaHQ9IjEwMCIgZmlsbD0ibm9uZSI%2BPHBhdGggZmlsbD0iI2ZmZiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMTEuOSAzNi40MjVjLTIuMTgxIDMuMDA3LTMuMzMyIDY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Ljg4MS0xMC45MzcgNi45OTQtMTguMDM3LjE5OC0xMi41MzYtNi4zMjctMjcuNDktMTguNTQzLTM5LjcwNkM2Mi4zMi0uNTg4IDM2LjQ2Ni01Ljc2IDIzLjcxIDYuOTk3Yy00LjYxOCA0LjYyLTYuODg3IDEwLjk1NC02Ljk5NCAxOC4wNjYtLjE4NyAxMi41MyA2LjMzNiAyNy40NzEgMTguNTQzIDM5LjY3OFptMjYuOTQ2IDMuMzk1Yy4zNTYgMS43NzcuNDkyIDMuMzg0LjQ1IDQuODI3LTcuMTg1LTIuNTAxLTE0LjgtNy4xNzQtMjEuNjIyLTEzLjk5Ni02LjgyMi02LjgyMi0xMS40OTUtMTQuNDM3LTEzLjk5Ni0yMS42MjMgMS40NDItLjA0IDMuMDUuMDk1IDQuODI2LjQ1IDYuMDUgMS4yMSAxMy4wODEgNC44NzMgMTkuMjc2IDExLjA2NyA2LjE5NCA2LjE5NSA5Ljg1NyAxMy4yMjYgMTEuMDY2IDE5LjI3NVpNMjkuNDg0IDEyLjc3MmMtMy40NTggMy40NTgtNS4zMDIgOS4wOC00LjM3MyAxNi41MjEgOS43ODEtLjk1IDIxLjk3MyAzLjk2NSAzMS44MDIgMTMuNzk0IDkuODI4IDkuODI4IDE0Ljc0NSAyMi4wMiAxMy43OTQgMzEuODAxIDcuNDQuOTMgMTMuMDYzLS45MTUgMTYuNTItNC4zNzIgMy44NDgtMy44NDcgNS42OTgtMTAuMzc2IDMuOTUyLTE5LjEwNC0xLjczMi04LjY2Mi02LjkxNC0xOC41MDUtMTUuNS0yNy4wOTEtOC41ODYtOC41ODYtMTguNDMtMTMuNzY4LTI3LjA5MS0xNS41LTguNzI5LTEuNzQ2LTE1LjI1Ny4xMDQtMTkuMTA0IDMuOTUxWiIgY2xpcC1ydWxlPSJldmVub2RkIi8%2BPC9zdmc%2B&logoSize=auto)](https://playground.wordpress.net/?blueprint-url=https://raw.githubusercontent.com/lubusIN/visual-blueprint-builder/playground/_playground/blueprint-github.json)

### Overview
Playground Blueprint Editor is block based editing experience for building blueprint.json

Visual Blueprint Builder is block based editing experience for building blueprint.json

### Features

- UI based json generation
- blocks to build steps
- Preview blueprint in playground
- Preview blueprint in playground
- download blueprint.json
- copy json code

Expand All @@ -23,16 +27,17 @@ Playground Blueprint Editor is block based editing experience for building bluep

1. Download latest release from GitHub
2. Visit `Plugins > Add New`
3. Upload `visual-blueprint-builder.zip` file
3. Upload `visual-blueprint-builder.zip` file
4. Activate `Visual Blueprint Builder` from plugins page

## Development

### 1. Clone the Repository

Clone the repository to your local system:

```bash
git clone git@github.com:lubusIN/visual-blueprint-builder.git
git clone git@github.com:lubusIN/visual-blueprint-builder.git
```

### 2. Go to package folder
Expand All @@ -49,6 +54,7 @@ composer install
```

### 4. Build Plugin

Build or start the development environment:

```bash
Expand All @@ -58,11 +64,13 @@ npm run start # Watch for changes and auto-compile
```

### 5. Launch Playground

Start a local WordPress playground using wp-now:

```bash
npx @wp-now/wp-now start
```

> [!NOTE]
> Refer to `package.json` for additional available npm commands.

Expand Down
2 changes: 1 addition & 1 deletion src/components/skeleton/plugin-skeleton.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Wordpress dependencies.
* WordPress dependencies.
*/
import { __ } from '@wordpress/i18n';
import {
Expand Down
2 changes: 1 addition & 1 deletion src/components/skeleton/theme-skeleton.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Wordpress dependencies.
* WordPress dependencies.
*/
import { __ } from '@wordpress/i18n';
import {
Expand Down
2 changes: 1 addition & 1 deletion src/steps/activate-plugin/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Wordpress dependencies.
* WordPress dependencies.
*/
import { __ } from '@wordpress/i18n';
import { registerBlockType } from '@wordpress/blocks';
Expand Down
2 changes: 1 addition & 1 deletion src/steps/activate-theme/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Wordpress dependencies.
* WordPress dependencies.
*/
import { __ } from '@wordpress/i18n';
import { registerBlockType } from '@wordpress/blocks';
Expand Down
2 changes: 1 addition & 1 deletion src/steps/cp/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Wordpress dependencies.
* WordPress dependencies.
*/
import { __ } from '@wordpress/i18n';
import { registerBlockType } from '@wordpress/blocks';
Expand Down
2 changes: 1 addition & 1 deletion src/steps/define-site-url/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Wordpress dependencies.
* WordPress dependencies.
*/
import { __ } from '@wordpress/i18n';
import { registerBlockType } from '@wordpress/blocks';
Expand Down
4 changes: 2 additions & 2 deletions src/steps/enable-multisite/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Wordpress dependencies.
* WordPress dependencies.
*/
import { __ } from '@wordpress/i18n';
import { registerBlockType } from '@wordpress/blocks';
Expand All @@ -24,7 +24,7 @@ import metadata from './block.json';
*
* @return {Element} Element to render.
*/
function Edit({isSelected}) {
function Edit({ isSelected }) {

return (
<p {...useBlockProps()}>
Expand Down
2 changes: 1 addition & 1 deletion src/steps/import-theme-starter-content/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Wordpress dependencies.
* WordPress dependencies.
*/
import { __ } from '@wordpress/i18n';
import { registerBlockType } from '@wordpress/blocks';
Expand Down
2 changes: 1 addition & 1 deletion src/steps/login/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Wordpress dependencies.
* WordPress dependencies.
*/
import { __ } from '@wordpress/i18n';
import { registerBlockType } from '@wordpress/blocks';
Expand Down
2 changes: 1 addition & 1 deletion src/steps/mv/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Wordpress dependencies.
* WordPress dependencies.
*/
import { __ } from '@wordpress/i18n';
import { registerBlockType } from '@wordpress/blocks';
Expand Down
Loading