@merchi/product-editor 0.1.9
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/.turbo/turbo-build.log +1 -0
- package/README.md +174 -0
- package/dist/components/AlignMenu.d.ts +3 -0
- package/dist/components/AlignMenu.js +61 -0
- package/dist/components/FloatingToolbar.d.ts +4 -0
- package/dist/components/FloatingToolbar.js +97 -0
- package/dist/components/FormatButtons.d.ts +2 -0
- package/dist/components/FormatButtons.js +22 -0
- package/dist/components/ImageNavButton.d.ts +7 -0
- package/dist/components/ImageNavButton.js +14 -0
- package/dist/components/ImageZoomModal.d.ts +12 -0
- package/dist/components/ImageZoomModal.js +129 -0
- package/dist/components/LayerPanel.d.ts +4 -0
- package/dist/components/LayerPanel.js +223 -0
- package/dist/components/LoadingOverlay.d.ts +9 -0
- package/dist/components/LoadingOverlay.js +17 -0
- package/dist/components/ProductEditor.d.ts +4 -0
- package/dist/components/ProductEditor.js +67 -0
- package/dist/components/ProductImageGallery.d.ts +6 -0
- package/dist/components/ProductImageGallery.js +148 -0
- package/dist/components/ProductPreviews.d.ts +7 -0
- package/dist/components/ProductPreviews.js +281 -0
- package/dist/components/TextToolbar.d.ts +4 -0
- package/dist/components/TextToolbar.js +117 -0
- package/dist/components/Toolbar.d.ts +3 -0
- package/dist/components/Toolbar.js +47 -0
- package/dist/config/colorConfig.d.ts +1 -0
- package/dist/config/colorConfig.js +10 -0
- package/dist/config/fontConfig.d.ts +5 -0
- package/dist/config/fontConfig.js +21 -0
- package/dist/context/ProductEditorContext.d.ts +60 -0
- package/dist/context/ProductEditorContext.js +743 -0
- package/dist/hooks/useSwipeNavigate.d.ts +11 -0
- package/dist/hooks/useSwipeNavigate.js +35 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +30 -0
- package/dist/styles/BottomPreviewDisplay.css +65 -0
- package/dist/styles/FloatingToolbar.css +41 -0
- package/dist/styles/ImageGallery.css +147 -0
- package/dist/styles/ImageNavButton.css +35 -0
- package/dist/styles/ImageZoomModal.css +101 -0
- package/dist/styles/LayerPanel.css +179 -0
- package/dist/styles/LoadingOverlay.css +48 -0
- package/dist/styles/ProductEditor.css +192 -0
- package/dist/styles/TextToolbar.css +327 -0
- package/dist/styles/Toolbar.css +125 -0
- package/dist/styles/index.css +5 -0
- package/dist/styles/textToolbarSelectStyles.d.ts +3 -0
- package/dist/styles/textToolbarSelectStyles.js +30 -0
- package/dist/types.d.ts +228 -0
- package/dist/types.js +17 -0
- package/dist/utils/canvasAddText.d.ts +11 -0
- package/dist/utils/canvasAddText.js +66 -0
- package/dist/utils/canvasUtils.d.ts +37 -0
- package/dist/utils/canvasUtils.js +342 -0
- package/dist/utils/deviceUtils.d.ts +5 -0
- package/dist/utils/deviceUtils.js +33 -0
- package/dist/utils/draftTemplateUtils.d.ts +23 -0
- package/dist/utils/draftTemplateUtils.js +66 -0
- package/dist/utils/grid.d.ts +32 -0
- package/dist/utils/grid.js +151 -0
- package/dist/utils/imageUtils.d.ts +12 -0
- package/dist/utils/imageUtils.js +178 -0
- package/dist/utils/job.d.ts +40 -0
- package/dist/utils/job.js +115 -0
- package/dist/utils/keyboard.d.ts +1 -0
- package/dist/utils/keyboard.js +26 -0
- package/dist/utils/previewUtils.d.ts +9 -0
- package/dist/utils/previewUtils.js +39 -0
- package/dist/utils/psdConverter.d.ts +40 -0
- package/dist/utils/psdConverter.js +516 -0
- package/dist/utils/psdRenderUtils.d.ts +12 -0
- package/dist/utils/psdRenderUtils.js +465 -0
- package/dist/utils/renderUtils.d.ts +2 -0
- package/dist/utils/renderUtils.js +85 -0
- package/package.json +66 -0
- package/src/components/AlignMenu.tsx +49 -0
- package/src/components/FloatingToolbar.tsx +83 -0
- package/src/components/FormatButtons.tsx +31 -0
- package/src/components/ImageNavButton.tsx +23 -0
- package/src/components/ImageZoomModal.tsx +163 -0
- package/src/components/LayerPanel.tsx +256 -0
- package/src/components/LoadingOverlay.tsx +27 -0
- package/src/components/ProductEditor.tsx +104 -0
- package/src/components/ProductImageGallery.tsx +181 -0
- package/src/components/ProductPreviews.tsx +243 -0
- package/src/components/TextToolbar.tsx +164 -0
- package/src/components/Toolbar.tsx +86 -0
- package/src/config/colorConfig.ts +7 -0
- package/src/config/fontConfig.ts +23 -0
- package/src/context/ProductEditorContext.tsx +829 -0
- package/src/hooks/useSwipeNavigate.ts +40 -0
- package/src/index.ts +6 -0
- package/src/styles/BottomPreviewDisplay.css +65 -0
- package/src/styles/FloatingToolbar.css +41 -0
- package/src/styles/ImageGallery.css +147 -0
- package/src/styles/ImageNavButton.css +35 -0
- package/src/styles/ImageZoomModal.css +101 -0
- package/src/styles/LayerPanel.css +179 -0
- package/src/styles/LoadingOverlay.css +48 -0
- package/src/styles/ProductEditor.css +192 -0
- package/src/styles/TextToolbar.css +327 -0
- package/src/styles/Toolbar.css +125 -0
- package/src/styles/index.css +5 -0
- package/src/styles/textToolbarSelectStyles.ts +60 -0
- package/src/types/ag-psd/index.d.ts +1 -0
- package/src/types/fabric.d.ts +14 -0
- package/src/types/lodash/index.d.ts +1 -0
- package/src/types/psd.d.ts +53 -0
- package/src/types.ts +247 -0
- package/src/utils/canvasAddText.ts +72 -0
- package/src/utils/canvasUtils.ts +406 -0
- package/src/utils/deviceUtils.ts +31 -0
- package/src/utils/draftTemplateUtils.ts +70 -0
- package/src/utils/grid.ts +154 -0
- package/src/utils/imageUtils.ts +218 -0
- package/src/utils/job.ts +128 -0
- package/src/utils/keyboard.ts +28 -0
- package/src/utils/previewUtils.ts +43 -0
- package/src/utils/psdConverter.ts +595 -0
- package/src/utils/psdRenderUtils.ts +453 -0
- package/src/utils/renderUtils.ts +44 -0
- package/tsconfig.json +17 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { TouchEvent } from 'react';
|
|
2
|
+
interface SwipeNavigateOptions {
|
|
3
|
+
onSwipeLeft: () => void;
|
|
4
|
+
onSwipeRight: () => void;
|
|
5
|
+
threshold?: number;
|
|
6
|
+
}
|
|
7
|
+
export declare const useSwipeNavigate: ({ onSwipeLeft, onSwipeRight, threshold }: SwipeNavigateOptions) => {
|
|
8
|
+
onTouchStart: (e: TouchEvent<HTMLElement>) => void;
|
|
9
|
+
onTouchEnd: (e: TouchEvent<HTMLElement>) => void;
|
|
10
|
+
};
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useSwipeNavigate = void 0;
|
|
4
|
+
var react_1 = require("react");
|
|
5
|
+
var useSwipeNavigate = function (_a) {
|
|
6
|
+
var onSwipeLeft = _a.onSwipeLeft, onSwipeRight = _a.onSwipeRight, _b = _a.threshold, threshold = _b === void 0 ? 50 : _b;
|
|
7
|
+
var touchStartX = (0, react_1.useRef)(0);
|
|
8
|
+
var touchEndX = (0, react_1.useRef)(0);
|
|
9
|
+
var handleTouchStart = function (e) {
|
|
10
|
+
touchStartX.current = e.touches[0].clientX;
|
|
11
|
+
touchEndX.current = 0;
|
|
12
|
+
};
|
|
13
|
+
var handleTouchEnd = function (e) {
|
|
14
|
+
if (touchStartX.current === 0) {
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
touchEndX.current = e.changedTouches[0].clientX;
|
|
18
|
+
var diff = touchStartX.current - touchEndX.current;
|
|
19
|
+
if (Math.abs(diff) > threshold) {
|
|
20
|
+
if (diff > 0) {
|
|
21
|
+
onSwipeLeft();
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
onSwipeRight();
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
touchStartX.current = 0;
|
|
28
|
+
touchEndX.current = 0;
|
|
29
|
+
};
|
|
30
|
+
return {
|
|
31
|
+
onTouchStart: handleTouchStart,
|
|
32
|
+
onTouchEnd: handleTouchEnd,
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
exports.useSwipeNavigate = useSwipeNavigate;
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { default as ProductEditor } from './components/ProductEditor';
|
|
2
|
+
export { default as ProductImageGallery } from './components/ProductImageGallery';
|
|
3
|
+
export { ProductEditorProvider, useProductEditor } from './context/ProductEditorContext';
|
|
4
|
+
export * from './utils/grid';
|
|
5
|
+
export * from './types';
|
|
6
|
+
import './styles/index.css';
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
17
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
18
|
+
};
|
|
19
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
+
exports.useProductEditor = exports.ProductEditorProvider = exports.ProductImageGallery = exports.ProductEditor = void 0;
|
|
21
|
+
var ProductEditor_1 = require("./components/ProductEditor");
|
|
22
|
+
Object.defineProperty(exports, "ProductEditor", { enumerable: true, get: function () { return __importDefault(ProductEditor_1).default; } });
|
|
23
|
+
var ProductImageGallery_1 = require("./components/ProductImageGallery");
|
|
24
|
+
Object.defineProperty(exports, "ProductImageGallery", { enumerable: true, get: function () { return __importDefault(ProductImageGallery_1).default; } });
|
|
25
|
+
var ProductEditorContext_1 = require("./context/ProductEditorContext");
|
|
26
|
+
Object.defineProperty(exports, "ProductEditorProvider", { enumerable: true, get: function () { return ProductEditorContext_1.ProductEditorProvider; } });
|
|
27
|
+
Object.defineProperty(exports, "useProductEditor", { enumerable: true, get: function () { return ProductEditorContext_1.useProductEditor; } });
|
|
28
|
+
__exportStar(require("./utils/grid"), exports);
|
|
29
|
+
__exportStar(require("./types"), exports);
|
|
30
|
+
require("./styles/index.css");
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
.bottom-preview-section {
|
|
2
|
+
position: absolute;
|
|
3
|
+
bottom: 0;
|
|
4
|
+
left: 0;
|
|
5
|
+
width: 100%;
|
|
6
|
+
transform: none;
|
|
7
|
+
background-color: rgba(245, 245, 245, 0.95);
|
|
8
|
+
border-radius: 0 0 8px 8px;
|
|
9
|
+
padding: 10px 0;
|
|
10
|
+
z-index: 5;
|
|
11
|
+
display: flex;
|
|
12
|
+
justify-content: center;
|
|
13
|
+
box-sizing: border-box;
|
|
14
|
+
overflow: hidden;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.preview-images {
|
|
18
|
+
display: flex;
|
|
19
|
+
gap: 10px;
|
|
20
|
+
align-items: center;
|
|
21
|
+
justify-content: center;
|
|
22
|
+
padding: 0 15px;
|
|
23
|
+
box-sizing: border-box;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.preview-image-box {
|
|
27
|
+
width: 60px;
|
|
28
|
+
height: 60px;
|
|
29
|
+
background-color: #ffffff;
|
|
30
|
+
border-radius: 4px;
|
|
31
|
+
border: 1px solid #d0d0d0;
|
|
32
|
+
cursor: pointer;
|
|
33
|
+
transition: transform 0.2s ease, border-color 0.2s ease;
|
|
34
|
+
flex-shrink: 0;
|
|
35
|
+
overflow: hidden;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.preview-image-box-loading {
|
|
39
|
+
width: 60px;
|
|
40
|
+
height: 60px;
|
|
41
|
+
display: flex;
|
|
42
|
+
align-items: center;
|
|
43
|
+
justify-content: center;
|
|
44
|
+
background-color: #ffffff;
|
|
45
|
+
border-radius: 4px;
|
|
46
|
+
border: 1px solid #d0d0d0;
|
|
47
|
+
cursor: pointer;
|
|
48
|
+
transition: transform 0.2s ease, border-color 0.2s ease;
|
|
49
|
+
flex-shrink: 0;
|
|
50
|
+
overflow: hidden;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.preview-image-box-oading-spinner {
|
|
54
|
+
width: 1.5rem;
|
|
55
|
+
height: 1.5rem;
|
|
56
|
+
border: 4px solid #e5e7eb;
|
|
57
|
+
border-top: 4px solid #374151;
|
|
58
|
+
border-radius: 50%;
|
|
59
|
+
animation: spin 1s linear infinite;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.preview-image-box:hover {
|
|
63
|
+
transform: scale(1.05);
|
|
64
|
+
border-color: #aaa;
|
|
65
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
.floating-toolbar {
|
|
2
|
+
position: absolute;
|
|
3
|
+
z-index: 1000;
|
|
4
|
+
background-color: #ffffff;
|
|
5
|
+
border: 1px solid #ccc;
|
|
6
|
+
border-radius: 6px;
|
|
7
|
+
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
|
|
8
|
+
cursor: grab;
|
|
9
|
+
width: 70px;
|
|
10
|
+
padding: 8px;
|
|
11
|
+
box-sizing: border-box;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.floating-toolbar:active {
|
|
15
|
+
cursor: grabbing;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.floating-toolbar .toolbar-content,
|
|
19
|
+
.floating-toolbar .grid-toggle,
|
|
20
|
+
.floating-toolbar .preview-toggle {
|
|
21
|
+
width: 100%;
|
|
22
|
+
margin-bottom: 4px;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.floating-toolbar .toolbar-button {
|
|
26
|
+
padding: 0.3rem 0.2rem 0.5rem 0.2rem;
|
|
27
|
+
border-bottom: none;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.floating-toolbar .toolbar-button span {
|
|
31
|
+
font-size: 11px;
|
|
32
|
+
margin-top: 0.15rem;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.floating-toolbar .toolbar-button:last-child {
|
|
36
|
+
margin-bottom: 0;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.floating-toolbar .toolbar-button {
|
|
40
|
+
cursor: pointer;
|
|
41
|
+
}
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
/* ImageGallery styles */
|
|
2
|
+
.image-gallery-container {
|
|
3
|
+
position: relative;
|
|
4
|
+
width: 100%;
|
|
5
|
+
aspect-ratio: 1 / 1;
|
|
6
|
+
max-width: 700px;
|
|
7
|
+
margin: 0 auto;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.image-container {
|
|
11
|
+
position: relative;
|
|
12
|
+
width: 100%;
|
|
13
|
+
height: 100%;
|
|
14
|
+
overflow: hidden;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.image-slide {
|
|
18
|
+
position: absolute;
|
|
19
|
+
inset: 0;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.gallery-image {
|
|
23
|
+
width: 100%;
|
|
24
|
+
height: 100%;
|
|
25
|
+
object-fit: contain;
|
|
26
|
+
transition: opacity 0.3s;
|
|
27
|
+
opacity: 0;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.image-loaded {
|
|
31
|
+
opacity: 1;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.loading-indicator {
|
|
35
|
+
position: absolute;
|
|
36
|
+
inset: 0;
|
|
37
|
+
display: flex;
|
|
38
|
+
align-items: center;
|
|
39
|
+
justify-content: center;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.loading-spinner {
|
|
43
|
+
width: 2rem;
|
|
44
|
+
height: 2rem;
|
|
45
|
+
border: 4px solid #e5e7eb;
|
|
46
|
+
border-top: 4px solid #374151;
|
|
47
|
+
border-radius: 50%;
|
|
48
|
+
animation: spin 1s linear infinite;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
@keyframes spin {
|
|
52
|
+
0% {
|
|
53
|
+
transform: rotate(0deg);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
100% {
|
|
57
|
+
transform: rotate(360deg);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.zoom-button {
|
|
62
|
+
position: absolute;
|
|
63
|
+
bottom: 1rem;
|
|
64
|
+
right: 1rem;
|
|
65
|
+
padding: 0.75rem;
|
|
66
|
+
border-radius: 50%;
|
|
67
|
+
background-color: rgba(255, 255, 255, 0.7);
|
|
68
|
+
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
|
|
69
|
+
transition: all 0.3s;
|
|
70
|
+
z-index: 10;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.zoom-button:hover {
|
|
74
|
+
background-color: white;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.zoom-icon {
|
|
78
|
+
width: 1.25rem;
|
|
79
|
+
height: 1.25rem;
|
|
80
|
+
color: #374151;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.nav-buttons-container {
|
|
84
|
+
position: absolute;
|
|
85
|
+
inset: 0;
|
|
86
|
+
display: flex;
|
|
87
|
+
align-items: center;
|
|
88
|
+
justify-content: space-between;
|
|
89
|
+
padding: 0 1rem;
|
|
90
|
+
z-index: 2;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/* Hide nav buttons on small screens (mobile) */
|
|
94
|
+
@media (max-width: 767px) {
|
|
95
|
+
.nav-buttons-container {
|
|
96
|
+
display: none;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.thumbnails-container {
|
|
101
|
+
width: 100%;
|
|
102
|
+
overflow-x: auto;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.thumbnails-row {
|
|
106
|
+
display: flex;
|
|
107
|
+
gap: 0.5rem;
|
|
108
|
+
margin-top: 1rem;
|
|
109
|
+
min-width: max-content;
|
|
110
|
+
padding: 0 0.5rem;
|
|
111
|
+
justify-content: center;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.thumbnail-button {
|
|
115
|
+
position: relative;
|
|
116
|
+
width: 60px;
|
|
117
|
+
height: 60px;
|
|
118
|
+
overflow: hidden;
|
|
119
|
+
border-radius: 0.125rem;
|
|
120
|
+
border: 1.5px solid transparent;
|
|
121
|
+
transition: all 0.3s;
|
|
122
|
+
flex-shrink: 0;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.thumbnail-button.selected {
|
|
126
|
+
border-color: rgba(48, 61, 191, 0.5);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.thumbnail-image {
|
|
130
|
+
width: 100%;
|
|
131
|
+
height: 100%;
|
|
132
|
+
object-fit: contain;
|
|
133
|
+
padding: 0.25rem;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/* Media queries */
|
|
137
|
+
@media (min-width: 768px) {
|
|
138
|
+
.thumbnails-row {
|
|
139
|
+
gap: 1rem;
|
|
140
|
+
min-width: 0;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
.thumbnail-button {
|
|
144
|
+
width: 80px;
|
|
145
|
+
height: 80px;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/* ImageNavButton styles */
|
|
2
|
+
.nav-button {
|
|
3
|
+
position: absolute;
|
|
4
|
+
top: 50%;
|
|
5
|
+
transform: translateY(-50%);
|
|
6
|
+
width: 40px;
|
|
7
|
+
height: 40px;
|
|
8
|
+
padding: 0;
|
|
9
|
+
display: flex;
|
|
10
|
+
align-items: center;
|
|
11
|
+
justify-content: center;
|
|
12
|
+
border-radius: 50%;
|
|
13
|
+
background-color: rgba(255, 255, 255, 0.7);
|
|
14
|
+
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
|
|
15
|
+
transition: all 0.3s;
|
|
16
|
+
cursor: pointer;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.nav-button:hover {
|
|
20
|
+
background-color: white;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.nav-button.left {
|
|
24
|
+
left: 1rem;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.nav-button.right {
|
|
28
|
+
right: 1rem;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.nav-button-icon {
|
|
32
|
+
height: 1.25rem;
|
|
33
|
+
width: 1.25rem;
|
|
34
|
+
color: #6b7280;
|
|
35
|
+
}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/* ImageZoomModal styles */
|
|
2
|
+
.zoom-modal {
|
|
3
|
+
position: fixed;
|
|
4
|
+
inset: 0;
|
|
5
|
+
background-color: rgba(0, 0, 0, 0.75);
|
|
6
|
+
z-index: 999999;
|
|
7
|
+
display: flex;
|
|
8
|
+
align-items: center;
|
|
9
|
+
justify-content: center;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.zoom-modal-container {
|
|
13
|
+
position: relative;
|
|
14
|
+
width: 100%;
|
|
15
|
+
height: 100%;
|
|
16
|
+
display: flex;
|
|
17
|
+
align-items: center;
|
|
18
|
+
justify-content: center;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.close-button {
|
|
22
|
+
position: absolute;
|
|
23
|
+
top: 1rem;
|
|
24
|
+
right: 1rem;
|
|
25
|
+
color: white;
|
|
26
|
+
z-index: 999999;
|
|
27
|
+
font-size: 1.5rem;
|
|
28
|
+
cursor: pointer;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.close-button:hover {
|
|
32
|
+
color: #d1d5db;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.nav-button-zoom {
|
|
36
|
+
position: absolute;
|
|
37
|
+
color: white;
|
|
38
|
+
z-index: 999999;
|
|
39
|
+
font-size: 2rem;
|
|
40
|
+
width: 48px;
|
|
41
|
+
height: 48px;
|
|
42
|
+
padding: 0;
|
|
43
|
+
background-color: rgba(0, 0, 0, 0.2);
|
|
44
|
+
border-radius: 50%;
|
|
45
|
+
display: flex;
|
|
46
|
+
align-items: center;
|
|
47
|
+
justify-content: center;
|
|
48
|
+
cursor: pointer;
|
|
49
|
+
transition: all 0.2s;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.nav-button-zoom:hover {
|
|
53
|
+
color: #d1d5db;
|
|
54
|
+
background-color: rgba(0, 0, 0, 0.4);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.nav-button-zoom.left {
|
|
58
|
+
left: 1.5rem;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.nav-button-zoom.right {
|
|
62
|
+
right: 1.5rem;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.nav-button-zoom.left,
|
|
66
|
+
.nav-button-zoom.right {
|
|
67
|
+
display: block;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/* Hide zoom nav buttons on small screens (mobile) */
|
|
71
|
+
@media (max-width: 767px) {
|
|
72
|
+
|
|
73
|
+
.nav-button-zoom.left,
|
|
74
|
+
.nav-button-zoom.right {
|
|
75
|
+
display: none;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.zoom-image-container {
|
|
80
|
+
position: relative;
|
|
81
|
+
width: 90vw;
|
|
82
|
+
height: 90vh;
|
|
83
|
+
overflow: hidden;
|
|
84
|
+
z-index: 999999;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.zoom-image {
|
|
88
|
+
position: absolute;
|
|
89
|
+
top: 0;
|
|
90
|
+
left: 0;
|
|
91
|
+
width: 100%;
|
|
92
|
+
height: 100%;
|
|
93
|
+
object-fit: contain;
|
|
94
|
+
transform: translateZ(0);
|
|
95
|
+
z-index: 999999;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/* Ensure modal is above everything when open */
|
|
99
|
+
body.has-preview-modal-open {
|
|
100
|
+
overflow: hidden;
|
|
101
|
+
}
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
.layer-panel {
|
|
2
|
+
position: absolute;
|
|
3
|
+
top: 60px;
|
|
4
|
+
right: 20px;
|
|
5
|
+
width: 250px;
|
|
6
|
+
background-color: #ffffff;
|
|
7
|
+
border: 1px solid #e0e0e0;
|
|
8
|
+
border-radius: 8px;
|
|
9
|
+
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
|
|
10
|
+
z-index: 10;
|
|
11
|
+
display: flex;
|
|
12
|
+
flex-direction: column;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.layer-panel-header {
|
|
16
|
+
display: flex;
|
|
17
|
+
justify-content: space-between;
|
|
18
|
+
align-items: center;
|
|
19
|
+
padding: 6px 15px;
|
|
20
|
+
border-bottom: 1px solid #e0e0e0;
|
|
21
|
+
background-color: #f5f5f5;
|
|
22
|
+
border-top-left-radius: 8px;
|
|
23
|
+
border-top-right-radius: 8px;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.layer-panel-header p {
|
|
27
|
+
margin: 0;
|
|
28
|
+
font-size: 14px;
|
|
29
|
+
font-weight: 600;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.layer-panel-header .close-button {
|
|
33
|
+
background: none;
|
|
34
|
+
border: none;
|
|
35
|
+
cursor: pointer;
|
|
36
|
+
display: flex;
|
|
37
|
+
align-items: flex-start;
|
|
38
|
+
justify-content: center;
|
|
39
|
+
color: #555;
|
|
40
|
+
margin-top: -5px;
|
|
41
|
+
margin-right: 5px;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.layer-list {
|
|
45
|
+
list-style: none;
|
|
46
|
+
padding: 5px 0 30px 0;
|
|
47
|
+
margin: 0;
|
|
48
|
+
max-height: 400px;
|
|
49
|
+
overflow-y: auto;
|
|
50
|
+
flex-grow: 1;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.layer-item {
|
|
54
|
+
display: flex;
|
|
55
|
+
align-items: center;
|
|
56
|
+
padding: 10px 15px;
|
|
57
|
+
border-bottom: none;
|
|
58
|
+
margin: 0 5px 2px 5px;
|
|
59
|
+
border-radius: 4px;
|
|
60
|
+
font-size: 0.9rem;
|
|
61
|
+
background-color: transparent;
|
|
62
|
+
cursor: pointer;
|
|
63
|
+
transition: background-color 0.2s ease;
|
|
64
|
+
position: relative;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.layer-item::after {
|
|
68
|
+
content: '';
|
|
69
|
+
position: absolute;
|
|
70
|
+
bottom: 0;
|
|
71
|
+
left: 15px;
|
|
72
|
+
right: 15px;
|
|
73
|
+
height: 1px;
|
|
74
|
+
background-color: #f0f0f0;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.layer-list>li:last-of-type::after {
|
|
78
|
+
display: none;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.layer-item:hover {
|
|
82
|
+
background-color: #f5f5f5;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.layer-item.selected {
|
|
86
|
+
background-color: #e0e8f3;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.layer-item.is-dragging-item {
|
|
90
|
+
opacity: 0;
|
|
91
|
+
background-color: #d0d8e3;
|
|
92
|
+
cursor: grabbing;
|
|
93
|
+
transition: none;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.layer-icon {
|
|
97
|
+
display: inline-flex;
|
|
98
|
+
align-items: center;
|
|
99
|
+
justify-content: center;
|
|
100
|
+
padding-right: 10px;
|
|
101
|
+
color: #333;
|
|
102
|
+
flex-shrink: 0;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.layer-icon svg {
|
|
106
|
+
width: 20px;
|
|
107
|
+
height: 20px;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.layer-thumbnail {
|
|
111
|
+
width: 24px;
|
|
112
|
+
height: 24px;
|
|
113
|
+
object-fit: cover;
|
|
114
|
+
border-radius: 3px;
|
|
115
|
+
border: 1px solid #ddd;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.layer-name {
|
|
119
|
+
flex-grow: 1;
|
|
120
|
+
white-space: nowrap;
|
|
121
|
+
overflow: hidden;
|
|
122
|
+
text-overflow: ellipsis;
|
|
123
|
+
color: #333;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.no-layers {
|
|
127
|
+
padding: 15px;
|
|
128
|
+
text-align: center;
|
|
129
|
+
color: #757575;
|
|
130
|
+
font-style: italic;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.layer-drag-indicator {
|
|
134
|
+
display: inline-flex;
|
|
135
|
+
align-items: center;
|
|
136
|
+
margin-left: auto;
|
|
137
|
+
padding-left: 8px;
|
|
138
|
+
color: #a0a0a0;
|
|
139
|
+
cursor: grab;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
.layer-item:active .layer-drag-indicator {
|
|
143
|
+
cursor: grabbing;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
.layer-list.is-dragging-active .layer-item {
|
|
147
|
+
transition: transform 0.2s ease;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
/* Mobile layer move buttons */
|
|
151
|
+
.layer-mobile-controls {
|
|
152
|
+
display: flex;
|
|
153
|
+
margin-left: auto;
|
|
154
|
+
gap: 8px;
|
|
155
|
+
align-items: center;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
.layer-move-button {
|
|
159
|
+
background: none;
|
|
160
|
+
border: none;
|
|
161
|
+
padding: 4px;
|
|
162
|
+
display: flex;
|
|
163
|
+
align-items: center;
|
|
164
|
+
justify-content: center;
|
|
165
|
+
color: #555;
|
|
166
|
+
cursor: pointer;
|
|
167
|
+
border-radius: 4px;
|
|
168
|
+
margin: 0;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
.layer-move-button:hover:not(:disabled) {
|
|
172
|
+
background-color: #f0f0f0;
|
|
173
|
+
color: #303DBF;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
.layer-move-button:disabled {
|
|
177
|
+
opacity: 0.3;
|
|
178
|
+
cursor: default;
|
|
179
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
.loading-overlay {
|
|
2
|
+
position: absolute;
|
|
3
|
+
top: 0;
|
|
4
|
+
left: 0;
|
|
5
|
+
right: 0;
|
|
6
|
+
bottom: 0;
|
|
7
|
+
display: flex;
|
|
8
|
+
flex-direction: column;
|
|
9
|
+
justify-content: center;
|
|
10
|
+
align-items: center;
|
|
11
|
+
z-index: 1000;
|
|
12
|
+
color: #333;
|
|
13
|
+
font-size: 1.2em;
|
|
14
|
+
background-color: rgba(255, 255, 255, 0.8);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.canvas-loading {
|
|
18
|
+
position: absolute;
|
|
19
|
+
top: 0;
|
|
20
|
+
left: 0;
|
|
21
|
+
right: 0;
|
|
22
|
+
bottom: 0;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.loading-spinner {
|
|
26
|
+
border: 4px solid rgba(0, 0, 0, 0.1);
|
|
27
|
+
width: 36px;
|
|
28
|
+
height: 36px;
|
|
29
|
+
border-radius: 50%;
|
|
30
|
+
border-left-color: #303dbf;
|
|
31
|
+
margin-bottom: 10px;
|
|
32
|
+
animation: spin 1s ease infinite;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
@keyframes spin {
|
|
36
|
+
0% {
|
|
37
|
+
transform: rotate(0deg);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
100% {
|
|
41
|
+
transform: rotate(360deg);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.loading-overlay p {
|
|
46
|
+
color: #303dbf;
|
|
47
|
+
font-size: 1rem;
|
|
48
|
+
}
|