@wordpress/media-editor 0.9.0 → 0.10.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/build/components/media-editor/index.cjs +34 -135
- package/build/components/media-editor/index.cjs.map +3 -3
- package/build/components/media-editor/use-crop-options.cjs +87 -0
- package/build/components/media-editor/use-crop-options.cjs.map +7 -0
- package/build/components/media-editor/use-save-media-editor.cjs +185 -0
- package/build/components/media-editor/use-save-media-editor.cjs.map +7 -0
- package/build/components/media-editor-canvas/index.cjs +32 -11
- package/build/components/media-editor-canvas/index.cjs.map +2 -2
- package/build/components/media-editor-crop-panel/index.cjs +66 -83
- package/build/components/media-editor-crop-panel/index.cjs.map +2 -2
- package/build/components/media-editor-modal/index.cjs +40 -11
- package/build/components/media-editor-modal/index.cjs.map +3 -3
- package/build/components/media-editor-toolbar/index.cjs +7 -3
- package/build/components/media-editor-toolbar/index.cjs.map +2 -2
- package/build/components/media-form/index.cjs +19 -1
- package/build/components/media-form/index.cjs.map +3 -3
- package/build/components/media-form/sidebar-datetime-view.cjs +53 -0
- package/build/components/media-form/sidebar-datetime-view.cjs.map +7 -0
- package/build/components/rotation-ruler/index.cjs +8 -2
- package/build/components/rotation-ruler/index.cjs.map +2 -2
- package/build/hooks/use-crop-gesture-handlers.cjs +41 -4
- package/build/hooks/use-crop-gesture-handlers.cjs.map +2 -2
- package/build/image-editor/core/camera.cjs +29 -11
- package/build/image-editor/core/camera.cjs.map +2 -2
- package/build/image-editor/core/constants.cjs +6 -0
- package/build/image-editor/core/constants.cjs.map +2 -2
- package/build/image-editor/core/containment.cjs +71 -34
- package/build/image-editor/core/containment.cjs.map +2 -2
- package/build/image-editor/core/crop-rect.cjs +48 -0
- package/build/image-editor/core/crop-rect.cjs.map +7 -0
- package/build/image-editor/core/index.cjs +12 -0
- package/build/image-editor/core/index.cjs.map +2 -2
- package/build/image-editor/core/interaction-controller.cjs.map +2 -2
- package/build/image-editor/core/math/sanitize.cjs +92 -0
- package/build/image-editor/core/math/sanitize.cjs.map +7 -0
- package/build/image-editor/core/setter-helpers.cjs +64 -0
- package/build/image-editor/core/setter-helpers.cjs.map +7 -0
- package/build/image-editor/core/source-region.cjs +16 -14
- package/build/image-editor/core/source-region.cjs.map +2 -2
- package/build/image-editor/core/state.cjs +20 -10
- package/build/image-editor/core/state.cjs.map +2 -2
- package/build/image-editor/core/stencil-math.cjs +31 -20
- package/build/image-editor/core/stencil-math.cjs.map +2 -2
- package/build/image-editor/core/transform-style.cjs +12 -6
- package/build/image-editor/core/transform-style.cjs.map +2 -2
- package/build/image-editor/core/types.cjs.map +1 -1
- package/build/image-editor/index.cjs +12 -2
- package/build/image-editor/index.cjs.map +2 -2
- package/build/image-editor/react/components/cropper-provider.cjs +2 -2
- package/build/image-editor/react/components/cropper-provider.cjs.map +2 -2
- package/build/image-editor/react/components/cropper.cjs +121 -48
- package/build/image-editor/react/components/cropper.cjs.map +2 -2
- package/build/image-editor/react/components/overlays/dimensions-overlay.cjs +172 -0
- package/build/image-editor/react/components/overlays/dimensions-overlay.cjs.map +7 -0
- package/build/image-editor/react/components/stencils/rectangle-stencil.cjs +20 -10
- package/build/image-editor/react/components/stencils/rectangle-stencil.cjs.map +2 -2
- package/build/image-editor/react/hooks/build-cropper-setters.cjs +71 -0
- package/build/image-editor/react/hooks/build-cropper-setters.cjs.map +7 -0
- package/build/image-editor/react/hooks/index.cjs +6 -3
- package/build/image-editor/react/hooks/index.cjs.map +2 -2
- package/build/image-editor/react/hooks/use-aria-announcer.cjs +3 -1
- package/build/image-editor/react/hooks/use-aria-announcer.cjs.map +2 -2
- package/build/image-editor/react/hooks/use-cropper-reducer.cjs +113 -0
- package/build/image-editor/react/hooks/use-cropper-reducer.cjs.map +7 -0
- package/build/image-editor/react/hooks/use-interaction.cjs +1 -1
- package/build/image-editor/react/hooks/use-interaction.cjs.map +2 -2
- package/build/state/composite-reducer.cjs +115 -0
- package/build/state/composite-reducer.cjs.map +7 -0
- package/build/state/index.cjs +48 -0
- package/build/state/index.cjs.map +7 -0
- package/build/state/media-editor-state-provider.cjs +58 -0
- package/build/state/media-editor-state-provider.cjs.map +7 -0
- package/build/state/types.cjs +34 -0
- package/build/state/types.cjs.map +7 -0
- package/build/state/use-media-editor-state.cjs +298 -0
- package/build/state/use-media-editor-state.cjs.map +7 -0
- package/build-module/components/media-editor/index.mjs +40 -140
- package/build-module/components/media-editor/index.mjs.map +2 -2
- package/build-module/components/media-editor/use-crop-options.mjs +61 -0
- package/build-module/components/media-editor/use-crop-options.mjs.map +7 -0
- package/build-module/components/media-editor/use-save-media-editor.mjs +151 -0
- package/build-module/components/media-editor/use-save-media-editor.mjs.map +7 -0
- package/build-module/components/media-editor-canvas/index.mjs +33 -12
- package/build-module/components/media-editor-canvas/index.mjs.map +2 -2
- package/build-module/components/media-editor-crop-panel/index.mjs +68 -83
- package/build-module/components/media-editor-crop-panel/index.mjs.map +2 -2
- package/build-module/components/media-editor-modal/index.mjs +40 -11
- package/build-module/components/media-editor-modal/index.mjs.map +2 -2
- package/build-module/components/media-editor-toolbar/index.mjs +7 -3
- package/build-module/components/media-editor-toolbar/index.mjs.map +2 -2
- package/build-module/components/media-form/index.mjs +9 -1
- package/build-module/components/media-form/index.mjs.map +2 -2
- package/build-module/components/media-form/sidebar-datetime-view.mjs +32 -0
- package/build-module/components/media-form/sidebar-datetime-view.mjs.map +7 -0
- package/build-module/components/rotation-ruler/index.mjs +8 -2
- package/build-module/components/rotation-ruler/index.mjs.map +2 -2
- package/build-module/hooks/use-crop-gesture-handlers.mjs +41 -4
- package/build-module/hooks/use-crop-gesture-handlers.mjs.map +2 -2
- package/build-module/image-editor/core/camera.mjs +34 -11
- package/build-module/image-editor/core/camera.mjs.map +2 -2
- package/build-module/image-editor/core/constants.mjs +4 -0
- package/build-module/image-editor/core/constants.mjs.map +2 -2
- package/build-module/image-editor/core/containment.mjs +75 -34
- package/build-module/image-editor/core/containment.mjs.map +2 -2
- package/build-module/image-editor/core/crop-rect.mjs +23 -0
- package/build-module/image-editor/core/crop-rect.mjs.map +7 -0
- package/build-module/image-editor/core/index.mjs +12 -0
- package/build-module/image-editor/core/index.mjs.map +2 -2
- package/build-module/image-editor/core/interaction-controller.mjs.map +2 -2
- package/build-module/image-editor/core/math/sanitize.mjs +63 -0
- package/build-module/image-editor/core/math/sanitize.mjs.map +7 -0
- package/build-module/image-editor/core/setter-helpers.mjs +39 -0
- package/build-module/image-editor/core/setter-helpers.mjs.map +7 -0
- package/build-module/image-editor/core/source-region.mjs +16 -14
- package/build-module/image-editor/core/source-region.mjs.map +2 -2
- package/build-module/image-editor/core/state.mjs +25 -11
- package/build-module/image-editor/core/state.mjs.map +2 -2
- package/build-module/image-editor/core/stencil-math.mjs +30 -19
- package/build-module/image-editor/core/stencil-math.mjs.map +2 -2
- package/build-module/image-editor/core/transform-style.mjs +12 -6
- package/build-module/image-editor/core/transform-style.mjs.map +2 -2
- package/build-module/image-editor/index.mjs +11 -2
- package/build-module/image-editor/index.mjs.map +2 -2
- package/build-module/image-editor/react/components/cropper-provider.mjs +3 -3
- package/build-module/image-editor/react/components/cropper-provider.mjs.map +2 -2
- package/build-module/image-editor/react/components/cropper.mjs +122 -49
- package/build-module/image-editor/react/components/cropper.mjs.map +2 -2
- package/build-module/image-editor/react/components/overlays/dimensions-overlay.mjs +147 -0
- package/build-module/image-editor/react/components/overlays/dimensions-overlay.mjs.map +7 -0
- package/build-module/image-editor/react/components/stencils/rectangle-stencil.mjs +20 -10
- package/build-module/image-editor/react/components/stencils/rectangle-stencil.mjs.map +2 -2
- package/build-module/image-editor/react/hooks/build-cropper-setters.mjs +46 -0
- package/build-module/image-editor/react/hooks/build-cropper-setters.mjs.map +7 -0
- package/build-module/image-editor/react/hooks/index.mjs +4 -2
- package/build-module/image-editor/react/hooks/index.mjs.map +2 -2
- package/build-module/image-editor/react/hooks/use-aria-announcer.mjs +3 -1
- package/build-module/image-editor/react/hooks/use-aria-announcer.mjs.map +2 -2
- package/build-module/image-editor/react/hooks/use-cropper-reducer.mjs +100 -0
- package/build-module/image-editor/react/hooks/use-cropper-reducer.mjs.map +7 -0
- package/build-module/image-editor/react/hooks/use-interaction.mjs +1 -1
- package/build-module/image-editor/react/hooks/use-interaction.mjs.map +2 -2
- package/build-module/state/composite-reducer.mjs +94 -0
- package/build-module/state/composite-reducer.mjs.map +7 -0
- package/build-module/state/index.mjs +26 -0
- package/build-module/state/index.mjs.map +7 -0
- package/build-module/state/media-editor-state-provider.mjs +34 -0
- package/build-module/state/media-editor-state-provider.mjs.map +7 -0
- package/build-module/state/types.mjs +9 -0
- package/build-module/state/types.mjs.map +7 -0
- package/build-module/state/use-media-editor-state.mjs +289 -0
- package/build-module/state/use-media-editor-state.mjs.map +7 -0
- package/build-style/style-rtl.css +46 -9
- package/build-style/style.css +46 -9
- package/build-types/components/media-editor/index.d.ts +4 -7
- package/build-types/components/media-editor/index.d.ts.map +1 -1
- package/build-types/components/media-editor/use-crop-options.d.ts +37 -0
- package/build-types/components/media-editor/use-crop-options.d.ts.map +1 -0
- package/build-types/components/media-editor/use-save-media-editor.d.ts +29 -0
- package/build-types/components/media-editor/use-save-media-editor.d.ts.map +1 -0
- package/build-types/components/media-editor-canvas/index.d.ts +5 -10
- package/build-types/components/media-editor-canvas/index.d.ts.map +1 -1
- package/build-types/components/media-editor-crop-panel/index.d.ts +4 -16
- package/build-types/components/media-editor-crop-panel/index.d.ts.map +1 -1
- package/build-types/components/media-editor-modal/index.d.ts.map +1 -1
- package/build-types/components/media-editor-toolbar/index.d.ts.map +1 -1
- package/build-types/components/media-form/index.d.ts.map +1 -1
- package/build-types/components/media-form/sidebar-datetime-view.d.ts +10 -0
- package/build-types/components/media-form/sidebar-datetime-view.d.ts.map +1 -0
- package/build-types/components/rotation-ruler/index.d.ts.map +1 -1
- package/build-types/hooks/use-crop-gesture-handlers.d.ts +13 -14
- package/build-types/hooks/use-crop-gesture-handlers.d.ts.map +1 -1
- package/build-types/image-editor/core/camera.d.ts.map +1 -1
- package/build-types/image-editor/core/constants.d.ts +18 -0
- package/build-types/image-editor/core/constants.d.ts.map +1 -1
- package/build-types/image-editor/core/containment.d.ts +10 -0
- package/build-types/image-editor/core/containment.d.ts.map +1 -1
- package/build-types/image-editor/core/crop-rect.d.ts +19 -0
- package/build-types/image-editor/core/crop-rect.d.ts.map +1 -0
- package/build-types/image-editor/core/index.d.ts +3 -1
- package/build-types/image-editor/core/index.d.ts.map +1 -1
- package/build-types/image-editor/core/interaction-controller.d.ts +5 -1
- package/build-types/image-editor/core/interaction-controller.d.ts.map +1 -1
- package/build-types/image-editor/core/math/sanitize.d.ts +70 -0
- package/build-types/image-editor/core/math/sanitize.d.ts.map +1 -0
- package/build-types/image-editor/core/setter-helpers.d.ts +24 -0
- package/build-types/image-editor/core/setter-helpers.d.ts.map +1 -0
- package/build-types/image-editor/core/source-region.d.ts.map +1 -1
- package/build-types/image-editor/core/state.d.ts +12 -0
- package/build-types/image-editor/core/state.d.ts.map +1 -1
- package/build-types/image-editor/core/stencil-math.d.ts +23 -18
- package/build-types/image-editor/core/stencil-math.d.ts.map +1 -1
- package/build-types/image-editor/core/transform-style.d.ts.map +1 -1
- package/build-types/image-editor/core/types.d.ts +23 -4
- package/build-types/image-editor/core/types.d.ts.map +1 -1
- package/build-types/image-editor/index.d.ts +4 -4
- package/build-types/image-editor/index.d.ts.map +1 -1
- package/build-types/image-editor/react/components/cropper-provider.d.ts +11 -7
- package/build-types/image-editor/react/components/cropper-provider.d.ts.map +1 -1
- package/build-types/image-editor/react/components/cropper.d.ts +6 -4
- 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 +36 -0
- package/build-types/image-editor/react/components/overlays/dimensions-overlay.d.ts.map +1 -0
- package/build-types/image-editor/react/components/stencils/rectangle-stencil.d.ts +2 -1
- package/build-types/image-editor/react/components/stencils/rectangle-stencil.d.ts.map +1 -1
- package/build-types/image-editor/react/hooks/build-cropper-setters.d.ts +47 -0
- package/build-types/image-editor/react/hooks/build-cropper-setters.d.ts.map +1 -0
- package/build-types/image-editor/react/hooks/index.d.ts +4 -2
- package/build-types/image-editor/react/hooks/index.d.ts.map +1 -1
- package/build-types/image-editor/react/hooks/use-aria-announcer.d.ts.map +1 -1
- package/build-types/image-editor/react/hooks/use-cropper-reducer.d.ts +58 -0
- package/build-types/image-editor/react/hooks/use-cropper-reducer.d.ts.map +1 -0
- package/build-types/image-editor/react/hooks/use-interaction.d.ts.map +1 -1
- package/build-types/image-editor/stories/rectangle-crop.story.d.ts.map +1 -1
- package/build-types/state/composite-reducer.d.ts +39 -0
- package/build-types/state/composite-reducer.d.ts.map +1 -0
- package/build-types/state/index.d.ts +7 -0
- package/build-types/state/index.d.ts.map +1 -0
- package/build-types/state/media-editor-state-provider.d.ts +34 -0
- package/build-types/state/media-editor-state-provider.d.ts.map +1 -0
- package/build-types/state/types.d.ts +104 -0
- package/build-types/state/types.d.ts.map +1 -0
- package/build-types/state/use-media-editor-state.d.ts +104 -0
- package/build-types/state/use-media-editor-state.d.ts.map +1 -0
- package/package.json +19 -17
- package/src/components/media-editor/index.tsx +52 -188
- package/src/components/media-editor/test/use-crop-options.tsx +164 -0
- package/src/components/media-editor/use-crop-options.ts +115 -0
- package/src/components/media-editor/use-save-media-editor.ts +214 -0
- package/src/components/media-editor-canvas/index.tsx +56 -24
- package/src/components/media-editor-crop-panel/index.tsx +25 -61
- package/src/components/media-editor-crop-panel/test/index.tsx +17 -43
- package/src/components/media-editor-modal/index.tsx +50 -12
- package/src/components/media-editor-modal/test/build-modifiers.test.ts +14 -0
- package/src/components/media-editor-modal/test/index.tsx +143 -0
- package/src/components/media-editor-toolbar/index.tsx +9 -5
- package/src/components/media-form/index.tsx +15 -1
- package/src/components/media-form/sidebar-datetime-view.tsx +47 -0
- package/src/components/media-form/test/sidebar-datetime-view.test.tsx +96 -0
- package/src/components/rotation-ruler/README.md +11 -25
- package/src/components/rotation-ruler/index.tsx +17 -2
- package/src/components/rotation-ruler/style.scss +49 -13
- package/src/hooks/use-crop-gesture-handlers.ts +66 -17
- package/src/image-editor/README.md +28 -129
- package/src/image-editor/core/camera.ts +51 -26
- package/src/image-editor/core/constants.ts +19 -0
- package/src/image-editor/core/containment.ts +102 -49
- package/src/image-editor/core/crop-rect.ts +45 -0
- package/src/image-editor/core/index.ts +16 -4
- package/src/image-editor/core/interaction-controller.ts +5 -1
- package/src/image-editor/core/math/sanitize.ts +158 -0
- package/src/image-editor/core/math/test/sanitize.ts +244 -0
- package/src/image-editor/core/setter-helpers.ts +66 -0
- package/src/image-editor/core/source-region.ts +21 -14
- package/src/image-editor/core/state.ts +67 -15
- package/src/image-editor/core/stencil-math.ts +55 -35
- package/src/image-editor/core/test/camera.ts +367 -1
- package/src/image-editor/core/test/state.ts +101 -8
- package/src/image-editor/core/test/stencil-math.ts +193 -0
- package/src/image-editor/core/transform-style.ts +21 -6
- package/src/image-editor/core/types.ts +24 -4
- package/src/image-editor/docs/architecture.md +48 -89
- package/src/image-editor/docs/recipes.md +123 -659
- package/src/image-editor/index.ts +12 -3
- package/src/image-editor/react/components/cropper-provider.tsx +16 -12
- package/src/image-editor/react/components/cropper.scss +23 -4
- package/src/image-editor/react/components/cropper.tsx +197 -90
- package/src/image-editor/react/components/overlays/dimensions-overlay.tsx +269 -0
- package/src/image-editor/react/components/stencils/rectangle-stencil.tsx +22 -9
- package/src/image-editor/react/components/test/cropper.tsx +55 -13
- package/src/image-editor/react/hooks/build-cropper-setters.ts +105 -0
- package/src/image-editor/react/hooks/index.ts +4 -2
- package/src/image-editor/react/hooks/test/{use-cropper-state.ts → use-cropper-reducer.ts} +142 -286
- package/src/image-editor/react/hooks/use-aria-announcer.ts +3 -1
- package/src/image-editor/react/hooks/use-cropper-reducer.ts +204 -0
- package/src/image-editor/react/hooks/use-interaction.ts +3 -2
- package/src/image-editor/stories/rectangle-crop.story.tsx +7 -17
- package/src/state/composite-reducer.ts +152 -0
- package/src/state/index.ts +20 -0
- package/src/state/media-editor-state-provider.tsx +70 -0
- package/src/state/test/use-media-editor-state.ts +402 -0
- package/src/state/types.ts +107 -0
- package/src/state/use-media-editor-state.ts +488 -0
- package/tsconfig.json +2 -0
- package/tsconfig.tsbuildinfo +1 -1
- package/build/image-editor/react/hooks/use-cropper-state.cjs +0 -277
- package/build/image-editor/react/hooks/use-cropper-state.cjs.map +0 -7
- package/build-module/image-editor/react/hooks/use-cropper-state.mjs +0 -262
- package/build-module/image-editor/react/hooks/use-cropper-state.mjs.map +0 -7
- package/build-types/image-editor/react/hooks/use-cropper-state.d.ts +0 -97
- package/build-types/image-editor/react/hooks/use-cropper-state.d.ts.map +0 -1
- package/src/image-editor/docs/roadmap.md +0 -66
- package/src/image-editor/react/hooks/use-cropper-state.ts +0 -457
|
@@ -205,6 +205,19 @@
|
|
|
205
205
|
height: 100%;
|
|
206
206
|
width: 1px;
|
|
207
207
|
}
|
|
208
|
+
.wp-media-editor-image-editor__dimensions-tooltip {
|
|
209
|
+
position: absolute;
|
|
210
|
+
padding: 2px 6px;
|
|
211
|
+
background: #fff;
|
|
212
|
+
color: #1e1e1e;
|
|
213
|
+
font-size: 11px;
|
|
214
|
+
line-height: 1.4;
|
|
215
|
+
font-variant-numeric: tabular-nums;
|
|
216
|
+
box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.08);
|
|
217
|
+
pointer-events: none;
|
|
218
|
+
white-space: nowrap;
|
|
219
|
+
z-index: 2;
|
|
220
|
+
}
|
|
208
221
|
.wp-media-editor-image-editor__stencil-rect {
|
|
209
222
|
position: absolute;
|
|
210
223
|
border: 1px solid rgba(255, 255, 255, 0.7);
|
|
@@ -212,7 +225,7 @@
|
|
|
212
225
|
pointer-events: none;
|
|
213
226
|
transition: border-color 0.15s ease, box-shadow 0.15s ease;
|
|
214
227
|
}
|
|
215
|
-
.wp-media-editor-image-editor__canvas--focus-visible .wp-media-editor-image-editor__stencil-rect {
|
|
228
|
+
.wp-media-editor-image-editor__canvas--focus-visible:focus .wp-media-editor-image-editor__stencil-rect {
|
|
216
229
|
border-color: var(--wp-image-editor-focus-color, var(--wp-admin-theme-color, #007cba));
|
|
217
230
|
box-shadow: 0 0 0 1px var(--wp-image-editor-focus-color, var(--wp-admin-theme-color, #007cba));
|
|
218
231
|
}
|
|
@@ -235,7 +248,7 @@
|
|
|
235
248
|
.wp-media-editor-image-editor__handle:focus {
|
|
236
249
|
outline: none;
|
|
237
250
|
}
|
|
238
|
-
.wp-media-editor-image-
|
|
251
|
+
.wp-media-editor-image-editor__canvas--focus-visible .wp-media-editor-image-editor__handle:focus {
|
|
239
252
|
background: var(--wp-image-editor-focus-color, var(--wp-admin-theme-color, #007cba));
|
|
240
253
|
border-color: transparent;
|
|
241
254
|
box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--wp-image-editor-focus-color, var(--wp-admin-theme-color, #007cba));
|
|
@@ -594,11 +607,10 @@
|
|
|
594
607
|
position: absolute;
|
|
595
608
|
bottom: 0;
|
|
596
609
|
right: 50%;
|
|
597
|
-
width:
|
|
598
|
-
height:
|
|
599
|
-
|
|
600
|
-
border-
|
|
601
|
-
border-bottom: 9px solid var(--wp-admin-theme-color, #3858e9);
|
|
610
|
+
width: 2px;
|
|
611
|
+
height: 18px;
|
|
612
|
+
background: var(--wp-admin-theme-color, #3858e9);
|
|
613
|
+
border-radius: 1px;
|
|
602
614
|
transform: translateX(50%);
|
|
603
615
|
pointer-events: none;
|
|
604
616
|
}
|
|
@@ -646,14 +658,39 @@
|
|
|
646
658
|
right: 50%;
|
|
647
659
|
height: 14px;
|
|
648
660
|
transform: translateX(50%);
|
|
649
|
-
padding: 0 12px;
|
|
650
661
|
font-size: 12px;
|
|
651
662
|
font-weight: 600;
|
|
652
663
|
line-height: 14px;
|
|
653
664
|
color: #1e1e1e;
|
|
654
|
-
background: linear-gradient(to left, transparent 0, #fff 12px, #fff calc(100% - 12px), transparent 100%);
|
|
655
665
|
pointer-events: none;
|
|
656
666
|
}
|
|
667
|
+
.rotation-ruler__active-label::before {
|
|
668
|
+
content: "";
|
|
669
|
+
position: absolute;
|
|
670
|
+
top: 0;
|
|
671
|
+
right: 50%;
|
|
672
|
+
width: 60px;
|
|
673
|
+
height: 100%;
|
|
674
|
+
transform: translateX(50%);
|
|
675
|
+
background: linear-gradient(to left, transparent 0, #fff 12px, #fff calc(100% - 12px), transparent 100%);
|
|
676
|
+
}
|
|
677
|
+
|
|
678
|
+
.rotation-ruler__active-label-number {
|
|
679
|
+
position: relative;
|
|
680
|
+
display: inline-block;
|
|
681
|
+
}
|
|
682
|
+
|
|
683
|
+
.rotation-ruler__active-label-sign {
|
|
684
|
+
position: absolute;
|
|
685
|
+
top: 0;
|
|
686
|
+
left: 100%;
|
|
687
|
+
}
|
|
688
|
+
|
|
689
|
+
.rotation-ruler__active-label-unit {
|
|
690
|
+
position: absolute;
|
|
691
|
+
top: 0;
|
|
692
|
+
right: 100%;
|
|
693
|
+
}
|
|
657
694
|
|
|
658
695
|
@container (max-width: 220px) {
|
|
659
696
|
.rotation-ruler__tick--minor {
|
package/build-style/style.css
CHANGED
|
@@ -205,6 +205,19 @@
|
|
|
205
205
|
height: 100%;
|
|
206
206
|
width: 1px;
|
|
207
207
|
}
|
|
208
|
+
.wp-media-editor-image-editor__dimensions-tooltip {
|
|
209
|
+
position: absolute;
|
|
210
|
+
padding: 2px 6px;
|
|
211
|
+
background: #fff;
|
|
212
|
+
color: #1e1e1e;
|
|
213
|
+
font-size: 11px;
|
|
214
|
+
line-height: 1.4;
|
|
215
|
+
font-variant-numeric: tabular-nums;
|
|
216
|
+
box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.08);
|
|
217
|
+
pointer-events: none;
|
|
218
|
+
white-space: nowrap;
|
|
219
|
+
z-index: 2;
|
|
220
|
+
}
|
|
208
221
|
.wp-media-editor-image-editor__stencil-rect {
|
|
209
222
|
position: absolute;
|
|
210
223
|
border: 1px solid rgba(255, 255, 255, 0.7);
|
|
@@ -212,7 +225,7 @@
|
|
|
212
225
|
pointer-events: none;
|
|
213
226
|
transition: border-color 0.15s ease, box-shadow 0.15s ease;
|
|
214
227
|
}
|
|
215
|
-
.wp-media-editor-image-editor__canvas--focus-visible .wp-media-editor-image-editor__stencil-rect {
|
|
228
|
+
.wp-media-editor-image-editor__canvas--focus-visible:focus .wp-media-editor-image-editor__stencil-rect {
|
|
216
229
|
border-color: var(--wp-image-editor-focus-color, var(--wp-admin-theme-color, #007cba));
|
|
217
230
|
box-shadow: 0 0 0 1px var(--wp-image-editor-focus-color, var(--wp-admin-theme-color, #007cba));
|
|
218
231
|
}
|
|
@@ -235,7 +248,7 @@
|
|
|
235
248
|
.wp-media-editor-image-editor__handle:focus {
|
|
236
249
|
outline: none;
|
|
237
250
|
}
|
|
238
|
-
.wp-media-editor-image-
|
|
251
|
+
.wp-media-editor-image-editor__canvas--focus-visible .wp-media-editor-image-editor__handle:focus {
|
|
239
252
|
background: var(--wp-image-editor-focus-color, var(--wp-admin-theme-color, #007cba));
|
|
240
253
|
border-color: transparent;
|
|
241
254
|
box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--wp-image-editor-focus-color, var(--wp-admin-theme-color, #007cba));
|
|
@@ -594,11 +607,10 @@
|
|
|
594
607
|
position: absolute;
|
|
595
608
|
bottom: 0;
|
|
596
609
|
left: 50%;
|
|
597
|
-
width:
|
|
598
|
-
height:
|
|
599
|
-
|
|
600
|
-
border-
|
|
601
|
-
border-bottom: 9px solid var(--wp-admin-theme-color, #3858e9);
|
|
610
|
+
width: 2px;
|
|
611
|
+
height: 18px;
|
|
612
|
+
background: var(--wp-admin-theme-color, #3858e9);
|
|
613
|
+
border-radius: 1px;
|
|
602
614
|
transform: translateX(-50%);
|
|
603
615
|
pointer-events: none;
|
|
604
616
|
}
|
|
@@ -646,14 +658,39 @@
|
|
|
646
658
|
left: 50%;
|
|
647
659
|
height: 14px;
|
|
648
660
|
transform: translateX(-50%);
|
|
649
|
-
padding: 0 12px;
|
|
650
661
|
font-size: 12px;
|
|
651
662
|
font-weight: 600;
|
|
652
663
|
line-height: 14px;
|
|
653
664
|
color: #1e1e1e;
|
|
654
|
-
background: linear-gradient(to right, transparent 0, #fff 12px, #fff calc(100% - 12px), transparent 100%);
|
|
655
665
|
pointer-events: none;
|
|
656
666
|
}
|
|
667
|
+
.rotation-ruler__active-label::before {
|
|
668
|
+
content: "";
|
|
669
|
+
position: absolute;
|
|
670
|
+
top: 0;
|
|
671
|
+
left: 50%;
|
|
672
|
+
width: 60px;
|
|
673
|
+
height: 100%;
|
|
674
|
+
transform: translateX(-50%);
|
|
675
|
+
background: linear-gradient(to right, transparent 0, #fff 12px, #fff calc(100% - 12px), transparent 100%);
|
|
676
|
+
}
|
|
677
|
+
|
|
678
|
+
.rotation-ruler__active-label-number {
|
|
679
|
+
position: relative;
|
|
680
|
+
display: inline-block;
|
|
681
|
+
}
|
|
682
|
+
|
|
683
|
+
.rotation-ruler__active-label-sign {
|
|
684
|
+
position: absolute;
|
|
685
|
+
top: 0;
|
|
686
|
+
right: 100%;
|
|
687
|
+
}
|
|
688
|
+
|
|
689
|
+
.rotation-ruler__active-label-unit {
|
|
690
|
+
position: absolute;
|
|
691
|
+
top: 0;
|
|
692
|
+
left: 100%;
|
|
693
|
+
}
|
|
657
694
|
|
|
658
695
|
@container (max-width: 220px) {
|
|
659
696
|
.rotation-ruler__tick--minor {
|
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
import type { Field } from '@wordpress/dataviews';
|
|
2
|
-
import type { KeyboardEvent as ReactKeyboardEvent, ReactNode } from 'react';
|
|
2
|
+
import type { JSX, KeyboardEvent as ReactKeyboardEvent, ReactNode } from 'react';
|
|
3
3
|
import type { Media } from '../media-editor-provider';
|
|
4
4
|
import type { AspectRatioPreset } from '../../image-editor/core/constants';
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
url?: string;
|
|
8
|
-
media: Media;
|
|
9
|
-
}
|
|
5
|
+
import { type MediaEditorSaveResult } from './use-save-media-editor';
|
|
6
|
+
export type { MediaEditorSaveResult } from './use-save-media-editor';
|
|
10
7
|
export interface MediaEditorFrameProps {
|
|
11
8
|
children: ReactNode;
|
|
12
9
|
headerActions: ReactNode;
|
|
@@ -29,6 +26,6 @@ export interface MediaEditorProps {
|
|
|
29
26
|
showCloseButton?: boolean;
|
|
30
27
|
shouldCloseOnEsc?: boolean;
|
|
31
28
|
}
|
|
32
|
-
export declare function MediaEditor(props: MediaEditorProps):
|
|
29
|
+
export declare function MediaEditor(props: MediaEditorProps): JSX.Element;
|
|
33
30
|
export default MediaEditor;
|
|
34
31
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/media-editor/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/media-editor/index.tsx"],"names":[],"mappings":"AA0BA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAQlD,OAAO,KAAK,EACX,GAAG,EACH,aAAa,IAAI,kBAAkB,EACnC,SAAS,EACT,MAAM,OAAO,CAAC;AAMf,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAC;AAStD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAG3E,OAAO,EAGN,KAAK,qBAAqB,EAC1B,MAAM,yBAAyB,CAAC;AAGjC,YAAY,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAiBrE,MAAM,WAAW,qBAAqB;IACrC,QAAQ,EAAE,SAAS,CAAC;IACpB,aAAa,EAAE,SAAS,CAAC;IACzB,cAAc,EAAE,MAAM,IAAI,CAAC;IAC3B,SAAS,EAAE,CAAE,KAAK,EAAE,kBAAkB,CAAE,WAAW,CAAE,KAAM,IAAI,CAAC;IAChE,yBAAyB,EAAE,OAAO,CAAC;IACnC,QAAQ,EAAE,OAAO,CAAC;IAClB,UAAU,EAAE,OAAO,CAAC;IACpB,QAAQ,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,gBAAgB;IAChC,MAAM,CAAC,EAAE,KAAK,CAAE,KAAK,CAAE,EAAE,CAAC;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,kBAAkB,CAAC,EAAE,iBAAiB,EAAE,CAAC;IACzC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,OAAO,CAAC,EAAE,CAAE,MAAM,EAAE,qBAAqB,KAAM,IAAI,CAAC;IACpD,WAAW,EAAE,CAAE,KAAK,EAAE,qBAAqB,KAAM,GAAG,CAAC,OAAO,CAAC;IAC7D,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,oBAAoB,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IACtC,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC3B;AA8cD,wBAAgB,WAAW,CAAE,KAAK,EAAE,gBAAgB,eAMnD;eAEc,WAAW"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { AspectRatioPreset } from '../../image-editor/core/constants';
|
|
2
|
+
interface UseCropOptionsArgs {
|
|
3
|
+
aspectRatioPresets?: AspectRatioPreset[];
|
|
4
|
+
}
|
|
5
|
+
interface UseCropOptionsReturn {
|
|
6
|
+
aspectRatioValue: string;
|
|
7
|
+
setAspectRatioValue: (value: string) => void;
|
|
8
|
+
aspectRatioOptions: AspectRatioPreset[];
|
|
9
|
+
freeformCrop: boolean;
|
|
10
|
+
setFreeformCrop: (value: boolean) => void;
|
|
11
|
+
resolvedAspectRatio: number | undefined;
|
|
12
|
+
resetCropOptions: () => void;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Build the preset list shown in the dropdown — always include the
|
|
16
|
+
* non-numeric presets (Free, Original) and append either the
|
|
17
|
+
* caller-supplied set or the defaults.
|
|
18
|
+
*
|
|
19
|
+
* @param aspectRatioPresets Optional caller-supplied presets.
|
|
20
|
+
* @return The full preset list to render.
|
|
21
|
+
*/
|
|
22
|
+
export declare function getAspectRatioOptions(aspectRatioPresets?: AspectRatioPreset[]): AspectRatioPreset[];
|
|
23
|
+
/**
|
|
24
|
+
* Thin selector over the composite media-editor store for the Crop
|
|
25
|
+
* sidebar tab. Reads the cropOptions slice (preset key, freeform) and
|
|
26
|
+
* exposes the corresponding setters plus a render-time
|
|
27
|
+
* `resolvedAspectRatio` derivation.
|
|
28
|
+
*
|
|
29
|
+
* No local React state, no refs, no synchronization effects — the
|
|
30
|
+
* composite store is the single source of truth.
|
|
31
|
+
*
|
|
32
|
+
* @param args
|
|
33
|
+
* @param args.aspectRatioPresets Optional caller-supplied aspect-ratio presets.
|
|
34
|
+
*/
|
|
35
|
+
export declare function useCropOptions({ aspectRatioPresets }?: UseCropOptionsArgs): UseCropOptionsReturn;
|
|
36
|
+
export {};
|
|
37
|
+
//# sourceMappingURL=use-crop-options.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-crop-options.d.ts","sourceRoot":"","sources":["../../../src/components/media-editor/use-crop-options.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAM3E,UAAU,kBAAkB;IAC3B,kBAAkB,CAAC,EAAE,iBAAiB,EAAE,CAAC;CACzC;AAED,UAAU,oBAAoB;IAC7B,gBAAgB,EAAE,MAAM,CAAC;IACzB,mBAAmB,EAAE,CAAE,KAAK,EAAE,MAAM,KAAM,IAAI,CAAC;IAC/C,kBAAkB,EAAE,iBAAiB,EAAE,CAAC;IACxC,YAAY,EAAE,OAAO,CAAC;IACtB,eAAe,EAAE,CAAE,KAAK,EAAE,OAAO,KAAM,IAAI,CAAC;IAC5C,mBAAmB,EAAE,MAAM,GAAG,SAAS,CAAC;IACxC,gBAAgB,EAAE,MAAM,IAAI,CAAC;CAC7B;AAED;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CACpC,kBAAkB,CAAC,EAAE,iBAAiB,EAAE,GACtC,iBAAiB,EAAE,CAMrB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,cAAc,CAAE,EAC/B,kBAAkB,EAClB,GAAE,kBAAuB,GAAI,oBAAoB,CAqDjD"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internal dependencies
|
|
3
|
+
*/
|
|
4
|
+
import type { Media } from '../media-editor-provider';
|
|
5
|
+
import type { MediaEditorController } from '../../state';
|
|
6
|
+
export declare const MEDIA_EDITOR_NOTICES_CONTEXT = "media-editor";
|
|
7
|
+
export interface MediaEditorSaveResult {
|
|
8
|
+
id: number;
|
|
9
|
+
url?: string;
|
|
10
|
+
media: Media;
|
|
11
|
+
previous?: {
|
|
12
|
+
id: number;
|
|
13
|
+
url?: string;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
interface UseSaveMediaEditorArgs {
|
|
17
|
+
cropper: MediaEditorController;
|
|
18
|
+
id: number;
|
|
19
|
+
isImage: boolean;
|
|
20
|
+
media?: Media | null;
|
|
21
|
+
onSaved?: (result: MediaEditorSaveResult) => void;
|
|
22
|
+
}
|
|
23
|
+
interface UseSaveMediaEditorReturn {
|
|
24
|
+
isSaving: boolean;
|
|
25
|
+
save: () => Promise<void>;
|
|
26
|
+
}
|
|
27
|
+
export declare function useSaveMediaEditor({ cropper, id, isImage, media, onSaved }: UseSaveMediaEditorArgs): UseSaveMediaEditorReturn;
|
|
28
|
+
export {};
|
|
29
|
+
//# sourceMappingURL=use-save-media-editor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-save-media-editor.d.ts","sourceRoot":"","sources":["../../../src/components/media-editor/use-save-media-editor.ts"],"names":[],"mappings":"AAUA;;GAEG;AACH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAiBzD,eAAO,MAAM,4BAA4B,iBAAiB,CAAC;AAI3D,MAAM,WAAW,qBAAqB;IACrC,EAAE,EAAE,MAAM,CAAC;IACX,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,KAAK,CAAC;IACb,QAAQ,CAAC,EAAE;QACV,EAAE,EAAE,MAAM,CAAC;QACX,GAAG,CAAC,EAAE,MAAM,CAAC;KACb,CAAC;CACF;AAED,UAAU,sBAAsB;IAC/B,OAAO,EAAE,qBAAqB,CAAC;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,KAAK,GAAG,IAAI,CAAC;IACrB,OAAO,CAAC,EAAE,CAAE,MAAM,EAAE,qBAAqB,KAAM,IAAI,CAAC;CACpD;AAED,UAAU,wBAAwB;IACjC,QAAQ,EAAE,OAAO,CAAC;IAClB,IAAI,EAAE,MAAM,OAAO,CAAE,IAAI,CAAE,CAAC;CAC5B;AAgCD,wBAAgB,kBAAkB,CAAE,EACnC,OAAO,EACP,EAAE,EACF,OAAO,EACP,KAAK,EACL,OAAO,EACP,EAAE,sBAAsB,GAAI,wBAAwB,CAuHpD"}
|
|
@@ -1,8 +1,4 @@
|
|
|
1
1
|
export interface MediaEditorCanvasProps {
|
|
2
|
-
/** Fixed aspect ratio (width / height). `undefined` means free. */
|
|
3
|
-
aspectRatio?: number;
|
|
4
|
-
/** Enable freeform crop mode (resize handles). */
|
|
5
|
-
freeformCrop?: boolean;
|
|
6
2
|
/** Focus the crop area when the canvas mounts. */
|
|
7
3
|
focusOnMount?: boolean;
|
|
8
4
|
/** Whether external placement activity should reveal the grid. */
|
|
@@ -13,19 +9,18 @@ export interface MediaEditorCanvasProps {
|
|
|
13
9
|
onGestureEnd?: () => void;
|
|
14
10
|
}
|
|
15
11
|
/**
|
|
16
|
-
* Editing surface for image media in the media editor modal. Pulls
|
|
17
|
-
* cropper controller from the surrounding `<
|
|
18
|
-
* bottom bar and Crop sidebar tab share the same state.
|
|
12
|
+
* Editing surface for image media in the media editor modal. Pulls
|
|
13
|
+
* its cropper controller from the surrounding `<MediaEditorStateProvider>`
|
|
14
|
+
* so the bottom bar and Crop sidebar tab share the same state.
|
|
19
15
|
*
|
|
20
16
|
* Returns `null` for missing or non-image media so the modal's outer
|
|
21
17
|
* guards can render a spinner or fall through to `<MediaPreview>`.
|
|
18
|
+
*
|
|
22
19
|
* @param props
|
|
23
|
-
* @param props.aspectRatio
|
|
24
|
-
* @param props.freeformCrop
|
|
25
20
|
* @param props.focusOnMount
|
|
26
21
|
* @param props.isPlacementActive
|
|
27
22
|
* @param props.onGestureStart
|
|
28
23
|
* @param props.onGestureEnd
|
|
29
24
|
*/
|
|
30
|
-
export default function MediaEditorCanvas({
|
|
25
|
+
export default function MediaEditorCanvas({ focusOnMount, isPlacementActive, onGestureStart, onGestureEnd }: MediaEditorCanvasProps): import("react").JSX.Element | null;
|
|
31
26
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/media-editor-canvas/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/media-editor-canvas/index.tsx"],"names":[],"mappings":"AAaA,MAAM,WAAW,sBAAsB;IACtC,kDAAkD;IAClD,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,kEAAkE;IAClE,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,kDAAkD;IAClD,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;IAC5B,gDAAgD;IAChD,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;CAC1B;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,OAAO,UAAU,iBAAiB,CAAE,EAC1C,YAAY,EACZ,iBAAyB,EACzB,cAAc,EACd,YAAY,EACZ,EAAE,sBAAsB,sCAoExB"}
|
|
@@ -14,21 +14,9 @@ export interface MediaEditorCropPanelProps {
|
|
|
14
14
|
onFreeformChange: (value: boolean) => void;
|
|
15
15
|
/** Signal that a placement-oriented control is being adjusted. */
|
|
16
16
|
onPlacementControlInteraction?: () => void;
|
|
17
|
-
/**
|
|
18
|
-
|
|
19
|
-
* omitted, the media editor's default fixed-ratio presets are used.
|
|
20
|
-
*/
|
|
21
|
-
aspectRatioPresets?: AspectRatioPreset[];
|
|
17
|
+
/** Aspect-ratio presets to display in the selector. */
|
|
18
|
+
aspectRatioOptions: AspectRatioPreset[];
|
|
22
19
|
}
|
|
23
|
-
/**
|
|
24
|
-
* Resolve an aspect-ratio preset value into a number suitable for
|
|
25
|
-
* `<Cropper aspectRatio=...>`. Returns `undefined` for Free (no lock).
|
|
26
|
-
*
|
|
27
|
-
* @param value Preset value as a string.
|
|
28
|
-
* @param imageAspectRatio Image's natural width / height — used for
|
|
29
|
-
* the Original preset.
|
|
30
|
-
*/
|
|
31
|
-
export declare function resolveAspectRatio(value: string, imageAspectRatio: number | null): number | undefined;
|
|
32
20
|
/**
|
|
33
21
|
* Sidebar panel for crop-shape controls — aspect-ratio presets and
|
|
34
22
|
* freeform toggle. The tactile verbs (rotate, flip) live in the
|
|
@@ -39,7 +27,7 @@ export declare function resolveAspectRatio(value: string, imageAspectRatio: numb
|
|
|
39
27
|
* @param props.freeformCrop
|
|
40
28
|
* @param props.onFreeformChange
|
|
41
29
|
* @param props.onPlacementControlInteraction
|
|
42
|
-
* @param props.
|
|
30
|
+
* @param props.aspectRatioOptions
|
|
43
31
|
*/
|
|
44
|
-
export default function MediaEditorCropPanel({ aspectRatioValue, onAspectRatioChange, freeformCrop, onFreeformChange, onPlacementControlInteraction,
|
|
32
|
+
export default function MediaEditorCropPanel({ aspectRatioValue, onAspectRatioChange, freeformCrop, onFreeformChange, onPlacementControlInteraction, aspectRatioOptions }: MediaEditorCropPanelProps): import("react").JSX.Element;
|
|
45
33
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/media-editor-crop-panel/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/media-editor-crop-panel/index.tsx"],"names":[],"mappings":"AAqBA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAE3E,MAAM,WAAW,yBAAyB;IACzC;;;;OAIG;IACH,gBAAgB,EAAE,MAAM,CAAC;IACzB,gDAAgD;IAChD,mBAAmB,EAAE,CAAE,KAAK,EAAE,MAAM,KAAM,IAAI,CAAC;IAC/C,+DAA+D;IAC/D,YAAY,EAAE,OAAO,CAAC;IACtB,gCAAgC;IAChC,gBAAgB,EAAE,CAAE,KAAK,EAAE,OAAO,KAAM,IAAI,CAAC;IAC7C,kEAAkE;IAClE,6BAA6B,CAAC,EAAE,MAAM,IAAI,CAAC;IAC3C,uDAAuD;IACvD,kBAAkB,EAAE,iBAAiB,EAAE,CAAC;CACxC;AAED;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,OAAO,UAAU,oBAAoB,CAAE,EAC7C,gBAAgB,EAChB,mBAAmB,EACnB,YAAY,EACZ,gBAAgB,EAChB,6BAA6B,EAC7B,kBAAkB,EAClB,EAAE,yBAAyB,+BAyD3B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/media-editor-modal/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/media-editor-modal/index.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAOlD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAC;AAGtD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAE3E,UAAU,qBAAqB;IAC9B;;;;;OAKG;IACH,MAAM,CAAC,EAAE,KAAK,CAAE,KAAK,CAAE,EAAE,CAAC;IAC1B;;;OAGG;IACH,kBAAkB,CAAC,EAAE,iBAAiB,EAAE,CAAC;CACzC;AAED,wBAAgB,gBAAgB,CAAE,EACjC,MAAW,EACX,kBAAkB,EAClB,EAAE,qBAAqB,sCAgGvB;eAEc,gBAAgB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/media-editor-toolbar/index.tsx"],"names":[],"mappings":"AAwBA,MAAM,WAAW,uBAAuB;IACvC;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,kEAAkE;IAClE,6BAA6B,CAAC,EAAE,MAAM,IAAI,CAAC;IAC3C,wEAAwE;IACxE,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED;;;;;;;;;GASG;AACH,MAAM,CAAC,OAAO,UAAU,kBAAkB,CAAE,EAC3C,OAAO,EACP,6BAA6B,EAC7B,kBAA0B,EAC1B,EAAE,uBAAuB,+
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/media-editor-toolbar/index.tsx"],"names":[],"mappings":"AAwBA,MAAM,WAAW,uBAAuB;IACvC;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,kEAAkE;IAClE,6BAA6B,CAAC,EAAE,MAAM,IAAI,CAAC;IAC3C,wEAAwE;IACxE,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED;;;;;;;;;GASG;AACH,MAAM,CAAC,OAAO,UAAU,kBAAkB,CAAE,EAC3C,OAAO,EACP,6BAA6B,EAC7B,kBAA0B,EAC1B,EAAE,uBAAuB,+BAiKzB"}
|
|
@@ -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;
|
|
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;AAKxD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AASvC;;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,+BAiEhB"}
|
|
@@ -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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/rotation-ruler/index.tsx"],"names":[],"mappings":"AAgBA,MAAM,WAAW,kBAAkB;IAClC,qBAAqB;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,iDAAiD;IACjD,QAAQ,EAAE,CAAE,KAAK,EAAE,MAAM,KAAM,IAAI,CAAC;IACpC,8CAA8C;IAC9C,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,6CAA6C;IAC7C,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,6CAA6C;IAC7C,KAAK,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,2DAA2D;IAC3D,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,4CAA4C;IAC5C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,oCAAoC;IACpC,QAAQ,CAAC,EAAE,OAAO,CAAC;CACnB;AAqDD;;;;;;;;;GASG;AACH,MAAM,CAAC,OAAO,UAAU,aAAa,CAAE,KAAK,EAAE,kBAAkB,+
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/rotation-ruler/index.tsx"],"names":[],"mappings":"AAgBA,MAAM,WAAW,kBAAkB;IAClC,qBAAqB;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,iDAAiD;IACjD,QAAQ,EAAE,CAAE,KAAK,EAAE,MAAM,KAAM,IAAI,CAAC;IACpC,8CAA8C;IAC9C,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,6CAA6C;IAC7C,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,6CAA6C;IAC7C,KAAK,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,2DAA2D;IAC3D,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,4CAA4C;IAC5C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,oCAAoC;IACpC,QAAQ,CAAC,EAAE,OAAO,CAAC;CACnB;AAqDD;;;;;;;;;GASG;AACH,MAAM,CAAC,OAAO,UAAU,aAAa,CAAE,KAAK,EAAE,kBAAkB,+BAwK/D"}
|
|
@@ -7,24 +7,20 @@
|
|
|
7
7
|
export declare const CROP_CONTROL_ATTR = "data-crop-control";
|
|
8
8
|
export interface UseCropGestureHandlersOptions {
|
|
9
9
|
/**
|
|
10
|
-
* When `true` (default), key-up
|
|
11
|
-
*
|
|
10
|
+
* When `true` (default), key-up closes the gesture so each
|
|
11
|
+
* discrete keypress becomes its own undo step. Set to `false` for
|
|
12
12
|
* continuous-input controls (e.g. the rotation ruler) where rapid
|
|
13
|
-
* keypresses should coalesce into a single history entry
|
|
14
|
-
*
|
|
13
|
+
* keypresses should coalesce into a single history entry across
|
|
14
|
+
* the whole gesture.
|
|
15
15
|
*/
|
|
16
16
|
commitOnKeyUp?: boolean;
|
|
17
17
|
}
|
|
18
18
|
/**
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
* so the modal's Cmd+Z handler can identify it, and wires
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
* expire.
|
|
25
|
-
*
|
|
26
|
-
* The history entry itself is recorded by the state-change debounce in
|
|
27
|
-
* `useCropperState` — no explicit gesture-start signal is needed.
|
|
19
|
+
* Event handler props to spread onto a wrapper element around a crop
|
|
20
|
+
* control. Marks the wrapper as a crop control (via `data-crop-control`)
|
|
21
|
+
* so the modal's Cmd+Z handler can identify it, and wires gesture
|
|
22
|
+
* boundaries on the composite store so a slider drag becomes a single
|
|
23
|
+
* undo entry rather than one per tick.
|
|
28
24
|
*
|
|
29
25
|
* Usage:
|
|
30
26
|
* const gestureHandlers = useCropGestureHandlers();
|
|
@@ -36,7 +32,10 @@ export interface UseCropGestureHandlersOptions {
|
|
|
36
32
|
*/
|
|
37
33
|
export declare function useCropGestureHandlers(options?: UseCropGestureHandlersOptions): {
|
|
38
34
|
"data-crop-control": boolean;
|
|
35
|
+
onPointerDownCapture: () => void;
|
|
39
36
|
onPointerUp: () => void;
|
|
40
|
-
|
|
37
|
+
onPointerCancel: () => void;
|
|
38
|
+
onKeyDownCapture: () => void;
|
|
39
|
+
onKeyUp: () => void;
|
|
41
40
|
};
|
|
42
41
|
//# sourceMappingURL=use-crop-gesture-handlers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-crop-gesture-handlers.d.ts","sourceRoot":"","sources":["../../src/hooks/use-crop-gesture-handlers.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"use-crop-gesture-handlers.d.ts","sourceRoot":"","sources":["../../src/hooks/use-crop-gesture-handlers.ts"],"names":[],"mappings":"AAUA;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,sBAAsB,CAAC;AAKrD,MAAM,WAAW,6BAA6B;IAC7C;;;;;;OAMG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;CACxB;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,sBAAsB,CACrC,OAAO,GAAE,6BAAkC;;;;;;;EAsD3C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"camera.d.ts","sourceRoot":"","sources":["../../../src/image-editor/core/camera.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"camera.d.ts","sourceRoot":"","sources":["../../../src/image-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EAAE,YAAY,EACnB,SAAS,EAAE,IAAI,EACf,UAAU,EAAE,IAAI,GACd,MAAM,CA2CR"}
|
|
@@ -2,8 +2,26 @@
|
|
|
2
2
|
* Internal dependencies
|
|
3
3
|
*/
|
|
4
4
|
import type { CropperState } from './types';
|
|
5
|
+
/**
|
|
6
|
+
* Default/resting zoom. A full, unrotated crop needs at least 1x to cover the
|
|
7
|
+
* crop area, but smaller/fine-rotated crops can be valid below 1x — the true
|
|
8
|
+
* floor for those comes from `getMinZoom`.
|
|
9
|
+
*/
|
|
5
10
|
export declare const MIN_ZOOM = 1;
|
|
11
|
+
/**
|
|
12
|
+
* Safety floor for coverage-aware zoom. Degenerate crops can have a geometric
|
|
13
|
+
* coverage minimum of 0, but camera and inverse-matrix math need a stable,
|
|
14
|
+
* positive scale.
|
|
15
|
+
*/
|
|
16
|
+
export declare const ABSOLUTE_MIN_ZOOM = 0.1;
|
|
6
17
|
export declare const MAX_ZOOM = 10;
|
|
18
|
+
/**
|
|
19
|
+
* Minimum crop rect dimension in source-image pixels, enforced per axis
|
|
20
|
+
* during resize. Prevents accidental sub-pixel crops while staying small
|
|
21
|
+
* enough to allow tight crops (favicons, icons). Adjust here to tune the
|
|
22
|
+
* floor globally.
|
|
23
|
+
*/
|
|
24
|
+
export declare const MIN_CROP_PIXELS = 24;
|
|
7
25
|
/**
|
|
8
26
|
* Wheel zoom sensitivity. A deltaY of 100 changes zoom by 0.25.
|
|
9
27
|
* This could be made configurable as a prop to the Cropper component.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/image-editor/core/constants.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH,OAAO,KAAK,EAAwB,YAAY,EAAE,MAAM,SAAS,CAAC;AAElE,eAAO,MAAM,QAAQ,IAAI,CAAC;AAC1B,eAAO,MAAM,QAAQ,KAAK,CAAC;AAE3B;;;GAGG;AACH,eAAO,MAAM,wBAAwB,SAAS,CAAC;AA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;;;;;;;;GAiBG;AACH;;;GAGG;AACH,eAAO,MAAM,qBAAqB,KAAK,CAAC;AAExC,eAAO,MAAM,qBAAqB,EAAE,iBAAiB,EAUpD,CAAC"}
|
|
@@ -2,6 +2,16 @@
|
|
|
2
2
|
* Internal dependencies
|
|
3
3
|
*/
|
|
4
4
|
import type { CropperState, NormalizedRect, Size } from './types';
|
|
5
|
+
/**
|
|
6
|
+
* Resolves the effective minimum zoom for the current state — the coverage-
|
|
7
|
+
* aware floor when an image is loaded, falling back to `MIN_ZOOM` otherwise.
|
|
8
|
+
* Used by both the cropper's interaction layer and the zoom slider so the
|
|
9
|
+
* floor stays consistent across surfaces.
|
|
10
|
+
*
|
|
11
|
+
* @param state The current cropper state.
|
|
12
|
+
* @return The minimum zoom factor.
|
|
13
|
+
*/
|
|
14
|
+
export declare function getMinZoom(state: CropperState): number;
|
|
5
15
|
/**
|
|
6
16
|
* Compute the crop handle bounds in normalized visual space — the
|
|
7
17
|
* axis-aligned bounding box (AABB) of the actual image footprint at the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"containment.d.ts","sourceRoot":"","sources":["../../../src/image-editor/core/containment.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"containment.d.ts","sourceRoot":"","sources":["../../../src/image-editor/core/containment.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAuFlE;;;;;;;;GAQG;AACH,wBAAgB,UAAU,CAAE,KAAK,EAAE,YAAY,GAAI,MAAM,CAqBxD;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,kBAAkB,CACjC,KAAK,EAAE,YAAY,EACnB,WAAW,EAAE,IAAI,EACjB,UAAU,EAAE,IAAI,GACd;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CA0D5D;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,gBAAgB,CAC/B,QAAQ,EAAE,cAAc,EACxB,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,MAAM,EAChB,gBAAgB,EAAE,MAAM,GACtB,cAAc,CAqDhB;AAcD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,eAAe,CAC9B,KAAK,EAAE,YAAY,EACnB,SAAS,EAAE,IAAI,EACf,QAAQ,EAAE,cAAc,GACtB;IAAE,GAAG,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAkKjD"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internal dependencies
|
|
3
|
+
*/
|
|
4
|
+
import type { NormalizedRect, Size } from './types';
|
|
5
|
+
/**
|
|
6
|
+
* Largest rect of the given pixel aspect ratio that fits inside the
|
|
7
|
+
* visual bounds, centered in [0,1] × [0,1] normalized space. Returns
|
|
8
|
+
* a full-frame rect (1×1) if `aspectRatio` is unset or non-positive.
|
|
9
|
+
*
|
|
10
|
+
* The returned rect is the same in either freeform or fixed-crop
|
|
11
|
+
* mode — it's the canonical "centered crop for this ratio at this
|
|
12
|
+
* canvas size".
|
|
13
|
+
*
|
|
14
|
+
* @param aspectRatio Desired pixel width/height ratio. `undefined`
|
|
15
|
+
* (or 0/negative) means no lock — returns full frame.
|
|
16
|
+
* @param visualSize Rendered image dimensions in pixels.
|
|
17
|
+
*/
|
|
18
|
+
export declare function computeInscribedRect(aspectRatio: number | undefined, visualSize: Size): NormalizedRect;
|
|
19
|
+
//# sourceMappingURL=crop-rect.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"crop-rect.d.ts","sourceRoot":"","sources":["../../../src/image-editor/core/crop-rect.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAEpD;;;;;;;;;;;;GAYG;AACH,wBAAgB,oBAAoB,CACnC,WAAW,EAAE,MAAM,GAAG,SAAS,EAC/B,UAAU,EAAE,IAAI,GACd,cAAc,CAuBhB"}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
export type { CropperState, TransformOperation, NormalizedPoint, NormalizedRect, Size, Flip, StencilProps, } from './types';
|
|
1
|
+
export type { CropperState, CropperAction, TransformOperation, NormalizedPoint, NormalizedRect, Size, Flip, StencilProps, HandlePosition, } from './types';
|
|
2
2
|
export { DEFAULT_STATE, DEFAULT_ASPECT_RATIOS, ORIGINAL_ASPECT_RATIO, } from './constants';
|
|
3
3
|
export type { AspectRatioPreset } from './constants';
|
|
4
|
+
export { cropperReducer, enforceContainment, areCropperStatesEqual, isStateDirty, } from './state';
|
|
4
5
|
export { getSourceRegion, getSourceRegionPercent } from './source-region';
|
|
5
6
|
export type { SourceRegion, SourceRegionPercent } from './source-region';
|
|
7
|
+
export { computeInscribedRect } from './crop-rect';
|
|
6
8
|
export { applyOperationToState, stateFromPipeline, } from './transforms/pipeline';
|
|
7
9
|
export { exportCroppedImage, applyToCanvas } from './export/canvas-renderer';
|
|
8
10
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/image-editor/core/index.ts"],"names":[],"mappings":"AACA,YAAY,EACX,YAAY,EACZ,kBAAkB,EAClB,eAAe,EACf,cAAc,EACd,IAAI,EACJ,IAAI,EACJ,YAAY,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/image-editor/core/index.ts"],"names":[],"mappings":"AACA,YAAY,EACX,YAAY,EACZ,aAAa,EACb,kBAAkB,EAClB,eAAe,EACf,cAAc,EACd,IAAI,EACJ,IAAI,EACJ,YAAY,EACZ,cAAc,GACd,MAAM,SAAS,CAAC;AAGjB,OAAO,EACN,aAAa,EACb,qBAAqB,EACrB,qBAAqB,GACrB,MAAM,aAAa,CAAC;AACrB,YAAY,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAMrD,OAAO,EACN,cAAc,EACd,kBAAkB,EAClB,qBAAqB,EACrB,YAAY,GACZ,MAAM,SAAS,CAAC;AAGjB,OAAO,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AAC1E,YAAY,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAGzE,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAGnD,OAAO,EACN,qBAAqB,EACrB,iBAAiB,GACjB,MAAM,uBAAuB,CAAC;AAG/B,OAAO,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC"}
|
|
@@ -17,7 +17,11 @@ export interface InteractionStatus {
|
|
|
17
17
|
export interface CropperInteractionActions {
|
|
18
18
|
/** Set the image pan offset in normalized coordinates. */
|
|
19
19
|
setPan: (pan: NormalizedPoint) => void;
|
|
20
|
-
/**
|
|
20
|
+
/**
|
|
21
|
+
* Set the zoom level. Cursorless surfaces (slider, keyboard `+`/`-`)
|
|
22
|
+
* rely on this anchoring at the crop center; pointer-driven zoom
|
|
23
|
+
* paths use `setZoomAtPoint` with an explicit focal point instead.
|
|
24
|
+
*/
|
|
21
25
|
setZoom: (zoom: number) => void;
|
|
22
26
|
/** Set zoom and pan together for focal-point zoom. */
|
|
23
27
|
setZoomAtPoint: (zoom: number, pan: NormalizedPoint) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interaction-controller.d.ts","sourceRoot":"","sources":["../../../src/image-editor/core/interaction-controller.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AA6CnE;;GAEG;AACH,MAAM,WAAW,iBAAiB;IACjC,uDAAuD;IACvD,UAAU,EAAE,OAAO,CAAC;IACpB,0DAA0D;IAC1D,SAAS,EAAE,OAAO,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACzC,0DAA0D;IAC1D,MAAM,EAAE,CAAE,GAAG,EAAE,eAAe,KAAM,IAAI,CAAC;IACzC
|
|
1
|
+
{"version":3,"file":"interaction-controller.d.ts","sourceRoot":"","sources":["../../../src/image-editor/core/interaction-controller.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AA6CnE;;GAEG;AACH,MAAM,WAAW,iBAAiB;IACjC,uDAAuD;IACvD,UAAU,EAAE,OAAO,CAAC;IACpB,0DAA0D;IAC1D,SAAS,EAAE,OAAO,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACzC,0DAA0D;IAC1D,MAAM,EAAE,CAAE,GAAG,EAAE,eAAe,KAAM,IAAI,CAAC;IACzC;;;;OAIG;IACH,OAAO,EAAE,CAAE,IAAI,EAAE,MAAM,KAAM,IAAI,CAAC;IAClC,sDAAsD;IACtD,cAAc,EAAE,CAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,eAAe,KAAM,IAAI,CAAC;IAC/D,iCAAiC;IACjC,YAAY,EAAE,CAAE,SAAS,EAAE,CAAC,GAAG,CAAC,CAAC,KAAM,IAAI,CAAC;IAC5C,qCAAqC;IACrC,UAAU,CAAC,EAAE,CAAE,SAAS,EAAE,YAAY,GAAG,UAAU,KAAM,IAAI,CAAC;CAC9D;AAED;;;;;;GAMG;AACH,MAAM,WAAW,4BAA4B;IAC5C,sEAAsE;IACtE,QAAQ,EAAE,MAAM,YAAY,CAAC;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