anentrypoint-design 0.0.337 → 0.0.339

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "anentrypoint-design",
3
- "version": "0.0.337",
3
+ "version": "0.0.339",
4
4
  "description": "247420 design system SDK — webjsx + modified ripple-ui, single-file ESM bundle for reproducible use of the AnEntrypoint design.",
5
5
  "type": "module",
6
6
  "main": "./dist/247420.js",
@@ -107,13 +107,20 @@ export function Row({ code, rank, title, sub, meta, active, state = 'default', o
107
107
  const railWord = rail === 'flame' ? 'error' : rail === 'purple' ? 'subagent' : null;
108
108
  // `detail` renders as a sibling block AFTER the title/meta children (its own
109
109
  // line via flex-basis:100% in .ds-row-detail), not inside the title span.
110
+ // The same `highlight` search term that marks matches in the collapsed
111
+ // title previously stopped applying the moment a row expanded - the
112
+ // expanded body (often the ONLY place a match beyond the 220-char title
113
+ // window is actually visible) rendered as plain unmarked text.
114
+ const detailNode = (highlight && typeof detail === 'string')
115
+ ? h('span', {}, ...[].concat(highlightTitle(detail, highlight)))
116
+ : detail;
110
117
  return h(isLink ? 'a' : 'div', props,
111
118
  railWord ? h('span', { class: 'sr-only' }, railWord) : null,
112
119
  leading != null ? leading : (codeVal != null ? h('span', { class: 'code' }, codeVal) : null),
113
120
  h('span', { class: 'title', title: typeof title === 'string' ? title : undefined }, titleNode, sub ? h('span', { class: 'sub', title: typeof sub === 'string' ? sub : undefined }, sub) : null),
114
121
  trailing != null ? trailing : (meta != null ? h('span', { class: 'meta' }, meta) : null),
115
122
  actionRow,
116
- detail != null ? h('pre', { class: 'ds-row-detail' }, detail) : null);
123
+ detail != null ? h('pre', { class: 'ds-row-detail' }, detailNode) : null);
117
124
  }
118
125
 
119
126
  export function RowLink({ code, title, sub, meta, href = '#', key, target }) {
package/src/page-html.js CHANGED
@@ -37,12 +37,26 @@ export function slugify(s) {
37
37
  .replace(/\s+/g, '-');
38
38
  }
39
39
 
40
+ // Raw-HTML passthrough block, opt-in via ```html fences. Distinct from a
41
+ // plain ``` code fence (which still escapes+<pre>-wraps its contents) — this
42
+ // is for SSR call sites that are trusted, repo-authored content (a theme.mjs
43
+ // page body sourced from the project's own YAML, never end-user input) and
44
+ // need to emit real markup (e.g. an <iframe> demo embed) that must NOT be
45
+ // escaped. There is no sanitization here by design: the caller owns trust.
46
+ // A consumer rendering untrusted content must not route it through this
47
+ // path — use markdown.js's DOMPurify-backed renderMarkdown for that instead.
40
48
  export function renderMarkdown(md) {
41
49
  const lines = String(md || '').split('\n');
42
50
  const out = [];
43
- let inCode = false, inList = false;
51
+ let inCode = false, inList = false, inRawHtml = false;
44
52
  for (const line of lines) {
45
- if (line.startsWith('```')) { if (inCode) { out.push('</pre>'); inCode = false; } else { out.push('<pre>'); inCode = true; } continue; }
53
+ if (line.trim() === '```html') { if (!inCode) { inRawHtml = true; continue; } }
54
+ if (line.startsWith('```')) {
55
+ if (inRawHtml) { inRawHtml = false; continue; }
56
+ if (inCode) { out.push('</pre>'); inCode = false; } else { out.push('<pre>'); inCode = true; }
57
+ continue;
58
+ }
59
+ if (inRawHtml) { out.push(line); continue; }
46
60
  if (inCode) { out.push(escape(line)); continue; }
47
61
  if (line.startsWith('# ')) { const t = line.slice(2); out.push(`<h1 id="${slugify(t)}">${escape(t)}</h1>`); }
48
62
  else if (line.startsWith('## ')) { const t = line.slice(3); out.push(`<h2 id="${slugify(t)}">${escape(t)}</h2>`); }