anentrypoint-design 0.0.202 → 0.0.204

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.202",
3
+ "version": "0.0.204",
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,8 +107,8 @@ export function RowLink({ code, title, sub, meta, href = '#', key, target }) {
107
107
  return Row({ code, title, sub, meta, href, kind: 'link', key, target });
108
108
  }
109
109
 
110
- export function Section({ title, eyebrow, children }) {
111
- return h('section', { class: 'ds-section' },
110
+ export function Section({ title, eyebrow, children, id }) {
111
+ return h('section', { class: 'ds-section', id: id || null },
112
112
  eyebrow ? h('span', { class: 'eyebrow' }, eyebrow) : null,
113
113
  title ? h('h3', {}, title) : null,
114
114
  ...(Array.isArray(children) ? children : [children])
@@ -240,14 +240,18 @@ export function Status({ left = [], right = [] } = {}) {
240
240
  );
241
241
  }
242
242
 
243
- // Toggle the mobile sidebar drawer. Pure-DOM because AppShell is stateless
244
- // chrome; the class lives on .app-body and is read by the <=900px media query.
245
- function toggleSide(open) {
246
- const body = document.querySelector('.app-body');
243
+ // Toggle the sidebar drawer. Pure-DOM because AppShell is stateless chrome; the
244
+ // class lives on .app-body and is read by the @container(max-width:900px) query.
245
+ // `fromEl` scopes the toggle to the shell that owns the clicked control — without
246
+ // it, document.querySelector grabs the FIRST .app-body on the page, so a second
247
+ // dashboard instance (multiple thebird WM windows) would toggle the wrong drawer.
248
+ function toggleSide(open, fromEl) {
249
+ const shell = (fromEl && fromEl.closest && fromEl.closest('.app')) || document;
250
+ const body = shell.querySelector('.app-body');
247
251
  if (!body) return;
248
252
  const next = open != null ? open : !body.classList.contains('side-open');
249
253
  body.classList.toggle('side-open', next);
250
- const btn = document.querySelector('.app-side-toggle');
254
+ const btn = shell.querySelector('.app-side-toggle');
251
255
  if (btn) btn.setAttribute('aria-expanded', next ? 'true' : 'false');
252
256
  }
253
257
 
@@ -267,12 +271,12 @@ export function AppShell({ topbar, crumb, side, main, status, narrow } = {}) {
267
271
  hasSide ? h('button', {
268
272
  class: 'app-side-toggle', type: 'button',
269
273
  'aria-label': 'toggle navigation', 'aria-expanded': 'false', 'aria-controls': 'app-main',
270
- onclick: () => toggleSide(),
274
+ onclick: (e) => toggleSide(null, e.currentTarget),
271
275
  }, Icon('menu')) : null,
272
276
  chrome,
273
277
  h('div', { class: 'app-body' + (hasSide ? '' : ' no-side') },
274
- h('div', { class: 'app-side-scrim', 'aria-hidden': 'true', onclick: () => toggleSide(false) }),
275
- h('div', { class: 'app-side-shell', onclick: (e) => { if (e.target.closest('a')) toggleSide(false); } }, sideNode),
278
+ h('div', { class: 'app-side-scrim', 'aria-hidden': 'true', onclick: (e) => toggleSide(false, e.currentTarget) }),
279
+ h('div', { class: 'app-side-shell', onclick: (e) => { if (e.target.closest('a')) toggleSide(false, e.currentTarget); } }, sideNode),
276
280
  // tabindex=-1 so the skip-link (href="#app-main") actually moves
277
281
  // keyboard focus into the main region, not just scroll to it.
278
282
  h('main', { class: 'app-main' + (narrow ? ' narrow' : ''), id: 'app-main', tabindex: '-1' }, ...(Array.isArray(main) ? main : [main]))
@@ -453,7 +453,7 @@ html, body {
453
453
  .wm-bar .wm-btns { pointer-events: auto; }
454
454
  .wm-btns .wm-btn:nth-child(1), .wm-btns .wm-btn:nth-child(2) { display: none !important; }
455
455
  .wm-btns .wm-btn:nth-child(3) { width: 44px !important; height: 44px !important; border-radius: var(--r-1, 6px) !important; background: var(--os-bg-3) !important; color: var(--os-fg) !important; }
456
- .wm-resize { display: none !important; }
456
+ .wm-resize, .wm-edge { display: none !important; }
457
457
  }
458
458
 
459
459
  /* ---- data-attr theme/accent: deferred to the canonical theme ----
@@ -1405,7 +1405,7 @@ html.ds-247420 { touch-action: pan-x pan-y; overscroll-behavior: none; -webkit-t
1405
1405
  border-radius: var(--r-1, 6px) !important;
1406
1406
  background: var(--os-bg-3) !important; color: var(--os-fg) !important;
1407
1407
  }
1408
- .ds-247420 .wm-resize { display: none !important; }
1408
+ .ds-247420 .wm-resize, .ds-247420 .wm-edge { display: none !important; }
1409
1409
  /* collapse the menubar workspace cluster on mobile (the unconditional
1410
1410
  * .ds-247420 .os-instances{display:flex} otherwise leaves it visible) */
1411
1411
  .ds-247420 .os-menubar .os-instances,
@@ -109,6 +109,21 @@
109
109
  linear-gradient(135deg, transparent 0 70%, currentColor 70% 80%, transparent 80% 100%);
110
110
  }
111
111
 
112
+ /* Edge + corner resize hit-zones. Invisible (no glyph) — they only widen the
113
+ * grab area beyond the SE .wm-resize grip. `width`/`height` are the grab
114
+ * thickness; corners overlap edges and win via later source order + size. */
115
+ .wm-edge { position: absolute; touch-action: none; z-index: 1; }
116
+ .wm-edge[data-dir='n'] { top: -3px; left: 8px; right: 8px; height: 8px; cursor: ns-resize; }
117
+ .wm-edge[data-dir='s'] { bottom: -3px; left: 8px; right: 8px; height: 8px; cursor: ns-resize; }
118
+ .wm-edge[data-dir='e'] { right: -3px; top: 8px; bottom: 8px; width: 8px; cursor: ew-resize; }
119
+ .wm-edge[data-dir='w'] { left: -3px; top: 8px; bottom: 8px; width: 8px; cursor: ew-resize; }
120
+ .wm-edge[data-dir='ne'] { top: -3px; right: -3px; width: 14px; height: 14px; cursor: nesw-resize; }
121
+ .wm-edge[data-dir='nw'] { top: -3px; left: -3px; width: 14px; height: 14px; cursor: nwse-resize; }
122
+ .wm-edge[data-dir='sw'] { bottom: -3px; left: -3px; width: 14px; height: 14px; cursor: nesw-resize; }
123
+
124
+ .wm-win.wm-min .wm-edge,
125
+ .wm-win.wm-max .wm-edge { display: none; }
126
+
112
127
  .wm-win.wm-min .wm-body,
113
128
  .wm-win.wm-min .wm-resize { display: none; }
114
129
 
package/src/kits/os/wm.js CHANGED
@@ -46,10 +46,19 @@ export function renderWindow(opts = {}) {
46
46
  bodyEl.className = 'wm-body';
47
47
  setBodyContent(bodyEl, body);
48
48
 
49
- const resize = document.createElement('div');
50
- resize.className = 'wm-resize';
49
+ // Resize affordances: one grip per edge + corner. `data-dir` carries the
50
+ // direction (n/s/e/w/ne/nw/se/sw) to the consumer's resize math. The SE
51
+ // corner keeps the visible diagonal grip glyph (.wm-resize); the other
52
+ // seven are invisible hit-zones (.wm-edge) styled in wm.css.
53
+ const DIRS = ['n', 's', 'e', 'w', 'ne', 'nw', 'se', 'sw'];
54
+ const grips = DIRS.map(dir => {
55
+ const g = document.createElement('div');
56
+ g.className = dir === 'se' ? 'wm-resize' : 'wm-edge';
57
+ g.dataset.dir = dir;
58
+ return g;
59
+ });
51
60
 
52
- el.append(bar, bodyEl, resize);
61
+ el.append(bar, bodyEl, ...grips);
53
62
 
54
63
  minBtn.addEventListener('click', e => { e.stopPropagation(); callbacks.onMinimize && callbacks.onMinimize(); });
55
64
  maxBtn.addEventListener('click', e => { e.stopPropagation(); callbacks.onMaximize && callbacks.onMaximize(); });
@@ -66,11 +75,11 @@ export function renderWindow(opts = {}) {
66
75
  if (callbacks.onDragStart) callbacks.onDragStart(e, { x: el.offsetLeft, y: el.offsetTop, w: el.offsetWidth, h: el.offsetHeight });
67
76
  });
68
77
 
69
- resize.addEventListener('pointerdown', e => {
78
+ grips.forEach(g => g.addEventListener('pointerdown', e => {
70
79
  e.stopPropagation();
71
80
  focus();
72
- if (callbacks.onResizeStart) callbacks.onResizeStart(e, { x: el.offsetLeft, y: el.offsetTop, w: el.offsetWidth, h: el.offsetHeight });
73
- });
81
+ if (callbacks.onResizeStart) callbacks.onResizeStart(e, { x: el.offsetLeft, y: el.offsetTop, w: el.offsetWidth, h: el.offsetHeight, dir: g.dataset.dir });
82
+ }));
74
83
 
75
84
  applyFocused(el, focused);
76
85
  applyMaximized(el, maximized);