@invisibleloop/pulse 0.1.36 → 0.1.38

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.
@@ -63,6 +63,7 @@ function prevNextBar(prev, next) {
63
63
 
64
64
  export function renderLayout({ currentHref, content, prev = null, next = null }) {
65
65
  return `
66
+ <a href="#main-content" class="skip-link">Skip to main content</a>
66
67
  <div class="sidebar-overlay" aria-hidden="true"></div>
67
68
  ${sidebar(currentHref)}
68
69
  <div class="docs-main">
@@ -77,14 +78,14 @@ export function renderLayout({ currentHref, content, prev = null, next = null })
77
78
  <path d="M13 2L4.5 13.5H11L10 22L19.5 10.5H13L13 2Z" fill="var(--accent)" stroke="var(--accent)" stroke-width="1" stroke-linejoin="round"/>
78
79
  </svg>
79
80
  </a>
80
- <a href="https://github.com/invisibleloop/pulse-framework" class="header-github" aria-label="View on GitHub" target="_blank" rel="noopener noreferrer">
81
+ <a href="https://github.com/invisibleloop/pulse-framework" class="header-github" aria-label="View on GitHub (opens in new tab)" target="_blank" rel="noopener noreferrer">
81
82
  <svg width="20" height="20" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true">
82
83
  <path d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z"/>
83
84
  </svg>
84
85
  GitHub
85
86
  </a>
86
87
  </header>
87
- <main class="docs-content">
88
+ <main class="docs-content" id="main-content">
88
89
  ${content}
89
90
  ${prevNextBar(prev, next)}
90
91
  </main>
@@ -119,12 +120,13 @@ export function codeBlock(highlighted, filename = '') {
119
120
  return `${header}<pre class="code-block"><code>${highlighted}</code></pre>`
120
121
  }
121
122
 
122
- export function table(headers, rows) {
123
+ export function table(headers, rows, caption = '') {
124
+ const cap = caption ? `<caption>${esc(caption)}</caption>` : ''
123
125
  const ths = headers.map(h => `<th scope="col">${h}</th>`).join('')
124
126
  const trs = rows.map(row =>
125
127
  `<tr>${row.map(cell => `<td>${cell}</td>`).join('')}</tr>`
126
128
  ).join('')
127
- return `<div class="table-wrap"><table><thead><tr>${ths}</tr></thead><tbody>${trs}</tbody></table></div>`
129
+ return `<div class="table-wrap"><table>${cap}<thead><tr>${ths}</tr></thead><tbody>${trs}</tbody></table></div>`
128
130
  }
129
131
 
130
132
  export function callout(type, content) {
@@ -156,7 +156,7 @@ onError: (state, err) => ({
156
156
  }),`, 'js'))}
157
157
  <p><code>_toast</code> works in <code>onStart</code>, <code>onSuccess</code>, and <code>onError</code>, and also in mutations. The toast container is injected into <code>document.body</code> once and survives client-side navigations.</p>
158
158
  ${table(
159
- ['Option', 'Type', 'Default', ''],
159
+ ['Option', 'Type', 'Default', 'Description'],
160
160
  [
161
161
  ['<code>message</code>', 'string', '—', 'Required. The notification text.'],
162
162
  ['<code>variant</code>', '<code>success | error | warning | info</code>', '<code>info</code>', ''],
@@ -45,7 +45,7 @@ export default {
45
45
 
46
46
  ${section('vs-validation', 'Constraints vs Validation')}
47
47
  ${table(
48
- ['', 'Constraints', 'Validation'],
48
+ ['Aspect', 'Constraints', 'Validation'],
49
49
  [
50
50
  ['When it runs', 'After <strong>every</strong> mutation, automatically', 'Only when an action has <code>validate: true</code>'],
51
51
  ['What it does', 'Clamps numeric values silently', 'Rejects the action and surfaces errors'],
@@ -22,8 +22,8 @@ export default {
22
22
 
23
23
  ${section('requirements', 'Requirements')}
24
24
  <ul>
25
- <li><strong>Node.js 22 or later</strong> — <a href="https://nodejs.org" target="_blank" rel="noopener">nodejs.org</a></li>
26
- <li><strong>Claude Code</strong> — the CLI for Claude, installed and authenticated — <a href="https://docs.anthropic.com/en/docs/claude-code/getting-started" target="_blank" rel="noopener">installation guide</a></li>
25
+ <li><strong>Node.js 22 or later</strong> — <a href="https://nodejs.org" target="_blank" rel="noopener" aria-label="nodejs.org (opens in new tab)">nodejs.org</a></li>
26
+ <li><strong>Claude Code</strong> — the CLI for Claude, installed and authenticated — <a href="https://docs.anthropic.com/en/docs/claude-code/getting-started" target="_blank" rel="noopener" aria-label="Claude Code installation guide (opens in new tab)">installation guide</a></li>
27
27
  </ul>
28
28
  <p>Claude Code provides the <code>claude</code> command. Pulse launches it automatically with the Pulse MCP server wired in — so the agent has instant access to the framework reference, your project structure, and all Pulse tools without any manual configuration.</p>
29
29
  ${callout('note', 'GitHub Copilot integration is coming soon. For now, Pulse works exclusively with Claude Code.')}
@@ -55,7 +55,7 @@ export default {
55
55
  </a>
56
56
  <div class="home-nav-links">
57
57
  <a href="/getting-started">Docs</a>
58
- <a href="https://github.com/invisibleloop/pulse-framework" target="_blank" rel="noopener">GitHub</a>
58
+ <a href="https://github.com/invisibleloop/pulse-framework" target="_blank" rel="noopener" aria-label="GitHub (opens in new tab)">GitHub</a>
59
59
  </div>
60
60
  </nav>
61
61
 
@@ -398,7 +398,7 @@ export default {
398
398
 
399
399
  </main>
400
400
  <footer class="home-footer">
401
- <p>MIT License · <a href="https://github.com/invisibleloop/pulse-framework" target="_blank" rel="noopener">GitHub</a> · <a href="/getting-started">Get started in 2 minutes</a></p>
401
+ <p>MIT License · <a href="https://github.com/invisibleloop/pulse-framework" target="_blank" rel="noopener" aria-label="GitHub (opens in new tab)">GitHub</a> · <a href="/getting-started">Get started in 2 minutes</a></p>
402
402
  </footer>
403
403
  </div>
404
404
  `,
@@ -68,7 +68,7 @@ export default {
68
68
  ${callout('tip', 'Use an absolute URL for <code>ogImage</code> — social media crawlers need the full URL to fetch the image. Recommended size: 1200×630 pixels.')}
69
69
 
70
70
  ${section('structured-data', 'Structured data (ld+json)')}
71
- <p>The <code>schema</code> field accepts a plain object conforming to <a href="https://schema.org" target="_blank" rel="noopener">schema.org</a> vocabulary. Pulse serialises it as a <code>&lt;script type="application/ld+json"&gt;</code> tag in the head:</p>
71
+ <p>The <code>schema</code> field accepts a plain object conforming to <a href="https://schema.org" target="_blank" rel="noopener" aria-label="schema.org (opens in new tab)">schema.org</a> vocabulary. Pulse serialises it as a <code>&lt;script type="application/ld+json"&gt;</code> tag in the head:</p>
72
72
  ${codeBlock(highlight(`meta: {
73
73
  title: 'How to make sourdough — My Blog',
74
74
  schema: {
@@ -230,7 +230,7 @@ Cross-Origin-Resource-Policy: same-origin`, 'bash'))}
230
230
  ${section('hsts', 'HSTS')}
231
231
  <p>When a request arrives with <code>x-forwarded-proto: https</code> (or over a TLS socket), Pulse adds:</p>
232
232
  ${codeBlock(highlight(`Strict-Transport-Security: max-age=31536000; includeSubDomains; preload`, 'bash'))}
233
- <p>This is automatic — no configuration required. On plain HTTP the header is omitted. The <code>preload</code> directive means you can submit the domain to <a href="https://hstspreload.org" target="_blank" rel="noopener">hstspreload.org</a> so browsers enforce HTTPS before the first connection — this is a separate manual step, not automatic.</p>
233
+ <p>This is automatic — no configuration required. On plain HTTP the header is omitted. The <code>preload</code> directive means you can submit the domain to <a href="https://hstspreload.org" target="_blank" rel="noopener" aria-label="hstspreload.org (opens in new tab)">hstspreload.org</a> so browsers enforce HTTPS before the first connection — this is a separate manual step, not automatic.</p>
234
234
 
235
235
  ${section('cookies', 'Cookie defaults')}
236
236
  <p>Cookies set via <code>ctx.setCookie()</code> default to <code>SameSite=Lax</code>. CSRF protection is on by default — omitting a <code>sameSite</code> option does not weaken it.</p>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@invisibleloop/pulse",
3
- "version": "0.1.36",
3
+ "version": "0.1.38",
4
4
  "type": "module",
5
5
  "description": "AI-first frontend framework. The spec is the source of truth.",
6
6
  "license": "MIT",
@@ -1 +1 @@
1
- 0.1.36
1
+ 0.1.38
@@ -1633,7 +1633,7 @@ hr.ui-divider {
1633
1633
  .ui-code-window-lang {
1634
1634
  font-size: .7rem;
1635
1635
  font-family: var(--ui-mono);
1636
- color: var(--ui-muted);
1636
+ color: #9898b2;
1637
1637
  margin-left: auto;
1638
1638
  }
1639
1639