rapier-markdown-kit 1.1.99 → 1.1.102
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/LICENSE +10 -2
- package/README.md +42 -8
- package/dist/kit/export-fonts.mjs +403 -0
- package/dist/kit/ledger/data.mjs +1 -1
- package/dist/kit/ledger/format.mjs +12 -5
- package/dist/kit/ledger/hash.mjs +16 -22
- package/dist/kit/ledger/history.mjs +59 -276
- package/dist/kit/ledger/inverse-source.mjs +316 -0
- package/dist/kit/ledger/journal-records.mjs +116 -12
- package/dist/kit/ledger/merge.mjs +7 -4
- package/dist/kit/ledger/transport.mjs +123 -19
- package/dist/kit/pdf-glyphs.mjs +159 -0
- package/dist/kit/pdf-vectors.mjs +204 -0
- package/dist/kit/print-capitals.mjs +85 -0
- package/dist/kit/rapier-ledger.mjs +2 -2
- package/dist/kit/render-entry.mjs +1 -0
- package/dist/kit/render-ink.mjs +132 -0
- package/dist/kit/render-markdown.mjs +71 -17
- package/dist/kit/render-print.mjs +208 -60
- package/dist/kit/render-sanitize.mjs +23 -7
- package/dist/kit/render-styles.mjs +8 -12
- package/dist/kit/render.mjs +365 -133
- package/dist/layout/model.mjs +26 -20
- package/dist/layout/typography.mjs +364 -0
- package/dist/packages/rapier-diff/LICENSE +21 -0
- package/dist/packages/rapier-diff/index.mjs +610 -0
- package/dist/spec/document-fonts.mjs +244 -0
- package/dist/spec/document-settings.mjs +494 -0
- package/dist/spec/frontmatter.mjs +30 -0
- package/dist/spec/html-blocks.mjs +143 -0
- package/dist/spec/md-assets.mjs +77 -5
- package/dist/spec/md-layout.mjs +7 -3
- package/dist/spec/md-marks.mjs +114 -8
- package/package.json +1 -1
- package/style.css +110 -52
- package/dist/agent/diff.mjs +0 -52
package/style.css
CHANGED
|
@@ -15,16 +15,20 @@
|
|
|
15
15
|
--md-font-sans:'Geist',system-ui,sans-serif;
|
|
16
16
|
--md-text-sm:calc(0.875 * var(--md-unit));
|
|
17
17
|
--md-color-text:light-dark(#121212,#fafafa);
|
|
18
|
-
--md-fw-medium:500;
|
|
19
18
|
--md-color-bg:light-dark(#ffffff,#000000);
|
|
20
19
|
--md-text-xs:calc(0.75 * var(--md-unit));
|
|
21
20
|
--md-color-inset:light-dark(#f2f1ef,#1d1d1d);
|
|
22
21
|
--md-color-surface:light-dark(#f7f6f3,#0d0d0d);
|
|
23
22
|
--md-text-base:calc(1 * var(--md-unit));
|
|
24
|
-
--md-fw-semibold:
|
|
23
|
+
--md-fw-semibold:560;
|
|
25
24
|
--md-fw-regular:400;
|
|
26
25
|
--md-text-body:calc(1.1 * var(--md-unit));
|
|
27
26
|
--md-line:calc(1.75 * var(--md-unit));
|
|
27
|
+
/* Compact gaps scale with the document body, independently of authored leading. */
|
|
28
|
+
--md-gap-paragraph:calc(var(--md-text-body) * 8 / 17.6);
|
|
29
|
+
--md-gap-heading-before:calc(var(--md-text-body) * 20 / 17.6);
|
|
30
|
+
--md-gap-heading-after:calc(var(--md-text-body) * 4 / 17.6);
|
|
31
|
+
--md-gap-block:calc(var(--md-text-body) * 12 / 17.6);
|
|
28
32
|
--md-space-6:calc(1.5 * var(--md-unit));
|
|
29
33
|
--md-space-4:calc(1 * var(--md-unit));
|
|
30
34
|
--md-space-3:calc(.75 * var(--md-unit));
|
|
@@ -56,7 +60,6 @@
|
|
|
56
60
|
--md-color-dark:var(--md-color);
|
|
57
61
|
--md-highlight-color:var(--md-color-accent);
|
|
58
62
|
--md-image-width:100%;
|
|
59
|
-
--md-drawing-width:0px;
|
|
60
63
|
--md-task-box:clamp(14px,.92em,24px);
|
|
61
64
|
--md-jump-gap:calc(.9 * var(--md-unit));
|
|
62
65
|
--md-jump-marker-inline-start:calc(-1.18 * var(--md-unit));
|
|
@@ -132,6 +135,21 @@
|
|
|
132
135
|
:where(.md-render) [data-md-align="center"]{text-align:center!important}
|
|
133
136
|
:where(.md-render) [data-md-align="right"]{text-align:right!important}
|
|
134
137
|
:where(.md-render) [data-md-align="justify"]{text-align:justify!important}
|
|
138
|
+
.md-render p[data-md-hyphens="auto"]{hyphens:auto;text-wrap:pretty}
|
|
139
|
+
.md-render p[data-md-hyphens="auto"] :is(code,kbd,samp,math){hyphens:none;text-wrap:wrap;text-justify:none}
|
|
140
|
+
.md-render [data-rapier-typography-break]::after{content:'\A';white-space:pre}
|
|
141
|
+
.md-render p[data-rapier-typography-ragged]{text-align:start!important}
|
|
142
|
+
.md-render p[data-md-lines]:not([data-rapier-typography-protected-initial])::first-letter{
|
|
143
|
+
initial-letter:var(--md-drop-lines,normal);
|
|
144
|
+
font-family:var(--md-drop-cap-font,inherit);
|
|
145
|
+
font-variant-caps:normal;
|
|
146
|
+
margin-inline-end:.12em;
|
|
147
|
+
}
|
|
148
|
+
.md-render p[data-md-caps="small"]::first-line{font-variant-caps:small-caps;font-synthesis-small-caps:none}
|
|
149
|
+
.md-render p[data-md-caps="small"] :is(code,kbd,samp,math){font-variant-caps:normal}
|
|
150
|
+
.md-render p[data-md-hanging="on"]{hanging-punctuation:first last allow-end}
|
|
151
|
+
.md-render p[data-md-hanging="on"][data-rapier-typography-protected-initial]{hanging-punctuation:last allow-end}
|
|
152
|
+
.md-render p[data-md-hanging="on"]:not([data-rapier-typography-protected-initial])::first-letter{margin-inline-start:var(--md-hang-start,0px)}
|
|
135
153
|
:where(.md-render) p[data-md-first]{--md-first:0px;text-indent:var(--md-first)}
|
|
136
154
|
.md-render :is(p,h1,h2,h3,h4,h5,h6)[data-md-indent]{--md-indent:0px;margin-inline-start:var(--md-indent)}
|
|
137
155
|
.md-render p[data-md-align="center"]>img{margin-inline:auto}
|
|
@@ -156,7 +174,7 @@
|
|
|
156
174
|
runs past the column reads as a wide table does -- it scrolls, under the same fading edge. */
|
|
157
175
|
:where(.md-render) .diagram-block {
|
|
158
176
|
position: relative;
|
|
159
|
-
margin: 0 0 var(--md-
|
|
177
|
+
margin: 0 0 var(--md-gap-block);
|
|
160
178
|
max-width: 100%;
|
|
161
179
|
overflow: auto;
|
|
162
180
|
padding-block: 0.55rem 0.85rem;
|
|
@@ -215,12 +233,10 @@
|
|
|
215
233
|
@media (prefers-reduced-motion:reduce){
|
|
216
234
|
:where(.md-render) svg.rapier-diagram[aria-roledescription^="flowchart"] :is(path,line,polyline):is(.edge-animation-fast,.edge-animation-slow){animation:none!important;stroke-dashoffset:0!important}
|
|
217
235
|
}
|
|
218
|
-
/*
|
|
236
|
+
/* Printed diagrams fit the page. */
|
|
219
237
|
@media print{
|
|
220
238
|
:where(.md-render) .diagram-block{overflow:visible!important}
|
|
221
239
|
:where(.md-render) svg.rapier-diagram,:where(.md-render) svg.rapier-native-flowchart{width:auto!important;max-width:100%!important}
|
|
222
|
-
.md-render img[data-md-drawing]{min-width:0!important}
|
|
223
|
-
.md-render :has(>img[data-md-drawing],>a>img[data-md-drawing]){overflow:visible!important}
|
|
224
240
|
}
|
|
225
241
|
:where(.md-render) .diagram-reason {
|
|
226
242
|
margin: .4em 0 0;
|
|
@@ -231,32 +247,30 @@
|
|
|
231
247
|
max-height: 9rem;
|
|
232
248
|
}
|
|
233
249
|
|
|
234
|
-
/*
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
on one and a half, h4 to h6 on one. Nothing sets a top
|
|
239
|
-
margin, so a plain page (sibling margins collapsing) and the editor (a wrapper per block) space alike, and the
|
|
240
|
-
space before any block is the line its predecessor leaves. */
|
|
250
|
+
/* Type keeps the reference line model: body 17.6/28 px at M; headings occupy two, one and a
|
|
251
|
+
half, or one body line. Compact margins use the body's size: 8 px after prose, 12 after other
|
|
252
|
+
blocks, 20 before headings and 4 after them at M. Sibling margins collapse to their maximum;
|
|
253
|
+
the editor's derived neighbor gap carries the same boundary inside its measured wrapper. */
|
|
241
254
|
.md-render{
|
|
242
255
|
font:var(--md-fw-regular) var(--md-text-body)/var(--md-line) var(--md-font-sans);color:var(--md-color-text);text-align:start}
|
|
243
256
|
.md-render>:first-child,.md-render :is(blockquote,li,td,th,dd,.callout,details)>:first-child{margin-top:0}
|
|
244
|
-
/*
|
|
257
|
+
/* The last child does not add another gap inside a compound block. */
|
|
245
258
|
.md-render :is(blockquote,td,th,dd)>:last-child{margin-bottom:0}
|
|
246
259
|
.md-render h1,.md-render h2,.md-render h3,.md-render h4,.md-render h5,.md-render h6{
|
|
247
260
|
font-family:var(--md-font-sans);letter-spacing:-0.01em;
|
|
248
|
-
line-height:var(--md-line);margin:
|
|
249
|
-
.md-render h1{font-size:calc(var(--md-text-body) * 2.6);line-height:calc(var(--md-line) * 2);font-weight:
|
|
250
|
-
.md-render h2{font-size:calc(var(--md-text-body) * 1.9);line-height:calc(var(--md-line) * 1.5);font-weight:
|
|
251
|
-
.md-render h3{font-size:calc(var(--md-text-body) * 1.5);line-height:calc(var(--md-line) * 1.5);font-weight:
|
|
252
|
-
.md-render h4{font-size:calc(var(--md-text-body) * 1.25);font-weight:
|
|
261
|
+
line-height:var(--md-line);margin:var(--md-gap-heading-before) 0 var(--md-gap-heading-after);color:var(--md-heading-color);text-wrap:balance}
|
|
262
|
+
.md-render h1{font-size:calc(var(--md-text-body) * 2.6);line-height:calc(var(--md-line) * 2);font-weight:var(--md-fw-semibold)}
|
|
263
|
+
.md-render h2{font-size:calc(var(--md-text-body) * 1.9);line-height:calc(var(--md-line) * 1.5);font-weight:var(--md-fw-semibold)}
|
|
264
|
+
.md-render h3{font-size:calc(var(--md-text-body) * 1.5);line-height:calc(var(--md-line) * 1.5);font-weight:var(--md-fw-semibold)}
|
|
265
|
+
.md-render h4{font-size:calc(var(--md-text-body) * 1.25);font-weight:var(--md-fw-semibold)}
|
|
253
266
|
/* h5/h6 complete the six-level hierarchy: modest but owned (explicit size/weight/colour), never
|
|
254
267
|
the browser default. Size stays strictly monotonic below h4; h6 sits at the body's own size and
|
|
255
268
|
firms up weight and dims colour, since its size alone would read as body text. */
|
|
256
|
-
.md-render h5{font-size:calc(var(--md-text-body) * 1.1);font-weight:
|
|
257
|
-
.md-render h6{font-size:var(--md-text-body);font-weight:
|
|
258
|
-
.md-render p{margin:0 0 var(--md-
|
|
259
|
-
.md-render
|
|
269
|
+
.md-render h5{font-size:calc(var(--md-text-body) * 1.1);font-weight:var(--md-fw-semibold)}
|
|
270
|
+
.md-render h6{font-size:var(--md-text-body);font-weight:var(--md-fw-semibold);color:var(--md-heading-muted-color)}
|
|
271
|
+
.md-render p{margin:0 0 var(--md-gap-paragraph)}
|
|
272
|
+
.md-render p[data-md-picture]{margin-bottom:var(--md-gap-block)}
|
|
273
|
+
.md-render ul,.md-render ol{margin:0 0 var(--md-gap-block);padding-inline-start:var(--md-space-5)}
|
|
260
274
|
.md-render ul{list-style:none}
|
|
261
275
|
.md-render ul>li{position:relative;--md-marker:0px}
|
|
262
276
|
|
|
@@ -336,7 +350,7 @@
|
|
|
336
350
|
.md-render ol{
|
|
337
351
|
list-style:none;
|
|
338
352
|
padding-inline-start:calc(2.75 * var(--md-unit));
|
|
339
|
-
margin:0 0 var(--md-
|
|
353
|
+
margin:0 0 var(--md-gap-block);
|
|
340
354
|
counter-reset:rapier-ol;
|
|
341
355
|
}
|
|
342
356
|
.md-render ol>li{
|
|
@@ -357,7 +371,7 @@
|
|
|
357
371
|
border-radius:999px;
|
|
358
372
|
background:var(--md-color-bg);
|
|
359
373
|
color:var(--md-color-line);
|
|
360
|
-
font:var(--md-fw-
|
|
374
|
+
font:var(--md-fw-semibold) calc(0.95 * var(--md-unit))/1 var(--md-font-sans);
|
|
361
375
|
font-variant-numeric:tabular-nums;
|
|
362
376
|
box-sizing:border-box;
|
|
363
377
|
z-index:1;
|
|
@@ -376,7 +390,7 @@
|
|
|
376
390
|
/* A heading between two parts of one numbered list (the second part's start follows the first's last number;
|
|
377
391
|
_rapierMarkListContinuations marks them): the heading stands on the margin the item text stands on, and the dotted
|
|
378
392
|
line runs on, out of the first part's last item, down the heading's own height, to the next circle. */
|
|
379
|
-
.md-render ol[data-rapier-list-continues]>li:last-child::after{bottom:calc(-1 * var(--md-
|
|
393
|
+
.md-render ol[data-rapier-list-continues]>li:last-child::after{bottom:calc(-1 * var(--md-list-heading-before,var(--md-gap-heading-before)))}
|
|
380
394
|
/* A wrapped picture set the next circle aside: the dotted line ends with this item, as at a list's last. */
|
|
381
395
|
.md-render ol>li[data-rapier-wrap-step]::after{content:none!important}
|
|
382
396
|
.md-render :is(h1,h2,h3,h4,h5,h6)[data-rapier-list-through]{position:relative;padding-inline-start:calc(2.75 * var(--md-unit))}
|
|
@@ -385,10 +399,11 @@
|
|
|
385
399
|
position:absolute;
|
|
386
400
|
inset-inline-start:calc(calc(1 * var(--md-unit)) - 1.5px);
|
|
387
401
|
top:0;
|
|
388
|
-
bottom:calc(var(--md-
|
|
402
|
+
bottom:calc(-1 * var(--md-list-heading-after,var(--md-gap-heading-after)));
|
|
389
403
|
border-inline-start:3px dotted var(--md-color-line);
|
|
390
404
|
z-index:0;
|
|
391
405
|
}
|
|
406
|
+
.md-render:not([data-md-space]):not([data-md-space] *) :is(h1,h2,h3,h4,h5,h6)[data-rapier-list-through]:has(+:is(h1,h2,h3,h4,h5,h6)){--md-list-heading-after:var(--md-gap-heading-before)}
|
|
392
407
|
.md-render li{margin:0 0 calc(var(--md-line) / 4)}
|
|
393
408
|
.md-render li:last-child{margin-bottom:0}
|
|
394
409
|
.md-render li>ul,.md-render li>ol{margin:calc(var(--md-line) / 4) 0 0}
|
|
@@ -410,7 +425,7 @@
|
|
|
410
425
|
--md-jump-marker-center:1em;
|
|
411
426
|
list-style:none;
|
|
412
427
|
padding-inline-start:calc(1.85 * var(--md-unit));
|
|
413
|
-
margin:0 0 var(--md-
|
|
428
|
+
margin:0 0 var(--md-gap-block);
|
|
414
429
|
}
|
|
415
430
|
.md-render ul.rapier-jump-list>li{
|
|
416
431
|
position:relative;
|
|
@@ -441,7 +456,7 @@
|
|
|
441
456
|
}
|
|
442
457
|
.md-render ul.rapier-jump-list>li>a{
|
|
443
458
|
color:var(--md-color-text);
|
|
444
|
-
font-weight:var(--md-fw-
|
|
459
|
+
font-weight:var(--md-fw-semibold);
|
|
445
460
|
text-decoration-line:underline;
|
|
446
461
|
text-decoration-color:color-mix(in srgb,var(--md-color-accent-text) 74%,transparent);
|
|
447
462
|
text-decoration-thickness:1px;
|
|
@@ -455,13 +470,13 @@
|
|
|
455
470
|
.md-render :not(pre)>code{line-height:1}
|
|
456
471
|
.md-render code{font-family:var(--md-font-mono);font-size:0.85em;
|
|
457
472
|
background:var(--md-color-inset);border:var(--md-hair) solid var(--md-color-border);padding:var(--md-hair) calc(5 * var(--md-hair))}
|
|
458
|
-
.md-render pre{margin:0 0 var(--md-
|
|
473
|
+
.md-render pre{margin:0 0 var(--md-gap-block);padding:var(--md-space-3) var(--md-space-4);
|
|
459
474
|
background:var(--md-color-surface-2);border:1px solid var(--md-color-border);overflow-x:auto}
|
|
460
475
|
.md-render pre code{background:none;border:none;padding:0;font-size:calc(var(--md-text-body) * 0.7386);line-height:calc(var(--md-line) * .75)}
|
|
461
476
|
.md-render .math-display-wrap{
|
|
462
477
|
display:block;
|
|
463
478
|
max-width:100%;
|
|
464
|
-
margin:0 0 var(--md-
|
|
479
|
+
margin:0 0 var(--md-gap-block);
|
|
465
480
|
overflow-x:auto;
|
|
466
481
|
overflow-y:hidden;
|
|
467
482
|
-webkit-overflow-scrolling:touch;
|
|
@@ -479,11 +494,13 @@
|
|
|
479
494
|
text-align:initial;
|
|
480
495
|
vertical-align:middle;
|
|
481
496
|
}
|
|
482
|
-
.md-render p>.math-display-wrap{margin:calc(var(--md-line) / 4) 0 var(--md-
|
|
497
|
+
.md-render p>.math-display-wrap{margin:calc(var(--md-line) / 4) 0 var(--md-gap-block)}
|
|
498
|
+
.md-render:not([data-md-space]):not([data-md-space] *) p:has(>:is(.math-display-wrap,.rapier-hscroll--math):only-child){margin-bottom:var(--md-gap-block)}
|
|
499
|
+
.md-render:not([data-md-space]):not([data-md-space] *) p>:is(.math-display-wrap,.rapier-hscroll--math):only-child{margin:0}
|
|
483
500
|
/* Diagram MathML keeps the metrics used by its renderer. */
|
|
484
501
|
.md-render math[display="block"]:not(svg *){font-size:1.12em}
|
|
485
502
|
.md-render math:not([display="block"]):not(svg *){font-size:1em}
|
|
486
|
-
.md-render blockquote{margin:0 0 var(--md-
|
|
503
|
+
.md-render blockquote{margin:0 0 var(--md-gap-block);
|
|
487
504
|
padding-block:var(--md-space-1);padding-inline-start:var(--md-space-4);padding-inline-end:0;
|
|
488
505
|
border-inline-start:calc(2 * var(--md-hair)) solid var(--md-color-border-focus);color:var(--md-color-text-secondary)}
|
|
489
506
|
.md-render blockquote blockquote{
|
|
@@ -512,14 +529,14 @@
|
|
|
512
529
|
.md-render blockquote.callout>:last-child{margin-bottom:0}
|
|
513
530
|
@media print{.md-render{--md-callout-note:#0969da;--md-callout-important:#8250df}}
|
|
514
531
|
|
|
515
|
-
.md-render details { border: var(--md-hair) solid var(--md-color-border); border-radius: 0; padding: var(--md-space-2) var(--md-space-4); margin: 0 0 var(--md-
|
|
532
|
+
.md-render details { border: var(--md-hair) solid var(--md-color-border); border-radius: 0; padding: var(--md-space-2) var(--md-space-4); margin: 0 0 var(--md-gap-block); }
|
|
516
533
|
.md-render details[open] { padding-bottom: var(--md-space-3); }
|
|
517
534
|
/* A section with nothing typed into it yet has no paragraph to tap: without this, the only body
|
|
518
535
|
space below the summary is the plain padding-bottom above (12px), too thin a margin for a real
|
|
519
536
|
touch to land in rather than snap back onto the summary control next to it -- the one-tap law
|
|
520
537
|
promises a way in, so an empty body keeps a genuine touch-target's worth of its own room. */
|
|
521
538
|
.md-render details[open]:not(:has(> :not(summary))) { padding-bottom: var(--md-space-8); }
|
|
522
|
-
.md-render summary { cursor: pointer; font-weight: var(--md-fw-
|
|
539
|
+
.md-render summary { cursor: pointer; font-weight: var(--md-fw-semibold); color: var(--md-color-text); user-select: none; padding: var(--md-space-1) 0; }
|
|
523
540
|
@media (hover:hover) and (pointer:fine){.md-render summary:hover{color:var(--md-color-accent-text)}}
|
|
524
541
|
.md-render details > *:not(summary):last-child { margin-bottom: 0; }
|
|
525
542
|
|
|
@@ -530,7 +547,7 @@
|
|
|
530
547
|
background:transparent;
|
|
531
548
|
color:var(--md-color-line);
|
|
532
549
|
opacity:1;
|
|
533
|
-
margin:var(--md-
|
|
550
|
+
margin:0 0 var(--md-gap-block);
|
|
534
551
|
overflow:visible;
|
|
535
552
|
}
|
|
536
553
|
.md-render hr[data-hr-style="dash"]{
|
|
@@ -538,7 +555,7 @@
|
|
|
538
555
|
}
|
|
539
556
|
.md-render hr[data-hr-style="stars"]{
|
|
540
557
|
height:var(--md-line);
|
|
541
|
-
margin:var(--md-
|
|
558
|
+
margin:0 0 var(--md-gap-block);
|
|
542
559
|
}
|
|
543
560
|
.md-render hr[data-hr-style="stars"]::before{
|
|
544
561
|
content:"";
|
|
@@ -567,7 +584,7 @@
|
|
|
567
584
|
height:0;
|
|
568
585
|
border:none;
|
|
569
586
|
border-top:1px dashed var(--md-color-text-muted);
|
|
570
|
-
margin:var(--md-
|
|
587
|
+
margin:0 0 var(--md-gap-block);
|
|
571
588
|
opacity:.37;
|
|
572
589
|
}
|
|
573
590
|
.md-render [data-md-break]::after{
|
|
@@ -586,7 +603,7 @@
|
|
|
586
603
|
.md-render table{
|
|
587
604
|
width:100%;
|
|
588
605
|
border-collapse:collapse;
|
|
589
|
-
margin:0 0 var(--md-
|
|
606
|
+
margin:0 0 var(--md-gap-block);
|
|
590
607
|
font-size:var(--md-text-sm);
|
|
591
608
|
border:calc(2 * var(--md-hair)) solid var(--md-color-line);
|
|
592
609
|
}
|
|
@@ -609,14 +626,14 @@
|
|
|
609
626
|
only mark a *candidate* on the block's own raw text (_rapierMarkTableCaptionCandidate); the
|
|
610
627
|
adjacent-sibling rule below settles the real "is it truly right after a table" question against
|
|
611
628
|
the live .block-wrapper DOM, reactively, with no bookkeeping kept in sync on insert/delete/reorder. */
|
|
612
|
-
|
|
613
|
-
margin-top: calc(var(--md-space-1) - var(--md-
|
|
629
|
+
.md-render p.rapier-table-caption {
|
|
630
|
+
margin-top: calc(var(--md-space-1) - var(--md-gap-block));
|
|
614
631
|
font-style: italic;
|
|
615
632
|
font-size: var(--md-text-sm);
|
|
616
633
|
color: var(--md-color-text-secondary);
|
|
617
634
|
}
|
|
618
|
-
|
|
619
|
-
margin-top: calc(var(--md-space-1) - var(--md-
|
|
635
|
+
.md-render p.rapier-figure-caption {
|
|
636
|
+
margin-top: calc(var(--md-space-1) - var(--md-gap-block));
|
|
620
637
|
font-style: italic;
|
|
621
638
|
font-size: var(--md-text-sm);
|
|
622
639
|
color: var(--md-color-text-secondary);
|
|
@@ -627,15 +644,9 @@
|
|
|
627
644
|
vertical-align:middle;
|
|
628
645
|
}
|
|
629
646
|
.md-render img[data-rapier-image-size]{width:min(var(--md-image-width),100%);height:auto}
|
|
630
|
-
/* A drawing (an SVG picture, as every Draw drawing is) shown at its own size carries that size, and shrinks to the column only
|
|
631
|
-
while its words stay legible: at 12/14 of it, Draw's default words (14 px) are 12 px, the smallest text a phone reads
|
|
632
|
-
(measured on a 390 px phone, the lane drawing-dark-wide). There it stops, and its block scrolls sideways, as a wide diagram
|
|
633
|
-
does; a drawing that fits, or shrinks less than that, is drawn as it always was. */
|
|
634
|
-
.md-render img[data-md-drawing]{min-width:calc(var(--md-drawing-width) * 12 / 14)}
|
|
635
|
-
.md-render :has(>img[data-md-drawing],>a>img[data-md-drawing]){overflow-x:auto}
|
|
636
647
|
.md-render img:is([data-rapier-asset],[data-rapier-image-url]):not([data-rapier-asset-state="ready"]){background:color-mix(in srgb,var(--md-color-text) 5%,transparent)}
|
|
637
648
|
|
|
638
|
-
.md-render dl{margin:0 0 var(--md-
|
|
649
|
+
.md-render dl{margin:0 0 var(--md-gap-block)}
|
|
639
650
|
.md-render dt{font-weight:var(--md-fw-semibold);margin:calc(var(--md-line) / 4) 0 0}
|
|
640
651
|
.md-render dt:first-child{margin-top:0}
|
|
641
652
|
.md-render dd{margin:var(--md-space-1) 0 0;padding-inline-start:var(--md-space-4);color:var(--md-color-text-secondary)}
|
|
@@ -716,7 +727,7 @@
|
|
|
716
727
|
|
|
717
728
|
/* Overflow belongs to the document; the surrounding page owns its measure and padding. */
|
|
718
729
|
/* A wide table scrolls inside its wrap; the wrap carries the block's line, so a scrollbar sits under the table, not a line below it. */
|
|
719
|
-
.md-render .table-scroll-wrap{width:100%;margin:0 0 var(--md-
|
|
730
|
+
.md-render .table-scroll-wrap{width:100%;margin:0 0 var(--md-gap-block);overflow-x:auto;-webkit-overflow-scrolling:touch;padding-bottom:2px}
|
|
720
731
|
.md-render .table-scroll-wrap table{min-width:100%;margin-bottom:0}
|
|
721
732
|
/* Single-axis overflow leaves vertical sticky positioning with the document's scroller.
|
|
722
733
|
Older engines keep the ordinary sideways wrapper; screen-only rules leave print unchanged. */
|
|
@@ -729,3 +740,50 @@
|
|
|
729
740
|
.md-render [data-md-break]{border:0!important;height:0!important;margin:0!important;break-before:page;page-break-before:always}
|
|
730
741
|
.md-render [data-md-break]::after{content:none!important}
|
|
731
742
|
}
|
|
743
|
+
|
|
744
|
+
/* Authored spacing: one body line, native collapsed gaps, and whole-line block boxes. */
|
|
745
|
+
:is(.md-render[data-md-space],[data-md-space] .md-render){
|
|
746
|
+
--md-list-heading-before:var(--md-line);
|
|
747
|
+
--md-list-heading-after:calc(var(--md-line) / 2);
|
|
748
|
+
--md-gap-paragraph:calc(var(--md-space-paragraph,.5) * var(--md-line));
|
|
749
|
+
--md-gap-heading-before:calc(var(--md-space-heading-before,1.5) * var(--md-line));
|
|
750
|
+
--md-gap-heading-after:calc(var(--md-space-heading-after,.5) * var(--md-line));
|
|
751
|
+
--md-gap-block:calc(var(--md-space-block,1) * var(--md-line));
|
|
752
|
+
}
|
|
753
|
+
:is(.md-render[data-md-space],[data-md-space] .md-render) :where(p,h1,h2,h3,h4,h5,h6,ul,ol,blockquote,pre,details,dl,figure,.diagram-block,.math-display-wrap,.table-scroll-wrap,.rapier-hscroll,.md-space-block){
|
|
754
|
+
margin-block:var(--md-gap-block);
|
|
755
|
+
height:calc-size(auto,round(up,size,var(--md-line)));
|
|
756
|
+
}
|
|
757
|
+
:is(.md-render[data-md-space],[data-md-space] .md-render) .md-space-block{display:flow-root}
|
|
758
|
+
:is(.md-render[data-md-space],[data-md-space] .md-render) p{margin-block:0 var(--md-gap-paragraph)}
|
|
759
|
+
:is(.md-render[data-md-space],[data-md-space] .md-render) :is(h1,h2,h3,h4,h5,h6){margin-block:var(--md-gap-heading-before) var(--md-gap-heading-after)}
|
|
760
|
+
:is(.md-render[data-md-space],[data-md-space] .md-render) :is(h2,h3){line-height:calc(2 * var(--md-line))}
|
|
761
|
+
:is(.md-render[data-md-space],[data-md-space] .md-render) :is(p[data-md-picture],p:has(>.math-display-wrap:only-child)){margin-block:var(--md-gap-block)}
|
|
762
|
+
:is(.md-render[data-md-space],[data-md-space] .md-render) p[data-md-picture]{line-height:0}
|
|
763
|
+
:is(.md-render[data-md-space],[data-md-space] .md-render) :is(li,dd){margin-block:0 var(--md-gap-paragraph)}
|
|
764
|
+
:is(.md-render[data-md-space],[data-md-space] .md-render) :is(li:last-child,dd:last-child){margin-block-end:0}
|
|
765
|
+
:is(.md-render[data-md-space],[data-md-space] .md-render) dt{margin-block:var(--md-gap-paragraph) 0}
|
|
766
|
+
:is(.md-render[data-md-space],[data-md-space] .md-render) blockquote{padding-block:calc(var(--md-line) / 2)}
|
|
767
|
+
:is(.md-render[data-md-space],[data-md-space] .md-render) .callout__label{margin-block:0 var(--md-gap-paragraph);height:auto}
|
|
768
|
+
:is(.md-render[data-md-space],[data-md-space] .md-render) pre{padding-block:calc(var(--md-line) / 2 - 1px);line-height:var(--md-line)}
|
|
769
|
+
:is(.md-render[data-md-space],[data-md-space] .md-render) pre code{display:block;line-height:var(--md-line)}
|
|
770
|
+
:is(.md-render[data-md-space],[data-md-space] .md-render) pre[data-rapier-code-lines]{padding-block-start:calc(var(--md-line) * 1.5 - 1px)}
|
|
771
|
+
:is(.md-render[data-md-space],[data-md-space] .md-render) details{padding-block:calc(var(--md-line) / 2 - var(--md-hair));}
|
|
772
|
+
:is(.md-render[data-md-space],[data-md-space] .md-render) summary{padding-block:0;line-height:var(--md-line)}
|
|
773
|
+
:is(.md-render[data-md-space],[data-md-space] .md-render) details[open]>summary{margin-block-end:var(--md-gap-paragraph)}
|
|
774
|
+
:is(.md-render[data-md-space],[data-md-space] .md-render) details[open]:not(:has(>:not(summary))){padding-block-end:calc(var(--md-line) * 1.5 - var(--md-hair))}
|
|
775
|
+
:is(.md-render[data-md-space],[data-md-space] .md-render) :is(th,td){line-height:var(--md-line);padding-block:calc(var(--md-line) / 2 - var(--md-hair) / 2);
|
|
776
|
+
border:0;border-inline-end:var(--md-hair) solid color-mix(in srgb,var(--md-color-line) 74%,transparent);border-block-end:var(--md-hair) solid color-mix(in srgb,var(--md-color-line) 74%,transparent)}
|
|
777
|
+
:is(.md-render[data-md-space],[data-md-space] .md-render) thead th{border-block-end:2px solid var(--md-color-line);padding-block-end:calc(var(--md-line) / 2 + var(--md-hair) / 2 - 2px)}
|
|
778
|
+
:is(.md-render[data-md-space],[data-md-space] .md-render) table{margin-block:var(--md-gap-block);border:0;border-collapse:separate;border-spacing:0;outline:calc(2 * var(--md-hair)) solid var(--md-color-line);outline-offset:calc(-2 * var(--md-hair))}
|
|
779
|
+
:is(.md-render[data-md-space],[data-md-space] .md-render) thead{outline:calc(2 * var(--md-hair)) solid var(--md-color-line);outline-offset:calc(-2 * var(--md-hair))}
|
|
780
|
+
:is(.md-render[data-md-space],[data-md-space] .md-render) :is(.table-scroll-wrap,.rapier-hscroll--table){padding-block:0}
|
|
781
|
+
:is(.md-render[data-md-space],[data-md-space] .md-render) :is(.table-scroll-wrap,.rapier-hscroll)>:is(table,pre,.math-display-wrap),
|
|
782
|
+
:is(.md-render[data-md-space],[data-md-space] .md-render) p>.math-display-wrap{margin-block:0}
|
|
783
|
+
:is(.md-render[data-md-space],[data-md-space] .md-render) hr{margin-block:var(--md-gap-block);height:var(--md-line);box-sizing:border-box}
|
|
784
|
+
:is(.md-render[data-md-space],[data-md-space] .md-render)>:first-child,
|
|
785
|
+
:is(.md-render[data-md-space],[data-md-space] .md-render) :is(blockquote,li,td,th,dd,details,.md-space-block)>:first-child{margin-block-start:0}
|
|
786
|
+
:is(.md-render[data-md-space],[data-md-space] .md-render) :is(blockquote,td,th,dd,details,.md-space-block)>:last-child{margin-block-end:0}
|
|
787
|
+
@media print{
|
|
788
|
+
:is(.md-render[data-md-space],[data-md-space] .md-render) pre[data-rapier-code-lines]{padding-block-start:calc(var(--md-line) / 2 - 1px)!important}
|
|
789
|
+
}
|
package/dist/agent/diff.mjs
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
/*! jsdiff 9.0.0 — derivative bundle. Upstream licence, reproduced complete:
|
|
2
|
-
https://github.com/kpdecker/jsdiff/blob/v9.0.0/LICENSE
|
|
3
|
-
|
|
4
|
-
BSD 3-Clause License
|
|
5
|
-
|
|
6
|
-
Copyright (c) 2009-2015, Kevin Decker <kpdecker@gmail.com>
|
|
7
|
-
All rights reserved.
|
|
8
|
-
|
|
9
|
-
Redistribution and use in source and binary forms, with or without
|
|
10
|
-
modification, are permitted provided that the following conditions are met:
|
|
11
|
-
|
|
12
|
-
1. Redistributions of source code must retain the above copyright notice, this
|
|
13
|
-
list of conditions and the following disclaimer.
|
|
14
|
-
|
|
15
|
-
2. Redistributions in binary form must reproduce the above copyright notice,
|
|
16
|
-
this list of conditions and the following disclaimer in the documentation
|
|
17
|
-
and/or other materials provided with the distribution.
|
|
18
|
-
|
|
19
|
-
3. Neither the name of the copyright holder nor the names of its
|
|
20
|
-
contributors may be used to endorse or promote products derived from
|
|
21
|
-
this software without specific prior written permission.
|
|
22
|
-
|
|
23
|
-
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
24
|
-
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
25
|
-
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
26
|
-
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
27
|
-
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
28
|
-
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
29
|
-
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
30
|
-
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
31
|
-
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
32
|
-
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
33
|
-
*/
|
|
34
|
-
/* Rapier note on this derivative bundle: the wall clock and the scheduler are injected.
|
|
35
|
-
`diffWithOptionsObj` reads `options.now()` instead of `Date.now()` and `options.schedule(fn,
|
|
36
|
-
ms)` instead of `setTimeout(fn, ms)`. Callers that want a real-time `timeout` or the async
|
|
37
|
-
callback path pass `{ now: Date.now, schedule: setTimeout }` (the Compare Worker in
|
|
38
|
-
editor/engine.js); callers that want a deterministic result bound only by `maxEditLength` pass
|
|
39
|
-
neither (the kernel), and the diff then depends on nothing but its two input strings. This keeps
|
|
40
|
-
one diff factory for the whole app and keeps agent/kernel.mjs inside the decision-purity gate
|
|
41
|
-
(tools/purity-gate.mjs) without any per-file exemption. */
|
|
42
|
-
export function createDiff(){var O=Object.defineProperty;var Y=Object.getOwnPropertyDescriptor;var B=Object.getOwnPropertyNames;var Q=Object.prototype.hasOwnProperty;var X=(i,e)=>{for(var n in e)O(i,n,{get:e[n],enumerable:!0})},Z=(i,e,n,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let l of B(e))!Q.call(i,l)&&l!==n&&O(i,l,{get:()=>e[l],enumerable:!(t=Y(e,l))||t.enumerable});return i};var K=i=>Z(O({},"__esModule",{value:!0}),i);var oe={};X(oe,{diffChars:()=>diffChars,diffLines:()=>y,diffWordsWithSpace:()=>z,structuredPatch:()=>U});var C=class{diff(e,n,t={}){let l;typeof t=="function"?(l=t,t={}):"callback"in t&&(l=t.callback);let o=this.castInput(e,t),r=this.castInput(n,t),u=this.removeEmpty(this.tokenize(o,t)),a=this.removeEmpty(this.tokenize(r,t));return this.diffWithOptionsObj(u,a,t,l)}diffWithOptionsObj(e,n,t,l){var o;let r=s=>{if(s=this.postProcess(s,t),l){t.schedule(function(){l(s)},0);return}else return s},u=n.length,a=e.length,f=1,c=u+a;t.maxEditLength!=null&&(c=Math.min(c,t.maxEditLength));let w=(o=t.timeout)!==null&&o!==void 0?o:1/0,p=(t.now?t.now():0)+w,m=[{oldPos:-1,lastComponent:void 0}],x=this.extractCommon(m[0],n,e,0,t);if(m[0].oldPos+1>=a&&x+1>=u)return r(this.buildValues(m[0].lastComponent,n,e));let v=-1/0,P=1/0,E=()=>{for(let s=Math.max(v,-f);s<=Math.min(P,f);s+=2){let d,h=m[s-1],g=m[s+1];h&&(m[s-1]=void 0);let F=!1;if(g){let q=g.oldPos-s;F=g&&0<=q&&q<u}let D=h&&h.oldPos+1<a;if(!F&&!D){m[s]=void 0;continue}if(!D||F&&h.oldPos<g.oldPos?d=this.addToPath(g,!0,!1,0,t):d=this.addToPath(h,!1,!0,1,t),x=this.extractCommon(d,n,e,s,t),d.oldPos+1>=a&&x+1>=u)return r(this.buildValues(d.lastComponent,n,e))||!0;m[s]=d,d.oldPos+1>=a&&(P=Math.min(P,s-1)),x+1>=u&&(v=Math.max(v,s+1))}f++};if(l)(function s(){t.schedule(function(){if(f>c||(t.now?t.now():0)>p)return l(void 0);E()||s()},0)})();else for(;f<=c&&(t.now?t.now():0)<=p;){let s=E();if(s)return s}}addToPath(e,n,t,l,o){let r=e.lastComponent;return r&&!o.oneChangePerToken&&r.added===n&&r.removed===t?{oldPos:e.oldPos+l,lastComponent:{count:r.count+1,added:n,removed:t,previousComponent:r.previousComponent}}:{oldPos:e.oldPos+l,lastComponent:{count:1,added:n,removed:t,previousComponent:r}}}extractCommon(e,n,t,l,o){let r=n.length,u=t.length,a=e.oldPos,f=a-l,c=0;for(;f+1<r&&a+1<u&&this.equals(t[a+1],n[f+1],o);)f++,a++,c++,o.oneChangePerToken&&(e.lastComponent={count:1,previousComponent:e.lastComponent,added:!1,removed:!1});return c&&!o.oneChangePerToken&&(e.lastComponent={count:c,previousComponent:e.lastComponent,added:!1,removed:!1}),e.oldPos=a,f}equals(e,n,t){return t.comparator?t.comparator(e,n):e===n||!!t.ignoreCase&&e.toLowerCase()===n.toLowerCase()}removeEmpty(e){let n=[];for(let t=0;t<e.length;t++)e[t]&&n.push(e[t]);return n}castInput(e,n){return e}tokenize(e,n){return Array.from(e)}join(e){return e.join("")}postProcess(e,n){return e}buildValues(e,n,t){let l=[],o;for(;e;)l.push(e),o=e.previousComponent,delete e.previousComponent,e=o;l.reverse();let r=l.length,u=0,a=0,f=0;for(;u<r;u++){let c=l[u];if(c.removed)c.value=this.join(t.slice(f,f+c.count)),f+=c.count;else{c.value=this.join(n.slice(a,a+c.count));a+=c.count,c.added||(f+=c.count)}}return l}};var I="a-zA-Z0-9_\\u{AD}\\u{C0}-\\u{D6}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}";var R=class extends C{tokenize(e){let n=new RegExp(`(\\r?\\n)|[${I}]+|[^\\S\\n\\r]+|[^${I}]`,"ug");return e.match(n)||[]}},J=new R;function z(i,e,n){return J.diff(i,e,n)}var $=class extends C{constructor(){super(...arguments),this.tokenize=ie}equals(e,n,t){return t.ignoreWhitespace?((!t.newlineIsToken||!e.includes(`
|
|
43
|
-
`))&&(e=e.trim()),(!t.newlineIsToken||!n.includes(`
|
|
44
|
-
`))&&(n=n.trim())):t.ignoreNewlineAtEof&&!t.newlineIsToken&&(e.endsWith(`
|
|
45
|
-
`)&&(e=e.slice(0,-1)),n.endsWith(`
|
|
46
|
-
`)&&(n=n.slice(0,-1))),super.equals(e,n,t)}},V=new $;function y(i,e,n){return V.diff(i,e,n)}function ie(i,e){e.stripTrailingCr&&(i=i.replace(/\r\n/g,`
|
|
47
|
-
`));let n=[],t=i.split(/(\n|\r\n)/);t[t.length-1]||t.pop();for(let l=0;l<t.length;l++){let o=t[l];l%2&&!e.newlineIsToken?n[n.length-1]+=o:n.push(o)}return n}function U(i,e,n,t,l,o,r){let u;r?typeof r=="function"?u={callback:r}:u=r:u={},typeof u.context>"u"&&(u.context=4);let a=u.context;if(u.newlineIsToken)throw new Error("newlineIsToken may not be used with patch-generation functions, only with diffing functions");if(u.callback){let{callback:c}=u;y(n,t,Object.assign(Object.assign({},u),{callback:w=>{let p=f(w);c(p)}}))}else return f(y(n,t,u));function f(c){if(!c)return;c.push({value:"",lines:[]});function w(s){return s.map(function(d){return" "+d})}let p=[],m=0,x=0,v=[],P=1,E=1;for(let s=0;s<c.length;s++){let d=c[s],h=d.lines||le(d.value);if(d.lines=h,d.added||d.removed){if(!m){let g=c[s-1];m=P,x=E,g&&(v=a>0?w(g.lines.slice(-a)):[],m-=v.length,x-=v.length)}for(let g of h)v.push((d.added?"+":"-")+g);d.added?E+=h.length:P+=h.length}else{if(m)if(h.length<=a*2&&s<c.length-2)for(let g of w(h))v.push(g);else{let g=Math.min(h.length,a);for(let D of w(h.slice(0,g)))v.push(D);let F={oldStart:m,oldLines:P-m+g,newStart:x,newLines:E-x+g,lines:v};p.push(F),m=0,x=0,v=[]}P+=h.length,E+=h.length}}for(let s of p)for(let d=0;d<s.lines.length;d++)s.lines[d].endsWith(`
|
|
48
|
-
`)?s.lines[d]=s.lines[d].slice(0,-1):(s.lines.splice(d+1,0,"\"),d++);return{oldFileName:i,newFileName:e,oldHeader:l,newHeader:o,hunks:p}}}function le(i){let e=i.endsWith(`
|
|
49
|
-
`),n=i.split(`
|
|
50
|
-
`).map(t=>t+`
|
|
51
|
-
`);return e?n.pop():n.push(n.pop().slice(0,-1)),n}function diffChars(before,after,options){return new C().diff(before,after,options)}return K(oe);}
|
|
52
|
-
export const {diffChars, diffLines, diffWordsWithSpace, structuredPatch} = createDiff();
|