Skip to content
This repository was archived by the owner on Nov 6, 2022. It is now read-only.

Commit df7ddd9

Browse files
authored
Merge pull request #298 from getblocklab/feature/repeater
Repeater Control
2 parents ab4fa6a + 9aae574 commit df7ddd9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+3186
-786
lines changed

CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838

3939
### 1.3.1 - 2019-05-22 ###
4040

41-
* New: Support for Gutenberg's built-in Additional CSS Class in your block template, by using the field `className`. [Read more](https://github.com/getblocklab/block-lab/wiki/7.-FAQ)
41+
* New: Support for Gutenberg's built-in Additional CSS Class in your block template, by using the field `className`. [Read more](https://getblocklab.com/docs/faqs/)
4242
* New: The Textarea field now has an option to automatically add paragraph tags and line-breaks
4343
* Fix: Bug affecting blocks containing Pro fields when there's no active Pro license
4444

@@ -70,7 +70,7 @@ If you are using the `block_value()` function with an image field and externally
7070

7171
### 1.2.1 - 2019-03-21 ###
7272

73-
* New: Automatic stylesheet enqueuing. Now you can create custom stylesheets for individual blocks! [Read more here](https://github.com/getblocklab/block-lab/wiki/5.-Styling-Custom-Blocks).
73+
* New: Automatic stylesheet enqueuing. Now you can create custom stylesheets for individual blocks! [Read more here](https://getblocklab.com/docs/get-started/style-block-lab-custom-blocks/).
7474
* New: A User control type (for Block Lab Pro users)
7575
* Fix: Various multiselect bug fixes, allowing for empty values in the multiselect control
7676

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ Before creating bug reports, please check [this list](#before-submitting-a-bug-r
3838
#### Before Submitting A Bug Report
3939

4040
* You might be able to find the cause of the problem and fix things yourself. Most importantly, check if you can reproduce the problem [in the latest version of Block Lab](https://github.com/getblocklab/block-lab/releases).
41-
* **Check the [FAQs](https://github.com/getblocklab/block-lab#frequently-asked-questions)** for a list of common questions and problems.
41+
* **Check the [FAQs](https://getblocklab.com/docs/faqs/)** for a list of common questions and problems.
4242
* While entering the title of your new issue, GitHub might show related issues below. If a related issue describes your problem and it's still open, add a comment to the existing issue instead of opening a new one.
4343

4444
#### How Do I Submit A (Good) Bug Report?

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ Block Lab Pro is coming mid 2019 with power features to take your block building
3838
## Links ##
3939
* [WordPress.org](https://wordpress.org/plugins/block-lab)
4040
* [Github](https://github.com/getblocklab/block-lab)
41-
* [Documentation](https://github.com/getblocklab/block-lab/wiki)
41+
* [Documentation](https://getblocklab.com/docs)
4242
* [Support](https://wordpress.org/support/plugin/block-lab)
4343
* [Block Lab Pro](https://getblocklab.com/block-lab-pro)
4444

@@ -64,7 +64,7 @@ A: Although the plugin handles the majority of the work in building a custom blo
6464
A: This plugin is open source and can only be better through community contribution. The GitHub repo is [here](https://github.com/getblocklab/block-lab).
6565

6666
**Q: Where can I find documentation for this plugin?**
67-
A: [Here](https://github.com/getblocklab/block-lab/wiki)
67+
A: [Here](https://getblocklab.com/docs/)
6868

6969
## Contributing ##
7070

block-lab.php

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -118,14 +118,7 @@ function block_lab() {
118118
->set_slug( 'block-lab' )
119119
->set_url( plugin_dir_url( __FILE__ ) )
120120
->set_version( __FILE__ )
121-
->set_util();
122-
123-
/**
124-
* Register plugin components.
125-
*/
126-
block_lab()
127-
->register_component( new \Block_Lab\Post_Types\Block_Post() )
128-
->register_component( new \Block_Lab\Blocks\Loader() );
121+
->init();
129122

130123
/**
131124
* Sometimes we need to do some things after the plugin is loaded, so call the Plugin_Interface::plugin_loaded().

css/admin.block-edit.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
.post-type-block_lab .column-template code {
88
background: none;
99
font-size: 12px;
10+
padding-left: 0;
1011
}
1112
.post-type-block_lab .fixed .column-icon {
1213
width: 10%;

css/admin.block-post.css

Lines changed: 93 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -53,38 +53,78 @@
5353
#block_fields .block-fields-list thead th {
5454
font-weight: 600;
5555
width: 32%;
56+
border-bottom: 1px solid #eee;
5657
}
5758
#block_fields .block-fields-list thead th.block-fields-sort {
58-
width: 4%
59+
width: 4%;
60+
min-width: 32px;
61+
}
62+
#block_fields .block-fields-list tbody {
63+
background: #f5f5f5;
64+
}
65+
#block_fields button {
66+
border: 0;
67+
background: transparent;
68+
padding: 0;
69+
margin: 0;
70+
cursor: pointer;
71+
color: #0073aa;
72+
font-weight: bold;
73+
transition: none;
74+
line-height: 20px;
75+
}
76+
#block_fields button:hover {
77+
color: #00a0d2;
78+
}
79+
#block_fields button:active,
80+
#block_fields button:focus {
81+
outline: 0;
82+
}
83+
#block_fields button > .dashicons {
84+
color: #0073aa;
85+
font-size: 12px;
86+
border: 2px solid #0073aa;
87+
border-radius: 10px;
88+
padding: 0;
89+
margin: 1px 4px 0 0;
90+
width: 14px;
91+
height: 14px;
92+
text-align: center;
93+
line-height: 16px;
94+
transition: none;
95+
}
96+
#block_fields button:hover > .dashicons {
97+
color: #00a0d2;
98+
border-color: #00a0d2;
5999
}
60100
#block_fields .block-fields-rows {
61-
max-height: 600px;
62101
width: 100%;
63-
display: inline-block;
64-
overflow-x: hidden;
65-
overflow-y: scroll;
66102
line-height: 1.5em;
67103
}
68104
#block_fields .block-fields-rows .block-no-fields {
69105
display: none;
70-
padding: 10px;
106+
padding: 20px 10px 10px;
107+
margin: 0;
108+
text-align: center;
71109
}
72110
#block_fields .block-fields-rows .block-fields-row {
73111
background: #fff;
112+
border: 1px solid #eee;
113+
box-shadow: 0 1px 1px rgba(0,0,0,.04);
114+
margin: 10px 10px 0;
115+
}
116+
#block_fields .block-fields-rows .block-fields-row-columns {
74117
display: grid;
75-
grid-template-columns: [handle] 4% 32% 32% 32%;
118+
grid-template-columns: [handle] minmax( 20px, calc(4% - 10px) ) calc(32% + 14px) calc(32% + 14px) calc(32% - 18px);
76119
}
77120
#block_fields .block-fields-rows .block-fields-row > div {
78121
padding: 8px 10px;
79122
}
80-
#block_fields .block-fields-rows .block-fields-row:nth-child(odd) {
81-
background: #f9f9f9;
82-
}
83123
#block_fields .block-fields-sort-handle:before {
84-
content: "\f333";
124+
content: "\f545";
85125
}
86126
#block_fields .block-fields-sort-handle {
87-
display: block;
127+
display: none;
88128
width: 15px;
89129
height: 15px;
90130
font-family: 'Dashicons', monospace;
@@ -98,41 +138,43 @@
98138
padding-bottom: 6px;
99139
}
100140
#block_fields .block-fields-actions-add-field {
101-
padding: 10px;
141+
padding: 20px 10px;
102142
clear: both;
103-
border-top: 1px solid #ddd;
104143
background: #f5f5f5;
105-
text-align: right;
144+
text-align: center;
106145
}
107146
#block_fields .block-fields-actions {
108147
font-size: 12px;
109148
line-height: 12px;
110149
visibility: hidden;
111150
}
112-
#block_fields .block-fields-row:hover .block-fields-actions {
151+
#block_fields .block-fields-row-columns:hover > .block-fields-label .block-fields-actions {
113152
visibility: visible;
114153
}
154+
#block_fields .block-fields-row-columns:hover > .block-fields-sort .block-fields-sort-handle {
155+
display: block;
156+
}
115157
#block_fields .block-fields-rows .block-fields-row .block-fields-edit {
116158
display: none;
117159
grid-column: 1 / span 4;
118160
padding: 0;
119161
border-bottom: 1px solid #e1e1e1;
120162
border-top: 1px solid #e1e1e1;
121163
}
164+
#block_fields .block-fields-rows .block-fields-row .block-fields-edit tbody {
165+
background: #f7f7f7;
166+
}
122167
#block_fields .block-fields-rows .block-fields-edit td,
123168
#block_fields .block-fields-rows .block-fields-edit th {
124169
padding: 8px 10px;
125-
border-bottom: 1px solid #f1f1f1;
126170
}
127171
#block_fields .block-fields-rows .block-fields-edit td.spacer {
128172
width: 4%;
129-
background: #f9f9f9;
130173
}
131174
#block_fields .block-fields-rows .block-fields-edit th {
132175
font-size: 12px;
133176
width: 32%;
134177
border-right: 1px solid #e1e1e1;
135-
background: #f9f9f9;
136178
}
137179
#block_fields .block-fields-rows .block-fields-edit th label {
138180
font-weight: 600;
@@ -166,6 +208,37 @@
166208
line-height: 1.5em;
167209
}
168210
}
211+
#block_fields .block-fields-rows .block-fields-row .block-fields-sub-rows {
212+
grid-column: 1 / span 4;
213+
margin: 0 10px;
214+
padding: 0 0 0 32px;
215+
overflow: hidden;
216+
}
217+
#block_fields .block-fields-sub-rows .block-fields-row-columns {
218+
grid-template-columns: [handle] minmax( 20px, 3% ) calc(33% - 22px) calc(32% + 38px) calc(32% - 16px);
219+
}
220+
#block_fields .block-fields-rows .block-fields-row .block-fields-sub-rows .block-fields-row {
221+
border: none;
222+
background: #f7f7f7;
223+
}
224+
#block_fields .block-fields-rows .block-fields-row .block-fields-sub-rows-actions {
225+
grid-column: 1 / span 4;
226+
padding: 0;
227+
margin: 0 10px 0 42px;
228+
text-align: center;
229+
background: #fff;
230+
}
231+
#block_fields .block-fields-rows .block-fields-row .block-fields-sub-rows-actions p {
232+
padding: 10px 0;
233+
margin: 10px 0;
234+
}
235+
#block_fields .block-fields-rows .block-fields-row .block-fields-sub-rows-actions p.repeater-no-fields {
236+
background: #f7f7f7;
237+
}
238+
#block_fields .block-fields-rows .block-fields-row .block-fields-sub-rows-actions button {
239+
margin-left: -32px;
240+
}
241+
169242
#block_properties input,
170243
#block_properties select,
171244
#block_properties label {
@@ -264,15 +337,7 @@
264337
background: #fff;
265338
border-left: 4px solid #ffffff;
266339
padding: 1px 12px;
267-
border-left-color: #00a0d2;
268-
}
269-
#block_template .template-notice .dashicons {
270-
font-size: 1.8em;
271-
width: auto;
272-
height: auto;
273-
line-height: 20px;
274-
padding-right: 4px;
275-
margin-left: -5px;
340+
border-left-color: #7D5DEC;
276341
}
277342
#block_template .template-success {
278343
border-left-color: #46b450;

0 commit comments

Comments
 (0)