@wordpress/media-editor 0.9.0 → 0.10.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.
- package/build/components/media-editor/index.cjs +212 -170
- package/build/components/media-editor/index.cjs.map +3 -3
- package/build/components/media-editor/use-crop-options.cjs +63 -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 +33 -12
- package/build/components/media-editor-canvas/index.cjs.map +2 -2
- package/build/components/media-editor-crop-panel/index.cjs +70 -84
- package/build/components/media-editor-crop-panel/index.cjs.map +2 -2
- package/build/components/media-editor-fine-rotation/index.cjs +81 -0
- package/build/components/media-editor-fine-rotation/index.cjs.map +7 -0
- package/build/components/media-editor-modal/index.cjs +63 -16
- package/build/components/media-editor-modal/index.cjs.map +3 -3
- package/build/components/media-editor-transform-controls/index.cjs +84 -0
- package/build/components/media-editor-transform-controls/index.cjs.map +7 -0
- 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 +120 -47
- 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 +19 -9
- 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-cropper-reducer.cjs +113 -0
- package/build/image-editor/react/hooks/use-cropper-reducer.cjs.map +7 -0
- package/build/state/composite-reducer.cjs +103 -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 +33 -0
- package/build/state/types.cjs.map +7 -0
- package/build/state/use-media-editor-state.cjs +287 -0
- package/build/state/use-media-editor-state.cjs.map +7 -0
- package/build/store/actions.cjs +4 -2
- package/build/store/actions.cjs.map +2 -2
- package/build/store/reducer.cjs +5 -3
- package/build/store/reducer.cjs.map +2 -2
- package/build/store/selectors.cjs +5 -0
- package/build/store/selectors.cjs.map +2 -2
- package/build-module/components/media-editor/index.mjs +224 -177
- package/build-module/components/media-editor/index.mjs.map +2 -2
- package/build-module/components/media-editor/use-crop-options.mjs +37 -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 +34 -13
- package/build-module/components/media-editor-canvas/index.mjs.map +2 -2
- package/build-module/components/media-editor-crop-panel/index.mjs +73 -89
- package/build-module/components/media-editor-crop-panel/index.mjs.map +2 -2
- package/build-module/components/media-editor-fine-rotation/index.mjs +50 -0
- package/build-module/components/media-editor-fine-rotation/index.mjs.map +7 -0
- package/build-module/components/media-editor-modal/index.mjs +64 -17
- package/build-module/components/media-editor-modal/index.mjs.map +2 -2
- package/build-module/components/media-editor-transform-controls/index.mjs +68 -0
- package/build-module/components/media-editor-transform-controls/index.mjs.map +7 -0
- 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 +121 -48
- 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 +19 -9
- 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-cropper-reducer.mjs +100 -0
- package/build-module/image-editor/react/hooks/use-cropper-reducer.mjs.map +7 -0
- package/build-module/state/composite-reducer.mjs +82 -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 +8 -0
- package/build-module/state/types.mjs.map +7 -0
- package/build-module/state/use-media-editor-state.mjs +278 -0
- package/build-module/state/use-media-editor-state.mjs.map +7 -0
- package/build-module/store/actions.mjs +4 -2
- package/build-module/store/actions.mjs.map +2 -2
- package/build-module/store/reducer.mjs +5 -3
- package/build-module/store/reducer.mjs.map +2 -2
- package/build-module/store/selectors.mjs +4 -0
- package/build-module/store/selectors.mjs.map +2 -2
- package/build-style/style-rtl.css +97 -44
- package/build-style/style.css +97 -44
- package/build-types/components/media-editor/index.d.ts +14 -5
- package/build-types/components/media-editor/index.d.ts.map +1 -1
- package/build-types/components/media-editor/use-crop-options.d.ts +35 -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 +6 -25
- package/build-types/components/media-editor-crop-panel/index.d.ts.map +1 -1
- package/build-types/components/media-editor-fine-rotation/index.d.ts +14 -0
- package/build-types/components/media-editor-fine-rotation/index.d.ts.map +1 -0
- package/build-types/components/media-editor-modal/index.d.ts.map +1 -1
- package/build-types/components/media-editor-transform-controls/index.d.ts +8 -0
- package/build-types/components/media-editor-transform-controls/index.d.ts.map +1 -0
- 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-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/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 +96 -0
- package/build-types/state/types.d.ts.map +1 -0
- package/build-types/state/use-media-editor-state.d.ts +101 -0
- package/build-types/state/use-media-editor-state.d.ts.map +1 -0
- package/build-types/store/actions.d.ts +3 -1
- package/build-types/store/actions.d.ts.map +1 -1
- package/build-types/store/reducer.d.ts +3 -0
- package/build-types/store/reducer.d.ts.map +1 -1
- package/build-types/store/selectors.d.ts +1 -0
- package/build-types/store/selectors.d.ts.map +1 -1
- package/package.json +19 -16
- package/src/components/media-editor/index.tsx +262 -229
- package/src/components/media-editor/style.scss +0 -9
- package/src/components/media-editor/test/use-crop-options.tsx +110 -0
- package/src/components/media-editor/use-crop-options.ts +79 -0
- package/src/components/media-editor/use-save-media-editor.ts +214 -0
- package/src/components/media-editor-canvas/index.tsx +57 -25
- package/src/components/media-editor-crop-panel/index.tsx +53 -87
- package/src/components/media-editor-crop-panel/test/index.tsx +46 -53
- package/src/components/media-editor-fine-rotation/index.tsx +74 -0
- package/src/components/media-editor-modal/index.tsx +70 -16
- package/src/components/media-editor-modal/style.scss +80 -0
- package/src/components/media-editor-modal/test/build-modifiers.test.ts +14 -0
- package/src/components/media-editor-modal/test/index.tsx +146 -0
- package/src/components/media-editor-transform-controls/index.tsx +70 -0
- package/src/components/media-editor-transform-controls/style.scss +8 -0
- 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 +64 -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 +194 -89
- package/src/image-editor/react/components/overlays/dimensions-overlay.tsx +269 -0
- package/src/image-editor/react/components/stencils/rectangle-stencil.tsx +19 -8
- 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-cropper-reducer.ts +204 -0
- package/src/image-editor/stories/rectangle-crop.story.tsx +7 -17
- package/src/state/composite-reducer.ts +137 -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 +330 -0
- package/src/state/types.ts +101 -0
- package/src/state/use-media-editor-state.ts +472 -0
- package/src/store/actions.ts +3 -0
- package/src/store/reducer.ts +6 -1
- package/src/store/selectors.ts +4 -0
- package/src/store/test/reducer.ts +9 -0
- package/src/style.scss +1 -1
- package/tsconfig.json +3 -0
- package/tsconfig.tsbuildinfo +1 -1
- package/build/components/media-editor-toolbar/index.cjs +0 -214
- package/build/components/media-editor-toolbar/index.cjs.map +0 -7
- 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/components/media-editor-toolbar/index.mjs +0 -190
- package/build-module/components/media-editor-toolbar/index.mjs.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/components/media-editor-toolbar/index.d.ts +0 -24
- package/build-types/components/media-editor-toolbar/index.d.ts.map +0 -1
- 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/components/media-editor-toolbar/index.tsx +0 -209
- package/src/components/media-editor-toolbar/style.scss +0 -49
- 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));
|
|
@@ -369,13 +382,6 @@
|
|
|
369
382
|
min-width: 0;
|
|
370
383
|
flex: 1;
|
|
371
384
|
}
|
|
372
|
-
.media-editor .interface-interface-skeleton__footer {
|
|
373
|
-
position: relative;
|
|
374
|
-
display: flex;
|
|
375
|
-
}
|
|
376
|
-
.media-editor .interface-interface-skeleton.has-footer .interface-interface-skeleton__body {
|
|
377
|
-
padding-bottom: 0;
|
|
378
|
-
}
|
|
379
385
|
.media-editor .media-editor__canvas {
|
|
380
386
|
display: flex;
|
|
381
387
|
align-items: center;
|
|
@@ -447,6 +453,56 @@
|
|
|
447
453
|
min-height: 0;
|
|
448
454
|
}
|
|
449
455
|
|
|
456
|
+
.media-editor-modal.components-modal__frame .media-editor-modal__footer {
|
|
457
|
+
flex-shrink: 0;
|
|
458
|
+
display: flex;
|
|
459
|
+
gap: 16px;
|
|
460
|
+
padding: 8px 24px;
|
|
461
|
+
border-top: 1px solid #ddd;
|
|
462
|
+
background: #fff;
|
|
463
|
+
}
|
|
464
|
+
.media-editor-modal.components-modal__frame .media-editor-modal__footer.is-wide {
|
|
465
|
+
flex-direction: row;
|
|
466
|
+
align-items: center;
|
|
467
|
+
}
|
|
468
|
+
.media-editor-modal.components-modal__frame .media-editor-modal__footer.is-wide .media-editor-modal__footer-toolbar {
|
|
469
|
+
flex: 1 1 0;
|
|
470
|
+
min-width: 0;
|
|
471
|
+
display: flex;
|
|
472
|
+
align-items: center;
|
|
473
|
+
justify-content: center;
|
|
474
|
+
gap: 8px;
|
|
475
|
+
}
|
|
476
|
+
.media-editor-modal.components-modal__frame .media-editor-modal__footer.is-wide .media-editor-fine-rotation {
|
|
477
|
+
flex: 1 1 280px;
|
|
478
|
+
min-width: 0;
|
|
479
|
+
max-width: 360px;
|
|
480
|
+
}
|
|
481
|
+
.media-editor-modal.components-modal__frame .media-editor-modal__footer.is-wide .media-editor-transform-controls {
|
|
482
|
+
border-right: 1px solid #ddd;
|
|
483
|
+
padding-right: 12px;
|
|
484
|
+
}
|
|
485
|
+
.media-editor-modal.components-modal__frame .media-editor-modal__footer.is-wide .media-editor__footer-actions {
|
|
486
|
+
margin-right: auto;
|
|
487
|
+
}
|
|
488
|
+
.media-editor-modal.components-modal__frame .media-editor-modal__footer.is-medium, .media-editor-modal.components-modal__frame .media-editor-modal__footer.is-narrow {
|
|
489
|
+
flex-direction: column;
|
|
490
|
+
}
|
|
491
|
+
.media-editor-modal.components-modal__frame .media-editor-modal__footer.is-narrow > .media-editor-transform-controls {
|
|
492
|
+
align-self: center;
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
.media-editor-modal__footer-row {
|
|
496
|
+
display: flex;
|
|
497
|
+
flex-wrap: wrap;
|
|
498
|
+
align-items: center;
|
|
499
|
+
gap: 16px;
|
|
500
|
+
}
|
|
501
|
+
.media-editor-modal__footer-row .media-editor-transform-controls,
|
|
502
|
+
.media-editor-modal__footer-row .media-editor__footer-actions {
|
|
503
|
+
margin-right: auto;
|
|
504
|
+
}
|
|
505
|
+
|
|
450
506
|
.media-editor-modal {
|
|
451
507
|
display: flex;
|
|
452
508
|
flex-direction: column;
|
|
@@ -476,40 +532,13 @@
|
|
|
476
532
|
height: 100%;
|
|
477
533
|
}
|
|
478
534
|
|
|
479
|
-
.media-editor-
|
|
480
|
-
width: 100%;
|
|
481
|
-
padding: 8px 16px;
|
|
482
|
-
}
|
|
483
|
-
|
|
484
|
-
.media-editor-toolbar__rotation-slider {
|
|
485
|
-
flex: 1 1 280px;
|
|
486
|
-
min-width: 0;
|
|
487
|
-
max-width: 360px;
|
|
488
|
-
}
|
|
489
|
-
|
|
490
|
-
.media-editor-toolbar__action-cluster {
|
|
535
|
+
.media-editor-transform-controls {
|
|
491
536
|
display: flex;
|
|
492
537
|
flex-wrap: nowrap;
|
|
493
538
|
align-items: center;
|
|
494
539
|
gap: 8px;
|
|
495
540
|
}
|
|
496
541
|
|
|
497
|
-
@media (min-width: 782px) {
|
|
498
|
-
.media-editor-toolbar__action-cluster {
|
|
499
|
-
border-right: 1px solid #ddd;
|
|
500
|
-
padding-right: 12px;
|
|
501
|
-
}
|
|
502
|
-
}
|
|
503
|
-
@media (max-width: 781px) {
|
|
504
|
-
.media-editor-toolbar__rotation-slider {
|
|
505
|
-
flex-basis: 100%;
|
|
506
|
-
max-width: none;
|
|
507
|
-
}
|
|
508
|
-
.media-editor-toolbar__action-cluster {
|
|
509
|
-
flex-basis: 100%;
|
|
510
|
-
justify-content: center;
|
|
511
|
-
}
|
|
512
|
-
}
|
|
513
542
|
.media-editor-keyboard-shortcuts-modal {
|
|
514
543
|
min-width: 280px;
|
|
515
544
|
}
|
|
@@ -594,11 +623,10 @@
|
|
|
594
623
|
position: absolute;
|
|
595
624
|
bottom: 0;
|
|
596
625
|
right: 50%;
|
|
597
|
-
width:
|
|
598
|
-
height:
|
|
599
|
-
|
|
600
|
-
border-
|
|
601
|
-
border-bottom: 9px solid var(--wp-admin-theme-color, #3858e9);
|
|
626
|
+
width: 2px;
|
|
627
|
+
height: 18px;
|
|
628
|
+
background: var(--wp-admin-theme-color, #3858e9);
|
|
629
|
+
border-radius: 1px;
|
|
602
630
|
transform: translateX(50%);
|
|
603
631
|
pointer-events: none;
|
|
604
632
|
}
|
|
@@ -646,14 +674,39 @@
|
|
|
646
674
|
right: 50%;
|
|
647
675
|
height: 14px;
|
|
648
676
|
transform: translateX(50%);
|
|
649
|
-
padding: 0 12px;
|
|
650
677
|
font-size: 12px;
|
|
651
678
|
font-weight: 600;
|
|
652
679
|
line-height: 14px;
|
|
653
680
|
color: #1e1e1e;
|
|
654
|
-
background: linear-gradient(to left, transparent 0, #fff 12px, #fff calc(100% - 12px), transparent 100%);
|
|
655
681
|
pointer-events: none;
|
|
656
682
|
}
|
|
683
|
+
.rotation-ruler__active-label::before {
|
|
684
|
+
content: "";
|
|
685
|
+
position: absolute;
|
|
686
|
+
top: 0;
|
|
687
|
+
right: 50%;
|
|
688
|
+
width: 60px;
|
|
689
|
+
height: 100%;
|
|
690
|
+
transform: translateX(50%);
|
|
691
|
+
background: linear-gradient(to left, transparent 0, #fff 12px, #fff calc(100% - 12px), transparent 100%);
|
|
692
|
+
}
|
|
693
|
+
|
|
694
|
+
.rotation-ruler__active-label-number {
|
|
695
|
+
position: relative;
|
|
696
|
+
display: inline-block;
|
|
697
|
+
}
|
|
698
|
+
|
|
699
|
+
.rotation-ruler__active-label-sign {
|
|
700
|
+
position: absolute;
|
|
701
|
+
top: 0;
|
|
702
|
+
left: 100%;
|
|
703
|
+
}
|
|
704
|
+
|
|
705
|
+
.rotation-ruler__active-label-unit {
|
|
706
|
+
position: absolute;
|
|
707
|
+
top: 0;
|
|
708
|
+
right: 100%;
|
|
709
|
+
}
|
|
657
710
|
|
|
658
711
|
@container (max-width: 220px) {
|
|
659
712
|
.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));
|
|
@@ -369,13 +382,6 @@
|
|
|
369
382
|
min-width: 0;
|
|
370
383
|
flex: 1;
|
|
371
384
|
}
|
|
372
|
-
.media-editor .interface-interface-skeleton__footer {
|
|
373
|
-
position: relative;
|
|
374
|
-
display: flex;
|
|
375
|
-
}
|
|
376
|
-
.media-editor .interface-interface-skeleton.has-footer .interface-interface-skeleton__body {
|
|
377
|
-
padding-bottom: 0;
|
|
378
|
-
}
|
|
379
385
|
.media-editor .media-editor__canvas {
|
|
380
386
|
display: flex;
|
|
381
387
|
align-items: center;
|
|
@@ -447,6 +453,56 @@
|
|
|
447
453
|
min-height: 0;
|
|
448
454
|
}
|
|
449
455
|
|
|
456
|
+
.media-editor-modal.components-modal__frame .media-editor-modal__footer {
|
|
457
|
+
flex-shrink: 0;
|
|
458
|
+
display: flex;
|
|
459
|
+
gap: 16px;
|
|
460
|
+
padding: 8px 24px;
|
|
461
|
+
border-top: 1px solid #ddd;
|
|
462
|
+
background: #fff;
|
|
463
|
+
}
|
|
464
|
+
.media-editor-modal.components-modal__frame .media-editor-modal__footer.is-wide {
|
|
465
|
+
flex-direction: row;
|
|
466
|
+
align-items: center;
|
|
467
|
+
}
|
|
468
|
+
.media-editor-modal.components-modal__frame .media-editor-modal__footer.is-wide .media-editor-modal__footer-toolbar {
|
|
469
|
+
flex: 1 1 0;
|
|
470
|
+
min-width: 0;
|
|
471
|
+
display: flex;
|
|
472
|
+
align-items: center;
|
|
473
|
+
justify-content: center;
|
|
474
|
+
gap: 8px;
|
|
475
|
+
}
|
|
476
|
+
.media-editor-modal.components-modal__frame .media-editor-modal__footer.is-wide .media-editor-fine-rotation {
|
|
477
|
+
flex: 1 1 280px;
|
|
478
|
+
min-width: 0;
|
|
479
|
+
max-width: 360px;
|
|
480
|
+
}
|
|
481
|
+
.media-editor-modal.components-modal__frame .media-editor-modal__footer.is-wide .media-editor-transform-controls {
|
|
482
|
+
border-left: 1px solid #ddd;
|
|
483
|
+
padding-left: 12px;
|
|
484
|
+
}
|
|
485
|
+
.media-editor-modal.components-modal__frame .media-editor-modal__footer.is-wide .media-editor__footer-actions {
|
|
486
|
+
margin-left: auto;
|
|
487
|
+
}
|
|
488
|
+
.media-editor-modal.components-modal__frame .media-editor-modal__footer.is-medium, .media-editor-modal.components-modal__frame .media-editor-modal__footer.is-narrow {
|
|
489
|
+
flex-direction: column;
|
|
490
|
+
}
|
|
491
|
+
.media-editor-modal.components-modal__frame .media-editor-modal__footer.is-narrow > .media-editor-transform-controls {
|
|
492
|
+
align-self: center;
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
.media-editor-modal__footer-row {
|
|
496
|
+
display: flex;
|
|
497
|
+
flex-wrap: wrap;
|
|
498
|
+
align-items: center;
|
|
499
|
+
gap: 16px;
|
|
500
|
+
}
|
|
501
|
+
.media-editor-modal__footer-row .media-editor-transform-controls,
|
|
502
|
+
.media-editor-modal__footer-row .media-editor__footer-actions {
|
|
503
|
+
margin-left: auto;
|
|
504
|
+
}
|
|
505
|
+
|
|
450
506
|
.media-editor-modal {
|
|
451
507
|
display: flex;
|
|
452
508
|
flex-direction: column;
|
|
@@ -476,40 +532,13 @@
|
|
|
476
532
|
height: 100%;
|
|
477
533
|
}
|
|
478
534
|
|
|
479
|
-
.media-editor-
|
|
480
|
-
width: 100%;
|
|
481
|
-
padding: 8px 16px;
|
|
482
|
-
}
|
|
483
|
-
|
|
484
|
-
.media-editor-toolbar__rotation-slider {
|
|
485
|
-
flex: 1 1 280px;
|
|
486
|
-
min-width: 0;
|
|
487
|
-
max-width: 360px;
|
|
488
|
-
}
|
|
489
|
-
|
|
490
|
-
.media-editor-toolbar__action-cluster {
|
|
535
|
+
.media-editor-transform-controls {
|
|
491
536
|
display: flex;
|
|
492
537
|
flex-wrap: nowrap;
|
|
493
538
|
align-items: center;
|
|
494
539
|
gap: 8px;
|
|
495
540
|
}
|
|
496
541
|
|
|
497
|
-
@media (min-width: 782px) {
|
|
498
|
-
.media-editor-toolbar__action-cluster {
|
|
499
|
-
border-left: 1px solid #ddd;
|
|
500
|
-
padding-left: 12px;
|
|
501
|
-
}
|
|
502
|
-
}
|
|
503
|
-
@media (max-width: 781px) {
|
|
504
|
-
.media-editor-toolbar__rotation-slider {
|
|
505
|
-
flex-basis: 100%;
|
|
506
|
-
max-width: none;
|
|
507
|
-
}
|
|
508
|
-
.media-editor-toolbar__action-cluster {
|
|
509
|
-
flex-basis: 100%;
|
|
510
|
-
justify-content: center;
|
|
511
|
-
}
|
|
512
|
-
}
|
|
513
542
|
.media-editor-keyboard-shortcuts-modal {
|
|
514
543
|
min-width: 280px;
|
|
515
544
|
}
|
|
@@ -594,11 +623,10 @@
|
|
|
594
623
|
position: absolute;
|
|
595
624
|
bottom: 0;
|
|
596
625
|
left: 50%;
|
|
597
|
-
width:
|
|
598
|
-
height:
|
|
599
|
-
|
|
600
|
-
border-
|
|
601
|
-
border-bottom: 9px solid var(--wp-admin-theme-color, #3858e9);
|
|
626
|
+
width: 2px;
|
|
627
|
+
height: 18px;
|
|
628
|
+
background: var(--wp-admin-theme-color, #3858e9);
|
|
629
|
+
border-radius: 1px;
|
|
602
630
|
transform: translateX(-50%);
|
|
603
631
|
pointer-events: none;
|
|
604
632
|
}
|
|
@@ -646,14 +674,39 @@
|
|
|
646
674
|
left: 50%;
|
|
647
675
|
height: 14px;
|
|
648
676
|
transform: translateX(-50%);
|
|
649
|
-
padding: 0 12px;
|
|
650
677
|
font-size: 12px;
|
|
651
678
|
font-weight: 600;
|
|
652
679
|
line-height: 14px;
|
|
653
680
|
color: #1e1e1e;
|
|
654
|
-
background: linear-gradient(to right, transparent 0, #fff 12px, #fff calc(100% - 12px), transparent 100%);
|
|
655
681
|
pointer-events: none;
|
|
656
682
|
}
|
|
683
|
+
.rotation-ruler__active-label::before {
|
|
684
|
+
content: "";
|
|
685
|
+
position: absolute;
|
|
686
|
+
top: 0;
|
|
687
|
+
left: 50%;
|
|
688
|
+
width: 60px;
|
|
689
|
+
height: 100%;
|
|
690
|
+
transform: translateX(-50%);
|
|
691
|
+
background: linear-gradient(to right, transparent 0, #fff 12px, #fff calc(100% - 12px), transparent 100%);
|
|
692
|
+
}
|
|
693
|
+
|
|
694
|
+
.rotation-ruler__active-label-number {
|
|
695
|
+
position: relative;
|
|
696
|
+
display: inline-block;
|
|
697
|
+
}
|
|
698
|
+
|
|
699
|
+
.rotation-ruler__active-label-sign {
|
|
700
|
+
position: absolute;
|
|
701
|
+
top: 0;
|
|
702
|
+
right: 100%;
|
|
703
|
+
}
|
|
704
|
+
|
|
705
|
+
.rotation-ruler__active-label-unit {
|
|
706
|
+
position: absolute;
|
|
707
|
+
top: 0;
|
|
708
|
+
left: 100%;
|
|
709
|
+
}
|
|
657
710
|
|
|
658
711
|
@container (max-width: 220px) {
|
|
659
712
|
.rotation-ruler__tick--minor {
|
|
@@ -2,14 +2,23 @@ import type { Field } from '@wordpress/dataviews';
|
|
|
2
2
|
import type { 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;
|
|
10
|
+
footerActions: ReactNode;
|
|
11
|
+
/**
|
|
12
|
+
* Footer layout selector. Frames apply this to the footer container
|
|
13
|
+
* as a modifier class.
|
|
14
|
+
*
|
|
15
|
+
* - `wide` — single row: History | Ruler | Transform | Cancel/Save.
|
|
16
|
+
* - `medium` — two rows: ruler on top; History | Transform | Cancel/Save
|
|
17
|
+
* beneath.
|
|
18
|
+
* - `narrow` — three rows: ruler; transform (centered); History |
|
|
19
|
+
* Cancel/Save.
|
|
20
|
+
*/
|
|
21
|
+
footerLayout: 'wide' | 'medium' | 'narrow';
|
|
13
22
|
onRequestClose: () => void;
|
|
14
23
|
onKeyDown: (event: ReactKeyboardEvent<HTMLElement>) => void;
|
|
15
24
|
shouldCloseOnClickOutside: boolean;
|
|
@@ -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":"AA+BA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAQlD,OAAO,KAAK,EAAE,aAAa,IAAI,kBAAkB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAM5E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAC;AAUtD,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,aAAa,EAAE,SAAS,CAAC;IACzB;;;;;;;;;OASG;IACH,YAAY,EAAE,MAAM,GAAG,QAAQ,GAAG,QAAQ,CAAC;IAC3C,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;AAymBD,wBAAgB,WAAW,CAAE,KAAK,EAAE,gBAAgB,+BAMnD;eAEc,WAAW"}
|
|
@@ -0,0 +1,35 @@
|
|
|
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
|
+
resolvedAspectRatio: number | undefined;
|
|
10
|
+
resetCropOptions: () => void;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Build the preset list shown in the dropdown — always include the
|
|
14
|
+
* non-numeric presets (Free, Original) and append either the
|
|
15
|
+
* caller-supplied set or the defaults.
|
|
16
|
+
*
|
|
17
|
+
* @param aspectRatioPresets Optional caller-supplied presets.
|
|
18
|
+
* @return The full preset list to render.
|
|
19
|
+
*/
|
|
20
|
+
export declare function getAspectRatioOptions(aspectRatioPresets?: AspectRatioPreset[]): AspectRatioPreset[];
|
|
21
|
+
/**
|
|
22
|
+
* Thin selector over the composite media-editor store for the Crop
|
|
23
|
+
* sidebar tab. Reads the cropOptions slice (preset key) and exposes
|
|
24
|
+
* the corresponding setters plus a render-time `resolvedAspectRatio`
|
|
25
|
+
* derivation.
|
|
26
|
+
*
|
|
27
|
+
* No local React state, no refs, no synchronization effects — the
|
|
28
|
+
* composite store is the single source of truth.
|
|
29
|
+
*
|
|
30
|
+
* @param args
|
|
31
|
+
* @param args.aspectRatioPresets Optional caller-supplied aspect-ratio presets.
|
|
32
|
+
*/
|
|
33
|
+
export declare function useCropOptions({ aspectRatioPresets }?: UseCropOptionsArgs): UseCropOptionsReturn;
|
|
34
|
+
export {};
|
|
35
|
+
//# 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;AAG3E,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,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,CAsBjD"}
|
|
@@ -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"}
|
|
@@ -8,38 +8,19 @@ export interface MediaEditorCropPanelProps {
|
|
|
8
8
|
aspectRatioValue: string;
|
|
9
9
|
/** Setter for the aspect-ratio preset value. */
|
|
10
10
|
onAspectRatioChange: (value: string) => void;
|
|
11
|
-
/** Whether the cropper is in freeform (resize-handle) mode. */
|
|
12
|
-
freeformCrop: boolean;
|
|
13
|
-
/** Setter for freeform mode. */
|
|
14
|
-
onFreeformChange: (value: boolean) => void;
|
|
15
11
|
/** Signal that a placement-oriented control is being adjusted. */
|
|
16
12
|
onPlacementControlInteraction?: () => void;
|
|
17
|
-
/**
|
|
18
|
-
|
|
19
|
-
* omitted, the media editor's default fixed-ratio presets are used.
|
|
20
|
-
*/
|
|
21
|
-
aspectRatioPresets?: AspectRatioPreset[];
|
|
13
|
+
/** Aspect-ratio presets to display in the selector. */
|
|
14
|
+
aspectRatioOptions: AspectRatioPreset[];
|
|
22
15
|
}
|
|
23
16
|
/**
|
|
24
|
-
*
|
|
25
|
-
*
|
|
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
|
-
/**
|
|
33
|
-
* Sidebar panel for crop-shape controls — aspect-ratio presets and
|
|
34
|
-
* freeform toggle. The tactile verbs (rotate, flip) live in the
|
|
35
|
-
* bottom toolbar instead.
|
|
17
|
+
* Sidebar panel for crop-shape controls. The tactile verbs (rotate, flip)
|
|
18
|
+
* live in the bottom toolbar instead.
|
|
36
19
|
* @param props
|
|
37
20
|
* @param props.aspectRatioValue
|
|
38
21
|
* @param props.onAspectRatioChange
|
|
39
|
-
* @param props.freeformCrop
|
|
40
|
-
* @param props.onFreeformChange
|
|
41
22
|
* @param props.onPlacementControlInteraction
|
|
42
|
-
* @param props.
|
|
23
|
+
* @param props.aspectRatioOptions
|
|
43
24
|
*/
|
|
44
|
-
export default function MediaEditorCropPanel({ aspectRatioValue, onAspectRatioChange,
|
|
25
|
+
export default function MediaEditorCropPanel({ aspectRatioValue, onAspectRatioChange, onPlacementControlInteraction, aspectRatioOptions }: MediaEditorCropPanelProps): import("react").JSX.Element;
|
|
45
26
|
//# 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":"AAiBA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAa3E,MAAM,WAAW,yBAAyB;IACzC;;;;OAIG;IACH,gBAAgB,EAAE,MAAM,CAAC;IACzB,gDAAgD;IAChD,mBAAmB,EAAE,CAAE,KAAK,EAAE,MAAM,KAAM,IAAI,CAAC;IAC/C,kEAAkE;IAClE,6BAA6B,CAAC,EAAE,MAAM,IAAI,CAAC;IAC3C,uDAAuD;IACvD,kBAAkB,EAAE,iBAAiB,EAAE,CAAC;CACxC;AAED;;;;;;;;GAQG;AACH,MAAM,CAAC,OAAO,UAAU,oBAAoB,CAAE,EAC7C,gBAAgB,EAChB,mBAAmB,EACnB,6BAA6B,EAC7B,kBAAkB,EAClB,EAAE,yBAAyB,+BA6D3B"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface MediaEditorFineRotationProps {
|
|
2
|
+
/** Signal that a placement-oriented control is being adjusted. */
|
|
3
|
+
onPlacementControlInteraction?: () => void;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Fine-rotation slider for the media-editor footer. Lives separately from
|
|
7
|
+
* the snap-rotate / flip buttons so the footer can place the two halves on
|
|
8
|
+
* different rows at intermediate viewport widths.
|
|
9
|
+
*
|
|
10
|
+
* @param props
|
|
11
|
+
* @param props.onPlacementControlInteraction
|
|
12
|
+
*/
|
|
13
|
+
export default function MediaEditorFineRotation({ onPlacementControlInteraction }: MediaEditorFineRotationProps): import("react").JSX.Element;
|
|
14
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/media-editor-fine-rotation/index.tsx"],"names":[],"mappings":"AAaA,MAAM,WAAW,4BAA4B;IAC5C,kEAAkE;IAClE,6BAA6B,CAAC,EAAE,MAAM,IAAI,CAAC;CAC3C;AAED;;;;;;;GAOG;AACH,MAAM,CAAC,OAAO,UAAU,uBAAuB,CAAE,EAChD,6BAA6B,EAC7B,EAAE,4BAA4B,+BA6C9B"}
|
|
@@ -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,sCAgHvB;eAEc,gBAAgB"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Snap-rotate and flip controls for the media-editor footer. Rotation and
|
|
3
|
+
* reflection are both geometric transforms, hence "transform controls".
|
|
4
|
+
* Lives separately from the fine-rotation slider so the footer can place
|
|
5
|
+
* the two halves on different rows at intermediate viewport widths.
|
|
6
|
+
*/
|
|
7
|
+
export default function MediaEditorTransformControls(): import("react").JSX.Element;
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/media-editor-transform-controls/index.tsx"],"names":[],"mappings":"AAiBA;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,4BAA4B,gCA8CnD"}
|
|
@@ -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"}
|