@wordpress/patterns 1.7.0 → 1.9.0

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 (60) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/build/components/category-selector.js +2 -1
  3. package/build/components/category-selector.js.map +1 -1
  4. package/build/components/create-pattern-modal.js +6 -3
  5. package/build/components/create-pattern-modal.js.map +1 -1
  6. package/build/components/duplicate-pattern-modal.js +3 -3
  7. package/build/components/duplicate-pattern-modal.js.map +1 -1
  8. package/build/components/index.js +4 -2
  9. package/build/components/index.js.map +1 -1
  10. package/build/components/partial-syncing-controls.js +91 -0
  11. package/build/components/partial-syncing-controls.js.map +1 -0
  12. package/build/components/pattern-convert-button.js +7 -4
  13. package/build/components/pattern-convert-button.js.map +1 -1
  14. package/build/components/patterns-manage-button.js +1 -2
  15. package/build/components/patterns-manage-button.js.map +1 -1
  16. package/build/components/rename-pattern-category-modal.js +3 -0
  17. package/build/components/rename-pattern-category-modal.js.map +1 -1
  18. package/build/components/rename-pattern-modal.js +3 -0
  19. package/build/components/rename-pattern-modal.js.map +1 -1
  20. package/build/constants.js +14 -1
  21. package/build/constants.js.map +1 -1
  22. package/build/private-apis.js +4 -1
  23. package/build/private-apis.js.map +1 -1
  24. package/build-module/components/category-selector.js +2 -1
  25. package/build-module/components/category-selector.js.map +1 -1
  26. package/build-module/components/create-pattern-modal.js +6 -3
  27. package/build-module/components/create-pattern-modal.js.map +1 -1
  28. package/build-module/components/duplicate-pattern-modal.js +4 -4
  29. package/build-module/components/duplicate-pattern-modal.js.map +1 -1
  30. package/build-module/components/index.js +4 -2
  31. package/build-module/components/index.js.map +1 -1
  32. package/build-module/components/partial-syncing-controls.js +83 -0
  33. package/build-module/components/partial-syncing-controls.js.map +1 -0
  34. package/build-module/components/pattern-convert-button.js +7 -4
  35. package/build-module/components/pattern-convert-button.js.map +1 -1
  36. package/build-module/components/patterns-manage-button.js +1 -2
  37. package/build-module/components/patterns-manage-button.js.map +1 -1
  38. package/build-module/components/rename-pattern-category-modal.js +3 -0
  39. package/build-module/components/rename-pattern-category-modal.js.map +1 -1
  40. package/build-module/components/rename-pattern-modal.js +3 -0
  41. package/build-module/components/rename-pattern-modal.js.map +1 -1
  42. package/build-module/constants.js +11 -0
  43. package/build-module/constants.js.map +1 -1
  44. package/build-module/private-apis.js +5 -2
  45. package/build-module/private-apis.js.map +1 -1
  46. package/build-style/style-rtl.css +6 -9
  47. package/build-style/style.css +6 -9
  48. package/package.json +17 -16
  49. package/src/components/category-selector.js +1 -0
  50. package/src/components/create-pattern-modal.js +5 -2
  51. package/src/components/duplicate-pattern-modal.js +7 -6
  52. package/src/components/index.js +2 -1
  53. package/src/components/partial-syncing-controls.js +98 -0
  54. package/src/components/pattern-convert-button.js +10 -4
  55. package/src/components/patterns-manage-button.js +34 -37
  56. package/src/components/rename-pattern-category-modal.js +7 -1
  57. package/src/components/rename-pattern-modal.js +11 -2
  58. package/src/components/style.scss +9 -14
  59. package/src/constants.js +10 -0
  60. package/src/private-apis.js +4 -0
@@ -93,6 +93,7 @@ export default function RenamePatternModal( {
93
93
  <VStack spacing="5">
94
94
  <TextControl
95
95
  __nextHasNoMarginBottom
96
+ __next40pxDefaultSize
96
97
  label={ __( 'Name' ) }
97
98
  value={ name }
98
99
  onChange={ setName }
@@ -100,11 +101,19 @@ export default function RenamePatternModal( {
100
101
  />
101
102
 
102
103
  <HStack justify="right">
103
- <Button variant="tertiary" onClick={ onRequestClose }>
104
+ <Button
105
+ __next40pxDefaultSize
106
+ variant="tertiary"
107
+ onClick={ onRequestClose }
108
+ >
104
109
  { __( 'Cancel' ) }
105
110
  </Button>
106
111
 
107
- <Button variant="primary" type="submit">
112
+ <Button
113
+ __next40pxDefaultSize
114
+ variant="primary"
115
+ type="submit"
116
+ >
108
117
  { __( 'Save' ) }
109
118
  </Button>
110
119
  </HStack>
@@ -7,32 +7,27 @@
7
7
  }
8
8
 
9
9
  .patterns-menu-items__convert-modal-categories {
10
- width: 100%;
11
10
  position: relative;
12
- min-height: 40px;
13
11
  }
14
- .components-form-token-field__suggestions-list {
12
+
13
+ .components-form-token-field__suggestions-list:not(:empty) {
15
14
  position: absolute;
15
+ border: $border-width solid var(--wp-admin-theme-color);
16
+ border-bottom-left-radius: $radius-block-ui;
17
+ border-bottom-right-radius: $radius-block-ui;
18
+ box-shadow: 0 0 0.5px 0.5px var(--wp-admin-theme-color);
16
19
  box-sizing: border-box;
17
20
  z-index: 1;
18
21
  background-color: $white;
19
- // Account for the border width of the token field.
20
- width: calc(100% + 2px);
22
+ width: calc(100% + 2px); // Account for the border width of the token field.
21
23
  left: -1px;
22
24
  min-width: initial;
23
- border: 1px solid var(--wp-admin-theme-color);
24
- border-top: none;
25
- box-shadow: 0 0 0 0.5px var(--wp-admin-theme-color);
26
- border-bottom-left-radius: 2px;
27
- border-bottom-right-radius: 2px;
25
+ max-height: $grid-unit-60 * 2; // Adjust to not cover the save button, showing three items.
28
26
  }
29
27
  }
30
28
 
31
29
  .patterns-create-modal__name-input input[type="text"] {
32
- // Match the minimal height of the category selector.
33
- min-height: 40px;
34
- // Override the default 1px margin-x.
35
- margin: 0;
30
+ margin: 0; // Override the default 1px margin-x.
36
31
  }
37
32
 
38
33
  .patterns-rename-pattern-category-modal__validation-message {
package/src/constants.js CHANGED
@@ -1,3 +1,8 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import { __ } from '@wordpress/i18n';
5
+
1
6
  export const PATTERN_TYPES = {
2
7
  theme: 'pattern',
3
8
  user: 'wp_block',
@@ -14,3 +19,8 @@ export const PATTERN_SYNC_TYPES = {
14
19
  full: 'fully',
15
20
  unsynced: 'unsynced',
16
21
  };
22
+
23
+ // TODO: This should not be hardcoded. Maybe there should be a config and/or an UI.
24
+ export const PARTIAL_SYNCING_SUPPORTED_BLOCKS = {
25
+ 'core/paragraph': { content: __( 'Content' ) },
26
+ };
@@ -7,12 +7,14 @@ import DuplicatePatternModal from './components/duplicate-pattern-modal';
7
7
  import RenamePatternModal from './components/rename-pattern-modal';
8
8
  import PatternsMenuItems from './components';
9
9
  import RenamePatternCategoryModal from './components/rename-pattern-category-modal';
10
+ import PartialSyncingControls from './components/partial-syncing-controls';
10
11
  import {
11
12
  PATTERN_TYPES,
12
13
  PATTERN_DEFAULT_CATEGORY,
13
14
  PATTERN_USER_CATEGORY,
14
15
  EXCLUDED_PATTERN_SOURCES,
15
16
  PATTERN_SYNC_TYPES,
17
+ PARTIAL_SYNCING_SUPPORTED_BLOCKS,
16
18
  } from './constants';
17
19
 
18
20
  export const privateApis = {};
@@ -22,9 +24,11 @@ lock( privateApis, {
22
24
  RenamePatternModal,
23
25
  PatternsMenuItems,
24
26
  RenamePatternCategoryModal,
27
+ PartialSyncingControls,
25
28
  PATTERN_TYPES,
26
29
  PATTERN_DEFAULT_CATEGORY,
27
30
  PATTERN_USER_CATEGORY,
28
31
  EXCLUDED_PATTERN_SOURCES,
29
32
  PATTERN_SYNC_TYPES,
33
+ PARTIAL_SYNCING_SUPPORTED_BLOCKS,
30
34
  } );