@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,192 @@
|
|
|
1
|
+
.product-editor {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
gap: 0;
|
|
5
|
+
padding: 0;
|
|
6
|
+
background-color: transparent;
|
|
7
|
+
border-radius: 8px;
|
|
8
|
+
position: relative;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/* Template buttons styles */
|
|
12
|
+
.template-buttons {
|
|
13
|
+
display: flex;
|
|
14
|
+
justify-content: flex-start;
|
|
15
|
+
gap: 0;
|
|
16
|
+
padding: 0;
|
|
17
|
+
margin-bottom: 0;
|
|
18
|
+
z-index: 2;
|
|
19
|
+
width: 100%;
|
|
20
|
+
max-width: none;
|
|
21
|
+
margin-left: 0;
|
|
22
|
+
margin-right: auto;
|
|
23
|
+
transform: none;
|
|
24
|
+
height: 54px;
|
|
25
|
+
position: relative;
|
|
26
|
+
padding-left: 1rem;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.template-button {
|
|
30
|
+
display: flex;
|
|
31
|
+
flex-direction: row;
|
|
32
|
+
align-items: center;
|
|
33
|
+
justify-content: center;
|
|
34
|
+
cursor: pointer;
|
|
35
|
+
width: auto;
|
|
36
|
+
min-width: 160px;
|
|
37
|
+
max-width: 240px;
|
|
38
|
+
padding: 0 0.8rem;
|
|
39
|
+
height: 48px;
|
|
40
|
+
background-color: #f5f5f5;
|
|
41
|
+
color: #8F8E8E;
|
|
42
|
+
border-radius: 8px 8px 0 0;
|
|
43
|
+
transition: all 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
|
|
44
|
+
margin: 0;
|
|
45
|
+
position: relative;
|
|
46
|
+
bottom: 0;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.template-thumbnail {
|
|
50
|
+
height: 36px;
|
|
51
|
+
width: 36px;
|
|
52
|
+
object-fit: contain;
|
|
53
|
+
margin-right: 8px;
|
|
54
|
+
border-radius: 3px;
|
|
55
|
+
flex-shrink: 0;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.template-button.selected {
|
|
59
|
+
background-color: #D6D8F2;
|
|
60
|
+
color: #4E4E4E;
|
|
61
|
+
height: 54px;
|
|
62
|
+
padding-top: 0;
|
|
63
|
+
padding-left: 1.2rem;
|
|
64
|
+
padding-right: 1.2rem;
|
|
65
|
+
min-width: 180px;
|
|
66
|
+
max-width: 280px;
|
|
67
|
+
transform: translateY(-6px);
|
|
68
|
+
box-shadow: 0 -2px 6px rgba(0, 0, 0, 0.15);
|
|
69
|
+
z-index: 3;
|
|
70
|
+
font-weight: bold;
|
|
71
|
+
bottom: 0;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.template-name {
|
|
75
|
+
font-size: 16px;
|
|
76
|
+
font-weight: 700;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/* Main layout */
|
|
80
|
+
.main-editor-layout {
|
|
81
|
+
display: flex;
|
|
82
|
+
gap: 1rem;
|
|
83
|
+
margin-top: -6px;
|
|
84
|
+
position: relative;
|
|
85
|
+
z-index: 1;
|
|
86
|
+
padding-left: 0;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/* Editor container */
|
|
90
|
+
.editor-container {
|
|
91
|
+
flex: 1;
|
|
92
|
+
background-color: #f5f5f5;
|
|
93
|
+
border-radius: 8px;
|
|
94
|
+
padding: 1rem;
|
|
95
|
+
margin-top: 0;
|
|
96
|
+
position: relative;
|
|
97
|
+
z-index: 1;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/* Canvas area */
|
|
101
|
+
.canvas-area {
|
|
102
|
+
display: flex;
|
|
103
|
+
justify-content: center;
|
|
104
|
+
align-items: center;
|
|
105
|
+
background-color: #ffffff;
|
|
106
|
+
border-radius: 4px;
|
|
107
|
+
padding: 1rem;
|
|
108
|
+
position: relative;
|
|
109
|
+
overflow: hidden;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/* Mobile Bottom Toolbar Styles */
|
|
113
|
+
.mobile-bottom-toolbar {
|
|
114
|
+
display: flex;
|
|
115
|
+
background-color: #ffffff;
|
|
116
|
+
border-top: 1px solid #e0e0e0;
|
|
117
|
+
padding: 5px 10px;
|
|
118
|
+
width: 100%;
|
|
119
|
+
box-sizing: border-box;
|
|
120
|
+
z-index: 5;
|
|
121
|
+
overflow-x: auto;
|
|
122
|
+
overflow-y: hidden;
|
|
123
|
+
white-space: nowrap;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
body.has-preview-modal-open .mobile-bottom-toolbar {
|
|
127
|
+
display: none;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
/* Responsive layout */
|
|
131
|
+
@media (max-width: 480px) {
|
|
132
|
+
.main-editor-layout {
|
|
133
|
+
flex-direction: column;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
.editor-container {
|
|
137
|
+
padding: 0.5rem;
|
|
138
|
+
border-bottom-left-radius: 0;
|
|
139
|
+
border-bottom-right-radius: 0;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
.editor-container.has-bottom-padding {
|
|
143
|
+
padding-bottom: 85px;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
.canvas-area {
|
|
147
|
+
padding: 0.5rem;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
.template-buttons {
|
|
151
|
+
transform: none;
|
|
152
|
+
margin-left: 0;
|
|
153
|
+
margin-right: 0;
|
|
154
|
+
max-width: none;
|
|
155
|
+
padding: 0;
|
|
156
|
+
height: 42px;
|
|
157
|
+
justify-content: center;
|
|
158
|
+
width: 100%;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
.template-button {
|
|
162
|
+
width: auto;
|
|
163
|
+
padding: 0.4rem 0.6rem;
|
|
164
|
+
font-size: 14px;
|
|
165
|
+
flex-grow: 0;
|
|
166
|
+
min-width: 80px;
|
|
167
|
+
max-width: 120px;
|
|
168
|
+
height: 36px;
|
|
169
|
+
justify-content: center;
|
|
170
|
+
transition: all 0.15s cubic-bezier(0.4, 0.0, 0.2, 1);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
.template-button.selected {
|
|
174
|
+
height: 42px;
|
|
175
|
+
padding-top: 0;
|
|
176
|
+
padding-left: 0.8rem;
|
|
177
|
+
padding-right: 0.8rem;
|
|
178
|
+
min-width: 90px;
|
|
179
|
+
max-width: 140px;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
.template-thumbnail {
|
|
183
|
+
display: none;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
.template-name {
|
|
187
|
+
font-size: 14px;
|
|
188
|
+
white-space: nowrap;
|
|
189
|
+
overflow: hidden;
|
|
190
|
+
text-overflow: ellipsis;
|
|
191
|
+
}
|
|
192
|
+
}
|
|
@@ -0,0 +1,327 @@
|
|
|
1
|
+
.text-toolbar {
|
|
2
|
+
position: absolute;
|
|
3
|
+
top: 0;
|
|
4
|
+
left: 0;
|
|
5
|
+
width: 100%;
|
|
6
|
+
background-color: #f5f5f5;
|
|
7
|
+
padding: 8px 12px;
|
|
8
|
+
display: flex;
|
|
9
|
+
justify-content: center;
|
|
10
|
+
align-items: center;
|
|
11
|
+
gap: 12px;
|
|
12
|
+
z-index: 100;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.text-toolbar select {
|
|
16
|
+
padding: 5px 10px;
|
|
17
|
+
border: 1px solid #bbb;
|
|
18
|
+
border-radius: 4px;
|
|
19
|
+
background-color: white;
|
|
20
|
+
font-size: 14px;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.text-toolbar .color-picker {
|
|
24
|
+
-webkit-appearance: none;
|
|
25
|
+
-moz-appearance: none;
|
|
26
|
+
appearance: none;
|
|
27
|
+
width: 30px;
|
|
28
|
+
height: 30px;
|
|
29
|
+
padding: 0;
|
|
30
|
+
border: 1px solid #bbb;
|
|
31
|
+
border-radius: 4px;
|
|
32
|
+
cursor: pointer;
|
|
33
|
+
background-color: transparent;
|
|
34
|
+
overflow: hidden;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.text-toolbar .color-picker::-webkit-color-swatch-wrapper {
|
|
38
|
+
padding: 2px;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.text-toolbar .color-picker::-webkit-color-swatch {
|
|
42
|
+
border: none;
|
|
43
|
+
border-radius: 3px;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.text-toolbar .color-picker::-moz-color-swatch {
|
|
47
|
+
border: none;
|
|
48
|
+
border-radius: 3px;
|
|
49
|
+
padding: 2px;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.text-toolbar .color-picker:hover {
|
|
53
|
+
border-color: #999;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.color-picker-container {
|
|
57
|
+
position: relative;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.color-picker-swatch {
|
|
61
|
+
width: 28px;
|
|
62
|
+
height: 28px;
|
|
63
|
+
border-radius: 50%;
|
|
64
|
+
border: 1px solid #bbb;
|
|
65
|
+
cursor: pointer;
|
|
66
|
+
display: inline-block;
|
|
67
|
+
vertical-align: middle;
|
|
68
|
+
overflow: hidden;
|
|
69
|
+
box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.1);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.color-picker-swatch>div {
|
|
73
|
+
display: none;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.color-picker-popover {
|
|
77
|
+
position: absolute;
|
|
78
|
+
top: calc(100% + 8px);
|
|
79
|
+
left: 50%;
|
|
80
|
+
transform: translateX(-50%);
|
|
81
|
+
background: #fff;
|
|
82
|
+
border-radius: 6px;
|
|
83
|
+
box-shadow: 0 3px 12px rgba(0, 0, 0, 0.15);
|
|
84
|
+
padding: 12px;
|
|
85
|
+
z-index: 200;
|
|
86
|
+
display: flex;
|
|
87
|
+
flex-direction: column;
|
|
88
|
+
gap: 12px;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.palette-grid {
|
|
92
|
+
display: grid;
|
|
93
|
+
grid-template-columns: repeat(8, 1fr);
|
|
94
|
+
gap: 10px;
|
|
95
|
+
max-width: 280px;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.palette-swatch,
|
|
99
|
+
.palette-trigger-swatch {
|
|
100
|
+
width: 26px;
|
|
101
|
+
height: 26px;
|
|
102
|
+
border-radius: 50%;
|
|
103
|
+
border: 1px solid #eee;
|
|
104
|
+
cursor: pointer;
|
|
105
|
+
box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.1);
|
|
106
|
+
transition: transform 0.1s ease;
|
|
107
|
+
background-color: transparent;
|
|
108
|
+
padding: 0;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.palette-swatch:hover,
|
|
112
|
+
.palette-trigger-swatch:hover {
|
|
113
|
+
transform: scale(1.1);
|
|
114
|
+
border-color: #ccc;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.palette-trigger-swatch {
|
|
118
|
+
width: 26px;
|
|
119
|
+
height: 26px;
|
|
120
|
+
border-radius: 50%;
|
|
121
|
+
border: 1px solid #ccc;
|
|
122
|
+
cursor: pointer;
|
|
123
|
+
box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.1);
|
|
124
|
+
transition: transform 0.1s ease;
|
|
125
|
+
background-image: conic-gradient(from 0deg,
|
|
126
|
+
red,
|
|
127
|
+
orange,
|
|
128
|
+
yellow,
|
|
129
|
+
lime,
|
|
130
|
+
aqua,
|
|
131
|
+
blue,
|
|
132
|
+
purple,
|
|
133
|
+
red);
|
|
134
|
+
padding: 0;
|
|
135
|
+
display: flex;
|
|
136
|
+
align-items: center;
|
|
137
|
+
justify-content: center;
|
|
138
|
+
color: white;
|
|
139
|
+
font-size: 22px;
|
|
140
|
+
font-weight: bold;
|
|
141
|
+
line-height: 1;
|
|
142
|
+
text-shadow:
|
|
143
|
+
-1px -1px 0 rgba(0, 0, 0, 0.7),
|
|
144
|
+
1px -1px 0 rgba(0, 0, 0, 0.7),
|
|
145
|
+
-1px 1px 0 rgba(0, 0, 0, 0.7),
|
|
146
|
+
1px 1px 0 rgba(0, 0, 0, 0.7);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
.palette-trigger-swatch:hover {
|
|
150
|
+
transform: scale(1.1);
|
|
151
|
+
border-color: #999;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
.color-picker-back-btn {
|
|
155
|
+
color: #303DBF;
|
|
156
|
+
border: 1px solid #303DBF;
|
|
157
|
+
border-radius: 4px;
|
|
158
|
+
padding: 5px 10px;
|
|
159
|
+
cursor: pointer;
|
|
160
|
+
font-size: 12px;
|
|
161
|
+
text-align: center;
|
|
162
|
+
transition: background-color 0.2s ease;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
.color-picker-custom-btn,
|
|
166
|
+
.color-picker-close-btn {
|
|
167
|
+
display: none;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
.color-picker-trigger {
|
|
171
|
+
display: flex;
|
|
172
|
+
align-items: center;
|
|
173
|
+
gap: 6px;
|
|
174
|
+
cursor: pointer;
|
|
175
|
+
padding: 3px;
|
|
176
|
+
border-radius: 4px;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
.color-picker-trigger:hover {
|
|
180
|
+
background-color: rgba(0, 0, 0, 0.05);
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
.color-picker-label {
|
|
184
|
+
font-size: 14px;
|
|
185
|
+
font-weight: 700;
|
|
186
|
+
color: #4E4E4E;
|
|
187
|
+
user-select: none;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
.color-picker-popover .chrome-picker .flexbox-fix {
|
|
191
|
+
padding-top: 4px;
|
|
192
|
+
padding-bottom: 4px;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
.color-picker-popover .chrome-picker input {
|
|
196
|
+
font-size: 15px !important;
|
|
197
|
+
height: 32px !important;
|
|
198
|
+
box-shadow: none !important;
|
|
199
|
+
border: 1px solid #ccc !important;
|
|
200
|
+
text-align: center !important;
|
|
201
|
+
padding: 4px !important;
|
|
202
|
+
margin: 0 3px !important;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
.color-picker-popover .chrome-picker .flexbox-fix>label {
|
|
206
|
+
font-size: 13px !important;
|
|
207
|
+
padding-top: 6px !important;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
.color-picker-popover .chrome-picker .flexbox-fix>div:last-child {
|
|
211
|
+
margin-top: 0 !important;
|
|
212
|
+
position: relative;
|
|
213
|
+
top: 2px;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
.color-picker-popover .chrome-picker .flexbox-fix svg {
|
|
217
|
+
width: 20px !important;
|
|
218
|
+
height: 20px !important;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
.text-toolbar .toolbar-button {
|
|
222
|
+
background: none;
|
|
223
|
+
border: none;
|
|
224
|
+
padding: 5px 8px;
|
|
225
|
+
margin: 0 6px;
|
|
226
|
+
cursor: pointer;
|
|
227
|
+
font-size: 16px;
|
|
228
|
+
border-radius: 4px;
|
|
229
|
+
transition: background-color 0.1s ease;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
.text-toolbar .toolbar-button:hover {
|
|
233
|
+
background-color: #E1E1E1;
|
|
234
|
+
color: inherit;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
.text-toolbar .toolbar-button.active {
|
|
238
|
+
background-color: #D6D8F2;
|
|
239
|
+
color: #303DBF;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
.text-toolbar .toolbar-button svg {
|
|
243
|
+
width: 18px;
|
|
244
|
+
height: 18px;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
.toolbar-button.bold-button,
|
|
248
|
+
.toolbar-button.underline-button,
|
|
249
|
+
.align-group .align-trigger {
|
|
250
|
+
margin: 0 2px;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
.align-group {
|
|
254
|
+
position: relative;
|
|
255
|
+
display: inline-flex;
|
|
256
|
+
align-items: center;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
.align-group .align-trigger {
|
|
260
|
+
margin-left: 4px;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
.align-popover {
|
|
264
|
+
position: absolute;
|
|
265
|
+
top: calc(100% + 12px);
|
|
266
|
+
left: 50%;
|
|
267
|
+
transform: translateX(-50%);
|
|
268
|
+
display: flex;
|
|
269
|
+
flex-direction: row;
|
|
270
|
+
gap: 8px;
|
|
271
|
+
background: #fff;
|
|
272
|
+
border-radius: 4px;
|
|
273
|
+
padding: 10px;
|
|
274
|
+
box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
|
|
275
|
+
z-index: 200;
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
@media (max-width: 480px) {
|
|
279
|
+
.text-toolbar {
|
|
280
|
+
flex-wrap: wrap;
|
|
281
|
+
justify-content: flex-start;
|
|
282
|
+
gap: 8px;
|
|
283
|
+
padding: 6px 8px;
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
.text-toolbar select {
|
|
287
|
+
font-size: 13px;
|
|
288
|
+
padding: 4px 6px;
|
|
289
|
+
margin: 0 4px;
|
|
290
|
+
max-width: 60px;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
.text-toolbar .toolbar-button {
|
|
294
|
+
font-size: 18px;
|
|
295
|
+
padding: 4px 6px;
|
|
296
|
+
margin: 0 4px;
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
.text-toolbar .toolbar-button svg {
|
|
300
|
+
width: 16px;
|
|
301
|
+
height: 16px;
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
.text-toolbar .color-picker-swatch,
|
|
305
|
+
.text-toolbar .palette-trigger-swatch {
|
|
306
|
+
width: 24px;
|
|
307
|
+
height: 24px;
|
|
308
|
+
border-radius: 50%;
|
|
309
|
+
flex-shrink: 0;
|
|
310
|
+
min-width: 24px;
|
|
311
|
+
min-height: 24px;
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
.color-picker-label {
|
|
315
|
+
display: none;
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
.text-toolbar .color-picker-trigger {
|
|
319
|
+
gap: 0;
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
.align-popover {
|
|
323
|
+
left: auto;
|
|
324
|
+
right: 0;
|
|
325
|
+
transform: none;
|
|
326
|
+
}
|
|
327
|
+
}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
.toolbar-content,
|
|
2
|
+
.grid-toggle,
|
|
3
|
+
.preview-toggle {
|
|
4
|
+
width: 100%;
|
|
5
|
+
margin-bottom: 4px;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.toolbar-button {
|
|
9
|
+
display: flex;
|
|
10
|
+
flex-direction: column;
|
|
11
|
+
align-items: center;
|
|
12
|
+
cursor: pointer;
|
|
13
|
+
padding: 0.3rem 0.2rem 0.5rem 0.2rem;
|
|
14
|
+
border-radius: 4px;
|
|
15
|
+
box-sizing: border-box;
|
|
16
|
+
text-align: center;
|
|
17
|
+
transition: all 0.2s;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.toolbar-button span {
|
|
21
|
+
font-size: 11px;
|
|
22
|
+
margin-top: 0.15rem;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.toolbar-button:hover {
|
|
26
|
+
background-color: transparent;
|
|
27
|
+
color: #303DBF;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.toolbar-button:hover svg {
|
|
31
|
+
stroke: #303DBF;
|
|
32
|
+
fill: #303DBF;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.toolbar-button.active {
|
|
36
|
+
background-color: #e6f7ff;
|
|
37
|
+
color: #303DBF;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.toolbar-button.active svg {
|
|
41
|
+
stroke: #303DBF;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.toolbar-button:hover svg,
|
|
45
|
+
.toolbar-button.active svg {
|
|
46
|
+
stroke: #303DBF;
|
|
47
|
+
fill: #303DBF;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.preview-toggle .toolbar-button {
|
|
51
|
+
border-bottom: none;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.grid-toggle+.preview-toggle .toolbar-button {
|
|
55
|
+
border-bottom: none;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.grid-toggle+.toolbar-content .toolbar-button {
|
|
59
|
+
border-bottom: none;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/* mobile toolbar */
|
|
63
|
+
.mobile-bottom-toolbar {
|
|
64
|
+
display: flex;
|
|
65
|
+
justify-content: space-around;
|
|
66
|
+
align-items: center;
|
|
67
|
+
width: 100%;
|
|
68
|
+
padding: 5px 0;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.mobile-bottom-toolbar .grid-toggle,
|
|
72
|
+
.mobile-bottom-toolbar .preview-toggle,
|
|
73
|
+
.mobile-bottom-toolbar .toolbar-content {
|
|
74
|
+
display: flex;
|
|
75
|
+
flex-direction: row;
|
|
76
|
+
align-items: center;
|
|
77
|
+
width: auto;
|
|
78
|
+
margin-bottom: 0;
|
|
79
|
+
gap: 15px;
|
|
80
|
+
flex: none;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.mobile-bottom-toolbar .toolbar-button {
|
|
84
|
+
flex-direction: column;
|
|
85
|
+
align-items: center;
|
|
86
|
+
padding: 2px 8px;
|
|
87
|
+
width: auto;
|
|
88
|
+
border: none;
|
|
89
|
+
background-color: transparent;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.mobile-bottom-toolbar .toolbar-button span {
|
|
93
|
+
font-size: 14px;
|
|
94
|
+
margin-top: 2px;
|
|
95
|
+
white-space: nowrap;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.mobile-bottom-toolbar .toolbar-button svg {
|
|
99
|
+
width: 20px;
|
|
100
|
+
height: 20px;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.mobile-bottom-toolbar .toolbar-button.active {
|
|
104
|
+
background-color: #e6f7ff;
|
|
105
|
+
border-radius: 4px;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.mobile-bottom-toolbar .grid-toggle .toolbar-button,
|
|
109
|
+
.mobile-bottom-toolbar .preview-toggle .toolbar-button,
|
|
110
|
+
.mobile-bottom-toolbar .toolbar-content .toolbar-button {
|
|
111
|
+
border: none;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.toolbar-button.disabled {
|
|
115
|
+
opacity: 0.5;
|
|
116
|
+
cursor: not-allowed;
|
|
117
|
+
pointer-events: none;
|
|
118
|
+
background-color: transparent !important;
|
|
119
|
+
color: #8F8E8E !important;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.toolbar-button.disabled svg {
|
|
123
|
+
stroke: #8F8E8E !important;
|
|
124
|
+
fill: none !important;
|
|
125
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { StylesConfig, OptionProps, SingleValueProps } from 'react-select';
|
|
2
|
+
import { FontOption } from '../config/fontConfig';
|
|
3
|
+
|
|
4
|
+
const isMobile = (): boolean => {
|
|
5
|
+
if (typeof window !== 'undefined') {
|
|
6
|
+
return window.innerWidth < 480;
|
|
7
|
+
}
|
|
8
|
+
return false;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export const customStyles: StylesConfig<FontOption, false> = {
|
|
12
|
+
option: (provided, state: OptionProps<FontOption>) => ({
|
|
13
|
+
...provided,
|
|
14
|
+
fontFamily: state.data.value,
|
|
15
|
+
padding: '10px 15px',
|
|
16
|
+
fontSize: '16px',
|
|
17
|
+
backgroundColor: state.isFocused ? '#eee' : state.isSelected ? '#ddd' : 'white',
|
|
18
|
+
color: '#333',
|
|
19
|
+
cursor: 'pointer',
|
|
20
|
+
transition: 'background-color 0.1s ease',
|
|
21
|
+
}),
|
|
22
|
+
control: (provided) => ({
|
|
23
|
+
...provided,
|
|
24
|
+
minWidth: isMobile() ? 160 : 180,
|
|
25
|
+
minHeight: 38,
|
|
26
|
+
border: '1px solid #ccc',
|
|
27
|
+
borderRadius: '4px',
|
|
28
|
+
boxShadow: 'none',
|
|
29
|
+
backgroundColor: 'white',
|
|
30
|
+
'&:hover': {
|
|
31
|
+
borderColor: '#aaa'
|
|
32
|
+
}
|
|
33
|
+
}),
|
|
34
|
+
singleValue: (provided, state: SingleValueProps<FontOption>) => ({
|
|
35
|
+
...provided,
|
|
36
|
+
fontFamily: state.data.value,
|
|
37
|
+
color: '#333',
|
|
38
|
+
fontSize: isMobile() ? '13px' : '14px',
|
|
39
|
+
}),
|
|
40
|
+
input: (provided) => ({
|
|
41
|
+
...provided,
|
|
42
|
+
margin: '0 2px',
|
|
43
|
+
paddingTop: '1px',
|
|
44
|
+
paddingBottom: '1px',
|
|
45
|
+
fontFamily: 'sans-serif',
|
|
46
|
+
color: '#333',
|
|
47
|
+
}),
|
|
48
|
+
placeholder: (provided) => ({
|
|
49
|
+
...provided,
|
|
50
|
+
color: '#888',
|
|
51
|
+
fontFamily: 'sans-serif',
|
|
52
|
+
}),
|
|
53
|
+
menu: (provided) => ({
|
|
54
|
+
...provided,
|
|
55
|
+
marginTop: '4px',
|
|
56
|
+
border: '1px solid #ccc',
|
|
57
|
+
boxShadow: '0 4px 10px rgba(0,0,0,0.1)',
|
|
58
|
+
borderRadius: '4px',
|
|
59
|
+
}),
|
|
60
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
declare module 'ag-psd';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Canvas } from 'fabric';
|
|
2
|
+
|
|
3
|
+
declare module 'fabric/fabric-impl' {
|
|
4
|
+
interface ICanvasOptions {
|
|
5
|
+
enableHistory?: boolean;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
interface Canvas {
|
|
9
|
+
enableHistory(): void;
|
|
10
|
+
undo(): void;
|
|
11
|
+
redo(): void;
|
|
12
|
+
upperCanvasEl: HTMLCanvasElement;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
declare module 'lodash';
|