@wordpress/block-editor 14.7.1-next.082ed6819.0 → 14.8.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 (30) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/components/block-toolbar/index.js +11 -4
  3. package/build/components/block-toolbar/index.js.map +1 -1
  4. package/build/components/iframe/index.js +12 -216
  5. package/build/components/iframe/index.js.map +1 -1
  6. package/build/components/iframe/use-scale-canvas.js +377 -0
  7. package/build/components/iframe/use-scale-canvas.js.map +1 -0
  8. package/build/components/image-editor/use-save-image.js +22 -3
  9. package/build/components/image-editor/use-save-image.js.map +1 -1
  10. package/build-module/components/block-toolbar/index.js +11 -4
  11. package/build-module/components/block-toolbar/index.js.map +1 -1
  12. package/build-module/components/iframe/index.js +14 -218
  13. package/build-module/components/iframe/index.js.map +1 -1
  14. package/build-module/components/iframe/use-scale-canvas.js +371 -0
  15. package/build-module/components/iframe/use-scale-canvas.js.map +1 -0
  16. package/build-module/components/image-editor/use-save-image.js +22 -3
  17. package/build-module/components/image-editor/use-save-image.js.map +1 -1
  18. package/build-style/content-rtl.css +7 -22
  19. package/build-style/content.css +7 -22
  20. package/build-style/style-rtl.css +30 -0
  21. package/build-style/style.css +30 -0
  22. package/package.json +31 -31
  23. package/src/components/block-canvas/style.scss +2 -1
  24. package/src/components/block-toolbar/index.js +8 -0
  25. package/src/components/block-tools/style.scss +39 -0
  26. package/src/components/color-palette/test/__snapshots__/control.js.snap +2 -2
  27. package/src/components/iframe/content.scss +34 -41
  28. package/src/components/iframe/index.js +13 -313
  29. package/src/components/iframe/use-scale-canvas.js +468 -0
  30. package/src/components/image-editor/use-save-image.js +27 -2
@@ -459,6 +459,36 @@ iframe[name=editor-canvas] {
459
459
  .components-popover.block-editor-block-list__block-popover .block-editor-block-toolbar .components-toolbar {
460
460
  border-left-color: #1e1e1e;
461
461
  }
462
+ .components-popover.block-editor-block-list__block-popover .is-inverted-toolbar {
463
+ background-color: #1e1e1e;
464
+ color: #f0f0f0;
465
+ }
466
+ .components-popover.block-editor-block-list__block-popover .is-inverted-toolbar.block-editor-block-contextual-toolbar {
467
+ border-color: #2f2f2f;
468
+ }
469
+ .components-popover.block-editor-block-list__block-popover .is-inverted-toolbar button {
470
+ color: #ddd;
471
+ }
472
+ .components-popover.block-editor-block-list__block-popover .is-inverted-toolbar button:hover {
473
+ color: #fff;
474
+ }
475
+ .components-popover.block-editor-block-list__block-popover .is-inverted-toolbar button:focus::before {
476
+ box-shadow: inset 0 0 0 1px #1e1e1e, 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
477
+ }
478
+ .components-popover.block-editor-block-list__block-popover .is-inverted-toolbar .block-editor-block-parent-selector .block-editor-block-parent-selector__button {
479
+ border-color: #2f2f2f;
480
+ background-color: #1e1e1e;
481
+ }
482
+ .components-popover.block-editor-block-list__block-popover .is-inverted-toolbar .block-editor-block-switcher__toggle {
483
+ color: #f0f0f0;
484
+ }
485
+ .components-popover.block-editor-block-list__block-popover .is-inverted-toolbar .components-toolbar-group,
486
+ .components-popover.block-editor-block-list__block-popover .is-inverted-toolbar .components-toolbar {
487
+ border-left-color: #2f2f2f !important;
488
+ }
489
+ .components-popover.block-editor-block-list__block-popover .is-inverted-toolbar .is-pressed {
490
+ color: var(--wp-admin-theme-color);
491
+ }
462
492
  .components-popover.block-editor-block-list__block-popover.is-insertion-point-visible {
463
493
  visibility: hidden;
464
494
  }
@@ -459,6 +459,36 @@ iframe[name=editor-canvas] {
459
459
  .components-popover.block-editor-block-list__block-popover .block-editor-block-toolbar .components-toolbar {
460
460
  border-right-color: #1e1e1e;
461
461
  }
462
+ .components-popover.block-editor-block-list__block-popover .is-inverted-toolbar {
463
+ background-color: #1e1e1e;
464
+ color: #f0f0f0;
465
+ }
466
+ .components-popover.block-editor-block-list__block-popover .is-inverted-toolbar.block-editor-block-contextual-toolbar {
467
+ border-color: #2f2f2f;
468
+ }
469
+ .components-popover.block-editor-block-list__block-popover .is-inverted-toolbar button {
470
+ color: #ddd;
471
+ }
472
+ .components-popover.block-editor-block-list__block-popover .is-inverted-toolbar button:hover {
473
+ color: #fff;
474
+ }
475
+ .components-popover.block-editor-block-list__block-popover .is-inverted-toolbar button:focus::before {
476
+ box-shadow: inset 0 0 0 1px #1e1e1e, 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
477
+ }
478
+ .components-popover.block-editor-block-list__block-popover .is-inverted-toolbar .block-editor-block-parent-selector .block-editor-block-parent-selector__button {
479
+ border-color: #2f2f2f;
480
+ background-color: #1e1e1e;
481
+ }
482
+ .components-popover.block-editor-block-list__block-popover .is-inverted-toolbar .block-editor-block-switcher__toggle {
483
+ color: #f0f0f0;
484
+ }
485
+ .components-popover.block-editor-block-list__block-popover .is-inverted-toolbar .components-toolbar-group,
486
+ .components-popover.block-editor-block-list__block-popover .is-inverted-toolbar .components-toolbar {
487
+ border-right-color: #2f2f2f !important;
488
+ }
489
+ .components-popover.block-editor-block-list__block-popover .is-inverted-toolbar .is-pressed {
490
+ color: var(--wp-admin-theme-color);
491
+ }
462
492
  .components-popover.block-editor-block-list__block-popover.is-insertion-point-visible {
463
493
  visibility: hidden;
464
494
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/block-editor",
3
- "version": "14.7.1-next.082ed6819.0",
3
+ "version": "14.8.0",
4
4
  "description": "Generic block editor.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -37,37 +37,37 @@
37
37
  "@emotion/react": "^11.7.1",
38
38
  "@emotion/styled": "^11.6.0",
39
39
  "@react-spring/web": "^9.4.5",
40
- "@wordpress/a11y": "^4.12.1-next.082ed6819.0",
41
- "@wordpress/api-fetch": "^7.12.1-next.082ed6819.0",
42
- "@wordpress/blob": "^4.12.1-next.082ed6819.0",
43
- "@wordpress/block-serialization-default-parser": "^5.12.1-next.082ed6819.0",
44
- "@wordpress/blocks": "^14.1.1-next.082ed6819.0",
45
- "@wordpress/commands": "^1.12.1-next.082ed6819.0",
40
+ "@wordpress/a11y": "*",
41
+ "@wordpress/api-fetch": "*",
42
+ "@wordpress/blob": "*",
43
+ "@wordpress/block-serialization-default-parser": "*",
44
+ "@wordpress/blocks": "*",
45
+ "@wordpress/commands": "*",
46
46
  "@wordpress/components": "*",
47
- "@wordpress/compose": "^7.12.1-next.082ed6819.0",
47
+ "@wordpress/compose": "*",
48
48
  "@wordpress/data": "*",
49
- "@wordpress/date": "^5.12.1-next.082ed6819.0",
50
- "@wordpress/deprecated": "^4.12.1-next.082ed6819.0",
51
- "@wordpress/dom": "^4.12.1-next.082ed6819.0",
52
- "@wordpress/element": "^6.12.1-next.082ed6819.0",
53
- "@wordpress/escape-html": "^3.12.1-next.082ed6819.0",
54
- "@wordpress/hooks": "^4.12.1-next.082ed6819.0",
55
- "@wordpress/html-entities": "^4.12.1-next.082ed6819.0",
56
- "@wordpress/i18n": "^5.12.1-next.082ed6819.0",
57
- "@wordpress/icons": "^10.12.1-next.082ed6819.0",
58
- "@wordpress/is-shallow-equal": "^5.12.1-next.082ed6819.0",
59
- "@wordpress/keyboard-shortcuts": "^5.12.1-next.082ed6819.0",
60
- "@wordpress/keycodes": "^4.12.1-next.082ed6819.0",
61
- "@wordpress/notices": "^5.12.1-next.082ed6819.0",
62
- "@wordpress/preferences": "^4.12.1-next.082ed6819.0",
63
- "@wordpress/priority-queue": "^3.12.1-next.082ed6819.0",
64
- "@wordpress/private-apis": "^1.12.1-next.082ed6819.0",
65
- "@wordpress/rich-text": "^7.12.1-next.082ed6819.0",
66
- "@wordpress/style-engine": "^2.12.1-next.082ed6819.0",
67
- "@wordpress/token-list": "^3.12.1-next.082ed6819.0",
68
- "@wordpress/url": "^4.12.1-next.082ed6819.0",
69
- "@wordpress/warning": "^3.12.1-next.082ed6819.0",
70
- "@wordpress/wordcount": "^4.12.1-next.082ed6819.0",
49
+ "@wordpress/date": "*",
50
+ "@wordpress/deprecated": "*",
51
+ "@wordpress/dom": "*",
52
+ "@wordpress/element": "*",
53
+ "@wordpress/escape-html": "*",
54
+ "@wordpress/hooks": "*",
55
+ "@wordpress/html-entities": "*",
56
+ "@wordpress/i18n": "*",
57
+ "@wordpress/icons": "*",
58
+ "@wordpress/is-shallow-equal": "*",
59
+ "@wordpress/keyboard-shortcuts": "*",
60
+ "@wordpress/keycodes": "*",
61
+ "@wordpress/notices": "*",
62
+ "@wordpress/preferences": "*",
63
+ "@wordpress/priority-queue": "*",
64
+ "@wordpress/private-apis": "*",
65
+ "@wordpress/rich-text": "*",
66
+ "@wordpress/style-engine": "*",
67
+ "@wordpress/token-list": "*",
68
+ "@wordpress/url": "*",
69
+ "@wordpress/warning": "*",
70
+ "@wordpress/wordcount": "*",
71
71
  "change-case": "^4.1.2",
72
72
  "clsx": "^2.1.1",
73
73
  "colord": "^2.7.0",
@@ -90,5 +90,5 @@
90
90
  "publishConfig": {
91
91
  "access": "public"
92
92
  },
93
- "gitHead": "2bb7bad15ddb8e88210fab7d4a1ef1565466e424"
93
+ "gitHead": "cce81c13739c2a8b53d91df90c4f037cb68c2665"
94
94
  }
@@ -4,6 +4,7 @@ iframe[name="editor-canvas"] {
4
4
  height: 100%;
5
5
  display: block;
6
6
  // Handles transitions between device previews
7
- @include editor-canvas-resize-animation;
7
+ transition: all 400ms cubic-bezier(0.46, 0.03, 0.52, 0.96);
8
+ @include reduce-motion("transition");
8
9
  background-color: $gray-300;
9
10
  }
@@ -74,6 +74,8 @@ export function PrivateBlockToolbar( {
74
74
  showGroupButtons,
75
75
  showLockButtons,
76
76
  showSwitchSectionStyleButton,
77
+ hasFixedToolbar,
78
+ isNavigationMode,
77
79
  } = useSelect( ( select ) => {
78
80
  const {
79
81
  getBlockName,
@@ -85,8 +87,10 @@ export function PrivateBlockToolbar( {
85
87
  getBlockAttributes,
86
88
  getBlockParentsByBlockName,
87
89
  getTemplateLock,
90
+ getSettings,
88
91
  getParentSectionBlock,
89
92
  isZoomOut,
93
+ isNavigationMode: _isNavigationMode,
90
94
  } = unlock( select( blockEditorStore ) );
91
95
  const selectedBlockClientIds = getSelectedBlockClientIds();
92
96
  const selectedBlockClientId = selectedBlockClientIds[ 0 ];
@@ -119,6 +123,7 @@ export function PrivateBlockToolbar( {
119
123
  const _hasTemplateLock = selectedBlockClientIds.some(
120
124
  ( id ) => getTemplateLock( id ) === 'contentOnly'
121
125
  );
126
+
122
127
  return {
123
128
  blockClientId: selectedBlockClientId,
124
129
  blockClientIds: selectedBlockClientIds,
@@ -144,6 +149,8 @@ export function PrivateBlockToolbar( {
144
149
  showGroupButtons: ! isZoomOut(),
145
150
  showLockButtons: ! isZoomOut(),
146
151
  showSwitchSectionStyleButton: isZoomOut(),
152
+ hasFixedToolbar: getSettings().hasFixedToolbar,
153
+ isNavigationMode: _isNavigationMode(),
147
154
  };
148
155
  }, [] );
149
156
 
@@ -170,6 +177,7 @@ export function PrivateBlockToolbar( {
170
177
  // Shifts the toolbar to make room for the parent block selector.
171
178
  const classes = clsx( 'block-editor-block-contextual-toolbar', {
172
179
  'has-parent': showParentSelector,
180
+ 'is-inverted-toolbar': isNavigationMode && ! hasFixedToolbar,
173
181
  } );
174
182
 
175
183
  const innerClasses = clsx( 'block-editor-block-toolbar', {
@@ -139,6 +139,45 @@
139
139
  border-right-color: $gray-900;
140
140
  }
141
141
 
142
+ .is-inverted-toolbar {
143
+ background-color: $gray-900;
144
+ color: $gray-100;
145
+
146
+ &.block-editor-block-contextual-toolbar {
147
+ border-color: $gray-800;
148
+ }
149
+
150
+ button {
151
+ color: $gray-300;
152
+
153
+ &:hover {
154
+ color: $white;
155
+ }
156
+
157
+ &:focus::before {
158
+ box-shadow: inset 0 0 0 1px $gray-900, 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
159
+ }
160
+ }
161
+
162
+ .block-editor-block-parent-selector .block-editor-block-parent-selector__button {
163
+ border-color: $gray-800;
164
+ background-color: $gray-900;
165
+ }
166
+
167
+ .block-editor-block-switcher__toggle {
168
+ color: $gray-100;
169
+ }
170
+
171
+ .components-toolbar-group,
172
+ .components-toolbar {
173
+ border-right-color: $gray-800 !important;
174
+ }
175
+
176
+ .is-pressed {
177
+ color: var(--wp-admin-theme-color);
178
+ }
179
+ }
180
+
142
181
  // Hide the block toolbar if the insertion point is shown.
143
182
  &.is-insertion-point-visible {
144
183
  visibility: hidden;
@@ -219,7 +219,7 @@ exports[`ColorPaletteControl matches the snapshot 1`] = `
219
219
  <button
220
220
  aria-label="Color: red"
221
221
  aria-selected="true"
222
- class="components-button components-circular-option-picker__option"
222
+ class="components-button components-circular-option-picker__option is-next-40px-default-size"
223
223
  data-active-item="true"
224
224
  id="components-circular-option-picker-0-0"
225
225
  role="option"
@@ -247,7 +247,7 @@ exports[`ColorPaletteControl matches the snapshot 1`] = `
247
247
  class="components-circular-option-picker__custom-clear-wrapper"
248
248
  >
249
249
  <button
250
- class="components-button components-circular-option-picker__clear is-tertiary"
250
+ class="components-button components-circular-option-picker__clear is-next-40px-default-size is-tertiary"
251
251
  type="button"
252
252
  >
253
253
  Clear
@@ -4,10 +4,8 @@
4
4
 
5
5
  .block-editor-iframe__html {
6
6
  transform-origin: top center;
7
- // We don't want to animate the transform of the translateX because it is used
8
- // to "center" the canvas. Leaving it on causes the canvas to slide around in
9
- // odd ways.
10
- @include editor-canvas-resize-animation( transform 0s, scale 0s, padding 0s, translate 0s);
7
+ // Prevents a flash of background color change when entering/exiting zoom out
8
+ transition: background-color 400ms;
11
9
 
12
10
  &.zoom-out-animation {
13
11
  $scroll-top: var(--wp-block-editor-iframe-zoom-out-scroll-top, 0);
@@ -18,53 +16,48 @@
18
16
  right: 0;
19
17
  top: calc(-1 * #{$scroll-top});
20
18
  bottom: 0;
21
- translate: 0 calc(#{$scroll-top} - #{$scroll-top-next});
22
19
  // Force preserving a scrollbar gutter as scrollbar-gutter isn't supported in all browsers yet,
23
20
  // and removing the scrollbar causes the content to shift.
24
21
  overflow-y: scroll;
25
-
26
- // We only want to animate the scaling when entering zoom out. When sidebars
27
- // are toggled, the resizing of the iframe handles scaling the canvas as well,
28
- // and the doubled animations cause very odd animations.
29
- @include editor-canvas-resize-animation( transform 0s, top 0s, bottom 0s, right 0s, left 0s );
30
22
  }
31
- }
32
23
 
33
- .block-editor-iframe__html.is-zoomed-out {
34
- $scale: var(--wp-block-editor-iframe-zoom-out-scale);
35
- $frame-size: var(--wp-block-editor-iframe-zoom-out-frame-size);
36
- $inner-height: var(--wp-block-editor-iframe-zoom-out-inner-height);
37
- $content-height: var(--wp-block-editor-iframe-zoom-out-content-height);
38
- $scale-container-width: var(--wp-block-editor-iframe-zoom-out-scale-container-width);
39
- $container-width: var(--wp-block-editor-iframe-zoom-out-container-width, 100vw);
40
- // Apply an X translation to center the scaled content within the available space.
41
- transform: translateX(calc((#{$scale-container-width} - #{$container-width}) / 2 / #{$scale}));
42
- scale: #{$scale};
43
- background-color: $gray-300;
24
+ &.is-zoomed-out {
25
+ $scale: var(--wp-block-editor-iframe-zoom-out-scale, 1);
26
+ $frame-size: var(--wp-block-editor-iframe-zoom-out-frame-size, 0);
27
+ $inner-height: var(--wp-block-editor-iframe-zoom-out-inner-height);
28
+ $content-height: var(--wp-block-editor-iframe-zoom-out-content-height);
29
+ $scale-container-width: var(--wp-block-editor-iframe-zoom-out-scale-container-width);
30
+ $container-width: var(--wp-block-editor-iframe-zoom-out-container-width, 100vw);
31
+ // Apply an X translation to center the scaled content within the available space.
32
+ transform: translateX(calc((#{$scale-container-width} - #{$container-width}) / 2 / #{$scale}));
33
+ scale: $scale;
34
+ background-color: $gray-300;
44
35
 
45
- // Chrome seems to respect that transform scale shouldn't affect the layout size of the element,
46
- // so we need to adjust the height of the content to match the scale by using negative margins.
47
- $extra-content-height: calc(#{$content-height} * (1 - #{$scale}));
48
- $total-frame-height: calc(2 * #{$frame-size} / #{$scale});
49
- $total-height: calc(#{$extra-content-height} + #{$total-frame-height} + 2px);
50
- margin-bottom: calc(-1 * #{$total-height});
51
- // Add the top/bottom frame size. We use scaling to account for the left/right, as
52
- // the padding left/right causes the contents to reflow, which breaks the 1:1 scaling
53
- // of the content.
54
- padding-top: calc(#{$frame-size} / #{$scale});
55
- padding-bottom: calc(#{$frame-size} / #{$scale});
36
+ // Chrome seems to respect that transform scale shouldn't affect the layout size of the element,
37
+ // so we need to adjust the height of the content to match the scale by using negative margins.
38
+ $extra-content-height: calc(#{$content-height} * (1 - #{$scale}));
39
+ $total-frame-height: calc(2 * #{$frame-size} / #{$scale});
40
+ $total-height: calc(#{$extra-content-height} + #{$total-frame-height} + 2px);
41
+ margin-bottom: calc(-1 * #{$total-height});
56
42
 
57
- body {
58
- min-height: calc((#{$inner-height} - #{$total-frame-height}) / #{$scale});
43
+ // Add the top/bottom frame size. We use scaling to account for the left/right, as
44
+ // the padding left/right causes the contents to reflow, which breaks the 1:1 scaling
45
+ // of the content.
46
+ padding-top: calc(#{$frame-size} / #{$scale});
47
+ padding-bottom: calc(#{$frame-size} / #{$scale});
59
48
 
60
- > .is-root-container:not(.wp-block-post-content) {
61
- flex: 1;
62
- display: flex;
63
- flex-direction: column;
64
- height: 100%;
49
+ body {
50
+ min-height: calc((#{$inner-height} - #{$total-frame-height}) / #{$scale});
65
51
 
66
- > main {
52
+ > .is-root-container:not(.wp-block-post-content) {
67
53
  flex: 1;
54
+ display: flex;
55
+ flex-direction: column;
56
+ height: 100%;
57
+
58
+ > main {
59
+ flex: 1;
60
+ }
68
61
  }
69
62
  }
70
63
  }