@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.
- package/CHANGELOG.md +9 -0
- package/build/image-editor/react/components/cropper.cjs +1 -11
- package/build/image-editor/react/components/cropper.cjs.map +2 -2
- package/build/image-editor/react/components/stencils/rectangle-stencil.cjs +8 -8
- package/build/image-editor/react/components/stencils/rectangle-stencil.cjs.map +2 -2
- package/build/image-editor/react/hooks/use-aria-announcer.cjs +75 -32
- package/build/image-editor/react/hooks/use-aria-announcer.cjs.map +2 -2
- package/build-module/image-editor/react/components/cropper.mjs +1 -11
- package/build-module/image-editor/react/components/cropper.mjs.map +2 -2
- package/build-module/image-editor/react/components/stencils/rectangle-stencil.mjs +8 -8
- package/build-module/image-editor/react/components/stencils/rectangle-stencil.mjs.map +2 -2
- package/build-module/image-editor/react/hooks/use-aria-announcer.mjs +76 -38
- package/build-module/image-editor/react/hooks/use-aria-announcer.mjs.map +2 -2
- package/build-style/style-rtl.css +5 -5
- package/build-style/style.css +5 -5
- package/build-types/components/media-editor/use-crop-options.d.ts +1 -1
- package/build-types/components/media-editor/use-crop-options.d.ts.map +1 -1
- package/build-types/components/media-editor/use-save-media-editor.d.ts +1 -1
- package/build-types/components/media-editor/use-save-media-editor.d.ts.map +1 -1
- package/build-types/components/media-editor-canvas/index.d.ts +1 -1
- package/build-types/components/media-editor-canvas/index.d.ts.map +1 -1
- package/build-types/components/media-editor-crop-panel/index.d.ts +1 -1
- package/build-types/components/media-editor-crop-panel/index.d.ts.map +1 -1
- package/build-types/components/media-editor-fine-rotation/index.d.ts +1 -1
- package/build-types/components/media-editor-fine-rotation/index.d.ts.map +1 -1
- package/build-types/components/media-editor-image-controls/index.d.ts +1 -1
- package/build-types/components/media-editor-image-controls/index.d.ts.map +1 -1
- package/build-types/components/media-editor-keyboard-shortcuts-modal/index.d.ts +1 -1
- package/build-types/components/media-editor-keyboard-shortcuts-modal/index.d.ts.map +1 -1
- package/build-types/components/media-editor-modal/index.d.ts +1 -1
- package/build-types/components/media-editor-modal/index.d.ts.map +1 -1
- package/build-types/components/media-editor-provider/index.d.ts +1 -1
- package/build-types/components/media-editor-provider/index.d.ts.map +1 -1
- package/build-types/components/media-form/index.d.ts +1 -1
- package/build-types/components/media-form/index.d.ts.map +1 -1
- package/build-types/image-editor/react/components/cropper-provider.d.ts +1 -1
- package/build-types/image-editor/react/components/cropper-provider.d.ts.map +1 -1
- package/build-types/image-editor/react/components/cropper.d.ts.map +1 -1
- package/build-types/image-editor/react/components/overlays/dimensions-overlay.d.ts +1 -1
- package/build-types/image-editor/react/components/overlays/dimensions-overlay.d.ts.map +1 -1
- package/build-types/image-editor/react/components/overlays/dimming-overlay.d.ts +1 -1
- package/build-types/image-editor/react/components/overlays/dimming-overlay.d.ts.map +1 -1
- package/build-types/image-editor/react/components/overlays/grid-overlay.d.ts +1 -1
- package/build-types/image-editor/react/components/overlays/grid-overlay.d.ts.map +1 -1
- package/build-types/image-editor/react/components/stencils/rectangle-stencil.d.ts +1 -1
- package/build-types/image-editor/react/components/stencils/rectangle-stencil.d.ts.map +1 -1
- package/build-types/image-editor/react/components/viewport-provider.d.ts +1 -1
- package/build-types/image-editor/react/components/viewport-provider.d.ts.map +1 -1
- package/build-types/image-editor/react/hooks/use-aria-announcer.d.ts +5 -4
- package/build-types/image-editor/react/hooks/use-aria-announcer.d.ts.map +1 -1
- package/build-types/state/media-editor-state-provider.d.ts +1 -1
- package/build-types/state/media-editor-state-provider.d.ts.map +1 -1
- package/build-types/store/actions.d.ts +1 -1
- package/build-types/store/actions.d.ts.map +1 -1
- package/package.json +22 -21
- package/src/components/media-editor-image-controls/style.scss +1 -1
- package/src/components/media-editor-keyboard-shortcuts-modal/style.scss +1 -1
- package/src/components/media-preview/style.scss +1 -1
- package/src/components/rotation-ruler/style.scss +2 -2
- package/src/image-editor/react/components/cropper.tsx +3 -12
- package/src/image-editor/react/components/stencils/rectangle-stencil.tsx +8 -8
- package/src/image-editor/react/components/stencils/test/rectangle-stencil.tsx +17 -15
- package/src/image-editor/react/components/test/cropper.tsx +17 -17
- package/src/image-editor/react/hooks/test/use-aria-announcer.ts +413 -5
- package/src/image-editor/react/hooks/use-aria-announcer.ts +120 -47
- package/tsconfig.json +1 -0
- 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,
|
|
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,
|
|
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,
|
|
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,
|
|
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,
|
|
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.
|
|
8
|
-
*
|
|
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
|
|
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):
|
|
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":"
|
|
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,
|
|
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,
|
|
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.
|
|
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/
|
|
47
|
-
"@wordpress/
|
|
48
|
-
"@wordpress/
|
|
49
|
-
"@wordpress/
|
|
50
|
-
"@wordpress/
|
|
51
|
-
"@wordpress/data": "^
|
|
52
|
-
"@wordpress/
|
|
53
|
-
"@wordpress/
|
|
54
|
-
"@wordpress/
|
|
55
|
-
"@wordpress/
|
|
56
|
-
"@wordpress/
|
|
57
|
-
"@wordpress/
|
|
58
|
-
"@wordpress/
|
|
59
|
-
"@wordpress/
|
|
60
|
-
"@wordpress/
|
|
61
|
-
"@wordpress/
|
|
62
|
-
"@wordpress/
|
|
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
|
|
74
|
-
"react": "^18
|
|
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": "
|
|
85
|
+
"gitHead": "e9a74f9c14095a34398ecd4d1f7a908e55051205"
|
|
85
86
|
}
|
|
@@ -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: -
|
|
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:
|
|
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
|
|
280
|
-
|
|
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', {
|
|
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
|
|