@wordpress/media-editor 0.13.1-next.v.202607070741.0 → 0.14.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 (67) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/build/image-editor/react/components/cropper.cjs +1 -11
  3. package/build/image-editor/react/components/cropper.cjs.map +2 -2
  4. package/build/image-editor/react/components/stencils/rectangle-stencil.cjs +8 -8
  5. package/build/image-editor/react/components/stencils/rectangle-stencil.cjs.map +2 -2
  6. package/build/image-editor/react/hooks/use-aria-announcer.cjs +75 -32
  7. package/build/image-editor/react/hooks/use-aria-announcer.cjs.map +2 -2
  8. package/build-module/image-editor/react/components/cropper.mjs +1 -11
  9. package/build-module/image-editor/react/components/cropper.mjs.map +2 -2
  10. package/build-module/image-editor/react/components/stencils/rectangle-stencil.mjs +8 -8
  11. package/build-module/image-editor/react/components/stencils/rectangle-stencil.mjs.map +2 -2
  12. package/build-module/image-editor/react/hooks/use-aria-announcer.mjs +76 -38
  13. package/build-module/image-editor/react/hooks/use-aria-announcer.mjs.map +2 -2
  14. package/build-style/style-rtl.css +5 -5
  15. package/build-style/style.css +5 -5
  16. package/build-types/components/media-editor/use-crop-options.d.ts +1 -1
  17. package/build-types/components/media-editor/use-crop-options.d.ts.map +1 -1
  18. package/build-types/components/media-editor/use-save-media-editor.d.ts +1 -1
  19. package/build-types/components/media-editor/use-save-media-editor.d.ts.map +1 -1
  20. package/build-types/components/media-editor-canvas/index.d.ts +1 -1
  21. package/build-types/components/media-editor-canvas/index.d.ts.map +1 -1
  22. package/build-types/components/media-editor-crop-panel/index.d.ts +1 -1
  23. package/build-types/components/media-editor-crop-panel/index.d.ts.map +1 -1
  24. package/build-types/components/media-editor-fine-rotation/index.d.ts +1 -1
  25. package/build-types/components/media-editor-fine-rotation/index.d.ts.map +1 -1
  26. package/build-types/components/media-editor-image-controls/index.d.ts +1 -1
  27. package/build-types/components/media-editor-image-controls/index.d.ts.map +1 -1
  28. package/build-types/components/media-editor-keyboard-shortcuts-modal/index.d.ts +1 -1
  29. package/build-types/components/media-editor-keyboard-shortcuts-modal/index.d.ts.map +1 -1
  30. package/build-types/components/media-editor-modal/index.d.ts +1 -1
  31. package/build-types/components/media-editor-modal/index.d.ts.map +1 -1
  32. package/build-types/components/media-editor-provider/index.d.ts +1 -1
  33. package/build-types/components/media-editor-provider/index.d.ts.map +1 -1
  34. package/build-types/components/media-form/index.d.ts +1 -1
  35. package/build-types/components/media-form/index.d.ts.map +1 -1
  36. package/build-types/image-editor/react/components/cropper-provider.d.ts +1 -1
  37. package/build-types/image-editor/react/components/cropper-provider.d.ts.map +1 -1
  38. package/build-types/image-editor/react/components/cropper.d.ts.map +1 -1
  39. package/build-types/image-editor/react/components/overlays/dimensions-overlay.d.ts +1 -1
  40. package/build-types/image-editor/react/components/overlays/dimensions-overlay.d.ts.map +1 -1
  41. package/build-types/image-editor/react/components/overlays/dimming-overlay.d.ts +1 -1
  42. package/build-types/image-editor/react/components/overlays/dimming-overlay.d.ts.map +1 -1
  43. package/build-types/image-editor/react/components/overlays/grid-overlay.d.ts +1 -1
  44. package/build-types/image-editor/react/components/overlays/grid-overlay.d.ts.map +1 -1
  45. package/build-types/image-editor/react/components/stencils/rectangle-stencil.d.ts +1 -1
  46. package/build-types/image-editor/react/components/stencils/rectangle-stencil.d.ts.map +1 -1
  47. package/build-types/image-editor/react/components/viewport-provider.d.ts +1 -1
  48. package/build-types/image-editor/react/components/viewport-provider.d.ts.map +1 -1
  49. package/build-types/image-editor/react/hooks/use-aria-announcer.d.ts +5 -4
  50. package/build-types/image-editor/react/hooks/use-aria-announcer.d.ts.map +1 -1
  51. package/build-types/state/media-editor-state-provider.d.ts +1 -1
  52. package/build-types/state/media-editor-state-provider.d.ts.map +1 -1
  53. package/build-types/store/actions.d.ts +1 -1
  54. package/build-types/store/actions.d.ts.map +1 -1
  55. package/package.json +22 -21
  56. package/src/components/media-editor-image-controls/style.scss +1 -1
  57. package/src/components/media-editor-keyboard-shortcuts-modal/style.scss +1 -1
  58. package/src/components/media-preview/style.scss +1 -1
  59. package/src/components/rotation-ruler/style.scss +2 -2
  60. package/src/image-editor/react/components/cropper.tsx +3 -12
  61. package/src/image-editor/react/components/stencils/rectangle-stencil.tsx +8 -8
  62. package/src/image-editor/react/components/stencils/test/rectangle-stencil.tsx +17 -15
  63. package/src/image-editor/react/components/test/cropper.tsx +17 -17
  64. package/src/image-editor/react/hooks/test/use-aria-announcer.ts +413 -5
  65. package/src/image-editor/react/hooks/use-aria-announcer.ts +120 -47
  66. package/tsconfig.json +1 -0
  67. package/tsconfig.tsbuildinfo +1 -1
@@ -31,6 +31,6 @@ interface DimensionsOverlayProps {
31
31
  * @param props.outputWidth
32
32
  * @param props.outputHeight
33
33
  */
34
- export declare function DimensionsOverlay({ cropRect, containerSize, imageSize, activeHandle, outputWidth, outputHeight }: DimensionsOverlayProps): import("react").JSX.Element | null;
34
+ export declare function DimensionsOverlay({ cropRect, containerSize, imageSize, activeHandle, outputWidth, outputHeight, }: DimensionsOverlayProps): import("react").JSX.Element | null;
35
35
  export {};
36
36
  //# sourceMappingURL=dimensions-overlay.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"dimensions-overlay.d.ts","sourceRoot":"","sources":["../../../../../src/image-editor/react/components/overlays/dimensions-overlay.tsx"],"names":[],"mappings":"AAKA;;GAEG;AACH,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAgIhF,UAAU,sBAAsB;IAC/B,gDAAgD;IAChD,QAAQ,EAAE,cAAc,CAAC;IACzB,8CAA8C;IAC9C,aAAa,EAAE,IAAI,CAAC;IACpB,gEAAgE;IAChE,SAAS,EAAE,IAAI,CAAC;IAChB,wEAAwE;IACxE,YAAY,EAAE,cAAc,GAAG,IAAI,CAAC;IACpC,0CAA0C;IAC1C,WAAW,EAAE,MAAM,CAAC;IACpB,2CAA2C;IAC3C,YAAY,EAAE,MAAM,CAAC;CACrB;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,iBAAiB,CAAE,EAClC,QAAQ,EACR,aAAa,EACb,SAAS,EACT,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,EAAE,sBAAsB,sCA+FxB"}
1
+ {"version":3,"file":"dimensions-overlay.d.ts","sourceRoot":"","sources":["../../../../../src/image-editor/react/components/overlays/dimensions-overlay.tsx"],"names":[],"mappings":"AAKA;;GAEG;AACH,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAgIhF,UAAU,sBAAsB;IAC/B,gDAAgD;IAChD,QAAQ,EAAE,cAAc,CAAC;IACzB,8CAA8C;IAC9C,aAAa,EAAE,IAAI,CAAC;IACpB,gEAAgE;IAChE,SAAS,EAAE,IAAI,CAAC;IAChB,wEAAwE;IACxE,YAAY,EAAE,cAAc,GAAG,IAAI,CAAC;IACpC,0CAA0C;IAC1C,WAAW,EAAE,MAAM,CAAC;IACpB,2CAA2C;IAC3C,YAAY,EAAE,MAAM,CAAC;CACrB;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,iBAAiB,CAAE,EAClC,QAAQ,EACR,aAAa,EACb,SAAS,EACT,YAAY,EACZ,WAAW,EACX,YAAY,GACZ,EAAE,sBAAsB,sCA+FxB"}
@@ -15,6 +15,6 @@ interface DimmingOverlayProps {
15
15
  /** CSS transition string, e.g. during settle animation. */
16
16
  transition?: string;
17
17
  }
18
- export declare function DimmingOverlay({ cropRect, containerSize, imageSize, transition }: DimmingOverlayProps): import("react").JSX.Element | null;
18
+ export declare function DimmingOverlay({ cropRect, containerSize, imageSize, transition, }: DimmingOverlayProps): import("react").JSX.Element | null;
19
19
  export {};
20
20
  //# sourceMappingURL=dimming-overlay.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"dimming-overlay.d.ts","sourceRoot":"","sources":["../../../../../src/image-editor/react/components/overlays/dimming-overlay.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAEhE;;GAEG;AACH,UAAU,mBAAmB;IAC5B,oDAAoD;IACpD,QAAQ,EAAE,cAAc,CAAC;IACzB,kDAAkD;IAClD,aAAa,EAAE,IAAI,CAAC;IACpB,oEAAoE;IACpE,SAAS,EAAE,IAAI,CAAC;IAChB,2DAA2D;IAC3D,UAAU,CAAC,EAAE,MAAM,CAAC;CACpB;AAID,wBAAgB,cAAc,CAAE,EAC/B,QAAQ,EACR,aAAa,EACb,SAAS,EACT,UAAU,EACV,EAAE,mBAAmB,sCA+BrB"}
1
+ {"version":3,"file":"dimming-overlay.d.ts","sourceRoot":"","sources":["../../../../../src/image-editor/react/components/overlays/dimming-overlay.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAEhE;;GAEG;AACH,UAAU,mBAAmB;IAC5B,oDAAoD;IACpD,QAAQ,EAAE,cAAc,CAAC;IACzB,kDAAkD;IAClD,aAAa,EAAE,IAAI,CAAC;IACpB,oEAAoE;IACpE,SAAS,EAAE,IAAI,CAAC;IAChB,2DAA2D;IAC3D,UAAU,CAAC,EAAE,MAAM,CAAC;CACpB;AAID,wBAAgB,cAAc,CAAE,EAC/B,QAAQ,EACR,aAAa,EACb,SAAS,EACT,UAAU,GACV,EAAE,mBAAmB,sCA+BrB"}
@@ -25,6 +25,6 @@ interface GridOverlayProps {
25
25
  * @param props.imageSize The rendered image dimensions in pixels.
26
26
  * @return The grid overlay element.
27
27
  */
28
- export declare function GridOverlay({ cropRect, containerSize, imageSize }: GridOverlayProps): import("react").JSX.Element | null;
28
+ export declare function GridOverlay({ cropRect, containerSize, imageSize, }: GridOverlayProps): import("react").JSX.Element | null;
29
29
  export {};
30
30
  //# sourceMappingURL=grid-overlay.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"grid-overlay.d.ts","sourceRoot":"","sources":["../../../../../src/image-editor/react/components/overlays/grid-overlay.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAEhE;;GAEG;AACH,UAAU,gBAAgB;IACzB,oDAAoD;IACpD,QAAQ,EAAE,cAAc,CAAC;IACzB,kDAAkD;IAClD,aAAa,EAAE,IAAI,CAAC;IACpB,oEAAoE;IACpE,SAAS,EAAE,IAAI,CAAC;CAChB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,WAAW,CAAE,EAC5B,QAAQ,EACR,aAAa,EACb,SAAS,EACT,EAAE,gBAAgB,sCA8ClB"}
1
+ {"version":3,"file":"grid-overlay.d.ts","sourceRoot":"","sources":["../../../../../src/image-editor/react/components/overlays/grid-overlay.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAEhE;;GAEG;AACH,UAAU,gBAAgB;IACzB,oDAAoD;IACpD,QAAQ,EAAE,cAAc,CAAC;IACzB,kDAAkD;IAClD,aAAa,EAAE,IAAI,CAAC;IACpB,oEAAoE;IACpE,SAAS,EAAE,IAAI,CAAC;CAChB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,WAAW,CAAE,EAC5B,QAAQ,EACR,aAAa,EACb,SAAS,GACT,EAAE,gBAAgB,sCA8ClB"}
@@ -31,6 +31,6 @@ type RectangleStencilProps = StencilProps;
31
31
  * @param props.keyboardResizeStep Optional keyboard resize step in normalized space, per axis.
32
32
  * @return The rectangle stencil element.
33
33
  */
34
- export declare function RectangleStencil({ cropRect, containerSize, imageSize, onCropChange, onResizeStart, onResizeEnd, aspectRatio, freeformCrop, isResizeDisabled, stencilTransition, cropBounds, onEscape, minCropSize, snapCropRect, keyboardResizeStep }: RectangleStencilProps): import("react").JSX.Element | null;
34
+ export declare function RectangleStencil({ cropRect, containerSize, imageSize, onCropChange, onResizeStart, onResizeEnd, aspectRatio, freeformCrop, isResizeDisabled, stencilTransition, cropBounds, onEscape, minCropSize, snapCropRect, keyboardResizeStep, }: RectangleStencilProps): import("react").JSX.Element | null;
35
35
  export {};
36
36
  //# sourceMappingURL=rectangle-stencil.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"rectangle-stencil.d.ts","sourceRoot":"","sources":["../../../../../src/image-editor/react/components/stencils/rectangle-stencil.tsx"],"names":[],"mappings":"AAYA;;GAEG;AACH,OAAO,KAAK,EAAE,YAAY,EAAkB,MAAM,qBAAqB,CAAC;AAmExE;;GAEG;AACH,KAAK,qBAAqB,GAAG,YAAY,CAAC;AAE1C;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,gBAAgB,CAAE,EACjC,QAAQ,EACR,aAAa,EACb,SAAS,EACT,YAAY,EACZ,aAAa,EACb,WAAW,EACX,WAAW,EACX,YAAoB,EACpB,gBAAwB,EACxB,iBAAiB,EACjB,UAAU,EACV,QAAQ,EACR,WAAW,EACX,YAAY,EACZ,kBAAkB,EAClB,EAAE,qBAAqB,sCAmevB"}
1
+ {"version":3,"file":"rectangle-stencil.d.ts","sourceRoot":"","sources":["../../../../../src/image-editor/react/components/stencils/rectangle-stencil.tsx"],"names":[],"mappings":"AAYA;;GAEG;AACH,OAAO,KAAK,EAAE,YAAY,EAAkB,MAAM,qBAAqB,CAAC;AAmExE;;GAEG;AACH,KAAK,qBAAqB,GAAG,YAAY,CAAC;AAE1C;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,gBAAgB,CAAE,EACjC,QAAQ,EACR,aAAa,EACb,SAAS,EACT,YAAY,EACZ,aAAa,EACb,WAAW,EACX,WAAW,EACX,YAAoB,EACpB,gBAAwB,EACxB,iBAAiB,EACjB,UAAU,EACV,QAAQ,EACR,WAAW,EACX,YAAY,EACZ,kBAAkB,GAClB,EAAE,qBAAqB,sCAmevB"}
@@ -2,7 +2,7 @@
2
2
  * Internal dependencies
3
3
  */
4
4
  import { type UseViewportStateReturn } from '../hooks/use-viewport-state';
5
- export declare function ViewportProvider({ children }: {
5
+ export declare function ViewportProvider({ children, }: {
6
6
  children: React.ReactNode;
7
7
  }): import("react").JSX.Element;
8
8
  export declare function useViewport(): UseViewportStateReturn;
@@ -1 +1 @@
1
- {"version":3,"file":"viewport-provider.d.ts","sourceRoot":"","sources":["../../../../src/image-editor/react/components/viewport-provider.tsx"],"names":[],"mappings":"AAKA;;GAEG;AACH,OAAO,EAEN,KAAK,sBAAsB,EAC3B,MAAM,6BAA6B,CAAC;AAMrC,wBAAgB,gBAAgB,CAAE,EACjC,QAAQ,EACR,EAAE;IACF,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC1B,+BAOA;AAED,wBAAgB,WAAW,IAAI,sBAAsB,CAQpD"}
1
+ {"version":3,"file":"viewport-provider.d.ts","sourceRoot":"","sources":["../../../../src/image-editor/react/components/viewport-provider.tsx"],"names":[],"mappings":"AAKA;;GAEG;AACH,OAAO,EAEN,KAAK,sBAAsB,EAC3B,MAAM,6BAA6B,CAAC;AAMrC,wBAAgB,gBAAgB,CAAE,EACjC,QAAQ,GACR,EAAE;IACF,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC1B,+BAOA;AAED,wBAAgB,WAAW,IAAI,sBAAsB,CAQpD"}
@@ -4,13 +4,14 @@
4
4
  import type { CropperState } from '../../core/types';
5
5
  /**
6
6
  * Debounce and dedupe ARIA-live announcements for screen readers as the
7
- * cropper state changes. Returns the current announcement message to render
8
- * inside an `aria-live="polite"` region.
7
+ * cropper state changes. Calls `speak()` from `@wordpress/a11y` to use the
8
+ * centralized, persistent live region instead of a local one that may be
9
+ * dynamically mounted.
9
10
  *
10
- * Debouncing avoids flooding the live region during drag/pointermove bursts;
11
+ * Debouncing avoids flooding announcements during drag/pointermove bursts;
11
12
  * deduping avoids re-announcing the same state.
12
13
  *
13
14
  * @param state The current cropper state to announce.
14
15
  */
15
- export declare function useAriaAnnouncer(state: CropperState): string;
16
+ export declare function useAriaAnnouncer(state: CropperState): void;
16
17
  //# sourceMappingURL=use-aria-announcer.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"use-aria-announcer.d.ts","sourceRoot":"","sources":["../../../../src/image-editor/react/hooks/use-aria-announcer.ts"],"names":[],"mappings":"AAWA;;GAEG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAiErD;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAAE,KAAK,EAAE,YAAY,GAAI,MAAM,CAmC9D"}
1
+ {"version":3,"file":"use-aria-announcer.d.ts","sourceRoot":"","sources":["../../../../src/image-editor/react/hooks/use-aria-announcer.ts"],"names":[],"mappings":"AAOA;;GAEG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAgJrD;;;;;;;;;;GAUG;AACH,wBAAgB,gBAAgB,CAAE,KAAK,EAAE,YAAY,GAAI,IAAI,CAgC5D"}
@@ -22,7 +22,7 @@ interface MediaEditorStateProviderProps {
22
22
  * @param props.initialCropOptions
23
23
  * @param props.children
24
24
  */
25
- export declare function MediaEditorStateProvider({ initialCropperState, initialCropOptions, children }: MediaEditorStateProviderProps): import("react").JSX.Element;
25
+ export declare function MediaEditorStateProvider({ initialCropperState, initialCropOptions, children, }: MediaEditorStateProviderProps): import("react").JSX.Element;
26
26
  /**
27
27
  * Consume the composite media-editor controller. Throws if used
28
28
  * outside a `<MediaEditorStateProvider>`.
@@ -1 +1 @@
1
- {"version":3,"file":"media-editor-state-provider.d.ts","sourceRoot":"","sources":["../../src/state/media-editor-state-provider.tsx"],"names":[],"mappings":"AAKA;;GAEG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAEN,KAAK,qBAAqB,EAC1B,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAMhD,UAAU,6BAA6B;IACtC,4CAA4C;IAC5C,mBAAmB,CAAC,EAAE,OAAO,CAAE,YAAY,CAAE,CAAC;IAC9C,gDAAgD;IAChD,kBAAkB,CAAC,EAAE,OAAO,CAAE,gBAAgB,CAAE,CAAC;IACjD,wBAAwB;IACxB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC1B;AAED;;;;;;;;;GASG;AACH,wBAAgB,wBAAwB,CAAE,EACzC,mBAAmB,EACnB,kBAAkB,EAClB,QAAQ,EACR,EAAE,6BAA6B,+BAW/B;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,IAAI,qBAAqB,CAQtD"}
1
+ {"version":3,"file":"media-editor-state-provider.d.ts","sourceRoot":"","sources":["../../src/state/media-editor-state-provider.tsx"],"names":[],"mappings":"AAKA;;GAEG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAEN,KAAK,qBAAqB,EAC1B,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAMhD,UAAU,6BAA6B;IACtC,4CAA4C;IAC5C,mBAAmB,CAAC,EAAE,OAAO,CAAE,YAAY,CAAE,CAAC;IAC9C,gDAAgD;IAChD,kBAAkB,CAAC,EAAE,OAAO,CAAE,gBAAgB,CAAE,CAAC;IACjD,wBAAwB;IACxB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC1B;AAED;;;;;;;;;GASG;AACH,wBAAgB,wBAAwB,CAAE,EACzC,mBAAmB,EACnB,kBAAkB,EAClB,QAAQ,GACR,EAAE,6BAA6B,+BAW/B;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,IAAI,qBAAqB,CAQtD"}
@@ -16,7 +16,7 @@ interface OpenMediaEditorModalArgs {
16
16
  onUpdate?: (updated: MediaEditorModalUpdate) => void;
17
17
  onClose?: () => void;
18
18
  }
19
- export declare function openMediaEditorModal({ id, onUpdate, onClose }: OpenMediaEditorModalArgs): {
19
+ export declare function openMediaEditorModal({ id, onUpdate, onClose, }: OpenMediaEditorModalArgs): {
20
20
  type: 'OPEN_MEDIA_EDITOR_MODAL';
21
21
  id: number;
22
22
  onUpdate: ((updated: MediaEditorModalUpdate) => void) | null;
@@ -1 +1 @@
1
- {"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../../src/store/actions.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,MAAM,WAAW,sBAAsB;IACtC,EAAE,EAAE,MAAM,CAAC;IACX,GAAG,CAAC,EAAE,MAAM,CAAC;CACb;AAED,UAAU,wBAAwB;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,CAAC,EAAE,CAAE,OAAO,EAAE,sBAAsB,KAAM,IAAI,CAAC;IACvD,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,wBAAgB,oBAAoB,CAAE,EACrC,EAAE,EACF,QAAQ,EACR,OAAO,EACP,EAAE,wBAAwB;UAEnB,yBAAyB;;yBAVV,sBAAsB,KAAM,IAAI;oBACtC,IAAI;EAcpB;AAED,wBAAgB,qBAAqB;IAC3B,IAAI,EAAE,0BAA0B;EACzC"}
1
+ {"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../../src/store/actions.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,MAAM,WAAW,sBAAsB;IACtC,EAAE,EAAE,MAAM,CAAC;IACX,GAAG,CAAC,EAAE,MAAM,CAAC;CACb;AAED,UAAU,wBAAwB;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,CAAC,EAAE,CAAE,OAAO,EAAE,sBAAsB,KAAM,IAAI,CAAC;IACvD,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,wBAAgB,oBAAoB,CAAE,EACrC,EAAE,EACF,QAAQ,EACR,OAAO,GACP,EAAE,wBAAwB;UAEnB,yBAAyB;;yBAVV,sBAAsB,KAAM,IAAI;oBACtC,IAAI;EAcpB;AAED,wBAAgB,qBAAqB;IAC3B,IAAI,EAAE,0BAA0B;EACzC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/media-editor",
3
- "version": "0.13.1-next.v.202607070741.0+a51d59513",
3
+ "version": "0.14.0",
4
4
  "description": "Media editor components for WordPress.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -43,23 +43,24 @@
43
43
  "build-module/store/index.mjs"
44
44
  ],
45
45
  "dependencies": {
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",
46
+ "@wordpress/a11y": "^4.51.0",
47
+ "@wordpress/api-fetch": "^7.51.0",
48
+ "@wordpress/base-styles": "^11.0.0",
49
+ "@wordpress/components": "^37.0.0",
50
+ "@wordpress/compose": "^8.4.0",
51
+ "@wordpress/core-data": "^7.51.0",
52
+ "@wordpress/data": "^10.51.0",
53
+ "@wordpress/dataviews": "^17.2.0",
54
+ "@wordpress/date": "^5.51.0",
55
+ "@wordpress/element": "^8.3.0",
56
+ "@wordpress/i18n": "^6.24.0",
57
+ "@wordpress/icons": "^15.2.0",
58
+ "@wordpress/interface": "^9.36.0",
59
+ "@wordpress/keyboard-shortcuts": "^5.51.0",
60
+ "@wordpress/keycodes": "^4.51.0",
61
+ "@wordpress/notices": "^5.51.0",
62
+ "@wordpress/private-apis": "^1.51.0",
63
+ "@wordpress/ui": "^0.18.0",
63
64
  "clsx": "^2.1.1",
64
65
  "gl-matrix": "^3.4.3"
65
66
  },
@@ -70,8 +71,8 @@
70
71
  "@testing-library/user-event": "^14.6.1"
71
72
  },
72
73
  "peerDependencies": {
73
- "@types/react": "^18.3.27",
74
- "react": "^18.0.0"
74
+ "@types/react": "^18 || ^19",
75
+ "react": "^18 || ^19"
75
76
  },
76
77
  "peerDependenciesMeta": {
77
78
  "@types/react": {
@@ -81,5 +82,5 @@
81
82
  "publishConfig": {
82
83
  "access": "public"
83
84
  },
84
- "gitHead": "f637726e370c8b23695ed9af82adbe171ad235d8"
85
+ "gitHead": "e9a74f9c14095a34398ecd4d1f7a908e55051205"
85
86
  }
@@ -33,7 +33,7 @@
33
33
  // headings. Mirrors `baseLabelTypography` from `@wordpress/components`.
34
34
  &__label {
35
35
  font-size: 11px;
36
- font-weight: 500;
36
+ font-weight: var(--wpds-typography-font-weight-emphasis);
37
37
  line-height: 1.4;
38
38
  text-transform: uppercase;
39
39
  }
@@ -35,7 +35,7 @@
35
35
 
36
36
  .media-editor-keyboard-shortcuts-modal__shortcut-term {
37
37
  background: none;
38
- font-weight: 600;
38
+ font-weight: var(--wpds-typography-font-weight-emphasis);
39
39
  margin: 0 0 0 1rem;
40
40
  padding: 0;
41
41
  text-align: right;
@@ -59,7 +59,7 @@
59
59
  }
60
60
 
61
61
  &__file-name {
62
- font-weight: 600;
62
+ font-weight: var(--wpds-typography-font-weight-emphasis);
63
63
  margin-bottom: $grid-unit-10;
64
64
  }
65
65
 
@@ -18,7 +18,7 @@ $rotation-ruler-accent: var(--wp-admin-theme-color, #3858e9);
18
18
  padding: 0 $grid-unit-10;
19
19
  box-sizing: border-box;
20
20
  color: $gray-900;
21
- font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
21
+ font-family: $font-family-body;
22
22
  user-select: none;
23
23
  touch-action: none;
24
24
  cursor: ew-resize;
@@ -134,7 +134,7 @@ $rotation-ruler-accent: var(--wp-admin-theme-color, #3858e9);
134
134
  height: 14px;
135
135
  transform: translateX(-50%);
136
136
  font-size: 12px;
137
- font-weight: 600;
137
+ font-weight: var(--wpds-typography-font-weight-emphasis);
138
138
  line-height: 14px;
139
139
  color: $gray-900;
140
140
  pointer-events: none;
@@ -276,8 +276,9 @@ function CropperInner(
276
276
  onStateChange?.( state );
277
277
  }, [ state, onStateChange ] );
278
278
 
279
- // ARIA live region: announce significant state changes for screen readers.
280
- const ariaMessage = useAriaAnnouncer( state );
279
+ // ARIA announcements: announce significant state changes for screen readers
280
+ // via the centralized @wordpress/a11y speak() API called inside the hook.
281
+ useAriaAnnouncer( state );
281
282
 
282
283
  // Compute fitted image dimensions and visual bounds from camera math.
283
284
  const naturalWidth = state.image?.naturalWidth ?? 0;
@@ -1107,16 +1108,6 @@ function CropperInner(
1107
1108
  />
1108
1109
  ) }
1109
1110
  </div>
1110
-
1111
- { /* ARIA live region for screen reader announcements */ }
1112
- <div
1113
- aria-live="polite"
1114
- aria-atomic="true"
1115
- className="wp-media-editor-image-editor__aria-live"
1116
- style={ VISUALLY_HIDDEN_STYLE }
1117
- >
1118
- { ariaMessage }
1119
- </div>
1120
1111
  </div>
1121
1112
  </div>
1122
1113
  );
@@ -59,21 +59,21 @@ const ALL_POSITIONS: HandlePosition[] = [
59
59
  function getHandleLabel( pos: HandlePosition ): string {
60
60
  switch ( pos ) {
61
61
  case 'n':
62
- return __( 'Resize top edge' );
62
+ return __( 'Resize from top edge' );
63
63
  case 's':
64
- return __( 'Resize bottom edge' );
64
+ return __( 'Resize from bottom edge' );
65
65
  case 'e':
66
- return __( 'Resize right edge' );
66
+ return __( 'Resize from right edge' );
67
67
  case 'w':
68
- return __( 'Resize left edge' );
68
+ return __( 'Resize from left edge' );
69
69
  case 'nw':
70
- return __( 'Resize top-left corner' );
70
+ return __( 'Resize from top-left corner' );
71
71
  case 'ne':
72
- return __( 'Resize top-right corner' );
72
+ return __( 'Resize from top-right corner' );
73
73
  case 'sw':
74
- return __( 'Resize bottom-left corner' );
74
+ return __( 'Resize from bottom-left corner' );
75
75
  case 'se':
76
- return __( 'Resize bottom-right corner' );
76
+ return __( 'Resize from bottom-right corner' );
77
77
  }
78
78
  }
79
79
 
@@ -94,21 +94,23 @@ describe( 'RectangleStencil', () => {
94
94
  .map( ( b ) => b.getAttribute( 'aria-label' ) );
95
95
 
96
96
  expect( labels ).toEqual( [
97
- 'Resize top-left corner',
98
- 'Resize top edge',
99
- 'Resize top-right corner',
100
- 'Resize right edge',
101
- 'Resize bottom-right corner',
102
- 'Resize bottom edge',
103
- 'Resize bottom-left corner',
104
- 'Resize left edge',
97
+ 'Resize from top-left corner',
98
+ 'Resize from top edge',
99
+ 'Resize from top-right corner',
100
+ 'Resize from right edge',
101
+ 'Resize from bottom-right corner',
102
+ 'Resize from bottom edge',
103
+ 'Resize from bottom-left corner',
104
+ 'Resize from left edge',
105
105
  ] );
106
106
  } );
107
107
 
108
108
  it( 'describes keyboard resizing on resize handles', () => {
109
109
  renderStencil();
110
110
  expect(
111
- screen.getByRole( 'button', { name: 'Resize top-left corner' } )
111
+ screen.getByRole( 'button', {
112
+ name: 'Resize from top-left corner',
113
+ } )
112
114
  ).toHaveAccessibleDescription(
113
115
  'Use arrow keys to resize the crop area. Hold Shift for larger steps.'
114
116
  );
@@ -121,10 +123,10 @@ describe( 'RectangleStencil', () => {
121
123
  .map( ( b ) => b.getAttribute( 'aria-label' ) );
122
124
 
123
125
  expect( labels ).toEqual( [
124
- 'Resize top-left corner',
125
- 'Resize top-right corner',
126
- 'Resize bottom-right corner',
127
- 'Resize bottom-left corner',
126
+ 'Resize from top-left corner',
127
+ 'Resize from top-right corner',
128
+ 'Resize from bottom-right corner',
129
+ 'Resize from bottom-left corner',
128
130
  ] );
129
131
  } );
130
132
  } );
@@ -252,7 +254,7 @@ describe( 'RectangleStencil', () => {
252
254
  imageSize: { width: 500, height: 500 },
253
255
  } );
254
256
  const nwHandle = screen.getByRole( 'button', {
255
- name: 'Resize top-left corner',
257
+ name: 'Resize from top-left corner',
256
258
  } );
257
259
 
258
260
  fireEvent.keyDown( nwHandle, {
@@ -319,7 +321,7 @@ describe( 'RectangleStencil', () => {
319
321
  const snapCropRect = jest.fn( ( rect: NormalizedRect ) => rect );
320
322
  renderStencil( { aspectRatio: 1, snapCropRect } );
321
323
  const nwHandle = screen.getByRole( 'button', {
322
- name: 'Resize top-left corner',
324
+ name: 'Resize from top-left corner',
323
325
  } );
324
326
 
325
327
  fireEvent.keyDown( nwHandle, {
@@ -165,7 +165,7 @@ describe( 'Cropper', () => {
165
165
 
166
166
  const canvas = screen.getByRole( 'group', { name: 'Crop area' } );
167
167
  const handle = await screen.findByRole( 'button', {
168
- name: 'Resize top-left corner',
168
+ name: 'Resize from top-left corner',
169
169
  } );
170
170
 
171
171
  fireEvent.blur( canvas, { relatedTarget: handle } );
@@ -192,7 +192,7 @@ describe( 'Cropper', () => {
192
192
 
193
193
  const canvas = screen.getByRole( 'group', { name: 'Crop area' } );
194
194
  const handle = await screen.findByRole( 'button', {
195
- name: 'Resize top-left corner',
195
+ name: 'Resize from top-left corner',
196
196
  } );
197
197
  const focusVisibleClass =
198
198
  'wp-media-editor-image-editor__canvas--focus-visible';
@@ -232,7 +232,7 @@ describe( 'Cropper', () => {
232
232
 
233
233
  const canvas = screen.getByRole( 'group', { name: 'Crop area' } );
234
234
  const handle = await screen.findByRole( 'button', {
235
- name: 'Resize top-left corner',
235
+ name: 'Resize from top-left corner',
236
236
  } );
237
237
 
238
238
  act( () => {
@@ -294,7 +294,7 @@ describe( 'Cropper', () => {
294
294
  );
295
295
 
296
296
  await screen.findByRole( 'button', {
297
- name: 'Resize top-left corner',
297
+ name: 'Resize from top-left corner',
298
298
  } );
299
299
  ( controller.setCropRect as jest.Mock ).mockClear();
300
300
  ( controller.adjustCropRectForViewport as jest.Mock ).mockClear();
@@ -310,7 +310,7 @@ describe( 'Cropper', () => {
310
310
 
311
311
  expect(
312
312
  screen.queryByRole( 'button', {
313
- name: 'Resize top-left corner',
313
+ name: 'Resize from top-left corner',
314
314
  } )
315
315
  ).not.toBeInTheDocument();
316
316
  expect( controller.setCropRect ).not.toHaveBeenCalled();
@@ -358,7 +358,7 @@ describe( 'Cropper', () => {
358
358
  );
359
359
 
360
360
  const handle = await screen.findByRole( 'button', {
361
- name: 'Resize top-left corner',
361
+ name: 'Resize from top-left corner',
362
362
  } );
363
363
  // The settle transition and viewport pan live on the stage, not the
364
364
  // canvas (which stays fixed so the root background is never exposed).
@@ -414,7 +414,7 @@ describe( 'Cropper', () => {
414
414
  );
415
415
 
416
416
  const handle = await screen.findByRole( 'button', {
417
- name: 'Resize top-left corner',
417
+ name: 'Resize from top-left corner',
418
418
  } );
419
419
  const stage = screen.getByTestId( 'cropper-stage' );
420
420
 
@@ -462,7 +462,7 @@ describe( 'Cropper', () => {
462
462
  );
463
463
 
464
464
  const handle = await screen.findByRole( 'button', {
465
- name: 'Resize top-left corner',
465
+ name: 'Resize from top-left corner',
466
466
  } );
467
467
  const stage = screen.getByTestId( 'cropper-stage' );
468
468
 
@@ -502,7 +502,7 @@ describe( 'Cropper', () => {
502
502
  );
503
503
 
504
504
  const handle = await screen.findByRole( 'button', {
505
- name: 'Resize top-left corner',
505
+ name: 'Resize from top-left corner',
506
506
  } );
507
507
  const stage = screen.getByTestId( 'cropper-stage' );
508
508
 
@@ -549,7 +549,7 @@ describe( 'Cropper', () => {
549
549
 
550
550
  // East handle (4th button clockwise: nw, n, ne, e).
551
551
  const eHandle = await screen.findByRole( 'button', {
552
- name: 'Resize right edge',
552
+ name: 'Resize from right edge',
553
553
  } );
554
554
  const stage = screen.getByTestId( 'cropper-stage' );
555
555
 
@@ -582,7 +582,7 @@ describe( 'Cropper', () => {
582
582
  );
583
583
 
584
584
  const resizeHandle = await screen.findByRole( 'button', {
585
- name: 'Resize top-left corner',
585
+ name: 'Resize from top-left corner',
586
586
  } );
587
587
  const canvas = screen.getByRole( 'group', { name: 'Crop area' } );
588
588
 
@@ -622,7 +622,7 @@ describe( 'Cropper', () => {
622
622
  );
623
623
 
624
624
  await screen.findByRole( 'button', {
625
- name: 'Resize top-left corner',
625
+ name: 'Resize from top-left corner',
626
626
  } );
627
627
  const canvas = screen.getByRole( 'group', { name: 'Crop area' } );
628
628
 
@@ -670,7 +670,7 @@ describe( 'Cropper', () => {
670
670
  );
671
671
 
672
672
  const resizeHandle = await screen.findByRole( 'button', {
673
- name: 'Resize top-left corner',
673
+ name: 'Resize from top-left corner',
674
674
  } );
675
675
  const canvas = screen.getByRole( 'group', {
676
676
  name: 'Crop area',
@@ -892,7 +892,7 @@ describe( 'Cropper', () => {
892
892
  expect( imageScale() ).toBeCloseTo( 2.4, 2 );
893
893
 
894
894
  const handle = await screen.findByRole( 'button', {
895
- name: 'Resize top-left corner',
895
+ name: 'Resize from top-left corner',
896
896
  } );
897
897
  fireEvent.pointerDown( handle, {
898
898
  button: 0,
@@ -926,7 +926,7 @@ describe( 'Cropper', () => {
926
926
  );
927
927
 
928
928
  const handle = await screen.findByRole( 'button', {
929
- name: 'Resize right edge',
929
+ name: 'Resize from right edge',
930
930
  } );
931
931
  fireEvent.keyDown( handle, { key: 'ArrowRight' } );
932
932
 
@@ -968,7 +968,7 @@ describe( 'Cropper', () => {
968
968
  );
969
969
 
970
970
  const handle = await screen.findByRole( 'button', {
971
- name: 'Resize right edge',
971
+ name: 'Resize from right edge',
972
972
  } );
973
973
  ( controller.setCropRect as jest.Mock ).mockClear();
974
974
  fireEvent.keyDown( handle, { key: 'ArrowRight' } );
@@ -1003,7 +1003,7 @@ describe( 'Cropper', () => {
1003
1003
  );
1004
1004
 
1005
1005
  const handle = await screen.findByRole( 'button', {
1006
- name: 'Resize right edge',
1006
+ name: 'Resize from right edge',
1007
1007
  } );
1008
1008
  fireEvent.keyDown( handle, { key: 'ArrowRight' } );
1009
1009