@shing.wong/sure-factor 0.5.7 → 0.5.8
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/.opencode/skills/sure-factor/SKILL.md +7 -0
- package/catalog/components/page-footer.yaml +49 -0
- package/dist/footer.d.ts +55 -0
- package/dist/footer.d.ts.map +1 -0
- package/dist/footer.js +91 -0
- package/dist/footer.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/markdown.d.ts +12 -0
- package/dist/markdown.d.ts.map +1 -0
- package/dist/markdown.js +170 -0
- package/dist/markdown.js.map +1 -0
- package/package.json +2 -2
|
@@ -149,6 +149,13 @@ application chrome, because an emoji carries its own palette. `align: 'end'`
|
|
|
149
149
|
pins an item (and a divider before it) to the far edge: sign out belongs there,
|
|
150
150
|
not among the pages.
|
|
151
151
|
|
|
152
|
+
For prose and page chrome, prefer the string renderers over DOM: `renderFooter()`
|
|
153
|
+
for the last line of a page (copyright, legal links, build credit) and
|
|
154
|
+
`renderMarkdown()` for documents. Both are escape-first, validate link
|
|
155
|
+
destinations against a protocol allowlist, and return HTML a build can write
|
|
156
|
+
into static pages — so they work with scripts disabled, which is what legal
|
|
157
|
+
pages and printouts need.
|
|
158
|
+
|
|
152
159
|
## Group the fields in the schema
|
|
153
160
|
|
|
154
161
|
A long form is easier to use when it is in sections, and the section a field
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
name: page-footer
|
|
2
|
+
description: The last line of a page — a copyright notice, the legal destinations and a build credit — as static HTML, drawn from theme tokens and hidden when printing. Emitted at build or request time so a page renders without JavaScript.
|
|
3
|
+
tier: prototype
|
|
4
|
+
parameters:
|
|
5
|
+
legal:
|
|
6
|
+
type: text
|
|
7
|
+
required: true
|
|
8
|
+
description: The copyright or ownership line, e.g. "© 2026 Example LLC. All rights reserved."
|
|
9
|
+
links:
|
|
10
|
+
type: array
|
|
11
|
+
required: false
|
|
12
|
+
description: Array of { label, href } destinations — privacy, terms, disclaimer, compliance.
|
|
13
|
+
credit:
|
|
14
|
+
type: object
|
|
15
|
+
required: false
|
|
16
|
+
description: '{ text, href? } build credit, e.g. "Powered by sure-stack". An href must be http(s), mailto or site-relative.'
|
|
17
|
+
behavior:
|
|
18
|
+
notificationModes: []
|
|
19
|
+
audio:
|
|
20
|
+
errorBell: false
|
|
21
|
+
successChime: false
|
|
22
|
+
voiceHelp: false
|
|
23
|
+
sure_ui:
|
|
24
|
+
- footer
|
|
25
|
+
# Template generation (generateForTier) always emits a form wrapper and a
|
|
26
|
+
# submit button for every catalog component; declaring these keeps that path
|
|
27
|
+
# from producing unstyled markup, exactly as the menu and markdown entries do.
|
|
28
|
+
- form
|
|
29
|
+
- buttons
|
|
30
|
+
cssClasses:
|
|
31
|
+
root: sure-footer
|
|
32
|
+
inner: sure-footer__inner
|
|
33
|
+
legal: sure-footer__legal
|
|
34
|
+
links: sure-footer__links
|
|
35
|
+
link: sure-footer__link
|
|
36
|
+
credit: sure-footer__credit
|
|
37
|
+
example:
|
|
38
|
+
usage: Render the footer for every page of a portal, with the legal pages and the build credit.
|
|
39
|
+
code: |
|
|
40
|
+
<footer class="sure-footer">
|
|
41
|
+
<div class="sure-footer__inner">
|
|
42
|
+
<p class="sure-footer__legal">© 2026 Example LLC. All rights reserved.</p>
|
|
43
|
+
<ul class="sure-footer__links">
|
|
44
|
+
<li><a class="sure-footer__link" href="/privacy.html">Privacy</a></li>
|
|
45
|
+
<li><a class="sure-footer__link" href="/terms.html">Terms</a></li>
|
|
46
|
+
</ul>
|
|
47
|
+
<p class="sure-footer__credit"><a href="https://positronic-ai.us/sure/" rel="noopener noreferrer">Powered by sure-stack</a></p>
|
|
48
|
+
</div>
|
|
49
|
+
</footer>
|
package/dist/footer.d.ts
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/** The catalog's class contract for `page-footer`. Keep in step with the yaml. */
|
|
2
|
+
export declare const FOOTER_CLASSES: {
|
|
3
|
+
readonly root: "sure-footer";
|
|
4
|
+
readonly inner: "sure-footer__inner";
|
|
5
|
+
readonly legal: "sure-footer__legal";
|
|
6
|
+
readonly links: "sure-footer__links";
|
|
7
|
+
readonly link: "sure-footer__link";
|
|
8
|
+
readonly credit: "sure-footer__credit";
|
|
9
|
+
};
|
|
10
|
+
export interface FooterLink {
|
|
11
|
+
/** Visible text. Escaped. */
|
|
12
|
+
label: string;
|
|
13
|
+
/** Destination. Validated: http(s), mailto, or a site-relative path. */
|
|
14
|
+
href: string;
|
|
15
|
+
}
|
|
16
|
+
export interface FooterCredit {
|
|
17
|
+
/** Text that introduces the link, e.g. "Powered by". Escaped. */
|
|
18
|
+
text: string;
|
|
19
|
+
/** Optional destination; without it the credit is plain text. */
|
|
20
|
+
href?: string;
|
|
21
|
+
}
|
|
22
|
+
export interface FooterOptions {
|
|
23
|
+
/** The copyright line: "@company, all rights reserved" or similar. */
|
|
24
|
+
legal: string;
|
|
25
|
+
/** Legal/navigation destinations, in display order. */
|
|
26
|
+
links?: readonly FooterLink[];
|
|
27
|
+
/** Build credit, e.g. { text: "Powered by sure-stack", href: "https://…" }. */
|
|
28
|
+
credit?: FooterCredit;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Escape text for an HTML body or a double-quoted attribute.
|
|
32
|
+
*
|
|
33
|
+
* Every consumer of this module passes *data* — a company name, a link label —
|
|
34
|
+
* and a label containing `<script>` must be shown, not executed.
|
|
35
|
+
*/
|
|
36
|
+
export declare function escapeHtml(value: string): string;
|
|
37
|
+
/**
|
|
38
|
+
* Accept only destinations a footer should point at.
|
|
39
|
+
*
|
|
40
|
+
* `javascript:` in an href is the classic injection, and it survives escaping —
|
|
41
|
+
* so the protocol is checked, not sanitised. A relative path (no scheme) is
|
|
42
|
+
* fine; a protocol-relative `//host` is not, because it silently leaves the
|
|
43
|
+
* site over whatever protocol the page happens to use.
|
|
44
|
+
*/
|
|
45
|
+
export declare function safeHref(href: string): string;
|
|
46
|
+
/**
|
|
47
|
+
* Render a footer.
|
|
48
|
+
*
|
|
49
|
+
* The markup matches sure-ui's `footer` block: `inner` holds the legal line,
|
|
50
|
+
* the link list and the credit in one row that wraps on a phone, and the block
|
|
51
|
+
* hides itself when printing.
|
|
52
|
+
*/
|
|
53
|
+
export declare function renderFooter(options: FooterOptions): string;
|
|
54
|
+
export default renderFooter;
|
|
55
|
+
//# sourceMappingURL=footer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"footer.d.ts","sourceRoot":"","sources":["../src/footer.ts"],"names":[],"mappings":"AAQA,kFAAkF;AAClF,eAAO,MAAM,cAAc;;;;;;;CAOjB,CAAA;AAEV,MAAM,WAAW,UAAU;IACzB,6BAA6B;IAC7B,KAAK,EAAE,MAAM,CAAA;IACb,wEAAwE;IACxE,IAAI,EAAE,MAAM,CAAA;CACb;AAED,MAAM,WAAW,YAAY;IAC3B,iEAAiE;IACjE,IAAI,EAAE,MAAM,CAAA;IACZ,iEAAiE;IACjE,IAAI,CAAC,EAAE,MAAM,CAAA;CACd;AAED,MAAM,WAAW,aAAa;IAC5B,sEAAsE;IACtE,KAAK,EAAE,MAAM,CAAA;IACb,uDAAuD;IACvD,KAAK,CAAC,EAAE,SAAS,UAAU,EAAE,CAAA;IAC7B,+EAA+E;IAC/E,MAAM,CAAC,EAAE,YAAY,CAAA;CACtB;AAUD;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAEhD;AAID;;;;;;;GAOG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAY7C;AAID;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,aAAa,GAAG,MAAM,CA4B3D;AAED,eAAe,YAAY,CAAA"}
|
package/dist/footer.js
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
// Footer markup, generated as a string.
|
|
2
|
+
//
|
|
3
|
+
// A menu is runtime chrome, so `renderMenu` builds DOM. A footer is static
|
|
4
|
+
// content that belongs in the HTML a server or build writes — a legal page must
|
|
5
|
+
// render with scripts disabled. Text output also makes the whole risk surface
|
|
6
|
+
// escaping, which is why every value here goes through `escapeHtml` and every
|
|
7
|
+
// URL through `safeHref`.
|
|
8
|
+
/** The catalog's class contract for `page-footer`. Keep in step with the yaml. */
|
|
9
|
+
export const FOOTER_CLASSES = {
|
|
10
|
+
root: 'sure-footer',
|
|
11
|
+
inner: 'sure-footer__inner',
|
|
12
|
+
legal: 'sure-footer__legal',
|
|
13
|
+
links: 'sure-footer__links',
|
|
14
|
+
link: 'sure-footer__link',
|
|
15
|
+
credit: 'sure-footer__credit',
|
|
16
|
+
};
|
|
17
|
+
const ESCAPES = {
|
|
18
|
+
'&': '&',
|
|
19
|
+
'<': '<',
|
|
20
|
+
'>': '>',
|
|
21
|
+
'"': '"',
|
|
22
|
+
"'": ''',
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Escape text for an HTML body or a double-quoted attribute.
|
|
26
|
+
*
|
|
27
|
+
* Every consumer of this module passes *data* — a company name, a link label —
|
|
28
|
+
* and a label containing `<script>` must be shown, not executed.
|
|
29
|
+
*/
|
|
30
|
+
export function escapeHtml(value) {
|
|
31
|
+
return value.replace(/[&<>"']/g, (char) => ESCAPES[char]);
|
|
32
|
+
}
|
|
33
|
+
const SCHEME = /^[a-z][a-z0-9+.-]*:/i;
|
|
34
|
+
/**
|
|
35
|
+
* Accept only destinations a footer should point at.
|
|
36
|
+
*
|
|
37
|
+
* `javascript:` in an href is the classic injection, and it survives escaping —
|
|
38
|
+
* so the protocol is checked, not sanitised. A relative path (no scheme) is
|
|
39
|
+
* fine; a protocol-relative `//host` is not, because it silently leaves the
|
|
40
|
+
* site over whatever protocol the page happens to use.
|
|
41
|
+
*/
|
|
42
|
+
export function safeHref(href) {
|
|
43
|
+
const value = href.trim();
|
|
44
|
+
if (value === '')
|
|
45
|
+
throw new Error('footer link: empty href');
|
|
46
|
+
if (value.startsWith('//'))
|
|
47
|
+
throw new Error(`footer link: protocol-relative href "${href}"`);
|
|
48
|
+
const scheme = SCHEME.exec(value);
|
|
49
|
+
if (scheme) {
|
|
50
|
+
const protocol = scheme[0].toLowerCase();
|
|
51
|
+
if (protocol !== 'http:' && protocol !== 'https:' && protocol !== 'mailto:') {
|
|
52
|
+
throw new Error(`footer link: "${href}" is not http(s), mailto, or a relative path`);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
return value;
|
|
56
|
+
}
|
|
57
|
+
const isExternal = (href) => /^(https?:)?\/\//i.test(href);
|
|
58
|
+
/**
|
|
59
|
+
* Render a footer.
|
|
60
|
+
*
|
|
61
|
+
* The markup matches sure-ui's `footer` block: `inner` holds the legal line,
|
|
62
|
+
* the link list and the credit in one row that wraps on a phone, and the block
|
|
63
|
+
* hides itself when printing.
|
|
64
|
+
*/
|
|
65
|
+
export function renderFooter(options) {
|
|
66
|
+
const classes = FOOTER_CLASSES;
|
|
67
|
+
const parts = [];
|
|
68
|
+
parts.push(`<p class="${classes.legal}">${escapeHtml(options.legal)}</p>`);
|
|
69
|
+
const links = options.links ?? [];
|
|
70
|
+
if (links.length > 0) {
|
|
71
|
+
const items = links.map((link) => {
|
|
72
|
+
const href = safeHref(link.href);
|
|
73
|
+
// External destinations get rel: the page is a financial portal and must
|
|
74
|
+
// not hand the target a `window.opener` handle.
|
|
75
|
+
const rel = isExternal(href) ? ' rel="noopener noreferrer"' : '';
|
|
76
|
+
return `<li><a class="${classes.link}" href="${escapeHtml(href)}"${rel}>${escapeHtml(link.label)}</a></li>`;
|
|
77
|
+
});
|
|
78
|
+
parts.push(`<ul class="${classes.links}">${items.join('')}</ul>`);
|
|
79
|
+
}
|
|
80
|
+
if (options.credit) {
|
|
81
|
+
const { text, href } = options.credit;
|
|
82
|
+
const label = escapeHtml(text);
|
|
83
|
+
const credit = href
|
|
84
|
+
? `<a href="${escapeHtml(safeHref(href))}"${isExternal(href) ? ' rel="noopener noreferrer"' : ''}>${label}</a>`
|
|
85
|
+
: label;
|
|
86
|
+
parts.push(`<p class="${classes.credit}">${credit}</p>`);
|
|
87
|
+
}
|
|
88
|
+
return `<footer class="${classes.root}"><div class="${classes.inner}">${parts.join('')}</div></footer>`;
|
|
89
|
+
}
|
|
90
|
+
export default renderFooter;
|
|
91
|
+
//# sourceMappingURL=footer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"footer.js","sourceRoot":"","sources":["../src/footer.ts"],"names":[],"mappings":"AAAA,wCAAwC;AACxC,EAAE;AACF,2EAA2E;AAC3E,gFAAgF;AAChF,8EAA8E;AAC9E,8EAA8E;AAC9E,0BAA0B;AAE1B,kFAAkF;AAClF,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,IAAI,EAAE,aAAa;IACnB,KAAK,EAAE,oBAAoB;IAC3B,KAAK,EAAE,oBAAoB;IAC3B,KAAK,EAAE,oBAAoB;IAC3B,IAAI,EAAE,mBAAmB;IACzB,MAAM,EAAE,qBAAqB;CACrB,CAAA;AAyBV,MAAM,OAAO,GAA2B;IACtC,GAAG,EAAE,OAAO;IACZ,GAAG,EAAE,MAAM;IACX,GAAG,EAAE,MAAM;IACX,GAAG,EAAE,QAAQ;IACb,GAAG,EAAE,OAAO;CACb,CAAA;AAED;;;;;GAKG;AACH,MAAM,UAAU,UAAU,CAAC,KAAa;IACtC,OAAO,KAAK,CAAC,OAAO,CAAC,UAAU,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,CAAE,CAAC,CAAA;AAC5D,CAAC;AAED,MAAM,MAAM,GAAG,sBAAsB,CAAA;AAErC;;;;;;;GAOG;AACH,MAAM,UAAU,QAAQ,CAAC,IAAY;IACnC,MAAM,KAAK,GAAG,IAAI,CAAC,IAAI,EAAE,CAAA;IACzB,IAAI,KAAK,KAAK,EAAE;QAAE,MAAM,IAAI,KAAK,CAAC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C,CAAC,EAAE,CAAA;YAChE,OAAO,iBAAiB,OAAO,CAAC,IAAI,WAAW,UAAU,CAAC,IAAI,CAAC,IAAI,GAAG,IAAI,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,WAAW,CAAA;QAC7G,CAAC,CAAC,CAAA;QACF,KAAK,CAAC,IAAI,CAAC,cAAc,OAAO,CAAC,KAAK,KAAK,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,CAAC,CAAA;IACnE,CAAC;IAED,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;QACnB,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC,MAAM,CAAA;QACrC,MAAM,KAAK,GAAG,UAAU,CAAC,IAAI,CAAC,CAAA;QAC9B,MAAM,MAAM,GAAG,IAAI;YACjB,CAAC,CAAC,YAAY,UAAU,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,IAAI,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,4BAA4B,CAAC,CAAC,CAAC,EAAE,IAAI,KAAK,MAAM;YAC/G,CAAC,CAAC,KAAK,CAAA;QACT,KAAK,CAAC,IAAI,CAAC,aAAa,OAAO,CAAC,MAAM,KAAK,MAAM,MAAM,CAAC,CAAA;IAC1D,CAAC;IAED,OAAO,kBAAkB,OAAO,CAAC,IAAI,iBAAiB,OAAO,CAAC,KAAK,KAAK,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,iBAAiB,CAAA;AACzG,CAAC;AAED,eAAe,YAAY,CAAA"}
|
package/dist/index.d.ts
CHANGED
|
@@ -5,6 +5,9 @@ export { generateForTier, type GenerationTier, type GenerateOptions } from './ge
|
|
|
5
5
|
export { generateClientComponent, buildClientFields, type ClientGenerateOptions, type ClientComponentOutput, type ClientFieldSpec, } from './generate-client.js';
|
|
6
6
|
export { generateStore, type StoreGenerationOptions, type GeneratedStoreOutput, type SyncDirection } from './generate-store.js';
|
|
7
7
|
export { sanitize, sanitizeInput, sanitizeOutput } from './sanitize.js';
|
|
8
|
+
export { renderFooter, escapeHtml, safeHref, FOOTER_CLASSES } from './footer.js';
|
|
9
|
+
export type { FooterOptions, FooterLink, FooterCredit } from './footer.js';
|
|
10
|
+
export { renderMarkdown } from './markdown.js';
|
|
8
11
|
export { toYaml, toJson, fromJson, toMarkdown, toXml, fromXml, convert } from './serialize.js';
|
|
9
12
|
export { formatCode, formatGeneratedOutput, formatGeneratedStoreOutput } from './format.js';
|
|
10
13
|
export type { FormattedOutput, FormattedStoreOutput } from './format.js';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAA;AACpG,YAAY,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAExE,OAAO,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,KAAK,eAAe,EAAE,MAAM,YAAY,CAAA;AAE7G,OAAO,EAAE,eAAe,EAAE,KAAK,cAAc,EAAE,KAAK,eAAe,EAAE,MAAM,eAAe,CAAA;AAC1F,OAAO,EACL,uBAAuB,EACvB,iBAAiB,EACjB,KAAK,qBAAqB,EAC1B,KAAK,qBAAqB,EAC1B,KAAK,eAAe,GACrB,MAAM,sBAAsB,CAAA;AAC7B,OAAO,EAAE,aAAa,EAAE,KAAK,sBAAsB,EAAE,KAAK,oBAAoB,EAAE,KAAK,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAC/H,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AACvE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAA;AAC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,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAA;AAC9F,OAAO,EAAE,UAAU,EAAE,qBAAqB,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAA;AAC3F,YAAY,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAA;AACxE,YAAY,EAAE,WAAW,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -13,6 +13,8 @@ export { generateForTier } from './generate.js';
|
|
|
13
13
|
export { generateClientComponent, buildClientFields, } from './generate-client.js';
|
|
14
14
|
export { generateStore } from './generate-store.js';
|
|
15
15
|
export { sanitize, sanitizeInput, sanitizeOutput } from './sanitize.js';
|
|
16
|
+
export { renderFooter, escapeHtml, safeHref, FOOTER_CLASSES } from './footer.js';
|
|
17
|
+
export { renderMarkdown } from './markdown.js';
|
|
16
18
|
export { toYaml, toJson, fromJson, toMarkdown, toXml, fromXml, convert } from './serialize.js';
|
|
17
19
|
export { formatCode, formatGeneratedOutput, formatGeneratedStoreOutput } from './format.js';
|
|
18
20
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,oEAAoE;AACpE,EAAE;AACF,gBAAgB;AAChB,2EAA2E;AAC3E,0EAA0E;AAC1E,4EAA4E;AAC5E,4EAA4E;AAC5E,EAAE;AACF,aAAa;AACb,OAAO,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAA;AAGpG,OAAO,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,gBAAgB,EAAwB,MAAM,YAAY,CAAA;AAE7G,OAAO,EAAE,eAAe,EAA6C,MAAM,eAAe,CAAA;AAC1F,OAAO,EACL,uBAAuB,EACvB,iBAAiB,GAIlB,MAAM,sBAAsB,CAAA;AAC7B,OA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BAA0B,EAAE,MAAM,aAAa,CAAA"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/** Escape text for an HTML body or double-quoted attribute. */
|
|
2
|
+
export declare function escapeHtml(value: string): string;
|
|
3
|
+
/** http(s), mailto, or a site-relative destination; anything else throws. */
|
|
4
|
+
export declare function safeHref(href: string): string;
|
|
5
|
+
interface Options {
|
|
6
|
+
/** Heading level for `#`. Defaults to 2: a document usually sits under the page's own `<h1>`. */
|
|
7
|
+
baseHeading?: number;
|
|
8
|
+
}
|
|
9
|
+
/** Render a Markdown document as the markup `sure-markdown` styles. */
|
|
10
|
+
export declare function renderMarkdown(source: string, options?: Options): string;
|
|
11
|
+
export default renderMarkdown;
|
|
12
|
+
//# sourceMappingURL=markdown.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"markdown.d.ts","sourceRoot":"","sources":["../src/markdown.ts"],"names":[],"mappings":"AAcA,+DAA+D;AAC/D,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAEhD;AAID,6EAA6E;AAC7E,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAY7C;AA+BD,UAAU,OAAO;IACf,iGAAiG;IACjG,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB;AAED,uEAAuE;AACvE,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,GAAE,OAAY,GAAG,MAAM,CAuH5E;AAED,eAAe,cAAc,CAAA"}
|
package/dist/markdown.js
ADDED
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
// Markdown → HTML for the `markdown` component the catalog already declares.
|
|
2
|
+
//
|
|
3
|
+
// Why this exists: `catalog/components/markdown.yaml` describes themed prose
|
|
4
|
+
// (`sure-markdown`, tables, quotes, code), but `generateClientComponent` answers
|
|
5
|
+
// `null` for it and `generateForTier` only wraps a template — so the component
|
|
6
|
+
// was unusable. Legal pages, help text and release notes are exactly the prose
|
|
7
|
+
// it was meant for, and they must render without JavaScript.
|
|
8
|
+
//
|
|
9
|
+
// The subset is deliberate: headings, paragraphs, lists, tables, quotes, rules,
|
|
10
|
+
// and inline code/bold/italic/links. Every value is HTML-escaped *first*, so
|
|
11
|
+
// raw HTML in a document is shown rather than executed — an author cannot
|
|
12
|
+
// inject markup through content, and escaping happens before any emphasis is
|
|
13
|
+
// applied so a `<` inside a paragraph cannot open a tag.
|
|
14
|
+
/** Escape text for an HTML body or double-quoted attribute. */
|
|
15
|
+
export function escapeHtml(value) {
|
|
16
|
+
return value.replace(/[&<>"']/g, (char) => ({ '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' })[char]);
|
|
17
|
+
}
|
|
18
|
+
const SCHEME = /^[a-z][a-z0-9+.-]*:/i;
|
|
19
|
+
/** http(s), mailto, or a site-relative destination; anything else throws. */
|
|
20
|
+
export function safeHref(href) {
|
|
21
|
+
const value = href.trim();
|
|
22
|
+
if (value === '')
|
|
23
|
+
throw new Error('markdown link: empty href');
|
|
24
|
+
if (value.startsWith('//'))
|
|
25
|
+
throw new Error(`markdown link: protocol-relative href "${href}"`);
|
|
26
|
+
const scheme = SCHEME.exec(value);
|
|
27
|
+
if (scheme) {
|
|
28
|
+
const protocol = scheme[0].toLowerCase();
|
|
29
|
+
if (protocol !== 'http:' && protocol !== 'https:' && protocol !== 'mailto:') {
|
|
30
|
+
throw new Error(`markdown link: "${href}" is not http(s), mailto, or a relative path`);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
return value;
|
|
34
|
+
}
|
|
35
|
+
const isExternal = (href) => /^(https?:)?\/\//i.test(href);
|
|
36
|
+
/**
|
|
37
|
+
* Inline markup for one run of text.
|
|
38
|
+
*
|
|
39
|
+
* Code spans are lifted out first, because `` `a ** b` `` must not become bold;
|
|
40
|
+
* links are built (label escaped, destination validated) and stashed for the
|
|
41
|
+
* same reason — escaping a half-built `<a>` would mangle the attribute.
|
|
42
|
+
*/
|
|
43
|
+
function inline(text) {
|
|
44
|
+
const stash = [];
|
|
45
|
+
const hold = (html) => `\u0000${stash.push(html) - 1}\u0000`;
|
|
46
|
+
let work = text.replace(/`([^`]+)`/g, (_, code) => hold(`<code>${escapeHtml(code)}</code>`));
|
|
47
|
+
work = work.replace(/\[([^\]]+)\]\(([^)\s]+)\)/g, (_, label, href) => {
|
|
48
|
+
const target = safeHref(href);
|
|
49
|
+
const rel = isExternal(target) ? ' rel="noopener noreferrer"' : '';
|
|
50
|
+
return hold(`<a href="${escapeHtml(target)}"${rel}>${emphasis(escapeHtml(label))}</a>`);
|
|
51
|
+
});
|
|
52
|
+
return emphasis(escapeHtml(work)).replace(/\u0000(\d+)\u0000/g, (_, index) => stash[Number(index)]);
|
|
53
|
+
}
|
|
54
|
+
const emphasis = (escaped) => escaped
|
|
55
|
+
.replace(/\*\*([^*]+)\*\*/g, '<strong>$1</strong>')
|
|
56
|
+
.replace(/(^|[\s(])\*([^*\s][^*]*)\*/g, '$1<em>$2</em>');
|
|
57
|
+
/** Render a Markdown document as the markup `sure-markdown` styles. */
|
|
58
|
+
export function renderMarkdown(source, options = {}) {
|
|
59
|
+
const base = options.baseHeading ?? 2;
|
|
60
|
+
const lines = source.replace(/\r\n?/g, '\n').split('\n');
|
|
61
|
+
const out = [];
|
|
62
|
+
let paragraph = [];
|
|
63
|
+
let i = 0;
|
|
64
|
+
// A line ending in two spaces is a hard break (the Markdown convention), so
|
|
65
|
+
// an address or a signature block keeps its shape without raw <br> tags.
|
|
66
|
+
const flush = () => {
|
|
67
|
+
if (paragraph.length === 0)
|
|
68
|
+
return;
|
|
69
|
+
const html = paragraph
|
|
70
|
+
.map((line, index) => {
|
|
71
|
+
const hard = / {2,}$/.test(line);
|
|
72
|
+
const text = inline(line.replace(/\s+$/, ''));
|
|
73
|
+
if (index === paragraph.length - 1)
|
|
74
|
+
return text;
|
|
75
|
+
return hard ? `${text}<br>` : `${text} `;
|
|
76
|
+
})
|
|
77
|
+
.join('');
|
|
78
|
+
out.push(`<p>${html}</p>`);
|
|
79
|
+
paragraph = [];
|
|
80
|
+
};
|
|
81
|
+
const headingLevel = (level) => Math.min(6, Math.max(1, level + base - 1));
|
|
82
|
+
while (i < lines.length) {
|
|
83
|
+
const line = lines[i];
|
|
84
|
+
const trimmed = line.trim();
|
|
85
|
+
if (trimmed === '') {
|
|
86
|
+
flush();
|
|
87
|
+
i += 1;
|
|
88
|
+
continue;
|
|
89
|
+
}
|
|
90
|
+
// Rule
|
|
91
|
+
if (/^(-{3,}|\*{3,}|_{3,})$/.test(trimmed)) {
|
|
92
|
+
flush();
|
|
93
|
+
out.push('<hr>');
|
|
94
|
+
i += 1;
|
|
95
|
+
continue;
|
|
96
|
+
}
|
|
97
|
+
// Heading
|
|
98
|
+
const heading = /^(#{1,6})\s+(.*)$/.exec(trimmed);
|
|
99
|
+
if (heading) {
|
|
100
|
+
flush();
|
|
101
|
+
const level = headingLevel(heading[1].length);
|
|
102
|
+
out.push(`<h${level}>${inline(heading[2].trim())}</h${level}>`);
|
|
103
|
+
i += 1;
|
|
104
|
+
continue;
|
|
105
|
+
}
|
|
106
|
+
// Table: a header row followed by a separator row of dashes and colons.
|
|
107
|
+
const next = lines[i + 1]?.trim() ?? '';
|
|
108
|
+
if (trimmed.includes('|') && /^\|?[\s:-]*-[\s:|-]*\|?$/.test(next) && next.includes('-')) {
|
|
109
|
+
flush();
|
|
110
|
+
const cells = (row) => row.replace(/^\s*\|/, '').replace(/\|\s*$/, '').split('|').map((cell) => cell.trim());
|
|
111
|
+
const head = cells(trimmed);
|
|
112
|
+
const rows = [];
|
|
113
|
+
i += 2;
|
|
114
|
+
while (i < lines.length && lines[i].trim().includes('|')) {
|
|
115
|
+
rows.push(cells(lines[i].trim()));
|
|
116
|
+
i += 1;
|
|
117
|
+
}
|
|
118
|
+
const headHtml = head.map((cell) => `<th>${inline(cell)}</th>`).join('');
|
|
119
|
+
const bodyHtml = rows
|
|
120
|
+
.map((row) => `<tr>${row.map((cell) => `<td>${inline(cell)}</td>`).join('')}</tr>`)
|
|
121
|
+
.join('');
|
|
122
|
+
out.push(`<table><thead><tr>${headHtml}</tr></thead><tbody>${bodyHtml}</tbody></table>`);
|
|
123
|
+
continue;
|
|
124
|
+
}
|
|
125
|
+
// Blockquote: consecutive "> " lines become one quote of paragraphs.
|
|
126
|
+
if (/^>\s?/.test(trimmed)) {
|
|
127
|
+
flush();
|
|
128
|
+
const quoted = [];
|
|
129
|
+
while (i < lines.length && /^>\s?/.test(lines[i].trim())) {
|
|
130
|
+
quoted.push(lines[i].trim().replace(/^>\s?/, ''));
|
|
131
|
+
i += 1;
|
|
132
|
+
}
|
|
133
|
+
const body = quoted
|
|
134
|
+
.join('\n')
|
|
135
|
+
.split(/\n{2,}/)
|
|
136
|
+
.map((block) => `<p>${inline(block.replace(/\n/g, ' '))}</p>`)
|
|
137
|
+
.join('');
|
|
138
|
+
out.push(`<blockquote>${body}</blockquote>`);
|
|
139
|
+
continue;
|
|
140
|
+
}
|
|
141
|
+
// Lists. A blank line or a non-item line ends the list; nested lists are
|
|
142
|
+
// out of scope on purpose (indentation rules differ per dialect).
|
|
143
|
+
const bullet = /^[-*]\s+(.*)$/.exec(trimmed);
|
|
144
|
+
const ordered = /^\d+[.)]\s+(.*)$/.exec(trimmed);
|
|
145
|
+
if (bullet || ordered) {
|
|
146
|
+
flush();
|
|
147
|
+
const orderedList = Boolean(ordered);
|
|
148
|
+
const items = [];
|
|
149
|
+
while (i < lines.length) {
|
|
150
|
+
const row = lines[i].trim();
|
|
151
|
+
const match = orderedList ? /^\d+[.)]\s+(.*)$/.exec(row) : /^[-*]\s+(.*)$/.exec(row);
|
|
152
|
+
if (!match)
|
|
153
|
+
break;
|
|
154
|
+
items.push(`<li>${inline(match[1].trim())}</li>`);
|
|
155
|
+
i += 1;
|
|
156
|
+
}
|
|
157
|
+
const tag = orderedList ? 'ol' : 'ul';
|
|
158
|
+
out.push(`<${tag}>${items.join('')}</${tag}>`);
|
|
159
|
+
continue;
|
|
160
|
+
}
|
|
161
|
+
// Trailing spaces are meaningful here (a hard break), so unlike every
|
|
162
|
+
// other branch this keeps them.
|
|
163
|
+
paragraph.push(line.replace(/^\s+/, ''));
|
|
164
|
+
i += 1;
|
|
165
|
+
}
|
|
166
|
+
flush();
|
|
167
|
+
return `<div class="sure-markdown">${out.join('\n')}</div>`;
|
|
168
|
+
}
|
|
169
|
+
export default renderMarkdown;
|
|
170
|
+
//# sourceMappingURL=markdown.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"markdown.js","sourceRoot":"","sources":["../src/markdown.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAC7E,EAAE;AACF,6EAA6E;AAC7E,iFAAiF;AACjF,+EAA+E;AAC/E,+EAA+E;AAC/E,6DAA6D;AAC7D,EAAE;AACF,gFAAgF;AAChF,6EAA6E;AAC7E,0EAA0E;AAC1E,6EAA6E;AAC7E,yDAAyD;AAEzD,+DAA+D;AAC/D,MAAM,UAAU,UAAU,CAAC,KAAa;IACtC,OAAO,KAAK,CAAC,OAAO,CAAC,UAAU,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG,EAAE,OAAO,EAAE,CAAC,CAAC,IAAI,CAAE,CAAC,CAAA;AAC9H,CAAC;AAED,MAAM,MAAM,GAAG,sBAAsB,CAAA;AAErC,6EAA6E;AAC7E,MAAM,UAAU,QAAQ,CAAC,IAAY;IACnC,MAAM,KAAK,GAAG,IAAI,CAAC,IAAI,EAAE,CAAA;IACzB,IAAI,KAAK,KAAK,EAAE;QAAE,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAA;IAC9D,IAAI,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,0CAA0C,IAAI,GAAG,CAAC,CAAA;IAC9F,MAAM,M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
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.8",
|
|
4
4
|
"description": "Database schema to production-grade UI — type catalog, validation, sanitization, i18n, audio, and tiered code generation.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"publishConfig": {
|
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
"database-schema"
|
|
85
85
|
],
|
|
86
86
|
"dependencies": {
|
|
87
|
-
"@shing.wong/sure-ui": "^0.
|
|
87
|
+
"@shing.wong/sure-ui": "^0.3.4",
|
|
88
88
|
"pg": "^8.23.0",
|
|
89
89
|
"prettier": "^3.9.6"
|
|
90
90
|
},
|