@wordpress/block-editor 12.10.0 → 12.10.1

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.
Files changed (71) hide show
  1. package/build/components/block-patterns-list/index.js +9 -4
  2. package/build/components/block-patterns-list/index.js.map +1 -1
  3. package/build/components/block-patterns-paging/index.js +3 -1
  4. package/build/components/block-patterns-paging/index.js.map +1 -1
  5. package/build/components/inserter/block-patterns-explorer/patterns-list.js +19 -30
  6. package/build/components/inserter/block-patterns-explorer/patterns-list.js.map +1 -1
  7. package/build/components/inserter/block-patterns-explorer/sidebar.js +0 -15
  8. package/build/components/inserter/block-patterns-explorer/sidebar.js.map +1 -1
  9. package/build/components/inserter/block-patterns-filter.js +137 -0
  10. package/build/components/inserter/block-patterns-filter.js.map +1 -0
  11. package/build/components/inserter/block-patterns-tab.js +77 -37
  12. package/build/components/inserter/block-patterns-tab.js.map +1 -1
  13. package/build/components/inserter/hooks/use-patterns-paging.js +4 -0
  14. package/build/components/inserter/hooks/use-patterns-paging.js.map +1 -1
  15. package/build/components/inspector-controls-tabs/styles-tab.js +1 -1
  16. package/build/components/inspector-controls-tabs/styles-tab.js.map +1 -1
  17. package/build/hooks/background.js +28 -23
  18. package/build/hooks/background.js.map +1 -1
  19. package/build/hooks/block-rename-ui.js +2 -1
  20. package/build/hooks/block-rename-ui.js.map +1 -1
  21. package/build/store/private-selectors.js +2 -3
  22. package/build/store/private-selectors.js.map +1 -1
  23. package/build-module/components/block-patterns-list/index.js +10 -5
  24. package/build-module/components/block-patterns-list/index.js.map +1 -1
  25. package/build-module/components/block-patterns-paging/index.js +3 -1
  26. package/build-module/components/block-patterns-paging/index.js.map +1 -1
  27. package/build-module/components/inserter/block-patterns-explorer/patterns-list.js +20 -31
  28. package/build-module/components/inserter/block-patterns-explorer/patterns-list.js.map +1 -1
  29. package/build-module/components/inserter/block-patterns-explorer/sidebar.js +0 -14
  30. package/build-module/components/inserter/block-patterns-explorer/sidebar.js.map +1 -1
  31. package/build-module/components/inserter/block-patterns-filter.js +128 -0
  32. package/build-module/components/inserter/block-patterns-filter.js.map +1 -0
  33. package/build-module/components/inserter/block-patterns-tab.js +75 -35
  34. package/build-module/components/inserter/block-patterns-tab.js.map +1 -1
  35. package/build-module/components/inserter/hooks/use-patterns-paging.js +5 -1
  36. package/build-module/components/inserter/hooks/use-patterns-paging.js.map +1 -1
  37. package/build-module/components/inspector-controls-tabs/styles-tab.js +1 -1
  38. package/build-module/components/inspector-controls-tabs/styles-tab.js.map +1 -1
  39. package/build-module/hooks/background.js +30 -25
  40. package/build-module/hooks/background.js.map +1 -1
  41. package/build-module/hooks/block-rename-ui.js +2 -1
  42. package/build-module/hooks/block-rename-ui.js.map +1 -1
  43. package/build-module/store/private-selectors.js +2 -3
  44. package/build-module/store/private-selectors.js.map +1 -1
  45. package/build-style/style-rtl.css +53 -26
  46. package/build-style/style.css +53 -26
  47. package/package.json +32 -32
  48. package/src/components/block-patterns-list/index.js +21 -12
  49. package/src/components/block-patterns-paging/index.js +1 -1
  50. package/src/components/block-patterns-paging/style.scss +16 -13
  51. package/src/components/inserter/block-patterns-explorer/patterns-list.js +23 -67
  52. package/src/components/inserter/block-patterns-explorer/sidebar.js +0 -15
  53. package/src/components/inserter/block-patterns-filter.js +183 -0
  54. package/src/components/inserter/block-patterns-tab.js +106 -58
  55. package/src/components/inserter/hooks/use-patterns-paging.js +12 -1
  56. package/src/components/inserter/style.scss +13 -5
  57. package/src/components/inspector-controls-tabs/styles-tab.js +1 -1
  58. package/src/hooks/background.js +57 -46
  59. package/src/hooks/background.scss +36 -18
  60. package/src/hooks/block-rename-ui.js +1 -0
  61. package/src/store/private-selectors.js +7 -3
  62. package/build/components/inserter/block-patterns-source-filter.js +0 -54
  63. package/build/components/inserter/block-patterns-source-filter.js.map +0 -1
  64. package/build/components/inserter/block-patterns-sync-filter.js +0 -46
  65. package/build/components/inserter/block-patterns-sync-filter.js.map +0 -1
  66. package/build-module/components/inserter/block-patterns-source-filter.js +0 -44
  67. package/build-module/components/inserter/block-patterns-source-filter.js.map +0 -1
  68. package/build-module/components/inserter/block-patterns-sync-filter.js +0 -38
  69. package/build-module/components/inserter/block-patterns-sync-filter.js.map +0 -1
  70. package/src/components/inserter/block-patterns-source-filter.js +0 -40
  71. package/src/components/inserter/block-patterns-sync-filter.js +0 -35
@@ -299,13 +299,10 @@ $block-inserter-tabs-height: 44px;
299
299
  border-left: $border-width solid $gray-200;
300
300
  border-right: $border-width solid $gray-200;
301
301
  position: absolute;
302
- padding: $grid-unit-40 $grid-unit-30;
303
302
  top: 0;
304
303
  left: 0;
305
304
  height: 100%;
306
305
  width: 100%;
307
- overflow-y: auto;
308
- scrollbar-gutter: stable both-edges;
309
306
 
310
307
  @include break-medium {
311
308
  left: 100%;
@@ -314,7 +311,10 @@ $block-inserter-tabs-height: 44px;
314
311
  }
315
312
 
316
313
  .block-editor-block-patterns-list {
317
- margin-top: $grid-unit-30;
314
+ overflow-y: auto;
315
+ flex-grow: 1;
316
+ height: 100%;
317
+ padding: $grid-unit-40 $grid-unit-30;
318
318
  }
319
319
  }
320
320
 
@@ -331,10 +331,18 @@ $block-inserter-tabs-height: 44px;
331
331
 
332
332
  .block-editor-inserter__patterns-category-panel {
333
333
  padding: 0 $grid-unit-20;
334
-
334
+ display: flex;
335
+ flex-direction: column;
336
+ height: 100%;
335
337
  @include break-medium {
336
338
  padding: 0;
337
339
  }
340
+ .block-editor-inserter__patterns-category-panel-header {
341
+ padding: 16px $grid-unit-30;
342
+ }
343
+ .block-editor-inserter__patterns-category-no-results {
344
+ margin-top: $grid-unit-30;
345
+ }
338
346
  }
339
347
 
340
348
  .block-editor-inserter__preview-content {
@@ -34,7 +34,7 @@ const StylesTab = ( { blockName, clientId, hasBlockStyles } ) => {
34
34
  />
35
35
  <InspectorControls.Slot
36
36
  group="background"
37
- label={ __( 'Background image' ) }
37
+ label={ __( 'Background' ) }
38
38
  />
39
39
  <InspectorControls.Slot group="filter" />
40
40
  <InspectorControls.Slot
@@ -1,3 +1,8 @@
1
+ /**
2
+ * External dependencies
3
+ */
4
+ import classnames from 'classnames';
5
+
1
6
  /**
2
7
  * WordPress dependencies
3
8
  */
@@ -5,17 +10,17 @@ import { isBlobURL } from '@wordpress/blob';
5
10
  import { getBlockSupport } from '@wordpress/blocks';
6
11
  import {
7
12
  __experimentalToolsPanelItem as ToolsPanelItem,
8
- Button,
9
13
  DropZone,
10
14
  FlexItem,
11
15
  MenuItem,
16
+ VisuallyHidden,
12
17
  __experimentalItemGroup as ItemGroup,
13
18
  __experimentalHStack as HStack,
14
19
  __experimentalTruncate as Truncate,
15
20
  } from '@wordpress/components';
16
21
  import { useDispatch, useSelect } from '@wordpress/data';
17
22
  import { Platform, useCallback } from '@wordpress/element';
18
- import { __ } from '@wordpress/i18n';
23
+ import { __, sprintf } from '@wordpress/i18n';
19
24
  import { store as noticesStore } from '@wordpress/notices';
20
25
  import { getFilename } from '@wordpress/url';
21
26
 
@@ -24,8 +29,6 @@ import { getFilename } from '@wordpress/url';
24
29
  */
25
30
  import InspectorControls from '../components/inspector-controls';
26
31
  import MediaReplaceFlow from '../components/media-replace-flow';
27
- import MediaUpload from '../components/media-upload';
28
- import MediaUploadCheck from '../components/media-upload/check';
29
32
  import useSetting from '../components/use-setting';
30
33
  import { cleanEmptyObject } from './utils';
31
34
  import { store as blockEditorStore } from '../store';
@@ -96,12 +99,29 @@ export function resetBackgroundImage( { attributes = {}, setAttributes } ) {
96
99
  } );
97
100
  }
98
101
 
99
- function InspectorImagePreview( { label, url: imgUrl } ) {
102
+ function InspectorImagePreview( { label, filename, url: imgUrl } ) {
100
103
  const imgLabel = label || getFilename( imgUrl );
101
104
  return (
102
105
  <ItemGroup as="span">
103
106
  <HStack justify="flex-start" as="span">
104
- <img src={ imgUrl } alt="" />
107
+ <span
108
+ className={ classnames(
109
+ 'block-editor-hooks__background__inspector-image-indicator-wrapper',
110
+ {
111
+ 'has-image': imgUrl,
112
+ }
113
+ ) }
114
+ aria-hidden
115
+ >
116
+ { imgUrl && (
117
+ <span
118
+ className="block-editor-hooks__background__inspector-image-indicator"
119
+ style={ {
120
+ backgroundImage: `url(${ imgUrl })`,
121
+ } }
122
+ />
123
+ ) }
124
+ </span>
105
125
  <FlexItem as="span">
106
126
  <Truncate
107
127
  numberOfLines={ 1 }
@@ -109,6 +129,15 @@ function InspectorImagePreview( { label, url: imgUrl } ) {
109
129
  >
110
130
  { imgLabel }
111
131
  </Truncate>
132
+ <VisuallyHidden as="span">
133
+ { filename
134
+ ? sprintf(
135
+ /* translators: %s: file name */
136
+ __( 'Selected image: %s' ),
137
+ filename
138
+ )
139
+ : __( 'No image selected' ) }
140
+ </VisuallyHidden>
112
141
  </FlexItem>
113
142
  </HStack>
114
143
  </ItemGroup>
@@ -223,47 +252,29 @@ function BackgroundImagePanelItem( props ) {
223
252
  panelId={ clientId }
224
253
  >
225
254
  <div className="block-editor-hooks__background__inspector-media-replace-container">
226
- { !! url && (
227
- <MediaReplaceFlow
228
- mediaId={ id }
229
- mediaURL={ url }
230
- allowedTypes={ [ IMAGE_BACKGROUND_TYPE ] }
231
- accept="image/*"
232
- onSelect={ onSelectMedia }
233
- name={
234
- <InspectorImagePreview
235
- label={ title }
236
- url={ url }
237
- />
238
- }
239
- variant="secondary"
240
- >
241
- <MenuItem
242
- onClick={ () => resetBackgroundImage( props ) }
243
- >
244
- { __( 'Reset ' ) }
245
- </MenuItem>
246
- </MediaReplaceFlow>
247
- ) }
248
- { ! url && (
249
- <MediaUploadCheck>
250
- <MediaUpload
251
- onSelect={ onSelectMedia }
252
- allowedTypes={ [ IMAGE_BACKGROUND_TYPE ] }
253
- render={ ( { open } ) => (
254
- <div className="block-editor-hooks__background__inspector-upload-container">
255
- <Button
256
- onClick={ open }
257
- variant="secondary"
258
- >
259
- { __( 'Add background image' ) }
260
- </Button>
261
- <DropZone onFilesDrop={ onFilesDrop } />
262
- </div>
263
- ) }
255
+ <MediaReplaceFlow
256
+ mediaId={ id }
257
+ mediaURL={ url }
258
+ allowedTypes={ [ IMAGE_BACKGROUND_TYPE ] }
259
+ accept="image/*"
260
+ onSelect={ onSelectMedia }
261
+ name={
262
+ <InspectorImagePreview
263
+ label={ __( 'Background image' ) }
264
+ filename={ title }
265
+ url={ url }
264
266
  />
265
- </MediaUploadCheck>
266
- ) }
267
+ }
268
+ variant="secondary"
269
+ >
270
+ <MenuItem onClick={ () => resetBackgroundImage( props ) }>
271
+ { __( 'Reset ' ) }
272
+ </MenuItem>
273
+ </MediaReplaceFlow>
274
+ <DropZone
275
+ onFilesDrop={ onFilesDrop }
276
+ label={ __( 'Drop to upload' ) }
277
+ />
267
278
  </div>
268
279
  </ToolsPanelItem>
269
280
  );
@@ -1,17 +1,14 @@
1
- .block-editor-hooks__background__inspector-upload-container {
1
+ .block-editor-hooks__background__inspector-media-replace-container {
2
2
  position: relative;
3
3
  // Since there is no option to skip rendering the drag'n'drop icon in drop
4
4
  // zone, we hide it for now.
5
5
  .components-drop-zone__content-icon {
6
6
  display: none;
7
7
  }
8
- }
9
8
 
10
- .block-editor-hooks__background__inspector-upload-container,
11
- .block-editor-hooks__background__inspector-media-replace-container {
12
9
  button.components-button {
13
10
  color: $gray-900;
14
- box-shadow: inset 0 0 0 1px $gray-400;
11
+ box-shadow: inset 0 0 0 $border-width $gray-300;
15
12
  width: 100%;
16
13
  display: block;
17
14
  height: $grid-unit-50;
@@ -34,24 +31,45 @@
34
31
  text-align: start;
35
32
  text-align-last: center;
36
33
  }
37
- }
38
34
 
39
- .block-editor-hooks__background__inspector-media-replace-container {
40
35
  .components-dropdown {
41
36
  display: block;
42
37
  }
38
+ }
43
39
 
44
- img {
45
- width: 20px;
46
- min-width: 20px;
47
- aspect-ratio: 1;
48
- box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.2);
49
- border-radius: 50% !important;
50
- }
40
+ .block-editor-hooks__background__inspector-image-indicator-wrapper {
41
+ background: #fff linear-gradient(-45deg, transparent 48%, $gray-300 48%, $gray-300 52%, transparent 52%); // Show a diagonal line (crossed out) for empty background image.
42
+ border-radius: $radius-round !important; // Override the default border-radius inherited from FlexItem.
43
+ box-shadow: inset 0 0 0 $border-width rgba(0, 0, 0, 0.2);
44
+ display: block;
45
+ width: 20px;
46
+ height: 20px;
47
+ flex: none;
51
48
 
52
- .block-editor-hooks__background__inspector-readonly-logo-preview {
53
- padding: 6px 12px;
54
- display: flex;
55
- height: $grid-unit-50;
49
+ &.has-image {
50
+ background: #fff; // No diagonal line for non-empty background image. A background color is in use to account for partially transparent images.
56
51
  }
57
52
  }
53
+
54
+ .block-editor-hooks__background__inspector-image-indicator {
55
+ background-size: cover;
56
+ border-radius: $radius-round;
57
+ width: 20px;
58
+ height: 20px;
59
+ display: block;
60
+ position: relative;
61
+ }
62
+
63
+ .block-editor-hooks__background__inspector-image-indicator::after {
64
+ content: "";
65
+ position: absolute;
66
+ top: -1px;
67
+ left: -1px;
68
+ bottom: -1px;
69
+ right: -1px;
70
+ border-radius: $radius-round;
71
+ box-shadow: inset 0 0 0 $border-width rgba(0, 0, 0, 0.2);
72
+ // Show a thin outline in Windows high contrast mode, otherwise the button is invisible.
73
+ border: 1px solid transparent;
74
+ box-sizing: inherit;
75
+ }
@@ -69,6 +69,7 @@ function RenameModal( { blockName, originalBlockName, onClose, onSave } ) {
69
69
  aria={ {
70
70
  describedby: dialogDescription,
71
71
  } }
72
+ focusOnMount="firstContentElement"
72
73
  >
73
74
  <p id={ dialogDescription }>
74
75
  { __( 'Enter a custom name for this block.' ) }
@@ -45,9 +45,8 @@ export function getLastInsertedBlocksClientIds( state ) {
45
45
  export const isBlockSubtreeDisabled = createSelector(
46
46
  ( state, clientId ) => {
47
47
  const isChildSubtreeDisabled = ( childClientId ) => {
48
- const mode = state.blockEditingModes.get( childClientId );
49
48
  return (
50
- ( mode === undefined || mode === 'disabled' ) &&
49
+ getBlockEditingMode( state, childClientId ) === 'disabled' &&
51
50
  getBlockOrder( state, childClientId ).every(
52
51
  isChildSubtreeDisabled
53
52
  )
@@ -58,7 +57,12 @@ export const isBlockSubtreeDisabled = createSelector(
58
57
  getBlockOrder( state, clientId ).every( isChildSubtreeDisabled )
59
58
  );
60
59
  },
61
- ( state ) => [ state.blockEditingModes, state.blocks.parents ]
60
+ ( state ) => [
61
+ state.blocks.parents,
62
+ state.blocks.order,
63
+ state.blockEditingModes,
64
+ state.blockListSettings,
65
+ ]
62
66
  );
63
67
 
64
68
  /**
@@ -1,54 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.PATTERN_TYPES = exports.PATTERN_SOURCE_FILTERS = void 0;
7
- exports.default = BlockPatternsSourceFilter;
8
- var _element = require("@wordpress/element");
9
- var _i18n = require("@wordpress/i18n");
10
- var _components = require("@wordpress/components");
11
- /**
12
- * WordPress dependencies
13
- */
14
-
15
- const PATTERN_TYPES = {
16
- synced: 'synced',
17
- unsynced: 'unsynced',
18
- user: 'user',
19
- theme: 'theme'
20
- };
21
- exports.PATTERN_TYPES = PATTERN_TYPES;
22
- const patternSourceOptions = [{
23
- value: 'all',
24
- label: (0, _i18n.__)('All pattern types')
25
- }, {
26
- value: PATTERN_TYPES.theme,
27
- label: (0, _i18n.__)('Theme patterns')
28
- }, {
29
- value: PATTERN_TYPES.user,
30
- label: (0, _i18n.__)('My patterns')
31
- }];
32
- const PATTERN_SOURCE_FILTERS = patternSourceOptions.reduce((patternSourceFilters, {
33
- value,
34
- label
35
- }) => {
36
- patternSourceFilters[value] = label;
37
- return patternSourceFilters;
38
- }, {});
39
- exports.PATTERN_SOURCE_FILTERS = PATTERN_SOURCE_FILTERS;
40
- function BlockPatternsSourceFilter({
41
- onChange,
42
- value
43
- }) {
44
- return (0, _element.createElement)(_components.SelectControl, {
45
- className: "block-editor-block-patterns__source-filter",
46
- label: (0, _i18n.__)('Pattern source'),
47
- options: patternSourceOptions,
48
- value: value,
49
- onChange: onChange,
50
- "aria-label": (0, _i18n.__)('Filter patterns by type'),
51
- hideLabelFromVision: true
52
- });
53
- }
54
- //# sourceMappingURL=block-patterns-source-filter.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_i18n","require","_components","PATTERN_TYPES","synced","unsynced","user","theme","exports","patternSourceOptions","value","label","__","PATTERN_SOURCE_FILTERS","reduce","patternSourceFilters","BlockPatternsSourceFilter","onChange","_element","createElement","SelectControl","className","options","hideLabelFromVision"],"sources":["@wordpress/block-editor/src/components/inserter/block-patterns-source-filter.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { SelectControl } from '@wordpress/components';\n\nexport const PATTERN_TYPES = {\n\tsynced: 'synced',\n\tunsynced: 'unsynced',\n\tuser: 'user',\n\ttheme: 'theme',\n};\n\nconst patternSourceOptions = [\n\t{ value: 'all', label: __( 'All pattern types' ) },\n\t{ value: PATTERN_TYPES.theme, label: __( 'Theme patterns' ) },\n\t{ value: PATTERN_TYPES.user, label: __( 'My patterns' ) },\n];\n\nexport const PATTERN_SOURCE_FILTERS = patternSourceOptions.reduce(\n\t( patternSourceFilters, { value, label } ) => {\n\t\tpatternSourceFilters[ value ] = label;\n\t\treturn patternSourceFilters;\n\t},\n\t{}\n);\n\nexport default function BlockPatternsSourceFilter( { onChange, value } ) {\n\treturn (\n\t\t<SelectControl\n\t\t\tclassName=\"block-editor-block-patterns__source-filter\"\n\t\t\tlabel={ __( 'Pattern source' ) }\n\t\t\toptions={ patternSourceOptions }\n\t\t\tvalue={ value }\n\t\t\tonChange={ onChange }\n\t\t\taria-label={ __( 'Filter patterns by type' ) }\n\t\t\thideLabelFromVision\n\t\t/>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AAJA;AACA;AACA;;AAIO,MAAME,aAAa,GAAG;EAC5BC,MAAM,EAAE,QAAQ;EAChBC,QAAQ,EAAE,UAAU;EACpBC,IAAI,EAAE,MAAM;EACZC,KAAK,EAAE;AACR,CAAC;AAACC,OAAA,CAAAL,aAAA,GAAAA,aAAA;AAEF,MAAMM,oBAAoB,GAAG,CAC5B;EAAEC,KAAK,EAAE,KAAK;EAAEC,KAAK,EAAE,IAAAC,QAAE,EAAE,mBAAoB;AAAE,CAAC,EAClD;EAAEF,KAAK,EAAEP,aAAa,CAACI,KAAK;EAAEI,KAAK,EAAE,IAAAC,QAAE,EAAE,gBAAiB;AAAE,CAAC,EAC7D;EAAEF,KAAK,EAAEP,aAAa,CAACG,IAAI;EAAEK,KAAK,EAAE,IAAAC,QAAE,EAAE,aAAc;AAAE,CAAC,CACzD;AAEM,MAAMC,sBAAsB,GAAGJ,oBAAoB,CAACK,MAAM,CAChE,CAAEC,oBAAoB,EAAE;EAAEL,KAAK;EAAEC;AAAM,CAAC,KAAM;EAC7CI,oBAAoB,CAAEL,KAAK,CAAE,GAAGC,KAAK;EACrC,OAAOI,oBAAoB;AAC5B,CAAC,EACD,CAAC,CACF,CAAC;AAACP,OAAA,CAAAK,sBAAA,GAAAA,sBAAA;AAEa,SAASG,yBAAyBA,CAAE;EAAEC,QAAQ;EAAEP;AAAM,CAAC,EAAG;EACxE,OACC,IAAAQ,QAAA,CAAAC,aAAA,EAACjB,WAAA,CAAAkB,aAAa;IACbC,SAAS,EAAC,4CAA4C;IACtDV,KAAK,EAAG,IAAAC,QAAE,EAAE,gBAAiB,CAAG;IAChCU,OAAO,EAAGb,oBAAsB;IAChCC,KAAK,EAAGA,KAAO;IACfO,QAAQ,EAAGA,QAAU;IACrB,cAAa,IAAAL,QAAE,EAAE,yBAA0B,CAAG;IAC9CW,mBAAmB;EAAA,CACnB,CAAC;AAEJ"}
@@ -1,46 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.BlockPatternsSyncFilter = BlockPatternsSyncFilter;
7
- exports.SYNC_TYPES = void 0;
8
- var _element = require("@wordpress/element");
9
- var _components = require("@wordpress/components");
10
- var _i18n = require("@wordpress/i18n");
11
- /**
12
- * WordPress dependencies
13
- */
14
-
15
- /**
16
- * Internal dependencies
17
- */
18
- const SYNC_TYPES = {
19
- full: 'fully',
20
- unsynced: 'unsynced'
21
- };
22
- exports.SYNC_TYPES = SYNC_TYPES;
23
- const patternSyncOptions = [{
24
- value: 'all',
25
- label: (0, _i18n.__)('All')
26
- }, {
27
- value: SYNC_TYPES.full,
28
- label: (0, _i18n.__)('Synced')
29
- }, {
30
- value: SYNC_TYPES.unsynced,
31
- label: (0, _i18n.__)('Standard')
32
- }];
33
- function BlockPatternsSyncFilter({
34
- setPatternSyncFilter,
35
- patternSyncFilter
36
- }) {
37
- return (0, _element.createElement)(_components.SelectControl, {
38
- className: "block-editor-patterns__sync-status-filter",
39
- label: (0, _i18n.__)('Syncing'),
40
- options: patternSyncOptions,
41
- value: patternSyncFilter,
42
- onChange: setPatternSyncFilter,
43
- "aria-label": (0, _i18n.__)('Filter patterns by sync type')
44
- });
45
- }
46
- //# sourceMappingURL=block-patterns-sync-filter.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_components","require","_i18n","SYNC_TYPES","full","unsynced","exports","patternSyncOptions","value","label","__","BlockPatternsSyncFilter","setPatternSyncFilter","patternSyncFilter","_element","createElement","SelectControl","className","options","onChange"],"sources":["@wordpress/block-editor/src/components/inserter/block-patterns-sync-filter.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { SelectControl } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nexport const SYNC_TYPES = {\n\tfull: 'fully',\n\tunsynced: 'unsynced',\n};\n\nconst patternSyncOptions = [\n\t{ value: 'all', label: __( 'All' ) },\n\t{ value: SYNC_TYPES.full, label: __( 'Synced' ) },\n\t{ value: SYNC_TYPES.unsynced, label: __( 'Standard' ) },\n];\n\nexport function BlockPatternsSyncFilter( {\n\tsetPatternSyncFilter,\n\tpatternSyncFilter,\n} ) {\n\treturn (\n\t\t<SelectControl\n\t\t\tclassName=\"block-editor-patterns__sync-status-filter\"\n\t\t\tlabel={ __( 'Syncing' ) }\n\t\t\toptions={ patternSyncOptions }\n\t\t\tvalue={ patternSyncFilter }\n\t\t\tonChange={ setPatternSyncFilter }\n\t\t\taria-label={ __( 'Filter patterns by sync type' ) }\n\t\t/>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAJA;AACA;AACA;;AAIA;AACA;AACA;AACO,MAAME,UAAU,GAAG;EACzBC,IAAI,EAAE,OAAO;EACbC,QAAQ,EAAE;AACX,CAAC;AAACC,OAAA,CAAAH,UAAA,GAAAA,UAAA;AAEF,MAAMI,kBAAkB,GAAG,CAC1B;EAAEC,KAAK,EAAE,KAAK;EAAEC,KAAK,EAAE,IAAAC,QAAE,EAAE,KAAM;AAAE,CAAC,EACpC;EAAEF,KAAK,EAAEL,UAAU,CAACC,IAAI;EAAEK,KAAK,EAAE,IAAAC,QAAE,EAAE,QAAS;AAAE,CAAC,EACjD;EAAEF,KAAK,EAAEL,UAAU,CAACE,QAAQ;EAAEI,KAAK,EAAE,IAAAC,QAAE,EAAE,UAAW;AAAE,CAAC,CACvD;AAEM,SAASC,uBAAuBA,CAAE;EACxCC,oBAAoB;EACpBC;AACD,CAAC,EAAG;EACH,OACC,IAAAC,QAAA,CAAAC,aAAA,EAACf,WAAA,CAAAgB,aAAa;IACbC,SAAS,EAAC,2CAA2C;IACrDR,KAAK,EAAG,IAAAC,QAAE,EAAE,SAAU,CAAG;IACzBQ,OAAO,EAAGX,kBAAoB;IAC9BC,KAAK,EAAGK,iBAAmB;IAC3BM,QAAQ,EAAGP,oBAAsB;IACjC,cAAa,IAAAF,QAAE,EAAE,8BAA+B;EAAG,CACnD,CAAC;AAEJ"}
@@ -1,44 +0,0 @@
1
- import { createElement } from "@wordpress/element";
2
- /**
3
- * WordPress dependencies
4
- */
5
- import { __ } from '@wordpress/i18n';
6
- import { SelectControl } from '@wordpress/components';
7
- export const PATTERN_TYPES = {
8
- synced: 'synced',
9
- unsynced: 'unsynced',
10
- user: 'user',
11
- theme: 'theme'
12
- };
13
- const patternSourceOptions = [{
14
- value: 'all',
15
- label: __('All pattern types')
16
- }, {
17
- value: PATTERN_TYPES.theme,
18
- label: __('Theme patterns')
19
- }, {
20
- value: PATTERN_TYPES.user,
21
- label: __('My patterns')
22
- }];
23
- export const PATTERN_SOURCE_FILTERS = patternSourceOptions.reduce((patternSourceFilters, {
24
- value,
25
- label
26
- }) => {
27
- patternSourceFilters[value] = label;
28
- return patternSourceFilters;
29
- }, {});
30
- export default function BlockPatternsSourceFilter({
31
- onChange,
32
- value
33
- }) {
34
- return createElement(SelectControl, {
35
- className: "block-editor-block-patterns__source-filter",
36
- label: __('Pattern source'),
37
- options: patternSourceOptions,
38
- value: value,
39
- onChange: onChange,
40
- "aria-label": __('Filter patterns by type'),
41
- hideLabelFromVision: true
42
- });
43
- }
44
- //# sourceMappingURL=block-patterns-source-filter.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["__","SelectControl","PATTERN_TYPES","synced","unsynced","user","theme","patternSourceOptions","value","label","PATTERN_SOURCE_FILTERS","reduce","patternSourceFilters","BlockPatternsSourceFilter","onChange","createElement","className","options","hideLabelFromVision"],"sources":["@wordpress/block-editor/src/components/inserter/block-patterns-source-filter.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { SelectControl } from '@wordpress/components';\n\nexport const PATTERN_TYPES = {\n\tsynced: 'synced',\n\tunsynced: 'unsynced',\n\tuser: 'user',\n\ttheme: 'theme',\n};\n\nconst patternSourceOptions = [\n\t{ value: 'all', label: __( 'All pattern types' ) },\n\t{ value: PATTERN_TYPES.theme, label: __( 'Theme patterns' ) },\n\t{ value: PATTERN_TYPES.user, label: __( 'My patterns' ) },\n];\n\nexport const PATTERN_SOURCE_FILTERS = patternSourceOptions.reduce(\n\t( patternSourceFilters, { value, label } ) => {\n\t\tpatternSourceFilters[ value ] = label;\n\t\treturn patternSourceFilters;\n\t},\n\t{}\n);\n\nexport default function BlockPatternsSourceFilter( { onChange, value } ) {\n\treturn (\n\t\t<SelectControl\n\t\t\tclassName=\"block-editor-block-patterns__source-filter\"\n\t\t\tlabel={ __( 'Pattern source' ) }\n\t\t\toptions={ patternSourceOptions }\n\t\t\tvalue={ value }\n\t\t\tonChange={ onChange }\n\t\t\taria-label={ __( 'Filter patterns by type' ) }\n\t\t\thideLabelFromVision\n\t\t/>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,aAAa,QAAQ,uBAAuB;AAErD,OAAO,MAAMC,aAAa,GAAG;EAC5BC,MAAM,EAAE,QAAQ;EAChBC,QAAQ,EAAE,UAAU;EACpBC,IAAI,EAAE,MAAM;EACZC,KAAK,EAAE;AACR,CAAC;AAED,MAAMC,oBAAoB,GAAG,CAC5B;EAAEC,KAAK,EAAE,KAAK;EAAEC,KAAK,EAAET,EAAE,CAAE,mBAAoB;AAAE,CAAC,EAClD;EAAEQ,KAAK,EAAEN,aAAa,CAACI,KAAK;EAAEG,KAAK,EAAET,EAAE,CAAE,gBAAiB;AAAE,CAAC,EAC7D;EAAEQ,KAAK,EAAEN,aAAa,CAACG,IAAI;EAAEI,KAAK,EAAET,EAAE,CAAE,aAAc;AAAE,CAAC,CACzD;AAED,OAAO,MAAMU,sBAAsB,GAAGH,oBAAoB,CAACI,MAAM,CAChE,CAAEC,oBAAoB,EAAE;EAAEJ,KAAK;EAAEC;AAAM,CAAC,KAAM;EAC7CG,oBAAoB,CAAEJ,KAAK,CAAE,GAAGC,KAAK;EACrC,OAAOG,oBAAoB;AAC5B,CAAC,EACD,CAAC,CACF,CAAC;AAED,eAAe,SAASC,yBAAyBA,CAAE;EAAEC,QAAQ;EAAEN;AAAM,CAAC,EAAG;EACxE,OACCO,aAAA,CAACd,aAAa;IACbe,SAAS,EAAC,4CAA4C;IACtDP,KAAK,EAAGT,EAAE,CAAE,gBAAiB,CAAG;IAChCiB,OAAO,EAAGV,oBAAsB;IAChCC,KAAK,EAAGA,KAAO;IACfM,QAAQ,EAAGA,QAAU;IACrB,cAAad,EAAE,CAAE,yBAA0B,CAAG;IAC9CkB,mBAAmB;EAAA,CACnB,CAAC;AAEJ"}
@@ -1,38 +0,0 @@
1
- import { createElement } from "@wordpress/element";
2
- /**
3
- * WordPress dependencies
4
- */
5
- import { SelectControl } from '@wordpress/components';
6
- import { __ } from '@wordpress/i18n';
7
-
8
- /**
9
- * Internal dependencies
10
- */
11
- export const SYNC_TYPES = {
12
- full: 'fully',
13
- unsynced: 'unsynced'
14
- };
15
- const patternSyncOptions = [{
16
- value: 'all',
17
- label: __('All')
18
- }, {
19
- value: SYNC_TYPES.full,
20
- label: __('Synced')
21
- }, {
22
- value: SYNC_TYPES.unsynced,
23
- label: __('Standard')
24
- }];
25
- export function BlockPatternsSyncFilter({
26
- setPatternSyncFilter,
27
- patternSyncFilter
28
- }) {
29
- return createElement(SelectControl, {
30
- className: "block-editor-patterns__sync-status-filter",
31
- label: __('Syncing'),
32
- options: patternSyncOptions,
33
- value: patternSyncFilter,
34
- onChange: setPatternSyncFilter,
35
- "aria-label": __('Filter patterns by sync type')
36
- });
37
- }
38
- //# sourceMappingURL=block-patterns-sync-filter.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["SelectControl","__","SYNC_TYPES","full","unsynced","patternSyncOptions","value","label","BlockPatternsSyncFilter","setPatternSyncFilter","patternSyncFilter","createElement","className","options","onChange"],"sources":["@wordpress/block-editor/src/components/inserter/block-patterns-sync-filter.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { SelectControl } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nexport const SYNC_TYPES = {\n\tfull: 'fully',\n\tunsynced: 'unsynced',\n};\n\nconst patternSyncOptions = [\n\t{ value: 'all', label: __( 'All' ) },\n\t{ value: SYNC_TYPES.full, label: __( 'Synced' ) },\n\t{ value: SYNC_TYPES.unsynced, label: __( 'Standard' ) },\n];\n\nexport function BlockPatternsSyncFilter( {\n\tsetPatternSyncFilter,\n\tpatternSyncFilter,\n} ) {\n\treturn (\n\t\t<SelectControl\n\t\t\tclassName=\"block-editor-patterns__sync-status-filter\"\n\t\t\tlabel={ __( 'Syncing' ) }\n\t\t\toptions={ patternSyncOptions }\n\t\t\tvalue={ patternSyncFilter }\n\t\t\tonChange={ setPatternSyncFilter }\n\t\t\taria-label={ __( 'Filter patterns by sync type' ) }\n\t\t/>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,aAAa,QAAQ,uBAAuB;AACrD,SAASC,EAAE,QAAQ,iBAAiB;;AAEpC;AACA;AACA;AACA,OAAO,MAAMC,UAAU,GAAG;EACzBC,IAAI,EAAE,OAAO;EACbC,QAAQ,EAAE;AACX,CAAC;AAED,MAAMC,kBAAkB,GAAG,CAC1B;EAAEC,KAAK,EAAE,KAAK;EAAEC,KAAK,EAAEN,EAAE,CAAE,KAAM;AAAE,CAAC,EACpC;EAAEK,KAAK,EAAEJ,UAAU,CAACC,IAAI;EAAEI,KAAK,EAAEN,EAAE,CAAE,QAAS;AAAE,CAAC,EACjD;EAAEK,KAAK,EAAEJ,UAAU,CAACE,QAAQ;EAAEG,KAAK,EAAEN,EAAE,CAAE,UAAW;AAAE,CAAC,CACvD;AAED,OAAO,SAASO,uBAAuBA,CAAE;EACxCC,oBAAoB;EACpBC;AACD,CAAC,EAAG;EACH,OACCC,aAAA,CAACX,aAAa;IACbY,SAAS,EAAC,2CAA2C;IACrDL,KAAK,EAAGN,EAAE,CAAE,SAAU,CAAG;IACzBY,OAAO,EAAGR,kBAAoB;IAC9BC,KAAK,EAAGI,iBAAmB;IAC3BI,QAAQ,EAAGL,oBAAsB;IACjC,cAAaR,EAAE,CAAE,8BAA+B;EAAG,CACnD,CAAC;AAEJ"}
@@ -1,40 +0,0 @@
1
- /**
2
- * WordPress dependencies
3
- */
4
- import { __ } from '@wordpress/i18n';
5
- import { SelectControl } from '@wordpress/components';
6
-
7
- export const PATTERN_TYPES = {
8
- synced: 'synced',
9
- unsynced: 'unsynced',
10
- user: 'user',
11
- theme: 'theme',
12
- };
13
-
14
- const patternSourceOptions = [
15
- { value: 'all', label: __( 'All pattern types' ) },
16
- { value: PATTERN_TYPES.theme, label: __( 'Theme patterns' ) },
17
- { value: PATTERN_TYPES.user, label: __( 'My patterns' ) },
18
- ];
19
-
20
- export const PATTERN_SOURCE_FILTERS = patternSourceOptions.reduce(
21
- ( patternSourceFilters, { value, label } ) => {
22
- patternSourceFilters[ value ] = label;
23
- return patternSourceFilters;
24
- },
25
- {}
26
- );
27
-
28
- export default function BlockPatternsSourceFilter( { onChange, value } ) {
29
- return (
30
- <SelectControl
31
- className="block-editor-block-patterns__source-filter"
32
- label={ __( 'Pattern source' ) }
33
- options={ patternSourceOptions }
34
- value={ value }
35
- onChange={ onChange }
36
- aria-label={ __( 'Filter patterns by type' ) }
37
- hideLabelFromVision
38
- />
39
- );
40
- }
@@ -1,35 +0,0 @@
1
- /**
2
- * WordPress dependencies
3
- */
4
- import { SelectControl } from '@wordpress/components';
5
- import { __ } from '@wordpress/i18n';
6
-
7
- /**
8
- * Internal dependencies
9
- */
10
- export const SYNC_TYPES = {
11
- full: 'fully',
12
- unsynced: 'unsynced',
13
- };
14
-
15
- const patternSyncOptions = [
16
- { value: 'all', label: __( 'All' ) },
17
- { value: SYNC_TYPES.full, label: __( 'Synced' ) },
18
- { value: SYNC_TYPES.unsynced, label: __( 'Standard' ) },
19
- ];
20
-
21
- export function BlockPatternsSyncFilter( {
22
- setPatternSyncFilter,
23
- patternSyncFilter,
24
- } ) {
25
- return (
26
- <SelectControl
27
- className="block-editor-patterns__sync-status-filter"
28
- label={ __( 'Syncing' ) }
29
- options={ patternSyncOptions }
30
- value={ patternSyncFilter }
31
- onChange={ setPatternSyncFilter }
32
- aria-label={ __( 'Filter patterns by sync type' ) }
33
- />
34
- );
35
- }