@nextblock-cms/editor 0.0.2 → 0.0.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nextblock-cms/editor",
3
- "version": "0.0.2",
3
+ "version": "0.0.4",
4
4
  "main": "index.cjs.js",
5
5
  "module": "index.es.js",
6
6
  "types": "index.d.ts"
@@ -0,0 +1,477 @@
1
+ /* Advanced Placeholder Styles */
2
+ .is-editor-empty {
3
+ position: relative;
4
+ }
5
+
6
+ .is-empty {
7
+ position: relative;
8
+ }
9
+
10
+ .is-empty::before {
11
+ color: var(--muted-foreground);
12
+ content: attr(data-placeholder);
13
+ position: absolute;
14
+ left: 0;
15
+ float: none;
16
+ height: auto;
17
+ pointer-events: none;
18
+ font-style: italic;
19
+ opacity: 0.6;
20
+ }
21
+
22
+ /* Specific placeholder styles for different node types */
23
+ .is-empty-paragraph::before {
24
+ content: attr(data-placeholder);
25
+ }
26
+
27
+ .is-empty-heading-1::before {
28
+ font-size: 2rem;
29
+ font-weight: 600;
30
+ line-height: 1.2;
31
+ }
32
+
33
+ .is-empty-heading-2::before {
34
+ font-size: 1.5rem;
35
+ font-weight: 600;
36
+ line-height: 1.3;
37
+ }
38
+
39
+ .is-empty-heading-3::before {
40
+ font-size: 1.25rem;
41
+ font-weight: 600;
42
+ line-height: 1.4;
43
+ }
44
+
45
+ .is-empty-list-item::before {
46
+ margin-left: 0.5rem;
47
+ }
48
+
49
+ .is-empty-task-item::before {
50
+ margin-left: 2rem;
51
+ }
52
+
53
+ .is-empty-blockquote::before {
54
+ font-style: italic;
55
+ opacity: 0.7;
56
+ }
57
+
58
+ .is-empty-code-block::before {
59
+ font-family: var(--font-mono);
60
+ font-size: 0.875rem;
61
+ opacity: 0.5;
62
+ }
63
+
64
+ /* Enhanced Focus Styles */
65
+ .has-focus {
66
+ position: relative;
67
+ outline: none;
68
+ }
69
+
70
+ .focus-transitions .has-focus {
71
+ transition: all 0.2s ease-in-out;
72
+ }
73
+
74
+ .editor-focused .has-focus {
75
+ background-color: rgba(59, 130, 246, 0.05);
76
+ border-radius: 4px;
77
+ box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
78
+ }
79
+
80
+ .focus-ring {
81
+ position: absolute;
82
+ left: -2px;
83
+ top: -2px;
84
+ right: -2px;
85
+ bottom: -2px;
86
+ border: 2px solid rgba(59, 130, 246, 0.3);
87
+ border-radius: 6px;
88
+ pointer-events: none;
89
+ opacity: 0;
90
+ transition: opacity 0.2s ease-in-out;
91
+ }
92
+
93
+ .editor-focused .focus-ring {
94
+ opacity: 1;
95
+ }
96
+
97
+ .selection-highlight {
98
+ background-color: rgba(59, 130, 246, 0.15);
99
+ border-radius: 2px;
100
+ }
101
+
102
+ .dim-unfocused .ProseMirror > *:not(.has-focus) {
103
+ opacity: 0.6;
104
+ transition: opacity 0.2s ease-in-out;
105
+ }
106
+
107
+ /* Focus mode styles */
108
+ .focus-mode {
109
+ background: var(--background);
110
+ color: var(--foreground);
111
+ }
112
+
113
+ .focus-mode .ProseMirror {
114
+ max-width: 65ch;
115
+ margin: 0 auto;
116
+ padding: 2rem;
117
+ line-height: 1.7;
118
+ font-size: 1.1rem;
119
+ }
120
+
121
+ .focus-mode .ProseMirror > *:not(.has-focus) {
122
+ opacity: 0.3;
123
+ transition: opacity 0.3s ease;
124
+ }
125
+
126
+ /* Writing mode styles */
127
+ .writing-mode {
128
+ background: #1a1a1a;
129
+ color: #e5e5e5;
130
+ }
131
+
132
+ .writing-mode .ProseMirror {
133
+ background: #1a1a1a;
134
+ color: #e5e5e5;
135
+ max-width: 70ch;
136
+ margin: 0 auto;
137
+ padding: 3rem 2rem;
138
+ line-height: 1.8;
139
+ font-size: 1.125rem;
140
+ font-family: 'Georgia', 'Times New Roman', serif;
141
+ }
142
+
143
+ .writing-mode .floating-menu,
144
+ .writing-mode .bubble-menu,
145
+ .writing-mode .toolbar {
146
+ background: #2a2a2a;
147
+ border-color: #404040;
148
+ color: #e5e5e5;
149
+ }
150
+
151
+ /* Enhanced Floating Menu Styles */
152
+ .enhanced-floating-menu {
153
+ background: var(--background);
154
+ border: 1px solid var(--border);
155
+ border-radius: 8px;
156
+ box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
157
+ backdrop-filter: blur(8px);
158
+ max-width: 400px;
159
+ overflow: hidden;
160
+ }
161
+
162
+ .enhanced-floating-menu .search-input {
163
+ background: var(--muted);
164
+ border: 1px solid var(--input);
165
+ border-radius: 6px;
166
+ padding: 8px 12px;
167
+ font-size: 14px;
168
+ transition: all 0.2s ease;
169
+ }
170
+
171
+ .enhanced-floating-menu .search-input:focus {
172
+ outline: none;
173
+ border-color: var(--ring);
174
+ box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
175
+ }
176
+
177
+ .enhanced-floating-menu .category-filter {
178
+ display: flex;
179
+ gap: 4px;
180
+ padding: 8px;
181
+ border-bottom: 1px solid var(--border);
182
+ overflow-x: auto;
183
+ scrollbar-width: none;
184
+ -ms-overflow-style: none;
185
+ }
186
+
187
+ .enhanced-floating-menu .category-filter::-webkit-scrollbar {
188
+ display: none;
189
+ }
190
+
191
+ .enhanced-floating-menu .category-button {
192
+ flex-shrink: 0;
193
+ padding: 6px 12px;
194
+ border-radius: 6px;
195
+ font-size: 12px;
196
+ font-weight: 500;
197
+ transition: all 0.2s ease;
198
+ white-space: nowrap;
199
+ }
200
+
201
+ .enhanced-floating-menu .category-button.active {
202
+ background: var(--primary);
203
+ color: var(--primary-foreground);
204
+ }
205
+
206
+ .enhanced-floating-menu .menu-item {
207
+ display: flex;
208
+ align-items: center;
209
+ gap: 12px;
210
+ padding: 12px;
211
+ border-radius: 6px;
212
+ transition: all 0.2s ease;
213
+ cursor: pointer;
214
+ }
215
+
216
+ .enhanced-floating-menu .menu-item:hover {
217
+ background: var(--accent);
218
+ }
219
+
220
+ .enhanced-floating-menu .menu-item-icon {
221
+ display: flex;
222
+ align-items: center;
223
+ justify-content: center;
224
+ width: 32px;
225
+ height: 32px;
226
+ border: 1px solid var(--border);
227
+ border-radius: 6px;
228
+ background: var(--muted);
229
+ flex-shrink: 0;
230
+ }
231
+
232
+ .enhanced-floating-menu .menu-item-content {
233
+ flex: 1;
234
+ min-width: 0;
235
+ }
236
+
237
+ .enhanced-floating-menu .menu-item-title {
238
+ font-weight: 500;
239
+ font-size: 14px;
240
+ margin-bottom: 2px;
241
+ }
242
+
243
+ .enhanced-floating-menu .menu-item-description {
244
+ font-size: 12px;
245
+ color: var(--muted-foreground);
246
+ line-height: 1.3;
247
+ }
248
+
249
+ .enhanced-floating-menu .category-section {
250
+ padding: 8px 0;
251
+ }
252
+
253
+ .enhanced-floating-menu .category-header {
254
+ display: flex;
255
+ align-items: center;
256
+ gap: 8px;
257
+ padding: 8px 12px;
258
+ font-size: 11px;
259
+ font-weight: 600;
260
+ color: var(--muted-foreground);
261
+ text-transform: uppercase;
262
+ letter-spacing: 0.5px;
263
+ border-bottom: 1px solid var(--border);
264
+ margin-bottom: 4px;
265
+ }
266
+
267
+ /* Mobile Toolbar Styles */
268
+ .mobile-toolbar {
269
+ background: var(--background);
270
+ border-top: 1px solid var(--border);
271
+ box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.1);
272
+ backdrop-filter: blur(8px);
273
+ }
274
+
275
+ .mobile-toolbar .section-tabs {
276
+ display: flex;
277
+ background: var(--muted/50);
278
+ border-bottom: 1px solid var(--border);
279
+ }
280
+
281
+ .mobile-toolbar .section-tab {
282
+ flex: 1;
283
+ display: flex;
284
+ flex-direction: column;
285
+ align-items: center;
286
+ gap: 4px;
287
+ padding: 12px 8px;
288
+ font-size: 11px;
289
+ font-weight: 500;
290
+ border: none;
291
+ background: transparent;
292
+ color: var(--muted-foreground);
293
+ transition: all 0.2s ease;
294
+ }
295
+
296
+ .mobile-toolbar .section-tab.active {
297
+ background: var(--background);
298
+ color: var(--foreground);
299
+ border-bottom: 2px solid var(--primary);
300
+ }
301
+
302
+ .mobile-toolbar .toolbar-items {
303
+ display: flex;
304
+ flex-wrap: wrap;
305
+ gap: 8px;
306
+ padding: 16px;
307
+ justify-content: center;
308
+ max-height: 200px;
309
+ overflow-y: auto;
310
+ }
311
+
312
+ .mobile-toolbar .toolbar-item {
313
+ display: flex;
314
+ flex-direction: column;
315
+ align-items: center;
316
+ gap: 4px;
317
+ padding: 12px 8px;
318
+ min-width: 60px;
319
+ border-radius: 8px;
320
+ font-size: 11px;
321
+ font-weight: 500;
322
+ transition: all 0.2s ease;
323
+ background: var(--muted);
324
+ border: 1px solid var(--border);
325
+ }
326
+
327
+ .mobile-toolbar .toolbar-item.active {
328
+ background: var(--primary);
329
+ color: var(--primary-foreground);
330
+ border-color: var(--primary);
331
+ }
332
+
333
+ .mobile-toolbar .toolbar-item:active {
334
+ transform: scale(0.95);
335
+ }
336
+
337
+ /* Safe area for mobile devices */
338
+ .mobile-toolbar .safe-area {
339
+ height: env(safe-area-inset-bottom);
340
+ background: var(--background);
341
+ }
342
+
343
+ /* Responsive adjustments */
344
+ @media (max-width: 768px) {
345
+ .enhanced-floating-menu {
346
+ max-width: calc(100vw - 32px);
347
+ margin: 0 16px;
348
+ }
349
+
350
+ .focus-mode .ProseMirror,
351
+ .writing-mode .ProseMirror {
352
+ padding: 1.5rem 1rem;
353
+ font-size: 1rem;
354
+ }
355
+ }
356
+
357
+ @media (max-width: 480px) {
358
+ .enhanced-floating-menu .menu-item {
359
+ padding: 10px;
360
+ }
361
+
362
+ .enhanced-floating-menu .menu-item-icon {
363
+ width: 28px;
364
+ height: 28px;
365
+ }
366
+
367
+ .mobile-toolbar .toolbar-items {
368
+ gap: 6px;
369
+ padding: 12px;
370
+ }
371
+
372
+ .mobile-toolbar .toolbar-item {
373
+ min-width: 50px;
374
+ padding: 10px 6px;
375
+ font-size: 10px;
376
+ }
377
+ }
378
+
379
+ /* Dark mode adjustments */
380
+ @media (prefers-color-scheme: dark) {
381
+ .writing-mode {
382
+ background: #0a0a0a;
383
+ color: #f5f5f5;
384
+ }
385
+
386
+ .writing-mode .ProseMirror {
387
+ background: #0a0a0a;
388
+ color: #f5f5f5;
389
+ }
390
+
391
+ .enhanced-floating-menu {
392
+ box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
393
+ }
394
+
395
+ .mobile-toolbar {
396
+ box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.3);
397
+ }
398
+ }
399
+
400
+ /* Animation keyframes */
401
+ @keyframes fadeInUp {
402
+ from {
403
+ opacity: 0;
404
+ transform: translateY(10px);
405
+ }
406
+ to {
407
+ opacity: 1;
408
+ transform: translateY(0);
409
+ }
410
+ }
411
+
412
+ @keyframes pulse {
413
+ 0%, 100% {
414
+ opacity: 1;
415
+ }
416
+ 50% {
417
+ opacity: 0.5;
418
+ }
419
+ }
420
+
421
+ .enhanced-floating-menu {
422
+ animation: fadeInUp 0.2s ease-out;
423
+ }
424
+
425
+ .mobile-toolbar {
426
+ animation: fadeInUp 0.3s ease-out;
427
+ }
428
+
429
+ /* Accessibility improvements */
430
+ @media (prefers-reduced-motion: reduce) {
431
+ .focus-transitions *,
432
+ .enhanced-floating-menu,
433
+ .mobile-toolbar,
434
+ .toolbar-item,
435
+ .menu-item {
436
+ transition: none !important;
437
+ animation: none !important;
438
+ }
439
+ }
440
+
441
+ /* High contrast mode support */
442
+ @media (prefers-contrast: high) {
443
+ .has-focus {
444
+ outline: 2px solid currentColor;
445
+ }
446
+
447
+ .focus-ring {
448
+ border-width: 3px;
449
+ }
450
+
451
+ .enhanced-floating-menu,
452
+ .mobile-toolbar {
453
+ border-width: 2px;
454
+ }
455
+ }
456
+
457
+ /* Suppress placeholder rendering within table cells */
458
+ .ProseMirror td .is-empty::before,
459
+ .ProseMirror th .is-empty::before,
460
+ .ProseMirror td.is-empty::before,
461
+ .ProseMirror th.is-empty::before {
462
+ content: none;
463
+ display: none;
464
+ }
465
+
466
+ .ProseMirror table .is-empty::before {
467
+ content: none !important;
468
+ display: none !important;
469
+ float: none !important;
470
+ height: auto !important;
471
+ }
472
+
473
+
474
+ .ProseMirror table .is-empty {
475
+ position: static !important;
476
+ }
477
+