@secretstache/wordpress-gutenberg 0.6.10 → 0.6.12

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@secretstache/wordpress-gutenberg",
3
- "version": "0.6.10",
3
+ "version": "0.6.12",
4
4
  "description": "",
5
5
  "author": "Secret Stache",
6
6
  "license": "GPL-2.0-or-later",
@@ -10,7 +10,7 @@ import { arrayMove } from 'react-sortable-hoc';
10
10
  import Select from 'react-select';
11
11
 
12
12
  import { SortableSelectAsync } from './SortableSelect.jsx';
13
- import { decodeHtmlEntities, loadSelectOptions } from '../utils/index.js';
13
+ import { decodeHtmlEntities, loadSelectOptions, useDefaultSelectOptions } from '../utils/index.js';
14
14
 
15
15
  const DataQueryContext = createContext({});
16
16
 
@@ -107,7 +107,7 @@ const QueryType = memo(({
107
107
  const TaxonomySelect = memo(({
108
108
  condition = true,
109
109
  attributeName = 'selectedCategories',
110
- taxonomy = 'category',
110
+ taxonomy = 'categories',
111
111
  placeholder = 'Categories to show',
112
112
  disabled = false,
113
113
  render = null,
@@ -180,7 +180,7 @@ const TaxonomySelect = memo(({
180
180
  const CuratedPosts = memo(({
181
181
  condition = true,
182
182
  attributeName = 'curatedPosts',
183
- postType = 'posts',
183
+ postType = 'post',
184
184
  placeholder = 'Posts to show',
185
185
  disabled = false,
186
186
  render = null,
@@ -192,11 +192,7 @@ const CuratedPosts = memo(({
192
192
  return await loadSelectOptions(inputValue, postType);
193
193
  }, []);
194
194
 
195
- const [ defaultPostsOptions, setDefaultPostsOptions ] = useState([]);
196
-
197
- useEffect(() => {
198
- loadSelectOptions('', postType).then(setDefaultPostsOptions);
199
- }, []);
195
+ const { options: defaultPostsOptions } = useDefaultSelectOptions(postType);
200
196
 
201
197
  const onSortEnd = useCallback(({ oldIndex, newIndex }) => {
202
198
  const newCuratedPosts = arrayMove(curatedPosts, oldIndex, newIndex);
@@ -3,7 +3,7 @@
3
3
  bottom: 30px;
4
4
  left: 50%;
5
5
  transform: translateX(-50%);
6
- width: calc(100% - var(--content-padding) * 2);
6
+ width: calc(100% - 60px);
7
7
 
8
8
  &::after {
9
9
  content: attr(data-tooltip);