@wordpress/media-editor 0.13.0 → 0.13.1-next.v.202607070741.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.
@@ -27,7 +27,6 @@ function MediaEditorCropPanel({
27
27
  /* @__PURE__ */ jsx(
28
28
  SelectControl,
29
29
  {
30
- __next40pxDefaultSize: true,
31
30
  label: __("Aspect ratio"),
32
31
  value: aspectRatioValue,
33
32
  onChange: onAspectRatioChange,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/media-editor-crop-panel/index.tsx"],
4
- "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { SelectControl } from '@wordpress/components';\nimport { Stack, VisuallyHidden } from '@wordpress/ui';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { CROP_CONTROL_ATTR } from '../../hooks/use-crop-gesture-handlers';\nimport MediaEditorImageControls from '../media-editor-image-controls';\nimport type { AspectRatioPreset } from '../../image-editor/core/constants';\n\nexport interface MediaEditorCropPanelProps {\n\t/**\n\t * Selected aspect-ratio preset value as a string (so it round-trips\n\t * through `<SelectControl>`). `'0'` = free, `'-1'` = original, any\n\t * positive number = fixed ratio.\n\t */\n\taspectRatioValue: string;\n\t/** Setter for the aspect-ratio preset value. */\n\tonAspectRatioChange: ( value: string ) => void;\n\t/** Aspect-ratio presets to display in the selector. */\n\taspectRatioOptions: AspectRatioPreset[];\n\t/**\n\t * When `true`, render the rotate/flip/zoom image controls at the top of\n\t * the panel. Used on wide viewports where the footer no longer carries\n\t * them.\n\t */\n\tshowTransformControls?: boolean;\n}\n\n/**\n * Sidebar panel for crop controls. Renders the aspect-ratio selector, plus the\n * rotate/flip and zoom controls on wide viewports (these move to the footer\n * toolbar when the sidebar collapses).\n * @param props\n * @param props.aspectRatioValue\n * @param props.onAspectRatioChange\n * @param props.aspectRatioOptions\n * @param props.showTransformControls\n */\nexport default function MediaEditorCropPanel( {\n\taspectRatioValue,\n\tonAspectRatioChange,\n\taspectRatioOptions,\n\tshowTransformControls = false,\n}: MediaEditorCropPanelProps ) {\n\treturn (\n\t\t// Tag the whole panel as a crop-control region so the modal's\n\t\t// Cmd+Z handler doesn't mistake the SelectControl input for a\n\t\t// metadata field (which would suppress undo).\n\t\t<Stack\n\t\t\tdirection=\"column\"\n\t\t\tgap=\"xl\"\n\t\t\t{ ...{ [ CROP_CONTROL_ATTR ]: true } }\n\t\t>\n\t\t\t<VisuallyHidden render={ <h2 /> }>\n\t\t\t\t{ __( 'Crop options' ) }\n\t\t\t</VisuallyHidden>\n\t\t\t{ showTransformControls && <MediaEditorImageControls withLabels /> }\n\t\t\t<SelectControl\n\t\t\t\t__next40pxDefaultSize\n\t\t\t\tlabel={ __( 'Aspect ratio' ) }\n\t\t\t\tvalue={ aspectRatioValue }\n\t\t\t\tonChange={ onAspectRatioChange }\n\t\t\t\toptions={ aspectRatioOptions.map( ( preset ) => ( {\n\t\t\t\t\tlabel: preset.label,\n\t\t\t\t\tvalue: preset.value.toString(),\n\t\t\t\t} ) ) }\n\t\t\t/>\n\t\t</Stack>\n\t);\n}\n"],
5
- "mappings": ";AAGA,SAAS,qBAAqB;AAC9B,SAAS,OAAO,sBAAsB;AACtC,SAAS,UAAU;AAKnB,SAAS,yBAAyB;AAClC,OAAO,8BAA8B;AA0CnC,SAK0B,KAL1B;AAVa,SAAR,qBAAuC;AAAA,EAC7C;AAAA,EACA;AAAA,EACA;AAAA,EACA,wBAAwB;AACzB,GAA+B;AAC9B;AAAA;AAAA;AAAA;AAAA,IAIC;AAAA,MAAC;AAAA;AAAA,QACA,WAAU;AAAA,QACV,KAAI;AAAA,QACF,GAAG,EAAE,CAAE,iBAAkB,GAAG,KAAK;AAAA,QAEnC;AAAA,8BAAC,kBAAe,QAAS,oBAAC,QAAG,GAC1B,aAAI,cAAe,GACtB;AAAA,UACE,yBAAyB,oBAAC,4BAAyB,YAAU,MAAC;AAAA,UAChE;AAAA,YAAC;AAAA;AAAA,cACA,uBAAqB;AAAA,cACrB,OAAQ,GAAI,cAAe;AAAA,cAC3B,OAAQ;AAAA,cACR,UAAW;AAAA,cACX,SAAU,mBAAmB,IAAK,CAAE,YAAc;AAAA,gBACjD,OAAO,OAAO;AAAA,gBACd,OAAO,OAAO,MAAM,SAAS;AAAA,cAC9B,EAAI;AAAA;AAAA,UACL;AAAA;AAAA;AAAA,IACD;AAAA;AAEF;",
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { SelectControl } from '@wordpress/components';\nimport { Stack, VisuallyHidden } from '@wordpress/ui';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { CROP_CONTROL_ATTR } from '../../hooks/use-crop-gesture-handlers';\nimport MediaEditorImageControls from '../media-editor-image-controls';\nimport type { AspectRatioPreset } from '../../image-editor/core/constants';\n\nexport interface MediaEditorCropPanelProps {\n\t/**\n\t * Selected aspect-ratio preset value as a string (so it round-trips\n\t * through `<SelectControl>`). `'0'` = free, `'-1'` = original, any\n\t * positive number = fixed ratio.\n\t */\n\taspectRatioValue: string;\n\t/** Setter for the aspect-ratio preset value. */\n\tonAspectRatioChange: ( value: string ) => void;\n\t/** Aspect-ratio presets to display in the selector. */\n\taspectRatioOptions: AspectRatioPreset[];\n\t/**\n\t * When `true`, render the rotate/flip/zoom image controls at the top of\n\t * the panel. Used on wide viewports where the footer no longer carries\n\t * them.\n\t */\n\tshowTransformControls?: boolean;\n}\n\n/**\n * Sidebar panel for crop controls. Renders the aspect-ratio selector, plus the\n * rotate/flip and zoom controls on wide viewports (these move to the footer\n * toolbar when the sidebar collapses).\n * @param props\n * @param props.aspectRatioValue\n * @param props.onAspectRatioChange\n * @param props.aspectRatioOptions\n * @param props.showTransformControls\n */\nexport default function MediaEditorCropPanel( {\n\taspectRatioValue,\n\tonAspectRatioChange,\n\taspectRatioOptions,\n\tshowTransformControls = false,\n}: MediaEditorCropPanelProps ) {\n\treturn (\n\t\t// Tag the whole panel as a crop-control region so the modal's\n\t\t// Cmd+Z handler doesn't mistake the SelectControl input for a\n\t\t// metadata field (which would suppress undo).\n\t\t<Stack\n\t\t\tdirection=\"column\"\n\t\t\tgap=\"xl\"\n\t\t\t{ ...{ [ CROP_CONTROL_ATTR ]: true } }\n\t\t>\n\t\t\t<VisuallyHidden render={ <h2 /> }>\n\t\t\t\t{ __( 'Crop options' ) }\n\t\t\t</VisuallyHidden>\n\t\t\t{ showTransformControls && <MediaEditorImageControls withLabels /> }\n\t\t\t<SelectControl\n\t\t\t\tlabel={ __( 'Aspect ratio' ) }\n\t\t\t\tvalue={ aspectRatioValue }\n\t\t\t\tonChange={ onAspectRatioChange }\n\t\t\t\toptions={ aspectRatioOptions.map( ( preset ) => ( {\n\t\t\t\t\tlabel: preset.label,\n\t\t\t\t\tvalue: preset.value.toString(),\n\t\t\t\t} ) ) }\n\t\t\t/>\n\t\t</Stack>\n\t);\n}\n"],
5
+ "mappings": ";AAGA,SAAS,qBAAqB;AAC9B,SAAS,OAAO,sBAAsB;AACtC,SAAS,UAAU;AAKnB,SAAS,yBAAyB;AAClC,OAAO,8BAA8B;AA0CnC,SAK0B,KAL1B;AAVa,SAAR,qBAAuC;AAAA,EAC7C;AAAA,EACA;AAAA,EACA;AAAA,EACA,wBAAwB;AACzB,GAA+B;AAC9B;AAAA;AAAA;AAAA;AAAA,IAIC;AAAA,MAAC;AAAA;AAAA,QACA,WAAU;AAAA,QACV,KAAI;AAAA,QACF,GAAG,EAAE,CAAE,iBAAkB,GAAG,KAAK;AAAA,QAEnC;AAAA,8BAAC,kBAAe,QAAS,oBAAC,QAAG,GAC1B,aAAI,cAAe,GACtB;AAAA,UACE,yBAAyB,oBAAC,4BAAyB,YAAU,MAAC;AAAA,UAChE;AAAA,YAAC;AAAA;AAAA,cACA,OAAQ,GAAI,cAAe;AAAA,cAC3B,OAAQ;AAAA,cACR,UAAW;AAAA,cACX,SAAU,mBAAmB,IAAK,CAAE,YAAc;AAAA,gBACjD,OAAO,OAAO;AAAA,gBACd,OAAO,OAAO,MAAM,SAAS;AAAA,cAC9B,EAAI;AAAA;AAAA,UACL;AAAA;AAAA;AAAA,IACD;AAAA;AAEF;",
6
6
  "names": []
7
7
  }
@@ -342,6 +342,12 @@
342
342
  /**
343
343
  * Focus styles.
344
344
  */
345
+ /**
346
+ * Standard focus rings for the WordPress Design System.
347
+ *
348
+ * Apply `outset-ring__focus` inside the relevant pseudo-class at the call site,
349
+ * e.g. `&:focus { @include outset-ring__focus(); }`.
350
+ */
345
351
  /**
346
352
  * Applies editor left position to the selector passed as argument
347
353
  */
@@ -458,7 +464,7 @@
458
464
  }
459
465
  @media (min-width: 600px) {
460
466
  .media-editor .media-editor__panel {
461
- padding: 16px 0 0 24px;
467
+ padding: 24px 0 0 24px;
462
468
  }
463
469
  }
464
470
  .media-editor .components-panel__header.media-editor__sidebar-header {
@@ -342,6 +342,12 @@
342
342
  /**
343
343
  * Focus styles.
344
344
  */
345
+ /**
346
+ * Standard focus rings for the WordPress Design System.
347
+ *
348
+ * Apply `outset-ring__focus` inside the relevant pseudo-class at the call site,
349
+ * e.g. `&:focus { @include outset-ring__focus(); }`.
350
+ */
345
351
  /**
346
352
  * Applies editor left position to the selector passed as argument
347
353
  */
@@ -458,7 +464,7 @@
458
464
  }
459
465
  @media (min-width: 600px) {
460
466
  .media-editor .media-editor__panel {
461
- padding: 16px 24px 0 0;
467
+ padding: 24px 24px 0 0;
462
468
  }
463
469
  }
464
470
  .media-editor .components-panel__header.media-editor__sidebar-header {
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/media-editor/index.tsx"],"names":[],"mappings":"AA+BA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAQlD,OAAO,KAAK,EAAE,aAAa,IAAI,kBAAkB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAM5E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAC;A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C;IAC1B,oBAAoB,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IACtC,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC3B;AAwmBD,wBAAgB,WAAW,CAAE,KAAK,EAAE,gBAAgB,+BAMnD;eAEc,WAAW"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/media-editor-crop-panel/index.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAE3E,MAAM,WAAW,yBAAyB;IACzC;;;;OAIG;IACH,gBAAgB,EAAE,MAAM,CAAC;IACzB,gDAAgD;IAChD,mBAAmB,EAAE,CAAE,KAAK,EAAE,MAAM,KAAM,IAAI,CAAC;IAC/C,uDAAuD;IACvD,kBAAkB,EAAE,iBAAiB,EAAE,CAAC;IACxC;;;;OAIG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;CAChC;AAED;;;;;;;;;GASG;AACH,MAAM,CAAC,OAAO,UAAU,oBAAoB,CAAE,EAC7C,gBAAgB,EAChB,mBAAmB,EACnB,kBAAkB,EAClB,qBAA6B,EAC7B,EAAE,yBAAyB,+BA0B3B"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/media-editor-crop-panel/index.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAE3E,MAAM,WAAW,yBAAyB;IACzC;;;;OAIG;IACH,gBAAgB,EAAE,MAAM,CAAC;IACzB,gDAAgD;IAChD,mBAAmB,EAAE,CAAE,KAAK,EAAE,MAAM,KAAM,IAAI,CAAC;IAC/C,uDAAuD;IACvD,kBAAkB,EAAE,iBAAiB,EAAE,CAAC;IACxC;;;;OAIG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;CAChC;AAED;;;;;;;;;GASG;AACH,MAAM,CAAC,OAAO,UAAU,oBAAoB,CAAE,EAC7C,gBAAgB,EAChB,mBAAmB,EACnB,kBAAkB,EAClB,qBAA6B,EAC7B,EAAE,yBAAyB,+BAyB3B"}
@@ -1 +1 @@
1
- {"version":3,"file":"rectangle-crop.story.d.ts","sourceRoot":"","sources":["../../../src/image-editor/stories/rectangle-crop.story.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAwB5D;;GAEG;AACH,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAuBtD,OAAO,aAAa,CAAC;AA6ErB,QAAA,MAAM,IAAI,EAAE,IAAI,CAAE,OAAO,OAAO,CAI/B,CAAC;eAEa,IAAI;AAEnB,KAAK,KAAK,GAAG,QAAQ,CAAE,OAAO,OAAO,CAAE,CAAC;AAsBxC,eAAO,MAAM,OAAO,EAAE,KAErB,CAAC;AA6WF,eAAO,MAAM,YAAY,EAAE,KAE1B,CAAC;AA+hBF,eAAO,MAAM,KAAK,EAAE,KAEnB,CAAC"}
1
+ {"version":3,"file":"rectangle-crop.story.d.ts","sourceRoot":"","sources":["../../../src/image-editor/stories/rectangle-crop.story.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAwB5D;;GAEG;AACH,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAuBtD,OAAO,aAAa,CAAC;AA6ErB,QAAA,MAAM,IAAI,EAAE,IAAI,CAAE,OAAO,OAAO,CAI/B,CAAC;eAEa,IAAI;AAEnB,KAAK,KAAK,GAAG,QAAQ,CAAE,OAAO,OAAO,CAAE,CAAC;AAsBxC,eAAO,MAAM,OAAO,EAAE,KAErB,CAAC;AAyWF,eAAO,MAAM,YAAY,EAAE,KAE1B,CAAC;AA4hBF,eAAO,MAAM,KAAK,EAAE,KAEnB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/media-editor",
3
- "version": "0.13.0",
3
+ "version": "0.13.1-next.v.202607070741.0+a51d59513",
4
4
  "description": "Media editor components for WordPress.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -43,27 +43,28 @@
43
43
  "build-module/store/index.mjs"
44
44
  ],
45
45
  "dependencies": {
46
- "@wordpress/api-fetch": "^7.50.0",
47
- "@wordpress/base-styles": "^10.2.0",
48
- "@wordpress/components": "^36.1.0",
49
- "@wordpress/compose": "^8.3.0",
50
- "@wordpress/core-data": "^7.50.0",
51
- "@wordpress/data": "^10.50.0",
52
- "@wordpress/dataviews": "^17.1.0",
53
- "@wordpress/date": "^5.50.0",
54
- "@wordpress/element": "^8.2.0",
55
- "@wordpress/i18n": "^6.23.0",
56
- "@wordpress/icons": "^15.1.0",
57
- "@wordpress/interface": "^9.35.0",
58
- "@wordpress/keyboard-shortcuts": "^5.50.0",
59
- "@wordpress/keycodes": "^4.50.0",
60
- "@wordpress/notices": "^5.50.0",
61
- "@wordpress/private-apis": "^1.50.0",
62
- "@wordpress/ui": "^0.17.0",
46
+ "@wordpress/api-fetch": "^7.50.1-next.v.202607070741.0+a51d59513",
47
+ "@wordpress/base-styles": "^10.3.1-next.v.202607070741.0+a51d59513",
48
+ "@wordpress/components": "^37.0.1-next.v.202607070741.0+a51d59513",
49
+ "@wordpress/compose": "^8.3.1-next.v.202607070741.0+a51d59513",
50
+ "@wordpress/core-data": "^7.50.1-next.v.202607070741.0+a51d59513",
51
+ "@wordpress/data": "^10.50.1-next.v.202607070741.0+a51d59513",
52
+ "@wordpress/dataviews": "^17.1.2-next.v.202607070741.0+a51d59513",
53
+ "@wordpress/date": "^5.50.1-next.v.202607070741.0+a51d59513",
54
+ "@wordpress/element": "^8.2.1-next.v.202607070741.0+a51d59513",
55
+ "@wordpress/i18n": "^6.23.1-next.v.202607070741.0+a51d59513",
56
+ "@wordpress/icons": "^15.1.1-next.v.202607070741.0+a51d59513",
57
+ "@wordpress/interface": "^9.35.1-next.v.202607070741.0+a51d59513",
58
+ "@wordpress/keyboard-shortcuts": "^5.50.1-next.v.202607070741.0+a51d59513",
59
+ "@wordpress/keycodes": "^4.50.1-next.v.202607070741.0+a51d59513",
60
+ "@wordpress/notices": "^5.50.1-next.v.202607070741.0+a51d59513",
61
+ "@wordpress/private-apis": "^1.50.1-next.v.202607070741.0+a51d59513",
62
+ "@wordpress/ui": "^0.18.1-next.v.202607070741.0+a51d59513",
63
63
  "clsx": "^2.1.1",
64
64
  "gl-matrix": "^3.4.3"
65
65
  },
66
66
  "devDependencies": {
67
+ "@storybook/react-vite": "^10.4.3",
67
68
  "@testing-library/dom": "^10.4.1",
68
69
  "@testing-library/react": "^16.3.2",
69
70
  "@testing-library/user-event": "^14.6.1"
@@ -80,5 +81,5 @@
80
81
  "publishConfig": {
81
82
  "access": "public"
82
83
  },
83
- "gitHead": "fee6e24e8e63d36f6bbcf487c193461e9bd79753"
84
+ "gitHead": "f637726e370c8b23695ed9af82adbe171ad235d8"
84
85
  }
@@ -6,16 +6,14 @@ import {
6
6
  Flex,
7
7
  Spinner,
8
8
  __experimentalConfirmDialog as ConfirmDialog,
9
- privateApis as componentsPrivateApis,
10
9
  } from '@wordpress/components';
11
- import { Stack } from '@wordpress/ui';
10
+ import { Stack, Tabs } from '@wordpress/ui';
12
11
  import { useViewportMatch } from '@wordpress/compose';
13
12
  import { useDispatch, useSelect } from '@wordpress/data';
14
13
  import { store as coreStore } from '@wordpress/core-data';
15
14
  import {
16
15
  createPortal,
17
16
  useCallback,
18
- useContext,
19
17
  useEffect,
20
18
  useMemo,
21
19
  useRef,
@@ -50,7 +48,6 @@ import MediaEditorFineRotation from '../media-editor-fine-rotation';
50
48
  import MediaEditorImageControls from '../media-editor-image-controls';
51
49
  import MediaEditorCropPanel from '../media-editor-crop-panel';
52
50
  import MediaForm from '../media-form';
53
- import { unlock } from '../../lock-unlock';
54
51
  import { getMediaTypeFromMimeType } from '../../utils';
55
52
  import { MediaEditorStateProvider, useMediaEditor } from '../../state';
56
53
  import type { AspectRatioPreset } from '../../image-editor/core/constants';
@@ -72,8 +69,6 @@ const ATTACHMENT_EMBED_QUERY = { _embed: 'author,wp:attached-to' } as const;
72
69
 
73
70
  const PLACEMENT_CONTROL_IDLE_MS = 300;
74
71
 
75
- const { Tabs } = unlock( componentsPrivateApis );
76
-
77
72
  interface EditorTab {
78
73
  id: string;
79
74
  title: string;
@@ -116,7 +111,10 @@ export interface MediaEditorProps {
116
111
  }
117
112
 
118
113
  function MediaEditorSidebar( { tabs }: { tabs: EditorTab[] } ) {
119
- const tabsContextValue = useContext( Tabs.Context );
114
+ // The tab list and panels must share one `<Tabs.Root>`, but they render in
115
+ // separate `ComplementaryArea` regions (header vs body). A non-virtual Slot
116
+ // reconciles both inline at the Slot, so the `Root` is lifted to wrap this
117
+ // Fill and that Slot together — see `MediaEditorContent`.
120
118
  return (
121
119
  <ComplementaryArea
122
120
  scope="media-editor"
@@ -129,28 +127,20 @@ function MediaEditorSidebar( { tabs }: { tabs: EditorTab[] } ) {
129
127
  headerClassName="media-editor__sidebar-header"
130
128
  closeLabel={ __( 'Close media panel' ) }
131
129
  header={
132
- <Tabs.Context.Provider value={ tabsContextValue }>
133
- <Tabs.TabList>
134
- { tabs.map( ( tab ) => (
135
- <Tabs.Tab key={ tab.id } tabId={ tab.id }>
136
- { tab.title }
137
- </Tabs.Tab>
138
- ) ) }
139
- </Tabs.TabList>
140
- </Tabs.Context.Provider>
130
+ <Tabs.List variant="minimal">
131
+ { tabs.map( ( tab ) => (
132
+ <Tabs.Tab key={ tab.id } value={ tab.id }>
133
+ { tab.title }
134
+ </Tabs.Tab>
135
+ ) ) }
136
+ </Tabs.List>
141
137
  }
142
138
  >
143
- <Tabs.Context.Provider value={ tabsContextValue }>
144
- { tabs.map( ( tab ) => (
145
- <Tabs.TabPanel
146
- key={ tab.id }
147
- tabId={ tab.id }
148
- focusable={ false }
149
- >
150
- { tab.panel }
151
- </Tabs.TabPanel>
152
- ) ) }
153
- </Tabs.Context.Provider>
139
+ { tabs.map( ( tab ) => (
140
+ <Tabs.Panel key={ tab.id } value={ tab.id } tabIndex={ -1 }>
141
+ { tab.panel }
142
+ </Tabs.Panel>
143
+ ) ) }
154
144
  </ComplementaryArea>
155
145
  );
156
146
  }
@@ -501,6 +491,13 @@ function MediaEditorContent( {
501
491
  isPanelLayout,
502
492
  ] );
503
493
 
494
+ // Control the active tab from state here so the selection survives the
495
+ // sidebar closing (which unmounts the `ComplementaryArea` Fill and its
496
+ // tabs). Fall back to the first tab until one is picked, so images open on
497
+ // Crop.
498
+ const [ selectedTabId, setSelectedTabId ] = useState< string >();
499
+ const activeTabId = selectedTabId ?? tabs[ 0 ]?.id;
500
+
504
501
  const handleChange = ( updates: Partial< Media > ) => {
505
502
  editEntityRecord( 'postType', 'attachment', id, updates );
506
503
  };
@@ -581,58 +578,62 @@ function MediaEditorContent( {
581
578
  onChange={ handleChange }
582
579
  settings={ { fields } }
583
580
  >
584
- <div className="media-editor">
585
- { ! media ? (
581
+ { ! media ? (
582
+ <div className="media-editor">
586
583
  <div className="media-editor__loading">
587
584
  <Spinner />
588
585
  </div>
589
- ) : (
590
- <>
591
- <Tabs>
592
- <MediaEditorSidebar tabs={ tabs } />
593
- </Tabs>
594
- <InterfaceSkeleton
595
- className="media-editor__skeleton"
596
- labels={ {
597
- body: isImage
598
- ? __( 'Image editor' )
599
- : __( 'Media preview' ),
600
- sidebar: __( 'Media details' ),
601
- } }
602
- content={
603
- <div className="media-editor__content">
604
- <div className="media-editor__canvas-area">
605
- { isImage ? (
606
- <MediaEditorCanvas
607
- focusOnMount
608
- isPlacementActive={
609
- isPlacementActive
610
- }
611
- onGestureStart={
612
- handleCanvasGestureStart
613
- }
614
- onGestureEnd={
615
- handleCanvasGestureEnd
616
- }
617
- />
618
- ) : (
619
- <MediaPreview />
620
- ) }
621
- </div>
622
- { isImage && (
623
- <div className="media-editor__canvas-toolbar">
624
- { ruler }
625
- </div>
586
+ </div>
587
+ ) : (
588
+ <Tabs.Root
589
+ className="media-editor"
590
+ value={ activeTabId }
591
+ onValueChange={ ( value ) =>
592
+ setSelectedTabId( value as string )
593
+ }
594
+ >
595
+ <MediaEditorSidebar tabs={ tabs } />
596
+ <InterfaceSkeleton
597
+ className="media-editor__skeleton"
598
+ labels={ {
599
+ body: isImage
600
+ ? __( 'Image editor' )
601
+ : __( 'Media preview' ),
602
+ sidebar: __( 'Media details' ),
603
+ } }
604
+ content={
605
+ <div className="media-editor__content">
606
+ <div className="media-editor__canvas-area">
607
+ { isImage ? (
608
+ <MediaEditorCanvas
609
+ focusOnMount
610
+ isPlacementActive={
611
+ isPlacementActive
612
+ }
613
+ onGestureStart={
614
+ handleCanvasGestureStart
615
+ }
616
+ onGestureEnd={
617
+ handleCanvasGestureEnd
618
+ }
619
+ />
620
+ ) : (
621
+ <MediaPreview />
626
622
  ) }
627
623
  </div>
628
- }
629
- sidebar={
630
- <ComplementaryArea.Slot scope="media-editor" />
631
- }
632
- />
633
- </>
634
- ) }
635
- </div>
624
+ { isImage && (
625
+ <div className="media-editor__canvas-toolbar">
626
+ { ruler }
627
+ </div>
628
+ ) }
629
+ </div>
630
+ }
631
+ sidebar={
632
+ <ComplementaryArea.Slot scope="media-editor" />
633
+ }
634
+ />
635
+ </Tabs.Root>
636
+ ) }
636
637
  <ConfirmDialog
637
638
  isOpen={ isDiscardDialogOpen }
638
639
  confirmButtonText={ __( 'Discard' ) }
@@ -30,15 +30,14 @@
30
30
  }
31
31
 
32
32
  // The skeleton must always sit in the modal's flow (`top: auto`). The reset
33
- // above sets that, but external rules can outrank its low specificity — e.g.
34
- // the "Omnipresent Toolbar" experiment (`gutenberg-omnibar`)
35
- // offsets every `.interface-interface-skeleton` below the admin bar via a
36
- // `body.has-admin-bar-in-editor.is-fullscreen-mode` rule, which would push
37
- // the editor (and the fine-rotation ruler under the canvas) down inside our
38
- // full-screen modal that already overlays the admin bar. Re-assert `top` at a
39
- // specificity that beats such rules, anchored on the modal frame
40
- // (`.media-editor` only ever renders inside `.media-editor-modal`) rather
41
- // than on the experiment's class, which may change if it ever graduates.
33
+ // above sets that, but `@wordpress/interface` offsets every
34
+ // `.interface-interface-skeleton` below the admin bar in fullscreen mode via
35
+ // `.is-fullscreen-mode .interface-interface-skeleton { top: ... }`. That
36
+ // selector ties the reset's specificity, so source order lets it win and
37
+ // pushes the editor (and the fine-rotation ruler under the canvas) down
38
+ // inside our full-screen modal that already overlays the admin bar.
39
+ // Re-assert `top` at a specificity that beats it, anchored on the modal
40
+ // frame (`.media-editor` only ever renders inside `.media-editor-modal`).
42
41
  .media-editor-modal & .interface-interface-skeleton.interface-interface-skeleton {
43
42
  top: auto;
44
43
  }
@@ -133,7 +132,7 @@
133
132
  padding: $grid-unit-20;
134
133
 
135
134
  @include break-small() {
136
- padding: $grid-unit-20 $grid-unit-30 0 0;
135
+ padding: $grid-unit-30 $grid-unit-30 0 0;
137
136
  }
138
137
  }
139
138
 
@@ -61,7 +61,6 @@ export default function MediaEditorCropPanel( {
61
61
  </VisuallyHidden>
62
62
  { showTransformControls && <MediaEditorImageControls withLabels /> }
63
63
  <SelectControl
64
- __next40pxDefaultSize
65
64
  label={ __( 'Aspect ratio' ) }
66
65
  value={ aspectRatioValue }
67
66
  onChange={ onAspectRatioChange }
@@ -395,7 +395,6 @@ const WithControlsComponent = () => {
395
395
  </FlexItem>
396
396
  <FlexItem>
397
397
  <SelectControl
398
- __next40pxDefaultSize
399
398
  label="Aspect ratio"
400
399
  hideLabelFromVision
401
400
  value={ aspectRatioValue }
@@ -417,7 +416,6 @@ const WithControlsComponent = () => {
417
416
  </FlexItem>
418
417
  <FlexItem>
419
418
  <SelectControl
420
- __next40pxDefaultSize
421
419
  label="Grid"
422
420
  hideLabelFromVision
423
421
  value={ gridMode }
@@ -450,7 +448,6 @@ const WithControlsComponent = () => {
450
448
  </Flex>
451
449
  <div className="image-editor-story__sliders">
452
450
  <RangeControl
453
- __next40pxDefaultSize
454
451
  label="Fine rotation"
455
452
  min={ -MAX_ROTATION_OFFSET }
456
453
  max={ MAX_ROTATION_OFFSET }
@@ -459,7 +456,6 @@ const WithControlsComponent = () => {
459
456
  onChange={ handleRotationSlider }
460
457
  />
461
458
  <RangeControl
462
- __next40pxDefaultSize
463
459
  label="Zoom"
464
460
  min={ getMinZoom( state ) }
465
461
  max={ MAX_ZOOM }
@@ -831,7 +827,6 @@ const DebugComponent = () => {
831
827
  </FlexItem>
832
828
  <FlexItem>
833
829
  <SelectControl
834
- __next40pxDefaultSize
835
830
  label="Format"
836
831
  hideLabelFromVision
837
832
  value={ exportFormat as 'image/jpeg' }
@@ -866,7 +861,6 @@ const DebugComponent = () => {
866
861
  </Flex>
867
862
  <div className="image-editor-story__sliders">
868
863
  <RangeControl
869
- __next40pxDefaultSize
870
864
  label="Fine rotation"
871
865
  min={ -MAX_ROTATION_OFFSET }
872
866
  max={ MAX_ROTATION_OFFSET }
@@ -875,7 +869,6 @@ const DebugComponent = () => {
875
869
  onChange={ handleRotationSlider }
876
870
  />
877
871
  <RangeControl
878
- __next40pxDefaultSize
879
872
  label="Zoom"
880
873
  min={ getMinZoom( state ) }
881
874
  max={ MAX_ZOOM }