entasis 0.9.1 → 0.9.2

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.
@@ -99,6 +99,7 @@
99
99
  let panelRef: HTMLElement | null = $state(null);
100
100
  let resizeHandleRef: HTMLElement | null = $state(null);
101
101
  let edgeTriggerRef: HTMLButtonElement | null = $state(null);
102
+ let activityBarRef: HTMLElement | null = $state(null);
102
103
 
103
104
  let focusInside = $state(false);
104
105
  let pointerInside = $state(false);
@@ -185,6 +186,34 @@
185
186
  return () => offs.forEach((off) => off());
186
187
  });
187
188
 
189
+ // The activity bar is part of the sidebar: hovering it opens the collapsed panel the way the
190
+ // edge strip (or `expandOnHover`) does, and a peek stays open while the pointer or focus is on
191
+ // the rail, so switching sections from it never closes the panel it is switching. Keyboard
192
+ // focus only keeps a peek: tabbing through the rail does not pop the panel out.
193
+ $effect(() => {
194
+ const rail = activityBarRef;
195
+ if (!rail) return;
196
+ const isInside = (target: EventTarget | null) =>
197
+ target instanceof Node && [rail, ...peekRegion].some((node) => node.contains(target));
198
+ const offs = [
199
+ on(rail, 'pointerenter', () => {
200
+ pointerInside = true;
201
+ if (showEdgeTrigger && !resize.isEdgeRevealSuppressed) edgeRevealed = true;
202
+ if (canHoverExpand) hoverExpanded = true;
203
+ }),
204
+ on(rail, 'pointerleave', (event) => {
205
+ pointerInside = isInside(event.relatedTarget);
206
+ }),
207
+ on(rail, 'focusin', () => {
208
+ if (isPeeking) focusInside = true;
209
+ }),
210
+ on(rail, 'focusout', (event) => {
211
+ focusInside = isInside(event.relatedTarget);
212
+ })
213
+ ];
214
+ return () => offs.forEach((off) => off());
215
+ });
216
+
188
217
  // `revealSafeArea` owns edge-reveal dismissal, and its tolerance rectangle is what lets a
189
218
  // pointer graze the panel edge without losing the reveal. It stops listening while a peek is
190
219
  // pinned, though, so a pin that releases with the pointer already gone leaves nobody to close
@@ -284,6 +313,8 @@
284
313
  <!-- Pinned outside the panel and never offset by the collapse state, so the rail stays
285
314
  on screen while the panel slides away. -->
286
315
  <div
316
+ bind:this={activityBarRef}
317
+ {@attach revealSafeArea.reference}
287
318
  data-slot="sidebar-activity-bar-container"
288
319
  data-side={side}
289
320
  class={getSidebarActivityBarContainerClass(side, frame, variant)}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "entasis",
3
- "version": "0.9.1",
3
+ "version": "0.9.2",
4
4
  "license": "MIT",
5
5
  "scripts": {
6
6
  "dev": "vite dev",