@refrakt-md/runes 0.16.0 → 0.17.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/dist/config.d.ts +7 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +72 -41
- package/dist/config.js.map +1 -1
- package/dist/drawer-pipeline.d.ts +72 -1
- package/dist/drawer-pipeline.d.ts.map +1 -1
- package/dist/drawer-pipeline.js +242 -1
- package/dist/drawer-pipeline.js.map +1 -1
- package/dist/file-ref-resolve.d.ts +22 -0
- package/dist/file-ref-resolve.d.ts.map +1 -0
- package/dist/file-ref-resolve.js +233 -0
- package/dist/file-ref-resolve.js.map +1 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +36 -0
- package/dist/index.js.map +1 -1
- package/dist/nodes.d.ts.map +1 -1
- package/dist/nodes.js +62 -8
- package/dist/nodes.js.map +1 -1
- package/dist/snippet-pipeline.d.ts +7 -5
- package/dist/snippet-pipeline.d.ts.map +1 -1
- package/dist/snippet-pipeline.js +32 -13
- package/dist/snippet-pipeline.js.map +1 -1
- package/dist/tags/badge.d.ts +5 -6
- package/dist/tags/badge.d.ts.map +1 -1
- package/dist/tags/badge.js +7 -18
- package/dist/tags/badge.js.map +1 -1
- package/dist/tags/bar.d.ts +23 -0
- package/dist/tags/bar.d.ts.map +1 -0
- package/dist/tags/bar.js +64 -0
- package/dist/tags/bar.js.map +1 -0
- package/dist/tags/codegroup.d.ts.map +1 -1
- package/dist/tags/codegroup.js +41 -2
- package/dist/tags/codegroup.js.map +1 -1
- package/dist/tags/deflist.d.ts +20 -0
- package/dist/tags/deflist.d.ts.map +1 -0
- package/dist/tags/deflist.js +173 -0
- package/dist/tags/deflist.js.map +1 -0
- package/dist/tags/diff.d.ts.map +1 -1
- package/dist/tags/diff.js +85 -18
- package/dist/tags/diff.js.map +1 -1
- package/dist/tags/drawer.d.ts.map +1 -1
- package/dist/tags/drawer.js +32 -2
- package/dist/tags/drawer.js.map +1 -1
- package/dist/tags/file-ref.d.ts +21 -0
- package/dist/tags/file-ref.d.ts.map +1 -0
- package/dist/tags/file-ref.js +88 -0
- package/dist/tags/file-ref.js.map +1 -0
- package/dist/tags/snippet.d.ts.map +1 -1
- package/dist/tags/snippet.js +10 -0
- package/dist/tags/snippet.js.map +1 -1
- package/dist/tags/xref.d.ts.map +1 -1
- package/dist/tags/xref.js +9 -0
- package/dist/tags/xref.js.map +1 -1
- package/dist/xref-preview-resolve.d.ts +35 -0
- package/dist/xref-preview-resolve.d.ts.map +1 -0
- package/dist/xref-preview-resolve.js +188 -0
- package/dist/xref-preview-resolve.js.map +1 -0
- package/package.json +3 -3
package/dist/config.d.ts
CHANGED
|
@@ -57,6 +57,13 @@ export interface CorePipelineHooksOptions {
|
|
|
57
57
|
* through `aggregate` into the postProcess `coreData` shape so the xref
|
|
58
58
|
* resolver can use them as a URL-resolution fallback. */
|
|
59
59
|
xrefPatterns?: CompiledXrefPattern[];
|
|
60
|
+
/** Canonical GitHub (or compatible) repository URL — `SiteConfig.repoUrl`
|
|
61
|
+
* threaded through to the file-ref resolver (SPEC-078) so it can build
|
|
62
|
+
* deep-link source URLs of the form `{repoUrl}/blob/{ref}/{path}#L{...}`. */
|
|
63
|
+
repoUrl?: string;
|
|
64
|
+
/** Git ref appended to GitHub source URLs (branch / tag / commit SHA).
|
|
65
|
+
* Defaults to `"main"` when omitted. */
|
|
66
|
+
repoBranch?: string;
|
|
60
67
|
/** Merged Markdoc transform config (tags + nodes from core + every
|
|
61
68
|
* loaded plugin) plus the project root. Threaded through `aggregate`
|
|
62
69
|
* so the expand postProcess (SPEC-066) can re-transform embedded
|
package/dist/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAA+B,MAAM,uBAAuB,CAAC;AAEtF,OAAO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
|
8
8
|
import { resolveXrefs } from './xref-resolve.js';
|
|
9
9
|
import { preprocessSnippets, wrapStandaloneSnippets } from './snippet-pipeline.js';
|
|
10
|
-
import { registerDrawers, resolveAutoDrawerTitleLevels } from './drawer-pipeline.js';
|
|
10
|
+
import { registerDrawers, resolveAutoDrawerTitleLevels, hoistPreviewDrawers } from './drawer-pipeline.js';
|
|
11
|
+
import { resolveFileRefs } from './file-ref-resolve.js';
|
|
12
|
+
import { resolveXrefPreviews } from './xref-preview-resolve.js';
|
|
11
13
|
import { applyOutlineScopeWalkers, harvestHeadingsFromRenderable } from './outline-scope.js';
|
|
12
14
|
import { resolveExpands } from './expand-pipeline.js';
|
|
13
15
|
import { resolveCollections } from './collection-resolve.js';
|
|
@@ -120,19 +122,20 @@ export const coreConfig = {
|
|
|
120
122
|
block: 'codegroup',
|
|
121
123
|
defaultDensity: 'compact',
|
|
122
124
|
modifiers: { title: { source: 'meta', noBemClass: true }, overflow: { source: 'meta', default: 'scroll' } },
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
{ tag: 'span', ref: 'title', metaText: 'title', condition: 'title' },
|
|
131
|
-
],
|
|
132
|
-
},
|
|
125
|
+
// The window chrome (three dots) is pure decoration — drawn in CSS
|
|
126
|
+
// on `.rf-codegroup__topbar`. The only metadata is the optional
|
|
127
|
+
// filename `title`, a bare monospace field in the topbar bar.
|
|
128
|
+
// `renderWhenEmpty` lets `title=""` still project the topbar (window
|
|
129
|
+
// chrome, no filename); an absent title renders no topbar.
|
|
130
|
+
metaFields: {
|
|
131
|
+
title: { metaType: 'code', condition: 'title', renderWhenEmpty: true },
|
|
133
132
|
},
|
|
134
|
-
|
|
135
|
-
|
|
133
|
+
blocks: {
|
|
134
|
+
topbar: { fields: ['title'], layout: 'bar' },
|
|
135
|
+
},
|
|
136
|
+
layout: { root: ['topbar'] },
|
|
137
|
+
sections: { topbar: 'header' },
|
|
138
|
+
editHints: { panel: 'code' },
|
|
136
139
|
postTransform(node) {
|
|
137
140
|
// Opt in to the highlight transform's `theme.code.colorScheme`
|
|
138
141
|
// cascade so the topbar + tab chrome flip with the inner code.
|
|
@@ -158,11 +161,24 @@ export const coreConfig = {
|
|
|
158
161
|
* still needs an entry in the theme config so `computeUsedCssBlocks`
|
|
159
162
|
* includes `badge.css` in CSS tree-shaking when a badge is rendered. */
|
|
160
163
|
Badge: { block: 'badge' },
|
|
164
|
+
/* SPEC-079 composable rune handles — render the same DOM as the
|
|
165
|
+
* engine's `split` / `definition-list` layout primitives. CSS comes
|
|
166
|
+
* from the universal `[data-zone-layout=…]` selectors; per-rune
|
|
167
|
+
* blocks exist so CSS tree-shaking includes them. */
|
|
168
|
+
Bar: { block: 'bar' },
|
|
169
|
+
Deflist: { block: 'deflist' },
|
|
161
170
|
/* Collection emits a sentinel during transform; the postProcess hook
|
|
162
171
|
* (`resolveCollections`) fills it with queried entities. Engine config
|
|
163
172
|
* provides the block name for CSS tree-shaking. */
|
|
164
173
|
Collection: { block: 'collection' },
|
|
165
174
|
Relationships: { block: 'relationships' },
|
|
175
|
+
/* file-ref emits a sentinel during transform; resolveFileRefs in
|
|
176
|
+
* the postProcess chain binds it to a GitHub URL anchor (and to
|
|
177
|
+
* a hoist sentinel for the drawer pipeline when preview="drawer").
|
|
178
|
+
* Engine config entry exists so the BEM block / data-rune are
|
|
179
|
+
* registered and CSS tree-shaking includes file-ref.css when
|
|
180
|
+
* authors use the rune. */
|
|
181
|
+
FileRef: { block: 'file-ref' },
|
|
166
182
|
/* Aggregate emits a sentinel during transform; the postProcess hook
|
|
167
183
|
* (`resolveAggregates`) fills it with either a single integer (no-body
|
|
168
184
|
* form) or a body-zoned breakdown. Engine config provides the block
|
|
@@ -256,29 +272,25 @@ export const coreConfig = {
|
|
|
256
272
|
Budget: {
|
|
257
273
|
block: 'budget',
|
|
258
274
|
defaultDensity: 'full',
|
|
259
|
-
sections: {
|
|
260
|
-
editHints: { headline: 'inline'
|
|
275
|
+
sections: { preamble: 'preamble', headline: 'title', footer: 'footer' },
|
|
276
|
+
editHints: { headline: 'inline' },
|
|
261
277
|
modifiers: {
|
|
262
278
|
currency: { source: 'meta', default: 'USD' },
|
|
263
279
|
duration: { source: 'meta' },
|
|
264
280
|
showPerDay: { source: 'meta', default: 'true' },
|
|
265
281
|
variant: { source: 'meta', default: 'detailed' },
|
|
266
282
|
},
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
{ tag: 'span', ref: 'meta-item', metaText: 'duration', label: 'Duration:', condition: 'duration', metaType: 'temporal', metaRank: 'secondary' },
|
|
277
|
-
],
|
|
278
|
-
},
|
|
279
|
-
],
|
|
280
|
-
},
|
|
283
|
+
// Duration reads first as a bare chip (self-evident, no label);
|
|
284
|
+
// currency is pushed to the right edge where it reads naturally
|
|
285
|
+
// against the budget breakdown below.
|
|
286
|
+
metaFields: {
|
|
287
|
+
duration: { metaType: 'category', condition: 'duration' },
|
|
288
|
+
currency: { metaType: 'category', condition: 'currency' },
|
|
289
|
+
},
|
|
290
|
+
blocks: {
|
|
291
|
+
meta: { fields: ['duration', { field: 'currency', align: 'end' }], layout: 'bar' },
|
|
281
292
|
},
|
|
293
|
+
layout: { root: ['meta', 'preamble'] },
|
|
282
294
|
postTransform(node) {
|
|
283
295
|
const block = 'rf-budget';
|
|
284
296
|
const catBlock = 'rf-budget-category';
|
|
@@ -345,16 +357,16 @@ export const coreConfig = {
|
|
|
345
357
|
modifiers: { hintType: { source: 'meta', default: 'note' } },
|
|
346
358
|
contextModifiers: { 'hero': 'in-hero', 'feature': 'in-feature' },
|
|
347
359
|
sections: { header: 'header' },
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
},
|
|
360
|
+
// Header is a single `hintType` field, icon-decorated: the value
|
|
361
|
+
// (note/warning/caution/check) selects both the glyph and the
|
|
362
|
+
// label text.
|
|
363
|
+
metaFields: {
|
|
364
|
+
hintType: { icon: { group: 'hint' } },
|
|
365
|
+
},
|
|
366
|
+
blocks: {
|
|
367
|
+
header: { fields: ['hintType'], layout: 'bar' },
|
|
357
368
|
},
|
|
369
|
+
layout: { root: ['header'] },
|
|
358
370
|
},
|
|
359
371
|
Drawer: {
|
|
360
372
|
block: 'drawer',
|
|
@@ -364,8 +376,8 @@ export const coreConfig = {
|
|
|
364
376
|
size: { source: 'meta', default: 'md' },
|
|
365
377
|
shortcut: { source: 'meta', noBemClass: true },
|
|
366
378
|
},
|
|
367
|
-
sections: { header: 'header', body: 'body' },
|
|
368
|
-
editHints: { title: 'inline', body: 'none', close: 'none' },
|
|
379
|
+
sections: { header: 'header', body: 'body', footer: 'footer' },
|
|
380
|
+
editHints: { title: 'inline', body: 'none', close: 'none', footer: 'none' },
|
|
369
381
|
},
|
|
370
382
|
Figure: {
|
|
371
383
|
block: 'figure',
|
|
@@ -2080,6 +2092,8 @@ navSearchScope) {
|
|
|
2080
2092
|
export function createCorePipelineHooks(opts = {}) {
|
|
2081
2093
|
const xrefPatterns = opts.xrefPatterns ?? [];
|
|
2082
2094
|
const embedConfig = opts.embedConfig;
|
|
2095
|
+
const repoUrl = opts.repoUrl;
|
|
2096
|
+
const repoBranch = opts.repoBranch;
|
|
2083
2097
|
return {
|
|
2084
2098
|
preprocess: preprocessSnippets,
|
|
2085
2099
|
register(pages, registry, ctx) {
|
|
@@ -2150,7 +2164,7 @@ export function createCorePipelineHooks(opts = {}) {
|
|
|
2150
2164
|
draft: e.data.draft || false,
|
|
2151
2165
|
frontmatter: e.data,
|
|
2152
2166
|
}));
|
|
2153
|
-
return { pageTree, breadcrumbPaths, pagesByUrl, headingIndex, allPosts, registry, xrefPatterns, embedConfig };
|
|
2167
|
+
return { pageTree, breadcrumbPaths, pagesByUrl, headingIndex, allPosts, registry, xrefPatterns, embedConfig, repoUrl, repoBranch };
|
|
2154
2168
|
},
|
|
2155
2169
|
postProcess(page, aggregated, ctx) {
|
|
2156
2170
|
const coreData = aggregated['__core__'];
|
|
@@ -2171,6 +2185,23 @@ export function createCorePipelineHooks(opts = {}) {
|
|
|
2171
2185
|
// resolution so the rewritten title doesn't carry the sentinel
|
|
2172
2186
|
// attribute into the rendered HTML.
|
|
2173
2187
|
renderable = resolveAutoDrawerTitleLevels(renderable);
|
|
2188
|
+
// SPEC-078 — bind file-ref sentinels to their GitHub URLs and emit
|
|
2189
|
+
// the hoist sentinel when `preview="drawer"`. Must run before
|
|
2190
|
+
// `hoistPreviewDrawers` (which consumes the hoist sentinel) and
|
|
2191
|
+
// before xref resolution (so the file-ref's inline `<a>` carries
|
|
2192
|
+
// its final href into the rendered tree).
|
|
2193
|
+
renderable = resolveFileRefs(renderable, page.url, coreData.repoUrl, coreData.repoBranch, ctx);
|
|
2194
|
+
// SPEC-078 — rewrite xref placeholders carrying `data-xref-preview=
|
|
2195
|
+
// "drawer"` into an inline `<a href="#drawer-{id}">` + hoist
|
|
2196
|
+
// sentinel. Non-preview xref placeholders pass through to
|
|
2197
|
+
// resolveXrefs later in the chain.
|
|
2198
|
+
renderable = resolveXrefPreviews(renderable, page.url, coreData.registry, ctx);
|
|
2199
|
+
// SPEC-078 hoist mechanism — collect `preview="drawer"` sentinels
|
|
2200
|
+
// from file-ref / xref / future reference runes and emit hoisted
|
|
2201
|
+
// `<section class="rf-drawer">` at the page root. Runs before
|
|
2202
|
+
// expand resolution so an xref-preview drawer's body (which uses
|
|
2203
|
+
// the expand resolver internally) is resolved by the same pass.
|
|
2204
|
+
renderable = hoistPreviewDrawers(renderable, page.url, coreData.registry, coreData.embedConfig?.projectRoot, ctx);
|
|
2174
2205
|
// SPEC-066 expand resolution — substitutes embedded entity content
|
|
2175
2206
|
// before xref runs so refs inside substituted content are resolved
|
|
2176
2207
|
// by the same pass as host-page refs.
|