{
	"$schema": "https://playground.wordpress.net/blueprint-schema.json",
	"landingPage": "/",
	"preferredVersions": {
		"php": "8.2",
		"wp": "latest"
	},
	"phpExtensionBundles": [
		"kitchen-sink"
	],
	"features": {
		"networking": true
	},
	"steps": [
		{
			"step": "login",
			"username": "admin",
			"password": "password"
		},
		{
			"step": "installPlugin",
			"options": {
				"activate": true
			},
			"pluginData": {
				"resource": "wordpress.org/plugins",
				"slug": "axcelersblocks"
			}
		},
		{
			"step": "writeFile",
			"path": "/wordpress/wp-content/mu-plugins/axb-demo-https.php",
			"data": "<?php\n/**\n * AxcelersBlocks demo polish (WordPress Playground only):\n *  1. Force generated asset URLs to HTTPS (Playground serves HTTPS but builds\n *     http:// URLs, tripping mixed-content blocking on bundled images).\n *  2. Load the AXB inspector-control CSS in the OUTER editor document. The\n *     published plugin bundles that CSS as a block \"style\" asset, so it loads\n *     inside the canvas iframe only — leaving the inspector controls unstyled\n *     in block-theme (iframed) editors like Playground. Re-enqueuing it via\n *     enqueue_block_editor_assets puts it where the inspector actually renders.\n *     Mirrors the fix shipping in the plugin's next release.\n * Scoped to playground.wordpress.net; not part of the plugin.\n */\n\nif ( ! function_exists( 'axb_demo_force_https' ) ) {\n\tfunction axb_demo_force_https( $url ) {\n\t\tif (\n\t\t\tis_string( $url )\n\t\t\t&& ! empty( $_SERVER['HTTP_HOST'] )\n\t\t\t&& false !== strpos( $_SERVER['HTTP_HOST'], 'playground.wordpress.net' )\n\t\t) {\n\t\t\treturn preg_replace( '#^http://#', 'https://', $url );\n\t\t}\n\t\treturn $url;\n\t}\n\tforeach ( array( 'plugins_url', 'content_url', 'includes_url', 'theme_root_uri', 'stylesheet_directory_uri', 'template_directory_uri', 'wp_get_attachment_url' ) as $axb_demo_hook ) {\n\t\tadd_filter( $axb_demo_hook, 'axb_demo_force_https' );\n\t}\n}\n\nadd_action( 'enqueue_block_editor_assets', function () {\n\t$plugin_main = WP_PLUGIN_DIR . '/axcelersblocks/axcelersblocks.php';\n\t$rel         = 'build/blocks/bodycopy/style-index.css';\n\tif ( file_exists( WP_PLUGIN_DIR . '/axcelersblocks/' . $rel ) ) {\n\t\twp_enqueue_style(\n\t\t\t'axb-demo-inspector-css',\n\t\t\tplugins_url( $rel, $plugin_main ),\n\t\t\tarray(),\n\t\t\t'1.0'\n\t\t);\n\t}\n}, 20 );\n"
		},
		{
			"step": "setSiteOptions",
			"options": {
				"blogname": "AxcelersBlocks Demo",
				"blogdescription": "Build modern WordPress layouts faster"
			}
		},
		{
			"step": "runPHP",
			"code": "<?php require '/wordpress/wp-load.php';\nwp_set_current_user( 1 );\n$registry = WP_Block_Patterns_Registry::get_instance();\n$wporg = 'https://wordpress.org/plugins/axcelersblocks/';\n$sections = array(\n\t'axcelersblocks/hero-dark-stats-row' => array(\n\t\t'copy' => array(\n\t\t\t'Everything you need to launch faster' => 'Build modern WordPress layouts faster',\n\t\t\t'A dark hero pattern with clear CTAs and a compact stats/features row underneath. Fully responsive using your Box + Columns controls.' => 'AxcelersBlocks is a Gutenberg block library with full responsive style controls. Every section on this page is built with AXB blocks — try editing it yourself.',\n\t\t\t'Get Started' => 'Edit This Page',\n\t\t\t'View Pricing' => 'See All Blocks',\n\t\t\t'12k+' => '14+',\n\t\t\t'Active users building pages weekly' => 'Custom blocks with full style controls',\n\t\t\t'98%' => '18',\n\t\t\t'Customer satisfaction rating' => 'Ready-made block patterns included',\n\t\t\t'24/7' => '3',\n\t\t\t'Priority support for your team' => 'Breakpoints — mobile-first responsive'\n\t\t),\n\t\t'links' => array( '__AXB_EDIT_URL__', $wporg )\n\t),\n\t'axcelersblocks/list-feature-checklist' => array(\n\t\t'copy' => array( 'Everything included' => 'What you get — free' ),\n\t\t'links' => array()\n\t),\n\t'axcelersblocks/media-with-text-image-left' => array(\n\t\t'copy' => array(\n\t\t\t'Build polished sections in minutes' => 'Style every breakpoint visually',\n\t\t\t'Use Media with Text patterns to create clean, responsive layouts. Customize spacing, typography, and buttons using AxcelersBlocks controls.' => 'Each AXB block has desktop, tablet, and mobile controls for spacing, typography, colors, borders, and effects — no CSS required. Open this page in the editor to see them.',\n\t\t\t'Learn More' => 'Open the Editor'\n\t\t),\n\t\t'links' => array( '__AXB_EDIT_URL__' )\n\t),\n\t'axcelersblocks/table-product-specs' => array(\n\t\t'copy' => array(\n\t\t\t'Product specifications' => 'Semantic tables, built with blocks',\n\t\t\t'Use this specs table to present product, service, or platform details in a structured format.' => 'This table is the AXB Table block family — header and footer sections, column and row spans, and per-cell styling, all inside the editor.'\n\t\t),\n\t\t'links' => array()\n\t),\n\t'axcelersblocks/cta-centered-banner' => array(\n\t\t'copy' => array(\n\t\t\t'Ready to build faster?' => 'Install AxcelersBlocks on your site',\n\t\t\t'Drop in this CTA banner and point the button to your pricing, signup, or contact page.' => 'The Bodycopy block holds your paragraph text — with full typography, color, and spacing controls, plus optional icons, links, and dynamic content.',\n\t\t\t'rgba(255,255,255,0.78)' => '#ffffff',\n\t\t\t'Get Started' => 'Download Free'\n\t\t),\n\t\t'links' => array( $wporg )\n\t)\n);\n$content = '';\nforeach ( $sections as $slug => $section ) {\n\t$pattern = $registry->get_registered( $slug );\n\tif ( ! $pattern || empty( $pattern['content'] ) ) { continue; }\n\t$chunk = str_replace( array_keys( $section['copy'] ), array_values( $section['copy'] ), $pattern['content'] );\n\tforeach ( $section['links'] as $url ) {\n\t\t$chunk = preg_replace( '/customLink\":\"#\"/', 'customLink\":\"' . $url . '\"', $chunk, 1 );\n\t}\n\t$content .= $chunk;\n}\n$page_id = wp_insert_post( array(\n\t'post_title'   => 'AxcelersBlocks Demo',\n\t'post_type'    => 'page',\n\t'post_status'  => 'publish',\n\t'post_content' => wp_slash( $content )\n) );\nif ( $page_id && ! is_wp_error( $page_id ) ) {\n\tupdate_post_meta( $page_id, '_wp_page_template', 'axcelersblocks-blank.php' );\n\tupdate_option( 'show_on_front', 'page' );\n\tupdate_option( 'page_on_front', $page_id );\n\t$content = str_replace( '__AXB_EDIT_URL__', admin_url( 'post.php?post=' . $page_id . '&action=edit' ), $content );\n\twp_update_post( array( 'ID' => $page_id, 'post_content' => wp_slash( $content ) ) );\n}"
		}
	]
}
