@wordpress/media-editor 0.8.0 → 0.8.1-next.v.202605131006.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/components/media-editor/index.cjs +560 -0
- package/build/components/media-editor/index.cjs.map +7 -0
- package/build/components/media-editor-canvas/index.cjs +14 -2
- package/build/components/media-editor-canvas/index.cjs.map +2 -2
- package/build/components/media-editor-crop-panel/index.cjs +34 -27
- package/build/components/media-editor-crop-panel/index.cjs.map +2 -2
- package/build/components/media-editor-keyboard-shortcuts-modal/index.cjs +162 -0
- package/build/components/media-editor-keyboard-shortcuts-modal/index.cjs.map +7 -0
- package/build/components/media-editor-modal/index.cjs +42 -430
- package/build/components/media-editor-modal/index.cjs.map +3 -3
- package/build/components/media-editor-toolbar/index.cjs +143 -75
- package/build/components/media-editor-toolbar/index.cjs.map +3 -3
- package/build/components/media-form/index.cjs +3 -0
- package/build/components/media-form/index.cjs.map +2 -2
- package/build/components/rotation-ruler/index.cjs +197 -0
- package/build/components/rotation-ruler/index.cjs.map +7 -0
- package/build/components/rotation-ruler/use-ruler-drag.cjs +154 -0
- package/build/components/rotation-ruler/use-ruler-drag.cjs.map +7 -0
- package/build/hooks/use-crop-gesture-handlers.cjs +43 -0
- package/build/hooks/use-crop-gesture-handlers.cjs.map +7 -0
- package/build/image-editor/core/constants.cjs +9 -0
- package/build/image-editor/core/constants.cjs.map +2 -2
- package/build/image-editor/core/containment.cjs +7 -13
- package/build/image-editor/core/containment.cjs.map +2 -2
- package/build/image-editor/core/interaction-controller.cjs +43 -7
- package/build/image-editor/core/interaction-controller.cjs.map +2 -2
- package/build/image-editor/core/state.cjs +5 -1
- package/build/image-editor/core/state.cjs.map +2 -2
- package/build/image-editor/core/transform-style.cjs.map +1 -1
- package/build/image-editor/core/types.cjs.map +1 -1
- package/build/image-editor/core/viewport-state.cjs +50 -0
- package/build/image-editor/core/viewport-state.cjs.map +7 -0
- package/build/image-editor/react/components/cropper.cjs +192 -72
- package/build/image-editor/react/components/cropper.cjs.map +3 -3
- package/build/image-editor/react/components/overlays/dimming-overlay.cjs +5 -2
- package/build/image-editor/react/components/overlays/dimming-overlay.cjs.map +2 -2
- package/build/image-editor/react/components/stencils/rectangle-stencil.cjs +16 -4
- package/build/image-editor/react/components/stencils/rectangle-stencil.cjs.map +2 -2
- package/build/image-editor/react/components/viewport-provider.cjs +51 -0
- package/build/image-editor/react/components/viewport-provider.cjs.map +7 -0
- package/build/image-editor/react/hooks/use-aria-announcer.cjs +53 -6
- package/build/image-editor/react/hooks/use-aria-announcer.cjs.map +2 -2
- package/build/image-editor/react/hooks/use-cropper-state.cjs +127 -8
- package/build/image-editor/react/hooks/use-cropper-state.cjs.map +2 -2
- package/build/image-editor/react/hooks/use-interaction.cjs +26 -5
- package/build/image-editor/react/hooks/use-interaction.cjs.map +2 -2
- package/build/image-editor/react/hooks/use-viewport-state.cjs +51 -0
- package/build/image-editor/react/hooks/use-viewport-state.cjs.map +7 -0
- package/build/image-editor/react/visually-hidden-style.cjs +41 -0
- package/build/image-editor/react/visually-hidden-style.cjs.map +7 -0
- package/build/private-apis.cjs +2 -0
- package/build/private-apis.cjs.map +2 -2
- package/build-module/components/media-editor/index.mjs +545 -0
- package/build-module/components/media-editor/index.mjs.map +7 -0
- package/build-module/components/media-editor-canvas/index.mjs +14 -2
- package/build-module/components/media-editor-canvas/index.mjs.map +2 -2
- package/build-module/components/media-editor-crop-panel/index.mjs +35 -28
- package/build-module/components/media-editor-crop-panel/index.mjs.map +2 -2
- package/build-module/components/media-editor-keyboard-shortcuts-modal/index.mjs +144 -0
- package/build-module/components/media-editor-keyboard-shortcuts-modal/index.mjs.map +7 -0
- package/build-module/components/media-editor-modal/index.mjs +46 -455
- package/build-module/components/media-editor-modal/index.mjs.map +2 -2
- package/build-module/components/media-editor-toolbar/index.mjs +137 -77
- package/build-module/components/media-editor-toolbar/index.mjs.map +2 -2
- package/build-module/components/media-form/index.mjs +3 -0
- package/build-module/components/media-form/index.mjs.map +2 -2
- package/build-module/components/rotation-ruler/index.mjs +166 -0
- package/build-module/components/rotation-ruler/index.mjs.map +7 -0
- package/build-module/components/rotation-ruler/use-ruler-drag.mjs +126 -0
- package/build-module/components/rotation-ruler/use-ruler-drag.mjs.map +7 -0
- package/build-module/hooks/use-crop-gesture-handlers.mjs +17 -0
- package/build-module/hooks/use-crop-gesture-handlers.mjs.map +7 -0
- package/build-module/image-editor/core/constants.mjs +6 -0
- package/build-module/image-editor/core/constants.mjs.map +2 -2
- package/build-module/image-editor/core/containment.mjs +6 -12
- package/build-module/image-editor/core/containment.mjs.map +2 -2
- package/build-module/image-editor/core/interaction-controller.mjs +50 -8
- package/build-module/image-editor/core/interaction-controller.mjs.map +2 -2
- package/build-module/image-editor/core/state.mjs +5 -1
- package/build-module/image-editor/core/state.mjs.map +2 -2
- package/build-module/image-editor/core/transform-style.mjs.map +1 -1
- package/build-module/image-editor/core/viewport-state.mjs +24 -0
- package/build-module/image-editor/core/viewport-state.mjs.map +7 -0
- package/build-module/image-editor/react/components/cropper.mjs +195 -73
- package/build-module/image-editor/react/components/cropper.mjs.map +3 -3
- package/build-module/image-editor/react/components/overlays/dimming-overlay.mjs +5 -2
- package/build-module/image-editor/react/components/overlays/dimming-overlay.mjs.map +2 -2
- package/build-module/image-editor/react/components/stencils/rectangle-stencil.mjs +26 -5
- package/build-module/image-editor/react/components/stencils/rectangle-stencil.mjs.map +2 -2
- package/build-module/image-editor/react/components/viewport-provider.mjs +27 -0
- package/build-module/image-editor/react/components/viewport-provider.mjs.map +7 -0
- package/build-module/image-editor/react/hooks/use-aria-announcer.mjs +59 -7
- package/build-module/image-editor/react/hooks/use-aria-announcer.mjs.map +2 -2
- package/build-module/image-editor/react/hooks/use-cropper-state.mjs +134 -9
- package/build-module/image-editor/react/hooks/use-cropper-state.mjs.map +2 -2
- package/build-module/image-editor/react/hooks/use-interaction.mjs +26 -5
- package/build-module/image-editor/react/hooks/use-interaction.mjs.map +2 -2
- package/build-module/image-editor/react/hooks/use-viewport-state.mjs +29 -0
- package/build-module/image-editor/react/hooks/use-viewport-state.mjs.map +7 -0
- package/build-module/image-editor/react/visually-hidden-style.mjs +16 -0
- package/build-module/image-editor/react/visually-hidden-style.mjs.map +7 -0
- package/build-module/private-apis.mjs +2 -0
- package/build-module/private-apis.mjs.map +2 -2
- package/build-style/style-rtl.css +254 -29
- package/build-style/style.css +254 -29
- package/build-types/components/media-editor/index.d.ts +34 -0
- package/build-types/components/media-editor/index.d.ts.map +1 -0
- package/build-types/components/media-editor-canvas/index.d.ts +10 -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 +1 -1
- package/build-types/components/media-editor-crop-panel/index.d.ts.map +1 -1
- package/build-types/components/media-editor-keyboard-shortcuts-modal/index.d.ts +6 -0
- package/build-types/components/media-editor-keyboard-shortcuts-modal/index.d.ts.map +1 -0
- package/build-types/components/media-editor-modal/index.d.ts +2 -2
- package/build-types/components/media-editor-modal/index.d.ts.map +1 -1
- package/build-types/components/media-editor-provider/index.d.ts +1 -1
- package/build-types/components/media-editor-provider/index.d.ts.map +1 -1
- package/build-types/components/media-editor-toolbar/index.d.ts +4 -1
- package/build-types/components/media-editor-toolbar/index.d.ts.map +1 -1
- package/build-types/components/media-form/index.d.ts +1 -1
- package/build-types/components/media-form/index.d.ts.map +1 -1
- package/build-types/components/rotation-ruler/index.d.ts +46 -0
- package/build-types/components/rotation-ruler/index.d.ts.map +1 -0
- package/build-types/components/rotation-ruler/stories/index.story.d.ts +14 -0
- package/build-types/components/rotation-ruler/stories/index.story.d.ts.map +1 -0
- package/build-types/components/rotation-ruler/use-ruler-drag.d.ts +61 -0
- package/build-types/components/rotation-ruler/use-ruler-drag.d.ts.map +1 -0
- package/build-types/hooks/use-crop-gesture-handlers.d.ts +42 -0
- package/build-types/hooks/use-crop-gesture-handlers.d.ts.map +1 -0
- package/build-types/image-editor/core/constants.d.ts +9 -0
- package/build-types/image-editor/core/constants.d.ts.map +1 -1
- package/build-types/image-editor/core/containment.d.ts +11 -7
- package/build-types/image-editor/core/containment.d.ts.map +1 -1
- package/build-types/image-editor/core/interaction-controller.d.ts +14 -2
- package/build-types/image-editor/core/interaction-controller.d.ts.map +1 -1
- package/build-types/image-editor/core/state.d.ts.map +1 -1
- package/build-types/image-editor/core/transform-style.d.ts +1 -1
- package/build-types/image-editor/core/types.d.ts +25 -0
- package/build-types/image-editor/core/types.d.ts.map +1 -1
- package/build-types/image-editor/core/viewport-state.d.ts +7 -0
- package/build-types/image-editor/core/viewport-state.d.ts.map +1 -0
- package/build-types/image-editor/react/components/cropper-provider.d.ts +1 -1
- package/build-types/image-editor/react/components/cropper-provider.d.ts.map +1 -1
- package/build-types/image-editor/react/components/cropper.d.ts +2 -1
- package/build-types/image-editor/react/components/cropper.d.ts.map +1 -1
- package/build-types/image-editor/react/components/overlays/dimming-overlay.d.ts +3 -13
- 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 +1 -1
- 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 +1 -1
- 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 +9 -0
- package/build-types/image-editor/react/components/viewport-provider.d.ts.map +1 -0
- package/build-types/image-editor/react/hooks/use-aria-announcer.d.ts.map +1 -1
- package/build-types/image-editor/react/hooks/use-cropper-state.d.ts +29 -0
- package/build-types/image-editor/react/hooks/use-cropper-state.d.ts.map +1 -1
- package/build-types/image-editor/react/hooks/use-interaction.d.ts +5 -2
- package/build-types/image-editor/react/hooks/use-interaction.d.ts.map +1 -1
- package/build-types/image-editor/react/hooks/use-viewport-state.d.ts +19 -0
- package/build-types/image-editor/react/hooks/use-viewport-state.d.ts.map +1 -0
- package/build-types/image-editor/react/visually-hidden-style.d.ts +6 -0
- package/build-types/image-editor/react/visually-hidden-style.d.ts.map +1 -0
- package/build-types/image-editor/stories/rectangle-crop.story.d.ts.map +1 -1
- package/build-types/private-apis.d.ts.map +1 -1
- package/build-types/store/actions.d.ts +3 -3
- package/build-types/store/actions.d.ts.map +1 -1
- package/package.json +16 -15
- package/src/components/media-editor/index.tsx +709 -0
- package/src/components/media-editor/style.scss +89 -0
- package/src/components/media-editor-canvas/index.tsx +24 -0
- package/src/components/media-editor-crop-panel/index.tsx +39 -27
- package/src/components/media-editor-crop-panel/test/index.tsx +109 -0
- package/src/components/media-editor-keyboard-shortcuts-modal/index.tsx +177 -0
- package/src/components/media-editor-keyboard-shortcuts-modal/style.scss +53 -0
- package/src/components/media-editor-modal/index.tsx +49 -589
- package/src/components/media-editor-modal/style.scss +13 -112
- package/src/components/media-editor-toolbar/index.tsx +122 -63
- package/src/components/media-editor-toolbar/style.scss +39 -11
- package/src/components/media-form/index.tsx +5 -0
- package/src/components/rotation-ruler/README.md +37 -0
- package/src/components/rotation-ruler/index.tsx +266 -0
- package/src/components/rotation-ruler/stories/index.story.tsx +54 -0
- package/src/components/rotation-ruler/style.scss +147 -0
- package/src/components/rotation-ruler/test/index.tsx +109 -0
- package/src/components/rotation-ruler/use-ruler-drag.ts +230 -0
- package/src/hooks/use-crop-gesture-handlers.ts +54 -0
- package/src/image-editor/core/constants.ts +12 -0
- package/src/image-editor/core/containment.ts +16 -28
- package/src/image-editor/core/interaction-controller.ts +66 -10
- package/src/image-editor/core/state.ts +15 -8
- package/src/image-editor/core/test/camera.ts +15 -26
- package/src/image-editor/core/test/interaction-controller.ts +158 -7
- package/src/image-editor/core/test/state.ts +21 -1
- package/src/image-editor/core/transform-style.ts +1 -1
- package/src/image-editor/core/types.ts +16 -0
- package/src/image-editor/core/viewport-state.ts +33 -0
- package/src/image-editor/docs/architecture.md +1 -1
- package/src/image-editor/docs/recipes.md +2 -2
- package/src/image-editor/react/components/cropper.scss +28 -0
- package/src/image-editor/react/components/cropper.tsx +268 -72
- package/src/image-editor/react/components/overlays/dimming-overlay.tsx +12 -12
- package/src/image-editor/react/components/stencils/rectangle-stencil.tsx +27 -8
- package/src/image-editor/react/components/stencils/test/rectangle-stencil.tsx +29 -3
- package/src/image-editor/react/components/test/cropper.tsx +294 -5
- package/src/image-editor/react/components/viewport-provider.tsx +39 -0
- package/src/image-editor/react/hooks/test/use-aria-announcer.ts +81 -0
- package/src/image-editor/react/hooks/test/use-cropper-state.ts +286 -0
- package/src/image-editor/react/hooks/test/use-interaction.ts +1 -0
- package/src/image-editor/react/hooks/use-aria-announcer.ts +68 -7
- package/src/image-editor/react/hooks/use-cropper-state.ts +230 -11
- package/src/image-editor/react/hooks/use-interaction.ts +36 -6
- package/src/image-editor/react/hooks/use-viewport-state.ts +48 -0
- package/src/image-editor/react/visually-hidden-style.ts +15 -0
- package/src/private-apis.ts +2 -0
- package/src/style.scss +3 -0
- package/tsconfig.json +1 -0
- package/tsconfig.tsbuildinfo +1 -1
package/build-style/style.css
CHANGED
|
@@ -140,6 +140,13 @@
|
|
|
140
140
|
position: absolute;
|
|
141
141
|
inset: 22px;
|
|
142
142
|
}
|
|
143
|
+
.wp-media-editor-image-editor__canvas:focus {
|
|
144
|
+
outline: none;
|
|
145
|
+
}
|
|
146
|
+
.wp-media-editor-image-editor__stage {
|
|
147
|
+
position: absolute;
|
|
148
|
+
inset: 0;
|
|
149
|
+
}
|
|
143
150
|
.wp-media-editor-image-editor--dragging {
|
|
144
151
|
cursor: grabbing;
|
|
145
152
|
}
|
|
@@ -180,6 +187,10 @@
|
|
|
180
187
|
opacity: 1;
|
|
181
188
|
transition-delay: 0s;
|
|
182
189
|
}
|
|
190
|
+
.wp-media-editor-image-editor__canvas--settling .wp-media-editor-image-editor__grid {
|
|
191
|
+
opacity: 0;
|
|
192
|
+
transition: none;
|
|
193
|
+
}
|
|
183
194
|
.wp-media-editor-image-editor__grid-line {
|
|
184
195
|
position: absolute;
|
|
185
196
|
background: rgba(255, 255, 255, 0.4);
|
|
@@ -199,6 +210,11 @@
|
|
|
199
210
|
border: 1px solid rgba(255, 255, 255, 0.7);
|
|
200
211
|
box-sizing: border-box;
|
|
201
212
|
pointer-events: none;
|
|
213
|
+
transition: border-color 0.15s ease, box-shadow 0.15s ease;
|
|
214
|
+
}
|
|
215
|
+
.wp-media-editor-image-editor__canvas--focus-visible .wp-media-editor-image-editor__stencil-rect {
|
|
216
|
+
border-color: var(--wp-image-editor-focus-color, var(--wp-admin-theme-color, #007cba));
|
|
217
|
+
box-shadow: 0 0 0 1px var(--wp-image-editor-focus-color, var(--wp-admin-theme-color, #007cba));
|
|
202
218
|
}
|
|
203
219
|
.wp-media-editor-image-editor__handle {
|
|
204
220
|
appearance: none;
|
|
@@ -325,22 +341,20 @@
|
|
|
325
341
|
* Creates a checkerboard pattern background to indicate transparency.
|
|
326
342
|
* @param {String} $size - The size of the squares in the checkerboard pattern. Default is 12px.
|
|
327
343
|
*/
|
|
328
|
-
.media-editor
|
|
329
|
-
padding: 0;
|
|
330
|
-
margin-bottom: 0;
|
|
331
|
-
}
|
|
332
|
-
|
|
333
|
-
.media-editor-modal {
|
|
344
|
+
.media-editor {
|
|
334
345
|
display: flex;
|
|
346
|
+
flex: 1;
|
|
335
347
|
flex-direction: column;
|
|
348
|
+
height: 100%;
|
|
349
|
+
min-height: 0;
|
|
336
350
|
}
|
|
337
|
-
.media-editor
|
|
351
|
+
.media-editor .media-editor__loading {
|
|
338
352
|
height: 100%;
|
|
339
353
|
display: flex;
|
|
340
354
|
align-items: center;
|
|
341
355
|
justify-content: center;
|
|
342
356
|
}
|
|
343
|
-
.media-editor
|
|
357
|
+
.media-editor .interface-interface-skeleton {
|
|
344
358
|
position: relative;
|
|
345
359
|
top: auto;
|
|
346
360
|
right: auto;
|
|
@@ -351,18 +365,18 @@
|
|
|
351
365
|
flex: 1;
|
|
352
366
|
flex-direction: column;
|
|
353
367
|
}
|
|
354
|
-
.media-editor
|
|
368
|
+
.media-editor .interface-interface-skeleton__editor {
|
|
355
369
|
min-width: 0;
|
|
356
370
|
flex: 1;
|
|
357
371
|
}
|
|
358
|
-
.media-editor
|
|
372
|
+
.media-editor .interface-interface-skeleton__footer {
|
|
359
373
|
position: relative;
|
|
360
374
|
display: flex;
|
|
361
375
|
}
|
|
362
|
-
.media-editor
|
|
376
|
+
.media-editor .interface-interface-skeleton.has-footer .interface-interface-skeleton__body {
|
|
363
377
|
padding-bottom: 0;
|
|
364
378
|
}
|
|
365
|
-
.media-editor
|
|
379
|
+
.media-editor .media-editor__canvas {
|
|
366
380
|
display: flex;
|
|
367
381
|
align-items: center;
|
|
368
382
|
justify-content: center;
|
|
@@ -370,39 +384,74 @@
|
|
|
370
384
|
overflow: auto;
|
|
371
385
|
height: 100%;
|
|
372
386
|
}
|
|
373
|
-
.media-editor
|
|
387
|
+
.media-editor .media-editor__canvas .media-editor-preview {
|
|
374
388
|
height: 100%;
|
|
375
389
|
}
|
|
376
|
-
.media-editor
|
|
377
|
-
.media-editor
|
|
390
|
+
.media-editor .media-editor__canvas img,
|
|
391
|
+
.media-editor .media-editor__canvas video {
|
|
378
392
|
max-width: 100%;
|
|
379
393
|
max-height: 100%;
|
|
380
394
|
object-fit: contain;
|
|
381
395
|
}
|
|
382
|
-
.media-editor
|
|
396
|
+
.media-editor .media-editor__sidebar {
|
|
383
397
|
box-sizing: border-box;
|
|
384
398
|
}
|
|
385
|
-
.media-editor
|
|
386
|
-
.media-editor
|
|
387
|
-
.media-editor
|
|
399
|
+
.media-editor .media-editor__sidebar *,
|
|
400
|
+
.media-editor .media-editor__sidebar *::before,
|
|
401
|
+
.media-editor .media-editor__sidebar *::after {
|
|
388
402
|
box-sizing: inherit;
|
|
389
403
|
}
|
|
390
|
-
.media-editor
|
|
404
|
+
.media-editor .media-editor__panel {
|
|
391
405
|
padding: 16px;
|
|
392
406
|
}
|
|
393
|
-
.media-editor
|
|
407
|
+
.media-editor .components-panel__header.media-editor__sidebar-header {
|
|
394
408
|
padding-left: 0;
|
|
395
409
|
padding-right: 8px;
|
|
396
410
|
}
|
|
397
|
-
.media-editor
|
|
411
|
+
.media-editor .components-panel__header.media-editor__sidebar-header .components-button.has-icon {
|
|
398
412
|
padding: 0;
|
|
399
413
|
}
|
|
400
414
|
@media (min-width: 782px) {
|
|
401
|
-
.media-editor
|
|
415
|
+
.media-editor .components-panel__header.media-editor__sidebar-header .components-button.has-icon {
|
|
402
416
|
display: flex;
|
|
403
417
|
}
|
|
404
418
|
}
|
|
405
419
|
|
|
420
|
+
.media-editor__snackbar {
|
|
421
|
+
position: fixed;
|
|
422
|
+
bottom: 24px;
|
|
423
|
+
left: 0;
|
|
424
|
+
right: 0;
|
|
425
|
+
padding-inline: 16px;
|
|
426
|
+
box-sizing: border-box;
|
|
427
|
+
display: flex;
|
|
428
|
+
flex-direction: column;
|
|
429
|
+
pointer-events: none;
|
|
430
|
+
}
|
|
431
|
+
.media-editor__snackbar .components-snackbar {
|
|
432
|
+
margin-inline: auto;
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
.media-editor-modal.components-modal__frame .components-modal__content {
|
|
436
|
+
padding: 0;
|
|
437
|
+
margin-bottom: 0;
|
|
438
|
+
display: flex;
|
|
439
|
+
flex-direction: column;
|
|
440
|
+
min-height: 0;
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
.media-editor-modal.components-modal__frame .components-modal__children-container {
|
|
444
|
+
display: flex;
|
|
445
|
+
flex: 1;
|
|
446
|
+
flex-direction: column;
|
|
447
|
+
min-height: 0;
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
.media-editor-modal {
|
|
451
|
+
display: flex;
|
|
452
|
+
flex-direction: column;
|
|
453
|
+
}
|
|
454
|
+
|
|
406
455
|
.media-editor-modal__snackbar {
|
|
407
456
|
position: fixed;
|
|
408
457
|
bottom: 24px;
|
|
@@ -431,12 +480,188 @@
|
|
|
431
480
|
width: 100%;
|
|
432
481
|
padding: 8px 16px;
|
|
433
482
|
}
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
483
|
+
|
|
484
|
+
.media-editor-toolbar__rotation-slider {
|
|
485
|
+
flex: 1 1 280px;
|
|
486
|
+
min-width: 0;
|
|
487
|
+
max-width: 360px;
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
.media-editor-toolbar__action-cluster {
|
|
491
|
+
display: flex;
|
|
492
|
+
flex-wrap: nowrap;
|
|
493
|
+
align-items: center;
|
|
494
|
+
gap: 8px;
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
@media (min-width: 782px) {
|
|
498
|
+
.media-editor-toolbar__action-cluster {
|
|
499
|
+
border-left: 1px solid #ddd;
|
|
500
|
+
padding-left: 12px;
|
|
501
|
+
}
|
|
502
|
+
}
|
|
503
|
+
@media (max-width: 781px) {
|
|
504
|
+
.media-editor-toolbar__rotation-slider {
|
|
505
|
+
flex-basis: 100%;
|
|
506
|
+
max-width: none;
|
|
507
|
+
}
|
|
508
|
+
.media-editor-toolbar__action-cluster {
|
|
509
|
+
flex-basis: 100%;
|
|
510
|
+
justify-content: center;
|
|
511
|
+
}
|
|
512
|
+
}
|
|
513
|
+
.media-editor-keyboard-shortcuts-modal {
|
|
514
|
+
min-width: 280px;
|
|
515
|
+
}
|
|
516
|
+
.media-editor-keyboard-shortcuts-modal .media-editor-keyboard-shortcuts-modal__note {
|
|
517
|
+
margin: 0 0 16px;
|
|
518
|
+
color: #757575;
|
|
519
|
+
font-size: 13px;
|
|
520
|
+
}
|
|
521
|
+
.media-editor-keyboard-shortcuts-modal .media-editor-keyboard-shortcuts-modal__shortcut-list {
|
|
522
|
+
list-style: none;
|
|
523
|
+
margin: 0;
|
|
524
|
+
padding: 0;
|
|
525
|
+
}
|
|
526
|
+
.media-editor-keyboard-shortcuts-modal .media-editor-keyboard-shortcuts-modal__shortcut {
|
|
527
|
+
display: flex;
|
|
528
|
+
align-items: baseline;
|
|
529
|
+
padding: 0.6rem 0;
|
|
530
|
+
border-top: 1px solid #ddd;
|
|
531
|
+
margin-bottom: 0;
|
|
532
|
+
}
|
|
533
|
+
.media-editor-keyboard-shortcuts-modal .media-editor-keyboard-shortcuts-modal__shortcut:last-child {
|
|
534
|
+
border-bottom: 1px solid #ddd;
|
|
535
|
+
}
|
|
536
|
+
.media-editor-keyboard-shortcuts-modal .media-editor-keyboard-shortcuts-modal__shortcut-description {
|
|
537
|
+
flex: 1;
|
|
538
|
+
margin: 0;
|
|
539
|
+
}
|
|
540
|
+
.media-editor-keyboard-shortcuts-modal .media-editor-keyboard-shortcuts-modal__shortcut-term {
|
|
541
|
+
background: none;
|
|
542
|
+
font-weight: 600;
|
|
543
|
+
margin: 0 0 0 1rem;
|
|
544
|
+
padding: 0;
|
|
545
|
+
text-align: right;
|
|
546
|
+
}
|
|
547
|
+
.media-editor-keyboard-shortcuts-modal .media-editor-keyboard-shortcuts-modal__shortcut-key {
|
|
548
|
+
padding: 0.25rem 0.5rem;
|
|
549
|
+
border-radius: 8%;
|
|
550
|
+
margin: 0 0.2rem 0 0.2rem;
|
|
551
|
+
}
|
|
552
|
+
.media-editor-keyboard-shortcuts-modal .media-editor-keyboard-shortcuts-modal__shortcut-key:last-child {
|
|
553
|
+
margin: 0 0 0 0.2rem;
|
|
554
|
+
}
|
|
555
|
+
|
|
556
|
+
.rotation-ruler {
|
|
557
|
+
position: relative;
|
|
558
|
+
min-width: 180px;
|
|
559
|
+
height: 32px;
|
|
560
|
+
padding: 0 8px;
|
|
561
|
+
box-sizing: border-box;
|
|
562
|
+
color: #1e1e1e;
|
|
563
|
+
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
|
|
564
|
+
-webkit-user-select: none;
|
|
565
|
+
user-select: none;
|
|
566
|
+
touch-action: none;
|
|
567
|
+
cursor: ew-resize;
|
|
568
|
+
container-type: inline-size;
|
|
569
|
+
}
|
|
570
|
+
.rotation-ruler[data-disabled] {
|
|
571
|
+
opacity: 0.5;
|
|
572
|
+
pointer-events: none;
|
|
573
|
+
cursor: default;
|
|
574
|
+
}
|
|
575
|
+
.rotation-ruler:has(.rotation-ruler__input:focus-visible) {
|
|
576
|
+
outline: 2px solid var(--wp-admin-theme-color, #3858e9);
|
|
577
|
+
outline-offset: 2px;
|
|
578
|
+
border-radius: 4px;
|
|
579
|
+
}
|
|
580
|
+
|
|
581
|
+
.rotation-ruler__input {
|
|
582
|
+
position: absolute;
|
|
583
|
+
width: 1px;
|
|
584
|
+
height: 1px;
|
|
585
|
+
margin: -1px;
|
|
586
|
+
padding: 0;
|
|
587
|
+
border: 0;
|
|
588
|
+
clip: rect(0 0 0 0);
|
|
589
|
+
overflow: hidden;
|
|
590
|
+
white-space: nowrap;
|
|
591
|
+
}
|
|
592
|
+
|
|
593
|
+
.rotation-ruler__pointer {
|
|
594
|
+
position: absolute;
|
|
595
|
+
bottom: 0;
|
|
596
|
+
left: 50%;
|
|
597
|
+
width: 0;
|
|
598
|
+
height: 0;
|
|
599
|
+
border-left: 6px solid transparent;
|
|
600
|
+
border-right: 6px solid transparent;
|
|
601
|
+
border-bottom: 9px solid var(--wp-admin-theme-color, #3858e9);
|
|
602
|
+
transform: translateX(-50%);
|
|
603
|
+
pointer-events: none;
|
|
604
|
+
}
|
|
605
|
+
|
|
606
|
+
.rotation-ruler__strip {
|
|
607
|
+
position: absolute;
|
|
608
|
+
inset: 0;
|
|
609
|
+
overflow: hidden;
|
|
610
|
+
mask-image: linear-gradient(to right, transparent 0, #000 8px, #000 calc(100% - 8px), transparent 100%);
|
|
611
|
+
-webkit-mask-image: linear-gradient(to right, transparent 0, #000 8px, #000 calc(100% - 8px), transparent 100%);
|
|
612
|
+
}
|
|
613
|
+
|
|
614
|
+
.rotation-ruler__ticks {
|
|
615
|
+
position: absolute;
|
|
616
|
+
left: 50%;
|
|
617
|
+
top: 0;
|
|
618
|
+
display: block;
|
|
619
|
+
overflow: visible;
|
|
620
|
+
}
|
|
621
|
+
|
|
622
|
+
.rotation-ruler__tick {
|
|
623
|
+
stroke: currentColor;
|
|
624
|
+
stroke-width: 1;
|
|
625
|
+
}
|
|
626
|
+
.rotation-ruler__tick--minor {
|
|
627
|
+
opacity: 0.35;
|
|
628
|
+
}
|
|
629
|
+
.rotation-ruler__tick--mid {
|
|
630
|
+
opacity: 0.6;
|
|
631
|
+
}
|
|
632
|
+
.rotation-ruler__tick--major {
|
|
633
|
+
opacity: 1;
|
|
634
|
+
}
|
|
635
|
+
|
|
636
|
+
.rotation-ruler__label {
|
|
637
|
+
fill: currentColor;
|
|
638
|
+
font-size: 10px;
|
|
639
|
+
font-weight: 400;
|
|
640
|
+
opacity: 0.45;
|
|
641
|
+
}
|
|
642
|
+
|
|
643
|
+
.rotation-ruler__active-label {
|
|
644
|
+
position: absolute;
|
|
645
|
+
top: 0;
|
|
646
|
+
left: 50%;
|
|
647
|
+
height: 14px;
|
|
648
|
+
transform: translateX(-50%);
|
|
649
|
+
padding: 0 12px;
|
|
650
|
+
font-size: 12px;
|
|
651
|
+
font-weight: 600;
|
|
652
|
+
line-height: 14px;
|
|
653
|
+
color: #1e1e1e;
|
|
654
|
+
background: linear-gradient(to right, transparent 0, #fff 12px, #fff calc(100% - 12px), transparent 100%);
|
|
655
|
+
pointer-events: none;
|
|
656
|
+
}
|
|
657
|
+
|
|
658
|
+
@container (max-width: 220px) {
|
|
659
|
+
.rotation-ruler__tick--minor {
|
|
660
|
+
opacity: 0;
|
|
661
|
+
}
|
|
437
662
|
}
|
|
438
|
-
@media (
|
|
439
|
-
.
|
|
440
|
-
|
|
663
|
+
@media (prefers-reduced-motion: reduce) {
|
|
664
|
+
.rotation-ruler__ticks {
|
|
665
|
+
transition: none;
|
|
441
666
|
}
|
|
442
667
|
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { Field } from '@wordpress/dataviews';
|
|
2
|
+
import type { KeyboardEvent as ReactKeyboardEvent, ReactNode } from 'react';
|
|
3
|
+
import type { Media } from '../media-editor-provider';
|
|
4
|
+
import type { AspectRatioPreset } from '../../image-editor/core/constants';
|
|
5
|
+
export interface MediaEditorSaveResult {
|
|
6
|
+
id: number;
|
|
7
|
+
url?: string;
|
|
8
|
+
media: Media;
|
|
9
|
+
}
|
|
10
|
+
export interface MediaEditorFrameProps {
|
|
11
|
+
children: ReactNode;
|
|
12
|
+
headerActions: ReactNode;
|
|
13
|
+
onRequestClose: () => void;
|
|
14
|
+
onKeyDown: (event: ReactKeyboardEvent<HTMLElement>) => void;
|
|
15
|
+
shouldCloseOnClickOutside: boolean;
|
|
16
|
+
isSaving: boolean;
|
|
17
|
+
hasChanges: boolean;
|
|
18
|
+
hasMedia: boolean;
|
|
19
|
+
}
|
|
20
|
+
export interface MediaEditorProps {
|
|
21
|
+
fields?: Field<Media>[];
|
|
22
|
+
id: number;
|
|
23
|
+
aspectRatioPresets?: AspectRatioPreset[];
|
|
24
|
+
onClose?: () => void;
|
|
25
|
+
onSaved?: (result: MediaEditorSaveResult) => void;
|
|
26
|
+
renderFrame: (props: MediaEditorFrameProps) => JSX.Element;
|
|
27
|
+
noticesClassName?: string;
|
|
28
|
+
noticesPortalElement?: Element | null;
|
|
29
|
+
showCloseButton?: boolean;
|
|
30
|
+
shouldCloseOnEsc?: boolean;
|
|
31
|
+
}
|
|
32
|
+
export declare function MediaEditor(props: MediaEditorProps): import("react").JSX.Element;
|
|
33
|
+
export default MediaEditor;
|
|
34
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/media-editor/index.tsx"],"names":[],"mappings":"AA2BA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAQlD,OAAO,KAAK,EAAE,aAAa,IAAI,kBAAkB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAM5E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAC;AAWtD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAgC3E,MAAM,WAAW,qBAAqB;IACrC,EAAE,EAAE,MAAM,CAAC;IACX,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,KAAK,CAAC;CACb;AAED,MAAM,WAAW,qBAAqB;IACrC,QAAQ,EAAE,SAAS,CAAC;IACpB,aAAa,EAAE,SAAS,CAAC;IACzB,cAAc,EAAE,MAAM,IAAI,CAAC;IAC3B,SAAS,EAAE,CAAE,KAAK,EAAE,kBAAkB,CAAE,WAAW,CAAE,KAAM,IAAI,CAAC;IAChE,yBAAyB,EAAE,OAAO,CAAC;IACnC,QAAQ,EAAE,OAAO,CAAC;IAClB,UAAU,EAAE,OAAO,CAAC;IACpB,QAAQ,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,gBAAgB;IAChC,MAAM,CAAC,EAAE,KAAK,CAAE,KAAK,CAAE,EAAE,CAAC;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,kBAAkB,CAAC,EAAE,iBAAiB,EAAE,CAAC;IACzC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,OAAO,CAAC,EAAE,CAAE,MAAM,EAAE,qBAAqB,KAAM,IAAI,CAAC;IACpD,WAAW,EAAE,CAAE,KAAK,EAAE,qBAAqB,KAAM,GAAG,CAAC,OAAO,CAAC;IAC7D,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,oBAAoB,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IACtC,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC3B;AA4kBD,wBAAgB,WAAW,CAAE,KAAK,EAAE,gBAAgB,+BAMnD;eAEc,WAAW"}
|
|
@@ -3,8 +3,14 @@ export interface MediaEditorCanvasProps {
|
|
|
3
3
|
aspectRatio?: number;
|
|
4
4
|
/** Enable freeform crop mode (resize handles). */
|
|
5
5
|
freeformCrop?: boolean;
|
|
6
|
+
/** Focus the crop area when the canvas mounts. */
|
|
7
|
+
focusOnMount?: boolean;
|
|
6
8
|
/** Whether external placement activity should reveal the grid. */
|
|
7
9
|
isPlacementActive?: boolean;
|
|
10
|
+
/** Fires when a canvas cropper gesture begins. */
|
|
11
|
+
onGestureStart?: () => void;
|
|
12
|
+
/** Fires when a canvas cropper gesture ends. */
|
|
13
|
+
onGestureEnd?: () => void;
|
|
8
14
|
}
|
|
9
15
|
/**
|
|
10
16
|
* Editing surface for image media in the media editor modal. Pulls its
|
|
@@ -16,7 +22,10 @@ export interface MediaEditorCanvasProps {
|
|
|
16
22
|
* @param props
|
|
17
23
|
* @param props.aspectRatio
|
|
18
24
|
* @param props.freeformCrop
|
|
25
|
+
* @param props.focusOnMount
|
|
19
26
|
* @param props.isPlacementActive
|
|
27
|
+
* @param props.onGestureStart
|
|
28
|
+
* @param props.onGestureEnd
|
|
20
29
|
*/
|
|
21
|
-
export default function MediaEditorCanvas({ aspectRatio, freeformCrop, isPlacementActive, }: MediaEditorCanvasProps): import("react").JSX.Element | null;
|
|
30
|
+
export default function MediaEditorCanvas({ aspectRatio, freeformCrop, focusOnMount, isPlacementActive, onGestureStart, onGestureEnd }: MediaEditorCanvasProps): import("react").JSX.Element | null;
|
|
22
31
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/media-editor-canvas/index.tsx"],"names":[],"mappings":"AAOA,MAAM,WAAW,sBAAsB;IACtC,mEAAmE;IACnE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,kDAAkD;IAClD,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,kEAAkE;IAClE,iBAAiB,CAAC,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/media-editor-canvas/index.tsx"],"names":[],"mappings":"AAOA,MAAM,WAAW,sBAAsB;IACtC,mEAAmE;IACnE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,kDAAkD;IAClD,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,kDAAkD;IAClD,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,kEAAkE;IAClE,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,kDAAkD;IAClD,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;IAC5B,gDAAgD;IAChD,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;CAC1B;AAED;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,OAAO,UAAU,iBAAiB,CAAE,EAC1C,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,iBAAyB,EACzB,cAAc,EACd,YAAY,EACZ,EAAE,sBAAsB,sCAmCxB"}
|
|
@@ -41,5 +41,5 @@ export declare function resolveAspectRatio(value: string, imageAspectRatio: numb
|
|
|
41
41
|
* @param props.onPlacementControlInteraction
|
|
42
42
|
* @param props.aspectRatioPresets
|
|
43
43
|
*/
|
|
44
|
-
export default function MediaEditorCropPanel({ aspectRatioValue, onAspectRatioChange, freeformCrop, onFreeformChange, onPlacementControlInteraction, aspectRatioPresets
|
|
44
|
+
export default function MediaEditorCropPanel({ aspectRatioValue, onAspectRatioChange, freeformCrop, onFreeformChange, onPlacementControlInteraction, aspectRatioPresets }: MediaEditorCropPanelProps): import("react").JSX.Element;
|
|
45
45
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/media-editor-crop-panel/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/media-editor-crop-panel/index.tsx"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAE3E,MAAM,WAAW,yBAAyB;IACzC;;;;OAIG;IACH,gBAAgB,EAAE,MAAM,CAAC;IACzB,gDAAgD;IAChD,mBAAmB,EAAE,CAAE,KAAK,EAAE,MAAM,KAAM,IAAI,CAAC;IAC/C,+DAA+D;IAC/D,YAAY,EAAE,OAAO,CAAC;IACtB,gCAAgC;IAChC,gBAAgB,EAAE,CAAE,KAAK,EAAE,OAAO,KAAM,IAAI,CAAC;IAC7C,kEAAkE;IAClE,6BAA6B,CAAC,EAAE,MAAM,IAAI,CAAC;IAC3C;;;OAGG;IACH,kBAAkB,CAAC,EAAE,iBAAiB,EAAE,CAAC;CACzC;AAED;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CACjC,KAAK,EAAE,MAAM,EACb,gBAAgB,EAAE,MAAM,GAAG,IAAI,GAC7B,MAAM,GAAG,SAAS,CAYpB;AAED;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,OAAO,UAAU,oBAAoB,CAAE,EAC7C,gBAAgB,EAChB,mBAAmB,EACnB,YAAY,EACZ,gBAAgB,EAChB,6BAA6B,EAC7B,kBAAkB,EAClB,EAAE,yBAAyB,+BAgE3B"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
interface MediaEditorKeyboardShortcutsModalProps {
|
|
2
|
+
onClose: () => void;
|
|
3
|
+
}
|
|
4
|
+
export default function MediaEditorKeyboardShortcutsModal({ onClose }: MediaEditorKeyboardShortcutsModalProps): import("react").JSX.Element;
|
|
5
|
+
export {};
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/media-editor-keyboard-shortcuts-modal/index.tsx"],"names":[],"mappings":"AAoIA,UAAU,sCAAsC;IAC/C,OAAO,EAAE,MAAM,IAAI,CAAC;CACpB;AAED,MAAM,CAAC,OAAO,UAAU,iCAAiC,CAAE,EAC1D,OAAO,EACP,EAAE,sCAAsC,+BAsCxC"}
|
|
@@ -11,10 +11,10 @@ interface MediaEditorModalProps {
|
|
|
11
11
|
fields?: Field<Media>[];
|
|
12
12
|
/**
|
|
13
13
|
* Fixed aspect-ratio presets for image cropping. Free and Original are
|
|
14
|
-
* always provided by the
|
|
14
|
+
* always provided by the media editor.
|
|
15
15
|
*/
|
|
16
16
|
aspectRatioPresets?: AspectRatioPreset[];
|
|
17
17
|
}
|
|
18
|
-
export declare function MediaEditorModal({ fields, aspectRatioPresets
|
|
18
|
+
export declare function MediaEditorModal({ fields, aspectRatioPresets }: MediaEditorModalProps): import("react").JSX.Element | null;
|
|
19
19
|
export default MediaEditorModal;
|
|
20
20
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/media-editor-modal/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/media-editor-modal/index.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAMlD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAC;AAGtD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAE3E,UAAU,qBAAqB;IAC9B;;;;;OAKG;IACH,MAAM,CAAC,EAAE,KAAK,CAAE,KAAK,CAAE,EAAE,CAAC;IAC1B;;;OAGG;IACH,kBAAkB,CAAC,EAAE,iBAAiB,EAAE,CAAC;CACzC;AAED,wBAAgB,gBAAgB,CAAE,EACjC,MAAW,EACX,kBAAkB,EAClB,EAAE,qBAAqB,sCA6DvB;eAEc,gBAAgB"}
|
|
@@ -50,7 +50,7 @@ export interface MediaEditorProviderProps {
|
|
|
50
50
|
/** Child components. */
|
|
51
51
|
children: ReactNode;
|
|
52
52
|
}
|
|
53
|
-
export declare function MediaEditorProvider({ value, onChange, settings, children
|
|
53
|
+
export declare function MediaEditorProvider({ value, onChange, settings, children }: MediaEditorProviderProps): import("react").JSX.Element;
|
|
54
54
|
/**
|
|
55
55
|
* Hook to access the MediaEditor context.
|
|
56
56
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/media-editor-provider/index.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC;;GAEG;AACH,MAAM,WAAW,KAAK;IACrB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,GAAG;QAAE,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,GAAG,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACrD,OAAO,CAAC,EAAE,MAAM,GAAG;QAAE,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,GAAG,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACvD,WAAW,CAAC,EAAE,MAAM,GAAG;QAAE,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,GAAG,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAC3D,CAAE,GAAG,EAAE,MAAM,GAAI,GAAG,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACvC,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,QAAQ,CAAC,EAAE,CAAE,OAAO,EAAE,OAAO,CAAE,KAAK,CAAE,KAAM,IAAI,CAAC;IACjD,MAAM,EAAE,KAAK,CAAE,KAAK,CAAE,EAAE,CAAC;CACzB;AAED;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACxC,gCAAgC;IAChC,KAAK,CAAC,EAAE,KAAK,CAAC;IACd;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,CAAE,OAAO,EAAE,OAAO,CAAE,KAAK,CAAE,KAAM,IAAI,CAAC;IACjD,mDAAmD;IACnD,QAAQ,CAAC,EAAE;QACV,MAAM,CAAC,EAAE,KAAK,CAAE,KAAK,CAAE,EAAE,CAAC;KAC1B,CAAC;IACF,wBAAwB;IACxB,QAAQ,EAAE,SAAS,CAAC;CACpB;AAMD,wBAAgB,mBAAmB,CAAE,EACpC,KAAK,EACL,QAAQ,EACR,QAAa,EACb,QAAQ,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/media-editor-provider/index.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC;;GAEG;AACH,MAAM,WAAW,KAAK;IACrB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,GAAG;QAAE,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,GAAG,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACrD,OAAO,CAAC,EAAE,MAAM,GAAG;QAAE,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,GAAG,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACvD,WAAW,CAAC,EAAE,MAAM,GAAG;QAAE,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,GAAG,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAC3D,CAAE,GAAG,EAAE,MAAM,GAAI,GAAG,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACvC,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,QAAQ,CAAC,EAAE,CAAE,OAAO,EAAE,OAAO,CAAE,KAAK,CAAE,KAAM,IAAI,CAAC;IACjD,MAAM,EAAE,KAAK,CAAE,KAAK,CAAE,EAAE,CAAC;CACzB;AAED;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACxC,gCAAgC;IAChC,KAAK,CAAC,EAAE,KAAK,CAAC;IACd;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,CAAE,OAAO,EAAE,OAAO,CAAE,KAAK,CAAE,KAAM,IAAI,CAAC;IACjD,mDAAmD;IACnD,QAAQ,CAAC,EAAE;QACV,MAAM,CAAC,EAAE,KAAK,CAAE,KAAK,CAAE,EAAE,CAAC;KAC1B,CAAC;IACF,wBAAwB;IACxB,QAAQ,EAAE,SAAS,CAAC;CACpB;AAMD,wBAAgB,mBAAmB,CAAE,EACpC,KAAK,EACL,QAAQ,EACR,QAAa,EACb,QAAQ,EACR,EAAE,wBAAwB,+BAY1B;AAED;;;;;;GAMG;AACH,wBAAgB,qBAAqB,IAAI,uBAAuB,CAQ/D"}
|
|
@@ -7,6 +7,8 @@ export interface MediaEditorToolbarProps {
|
|
|
7
7
|
onReset?: () => void;
|
|
8
8
|
/** Signal that a placement-oriented control is being adjusted. */
|
|
9
9
|
onPlacementControlInteraction?: () => void;
|
|
10
|
+
/** Whether undo/redo should be unavailable during an active gesture. */
|
|
11
|
+
isUndoRedoDisabled?: boolean;
|
|
10
12
|
}
|
|
11
13
|
/**
|
|
12
14
|
* Toolbar for the media editor modal. Hosts the tactile cropper verbs —
|
|
@@ -16,6 +18,7 @@ export interface MediaEditorToolbarProps {
|
|
|
16
18
|
* @param props
|
|
17
19
|
* @param props.onReset
|
|
18
20
|
* @param props.onPlacementControlInteraction
|
|
21
|
+
* @param props.isUndoRedoDisabled
|
|
19
22
|
*/
|
|
20
|
-
export default function MediaEditorToolbar({ onReset, onPlacementControlInteraction, }: MediaEditorToolbarProps): import("react").JSX.Element;
|
|
23
|
+
export default function MediaEditorToolbar({ onReset, onPlacementControlInteraction, isUndoRedoDisabled }: MediaEditorToolbarProps): import("react").JSX.Element;
|
|
21
24
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/media-editor-toolbar/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/media-editor-toolbar/index.tsx"],"names":[],"mappings":"AAwBA,MAAM,WAAW,uBAAuB;IACvC;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,kEAAkE;IAClE,6BAA6B,CAAC,EAAE,MAAM,IAAI,CAAC;IAC3C,wEAAwE;IACxE,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED;;;;;;;;;GASG;AACH,MAAM,CAAC,OAAO,UAAU,kBAAkB,CAAE,EAC3C,OAAO,EACP,6BAA6B,EAC7B,kBAA0B,EAC1B,EAAE,uBAAuB,+BA6JzB"}
|
|
@@ -18,5 +18,5 @@ export interface MediaFormProps {
|
|
|
18
18
|
* @param props.header - Optional header content to display above the form.
|
|
19
19
|
* @return The MediaForm component.
|
|
20
20
|
*/
|
|
21
|
-
export default function MediaForm({ form: formOverrides, header
|
|
21
|
+
export default function MediaForm({ form: formOverrides, header }: MediaFormProps): import("react").JSX.Element;
|
|
22
22
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/media-form/index.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,IAAI,EAAS,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/media-form/index.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,IAAI,EAAS,MAAM,sBAAsB,CAAC;AAIxD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAQvC;;GAEG;AACH,MAAM,WAAW,cAAc;IAC9B,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,MAAM,CAAC,EAAE,SAAS,CAAC;CACnB;AAED;;;;;;;;;;GAUG;AACH,MAAM,CAAC,OAAO,UAAU,SAAS,CAAE,EAClC,IAAI,EAAE,aAAa,EACnB,MAAM,EACN,EAAE,cAAc,+BAqDhB"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
export interface RotationRulerProps {
|
|
2
|
+
/** Current value. */
|
|
3
|
+
value: number;
|
|
4
|
+
/** Called with the next value on each change. */
|
|
5
|
+
onChange: (value: number) => void;
|
|
6
|
+
/** Lower bound of the range. Default: -45. */
|
|
7
|
+
min?: number;
|
|
8
|
+
/** Upper bound of the range. Default: 45. */
|
|
9
|
+
max?: number;
|
|
10
|
+
/**
|
|
11
|
+
* Value step for drag and keyboard arrows. Default: 1. Drag values
|
|
12
|
+
* are quantized to multiples of `step`. Holding Shift during drag
|
|
13
|
+
* or with arrow keys halves the step for precision adjustment.
|
|
14
|
+
*/
|
|
15
|
+
step?: number;
|
|
16
|
+
/** Accessible label for the slider input. */
|
|
17
|
+
label: string;
|
|
18
|
+
/**
|
|
19
|
+
* Unit suffix shown in the active label and `aria-valuetext`.
|
|
20
|
+
* Default: `°`.
|
|
21
|
+
*/
|
|
22
|
+
unit?: string;
|
|
23
|
+
/** CSS pixels of pointer travel per `step`. Default: 6. */
|
|
24
|
+
pixelsPerStep?: number;
|
|
25
|
+
/** Optional extra class for the wrapper. */
|
|
26
|
+
className?: string;
|
|
27
|
+
/**
|
|
28
|
+
* Optional id for the underlying input; auto-generated when
|
|
29
|
+
* omitted.
|
|
30
|
+
*/
|
|
31
|
+
id?: string;
|
|
32
|
+
/** When true, ignores all input. */
|
|
33
|
+
disabled?: boolean;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Horizontal "scrub-the-ruler" slider for fine-grained numeric input
|
|
37
|
+
* such as rotation in degrees.
|
|
38
|
+
*
|
|
39
|
+
* Renders a visually hidden `<input type="range">` for assistive
|
|
40
|
+
* technologies and keyboard input alongside a decorative tick strip
|
|
41
|
+
* that the user can drag with a pointer.
|
|
42
|
+
*
|
|
43
|
+
* @param props Component props. See `RotationRulerProps`.
|
|
44
|
+
*/
|
|
45
|
+
export default function RotationRuler(props: RotationRulerProps): import("react").JSX.Element;
|
|
46
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/rotation-ruler/index.tsx"],"names":[],"mappings":"AAgBA,MAAM,WAAW,kBAAkB;IAClC,qBAAqB;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,iDAAiD;IACjD,QAAQ,EAAE,CAAE,KAAK,EAAE,MAAM,KAAM,IAAI,CAAC;IACpC,8CAA8C;IAC9C,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,6CAA6C;IAC7C,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,6CAA6C;IAC7C,KAAK,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,2DAA2D;IAC3D,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,4CAA4C;IAC5C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,oCAAoC;IACpC,QAAQ,CAAC,EAAE,OAAO,CAAC;CACnB;AAqDD;;;;;;;;;GASG;AACH,MAAM,CAAC,OAAO,UAAU,aAAa,CAAE,KAAK,EAAE,kBAAkB,+BAyJ/D"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* External dependencies
|
|
3
|
+
*/
|
|
4
|
+
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
5
|
+
/**
|
|
6
|
+
* Internal dependencies
|
|
7
|
+
*/
|
|
8
|
+
import RotationRuler from '../index';
|
|
9
|
+
import '../style.scss';
|
|
10
|
+
declare const meta: Meta<typeof RotationRuler>;
|
|
11
|
+
export default meta;
|
|
12
|
+
type Story = StoryObj<typeof RotationRuler>;
|
|
13
|
+
export declare const Default: Story;
|
|
14
|
+
//# sourceMappingURL=index.story.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.story.d.ts","sourceRoot":"","sources":["../../../../src/components/rotation-ruler/stories/index.story.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAQ5D;;GAEG;AACH,OAAO,aAAa,MAAM,UAAU,CAAC;AACrC,OAAO,eAAe,CAAC;AAEvB,QAAA,MAAM,IAAI,EAAE,IAAI,CAAE,OAAO,aAAa,CAerC,CAAC;eACa,IAAI;AAEnB,KAAK,KAAK,GAAG,QAAQ,CAAE,OAAO,aAAa,CAAE,CAAC;AAE9C,eAAO,MAAM,OAAO,EAAE,KAgBrB,CAAC"}
|