@nextblock-cms/editor 0.0.6 → 0.1.0

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/styles/editor.css CHANGED
@@ -1,10 +1,7 @@
1
- @config "../../../../tailwind.config.js";
2
1
  @import "tailwindcss/theme";
2
+ @config "../../../../tailwind.config.js";
3
3
  /* libs/editor/src/styles/editor.css */
4
4
 
5
- /* Import drag handle styles */
6
- @import './drag-handle.css';
7
-
8
5
  .is-editor-empty,
9
6
  .is-empty {
10
7
  position: relative;
@@ -39,6 +36,15 @@
39
36
  font-weight: 600;
40
37
  }
41
38
 
39
+ .tiptap h1,
40
+ .tiptap h2,
41
+ .tiptap h3,
42
+ .tiptap h4,
43
+ .tiptap h5,
44
+ .tiptap h6 {
45
+ margin-top: 0;
46
+ }
47
+
42
48
  .ProseMirror .is-empty-blockquote::before {
43
49
  font-style: italic;
44
50
  opacity: 0.6;
@@ -89,3 +95,157 @@
89
95
  background: rgba(0, 0, 0, 0.05);
90
96
  color: inherit;
91
97
  }
98
+
99
+ /* Drag handle styles */
100
+ .tiptap-drag-handle {
101
+ position: absolute;
102
+ z-index: 50;
103
+ pointer-events: none;
104
+ display: flex;
105
+ align-items: center;
106
+ justify-content: center;
107
+ transform: translateX(0);
108
+ transition: opacity 120ms var(--ease-out, ease), transform 120ms var(--ease-out, ease);
109
+ }
110
+
111
+ .tiptap-drag-handle__group {
112
+ pointer-events: auto;
113
+ display: inline-flex;
114
+ align-items: center;
115
+ gap: 0.125rem;
116
+ padding: 0.125rem 0.1rem;
117
+ border-radius: 0.5rem;
118
+ border: none;
119
+ background-color: transparent;
120
+ box-shadow: none;
121
+ color: color-mix(in srgb, hsl(var(--muted-foreground)) 80%, hsl(var(--foreground)) 20%);
122
+ transition:
123
+ background-color 120ms var(--ease-out, ease),
124
+ color 120ms var(--ease-out, ease);
125
+ min-height: 1.65rem;
126
+ line-height: 1;
127
+ }
128
+
129
+ .tiptap-drag-handle__group:hover,
130
+ .tiptap-drag-handle__group:focus-within {
131
+ background-color: transparent;
132
+ color: color-mix(in srgb, hsl(var(--foreground)) 90%, hsl(var(--muted-foreground)) 10%);
133
+ }
134
+
135
+ .dark .tiptap-drag-handle__group {
136
+ background-color: transparent;
137
+ border: none;
138
+ box-shadow: none;
139
+ color: color-mix(in srgb, hsl(var(--muted-foreground)) 85%, white 15%);
140
+ }
141
+
142
+ .tiptap-drag-handle__group[data-menu-open='true'] {
143
+ border: none;
144
+ background-color: transparent;
145
+ color: hsl(var(--primary));
146
+ }
147
+
148
+ .tiptap-drag-handle__button {
149
+ display: inline-flex;
150
+ align-items: center;
151
+ justify-content: center;
152
+ width: 1.3rem;
153
+ height: 1.3rem;
154
+ border-radius: 0.5rem;
155
+ border: none;
156
+ background-color: transparent;
157
+ color: inherit;
158
+ transition:
159
+ background-color 120ms var(--ease-out, ease),
160
+ border-color 120ms var(--ease-out, ease),
161
+ transform 120ms var(--ease-out, ease),
162
+ color 120ms var(--ease-out, ease);
163
+ }
164
+
165
+ .tiptap-drag-handle__button--ghost:hover,
166
+ .tiptap-drag-handle__button--ghost:focus-visible {
167
+ background-color: color-mix(in srgb, hsl(var(--muted)) 55%, transparent 45%);
168
+ border-color: transparent;
169
+ color: hsl(var(--foreground));
170
+ transform: translateY(-1px);
171
+ }
172
+
173
+ .dark .tiptap-drag-handle__button--ghost:hover,
174
+ .dark .tiptap-drag-handle__button--ghost:focus-visible {
175
+ background-color: color-mix(in srgb, hsl(var(--muted)) 68%, transparent 32%);
176
+ border-color: transparent;
177
+ }
178
+
179
+ .tiptap-drag-handle__button:active {
180
+ transform: translateY(0);
181
+ }
182
+
183
+ .tiptap-drag-handle__plus {
184
+ cursor: pointer;
185
+ }
186
+
187
+ .tiptap-drag-handle__grip {
188
+ cursor: grab;
189
+ border-left: none;
190
+ padding-left: 0.1rem;
191
+ }
192
+
193
+ .tiptap-drag-handle__grip:active {
194
+ cursor: grabbing;
195
+ }
196
+
197
+ body.dragging {
198
+ cursor: grabbing !important;
199
+ user-select: none;
200
+ }
201
+
202
+ body.dragging .tiptap-drag-handle__group {
203
+ box-shadow: none;
204
+ }
205
+
206
+ body.dragging .tiptap-drag-handle__button {
207
+ background-color: color-mix(in srgb, hsl(var(--primary)) 18%, transparent 82%);
208
+ border-color: transparent;
209
+ color: hsl(var(--primary-foreground));
210
+ }
211
+
212
+ .tiptap-drag-handle__icon {
213
+ width: 0.85rem;
214
+ height: 0.85rem;
215
+ }
216
+
217
+ .tiptap-drag-handle__icon--filled {
218
+ width: 0.95rem;
219
+ height: 0.95rem;
220
+ }
221
+
222
+ .tiptap-drag-hover-target {
223
+ position: relative;
224
+ }
225
+
226
+ .tiptap-drag-hover-target::before {
227
+ content: '';
228
+ position: absolute;
229
+ left: -0.75rem;
230
+ right: -0.75rem;
231
+ top: -0.5rem;
232
+ bottom: -0.5rem;
233
+ border-radius: 0.75rem;
234
+ border: 1px dashed transparent;
235
+ transition: border-color 120ms var(--ease-out, ease);
236
+ }
237
+
238
+ .tiptap-drag-hover-target.is-drag-over::before {
239
+ border-color: hsl(var(--primary));
240
+ }
241
+
242
+ @media (max-width: 768px) {
243
+ .tiptap-drag-handle {
244
+ transform: translateX(calc(-100% - 0.5rem));
245
+ }
246
+
247
+ .tiptap-drag-handle__group {
248
+ gap: 0.1rem;
249
+ padding: 0.15rem 0.2rem;
250
+ }
251
+ }