@noirmd/previewer 2.0.1 → 2.0.3
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/dist/NReditor.cjs +1076 -96
- package/dist/NReditor.cjs.map +1 -1
- package/dist/NReditor.d.cts +3 -1
- package/dist/NReditor.d.ts +3 -1
- package/dist/NReditor.js +1076 -96
- package/dist/NReditor.js.map +1 -1
- package/dist/accordion.css +85 -0
- package/dist/carousel.css +121 -0
- package/dist/chat.css +182 -0
- package/dist/countdown.css +83 -0
- package/dist/diff.css +94 -0
- package/dist/editor.css +218 -4
- package/dist/hover3d.css +157 -0
- package/dist/hovergallery.css +110 -0
- package/dist/index.cjs +572 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +572 -4
- package/dist/index.js.map +1 -1
- package/dist/kbd.css +63 -0
- package/dist/modal.css +3 -0
- package/dist/react.cjs +964 -7
- package/dist/react.cjs.map +1 -1
- package/dist/react.d.cts +27 -1
- package/dist/react.d.ts +27 -1
- package/dist/react.js +962 -7
- package/dist/react.js.map +1 -1
- package/dist/richlist.css +110 -0
- package/dist/stat.css +107 -0
- package/dist/vanilla.cjs +572 -4
- package/dist/vanilla.cjs.map +1 -1
- package/dist/vanilla.css +11 -1
- package/dist/vanilla.js +572 -4
- package/dist/vanilla.js.map +1 -1
- package/dist/variables.css +2 -0
- package/dist/vue.cjs +572 -4
- package/dist/vue.cjs.map +1 -1
- package/dist/vue.js +572 -4
- package/dist/vue.js.map +1 -1
- package/editor.css +218 -4
- package/package.json +4 -1
package/editor.css
CHANGED
|
@@ -53,6 +53,14 @@
|
|
|
53
53
|
min-height: var(--nr-editor-min-height, 300px);
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
+
/* Split mode: the editor drives the height (its content), the preview
|
|
57
|
+
is absolute over the right half at exactly the editor's height and
|
|
58
|
+
scrolls internally when taller. */
|
|
59
|
+
.nr-editor--split {
|
|
60
|
+
flex: 0 1 auto;
|
|
61
|
+
height: auto;
|
|
62
|
+
}
|
|
63
|
+
|
|
56
64
|
/* ── Toolbar ──────────────────────────────────────────────── */
|
|
57
65
|
|
|
58
66
|
.nr-editor-toolbar {
|
|
@@ -176,6 +184,7 @@
|
|
|
176
184
|
display: flex;
|
|
177
185
|
flex: 1 1 auto;
|
|
178
186
|
min-height: 0;
|
|
187
|
+
position: relative;
|
|
179
188
|
}
|
|
180
189
|
|
|
181
190
|
.nr-editor-pane {
|
|
@@ -187,6 +196,7 @@
|
|
|
187
196
|
}
|
|
188
197
|
.nr-editor-pane--half {
|
|
189
198
|
width: 50%;
|
|
199
|
+
flex: 0 1 auto;
|
|
190
200
|
border-right: 1px solid color-mix(in srgb, var(--color-border, #334155) 30%, transparent);
|
|
191
201
|
}
|
|
192
202
|
|
|
@@ -213,14 +223,218 @@
|
|
|
213
223
|
flex: 1 1 auto;
|
|
214
224
|
min-width: 0;
|
|
215
225
|
min-height: 0;
|
|
216
|
-
overflow: auto;
|
|
217
226
|
}
|
|
218
227
|
.nr-editor-preview--half {
|
|
219
|
-
|
|
228
|
+
position: absolute;
|
|
229
|
+
top: 0;
|
|
230
|
+
bottom: 0;
|
|
231
|
+
left: 50%;
|
|
232
|
+
right: 0;
|
|
233
|
+
width: auto;
|
|
234
|
+
overflow-y: auto;
|
|
220
235
|
}
|
|
221
236
|
|
|
222
237
|
.nr-editor-prose {
|
|
223
|
-
height: 100%;
|
|
224
|
-
overflow: auto;
|
|
225
238
|
padding: 1rem;
|
|
226
239
|
}
|
|
240
|
+
|
|
241
|
+
/* ── Guide (syntax help panel) ──────────────────────────── */
|
|
242
|
+
.nr-guide {
|
|
243
|
+
position: fixed;
|
|
244
|
+
inset: 0;
|
|
245
|
+
z-index: 200;
|
|
246
|
+
display: flex;
|
|
247
|
+
align-items: center;
|
|
248
|
+
justify-content: center;
|
|
249
|
+
}
|
|
250
|
+
.nr-guide__overlay {
|
|
251
|
+
position: absolute;
|
|
252
|
+
inset: 0;
|
|
253
|
+
background: rgba(2, 6, 23, 0.6);
|
|
254
|
+
backdrop-filter: blur(2px);
|
|
255
|
+
}
|
|
256
|
+
.nr-guide__panel {
|
|
257
|
+
position: relative;
|
|
258
|
+
display: flex;
|
|
259
|
+
flex-direction: column;
|
|
260
|
+
width: min(980px, 94vw);
|
|
261
|
+
height: min(740px, 88vh);
|
|
262
|
+
background: var(--color-background-primary, #0f172a);
|
|
263
|
+
border: 1px solid var(--color-border, #334155);
|
|
264
|
+
border-radius: 14px;
|
|
265
|
+
box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
|
|
266
|
+
overflow: hidden;
|
|
267
|
+
}
|
|
268
|
+
.nr-guide__head {
|
|
269
|
+
display: flex;
|
|
270
|
+
align-items: center;
|
|
271
|
+
gap: 10px;
|
|
272
|
+
padding: 12px 16px;
|
|
273
|
+
border-bottom: 1px solid var(--color-border, #334155);
|
|
274
|
+
background: var(--color-background-secondary-solid, #1e293b);
|
|
275
|
+
}
|
|
276
|
+
.nr-guide__head h2 {
|
|
277
|
+
margin: 0;
|
|
278
|
+
font-size: 15px;
|
|
279
|
+
font-weight: 700;
|
|
280
|
+
color: var(--color-text-primary, #e2e8f0);
|
|
281
|
+
}
|
|
282
|
+
.nr-guide__head .material-icons-round {
|
|
283
|
+
color: var(--color-accent-primary, #0ea5e9);
|
|
284
|
+
font-size: 22px;
|
|
285
|
+
}
|
|
286
|
+
.nr-guide__search {
|
|
287
|
+
margin-left: auto;
|
|
288
|
+
width: 260px;
|
|
289
|
+
padding: 6px 10px;
|
|
290
|
+
border: 1px solid var(--color-border, #334155);
|
|
291
|
+
border-radius: 8px;
|
|
292
|
+
background: var(--color-background-primary, #0f172a);
|
|
293
|
+
color: var(--color-text-primary, #e2e8f0);
|
|
294
|
+
font-size: 13px;
|
|
295
|
+
font-family: inherit;
|
|
296
|
+
}
|
|
297
|
+
.nr-guide__search:focus {
|
|
298
|
+
outline: none;
|
|
299
|
+
border-color: var(--color-accent-primary, #0ea5e9);
|
|
300
|
+
}
|
|
301
|
+
.nr-guide__search::placeholder {
|
|
302
|
+
color: var(--color-text-secondary, #94a3b8);
|
|
303
|
+
}
|
|
304
|
+
.nr-guide__close {
|
|
305
|
+
border: none;
|
|
306
|
+
background: none;
|
|
307
|
+
color: var(--color-text-secondary, #94a3b8);
|
|
308
|
+
font-size: 24px;
|
|
309
|
+
line-height: 1;
|
|
310
|
+
cursor: pointer;
|
|
311
|
+
padding: 2px 8px;
|
|
312
|
+
border-radius: 6px;
|
|
313
|
+
}
|
|
314
|
+
.nr-guide__close:hover {
|
|
315
|
+
color: var(--color-text-primary, #e2e8f0);
|
|
316
|
+
background: rgba(255, 255, 255, 0.06);
|
|
317
|
+
}
|
|
318
|
+
.nr-guide__body {
|
|
319
|
+
display: flex;
|
|
320
|
+
flex: 1;
|
|
321
|
+
min-height: 0;
|
|
322
|
+
}
|
|
323
|
+
.nr-guide__nav {
|
|
324
|
+
width: 240px;
|
|
325
|
+
min-width: 240px;
|
|
326
|
+
overflow-y: auto;
|
|
327
|
+
border-right: 1px solid var(--color-border, #334155);
|
|
328
|
+
padding: 10px 8px;
|
|
329
|
+
background: color-mix(
|
|
330
|
+
in srgb,
|
|
331
|
+
var(--color-background-secondary-solid, #1e293b) 40%,
|
|
332
|
+
transparent
|
|
333
|
+
);
|
|
334
|
+
}
|
|
335
|
+
.nr-guide__cat {
|
|
336
|
+
margin-bottom: 4px;
|
|
337
|
+
}
|
|
338
|
+
.nr-guide__cat-head {
|
|
339
|
+
display: flex;
|
|
340
|
+
align-items: center;
|
|
341
|
+
gap: 4px;
|
|
342
|
+
width: 100%;
|
|
343
|
+
padding: 6px 8px;
|
|
344
|
+
border: none;
|
|
345
|
+
background: none;
|
|
346
|
+
color: var(--color-text-secondary, #94a3b8);
|
|
347
|
+
font-size: 12px;
|
|
348
|
+
font-weight: 700;
|
|
349
|
+
text-transform: uppercase;
|
|
350
|
+
letter-spacing: 0.04em;
|
|
351
|
+
cursor: pointer;
|
|
352
|
+
border-radius: 6px;
|
|
353
|
+
}
|
|
354
|
+
.nr-guide__cat-head:hover {
|
|
355
|
+
color: var(--color-text-primary, #e2e8f0);
|
|
356
|
+
}
|
|
357
|
+
.nr-guide__cat-chevron {
|
|
358
|
+
font-size: 16px;
|
|
359
|
+
transition: transform 0.15s;
|
|
360
|
+
}
|
|
361
|
+
.nr-guide__items {
|
|
362
|
+
list-style: none;
|
|
363
|
+
margin: 2px 0 8px;
|
|
364
|
+
padding: 0;
|
|
365
|
+
}
|
|
366
|
+
.nr-guide__item {
|
|
367
|
+
display: flex;
|
|
368
|
+
align-items: center;
|
|
369
|
+
gap: 8px;
|
|
370
|
+
width: 100%;
|
|
371
|
+
padding: 6px 8px 6px 24px;
|
|
372
|
+
border: none;
|
|
373
|
+
background: none;
|
|
374
|
+
color: var(--color-text-primary, #e2e8f0);
|
|
375
|
+
font-size: 13px;
|
|
376
|
+
text-align: left;
|
|
377
|
+
cursor: pointer;
|
|
378
|
+
border-radius: 6px;
|
|
379
|
+
font-family: inherit;
|
|
380
|
+
}
|
|
381
|
+
.nr-guide__item:hover {
|
|
382
|
+
background: rgba(255, 255, 255, 0.05);
|
|
383
|
+
}
|
|
384
|
+
.nr-guide__item--active {
|
|
385
|
+
background: color-mix(
|
|
386
|
+
in srgb,
|
|
387
|
+
var(--color-accent-primary, #0ea5e9) 18%,
|
|
388
|
+
transparent
|
|
389
|
+
);
|
|
390
|
+
color: var(--color-accent-primary, #0ea5e9);
|
|
391
|
+
}
|
|
392
|
+
.nr-guide__item-icon {
|
|
393
|
+
font-size: 15px;
|
|
394
|
+
opacity: 0.8;
|
|
395
|
+
}
|
|
396
|
+
.nr-guide__content {
|
|
397
|
+
flex: 1;
|
|
398
|
+
min-width: 0;
|
|
399
|
+
overflow-y: auto;
|
|
400
|
+
padding: 20px 26px;
|
|
401
|
+
}
|
|
402
|
+
.nr-guide__content > div {
|
|
403
|
+
height: 100%;
|
|
404
|
+
}
|
|
405
|
+
.nr-guide__content .nr-prose {
|
|
406
|
+
font-size: 14px;
|
|
407
|
+
}
|
|
408
|
+
.nr-guide__content h1 {
|
|
409
|
+
font-size: 1.5rem;
|
|
410
|
+
}
|
|
411
|
+
.nr-guide__content h2 {
|
|
412
|
+
font-size: 1.2rem;
|
|
413
|
+
margin-top: 1.8rem;
|
|
414
|
+
}
|
|
415
|
+
.nr-guide__empty {
|
|
416
|
+
color: var(--color-text-secondary, #94a3b8);
|
|
417
|
+
font-size: 14px;
|
|
418
|
+
padding: 40px 12px;
|
|
419
|
+
text-align: center;
|
|
420
|
+
}
|
|
421
|
+
@media (max-width: 720px) {
|
|
422
|
+
.nr-guide__nav {
|
|
423
|
+
width: 200px;
|
|
424
|
+
min-width: 200px;
|
|
425
|
+
}
|
|
426
|
+
.nr-guide__search {
|
|
427
|
+
width: 140px;
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
@media (max-width: 560px) {
|
|
431
|
+
.nr-guide__panel {
|
|
432
|
+
width: 100vw;
|
|
433
|
+
height: 100vh;
|
|
434
|
+
border-radius: 0;
|
|
435
|
+
border: none;
|
|
436
|
+
}
|
|
437
|
+
.nr-guide__nav {
|
|
438
|
+
display: none;
|
|
439
|
+
}
|
|
440
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@noirmd/previewer",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Framework-agnostic markdown renderer: one vanilla DOM engine with thin React/Vue wrappers, directives, cards, modals, and pure CSS styling",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -51,9 +51,12 @@
|
|
|
51
51
|
"editor.css"
|
|
52
52
|
],
|
|
53
53
|
"scripts": {
|
|
54
|
+
"guide:build": "node guide/build.mjs",
|
|
55
|
+
"prebuild": "node guide/build.mjs",
|
|
54
56
|
"build": "tsup",
|
|
55
57
|
"dev": "tsup --watch",
|
|
56
58
|
"typecheck": "tsc --noEmit",
|
|
59
|
+
"pretest:editor": "node guide/build.mjs",
|
|
57
60
|
"test:editor": "node test/build.mjs"
|
|
58
61
|
},
|
|
59
62
|
"keywords": [
|