Skip to content

Commit

Permalink
[#148] Adding files for dialog block
Browse files Browse the repository at this point in the history
  • Loading branch information
nathan-schmidt-viget committed Nov 7, 2024
1 parent 6d56877 commit 69262eb
Show file tree
Hide file tree
Showing 4 changed files with 111 additions and 0 deletions.
47 changes: 47 additions & 0 deletions wp-content/themes/wp-starter/blocks/dialog/block.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
"name": "dialog",
"title": "Dialog",
"description": "Displays the Dialog",
"icon": "editor-expand",
"category": "components",
"textdomain": "wp-starter",
"keywords": ["dialog", "modal"],
"allowedBlocks": [],
"attributes": {
"align": {
"type": "string",
"default": "full"
},
"style": {
"type": "object",
"default": {
"spacing": {
"padding": {
"top": "var:preset|spacing|20",
"bottom": "var:preset|spacing|20",
"left": "var:preset|spacing|20",
"right": "var:preset|spacing|20"
}
}
}
}
},
"supports": {
"jsx": true,
"mode": false,
"alignWide": true,
"color": {
"background": true
}
},
"styles": [
{
"name": "default",
"label": "Default",
"isDefault": true
}
],
"acf": {
"mode": "preview"
}
}
11 changes: 11 additions & 0 deletions wp-content/themes/wp-starter/blocks/dialog/render.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{#
Block: Dialog
#}


{% set inner = {
template: block.template ?? [],
} %}
<section {{ block_attrs( block ) }}>
{{ inner_blocks( inner ) }}
</section>
5 changes: 5 additions & 0 deletions wp-content/themes/wp-starter/blocks/dialog/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
@layer components {
.acf-block-dialog {

}
}
48 changes: 48 additions & 0 deletions wp-content/themes/wp-starter/blocks/dialog/template.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
"template": [
[
"core/group",
{
"layout": {
"type": "constrained"
},
"metadata": {
"name": "Content"
}
},
[
[
"core/heading",
{
"placeholder": "Headline Goes Here"
}
],
[
"core/paragraph",
{
"placeholder": "Dialog text goes here. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat"
}
]
]
],
[
"core/group",
{
"layout": {
"type": "constrained"
},
"metadata": {
"name": "Button"
}
},
[
[
"core/button",
{
"text": "Open Dialog"
}
]
]
]
]
}

0 comments on commit 69262eb

Please sign in to comment.