{
	"$schema": "https://schemas.wp.org/trunk/block.json",
	"apiVersion": 3,
	"name": "wpuf-ud/directory",
	"title": "WPUF - User Directory",
	"category": "wpuf-ud",
	"description": "An advanced block that allows displaying users based on different query parameters and visual configurations.",
	"keywords": [ "users", "directory", "profiles", "members" ],
	"textdomain": "wpuf-pro",
	"attributes": {
		"queryId": {
			"type": "number"
		},
		"tagName": {
			"type": "string",
			"default": "div"
		},
		"namespace": {
			"type": "string"
		},
		"roles": {
			"type": "string",
			"default": "all"
		},
		"exclude_roles": {
			"type": "string",
			"default": ""
		},
		"exclude_users": {
			"type": "string",
			"default": ""
		},
		"directory_layout": {
			"type": "string",
			"default": "layout-1"
		},
		"hasSelectedLayout": {
			"type": "boolean",
			"default": false
		},
		"selectedLayout": {
			"type": "string",
			"default": "layout-1"
		},
		"isSwitchingLayout": {
			"type": "boolean",
			"default": false
		},
		"max_item_per_page": {
			"type": "number",
			"default": 10
		},
		"orderby": {
			"type": "string",
			"default": "id"
		},
		"order": {
			"type": "string",
			"default": "desc"
		},
		"enable_search": {
			"type": "boolean",
			"default": true
		},
		"search_placeholder": {
			"type": "string",
			"default": "Search Users"
		},
		"searchable_fields": {
			"type": "array",
			"default": ["user_login", "user_email", "display_name"]
		},
		"enable_frontend_sorting": {
			"type": "boolean",
			"default": false
		},
		"available_sort_options": {
			"type": "array",
			"default": ["id", "user_login", "user_email", "display_name", "user_registered"]
		},
		"usersPerRow": {
			"type": "number",
			"default": 3
		},
		"show_avatar": {
			"type": "boolean",
			"default": true
		},
		"avatar_size": {
			"type": "string",
			"default": "medium"
		},
		"avatar_shape": {
			"type": "string",
			"default": "circle"
		},
		"avatar_fallback_type": {
			"type": "string",
			"default": "initial"
		},
		"table_columns": {
			"type": "array",
			"default": ["email", "display_name"]
		}
	},
	"usesContext": [ "templateSlug" ],
	"providesContext": {
		"queryId": "queryId",
		"query": "query",
		"displayLayout": "displayLayout",
		"enhancedPagination": "enhancedPagination",
		"userRoles": "roles",
		"userExcludeRoles": "exclude_roles",
		"userExcludeUsers": "exclude_users",
		"usersPerRow": "usersPerRow"
	},
	"supports": {
		"align": [ "wide", "full" ],
		"html": false,
		"layout": true,
		"spacing": {
			"margin": true,
			"padding": true,
			"__experimentalDefaultControls": {
				"padding": true,
				"margin": true
			}
		},
		"color": {
			"gradients": true,
			"link": true,
			"__experimentalDefaultControls": {
				"background": true
			}
		},
		"__experimentalBorder": {
			"radius": true,
			"color": true,
			"width": true,
			"style": true
		}
	},
	"example": {
		"viewportWidth": 800,
		"attributes": {
			"roles": "all",
			"directory_layout": "layout-2",
			"max_item_per_page": 6,
			"orderby": "display_name",
			"order": "asc",
			"enable_search": true,
			"search_placeholder": "Search Users",
			"usersPerRow": 3
		},
		"innerBlocks": [
			{
				"name": "wpuf-ud/directory-item",
				"attributes": {},
				"innerBlocks": [
					{
						"name": "wpuf-ud/avatar",
						"attributes": {
							"avatarSize": "medium",
							"avatarShape": "circle"
						}
					},
					{
						"name": "wpuf-ud/name",
						"attributes": {
							"nameFormat": "display_name",
							"headingLevel": "h3"
						}
					},
					{
						"name": "wpuf-ud/bio",
						"attributes": {
							"characterLimit": 100,
							"readMoreStyle": "none"
						}
					}
				]
			}
		]
	}
}

