@blotch/dolan 22.2.8 → 22.2.9

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.
@@ -20,8 +20,10 @@ import {
20
20
  import { toSignal } from '@angular/core/rxjs-interop';
21
21
  import { RouterLink, RouterLinkActive } from '@angular/router';
22
22
  import {
23
+ type LayoutChangeDetail,
23
24
  LYNX_ELEMENTS,
24
25
  LynxAccessibilitySettings,
26
+ type LynxEvent,
25
27
  LynxRouterLinkActive,
26
28
  } from '@blotch/angular-lynx';
27
29
 
@@ -205,9 +207,6 @@ const CAPSULE_OPACITY = 0.1;
205
207
  */
206
208
  const ACCESSORY_ICON_COLOR = signal('var(--glass-foreground)').asReadonly();
207
209
 
208
- /** What Lynx's `layoutchange` event carries, as far as the dock reads it. */
209
- type LayoutChangeEvent = Event & { detail: { width: number } };
210
-
211
210
  /**
212
211
  * A CSS length in px.
213
212
  */
@@ -1014,8 +1013,8 @@ export class UiDock implements SearchFieldContainer {
1014
1013
  );
1015
1014
  });
1016
1015
 
1017
- protected measure(event: Event): void {
1018
- this.width.set((event as LayoutChangeEvent).detail.width);
1016
+ protected measure({ detail }: LynxEvent<LayoutChangeDetail>): void {
1017
+ this.width.set(detail.width);
1019
1018
  }
1020
1019
 
1021
1020
  /**
@@ -91,7 +91,7 @@ import { cn } from '../../utils/cn';
91
91
  [attr.disabled]="disabled() || undefined"
92
92
  class="text-sm text-foreground"
93
93
  style="border: none; background: transparent; height: 100%; width: 100%; position: relative; z-index: 1;"
94
- (bindinput)="onInput($any($event))"
94
+ (bindinput)="onInput($event)"
95
95
  (bindfocus)="onFocus()"
96
96
  (bindblur)="onBlur()"
97
97
  />
@@ -12,8 +12,10 @@ import {
12
12
  } from '@angular/core';
13
13
  import { ROUTES, Router } from '@angular/router';
14
14
  import {
15
+ type LayoutChangeDetail,
15
16
  LYNX_ELEMENTS,
16
17
  LynxAccessibilitySettings,
18
+ type LynxEvent,
17
19
  LynxLocationStrategy,
18
20
  } from '@blotch/angular-lynx';
19
21
 
@@ -48,9 +50,6 @@ const ROW_PADDING: Readonly<Record<GlassDesign, number>> = {
48
50
  /** The space between a centered title and the controls beside it, in px. */
49
51
  const TITLE_GAP = 8;
50
52
 
51
- /** What Lynx's `layoutchange` event carries, as far as the bar reads it. */
52
- type LayoutChangeEvent = Event & { detail: { width: number } };
53
-
54
53
  /**
55
54
  * How the inline title comes in as the large title scrolls under the bar,
56
55
  * and how Material's bar changes color as content scrolls under it.
@@ -379,20 +378,20 @@ export class UiNavigationBar {
379
378
  ),
380
379
  );
381
380
 
382
- protected measureRow(event: Event): void {
383
- this.rowWidth.set((event as LayoutChangeEvent).detail.width);
381
+ protected measureRow({ detail }: LynxEvent<LayoutChangeDetail>): void {
382
+ this.rowWidth.set(detail.width);
384
383
  }
385
384
 
386
- protected measureTitle(event: Event): void {
387
- this.titleWidth.set((event as LayoutChangeEvent).detail.width);
385
+ protected measureTitle({ detail }: LynxEvent<LayoutChangeDetail>): void {
386
+ this.titleWidth.set(detail.width);
388
387
  }
389
388
 
390
- protected measureLeading(event: Event): void {
391
- this.leadingWidth.set((event as LayoutChangeEvent).detail.width);
389
+ protected measureLeading({ detail }: LynxEvent<LayoutChangeDetail>): void {
390
+ this.leadingWidth.set(detail.width);
392
391
  }
393
392
 
394
- protected measureTrailing(event: Event): void {
395
- this.trailingWidth.set((event as LayoutChangeEvent).detail.width);
393
+ protected measureTrailing({ detail }: LynxEvent<LayoutChangeDetail>): void {
394
+ this.trailingWidth.set(detail.width);
396
395
  }
397
396
 
398
397
  /**
@@ -184,11 +184,11 @@ const iconSvg = (icon: IconName, color: string): string =>
184
184
  [value]="value()"
185
185
  [class]="inputClass()"
186
186
  [style.font-size.px]="look().fontSize"
187
- (bindinput)="onInput($any($event))"
188
- (bindconfirm)="onConfirm($any($event))"
187
+ (bindinput)="onInput($event)"
188
+ (bindconfirm)="onConfirm($event)"
189
189
  (bindfocus)="onFocus()"
190
190
  (bindblur)="onBlur()"
191
- (bindkeyboardheightchange)="onKeyboard($any($event))"
191
+ (bindkeyboardheightchange)="onKeyboard($event)"
192
192
  />
193
193
  @if (value() && !disabled()) {
194
194
  <view
@@ -85,7 +85,7 @@ import { cn } from '../../utils/cn';
85
85
  [attr.enable-scroll-bar]="maxLines() != null ? 'true' : null"
86
86
  class="text-sm text-foreground"
87
87
  style="border: none; background: transparent; height: 100%; width: 100%; line-height: 20px; position: relative; z-index: 1;"
88
- (bindinput)="onInput($any($event))"
88
+ (bindinput)="onInput($event)"
89
89
  (bindfocus)="onFocus()"
90
90
  (bindblur)="onBlur()"
91
91
  ></textarea>
@@ -12,7 +12,13 @@ import {
12
12
  type Signal,
13
13
  type WritableSignal,
14
14
  } from '@angular/core';
15
- import { LYNX_ELEMENTS, LynxSystemInfo } from '@blotch/angular-lynx';
15
+ import {
16
+ type LayoutChangeDetail,
17
+ LYNX_ELEMENTS,
18
+ type LynxEvent,
19
+ LynxSystemInfo,
20
+ type ScrollDetail,
21
+ } from '@blotch/angular-lynx';
16
22
 
17
23
  import { cn } from '../../utils/cn';
18
24
  import { type GlassDesign, injectGlassDesign } from '../glass/glass-design';
@@ -131,10 +137,6 @@ export const edgeFadeOverlay = (toward: 'bottom' | 'top'): string => {
131
137
  return `linear-gradient(to ${toward}, ${stops.join(', ')})`;
132
138
  };
133
139
 
134
- /** What Lynx sends with `scroll` and `layoutchange`, as far as this reads. */
135
- type ScrollDetail = { scrollTop: number; scrollHeight: number };
136
- type LayoutDetail = { height: number };
137
-
138
140
  /**
139
141
  * The platform, as SystemInfo names it, or undefined where there's no
140
142
  * SystemInfo to read, such as in unit tests, where LynxSystemInfo throws.
@@ -234,19 +236,19 @@ export class UiBarScroll {
234
236
  this.#renderer.listen(
235
237
  this.#element,
236
238
  'bindscroll',
237
- (event: { detail: ScrollDetail }) => this.#scrolled(event.detail),
239
+ (event: LynxEvent<ScrollDetail>) => this.#scrolled(event.detail),
238
240
  ),
239
241
  // iOS and Android report the content's height when it changes, which a
240
242
  // frosted toolbar needs before anything scrolls.
241
243
  this.#renderer.listen(
242
244
  this.#element,
243
245
  'bindcontentsizechanged',
244
- (event: { detail: ScrollDetail }) => this.#scrolled(event.detail),
246
+ (event: LynxEvent<ScrollDetail>) => this.#scrolled(event.detail),
245
247
  ),
246
248
  this.#renderer.listen(
247
249
  this.#element,
248
250
  'bindlayoutchange',
249
- (event: { detail: LayoutDetail }) => {
251
+ (event: LynxEvent<LayoutChangeDetail>) => {
250
252
  this.viewport.set(event.detail.height);
251
253
  this.#update();
252
254
  },
@@ -334,16 +336,12 @@ export class UiBarScroll {
334
336
  return `linear-gradient(to bottom, ${stops.join(', ')})`;
335
337
  });
336
338
 
337
- protected measureTop(event: Event): void {
338
- this.topSpace.set(
339
- (event as Event & { detail: LayoutDetail }).detail.height,
340
- );
339
+ protected measureTop({ detail }: LynxEvent<LayoutChangeDetail>): void {
340
+ this.topSpace.set(detail.height);
341
341
  }
342
342
 
343
- protected measureBottom(event: Event): void {
344
- this.bottomSpace.set(
345
- (event as Event & { detail: LayoutDetail }).detail.height,
346
- );
343
+ protected measureBottom({ detail }: LynxEvent<LayoutChangeDetail>): void {
344
+ this.bottomSpace.set(detail.height);
347
345
  }
348
346
 
349
347
  #scrolled({ scrollTop, scrollHeight }: ScrollDetail): void {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blotch/dolan",
3
- "version": "22.2.8",
3
+ "version": "22.2.9",
4
4
  "description": "CLI for adding @blotch/ui components to your project",
5
5
  "homepage": "https://github.com/Blotch-Smart-Frames/AngularLynx#readme",
6
6
  "bugs": {