@wordpress/media-editor 0.13.1-next.v.202607070741.0 → 0.15.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 (75) hide show
  1. package/CHANGELOG.md +11 -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-editor-toolbar/index.d.ts +24 -0
  35. package/build-types/components/media-editor-toolbar/index.d.ts.map +1 -0
  36. package/build-types/components/media-editor-transform-controls/index.d.ts +21 -0
  37. package/build-types/components/media-editor-transform-controls/index.d.ts.map +1 -0
  38. package/build-types/components/media-form/index.d.ts +1 -1
  39. package/build-types/components/media-form/index.d.ts.map +1 -1
  40. package/build-types/components/media-form/sidebar-datetime-view.d.ts +10 -0
  41. package/build-types/components/media-form/sidebar-datetime-view.d.ts.map +1 -0
  42. package/build-types/image-editor/react/components/cropper-provider.d.ts +1 -1
  43. package/build-types/image-editor/react/components/cropper-provider.d.ts.map +1 -1
  44. package/build-types/image-editor/react/components/cropper.d.ts.map +1 -1
  45. package/build-types/image-editor/react/components/overlays/dimensions-overlay.d.ts +1 -1
  46. package/build-types/image-editor/react/components/overlays/dimensions-overlay.d.ts.map +1 -1
  47. package/build-types/image-editor/react/components/overlays/dimming-overlay.d.ts +1 -1
  48. package/build-types/image-editor/react/components/overlays/dimming-overlay.d.ts.map +1 -1
  49. package/build-types/image-editor/react/components/overlays/grid-overlay.d.ts +1 -1
  50. package/build-types/image-editor/react/components/overlays/grid-overlay.d.ts.map +1 -1
  51. package/build-types/image-editor/react/components/stencils/rectangle-stencil.d.ts +1 -1
  52. package/build-types/image-editor/react/components/stencils/rectangle-stencil.d.ts.map +1 -1
  53. package/build-types/image-editor/react/components/viewport-provider.d.ts +1 -1
  54. package/build-types/image-editor/react/components/viewport-provider.d.ts.map +1 -1
  55. package/build-types/image-editor/react/hooks/use-aria-announcer.d.ts +5 -4
  56. package/build-types/image-editor/react/hooks/use-aria-announcer.d.ts.map +1 -1
  57. package/build-types/image-editor/react/hooks/use-cropper-state.d.ts +108 -0
  58. package/build-types/image-editor/react/hooks/use-cropper-state.d.ts.map +1 -0
  59. package/build-types/state/media-editor-state-provider.d.ts +1 -1
  60. package/build-types/state/media-editor-state-provider.d.ts.map +1 -1
  61. package/build-types/store/actions.d.ts +1 -1
  62. package/build-types/store/actions.d.ts.map +1 -1
  63. package/package.json +22 -21
  64. package/src/components/media-editor-image-controls/style.scss +1 -1
  65. package/src/components/media-editor-keyboard-shortcuts-modal/style.scss +1 -1
  66. package/src/components/media-preview/style.scss +1 -1
  67. package/src/components/rotation-ruler/style.scss +2 -2
  68. package/src/image-editor/react/components/cropper.tsx +3 -12
  69. package/src/image-editor/react/components/stencils/rectangle-stencil.tsx +8 -8
  70. package/src/image-editor/react/components/stencils/test/rectangle-stencil.tsx +17 -15
  71. package/src/image-editor/react/components/test/cropper.tsx +17 -17
  72. package/src/image-editor/react/hooks/test/use-aria-announcer.ts +413 -5
  73. package/src/image-editor/react/hooks/use-aria-announcer.ts +120 -47
  74. package/tsconfig.json +1 -0
  75. package/tsconfig.tsbuildinfo +1 -1
@@ -0,0 +1,21 @@
1
+ export interface MediaEditorTransformControlsProps {
2
+ /**
3
+ * When `true`, render rotate and flip as two labelled groups stacked
4
+ * vertically — the Crop panel layout used on wide viewports. When
5
+ * `false` (default), render a single flat row of icon buttons — the
6
+ * footer layout used at narrower widths.
7
+ */
8
+ withLabels?: boolean;
9
+ }
10
+ /**
11
+ * Snap-rotate and flip controls. Rotation and reflection are both geometric
12
+ * transforms, hence "transform controls". Lives separately from the
13
+ * fine-rotation slider so each can be placed independently per viewport: on
14
+ * wide viewports both render inside the Crop panel (`withLabels`), and at
15
+ * narrower widths they fall back into the footer toolbar (flat row).
16
+ *
17
+ * @param props
18
+ * @param props.withLabels
19
+ */
20
+ export default function MediaEditorTransformControls({ withLabels }: MediaEditorTransformControlsProps): import("react").JSX.Element;
21
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/media-editor-transform-controls/index.tsx"],"names":[],"mappings":"AAiBA,MAAM,WAAW,iCAAiC;IACjD;;;;;OAKG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;CACrB;AAED;;;;;;;;;GASG;AACH,MAAM,CAAC,OAAO,UAAU,4BAA4B,CAAE,EACrD,UAAkB,EAClB,EAAE,iCAAiC,+BAgGnC"}
@@ -18,5 +18,5 @@ export interface MediaFormProps {
18
18
  * @param props.header - Optional header content to display above the form.
19
19
  * @return The MediaForm component.
20
20
  */
21
- export default function MediaForm({ form: formOverrides, header }: MediaFormProps): import("react").JSX.Element;
21
+ export default function MediaForm({ form: formOverrides, header, }: MediaFormProps): import("react").JSX.Element;
22
22
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/media-form/index.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,IAAI,EAAS,MAAM,sBAAsB,CAAC;AAIxD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAQvC;;GAEG;AACH,MAAM,WAAW,cAAc;IAC9B,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,MAAM,CAAC,EAAE,SAAS,CAAC;CACnB;AAED;;;;;;;;;;GAUG;AACH,MAAM,CAAC,OAAO,UAAU,SAAS,CAAE,EAClC,IAAI,EAAE,aAAa,EACnB,MAAM,EACN,EAAE,cAAc,+BA+DhB"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/media-form/index.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,IAAI,EAAS,MAAM,sBAAsB,CAAC;AAIxD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAQvC;;GAEG;AACH,MAAM,WAAW,cAAc;IAC9B,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,MAAM,CAAC,EAAE,SAAS,CAAC;CACnB;AAED;;;;;;;;;;GAUG;AACH,MAAM,CAAC,OAAO,UAAU,SAAS,CAAE,EAClC,IAAI,EAAE,aAAa,EACnB,MAAM,GACN,EAAE,cAAc,+BA+DhB"}
@@ -0,0 +1,10 @@
1
+ import type { NormalizedField } from '@wordpress/dataviews';
2
+ /**
3
+ * Internal dependencies
4
+ */
5
+ import type { Media } from '../media-editor-provider';
6
+ export default function SidebarDatetimeView({ item, field }: {
7
+ item: Media;
8
+ field: NormalizedField<Media>;
9
+ }): import("react").JSX.Element | null;
10
+ //# sourceMappingURL=sidebar-datetime-view.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sidebar-datetime-view.d.ts","sourceRoot":"","sources":["../../../src/components/media-form/sidebar-datetime-view.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAE5D;;GAEG;AACH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAC;AAEtD,MAAM,CAAC,OAAO,UAAU,mBAAmB,CAAE,EAC5C,IAAI,EACJ,KAAK,EACL,EAAE;IACF,IAAI,EAAE,KAAK,CAAC;IACZ,KAAK,EAAE,eAAe,CAAE,KAAK,CAAE,CAAC;CAChC,sCA4BA"}
@@ -27,7 +27,7 @@ interface CropperProviderProps {
27
27
  * @param props.children
28
28
  * @return The provider element wrapping children.
29
29
  */
30
- export declare function CropperProvider({ initialState, children }: CropperProviderProps): import("react").JSX.Element;
30
+ export declare function CropperProvider({ initialState, children, }: CropperProviderProps): import("react").JSX.Element;
31
31
  /**
32
32
  * Hook to consume the CropperProvider context.
33
33
  *
@@ -1 +1 @@
1
- {"version":3,"file":"cropper-provider.d.ts","sourceRoot":"","sources":["../../../../src/image-editor/react/components/cropper-provider.tsx"],"names":[],"mappings":"AAKA;;GAEG;AACH,OAAO,EAEN,KAAK,iBAAiB,EACtB,MAAM,8BAA8B,CAAC;AACtC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAUrD;;GAEG;AACH,UAAU,oBAAoB;IAC7B,6DAA6D;IAC7D,YAAY,CAAC,EAAE,OAAO,CAAE,YAAY,CAAE,CAAC;IACvC,wBAAwB;IACxB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC1B;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,eAAe,CAAE,EAChC,YAAY,EACZ,QAAQ,EACR,EAAE,oBAAoB,+BAQtB;AAED;;;;;;;GAOG;AACH,wBAAgB,UAAU,IAAI,iBAAiB,CAQ9C"}
1
+ {"version":3,"file":"cropper-provider.d.ts","sourceRoot":"","sources":["../../../../src/image-editor/react/components/cropper-provider.tsx"],"names":[],"mappings":"AAKA;;GAEG;AACH,OAAO,EAEN,KAAK,iBAAiB,EACtB,MAAM,8BAA8B,CAAC;AACtC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAUrD;;GAEG;AACH,UAAU,oBAAoB;IAC7B,6DAA6D;IAC7D,YAAY,CAAC,EAAE,OAAO,CAAE,YAAY,CAAE,CAAC;IACvC,wBAAwB;IACxB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC1B;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,eAAe,CAAE,EAChC,YAAY,EACZ,QAAQ,GACR,EAAE,oBAAoB,+BAQtB;AAED;;;;;;;GAOG;AACH,wBAAgB,UAAU,IAAI,iBAAiB,CAQ9C"}
@@ -1 +1 @@
1
- {"version":3,"file":"cropper.d.ts","sourceRoot":"","sources":["../../../../src/image-editor/react/components/cropper.tsx"],"names":[],"mappings":"AAAA;;GAEG;AAmBH;;GAEG;AACH,OAAO,KAAK,EACX,YAAY,EAEZ,YAAY,EACZ,IAAI,EAEJ,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AA2CtE;;GAEG;AACH,MAAM,WAAW,YAAY;IAC5B,wBAAwB;IACxB,GAAG,EAAE,MAAM,CAAC;IACZ,4EAA4E;IAC5E,UAAU,EAAE,iBAAiB,CAAC;IAC9B,yEAAyE;IACzE,OAAO,CAAC,EAAE,KAAK,CAAC,aAAa,CAAE,YAAY,CAAE,CAAC;IAC9C,yEAAyE;IACzE,QAAQ,CAAC,EAAE,OAAO,GAAG,aAAa,CAAC;IACnC,wEAAwE;IACxE,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,sDAAsD;IACtD,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,+DAA+D;IAC/D,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,2EAA2E;IAC3E,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,0BAA0B;IAC1B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,4EAA4E;IAC5E,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;OAIG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,mDAAmD;IACnD,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,+CAA+C;IAC/C,aAAa,CAAC,EAAE,CAAE,IAAI,EAAE,IAAI,KAAM,IAAI,CAAC;IACvC;;;;;;;;;OASG;IACH,aAAa,CAAC,EAAE,CAAE,KAAK,EAAE,YAAY,KAAM,IAAI,CAAC;IAChD,oFAAoF;IACpF,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;IAC5B,uEAAuE;IACvE,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B,8CAA8C;IAC9C,SAAS,CAAC,EAAE,MAAM,CAAC;CACnB;AA2+BD,eAAO,MAAM,OAAO,yGAMnB,CAAC"}
1
+ {"version":3,"file":"cropper.d.ts","sourceRoot":"","sources":["../../../../src/image-editor/react/components/cropper.tsx"],"names":[],"mappings":"AAAA;;GAEG;AAmBH;;GAEG;AACH,OAAO,KAAK,EACX,YAAY,EAEZ,YAAY,EACZ,IAAI,EAEJ,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AA2CtE;;GAEG;AACH,MAAM,WAAW,YAAY;IAC5B,wBAAwB;IACxB,GAAG,EAAE,MAAM,CAAC;IACZ,4EAA4E;IAC5E,UAAU,EAAE,iBAAiB,CAAC;IAC9B,yEAAyE;IACzE,OAAO,CAAC,EAAE,KAAK,CAAC,aAAa,CAAE,YAAY,CAAE,CAAC;IAC9C,yEAAyE;IACzE,QAAQ,CAAC,EAAE,OAAO,GAAG,aAAa,CAAC;IACnC,wEAAwE;IACxE,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,sDAAsD;IACtD,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,+DAA+D;IAC/D,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,2EAA2E;IAC3E,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,0BAA0B;IAC1B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,4EAA4E;IAC5E,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;OAIG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,mDAAmD;IACnD,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,+CAA+C;IAC/C,aAAa,CAAC,EAAE,CAAE,IAAI,EAAE,IAAI,KAAM,IAAI,CAAC;IACvC;;;;;;;;;OASG;IACH,aAAa,CAAC,EAAE,CAAE,KAAK,EAAE,YAAY,KAAM,IAAI,CAAC;IAChD,oFAAoF;IACpF,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;IAC5B,uEAAuE;IACvE,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B,8CAA8C;IAC9C,SAAS,CAAC,EAAE,MAAM,CAAC;CACnB;AAk+BD,eAAO,MAAM,OAAO,yGAMnB,CAAC"}
@@ -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"}
@@ -0,0 +1,108 @@
1
+ /**
2
+ * Internal dependencies
3
+ */
4
+ import type { CropperState, TransformOperation, NormalizedPoint, NormalizedRect, Flip } from '../../core/types';
5
+ /**
6
+ * The return type of the useCropperState hook.
7
+ *
8
+ * The hook exposes its state through named setter methods rather
9
+ * than a raw dispatch function. Each setter has a specific
10
+ * behavioral contract (see individual JSDoc) that maps 1:1 to a
11
+ * reducer action internally. Keeping the reducer actions private
12
+ * lets the implementation evolve without breaking consumers.
13
+ */
14
+ export interface UseCropperStateReturn {
15
+ /** The current cropper state (read-only). */
16
+ state: CropperState;
17
+ /** Set the loaded image (natural size and src). */
18
+ setImage: (image: CropperState['image']) => void;
19
+ /**
20
+ * Set the image pan offset in normalized coordinates. Use
21
+ * `setCropRect` for the crop rectangle.
22
+ */
23
+ setPan: (pan: NormalizedPoint) => void;
24
+ /**
25
+ * Set the zoom level, anchored at the crop center. Clamped to the
26
+ * coverage-aware minimum and maximum zoom.
27
+ *
28
+ * Pointer-driven zoom (wheel, pinch, double-tap) anchors at the
29
+ * cursor via `setZoomAtPoint`. Cursorless surfaces — the slider, the
30
+ * `+`/`-` keys, programmatic toolbar buttons — have no natural
31
+ * focal point, so they default to the crop center. Otherwise
32
+ * `enforceContainment` would translate the image whichever way is
33
+ * shortest, which snaps the framed content toward the nearest
34
+ * viewport corner when zooming out from an off-center position.
35
+ */
36
+ setZoom: (zoom: number) => void;
37
+ /** Set zoom and pan together so focal-point zoom remains atomic. */
38
+ setZoomAtPoint: (zoom: number, pan: NormalizedPoint) => void;
39
+ /** Set the rotation in degrees. Normalized to [0, 360). */
40
+ setRotation: (rotation: number) => void;
41
+ /** Set the flip state. */
42
+ setFlip: (flip: Flip) => void;
43
+ /** Toggle flip on the given axis. */
44
+ toggleFlip: (direction: 'horizontal' | 'vertical') => void;
45
+ /** Snap rotate 90° preserving the image selection (Google Photos style). */
46
+ snapRotate90: (direction: 1 | -1) => void;
47
+ /** Set the crop rectangle in normalized coordinates. */
48
+ setCropRect: (rect: NormalizedRect) => void;
49
+ /**
50
+ * Settle the crop rect after a resize drag: expand to fill the
51
+ * available visual area while preserving the framed image region.
52
+ * Typically called from a stencil's `onResizeEnd` callback.
53
+ *
54
+ * Flushes the pending resize history before dispatching, then suppresses
55
+ * the settle dispatch itself so resizing and settling undo as one step.
56
+ */
57
+ settleCrop: () => void;
58
+ /** Apply a transform operation through the pipeline. */
59
+ applyOperation: (op: TransformOperation) => void;
60
+ /** Reset the state. Optionally merge partial state overrides. */
61
+ reset: (resetState?: Partial<CropperState>) => void;
62
+ /** Whether the current state differs from the initial state. */
63
+ isDirty: boolean;
64
+ /** Whether there is a cropper state to undo. */
65
+ hasUndo: boolean;
66
+ /** Whether there is a cropper state to redo. */
67
+ hasRedo: boolean;
68
+ /** Undo the last committed cropper operation. */
69
+ undo: () => void;
70
+ /** Redo the last undone cropper operation. */
71
+ redo: () => void;
72
+ /**
73
+ * Flush the pending history entry immediately, bypassing the debounce
74
+ * timer. Useful in two situations:
75
+ *
76
+ * - **Pointer-up / key-up**: commit as soon as the user releases so the
77
+ * undo button lights up without waiting for the debounce window.
78
+ * - **Gesture start**: pass to `onGestureStart` on the `Cropper` so any
79
+ * pending sidebar interaction is committed before a new canvas gesture
80
+ * begins, keeping the two interactions as separate undo steps.
81
+ */
82
+ commitHistory: () => void;
83
+ /**
84
+ * Export the cropped image as a Blob. Throws on failure — see
85
+ * `exportCroppedImage` in core for the error semantics (image
86
+ * load errors, CORS taint, missing canvas context). Wrap in
87
+ * try/catch if you need to recover.
88
+ */
89
+ getCroppedImage: (mimeType?: string, quality?: number) => Promise<Blob>;
90
+ }
91
+ /**
92
+ * Reducer-based state management hook for the image editor.
93
+ *
94
+ * Provides the full cropper state and named setter methods for
95
+ * every supported transition. The reducer and containment logic
96
+ * live in core/state.ts (framework-agnostic); this hook is a thin
97
+ * React wrapper around that pure reducer, with memoized callbacks.
98
+ *
99
+ * History is recorded via a state-change debounce: any state change
100
+ * starts a 300 ms timer; when it fires the pre-change state is pushed
101
+ * onto the undo stack. `commitHistory` flushes the timer immediately
102
+ * (useful on pointer-up / key-up for a crisp commit feel).
103
+ *
104
+ * @param initialState Optional partial state to merge with DEFAULT_STATE.
105
+ * @return The cropper state, setters, and utilities.
106
+ */
107
+ export declare function useCropperState(initialState?: Partial<CropperState>): UseCropperStateReturn;
108
+ //# sourceMappingURL=use-cropper-state.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-cropper-state.d.ts","sourceRoot":"","sources":["../../../../src/image-editor/react/hooks/use-cropper-state.ts"],"names":[],"mappings":"AAWA;;GAEG;AACH,OAAO,KAAK,EACX,YAAY,EACZ,kBAAkB,EAClB,eAAe,EACf,cAAc,EACd,IAAI,EACJ,MAAM,kBAAkB,CAAC;AAU1B;;;;;;;;GAQG;AACH,MAAM,WAAW,qBAAqB;IACrC,6CAA6C;IAC7C,KAAK,EAAE,YAAY,CAAC;IACpB,mDAAmD;IACnD,QAAQ,EAAE,CAAE,KAAK,EAAE,YAAY,CAAE,OAAO,CAAE,KAAM,IAAI,CAAC;IACrD;;;OAGG;IACH,MAAM,EAAE,CAAE,GAAG,EAAE,eAAe,KAAM,IAAI,CAAC;IACzC;;;;;;;;;;;OAWG;IACH,OAAO,EAAE,CAAE,IAAI,EAAE,MAAM,KAAM,IAAI,CAAC;IAClC,oEAAoE;IACpE,cAAc,EAAE,CAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,eAAe,KAAM,IAAI,CAAC;IAC/D,2DAA2D;IAC3D,WAAW,EAAE,CAAE,QAAQ,EAAE,MAAM,KAAM,IAAI,CAAC;IAC1C,0BAA0B;IAC1B,OAAO,EAAE,CAAE,IAAI,EAAE,IAAI,KAAM,IAAI,CAAC;IAChC,qCAAqC;IACrC,UAAU,EAAE,CAAE,SAAS,EAAE,YAAY,GAAG,UAAU,KAAM,IAAI,CAAC;IAC7D,4EAA4E;IAC5E,YAAY,EAAE,CAAE,SAAS,EAAE,CAAC,GAAG,CAAC,CAAC,KAAM,IAAI,CAAC;IAC5C,wDAAwD;IACxD,WAAW,EAAE,CAAE,IAAI,EAAE,cAAc,KAAM,IAAI,CAAC;IAC9C;;;;;;;OAOG;IACH,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,wDAAwD;IACxD,cAAc,EAAE,CAAE,EAAE,EAAE,kBAAkB,KAAM,IAAI,CAAC;IACnD,iEAAiE;IACjE,KAAK,EAAE,CAAE,UAAU,CAAC,EAAE,OAAO,CAAE,YAAY,CAAE,KAAM,IAAI,CAAC;IACxD,gEAAgE;IAChE,OAAO,EAAE,OAAO,CAAC;IACjB,gDAAgD;IAChD,OAAO,EAAE,OAAO,CAAC;IACjB,gDAAgD;IAChD,OAAO,EAAE,OAAO,CAAC;IACjB,iDAAiD;IACjD,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB,8CAA8C;IAC9C,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB;;;;;;;;;OASG;IACH,aAAa,EAAE,MAAM,IAAI,CAAC;IAC1B;;;;;OAKG;IACH,eAAe,EAAE,CAAE,QAAQ,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,KAAM,OAAO,CAAE,IAAI,CAAE,CAAC;CAC5E;AAgCD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,eAAe,CAC9B,YAAY,CAAC,EAAE,OAAO,CAAE,YAAY,CAAE,GACpC,qBAAqB,CAmVvB"}
@@ -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.15.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.52.0",
47
+ "@wordpress/api-fetch": "^7.52.0",
48
+ "@wordpress/base-styles": "^12.0.0",
49
+ "@wordpress/components": "^38.0.0",
50
+ "@wordpress/compose": "^8.5.0",
51
+ "@wordpress/core-data": "^7.52.0",
52
+ "@wordpress/data": "^10.52.0",
53
+ "@wordpress/dataviews": "^17.3.0",
54
+ "@wordpress/date": "^5.52.0",
55
+ "@wordpress/element": "^8.4.0",
56
+ "@wordpress/i18n": "^6.25.0",
57
+ "@wordpress/icons": "^15.3.0",
58
+ "@wordpress/interface": "^9.37.0",
59
+ "@wordpress/keyboard-shortcuts": "^5.52.0",
60
+ "@wordpress/keycodes": "^4.52.0",
61
+ "@wordpress/notices": "^5.52.0",
62
+ "@wordpress/private-apis": "^1.52.0",
63
+ "@wordpress/ui": "^0.19.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": "7e8b17a983f9391d3ebc7717af2a1c9ed7efc7ab"
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, {