anentrypoint-design 0.0.101 → 0.0.103

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 (78) hide show
  1. package/app-shell.css +464 -1997
  2. package/colors_and_type.css +140 -626
  3. package/dist/247420.css +578 -2741
  4. package/dist/247420.js +23 -62
  5. package/package.json +22 -23
  6. package/src/bootstrap.js +5 -18
  7. package/src/components/chat.js +15 -15
  8. package/src/components/community.js +9 -7
  9. package/src/components/content.js +71 -54
  10. package/src/components/files-modals.js +4 -2
  11. package/src/components/files.js +6 -14
  12. package/src/components/freddie/helpers.js +38 -77
  13. package/src/components/freddie.js +32 -16
  14. package/src/components/shell.js +22 -15
  15. package/src/components.js +7 -3
  16. package/src/debug.js +21 -30
  17. package/src/deck-stage.js +10 -6
  18. package/src/highlight.js +25 -11
  19. package/src/index.js +29 -5
  20. package/src/{desktop → kits/os}/freddie/helpers.js +1 -1
  21. package/src/{desktop → kits/os}/freddie/pages-chat.js +2 -2
  22. package/src/{desktop → kits/os}/freddie/pages-core.js +2 -2
  23. package/src/{desktop → kits/os}/freddie/pages-os.js +1 -1
  24. package/src/{desktop → kits/os}/freddie/pages-tools.js +2 -2
  25. package/src/{desktop → kits/os}/freddie-dashboard.js +2 -2
  26. package/src/markdown.js +27 -49
  27. package/src/motion.js +30 -17
  28. package/src/page-html.js +18 -116
  29. package/src/styles.js +14 -22
  30. package/src/web-components/ds-chat.js +24 -56
  31. package/dist/247420.app.js +0 -5
  32. package/dist/fonts/archivo_v25_k3k6o8UDI-1M0wlSV9XAw6lQkqWY8Q82sJaRE-NWIDdgffTT0zRp8A.ttf +0 -0
  33. package/dist/fonts/archivo_v25_k3k6o8UDI-1M0wlSV9XAw6lQkqWY8Q82sJaRE-NWIDdgffTT6jRp8A.ttf +0 -0
  34. package/dist/fonts/archivo_v25_k3k6o8UDI-1M0wlSV9XAw6lQkqWY8Q82sJaRE-NWIDdgffTTBjNp8A.ttf +0 -0
  35. package/dist/fonts/archivo_v25_k3k6o8UDI-1M0wlSV9XAw6lQkqWY8Q82sJaRE-NWIDdgffTTNDNp8A.ttf +0 -0
  36. package/dist/fonts/archivo_v25_k3k6o8UDI-1M0wlSV9XAw6lQkqWY8Q82sJaRE-NWIDdgffTTnTRp8A.ttf +0 -0
  37. package/dist/fonts/archivo_v25_k3k6o8UDI-1M0wlSV9XAw6lQkqWY8Q82sJaRE-NWIDdgffTTtDRp8A.ttf +0 -0
  38. package/dist/fonts/archivonarrow_v35_tss5ApVBdCYD5Q7hcxTE1ArZ0Zz8oY2KRmwvKhhv8laKpA.ttf +0 -0
  39. package/dist/fonts/archivonarrow_v35_tss5ApVBdCYD5Q7hcxTE1ArZ0Zz8oY2KRmwvKhhvHlGKpA.ttf +0 -0
  40. package/dist/fonts/archivonarrow_v35_tss5ApVBdCYD5Q7hcxTE1ArZ0Zz8oY2KRmwvKhhvLFGKpA.ttf +0 -0
  41. package/dist/fonts/archivonarrow_v35_tss5ApVBdCYD5Q7hcxTE1ArZ0Zz8oY2KRmwvKhhvy1aKpA.ttf +0 -0
  42. package/dist/fonts/jetbrainsmono_v24_tDbY2o-flEEny0FZhsfKu5WU4zr3E_BX0PnT8RD8-qxjPQ.ttf +0 -0
  43. package/dist/fonts/jetbrainsmono_v24_tDbY2o-flEEny0FZhsfKu5WU4zr3E_BX0PnT8RD8FqtjPQ.ttf +0 -0
  44. package/dist/fonts/jetbrainsmono_v24_tDbY2o-flEEny0FZhsfKu5WU4zr3E_BX0PnT8RD8L6tjPQ.ttf +0 -0
  45. package/dist/fonts/jetbrainsmono_v24_tDbY2o-flEEny0FZhsfKu5WU4zr3E_BX0PnT8RD8yKxjPQ.ttf +0 -0
  46. package/dist/fonts/jetbrainsmono_v24_tDba2o-flEEny0FZhsfKu5WU4xD-IQ-PuZJJXxfpAO-LflOQ.ttf +0 -0
  47. package/dist/fonts/jetbrainsmono_v24_tDba2o-flEEny0FZhsfKu5WU4xD-IQ-PuZJJXxfpAO9seVOQ.ttf +0 -0
  48. package/dist/fonts/spacegrotesk_v22_V8mQoQDjQSkFtoMM3T6r8E7mF71Q-gOoraIAEj42Vksj.ttf +0 -0
  49. package/dist/fonts/spacegrotesk_v22_V8mQoQDjQSkFtoMM3T6r8E7mF71Q-gOoraIAEj4PVksj.ttf +0 -0
  50. package/dist/fonts/spacegrotesk_v22_V8mQoQDjQSkFtoMM3T6r8E7mF71Q-gOoraIAEj7aUUsj.ttf +0 -0
  51. package/dist/fonts/spacegrotesk_v22_V8mQoQDjQSkFtoMM3T6r8E7mF71Q-gOoraIAEj7oUUsj.ttf +0 -0
  52. package/src/app.js +0 -156
  53. package/src/components/freddie/pages-chains.js +0 -168
  54. package/src/components/freddie/pages-chat.js +0 -122
  55. package/src/components/freddie/pages-config-edit.js +0 -174
  56. package/src/components/freddie/pages-config.js +0 -193
  57. package/src/components/freddie/pages-core.js +0 -170
  58. package/src/components/freddie/pages-runtime.js +0 -69
  59. package/src/components/freddie/pages-voice.js +0 -109
  60. package/src/web-components/freddie-chat.js +0 -34
  61. /package/src/{desktop → kits/os}/about-app.js +0 -0
  62. /package/src/{desktop → kits/os}/app-panes.css +0 -0
  63. /package/src/{desktop → kits/os}/browser-app.js +0 -0
  64. /package/src/{desktop → kits/os}/files-app.js +0 -0
  65. /package/src/{desktop → kits/os}/freddie/routes.js +0 -0
  66. /package/src/{desktop → kits/os}/freddie-dashboard.css +0 -0
  67. /package/src/{desktop → kits/os}/icons.js +0 -0
  68. /package/src/{desktop → kits/os}/index.js +0 -0
  69. /package/src/{desktop → kits/os}/launcher.css +0 -0
  70. /package/src/{desktop → kits/os}/launcher.js +0 -0
  71. /package/src/{desktop → kits/os}/monitor-app.js +0 -0
  72. /package/src/{desktop → kits/os}/shell.js +0 -0
  73. /package/src/{desktop → kits/os}/terminal-app.js +0 -0
  74. /package/src/{desktop → kits/os}/theme.css +0 -0
  75. /package/src/{desktop → kits/os}/validate.css +0 -0
  76. /package/src/{desktop → kits/os}/validator-app.js +0 -0
  77. /package/src/{desktop → kits/os}/wm.css +0 -0
  78. /package/src/{desktop → kits/os}/wm.js +0 -0
package/src/motion.js CHANGED
@@ -1,22 +1,35 @@
1
- function hasDom() {
2
- return typeof document !== 'undefined';
3
- }
4
-
5
- export function shouldReduceMotion() {
6
- return true;
7
- }
1
+ // Minimal motion — the SDK historically wired animate.css for entry
2
+ // flourishes. We tone this down: no animate.css, just a single GPU-friendly
3
+ // fade-up on first paint. animateTree() walks once and marks rendered nodes
4
+ // so it doesn't re-animate on every applyDiff.
8
5
 
9
6
  export function installMotion() {
7
+ if (typeof document === 'undefined') return;
8
+ if (document.getElementById('ds-247420-motion')) return;
9
+ const style = document.createElement('style');
10
+ style.id = 'ds-247420-motion';
11
+ style.textContent = `
12
+ @media (prefers-reduced-motion: no-preference) {
13
+ .ds-247420 [data-anim="in"] {
14
+ opacity: 0; transform: translateY(8px);
15
+ transition: opacity 320ms cubic-bezier(.2,0,0,1), transform 320ms cubic-bezier(.2,0,0,1);
16
+ }
17
+ .ds-247420 [data-anim="ready"] {
18
+ opacity: 1; transform: translateY(0);
19
+ }
20
+ }`.trim();
21
+ document.head.appendChild(style);
10
22
  }
11
23
 
12
- export function animateElement(el, name, opts = {}) {
13
- return Promise.resolve(false);
14
- }
15
-
16
- export function animateSelector(selector, name, opts = {}) {
17
- return Promise.resolve(false);
18
- }
19
-
20
- export function animateTree(root, opts = {}) {
21
- return 0;
24
+ export function animateTree(root) {
25
+ if (!root || typeof root.querySelectorAll !== 'function') return;
26
+ // Mark sections / hero / panels for entry.
27
+ const targets = root.querySelectorAll('.ds-hero,.panel,.ds-section,.app-main > *');
28
+ targets.forEach((el, i) => {
29
+ if (el.dataset.anim === 'ready') return;
30
+ el.dataset.anim = 'in';
31
+ // stagger up to 6 elements, then snap the rest in
32
+ const delay = Math.min(i, 6) * 30;
33
+ setTimeout(() => { el.dataset.anim = 'ready'; }, delay);
34
+ });
22
35
  }
package/src/page-html.js CHANGED
@@ -1,125 +1,27 @@
1
- // Static-site page HTML renderer. Consumes structured page YAML
2
- // (hero/sections/examples/body) and emits a complete <!doctype html>
3
- // scaffold with rail-coloured sections and SDK styles loaded from unpkg.
4
- // Used by 247420-flavoured doc sites (e.g. flatspace consumers).
1
+ // Server-side / static rendering helper. Generates a full HTML document
2
+ // using the SDK scope and the prefixed CSS bundle.
5
3
 
6
- const RAILS = ['rail-green', 'rail-purple', 'rail-mascot', 'rail-sun', 'rail-flame', 'rail-sky'];
7
- const DOTS = ['green', 'purple', 'mascot', 'sun', 'flame', 'sky'];
4
+ const SCOPE = 'ds-247420';
8
5
 
9
- export function escape(s) {
10
- return String(s).replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;');
11
- }
12
-
13
- export function inlineMd(s) {
14
- return s
15
- .replace(/`([^`]+)`/g, '<code>$1</code>')
16
- .replace(/\*\*([^*]+)\*\*/g, '<strong>$1</strong>')
17
- .replace(/\[([^\]]+)\]\(([^)]+)\)/g, '<a href="$2">$1</a>');
18
- }
19
-
20
- export function renderMarkdown(md) {
21
- const lines = String(md || '').split('\n');
22
- const out = [];
23
- let inCode = false, inList = false;
24
- for (const line of lines) {
25
- if (line.startsWith('```')) { if (inCode) { out.push('</pre>'); inCode = false; } else { out.push('<pre>'); inCode = true; } continue; }
26
- if (inCode) { out.push(escape(line)); continue; }
27
- if (line.startsWith('# ')) out.push(`<h1>${escape(line.slice(2))}</h1>`);
28
- else if (line.startsWith('## ')) out.push(`<h2>${escape(line.slice(3))}</h2>`);
29
- else if (line.startsWith('### ')) out.push(`<h3>${escape(line.slice(4))}</h3>`);
30
- else if (line.startsWith('- ')) { if (!inList) { out.push('<ul>'); inList = true; } out.push(`<li>${inlineMd(escape(line.slice(2)))}</li>`); }
31
- else { if (inList) { out.push('</ul>'); inList = false; } if (line.trim()) out.push(`<p>${inlineMd(escape(line))}</p>`); }
32
- }
33
- if (inList) out.push('</ul>');
34
- if (inCode) out.push('</pre>');
35
- return out.join('\n');
36
- }
37
-
38
- function heroBlock(hero, title) {
39
- if (!hero) return '';
40
- const badges = Array.isArray(hero.badges) && hero.badges.length
41
- ? `<div class="ds-hero-badges">${hero.badges.map(b => `<span class="chip"><strong>${escape(b.label || '')}</strong>${b.desc ? `<span class="dim"> ${escape(b.desc)}</span>` : ''}</span>`).join(' ')}</div>` : '';
42
- const ctas = Array.isArray(hero.ctas) && hero.ctas.length
43
- ? `<div class="ds-hero-ctas">${hero.ctas.map((c, i) => `<a class="${i === 0 ? 'btn-primary' : 'btn'}" href="${escape(c.href || '#')}">${escape(c.label || c.cta || 'go')}</a>`).join('')}</div>` : '';
44
- return `<div class="ds-hero">
45
- <h1 class="ds-hero-title">${escape(hero.heading || hero.title || title)}</h1>
46
- ${hero.subheading ? `<p class="ds-hero-body">${escape(hero.subheading)}${hero.accent ? ` <span class="ds-hero-accent">${escape(hero.accent)}</span>` : ''}</p>` : ''}
47
- ${hero.body ? `<p class="ds-hero-body">${escape(hero.body)}</p>` : ''}
48
- ${badges}
49
- ${ctas}
50
- </div>`;
51
- }
52
-
53
- function sectionBlocks(sections) {
54
- return (Array.isArray(sections) ? sections : []).map((sec, idx) => {
55
- const rail = RAILS[idx % RAILS.length];
56
- const dot = DOTS[idx % DOTS.length];
57
- const items = (sec.features || sec.items || []).map((f) => {
58
- const benefit = f.benefit ? `<div class="row-benefit">${escape(f.benefit)}</div>` : '';
59
- return `<div class="row ${rail}">
60
- <span class="dot dot-${dot}" aria-hidden="true"></span>
61
- <span class="title">${escape(f.name)}</span>
62
- ${f.desc ? `<div class="sub">${inlineMd(escape(f.desc))}</div>` : ''}
63
- ${benefit}
64
- </div>`;
65
- }).join('\n');
66
- const lede = sec.lede || (sec.body && sec.body.length < 240 ? sec.body : '');
67
- return `<section class="ds-section ${rail}" id="${escape(sec.id || '')}">
68
- <h2 class="ds-section-title">${escape(sec.name || sec.title || sec.id)}</h2>
69
- ${lede ? `<p class="ds-lede">${escape(lede)}</p>` : ''}
70
- ${items}
71
- ${sec.body && sec.body.length >= 240 ? renderMarkdown(sec.body) : ''}
72
- </section>`;
73
- }).join('\n');
74
- }
75
-
76
- function examplesBlock(examples) {
77
- if (!Array.isArray(examples) || !examples.length) return '';
78
- return `<section class="ds-section">
79
- <h2 class="ds-section-title">explore</h2>
80
- ${examples.map((e, i) => {
81
- const rail = RAILS[(i + 1) % RAILS.length];
82
- return `<a class="row ${rail}" href="${escape(e.href || '#')}">
83
- <span class="code">${String(i + 1).padStart(2, '0')}</span>
84
- <span class="title">${escape(e.label || e.name || e.href)}</span>
85
- ${e.desc ? `<span class="meta dim"> — ${escape(e.desc)}</span>` : ''}
86
- <span class="ds-row-arrow">↗</span>
87
- </a>`;
88
- }).join('\n')}
89
- </section>`;
90
- }
91
-
92
- export function renderPageHtml({ title, slug, hero, sections, examples, body, navItems = [], siteName = 'Freddie' }) {
93
- const main = heroBlock(hero, title) + sectionBlocks(sections) + examplesBlock(examples)
94
- + (body ? `<section class="ds-section page-body">${renderMarkdown(body)}</section>` : '');
6
+ export function renderPageHtml({ title = '247420', body = '', headExtra = '', theme = 'light', cssHref } = {}) {
7
+ const cssLink = cssHref
8
+ ? `<link rel="stylesheet" href="${cssHref}">`
9
+ : `<link rel="stylesheet" href="https://unpkg.com/anentrypoint-design@latest/dist/247420.css">`;
95
10
  return `<!doctype html>
96
- <html lang="en" class="ds-247420" data-theme="light">
11
+ <html lang="en" class="${SCOPE}" data-theme="${theme}">
97
12
  <head>
98
- <meta charset="utf-8">
99
- <meta name="viewport" content="width=device-width, initial-scale=1">
100
- <title>${escape(title)} — ${escape(siteName)}</title>
101
- <link rel="stylesheet" href="https://unpkg.com/anentrypoint-design@latest/dist/247420.css">
102
- <script type="importmap">
103
- { "imports": { "anentrypoint-design": "https://unpkg.com/anentrypoint-design@latest/dist/247420.js" } }
104
- </script>
105
- <style>
106
- .app-stage { max-width: 1100px; margin: 0 auto; padding: 24px }
107
- .page-body h1 { margin-top: 0 } .page-body h2 { margin-top: 32px } .page-body h3 { margin-top: 24px }
108
- .page-body pre { margin: 12px 0; background: var(--panel-2); padding: 12px; border-radius: 8px; overflow-x: auto }
109
- </style>
13
+ <meta charset="utf-8">
14
+ <meta name="viewport" content="width=device-width, initial-scale=1">
15
+ <title>${escapeHtml(title)}</title>
16
+ ${cssLink}
17
+ ${headExtra}
110
18
  </head>
111
19
  <body>
112
- <div id="app"></div>
113
- <script type="module">
114
- import { mount, components as C } from 'anentrypoint-design';
115
- const navItems = ${JSON.stringify(navItems)};
116
- mount(document.getElementById('app'), () => C.AppShell({
117
- topbar: C.Topbar({ brand: ${JSON.stringify(siteName)}, items: navItems, active: ${JSON.stringify(title)} }),
118
- crumb: C.Crumb({ leaf: ${JSON.stringify(title)} }),
119
- main: C.h('div', { class: 'app-stage', innerHTML: ${JSON.stringify(main)} }),
120
- status: C.Status({ left: [${JSON.stringify(siteName.toLowerCase())}, ${JSON.stringify(slug)}], right: ['live'] })
121
- }));
122
- </script>
20
+ <div id="app">${body}</div>
123
21
  </body>
124
22
  </html>`;
125
23
  }
24
+
25
+ function escapeHtml(s) {
26
+ return String(s).replace(/[&<>"]/g, (c) => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;' })[c]);
27
+ }