anentrypoint-design 0.0.209 → 0.0.210

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.209",
3
+ "version": "0.0.210",
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",
@@ -305,15 +305,60 @@ export function AppShell({ topbar, crumb, side, main, status, narrow } = {}) {
305
305
  function toggleWs(which) {
306
306
  const shell = document.querySelector('.ws-shell');
307
307
  if (!shell) return;
308
- const cls = which === 'pane' ? 'ws-pane-collapsed' : 'ws-rail-collapsed';
308
+ const cls = which === 'pane' ? 'ws-pane-collapsed'
309
+ : which === 'sessions' ? 'ws-sessions-collapsed'
310
+ : 'ws-rail-collapsed';
309
311
  const nowCollapsed = shell.classList.toggle(cls);
310
- const btn = document.querySelector('.ws-' + which + '-toggle');
311
- if (btn) btn.setAttribute('aria-expanded', nowCollapsed ? 'false' : 'true');
312
+ document.querySelectorAll('.ws-' + which + '-toggle').forEach((btn) =>
313
+ btn.setAttribute('aria-expanded', nowCollapsed ? 'false' : 'true'));
312
314
  try {
313
315
  localStorage.setItem('ds.ws.' + which, nowCollapsed ? 'collapsed' : 'open');
314
316
  } catch (_) {}
315
317
  }
316
318
 
319
+ // Column resize: read the current rendered track width and write a clamped inline
320
+ // --ws-<col>-w on .ws-shell (inline overrides the fluid clamp base), persisted.
321
+ const WS_RESIZE_CLAMP = { rail: [60, 360], sessions: [200, 520], pane: [240, 560] };
322
+ function wsResize(col, dx) {
323
+ const shell = document.querySelector('.ws-shell');
324
+ if (!shell) return;
325
+ const track = shell.querySelector('.ws-' + col);
326
+ const cur = track ? track.getBoundingClientRect().width : 0;
327
+ const [lo, hi] = WS_RESIZE_CLAMP[col] || [120, 600];
328
+ const next = Math.max(lo, Math.min(hi, Math.round(cur + dx)));
329
+ shell.style.setProperty('--ws-' + col + '-w', next + 'px');
330
+ try { localStorage.setItem('ds.ws.w.' + col, String(next)); } catch (_) {}
331
+ }
332
+ function seedWsWidths(el) {
333
+ if (!el) return;
334
+ ['rail', 'sessions', 'pane'].forEach((col) => {
335
+ try {
336
+ const v = localStorage.getItem('ds.ws.w.' + col);
337
+ if (v && /^\d+$/.test(v)) el.style.setProperty('--ws-' + col + '-w', v + 'px');
338
+ } catch (_) {}
339
+ });
340
+ }
341
+ function WsResizer(col) {
342
+ const onKey = (e) => {
343
+ if (e.key === 'ArrowLeft') { e.preventDefault(); wsResize(col, -16); }
344
+ else if (e.key === 'ArrowRight') { e.preventDefault(); wsResize(col, 16); }
345
+ };
346
+ const onDown = (e) => {
347
+ e.preventDefault();
348
+ let lastX = e.clientX;
349
+ const move = (ev) => { const dx = ev.clientX - lastX; lastX = ev.clientX; wsResize(col, dx); };
350
+ const up = () => { document.removeEventListener('pointermove', move); document.removeEventListener('pointerup', up); document.body.style.cursor = ''; };
351
+ document.addEventListener('pointermove', move);
352
+ document.addEventListener('pointerup', up);
353
+ document.body.style.cursor = 'col-resize';
354
+ };
355
+ return h('div', {
356
+ class: 'ws-resizer ws-resizer-' + col, role: 'separator', tabindex: '0',
357
+ 'aria-orientation': 'vertical', 'aria-label': 'resize ' + col + ' column (arrow keys)',
358
+ onpointerdown: onDown, onkeydown: onKey,
359
+ });
360
+ }
361
+
317
362
  // Toggle a mobile WorkspaceShell DRAWER (sessions or pane). Distinct from the
318
363
  // desktop width-collapse (toggleWs): on mobile the columns are fixed overlays
319
364
  // revealed by .ws-sessions-open / .ws-pane-open. Opening one closes the other
@@ -394,7 +439,7 @@ export function WorkspaceShell({ rail, sessions, main, pane, crumb, status, narr
394
439
  + (((hasPane && paneIsCollapsed) || keepPaneTrack) ? ' ws-pane-collapsed' : '')
395
440
  + (hasSessions ? '' : ' ws-no-sessions')
396
441
  + (narrow ? ' narrow' : '');
397
- return h('div', { class: shellCls },
442
+ return h('div', { class: shellCls, ref: seedWsWidths },
398
443
  h('a', { href: '#ws-main', class: 'skip-link' }, 'skip to main content'),
399
444
  // Left rail column. Its own toggle collapses it to icon-only.
400
445
  h('nav', { class: 'ws-rail', role: 'navigation', 'aria-label': railLabel },
@@ -430,6 +475,13 @@ export function WorkspaceShell({ rail, sessions, main, pane, crumb, status, narr
430
475
  'aria-label': 'toggle conversations', 'aria-expanded': 'false',
431
476
  onclick: () => toggleWsDrawer('sessions'),
432
477
  }, Icon('thread')) : null,
478
+ // Desktop-only sessions collapse (reclaims its width for a
479
+ // full-width thread/grid). Hidden on mobile via CSS.
480
+ hasSessions ? h('button', {
481
+ class: 'ws-desktop-toggle ws-sessions-toggle', type: 'button',
482
+ 'aria-label': 'collapse conversations', title: 'collapse conversations',
483
+ 'aria-expanded': 'true', onclick: () => toggleWs('sessions'),
484
+ }, Icon('chevron-left')) : null,
433
485
  h('div', { class: 'ws-crumb-main' }, crumb),
434
486
  hasPane ? h('button', {
435
487
  class: 'ws-drawer-toggle ws-pane-drawer-toggle', type: 'button',
@@ -452,6 +504,10 @@ export function WorkspaceShell({ rail, sessions, main, pane, crumb, status, narr
452
504
  }, Icon(paneIsCollapsed ? 'chevron-left' : 'chevron-right')),
453
505
  pane)
454
506
  : null,
507
+ // Keyboard/pointer column resize handles (desktop only).
508
+ (!narrow && !railIsCollapsed) ? WsResizer('rail') : null,
509
+ (!narrow && hasSessions) ? WsResizer('sessions') : null,
510
+ (!narrow && hasPane && !paneIsCollapsed) ? WsResizer('pane') : null,
455
511
  );
456
512
  }
457
513