@stacksjs/bunpress 0.2.18 → 0.2.20
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/README.md +10 -0
- package/dist/bin/cli.js +1 -1
- package/dist/{chunk-d1n554nc.js → chunk-0y87yvqf.js} +113 -105
- package/dist/{chunk-pmf08yky.js → chunk-3ymfys00.js} +273 -20
- package/dist/{chunk-7j4gbtme.js → chunk-8w5tx0v1.js} +1 -1
- package/dist/{chunk-ptn6bypd.js → chunk-9ytw3mfw.js} +1 -1
- package/dist/{chunk-w25thc3e.js → chunk-btaakbga.js} +5 -5
- package/dist/{chunk-38js3eer.js → chunk-drgrfnm1.js} +1 -1
- package/dist/{chunk-wdrb5swv.js → chunk-rcr6k1et.js} +1 -1
- package/dist/{chunk-4zrjjjjh.js → chunk-rnzqf7rp.js} +1 -1
- package/dist/src/index.js +1 -1
- package/dist/src/message-previews.d.ts +60 -0
- package/dist/src/serve.d.ts +1 -0
- package/dist/src/stx-components.d.ts +5 -1
- package/dist/src/types.d.ts +2 -0
- package/package.json +1 -1
package/dist/src/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{a as W,b as X,c as Y,d as Z,e as _,f as $,g as b,h as v,i as A,j as zj,k as Bj,l as Dj,m as Ej,n as Gj,o as Hj,p as Ij}from"../chunk-
|
|
2
|
+
import{a as W,b as X,c as Y,d as Z,e as _,f as $,g as b,h as v,i as A,j as zj,k as Bj,l as Dj,m as Ej,n as Gj,o as Hj,p as Ij}from"../chunk-0y87yvqf.js";import{A as u,B as w,x as j,y as k,z as q}from"../chunk-rcr6k1et.js";import{$ as wj,C as Q,D as S,E as T,F as V,K as p,L as f,M as c,N as d,O as g,P as a,Q as n,R as o,S as r,T as t,U as i,V as s,W as e,X as jj,Y as kj,Z as qj,_ as uj,aa as z,ba as B,ca as D}from"../chunk-3ymfys00.js";import{fa as F,ga as R,ha as U,ia as m,ja as x,ka as C,la as l,ma as h,na as y}from"../chunk-rnzqf7rp.js";export{Ej as wrapInLayout,Dj as stripConfiguredBasePath,Hj as startServer,U as splitLocaleFromPath,X as setLanguageAliases,Ij as serveCLI,F as resolveI18nConfig,W as resetHighlighter,d as reserveUniqueSlug,kj as processInlineTocSyntax,v as prewarmHighlighter,Y as normalizeLanguage,Gj as markdownToHtml,f as markdownHeadingText,m as localizeUrl,l as localeLabel,x as localeContentCandidates,R as loadI18nTranslations,Z as isLanguageSupported,$ as highlightCodeSync,_ as highlightCode,b as getSyntaxHighlightingStyles,A as getHighlighterInstance,Bj as getConfiguredBasePath,V as getConfig,g as generateUniqueSlug,uj as generateTocStyles,wj as generateTocScripts,jj as generateTocPositions,r as generateTocHtml,e as generateTocData,c as generateSlug,w as generateSitemap,i as generateSidebarTocHtml,k as generateRssFeed,q as generateRobotsTxt,y as generateLocaleDetectionScript,t as generateInlineTocHtml,h as generateHreflangTags,s as generateFloatingTocHtml,o as filterHeadings,a as extractHeadings,qj as enhanceHeadingsWithAnchors,p as defaultTocConfig,Q as defaultConfig,zj as decodeHtmlEntities,C as configForLocale,T as config,n as buildTocHierarchy,u as buildSitemap,B as buildSearchRuntimeConfig,D as buildSearchIndex,j as buildRssFeed,S as applyConfigPlugins,z as SEARCH_INDEX_PATH};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
export declare function isMessagePreviewLang(lang: string): boolean;
|
|
2
|
+
/**
|
|
3
|
+
* Split a fence into headers and body. Headers exist only when a `---` line
|
|
4
|
+
* follows lines that all read `key: value`, so a body that merely contains a
|
|
5
|
+
* colon is never mistaken for one.
|
|
6
|
+
*/
|
|
7
|
+
export declare function parseMessage(source: string, splitParts: boolean): ParsedMessage;
|
|
8
|
+
export declare function renderEmailPreview(source: string): string;
|
|
9
|
+
/** How many SMS segments a message costs, the way carriers count them. */
|
|
10
|
+
export declare function countSmsSegments(text: string): SmsSegments;
|
|
11
|
+
export declare function renderSmsPreview(source: string): string;
|
|
12
|
+
/** Render a message fence, or `null` when the language is not one of ours. */
|
|
13
|
+
export declare function renderMessagePreview(lang: string, source: string): string | null;
|
|
14
|
+
/**
|
|
15
|
+
* Replace each top-level ```email / ```sms fence with its text, so the copy of
|
|
16
|
+
* a message stays searchable while every other code block is stripped from
|
|
17
|
+
* the search index. A message fence shown inside a longer example fence is
|
|
18
|
+
* left alone: that is syntax being demonstrated, not a message.
|
|
19
|
+
*/
|
|
20
|
+
export declare function unwrapMessageFences(markdown: string): string;
|
|
21
|
+
/**
|
|
22
|
+
* Message previews: ```email and ```sms fences rendered as the message itself.
|
|
23
|
+
*
|
|
24
|
+
* Product docs often need to show the exact copy a system sends — a welcome
|
|
25
|
+
* email, a class reminder text — and a plain code block reads as code, not as
|
|
26
|
+
* a message. These fences render an email as a mail-client card (headers,
|
|
27
|
+
* subject, body, buttons) and an SMS thread as phone bubbles with a character
|
|
28
|
+
* and segment count, so a reader sees what the recipient sees.
|
|
29
|
+
*
|
|
30
|
+
* ````md
|
|
31
|
+
* ```email
|
|
32
|
+
* from: Acme <hello@acme.com>
|
|
33
|
+
* to: The new member
|
|
34
|
+
* subject: Welcome to Acme, {firstName}
|
|
35
|
+
* ---
|
|
36
|
+
* Hi {firstName},
|
|
37
|
+
*
|
|
38
|
+
* [Set your password](https://acme.com/reset)
|
|
39
|
+
* ```
|
|
40
|
+
* ````
|
|
41
|
+
*
|
|
42
|
+
* Header lines (`key: value`) come before the first `---`; the body follows.
|
|
43
|
+
* In an `sms` fence every later `---` starts another message in the thread,
|
|
44
|
+
* and a message whose lines all start with `> ` is a reply from the recipient.
|
|
45
|
+
* In an `email` fence a later `---` is a divider (above a footer, say).
|
|
46
|
+
* `{name}` and `{{ name }}` placeholders are highlighted as variables.
|
|
47
|
+
*/
|
|
48
|
+
/** The fence languages rendered as message previews. */
|
|
49
|
+
export declare const MESSAGE_PREVIEW_LANGS: readonly string[];
|
|
50
|
+
/** Styles for both previews, built on the theme's own colour variables. */
|
|
51
|
+
export declare const messagePreviewCSS: string;
|
|
52
|
+
export declare interface ParsedMessage {
|
|
53
|
+
headers: Array<{ key: string, value: string }>
|
|
54
|
+
parts: string[][]
|
|
55
|
+
}
|
|
56
|
+
export declare interface SmsSegments {
|
|
57
|
+
encoding: 'GSM-7' | 'UCS-2'
|
|
58
|
+
length: number
|
|
59
|
+
segments: number
|
|
60
|
+
}
|
package/dist/src/serve.d.ts
CHANGED
|
@@ -8,4 +8,8 @@ export declare function clearComponentCache(): void;
|
|
|
8
8
|
* @param context Variables available to bound props and components.
|
|
9
9
|
* @param depth Internal recursion guard for components emitting components.
|
|
10
10
|
*/
|
|
11
|
-
export declare function resolveStxComponents(content: string, componentsDir: string, context: Record<string, unknown>, depth?: number): Promise<string>;
|
|
11
|
+
export declare function resolveStxComponents(content: string, componentsDir: string, context: Record<string, unknown>, options?: ComponentRenderOptions, depth?: number): Promise<string>;
|
|
12
|
+
export declare interface ComponentRenderOptions {
|
|
13
|
+
fallbackComponentsDir?: string
|
|
14
|
+
rendered?: Map<string, string>
|
|
15
|
+
}
|
package/dist/src/types.d.ts
CHANGED
|
@@ -17,6 +17,7 @@ export declare interface BunPressConfig {
|
|
|
17
17
|
outDir?: string
|
|
18
18
|
basePath?: string
|
|
19
19
|
componentsDir?: string
|
|
20
|
+
fallbackComponentsDir?: string
|
|
20
21
|
dataDir?: string
|
|
21
22
|
fonts?: {
|
|
22
23
|
google?: string[]
|
|
@@ -217,6 +218,7 @@ export declare interface MarkdownFeaturesConfig {
|
|
|
217
218
|
githubAlerts?: boolean | GitHubAlertsConfig
|
|
218
219
|
codeBlocks?: boolean | CodeBlocksConfig
|
|
219
220
|
codeGroups?: boolean
|
|
221
|
+
messagePreviews?: boolean
|
|
220
222
|
codeImports?: boolean
|
|
221
223
|
inlineToc?: boolean
|
|
222
224
|
customAnchors?: boolean
|