@prunellejs/cms 0.0.0-stage → 0.6.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.
@@ -0,0 +1,621 @@
1
+ // Shadow DOM stylesheet for @prunellejs/cms dev in-page editing overlay.
2
+ // Styled in Prunelle's own book/editorial grammar: Porcelaine paper & plum in light,
3
+ // Velours & gold in dark, rules instead of heavy boxes, nearly square 2px corners,
4
+ // underline tabs, and inverted ink/paper toasts. Ships 0 B to production pages.
5
+
6
+ export const INLINE_CMS_CSS = `/* @prunellejs/cms — Prunelle editorial grammar Shadow DOM UI */
7
+ :host {
8
+ position: fixed;
9
+ inset: 0;
10
+ z-index: 2147483640;
11
+ pointer-events: none;
12
+ color-scheme: light dark;
13
+ --cms-paper: light-dark(#f8f4ee, #130e16);
14
+ --cms-surface: light-dark(#fdfaf6, #1a1320);
15
+ --cms-surface-strong: light-dark(#efe8e1, #241b2d);
16
+ --cms-ink: light-dark(#18111d, #f8f4ee);
17
+ --cms-subtext: light-dark(#3d3045, #d6cbdf);
18
+ --cms-muted: light-dark(#5a4b63, #b5a6c2);
19
+ --cms-line: light-dark(#d9ced6, #2e2339);
20
+ --cms-line-strong: light-dark(#8e7c8c, #6e5c80);
21
+ --cms-accent: light-dark(#7a3667, #e5c068);
22
+ --cms-accent-hover: light-dark(#692857, #edd085);
23
+ --cms-accent-fill: light-dark(#18111d, #e5c068);
24
+ --cms-on-primary: light-dark(#e5c068, #130e16);
25
+ --cms-on-accent: light-dark(#f8f4ee, #130e16);
26
+ --cms-accent-soft: light-dark(rgba(122, 54, 103, 0.08), rgba(229, 192, 104, 0.11));
27
+ --cms-accent-soft-hover: light-dark(rgba(122, 54, 103, 0.15), rgba(229, 192, 104, 0.19));
28
+ --cms-ok: light-dark(#2c6b3a, #7cc79a);
29
+ --cms-ok-inv: light-dark(#7cc79a, #2c6b3a);
30
+ --cms-warning: light-dark(#9a6700, #f2a65a);
31
+ --cms-danger: light-dark(#b42318, #f58a8a);
32
+ --cms-danger-inv: light-dark(#f58a8a, #b42318);
33
+ --cms-iris: light-dark(#7a3667, #e5c068);
34
+ --cms-pupil: light-dark(#18111d, #130e16);
35
+ --cms-shadow: light-dark(0 10px 28px rgba(24, 17, 29, 0.14), 0 12px 34px rgba(0, 0, 0, 0.45));
36
+ --cms-radius: 2px;
37
+ --cms-font-display: 'Fraunces', 'Iowan Old Style', 'Palatino Linotype', 'Liberation Serif', 'DejaVu Serif', Georgia, serif;
38
+ --cms-font: 'Segoe UI Variable Text', 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'Noto Sans', sans-serif;
39
+ --cms-mono: ui-monospace, 'Cascadia Code', Menlo, Consolas, 'DejaVu Sans Mono', monospace;
40
+ font-family: var(--cms-font);
41
+ font-size: 13.5px;
42
+ line-height: 1.5;
43
+ color: var(--cms-ink);
44
+ -webkit-font-smoothing: antialiased;
45
+ }
46
+
47
+ *, *::before, *::after {
48
+ box-sizing: border-box;
49
+ }
50
+
51
+ :focus-visible {
52
+ outline: 2px solid var(--cms-accent);
53
+ outline-offset: 2px;
54
+ }
55
+
56
+ [hidden] {
57
+ display: none !important;
58
+ }
59
+
60
+ /* Highlight overlay layer for Edit-on-Page mode */
61
+ .pru-hl-layer {
62
+ position: fixed;
63
+ inset: 0;
64
+ pointer-events: none;
65
+ z-index: 1;
66
+ }
67
+
68
+ .pru-hl-box {
69
+ position: fixed;
70
+ pointer-events: auto;
71
+ border: 1.5px dashed var(--cms-accent);
72
+ border-radius: var(--cms-radius);
73
+ background: var(--cms-accent-soft);
74
+ cursor: pointer;
75
+ transition: background 140ms ease, border-color 140ms ease;
76
+ }
77
+
78
+ .pru-hl-box:hover,
79
+ .pru-hl-box:focus-visible {
80
+ border-style: solid;
81
+ background: var(--cms-accent-soft-hover);
82
+ }
83
+
84
+ .pru-hl-tag {
85
+ position: absolute;
86
+ top: -1px;
87
+ right: -1px;
88
+ display: inline-flex;
89
+ align-items: center;
90
+ padding: 0.1rem 0.48rem;
91
+ border-radius: 0 0 0 var(--cms-radius);
92
+ background: var(--cms-accent);
93
+ color: var(--cms-on-accent);
94
+ font-family: var(--cms-font);
95
+ font-size: 11px;
96
+ font-weight: 600;
97
+ letter-spacing: 0.02em;
98
+ white-space: nowrap;
99
+ }
100
+
101
+ /* Active inline text editor bar anchored beside the edited element */
102
+ .pru-inline-bar {
103
+ position: fixed;
104
+ z-index: 4;
105
+ pointer-events: auto;
106
+ display: flex;
107
+ flex-direction: column;
108
+ gap: 0.45rem;
109
+ min-width: 15.5rem;
110
+ max-width: min(26rem, calc(100vw - 1.5rem));
111
+ padding: 0.55rem 0.75rem;
112
+ border-radius: var(--cms-radius);
113
+ border: 1px solid var(--cms-ink);
114
+ background: var(--cms-paper);
115
+ color: var(--cms-ink);
116
+ box-shadow: var(--cms-shadow);
117
+ }
118
+
119
+ .pru-inline-bar-row {
120
+ display: flex;
121
+ align-items: center;
122
+ justify-content: space-between;
123
+ gap: 0.75rem;
124
+ }
125
+
126
+ .pru-inline-label {
127
+ font-family: var(--cms-font-display);
128
+ font-size: 13px;
129
+ font-weight: 500;
130
+ color: var(--cms-subtext);
131
+ }
132
+
133
+ .pru-inline-actions {
134
+ display: flex;
135
+ align-items: center;
136
+ gap: 0.4rem;
137
+ }
138
+
139
+ /* Floating bottom-right editorial toolbar */
140
+ .pru-bar {
141
+ position: fixed;
142
+ right: 1rem;
143
+ bottom: 1rem;
144
+ z-index: 3;
145
+ pointer-events: auto;
146
+ display: flex;
147
+ flex-wrap: wrap;
148
+ align-items: center;
149
+ gap: 0.5rem;
150
+ max-width: calc(100vw - 2rem);
151
+ padding: 0.42rem 0.65rem;
152
+ border-radius: var(--cms-radius);
153
+ border: 1px solid var(--cms-ink);
154
+ background: var(--cms-paper);
155
+ color: var(--cms-ink);
156
+ box-shadow: var(--cms-shadow);
157
+ }
158
+
159
+ .pru-bar[data-drawer-open="true"] {
160
+ right: calc(min(440px, 100vw) + 1rem);
161
+ }
162
+
163
+ .pru-brand {
164
+ display: inline-flex;
165
+ align-items: center;
166
+ gap: 0.42rem;
167
+ padding-right: 0.2rem;
168
+ font-family: var(--cms-font-display);
169
+ font-weight: 500;
170
+ font-size: 14.5px;
171
+ letter-spacing: -0.015em;
172
+ white-space: nowrap;
173
+ }
174
+
175
+ /* Prunelle almond eye mark */
176
+ .pru-eye {
177
+ width: 20px;
178
+ height: 20px;
179
+ flex: none;
180
+ display: inline-grid;
181
+ place-items: center;
182
+ background: var(--cms-surface-strong);
183
+ border-radius: 22%;
184
+ }
185
+
186
+ .pru-eye > i {
187
+ width: 70%;
188
+ height: 70%;
189
+ display: grid;
190
+ place-items: center;
191
+ overflow: hidden;
192
+ background: var(--cms-iris);
193
+ border-radius: 100% 0;
194
+ transform: rotate(45deg);
195
+ }
196
+
197
+ .pru-eye > i::after {
198
+ content: '';
199
+ width: 2.5px;
200
+ height: 7px;
201
+ border-radius: 50%;
202
+ background: var(--cms-pupil);
203
+ transform: rotate(-45deg);
204
+ }
205
+
206
+ .pru-dot {
207
+ width: 6px;
208
+ height: 6px;
209
+ border-radius: 50%;
210
+ background: var(--cms-accent);
211
+ flex-shrink: 0;
212
+ }
213
+
214
+ .pru-dot[data-dirty="true"] {
215
+ background: var(--cms-warning);
216
+ }
217
+
218
+ .pru-entry-select {
219
+ max-width: 14.5rem;
220
+ height: 28px;
221
+ padding: 0 0.55rem;
222
+ border-radius: var(--cms-radius);
223
+ border: 1px solid var(--cms-line-strong);
224
+ background: var(--cms-surface);
225
+ color: var(--cms-ink);
226
+ font-family: var(--cms-mono);
227
+ font-size: 11.5px;
228
+ }
229
+
230
+ .pru-entry-select:hover {
231
+ border-color: var(--cms-ink);
232
+ }
233
+
234
+ .pru-entry-badge {
235
+ display: inline-flex;
236
+ align-items: center;
237
+ gap: 0.35rem;
238
+ padding: 0.15rem 0.5rem;
239
+ border-radius: var(--cms-radius);
240
+ background: var(--cms-surface-strong);
241
+ font-family: var(--cms-mono);
242
+ font-size: 11.5px;
243
+ color: var(--cms-subtext);
244
+ max-width: 14.5rem;
245
+ overflow: hidden;
246
+ text-overflow: ellipsis;
247
+ white-space: nowrap;
248
+ }
249
+
250
+ .pru-btn {
251
+ display: inline-flex;
252
+ align-items: center;
253
+ justify-content: center;
254
+ gap: 0.35rem;
255
+ min-height: 30px;
256
+ padding: 0 11px;
257
+ border-radius: var(--cms-radius);
258
+ border: 0;
259
+ box-shadow: inset 0 0 0 1px var(--cms-line-strong);
260
+ background: transparent;
261
+ color: var(--cms-ink);
262
+ font: 500 12.5px/1 var(--cms-font);
263
+ text-decoration: none;
264
+ cursor: pointer;
265
+ white-space: nowrap;
266
+ transition: box-shadow 140ms ease, background 140ms ease, color 140ms ease;
267
+ }
268
+
269
+ .pru-btn:hover:not(:disabled) {
270
+ box-shadow: inset 0 0 0 1px var(--cms-ink);
271
+ background: var(--cms-surface-strong);
272
+ }
273
+
274
+ .pru-btn:disabled {
275
+ opacity: 0.45;
276
+ cursor: not-allowed;
277
+ }
278
+
279
+ .pru-btn-primary,
280
+ .pru-btn[aria-pressed="true"] {
281
+ background: var(--cms-accent-fill);
282
+ box-shadow: none;
283
+ color: var(--cms-on-primary);
284
+ }
285
+
286
+ .pru-btn-primary:hover:not(:disabled),
287
+ .pru-btn[aria-pressed="true"]:hover:not(:disabled) {
288
+ background: color-mix(in srgb, var(--cms-accent-fill) 86%, var(--cms-paper));
289
+ box-shadow: none;
290
+ }
291
+
292
+ .pru-btn-ghost {
293
+ box-shadow: none;
294
+ padding-inline: 3px;
295
+ text-decoration: underline 1px var(--cms-accent);
296
+ text-underline-offset: 4px;
297
+ }
298
+
299
+ .pru-btn-ghost:hover:not(:disabled) {
300
+ box-shadow: none;
301
+ background: transparent;
302
+ text-decoration-thickness: 2px;
303
+ }
304
+
305
+ .pru-btn-danger {
306
+ background: transparent;
307
+ box-shadow: inset 0 0 0 1px var(--cms-danger);
308
+ color: var(--cms-danger);
309
+ }
310
+
311
+ .pru-btn-danger:hover:not(:disabled) {
312
+ background: var(--cms-danger);
313
+ box-shadow: none;
314
+ color: var(--cms-on-accent);
315
+ }
316
+
317
+ .pru-btn-sm {
318
+ min-height: 26px;
319
+ padding: 0 9px;
320
+ font-size: 12px;
321
+ }
322
+
323
+ /* Right-docked slide-over inspector drawer (rules instead of boxes) */
324
+ .pru-drawer {
325
+ position: fixed;
326
+ top: 0;
327
+ right: 0;
328
+ bottom: 0;
329
+ width: min(440px, 100vw);
330
+ z-index: 3;
331
+ pointer-events: auto;
332
+ display: flex;
333
+ flex-direction: column;
334
+ background: var(--cms-paper);
335
+ border-left: 1px solid var(--cms-ink);
336
+ box-shadow: var(--cms-shadow);
337
+ }
338
+
339
+ .pru-drawer-head {
340
+ display: flex;
341
+ align-items: flex-start;
342
+ justify-content: space-between;
343
+ gap: 0.75rem;
344
+ padding: 1rem 1.2rem 0.85rem;
345
+ border-bottom: 1px solid var(--cms-ink);
346
+ }
347
+
348
+ .pru-drawer-title-wrap {
349
+ min-width: 0;
350
+ }
351
+
352
+ .pru-drawer-title {
353
+ margin: 0;
354
+ font-family: var(--cms-font-display);
355
+ font-size: 1.18rem;
356
+ font-weight: 500;
357
+ line-height: 1.25;
358
+ letter-spacing: -0.015em;
359
+ overflow: hidden;
360
+ text-overflow: ellipsis;
361
+ white-space: nowrap;
362
+ }
363
+
364
+ .pru-drawer-sub {
365
+ margin: 0.2rem 0 0;
366
+ font-size: 11.5px;
367
+ color: var(--cms-muted);
368
+ font-family: var(--cms-mono);
369
+ }
370
+
371
+ /* Prunelle underline tabs */
372
+ .pru-tabs {
373
+ display: flex;
374
+ gap: 1.35rem;
375
+ padding: 0 1.2rem;
376
+ border-bottom: 1px solid var(--cms-line-strong);
377
+ }
378
+
379
+ .pru-tab {
380
+ min-height: 36px;
381
+ padding: 8px 0;
382
+ margin-bottom: -1px;
383
+ border: 0;
384
+ background: transparent;
385
+ color: var(--cms-muted);
386
+ font: 500 13px/1.3 var(--cms-font);
387
+ cursor: pointer;
388
+ transition: color 140ms ease;
389
+ }
390
+
391
+ .pru-tab:hover {
392
+ color: var(--cms-ink);
393
+ }
394
+
395
+ .pru-tab[aria-selected="true"] {
396
+ color: var(--cms-ink);
397
+ box-shadow: inset 0 -2px 0 var(--cms-accent);
398
+ }
399
+
400
+ .pru-drawer-body {
401
+ flex: 1;
402
+ overflow-y: auto;
403
+ padding: 1rem 1.2rem 1.25rem;
404
+ display: flex;
405
+ flex-direction: column;
406
+ gap: 0.95rem;
407
+ }
408
+
409
+ /* Notices: a 2px rule in tone above text */
410
+ .pru-notice {
411
+ padding: 0.55rem 0 0.15rem;
412
+ border-top: 2px solid var(--cms-line-strong);
413
+ font-size: 12.5px;
414
+ color: var(--cms-subtext);
415
+ }
416
+
417
+ .pru-notice[data-tone="error"] {
418
+ border-top-color: var(--cms-danger);
419
+ color: var(--cms-danger);
420
+ }
421
+
422
+ .pru-notice[data-tone="success"] {
423
+ border-top-color: var(--cms-ok);
424
+ color: var(--cms-ok);
425
+ }
426
+
427
+ .pru-field {
428
+ display: flex;
429
+ flex-direction: column;
430
+ gap: 0.28rem;
431
+ }
432
+
433
+ .pru-field-grow {
434
+ flex: 1;
435
+ }
436
+
437
+ .pru-err-list {
438
+ margin: 0.35rem 0 0;
439
+ padding-left: 1.1rem;
440
+ }
441
+
442
+ .pru-field label {
443
+ font-size: 12.5px;
444
+ font-weight: 500;
445
+ color: var(--cms-ink);
446
+ }
447
+
448
+ .pru-req {
449
+ color: var(--cms-accent);
450
+ margin-left: 0.18rem;
451
+ }
452
+
453
+ .pru-input,
454
+ .pru-select,
455
+ .pru-textarea {
456
+ width: 100%;
457
+ min-height: 34px;
458
+ padding: 0.4rem 10px;
459
+ border-radius: var(--cms-radius);
460
+ border: 1px solid var(--cms-line-strong);
461
+ background: var(--cms-surface);
462
+ color: var(--cms-ink);
463
+ font: 400 13.5px/1.4 var(--cms-font);
464
+ transition: border-color 140ms ease, box-shadow 140ms ease;
465
+ }
466
+
467
+ .pru-input:hover,
468
+ .pru-select:hover,
469
+ .pru-textarea:hover {
470
+ border-color: var(--cms-ink);
471
+ }
472
+
473
+ .pru-input:focus,
474
+ .pru-select:focus,
475
+ .pru-textarea:focus {
476
+ outline: none;
477
+ border-color: var(--cms-accent);
478
+ box-shadow: 0 0 0 3px color-mix(in srgb, var(--cms-accent) 22%, transparent);
479
+ }
480
+
481
+ .pru-textarea {
482
+ min-height: 5.5rem;
483
+ resize: vertical;
484
+ }
485
+
486
+ .pru-md-textarea {
487
+ flex: 1;
488
+ min-height: 22rem;
489
+ font-family: var(--cms-mono);
490
+ font-size: 12.5px;
491
+ line-height: 1.6;
492
+ }
493
+
494
+ [aria-invalid="true"] {
495
+ border-color: var(--cms-danger) !important;
496
+ }
497
+
498
+ .pru-hint {
499
+ margin: 0;
500
+ font-size: 11.5px;
501
+ color: var(--cms-muted);
502
+ }
503
+
504
+ .pru-err {
505
+ margin: 0;
506
+ font-size: 12px;
507
+ font-weight: 500;
508
+ color: var(--cms-danger);
509
+ }
510
+
511
+ .pru-switch {
512
+ display: inline-flex;
513
+ align-items: center;
514
+ gap: 0.6rem;
515
+ min-height: 30px;
516
+ cursor: pointer;
517
+ font-weight: 500;
518
+ font-size: 13px;
519
+ }
520
+
521
+ .pru-switch input[type="checkbox"] {
522
+ width: 1rem;
523
+ height: 1rem;
524
+ accent-color: var(--cms-accent);
525
+ }
526
+
527
+ .pru-fieldset {
528
+ margin: 0;
529
+ padding: 0.85rem 0 0.25rem;
530
+ border: 0;
531
+ border-top: 1px solid var(--cms-ink);
532
+ display: flex;
533
+ flex-direction: column;
534
+ gap: 0.75rem;
535
+ }
536
+
537
+ .pru-fieldset > legend {
538
+ font-family: var(--cms-font-display);
539
+ font-size: 0.95rem;
540
+ font-weight: 500;
541
+ padding: 0 0.4rem 0 0;
542
+ color: var(--cms-ink);
543
+ }
544
+
545
+ .pru-row-card {
546
+ padding: 0.7rem 0.8rem;
547
+ border-radius: var(--cms-radius);
548
+ border: 1px solid var(--cms-line);
549
+ background: var(--cms-surface);
550
+ display: flex;
551
+ flex-direction: column;
552
+ gap: 0.65rem;
553
+ }
554
+
555
+ .pru-row-head {
556
+ display: flex;
557
+ align-items: center;
558
+ justify-content: space-between;
559
+ gap: 0.4rem;
560
+ padding-bottom: 0.35rem;
561
+ border-bottom: 1px solid var(--cms-line);
562
+ }
563
+
564
+ .pru-row-btns {
565
+ display: flex;
566
+ gap: 0.3rem;
567
+ }
568
+
569
+ .pru-drawer-foot {
570
+ display: flex;
571
+ flex-wrap: wrap;
572
+ align-items: center;
573
+ justify-content: space-between;
574
+ gap: 0.5rem;
575
+ padding: 0.75rem 1.2rem;
576
+ border-top: 1px solid var(--cms-line);
577
+ background: var(--cms-surface);
578
+ }
579
+
580
+ .pru-foot-actions {
581
+ display: flex;
582
+ align-items: center;
583
+ gap: 0.45rem;
584
+ }
585
+
586
+ /* Inverted ink/paper toast matching Prunelle grammar */
587
+ .pru-toast {
588
+ position: fixed;
589
+ right: 1rem;
590
+ bottom: 4.35rem;
591
+ z-index: 5;
592
+ pointer-events: auto;
593
+ padding: 0.55rem 0.95rem;
594
+ border-radius: var(--cms-radius);
595
+ background: var(--cms-ink);
596
+ color: var(--cms-paper);
597
+ box-shadow: inset 3px 0 0 var(--cms-ok-inv), var(--cms-shadow);
598
+ font-size: 12.5px;
599
+ font-weight: 500;
600
+ }
601
+
602
+ .pru-toast[data-drawer-open="true"] {
603
+ right: calc(min(440px, 100vw) + 1rem);
604
+ }
605
+
606
+ .pru-toast[data-tone="error"] {
607
+ box-shadow: inset 3px 0 0 var(--cms-danger-inv), var(--cms-shadow);
608
+ }
609
+
610
+ @media (max-width: 640px) {
611
+ .pru-bar[data-drawer-open="true"] {
612
+ display: none;
613
+ }
614
+ }
615
+
616
+ @media (prefers-reduced-motion: reduce) {
617
+ *, *::before, *::after {
618
+ transition: none !important;
619
+ }
620
+ }
621
+ `