@syntrologie/runtime-sdk 2.8.0-canary.176 → 2.8.0-canary.178

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.
@@ -9,18 +9,20 @@
9
9
  * reached its top.
10
10
  *
11
11
  * **Geometry:** ``position: fixed; left:0; right:0; bottom:0;
12
- * height: 100vh`` with a vertical ``translateY()`` to position the
13
- * **top edge** of the sheet at the active snap point. ``height = 100vh``
12
+ * height: 100svh`` with a vertical ``translateY()`` to position the
13
+ * **top edge** of the sheet at the active snap point. ``height = 100svh``
14
14
  * keeps the sheet's bottom anchored even when the snap point moves —
15
- * the content area below the handle just expands. Inner padding uses
16
- * ``env(safe-area-inset-bottom)`` so the iPhone home indicator doesn't
17
- * eat the last row of tiles.
15
+ * the content area below the handle just expands. ``svh`` (small
16
+ * viewport height) is used instead of ``dvh`` so the sheet doesn't
17
+ * jump when the mobile browser chrome (URL bar) appears or hides.
18
+ * Inner padding uses ``env(safe-area-inset-bottom)`` so the iPhone
19
+ * home indicator doesn't eat the last row of tiles.
18
20
  *
19
- * **Snap points** (vh percentages, peek default 30, mid 70, full 95)
21
+ * **Snap points** (svh percentages, peek default 30, mid 70, full 95)
20
22
  * are configurable via ``theme.canvas.snapPoints``. ``peek`` is the
21
23
  * lowest position the sheet rests at — dragging below peek with a
22
24
  * downward velocity dispatches ``canvas-toggle`` (close) rather than
23
- * snapping back. The translateY is computed as ``(100 - snapVh)%``.
25
+ * snapping back. The translateY is computed as ``(100 - snapVh)svh``.
24
26
  *
25
27
  * **Drag handle** is a 44px-tall touch target across the top, matching
26
28
  * Apple's recommended minimum for finger taps. ``pointerdown`` here
@@ -134,6 +136,7 @@ export declare class SyntroBottomSheet extends LitElement {
134
136
  private _scrollEl;
135
137
  /** Saved body overflow value before we apply scroll lock. */
136
138
  private _savedBodyOverflow;
139
+ private _entryRafId;
137
140
  private _onDocumentMousedown;
138
141
  private _onScrimClick;
139
142
  createRenderRoot(): this;
@@ -158,6 +161,7 @@ export declare class SyntroBottomSheet extends LitElement {
158
161
  updated(changed: Map<string, unknown>): void;
159
162
  private _lockBodyScroll;
160
163
  private _unlockBodyScroll;
164
+ private _scheduleEntryTransition;
161
165
  /** Convert a vertical pointer delta (px, downward = positive) to a vh
162
166
  * offset. Used during drag and for velocity calculations. */
163
167
  private _pxToVh;
@@ -74,6 +74,7 @@ export declare class SyntroLauncher extends LitElement {
74
74
  colorPrimary: string;
75
75
  colorPrimaryHover: string;
76
76
  launcherConfig: LauncherElementConfig;
77
+ hasActiveTiles: boolean;
77
78
  _launcherPos: {
78
79
  x: number;
79
80
  y: number;
package/dist/index.js CHANGED
@@ -7698,6 +7698,7 @@ var SyntroBottomSheet = class extends LitElement6 {
7698
7698
  __publicField(this, "_scrollEl", null);
7699
7699
  /** Saved body overflow value before we apply scroll lock. */
7700
7700
  __publicField(this, "_savedBodyOverflow", null);
7701
+ __publicField(this, "_entryRafId", 0);
7701
7702
  // --- Outside-click-to-close (matches SyntroDrawer pattern) ---
7702
7703
  __publicField(this, "_onDocumentMousedown", (e) => {
7703
7704
  if (!this.isOpen) return;
@@ -7790,6 +7791,7 @@ var SyntroBottomSheet = class extends LitElement6 {
7790
7791
  disconnectedCallback() {
7791
7792
  super.disconnectedCallback();
7792
7793
  document.removeEventListener("mousedown", this._onDocumentMousedown);
7794
+ cancelAnimationFrame(this._entryRafId);
7793
7795
  this._unlockBodyScroll();
7794
7796
  }
7795
7797
  updated(changed) {
@@ -7799,6 +7801,7 @@ var SyntroBottomSheet = class extends LitElement6 {
7799
7801
  if (this.isOpen) {
7800
7802
  this.snap = "mid";
7801
7803
  this._lockBodyScroll();
7804
+ this._scheduleEntryTransition();
7802
7805
  } else {
7803
7806
  this._unlockBodyScroll();
7804
7807
  }
@@ -7821,6 +7824,22 @@ var SyntroBottomSheet = class extends LitElement6 {
7821
7824
  this._savedBodyOverflow = null;
7822
7825
  }
7823
7826
  }
7827
+ _scheduleEntryTransition() {
7828
+ if (typeof window === "undefined") return;
7829
+ cancelAnimationFrame(this._entryRafId);
7830
+ this._entryRafId = requestAnimationFrame(() => {
7831
+ const container = this.querySelector('[data-syntro-bottom-sheet="container"]');
7832
+ if (!container) return;
7833
+ const targetTransform = container.style.transform;
7834
+ const targetTransition = container.style.transition;
7835
+ container.style.transition = "none";
7836
+ container.style.transform = "translateY(100svh)";
7837
+ this._entryRafId = requestAnimationFrame(() => {
7838
+ container.style.transition = targetTransition;
7839
+ container.style.transform = targetTransform;
7840
+ });
7841
+ });
7842
+ }
7824
7843
  // ── Snap math ────────────────────────────────────────────────────────────
7825
7844
  /** Convert a vertical pointer delta (px, downward = positive) to a vh
7826
7845
  * offset. Used during drag and for velocity calculations. */
@@ -7889,6 +7908,7 @@ var SyntroBottomSheet = class extends LitElement6 {
7889
7908
  _onPointerDown(e, fromHandle) {
7890
7909
  var _a3, _b;
7891
7910
  if (this._activePointerId !== null) return;
7911
+ if (!fromHandle && this.snap !== "full") return;
7892
7912
  this._activePointerId = e.pointerId;
7893
7913
  this._dragStartY = e.clientY;
7894
7914
  this._dragStartSnap = this.snap;
@@ -7985,15 +8005,17 @@ var SyntroBottomSheet = class extends LitElement6 {
7985
8005
  left: "0",
7986
8006
  right: "0",
7987
8007
  bottom: "0",
7988
- // ``100dvh`` (dynamic viewport height) shrinks when the iOS soft
7989
- // keyboard appears, so a tile with a text input doesn't end up
7990
- // covered by the keyboard. ``100vh`` would be measured against the
7991
- // pre-keyboard viewport and lose the bottom of the sheet behind
7992
- // the keyboard. Browser support: Safari 15.4+, Chrome 108+,
7993
- // Firefox 101+ universal in 2026.
7994
- height: "100dvh",
8008
+ // ``100svh`` (small viewport height) is the viewport with the
8009
+ // mobile browser chrome (URL bar) visible. Using ``svh`` instead
8010
+ // of ``dvh`` prevents the sheet from jumping when Chrome/Safari
8011
+ // shows or hides the URL bar the sheet is always sized for the
8012
+ // smallest viewport. When the URL bar hides, a small gap appears
8013
+ // at the bottom rather than a jarring position shift. Browser
8014
+ // support: Safari 15.4+, Chrome 108+, Firefox 101+ — universal
8015
+ // in 2026.
8016
+ height: "100svh",
7995
8017
  pointerEvents: "auto",
7996
- transform: `translateY(${topEdgeVh}vh)`,
8018
+ transform: `translateY(${topEdgeVh}svh)`,
7997
8019
  transition: this.isDragging ? "none" : `transform ${dur} ${ease}, opacity ${dur} ease-out`,
7998
8020
  display: "flex",
7999
8021
  flexDirection: "column",
@@ -8023,11 +8045,13 @@ var SyntroBottomSheet = class extends LitElement6 {
8023
8045
  borderRadius: "3px",
8024
8046
  background: "rgba(255, 255, 255, 0.4)"
8025
8047
  };
8048
+ const snapVh = this.snapPoints[this.snap];
8026
8049
  const scrollAreaStyles = {
8027
8050
  flex: "1 1 auto",
8028
8051
  overflowY: "auto",
8029
8052
  padding: "0 1rem 1rem",
8030
- touchAction: "pan-y"
8053
+ touchAction: "pan-y",
8054
+ maxHeight: `calc(${snapVh}svh - 56px)`
8031
8055
  };
8032
8056
  return html6`
8033
8057
  <div data-syntro-bottom-sheet="root" style=${styleMap6(rootStyles)}>
@@ -9293,6 +9317,7 @@ var SyntroCanvasOverlay = class extends LitElement7 {
9293
9317
  .themeConfig=${this.themeConfig}
9294
9318
  .launcherIcon=${(_e2 = (_d = (_c = this.themeConfig) == null ? void 0 : _c.launcher) == null ? void 0 : _d.icon) != null ? _e2 : null}
9295
9319
  ?launcherAnimate=${this.launcherAnimate && !this.isOpen}
9320
+ .hasActiveTiles=${this.tiles.length > 0}
9296
9321
  @launcher-toggle=${this._onLauncherToggle}
9297
9322
  ></syntro-launcher>
9298
9323
  </div>
@@ -9508,7 +9533,7 @@ function error(prefix, message, data) {
9508
9533
  }
9509
9534
 
9510
9535
  // src/version.ts
9511
- var SDK_VERSION = "2.8.0-canary.176";
9536
+ var SDK_VERSION = "2.8.0-canary.178";
9512
9537
 
9513
9538
  // src/types.ts
9514
9539
  var SDK_SCHEMA_VERSION = "2.0";
@@ -10748,6 +10773,7 @@ var SyntroLauncher = class extends LitElement11 {
10748
10773
  __publicField(this, "colorPrimary", TOKEN_PURPLE_42);
10749
10774
  __publicField(this, "colorPrimaryHover", TOKEN_PURPLE_5);
10750
10775
  __publicField(this, "launcherConfig", {});
10776
+ __publicField(this, "hasActiveTiles", true);
10751
10777
  // --- Private reactive state ---
10752
10778
  __publicField(this, "_launcherPos", null);
10753
10779
  __publicField(this, "_hovered", false);
@@ -10910,7 +10936,8 @@ var SyntroLauncher = class extends LitElement11 {
10910
10936
  border: "none",
10911
10937
  backgroundColor: "var(--sc-launcher-background)",
10912
10938
  cursor: ((_a3 = this._drag) == null ? void 0 : _a3.dragged) ? "grabbing" : "pointer",
10913
- touchAction: "none"
10939
+ touchAction: "none",
10940
+ opacity: !this.hasActiveTiles && !this.isOpen ? "0.3" : void 0
10914
10941
  };
10915
10942
  const animateClass = this.launcherAnimate && !this.isOpen ? "syntro-launcher-animate" : "";
10916
10943
  const showBadge = !this.isOpen && this.notificationCount > 0;