Skip to content

Commit

Permalink
Merge pull request #93 from studiopress/add/editor-modal
Browse files Browse the repository at this point in the history
Optional modal for editor fields
  • Loading branch information
kienstra authored Sep 10, 2021
2 parents 6729f16 + d07a86b commit 3b74d78
Show file tree
Hide file tree
Showing 30 changed files with 355 additions and 165 deletions.
6 changes: 6 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@
],
"rules": {
"@wordpress/dependency-group": "error",
"@wordpress/i18n-text-domain": [
"error",
{
"allowedTextDomain": "genesis-custom-blocks"
}
],
"@wordpress/no-unused-vars-before-return": "off",
"@wordpress/react-no-unsafe-timeout": "error",
"comma-dangle": [
Expand Down
20 changes: 0 additions & 20 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,16 +1,6 @@
# IDEA Ignores #
################
*.iml
*.ipr
*.iws
.idea/
out/
local.properties

# Sublime Text #
##############
*.sublime-project
*.sublime-workspace

# Packages #
############
Expand Down Expand Up @@ -92,16 +82,6 @@ node_modules
#######
*.sass-cache

# Vagrant #
##########
.vagrant

# Ansible
*.retry

# ack
.ackrc

# Composer
vendor

Expand Down
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
save-exact = true
engine-strict = true
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ Let the plugin do the heavy lifting so you can use the built-in editor, or famil
As an alternative to the built-in editor, there are simple functions, ready to render and work with the data stored through your custom block fields.

## Currently available block fields ##
* Inner Blocks field
* File Field
* Text Field
* Image Field
* URL Field
Expand Down
6 changes: 6 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@
}
},
"scripts": {
"lint": [
"phpcs"
],
"lint-fix": [
"phpcbf"
],
"test": [
"phpunit"
]
Expand Down
127 changes: 62 additions & 65 deletions css/src/editor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,8 @@ $font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans
box-shadow: none;
}

/* Block form in editor & sidebar */
div[class^="wp-block-genesis-custom-blocks-"],
.edit-post-settings-sidebar__panel-block .components-panel__body,
.gcb-editor {
.gcb-editor-form,
.gcb-inspector-form {

:required:invalid {
border-color: #c00000;
Expand Down Expand Up @@ -116,84 +114,83 @@ div[class^="wp-block-genesis-custom-blocks-"],
div[class^="wp-block-genesis-custom-blocks-"],
.gcb-editor {
margin: 0;
}

.block-form {
border-left: none;
background: $dark-opacity-light-200;
padding: 22px 0 22px 22px;
font-size: 0.8125rem;
display: flex;
flex-wrap: wrap;

h3 {
color: #111;
font-size: 1rem;
margin: 0;
flex: 1 1 100%;

svg {
position: relative;
top: 6px;
margin-right: 4px;
}
.gcb-editor-form {
border-left: none;
background: $dark-opacity-light-200;
padding: 22px 0 22px 22px;
font-size: 0.8125rem;
display: flex;
flex-wrap: wrap;

h3 {
color: #111;
font-size: 1rem;
margin: 0;
flex: 1 1 100%;

svg {
position: relative;
top: 6px;
margin-right: 4px;
}
}

p {
font-size: 1rem;
font-family: $font-family;
}
p {
font-size: 1rem;
font-family: $font-family;
}

.genesis-custom-blocks-control {
flex-basis: 100%;
padding-right: 22px;
.genesis-custom-blocks-control {
flex-basis: 100%;
padding-right: 22px;

&.width-25 {
flex-basis: 25%;
}
&.width-50 {
flex-basis: 50%;
}
&.width-75 {
flex-basis: 75%;
}
&.width-25 {
flex-basis: 25%;
}

@media screen and (max-width: 782px) {
.genesis-custom-blocks-control.width-25,
.genesis-custom-blocks-control.width-50,
.genesis-custom-blocks-control.width-75 {
flex-basis: 100%;
}
&.width-50 {
flex-basis: 50%;
}
&.width-75 {
flex-basis: 75%;
}
}

.components-base-control {
font-family: $font-family;
@media screen and (max-width: 782px) {
.genesis-custom-blocks-control.width-25,
.genesis-custom-blocks-control.width-50,
.genesis-custom-blocks-control.width-75 {
flex-basis: 100%;
}
}

.components-base-control__field {
margin: 1em 0 0;
.components-base-control {
font-family: $font-family;
}

.components-base-control__label {
display: block;
font-weight: 600;
}
}
.components-base-control__field {
margin: 1em 0 0;

.components-base-control__help {
margin: 0 0 1em 0.5em;
font-size: 1em;
color: rgba(0, 0, 0, 0.8);
.components-base-control__label {
display: block;
font-weight: 600;
}
}

/* Override a max-width: 25rem style rule in Core that can prevent displaying at the selected with, like 75% */
.components-select-control__input {
max-width: unset;
}
.components-base-control__help {
margin: 0 0 1em 0.5em;
font-size: 1em;
color: rgba(0, 0, 0, 0.8);
}

/* Override a max-width: 25rem style rule in Core that can prevent displaying at the selected with, like 75% */
.components-select-control__input {
max-width: unset;
}
}

/* Block form in sidebar */
.edit-post-settings-sidebar__panel-block .components-panel__body {
.gcb-inspector-form {
/* Media Upload Component */
.genesis-custom-blocks-media-controls {
.components-spinner {
Expand Down
Loading

0 comments on commit 3b74d78

Please sign in to comment.