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.
Files changed (113) hide show
  1. package/README.md +65 -60
  2. package/README.npm.md +80 -0
  3. package/dist/lib/index.js +1602 -0
  4. package/dist/lib/index.umd.js +28 -0
  5. package/package.json +9 -4
  6. package/.github/workflows/deploy.yml +0 -54
  7. package/.prettierr +0 -9
  8. package/.storybook/main.ts +0 -16
  9. package/.storybook/preview.ts +0 -53
  10. package/.vscode/extensions.json +0 -6
  11. package/eslint.config.js +0 -22
  12. package/index.html +0 -13
  13. package/pnpm-workspace.yaml +0 -2
  14. package/public/favicon.svg +0 -1
  15. package/src/app/App.tsx +0 -10
  16. package/src/app/entries/index.ts +0 -145
  17. package/src/app/providers/RouterProvider.tsx +0 -6
  18. package/src/app/providers/index.ts +0 -1
  19. package/src/app/router/AppRouter.tsx +0 -12
  20. package/src/app/router/index.ts +0 -0
  21. package/src/app/styles/index.css +0 -4
  22. package/src/features/gallery/GalleryPage.tsx +0 -33
  23. package/src/features/gallery/ImageEditPage.tsx +0 -37
  24. package/src/features/gallery/index.ts +0 -2
  25. package/src/main.tsx +0 -10
  26. package/src/shared/components/ImageCard/ImageCard.tsx +0 -54
  27. package/src/shared/components/ImageCard/index.ts +0 -1
  28. package/src/shared/components/ImageEditor/ImageEditor.tsx +0 -48
  29. package/src/shared/components/ImageEditor/assets/icons.tsx +0 -114
  30. package/src/shared/components/ImageEditor/constants.ts +0 -118
  31. package/src/shared/components/ImageEditor/crop/Crop.tsx +0 -60
  32. package/src/shared/components/ImageEditor/crop/CropBorders.tsx +0 -28
  33. package/src/shared/components/ImageEditor/crop/CropLines.tsx +0 -8
  34. package/src/shared/components/ImageEditor/crop/CropPointer.tsx +0 -21
  35. package/src/shared/components/ImageEditor/crop/CropPointers.tsx +0 -44
  36. package/src/shared/components/ImageEditor/crop/CropTools.tsx +0 -138
  37. package/src/shared/components/ImageEditor/crop/crop.css +0 -180
  38. package/src/shared/components/ImageEditor/crop/index.ts +0 -8
  39. package/src/shared/components/ImageEditor/crop/useCropInteraction.ts +0 -230
  40. package/src/shared/components/ImageEditor/eventBus.ts +0 -8
  41. package/src/shared/components/ImageEditor/frame/Frame.tsx +0 -48
  42. package/src/shared/components/ImageEditor/frame/frame.css +0 -40
  43. package/src/shared/components/ImageEditor/frame/index.ts +0 -1
  44. package/src/shared/components/ImageEditor/header/Header.tsx +0 -81
  45. package/src/shared/components/ImageEditor/header/header.css +0 -27
  46. package/src/shared/components/ImageEditor/header/index.ts +0 -1
  47. package/src/shared/components/ImageEditor/hooks/index.ts +0 -5
  48. package/src/shared/components/ImageEditor/hooks/useAbove.tsx +0 -18
  49. package/src/shared/components/ImageEditor/hooks/useBellow.tsx +0 -18
  50. package/src/shared/components/ImageEditor/hooks/useImageLoader.tsx +0 -110
  51. package/src/shared/components/ImageEditor/hooks/useImageProcessor.test.tsx +0 -147
  52. package/src/shared/components/ImageEditor/hooks/useImageProcessor.ts +0 -225
  53. package/src/shared/components/ImageEditor/hooks/useMobile.tsx +0 -33
  54. package/src/shared/components/ImageEditor/index.css +0 -145
  55. package/src/shared/components/ImageEditor/index.ts +0 -1
  56. package/src/shared/components/ImageEditor/provider/ImageEditorProvider.test.tsx +0 -126
  57. package/src/shared/components/ImageEditor/provider/ImageEditorProvider.tsx +0 -107
  58. package/src/shared/components/ImageEditor/provider/StoreContext.tsx +0 -20
  59. package/src/shared/components/ImageEditor/provider/initialState.ts +0 -30
  60. package/src/shared/components/ImageEditor/provider/useImageEditorContext.tsx +0 -12
  61. package/src/shared/components/ImageEditor/resize/ResizeTools.tsx +0 -183
  62. package/src/shared/components/ImageEditor/resize/index.ts +0 -1
  63. package/src/shared/components/ImageEditor/resize/resize.css +0 -56
  64. package/src/shared/components/ImageEditor/sidebar/Sidebar.tsx +0 -54
  65. package/src/shared/components/ImageEditor/sidebar/SidebarCrop.tsx +0 -57
  66. package/src/shared/components/ImageEditor/sidebar/SidebarPresets.tsx +0 -54
  67. package/src/shared/components/ImageEditor/sidebar/SidebarResize.tsx +0 -26
  68. package/src/shared/components/ImageEditor/sidebar/index.ts +0 -1
  69. package/src/shared/components/ImageEditor/sidebar/sidebar.css +0 -101
  70. package/src/shared/components/ImageEditor/types.ts +0 -59
  71. package/src/shared/components/ImageEditor/ui/button/Button.stories.tsx +0 -42
  72. package/src/shared/components/ImageEditor/ui/button/Button.tsx +0 -21
  73. package/src/shared/components/ImageEditor/ui/button/button.css +0 -69
  74. package/src/shared/components/ImageEditor/ui/button-crop/ButtonCrop.stories.tsx +0 -26
  75. package/src/shared/components/ImageEditor/ui/button-crop/ButtonCrop.tsx +0 -29
  76. package/src/shared/components/ImageEditor/ui/button-crop/button-crop.css +0 -38
  77. package/src/shared/components/ImageEditor/ui/index.ts +0 -6
  78. package/src/shared/components/ImageEditor/ui/input/Input.stories.tsx +0 -45
  79. package/src/shared/components/ImageEditor/ui/input/Input.tsx +0 -20
  80. package/src/shared/components/ImageEditor/ui/input/input.css +0 -48
  81. package/src/shared/components/ImageEditor/ui/input-pixel/InputPixel.stories.tsx +0 -33
  82. package/src/shared/components/ImageEditor/ui/input-pixel/InputPixel.tsx +0 -23
  83. package/src/shared/components/ImageEditor/ui/input-pixel/input-pixel.css +0 -24
  84. package/src/shared/components/ImageEditor/ui/select/Select.stories.tsx +0 -67
  85. package/src/shared/components/ImageEditor/ui/select/Select.tsx +0 -161
  86. package/src/shared/components/ImageEditor/ui/select/select.css +0 -147
  87. package/src/shared/components/ImageEditor/ui/separator/Separator.stories.tsx +0 -37
  88. package/src/shared/components/ImageEditor/ui/separator/Separator.tsx +0 -27
  89. package/src/shared/components/ImageEditor/ui/separator/separator.css +0 -19
  90. package/src/shared/components/ImageEditor/utils.test.ts +0 -136
  91. package/src/shared/components/ImageEditor/utils.ts +0 -497
  92. package/src/shared/components/ui/index.ts +0 -1
  93. package/src/shared/components/ui/preloader.tsx +0 -78
  94. package/src/shared/config/index.ts +0 -3
  95. package/src/shared/config/routes.ts +0 -4
  96. package/src/shared/features/gallery/GalleryPage.tsx +0 -33
  97. package/src/shared/features/gallery/ImageEditPage.tsx +0 -37
  98. package/src/shared/features/gallery/index.ts +0 -2
  99. package/src/shared/hooks/index.ts +0 -1
  100. package/src/shared/hooks/useImagePreload.tsx +0 -49
  101. package/src/shared/types/index.ts +0 -11
  102. package/src/test/setup.ts +0 -14
  103. package/src/virtual-css-injected-by-js.d.ts +0 -8
  104. package/src/widget.tsx +0 -119
  105. package/tsconfig.app.json +0 -29
  106. package/tsconfig.json +0 -12
  107. package/tsconfig.lib.json +0 -18
  108. package/tsconfig.node.json +0 -23
  109. package/vite-env.d.ts +0 -1
  110. package/vite.config.ts +0 -24
  111. package/vite.lib.config.ts +0 -33
  112. package/vite.widget.config.ts +0 -39
  113. package/wrangler.json +0 -5
package/README.md CHANGED
@@ -1,75 +1,80 @@
1
- # React + TypeScript + Vite
1
+ # pixedi
2
2
 
3
- This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
3
+ A lightweight, embeddable React image editor component.
4
4
 
5
- Currently, two official plugins are available:
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
- - [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react) uses [Oxc](https://oxc.rs)
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
- ## React Compiler
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
- The React Compiler is not enabled on this template because of its impact on dev & build performances. To add it, see [this documentation](https://react.dev/learn/react-compiler/installation).
18
+ ## Installation
13
19
 
14
- ## Expanding the ESLint configuration
20
+ ```bash
21
+ npm install pixedi
22
+ # or
23
+ pnpm add pixedi
24
+ # or
25
+ yarn add pixedi
26
+ ```
15
27
 
16
- If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules:
28
+ `pixedi` requires the following peer dependencies:
17
29
 
18
- ```js
19
- export default defineConfig([
20
- globalIgnores(['dist']),
21
- {
22
- files: ['**/*.{ts,tsx}'],
23
- extends: [
24
- // Other configs...
30
+ ```bash
31
+ npm install react react-dom
32
+ ```
25
33
 
26
- // Remove tseslint.configs.recommended and replace with this
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
- // Other configs...
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
- You can also install [eslint-plugin-react-x](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-x) and [eslint-plugin-react-dom](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-dom) for React-specific lint rules:
48
-
49
- ```js
50
- // eslint.config.js
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