pixedi 1.0.0 → 1.0.2
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/README.md +65 -60
- package/README.npm.md +80 -0
- package/dist/lib/index.js +1602 -0
- package/dist/lib/index.umd.js +28 -0
- package/package.json +9 -4
- package/.github/workflows/deploy.yml +0 -54
- package/.prettierr +0 -9
- package/.storybook/main.ts +0 -16
- package/.storybook/preview.ts +0 -53
- package/.vscode/extensions.json +0 -6
- package/eslint.config.js +0 -22
- package/index.html +0 -13
- package/pnpm-workspace.yaml +0 -2
- package/public/favicon.svg +0 -1
- package/src/app/App.tsx +0 -10
- package/src/app/entries/index.ts +0 -145
- package/src/app/providers/RouterProvider.tsx +0 -6
- package/src/app/providers/index.ts +0 -1
- package/src/app/router/AppRouter.tsx +0 -12
- package/src/app/router/index.ts +0 -0
- package/src/app/styles/index.css +0 -4
- package/src/features/gallery/GalleryPage.tsx +0 -33
- package/src/features/gallery/ImageEditPage.tsx +0 -37
- package/src/features/gallery/index.ts +0 -2
- package/src/main.tsx +0 -10
- package/src/shared/components/ImageCard/ImageCard.tsx +0 -54
- package/src/shared/components/ImageCard/index.ts +0 -1
- package/src/shared/components/ImageEditor/ImageEditor.tsx +0 -48
- package/src/shared/components/ImageEditor/assets/icons.tsx +0 -114
- package/src/shared/components/ImageEditor/constants.ts +0 -118
- package/src/shared/components/ImageEditor/crop/Crop.tsx +0 -60
- package/src/shared/components/ImageEditor/crop/CropBorders.tsx +0 -28
- package/src/shared/components/ImageEditor/crop/CropLines.tsx +0 -8
- package/src/shared/components/ImageEditor/crop/CropPointer.tsx +0 -21
- package/src/shared/components/ImageEditor/crop/CropPointers.tsx +0 -44
- package/src/shared/components/ImageEditor/crop/CropTools.tsx +0 -138
- package/src/shared/components/ImageEditor/crop/crop.css +0 -180
- package/src/shared/components/ImageEditor/crop/index.ts +0 -8
- package/src/shared/components/ImageEditor/crop/useCropInteraction.ts +0 -230
- package/src/shared/components/ImageEditor/eventBus.ts +0 -8
- package/src/shared/components/ImageEditor/frame/Frame.tsx +0 -48
- package/src/shared/components/ImageEditor/frame/frame.css +0 -40
- package/src/shared/components/ImageEditor/frame/index.ts +0 -1
- package/src/shared/components/ImageEditor/header/Header.tsx +0 -81
- package/src/shared/components/ImageEditor/header/header.css +0 -27
- package/src/shared/components/ImageEditor/header/index.ts +0 -1
- package/src/shared/components/ImageEditor/hooks/index.ts +0 -5
- package/src/shared/components/ImageEditor/hooks/useAbove.tsx +0 -18
- package/src/shared/components/ImageEditor/hooks/useBellow.tsx +0 -18
- package/src/shared/components/ImageEditor/hooks/useImageLoader.tsx +0 -110
- package/src/shared/components/ImageEditor/hooks/useImageProcessor.test.tsx +0 -147
- package/src/shared/components/ImageEditor/hooks/useImageProcessor.ts +0 -225
- package/src/shared/components/ImageEditor/hooks/useMobile.tsx +0 -33
- package/src/shared/components/ImageEditor/index.css +0 -145
- package/src/shared/components/ImageEditor/index.ts +0 -1
- package/src/shared/components/ImageEditor/provider/ImageEditorProvider.test.tsx +0 -126
- package/src/shared/components/ImageEditor/provider/ImageEditorProvider.tsx +0 -107
- package/src/shared/components/ImageEditor/provider/StoreContext.tsx +0 -20
- package/src/shared/components/ImageEditor/provider/initialState.ts +0 -30
- package/src/shared/components/ImageEditor/provider/useImageEditorContext.tsx +0 -12
- package/src/shared/components/ImageEditor/resize/ResizeTools.tsx +0 -183
- package/src/shared/components/ImageEditor/resize/index.ts +0 -1
- package/src/shared/components/ImageEditor/resize/resize.css +0 -56
- package/src/shared/components/ImageEditor/sidebar/Sidebar.tsx +0 -54
- package/src/shared/components/ImageEditor/sidebar/SidebarCrop.tsx +0 -57
- package/src/shared/components/ImageEditor/sidebar/SidebarPresets.tsx +0 -54
- package/src/shared/components/ImageEditor/sidebar/SidebarResize.tsx +0 -26
- package/src/shared/components/ImageEditor/sidebar/index.ts +0 -1
- package/src/shared/components/ImageEditor/sidebar/sidebar.css +0 -101
- package/src/shared/components/ImageEditor/types.ts +0 -59
- package/src/shared/components/ImageEditor/ui/button/Button.stories.tsx +0 -42
- package/src/shared/components/ImageEditor/ui/button/Button.tsx +0 -21
- package/src/shared/components/ImageEditor/ui/button/button.css +0 -69
- package/src/shared/components/ImageEditor/ui/button-crop/ButtonCrop.stories.tsx +0 -26
- package/src/shared/components/ImageEditor/ui/button-crop/ButtonCrop.tsx +0 -29
- package/src/shared/components/ImageEditor/ui/button-crop/button-crop.css +0 -38
- package/src/shared/components/ImageEditor/ui/index.ts +0 -6
- package/src/shared/components/ImageEditor/ui/input/Input.stories.tsx +0 -45
- package/src/shared/components/ImageEditor/ui/input/Input.tsx +0 -20
- package/src/shared/components/ImageEditor/ui/input/input.css +0 -48
- package/src/shared/components/ImageEditor/ui/input-pixel/InputPixel.stories.tsx +0 -33
- package/src/shared/components/ImageEditor/ui/input-pixel/InputPixel.tsx +0 -23
- package/src/shared/components/ImageEditor/ui/input-pixel/input-pixel.css +0 -24
- package/src/shared/components/ImageEditor/ui/select/Select.stories.tsx +0 -67
- package/src/shared/components/ImageEditor/ui/select/Select.tsx +0 -161
- package/src/shared/components/ImageEditor/ui/select/select.css +0 -147
- package/src/shared/components/ImageEditor/ui/separator/Separator.stories.tsx +0 -37
- package/src/shared/components/ImageEditor/ui/separator/Separator.tsx +0 -27
- package/src/shared/components/ImageEditor/ui/separator/separator.css +0 -19
- package/src/shared/components/ImageEditor/utils.test.ts +0 -136
- package/src/shared/components/ImageEditor/utils.ts +0 -497
- package/src/shared/components/ui/index.ts +0 -1
- package/src/shared/components/ui/preloader.tsx +0 -78
- package/src/shared/config/index.ts +0 -3
- package/src/shared/config/routes.ts +0 -4
- package/src/shared/features/gallery/GalleryPage.tsx +0 -33
- package/src/shared/features/gallery/ImageEditPage.tsx +0 -37
- package/src/shared/features/gallery/index.ts +0 -2
- package/src/shared/hooks/index.ts +0 -1
- package/src/shared/hooks/useImagePreload.tsx +0 -49
- package/src/shared/types/index.ts +0 -11
- package/src/test/setup.ts +0 -14
- package/src/virtual-css-injected-by-js.d.ts +0 -8
- package/src/widget.tsx +0 -119
- package/tsconfig.app.json +0 -29
- package/tsconfig.json +0 -12
- package/tsconfig.lib.json +0 -18
- package/tsconfig.node.json +0 -23
- package/vite-env.d.ts +0 -1
- package/vite.config.ts +0 -24
- package/vite.lib.config.ts +0 -33
- package/vite.widget.config.ts +0 -39
- package/wrangler.json +0 -5
package/README.md
CHANGED
|
@@ -1,75 +1,80 @@
|
|
|
1
|
-
#
|
|
1
|
+
# pixedi
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A lightweight, embeddable React image editor component.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
`pixedi` provides a ready-to-use image editing UI with cropping, resizing, filters, horizontal/vertical flip, undo/redo, and social-media presets. It is built for React applications.
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react-swc) uses [SWC](https://swc.rs/)
|
|
7
|
+
## Features
|
|
9
8
|
|
|
10
|
-
|
|
9
|
+
- Crop with free or fixed-ratio selection
|
|
10
|
+
- Resize by exact pixel dimensions
|
|
11
|
+
- Horizontal and vertical flip
|
|
12
|
+
- Image filters (brightness, contrast, saturation, etc.)
|
|
13
|
+
- Undo/redo history
|
|
14
|
+
- Social-media size presets (Facebook, Instagram, LinkedIn)
|
|
15
|
+
- React component
|
|
16
|
+
- TypeScript declarations included
|
|
11
17
|
|
|
12
|
-
|
|
18
|
+
## Installation
|
|
13
19
|
|
|
14
|
-
|
|
20
|
+
```bash
|
|
21
|
+
npm install pixedi
|
|
22
|
+
# or
|
|
23
|
+
pnpm add pixedi
|
|
24
|
+
# or
|
|
25
|
+
yarn add pixedi
|
|
26
|
+
```
|
|
15
27
|
|
|
16
|
-
|
|
28
|
+
`pixedi` requires the following peer dependencies:
|
|
17
29
|
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
{
|
|
22
|
-
files: ['**/*.{ts,tsx}'],
|
|
23
|
-
extends: [
|
|
24
|
-
// Other configs...
|
|
30
|
+
```bash
|
|
31
|
+
npm install react react-dom
|
|
32
|
+
```
|
|
25
33
|
|
|
26
|
-
|
|
27
|
-
tseslint.configs.recommendedTypeChecked,
|
|
28
|
-
// Alternatively, use this for stricter rules
|
|
29
|
-
tseslint.configs.strictTypeChecked,
|
|
30
|
-
// Optionally, add this for stylistic rules
|
|
31
|
-
tseslint.configs.stylisticTypeChecked,
|
|
34
|
+
## React Component
|
|
32
35
|
|
|
33
|
-
|
|
34
|
-
],
|
|
35
|
-
languageOptions: {
|
|
36
|
-
parserOptions: {
|
|
37
|
-
project: ['./tsconfig.node.json', './tsconfig.app.json'],
|
|
38
|
-
tsconfigRootDir: import.meta.dirname,
|
|
39
|
-
},
|
|
40
|
-
// other options...
|
|
41
|
-
},
|
|
42
|
-
},
|
|
43
|
-
])
|
|
36
|
+
### Import
|
|
44
37
|
|
|
38
|
+
```tsx
|
|
39
|
+
import { ImageEditor } from "pixedi";
|
|
45
40
|
```
|
|
46
41
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
import reactX from 'eslint-plugin-react-x'
|
|
52
|
-
import reactDom from 'eslint-plugin-react-dom'
|
|
53
|
-
|
|
54
|
-
export default defineConfig([
|
|
55
|
-
globalIgnores(['dist']),
|
|
56
|
-
{
|
|
57
|
-
files: ['**/*.{ts,tsx}'],
|
|
58
|
-
extends: [
|
|
59
|
-
// Other configs...
|
|
60
|
-
// Enable lint rules for React
|
|
61
|
-
reactX.configs['recommended-typescript'],
|
|
62
|
-
// Enable lint rules for React DOM
|
|
63
|
-
reactDom.configs.recommended,
|
|
64
|
-
],
|
|
65
|
-
languageOptions: {
|
|
66
|
-
parserOptions: {
|
|
67
|
-
project: ['./tsconfig.node.json', './tsconfig.app.json'],
|
|
68
|
-
tsconfigRootDir: import.meta.dirname,
|
|
69
|
-
},
|
|
70
|
-
// other options...
|
|
71
|
-
},
|
|
72
|
-
},
|
|
73
|
-
])
|
|
42
|
+
### Usage
|
|
43
|
+
|
|
44
|
+
```tsx
|
|
45
|
+
import { ImageEditor } from "pixedi";
|
|
74
46
|
|
|
47
|
+
function App() {
|
|
48
|
+
return (
|
|
49
|
+
<div style={{ width: "100vw", height: "100vh" }}>
|
|
50
|
+
<ImageEditor
|
|
51
|
+
image="https://example.com/photo.jpg"
|
|
52
|
+
onSave={async (base64) => {
|
|
53
|
+
// Upload or persist the edited image
|
|
54
|
+
console.log(base64);
|
|
55
|
+
}}
|
|
56
|
+
onBack={() => {
|
|
57
|
+
// Handle back/cancel action
|
|
58
|
+
console.log("User cancelled editing");
|
|
59
|
+
}}
|
|
60
|
+
/>
|
|
61
|
+
</div>
|
|
62
|
+
);
|
|
63
|
+
}
|
|
75
64
|
```
|
|
65
|
+
|
|
66
|
+
### Props
|
|
67
|
+
|
|
68
|
+
| Prop | Type | Description |
|
|
69
|
+
| -------- | ----------------------------- | ---------------------------------------------------------------------- |
|
|
70
|
+
| `image` | `string` | URL or base64 data URI of the image to edit. |
|
|
71
|
+
| `onSave` | `(base64: string) => void \| Promise<void>` | Called when the user clicks Save. Receives the edited image as base64. |
|
|
72
|
+
| `onBack` | `() => void` | Called when the user clicks Back/Cancel. |
|
|
73
|
+
|
|
74
|
+
## TypeScript
|
|
75
|
+
|
|
76
|
+
TypeScript declarations are included under `dist/lib/index.d.ts`. No additional `@types` package is required.
|
|
77
|
+
|
|
78
|
+
## License
|
|
79
|
+
|
|
80
|
+
MIT
|
package/README.npm.md
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
# pixedi
|
|
2
|
+
|
|
3
|
+
A lightweight, embeddable React image editor component.
|
|
4
|
+
|
|
5
|
+
`pixedi` provides a ready-to-use image editing UI with cropping, resizing, filters, horizontal/vertical flip, undo/redo, and social-media presets. It is built for React applications.
|
|
6
|
+
|
|
7
|
+
## Features
|
|
8
|
+
|
|
9
|
+
- Crop with free or fixed-ratio selection
|
|
10
|
+
- Resize by exact pixel dimensions
|
|
11
|
+
- Horizontal and vertical flip
|
|
12
|
+
- Image filters (brightness, contrast, saturation, etc.)
|
|
13
|
+
- Undo/redo history
|
|
14
|
+
- Social-media size presets (Facebook, Instagram, LinkedIn)
|
|
15
|
+
- React component
|
|
16
|
+
- TypeScript declarations included
|
|
17
|
+
|
|
18
|
+
## Installation
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
npm install pixedi
|
|
22
|
+
# or
|
|
23
|
+
pnpm add pixedi
|
|
24
|
+
# or
|
|
25
|
+
yarn add pixedi
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
`pixedi` requires the following peer dependencies:
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
npm install react react-dom
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## React Component
|
|
35
|
+
|
|
36
|
+
### Import
|
|
37
|
+
|
|
38
|
+
```tsx
|
|
39
|
+
import { ImageEditor } from "pixedi";
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
### Usage
|
|
43
|
+
|
|
44
|
+
```tsx
|
|
45
|
+
import { ImageEditor } from "pixedi";
|
|
46
|
+
|
|
47
|
+
function App() {
|
|
48
|
+
return (
|
|
49
|
+
<div style={{ width: "100vw", height: "100vh" }}>
|
|
50
|
+
<ImageEditor
|
|
51
|
+
image="https://example.com/photo.jpg"
|
|
52
|
+
onSave={async (base64) => {
|
|
53
|
+
// Upload or persist the edited image
|
|
54
|
+
console.log(base64);
|
|
55
|
+
}}
|
|
56
|
+
onBack={() => {
|
|
57
|
+
// Handle back/cancel action
|
|
58
|
+
console.log("User cancelled editing");
|
|
59
|
+
}}
|
|
60
|
+
/>
|
|
61
|
+
</div>
|
|
62
|
+
);
|
|
63
|
+
}
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
### Props
|
|
67
|
+
|
|
68
|
+
| Prop | Type | Description |
|
|
69
|
+
| -------- | ----------------------------- | ---------------------------------------------------------------------- |
|
|
70
|
+
| `image` | `string` | URL or base64 data URI of the image to edit. |
|
|
71
|
+
| `onSave` | `(base64: string) => void \| Promise<void>` | Called when the user clicks Save. Receives the edited image as base64. |
|
|
72
|
+
| `onBack` | `() => void` | Called when the user clicks Back/Cancel. |
|
|
73
|
+
|
|
74
|
+
## TypeScript
|
|
75
|
+
|
|
76
|
+
TypeScript declarations are included under `dist/lib/index.d.ts`. No additional `@types` package is required.
|
|
77
|
+
|
|
78
|
+
## License
|
|
79
|
+
|
|
80
|
+
MIT
|