@progress/kendo-themes-html 14.7.0-dev.14 → 14.7.0-dev.15
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/dist/cjs/imageeditor/imageeditor-canvas.spec.js +1 -0
- package/dist/cjs/imageeditor/imageeditor-option-list.js +1 -1
- package/dist/cjs/imageeditor/imageeditor-pane.js +1 -1
- package/dist/cjs/imageeditor/imageeditor-preview-thumbnail.js +1 -1
- package/dist/cjs/imageeditor/imageeditor-sidebar.js +1 -1
- package/dist/cjs/imageeditor/imageeditor-toolbar.js +1 -1
- package/dist/cjs/imageeditor/imageeditor.spec.js +1 -1
- package/dist/cjs/imageeditor/templates/imageeditor-adjustments-adaptive.js +1 -0
- package/dist/cjs/imageeditor/templates/imageeditor-adjustments.js +1 -1
- package/dist/cjs/imageeditor/templates/imageeditor-blur-adaptive.js +1 -0
- package/dist/cjs/imageeditor/templates/imageeditor-blur.js +1 -1
- package/dist/cjs/imageeditor/templates/imageeditor-crop-adaptive.js +1 -0
- package/dist/cjs/imageeditor/templates/imageeditor-crop.js +1 -1
- package/dist/cjs/imageeditor/templates/imageeditor-filters-adaptive.js +1 -0
- package/dist/cjs/imageeditor/templates/imageeditor-filters.js +1 -1
- package/dist/cjs/imageeditor/templates/imageeditor-frames-adaptive.js +1 -0
- package/dist/cjs/imageeditor/templates/imageeditor-frames.js +1 -1
- package/dist/cjs/imageeditor/templates/imageeditor-insert-line-adaptive.js +1 -0
- package/dist/cjs/imageeditor/templates/imageeditor-insert-line.js +1 -1
- package/dist/cjs/imageeditor/templates/imageeditor-insert-shape-adaptive.js +1 -0
- package/dist/cjs/imageeditor/templates/imageeditor-insert-shape.js +1 -1
- package/dist/cjs/imageeditor/templates/imageeditor-insert-text-adaptive.js +1 -0
- package/dist/cjs/imageeditor/templates/imageeditor-insert-text.js +1 -1
- package/dist/cjs/imageeditor/templates/imageeditor-normal.js +1 -1
- package/dist/cjs/imageeditor/templates/imageeditor-pixelate-adaptive.js +1 -0
- package/dist/cjs/imageeditor/templates/imageeditor-pixelate.js +1 -1
- package/dist/cjs/imageeditor/templates/imageeditor-resize-adaptive.js +1 -0
- package/dist/cjs/imageeditor/templates/imageeditor-resize.js +1 -1
- package/dist/cjs/imageeditor/templates/imageeditor-rotate-adaptive.js +1 -0
- package/dist/cjs/imageeditor/templates/imageeditor-rotate.js +1 -1
- package/dist/cjs/imageeditor/templates/imageeditor-shadow-adaptive.js +1 -0
- package/dist/cjs/imageeditor/templates/imageeditor-shadow.js +1 -1
- package/dist/cjs/index.js +8 -8
- package/dist/esm/imageeditor/imageeditor-canvas.spec.mjs +1 -0
- package/dist/esm/imageeditor/imageeditor-option-list.mjs +1 -1
- package/dist/esm/imageeditor/imageeditor-pane.mjs +1 -1
- package/dist/esm/imageeditor/imageeditor-preview-thumbnail.mjs +1 -1
- package/dist/esm/imageeditor/imageeditor-sidebar.mjs +1 -1
- package/dist/esm/imageeditor/imageeditor-toolbar.mjs +1 -1
- package/dist/esm/imageeditor/imageeditor.spec.mjs +1 -1
- package/dist/esm/imageeditor/templates/imageeditor-adjustments-adaptive.mjs +1 -0
- package/dist/esm/imageeditor/templates/imageeditor-adjustments.mjs +1 -1
- package/dist/esm/imageeditor/templates/imageeditor-blur-adaptive.mjs +1 -0
- package/dist/esm/imageeditor/templates/imageeditor-blur.mjs +1 -1
- package/dist/esm/imageeditor/templates/imageeditor-crop-adaptive.mjs +1 -0
- package/dist/esm/imageeditor/templates/imageeditor-crop.mjs +1 -1
- package/dist/esm/imageeditor/templates/imageeditor-filters-adaptive.mjs +1 -0
- package/dist/esm/imageeditor/templates/imageeditor-filters.mjs +1 -1
- package/dist/esm/imageeditor/templates/imageeditor-frames-adaptive.mjs +1 -0
- package/dist/esm/imageeditor/templates/imageeditor-frames.mjs +1 -1
- package/dist/esm/imageeditor/templates/imageeditor-insert-line-adaptive.mjs +1 -0
- package/dist/esm/imageeditor/templates/imageeditor-insert-line.mjs +1 -1
- package/dist/esm/imageeditor/templates/imageeditor-insert-shape-adaptive.mjs +1 -0
- package/dist/esm/imageeditor/templates/imageeditor-insert-shape.mjs +1 -1
- package/dist/esm/imageeditor/templates/imageeditor-insert-text-adaptive.mjs +1 -0
- package/dist/esm/imageeditor/templates/imageeditor-insert-text.mjs +1 -1
- package/dist/esm/imageeditor/templates/imageeditor-normal.mjs +1 -1
- package/dist/esm/imageeditor/templates/imageeditor-pixelate-adaptive.mjs +1 -0
- package/dist/esm/imageeditor/templates/imageeditor-pixelate.mjs +1 -1
- package/dist/esm/imageeditor/templates/imageeditor-resize-adaptive.mjs +1 -0
- package/dist/esm/imageeditor/templates/imageeditor-resize.mjs +1 -1
- package/dist/esm/imageeditor/templates/imageeditor-rotate-adaptive.mjs +1 -0
- package/dist/esm/imageeditor/templates/imageeditor-rotate.mjs +1 -1
- package/dist/esm/imageeditor/templates/imageeditor-shadow-adaptive.mjs +1 -0
- package/dist/esm/imageeditor/templates/imageeditor-shadow.mjs +1 -1
- package/dist/esm/index.mjs +8 -8
- package/dist/types/imageeditor/constants.d.ts +9 -0
- package/dist/types/imageeditor/imageeditor-canvas.spec.d.ts +15 -0
- package/dist/types/imageeditor/imageeditor-option-list.d.ts +1 -0
- package/dist/types/imageeditor/imageeditor-pane.d.ts +2 -0
- package/dist/types/imageeditor/imageeditor-preview-thumbnail.d.ts +1 -0
- package/dist/types/imageeditor/imageeditor-sidebar.d.ts +8 -0
- package/dist/types/imageeditor/imageeditor-toolbar.d.ts +5 -4
- package/dist/types/imageeditor/imageeditor.spec.d.ts +7 -3
- package/dist/types/imageeditor/index.d.ts +13 -1
- package/dist/types/imageeditor/templates/imageeditor-adjustments-adaptive.d.ts +1 -0
- package/dist/types/imageeditor/templates/imageeditor-adjustments.d.ts +1 -1
- package/dist/types/imageeditor/templates/imageeditor-blur-adaptive.d.ts +1 -0
- package/dist/types/imageeditor/templates/imageeditor-blur.d.ts +1 -1
- package/dist/types/imageeditor/templates/imageeditor-crop-adaptive.d.ts +1 -0
- package/dist/types/imageeditor/templates/imageeditor-crop.d.ts +1 -1
- package/dist/types/imageeditor/templates/imageeditor-filters-adaptive.d.ts +1 -0
- package/dist/types/imageeditor/templates/imageeditor-filters.d.ts +1 -6
- package/dist/types/imageeditor/templates/imageeditor-frames-adaptive.d.ts +1 -0
- package/dist/types/imageeditor/templates/imageeditor-frames.d.ts +1 -1
- package/dist/types/imageeditor/templates/imageeditor-insert-line-adaptive.d.ts +1 -0
- package/dist/types/imageeditor/templates/imageeditor-insert-line.d.ts +1 -1
- package/dist/types/imageeditor/templates/imageeditor-insert-shape-adaptive.d.ts +1 -0
- package/dist/types/imageeditor/templates/imageeditor-insert-shape.d.ts +1 -1
- package/dist/types/imageeditor/templates/imageeditor-insert-text-adaptive.d.ts +1 -0
- package/dist/types/imageeditor/templates/imageeditor-insert-text.d.ts +1 -1
- package/dist/types/imageeditor/templates/imageeditor-pixelate-adaptive.d.ts +1 -0
- package/dist/types/imageeditor/templates/imageeditor-pixelate.d.ts +1 -1
- package/dist/types/imageeditor/templates/imageeditor-resize-adaptive.d.ts +1 -0
- package/dist/types/imageeditor/templates/imageeditor-resize.d.ts +1 -1
- package/dist/types/imageeditor/templates/imageeditor-rotate-adaptive.d.ts +1 -0
- package/dist/types/imageeditor/templates/imageeditor-rotate.d.ts +1 -1
- package/dist/types/imageeditor/templates/imageeditor-shadow-adaptive.d.ts +1 -0
- package/dist/types/imageeditor/templates/imageeditor-shadow.d.ts +1 -1
- package/package.json +1 -1
- package/src/imageeditor/constants.ts +4 -0
- package/src/imageeditor/imageeditor-canvas.spec.tsx +30 -0
- package/src/imageeditor/imageeditor-option-list.tsx +2 -1
- package/src/imageeditor/imageeditor-pane.tsx +4 -1
- package/src/imageeditor/imageeditor-preview-thumbnail.tsx +3 -2
- package/src/imageeditor/imageeditor-sidebar.tsx +32 -19
- package/src/imageeditor/imageeditor-toolbar.tsx +27 -21
- package/src/imageeditor/imageeditor.spec.tsx +14 -6
- package/src/imageeditor/index.ts +13 -1
- package/src/imageeditor/templates/imageeditor-adjustments-adaptive.tsx +3 -0
- package/src/imageeditor/templates/imageeditor-adjustments.tsx +80 -57
- package/src/imageeditor/templates/imageeditor-blur-adaptive.tsx +3 -0
- package/src/imageeditor/templates/imageeditor-blur.tsx +9 -25
- package/src/imageeditor/templates/imageeditor-crop-adaptive.tsx +3 -0
- package/src/imageeditor/templates/imageeditor-crop.tsx +22 -28
- package/src/imageeditor/templates/imageeditor-filters-adaptive.tsx +3 -0
- package/src/imageeditor/templates/imageeditor-filters.tsx +32 -52
- package/src/imageeditor/templates/imageeditor-frames-adaptive.tsx +3 -0
- package/src/imageeditor/templates/imageeditor-frames.tsx +123 -149
- package/src/imageeditor/templates/imageeditor-insert-line-adaptive.tsx +3 -0
- package/src/imageeditor/templates/imageeditor-insert-line.tsx +24 -25
- package/src/imageeditor/templates/imageeditor-insert-shape-adaptive.tsx +3 -0
- package/src/imageeditor/templates/imageeditor-insert-shape.tsx +93 -50
- package/src/imageeditor/templates/imageeditor-insert-text-adaptive.tsx +3 -0
- package/src/imageeditor/templates/imageeditor-insert-text.tsx +24 -25
- package/src/imageeditor/templates/imageeditor-normal.tsx +2 -23
- package/src/imageeditor/templates/imageeditor-pixelate-adaptive.tsx +3 -0
- package/src/imageeditor/templates/imageeditor-pixelate.tsx +9 -24
- package/src/imageeditor/templates/imageeditor-resize-adaptive.tsx +3 -0
- package/src/imageeditor/templates/imageeditor-resize.tsx +10 -25
- package/src/imageeditor/templates/imageeditor-rotate-adaptive.tsx +3 -0
- package/src/imageeditor/templates/imageeditor-rotate.tsx +8 -23
- package/src/imageeditor/templates/imageeditor-shadow-adaptive.tsx +3 -0
- package/src/imageeditor/templates/imageeditor-shadow.tsx +20 -42
- package/src/imageeditor/tests/imageeditor-adaptive-panes.tsx +85 -0
- package/src/imageeditor/tests/imageeditor-adaptive-small.tsx +10 -305
- package/src/imageeditor/tests/imageeditor-adjustments-pane.tsx +2 -1
- package/src/imageeditor/tests/imageeditor-blur-pane.tsx +2 -1
- package/src/imageeditor/tests/imageeditor-crop-pane.tsx +2 -1
- package/src/imageeditor/tests/imageeditor-filters-pane.tsx +2 -1
- package/src/imageeditor/tests/imageeditor-frames-pane.tsx +4 -3
- package/src/imageeditor/tests/imageeditor-insert-shape-pane.tsx +1 -1
- package/src/imageeditor/tests/imageeditor-interactive-states.tsx +6 -6
- package/src/imageeditor/tests/imageeditor-pixelate-pane.tsx +2 -1
- package/src/imageeditor/tests/imageeditor-resize-pane.tsx +2 -1
- package/src/imageeditor/tests/imageeditor-responsive.tsx +4 -4
- package/src/imageeditor/tests/imageeditor-rotate-pane.tsx +2 -1
- package/src/imageeditor/tests/imageeditor-shadow-pane.tsx +2 -1
- package/dist/cjs/imageeditor/templates/imageeditor-disabled.js +0 -1
- package/dist/esm/imageeditor/templates/imageeditor-disabled.mjs +0 -1
- package/dist/types/imageeditor/templates/imageeditor-disabled.d.ts +0 -1
- package/src/imageeditor/templates/imageeditor-disabled.tsx +0 -54
package/src/imageeditor/index.ts
CHANGED
|
@@ -6,13 +6,13 @@ export * from './imageeditor-pane';
|
|
|
6
6
|
export * from './imageeditor-option-preview';
|
|
7
7
|
export * from './imageeditor-option-list';
|
|
8
8
|
export * from './imageeditor-preview-thumbnail';
|
|
9
|
+
export * from './imageeditor-canvas.spec';
|
|
9
10
|
export * from './imageeditor-resize-handles';
|
|
10
11
|
export * from './imageeditor-rotate-handle';
|
|
11
12
|
export * from './templates/imageeditor-normal';
|
|
12
13
|
export * from './templates/imageeditor-resize';
|
|
13
14
|
export * from './templates/imageeditor-rotate';
|
|
14
15
|
export * from './templates/imageeditor-crop';
|
|
15
|
-
export * from './templates/imageeditor-disabled';
|
|
16
16
|
export * from './templates/imageeditor-insert-text';
|
|
17
17
|
export * from './templates/imageeditor-insert-shape';
|
|
18
18
|
export * from './templates/imageeditor-insert-line';
|
|
@@ -22,4 +22,16 @@ export * from './templates/imageeditor-filters';
|
|
|
22
22
|
export * from './templates/imageeditor-adjustments';
|
|
23
23
|
export * from './templates/imageeditor-frames';
|
|
24
24
|
export * from './templates/imageeditor-shadow';
|
|
25
|
+
export * from './templates/imageeditor-resize-adaptive';
|
|
26
|
+
export * from './templates/imageeditor-crop-adaptive';
|
|
27
|
+
export * from './templates/imageeditor-rotate-adaptive';
|
|
28
|
+
export * from './templates/imageeditor-insert-text-adaptive';
|
|
29
|
+
export * from './templates/imageeditor-insert-shape-adaptive';
|
|
30
|
+
export * from './templates/imageeditor-insert-line-adaptive';
|
|
31
|
+
export * from './templates/imageeditor-blur-adaptive';
|
|
32
|
+
export * from './templates/imageeditor-pixelate-adaptive';
|
|
33
|
+
export * from './templates/imageeditor-adjustments-adaptive';
|
|
34
|
+
export * from './templates/imageeditor-filters-adaptive';
|
|
35
|
+
export * from './templates/imageeditor-frames-adaptive';
|
|
36
|
+
export * from './templates/imageeditor-shadow-adaptive';
|
|
25
37
|
|
|
@@ -1,53 +1,9 @@
|
|
|
1
|
-
import { ImageEditor, ImageEditorPane } from "..";
|
|
1
|
+
import { ImageEditor, ImageEditorPane, ImageEditorCanvas } from "..";
|
|
2
2
|
import { Button } from "../../button";
|
|
3
3
|
import { NumericTextbox } from "../../numerictextbox";
|
|
4
4
|
import { Form, FormField } from "../../form";
|
|
5
5
|
import { Slider } from "../../slider";
|
|
6
6
|
|
|
7
|
-
const adjustmentsSidebarItems = [
|
|
8
|
-
<Button fillMode="flat" key="sidebar-button-1" icon="image-resize" aria-label="Resize"></Button>,
|
|
9
|
-
<Button fillMode="flat" key="sidebar-button-2" icon="crop" aria-label="Crop"></Button>,
|
|
10
|
-
<Button fillMode="flat" key="sidebar-button-3" icon="rotate" aria-label="Rotate"></Button>,
|
|
11
|
-
<div className="k-separator" key="sidebar-separator-1"></div>,
|
|
12
|
-
<Button fillMode="flat" key="sidebar-button-4" icon="free-text" aria-label="Text"></Button>,
|
|
13
|
-
<Button fillMode="flat" key="sidebar-button-5" icon="shapes" aria-label="Shapes"></Button>,
|
|
14
|
-
<div className="k-separator" key="sidebar-separator-2"></div>,
|
|
15
|
-
<Button fillMode="flat" key="sidebar-button-6" icon="drop-half-pixelated" aria-label="Blur"></Button>,
|
|
16
|
-
<Button fillMode="flat" key="sidebar-button-7" icon="sliders-horizontal" selected aria-label="Adjustments"></Button>,
|
|
17
|
-
<Button fillMode="flat" key="sidebar-button-8" icon="circles-three-intersecting" aria-label="Filters"></Button>,
|
|
18
|
-
<div className="k-separator" key="sidebar-separator-3"></div>,
|
|
19
|
-
<Button fillMode="flat" key="sidebar-button-9" icon="frame-corners" aria-label="Frame"></Button>,
|
|
20
|
-
<Button fillMode="flat" key="sidebar-button-10" icon="circle-half-tilted" aria-label="Shadow"></Button>
|
|
21
|
-
];
|
|
22
|
-
|
|
23
|
-
const AdjustmentSlider = ({ id, label, value, min = 0, max = 100 }: { id: string; label: string; value: number; min?: number; max?: number }) => (
|
|
24
|
-
<FormField
|
|
25
|
-
label={label}
|
|
26
|
-
editorId={id}
|
|
27
|
-
editor={
|
|
28
|
-
<div className="k-imageeditor-adjustment-editor">
|
|
29
|
-
<Slider
|
|
30
|
-
className="k-imageeditor-adjustment-slider"
|
|
31
|
-
aria-label={label}
|
|
32
|
-
showButtons={false}
|
|
33
|
-
showTicks={false}
|
|
34
|
-
value={value}
|
|
35
|
-
min={min}
|
|
36
|
-
max={max}
|
|
37
|
-
style={{ "--kendo-slider-start": 0, "--kendo-slider-end": (value - min) / (max - min) * 100 } as React.CSSProperties}
|
|
38
|
-
/>
|
|
39
|
-
<NumericTextbox
|
|
40
|
-
id={id}
|
|
41
|
-
style={{ width: "80px", flex: "none" }}
|
|
42
|
-
showClearButton={false}
|
|
43
|
-
showSpinButton={false}
|
|
44
|
-
value={String(value)}
|
|
45
|
-
/>
|
|
46
|
-
</div>
|
|
47
|
-
}
|
|
48
|
-
/>
|
|
49
|
-
);
|
|
50
|
-
|
|
51
7
|
export const ImageEditorAdjustments = ({
|
|
52
8
|
brightness = 0,
|
|
53
9
|
contrast = 0,
|
|
@@ -56,32 +12,99 @@ export const ImageEditorAdjustments = ({
|
|
|
56
12
|
exposure = 0,
|
|
57
13
|
blur = 0,
|
|
58
14
|
opacity = 100,
|
|
15
|
+
isPristine = brightness === 0 && contrast === 0 && saturation === 0 && hue === 0 && exposure === 0 && blur === 0 && opacity === 100,
|
|
16
|
+
adaptive,
|
|
17
|
+
imageSrc,
|
|
59
18
|
...props
|
|
60
19
|
}: any) => (
|
|
61
20
|
<ImageEditor
|
|
62
|
-
|
|
21
|
+
adaptive={adaptive}
|
|
22
|
+
activeTool="Adjustments"
|
|
63
23
|
actionPane={
|
|
64
|
-
<ImageEditorPane title="Adjustments" actions={
|
|
24
|
+
<ImageEditorPane title="Adjustments" adaptive={adaptive} confirmDisabled={isPristine} actions={
|
|
65
25
|
<>
|
|
66
|
-
<Button>Reset</Button>
|
|
67
|
-
<Button themeColor="primary">Apply</Button>
|
|
26
|
+
<Button disabled={isPristine}>Reset</Button>
|
|
27
|
+
<Button themeColor="primary" disabled={isPristine}>Apply</Button>
|
|
68
28
|
</>
|
|
69
29
|
}>
|
|
70
30
|
<Form tag="div">
|
|
71
|
-
<
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
31
|
+
<FormField
|
|
32
|
+
label="Brightness"
|
|
33
|
+
editorId="adjustments-brightness"
|
|
34
|
+
editor={
|
|
35
|
+
<div className="k-imageeditor-adjustment-editor">
|
|
36
|
+
<Slider className="k-imageeditor-adjustment-slider" aria-label="Brightness" showButtons={false} showTicks={false} value={brightness} min={-100} max={100} style={{ "--kendo-slider-start": 0, "--kendo-slider-end": (brightness + 100) / 2 } as React.CSSProperties} />
|
|
37
|
+
<NumericTextbox id="adjustments-brightness" style={{ width: "80px", flex: "none" }} showClearButton={false} showSpinButton={false} value={String(brightness)} />
|
|
38
|
+
</div>
|
|
39
|
+
}
|
|
40
|
+
/>
|
|
41
|
+
<FormField
|
|
42
|
+
label="Contrast"
|
|
43
|
+
editorId="adjustments-contrast"
|
|
44
|
+
editor={
|
|
45
|
+
<div className="k-imageeditor-adjustment-editor">
|
|
46
|
+
<Slider className="k-imageeditor-adjustment-slider" aria-label="Contrast" showButtons={false} showTicks={false} value={contrast} min={-100} max={100} style={{ "--kendo-slider-start": 0, "--kendo-slider-end": (contrast + 100) / 2 } as React.CSSProperties} />
|
|
47
|
+
<NumericTextbox id="adjustments-contrast" style={{ width: "80px", flex: "none" }} showClearButton={false} showSpinButton={false} value={String(contrast)} />
|
|
48
|
+
</div>
|
|
49
|
+
}
|
|
50
|
+
/>
|
|
51
|
+
<FormField
|
|
52
|
+
label="Saturation"
|
|
53
|
+
editorId="adjustments-saturation"
|
|
54
|
+
editor={
|
|
55
|
+
<div className="k-imageeditor-adjustment-editor">
|
|
56
|
+
<Slider className="k-imageeditor-adjustment-slider" aria-label="Saturation" showButtons={false} showTicks={false} value={saturation} min={-100} max={100} style={{ "--kendo-slider-start": 0, "--kendo-slider-end": (saturation + 100) / 2 } as React.CSSProperties} />
|
|
57
|
+
<NumericTextbox id="adjustments-saturation" style={{ width: "80px", flex: "none" }} showClearButton={false} showSpinButton={false} value={String(saturation)} />
|
|
58
|
+
</div>
|
|
59
|
+
}
|
|
60
|
+
/>
|
|
61
|
+
<FormField
|
|
62
|
+
label="Hue"
|
|
63
|
+
editorId="adjustments-hue"
|
|
64
|
+
editor={
|
|
65
|
+
<div className="k-imageeditor-adjustment-editor">
|
|
66
|
+
<Slider className="k-imageeditor-adjustment-slider" aria-label="Hue" showButtons={false} showTicks={false} value={hue} min={-100} max={100} style={{ "--kendo-slider-start": 0, "--kendo-slider-end": (hue + 100) / 2 } as React.CSSProperties} />
|
|
67
|
+
<NumericTextbox id="adjustments-hue" style={{ width: "80px", flex: "none" }} showClearButton={false} showSpinButton={false} value={String(hue)} />
|
|
68
|
+
</div>
|
|
69
|
+
}
|
|
70
|
+
/>
|
|
71
|
+
<FormField
|
|
72
|
+
label="Exposure"
|
|
73
|
+
editorId="adjustments-exposure"
|
|
74
|
+
editor={
|
|
75
|
+
<div className="k-imageeditor-adjustment-editor">
|
|
76
|
+
<Slider className="k-imageeditor-adjustment-slider" aria-label="Exposure" showButtons={false} showTicks={false} value={exposure} min={-100} max={100} style={{ "--kendo-slider-start": 0, "--kendo-slider-end": (exposure + 100) / 2 } as React.CSSProperties} />
|
|
77
|
+
<NumericTextbox id="adjustments-exposure" style={{ width: "80px", flex: "none" }} showClearButton={false} showSpinButton={false} value={String(exposure)} />
|
|
78
|
+
</div>
|
|
79
|
+
}
|
|
80
|
+
/>
|
|
81
|
+
<FormField
|
|
82
|
+
label="Blur"
|
|
83
|
+
editorId="adjustments-blur"
|
|
84
|
+
editor={
|
|
85
|
+
<div className="k-imageeditor-adjustment-editor">
|
|
86
|
+
<Slider className="k-imageeditor-adjustment-slider" aria-label="Blur" showButtons={false} showTicks={false} value={blur} min={0} max={100} style={{ "--kendo-slider-start": 0, "--kendo-slider-end": blur } as React.CSSProperties} />
|
|
87
|
+
<NumericTextbox id="adjustments-blur" style={{ width: "80px", flex: "none" }} showClearButton={false} showSpinButton={false} value={String(blur)} />
|
|
88
|
+
</div>
|
|
89
|
+
}
|
|
90
|
+
/>
|
|
91
|
+
<FormField
|
|
92
|
+
label="Opacity"
|
|
93
|
+
editorId="adjustments-opacity"
|
|
94
|
+
editor={
|
|
95
|
+
<div className="k-imageeditor-adjustment-editor">
|
|
96
|
+
<Slider className="k-imageeditor-adjustment-slider" aria-label="Opacity" showButtons={false} showTicks={false} value={opacity} min={0} max={100} style={{ "--kendo-slider-start": 0, "--kendo-slider-end": opacity } as React.CSSProperties} />
|
|
97
|
+
<NumericTextbox id="adjustments-opacity" style={{ width: "80px", flex: "none" }} showClearButton={false} showSpinButton={false} value={String(opacity)} />
|
|
98
|
+
</div>
|
|
99
|
+
}
|
|
100
|
+
/>
|
|
78
101
|
</Form>
|
|
79
102
|
</ImageEditorPane>
|
|
80
103
|
}
|
|
81
104
|
|
|
82
105
|
children={
|
|
83
106
|
<>
|
|
84
|
-
<
|
|
107
|
+
<ImageEditorCanvas adaptive={adaptive} imageSrc={imageSrc} />
|
|
85
108
|
</>
|
|
86
109
|
}
|
|
87
110
|
{...props} />
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ImageEditor, ImageEditorPane } from "..";
|
|
1
|
+
import { ImageEditor, ImageEditorPane, ImageEditorCanvas } from "..";
|
|
2
2
|
import { Button } from "../../button";
|
|
3
3
|
import { NumericTextbox } from "../../numerictextbox";
|
|
4
4
|
import { Form, FormField } from "../../form";
|
|
@@ -7,34 +7,18 @@ import { SegmentedControl, SegmentedControlButton } from "../../segmented-contro
|
|
|
7
7
|
import { Slider } from "../../slider";
|
|
8
8
|
import { InputSuffixText } from "../../input";
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
const blurSidebarItems = [
|
|
12
|
-
<Button fillMode="flat" key="sidebar-button-1" icon="image-resize" aria-label="Resize"></Button>,
|
|
13
|
-
<Button fillMode="flat" key="sidebar-button-2" icon="crop" aria-label="Crop"></Button>,
|
|
14
|
-
<Button fillMode="flat" key="sidebar-button-3" icon="rotate" aria-label="Rotate"></Button>,
|
|
15
|
-
<div className="k-separator" key="sidebar-separator-1"></div>,
|
|
16
|
-
<Button fillMode="flat" key="sidebar-button-4" icon="free-text" aria-label="Text"></Button>,
|
|
17
|
-
<Button fillMode="flat" key="sidebar-button-5" icon="shapes" aria-label="Shapes"></Button>,
|
|
18
|
-
<div className="k-separator" key="sidebar-separator-2"></div>,
|
|
19
|
-
<Button fillMode="flat" key="sidebar-button-6" icon="drop-half-pixelated" selected aria-label="Blur"></Button>,
|
|
20
|
-
<Button fillMode="flat" key="sidebar-button-7" icon="sliders-horizontal" aria-label="Adjustments"></Button>,
|
|
21
|
-
<Button fillMode="flat" key="sidebar-button-8" icon="circles-three-intersecting" aria-label="Filters"></Button>,
|
|
22
|
-
<div className="k-separator" key="sidebar-separator-3"></div>,
|
|
23
|
-
<Button fillMode="flat" key="sidebar-button-9" icon="frame-corners" aria-label="Frame"></Button>,
|
|
24
|
-
<Button fillMode="flat" key="sidebar-button-10" icon="circle-half-tilted" aria-label="Shadow"></Button>
|
|
25
|
-
];
|
|
26
|
-
|
|
27
|
-
export const ImageEditorBlur = ({ selected = false, shape = "rectangular", intensity = 16, ...props }: any) => (
|
|
10
|
+
export const ImageEditorBlur = ({ selected = false, shape = "rectangular", intensity = 0, adaptive, imageSrc, ...props }: any) => (
|
|
28
11
|
<ImageEditor
|
|
29
|
-
|
|
12
|
+
adaptive={adaptive}
|
|
13
|
+
activeTool="Blur"
|
|
30
14
|
actionPane={
|
|
31
|
-
<ImageEditorPane title="Blur" actions={
|
|
15
|
+
<ImageEditorPane title="Blur" adaptive={adaptive} confirmDisabled={!selected} actions={
|
|
32
16
|
<>
|
|
33
|
-
<Button>Reset</Button>
|
|
34
|
-
<Button themeColor="primary">Apply</Button>
|
|
17
|
+
<Button disabled={!selected}>Reset</Button>
|
|
18
|
+
<Button themeColor="primary" disabled={!selected}>Apply</Button>
|
|
35
19
|
</>
|
|
36
20
|
}>
|
|
37
|
-
<SegmentedControl thumbStyles={{ width: "50%" }} stretched aria-label="Redaction Tool"
|
|
21
|
+
<SegmentedControl thumbStyles={{ width: "50%" }} stretched aria-label="Redaction Tool">
|
|
38
22
|
<SegmentedControlButton icon="blur" selected>Blur</SegmentedControlButton>
|
|
39
23
|
<SegmentedControlButton icon="grid">Pixelate</SegmentedControlButton>
|
|
40
24
|
</SegmentedControl>
|
|
@@ -109,7 +93,7 @@ export const ImageEditorBlur = ({ selected = false, shape = "rectangular", inten
|
|
|
109
93
|
}
|
|
110
94
|
|
|
111
95
|
children={
|
|
112
|
-
<
|
|
96
|
+
<ImageEditorCanvas adaptive={adaptive} imageSrc={imageSrc} />
|
|
113
97
|
}
|
|
114
98
|
{...props} />
|
|
115
99
|
);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { ImageEditor, ImageEditorPane, ImageEditorOptionList, ImageEditorOptionPreview, ImageEditorResizeHandles } from "..";
|
|
1
|
+
import { ImageEditor, ImageEditorPane, ImageEditorOptionList, ImageEditorOptionPreview, ImageEditorResizeHandles, ImageEditorCanvas } from "..";
|
|
2
|
+
import { IMAGEEDITOR_ADAPTIVE_CANVAS_SIZE, IMAGEEDITOR_CANVAS_SIZE } from "../constants";
|
|
2
3
|
import { Button } from "../../button";
|
|
3
4
|
import { CheckboxWithLabelAfter } from "../../checkbox";
|
|
4
5
|
import { NumericTextbox } from "../../numerictextbox";
|
|
@@ -6,30 +7,23 @@ import { Form, FormField, Fieldset } from "../../form";
|
|
|
6
7
|
import { Icon } from "../../icon";
|
|
7
8
|
import { RadioGroup, RadioItem, RadioButtonWithLabelAfter } from "../../radio";
|
|
8
9
|
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
<Button fillMode="flat" key="sidebar-button-7" icon="sliders-horizontal" aria-label="Adjustments"></Button>,
|
|
19
|
-
<Button fillMode="flat" key="sidebar-button-8" icon="circles-three-intersecting" aria-label="Filters"></Button>,
|
|
20
|
-
<div className="k-separator" key="sidebar-separator-3"></div>,
|
|
21
|
-
<Button fillMode="flat" key="sidebar-button-9" icon="frame-corners" aria-label="Frame"></Button>,
|
|
22
|
-
<Button fillMode="flat" key="sidebar-button-10" icon="circle-half-tilted" aria-label="Shadow"></Button>
|
|
23
|
-
];
|
|
24
|
-
|
|
25
|
-
export const ImageEditorCrop = ({ cropWidth = 494, cropHeight = 307, ...props }: any) => (
|
|
10
|
+
export const ImageEditorCrop = ({
|
|
11
|
+
cropWidth = 494,
|
|
12
|
+
cropHeight = 307,
|
|
13
|
+
isPristine = cropWidth === 494 && cropHeight === 307,
|
|
14
|
+
adaptive,
|
|
15
|
+
canvas = adaptive ? IMAGEEDITOR_ADAPTIVE_CANVAS_SIZE : IMAGEEDITOR_CANVAS_SIZE,
|
|
16
|
+
imageSrc,
|
|
17
|
+
...props
|
|
18
|
+
}: any) => (
|
|
26
19
|
<ImageEditor
|
|
27
|
-
|
|
20
|
+
adaptive={adaptive}
|
|
21
|
+
activeTool="Crop"
|
|
28
22
|
actionPane={
|
|
29
|
-
<ImageEditorPane title="Crop" actions={
|
|
23
|
+
<ImageEditorPane title="Crop" adaptive={adaptive} confirmDisabled={isPristine} actions={
|
|
30
24
|
<>
|
|
31
|
-
<Button>Reset</Button>
|
|
32
|
-
<Button themeColor="primary">Apply</Button>
|
|
25
|
+
<Button disabled={isPristine}>Reset</Button>
|
|
26
|
+
<Button themeColor="primary" disabled={isPristine}>Apply</Button>
|
|
33
27
|
</>
|
|
34
28
|
}>
|
|
35
29
|
<Form tag="div">
|
|
@@ -49,7 +43,7 @@ export const ImageEditorCrop = ({ cropWidth = 494, cropHeight = 307, ...props }:
|
|
|
49
43
|
<FormField
|
|
50
44
|
label="Aspect Ratio"
|
|
51
45
|
editor={
|
|
52
|
-
<ImageEditorOptionList scrollable
|
|
46
|
+
<ImageEditorOptionList scrollable>
|
|
53
47
|
<ImageEditorOptionPreview selected><span className="k-imageeditor-option-label">Original</span></ImageEditorOptionPreview>
|
|
54
48
|
<ImageEditorOptionPreview><span className="k-imageeditor-option-label">1:1</span></ImageEditorOptionPreview>
|
|
55
49
|
<ImageEditorOptionPreview><span className="k-imageeditor-option-label">3:2</span></ImageEditorOptionPreview>
|
|
@@ -65,12 +59,12 @@ export const ImageEditorCrop = ({ cropWidth = 494, cropHeight = 307, ...props }:
|
|
|
65
59
|
<FormField
|
|
66
60
|
label="Width"
|
|
67
61
|
editorId="crop-width"
|
|
68
|
-
editor={ <NumericTextbox id="crop-width" showClearButton={false} value={String(cropWidth)} prefix={<Icon icon="arrows-left-right" />} /> }
|
|
62
|
+
editor={ <NumericTextbox id="crop-width" showClearButton={false} showSpinButton={false} value={String(cropWidth)} prefix={<Icon icon="arrows-left-right" />} /> }
|
|
69
63
|
/>
|
|
70
64
|
<FormField
|
|
71
65
|
label="Height"
|
|
72
66
|
editorId="crop-height"
|
|
73
|
-
editor={ <NumericTextbox id="crop-height" showClearButton={false} value={String(cropHeight)} prefix={<Icon icon="arrows-top-bottom" />} /> }
|
|
67
|
+
editor={ <NumericTextbox id="crop-height" showClearButton={false} showSpinButton={false} value={String(cropHeight)} prefix={<Icon icon="arrows-top-bottom" />} /> }
|
|
74
68
|
/>
|
|
75
69
|
</Fieldset>
|
|
76
70
|
<FormField editor={ <CheckboxWithLabelAfter id="crop-lock" checked>Lock Aspect Ratio</CheckboxWithLabelAfter> } />
|
|
@@ -80,10 +74,10 @@ export const ImageEditorCrop = ({ cropWidth = 494, cropHeight = 307, ...props }:
|
|
|
80
74
|
|
|
81
75
|
children={
|
|
82
76
|
<>
|
|
83
|
-
<canvas
|
|
84
|
-
<div className="k-imageeditor-crop-overlay" style={{ "--crop-x": "0px", "--crop-y": "0px", "--crop-w":
|
|
77
|
+
<ImageEditorCanvas {...canvas} imageSrc={imageSrc} />
|
|
78
|
+
<div className="k-imageeditor-crop-overlay" style={{ "--crop-x": "0px", "--crop-y": "0px", "--crop-w": `${canvas.width}px`, "--crop-h": `${canvas.height}px` } as React.CSSProperties}>
|
|
85
79
|
<div className="k-imageeditor-crop-dim"></div>
|
|
86
|
-
<div className="k-imageeditor-crop" style={{ width:
|
|
80
|
+
<div className="k-imageeditor-crop" style={{ width: `${canvas.width}px`, height: `${canvas.height}px` }}>
|
|
87
81
|
<ImageEditorResizeHandles variant="crop" grid />
|
|
88
82
|
</div>
|
|
89
83
|
</div>
|
|
@@ -1,59 +1,25 @@
|
|
|
1
|
-
import { ImageEditor, ImageEditorPane, ImageEditorOptionPreview, ImageEditorPreviewThumbnail } from "..";
|
|
1
|
+
import { ImageEditor, ImageEditorPane, ImageEditorOptionPreview, ImageEditorPreviewThumbnail, ImageEditorCanvas } from "..";
|
|
2
2
|
import { Button } from "../../button";
|
|
3
3
|
import { Form, FormField } from "../../form";
|
|
4
4
|
|
|
5
|
-
const
|
|
6
|
-
<Button fillMode="flat" key="sidebar-button-1" icon="image-resize" aria-label="Resize"></Button>,
|
|
7
|
-
<Button fillMode="flat" key="sidebar-button-2" icon="crop" aria-label="Crop"></Button>,
|
|
8
|
-
<Button fillMode="flat" key="sidebar-button-3" icon="rotate" aria-label="Rotate"></Button>,
|
|
9
|
-
<div className="k-separator" key="sidebar-separator-1"></div>,
|
|
10
|
-
<Button fillMode="flat" key="sidebar-button-4" icon="free-text" aria-label="Text"></Button>,
|
|
11
|
-
<Button fillMode="flat" key="sidebar-button-5" icon="shapes" aria-label="Shapes"></Button>,
|
|
12
|
-
<div className="k-separator" key="sidebar-separator-2"></div>,
|
|
13
|
-
<Button fillMode="flat" key="sidebar-button-6" icon="drop-half-pixelated" aria-label="Blur"></Button>,
|
|
14
|
-
<Button fillMode="flat" key="sidebar-button-7" icon="sliders-horizontal" aria-label="Adjustments"></Button>,
|
|
15
|
-
<Button fillMode="flat" key="sidebar-button-8" icon="circles-three-intersecting" selected aria-label="Filters"></Button>,
|
|
16
|
-
<div className="k-separator" key="sidebar-separator-3"></div>,
|
|
17
|
-
<Button fillMode="flat" key="sidebar-button-9" icon="frame-corners" aria-label="Frame"></Button>,
|
|
18
|
-
<Button fillMode="flat" key="sidebar-button-10" icon="circle-half-tilted" aria-label="Shadow"></Button>
|
|
19
|
-
];
|
|
20
|
-
|
|
21
|
-
export const filterPresets: { [key: string]: { label: string } } = {
|
|
22
|
-
"none": { label: "None" },
|
|
23
|
-
"black-white": { label: "Black and White" },
|
|
24
|
-
"greyscale": { label: "Greyscale" },
|
|
25
|
-
"sepia": { label: "Sepia" },
|
|
26
|
-
"warm": { label: "Warm" },
|
|
27
|
-
"cold": { label: "Cold" },
|
|
28
|
-
"chrome": { label: "Chrome" },
|
|
29
|
-
"invert": { label: "Invert" }
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
const FilterPreview = ({ presetKey, selected }: { presetKey: string; selected: boolean }) => {
|
|
33
|
-
const preset = filterPresets[presetKey];
|
|
34
|
-
|
|
35
|
-
return (
|
|
36
|
-
<ImageEditorOptionPreview key={presetKey} selected={selected} aria-label={preset.label}>
|
|
37
|
-
<ImageEditorPreviewThumbnail label={preset.label} />
|
|
38
|
-
</ImageEditorOptionPreview>
|
|
39
|
-
);
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
export const ImageEditorFilters = ({ preset = "none", ...props }: any) => (
|
|
5
|
+
export const ImageEditorFilters = ({ preset = "none", adaptive, imageSrc, ...props }: any) => (
|
|
43
6
|
<ImageEditor
|
|
44
|
-
|
|
7
|
+
adaptive={adaptive}
|
|
8
|
+
activeTool="Filters"
|
|
45
9
|
actionPane={
|
|
46
|
-
<ImageEditorPane title="Filters" actions={
|
|
10
|
+
<ImageEditorPane title="Filters" adaptive={adaptive} confirmDisabled={preset === "none"} actions={
|
|
47
11
|
<>
|
|
48
|
-
<Button>Reset</Button>
|
|
49
|
-
<Button themeColor="primary">Apply</Button>
|
|
12
|
+
<Button disabled={preset === "none"}>Reset</Button>
|
|
13
|
+
<Button themeColor="primary" disabled={preset === "none"}>Apply</Button>
|
|
50
14
|
</>
|
|
51
15
|
}>
|
|
52
16
|
<Form tag="div">
|
|
53
17
|
<FormField
|
|
54
18
|
editor={
|
|
55
19
|
<div className="k-imageeditor-option-grid">
|
|
56
|
-
<
|
|
20
|
+
<ImageEditorOptionPreview selected={preset === "none"} aria-label="None">
|
|
21
|
+
<ImageEditorPreviewThumbnail label="None" imageSrc={imageSrc} />
|
|
22
|
+
</ImageEditorOptionPreview>
|
|
57
23
|
</div>
|
|
58
24
|
}
|
|
59
25
|
/>
|
|
@@ -61,9 +27,15 @@ export const ImageEditorFilters = ({ preset = "none", ...props }: any) => (
|
|
|
61
27
|
label="Monochrome"
|
|
62
28
|
editor={
|
|
63
29
|
<div className="k-imageeditor-option-grid">
|
|
64
|
-
<
|
|
65
|
-
|
|
66
|
-
|
|
30
|
+
<ImageEditorOptionPreview selected={preset === "black-white"} aria-label="Black and White">
|
|
31
|
+
<ImageEditorPreviewThumbnail label="Black and White" imageSrc={imageSrc} />
|
|
32
|
+
</ImageEditorOptionPreview>
|
|
33
|
+
<ImageEditorOptionPreview selected={preset === "greyscale"} aria-label="Greyscale">
|
|
34
|
+
<ImageEditorPreviewThumbnail label="Greyscale" imageSrc={imageSrc} />
|
|
35
|
+
</ImageEditorOptionPreview>
|
|
36
|
+
<ImageEditorOptionPreview selected={preset === "sepia"} aria-label="Sepia">
|
|
37
|
+
<ImageEditorPreviewThumbnail label="Sepia" imageSrc={imageSrc} />
|
|
38
|
+
</ImageEditorOptionPreview>
|
|
67
39
|
</div>
|
|
68
40
|
}
|
|
69
41
|
/>
|
|
@@ -71,9 +43,15 @@ export const ImageEditorFilters = ({ preset = "none", ...props }: any) => (
|
|
|
71
43
|
label="Color Temperature & Mood"
|
|
72
44
|
editor={
|
|
73
45
|
<div className="k-imageeditor-option-grid">
|
|
74
|
-
<
|
|
75
|
-
|
|
76
|
-
|
|
46
|
+
<ImageEditorOptionPreview selected={preset === "warm"} aria-label="Warm">
|
|
47
|
+
<ImageEditorPreviewThumbnail label="Warm" imageSrc={imageSrc} />
|
|
48
|
+
</ImageEditorOptionPreview>
|
|
49
|
+
<ImageEditorOptionPreview selected={preset === "cold"} aria-label="Cold">
|
|
50
|
+
<ImageEditorPreviewThumbnail label="Cold" imageSrc={imageSrc} />
|
|
51
|
+
</ImageEditorOptionPreview>
|
|
52
|
+
<ImageEditorOptionPreview selected={preset === "chrome"} aria-label="Chrome">
|
|
53
|
+
<ImageEditorPreviewThumbnail label="Chrome" imageSrc={imageSrc} />
|
|
54
|
+
</ImageEditorOptionPreview>
|
|
77
55
|
</div>
|
|
78
56
|
}
|
|
79
57
|
/>
|
|
@@ -81,7 +59,9 @@ export const ImageEditorFilters = ({ preset = "none", ...props }: any) => (
|
|
|
81
59
|
label="Color Reversal"
|
|
82
60
|
editor={
|
|
83
61
|
<div className="k-imageeditor-option-grid">
|
|
84
|
-
<
|
|
62
|
+
<ImageEditorOptionPreview selected={preset === "invert"} aria-label="Invert">
|
|
63
|
+
<ImageEditorPreviewThumbnail label="Invert" imageSrc={imageSrc} />
|
|
64
|
+
</ImageEditorOptionPreview>
|
|
85
65
|
</div>
|
|
86
66
|
}
|
|
87
67
|
/>
|
|
@@ -91,7 +71,7 @@ export const ImageEditorFilters = ({ preset = "none", ...props }: any) => (
|
|
|
91
71
|
|
|
92
72
|
children={
|
|
93
73
|
<>
|
|
94
|
-
<
|
|
74
|
+
<ImageEditorCanvas adaptive={adaptive} imageSrc={imageSrc} />
|
|
95
75
|
</>
|
|
96
76
|
}
|
|
97
77
|
{...props} />
|