anentrypoint-design 0.0.433 → 0.0.435

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.433",
3
+ "version": "0.0.435",
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",
@@ -15,12 +15,14 @@ export function FocusTrap({ children } = {}) {
15
15
  if (!el || el._dsTrap) return;
16
16
  el._dsTrap = true;
17
17
  el.addEventListener('keydown', (e) => trapTabKey(el, e));
18
- // Auto-focus first focusable
19
- queueMicrotask(() => {
18
+ // Auto-focus first focusable. setTimeout(0), not queueMicrotask: the
19
+ // triggering click's own default focus-on-click runs in the same tick,
20
+ // which can race a same-tick microtask and leave focus on the trigger.
21
+ setTimeout(() => {
20
22
  const first = el.querySelector(FOCUSABLE_SEL);
21
23
  if (first) first.focus();
22
24
  else el.focus();
23
- });
25
+ }, 0);
24
26
  }
25
27
  }, ...kids(children));
26
28
  }
@@ -17,7 +17,7 @@ export function ApprovalPrompt({ toolName, categoryLabel, argsPreview, onDecisio
17
17
  const noteRef = (el) => {
18
18
  if (!el || noteEl === el) return;
19
19
  noteEl = el;
20
- if (autoFocusNote) queueMicrotask(() => noteEl && noteEl.focus());
20
+ if (autoFocusNote) setTimeout(() => noteEl && noteEl.focus(), 0);
21
21
  };
22
22
  const decide = (kind) => { if (onDecision) onDecision(kind, (noteEl && noteEl.value || '').trim()); };
23
23
  return h('div', { class: 'ov-approval', role: 'group', 'aria-label': toolName ? `Permission requested: ${toolName}` : 'Permission requested' },
@@ -92,7 +92,7 @@ export function CommandPalette({ open, items = [], onSelect, onClose } = {}) {
92
92
  'aria-controls': 'ov-cmd-list',
93
93
  'aria-activedescendant': '',
94
94
  oninput: (e) => { filterText = e.target.value; active = 0; renderInner(); },
95
- ref: (el) => { if (!el || el._ovCmdIn) return; el._ovCmdIn = true; inputEl = el; queueMicrotask(() => el.focus()); },
95
+ ref: (el) => { if (!el || el._ovCmdIn) return; el._ovCmdIn = true; inputEl = el; setTimeout(() => el.focus(), 0); },
96
96
  }),
97
97
  h('div', { class: 'ov-cmd-list', id: 'ov-cmd-list', role: 'listbox',
98
98
  ref: (el) => { if (!el) return; listEl = el; queueMicrotask(renderInner); } })
@@ -58,7 +58,7 @@ export function useRovingMenu({ itemSelector, items = [], getLabel = (it) => it.
58
58
  floating = useFloating(triggerEl, menuEl, { placement, offset: FLOAT_OFFSET_DROPDOWN });
59
59
  document.addEventListener('mousedown', onDown, true);
60
60
  triggerEl.setAttribute('aria-expanded', 'true');
61
- if (focusFirst && liveItems().length) queueMicrotask(() => focusItem(0));
61
+ if (focusFirst && liveItems().length) setTimeout(() => focusItem(0), 0);
62
62
  if (onOpenChange) onOpenChange(true);
63
63
  };
64
64
  const onTrigClick = (buildMenuEl) => { if (open) close(false); else openMenu(buildMenuEl, true); };