@wordpress/media-editor 0.20.0 → 0.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +28 -0
- package/README.md +2 -1
- package/build/components/media-editor/index.cjs +533 -695
- package/build/components/media-editor/index.cjs.map +1 -7
- package/build/components/media-editor/use-crop-options.cjs +43 -58
- package/build/components/media-editor/use-crop-options.cjs.map +1 -7
- package/build/components/media-editor/use-save-media-editor.cjs +111 -185
- package/build/components/media-editor/use-save-media-editor.cjs.map +1 -7
- package/build/components/media-editor-canvas/index.cjs +122 -124
- package/build/components/media-editor-canvas/index.cjs.map +1 -7
- package/build/components/media-editor-crop-panel/index.cjs +65 -68
- package/build/components/media-editor-crop-panel/index.cjs.map +1 -7
- package/build/components/media-editor-fine-rotation/index.cjs +62 -72
- package/build/components/media-editor-fine-rotation/index.cjs.map +1 -7
- package/build/components/media-editor-image-controls/index.cjs +183 -257
- package/build/components/media-editor-image-controls/index.cjs.map +1 -7
- package/build/components/media-editor-keyboard-shortcuts-modal/index.cjs +119 -157
- package/build/components/media-editor-keyboard-shortcuts-modal/index.cjs.map +1 -7
- package/build/components/media-editor-modal/build-modifiers.cjs +107 -88
- package/build/components/media-editor-modal/build-modifiers.cjs.map +1 -7
- package/build/components/media-editor-modal/index.cjs +112 -153
- package/build/components/media-editor-modal/index.cjs.map +1 -7
- package/build/components/media-editor-provider/index.cjs +32 -54
- package/build/components/media-editor-provider/index.cjs.map +1 -7
- package/build/components/media-form/index.cjs +77 -78
- package/build/components/media-form/index.cjs.map +1 -7
- package/build/components/media-preview/index.cjs +114 -114
- package/build/components/media-preview/index.cjs.map +1 -7
- package/build/components/rotation-ruler/index.cjs +181 -188
- package/build/components/rotation-ruler/index.cjs.map +1 -7
- package/build/components/rotation-ruler/use-ruler-drag.cjs +132 -149
- package/build/components/rotation-ruler/use-ruler-drag.cjs.map +1 -7
- package/build/hooks/use-crop-gesture-handlers.cjs +82 -76
- package/build/hooks/use-crop-gesture-handlers.cjs.map +1 -7
- package/build/image-editor/core/camera.cjs +257 -205
- package/build/image-editor/core/camera.cjs.map +1 -7
- package/build/image-editor/core/constants.cjs +127 -102
- package/build/image-editor/core/constants.cjs.map +1 -7
- package/build/image-editor/core/containment.cjs +275 -262
- package/build/image-editor/core/containment.cjs.map +1 -7
- package/build/image-editor/core/crop-rect.cjs +33 -44
- package/build/image-editor/core/crop-rect.cjs.map +1 -7
- package/build/image-editor/core/export/canvas-renderer.cjs +165 -135
- package/build/image-editor/core/export/canvas-renderer.cjs.map +1 -7
- package/build/image-editor/core/index.cjs +88 -61
- package/build/image-editor/core/interaction-controller.cjs +583 -646
- package/build/image-editor/core/interaction-controller.cjs.map +1 -7
- package/build/image-editor/core/math/rotation.cjs +26 -35
- package/build/image-editor/core/math/rotation.cjs.map +1 -7
- package/build/image-editor/core/math/sanitize.cjs +124 -80
- package/build/image-editor/core/math/sanitize.cjs.map +1 -7
- package/build/image-editor/core/setter-helpers.cjs +57 -60
- package/build/image-editor/core/setter-helpers.cjs.map +1 -7
- package/build/image-editor/core/source-region.cjs +220 -190
- package/build/image-editor/core/source-region.cjs.map +1 -7
- package/build/image-editor/core/state.cjs +278 -265
- package/build/image-editor/core/state.cjs.map +1 -7
- package/build/image-editor/core/stencil-math.cjs +193 -206
- package/build/image-editor/core/stencil-math.cjs.map +1 -7
- package/build/image-editor/core/transform-style.cjs +39 -48
- package/build/image-editor/core/transform-style.cjs.map +1 -7
- package/build/image-editor/core/transforms/pipeline.cjs +36 -38
- package/build/image-editor/core/transforms/pipeline.cjs.map +1 -7
- package/build/image-editor/core/types.cjs +4 -18
- package/build/image-editor/core/viewport-state.cjs +31 -45
- package/build/image-editor/core/viewport-state.cjs.map +1 -7
- package/build/image-editor/index.cjs +65 -64
- package/build/image-editor/react/components/cropper-provider.cjs +44 -45
- package/build/image-editor/react/components/cropper-provider.cjs.map +1 -7
- package/build/image-editor/react/components/cropper.cjs +583 -720
- package/build/image-editor/react/components/cropper.cjs.map +1 -7
- package/build/image-editor/react/components/index.cjs +22 -33
- package/build/image-editor/react/components/overlays/dimensions-overlay.cjs +135 -160
- package/build/image-editor/react/components/overlays/dimensions-overlay.cjs.map +1 -7
- package/build/image-editor/react/components/overlays/dimming-overlay.cjs +28 -59
- package/build/image-editor/react/components/overlays/dimming-overlay.cjs.map +1 -7
- package/build/image-editor/react/components/overlays/grid-overlay.cjs +58 -88
- package/build/image-editor/react/components/overlays/grid-overlay.cjs.map +1 -7
- package/build/image-editor/react/components/stencils/rectangle-stencil.cjs +361 -420
- package/build/image-editor/react/components/stencils/rectangle-stencil.cjs.map +1 -7
- package/build/image-editor/react/components/viewport-provider.cjs +21 -46
- package/build/image-editor/react/components/viewport-provider.cjs.map +1 -7
- package/build/image-editor/react/hooks/build-cropper-setters.cjs +76 -67
- package/build/image-editor/react/hooks/build-cropper-setters.cjs.map +1 -7
- package/build/image-editor/react/hooks/index.cjs +16 -31
- package/build/image-editor/react/hooks/use-aria-announcer.cjs +90 -146
- package/build/image-editor/react/hooks/use-aria-announcer.cjs.map +1 -7
- package/build/image-editor/react/hooks/use-cropper-controller.cjs +80 -0
- package/build/image-editor/react/hooks/use-cropper-controller.cjs.map +1 -0
- package/build/image-editor/react/hooks/use-interaction.cjs +179 -205
- package/build/image-editor/react/hooks/use-interaction.cjs.map +1 -7
- package/build/image-editor/react/hooks/use-transform-style.cjs +20 -34
- package/build/image-editor/react/hooks/use-transform-style.cjs.map +1 -7
- package/build/image-editor/react/hooks/use-viewport-state.cjs +36 -47
- package/build/image-editor/react/hooks/use-viewport-state.cjs.map +1 -7
- package/build/image-editor/react/visually-hidden-style.cjs +21 -38
- package/build/image-editor/react/visually-hidden-style.cjs.map +1 -7
- package/build/index.cjs +45 -39
- package/build/lock-unlock.cjs +9 -35
- package/build/lock-unlock.cjs.map +1 -7
- package/build/private-apis.cjs +16 -37
- package/build/private-apis.cjs.map +1 -7
- package/build/state/aspect-ratio-presets.cjs +53 -0
- package/build/state/aspect-ratio-presets.cjs.map +1 -0
- package/build/state/composite-reducer.cjs +136 -89
- package/build/state/composite-reducer.cjs.map +1 -7
- package/build/state/index.cjs +63 -47
- package/build/state/media-editor-state-provider.cjs +35 -48
- package/build/state/media-editor-state-provider.cjs.map +1 -7
- package/build/state/types.cjs +12 -31
- package/build/state/types.cjs.map +1 -7
- package/build/state/use-media-editor-state.cjs +261 -281
- package/build/state/use-media-editor-state.cjs.map +1 -7
- package/build/store/actions.cjs +17 -44
- package/build/store/actions.cjs.map +1 -7
- package/build/store/constants.cjs +8 -29
- package/build/store/constants.cjs.map +1 -7
- package/build/store/index.cjs +33 -40
- package/build/store/index.cjs.map +1 -7
- package/build/store/reducer.cjs +28 -50
- package/build/store/reducer.cjs.map +1 -7
- package/build/store/selectors.cjs +16 -41
- package/build/store/selectors.cjs.map +1 -7
- package/build/utils/get-media-type.cjs +18 -41
- package/build/utils/get-media-type.cjs.map +1 -7
- package/build/utils/index.cjs +9 -28
- package/build-module/components/media-editor/index.mjs +490 -682
- package/build-module/components/media-editor/index.mjs.map +1 -7
- package/build-module/components/media-editor/use-crop-options.mjs +38 -33
- package/build-module/components/media-editor/use-crop-options.mjs.map +1 -7
- package/build-module/components/media-editor/use-save-media-editor.mjs +89 -157
- package/build-module/components/media-editor/use-save-media-editor.mjs.map +1 -7
- package/build-module/components/media-editor-canvas/index.mjs +97 -95
- package/build-module/components/media-editor-canvas/index.mjs.map +1 -7
- package/build-module/components/media-editor-crop-panel/index.mjs +44 -43
- package/build-module/components/media-editor-crop-panel/index.mjs.map +1 -7
- package/build-module/components/media-editor-fine-rotation/index.mjs +39 -45
- package/build-module/components/media-editor-fine-rotation/index.mjs.map +1 -7
- package/build-module/components/media-editor-image-controls/index.mjs +172 -237
- package/build-module/components/media-editor-image-controls/index.mjs.map +1 -7
- package/build-module/components/media-editor-keyboard-shortcuts-modal/index.mjs +112 -137
- package/build-module/components/media-editor-keyboard-shortcuts-modal/index.mjs.map +1 -7
- package/build-module/components/media-editor-modal/build-modifiers.mjs +103 -64
- package/build-module/components/media-editor-modal/build-modifiers.mjs.map +1 -7
- package/build-module/components/media-editor-modal/index.mjs +88 -122
- package/build-module/components/media-editor-modal/index.mjs.map +1 -7
- package/build-module/components/media-editor-provider/index.mjs +26 -28
- package/build-module/components/media-editor-provider/index.mjs.map +1 -7
- package/build-module/components/media-form/index.mjs +69 -54
- package/build-module/components/media-form/index.mjs.map +1 -7
- package/build-module/components/media-preview/index.mjs +105 -89
- package/build-module/components/media-preview/index.mjs.map +1 -7
- package/build-module/components/rotation-ruler/index.mjs +161 -164
- package/build-module/components/rotation-ruler/index.mjs.map +1 -7
- package/build-module/components/rotation-ruler/use-ruler-drag.mjs +125 -122
- package/build-module/components/rotation-ruler/use-ruler-drag.mjs.map +1 -7
- package/build-module/hooks/use-crop-gesture-handlers.mjs +76 -50
- package/build-module/hooks/use-crop-gesture-handlers.mjs.map +1 -7
- package/build-module/image-editor/core/camera.mjs +245 -178
- package/build-module/image-editor/core/camera.mjs.map +1 -7
- package/build-module/image-editor/core/constants.mjs +110 -64
- package/build-module/image-editor/core/constants.mjs.map +1 -7
- package/build-module/image-editor/core/containment.mjs +265 -237
- package/build-module/image-editor/core/containment.mjs.map +1 -7
- package/build-module/image-editor/core/crop-rect.mjs +29 -20
- package/build-module/image-editor/core/crop-rect.mjs.map +1 -7
- package/build-module/image-editor/core/export/canvas-renderer.mjs +155 -105
- package/build-module/image-editor/core/export/canvas-renderer.mjs.map +1 -7
- package/build-module/image-editor/core/index.mjs +5 -34
- package/build-module/image-editor/core/interaction-controller.mjs +579 -628
- package/build-module/image-editor/core/interaction-controller.mjs.map +1 -7
- package/build-module/image-editor/core/math/rotation.mjs +21 -10
- package/build-module/image-editor/core/math/rotation.mjs.map +1 -7
- package/build-module/image-editor/core/math/sanitize.mjs +116 -52
- package/build-module/image-editor/core/math/sanitize.mjs.map +1 -7
- package/build-module/image-editor/core/setter-helpers.mjs +52 -35
- package/build-module/image-editor/core/setter-helpers.mjs.map +1 -7
- package/build-module/image-editor/core/source-region.mjs +210 -160
- package/build-module/image-editor/core/source-region.mjs.map +1 -7
- package/build-module/image-editor/core/state.mjs +271 -243
- package/build-module/image-editor/core/state.mjs.map +1 -7
- package/build-module/image-editor/core/stencil-math.mjs +185 -178
- package/build-module/image-editor/core/stencil-math.mjs.map +1 -7
- package/build-module/image-editor/core/transform-style.mjs +34 -23
- package/build-module/image-editor/core/transform-style.mjs.map +1 -7
- package/build-module/image-editor/core/transforms/pipeline.mjs +29 -11
- package/build-module/image-editor/core/transforms/pipeline.mjs.map +1 -7
- package/build-module/image-editor/core/types.mjs +0 -1
- package/build-module/image-editor/core/viewport-state.mjs +26 -20
- package/build-module/image-editor/core/viewport-state.mjs.map +1 -7
- package/build-module/image-editor/index.mjs +3 -38
- package/build-module/image-editor/react/components/cropper-provider.mjs +38 -21
- package/build-module/image-editor/react/components/cropper-provider.mjs.map +1 -7
- package/build-module/image-editor/react/components/cropper.mjs +550 -696
- package/build-module/image-editor/react/components/cropper.mjs.map +1 -7
- package/build-module/image-editor/react/components/index.mjs +1 -7
- package/build-module/image-editor/react/components/overlays/dimensions-overlay.mjs +130 -135
- package/build-module/image-editor/react/components/overlays/dimensions-overlay.mjs.map +1 -7
- package/build-module/image-editor/react/components/overlays/dimming-overlay.mjs +24 -35
- package/build-module/image-editor/react/components/overlays/dimming-overlay.mjs.map +1 -7
- package/build-module/image-editor/react/components/overlays/grid-overlay.mjs +54 -64
- package/build-module/image-editor/react/components/overlays/grid-overlay.mjs.map +1 -7
- package/build-module/image-editor/react/components/stencils/rectangle-stencil.mjs +355 -407
- package/build-module/image-editor/react/components/stencils/rectangle-stencil.mjs.map +1 -7
- package/build-module/image-editor/react/components/viewport-provider.mjs +15 -22
- package/build-module/image-editor/react/components/viewport-provider.mjs.map +1 -7
- package/build-module/image-editor/react/hooks/build-cropper-setters.mjs +72 -43
- package/build-module/image-editor/react/hooks/build-cropper-setters.mjs.map +1 -7
- package/build-module/image-editor/react/hooks/index.mjs +2 -7
- package/build-module/image-editor/react/hooks/use-aria-announcer.mjs +83 -119
- package/build-module/image-editor/react/hooks/use-aria-announcer.mjs.map +1 -7
- package/build-module/image-editor/react/hooks/use-cropper-controller.mjs +75 -0
- package/build-module/image-editor/react/hooks/use-cropper-controller.mjs.map +1 -0
- package/build-module/image-editor/react/hooks/use-interaction.mjs +175 -183
- package/build-module/image-editor/react/hooks/use-interaction.mjs.map +1 -7
- package/build-module/image-editor/react/hooks/use-transform-style.mjs +15 -9
- package/build-module/image-editor/react/hooks/use-transform-style.mjs.map +1 -7
- package/build-module/image-editor/react/hooks/use-viewport-state.mjs +32 -26
- package/build-module/image-editor/react/hooks/use-viewport-state.mjs.map +1 -7
- package/build-module/image-editor/react/visually-hidden-style.mjs +17 -14
- package/build-module/image-editor/react/visually-hidden-style.mjs.map +1 -7
- package/build-module/index.mjs +3 -10
- package/build-module/lock-unlock.mjs +5 -10
- package/build-module/lock-unlock.mjs.map +1 -7
- package/build-module/private-apis.mjs +8 -9
- package/build-module/private-apis.mjs.map +1 -7
- package/build-module/state/aspect-ratio-presets.mjs +48 -0
- package/build-module/state/aspect-ratio-presets.mjs.map +1 -0
- package/build-module/state/composite-reducer.mjs +114 -75
- package/build-module/state/composite-reducer.mjs.map +1 -7
- package/build-module/state/index.mjs +5 -25
- package/build-module/state/media-editor-state-provider.mjs +29 -24
- package/build-module/state/media-editor-state-provider.mjs.map +1 -7
- package/build-module/state/types.mjs +8 -7
- package/build-module/state/types.mjs.map +1 -7
- package/build-module/state/use-media-editor-state.mjs +256 -273
- package/build-module/state/use-media-editor-state.mjs.map +1 -7
- package/build-module/store/actions.mjs +12 -19
- package/build-module/store/actions.mjs.map +1 -7
- package/build-module/store/constants.mjs +4 -5
- package/build-module/store/constants.mjs.map +1 -7
- package/build-module/store/index.mjs +8 -9
- package/build-module/store/index.mjs.map +1 -7
- package/build-module/store/reducer.mjs +23 -26
- package/build-module/store/reducer.mjs.map +1 -7
- package/build-module/store/selectors.mjs +8 -13
- package/build-module/store/selectors.mjs.map +1 -7
- package/build-module/utils/get-media-type.mjs +14 -17
- package/build-module/utils/get-media-type.mjs.map +1 -7
- package/build-module/utils/index.mjs +1 -6
- package/build-style/style-rtl.css +41 -4
- package/build-style/style.css +41 -4
- package/build-types/components/media-editor/index.d.ts +6 -1
- package/build-types/components/media-editor/index.d.ts.map +1 -1
- package/build-types/components/media-editor/use-crop-options.d.ts +0 -1
- package/build-types/components/media-editor/use-crop-options.d.ts.map +1 -1
- package/build-types/components/media-editor/use-save-media-editor.d.ts.map +1 -1
- package/build-types/components/media-editor-canvas/index.d.ts.map +1 -1
- package/build-types/components/media-editor-crop-panel/index.d.ts.map +1 -1
- package/build-types/components/media-editor-image-controls/index.d.ts.map +1 -1
- package/build-types/components/media-editor-modal/build-modifiers.d.ts +6 -5
- package/build-types/components/media-editor-modal/build-modifiers.d.ts.map +1 -1
- package/build-types/components/media-editor-modal/index.d.ts +7 -2
- package/build-types/components/media-editor-modal/index.d.ts.map +1 -1
- package/build-types/components/media-editor-provider/index.d.ts +7 -1
- package/build-types/components/media-editor-provider/index.d.ts.map +1 -1
- package/build-types/components/media-form/index.d.ts +5 -2
- package/build-types/components/media-form/index.d.ts.map +1 -1
- package/build-types/components/media-preview/index.d.ts.map +1 -1
- package/build-types/components/rotation-ruler/use-ruler-drag.d.ts.map +1 -1
- package/build-types/image-editor/core/constants.d.ts +0 -1
- package/build-types/image-editor/core/constants.d.ts.map +1 -1
- package/build-types/image-editor/core/index.d.ts +1 -1
- package/build-types/image-editor/core/index.d.ts.map +1 -1
- package/build-types/image-editor/core/setter-helpers.d.ts +1 -1
- package/build-types/image-editor/core/types.d.ts +1 -1
- package/build-types/image-editor/index.d.ts +7 -6
- package/build-types/image-editor/index.d.ts.map +1 -1
- package/build-types/image-editor/react/components/cropper-provider.d.ts +2 -2
- package/build-types/image-editor/react/components/cropper-provider.d.ts.map +1 -1
- package/build-types/image-editor/react/components/cropper.d.ts +5 -14
- package/build-types/image-editor/react/components/cropper.d.ts.map +1 -1
- package/build-types/image-editor/react/hooks/build-cropper-setters.d.ts +2 -2
- package/build-types/image-editor/react/hooks/index.d.ts +2 -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 → use-cropper-controller.d.ts} +12 -12
- package/build-types/image-editor/react/hooks/use-cropper-controller.d.ts.map +1 -0
- package/build-types/state/aspect-ratio-presets.d.ts +7 -0
- package/build-types/state/aspect-ratio-presets.d.ts.map +1 -0
- package/build-types/state/composite-reducer.d.ts +2 -2
- package/build-types/state/composite-reducer.d.ts.map +1 -1
- package/build-types/state/index.d.ts +2 -1
- package/build-types/state/index.d.ts.map +1 -1
- package/build-types/state/types.d.ts +36 -6
- package/build-types/state/types.d.ts.map +1 -1
- package/build-types/state/use-media-editor-state.d.ts +16 -5
- package/build-types/state/use-media-editor-state.d.ts.map +1 -1
- package/package.json +35 -24
- package/src/components/media-editor/index.tsx +226 -183
- package/src/components/media-editor/style.scss +19 -0
- package/src/components/media-editor/use-crop-options.ts +5 -4
- package/src/components/media-editor/use-save-media-editor.ts +2 -6
- package/src/components/media-editor-canvas/index.tsx +18 -28
- package/src/components/media-editor-crop-panel/index.tsx +17 -9
- package/src/components/media-editor-image-controls/index.tsx +4 -2
- package/src/components/media-editor-image-controls/style.scss +1 -1
- package/src/components/media-editor-modal/build-modifiers.ts +13 -7
- package/src/components/media-editor-modal/index.tsx +8 -1
- package/src/components/media-editor-modal/style.scss +1 -1
- package/src/components/media-editor-provider/index.tsx +8 -1
- package/src/components/media-form/index.tsx +48 -42
- package/src/components/media-preview/index.tsx +68 -25
- package/src/components/media-preview/style.scss +16 -2
- package/src/components/rotation-ruler/style.scss +6 -2
- package/src/components/rotation-ruler/use-ruler-drag.ts +6 -11
- package/src/image-editor/README.md +8 -8
- package/src/image-editor/core/constants.ts +0 -13
- package/src/image-editor/core/index.ts +1 -5
- package/src/image-editor/core/setter-helpers.ts +1 -1
- package/src/image-editor/core/types.ts +1 -1
- package/src/image-editor/docs/architecture.md +5 -1
- package/src/image-editor/docs/recipes.md +3 -3
- package/src/image-editor/index.ts +7 -16
- package/src/image-editor/react/components/cropper-provider.tsx +5 -5
- package/src/image-editor/react/components/cropper.tsx +20 -42
- package/src/image-editor/react/hooks/build-cropper-setters.ts +2 -2
- package/src/image-editor/react/hooks/index.ts +2 -2
- package/src/image-editor/react/hooks/{use-cropper-reducer.ts → use-cropper-controller.ts} +11 -11
- package/src/state/aspect-ratio-presets.ts +18 -0
- package/src/state/composite-reducer.ts +26 -13
- package/src/state/index.ts +3 -0
- package/src/state/types.ts +39 -11
- package/src/state/use-media-editor-state.ts +53 -16
- package/build/image-editor/core/index.cjs.map +0 -7
- package/build/image-editor/core/types.cjs.map +0 -7
- package/build/image-editor/index.cjs.map +0 -7
- package/build/image-editor/react/components/index.cjs.map +0 -7
- package/build/image-editor/react/hooks/index.cjs.map +0 -7
- package/build/image-editor/react/hooks/use-cropper-reducer.cjs +0 -113
- package/build/image-editor/react/hooks/use-cropper-reducer.cjs.map +0 -7
- package/build/index.cjs.map +0 -7
- package/build/state/index.cjs.map +0 -7
- package/build/utils/index.cjs.map +0 -7
- package/build-module/image-editor/core/index.mjs.map +0 -7
- package/build-module/image-editor/core/types.mjs.map +0 -7
- package/build-module/image-editor/index.mjs.map +0 -7
- package/build-module/image-editor/react/components/index.mjs.map +0 -7
- package/build-module/image-editor/react/hooks/index.mjs.map +0 -7
- package/build-module/image-editor/react/hooks/use-cropper-reducer.mjs +0 -100
- package/build-module/image-editor/react/hooks/use-cropper-reducer.mjs.map +0 -7
- package/build-module/index.mjs.map +0 -7
- package/build-module/state/index.mjs.map +0 -7
- package/build-module/utils/index.mjs.map +0 -7
- package/build-types/image-editor/react/hooks/use-cropper-reducer.d.ts.map +0 -1
- package/global.d.ts +0 -5
- package/src/components/media-editor/test/restore-original.browser.test.tsx +0 -227
- package/src/components/media-editor/test/use-crop-options.jsdom.test.tsx +0 -106
- package/src/components/media-editor-crop-panel/test/index.jsdom.test.tsx +0 -72
- package/src/components/media-editor-image-controls/test/index.jsdom.test.tsx +0 -186
- package/src/components/media-editor-modal/test/build-modifiers.test.ts +0 -359
- package/src/components/media-editor-modal/test/index.jsdom.test.tsx +0 -182
- package/src/components/rotation-ruler/stories/index.story.tsx +0 -43
- package/src/components/rotation-ruler/test/index.jsdom.test.tsx +0 -140
- package/src/image-editor/core/export/test/canvas-renderer.jsdom.test.ts +0 -823
- package/src/image-editor/core/math/test/sanitize.ts +0 -242
- package/src/image-editor/core/test/camera.ts +0 -1218
- package/src/image-editor/core/test/interaction-controller.ts +0 -1299
- package/src/image-editor/core/test/preview-export-parity.ts +0 -249
- package/src/image-editor/core/test/render-camera-bridge.ts +0 -349
- package/src/image-editor/core/test/state.ts +0 -876
- package/src/image-editor/core/test/stencil-math.ts +0 -665
- package/src/image-editor/core/transforms/test/pipeline.ts +0 -267
- package/src/image-editor/react/components/stencils/test/rectangle-stencil.browser.test.tsx +0 -438
- package/src/image-editor/react/components/test/cropper.browser.test.tsx +0 -1462
- package/src/image-editor/react/hooks/test/use-aria-announcer.jsdom.test.ts +0 -491
- package/src/image-editor/react/hooks/test/use-cropper-reducer.jsdom.test.ts +0 -1049
- package/src/image-editor/react/hooks/test/use-interaction.jsdom.test.ts +0 -213
- package/src/image-editor/react/hooks/test/use-transform-style.jsdom.test.ts +0 -140
- package/src/image-editor/stories/rectangle-crop.story.tsx +0 -1073
- package/src/image-editor/stories/style.module.css +0 -65
- package/src/state/test/use-media-editor-state.browser.test.tsx +0 -79
- package/src/state/test/use-media-editor-state.jsdom.test.ts +0 -386
- package/src/store/test/reducer.ts +0 -64
- package/tsconfig.build.json +0 -26
- package/tsconfig.build.tsbuildinfo +0 -1
- package/tsconfig.json +0 -37
|
@@ -11,10 +11,13 @@ export interface MediaFormProps {
|
|
|
11
11
|
* MediaForm component for editing media metadata.
|
|
12
12
|
*
|
|
13
13
|
* Renders a DataForm with fields for editing media properties like
|
|
14
|
-
* title, alt text, caption, description, etc.
|
|
14
|
+
* title, alt text, caption, description, etc. The fields are laid out with
|
|
15
|
+
* the `form` prop, else the form of the provider settings, else a default
|
|
16
|
+
* form of the core attachment fields.
|
|
15
17
|
*
|
|
16
18
|
* @param props - Component props.
|
|
17
|
-
* @param props.form - Optional form configuration
|
|
19
|
+
* @param props.form - Optional form configuration, which takes precedence
|
|
20
|
+
* over the form of the provider settings.
|
|
18
21
|
* @param props.header - Optional header content to display above the form.
|
|
19
22
|
* @return The MediaForm component.
|
|
20
23
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/media-form/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/media-form/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAOjD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAiCvC;;GAEG;AACH,MAAM,WAAW,cAAc;IAC9B,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,MAAM,CAAC,EAAE,SAAS,CAAC;CACnB;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,OAAO,UAAU,SAAS,CAAE,EAClC,IAAI,EAAE,aAAa,EACnB,MAAM,GACN,EAAE,cAAc,+BAkChB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/media-preview/index.tsx"],"names":[],"mappings":"AAMA;;GAEG;AACH,MAAM,WAAW,iBAAiB;IACjC,CAAE,GAAG,EAAE,MAAM,GAAI,GAAG,CAAC;CACrB;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/media-preview/index.tsx"],"names":[],"mappings":"AAMA;;GAEG;AAC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I,CAAC;IACpE,WAAW,EAAE,CAAE,KAAK,EAAE,KAAK,CAAC,YAAY,CAAE,WAAW,CAAE,KAAM,IAAI,CAAC;IAClE,eAAe,EAAE,CAAE,KAAK,EAAE,KAAK,CAAC,YAAY,CAAE,WAAW,CAAE,KAAM,IAAI,CAAC;CACtE;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,YAAY,CAC3B,OAAO,EAAE,mBAAmB,GAC1B,iBAAiB,CAiJnB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/image-editor/core/constants.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/image-editor/core/constants.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAwB,YAAY,EAAE,MAAM,SAAS,CAAC;AAElE;;;;GAIG;AACH,eAAO,MAAM,QAAQ,IAAI,CAAC;AAC1B;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,MAAM,CAAC;AACrC,eAAO,MAAM,QAAQ,KAAK,CAAC;AAE3B;;;;;GAKG;AACH,eAAO,MAAM,eAAe,KAAK,CAAC;AAElC;;;;;;;;GAQG;AACH,eAAO,MAAM,kBAAkB,KAAK,CAAC;AAErC;;;;;;GAMG;AACH,eAAO,MAAM,yBAAyB,MAAM,CAAC;AAE7C;;;GAGG;AACH,eAAO,MAAM,cAAc,IAAI,CAAC;AAEhC;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,IAAI,CAAC;AAE1C;;;GAGG;AACH,eAAO,MAAM,wBAAwB,SAAS,CAAC;AAE/C,iFAAiF;AACjF,eAAO,MAAM,qBAAqB,OAAO,CAAC;AAE1C,8DAA8D;AAC9D,eAAO,MAAM,8BAA8B,KAAK,CAAC;AAEjD;;;GAGG;AACH,eAAO,MAAM,mBAAmB,KAAK,CAAC;AAmBtC,eAAO,MAAM,aAAa,EAAE,YAU3B,CAAC;AAEF;;GAEG;AACH,MAAM,WAAW,iBAAiB;IACjC,4CAA4C;IAC5C,KAAK,EAAE,MAAM,CAAC;IACd,oEAAoE;IACpE,KAAK,EAAE,MAAM,CAAC;CACd;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH;;;GAGG;AACH,eAAO,MAAM,qBAAqB,KAAK,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export type { CropperState, CropperAction, TransformOperation, NormalizedPoint, NormalizedRect, Size, Flip, StencilProps, HandlePosition, } from './types';
|
|
2
|
-
export { DEFAULT_STATE,
|
|
2
|
+
export { DEFAULT_STATE, ORIGINAL_ASPECT_RATIO } from './constants';
|
|
3
3
|
export type { AspectRatioPreset } from './constants';
|
|
4
4
|
export { cropperReducer, enforceContainment, areCropperStatesEqual, isStateDirty, } from './state';
|
|
5
5
|
export { getSourceRegion, getSourceRegionPercent } from './source-region';
|
|
@@ -1 +1 @@
|
|
|
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,
|
|
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,EAAE,aAAa,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AACnE,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"}
|
|
@@ -9,7 +9,7 @@ import type { CropperState, CropperAction } from './types';
|
|
|
9
9
|
* the crop center. Returns `null` when the clamped zoom matches the
|
|
10
10
|
* current zoom (no-op).
|
|
11
11
|
*
|
|
12
|
-
* Extracted so multiple hooks (the pure `
|
|
12
|
+
* Extracted so multiple hooks (the pure `useCropperController` and the
|
|
13
13
|
* composite `useMediaEditorState`) can share the math without
|
|
14
14
|
* duplicating it.
|
|
15
15
|
*
|
|
@@ -109,7 +109,7 @@ export interface CropperState {
|
|
|
109
109
|
*
|
|
110
110
|
* This type is intentionally not exported from the image-editor public barrel.
|
|
111
111
|
* Consumers should drive state through the controller returned by
|
|
112
|
-
* `
|
|
112
|
+
* `useCropperController()` (or a composite store) or through serializable
|
|
113
113
|
* `TransformOperation` values.
|
|
114
114
|
*/
|
|
115
115
|
export type CropperAction =
|
|
@@ -3,14 +3,15 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Keep this barrel explicit so implementation details from `core/`,
|
|
5
5
|
* `react/hooks/`, or `react/components/` do not become supported API by
|
|
6
|
-
* accident.
|
|
7
|
-
*
|
|
6
|
+
* accident. The media editor's own state code imports the reducer-level
|
|
7
|
+
* helpers from `./core` and `./react/hooks` directly, as the package's
|
|
8
|
+
* components already do; everyone else uses what is here.
|
|
8
9
|
*/
|
|
9
|
-
export {
|
|
10
|
+
export { useCropperController } from './react/hooks';
|
|
10
11
|
export { Cropper, CropperProvider, useCropper } from './react/components';
|
|
11
|
-
export type { CropperController
|
|
12
|
+
export type { CropperController } from './react/hooks';
|
|
12
13
|
export type { CropperProps } from './react/components';
|
|
13
|
-
export type { CropperState,
|
|
14
|
-
export {
|
|
14
|
+
export type { CropperState, TransformOperation, NormalizedPoint, NormalizedRect, Size, Flip, StencilProps, HandlePosition, } from './core';
|
|
15
|
+
export { ORIGINAL_ASPECT_RATIO, getSourceRegion, getSourceRegionPercent, stateFromPipeline, exportCroppedImage, applyToCanvas, } from './core';
|
|
15
16
|
export type { AspectRatioPreset, SourceRegion, SourceRegionPercent, } from './core';
|
|
16
17
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/image-editor/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/image-editor/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAC1E,YAAY,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AACvD,YAAY,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAGvD,YAAY,EACX,YAAY,EACZ,kBAAkB,EAClB,eAAe,EACf,cAAc,EACd,IAAI,EACJ,IAAI,EACJ,YAAY,EACZ,cAAc,GACd,MAAM,QAAQ,CAAC;AAIhB,OAAO,EACN,qBAAqB,EACrB,eAAe,EACf,sBAAsB,EACtB,iBAAiB,EACjB,kBAAkB,EAClB,aAAa,GACb,MAAM,QAAQ,CAAC;AAChB,YAAY,EACX,iBAAiB,EACjB,YAAY,EACZ,mBAAmB,GACnB,MAAM,QAAQ,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type CropperController } from '../hooks/use-cropper-
|
|
1
|
+
import { type CropperController } from '../hooks/use-cropper-controller';
|
|
2
2
|
import type { CropperState } from '../../core/types';
|
|
3
3
|
/**
|
|
4
4
|
* Props for the CropperProvider component.
|
|
@@ -10,7 +10,7 @@ interface CropperProviderProps {
|
|
|
10
10
|
children: React.ReactNode;
|
|
11
11
|
}
|
|
12
12
|
/**
|
|
13
|
-
* Convenience context provider that wraps `
|
|
13
|
+
* Convenience context provider that wraps `useCropperController`.
|
|
14
14
|
*
|
|
15
15
|
* Provides the pure cropper controller (state + setters, NO undo
|
|
16
16
|
* history) to all descendant components via React context.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cropper-provider.d.ts","sourceRoot":"","sources":["../../../../src/image-editor/react/components/cropper-provider.tsx"],"names":[],"mappings":"AACA,OAAO,EAEN,KAAK,iBAAiB,EACtB,MAAM,
|
|
1
|
+
{"version":3,"file":"cropper-provider.d.ts","sourceRoot":"","sources":["../../../../src/image-editor/react/components/cropper-provider.tsx"],"names":[],"mappings":"AACA,OAAO,EAEN,KAAK,iBAAiB,EACtB,MAAM,iCAAiC,CAAC;AACzC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAUrD;;GAEG;AACH,UAAU,oBAAoB;IAC7B,6DAA6D;IAC7D,YAAY,CAAC,EAAE,OAAO,CAAE,YAAY,CAAE,CAAC;IACvC,wBAAwB;IACxB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC1B;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,eAAe,CAAE,EAChC,YAAY,EACZ,QAAQ,GACR,EAAE,oBAAoB,+BAQtB;AAED;;;;;;;GAOG;AACH,wBAAgB,UAAU,IAAI,iBAAiB,CAQ9C"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { CropperController } from '../hooks/use-cropper-
|
|
1
|
+
import type { StencilProps, Size } from '../../core/types';
|
|
2
|
+
import type { CropperController } from '../hooks/use-cropper-controller';
|
|
3
3
|
/**
|
|
4
4
|
* Props for the Cropper component.
|
|
5
5
|
*/
|
|
6
6
|
export interface CropperProps {
|
|
7
7
|
/** Image source URL. */
|
|
8
8
|
src: string;
|
|
9
|
-
/** The cropper controller from `
|
|
9
|
+
/** The cropper controller from `useCropperController` or a composite store. */
|
|
10
10
|
controller: CropperController;
|
|
11
11
|
/** Stencil component for the crop area. Defaults to RectangleStencil. */
|
|
12
12
|
stencil?: React.ComponentType<StencilProps>;
|
|
@@ -41,17 +41,8 @@ export interface CropperProps {
|
|
|
41
41
|
disabled?: boolean;
|
|
42
42
|
/** Callback fired when the image is loaded. */
|
|
43
43
|
onImageLoaded?: (size: Size) => void;
|
|
44
|
-
/**
|
|
45
|
-
|
|
46
|
-
* during drags, so keep the handler light — no heavy work, no
|
|
47
|
-
* expensive parent re-renders. For commit-style events (drag end,
|
|
48
|
-
* settled crop), use `onGestureEnd` instead.
|
|
49
|
-
*
|
|
50
|
-
* Useful for lightweight syncing with external tools, analytics,
|
|
51
|
-
* or AI agents. Receives the full state so consumers can derive
|
|
52
|
-
* whatever they need.
|
|
53
|
-
*/
|
|
54
|
-
onStateChange?: (state: CropperState) => void;
|
|
44
|
+
/** Callback fired when the image fails to load. */
|
|
45
|
+
onImageError?: () => void;
|
|
55
46
|
/** Fires when a continuous gesture begins (pan drag, handle resize, pinch zoom). */
|
|
56
47
|
onGestureStart?: () => void;
|
|
57
48
|
/** Fires when a continuous gesture ends (pointerup, resize settle). */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cropper.d.ts","sourceRoot":"","sources":["../../../../src/image-editor/react/components/cropper.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"cropper.d.ts","sourceRoot":"","sources":["../../../../src/image-editor/react/components/cropper.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAEX,YAAY,EACZ,IAAI,EAEJ,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,C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* The named cropper setters shared by every hook that drives the
|
|
4
|
-
* cropper reducer — the pure `
|
|
4
|
+
* cropper reducer — the pure `useCropperController` and any composite
|
|
5
5
|
* store that delegates cropper actions (e.g. `useMediaEditorState`).
|
|
6
6
|
*
|
|
7
7
|
* `setImage` and `reset` are intentionally NOT included: each hook
|
|
@@ -24,7 +24,7 @@ export interface CropperSetters {
|
|
|
24
24
|
* Build the named cropper setters from a dispatch function and a
|
|
25
25
|
* state getter. The two consuming hooks differ in how they dispatch:
|
|
26
26
|
*
|
|
27
|
-
* - `
|
|
27
|
+
* - `useCropperController` dispatches directly into its `useReducer`.
|
|
28
28
|
* - `useMediaEditorState` wraps cropper actions in a composite
|
|
29
29
|
* `CROPPER` envelope so the history machinery can record them.
|
|
30
30
|
*
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export type { CropperController } from './use-cropper-
|
|
1
|
+
export { useCropperController } from './use-cropper-controller';
|
|
2
|
+
export type { CropperController } from './use-cropper-controller';
|
|
3
3
|
export { buildCropperSetters } from './build-cropper-setters';
|
|
4
4
|
export type { CropperSetters } from './build-cropper-setters';
|
|
5
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/image-editor/react/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/image-editor/react/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAChE,YAAY,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,YAAY,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC"}
|
|
@@ -24,23 +24,23 @@ export interface CropperController extends CropperSetters {
|
|
|
24
24
|
*/
|
|
25
25
|
getCroppedImage: (mimeType?: string, quality?: number) => Promise<Blob>;
|
|
26
26
|
/**
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
* cropper hook ignores it (no-op).
|
|
27
|
+
* Called by `Cropper` whenever its rendered image size changes; not for
|
|
28
|
+
* consumers to call. A composite controller uses the size to reshape the
|
|
29
|
+
* crop for an aspect ratio. The pure cropper hook ignores it.
|
|
31
30
|
*/
|
|
32
31
|
setVisualSize: (size: Size) => void;
|
|
33
32
|
/**
|
|
34
|
-
*
|
|
35
|
-
* resize
|
|
36
|
-
* composite
|
|
37
|
-
*
|
|
38
|
-
*
|
|
33
|
+
* Called by `Cropper` when the viewport changes (window or canvas
|
|
34
|
+
* resize); not for consumers to call. Like `setCropRect`, except that a
|
|
35
|
+
* composite controller records no undo entry for it, since a viewport
|
|
36
|
+
* reshape is not an editor action. The pure cropper hook aliases it to
|
|
37
|
+
* `setCropRect`.
|
|
39
38
|
*/
|
|
40
39
|
adjustCropRectForViewport: (rect: NormalizedRect) => void;
|
|
41
40
|
}
|
|
42
41
|
/**
|
|
43
|
-
*
|
|
42
|
+
* Controller hook for the image cropper: the state, the named setters and
|
|
43
|
+
* the export helpers, without history.
|
|
44
44
|
*
|
|
45
45
|
* Wraps the framework-agnostic `cropperReducer` and exposes named
|
|
46
46
|
* setters (built from the shared `buildCropperSetters` factory).
|
|
@@ -51,5 +51,5 @@ export interface CropperController extends CropperSetters {
|
|
|
51
51
|
* @param initialState Optional partial state to merge with DEFAULT_STATE.
|
|
52
52
|
* @return The cropper controller — state, setters, and helpers.
|
|
53
53
|
*/
|
|
54
|
-
export declare function
|
|
55
|
-
//# sourceMappingURL=use-cropper-
|
|
54
|
+
export declare function useCropperController(initialState?: Partial<CropperState>): CropperController;
|
|
55
|
+
//# sourceMappingURL=use-cropper-controller.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-cropper-controller.d.ts","sourceRoot":"","sources":["../../../../src/image-editor/react/hooks/use-cropper-controller.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EACX,YAAY,EAEZ,cAAc,EACd,IAAI,EACJ,MAAM,kBAAkB,CAAC;AAQ1B,OAAO,EAEN,KAAK,cAAc,EACnB,MAAM,yBAAyB,CAAC;AAEjC;;;;;;;;GAQG;AACH,MAAM,WAAW,iBAAkB,SAAQ,cAAc;IACxD,6CAA6C;IAC7C,KAAK,EAAE,YAAY,CAAC;IACpB,mDAAmD;IACnD,QAAQ,EAAE,CAAE,KAAK,EAAE,YAAY,CAAE,OAAO,CAAE,KAAM,IAAI,CAAC;IACrD,iEAAiE;IACjE,KAAK,EAAE,CAAE,UAAU,CAAC,EAAE,OAAO,CAAE,YAAY,CAAE,KAAM,IAAI,CAAC;IACxD,gEAAgE;IAChE,OAAO,EAAE,OAAO,CAAC;IACjB;;;OAGG;IACH,eAAe,EAAE,CAAE,QAAQ,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,KAAM,OAAO,CAAE,IAAI,CAAE,CAAC;IAC5E;;;;OAIG;IACH,aAAa,EAAE,CAAE,IAAI,EAAE,IAAI,KAAM,IAAI,CAAC;IACtC;;;;;;OAMG;IACH,yBAAyB,EAAE,CAAE,IAAI,EAAE,cAAc,KAAM,IAAI,CAAC;CAC5D;AAaD;;;;;;;;;;;;GAYG;AACH,wBAAgB,oBAAoB,CACnC,YAAY,CAAC,EAAE,OAAO,CAAE,YAAY,CAAE,GACpC,iBAAiB,CA0GnB"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type AspectRatioPreset } from '../image-editor';
|
|
2
|
+
/**
|
|
3
|
+
* The presets the editor offers by default. The labels live here rather
|
|
4
|
+
* than in the cropper core, which has no user-facing strings.
|
|
5
|
+
*/
|
|
6
|
+
export declare const DEFAULT_ASPECT_RATIOS: AspectRatioPreset[];
|
|
7
|
+
//# sourceMappingURL=aspect-ratio-presets.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"aspect-ratio-presets.d.ts","sourceRoot":"","sources":["../../src/state/aspect-ratio-presets.ts"],"names":[],"mappings":"AACA,OAAO,EAAyB,KAAK,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAEhF;;;GAGG;AACH,eAAO,MAAM,qBAAqB,EAAE,iBAAiB,EAUpD,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { CropperState } from '../image-editor';
|
|
2
2
|
import { type MediaEditorAction, type MediaEditorState } from './types';
|
|
3
3
|
/**
|
|
4
4
|
* Pure composite reducer for the media editor.
|
|
@@ -27,7 +27,7 @@ export declare function mediaEditorReducer(state: MediaEditorState, action: Medi
|
|
|
27
27
|
export declare function areMediaEditorStatesEqual(a: MediaEditorState, b: MediaEditorState): boolean;
|
|
28
28
|
/**
|
|
29
29
|
* Build the composite state a session starts from: the given cropper
|
|
30
|
-
* slice
|
|
30
|
+
* slice, default crop options, and no edits.
|
|
31
31
|
*
|
|
32
32
|
* @param cropper The cropper slice.
|
|
33
33
|
* @return Composite initial state.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"composite-reducer.d.ts","sourceRoot":"","sources":["../../src/state/composite-reducer.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"composite-reducer.d.ts","sourceRoot":"","sources":["../../src/state/composite-reducer.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAMpD,OAAO,EAGN,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACrB,MAAM,SAAS,CAAC;AAEjB;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,kBAAkB,CACjC,KAAK,EAAE,gBAAgB,EACvB,MAAM,EAAE,iBAAiB,GACvB,gBAAgB,CA0ElB;AAED;;;;;;;GAOG;AACH,wBAAgB,yBAAyB,CACxC,CAAC,EAAE,gBAAgB,EACnB,CAAC,EAAE,gBAAgB,GACjB,OAAO,CAST;AAED;;;;;;GAMG;AACH,wBAAgB,4BAA4B,CAC3C,OAAO,EAAE,YAAY,GACnB,gBAAgB,CAMlB"}
|
|
@@ -3,5 +3,6 @@ export type { MediaEditorSession } from './use-media-editor-state';
|
|
|
3
3
|
export { MediaEditorStateProvider, useMediaEditor, } from './media-editor-state-provider';
|
|
4
4
|
export { mediaEditorReducer, areMediaEditorStatesEqual, buildInitialMediaEditorState, } from './composite-reducer';
|
|
5
5
|
export { DEFAULT_CROP_OPTIONS } from './types';
|
|
6
|
-
export
|
|
6
|
+
export { DEFAULT_ASPECT_RATIOS } from './aspect-ratio-presets';
|
|
7
|
+
export type { CropOptionsSlice, EditsSlice, EditValue, MediaEditorState, MediaEditorAction, } from './types';
|
|
7
8
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/state/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,mBAAmB,EACnB,kBAAkB,GAClB,MAAM,0BAA0B,CAAC;AAClC,YAAY,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AACnE,OAAO,EACN,wBAAwB,EACxB,cAAc,GACd,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACN,kBAAkB,EAClB,yBAAyB,EACzB,4BAA4B,GAC5B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAC/C,YAAY,EACX,gBAAgB,EAChB,gBAAgB,EAChB,iBAAiB,GACjB,MAAM,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/state/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,mBAAmB,EACnB,kBAAkB,GAClB,MAAM,0BAA0B,CAAC;AAClC,YAAY,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AACnE,OAAO,EACN,wBAAwB,EACxB,cAAc,GACd,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACN,kBAAkB,EAClB,yBAAyB,EACzB,4BAA4B,GAC5B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAC/C,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,YAAY,EACX,gBAAgB,EAChB,UAAU,EACV,SAAS,EACT,gBAAgB,EAChB,iBAAiB,GACjB,MAAM,SAAS,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { CropperState, NormalizedRect, Size } from '../image-editor';
|
|
2
|
+
import type { CropperAction } from '../image-editor/core';
|
|
2
3
|
/**
|
|
3
4
|
* Sidebar control state for the cropper. Lives in the composite store
|
|
4
5
|
* so it participates in the same undo history as cropper geometry.
|
|
@@ -17,9 +18,25 @@ export interface CropOptionsSlice {
|
|
|
17
18
|
*/
|
|
18
19
|
export declare const DEFAULT_CROP_OPTIONS: CropOptionsSlice;
|
|
19
20
|
/**
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
21
|
+
* A value an edit can hold: plain data only, because the session
|
|
22
|
+
* compares values by content to tell a real change from a no-op.
|
|
23
|
+
* Anything else, such as a `Blob`, would compare equal to any other
|
|
24
|
+
* and the change would be dropped — keep bytes behind a URL instead.
|
|
25
|
+
*
|
|
26
|
+
* Objects must satisfy the index signature, so type a value with a
|
|
27
|
+
* `type` alias rather than an `interface`.
|
|
28
|
+
*/
|
|
29
|
+
export type EditValue = string | number | boolean | null | EditValue[] | {
|
|
30
|
+
[key: string]: EditValue;
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* Named edits other than crop, keyed by edit name (for example
|
|
34
|
+
* `my-plugin/vignette`). An edit that is not present means "no edit".
|
|
35
|
+
*/
|
|
36
|
+
export type EditsSlice = Record<string, EditValue>;
|
|
37
|
+
/**
|
|
38
|
+
* The full composite state for the media editor — cropper geometry,
|
|
39
|
+
* the sidebar control slice, and named edits.
|
|
23
40
|
*
|
|
24
41
|
* Every undo/redo snapshot is a full `MediaEditorState`. Slices stay
|
|
25
42
|
* referentially equal across actions that don't touch them.
|
|
@@ -27,6 +44,7 @@ export declare const DEFAULT_CROP_OPTIONS: CropOptionsSlice;
|
|
|
27
44
|
export interface MediaEditorState {
|
|
28
45
|
cropper: CropperState;
|
|
29
46
|
cropOptions: CropOptionsSlice;
|
|
47
|
+
edits: EditsSlice;
|
|
30
48
|
}
|
|
31
49
|
/**
|
|
32
50
|
* Composite reducer action union.
|
|
@@ -68,9 +86,21 @@ export type MediaEditorAction =
|
|
|
68
86
|
visualSize: Size;
|
|
69
87
|
};
|
|
70
88
|
}
|
|
71
|
-
/**
|
|
89
|
+
/**
|
|
90
|
+
* Put every slice back to its starting state, keeping the image:
|
|
91
|
+
* default geometry, default crop options, no edits. One action,
|
|
92
|
+
* so one undo entry.
|
|
93
|
+
*/
|
|
94
|
+
| {
|
|
95
|
+
type: 'RESET';
|
|
96
|
+
}
|
|
97
|
+
/** Set a named edit, or remove it when `value` is `undefined`. */
|
|
72
98
|
| {
|
|
73
|
-
type: '
|
|
99
|
+
type: 'SET_EDIT';
|
|
100
|
+
payload: {
|
|
101
|
+
name: string;
|
|
102
|
+
value: EditValue | undefined;
|
|
103
|
+
};
|
|
74
104
|
}
|
|
75
105
|
/**
|
|
76
106
|
* Replace the entire composite state with `payload`. Used by
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/state/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/state/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAC1E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,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AKG;GACD;IACA,IAAI,EAAE,2BAA2B,CAAC;IAClC,OAAO,EAAE,cAAc,CAAC;CACvB,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type CropperController, type CropperState } from '../image-editor';
|
|
2
|
-
import type { CropOptionsSlice } from './types';
|
|
2
|
+
import type { CropOptionsSlice, EditsSlice, EditValue } from './types';
|
|
3
3
|
/**
|
|
4
4
|
* Resolve an aspect-ratio preset value (the string the dropdown
|
|
5
5
|
* round-trips) into a numeric width/height ratio for the cropper.
|
|
@@ -39,8 +39,19 @@ export interface MediaEditorSession {
|
|
|
39
39
|
cropOptions: CropOptionsSlice;
|
|
40
40
|
/** Set the aspect-ratio preset. Atomic with the cropRect reshape. */
|
|
41
41
|
setAspectRatioValue: (presetKey: string) => void;
|
|
42
|
-
/**
|
|
43
|
-
|
|
42
|
+
/**
|
|
43
|
+
* Put every slice back to its starting state in one undo entry:
|
|
44
|
+
* default geometry and crop options, no edits. Keeps the image.
|
|
45
|
+
*/
|
|
46
|
+
reset: () => void;
|
|
47
|
+
/** The named edits other than crop, keyed by edit name. */
|
|
48
|
+
edits: EditsSlice;
|
|
49
|
+
/**
|
|
50
|
+
* Set a named edit, or remove it by passing `undefined`. Recorded
|
|
51
|
+
* in the session history like any crop change. Setting a value
|
|
52
|
+
* equal in content to the current one is a no-op.
|
|
53
|
+
*/
|
|
54
|
+
setEdit: (name: string, value: EditValue | undefined) => void;
|
|
44
55
|
/**
|
|
45
56
|
* Replace the image being edited. A different image starts a
|
|
46
57
|
* fresh session: default geometry and crop options, a clean
|
|
@@ -79,8 +90,8 @@ export interface MediaEditorSession {
|
|
|
79
90
|
* The media editor session.
|
|
80
91
|
*
|
|
81
92
|
* Owns the only undo/redo history for the editor. Cropper geometry
|
|
82
|
-
* actions
|
|
83
|
-
* reducer and the same history stack.
|
|
93
|
+
* actions, sidebar cropOptions actions and named edits flow through
|
|
94
|
+
* the same reducer and the same history stack.
|
|
84
95
|
*
|
|
85
96
|
* History semantics:
|
|
86
97
|
* - Each action's pre-state is pushed to the undo stack before the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-media-editor-state.d.ts","sourceRoot":"","sources":["../../src/state/use-media-editor-state.ts"],"names":[],"mappings":"AAOA,OAAO,
|
|
1
|
+
{"version":3,"file":"use-media-editor-state.d.ts","sourceRoot":"","sources":["../../src/state/use-media-editor-state.ts"],"names":[],"mappings":"AAOA,OAAO,EAGN,KAAK,iBAAiB,EACtB,KAAK,YAAY,EAGjB,MAAM,iBAAiB,CAAC;AAazB,OAAO,KAAK,EACX,gBAAgB,EAChB,UAAU,EACV,SAAS,EAGT,MAAM,SAAS,CAAC;AAEjB;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,kBAAkB,CACjC,SAAS,EAAE,MAAM,EACjB,YAAY,EAAE,YAAY,CAAE,OAAO,CAAE,GAAG,IAAI,GAC1C,MAAM,GAAG,SAAS,CAmBpB;AAaD;;;;;;;;;GASG;AACH,MAAM,WAAW,kBAAkB;IAClC;;;;;OAKG;IACH,OAAO,EAAE,iBAAiB,CAAC;IAC3B,6BAA6B;IAC7B,WAAW,EAAE,gBAAgB,CAAC;IAC9B,qEAAqE;IACrE,mBAAmB,EAAE,CAAE,SAAS,EAAE,MAAM,KAAM,IAAI,CAAC;IACnD;;;OAGG;IACH,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,2DAA2D;IAC3D,KAAK,EAAE,UAAU,CAAC;IAClB;;;;OAIG;IACH,OAAO,EAAE,CAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,GAAG,SAAS,KAAM,IAAI,CAAC;IAChE;;;;;OAKG;IACH,cAAc,EAAE,CAAE,KAAK,EAAE,YAAY,CAAE,OAAO,CAAE,KAAM,IAAI,CAAC;IAC3D;;;OAGG;IACH,OAAO,EAAE,OAAO,CAAC;IACjB;;;OAGG;IACH,cAAc,EAAE,OAAO,CAAC;IACxB,qDAAqD;IACrD,OAAO,EAAE,OAAO,CAAC;IACjB,oDAAoD;IACpD,OAAO,EAAE,OAAO,CAAC;IACjB,wDAAwD;IACxD,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB,qDAAqD;IACrD,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB;;;;OAIG;IACH,YAAY,EAAE,MAAM,IAAI,CAAC;IACzB,oEAAoE;IACpE,UAAU,EAAE,MAAM,IAAI,CAAC;CACvB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,mBAAmB,IAAI,kBAAkB,CA0UxD"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/media-editor",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.22.0",
|
|
4
4
|
"description": "Media editor components for WordPress.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -21,8 +21,18 @@
|
|
|
21
21
|
"url": "https://github.com/WordPress/gutenberg/issues"
|
|
22
22
|
},
|
|
23
23
|
"engines": {
|
|
24
|
-
"node": ">=
|
|
24
|
+
"node": ">=22.13.0"
|
|
25
25
|
},
|
|
26
|
+
"files": [
|
|
27
|
+
"build",
|
|
28
|
+
"build-module",
|
|
29
|
+
"build-style",
|
|
30
|
+
"build-types",
|
|
31
|
+
"src",
|
|
32
|
+
"*.md",
|
|
33
|
+
"!**/stories/**",
|
|
34
|
+
"!**/test/**"
|
|
35
|
+
],
|
|
26
36
|
"main": "build/index.cjs",
|
|
27
37
|
"module": "build-module/index.mjs",
|
|
28
38
|
"exports": {
|
|
@@ -33,7 +43,7 @@
|
|
|
33
43
|
},
|
|
34
44
|
"./package.json": "./package.json"
|
|
35
45
|
},
|
|
36
|
-
"types": "build-types",
|
|
46
|
+
"types": "build-types/index.d.ts",
|
|
37
47
|
"sideEffects": [
|
|
38
48
|
"build-style/**",
|
|
39
49
|
"src/**/*.scss",
|
|
@@ -42,33 +52,34 @@
|
|
|
42
52
|
"build-module/store/index.mjs"
|
|
43
53
|
],
|
|
44
54
|
"dependencies": {
|
|
45
|
-
"@wordpress/a11y": "^
|
|
46
|
-
"@wordpress/admin-ui": "^
|
|
47
|
-
"@wordpress/api-fetch": "^
|
|
48
|
-
"@wordpress/base-styles": "^
|
|
49
|
-
"@wordpress/components": "^
|
|
50
|
-
"@wordpress/compose": "^
|
|
51
|
-
"@wordpress/core-data": "^
|
|
52
|
-
"@wordpress/data": "^
|
|
53
|
-
"@wordpress/dataviews": "^
|
|
54
|
-
"@wordpress/element": "^
|
|
55
|
-
"@wordpress/i18n": "^
|
|
56
|
-
"@wordpress/icons": "^
|
|
57
|
-
"@wordpress/keyboard-shortcuts": "^
|
|
58
|
-
"@wordpress/keycodes": "^
|
|
59
|
-
"@wordpress/notices": "^
|
|
60
|
-
"@wordpress/private-apis": "^
|
|
61
|
-
"@wordpress/ui": "^0.
|
|
55
|
+
"@wordpress/a11y": "^5.1.0",
|
|
56
|
+
"@wordpress/admin-ui": "^3.1.0",
|
|
57
|
+
"@wordpress/api-fetch": "^8.1.0",
|
|
58
|
+
"@wordpress/base-styles": "^15.0.0",
|
|
59
|
+
"@wordpress/components": "^44.0.0",
|
|
60
|
+
"@wordpress/compose": "^9.1.0",
|
|
61
|
+
"@wordpress/core-data": "^9.1.0",
|
|
62
|
+
"@wordpress/data": "^11.1.0",
|
|
63
|
+
"@wordpress/dataviews": "^22.0.0",
|
|
64
|
+
"@wordpress/element": "^10.1.0",
|
|
65
|
+
"@wordpress/i18n": "^7.1.0",
|
|
66
|
+
"@wordpress/icons": "^20.0.0",
|
|
67
|
+
"@wordpress/keyboard-shortcuts": "^6.1.0",
|
|
68
|
+
"@wordpress/keycodes": "^5.1.0",
|
|
69
|
+
"@wordpress/notices": "^6.1.0",
|
|
70
|
+
"@wordpress/private-apis": "^3.1.0",
|
|
71
|
+
"@wordpress/ui": "^0.26.0",
|
|
62
72
|
"clsx": "^2.1.1",
|
|
73
|
+
"fast-deep-equal": "^3.1.3",
|
|
63
74
|
"gl-matrix": "^3.4.3"
|
|
64
75
|
},
|
|
65
76
|
"devDependencies": {
|
|
66
|
-
"@storybook/react-vite": "^10.6.
|
|
77
|
+
"@storybook/react-vite": "^10.6.5",
|
|
67
78
|
"@testing-library/dom": "^10.4.2",
|
|
68
79
|
"@testing-library/jest-dom": "^7.0.1",
|
|
69
80
|
"@testing-library/react": "^16.3.3",
|
|
70
|
-
"@testing-library/user-event": "^14.6.
|
|
71
|
-
"vitest": "^5.0.
|
|
81
|
+
"@testing-library/user-event": "^14.6.8",
|
|
82
|
+
"vitest": "^5.0.5",
|
|
72
83
|
"vitest-browser-react": "^2.3.0"
|
|
73
84
|
},
|
|
74
85
|
"peerDependencies": {
|
|
@@ -88,5 +99,5 @@
|
|
|
88
99
|
"publishConfig": {
|
|
89
100
|
"access": "public"
|
|
90
101
|
},
|
|
91
|
-
"gitHead": "
|
|
102
|
+
"gitHead": "9b70363b9f93cff0583a1f3153738d383cf5a49e"
|
|
92
103
|
}
|