@secretstache/wordpress-gutenberg 0.6.12 → 0.6.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/index.js +352 -342
- package/build/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/DataQueryControls.jsx +39 -28
package/package.json
CHANGED
|
@@ -59,10 +59,11 @@ const QueryType = memo(({
|
|
|
59
59
|
label = 'Query',
|
|
60
60
|
options = [],
|
|
61
61
|
onChange,
|
|
62
|
-
|
|
62
|
+
isDisabled = false,
|
|
63
63
|
help = '',
|
|
64
64
|
attributeName = 'queryType',
|
|
65
65
|
render = null,
|
|
66
|
+
hasDivider = true,
|
|
66
67
|
}) => {
|
|
67
68
|
const { attributes, updateAttribute } = useDataQueryContext();
|
|
68
69
|
const queryType = attributes[attributeName];
|
|
@@ -80,7 +81,7 @@ const QueryType = memo(({
|
|
|
80
81
|
value: queryType,
|
|
81
82
|
onChange: handleChange,
|
|
82
83
|
options,
|
|
83
|
-
|
|
84
|
+
isDisabled,
|
|
84
85
|
attributeName,
|
|
85
86
|
});
|
|
86
87
|
}
|
|
@@ -92,11 +93,11 @@ const QueryType = memo(({
|
|
|
92
93
|
selected={queryType}
|
|
93
94
|
options={options}
|
|
94
95
|
onChange={handleChange}
|
|
95
|
-
disabled={
|
|
96
|
+
disabled={isDisabled}
|
|
96
97
|
help={help}
|
|
97
98
|
/>
|
|
98
99
|
|
|
99
|
-
<Divider />
|
|
100
|
+
{ hasDivider && ( <Divider /> ) }
|
|
100
101
|
</>
|
|
101
102
|
);
|
|
102
103
|
});
|
|
@@ -109,9 +110,11 @@ const TaxonomySelect = memo(({
|
|
|
109
110
|
attributeName = 'selectedCategories',
|
|
110
111
|
taxonomy = 'categories',
|
|
111
112
|
placeholder = 'Categories to show',
|
|
112
|
-
|
|
113
|
+
isDisabled = false,
|
|
113
114
|
render = null,
|
|
114
115
|
customOptions = null,
|
|
116
|
+
hasDivider = true,
|
|
117
|
+
isMulti = true,
|
|
115
118
|
}) => {
|
|
116
119
|
const { attributes, updateAttribute } = useDataQueryContext();
|
|
117
120
|
|
|
@@ -151,25 +154,26 @@ const TaxonomySelect = memo(({
|
|
|
151
154
|
onChange,
|
|
152
155
|
options: selectOptions,
|
|
153
156
|
placeholder,
|
|
154
|
-
|
|
157
|
+
isDisabled,
|
|
155
158
|
attributeName,
|
|
159
|
+
isMulti,
|
|
156
160
|
});
|
|
157
161
|
}
|
|
158
162
|
|
|
159
163
|
return (
|
|
160
164
|
<>
|
|
161
165
|
<Select
|
|
162
|
-
isMulti
|
|
166
|
+
isMulti={isMulti}
|
|
163
167
|
options={selectOptions}
|
|
164
168
|
value={selectedOptions}
|
|
165
169
|
onChange={onChange}
|
|
166
170
|
className="react-select-container"
|
|
167
171
|
classNamePrefix="react-select"
|
|
168
172
|
placeholder={placeholder}
|
|
169
|
-
isDisabled={
|
|
173
|
+
isDisabled={isDisabled}
|
|
170
174
|
/>
|
|
171
175
|
|
|
172
|
-
<Divider />
|
|
176
|
+
{ hasDivider && ( <Divider /> ) }
|
|
173
177
|
</>
|
|
174
178
|
);
|
|
175
179
|
});
|
|
@@ -182,8 +186,10 @@ const CuratedPosts = memo(({
|
|
|
182
186
|
attributeName = 'curatedPosts',
|
|
183
187
|
postType = 'post',
|
|
184
188
|
placeholder = 'Posts to show',
|
|
185
|
-
|
|
189
|
+
isDisabled = false,
|
|
186
190
|
render = null,
|
|
191
|
+
hasDivider = true,
|
|
192
|
+
isMulti = true,
|
|
187
193
|
}) => {
|
|
188
194
|
const { attributes, updateAttribute } = useDataQueryContext();
|
|
189
195
|
const curatedPosts = attributes[attributeName] || [];
|
|
@@ -213,8 +219,9 @@ const CuratedPosts = memo(({
|
|
|
213
219
|
loadOptions: loadPostsOptions,
|
|
214
220
|
defaultOptions: defaultPostsOptions,
|
|
215
221
|
placeholder,
|
|
216
|
-
|
|
222
|
+
isDisabled,
|
|
217
223
|
attributeName,
|
|
224
|
+
isMulti,
|
|
218
225
|
});
|
|
219
226
|
}
|
|
220
227
|
|
|
@@ -227,9 +234,11 @@ const CuratedPosts = memo(({
|
|
|
227
234
|
loadOptions={loadPostsOptions}
|
|
228
235
|
onChange={onChange}
|
|
229
236
|
placeholder={placeholder}
|
|
230
|
-
isDisabled={
|
|
237
|
+
isDisabled={isDisabled}
|
|
238
|
+
isMulti={isMulti}
|
|
231
239
|
/>
|
|
232
|
-
|
|
240
|
+
|
|
241
|
+
{ hasDivider && ( <Divider /> ) }
|
|
233
242
|
</>
|
|
234
243
|
);
|
|
235
244
|
});
|
|
@@ -246,6 +255,7 @@ const NumberOfPosts = memo(({
|
|
|
246
255
|
help = 'The maximum number of posts to show (-1 for no limit)',
|
|
247
256
|
disabled = false,
|
|
248
257
|
render = null,
|
|
258
|
+
hasDivider = true,
|
|
249
259
|
}) => {
|
|
250
260
|
const { attributes, updateAttribute } = useDataQueryContext();
|
|
251
261
|
const numberOfPosts = attributes[attributeName];
|
|
@@ -280,7 +290,7 @@ const NumberOfPosts = memo(({
|
|
|
280
290
|
disabled={disabled}
|
|
281
291
|
/>
|
|
282
292
|
|
|
283
|
-
<Divider />
|
|
293
|
+
{ hasDivider && ( <Divider /> ) }
|
|
284
294
|
</>
|
|
285
295
|
);
|
|
286
296
|
});
|
|
@@ -289,19 +299,20 @@ const NumberOfPosts = memo(({
|
|
|
289
299
|
* OrderByControl component for controlling ordering
|
|
290
300
|
*/
|
|
291
301
|
const OrderByControl = memo(({
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
302
|
+
condition = true,
|
|
303
|
+
orderByAttributeName = 'orderBy',
|
|
304
|
+
orderAttributeName = 'order',
|
|
305
|
+
disabled = false,
|
|
306
|
+
orderByOptions = [
|
|
307
|
+
{ label: 'Date', value: 'date' },
|
|
308
|
+
{ label: 'Title', value: 'title' },
|
|
309
|
+
],
|
|
310
|
+
orderOptions = [
|
|
311
|
+
{ label: 'Ascending', value: 'asc' },
|
|
312
|
+
{ label: 'Descending', value: 'desc' },
|
|
313
|
+
],
|
|
314
|
+
render = null,
|
|
315
|
+
hasDivider = true,
|
|
305
316
|
}) => {
|
|
306
317
|
const { attributes, updateAttribute } = useDataQueryContext();
|
|
307
318
|
const orderBy = attributes[orderByAttributeName] || 'date';
|
|
@@ -349,7 +360,7 @@ const OrderByControl = memo(({
|
|
|
349
360
|
disabled={disabled}
|
|
350
361
|
/>
|
|
351
362
|
|
|
352
|
-
<Divider />
|
|
363
|
+
{ hasDivider && ( <Divider /> ) }
|
|
353
364
|
</>
|
|
354
365
|
);
|
|
355
366
|
});
|