anentrypoint-design 0.0.472 → 0.0.474

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.472",
3
+ "version": "0.0.474",
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",
@@ -11,6 +11,8 @@
11
11
  "./src/index.js",
12
12
  "./src/styles.js",
13
13
  "./src/markdown-cache.js",
14
+ "./src/theme.js",
15
+ "./src/motion-toggle.js",
14
16
  "./src/components/chat/stats.js",
15
17
  "./src/web-components/freddie-chat.js",
16
18
  "./dist/247420.js"
@@ -87,6 +87,7 @@ function applyEnvelope(msgs, env, sendApprove) {
87
87
 
88
88
  export const chat = makePage((ctx) => {
89
89
  Object.assign(ctx.state, { loading: false, messages: [], draft: '', busy: false, error: null, sessionId: null, ws: null, conn: 'closed', sessions: [], staged: [] });
90
+ let unmounted = false;
90
91
 
91
92
  // Session picker (kimi web's sessions sidebar, compact form): recent
92
93
  // conversations from /api/sessions, needsInput badges included. Picking
@@ -129,6 +130,10 @@ export const chat = makePage((ctx) => {
129
130
  ctx.rerender();
130
131
  }
131
132
  watchReconnect('chat', sendQueuedToServer);
133
+ ctx.onCleanup(() => {
134
+ unmounted = true;
135
+ try { ctx.state.ws && ctx.state.ws.close(); } catch { /* already closed */ }
136
+ });
132
137
 
133
138
  const s = () => ctx.state;
134
139
  const cur = () => s().messages[s().messages.length - 1];
@@ -142,6 +147,7 @@ export const chat = makePage((ctx) => {
142
147
  }
143
148
 
144
149
  function ensureWs() {
150
+ if (unmounted) return null;
145
151
  const st = s();
146
152
  if (!st.sessionId) st.sessionId = newSessionId();
147
153
  if (st.ws && (st.ws.readyState === 1 || st.ws.readyState === 0)) return st.ws;
@@ -36,11 +36,13 @@ function heroNode(hero) {
36
36
  );
37
37
  }
38
38
 
39
+ function __esc(s) { return String(s).replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;'); }
40
+
39
41
  function sectionNode(sec, idx) {
40
42
  const features = sec.features || sec.items || [];
41
43
  const rows = features.map((f, i) => {
42
44
  const kids = [h('div', { key: 't', class: 'ds-feature-title' }, String(f.name || ''))];
43
- if (f.desc) kids.push(h('div', { key: 'd', class: 'ds-feature-desc', innerHTML: String(f.desc).replace(/\`([^\`]+)\`/g, '<code>$1</code>') }));
45
+ if (f.desc) kids.push(h('div', { key: 'd', class: 'ds-feature-desc', innerHTML: __esc(String(f.desc)).replace(/\`([^\`]+)\`/g, '<code>$1</code>') }));
44
46
  if (f.benefit) kids.push(h('div', { key: 'b', class: 'ds-feature-benefit' }, String(f.benefit)));
45
47
  return h('div', { key: i, class: 'ds-feature' }, ...kids);
46
48
  });