tokimeki-image-editor 0.1.6 → 0.1.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2023 Shoichiro Hori
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,7 +1,34 @@
1
- # Tokimeki Image Editor
1
+ # TOKIMEKI Image Editor
2
+
3
+ ![screenshot-1.png](/static/screenshot-1.png)
2
4
 
3
5
  A powerful and modern image editing library for Svelte 5.
4
6
 
7
+ # Features
8
+
9
+ - Cropping
10
+ - Flip
11
+ - Image Adjustment
12
+ - Filtering
13
+ - Blur
14
+ - Stamp
15
+
16
+ # Demo
17
+
18
+ https://tokimeki-image-editor.vercel.app/
19
+
20
+ # Install
21
+
22
+ ```
23
+ npm install tokimeki-image-editor
24
+ ```
25
+
26
+ WIP
27
+
28
+ # Usage
29
+
30
+ WIP
31
+
5
32
  ## License
6
33
 
7
34
  MIT
@@ -18,9 +18,13 @@ function resetAll() {
18
18
  grayscale: 0
19
19
  });
20
20
  }
21
+ // Prevent wheel events from propagating to canvas zoom handler
22
+ function handleWheel(e) {
23
+ e.stopPropagation();
24
+ }
21
25
  </script>
22
26
 
23
- <div class="adjust-tool">
27
+ <div class="adjust-tool" onwheel={handleWheel}>
24
28
  <div class="tool-header">
25
29
  <h3>{$_('editor.adjust')}</h3>
26
30
  <button class="close-btn" onclick={onClose} title={$_('editor.close')}>
@@ -406,6 +406,12 @@ function handlePinchZoomEnd() {
406
406
  }
407
407
  // Unified touch handlers that delegate based on finger count
408
408
  function handleContainerTouchStartUnified(event) {
409
+ // Check if touch is on a button or interactive element
410
+ const target = event.target;
411
+ if (target.closest('button') || target.closest('.crop-top-controls') || target.closest('.crop-controls')) {
412
+ // Let the button handle the event
413
+ return;
414
+ }
409
415
  // Two fingers = pinch zoom crop area
410
416
  if (event.touches.length === 2) {
411
417
  handlePinchZoomStart(event);
@@ -742,6 +748,7 @@ function toggleFlipVertical() {
742
748
  flex-direction: column;
743
749
  gap: 0.75rem;
744
750
  z-index: 20;
751
+ pointer-events: auto;
745
752
  }
746
753
 
747
754
  @media (max-width: 767px) {
@@ -883,6 +890,7 @@ function toggleFlipVertical() {
883
890
  display: flex;
884
891
  gap: 0.5rem;
885
892
  z-index: 20;
893
+ pointer-events: auto;
886
894
  }
887
895
 
888
896
  @media (max-width: 767px) {
@@ -8,9 +8,13 @@ function handleQualityChange(event) {
8
8
  const value = parseFloat(event.target.value);
9
9
  onChange({ quality: value });
10
10
  }
11
+ // Prevent wheel events from propagating to canvas zoom handler
12
+ function handleWheel(e) {
13
+ e.stopPropagation();
14
+ }
11
15
  </script>
12
16
 
13
- <div class="export-tool">
17
+ <div class="export-tool" onwheel={handleWheel}>
14
18
  <div class="tool-header">
15
19
  <h3>{$_('editor.export')}</h3>
16
20
  <button class="close-btn" onclick={onClose}>✕</button>
@@ -239,9 +239,13 @@ function handleFilterSelect(filterId) {
239
239
  onChange(newAdjustments);
240
240
  }
241
241
  }
242
+ // Prevent wheel events from propagating to canvas zoom handler
243
+ function handleWheel(e) {
244
+ e.stopPropagation();
245
+ }
242
246
  </script>
243
247
 
244
- <div class="filter-tool">
248
+ <div class="filter-tool" onwheel={handleWheel}>
245
249
  <div class="tool-header">
246
250
  <h3>{$_('editor.filter')}</h3>
247
251
  <button class="close-btn" onclick={onClose} title={$_('editor.close')}>
@@ -1,4 +1,5 @@
1
- <script lang="ts">import { _ } from 'svelte-i18n';
1
+ <script lang="ts">import '../i18n';
2
+ import { _ } from 'svelte-i18n';
2
3
  import { Redo2, RotateCcw, Undo2 } from 'lucide-svelte';
3
4
  import { loadImage, calculateFitScale, exportCanvas, downloadImage, applyTransform } from '../utils/canvas';
4
5
  import { createEmptyHistory, createSnapshot, addToHistory, undo, redo, canUndo, canRedo } from '../utils/history';
@@ -1,3 +1,4 @@
1
+ import '../i18n';
1
2
  interface Props {
2
3
  initialImage?: File | string;
3
4
  width?: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tokimeki-image-editor",
3
- "version": "0.1.6",
3
+ "version": "0.1.8",
4
4
  "description": "A image editor for svelte.",
5
5
  "type": "module",
6
6
  "license": "MIT",