@wordpress/block-editor 12.18.1 → 12.18.2

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 (76) hide show
  1. package/build/components/global-styles/hooks.js +2 -3
  2. package/build/components/global-styles/hooks.js.map +1 -1
  3. package/build/components/global-styles/typography-panel.js +14 -31
  4. package/build/components/global-styles/typography-panel.js.map +1 -1
  5. package/build/components/rich-text/index.js +1 -1
  6. package/build/components/rich-text/index.js.map +1 -1
  7. package/build/components/url-popover/image-url-input-ui.js +55 -34
  8. package/build/components/url-popover/image-url-input-ui.js.map +1 -1
  9. package/build/components/url-popover/index.js +3 -1
  10. package/build/components/url-popover/index.js.map +1 -1
  11. package/build/components/url-popover/link-editor.js +2 -1
  12. package/build/components/url-popover/link-editor.js.map +1 -1
  13. package/build/components/url-popover/link-viewer.js +2 -1
  14. package/build/components/url-popover/link-viewer.js.map +1 -1
  15. package/build/hooks/index.js +0 -6
  16. package/build/hooks/index.js.map +1 -1
  17. package/build/hooks/index.native.js +0 -6
  18. package/build/hooks/index.native.js.map +1 -1
  19. package/build/hooks/use-bindings-attributes.js +2 -2
  20. package/build/hooks/use-bindings-attributes.js.map +1 -1
  21. package/build/hooks/use-shadow-props.js +0 -15
  22. package/build/hooks/use-shadow-props.js.map +1 -1
  23. package/build/hooks/utils.js +3 -6
  24. package/build/hooks/utils.js.map +1 -1
  25. package/build/index.js +0 -7
  26. package/build/index.js.map +1 -1
  27. package/build/utils/object.js +0 -17
  28. package/build/utils/object.js.map +1 -1
  29. package/build-module/components/global-styles/hooks.js +2 -3
  30. package/build-module/components/global-styles/hooks.js.map +1 -1
  31. package/build-module/components/global-styles/typography-panel.js +15 -32
  32. package/build-module/components/global-styles/typography-panel.js.map +1 -1
  33. package/build-module/components/rich-text/index.js +1 -1
  34. package/build-module/components/rich-text/index.js.map +1 -1
  35. package/build-module/components/url-popover/image-url-input-ui.js +57 -36
  36. package/build-module/components/url-popover/image-url-input-ui.js.map +1 -1
  37. package/build-module/components/url-popover/index.js +3 -1
  38. package/build-module/components/url-popover/index.js.map +1 -1
  39. package/build-module/components/url-popover/link-editor.js +2 -1
  40. package/build-module/components/url-popover/link-editor.js.map +1 -1
  41. package/build-module/components/url-popover/link-viewer.js +2 -1
  42. package/build-module/components/url-popover/link-viewer.js.map +1 -1
  43. package/build-module/hooks/index.js +1 -1
  44. package/build-module/hooks/index.js.map +1 -1
  45. package/build-module/hooks/index.native.js +1 -1
  46. package/build-module/hooks/index.native.js.map +1 -1
  47. package/build-module/hooks/use-bindings-attributes.js +2 -2
  48. package/build-module/hooks/use-bindings-attributes.js.map +1 -1
  49. package/build-module/hooks/use-shadow-props.js +0 -14
  50. package/build-module/hooks/use-shadow-props.js.map +1 -1
  51. package/build-module/hooks/utils.js +3 -6
  52. package/build-module/hooks/utils.js.map +1 -1
  53. package/build-module/index.js +1 -1
  54. package/build-module/index.js.map +1 -1
  55. package/build-module/utils/object.js +0 -16
  56. package/build-module/utils/object.js.map +1 -1
  57. package/build-style/style-rtl.css +48 -31
  58. package/build-style/style.css +48 -31
  59. package/package.json +2 -2
  60. package/src/components/block-canvas/style.scss +2 -2
  61. package/src/components/global-styles/hooks.js +0 -2
  62. package/src/components/global-styles/typography-panel.js +13 -45
  63. package/src/components/media-replace-flow/style.scss +1 -1
  64. package/src/components/rich-text/index.js +1 -2
  65. package/src/components/url-popover/image-url-input-ui.js +86 -37
  66. package/src/components/url-popover/index.js +2 -0
  67. package/src/components/url-popover/link-editor.js +1 -0
  68. package/src/components/url-popover/link-viewer.js +1 -0
  69. package/src/components/url-popover/style.scss +51 -31
  70. package/src/hooks/index.js +1 -1
  71. package/src/hooks/index.native.js +1 -1
  72. package/src/hooks/use-bindings-attributes.js +2 -5
  73. package/src/hooks/use-shadow-props.js +0 -14
  74. package/src/hooks/utils.js +4 -16
  75. package/src/index.js +0 -1
  76. package/src/utils/object.js +0 -16
@@ -41,6 +41,7 @@ export default function LinkViewer( {
41
41
  icon={ edit }
42
42
  label={ __( 'Edit' ) }
43
43
  onClick={ onEditLinkClick }
44
+ size="compact"
44
45
  />
45
46
  ) }
46
47
  </div>
@@ -1,53 +1,39 @@
1
1
  .block-editor-url-popover__additional-controls {
2
- border-top: $border-width solid $gray-300;
2
+ border-top: $border-width solid $gray-900;
3
+ padding: $grid-unit-10 $grid-unit-10;
3
4
  }
4
5
 
5
- .block-editor-url-popover__additional-controls > div[role="menu"] .components-button:not(:disabled):not([aria-disabled="true"]):not(.is-secondary) > svg {
6
- box-shadow: none;
7
- }
8
-
9
- .block-editor-url-popover__additional-controls div[role="menu"] > .components-button {
10
- padding-left: $grid-unit-15;
6
+ .block-editor-url-popover__input-container {
7
+ padding: $grid-unit-10;
8
+ padding-left: $grid-unit-20;
11
9
  }
12
10
 
13
11
  .block-editor-url-popover__row {
14
12
  display: flex;
13
+ gap: $grid-unit-05;
15
14
  }
16
15
 
17
16
  // Any children of the popover-row that are not the settings-toggle
18
17
  // should take up as much space as possible.
19
18
  .block-editor-url-popover__row > :not(.block-editor-url-popover__settings-toggle) {
20
19
  flex-grow: 1;
20
+ gap: $grid-unit-05;
21
21
  }
22
22
 
23
- // Mimic toolbar component styles for the icons in this popover.
24
- .block-editor-url-popover .components-button.has-icon {
25
- padding: 3px;
23
+ .block-editor-url-popover__additional-controls .components-button.has-icon {
24
+ padding-left: $grid-unit-10;
25
+ padding-right: $grid-unit-10;
26
+ height: auto;
27
+ text-align: left;
26
28
 
27
29
  > svg {
28
- padding: 5px;
29
- border-radius: $radius-block-ui;
30
- height: 30px;
31
- width: 30px;
32
- }
33
-
34
- &:not(:disabled):focus {
35
- box-shadow: none;
36
-
37
- > svg {
38
- @include block-toolbar-button-style__focus();
39
- }
30
+ margin-right: $grid-unit-10;
40
31
  }
41
32
  }
42
33
 
43
34
  .block-editor-url-popover__settings-toggle {
44
35
  flex-shrink: 0;
45
36
 
46
- // Add a left divider to the toggle button.
47
- border-radius: 0;
48
- border-left: $border-width solid $gray-300;
49
- margin-left: 1px;
50
-
51
37
  &[aria-expanded="true"] .dashicon {
52
38
  transform: rotate(180deg);
53
39
  }
@@ -56,7 +42,7 @@
56
42
  .block-editor-url-popover__settings {
57
43
  display: block;
58
44
  padding: $grid-unit-20;
59
- border-top: $border-width solid $gray-300;
45
+ border-top: $border-width solid $gray-900;
60
46
  }
61
47
 
62
48
  .block-editor-url-popover__link-editor,
@@ -65,16 +51,50 @@
65
51
  }
66
52
 
67
53
  .block-editor-url-popover__link-viewer-url {
68
- margin: $grid-unit-10 - $border-width;
54
+ display: flex;
55
+ align-items: center;
69
56
  flex-grow: 1;
70
57
  flex-shrink: 1;
71
58
  overflow: hidden;
72
59
  text-overflow: ellipsis;
73
60
  white-space: nowrap;
74
- min-width: 150px;
75
- max-width: 500px;
61
+ margin-right: $grid-unit-10;
76
62
 
77
63
  &.has-invalid-link {
78
64
  color: $alert-red;
79
65
  }
80
66
  }
67
+
68
+ .block-editor-url-popover__expand-on-click {
69
+ display: flex;
70
+ align-items: center;
71
+ min-width: $modal-min-width;
72
+ overflow: hidden;
73
+ white-space: nowrap;
74
+
75
+ .fullscreen-icon {
76
+ padding-right: $grid-unit-05;
77
+
78
+ > svg {
79
+ width: $icon-size;
80
+ height: $icon-size;
81
+ }
82
+ }
83
+
84
+ .text {
85
+ flex-grow: 1;
86
+
87
+ p {
88
+ margin: 0;
89
+ }
90
+ }
91
+
92
+ .description {
93
+ color: $gray-600;
94
+ }
95
+
96
+ .remove-link {
97
+ margin-right: $grid-unit-10;
98
+ }
99
+
100
+ }
@@ -71,7 +71,7 @@ createBlockSaveFilter( [
71
71
  export { useCustomSides } from './dimensions';
72
72
  export { useLayoutClasses, useLayoutStyles } from './layout';
73
73
  export { getBorderClassesAndStyles, useBorderProps } from './use-border-props';
74
- export { getShadowClassesAndStyles, useShadowProps } from './use-shadow-props';
74
+ export { getShadowClassesAndStyles } from './use-shadow-props';
75
75
  export { getColorClassesAndStyles, useColorProps } from './use-color-props';
76
76
  export { getSpacingClassesAndStyles } from './use-spacing-props';
77
77
  export { getTypographyClassesAndStyles } from './use-typography-props';
@@ -28,7 +28,7 @@ createBlockSaveFilter( [
28
28
  ] );
29
29
 
30
30
  export { getBorderClassesAndStyles, useBorderProps } from './use-border-props';
31
- export { getShadowClassesAndStyles, useShadowProps } from './use-shadow-props';
31
+ export { getShadowClassesAndStyles } from './use-shadow-props';
32
32
  export { getColorClassesAndStyles, useColorProps } from './use-color-props';
33
33
  export { getSpacingClassesAndStyles } from './use-spacing-props';
34
34
  export { useCachedTruthy } from './use-cached-truthy';
@@ -44,7 +44,7 @@ const createEditFunctionWithBindingsAttribute = () =>
44
44
  Object.entries( updatedAttributes.metadata.bindings ).forEach(
45
45
  ( [ attributeName, settings ] ) => {
46
46
  const source = getBlockBindingsSource(
47
- settings.source.name
47
+ settings.source
48
48
  );
49
49
 
50
50
  if ( source ) {
@@ -52,10 +52,7 @@ const createEditFunctionWithBindingsAttribute = () =>
52
52
  const {
53
53
  placeholder,
54
54
  useValue: [ metaValue = null ] = [],
55
- } = source.useSource(
56
- props,
57
- settings.source.attributes
58
- );
55
+ } = source.useSource( props, settings.args );
59
56
 
60
57
  if ( placeholder && ! metaValue ) {
61
58
  // If the attribute is `src` or `href`, a placeholder can't be used because it is not a valid url.
@@ -18,20 +18,6 @@ export function getShadowClassesAndStyles( attributes ) {
18
18
  const shadow = attributes.style?.shadow || '';
19
19
 
20
20
  return {
21
- className: undefined,
22
21
  style: getInlineStyles( { shadow } ),
23
22
  };
24
23
  }
25
-
26
- /**
27
- * Derives the shadow related props for a block from its shadow block support
28
- * attributes.
29
- *
30
- * @param {Object} attributes Block attributes.
31
- *
32
- * @return {Object} ClassName & style props from shadow block support.
33
- */
34
- export function useShadowProps( attributes ) {
35
- const shadowProps = getShadowClassesAndStyles( attributes );
36
- return shadowProps;
37
- }
@@ -177,10 +177,7 @@ export function useBlockSettings( name, parentLayout ) {
177
177
  backgroundImage,
178
178
  backgroundSize,
179
179
  fontFamilies,
180
- userFontSizes,
181
- themeFontSizes,
182
- defaultFontSizes,
183
- defaultFontSizesEnabled,
180
+ fontSizes,
184
181
  customFontSize,
185
182
  fontStyle,
186
183
  fontWeight,
@@ -227,10 +224,7 @@ export function useBlockSettings( name, parentLayout ) {
227
224
  'background.backgroundImage',
228
225
  'background.backgroundSize',
229
226
  'typography.fontFamilies',
230
- 'typography.fontSizes.custom',
231
- 'typography.fontSizes.theme',
232
- 'typography.fontSizes.default',
233
- 'typography.defaultFontSizes',
227
+ 'typography.fontSizes',
234
228
  'typography.customFontSize',
235
229
  'typography.fontStyle',
236
230
  'typography.fontWeight',
@@ -314,12 +308,9 @@ export function useBlockSettings( name, parentLayout ) {
314
308
  custom: fontFamilies,
315
309
  },
316
310
  fontSizes: {
317
- custom: userFontSizes,
318
- theme: themeFontSizes,
319
- default: defaultFontSizes,
311
+ custom: fontSizes,
320
312
  },
321
313
  customFontSize,
322
- defaultFontSizes: defaultFontSizesEnabled,
323
314
  fontStyle,
324
315
  fontWeight,
325
316
  lineHeight,
@@ -356,10 +347,7 @@ export function useBlockSettings( name, parentLayout ) {
356
347
  backgroundImage,
357
348
  backgroundSize,
358
349
  fontFamilies,
359
- userFontSizes,
360
- themeFontSizes,
361
- defaultFontSizes,
362
- defaultFontSizesEnabled,
350
+ fontSizes,
363
351
  customFontSize,
364
352
  fontStyle,
365
353
  fontWeight,
package/src/index.js CHANGED
@@ -12,7 +12,6 @@ export {
12
12
  getSpacingClassesAndStyles as __experimentalGetSpacingClassesAndStyles,
13
13
  getGapCSSValue as __experimentalGetGapCSSValue,
14
14
  getShadowClassesAndStyles as __experimentalGetShadowClassesAndStyles,
15
- useShadowProps as __experimentalUseShadowProps,
16
15
  useCachedTruthy,
17
16
  } from './hooks';
18
17
  export * from './components';
@@ -49,19 +49,3 @@ export const getValueFromObjectPath = ( object, path, defaultValue ) => {
49
49
  } );
50
50
  return value ?? defaultValue;
51
51
  };
52
-
53
- /**
54
- * Helper util to filter out objects with duplicate values for a given property.
55
- *
56
- * @param {Object[]} array Array of objects to filter.
57
- * @param {string} property Property to filter unique values by.
58
- *
59
- * @return {Object[]} Array of objects with unique values for the specified property.
60
- */
61
- export function uniqByProperty( array, property ) {
62
- const seen = new Set();
63
- return array.filter( ( item ) => {
64
- const value = item[ property ];
65
- return seen.has( value ) ? false : seen.add( value );
66
- } );
67
- }