@glw907/cairn-cms 0.21.0 → 0.26.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.
Files changed (75) hide show
  1. package/CHANGELOG.md +87 -0
  2. package/README.md +50 -37
  3. package/dist/content/compose.d.ts +15 -4
  4. package/dist/content/compose.d.ts.map +1 -1
  5. package/dist/content/compose.js +9 -4
  6. package/dist/content/concepts.d.ts.map +1 -1
  7. package/dist/content/concepts.js +7 -0
  8. package/dist/content/frontmatter.d.ts +8 -0
  9. package/dist/content/frontmatter.d.ts.map +1 -1
  10. package/dist/content/frontmatter.js +19 -0
  11. package/dist/content/manifest.d.ts +20 -3
  12. package/dist/content/manifest.d.ts.map +1 -1
  13. package/dist/content/manifest.js +49 -6
  14. package/dist/content/types.d.ts +6 -0
  15. package/dist/content/types.d.ts.map +1 -1
  16. package/dist/content/validate.d.ts +4 -1
  17. package/dist/content/validate.d.ts.map +1 -1
  18. package/dist/content/validate.js +12 -2
  19. package/dist/delivery/content-index.d.ts +11 -0
  20. package/dist/delivery/content-index.d.ts.map +1 -1
  21. package/dist/delivery/content-index.js +7 -0
  22. package/dist/delivery/data.d.ts +24 -0
  23. package/dist/delivery/data.d.ts.map +1 -0
  24. package/dist/delivery/data.js +18 -0
  25. package/dist/delivery/head.d.ts +2 -0
  26. package/dist/delivery/head.d.ts.map +1 -0
  27. package/dist/delivery/head.js +4 -0
  28. package/dist/delivery/index.d.ts +1 -24
  29. package/dist/delivery/index.d.ts.map +1 -1
  30. package/dist/delivery/index.js +5 -21
  31. package/dist/index.d.ts +7 -3
  32. package/dist/index.d.ts.map +1 -1
  33. package/dist/index.js +7 -2
  34. package/dist/render/pipeline.d.ts +6 -2
  35. package/dist/render/pipeline.d.ts.map +1 -1
  36. package/dist/render/pipeline.js +5 -2
  37. package/dist/render/registry.d.ts +1 -1
  38. package/dist/render/registry.d.ts.map +1 -1
  39. package/dist/render/rehype-dispatch.d.ts +5 -0
  40. package/dist/render/rehype-dispatch.d.ts.map +1 -1
  41. package/dist/render/rehype-dispatch.js +12 -1
  42. package/dist/render/remark-directives.d.ts.map +1 -1
  43. package/dist/render/remark-directives.js +15 -6
  44. package/dist/render/sanitize-schema.d.ts +4 -3
  45. package/dist/render/sanitize-schema.d.ts.map +1 -1
  46. package/dist/render/sanitize-schema.js +6 -5
  47. package/dist/sveltekit/public-routes.d.ts +1 -0
  48. package/dist/sveltekit/public-routes.d.ts.map +1 -1
  49. package/dist/sveltekit/public-routes.js +1 -1
  50. package/dist/vite/bin.d.ts +3 -0
  51. package/dist/vite/bin.d.ts.map +1 -0
  52. package/dist/vite/bin.js +9 -0
  53. package/dist/vite/index.d.ts +33 -0
  54. package/dist/vite/index.d.ts.map +1 -0
  55. package/dist/vite/index.js +178 -0
  56. package/package.json +26 -4
  57. package/src/lib/content/compose.ts +18 -9
  58. package/src/lib/content/concepts.ts +9 -0
  59. package/src/lib/content/frontmatter.ts +21 -0
  60. package/src/lib/content/manifest.ts +63 -7
  61. package/src/lib/content/types.ts +6 -0
  62. package/src/lib/content/validate.ts +10 -2
  63. package/src/lib/delivery/content-index.ts +17 -0
  64. package/src/lib/delivery/data.ts +26 -0
  65. package/src/lib/delivery/head.ts +4 -0
  66. package/src/lib/delivery/index.ts +5 -29
  67. package/src/lib/index.ts +10 -1
  68. package/src/lib/render/pipeline.ts +11 -3
  69. package/src/lib/render/registry.ts +1 -1
  70. package/src/lib/render/rehype-dispatch.ts +12 -1
  71. package/src/lib/render/remark-directives.ts +16 -5
  72. package/src/lib/render/sanitize-schema.ts +6 -5
  73. package/src/lib/sveltekit/public-routes.ts +2 -1
  74. package/src/lib/vite/bin.ts +10 -0
  75. package/src/lib/vite/index.ts +213 -0
@@ -0,0 +1,24 @@
1
+ export { createContentIndex, fromGlob } from './content-index.js';
2
+ export type { RawFile, ContentSummary, ContentEntry, ContentIndex, ContentProblem } from './content-index.js';
3
+ export { createSiteIndex } from './site-index.js';
4
+ export type { SiteIndex, ConceptIndex } from './site-index.js';
5
+ export { createSiteIndexes } from './site-indexes.js';
6
+ export type { SiteIndexes, SiteGlobs } from './site-indexes.js';
7
+ export { siteDescriptors } from './site-descriptors.js';
8
+ export { deriveExcerpt, wordCount } from './excerpt.js';
9
+ export { buildRssFeed, buildJsonFeed } from './feeds.js';
10
+ export type { FeedChannel, FeedItem } from './feeds.js';
11
+ export { buildSitemap } from './sitemap.js';
12
+ export type { SitemapUrl } from './sitemap.js';
13
+ export { buildRobots } from './robots.js';
14
+ export { buildSeoMeta } from './seo.js';
15
+ export type { SeoInput, SeoMeta } from './seo.js';
16
+ export { readSeoFields, resolveImageUrl } from './seo-fields.js';
17
+ export type { SeoFields } from './seo-fields.js';
18
+ export { paginate } from './paginate.js';
19
+ export type { Page } from './paginate.js';
20
+ export { rssResponse, jsonFeedResponse, sitemapResponse, robotsResponse } from './responses.js';
21
+ export { jsonLdScript } from './json-ld.js';
22
+ export { permalink } from '../content/permalink.js';
23
+ export { buildSiteManifest, buildLinkResolver } from './manifest.js';
24
+ //# sourceMappingURL=data.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../src/lib/delivery/data.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,kBAAkB,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAClE,YAAY,EAAE,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAC9G,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,YAAY,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/D,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACtD,YAAY,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AACzD,YAAY,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,YAAY,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACxC,YAAY,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACjE,YAAY,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,YAAY,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChG,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC"}
@@ -0,0 +1,18 @@
1
+ // cairn-cms: the node-safe delivery data surface (@glw907/cairn-cms/delivery/data). The pure corpus
2
+ // projections a SvelteKit site or a plain-Node tool reads, with no @sveltejs/kit and no .svelte in
3
+ // the graph. The full ./delivery barrel re-exports this and adds the route loaders.
4
+ export { createContentIndex, fromGlob } from './content-index.js';
5
+ export { createSiteIndex } from './site-index.js';
6
+ export { createSiteIndexes } from './site-indexes.js';
7
+ export { siteDescriptors } from './site-descriptors.js';
8
+ export { deriveExcerpt, wordCount } from './excerpt.js';
9
+ export { buildRssFeed, buildJsonFeed } from './feeds.js';
10
+ export { buildSitemap } from './sitemap.js';
11
+ export { buildRobots } from './robots.js';
12
+ export { buildSeoMeta } from './seo.js';
13
+ export { readSeoFields, resolveImageUrl } from './seo-fields.js';
14
+ export { paginate } from './paginate.js';
15
+ export { rssResponse, jsonFeedResponse, sitemapResponse, robotsResponse } from './responses.js';
16
+ export { jsonLdScript } from './json-ld.js';
17
+ export { permalink } from '../content/permalink.js';
18
+ export { buildSiteManifest, buildLinkResolver } from './manifest.js';
@@ -0,0 +1,2 @@
1
+ export { default as CairnHead } from './CairnHead.svelte';
2
+ //# sourceMappingURL=head.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"head.d.ts","sourceRoot":"","sources":["../../src/lib/delivery/head.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,oBAAoB,CAAC"}
@@ -0,0 +1,4 @@
1
+ // cairn-cms: the delivery head component entry (@glw907/cairn-cms/delivery/head). CairnHead lives
2
+ // behind its own export so importing a delivery data helper from /delivery never pulls a .svelte
3
+ // module into the graph. A node-environment data import then needs no Svelte plugin.
4
+ export { default as CairnHead } from './CairnHead.svelte';
@@ -1,27 +1,4 @@
1
- export { createContentIndex, fromGlob } from './content-index.js';
2
- export type { RawFile, ContentSummary, ContentEntry, ContentIndex, ContentProblem } from './content-index.js';
3
- export { createSiteIndex } from './site-index.js';
4
- export type { SiteIndex, ConceptIndex } from './site-index.js';
5
- export { createSiteIndexes } from './site-indexes.js';
6
- export type { SiteIndexes, SiteGlobs } from './site-indexes.js';
7
- export { siteDescriptors } from './site-descriptors.js';
8
- export { deriveExcerpt, wordCount } from './excerpt.js';
9
- export { buildRssFeed, buildJsonFeed } from './feeds.js';
10
- export type { FeedChannel, FeedItem } from './feeds.js';
11
- export { buildSitemap } from './sitemap.js';
12
- export type { SitemapUrl } from './sitemap.js';
13
- export { buildRobots } from './robots.js';
14
- export { buildSeoMeta } from './seo.js';
15
- export type { SeoInput, SeoMeta } from './seo.js';
16
- export { readSeoFields, resolveImageUrl } from './seo-fields.js';
17
- export type { SeoFields } from './seo-fields.js';
18
- export { paginate } from './paginate.js';
19
- export type { Page } from './paginate.js';
20
- export { rssResponse, jsonFeedResponse, sitemapResponse, robotsResponse } from './responses.js';
21
- export { jsonLdScript } from './json-ld.js';
22
- export { permalink } from '../content/permalink.js';
23
- export { buildSiteManifest, buildLinkResolver } from './manifest.js';
1
+ export * from './data.js';
24
2
  export { createPublicRoutes } from '../sveltekit/public-routes.js';
25
3
  export type { PublicRoutesDeps, ListData, TagData, TagIndexData, EntryData, } from '../sveltekit/public-routes.js';
26
- export { default as CairnHead } from './CairnHead.svelte';
27
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lib/delivery/index.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,kBAAkB,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAClE,YAAY,EAAE,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAC9G,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,YAAY,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/D,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACtD,YAAY,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AACzD,YAAY,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,YAAY,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACxC,YAAY,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACjE,YAAY,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,YAAY,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChG,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AACrE,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AACnE,YAAY,EACV,gBAAgB,EAChB,QAAQ,EACR,OAAO,EACP,YAAY,EACZ,SAAS,GACV,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,oBAAoB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lib/delivery/index.ts"],"names":[],"mappings":"AAIA,cAAc,WAAW,CAAC;AAC1B,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AACnE,YAAY,EACV,gBAAgB,EAChB,QAAQ,EACR,OAAO,EACP,YAAY,EACZ,SAAS,GACV,MAAM,+BAA+B,CAAC"}
@@ -1,22 +1,6 @@
1
- // cairn-cms: the public delivery entry (@glw907/cairn-cms/delivery). The complete, canonical,
2
- // backend-free toolkit a SvelteKit site wires its public pages with: the content index and the
3
- // site resolver, the descriptor helper, the syndication and SEO builders, the endpoint response
4
- // helpers, the catch-all route loaders, and the head component. It imports nothing from auth,
5
- // github, or email, so importing it does not pull the server backend into a public bundle.
6
- export { createContentIndex, fromGlob } from './content-index.js';
7
- export { createSiteIndex } from './site-index.js';
8
- export { createSiteIndexes } from './site-indexes.js';
9
- export { siteDescriptors } from './site-descriptors.js';
10
- export { deriveExcerpt, wordCount } from './excerpt.js';
11
- export { buildRssFeed, buildJsonFeed } from './feeds.js';
12
- export { buildSitemap } from './sitemap.js';
13
- export { buildRobots } from './robots.js';
14
- export { buildSeoMeta } from './seo.js';
15
- export { readSeoFields, resolveImageUrl } from './seo-fields.js';
16
- export { paginate } from './paginate.js';
17
- export { rssResponse, jsonFeedResponse, sitemapResponse, robotsResponse } from './responses.js';
18
- export { jsonLdScript } from './json-ld.js';
19
- export { permalink } from '../content/permalink.js';
20
- export { buildSiteManifest, buildLinkResolver } from './manifest.js';
1
+ // cairn-cms: the public delivery entry (@glw907/cairn-cms/delivery). The node-safe data surface
2
+ // (re-exported from ./delivery/data) plus the SvelteKit catch-all route loaders. The head component
3
+ // lives at ./delivery/head. Importing this pulls @sveltejs/kit through the route loaders, so a
4
+ // plain-Node tool imports from ./delivery/data instead.
5
+ export * from './data.js';
21
6
  export { createPublicRoutes } from '../sveltekit/public-routes.js';
22
- export { default as CairnHead } from './CairnHead.svelte';
package/dist/index.d.ts CHANGED
@@ -5,6 +5,7 @@ export { buildMagicLinkMessage, cloudflareSend } from './email.js';
5
5
  export type { CairnAdapter, ConceptConfig, FrontmatterField, TextField, TextareaField, DateField, BooleanField, TagsField, FreeTagsField, ValidationResult, BackendConfig, SenderConfig, NavMenuConfig, AssetConfig, RoutingRule, ConceptDescriptor, ConceptUrlPolicy, CairnExtension, CairnRuntime, AdminPanel, FieldTypeDef, } from './content/types.js';
6
6
  export { CONCEPT_ROUTING, normalizeConcepts, findConcept } from './content/concepts.js';
7
7
  export { composeRuntime } from './content/compose.js';
8
+ export type { ComposeInput } from './content/compose.js';
8
9
  export { frontmatterFromForm, dateInputValue, serializeMarkdown, parseMarkdown, } from './content/frontmatter.js';
9
10
  export { defineFields } from './content/schema.js';
10
11
  export { defineAdapter } from './content/adapter.js';
@@ -13,8 +14,8 @@ export { isValidId, idFromFilename, filenameFromId, slugify, slugFromId, compose
13
14
  export type { DatePrefix } from './content/ids.js';
14
15
  export { parseCairnToken, extractCairnLinks, formatCairnToken, escapeLinkText } from './content/links.js';
15
16
  export type { CairnRef, LinkResolve } from './content/links.js';
16
- export { serializeManifest, parseManifest, emptyManifest, verifyManifest, upsertEntry, removeEntry, manifestEntryFromFile, manifestLinkResolver, inboundLinks, } from './content/manifest.js';
17
- export type { Manifest, ManifestEntry, LinkTarget, InboundLink } from './content/manifest.js';
17
+ export { serializeManifest, parseManifest, emptyManifest, verifyManifest, diffManifests, upsertEntry, removeEntry, manifestEntryFromFile, manifestLinkResolver, inboundLinks, } from './content/manifest.js';
18
+ export type { Manifest, ManifestEntry, ManifestDiff, ManifestEntryDiff, LinkTarget, InboundLink } from './content/manifest.js';
18
19
  export { defineRegistry, emptyValues } from './render/registry.js';
19
20
  export type { ComponentDef, ComponentRegistry, FieldType, AttributeField, SlotKind, SlotDef, ComponentValues, } from './render/registry.js';
20
21
  export { serializeComponent, parseComponent } from './render/component-grammar.js';
@@ -26,7 +27,7 @@ export type { ReferenceOptions } from './render/component-reference.js';
26
27
  export { glyph } from './render/glyph.js';
27
28
  export type { IconSet } from './render/glyph.js';
28
29
  export { remarkDirectiveStamp } from './render/remark-directives.js';
29
- export { rehypeDispatch, isElement, strProp, iconSpan, cardShell, markFirstList, } from './render/rehype-dispatch.js';
30
+ export { rehypeDispatch, isElement, strProp, iconSpan, cardShell, headRow, markFirstList, } from './render/rehype-dispatch.js';
30
31
  export type { MakeIcon } from './render/rehype-dispatch.js';
31
32
  export { createRenderer } from './render/pipeline.js';
32
33
  export type { RendererOptions } from './render/pipeline.js';
@@ -57,4 +58,7 @@ export { readSeoFields, resolveImageUrl } from './delivery/seo-fields.js';
57
58
  export type { SeoFields } from './delivery/seo-fields.js';
58
59
  export { paginate } from './delivery/paginate.js';
59
60
  export type { Page } from './delivery/paginate.js';
61
+ export { rssResponse, jsonFeedResponse, sitemapResponse, robotsResponse } from './delivery/responses.js';
62
+ export { createPublicRoutes } from './sveltekit/public-routes.js';
63
+ export type { PublicRoutesDeps, ListData, TagData, TagIndexData, EntryData } from './sveltekit/public-routes.js';
60
64
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/lib/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,YAAY,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC7D,YAAY,EAAE,YAAY,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAChF,OAAO,EAAE,qBAAqB,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAGnE,YAAY,EACV,YAAY,EACZ,aAAa,EACb,gBAAgB,EAChB,SAAS,EACT,aAAa,EACb,SAAS,EACT,YAAY,EACZ,SAAS,EACT,aAAa,EACb,gBAAgB,EAChB,aAAa,EACb,YAAY,EACZ,aAAa,EACb,WAAW,EACX,WAAW,EACX,iBAAiB,EACjB,gBAAgB,EAChB,cAAc,EACd,YAAY,EACZ,UAAU,EACV,YAAY,GACb,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACxF,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EACL,mBAAmB,EACnB,cAAc,EACd,iBAAiB,EACjB,aAAa,GACd,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,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,uBAAuB,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,YAAY,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC1E,YAAY,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,YAAY,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAInD,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzG,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAClE,YAAY,EAAE,gBAAgB,EAAE,QAAQ,EAAE,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC"}
package/dist/index.js CHANGED
@@ -12,7 +12,7 @@ export { isValidId, idFromFilename, filenameFromId, slugify, slugFromId, compose
12
12
  // builder and the request-time resolver ship from the delivery entry; this surface is the
13
13
  // grammar, the manifest operations, and their types a migrating site adopts.
14
14
  export { parseCairnToken, extractCairnLinks, formatCairnToken, escapeLinkText } from './content/links.js';
15
- export { serializeManifest, parseManifest, emptyManifest, verifyManifest, upsertEntry, removeEntry, manifestEntryFromFile, manifestLinkResolver, inboundLinks, } from './content/manifest.js';
15
+ export { serializeManifest, parseManifest, emptyManifest, verifyManifest, diffManifests, upsertEntry, removeEntry, manifestEntryFromFile, manifestLinkResolver, inboundLinks, } from './content/manifest.js';
16
16
  // Render engine (Plan 04): generic directive pipeline; sites own the component registry.
17
17
  export { defineRegistry, emptyValues } from './render/registry.js';
18
18
  export { serializeComponent, parseComponent } from './render/component-grammar.js';
@@ -21,7 +21,7 @@ export { buildComponentInsert } from './render/component-insert.js';
21
21
  export { generateComponentReference } from './render/component-reference.js';
22
22
  export { glyph } from './render/glyph.js';
23
23
  export { remarkDirectiveStamp } from './render/remark-directives.js';
24
- export { rehypeDispatch, isElement, strProp, iconSpan, cardShell, markFirstList, } from './render/rehype-dispatch.js';
24
+ export { rehypeDispatch, isElement, strProp, iconSpan, cardShell, headRow, markFirstList, } from './render/rehype-dispatch.js';
25
25
  export { createRenderer } from './render/pipeline.js';
26
26
  export { CommitConflictError } from './github/types.js';
27
27
  export { appJwt, installationToken, signingSelfTest } from './github/signing.js';
@@ -43,3 +43,8 @@ export { buildRobots } from './delivery/robots.js';
43
43
  export { buildSeoMeta } from './delivery/seo.js';
44
44
  export { readSeoFields, resolveImageUrl } from './delivery/seo-fields.js';
45
45
  export { paginate } from './delivery/paginate.js';
46
+ // Root superset of the delivery route surface: a wrong guess from root for a route loader or a
47
+ // response helper now resolves. The CairnHead component stays out of root so the root barrel stays
48
+ // node-importable for the unit suite; it resolves from @glw907/cairn-cms/delivery/head.
49
+ export { rssResponse, jsonFeedResponse, sitemapResponse, robotsResponse } from './delivery/responses.js';
50
+ export { createPublicRoutes } from './sveltekit/public-routes.js';
@@ -1,6 +1,6 @@
1
1
  import { type PluggableList } from 'unified';
2
2
  import type { Schema } from 'hast-util-sanitize';
3
- import type { ComponentRegistry } from './registry.js';
3
+ import { type ComponentRegistry } from './registry.js';
4
4
  import type { LinkResolve } from '../content/links.js';
5
5
  export interface RendererOptions {
6
6
  /** Stamp a `data-rise` ordinal (0, 1, 2, …) on each top-level component so a site's
@@ -16,11 +16,15 @@ export interface RendererOptions {
16
16
  * vector the floor closes, so it is only for a site whose content is fully developer-controlled.
17
17
  * It is a code-level adapter decision, never an editor-facing setting. */
18
18
  unsafeDisableSanitize?: boolean;
19
+ /** The `rel` value forced on every `target="_blank"` anchor, applied last so it also covers
20
+ * component-built anchors. Defaults to `'noopener noreferrer'`. Set a different string to change
21
+ * it, or `false` to disable the injection (a site that owns its own anchor hardening). */
22
+ anchorRel?: string | false;
19
23
  }
20
24
  /** Compose a site's render pipeline from its component registry: directive syntax to
21
25
  * stamped markers to registry-built hast. Returns `renderMarkdown` plus the remark/
22
26
  * rehype plugin arrays (so the admin editor preview can reuse the exact same set). */
23
- export declare function createRenderer(registry: ComponentRegistry, options?: RendererOptions): {
27
+ export declare function createRenderer(registry?: ComponentRegistry, options?: RendererOptions): {
24
28
  remarkPlugins: PluggableList;
25
29
  rehypePlugins: PluggableList;
26
30
  renderMarkdown: (content: string, opts?: {
@@ -1 +1 @@
1
- {"version":3,"file":"pipeline.d.ts","sourceRoot":"","sources":["../../src/lib/render/pipeline.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,KAAK,aAAa,EAAE,MAAM,SAAS,CAAC;AAStD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAMjD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEvD,MAAM,WAAW,eAAe;IAC9B;;0FAEsF;IACtF,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;wCAGoC;IACpC,cAAc,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,MAAM,CAAC;IAC9C;;+EAE2E;IAC3E,qBAAqB,CAAC,EAAE,OAAO,CAAC;CACjC;AAED;;uFAEuF;AACvF,wBAAgB,cAAc,CAAC,QAAQ,EAAE,iBAAiB,EAAE,OAAO,GAAE,eAAoB;;;8BAyBrD,MAAM,SAAQ;QAAE,OAAO,CAAC,EAAE,WAAW,CAAA;KAAE,KAAQ,OAAO,CAAC,MAAM,CAAC;EAKjG"}
1
+ {"version":3,"file":"pipeline.d.ts","sourceRoot":"","sources":["../../src/lib/render/pipeline.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,KAAK,aAAa,EAAE,MAAM,SAAS,CAAC;AAStD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAMjD,OAAO,EAAkB,KAAK,iBAAiB,EAAE,MAAM,eAAe,CAAC;AACvE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEvD,MAAM,WAAW,eAAe;IAC9B;;0FAEsF;IACtF,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;wCAGoC;IACpC,cAAc,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,MAAM,CAAC;IAC9C;;+EAE2E;IAC3E,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC;;+FAE2F;IAC3F,SAAS,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC;CAC5B;AAED;;uFAEuF;AACvF,wBAAgB,cAAc,CAC5B,QAAQ,GAAE,iBAAsD,EAChE,OAAO,GAAE,eAAoB;;;8BA2BK,MAAM,SAAQ;QAAE,OAAO,CAAC,EAAE,WAAW,CAAA;KAAE,KAAQ,OAAO,CAAC,MAAM,CAAC;EAKjG"}
@@ -12,10 +12,11 @@ import { buildSanitizeSchema, rehypeAnchorRel } from './sanitize-schema.js';
12
12
  import { remarkDirectiveStamp } from './remark-directives.js';
13
13
  import { remarkResolveCairnLinks, CAIRN_RESOLVE } from './resolve-links.js';
14
14
  import { rehypeDispatch } from './rehype-dispatch.js';
15
+ import { defineRegistry } from './registry.js';
15
16
  /** Compose a site's render pipeline from its component registry: directive syntax to
16
17
  * stamped markers to registry-built hast. Returns `renderMarkdown` plus the remark/
17
18
  * rehype plugin arrays (so the admin editor preview can reuse the exact same set). */
18
- export function createRenderer(registry, options = {}) {
19
+ export function createRenderer(registry = defineRegistry({ components: [] }), options = {}) {
19
20
  const remarkPlugins = [remarkDirective, [remarkDirectiveStamp, registry], remarkResolveCairnLinks];
20
21
  // The sanitize floor runs after rehype-raw (so author raw HTML is parsed, then cleaned) and
21
22
  // before the dispatch (so the site's trusted build() output and its inline SVG icons are never
@@ -23,13 +24,15 @@ export function createRenderer(registry, options = {}) {
23
24
  const floor = options.unsafeDisableSanitize
24
25
  ? []
25
26
  : [[rehypeSanitize, buildSanitizeSchema(registry, options.sanitizeSchema)]];
27
+ const rel = options.anchorRel ?? 'noopener noreferrer';
26
28
  const rehypePlugins = [
27
29
  rehypeRaw,
28
30
  ...floor,
29
31
  [rehypeDispatch, registry, options.stagger],
30
32
  rehypeSlug,
31
- rehypeAnchorRel,
32
33
  ];
34
+ if (rel !== false)
35
+ rehypePlugins.push([rehypeAnchorRel, rel]);
33
36
  const processor = unified()
34
37
  .use(remarkParse)
35
38
  .use(remarkGfm)
@@ -12,7 +12,7 @@ export interface AttributeField {
12
12
  /** Initial value; a string for text/select/icon, a boolean for boolean. */
13
13
  default?: string | boolean;
14
14
  /** Allowed values for `type: 'select'`. */
15
- options?: string[];
15
+ options?: readonly string[];
16
16
  /** Helper text shown under the field. */
17
17
  help?: string;
18
18
  }
@@ -1 +1 @@
1
- {"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/lib/render/registry.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,MAAM,CAAC;AAEpD,+EAA+E;AAC/E,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,QAAQ,GAAG,MAAM,GAAG,SAAS,CAAC;AAE/D,iGAAiG;AACjG,MAAM,WAAW,cAAc;IAC7B,sEAAsE;IACtE,GAAG,EAAE,MAAM,CAAC;IACZ,sBAAsB;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,SAAS,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,2EAA2E;IAC3E,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAC3B,2CAA2C;IAC3C,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,yCAAyC;IACzC,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,MAAM,QAAQ,GAAG,UAAU,GAAG,QAAQ,GAAG,YAAY,CAAC;AAE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C9B,wDAAwD;IACxD,KAAK,CAAC,EAAE,OAAO,EAAE,CAAC;CACnB;AAED,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,YAAY,EAAE,CAAC;IACrB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,YAAY,GAAG,SAAS,CAAC;IAC5C,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;CAC9D;AAED;;4FAE4F;AAC5F,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAEhD;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,EAAE,UAAU,EAAE,EAAE;IAAE,UAAU,EAAE,YAAY,EAAE,CAAA;CAAE,GAAG,iBAAiB,CAQhG;AAED;uEACuE;AACvE,MAAM,WAAW,eAAe;IAC9B,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC;IAC7C,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC,CAAC;CAC1C;AAED;+DAC+D;AAC/D,wBAAgB,WAAW,CAAC,GAAG,EAAE,YAAY,GAAG,eAAe,CAU9D"}
@@ -8,6 +8,11 @@ export declare function iconSpan(glyphEl: Element, role?: string): Element;
8
8
  export type MakeIcon = (name: string, role?: string) => Element;
9
9
  /** Section wrapper: `<section class=…><div class="card-body">…</div></section>`. */
10
10
  export declare function cardShell(classes: string[], body: ElementContent[]): Element;
11
+ /** Card head row: `<div class="ec-head">[icon]<h2 class="card-title">{title}</h2></div>`.
12
+ * Pass the title's inline children and an optional pre-built icon element, the way `cardShell`
13
+ * takes already-built body content. This factors the icon-plus-heading head that a titled
14
+ * component build would otherwise rebuild by hand (the shape the removed `splitHead` produced). */
15
+ export declare function headRow(title: ElementContent[], icon?: Element): Element;
11
16
  /** Tag the first <ul> among children with `ec-grid` and strip its whitespace-only
12
17
  * text nodes so the bare list serializes without newlines. Returns that <ul>. */
13
18
  export declare function markFirstList(children: ElementContent[]): Element | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"rehype-dispatch.d.ts","sourceRoot":"","sources":["../../src/lib/render/rehype-dispatch.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,MAAM,CAAC;AAE1D,OAAO,EAA0D,KAAK,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAE/G,wBAAgB,SAAS,CAAC,IAAI,EAAE,cAAc,GAAG,SAAS,GAAG,IAAI,IAAI,OAAO,CAE3E;AAKD,wBAAgB,OAAO,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAGvE;AAED,mFAAmF;AACnF,wBAAgB,QAAQ,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAGjE;AAED,kFAAkF;AAClF,MAAM,MAAM,QAAQ,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC;AAEhE,oFAAoF;AACpF,wBAAgB,SAAS,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,cAAc,EAAE,GAAG,OAAO,CAE5E;AAED;kFACkF;AAClF,wBAAgB,aAAa,CAAC,QAAQ,EAAE,cAAc,EAAE,GAAG,OAAO,GAAG,SAAS,CAS7E;AAqFD;;;;;mFAKmF;AACnF,wBAAgB,cAAc,CAAC,QAAQ,EAAE,iBAAiB,EAAE,OAAO,CAAC,EAAE,OAAO,IACnE,MAAM,IAAI,UAYnB"}
1
+ {"version":3,"file":"rehype-dispatch.d.ts","sourceRoot":"","sources":["../../src/lib/render/rehype-dispatch.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,MAAM,CAAC;AAE1D,OAAO,EAA0D,KAAK,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAE/G,wBAAgB,SAAS,CAAC,IAAI,EAAE,cAAc,GAAG,SAAS,GAAG,IAAI,IAAI,OAAO,CAE3E;AAKD,wBAAgB,OAAO,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAGvE;AAED,mFAAmF;AACnF,wBAAgB,QAAQ,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAGjE;AAED,kFAAkF;AAClF,MAAM,MAAM,QAAQ,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC;AAEhE,oFAAoF;AACpF,wBAAgB,SAAS,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,cAAc,EAAE,GAAG,OAAO,CAE5E;AAED;;;oGAGoG;AACpG,wBAAgB,OAAO,CAAC,KAAK,EAAE,cAAc,EAAE,EAAE,IAAI,CAAC,EAAE,OAAO,GAAG,OAAO,CAKxE;AAED;kFACkF;AAClF,wBAAgB,aAAa,CAAC,QAAQ,EAAE,cAAc,EAAE,GAAG,OAAO,GAAG,SAAS,CAS7E;AAqFD;;;;;mFAKmF;AACnF,wBAAgB,cAAc,CAAC,QAAQ,EAAE,iBAAiB,EAAE,OAAO,CAAC,EAAE,OAAO,IACnE,MAAM,IAAI,UAYnB"}
@@ -4,7 +4,7 @@ export function isElement(node) {
4
4
  return !!node && node.type === 'element';
5
5
  }
6
6
  // hast Properties values are PropertyValue (string | number | boolean | array | null).
7
- // Directive markers (dataIcon/dataRole/dataPrimitive) are always stamped as strings;
7
+ // Directive markers (dataPrimitive/dataRole/dataAttr<Key>) are always stamped as strings;
8
8
  // this reads them back with that guarantee instead of casting at each call site.
9
9
  export function strProp(node, name) {
10
10
  const value = node.properties?.[name];
@@ -19,6 +19,17 @@ export function iconSpan(glyphEl, role) {
19
19
  export function cardShell(classes, body) {
20
20
  return h('section', { className: classes }, [h('div', { className: ['card-body'] }, body)]);
21
21
  }
22
+ /** Card head row: `<div class="ec-head">[icon]<h2 class="card-title">{title}</h2></div>`.
23
+ * Pass the title's inline children and an optional pre-built icon element, the way `cardShell`
24
+ * takes already-built body content. This factors the icon-plus-heading head that a titled
25
+ * component build would otherwise rebuild by hand (the shape the removed `splitHead` produced). */
26
+ export function headRow(title, icon) {
27
+ const children = [];
28
+ if (icon)
29
+ children.push(icon);
30
+ children.push(h('h2', { className: ['card-title'] }, title));
31
+ return h('div', { className: ['ec-head'] }, children);
32
+ }
22
33
  /** Tag the first <ul> among children with `ec-grid` and strip its whitespace-only
23
34
  * text nodes so the bare list serializes without newlines. Returns that <ul>. */
24
35
  export function markFirstList(children) {
@@ -1 +1 @@
1
- {"version":3,"file":"remark-directives.d.ts","sourceRoot":"","sources":["../../src/lib/render/remark-directives.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAA8B,IAAI,EAAQ,MAAM,OAAO,CAAC;AAGpE,OAAO,EAAgB,KAAK,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAkDrE,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,iBAAiB,IAEtD,MAAM,IAAI,UAqDnB"}
1
+ {"version":3,"file":"remark-directives.d.ts","sourceRoot":"","sources":["../../src/lib/render/remark-directives.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAA8B,IAAI,EAAQ,MAAM,OAAO,CAAC;AAGpE,OAAO,EAAgB,KAAK,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAkDrE,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,iBAAiB,IAEtD,MAAM,IAAI,UAgEnB"}
@@ -60,19 +60,23 @@ export function remarkDirectiveStamp(registry) {
60
60
  const def = registry.get(node.name);
61
61
  const attrs = node.attributes ?? {};
62
62
  const role = attrs.role || undefined;
63
- let icon = attrs.icon || undefined;
63
+ const iconField = def?.attributes?.find((field) => field.type === 'icon');
64
+ const iconKey = iconField?.key ?? 'icon';
65
+ let icon = attrs[iconKey] || undefined;
64
66
  if (!icon && role)
65
67
  icon = registry.defaultIcon(node.name, role);
66
68
  const properties = { dataPrimitive: node.name };
67
- if (icon)
68
- properties.dataIcon = icon;
69
69
  if (role)
70
70
  properties.dataRole = role;
71
71
  // Carry every declared attribute to hast so the dispatch partitioner can build the
72
- // component context. data-attr-<key> survives to the element; build() consumes it and
73
- // returns a fresh element, so the marker never reaches the published DOM.
72
+ // component context. The icon attribute uses the already-resolved `icon` (the author value
73
+ // coerced through the same empty-is-absent rule above, or the defaultIconByRole default), so
74
+ // a role default reaches the build through the one declared path and a blank `icon=` falls
75
+ // back to that default the same way a missing one does. data-attr-<key> survives to the
76
+ // element; build() consumes it and returns a fresh element, so the marker never reaches the
77
+ // published DOM.
74
78
  for (const field of def?.attributes ?? []) {
75
- const raw = attrs[field.key];
79
+ const raw = field === iconField ? icon : attrs[field.key];
76
80
  if (raw != null)
77
81
  properties[dataAttrProp(field.key)] = raw;
78
82
  }
@@ -92,6 +96,11 @@ export function remarkDirectiveStamp(registry) {
92
96
  markSlot(child, child.name);
93
97
  }
94
98
  }
99
+ // A directive [label] that the component has no `title` slot to claim would otherwise fall
100
+ // through as body content and render as a stray paragraph. Drop it.
101
+ if (!slotNames.has('title')) {
102
+ node.children = node.children.filter((child) => !isDirectiveLabel(child));
103
+ }
95
104
  });
96
105
  visit(tree, ['textDirective', 'leafDirective'], (node, index, parent) => {
97
106
  if (!parent || index == null)
@@ -12,9 +12,10 @@ import { type ComponentRegistry } from './registry.js';
12
12
  */
13
13
  export declare function buildSanitizeSchema(registry: ComponentRegistry, extend?: (defaults: Schema) => Schema): Schema;
14
14
  /**
15
- * Force rel="noopener noreferrer" on every target="_blank" anchor, to prevent reverse-tabnabbing.
15
+ * Force a `rel` value on every target="_blank" anchor, to prevent reverse-tabnabbing.
16
16
  * hast-util-sanitize runs no per-node hook, so this small transform carries the behavior the old
17
- * DOMPurify preview pass enforced, now on the delivered output as well.
17
+ * DOMPurify preview pass enforced, now on the delivered output as well. The value is the renderer's
18
+ * `anchorRel` option (default `noopener noreferrer`); a site can override it or disable it entirely.
18
19
  */
19
- export declare function rehypeAnchorRel(): (tree: Root) => void;
20
+ export declare function rehypeAnchorRel(rel: string): (tree: Root) => void;
20
21
  //# sourceMappingURL=sanitize-schema.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"sanitize-schema.d.ts","sourceRoot":"","sources":["../../src/lib/render/sanitize-schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,KAAK,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,KAAK,EAAE,IAAI,EAAW,MAAM,MAAM,CAAC;AAE1C,OAAO,EAAgB,KAAK,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAMrE;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,iBAAiB,EAC3B,MAAM,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,MAAM,GACpC,MAAM,CA6BR;AAED;;;;GAIG;AACH,wBAAgB,eAAe,KACrB,MAAM,IAAI,UAOnB"}
1
+ {"version":3,"file":"sanitize-schema.d.ts","sourceRoot":"","sources":["../../src/lib/render/sanitize-schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,KAAK,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,KAAK,EAAE,IAAI,EAAW,MAAM,MAAM,CAAC;AAE1C,OAAO,EAAgB,KAAK,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAMrE;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,iBAAiB,EAC3B,MAAM,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,MAAM,GACpC,MAAM,CA6BR;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,IACjC,MAAM,IAAI,UAOnB"}
@@ -3,7 +3,7 @@ import { visit } from 'unist-util-visit';
3
3
  import { dataAttrProp } from './registry.js';
4
4
  // The fixed directive markers the stamp writes and the dispatch reads. They are inert data
5
5
  // attributes, never a script vector, and must survive the floor so the dispatch still runs.
6
- const FIXED_MARKERS = ['dataPrimitive', 'dataSlot', 'dataIcon', 'dataRole', 'dataRise'];
6
+ const FIXED_MARKERS = ['dataPrimitive', 'dataSlot', 'dataRole', 'dataRise'];
7
7
  /**
8
8
  * Build the delivery sanitize schema. Starts from hast-util-sanitize's defaultSchema, the
9
9
  * GitHub-lineage allowlist that strips scripts, inline event handlers, and javascript:/data: URLs,
@@ -42,15 +42,16 @@ export function buildSanitizeSchema(registry, extend) {
42
42
  return extend ? extend(schema) : schema;
43
43
  }
44
44
  /**
45
- * Force rel="noopener noreferrer" on every target="_blank" anchor, to prevent reverse-tabnabbing.
45
+ * Force a `rel` value on every target="_blank" anchor, to prevent reverse-tabnabbing.
46
46
  * hast-util-sanitize runs no per-node hook, so this small transform carries the behavior the old
47
- * DOMPurify preview pass enforced, now on the delivered output as well.
47
+ * DOMPurify preview pass enforced, now on the delivered output as well. The value is the renderer's
48
+ * `anchorRel` option (default `noopener noreferrer`); a site can override it or disable it entirely.
48
49
  */
49
- export function rehypeAnchorRel() {
50
+ export function rehypeAnchorRel(rel) {
50
51
  return (tree) => {
51
52
  visit(tree, 'element', (node) => {
52
53
  if (node.tagName === 'a' && node.properties?.target === '_blank') {
53
- node.properties.rel = 'noopener noreferrer';
54
+ node.properties.rel = rel;
54
55
  }
55
56
  });
56
57
  };
@@ -40,6 +40,7 @@ export interface TagIndexData {
40
40
  }
41
41
  /** One entry's data: the detail entry, its rendered html, and its canonical URL. */
42
42
  export interface EntryData {
43
+ concept: string;
43
44
  entry: ContentEntry;
44
45
  html: string;
45
46
  canonicalUrl: string;
@@ -1 +1 @@
1
- {"version":3,"file":"public-routes.d.ts","sourceRoot":"","sources":["../../src/lib/sveltekit/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AAC,EAAE;QAAE,GAAG,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACxC;6EACyE;IACzE,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,qEAAqE;AACrE,MAAM,WAAW,QAAQ;IACvB,OAAO,EAAE,cAAc,EAAE,CAAC;CAC3B;AAED,uDAAuD;AACvD,MAAM,WAAW,OAAQ,SAAQ,QAAQ;IACvC,GAAG,EAAE,MAAM,CAAC;CACb;AAED,oDAAoD;AACpD,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;CACxC;AAED,oFAAoF;AACpF,MAAM,WAAW,SAAS;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,YAAY,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,CAAC;IACrB,GAAG,EAAE,OAAO,CAAC;IACb,KAAK,CAAC,EAAE,cAAc,CAAC;IACvB,KAAK,CAAC,EAAE,cAAc,CAAC;CACxB;AAED,2DAA2D;AAC3D,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,gBAAgB;uBAWvB;QAAE,GAAG,EAAE,GAAG,CAAA;KAAE,KAAG,OAAO,CAAC,SAAS,CAAC;6BA0BjC,MAAM,KAAG,QAAQ;8BAKhB,MAAM,KAAG,YAAY;yBAK1B,MAAM,SAAS;QAAE,MAAM,EAAE;YAAE,GAAG,EAAE,MAAM,CAAA;SAAE,CAAA;KAAE,KAAG,OAAO;mBAO5D;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,EAAE;EAKvC"}
@@ -41,7 +41,7 @@ export function createPublicRoutes(deps) {
41
41
  ...(fields.author ? { author: fields.author } : {}),
42
42
  ...(entry.date ? { feeds } : {}),
43
43
  });
44
- return { entry, html: await render(entry.body, { stagger: true, resolve: buildLinkResolver(site) }), canonicalUrl, seo, newer, older };
44
+ return { concept: entry.concept, entry, html: await render(entry.body, { stagger: true, resolve: buildLinkResolver(site) }), canonicalUrl, seo, newer, older };
45
45
  }
46
46
  /** The chronological archive for one concept: every non-draft summary, newest-first. */
47
47
  function archiveLoad(conceptId) {
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ export {};
3
+ //# sourceMappingURL=bin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bin.d.ts","sourceRoot":"","sources":["../../src/lib/vite/bin.ts"],"names":[],"mappings":""}
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/env node
2
+ // cairn-manifest: the regenerate command. It evaluates the cairnManifest virtual module in write mode
3
+ // through the consumer's own Vite resolution and writes the canonical content manifest. A thin shell
4
+ // over writeManifest so the write logic stays testable apart from the CLI.
5
+ import { writeManifest } from './index.js';
6
+ writeManifest(process.cwd()).catch((err) => {
7
+ console.error(err instanceof Error ? err.message : String(err));
8
+ process.exit(1);
9
+ });
@@ -0,0 +1,33 @@
1
+ import type { Plugin, PluginOption } from 'vite';
2
+ /** Options for {@link cairnManifest}. Paths are app-root-absolute (the form `import.meta.glob` wants),
3
+ * so they match the build's own resolution. */
4
+ export interface CairnManifestOptions {
5
+ /** The module exporting the `cairn` adapter and the parsed `siteConfig`, app-root-absolute. */
6
+ configModule: string;
7
+ /** Per-concept content globs, keyed by concept id, app-root-absolute. */
8
+ content: Record<string, string>;
9
+ /** The committed manifest path, app-root-absolute. Defaults to `/src/content/.cairn/index.json`. */
10
+ manifestPath?: string;
11
+ }
12
+ /** Flatten the consumer's plugins option and drop the cairnManifest plugin at any nesting depth, so
13
+ * the nested verify server can never re-enter its buildStart. Vite supports (and flattens) nested
14
+ * plugin arrays, and findCairnOptions recurses into them, so a flat single-level filter would miss a
15
+ * cairnManifest nested inside a shared preset's sub-array and let it survive into the nested server.
16
+ * This mirrors findCairnOptions's recursion. Falsy slots pass through, which Vite tolerates. */
17
+ export declare function stripCairnManifest(plugins: PluginOption | PluginOption[]): PluginOption[];
18
+ /** Verify the committed manifest against the corpus from a Vite context, throwing on drift. The bin
19
+ * and the plugin share this; the spike proved it runs cleanly inside the consumer's config. */
20
+ export declare function verifyManifestFromVite(opts: CairnManifestOptions, root: string): Promise<void>;
21
+ /** Regenerate the serialized manifest from the corpus in a Vite context, sharing the build's
22
+ * resolution. The cairn-manifest bin (a later task) will call this and write the result. */
23
+ export declare function buildManifestFromVite(opts: CairnManifestOptions, root: string): Promise<string>;
24
+ /** The cairnManifest plugin. It serves the verify virtual module to the app graph and, in
25
+ * buildStart, evaluates it through a nested Vite SSR load so a manifest drift fails the build. */
26
+ export declare function cairnManifest(opts: CairnManifestOptions): Plugin;
27
+ /** Regenerate the committed manifest from the consumer's corpus and write it to the configured
28
+ * manifestPath. It loads the consumer's Vite config from `cwd`, reads the cairnManifest plugin's
29
+ * options off the instance, evaluates the write-mode virtual module through the build's own
30
+ * resolution, and writes the serialized manifest. The cairn-manifest bin calls this; it is exported
31
+ * so the write logic is testable apart from the CLI shell. */
32
+ export declare function writeManifest(cwd?: string): Promise<void>;
33
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lib/vite/index.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,MAAM,CAAC;AAWjD;gDACgD;AAChD,MAAM,WAAW,oBAAoB;IACnC,+FAA+F;IAC/F,YAAY,EAAE,MAAM,CAAC;IACrB,yEAAyE;IACzE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,oGAAoG;IACpG,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AA4ED;;;;iGAIiG;AACjG,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,YAAY,GAAG,YAAY,EAAE,GAAG,YAAY,EAAE,CAIzF;AAED;gGACgG;AAChG,wBAAsB,sBAAsB,CAAC,IAAI,EAAE,oBAAoB,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAEpG;AAED;6FAC6F;AAC7F,wBAAsB,qBAAqB,CAAC,IAAI,EAAE,oBAAoB,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAErG;AAED;mGACmG;AACnG,wBAAgB,aAAa,CAAC,IAAI,EAAE,oBAAoB,GAAG,MAAM,CA2BhE;AAED;;;;+DAI+D;AAC/D,wBAAsB,aAAa,CAAC,GAAG,GAAE,MAAsB,GAAG,OAAO,CAAC,IAAI,CAAC,CAmB9E"}