@wordpress/media-editor 0.15.0 → 0.16.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 +3 -0
- package/build/components/media-editor/index.cjs +54 -44
- package/build/components/media-editor/index.cjs.map +2 -2
- package/build/components/media-editor/use-crop-options.cjs.map +2 -2
- package/build/components/media-editor/use-save-media-editor.cjs.map +2 -2
- package/build/components/media-editor-canvas/index.cjs.map +2 -2
- package/build/components/media-editor-crop-panel/index.cjs.map +2 -2
- package/build/components/media-editor-fine-rotation/index.cjs.map +2 -2
- package/build/components/media-editor-image-controls/index.cjs.map +2 -2
- package/build/components/media-editor-keyboard-shortcuts-modal/index.cjs.map +2 -2
- package/build/components/media-editor-modal/build-modifiers.cjs.map +2 -2
- package/build/components/media-editor-modal/index.cjs.map +2 -2
- package/build/components/media-editor-provider/index.cjs.map +2 -2
- package/build/components/media-form/index.cjs.map +2 -2
- package/build/components/media-preview/index.cjs.map +2 -2
- package/build/components/rotation-ruler/index.cjs.map +2 -2
- package/build/components/rotation-ruler/use-ruler-drag.cjs.map +2 -2
- package/build/hooks/use-crop-gesture-handlers.cjs.map +2 -2
- package/build/image-editor/core/camera.cjs.map +2 -2
- package/build/image-editor/core/constants.cjs.map +2 -2
- package/build/image-editor/core/containment.cjs.map +2 -2
- package/build/image-editor/core/crop-rect.cjs.map +2 -2
- package/build/image-editor/core/export/canvas-renderer.cjs.map +2 -2
- package/build/image-editor/core/interaction-controller.cjs.map +2 -2
- package/build/image-editor/core/math/sanitize.cjs.map +2 -2
- package/build/image-editor/core/setter-helpers.cjs.map +2 -2
- package/build/image-editor/core/source-region.cjs.map +2 -2
- package/build/image-editor/core/state.cjs.map +2 -2
- package/build/image-editor/core/stencil-math.cjs.map +2 -2
- package/build/image-editor/core/transform-style.cjs.map +2 -2
- package/build/image-editor/core/transforms/pipeline.cjs.map +2 -2
- package/build/image-editor/core/viewport-state.cjs.map +2 -2
- package/build/image-editor/react/components/cropper-provider.cjs.map +2 -2
- package/build/image-editor/react/components/cropper.cjs.map +2 -2
- package/build/image-editor/react/components/overlays/dimensions-overlay.cjs.map +2 -2
- package/build/image-editor/react/components/overlays/dimming-overlay.cjs.map +2 -2
- package/build/image-editor/react/components/overlays/grid-overlay.cjs.map +2 -2
- package/build/image-editor/react/components/stencils/rectangle-stencil.cjs.map +2 -2
- package/build/image-editor/react/components/viewport-provider.cjs.map +2 -2
- package/build/image-editor/react/hooks/build-cropper-setters.cjs.map +2 -2
- package/build/image-editor/react/hooks/use-aria-announcer.cjs.map +2 -2
- package/build/image-editor/react/hooks/use-cropper-reducer.cjs.map +2 -2
- package/build/image-editor/react/hooks/use-interaction.cjs.map +2 -2
- package/build/image-editor/react/hooks/use-transform-style.cjs.map +2 -2
- package/build/image-editor/react/hooks/use-viewport-state.cjs.map +2 -2
- package/build/lock-unlock.cjs.map +2 -2
- package/build/private-apis.cjs.map +2 -2
- package/build/state/composite-reducer.cjs.map +2 -2
- package/build/state/media-editor-state-provider.cjs.map +2 -2
- package/build/state/types.cjs.map +2 -2
- package/build/state/use-media-editor-state.cjs.map +2 -2
- package/build/store/index.cjs.map +2 -2
- package/build/store/reducer.cjs.map +2 -2
- package/build/store/selectors.cjs.map +2 -2
- package/build-module/components/media-editor/index.mjs +54 -45
- package/build-module/components/media-editor/index.mjs.map +2 -2
- package/build-module/components/media-editor/use-crop-options.mjs.map +2 -2
- package/build-module/components/media-editor/use-save-media-editor.mjs.map +2 -2
- package/build-module/components/media-editor-canvas/index.mjs.map +2 -2
- package/build-module/components/media-editor-crop-panel/index.mjs.map +2 -2
- package/build-module/components/media-editor-fine-rotation/index.mjs.map +2 -2
- package/build-module/components/media-editor-image-controls/index.mjs.map +2 -2
- package/build-module/components/media-editor-keyboard-shortcuts-modal/index.mjs.map +2 -2
- package/build-module/components/media-editor-modal/build-modifiers.mjs.map +2 -2
- package/build-module/components/media-editor-modal/index.mjs.map +2 -2
- package/build-module/components/media-editor-provider/index.mjs.map +2 -2
- package/build-module/components/media-form/index.mjs.map +2 -2
- package/build-module/components/media-preview/index.mjs.map +2 -2
- package/build-module/components/rotation-ruler/index.mjs.map +2 -2
- package/build-module/components/rotation-ruler/use-ruler-drag.mjs.map +2 -2
- package/build-module/hooks/use-crop-gesture-handlers.mjs.map +2 -2
- package/build-module/image-editor/core/camera.mjs.map +2 -2
- package/build-module/image-editor/core/constants.mjs.map +2 -2
- package/build-module/image-editor/core/containment.mjs.map +2 -2
- package/build-module/image-editor/core/crop-rect.mjs.map +2 -2
- package/build-module/image-editor/core/export/canvas-renderer.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.map +2 -2
- package/build-module/image-editor/core/setter-helpers.mjs.map +2 -2
- package/build-module/image-editor/core/source-region.mjs.map +2 -2
- package/build-module/image-editor/core/state.mjs.map +2 -2
- package/build-module/image-editor/core/stencil-math.mjs.map +2 -2
- package/build-module/image-editor/core/transform-style.mjs.map +2 -2
- package/build-module/image-editor/core/transforms/pipeline.mjs.map +2 -2
- package/build-module/image-editor/core/viewport-state.mjs.map +2 -2
- package/build-module/image-editor/react/components/cropper-provider.mjs.map +2 -2
- package/build-module/image-editor/react/components/cropper.mjs.map +2 -2
- package/build-module/image-editor/react/components/overlays/dimensions-overlay.mjs.map +2 -2
- package/build-module/image-editor/react/components/overlays/dimming-overlay.mjs.map +2 -2
- package/build-module/image-editor/react/components/overlays/grid-overlay.mjs.map +2 -2
- package/build-module/image-editor/react/components/stencils/rectangle-stencil.mjs.map +2 -2
- package/build-module/image-editor/react/components/viewport-provider.mjs.map +2 -2
- package/build-module/image-editor/react/hooks/build-cropper-setters.mjs.map +2 -2
- package/build-module/image-editor/react/hooks/use-aria-announcer.mjs.map +2 -2
- package/build-module/image-editor/react/hooks/use-cropper-reducer.mjs.map +2 -2
- package/build-module/image-editor/react/hooks/use-interaction.mjs.map +2 -2
- package/build-module/image-editor/react/hooks/use-transform-style.mjs.map +2 -2
- package/build-module/image-editor/react/hooks/use-viewport-state.mjs.map +2 -2
- package/build-module/lock-unlock.mjs.map +2 -2
- package/build-module/private-apis.mjs.map +2 -2
- package/build-module/state/composite-reducer.mjs.map +2 -2
- package/build-module/state/media-editor-state-provider.mjs.map +2 -2
- package/build-module/state/types.mjs.map +2 -2
- package/build-module/state/use-media-editor-state.mjs.map +2 -2
- package/build-module/store/index.mjs.map +2 -2
- package/build-module/store/reducer.mjs.map +2 -2
- package/build-module/store/selectors.mjs.map +2 -2
- package/build-style/style-rtl.css +2 -2
- package/build-style/style.css +2 -2
- package/build-types/components/media-editor/index.d.ts.map +1 -1
- package/build-types/components/media-editor/use-crop-options.d.ts.map +1 -1
- package/build-types/components/media-editor/use-save-media-editor.d.ts +0 -3
- 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-fine-rotation/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-keyboard-shortcuts-modal/index.d.ts.map +1 -1
- package/build-types/components/media-editor-modal/build-modifiers.d.ts +0 -3
- package/build-types/components/media-editor-modal/build-modifiers.d.ts.map +1 -1
- package/build-types/components/media-editor-modal/index.d.ts.map +1 -1
- package/build-types/components/media-editor-provider/index.d.ts.map +1 -1
- 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/index.d.ts.map +1 -1
- package/build-types/components/rotation-ruler/stories/index.story.d.ts +0 -6
- package/build-types/components/rotation-ruler/stories/index.story.d.ts.map +1 -1
- package/build-types/components/rotation-ruler/use-ruler-drag.d.ts.map +1 -1
- package/build-types/hooks/use-crop-gesture-handlers.d.ts.map +1 -1
- package/build-types/image-editor/core/camera.d.ts +0 -3
- package/build-types/image-editor/core/camera.d.ts.map +1 -1
- package/build-types/image-editor/core/constants.d.ts +0 -3
- package/build-types/image-editor/core/constants.d.ts.map +1 -1
- package/build-types/image-editor/core/containment.d.ts +0 -3
- package/build-types/image-editor/core/containment.d.ts.map +1 -1
- package/build-types/image-editor/core/crop-rect.d.ts +0 -3
- package/build-types/image-editor/core/crop-rect.d.ts.map +1 -1
- package/build-types/image-editor/core/export/canvas-renderer.d.ts +0 -3
- package/build-types/image-editor/core/export/canvas-renderer.d.ts.map +1 -1
- package/build-types/image-editor/core/interaction-controller.d.ts +0 -3
- package/build-types/image-editor/core/interaction-controller.d.ts.map +1 -1
- package/build-types/image-editor/core/math/sanitize.d.ts +0 -3
- package/build-types/image-editor/core/math/sanitize.d.ts.map +1 -1
- package/build-types/image-editor/core/setter-helpers.d.ts +0 -3
- package/build-types/image-editor/core/setter-helpers.d.ts.map +1 -1
- package/build-types/image-editor/core/source-region.d.ts +0 -3
- package/build-types/image-editor/core/source-region.d.ts.map +1 -1
- package/build-types/image-editor/core/state.d.ts +0 -3
- package/build-types/image-editor/core/state.d.ts.map +1 -1
- package/build-types/image-editor/core/stencil-math.d.ts.map +1 -1
- package/build-types/image-editor/core/transform-style.d.ts +0 -3
- package/build-types/image-editor/core/transform-style.d.ts.map +1 -1
- package/build-types/image-editor/core/transforms/pipeline.d.ts +0 -3
- package/build-types/image-editor/core/transforms/pipeline.d.ts.map +1 -1
- package/build-types/image-editor/core/viewport-state.d.ts +0 -3
- package/build-types/image-editor/core/viewport-state.d.ts.map +1 -1
- package/build-types/image-editor/react/components/cropper-provider.d.ts +0 -3
- package/build-types/image-editor/react/components/cropper-provider.d.ts.map +1 -1
- package/build-types/image-editor/react/components/cropper.d.ts +0 -6
- 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 +0 -3
- package/build-types/image-editor/react/components/overlays/dimensions-overlay.d.ts.map +1 -1
- package/build-types/image-editor/react/components/overlays/dimming-overlay.d.ts +0 -3
- package/build-types/image-editor/react/components/overlays/dimming-overlay.d.ts.map +1 -1
- package/build-types/image-editor/react/components/overlays/grid-overlay.d.ts +0 -3
- package/build-types/image-editor/react/components/overlays/grid-overlay.d.ts.map +1 -1
- package/build-types/image-editor/react/components/stencils/rectangle-stencil.d.ts +0 -3
- package/build-types/image-editor/react/components/stencils/rectangle-stencil.d.ts.map +1 -1
- package/build-types/image-editor/react/components/viewport-provider.d.ts +0 -3
- package/build-types/image-editor/react/components/viewport-provider.d.ts.map +1 -1
- package/build-types/image-editor/react/hooks/build-cropper-setters.d.ts +0 -3
- package/build-types/image-editor/react/hooks/build-cropper-setters.d.ts.map +1 -1
- package/build-types/image-editor/react/hooks/use-aria-announcer.d.ts +0 -3
- package/build-types/image-editor/react/hooks/use-aria-announcer.d.ts.map +1 -1
- package/build-types/image-editor/react/hooks/use-cropper-reducer.d.ts +0 -3
- package/build-types/image-editor/react/hooks/use-cropper-reducer.d.ts.map +1 -1
- package/build-types/image-editor/react/hooks/use-interaction.d.ts +0 -3
- package/build-types/image-editor/react/hooks/use-interaction.d.ts.map +1 -1
- package/build-types/image-editor/react/hooks/use-transform-style.d.ts +0 -3
- package/build-types/image-editor/react/hooks/use-transform-style.d.ts.map +1 -1
- package/build-types/image-editor/react/hooks/use-viewport-state.d.ts +0 -3
- package/build-types/image-editor/react/hooks/use-viewport-state.d.ts.map +1 -1
- package/build-types/image-editor/stories/rectangle-crop.story.d.ts +0 -6
- package/build-types/image-editor/stories/rectangle-crop.story.d.ts.map +1 -1
- package/build-types/lock-unlock.d.ts.map +1 -1
- package/build-types/private-apis.d.ts.map +1 -1
- package/build-types/state/composite-reducer.d.ts +0 -3
- package/build-types/state/composite-reducer.d.ts.map +1 -1
- package/build-types/state/media-editor-state-provider.d.ts +0 -3
- package/build-types/state/media-editor-state-provider.d.ts.map +1 -1
- package/build-types/state/types.d.ts +0 -3
- package/build-types/state/types.d.ts.map +1 -1
- package/build-types/state/use-media-editor-state.d.ts +0 -3
- package/build-types/state/use-media-editor-state.d.ts.map +1 -1
- package/build-types/store/index.d.ts.map +1 -1
- package/build-types/store/reducer.d.ts +0 -3
- package/build-types/store/reducer.d.ts.map +1 -1
- package/build-types/store/selectors.d.ts +0 -3
- package/build-types/store/selectors.d.ts.map +1 -1
- package/package.json +20 -20
- package/src/components/media-editor/index.tsx +83 -78
- package/src/components/media-editor/test/use-crop-options.tsx +0 -7
- package/src/components/media-editor/use-crop-options.ts +0 -7
- package/src/components/media-editor/use-save-media-editor.ts +0 -7
- package/src/components/media-editor-canvas/index.tsx +0 -11
- package/src/components/media-editor-crop-panel/index.tsx +0 -7
- package/src/components/media-editor-crop-panel/test/index.tsx +0 -7
- package/src/components/media-editor-fine-rotation/index.tsx +0 -7
- package/src/components/media-editor-image-controls/index.tsx +0 -7
- package/src/components/media-editor-image-controls/test/index.tsx +0 -7
- package/src/components/media-editor-keyboard-shortcuts-modal/index.tsx +0 -3
- package/src/components/media-editor-modal/build-modifiers.ts +0 -3
- package/src/components/media-editor-modal/index.tsx +0 -7
- package/src/components/media-editor-modal/test/build-modifiers.test.ts +0 -8
- package/src/components/media-editor-modal/test/index.tsx +0 -11
- package/src/components/media-editor-provider/index.tsx +0 -3
- package/src/components/media-form/index.tsx +0 -7
- package/src/components/media-preview/index.tsx +0 -7
- package/src/components/rotation-ruler/index.tsx +0 -11
- package/src/components/rotation-ruler/stories/index.story.tsx +0 -11
- package/src/components/rotation-ruler/test/index.tsx +0 -7
- package/src/components/rotation-ruler/use-ruler-drag.ts +0 -3
- package/src/hooks/use-crop-gesture-handlers.ts +0 -7
- package/src/image-editor/core/camera.ts +0 -7
- package/src/image-editor/core/constants.ts +0 -7
- package/src/image-editor/core/containment.ts +0 -7
- package/src/image-editor/core/crop-rect.ts +0 -3
- package/src/image-editor/core/export/canvas-renderer.ts +0 -3
- package/src/image-editor/core/export/test/canvas-renderer.ts +0 -3
- package/src/image-editor/core/interaction-controller.ts +0 -3
- package/src/image-editor/core/math/sanitize.ts +0 -3
- package/src/image-editor/core/math/test/sanitize.ts +0 -3
- package/src/image-editor/core/setter-helpers.ts +0 -3
- package/src/image-editor/core/source-region.ts +0 -7
- package/src/image-editor/core/state.ts +0 -3
- package/src/image-editor/core/stencil-math.ts +0 -3
- package/src/image-editor/core/test/interaction-controller.ts +0 -3
- package/src/image-editor/core/test/preview-export-parity.ts +0 -1
- package/src/image-editor/core/test/stencil-math.ts +0 -3
- package/src/image-editor/core/transform-style.ts +0 -3
- package/src/image-editor/core/transforms/pipeline.ts +0 -3
- package/src/image-editor/core/transforms/test/pipeline.ts +0 -3
- package/src/image-editor/core/viewport-state.ts +0 -3
- package/src/image-editor/react/components/cropper-provider.tsx +0 -7
- package/src/image-editor/react/components/cropper.tsx +0 -12
- package/src/image-editor/react/components/overlays/dimensions-overlay.tsx +0 -7
- package/src/image-editor/react/components/overlays/dimming-overlay.tsx +0 -3
- package/src/image-editor/react/components/overlays/grid-overlay.tsx +0 -3
- package/src/image-editor/react/components/stencils/rectangle-stencil.tsx +0 -7
- package/src/image-editor/react/components/stencils/test/rectangle-stencil.tsx +0 -7
- package/src/image-editor/react/components/test/cropper.tsx +0 -7
- package/src/image-editor/react/components/viewport-provider.tsx +0 -7
- package/src/image-editor/react/hooks/build-cropper-setters.ts +0 -3
- package/src/image-editor/react/hooks/test/use-aria-announcer.ts +0 -11
- package/src/image-editor/react/hooks/test/use-cropper-reducer.ts +0 -7
- package/src/image-editor/react/hooks/test/use-interaction.ts +0 -7
- package/src/image-editor/react/hooks/test/use-transform-style.ts +0 -7
- package/src/image-editor/react/hooks/use-aria-announcer.ts +0 -7
- package/src/image-editor/react/hooks/use-cropper-reducer.ts +0 -7
- package/src/image-editor/react/hooks/use-interaction.ts +0 -7
- package/src/image-editor/react/hooks/use-transform-style.ts +0 -7
- package/src/image-editor/react/hooks/use-viewport-state.ts +0 -7
- package/src/image-editor/stories/rectangle-crop.story.tsx +0 -11
- package/src/lock-unlock.ts +0 -3
- package/src/private-apis.ts +0 -3
- package/src/state/composite-reducer.ts +0 -3
- package/src/state/media-editor-state-provider.tsx +0 -7
- package/src/state/test/use-media-editor-state.ts +0 -7
- package/src/state/types.ts +0 -3
- package/src/state/use-media-editor-state.ts +0 -7
- package/src/store/index.ts +0 -7
- package/src/store/reducer.ts +0 -3
- package/src/store/selectors.ts +0 -3
- package/src/store/test/reducer.ts +0 -3
- package/tsconfig.tsbuildinfo +1 -1
- 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/components/media-editor-transform-controls/index.d.ts +0 -21
- package/build-types/components/media-editor-transform-controls/index.d.ts.map +0 -1
- package/build-types/components/media-form/sidebar-datetime-view.d.ts +0 -10
- package/build-types/components/media-form/sidebar-datetime-view.d.ts.map +0 -1
- package/build-types/image-editor/react/hooks/use-cropper-state.d.ts +0 -108
- package/build-types/image-editor/react/hooks/use-cropper-state.d.ts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/store/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/store/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AACrC,OAAO,KAAK,SAAS,MAAM,aAAa,CAAC;AAGzC,eAAO,MAAM,KAAK,kIAIf,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reducer.d.ts","sourceRoot":"","sources":["../../src/store/reducer.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"reducer.d.ts","sourceRoot":"","sources":["../../src/store/reducer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,WAAW,CAAC;AAExD,KAAK,gBAAgB,GAAG,CAAE,OAAO,EAAE,sBAAsB,KAAM,IAAI,CAAC;AACpE,KAAK,eAAe,GAAG,MAAM,IAAI,CAAC;AAElC,MAAM,WAAW,KAAK;IACrB,MAAM,EAAE,OAAO,CAAC;IAChB,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;IAClB,QAAQ,EAAE,gBAAgB,GAAG,IAAI,CAAC;IAClC,OAAO,EAAE,eAAe,GAAG,IAAI,CAAC;CAChC;AAED,eAAO,MAAM,aAAa,EAAE,KAK3B,CAAC;AAEF,KAAK,MAAM,GACR;IACA,IAAI,EAAE,yBAAyB,CAAC;IAChC,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,gBAAgB,GAAG,IAAI,CAAC;IAClC,OAAO,EAAE,eAAe,GAAG,IAAI,CAAC;CAC/B,GACD;IAAE,IAAI,EAAE,0BAA0B,CAAA;CAAE,CAAC;AAExC,MAAM,CAAC,OAAO,UAAU,OAAO,CAC9B,KAAK,EAAE,KAAK,YAAgB,EAC5B,MAAM,EAAE,MAAM,GAAG;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,GAC/B,KAAK,CAkBP"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"selectors.d.ts","sourceRoot":"","sources":["../../src/store/selectors.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"selectors.d.ts","sourceRoot":"","sources":["../../src/store/selectors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAEvC,wBAAgB,MAAM,CAAE,KAAK,EAAE,KAAK,GAAI,OAAO,CAE9C;AAED,wBAAgB,KAAK,CAAE,KAAK,EAAE,KAAK,GAAI,MAAM,GAAG,IAAI,CAEnD;AAED,wBAAgB,WAAW,CAAE,KAAK,EAAE,KAAK,0EAExC;AAED,wBAAgB,UAAU,CAAE,KAAK,EAAE,KAAK,uBAEvC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/media-editor",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.16.0",
|
|
4
4
|
"description": "Media editor components for WordPress.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -43,24 +43,24 @@
|
|
|
43
43
|
"build-module/store/index.mjs"
|
|
44
44
|
],
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@wordpress/a11y": "^4.
|
|
47
|
-
"@wordpress/api-fetch": "^7.
|
|
48
|
-
"@wordpress/base-styles": "^12.
|
|
49
|
-
"@wordpress/components": "^
|
|
50
|
-
"@wordpress/compose": "^8.
|
|
51
|
-
"@wordpress/core-data": "^7.
|
|
52
|
-
"@wordpress/data": "^10.
|
|
53
|
-
"@wordpress/dataviews": "^
|
|
54
|
-
"@wordpress/date": "^5.
|
|
55
|
-
"@wordpress/element": "^8.
|
|
56
|
-
"@wordpress/i18n": "^6.
|
|
57
|
-
"@wordpress/icons": "^15.
|
|
58
|
-
"@wordpress/interface": "^9.
|
|
59
|
-
"@wordpress/keyboard-shortcuts": "^5.
|
|
60
|
-
"@wordpress/keycodes": "^4.
|
|
61
|
-
"@wordpress/notices": "^5.
|
|
62
|
-
"@wordpress/private-apis": "^1.
|
|
63
|
-
"@wordpress/ui": "^0.
|
|
46
|
+
"@wordpress/a11y": "^4.53.0",
|
|
47
|
+
"@wordpress/api-fetch": "^7.53.0",
|
|
48
|
+
"@wordpress/base-styles": "^12.1.0",
|
|
49
|
+
"@wordpress/components": "^39.0.0",
|
|
50
|
+
"@wordpress/compose": "^8.6.0",
|
|
51
|
+
"@wordpress/core-data": "^7.53.0",
|
|
52
|
+
"@wordpress/data": "^10.53.0",
|
|
53
|
+
"@wordpress/dataviews": "^18.0.0",
|
|
54
|
+
"@wordpress/date": "^5.53.0",
|
|
55
|
+
"@wordpress/element": "^8.5.0",
|
|
56
|
+
"@wordpress/i18n": "^6.26.0",
|
|
57
|
+
"@wordpress/icons": "^15.4.0",
|
|
58
|
+
"@wordpress/interface": "^9.38.0",
|
|
59
|
+
"@wordpress/keyboard-shortcuts": "^5.53.0",
|
|
60
|
+
"@wordpress/keycodes": "^4.53.0",
|
|
61
|
+
"@wordpress/notices": "^5.53.0",
|
|
62
|
+
"@wordpress/private-apis": "^1.53.0",
|
|
63
|
+
"@wordpress/ui": "^0.20.0",
|
|
64
64
|
"clsx": "^2.1.1",
|
|
65
65
|
"gl-matrix": "^3.4.3"
|
|
66
66
|
},
|
|
@@ -82,5 +82,5 @@
|
|
|
82
82
|
"publishConfig": {
|
|
83
83
|
"access": "public"
|
|
84
84
|
},
|
|
85
|
-
"gitHead": "
|
|
85
|
+
"gitHead": "989764d42ff93e33684aaf0b96a5b7f3d9bbff52"
|
|
86
86
|
}
|
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WordPress dependencies
|
|
3
|
-
*/
|
|
4
1
|
import {
|
|
5
2
|
Button,
|
|
6
|
-
Flex,
|
|
7
3
|
Spinner,
|
|
8
4
|
__experimentalConfirmDialog as ConfirmDialog,
|
|
9
5
|
} from '@wordpress/components';
|
|
@@ -32,14 +28,9 @@ import {
|
|
|
32
28
|
ComplementaryArea,
|
|
33
29
|
InterfaceSkeleton,
|
|
34
30
|
PinnedItems,
|
|
35
|
-
//
|
|
36
|
-
// @ts-expect-error
|
|
31
|
+
// @ts-expect-error `@wordpress/interface` is not typed yet.
|
|
37
32
|
} from '@wordpress/interface';
|
|
38
33
|
import type { KeyboardEvent as ReactKeyboardEvent, ReactNode } from 'react';
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* Internal dependencies
|
|
42
|
-
*/
|
|
43
34
|
import { MediaEditorProvider } from '../media-editor-provider';
|
|
44
35
|
import type { Media } from '../media-editor-provider';
|
|
45
36
|
import MediaPreview from '../media-preview';
|
|
@@ -110,11 +101,17 @@ export interface MediaEditorProps {
|
|
|
110
101
|
shouldCloseOnEsc?: boolean;
|
|
111
102
|
}
|
|
112
103
|
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
104
|
+
interface MediaEditorSidebarProps {
|
|
105
|
+
tabs: EditorTab[];
|
|
106
|
+
activeTabId?: string;
|
|
107
|
+
onTabChange: ( tabId: string ) => void;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
function MediaEditorSidebar( {
|
|
111
|
+
tabs,
|
|
112
|
+
activeTabId,
|
|
113
|
+
onTabChange,
|
|
114
|
+
}: MediaEditorSidebarProps ) {
|
|
118
115
|
return (
|
|
119
116
|
<ComplementaryArea
|
|
120
117
|
scope="media-editor"
|
|
@@ -126,6 +123,16 @@ function MediaEditorSidebar( { tabs }: { tabs: EditorTab[] } ) {
|
|
|
126
123
|
panelClassName="media-editor__sidebar-panel"
|
|
127
124
|
headerClassName="media-editor__sidebar-header"
|
|
128
125
|
closeLabel={ __( 'Close media panel' ) }
|
|
126
|
+
// Makes `Tabs.Root` the container, so the tab list passed as
|
|
127
|
+
// `header` and the panels below share a subtree across the fill.
|
|
128
|
+
render={
|
|
129
|
+
<Tabs.Root
|
|
130
|
+
value={ activeTabId }
|
|
131
|
+
onValueChange={ ( value ) =>
|
|
132
|
+
onTabChange( value as string )
|
|
133
|
+
}
|
|
134
|
+
/>
|
|
135
|
+
}
|
|
129
136
|
header={
|
|
130
137
|
<Tabs.List variant="minimal">
|
|
131
138
|
{ tabs.map( ( tab ) => (
|
|
@@ -160,11 +167,11 @@ function HeaderActions( {
|
|
|
160
167
|
}: HeaderActionsProps ) {
|
|
161
168
|
const [ isShortcutsModalOpen, setIsShortcutsModalOpen ] = useState( false );
|
|
162
169
|
return (
|
|
163
|
-
<
|
|
170
|
+
<Stack
|
|
164
171
|
className="media-editor__header-actions"
|
|
165
172
|
justify="flex-end"
|
|
166
|
-
|
|
167
|
-
gap=
|
|
173
|
+
align="center"
|
|
174
|
+
gap="sm"
|
|
168
175
|
>
|
|
169
176
|
{ isImage && (
|
|
170
177
|
<Button
|
|
@@ -190,7 +197,7 @@ function HeaderActions( {
|
|
|
190
197
|
onClose={ () => setIsShortcutsModalOpen( false ) }
|
|
191
198
|
/>
|
|
192
199
|
) }
|
|
193
|
-
</
|
|
200
|
+
</Stack>
|
|
194
201
|
);
|
|
195
202
|
}
|
|
196
203
|
|
|
@@ -232,10 +239,10 @@ function HistoryActions( {
|
|
|
232
239
|
endGesture();
|
|
233
240
|
};
|
|
234
241
|
return (
|
|
235
|
-
<
|
|
242
|
+
<Stack
|
|
236
243
|
className="media-editor__history-actions"
|
|
237
|
-
|
|
238
|
-
gap=
|
|
244
|
+
align="center"
|
|
245
|
+
gap="sm"
|
|
239
246
|
>
|
|
240
247
|
<Button
|
|
241
248
|
size="compact"
|
|
@@ -270,7 +277,7 @@ function HistoryActions( {
|
|
|
270
277
|
accessibleWhenDisabled
|
|
271
278
|
onClick={ handleRedo }
|
|
272
279
|
/>
|
|
273
|
-
</
|
|
280
|
+
</Stack>
|
|
274
281
|
);
|
|
275
282
|
}
|
|
276
283
|
|
|
@@ -291,11 +298,11 @@ function FooterActions( {
|
|
|
291
298
|
}: FooterActionsProps ) {
|
|
292
299
|
const saveDisabled = isSaving || ! hasMedia || ! hasChanges;
|
|
293
300
|
return (
|
|
294
|
-
<
|
|
301
|
+
<Stack
|
|
295
302
|
className="media-editor__footer-actions"
|
|
296
303
|
justify="flex-end"
|
|
297
|
-
|
|
298
|
-
gap=
|
|
304
|
+
align="center"
|
|
305
|
+
gap="sm"
|
|
299
306
|
>
|
|
300
307
|
<Button
|
|
301
308
|
__next40pxDefaultSize
|
|
@@ -316,7 +323,7 @@ function FooterActions( {
|
|
|
316
323
|
>
|
|
317
324
|
{ __( 'Save' ) }
|
|
318
325
|
</Button>
|
|
319
|
-
</
|
|
326
|
+
</Stack>
|
|
320
327
|
);
|
|
321
328
|
}
|
|
322
329
|
|
|
@@ -578,62 +585,60 @@ function MediaEditorContent( {
|
|
|
578
585
|
onChange={ handleChange }
|
|
579
586
|
settings={ { fields } }
|
|
580
587
|
>
|
|
581
|
-
|
|
582
|
-
|
|
588
|
+
<div className="media-editor">
|
|
589
|
+
{ ! media ? (
|
|
583
590
|
<div className="media-editor__loading">
|
|
584
591
|
<Spinner />
|
|
585
592
|
</div>
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
593
|
+
) : (
|
|
594
|
+
<>
|
|
595
|
+
<MediaEditorSidebar
|
|
596
|
+
tabs={ tabs }
|
|
597
|
+
activeTabId={ activeTabId }
|
|
598
|
+
onTabChange={ setSelectedTabId }
|
|
599
|
+
/>
|
|
600
|
+
<InterfaceSkeleton
|
|
601
|
+
className="media-editor__skeleton"
|
|
602
|
+
labels={ {
|
|
603
|
+
body: isImage
|
|
604
|
+
? __( 'Image editor' )
|
|
605
|
+
: __( 'Media preview' ),
|
|
606
|
+
sidebar: __( 'Media details' ),
|
|
607
|
+
} }
|
|
608
|
+
content={
|
|
609
|
+
<div className="media-editor__content">
|
|
610
|
+
<div className="media-editor__canvas-area">
|
|
611
|
+
{ isImage ? (
|
|
612
|
+
<MediaEditorCanvas
|
|
613
|
+
focusOnMount
|
|
614
|
+
isPlacementActive={
|
|
615
|
+
isPlacementActive
|
|
616
|
+
}
|
|
617
|
+
onGestureStart={
|
|
618
|
+
handleCanvasGestureStart
|
|
619
|
+
}
|
|
620
|
+
onGestureEnd={
|
|
621
|
+
handleCanvasGestureEnd
|
|
622
|
+
}
|
|
623
|
+
/>
|
|
624
|
+
) : (
|
|
625
|
+
<MediaPreview />
|
|
626
|
+
) }
|
|
627
|
+
</div>
|
|
628
|
+
{ isImage && (
|
|
629
|
+
<div className="media-editor__canvas-toolbar">
|
|
630
|
+
{ ruler }
|
|
631
|
+
</div>
|
|
622
632
|
) }
|
|
623
633
|
</div>
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
<ComplementaryArea.Slot scope="media-editor" />
|
|
633
|
-
}
|
|
634
|
-
/>
|
|
635
|
-
</Tabs.Root>
|
|
636
|
-
) }
|
|
634
|
+
}
|
|
635
|
+
sidebar={
|
|
636
|
+
<ComplementaryArea.Slot scope="media-editor" />
|
|
637
|
+
}
|
|
638
|
+
/>
|
|
639
|
+
</>
|
|
640
|
+
) }
|
|
641
|
+
</div>
|
|
637
642
|
<ConfirmDialog
|
|
638
643
|
isOpen={ isDiscardDialogOpen }
|
|
639
644
|
confirmButtonText={ __( 'Discard' ) }
|
|
@@ -1,11 +1,4 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* External dependencies
|
|
3
|
-
*/
|
|
4
1
|
import { fireEvent, render, screen } from '@testing-library/react';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Internal dependencies
|
|
8
|
-
*/
|
|
9
2
|
import { useCropOptions } from '../use-crop-options';
|
|
10
3
|
import { ORIGINAL_ASPECT_RATIO } from '../../../image-editor/core/constants';
|
|
11
4
|
import { MediaEditorStateProvider } from '../../../state';
|
|
@@ -1,11 +1,4 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WordPress dependencies
|
|
3
|
-
*/
|
|
4
1
|
import { useMemo } from '@wordpress/element';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Internal dependencies
|
|
8
|
-
*/
|
|
9
2
|
import { DEFAULT_ASPECT_RATIOS } from '../../image-editor/core/constants';
|
|
10
3
|
import type { AspectRatioPreset } from '../../image-editor/core/constants';
|
|
11
4
|
import { useMediaEditor, resolveAspectRatio } from '../../state';
|
|
@@ -1,16 +1,9 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WordPress dependencies
|
|
3
|
-
*/
|
|
4
1
|
import apiFetch from '@wordpress/api-fetch';
|
|
5
2
|
import { useDispatch, useRegistry } from '@wordpress/data';
|
|
6
3
|
import { store as coreStore } from '@wordpress/core-data';
|
|
7
4
|
import { useCallback, useState } from '@wordpress/element';
|
|
8
5
|
import { __, sprintf } from '@wordpress/i18n';
|
|
9
6
|
import { store as noticesStore } from '@wordpress/notices';
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Internal dependencies
|
|
13
|
-
*/
|
|
14
7
|
import type { Media } from '../media-editor-provider';
|
|
15
8
|
import type { MediaEditorController } from '../../state';
|
|
16
9
|
import {
|
|
@@ -1,18 +1,7 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* External dependencies
|
|
3
|
-
*/
|
|
4
1
|
import clsx from 'clsx';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* WordPress dependencies
|
|
8
|
-
*/
|
|
9
2
|
import { useCallback, useEffect, useMemo, useState } from '@wordpress/element';
|
|
10
3
|
import { Spinner } from '@wordpress/components';
|
|
11
4
|
import { __ } from '@wordpress/i18n';
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Internal dependencies
|
|
15
|
-
*/
|
|
16
5
|
import { useMediaEditorContext } from '../media-editor-provider';
|
|
17
6
|
import { getMediaTypeFromMimeType } from '../../utils';
|
|
18
7
|
import { Cropper } from '../../image-editor';
|
|
@@ -1,13 +1,6 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WordPress dependencies
|
|
3
|
-
*/
|
|
4
1
|
import { SelectControl } from '@wordpress/components';
|
|
5
2
|
import { Stack, VisuallyHidden } from '@wordpress/ui';
|
|
6
3
|
import { __ } from '@wordpress/i18n';
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Internal dependencies
|
|
10
|
-
*/
|
|
11
4
|
import { CROP_CONTROL_ATTR } from '../../hooks/use-crop-gesture-handlers';
|
|
12
5
|
import MediaEditorImageControls from '../media-editor-image-controls';
|
|
13
6
|
import type { AspectRatioPreset } from '../../image-editor/core/constants';
|
|
@@ -1,11 +1,4 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* External dependencies
|
|
3
|
-
*/
|
|
4
1
|
import { fireEvent, render, screen } from '@testing-library/react';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Internal dependencies
|
|
8
|
-
*/
|
|
9
2
|
import MediaEditorCropPanel from '..';
|
|
10
3
|
import type { MediaEditorCropPanelProps } from '..';
|
|
11
4
|
import { MediaEditorStateProvider } from '../../../state';
|
|
@@ -1,11 +1,4 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WordPress dependencies
|
|
3
|
-
*/
|
|
4
1
|
import { __ } from '@wordpress/i18n';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Internal dependencies
|
|
8
|
-
*/
|
|
9
2
|
import { useMediaEditor } from '../../state';
|
|
10
3
|
import { useCropGestureHandlers } from '../../hooks/use-crop-gesture-handlers';
|
|
11
4
|
import { MAX_ROTATION_OFFSET } from '../../image-editor/core/constants';
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WordPress dependencies
|
|
3
|
-
*/
|
|
4
1
|
import {
|
|
5
2
|
Button,
|
|
6
3
|
DropdownMenu,
|
|
@@ -18,10 +15,6 @@ import {
|
|
|
18
15
|
lineSolid,
|
|
19
16
|
plus,
|
|
20
17
|
} from '@wordpress/icons';
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* Internal dependencies
|
|
24
|
-
*/
|
|
25
18
|
import { useMediaEditor } from '../../state';
|
|
26
19
|
import {
|
|
27
20
|
MAX_ZOOM,
|
|
@@ -1,11 +1,4 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* External dependencies
|
|
3
|
-
*/
|
|
4
1
|
import { fireEvent, render, screen, waitFor } from '@testing-library/react';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Internal dependencies
|
|
8
|
-
*/
|
|
9
2
|
import MediaEditorImageControls from '..';
|
|
10
3
|
import type { MediaEditorImageControlsProps } from '..';
|
|
11
4
|
import { MediaEditorStateProvider, useMediaEditor } from '../../../state';
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WordPress dependencies
|
|
3
|
-
*/
|
|
4
1
|
import { Modal } from '@wordpress/components';
|
|
5
2
|
import { useDispatch, useSelect } from '@wordpress/data';
|
|
6
3
|
import { __ } from '@wordpress/i18n';
|
|
@@ -8,10 +5,6 @@ import { ShortcutProvider } from '@wordpress/keyboard-shortcuts';
|
|
|
8
5
|
import { store as noticesStore } from '@wordpress/notices';
|
|
9
6
|
import type { Field } from '@wordpress/dataviews';
|
|
10
7
|
import type { KeyboardEvent as ReactKeyboardEvent } from 'react';
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Internal dependencies
|
|
14
|
-
*/
|
|
15
8
|
import MediaEditor from '../media-editor';
|
|
16
9
|
import type { Media } from '../media-editor-provider';
|
|
17
10
|
import { store as mediaEditorStore } from '../../store';
|
|
@@ -52,15 +52,7 @@
|
|
|
52
52
|
* `serverSourcePixel` to undo it, and add values to the grid in
|
|
53
53
|
* `buildRows`. The probes don't need to change.
|
|
54
54
|
*/
|
|
55
|
-
|
|
56
|
-
/**
|
|
57
|
-
* External dependencies
|
|
58
|
-
*/
|
|
59
55
|
import { mat2d, vec2 } from 'gl-matrix';
|
|
60
|
-
|
|
61
|
-
/**
|
|
62
|
-
* Internal dependencies
|
|
63
|
-
*/
|
|
64
56
|
import { buildModifiers } from '../build-modifiers';
|
|
65
57
|
import type { Modifier } from '../build-modifiers';
|
|
66
58
|
import {
|
|
@@ -1,17 +1,6 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* External dependencies
|
|
3
|
-
*/
|
|
4
1
|
import { fireEvent, render, screen } from '@testing-library/react';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* WordPress dependencies
|
|
8
|
-
*/
|
|
9
2
|
import { useDispatch, useSelect } from '@wordpress/data';
|
|
10
3
|
import { store as noticesStore } from '@wordpress/notices';
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Internal dependencies
|
|
14
|
-
*/
|
|
15
4
|
import { MediaEditorModal } from '../index';
|
|
16
5
|
|
|
17
6
|
let mockSaveResult = {
|
|
@@ -1,16 +1,9 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WordPress dependencies
|
|
3
|
-
*/
|
|
4
1
|
import { DataForm } from '@wordpress/dataviews';
|
|
5
2
|
import type { Form, Field } from '@wordpress/dataviews';
|
|
6
3
|
import { Spinner, __experimentalVStack as VStack } from '@wordpress/components';
|
|
7
4
|
import { VisuallyHidden } from '@wordpress/ui';
|
|
8
5
|
import { __ } from '@wordpress/i18n';
|
|
9
6
|
import type { ReactNode } from 'react';
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Internal dependencies
|
|
13
|
-
*/
|
|
14
7
|
import { useMediaEditorContext } from '../media-editor-provider';
|
|
15
8
|
import type { Media } from '../media-editor-provider';
|
|
16
9
|
|
|
@@ -1,13 +1,6 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WordPress dependencies
|
|
3
|
-
*/
|
|
4
1
|
import { Spinner } from '@wordpress/components';
|
|
5
2
|
import { useState } from '@wordpress/element';
|
|
6
3
|
import { __ } from '@wordpress/i18n';
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Internal dependencies
|
|
10
|
-
*/
|
|
11
4
|
import { useMediaEditorContext } from '../media-editor-provider';
|
|
12
5
|
import { getMediaTypeFromMimeType } from '../../utils';
|
|
13
6
|
|
|
@@ -1,17 +1,6 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* External dependencies
|
|
3
|
-
*/
|
|
4
1
|
import clsx from 'clsx';
|
|
5
2
|
import type { CSSProperties, KeyboardEvent } from 'react';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* WordPress dependencies
|
|
9
|
-
*/
|
|
10
3
|
import { useId, useMemo, useRef } from '@wordpress/element';
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Internal dependencies
|
|
14
|
-
*/
|
|
15
4
|
import { useRulerDrag, clampValue } from './use-ruler-drag';
|
|
16
5
|
|
|
17
6
|
export interface RotationRulerProps {
|
|
@@ -1,17 +1,6 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* External dependencies
|
|
3
|
-
*/
|
|
4
1
|
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* WordPress dependencies
|
|
8
|
-
*/
|
|
9
2
|
import { useState } from '@wordpress/element';
|
|
10
3
|
import { __ } from '@wordpress/i18n';
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Internal dependencies
|
|
14
|
-
*/
|
|
15
4
|
import RotationRuler from '../index';
|
|
16
5
|
import '../style.scss';
|
|
17
6
|
|
|
@@ -1,12 +1,5 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* External dependencies
|
|
3
|
-
*/
|
|
4
1
|
import { render, screen } from '@testing-library/react';
|
|
5
2
|
import userEvent from '@testing-library/user-event';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Internal dependencies
|
|
9
|
-
*/
|
|
10
3
|
import { pxToValueDelta, clampValue, quantize } from '../use-ruler-drag';
|
|
11
4
|
import RotationRuler from '../index';
|
|
12
5
|
|