@wordpress/media-editor 0.3.1-next.v.202602271551.0 → 0.3.1

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 (124) hide show
  1. package/build-types/components/media-editor/index.d.ts +42 -0
  2. package/build-types/components/media-editor/index.d.ts.map +1 -0
  3. package/build-types/components/media-editor/use-crop-options.d.ts +35 -0
  4. package/build-types/components/media-editor/use-crop-options.d.ts.map +1 -0
  5. package/build-types/components/media-editor/use-save-media-editor.d.ts +29 -0
  6. package/build-types/components/media-editor/use-save-media-editor.d.ts.map +1 -0
  7. package/build-types/components/media-editor-canvas/index.d.ts +26 -0
  8. package/build-types/components/media-editor-canvas/index.d.ts.map +1 -0
  9. package/build-types/components/media-editor-crop-panel/index.d.ts +31 -0
  10. package/build-types/components/media-editor-crop-panel/index.d.ts.map +1 -0
  11. package/build-types/components/media-editor-fine-rotation/index.d.ts +15 -0
  12. package/build-types/components/media-editor-fine-rotation/index.d.ts.map +1 -0
  13. package/build-types/components/media-editor-image-controls/index.d.ts +46 -0
  14. package/build-types/components/media-editor-image-controls/index.d.ts.map +1 -0
  15. package/build-types/components/media-editor-keyboard-shortcuts-modal/index.d.ts +6 -0
  16. package/build-types/components/media-editor-keyboard-shortcuts-modal/index.d.ts.map +1 -0
  17. package/build-types/components/media-editor-modal/build-modifiers.d.ts +83 -0
  18. package/build-types/components/media-editor-modal/build-modifiers.d.ts.map +1 -0
  19. package/build-types/components/media-editor-modal/index.d.ts +20 -0
  20. package/build-types/components/media-editor-modal/index.d.ts.map +1 -0
  21. package/build-types/components/rotation-ruler/index.d.ts +46 -0
  22. package/build-types/components/rotation-ruler/index.d.ts.map +1 -0
  23. package/build-types/components/rotation-ruler/stories/index.story.d.ts +14 -0
  24. package/build-types/components/rotation-ruler/stories/index.story.d.ts.map +1 -0
  25. package/build-types/components/rotation-ruler/use-ruler-drag.d.ts +61 -0
  26. package/build-types/components/rotation-ruler/use-ruler-drag.d.ts.map +1 -0
  27. package/build-types/hooks/use-crop-gesture-handlers.d.ts +41 -0
  28. package/build-types/hooks/use-crop-gesture-handlers.d.ts.map +1 -0
  29. package/build-types/image-editor/core/camera.d.ts +107 -0
  30. package/build-types/image-editor/core/camera.d.ts.map +1 -0
  31. package/build-types/image-editor/core/constants.d.ts +83 -0
  32. package/build-types/image-editor/core/constants.d.ts.map +1 -0
  33. package/build-types/image-editor/core/containment.d.ts +75 -0
  34. package/build-types/image-editor/core/containment.d.ts.map +1 -0
  35. package/build-types/image-editor/core/crop-rect.d.ts +19 -0
  36. package/build-types/image-editor/core/crop-rect.d.ts.map +1 -0
  37. package/build-types/image-editor/core/export/canvas-renderer.d.ts +106 -0
  38. package/build-types/image-editor/core/export/canvas-renderer.d.ts.map +1 -0
  39. package/build-types/image-editor/core/index.d.ts +10 -0
  40. package/build-types/image-editor/core/index.d.ts.map +1 -0
  41. package/build-types/image-editor/core/interaction-controller.d.ts +194 -0
  42. package/build-types/image-editor/core/interaction-controller.d.ts.map +1 -0
  43. package/build-types/image-editor/core/math/rotation.d.ts +18 -0
  44. package/build-types/image-editor/core/math/rotation.d.ts.map +1 -0
  45. package/build-types/image-editor/core/math/sanitize.d.ts +70 -0
  46. package/build-types/image-editor/core/math/sanitize.d.ts.map +1 -0
  47. package/build-types/image-editor/core/setter-helpers.d.ts +24 -0
  48. package/build-types/image-editor/core/setter-helpers.d.ts.map +1 -0
  49. package/build-types/image-editor/core/source-region.d.ts +75 -0
  50. package/build-types/image-editor/core/source-region.d.ts.map +1 -0
  51. package/build-types/image-editor/core/state.d.ts +54 -0
  52. package/build-types/image-editor/core/state.d.ts.map +1 -0
  53. package/build-types/image-editor/core/stencil-math.d.ts +97 -0
  54. package/build-types/image-editor/core/stencil-math.d.ts.map +1 -0
  55. package/build-types/image-editor/core/transform-style.d.ts +23 -0
  56. package/build-types/image-editor/core/transform-style.d.ts.map +1 -0
  57. package/build-types/image-editor/core/transforms/pipeline.d.ts +27 -0
  58. package/build-types/image-editor/core/transforms/pipeline.d.ts.map +1 -0
  59. package/build-types/image-editor/core/types.d.ts +255 -0
  60. package/build-types/image-editor/core/types.d.ts.map +1 -0
  61. package/build-types/image-editor/core/viewport-state.d.ts +7 -0
  62. package/build-types/image-editor/core/viewport-state.d.ts.map +1 -0
  63. package/build-types/image-editor/index.d.ts +16 -0
  64. package/build-types/image-editor/index.d.ts.map +1 -0
  65. package/build-types/image-editor/react/components/cropper-provider.d.ts +41 -0
  66. package/build-types/image-editor/react/components/cropper-provider.d.ts.map +1 -0
  67. package/build-types/image-editor/react/components/cropper.d.ts +62 -0
  68. package/build-types/image-editor/react/components/cropper.d.ts.map +1 -0
  69. package/build-types/image-editor/react/components/index.d.ts +4 -0
  70. package/build-types/image-editor/react/components/index.d.ts.map +1 -0
  71. package/build-types/image-editor/react/components/overlays/dimensions-overlay.d.ts +36 -0
  72. package/build-types/image-editor/react/components/overlays/dimensions-overlay.d.ts.map +1 -0
  73. package/build-types/image-editor/react/components/overlays/dimming-overlay.d.ts +20 -0
  74. package/build-types/image-editor/react/components/overlays/dimming-overlay.d.ts.map +1 -0
  75. package/build-types/image-editor/react/components/overlays/grid-overlay.d.ts +30 -0
  76. package/build-types/image-editor/react/components/overlays/grid-overlay.d.ts.map +1 -0
  77. package/build-types/image-editor/react/components/stencils/rectangle-stencil.d.ts +33 -0
  78. package/build-types/image-editor/react/components/stencils/rectangle-stencil.d.ts.map +1 -0
  79. package/build-types/image-editor/react/components/viewport-provider.d.ts +9 -0
  80. package/build-types/image-editor/react/components/viewport-provider.d.ts.map +1 -0
  81. package/build-types/image-editor/react/hooks/build-cropper-setters.d.ts +47 -0
  82. package/build-types/image-editor/react/hooks/build-cropper-setters.d.ts.map +1 -0
  83. package/build-types/image-editor/react/hooks/index.d.ts +5 -0
  84. package/build-types/image-editor/react/hooks/index.d.ts.map +1 -0
  85. package/build-types/image-editor/react/hooks/use-aria-announcer.d.ts +16 -0
  86. package/build-types/image-editor/react/hooks/use-aria-announcer.d.ts.map +1 -0
  87. package/build-types/image-editor/react/hooks/use-cropper-reducer.d.ts +58 -0
  88. package/build-types/image-editor/react/hooks/use-cropper-reducer.d.ts.map +1 -0
  89. package/build-types/image-editor/react/hooks/use-interaction.d.ts +63 -0
  90. package/build-types/image-editor/react/hooks/use-interaction.d.ts.map +1 -0
  91. package/build-types/image-editor/react/hooks/use-transform-style.d.ts +16 -0
  92. package/build-types/image-editor/react/hooks/use-transform-style.d.ts.map +1 -0
  93. package/build-types/image-editor/react/hooks/use-viewport-state.d.ts +19 -0
  94. package/build-types/image-editor/react/hooks/use-viewport-state.d.ts.map +1 -0
  95. package/build-types/image-editor/react/visually-hidden-style.d.ts +6 -0
  96. package/build-types/image-editor/react/visually-hidden-style.d.ts.map +1 -0
  97. package/build-types/image-editor/stories/rectangle-crop.story.d.ts +16 -0
  98. package/build-types/image-editor/stories/rectangle-crop.story.d.ts.map +1 -0
  99. package/build-types/lock-unlock.d.ts +2 -0
  100. package/build-types/lock-unlock.d.ts.map +1 -0
  101. package/build-types/private-apis.d.ts +2 -0
  102. package/build-types/private-apis.d.ts.map +1 -0
  103. package/build-types/state/composite-reducer.d.ts +39 -0
  104. package/build-types/state/composite-reducer.d.ts.map +1 -0
  105. package/build-types/state/index.d.ts +7 -0
  106. package/build-types/state/index.d.ts.map +1 -0
  107. package/build-types/state/media-editor-state-provider.d.ts +34 -0
  108. package/build-types/state/media-editor-state-provider.d.ts.map +1 -0
  109. package/build-types/state/types.d.ts +96 -0
  110. package/build-types/state/types.d.ts.map +1 -0
  111. package/build-types/state/use-media-editor-state.d.ts +101 -0
  112. package/build-types/state/use-media-editor-state.d.ts.map +1 -0
  113. package/build-types/store/actions.d.ts +29 -0
  114. package/build-types/store/actions.d.ts.map +1 -0
  115. package/build-types/store/constants.d.ts +2 -0
  116. package/build-types/store/constants.d.ts.map +1 -0
  117. package/build-types/store/index.d.ts +4 -0
  118. package/build-types/store/index.d.ts.map +1 -0
  119. package/build-types/store/reducer.d.ts +26 -0
  120. package/build-types/store/reducer.d.ts.map +1 -0
  121. package/build-types/store/selectors.d.ts +9 -0
  122. package/build-types/store/selectors.d.ts.map +1 -0
  123. package/package.json +6 -6
  124. package/tsconfig.tsbuildinfo +1 -1
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Internal dependencies
3
+ */
4
+ import type { ViewportState, ViewportAction } from './types';
5
+ export declare const DEFAULT_VIEWPORT_STATE: ViewportState;
6
+ export declare function viewportReducer(state: ViewportState, action: ViewportAction): ViewportState;
7
+ //# sourceMappingURL=viewport-state.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"viewport-state.d.ts","sourceRoot":"","sources":["../../../src/image-editor/core/viewport-state.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAE7D,eAAO,MAAM,sBAAsB,EAAE,aAGpC,CAAC;AAEF,wBAAgB,eAAe,CAC9B,KAAK,EAAE,aAAa,EACpB,MAAM,EAAE,cAAc,GACpB,aAAa,CAmBf"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Public image editor contract.
3
+ *
4
+ * Keep this barrel explicit so implementation details from `core/`,
5
+ * `react/hooks/`, or `react/components/` do not become supported API by
6
+ * accident. Internal modules may export additional helpers for local tests or
7
+ * React wiring; consumers should import through this file.
8
+ */
9
+ export { useCropperReducer, buildCropperSetters } from './react/hooks';
10
+ export { Cropper, CropperProvider, useCropper } from './react/components';
11
+ export type { CropperController, CropperSetters } from './react/hooks';
12
+ export type { CropperProps } from './react/components';
13
+ export type { CropperState, CropperAction, TransformOperation, NormalizedPoint, NormalizedRect, Size, Flip, StencilProps, HandlePosition, } from './core';
14
+ export { DEFAULT_STATE, DEFAULT_ASPECT_RATIOS, ORIGINAL_ASPECT_RATIO, cropperReducer, enforceContainment, areCropperStatesEqual, computeInscribedRect, getSourceRegion, getSourceRegionPercent, applyOperationToState, stateFromPipeline, exportCroppedImage, applyToCanvas, } from './core';
15
+ export type { AspectRatioPreset, SourceRegion, SourceRegionPercent, } from './core';
16
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/image-editor/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AACvE,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAC1E,YAAY,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AACvE,YAAY,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAGvD,YAAY,EACX,YAAY,EACZ,aAAa,EACb,kBAAkB,EAClB,eAAe,EACf,cAAc,EACd,IAAI,EACJ,IAAI,EACJ,YAAY,EACZ,cAAc,GACd,MAAM,QAAQ,CAAC;AAMhB,OAAO,EACN,aAAa,EACb,qBAAqB,EACrB,qBAAqB,EACrB,cAAc,EACd,kBAAkB,EAClB,qBAAqB,EACrB,oBAAoB,EACpB,eAAe,EACf,sBAAsB,EACtB,qBAAqB,EACrB,iBAAiB,EACjB,kBAAkB,EAClB,aAAa,GACb,MAAM,QAAQ,CAAC;AAChB,YAAY,EACX,iBAAiB,EACjB,YAAY,EACZ,mBAAmB,GACnB,MAAM,QAAQ,CAAC"}
@@ -0,0 +1,41 @@
1
+ /**
2
+ * Internal dependencies
3
+ */
4
+ import { type CropperController } from '../hooks/use-cropper-reducer';
5
+ import type { CropperState } from '../../core/types';
6
+ /**
7
+ * Props for the CropperProvider component.
8
+ */
9
+ interface CropperProviderProps {
10
+ /** Optional partial initial state to merge with defaults. */
11
+ initialState?: Partial<CropperState>;
12
+ /** Child components. */
13
+ children: React.ReactNode;
14
+ }
15
+ /**
16
+ * Convenience context provider that wraps `useCropperReducer`.
17
+ *
18
+ * Provides the pure cropper controller (state + setters, NO undo
19
+ * history) to all descendant components via React context.
20
+ *
21
+ * History is a higher-layer concern owned by composite stores
22
+ * (see `useMediaEditorState` in media-editor/state for the media
23
+ * editor's composite controller with undo/redo).
24
+ *
25
+ * @param props
26
+ * @param props.initialState
27
+ * @param props.children
28
+ * @return The provider element wrapping children.
29
+ */
30
+ export declare function CropperProvider({ initialState, children }: CropperProviderProps): import("react").JSX.Element;
31
+ /**
32
+ * Hook to consume the CropperProvider context.
33
+ *
34
+ * Must be used within a CropperProvider. Throws if used outside
35
+ * of the provider tree.
36
+ *
37
+ * @return The cropper controller.
38
+ */
39
+ export declare function useCropper(): CropperController;
40
+ export {};
41
+ //# sourceMappingURL=cropper-provider.d.ts.map
@@ -0,0 +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"}
@@ -0,0 +1,62 @@
1
+ /**
2
+ * External dependencies
3
+ */
4
+ /**
5
+ * Internal dependencies
6
+ */
7
+ import type { CropperState, StencilProps, Size } from '../../core/types';
8
+ import type { CropperController } from '../hooks/use-cropper-reducer';
9
+ /**
10
+ * Props for the Cropper component.
11
+ */
12
+ export interface CropperProps {
13
+ /** Image source URL. */
14
+ src: string;
15
+ /** The cropper controller from `useCropperReducer` or a composite store. */
16
+ controller: CropperController;
17
+ /** Stencil component for the crop area. Defaults to RectangleStencil. */
18
+ stencil?: React.ComponentType<StencilProps>;
19
+ /** Show the rule-of-thirds grid overlay, or only during interactions. */
20
+ showGrid?: boolean | 'interactive';
21
+ /** Whether external placement activity should keep the grid visible. */
22
+ isPlacementActive?: boolean;
23
+ /** Show the dimming overlay outside the crop area. */
24
+ showDimming?: boolean;
25
+ /** Show the live output dimensions tooltip during a resize. */
26
+ showDimensions?: boolean;
27
+ /** Minimum zoom level override. Defaults to the coverage-aware minimum. */
28
+ minZoom?: number;
29
+ /** Maximum zoom level. */
30
+ maxZoom?: number;
31
+ /** Fixed aspect ratio (width / height) in pixel space for the crop area. */
32
+ aspectRatio?: number;
33
+ /**
34
+ * Enable freeform crop mode with resizable handles.
35
+ * When false (default), the crop area is fixed and centered.
36
+ * When true, the crop area has resize handles and can be freely repositioned.
37
+ */
38
+ freeformCrop?: boolean;
39
+ /** Focus the crop area when the cropper mounts. */
40
+ focusOnMount?: boolean;
41
+ /** Callback fired when the image is loaded. */
42
+ onImageLoaded?: (size: Size) => void;
43
+ /**
44
+ * Callback fired on every state change. Fires at pointermove rate
45
+ * during drags, so keep the handler light — no heavy work, no
46
+ * expensive parent re-renders. For commit-style events (drag end,
47
+ * settled crop), use `onGestureEnd` instead.
48
+ *
49
+ * Useful for lightweight syncing with external tools, analytics,
50
+ * or AI agents. Receives the full state so consumers can derive
51
+ * whatever they need.
52
+ */
53
+ onStateChange?: (state: CropperState) => void;
54
+ /** Fires when a continuous gesture begins (pan drag, handle resize, pinch zoom). */
55
+ onGestureStart?: () => void;
56
+ /** Fires when a continuous gesture ends (pointerup, resize settle). */
57
+ onGestureEnd?: () => void;
58
+ /** Additional className for the container. */
59
+ className?: string;
60
+ }
61
+ export declare const Cropper: import("react").ForwardRefExoticComponent<CropperProps & import("react").RefAttributes<HTMLDivElement>>;
62
+ //# sourceMappingURL=cropper.d.ts.map
@@ -0,0 +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;AAmBtE;;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;AAiuBD,eAAO,MAAM,OAAO,yGAMnB,CAAC"}
@@ -0,0 +1,4 @@
1
+ export { Cropper } from './cropper';
2
+ export type { CropperProps } from './cropper';
3
+ export { CropperProvider, useCropper } from './cropper-provider';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/image-editor/react/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,YAAY,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC"}
@@ -0,0 +1,36 @@
1
+ /**
2
+ * Internal dependencies
3
+ */
4
+ import type { HandlePosition, NormalizedRect, Size } from '../../../core/types';
5
+ interface DimensionsOverlayProps {
6
+ /** Crop rectangle in normalized coordinates. */
7
+ cropRect: NormalizedRect;
8
+ /** Container element dimensions in pixels. */
9
+ containerSize: Size;
10
+ /** Rendered image dimensions in pixels within the container. */
11
+ imageSize: Size;
12
+ /** Currently-dragged handle, or null when no pointer drag is active. */
13
+ activeHandle: HandlePosition | null;
14
+ /** Output crop width in source pixels. */
15
+ outputWidth: number;
16
+ /** Output crop height in source pixels. */
17
+ outputHeight: number;
18
+ }
19
+ /**
20
+ * Tooltip that follows the active resize handle during a pointer drag,
21
+ * showing the current output dimensions of the crop in source pixels.
22
+ *
23
+ * Renders nothing outside of a pointer-driven resize, so keyboard
24
+ * arrow-key adjustments and pan/zoom gestures stay quiet.
25
+ *
26
+ * @param props
27
+ * @param props.cropRect
28
+ * @param props.containerSize
29
+ * @param props.imageSize
30
+ * @param props.activeHandle
31
+ * @param props.outputWidth
32
+ * @param props.outputHeight
33
+ */
34
+ export declare function DimensionsOverlay({ cropRect, containerSize, imageSize, activeHandle, outputWidth, outputHeight }: DimensionsOverlayProps): import("react").JSX.Element | null;
35
+ export {};
36
+ //# sourceMappingURL=dimensions-overlay.d.ts.map
@@ -0,0 +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"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Internal dependencies
3
+ */
4
+ import type { NormalizedRect, Size } from '../../../core/types';
5
+ /**
6
+ * Props for the DimmingOverlay component.
7
+ */
8
+ interface DimmingOverlayProps {
9
+ /** The crop rectangle in normalized coordinates. */
10
+ cropRect: NormalizedRect;
11
+ /** The container element dimensions in pixels. */
12
+ containerSize: Size;
13
+ /** The rendered image dimensions in pixels within the container. */
14
+ imageSize: Size;
15
+ /** CSS transition string, e.g. during settle animation. */
16
+ transition?: string;
17
+ }
18
+ export declare function DimmingOverlay({ cropRect, containerSize, imageSize, transition }: DimmingOverlayProps): import("react").JSX.Element | null;
19
+ export {};
20
+ //# sourceMappingURL=dimming-overlay.d.ts.map
@@ -0,0 +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,sCA8BrB"}
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Internal dependencies
3
+ */
4
+ import type { NormalizedRect, Size } from '../../../core/types';
5
+ /**
6
+ * Props for the GridOverlay component.
7
+ */
8
+ interface GridOverlayProps {
9
+ /** The crop rectangle in normalized coordinates. */
10
+ cropRect: NormalizedRect;
11
+ /** The container element dimensions in pixels. */
12
+ containerSize: Size;
13
+ /** The rendered image dimensions in pixels within the container. */
14
+ imageSize: Size;
15
+ }
16
+ /**
17
+ * Renders a rule-of-thirds grid inside the crop rectangle.
18
+ *
19
+ * Displays 2 horizontal and 2 vertical lines at 1/3 and 2/3
20
+ * positions within the crop area.
21
+ *
22
+ * @param props Component props.
23
+ * @param props.cropRect The crop rectangle in normalized coordinates.
24
+ * @param props.containerSize The container element dimensions in pixels.
25
+ * @param props.imageSize The rendered image dimensions in pixels.
26
+ * @return The grid overlay element.
27
+ */
28
+ export declare function GridOverlay({ cropRect, containerSize, imageSize }: GridOverlayProps): import("react").JSX.Element | null;
29
+ export {};
30
+ //# sourceMappingURL=grid-overlay.d.ts.map
@@ -0,0 +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"}
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Internal dependencies
3
+ */
4
+ import type { StencilProps } from '../../../core/types';
5
+ /**
6
+ * Props for the RectangleStencil component.
7
+ */
8
+ type RectangleStencilProps = StencilProps;
9
+ /**
10
+ * A rectangular crop stencil with resize handles.
11
+ *
12
+ * In freeform mode, handles resize the crop area. Clicks inside the
13
+ * crop pass through to the container for image panning. The crop
14
+ * auto-centers after resize via SETTLE_CROP.
15
+ *
16
+ * @param props Component props implementing StencilProps.
17
+ * @param props.cropRect The crop rectangle in normalized coordinates.
18
+ * @param props.containerSize The container element dimensions in pixels.
19
+ * @param props.imageSize The rendered image dimensions in pixels.
20
+ * @param props.onCropChange Callback fired when the crop rect changes.
21
+ * @param props.onResizeStart Callback fired when a resize drag starts.
22
+ * @param props.onResizeEnd Callback fired when a resize drag ends (mouseup).
23
+ * @param props.aspectRatio Optional fixed aspect ratio (width / height).
24
+ * @param props.freeformCrop Whether resize handles are shown.
25
+ * @param props.stencilTransition CSS transition string for settle animation.
26
+ * @param props.cropBounds Maximum crop rect bounds from camera (zoom/rotation-aware).
27
+ * @param props.onEscape Called when Escape is pressed on a resize handle.
28
+ * @param props.minCropSize Minimum crop rect dimension in normalized space, per axis.
29
+ * @return The rectangle stencil element.
30
+ */
31
+ export declare function RectangleStencil({ cropRect, containerSize, imageSize, onCropChange, onResizeStart, onResizeEnd, aspectRatio, freeformCrop, stencilTransition, cropBounds, onEscape, minCropSize }: RectangleStencilProps): import("react").JSX.Element | null;
32
+ export {};
33
+ //# sourceMappingURL=rectangle-stencil.d.ts.map
@@ -0,0 +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;AAkExE;;GAEG;AACH,KAAK,qBAAqB,GAAG,YAAY,CAAC;AAE1C;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,gBAAgB,CAAE,EACjC,QAAQ,EACR,aAAa,EACb,SAAS,EACT,YAAY,EACZ,aAAa,EACb,WAAW,EACX,WAAW,EACX,YAAoB,EACpB,iBAAiB,EACjB,UAAU,EACV,QAAQ,EACR,WAAW,EACX,EAAE,qBAAqB,sCAqavB"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Internal dependencies
3
+ */
4
+ import { type UseViewportStateReturn } from '../hooks/use-viewport-state';
5
+ export declare function ViewportProvider({ children }: {
6
+ children: React.ReactNode;
7
+ }): import("react").JSX.Element;
8
+ export declare function useViewport(): UseViewportStateReturn;
9
+ //# sourceMappingURL=viewport-provider.d.ts.map
@@ -0,0 +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"}
@@ -0,0 +1,47 @@
1
+ /**
2
+ * Internal dependencies
3
+ */
4
+ import type { CropperAction, CropperState, Flip, NormalizedPoint, NormalizedRect, TransformOperation } from '../../core/types';
5
+ /**
6
+ * The named cropper setters shared by every hook that drives the
7
+ * cropper reducer — the pure `useCropperReducer` and any composite
8
+ * store that delegates cropper actions (e.g. `useMediaEditorState`).
9
+ *
10
+ * `setImage` and `reset` are intentionally NOT included: each hook
11
+ * has additional bookkeeping for them (dirty-baseline, history clear)
12
+ * that doesn't fit a shared factory.
13
+ */
14
+ export interface CropperSetters {
15
+ setPan: (pan: NormalizedPoint) => void;
16
+ setZoom: (zoom: number) => void;
17
+ setZoomAtPoint: (zoom: number, pan: NormalizedPoint) => void;
18
+ setRotation: (rotation: number) => void;
19
+ setFlip: (flip: Flip) => void;
20
+ toggleFlip: (direction: 'horizontal' | 'vertical') => void;
21
+ snapRotate90: (direction: 1 | -1) => void;
22
+ setCropRect: (rect: NormalizedRect) => void;
23
+ settleCrop: () => void;
24
+ applyOperation: (op: TransformOperation) => void;
25
+ }
26
+ /**
27
+ * Build the named cropper setters from a dispatch function and a
28
+ * state getter. The two consuming hooks differ in how they dispatch:
29
+ *
30
+ * - `useCropperReducer` dispatches directly into its `useReducer`.
31
+ * - `useMediaEditorState` wraps cropper actions in a composite
32
+ * `CROPPER` envelope so the history machinery can record them.
33
+ *
34
+ * Both pass their own dispatch function and a getter that returns
35
+ * the current `CropperState`. The factory shape keeps the two hooks
36
+ * in lockstep — add a setter here once, both hooks get it.
37
+ *
38
+ * @param dispatchCropperAction Apply a `CropperAction` to the
39
+ * underlying reducer.
40
+ * @param getCropperState Return the current `CropperState`.
41
+ * Used by setters that need to read
42
+ * the latest state to compute their
43
+ * payload (focal-point zoom, flip toggle).
44
+ * @return The named cropper setters.
45
+ */
46
+ export declare function buildCropperSetters(dispatchCropperAction: (action: CropperAction) => void, getCropperState: () => CropperState): CropperSetters;
47
+ //# sourceMappingURL=build-cropper-setters.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"build-cropper-setters.d.ts","sourceRoot":"","sources":["../../../../src/image-editor/react/hooks/build-cropper-setters.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EACX,aAAa,EACb,YAAY,EACZ,IAAI,EACJ,eAAe,EACf,cAAc,EACd,kBAAkB,EAClB,MAAM,kBAAkB,CAAC;AAG1B;;;;;;;;GAQG;AACH,MAAM,WAAW,cAAc;IAC9B,MAAM,EAAE,CAAE,GAAG,EAAE,eAAe,KAAM,IAAI,CAAC;IACzC,OAAO,EAAE,CAAE,IAAI,EAAE,MAAM,KAAM,IAAI,CAAC;IAClC,cAAc,EAAE,CAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,eAAe,KAAM,IAAI,CAAC;IAC/D,WAAW,EAAE,CAAE,QAAQ,EAAE,MAAM,KAAM,IAAI,CAAC;IAC1C,OAAO,EAAE,CAAE,IAAI,EAAE,IAAI,KAAM,IAAI,CAAC;IAChC,UAAU,EAAE,CAAE,SAAS,EAAE,YAAY,GAAG,UAAU,KAAM,IAAI,CAAC;IAC7D,YAAY,EAAE,CAAE,SAAS,EAAE,CAAC,GAAG,CAAC,CAAC,KAAM,IAAI,CAAC;IAC5C,WAAW,EAAE,CAAE,IAAI,EAAE,cAAc,KAAM,IAAI,CAAC;IAC9C,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,cAAc,EAAE,CAAE,EAAE,EAAE,kBAAkB,KAAM,IAAI,CAAC;CACnD;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,mBAAmB,CAClC,qBAAqB,EAAE,CAAE,MAAM,EAAE,aAAa,KAAM,IAAI,EACxD,eAAe,EAAE,MAAM,YAAY,GACjC,cAAc,CA8ChB"}
@@ -0,0 +1,5 @@
1
+ export { useCropperReducer } from './use-cropper-reducer';
2
+ export type { CropperController } from './use-cropper-reducer';
3
+ export { buildCropperSetters } from './build-cropper-setters';
4
+ export type { CropperSetters } from './build-cropper-setters';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/image-editor/react/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,YAAY,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,YAAY,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Internal dependencies
3
+ */
4
+ import type { CropperState } from '../../core/types';
5
+ /**
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.
9
+ *
10
+ * Debouncing avoids flooding the live region during drag/pointermove bursts;
11
+ * deduping avoids re-announcing the same state.
12
+ *
13
+ * @param state The current cropper state to announce.
14
+ */
15
+ export declare function useAriaAnnouncer(state: CropperState): string;
16
+ //# sourceMappingURL=use-aria-announcer.d.ts.map
@@ -0,0 +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"}
@@ -0,0 +1,58 @@
1
+ /**
2
+ * Internal dependencies
3
+ */
4
+ import type { CropperState, NormalizedRect, Size } from '../../core/types';
5
+ import { type CropperSetters } from './build-cropper-setters';
6
+ /**
7
+ * The cropper controller surface — the contract the Cropper component
8
+ * and its interaction hooks consume.
9
+ *
10
+ * History (undo / redo / commitHistory) is intentionally NOT part of
11
+ * this interface. The cropper is a pure state machine; history is a
12
+ * higher-layer concern owned by a composite store
13
+ * (see media-editor/src/state).
14
+ */
15
+ export interface CropperController extends CropperSetters {
16
+ /** The current cropper state (read-only). */
17
+ state: CropperState;
18
+ /** Set the loaded image (natural size and src). */
19
+ setImage: (image: CropperState['image']) => void;
20
+ /** Reset the state. Optionally merge partial state overrides. */
21
+ reset: (resetState?: Partial<CropperState>) => void;
22
+ /** Whether the current state differs from the initial state. */
23
+ isDirty: boolean;
24
+ /**
25
+ * Export the cropped image as a Blob. Throws on failure — see
26
+ * `exportCroppedImage` for error semantics.
27
+ */
28
+ getCroppedImage: (mimeType?: string, quality?: number) => Promise<Blob>;
29
+ /**
30
+ * Report the current rendered image size to the controller. The
31
+ * Cropper component calls this on visualSize changes; composite
32
+ * controllers use it to compute aspect-ratio reshapes. The pure
33
+ * cropper hook ignores it (no-op).
34
+ */
35
+ setVisualSize: (size: Size) => void;
36
+ /**
37
+ * Adjust the cropRect in response to a viewport change (window
38
+ * resize, canvas resize). Behaves like `setCropRect` but, in
39
+ * composite controllers, does NOT record an undo entry — viewport
40
+ * reshapes aren't editor actions. The pure cropper hook aliases
41
+ * this to `setCropRect` (history is a composite concern).
42
+ */
43
+ adjustCropRectForViewport: (rect: NormalizedRect) => void;
44
+ }
45
+ /**
46
+ * Pure reducer hook for the image cropper.
47
+ *
48
+ * Wraps the framework-agnostic `cropperReducer` and exposes named
49
+ * setters (built from the shared `buildCropperSetters` factory).
50
+ * Does NOT manage undo/redo history — that responsibility belongs to
51
+ * the surrounding application (see `useMediaEditorState` for the
52
+ * composite store used by the media editor).
53
+ *
54
+ * @param initialState Optional partial state to merge with DEFAULT_STATE.
55
+ * @return The cropper controller — state, setters, and helpers.
56
+ */
57
+ export declare function useCropperReducer(initialState?: Partial<CropperState>): CropperController;
58
+ //# sourceMappingURL=use-cropper-reducer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-cropper-reducer.d.ts","sourceRoot":"","sources":["../../../../src/image-editor/react/hooks/use-cropper-reducer.ts"],"names":[],"mappings":"AAWA;;GAEG;AACH,OAAO,KAAK,EACX,YAAY,EAEZ,cAAc,EACd,IAAI,EACJ,MAAM,kBAAkB,CAAC;AAQ1B,OAAO,EAEN,KAAK,cAAc,EACnB,MAAM,yBAAyB,CAAC;AAEjC;;;;;;;;GAQG;AACH,MAAM,WAAW,iBAAkB,SAAQ,cAAc;IACxD,6CAA6C;IAC7C,KAAK,EAAE,YAAY,CAAC;IACpB,mDAAmD;IACnD,QAAQ,EAAE,CAAE,KAAK,EAAE,YAAY,CAAE,OAAO,CAAE,KAAM,IAAI,CAAC;IACrD,iEAAiE;IACjE,KAAK,EAAE,CAAE,UAAU,CAAC,EAAE,OAAO,CAAE,YAAY,CAAE,KAAM,IAAI,CAAC;IACxD,gEAAgE;IAChE,OAAO,EAAE,OAAO,CAAC;IACjB;;;OAGG;IACH,eAAe,EAAE,CAAE,QAAQ,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,KAAM,OAAO,CAAE,IAAI,CAAE,CAAC;IAC5E;;;;;OAKG;IACH,aAAa,EAAE,CAAE,IAAI,EAAE,IAAI,KAAM,IAAI,CAAC;IACtC;;;;;;OAMG;IACH,yBAAyB,EAAE,CAAE,IAAI,EAAE,cAAc,KAAM,IAAI,CAAC;CAC5D;AAaD;;;;;;;;;;;GAWG;AACH,wBAAgB,iBAAiB,CAChC,YAAY,CAAC,EAAE,OAAO,CAAE,YAAY,CAAE,GACpC,iBAAiB,CA0GnB"}
@@ -0,0 +1,63 @@
1
+ /**
2
+ * Internal dependencies
3
+ */
4
+ import type { CropperState, Size } from '../../core/types';
5
+ import { type CropperInteractionActions } from '../../core/interaction-controller';
6
+ /**
7
+ * The return type of the useInteraction hook.
8
+ */
9
+ export interface UseInteractionReturn {
10
+ /** Event handler props to spread on the container element. */
11
+ handlers: {
12
+ onPointerDown: (e: React.PointerEvent) => void;
13
+ onTouchStart: (e: React.TouchEvent) => void;
14
+ onKeyDown: (e: React.KeyboardEvent) => void;
15
+ };
16
+ /** Native wheel handler — must be registered with { passive: false }. */
17
+ onWheelNative: (e: WheelEvent) => void;
18
+ /** Whether a drag (pan) interaction is in progress. */
19
+ isDragging: boolean;
20
+ /** Whether a double-tap zoom animation is in progress. */
21
+ isZooming: boolean;
22
+ /** Whether the user is currently performing a placement interaction. */
23
+ isPlacementActive: boolean;
24
+ }
25
+ /**
26
+ * Options for the useInteraction hook.
27
+ */
28
+ export interface UseInteractionOptions {
29
+ /** Minimum zoom level. Defaults to MIN_ZOOM. */
30
+ minZoom?: number;
31
+ /** Maximum zoom level. Defaults to MAX_ZOOM. */
32
+ maxZoom?: number;
33
+ /** Zoom speed multiplier for wheel events. Defaults to 0.0025. */
34
+ zoomSpeed?: number;
35
+ /**
36
+ * Pan step size in normalized coords for keyboard events.
37
+ * Defaults to 0.01. Shift multiplies it by 10.
38
+ */
39
+ keyboardStep?: number;
40
+ /** Zoom level for double-tap zoom. Defaults to 2. */
41
+ doubleTapZoom?: number;
42
+ /** Fires when a continuous gesture begins (pan drag, pinch zoom). */
43
+ onGestureStart?: () => void;
44
+ /** Fires when a continuous gesture ends (pointer release). */
45
+ onGestureEnd?: () => void;
46
+ }
47
+ /**
48
+ * Mouse, touch, and keyboard event handling for pan, zoom,
49
+ * and crop manipulation.
50
+ *
51
+ * Returns event handler props to spread on the container element.
52
+ * Uses requestAnimationFrame for drag/pinch updates to avoid
53
+ * layout thrashing.
54
+ *
55
+ * @param state The current cropper state.
56
+ * @param actions Named state updates for cropper interactions.
57
+ * @param containerSize The container dimensions in pixels.
58
+ * @param imageSize The rendered image dimensions in pixels.
59
+ * @param options Optional configuration for zoom and keyboard behavior.
60
+ * @return Event handler props for the container element.
61
+ */
62
+ export declare function useInteraction(state: CropperState, actions: CropperInteractionActions, containerSize: Size, imageSize?: Size, options?: UseInteractionOptions): UseInteractionReturn;
63
+ //# sourceMappingURL=use-interaction.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-interaction.d.ts","sourceRoot":"","sources":["../../../../src/image-editor/react/hooks/use-interaction.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,EAEN,KAAK,yBAAyB,EAC9B,MAAM,mCAAmC,CAAC;AAE3C;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACpC,8DAA8D;IAC9D,QAAQ,EAAE;QACT,aAAa,EAAE,CAAE,CAAC,EAAE,KAAK,CAAC,YAAY,KAAM,IAAI,CAAC;QACjD,YAAY,EAAE,CAAE,CAAC,EAAE,KAAK,CAAC,UAAU,KAAM,IAAI,CAAC;QAC9C,SAAS,EAAE,CAAE,CAAC,EAAE,KAAK,CAAC,aAAa,KAAM,IAAI,CAAC;KAC9C,CAAC;IACF,yEAAyE;IACzE,aAAa,EAAE,CAAE,CAAC,EAAE,UAAU,KAAM,IAAI,CAAC;IACzC,uDAAuD;IACvD,UAAU,EAAE,OAAO,CAAC;IACpB,0DAA0D;IAC1D,SAAS,EAAE,OAAO,CAAC;IACnB,wEAAwE;IACxE,iBAAiB,EAAE,OAAO,CAAC;CAC3B;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACrC,gDAAgD;IAChD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,gDAAgD;IAChD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,kEAAkE;IAClE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,qDAAqD;IACrD,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,qEAAqE;IACrE,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;IAC5B,8DAA8D;IAC9D,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;CAC1B;AA6BD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,cAAc,CAC7B,KAAK,EAAE,YAAY,EACnB,OAAO,EAAE,yBAAyB,EAClC,aAAa,EAAE,IAAI,EACnB,SAAS,CAAC,EAAE,IAAI,EAChB,OAAO,CAAC,EAAE,qBAAqB,GAC7B,oBAAoB,CAmJtB"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Internal dependencies
3
+ */
4
+ import type { CropperState, Size } from '../../core/types';
5
+ /**
6
+ * React hook that computes a memoized CSS matrix() transform string
7
+ * from the cropper state.
8
+ *
9
+ * Delegates to the pure `computeTransformStyle` function in core.
10
+ *
11
+ * @param state The current cropper state.
12
+ * @param imageSize The rendered image dimensions in pixels.
13
+ * @return A CSS transform string.
14
+ */
15
+ export declare function useTransformStyle(state: CropperState, imageSize: Size): string;
16
+ //# sourceMappingURL=use-transform-style.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-transform-style.d.ts","sourceRoot":"","sources":["../../../../src/image-editor/react/hooks/use-transform-style.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAG3D;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAChC,KAAK,EAAE,YAAY,EACnB,SAAS,EAAE,IAAI,GACb,MAAM,CAKR"}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Internal dependencies
3
+ */
4
+ import type { ViewportState } from '../../core/types';
5
+ export interface UseViewportStateReturn {
6
+ viewport: ViewportState;
7
+ /**
8
+ * Unused in the current Cropper implementation — scaffolded for the
9
+ * upcoming navigator panel (viewport zoom slider).
10
+ */
11
+ setViewportZoom: (zoom: number) => void;
12
+ setViewportPan: (pan: {
13
+ x: number;
14
+ y: number;
15
+ }) => void;
16
+ resetViewport: () => void;
17
+ }
18
+ export declare function useViewportState(): UseViewportStateReturn;
19
+ //# sourceMappingURL=use-viewport-state.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-viewport-state.d.ts","sourceRoot":"","sources":["../../../../src/image-editor/react/hooks/use-viewport-state.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAMtD,MAAM,WAAW,sBAAsB;IACtC,QAAQ,EAAE,aAAa,CAAC;IACxB;;;OAGG;IACH,eAAe,EAAE,CAAE,IAAI,EAAE,MAAM,KAAM,IAAI,CAAC;IAC1C,cAAc,EAAE,CAAE,GAAG,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,KAAM,IAAI,CAAC;IAC1D,aAAa,EAAE,MAAM,IAAI,CAAC;CAC1B;AAED,wBAAgB,gBAAgB,IAAI,sBAAsB,CAsBzD"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * CSS style object that visually hides an element while keeping it accessible
3
+ * to screen readers.
4
+ */
5
+ export declare const VISUALLY_HIDDEN_STYLE: React.CSSProperties;
6
+ //# sourceMappingURL=visually-hidden-style.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"visually-hidden-style.d.ts","sourceRoot":"","sources":["../../../src/image-editor/react/visually-hidden-style.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,qBAAqB,EAAE,KAAK,CAAC,aAUzC,CAAC"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * External dependencies
3
+ */
4
+ import type { Meta, StoryObj } from '@storybook/react-vite';
5
+ /**
6
+ * Internal dependencies
7
+ */
8
+ import { Cropper } from '../react/components/cropper';
9
+ import './style.css';
10
+ declare const meta: Meta<typeof Cropper>;
11
+ export default meta;
12
+ type Story = StoryObj<typeof Cropper>;
13
+ export declare const Default: Story;
14
+ export declare const WithControls: Story;
15
+ export declare const Debug: Story;
16
+ //# sourceMappingURL=rectangle-crop.story.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rectangle-crop.story.d.ts","sourceRoot":"","sources":["../../../src/image-editor/stories/rectangle-crop.story.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAwB5D;;GAEG;AACH,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAuBtD,OAAO,aAAa,CAAC;AA6ErB,QAAA,MAAM,IAAI,EAAE,IAAI,CAAE,OAAO,OAAO,CAI/B,CAAC;eAEa,IAAI;AAEnB,KAAK,KAAK,GAAG,QAAQ,CAAE,OAAO,OAAO,CAAE,CAAC;AAsBxC,eAAO,MAAM,OAAO,EAAE,KAErB,CAAC;AA6WF,eAAO,MAAM,YAAY,EAAE,KAE1B,CAAC;AA+hBF,eAAO,MAAM,KAAK,EAAE,KAEnB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const lock: (object: unknown, privateData: unknown) => void, unlock: <T = any>(object: unknown) => T;
2
+ //# sourceMappingURL=lock-unlock.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lock-unlock.d.ts","sourceRoot":"","sources":["../src/lock-unlock.ts"],"names":[],"mappings":"AAKA,eAAO,MAAQ,IAAI,mDAAE,MAAM,iCAIzB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const privateApis: {};
2
+ //# sourceMappingURL=private-apis.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"private-apis.d.ts","sourceRoot":"","sources":["../src/private-apis.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,WAAW,IAAK,CAAC"}