@progress/kendo-themes-html 14.5.1-dev.7 → 14.5.1-dev.8
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/colorgradient/demos/colorgradient.js +1 -1
- package/dist/cjs/colorpicker/colorpicker.spec.js +1 -1
- package/dist/cjs/colorpicker/templates/colorpicker-adaptive.js +1 -1
- package/dist/cjs/colorpicker/templates/colorpicker-disabled.js +1 -1
- package/dist/cjs/colorpicker/templates/colorpicker-normal.js +1 -1
- package/dist/cjs/combobox/demos/combobox.js +1 -1
- package/dist/cjs/combobox/templates/combobox-grouping-modern-custom-value.js +1 -1
- package/dist/cjs/filemanager/filemanager-listview.spec.js +1 -1
- package/dist/cjs/floating-toolbar/floating-toolbar.spec.js +1 -1
- package/dist/cjs/imageeditor/imageeditor-option-list.js +1 -0
- package/dist/cjs/imageeditor/imageeditor-option-preview.js +1 -0
- package/dist/cjs/imageeditor/imageeditor-pane.js +1 -0
- package/dist/cjs/imageeditor/imageeditor-placeholder.js +1 -0
- package/dist/cjs/imageeditor/imageeditor-preview-thumbnail.js +1 -0
- package/dist/cjs/imageeditor/imageeditor-resize-handles.js +1 -0
- package/dist/cjs/imageeditor/imageeditor-sidebar.js +1 -0
- 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.js +1 -0
- package/dist/cjs/imageeditor/templates/imageeditor-blur.js +1 -0
- package/dist/cjs/imageeditor/templates/imageeditor-crop.js +1 -1
- package/dist/cjs/imageeditor/templates/imageeditor-disabled.js +1 -0
- package/dist/cjs/imageeditor/templates/imageeditor-filters.js +1 -0
- package/dist/cjs/imageeditor/templates/imageeditor-frames.js +1 -0
- package/dist/cjs/imageeditor/templates/imageeditor-insert-line.js +1 -0
- package/dist/cjs/imageeditor/templates/imageeditor-insert-shape.js +1 -0
- package/dist/cjs/imageeditor/templates/imageeditor-insert-text.js +1 -0
- package/dist/cjs/imageeditor/templates/imageeditor-normal.js +1 -1
- package/dist/cjs/imageeditor/templates/imageeditor-pixelate.js +1 -0
- package/dist/cjs/imageeditor/templates/imageeditor-resize.js +1 -1
- package/dist/cjs/imageeditor/templates/imageeditor-rotate.js +1 -0
- package/dist/cjs/imageeditor/templates/imageeditor-shadow.js +1 -0
- package/dist/cjs/index.js +8 -8
- package/dist/cjs/listview/demos/listview.js +1 -1
- package/dist/cjs/listview/listview.spec.js +1 -1
- package/dist/cjs/listview/templates/listview-no-data.js +1 -1
- package/dist/cjs/listview/templates/listview-normal.js +1 -1
- package/dist/cjs/listview/templates/listview-selectable.js +1 -1
- package/dist/cjs/pager/index.js +1 -1
- package/dist/cjs/prompt/templates/prompt-inline-input-only.js +1 -1
- package/dist/cjs/prompt/templates/prompt-inline.js +1 -1
- package/dist/cjs/prompt/templates/prompt-more-actions.js +1 -1
- package/dist/cjs/prompt/templates/prompt-normal.js +1 -1
- package/dist/cjs/prompt/templates/prompt-output.js +1 -1
- package/dist/cjs/prompt/templates/prompt-popup.js +1 -1
- package/dist/cjs/prompt/templates/prompt-settings.js +1 -1
- package/dist/cjs/prompt/templates/prompt-suggestions.js +1 -1
- package/dist/cjs/scheduler/scheduler-toolbar.spec.js +1 -1
- package/dist/cjs/spreadsheet/spreadsheet-action-bar.js +1 -1
- package/dist/cjs/toolbar/demos/toolbar.js +1 -1
- package/dist/cjs/toolbar/templates/toolbar-scrollable-buttons-hidden.js +1 -1
- package/dist/cjs/toolbar/templates/toolbar-scrollable.js +1 -1
- package/dist/esm/colorgradient/demos/colorgradient.mjs +1 -1
- package/dist/esm/colorpicker/colorpicker.spec.mjs +1 -1
- package/dist/esm/colorpicker/templates/colorpicker-adaptive.mjs +1 -1
- package/dist/esm/colorpicker/templates/colorpicker-disabled.mjs +1 -1
- package/dist/esm/colorpicker/templates/colorpicker-normal.mjs +1 -1
- package/dist/esm/combobox/demos/combobox.mjs +1 -1
- package/dist/esm/combobox/templates/combobox-grouping-modern-custom-value.mjs +1 -1
- package/dist/esm/filemanager/filemanager-listview.spec.mjs +1 -1
- package/dist/esm/floating-toolbar/floating-toolbar.spec.mjs +1 -1
- package/dist/esm/imageeditor/imageeditor-option-list.mjs +1 -0
- package/dist/esm/imageeditor/imageeditor-option-preview.mjs +1 -0
- package/dist/esm/imageeditor/imageeditor-pane.mjs +1 -0
- package/dist/esm/imageeditor/imageeditor-placeholder.mjs +1 -0
- package/dist/esm/imageeditor/imageeditor-preview-thumbnail.mjs +1 -0
- package/dist/esm/imageeditor/imageeditor-resize-handles.mjs +1 -0
- package/dist/esm/imageeditor/imageeditor-sidebar.mjs +1 -0
- 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.mjs +1 -0
- package/dist/esm/imageeditor/templates/imageeditor-blur.mjs +1 -0
- package/dist/esm/imageeditor/templates/imageeditor-crop.mjs +1 -1
- package/dist/esm/imageeditor/templates/imageeditor-disabled.mjs +1 -0
- package/dist/esm/imageeditor/templates/imageeditor-filters.mjs +1 -0
- package/dist/esm/imageeditor/templates/imageeditor-frames.mjs +1 -0
- package/dist/esm/imageeditor/templates/imageeditor-insert-line.mjs +1 -0
- package/dist/esm/imageeditor/templates/imageeditor-insert-shape.mjs +1 -0
- package/dist/esm/imageeditor/templates/imageeditor-insert-text.mjs +1 -0
- package/dist/esm/imageeditor/templates/imageeditor-normal.mjs +1 -1
- package/dist/esm/imageeditor/templates/imageeditor-pixelate.mjs +1 -0
- package/dist/esm/imageeditor/templates/imageeditor-resize.mjs +1 -1
- package/dist/esm/imageeditor/templates/imageeditor-rotate.mjs +1 -0
- package/dist/esm/imageeditor/templates/imageeditor-shadow.mjs +1 -0
- package/dist/esm/index.mjs +8 -8
- package/dist/esm/listview/demos/listview.mjs +1 -1
- package/dist/esm/listview/templates/listview-no-data.mjs +1 -1
- package/dist/esm/listview/templates/listview-normal.mjs +1 -1
- package/dist/esm/listview/templates/listview-selectable.mjs +1 -1
- package/dist/esm/pager/index.mjs +1 -1
- package/dist/esm/prompt/templates/prompt-inline-input-only.mjs +1 -1
- package/dist/esm/prompt/templates/prompt-inline.mjs +1 -1
- package/dist/esm/prompt/templates/prompt-more-actions.mjs +1 -1
- package/dist/esm/prompt/templates/prompt-normal.mjs +1 -1
- package/dist/esm/prompt/templates/prompt-output.mjs +1 -1
- package/dist/esm/prompt/templates/prompt-popup.mjs +1 -1
- package/dist/esm/prompt/templates/prompt-settings.mjs +1 -1
- package/dist/esm/prompt/templates/prompt-suggestions.mjs +1 -1
- package/dist/esm/scheduler/scheduler-toolbar.spec.mjs +1 -1
- package/dist/esm/spreadsheet/spreadsheet-action-bar.mjs +1 -1
- package/dist/esm/toolbar/demos/toolbar.mjs +1 -1
- package/dist/esm/toolbar/templates/toolbar-scrollable-buttons-hidden.mjs +1 -1
- package/dist/esm/toolbar/templates/toolbar-scrollable.mjs +1 -1
- package/dist/types/combobox/combobox.spec.d.ts +1 -1
- package/dist/types/imageeditor/imageeditor-option-list.d.ts +18 -0
- package/dist/types/imageeditor/imageeditor-option-preview.d.ts +18 -0
- package/dist/types/imageeditor/imageeditor-pane.d.ts +21 -0
- package/dist/types/imageeditor/imageeditor-placeholder.d.ts +7 -0
- package/dist/types/imageeditor/imageeditor-preview-thumbnail.d.ts +12 -0
- package/dist/types/imageeditor/imageeditor-resize-handles.d.ts +14 -0
- package/dist/types/imageeditor/imageeditor-sidebar.d.ts +11 -0
- package/dist/types/imageeditor/imageeditor-toolbar.d.ts +1 -0
- package/dist/types/imageeditor/imageeditor.spec.d.ts +40 -4
- package/dist/types/imageeditor/index.d.ts +18 -0
- package/dist/types/imageeditor/templates/imageeditor-adjustments.d.ts +1 -0
- package/dist/types/imageeditor/templates/imageeditor-blur.d.ts +1 -0
- package/dist/types/imageeditor/templates/imageeditor-disabled.d.ts +1 -0
- package/dist/types/imageeditor/templates/imageeditor-filters.d.ts +6 -0
- package/dist/types/imageeditor/templates/imageeditor-frames.d.ts +1 -0
- package/dist/types/imageeditor/templates/imageeditor-insert-line.d.ts +2 -0
- package/dist/types/imageeditor/templates/imageeditor-insert-shape.d.ts +2 -0
- package/dist/types/imageeditor/templates/imageeditor-insert-text.d.ts +2 -0
- package/dist/types/imageeditor/templates/imageeditor-pixelate.d.ts +1 -0
- package/dist/types/imageeditor/templates/imageeditor-rotate.d.ts +1 -0
- package/dist/types/imageeditor/templates/imageeditor-shadow.d.ts +1 -0
- package/dist/types/numerictextbox/numerictextbox.spec.d.ts +1 -1
- package/package.json +4 -4
- package/src/combobox/combobox.spec.tsx +2 -2
- package/src/imageeditor/imageeditor-option-list.tsx +53 -0
- package/src/imageeditor/imageeditor-option-preview.tsx +56 -0
- package/src/imageeditor/imageeditor-pane.tsx +70 -0
- package/src/imageeditor/imageeditor-placeholder.tsx +51 -0
- package/src/imageeditor/imageeditor-preview-thumbnail.tsx +42 -0
- package/src/imageeditor/imageeditor-resize-handles.tsx +37 -0
- package/src/imageeditor/imageeditor-sidebar.tsx +66 -0
- package/src/imageeditor/imageeditor-toolbar.tsx +14 -13
- package/src/imageeditor/imageeditor.spec.tsx +79 -13
- package/src/imageeditor/index.ts +19 -0
- package/src/imageeditor/templates/imageeditor-adjustments.tsx +88 -0
- package/src/imageeditor/templates/imageeditor-blur.tsx +92 -0
- package/src/imageeditor/templates/imageeditor-crop.tsx +64 -59
- package/src/imageeditor/templates/imageeditor-disabled.tsx +45 -0
- package/src/imageeditor/templates/imageeditor-filters.tsx +98 -0
- package/src/imageeditor/templates/imageeditor-frames.tsx +180 -0
- package/src/imageeditor/templates/imageeditor-insert-line.tsx +141 -0
- package/src/imageeditor/templates/imageeditor-insert-shape.tsx +195 -0
- package/src/imageeditor/templates/imageeditor-insert-text.tsx +143 -0
- package/src/imageeditor/templates/imageeditor-normal.tsx +20 -1
- package/src/imageeditor/templates/imageeditor-pixelate.tsx +92 -0
- package/src/imageeditor/templates/imageeditor-resize.tsx +68 -50
- package/src/imageeditor/templates/imageeditor-rotate.tsx +98 -0
- package/src/imageeditor/templates/imageeditor-shadow.tsx +96 -0
- package/src/imageeditor/tests/imageeditor-adaptive-small.tsx +373 -0
- package/src/imageeditor/tests/imageeditor-adjustments-pane.tsx +14 -0
- package/src/imageeditor/tests/imageeditor-blur-pane.tsx +29 -0
- package/src/imageeditor/tests/imageeditor-crop-pane.tsx +3 -2
- package/src/imageeditor/tests/imageeditor-export-dialog.tsx +85 -0
- package/src/imageeditor/tests/imageeditor-filters-pane.tsx +14 -0
- package/src/imageeditor/tests/imageeditor-frames-pane.tsx +22 -0
- package/src/imageeditor/tests/imageeditor-insert-line-pane.tsx +52 -0
- package/src/imageeditor/tests/imageeditor-insert-shape-pane.tsx +57 -0
- package/src/imageeditor/tests/imageeditor-insert-text-pane.tsx +51 -0
- package/src/imageeditor/tests/imageeditor-interactive-states.tsx +79 -0
- package/src/imageeditor/tests/imageeditor-option-list-states.tsx +17 -0
- package/src/imageeditor/tests/imageeditor-pixelate-pane.tsx +29 -0
- package/src/imageeditor/tests/imageeditor-resize-pane.tsx +15 -1
- package/src/imageeditor/tests/imageeditor-responsive.tsx +71 -0
- package/src/imageeditor/tests/imageeditor-rotate-pane.tsx +27 -0
- package/src/imageeditor/tests/imageeditor-shadow-pane.tsx +14 -0
- package/src/imageeditor/tests/imageeditor-sidebar-scrollable.tsx +97 -0
- package/src/numerictextbox/numerictextbox.spec.tsx +2 -2
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import { ImageEditor, ImageEditorPane, ImageEditorResizeHandles } from "..";
|
|
2
|
+
import { Button } from "../../button";
|
|
3
|
+
import { ButtonGroup } from "../../button-group";
|
|
4
|
+
import { Combobox } from "../../combobox";
|
|
5
|
+
import { NumericTextbox } from "../../numerictextbox";
|
|
6
|
+
import { ColorPicker } from "../../colorpicker";
|
|
7
|
+
import { Form, FormField, Fieldset } from "../../form";
|
|
8
|
+
import { Icon } from "../../icon";
|
|
9
|
+
import { FloatingToolbar } from "../../floating-toolbar/floating-toolbar.spec";
|
|
10
|
+
|
|
11
|
+
const insertTextSidebarItems = [
|
|
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" selected 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" 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 ImageEditorInsertText = (props: any) => (
|
|
28
|
+
<ImageEditor
|
|
29
|
+
sidebarItems={insertTextSidebarItems}
|
|
30
|
+
actionPane={
|
|
31
|
+
<ImageEditorPane title="Text" actions={
|
|
32
|
+
<>
|
|
33
|
+
<Button>Remove</Button>
|
|
34
|
+
<Button themeColor="primary">Insert</Button>
|
|
35
|
+
</>
|
|
36
|
+
}>
|
|
37
|
+
<Form tag="div">
|
|
38
|
+
<FormField
|
|
39
|
+
label="Font Family"
|
|
40
|
+
editorId="text-font-family"
|
|
41
|
+
editor={ <Combobox id="text-font-family" prefix={<Icon icon="font-family" />} value="Trebuchet MS" /> }
|
|
42
|
+
/>
|
|
43
|
+
<Fieldset layout="grid" cols={2} gutters={{ cols: "16px" }}>
|
|
44
|
+
<FormField
|
|
45
|
+
label="Font Size"
|
|
46
|
+
editorId="text-font-size"
|
|
47
|
+
editor={ <NumericTextbox id="text-font-size" showSpinButton={false} value="70" prefix={<Icon icon="font-size" />} /> }
|
|
48
|
+
/>
|
|
49
|
+
<FormField
|
|
50
|
+
label="Alignment"
|
|
51
|
+
editor={
|
|
52
|
+
<ButtonGroup>
|
|
53
|
+
<Button className="k-group-start" icon="align-left" aria-label="Align Left"></Button>
|
|
54
|
+
<Button icon="align-center" selected aria-label="Align Center"></Button>
|
|
55
|
+
<Button className="k-group-end" icon="align-right" aria-label="Align Right"></Button>
|
|
56
|
+
</ButtonGroup>
|
|
57
|
+
}
|
|
58
|
+
/>
|
|
59
|
+
</Fieldset>
|
|
60
|
+
<FormField
|
|
61
|
+
label="Format"
|
|
62
|
+
editor={
|
|
63
|
+
<div className="k-imageeditor-controls">
|
|
64
|
+
<Button icon="bold" aria-label="Bold"></Button>
|
|
65
|
+
<Button icon="italic" aria-label="Italic"></Button>
|
|
66
|
+
<Button icon="underline" aria-label="Underline"></Button>
|
|
67
|
+
<Button icon="strikethrough" aria-label="Strikethrough"></Button>
|
|
68
|
+
<Button icon="convert-uppercase" aria-label="Uppercase"></Button>
|
|
69
|
+
<Button icon="convert-lowercase" aria-label="Lowercase"></Button>
|
|
70
|
+
</div>
|
|
71
|
+
}
|
|
72
|
+
/>
|
|
73
|
+
<Fieldset layout="grid" cols={2} gutters={{ cols: "16px" }}>
|
|
74
|
+
<FormField
|
|
75
|
+
label="Fill Color"
|
|
76
|
+
editor={ <ColorPicker id="text-fill-color" value="#f5e93d" valueIconName="foreground-color" aria-label="Fill Color" /> }
|
|
77
|
+
/>
|
|
78
|
+
<FormField
|
|
79
|
+
label="Text Opacity"
|
|
80
|
+
editor={ <NumericTextbox id="text-opacity" showSpinButton={false} value="70%" prefix={<Icon icon="transparency" />} aria-label="Text Opacity" /> }
|
|
81
|
+
/>
|
|
82
|
+
</Fieldset>
|
|
83
|
+
<Fieldset layout="grid" cols={2} gutters={{ cols: "16px" }}>
|
|
84
|
+
<FormField
|
|
85
|
+
label="Align Horizontal"
|
|
86
|
+
editor={
|
|
87
|
+
<ButtonGroup>
|
|
88
|
+
<Button className="k-group-start" icon="align-items-start" aria-label="Align Left"></Button>
|
|
89
|
+
<Button icon="align-items-center" aria-label="Align Center"></Button>
|
|
90
|
+
<Button className="k-group-end" icon="align-items-end" aria-label="Align Right"></Button>
|
|
91
|
+
</ButtonGroup>
|
|
92
|
+
}
|
|
93
|
+
/>
|
|
94
|
+
<FormField
|
|
95
|
+
label="Align Vertical"
|
|
96
|
+
editor={
|
|
97
|
+
<ButtonGroup>
|
|
98
|
+
<Button className="k-group-start" icon="align-items-start-alt" aria-label="Align Top"></Button>
|
|
99
|
+
<Button icon="align-items-center-alt" aria-label="Align Middle"></Button>
|
|
100
|
+
<Button className="k-group-end" icon="align-items-end-alt" aria-label="Align Bottom"></Button>
|
|
101
|
+
</ButtonGroup>
|
|
102
|
+
}
|
|
103
|
+
/>
|
|
104
|
+
</Fieldset>
|
|
105
|
+
</Form>
|
|
106
|
+
</ImageEditorPane>
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
children={
|
|
110
|
+
<>
|
|
111
|
+
<canvas width="494" height="307" role="img" aria-label="Image being edited" style={{ backgroundImage: "url('/packages/html/assets/sofia.jpg')", backgroundSize: "cover" }}></canvas>
|
|
112
|
+
<div className="k-imageeditor-resize" style={{ width: "270px", height: "64px", top: "122px", left: "112px" }}>
|
|
113
|
+
<p style={{
|
|
114
|
+
margin: 0,
|
|
115
|
+
width: "100%",
|
|
116
|
+
height: "100%",
|
|
117
|
+
display: "flex",
|
|
118
|
+
alignItems: "center",
|
|
119
|
+
justifyContent: "center",
|
|
120
|
+
fontFamily: "'Trebuchet MS', sans-serif",
|
|
121
|
+
fontWeight: "bold",
|
|
122
|
+
fontSize: "38px",
|
|
123
|
+
lineHeight: 1,
|
|
124
|
+
color: "#f5e93d",
|
|
125
|
+
opacity: 0.7,
|
|
126
|
+
textTransform: "uppercase",
|
|
127
|
+
whiteSpace: "nowrap"
|
|
128
|
+
}}>Text Example</p>
|
|
129
|
+
<ImageEditorResizeHandles variant="mixed" />
|
|
130
|
+
<FloatingToolbar fillMode="flat" offset={{ top: "72px", left: "0" }}>
|
|
131
|
+
<Button fillMode="flat" icon="copy" aria-label="Duplicate"></Button>
|
|
132
|
+
<Button fillMode="flat" icon="pencil" aria-label="Edit"></Button>
|
|
133
|
+
<Button fillMode="flat" icon="flip-horizontal" aria-label="Flip Horizontal"></Button>
|
|
134
|
+
<Button fillMode="flat" icon="flip-vertical" aria-label="Flip Vertical"></Button>
|
|
135
|
+
<Button fillMode="flat" icon="trash" aria-label="Delete"></Button>
|
|
136
|
+
</FloatingToolbar>
|
|
137
|
+
</div>
|
|
138
|
+
</>
|
|
139
|
+
}
|
|
140
|
+
{...props} />
|
|
141
|
+
);
|
|
142
|
+
|
|
143
|
+
export default ImageEditorInsertText;
|
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
import { ImageEditor } from "..";
|
|
2
|
+
import { Button } from "../../button";
|
|
3
|
+
import { Autocomplete } from "../../autocomplete";
|
|
4
|
+
import { ToolbarItem, ToolbarSeparator } from "../../toolbar";
|
|
5
|
+
|
|
6
|
+
// Freshly-loaded image: no edit history yet, so undo/redo are disabled
|
|
7
|
+
const normalToolbarItems = [
|
|
8
|
+
<Button fillMode="flat" key="toolbar-button-1" icon="image-add" aria-label="Image Add"></Button>,
|
|
9
|
+
<ToolbarSeparator key="toolbar-separator-1"></ToolbarSeparator>,
|
|
10
|
+
<Button fillMode="flat" key="toolbar-button-2" disabled icon="undo" aria-label="Undo"></Button>,
|
|
11
|
+
<Button fillMode="flat" key="toolbar-button-3" disabled icon="redo" aria-label="Redo"></Button>,
|
|
12
|
+
<ToolbarSeparator key="toolbar-separator-2"></ToolbarSeparator>,
|
|
13
|
+
<Button fillMode="flat" key="toolbar-button-4" icon="download" aria-label="Download"></Button>,
|
|
14
|
+
<div className="k-spacer" key="toolbar-spacer"></div>,
|
|
15
|
+
<Button fillMode="flat" key="toolbar-button-5" icon="zoom-in" aria-label="Zoom In"></Button>,
|
|
16
|
+
<ToolbarItem key="toolbar-item-1">
|
|
17
|
+
<Autocomplete fillMode="flat" value="Fit" aria-label="Zoom options" />
|
|
18
|
+
</ToolbarItem>,
|
|
19
|
+
<Button fillMode="flat" key="toolbar-button-6" icon="zoom-out" aria-label="Zoom Out"></Button>
|
|
20
|
+
];
|
|
2
21
|
|
|
3
22
|
export const ImageEditorNormal = (props: any) => (
|
|
4
|
-
<ImageEditor {...props} />
|
|
23
|
+
<ImageEditor toolbarItems={normalToolbarItems} {...props} />
|
|
5
24
|
);
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { ImageEditor, ImageEditorPane } from "..";
|
|
2
|
+
import { Button } from "../../button";
|
|
3
|
+
import { NumericTextbox } from "../../numerictextbox";
|
|
4
|
+
import { Form, FormField } from "../../form";
|
|
5
|
+
import { RadioGroup, RadioItem, RadioButtonWithLabelAfter } from "../../radio";
|
|
6
|
+
import { SegmentedControl, SegmentedControlButton } from "../../segmented-control";
|
|
7
|
+
import { Slider } from "../../slider";
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
const pixelateSidebarItems = [
|
|
11
|
+
<Button fillMode="flat" key="sidebar-button-1" icon="image-resize" aria-label="Resize"></Button>,
|
|
12
|
+
<Button fillMode="flat" key="sidebar-button-2" icon="crop" aria-label="Crop"></Button>,
|
|
13
|
+
<Button fillMode="flat" key="sidebar-button-3" icon="rotate" aria-label="Rotate"></Button>,
|
|
14
|
+
<div className="k-separator" key="sidebar-separator-1"></div>,
|
|
15
|
+
<Button fillMode="flat" key="sidebar-button-4" icon="free-text" aria-label="Text"></Button>,
|
|
16
|
+
<Button fillMode="flat" key="sidebar-button-5" icon="shapes" aria-label="Shapes"></Button>,
|
|
17
|
+
<div className="k-separator" key="sidebar-separator-2"></div>,
|
|
18
|
+
<Button fillMode="flat" key="sidebar-button-6" icon="drop-half-pixelated" selected aria-label="Blur"></Button>,
|
|
19
|
+
<Button fillMode="flat" key="sidebar-button-7" icon="sliders-horizontal" aria-label="Adjustments"></Button>,
|
|
20
|
+
<Button fillMode="flat" key="sidebar-button-8" icon="circles-three-intersecting" aria-label="Filters"></Button>,
|
|
21
|
+
<div className="k-separator" key="sidebar-separator-3"></div>,
|
|
22
|
+
<Button fillMode="flat" key="sidebar-button-9" icon="frame-corners" aria-label="Frame"></Button>,
|
|
23
|
+
<Button fillMode="flat" key="sidebar-button-10" icon="circle-half-tilted" aria-label="Shadow"></Button>
|
|
24
|
+
];
|
|
25
|
+
|
|
26
|
+
export const ImageEditorPixelate = ({ shape = "rectangular", intensity = 24, ...props }: any) => (
|
|
27
|
+
<ImageEditor
|
|
28
|
+
sidebarItems={pixelateSidebarItems}
|
|
29
|
+
actionPane={
|
|
30
|
+
<ImageEditorPane title="Pixelate" actions={
|
|
31
|
+
<>
|
|
32
|
+
<Button>Reset</Button>
|
|
33
|
+
<Button themeColor="primary">Apply</Button>
|
|
34
|
+
</>
|
|
35
|
+
}>
|
|
36
|
+
<SegmentedControl thumbStyles={{ width: "50%", left: "50%" }} stretched aria-label="Redaction Tool" style={{ flexShrink: 0 }}>
|
|
37
|
+
<SegmentedControlButton icon="blur">Blur</SegmentedControlButton>
|
|
38
|
+
<SegmentedControlButton icon="grid" selected>Pixelate</SegmentedControlButton>
|
|
39
|
+
</SegmentedControl>
|
|
40
|
+
|
|
41
|
+
<Form tag="div">
|
|
42
|
+
<FormField
|
|
43
|
+
label="Marquee Tool Shape"
|
|
44
|
+
editor={
|
|
45
|
+
<RadioGroup layout="horizontal">
|
|
46
|
+
<RadioItem>
|
|
47
|
+
<RadioButtonWithLabelAfter id="pixelate-shape-rectangular" name="pixelate-shape" checked={shape === "rectangular"}>Rectangular</RadioButtonWithLabelAfter>
|
|
48
|
+
</RadioItem>
|
|
49
|
+
<RadioItem>
|
|
50
|
+
<RadioButtonWithLabelAfter id="pixelate-shape-elliptical" name="pixelate-shape" checked={shape === "elliptical"}>Elliptical</RadioButtonWithLabelAfter>
|
|
51
|
+
</RadioItem>
|
|
52
|
+
</RadioGroup>
|
|
53
|
+
}
|
|
54
|
+
/>
|
|
55
|
+
<FormField
|
|
56
|
+
label="Pixelate Intensity"
|
|
57
|
+
editorId="pixelate-intensity"
|
|
58
|
+
editor={
|
|
59
|
+
<div className="k-imageeditor-field-row">
|
|
60
|
+
<Slider
|
|
61
|
+
style={{ flex: 1, "--kendo-slider-start": 0, "--kendo-slider-end": intensity } as React.CSSProperties}
|
|
62
|
+
aria-label="Pixelate Intensity"
|
|
63
|
+
showButtons={false}
|
|
64
|
+
showTicks={false}
|
|
65
|
+
value={intensity}
|
|
66
|
+
min={0}
|
|
67
|
+
max={100}
|
|
68
|
+
/>
|
|
69
|
+
<NumericTextbox
|
|
70
|
+
id="pixelate-intensity"
|
|
71
|
+
style={{ width: "80px", flex: "none" }}
|
|
72
|
+
showClearButton={false}
|
|
73
|
+
showSpinButton={false}
|
|
74
|
+
value={String(intensity)}
|
|
75
|
+
/>
|
|
76
|
+
</div>
|
|
77
|
+
}
|
|
78
|
+
/>
|
|
79
|
+
</Form>
|
|
80
|
+
</ImageEditorPane>
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
children={
|
|
84
|
+
<>
|
|
85
|
+
<canvas width="494" height="307" role="img" aria-label="Image being edited" style={{ backgroundImage: "url('/packages/html/assets/sofia.jpg')", backgroundSize: "cover" }}></canvas>
|
|
86
|
+
<div className="k-imageeditor-crop-overlay">
|
|
87
|
+
<div className="k-imageeditor-crop" style={{ borderStyle: "dashed" }}></div>
|
|
88
|
+
</div>
|
|
89
|
+
</>
|
|
90
|
+
}
|
|
91
|
+
{...props} />
|
|
92
|
+
);
|
|
@@ -1,68 +1,86 @@
|
|
|
1
|
-
import { ImageEditor } from "..";
|
|
1
|
+
import { ImageEditor, ImageEditorPane, ImageEditorResizeHandles } from "..";
|
|
2
2
|
import { Button } from "../../button";
|
|
3
3
|
import { CheckboxWithLabelAfter } from "../../checkbox";
|
|
4
|
-
import { DropdownList } from "../../dropdownlist";
|
|
5
|
-
import { FormNormal, Fieldset, FormField } from "../../form";
|
|
6
4
|
import { NumericTextbox } from "../../numerictextbox";
|
|
7
|
-
import {
|
|
5
|
+
import { Form, FormField, Fieldset } from "../../form";
|
|
6
|
+
import { Icon } from "../../icon";
|
|
7
|
+
import { RadioGroup, RadioItem, RadioButtonWithLabelAfter } from "../../radio";
|
|
8
|
+
import { Tooltip } from "../../tooltip";
|
|
9
|
+
|
|
10
|
+
const resizeSidebarItems = [
|
|
11
|
+
<Button fillMode="flat" key="sidebar-button-1" icon="image-resize" selected aria-label="Resize"></Button>,
|
|
12
|
+
<Button fillMode="flat" key="sidebar-button-2" icon="crop" aria-label="Crop"></Button>,
|
|
13
|
+
<Button fillMode="flat" key="sidebar-button-3" icon="rotate" aria-label="Rotate"></Button>,
|
|
14
|
+
<div className="k-separator" key="sidebar-separator-1"></div>,
|
|
15
|
+
<Button fillMode="flat" key="sidebar-button-4" icon="free-text" aria-label="Text"></Button>,
|
|
16
|
+
<Button fillMode="flat" key="sidebar-button-5" icon="shapes" aria-label="Shapes"></Button>,
|
|
17
|
+
<div className="k-separator" key="sidebar-separator-2"></div>,
|
|
18
|
+
<Button fillMode="flat" key="sidebar-button-6" icon="drop-half-pixelated" aria-label="Blur"></Button>,
|
|
19
|
+
<Button fillMode="flat" key="sidebar-button-7" icon="sliders-horizontal" aria-label="Adjustments"></Button>,
|
|
20
|
+
<Button fillMode="flat" key="sidebar-button-8" icon="circles-three-intersecting" aria-label="Filters"></Button>,
|
|
21
|
+
<div className="k-separator" key="sidebar-separator-3"></div>,
|
|
22
|
+
<Button fillMode="flat" key="sidebar-button-9" icon="frame-corners" aria-label="Frame"></Button>,
|
|
23
|
+
<Button fillMode="flat" key="sidebar-button-10" icon="circle-half-tilted" aria-label="Shadow"></Button>
|
|
24
|
+
];
|
|
8
25
|
|
|
9
26
|
export const ImageEditorResize = (props: any) => (
|
|
10
27
|
<ImageEditor
|
|
11
|
-
|
|
12
|
-
<Button key="toolbar-button-1" icon="upload" aria-label="Upload"></Button>,
|
|
13
|
-
<Button key="toolbar-button-2" icon="download" aria-label="Download"></Button>,
|
|
14
|
-
<ToolbarSeparator key="toolbar-separator-1"></ToolbarSeparator>,
|
|
15
|
-
<Button key="toolbar-button-3" disabled icon="undo" aria-label="Undo"></Button>,
|
|
16
|
-
<Button key="toolbar-button-4" disabled icon="redo" aria-label="Redo"></Button>,
|
|
17
|
-
<ToolbarSeparator key="toolbar-separator-2"></ToolbarSeparator>,
|
|
18
|
-
<Button key="toolbar-button-5" icon="crop" aria-label="Crop"></Button>,
|
|
19
|
-
<Button key="toolbar-button-6" icon="image-resize" aria-label="Resize"></Button>,
|
|
20
|
-
<Button key="toolbar-button-7" icon="zoom-in" aria-label="Zoom in"></Button>,
|
|
21
|
-
<Button key="toolbar-button-8" icon="zoom-out" aria-label="Zoom out"></Button>,
|
|
22
|
-
<ToolbarItem key="toolbar-item-1">
|
|
23
|
-
<DropdownList value="Zoom options" aria-label="Zoom options" />
|
|
24
|
-
</ToolbarItem>
|
|
25
|
-
]}
|
|
28
|
+
sidebarItems={resizeSidebarItems}
|
|
26
29
|
actionPane={
|
|
27
|
-
<
|
|
30
|
+
<ImageEditorPane title="Resize" actions={
|
|
28
31
|
<>
|
|
29
|
-
<Button
|
|
30
|
-
<Button
|
|
32
|
+
<Button>Reset</Button>
|
|
33
|
+
<Button themeColor="primary">Apply</Button>
|
|
31
34
|
</>
|
|
32
35
|
}>
|
|
33
|
-
<
|
|
34
|
-
<FormField
|
|
35
|
-
colSpan="1"
|
|
36
|
-
label="Width:"
|
|
37
|
-
editorId="resize-width"
|
|
38
|
-
editor={ <NumericTextbox id="resize-width" showClearButton={false} value="61" /> }
|
|
39
|
-
/>
|
|
40
|
-
<FormField
|
|
41
|
-
colSpan="1"
|
|
42
|
-
label=" "
|
|
43
|
-
editor={ <DropdownList value="Pixels" aria-label="Width unit" /> }
|
|
44
|
-
/>
|
|
45
|
-
<FormField
|
|
46
|
-
colSpan="1"
|
|
47
|
-
label="Height:"
|
|
48
|
-
editorId="resize-height"
|
|
49
|
-
editor={ <NumericTextbox id="resize-height" showClearButton={false} value="68" /> }
|
|
50
|
-
/>
|
|
51
|
-
<FormField
|
|
52
|
-
colSpan="1"
|
|
53
|
-
label=" "
|
|
54
|
-
editor={ <DropdownList value="Pixels" aria-label="Height unit" /> }
|
|
55
|
-
/>
|
|
36
|
+
<Form tag="div">
|
|
56
37
|
<FormField
|
|
57
|
-
|
|
58
|
-
editor={
|
|
38
|
+
label="Scale Unit"
|
|
39
|
+
editor={
|
|
40
|
+
<RadioGroup layout="horizontal">
|
|
41
|
+
<RadioItem>
|
|
42
|
+
<RadioButtonWithLabelAfter id="resize-scale-unit-pixel" name="resize-scale-unit" checked>Pixel</RadioButtonWithLabelAfter>
|
|
43
|
+
</RadioItem>
|
|
44
|
+
<RadioItem>
|
|
45
|
+
<RadioButtonWithLabelAfter id="resize-scale-unit-percentage" name="resize-scale-unit">Percentage</RadioButtonWithLabelAfter>
|
|
46
|
+
</RadioItem>
|
|
47
|
+
</RadioGroup>
|
|
48
|
+
}
|
|
59
49
|
/>
|
|
60
|
-
|
|
61
|
-
|
|
50
|
+
<Fieldset layout="grid" cols={2} gutters={{ cols: "8px" }}>
|
|
51
|
+
<FormField
|
|
52
|
+
label="Width"
|
|
53
|
+
editorId="resize-width"
|
|
54
|
+
editor={ <NumericTextbox id="resize-width" showClearButton={false} value="494" prefix={<Icon icon="arrows-left-right" />} /> }
|
|
55
|
+
/>
|
|
56
|
+
<FormField
|
|
57
|
+
label="Height"
|
|
58
|
+
editorId="resize-height"
|
|
59
|
+
editor={ <NumericTextbox id="resize-height" showClearButton={false} value="307" prefix={<Icon icon="arrows-top-bottom" />} /> }
|
|
60
|
+
/>
|
|
61
|
+
</Fieldset>
|
|
62
|
+
<FormField editor={ <CheckboxWithLabelAfter id="resize-lock" checked>Lock Aspect Ratio</CheckboxWithLabelAfter> } />
|
|
63
|
+
</Form>
|
|
64
|
+
</ImageEditorPane>
|
|
62
65
|
}
|
|
63
66
|
|
|
64
67
|
children={
|
|
65
|
-
|
|
68
|
+
<>
|
|
69
|
+
<canvas width="494" height="307" role="img" aria-label="Image being edited" style={{ backgroundImage: "url('/packages/html/assets/sofia.jpg')", backgroundSize: "cover" }}></canvas>
|
|
70
|
+
<div className="k-imageeditor-resize">
|
|
71
|
+
<ImageEditorResizeHandles variant="mixed" />
|
|
72
|
+
</div>
|
|
73
|
+
<Tooltip
|
|
74
|
+
themeColor="inverse"
|
|
75
|
+
style={{ position: "absolute", insetBlockEnd: "-52px", insetInlineEnd: "0" }}
|
|
76
|
+
content={
|
|
77
|
+
<>
|
|
78
|
+
<div>W: 494</div>
|
|
79
|
+
<div>H: 307</div>
|
|
80
|
+
</>
|
|
81
|
+
}
|
|
82
|
+
></Tooltip>
|
|
83
|
+
</>
|
|
66
84
|
}
|
|
67
85
|
{...props} />
|
|
68
86
|
);
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { ImageEditor, ImageEditorPane, ImageEditorResizeHandles } from "..";
|
|
2
|
+
import { Button } from "../../button";
|
|
3
|
+
import { NumericTextbox } from "../../numerictextbox";
|
|
4
|
+
import { InputSuffixText } from "../../input";
|
|
5
|
+
import { Form, FormField, Fieldset } from "../../form";
|
|
6
|
+
import { Slider } from "../../slider";
|
|
7
|
+
import { Tooltip } from "../../tooltip";
|
|
8
|
+
|
|
9
|
+
const rotateSidebarItems = [
|
|
10
|
+
<Button fillMode="flat" key="sidebar-button-1" icon="image-resize" aria-label="Resize"></Button>,
|
|
11
|
+
<Button fillMode="flat" key="sidebar-button-2" icon="crop" aria-label="Crop"></Button>,
|
|
12
|
+
<Button fillMode="flat" key="sidebar-button-3" icon="rotate" selected aria-label="Rotate"></Button>,
|
|
13
|
+
<div className="k-separator" key="sidebar-separator-1"></div>,
|
|
14
|
+
<Button fillMode="flat" key="sidebar-button-4" icon="free-text" aria-label="Text"></Button>,
|
|
15
|
+
<Button fillMode="flat" key="sidebar-button-5" icon="shapes" aria-label="Shapes"></Button>,
|
|
16
|
+
<div className="k-separator" key="sidebar-separator-2"></div>,
|
|
17
|
+
<Button fillMode="flat" key="sidebar-button-6" icon="drop-half-pixelated" aria-label="Blur"></Button>,
|
|
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 ImageEditorRotate = (props: any) => (
|
|
26
|
+
<ImageEditor
|
|
27
|
+
sidebarItems={rotateSidebarItems}
|
|
28
|
+
actionPane={
|
|
29
|
+
<ImageEditorPane title="Rotate" actions={
|
|
30
|
+
<>
|
|
31
|
+
<Button>Reset</Button>
|
|
32
|
+
<Button themeColor="primary">Apply</Button>
|
|
33
|
+
</>
|
|
34
|
+
}>
|
|
35
|
+
<Form tag="div">
|
|
36
|
+
<FormField
|
|
37
|
+
label="Rotation"
|
|
38
|
+
editor={
|
|
39
|
+
<div className="k-imageeditor-field-row">
|
|
40
|
+
<Slider
|
|
41
|
+
style={{ width: "170px", flex: "none" }}
|
|
42
|
+
aria-label="Rotation"
|
|
43
|
+
showButtons={false}
|
|
44
|
+
showTicks={false}
|
|
45
|
+
value={85}
|
|
46
|
+
min={0}
|
|
47
|
+
max={360}
|
|
48
|
+
/>
|
|
49
|
+
<NumericTextbox
|
|
50
|
+
style={{ width: "72px", flex: "none" }}
|
|
51
|
+
showClearButton={false}
|
|
52
|
+
showSpinButton={false}
|
|
53
|
+
separators={false}
|
|
54
|
+
value="85"
|
|
55
|
+
suffix={<InputSuffixText>°</InputSuffixText>}
|
|
56
|
+
/>
|
|
57
|
+
</div>
|
|
58
|
+
}
|
|
59
|
+
/>
|
|
60
|
+
<Fieldset layout="grid" cols={2} gutters={{ cols: "16px" }}>
|
|
61
|
+
<FormField
|
|
62
|
+
label="Rotate Options"
|
|
63
|
+
editor={
|
|
64
|
+
<div className="k-imageeditor-controls">
|
|
65
|
+
<Button icon="rotate-right" aria-label="Rotate Right"></Button>
|
|
66
|
+
<Button icon="rotate-left" aria-label="Rotate Left"></Button>
|
|
67
|
+
</div>
|
|
68
|
+
}
|
|
69
|
+
/>
|
|
70
|
+
<FormField
|
|
71
|
+
label="Flip Options"
|
|
72
|
+
editor={
|
|
73
|
+
<div className="k-imageeditor-controls">
|
|
74
|
+
<Button icon="flip-horizontal" aria-label="Flip Horizontal"></Button>
|
|
75
|
+
<Button icon="flip-vertical" aria-label="Flip Vertical"></Button>
|
|
76
|
+
</div>
|
|
77
|
+
}
|
|
78
|
+
/>
|
|
79
|
+
</Fieldset>
|
|
80
|
+
</Form>
|
|
81
|
+
</ImageEditorPane>
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
children={
|
|
85
|
+
<>
|
|
86
|
+
<canvas width="494" height="307" role="img" aria-label="Image being edited" style={{ backgroundImage: "url('/packages/html/assets/sofia.jpg')", backgroundSize: "cover" }}></canvas>
|
|
87
|
+
<div className="k-imageeditor-rotate">
|
|
88
|
+
<ImageEditorResizeHandles variant="scale" grid />
|
|
89
|
+
</div>
|
|
90
|
+
<Tooltip
|
|
91
|
+
themeColor="inverse"
|
|
92
|
+
style={{ position: "absolute", insetBlockEnd: "-52px", insetInlineEnd: "0" }}
|
|
93
|
+
content={<div>85°</div>}
|
|
94
|
+
></Tooltip>
|
|
95
|
+
</>
|
|
96
|
+
}
|
|
97
|
+
{...props} />
|
|
98
|
+
);
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { ImageEditor, ImageEditorPane } from "..";
|
|
2
|
+
import { Button } from "../../button";
|
|
3
|
+
import { NumericTextbox } from "../../numerictextbox";
|
|
4
|
+
import { ColorPicker } from "../../colorpicker";
|
|
5
|
+
import { Form, FormField, Fieldset } from "../../form";
|
|
6
|
+
import { Icon } from "../../icon";
|
|
7
|
+
import { InputPrefixText } from "../../input";
|
|
8
|
+
|
|
9
|
+
const shadowSidebarItems = [
|
|
10
|
+
<Button fillMode="flat" key="sidebar-button-1" icon="image-resize" aria-label="Resize"></Button>,
|
|
11
|
+
<Button fillMode="flat" key="sidebar-button-2" icon="crop" aria-label="Crop"></Button>,
|
|
12
|
+
<Button fillMode="flat" key="sidebar-button-3" icon="rotate" aria-label="Rotate"></Button>,
|
|
13
|
+
<div className="k-separator" key="sidebar-separator-1"></div>,
|
|
14
|
+
<Button fillMode="flat" key="sidebar-button-4" icon="free-text" aria-label="Text"></Button>,
|
|
15
|
+
<Button fillMode="flat" key="sidebar-button-5" icon="shapes" aria-label="Shapes"></Button>,
|
|
16
|
+
<div className="k-separator" key="sidebar-separator-2"></div>,
|
|
17
|
+
<Button fillMode="flat" key="sidebar-button-6" icon="drop-half-pixelated" aria-label="Blur"></Button>,
|
|
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" selected aria-label="Shadow"></Button>
|
|
23
|
+
];
|
|
24
|
+
|
|
25
|
+
const hexToRgba = (hex: string, alphaPercent: number) => {
|
|
26
|
+
const value = hex.replace("#", "");
|
|
27
|
+
const r = parseInt(value.substring(0, 2), 16);
|
|
28
|
+
const g = parseInt(value.substring(2, 4), 16);
|
|
29
|
+
const b = parseInt(value.substring(4, 6), 16);
|
|
30
|
+
return `rgba(${r}, ${g}, ${b}, ${alphaPercent / 100})`;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export const ImageEditorShadow = ({
|
|
34
|
+
positionX = 2,
|
|
35
|
+
positionY = -4,
|
|
36
|
+
blur = 32,
|
|
37
|
+
spread = 12,
|
|
38
|
+
color = "#232a36",
|
|
39
|
+
opacity = 32,
|
|
40
|
+
...props
|
|
41
|
+
}: any) => (
|
|
42
|
+
<ImageEditor
|
|
43
|
+
sidebarItems={shadowSidebarItems}
|
|
44
|
+
actionPane={
|
|
45
|
+
<ImageEditorPane title="Shadow" actions={
|
|
46
|
+
<>
|
|
47
|
+
<Button>Reset</Button>
|
|
48
|
+
<Button themeColor="primary">Apply</Button>
|
|
49
|
+
</>
|
|
50
|
+
}>
|
|
51
|
+
<Form tag="div">
|
|
52
|
+
<FormField
|
|
53
|
+
label="Position"
|
|
54
|
+
editor={
|
|
55
|
+
<Fieldset layout="grid" cols={2} gutters={{ cols: "16px" }}>
|
|
56
|
+
<NumericTextbox id="shadow-position-x" showSpinButton={false} value={String(positionX)} prefix={<InputPrefixText>X</InputPrefixText>} aria-label="Position X" />
|
|
57
|
+
<NumericTextbox id="shadow-position-y" showSpinButton={false} value={String(positionY)} prefix={<InputPrefixText>Y</InputPrefixText>} aria-label="Position Y" />
|
|
58
|
+
</Fieldset>
|
|
59
|
+
}
|
|
60
|
+
/>
|
|
61
|
+
<Fieldset layout="grid" cols={2} gutters={{ cols: "16px" }}>
|
|
62
|
+
<FormField
|
|
63
|
+
label="Blur"
|
|
64
|
+
editorId="shadow-blur"
|
|
65
|
+
editor={ <NumericTextbox id="shadow-blur" showSpinButton={false} value={String(blur)} prefix={<Icon icon="blur" />} /> }
|
|
66
|
+
/>
|
|
67
|
+
<FormField
|
|
68
|
+
label="Spread"
|
|
69
|
+
editorId="shadow-spread"
|
|
70
|
+
editor={ <NumericTextbox id="shadow-spread" showSpinButton={false} value={String(spread)} prefix={<Icon icon="brightness-contrast" />} /> }
|
|
71
|
+
/>
|
|
72
|
+
</Fieldset>
|
|
73
|
+
<Fieldset layout="grid" cols={2} gutters={{ cols: "16px" }}>
|
|
74
|
+
<FormField
|
|
75
|
+
label="Color"
|
|
76
|
+
editor={ <ColorPicker id="shadow-color" value={color} aria-label="Color" /> }
|
|
77
|
+
/>
|
|
78
|
+
<FormField
|
|
79
|
+
label="Opacity"
|
|
80
|
+
editorId="shadow-opacity"
|
|
81
|
+
editor={ <NumericTextbox id="shadow-opacity" showSpinButton={false} value={`${opacity}%`} prefix={<Icon icon="transparency" />} /> }
|
|
82
|
+
/>
|
|
83
|
+
</Fieldset>
|
|
84
|
+
</Form>
|
|
85
|
+
</ImageEditorPane>
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
children={
|
|
89
|
+
<canvas width="494" height="307" role="img" aria-label="Image being edited" style={{
|
|
90
|
+
backgroundImage: "url('/packages/html/assets/sofia.jpg')",
|
|
91
|
+
backgroundSize: "cover",
|
|
92
|
+
boxShadow: `${positionX}px ${positionY}px ${blur}px ${spread}px ${hexToRgba(color, opacity)}`
|
|
93
|
+
}}></canvas>
|
|
94
|
+
}
|
|
95
|
+
{...props} />
|
|
96
|
+
);
|