@blotch/angular-lynx 22.2.3 → 22.2.5
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/README.md +46 -22
- package/fesm2022/{blotch-angular-lynx-web-glass-8MFrhPz0.mjs → blotch-angular-lynx-web-glass-zlVeee5K.mjs} +104 -29
- package/fesm2022/blotch-angular-lynx-web-glass-zlVeee5K.mjs.map +1 -0
- package/fesm2022/blotch-angular-lynx.mjs +559 -97
- package/fesm2022/blotch-angular-lynx.mjs.map +1 -1
- package/package.json +1 -1
- package/schematics/add-tailwind/index.js +14 -74
- package/schematics/add-tailwind/schema.json +6 -1
- package/schematics/collection.json +1 -1
- package/schematics/ng-add/index.js +4 -58
- package/schematics/ng-add/schema.json +7 -2
- package/schematics/ng-add/versions.js +8 -2
- package/schematics/utility/tailwind.js +167 -0
- package/types/blotch-angular-lynx.d.ts +324 -42
- package/fesm2022/blotch-angular-lynx-web-glass-8MFrhPz0.mjs.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from "@angular/core";
|
|
2
|
-
import { ApplicationConfig, ApplicationRef, ComponentRef, EmbeddedViewRef, EnvironmentInjector, EnvironmentProviders, ErrorDetails, ErrorHandler, Injector, OnChanges, OnDestroy, SimpleChanges, TemplateRef, Type, ViewContainerRef, signal } from "@angular/core";
|
|
2
|
+
import { ApplicationConfig, ApplicationRef, ComponentRef, EmbeddedViewRef, EnvironmentInjector, EnvironmentProviders, ErrorDetails, ErrorHandler, InjectionToken, Injector, OnChanges, OnDestroy, OutputRef, Signal, SimpleChanges, TemplateRef, Type, ViewContainerRef, signal } from "@angular/core";
|
|
3
3
|
import { Animation, AnimationOptions, Element as Element$1 } from "@lynx-js/types/main-thread";
|
|
4
4
|
import { AnyObject } from "@lynx-js/types/common";
|
|
5
5
|
import { ControlValueAccessor } from "@angular/forms";
|
|
@@ -55,6 +55,115 @@ export declare class LynxAccessibility {
|
|
|
55
55
|
static ɵfac: i0.ɵɵFactoryDeclaration<LynxAccessibility, never>;
|
|
56
56
|
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
57
57
|
}
|
|
58
|
+
/**
|
|
59
|
+
* The user's accessibility display settings, as signals: Reduce Motion,
|
|
60
|
+
* Reduce Transparency and Increase Contrast.
|
|
61
|
+
*
|
|
62
|
+
* Lynx has no API for them on any platform, so they come from the host app,
|
|
63
|
+
* in its global props, like the theme does: `reduceMotion`,
|
|
64
|
+
* `reduceTransparency` and `increaseContrast`, each `true` when on. The apps
|
|
65
|
+
* `ng build --platform` makes send them, and send them again when the user
|
|
66
|
+
* changes one:
|
|
67
|
+
*
|
|
68
|
+
* - **iOS:** `UIAccessibility.isReduceMotionEnabled`,
|
|
69
|
+
* `isReduceTransparencyEnabled` and `isDarkerSystemColorsEnabled`
|
|
70
|
+
* (Increase Contrast).
|
|
71
|
+
* - **Android:** Remove animations (an animator duration scale of 0) for
|
|
72
|
+
* Reduce Motion, and contrast above standard (Android 14) or high contrast
|
|
73
|
+
* text (Android 16) for Increase Contrast. Android has no Reduce
|
|
74
|
+
* Transparency setting.
|
|
75
|
+
*
|
|
76
|
+
* In the web preview they follow the browser's `prefers-reduced-motion`,
|
|
77
|
+
* `prefers-reduced-transparency` and `prefers-contrast: more` too. Lynx
|
|
78
|
+
* Explorer sends none of them, so they're off there, unless you add them to
|
|
79
|
+
* the bundle URL: `?reduceMotion=true`.
|
|
80
|
+
*
|
|
81
|
+
* iOS 27's Liquid Glass appearance setting (clear or tinted glass) has no
|
|
82
|
+
* public API, so it isn't here. UIKit's glass follows it, and Reduce
|
|
83
|
+
* Transparency and Increase Contrast, by itself.
|
|
84
|
+
*
|
|
85
|
+
* @usageNotes
|
|
86
|
+
* ```typescript
|
|
87
|
+
* const settings = inject(LynxAccessibilitySettings);
|
|
88
|
+
*
|
|
89
|
+
* // Jump instead of sliding when the user asked for less motion.
|
|
90
|
+
* const duration = computed(() => (settings.reduceMotion() ? 0 : 250));
|
|
91
|
+
* ```
|
|
92
|
+
*/
|
|
93
|
+
export declare class LynxAccessibilitySettings {
|
|
94
|
+
#private;
|
|
95
|
+
/**
|
|
96
|
+
* The user asked for less motion. Replace movement, such as a slide or a
|
|
97
|
+
* bounce, with a fade or an instant change.
|
|
98
|
+
*/
|
|
99
|
+
readonly reduceMotion: Signal<boolean>;
|
|
100
|
+
/**
|
|
101
|
+
* The user asked for less transparency. Draw blurred and translucent
|
|
102
|
+
* surfaces opaque.
|
|
103
|
+
*/
|
|
104
|
+
readonly reduceTransparency: Signal<boolean>;
|
|
105
|
+
/**
|
|
106
|
+
* The user asked for more contrast: iOS's Increase Contrast. Strengthen
|
|
107
|
+
* borders and use full-strength text colors.
|
|
108
|
+
*/
|
|
109
|
+
readonly increaseContrast: Signal<boolean>;
|
|
110
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<LynxAccessibilitySettings, never>;
|
|
111
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* One trait of `accessibility-traits`, each of which iOS turns into a
|
|
115
|
+
* UIAccessibilityTraits flag (`LynxConverter+UI.m`).
|
|
116
|
+
*/
|
|
117
|
+
type AccessibilityTrait = 'text' | 'image' | 'button' | 'link' | 'header' | 'search' | 'selected' | 'playable' | 'keyboard' | 'summary' | 'disabled' | 'updating' | 'adjustable' | 'tabbar' | 'none';
|
|
118
|
+
/**
|
|
119
|
+
* Which traits LynxAccessibilityTraits adds, by name. `none` isn't one: it
|
|
120
|
+
* says the element has no traits, so there's nothing to add.
|
|
121
|
+
*/
|
|
122
|
+
type AccessibilityTraitStates = Partial<Record<Exclude<AccessibilityTrait, 'none'>, boolean>>;
|
|
123
|
+
/**
|
|
124
|
+
* Adds accessibility traits to an element's own `accessibility-traits` while
|
|
125
|
+
* a binding says so, such as `selected` on the chosen one of several options,
|
|
126
|
+
* or `disabled` on an item that can't be used now.
|
|
127
|
+
*
|
|
128
|
+
* Writing the state into the attribute instead,
|
|
129
|
+
* `accessibility-traits="button,selected"`, works only on iOS. Android reads
|
|
130
|
+
* the attribute as a single trait, so a list stops being a button there. The
|
|
131
|
+
* element merges these traits into its own instead (see
|
|
132
|
+
* LynxElement.setAccessibilityTrait): `button` reads `button,selected` on iOS,
|
|
133
|
+
* and stays `button` on Android, which has no selected trait to add. The
|
|
134
|
+
* element can still set its own traits at any time, and neither undoes the
|
|
135
|
+
* other.
|
|
136
|
+
*
|
|
137
|
+
* A trait that turns false, or that the map leaves out, is taken away again.
|
|
138
|
+
* Only the traits this directive added are: the element's own stay.
|
|
139
|
+
*
|
|
140
|
+
* It's part of LYNX_ELEMENTS, so a component that imports LYNX_ELEMENTS can
|
|
141
|
+
* bind it on any element.
|
|
142
|
+
*
|
|
143
|
+
* @usageNotes
|
|
144
|
+
* ```html
|
|
145
|
+
* <view
|
|
146
|
+
* [accessibility-element]="true"
|
|
147
|
+
* accessibility-traits="button"
|
|
148
|
+
* [accessibility-label]="label()"
|
|
149
|
+
* [lynxAccessibilityTraits]="{ selected: selected() }"
|
|
150
|
+
* (bindtap)="chosen.emit()"
|
|
151
|
+
* >
|
|
152
|
+
* ```
|
|
153
|
+
*/
|
|
154
|
+
export declare class LynxAccessibilityTraits {
|
|
155
|
+
#private;
|
|
156
|
+
readonly lynxAccessibilityTraits: import("@angular/core").InputSignal<Partial<Record<"text" | "search" | "link" | "image" | "button" | "header" | "selected" | "playable" | "keyboard" | "summary" | "disabled" | "updating" | "adjustable" | "tabbar", boolean>> | null | undefined>;
|
|
157
|
+
constructor();
|
|
158
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<LynxAccessibilityTraits, never>;
|
|
159
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<LynxAccessibilityTraits, "[lynxAccessibilityTraits]", never, {
|
|
160
|
+
"lynxAccessibilityTraits": {
|
|
161
|
+
"alias": "lynxAccessibilityTraits";
|
|
162
|
+
"required": false;
|
|
163
|
+
"isSignal": true;
|
|
164
|
+
};
|
|
165
|
+
}, {}, never, never, true, never>;
|
|
166
|
+
}
|
|
58
167
|
/**
|
|
59
168
|
* Phantom brand symbol — makes each ElementRef variant nominally distinct at
|
|
60
169
|
* the type level even though Lynx PAPI handles have no runtime structure.
|
|
@@ -1163,9 +1272,12 @@ declare class LynxElementBase implements OnChanges {
|
|
|
1163
1272
|
'accessibility-label'?: string;
|
|
1164
1273
|
/**
|
|
1165
1274
|
* The kind of element a screen reader announces. Plural, as Lynx reads it:
|
|
1166
|
-
* iOS, Android and Harmony ignore `accessibility-trait`.
|
|
1275
|
+
* iOS, Android and Harmony ignore `accessibility-trait`. iOS also reads a
|
|
1276
|
+
* comma-separated list with no spaces, such as `button,selected`, which
|
|
1277
|
+
* is what LynxRouterLinkActive and LynxAccessibilityTraits write; Android
|
|
1278
|
+
* and Harmony read a single trait. @default 'none'
|
|
1167
1279
|
*/
|
|
1168
|
-
'accessibility-traits'?:
|
|
1280
|
+
'accessibility-traits'?: AccessibilityTrait | `${AccessibilityTrait},${string}`;
|
|
1169
1281
|
/**
|
|
1170
1282
|
* Comma-separated `id`s of the child elements a screen reader visits, in
|
|
1171
1283
|
* order. iOS and Android look each one up as an `id` selector.
|
|
@@ -1488,6 +1600,16 @@ export declare class LynxBlurView extends LynxElementBase {
|
|
|
1488
1600
|
* gets a tint that approximates it. @default 'light'
|
|
1489
1601
|
*/
|
|
1490
1602
|
'blur-effect'?: 'light' | 'extra-light' | 'dark' | 'glass' | 'glass-container';
|
|
1603
|
+
/**
|
|
1604
|
+
* One of UIKit's adaptive blur materials, which follow
|
|
1605
|
+
* `ios-user-interface-style` (iOS 13+, in apps built with
|
|
1606
|
+
* `ng build --platform ios`): `systemUltraThinMaterial` to
|
|
1607
|
+
* `systemThickMaterial`, or `systemChromeMaterial`, the bars'. While it's
|
|
1608
|
+
* set it replaces `blur-effect` and `blur-radius`. Lynx's own blur-view
|
|
1609
|
+
* doesn't have it, so Lynx Explorer and other hosts ignore it and draw the
|
|
1610
|
+
* `blur-effect`.
|
|
1611
|
+
*/
|
|
1612
|
+
'blur-material'?: 'ultra-thin' | 'thin' | 'regular' | 'thick' | 'chrome';
|
|
1491
1613
|
/**
|
|
1492
1614
|
* Distance at which glass elements inside a `glass-container` start to merge (iOS). @default 0
|
|
1493
1615
|
*/
|
|
@@ -1534,6 +1656,10 @@ export declare class LynxBlurView extends LynxElementBase {
|
|
|
1534
1656
|
"alias": "blur-effect";
|
|
1535
1657
|
"required": false;
|
|
1536
1658
|
};
|
|
1659
|
+
"blur-material": {
|
|
1660
|
+
"alias": "blur-material";
|
|
1661
|
+
"required": false;
|
|
1662
|
+
};
|
|
1537
1663
|
"spacing": {
|
|
1538
1664
|
"alias": "spacing";
|
|
1539
1665
|
"required": false;
|
|
@@ -2996,11 +3122,118 @@ export declare class LynxWebView extends LynxElementBase {
|
|
|
2996
3122
|
};
|
|
2997
3123
|
}, {}, never, never, true, never>;
|
|
2998
3124
|
}
|
|
3125
|
+
/**
|
|
3126
|
+
* Finds the `isActiveChange` output of Angular's `RouterLinkActive` on the
|
|
3127
|
+
* element being created, or null if it has none. Called in the injection
|
|
3128
|
+
* context of that element's LynxRouterLinkActive.
|
|
3129
|
+
*
|
|
3130
|
+
* `provideRouter()` provides it, rather than LynxRouterLinkActive importing
|
|
3131
|
+
* `RouterLinkActive` itself, because LynxRouterLinkActive is part of
|
|
3132
|
+
* LYNX_ELEMENTS, which every component imports: referring to the router from
|
|
3133
|
+
* there would put the whole router in the bundle of an app without routes.
|
|
3134
|
+
* Without `provideRouter()` there's no router to follow, and the token is
|
|
3135
|
+
* missing.
|
|
3136
|
+
*/
|
|
3137
|
+
declare const ROUTER_LINK_ACTIVE_CHANGE: InjectionToken<() => OutputRef<boolean> | null>;
|
|
3138
|
+
/**
|
|
3139
|
+
* Tells screen readers which router link is the current one: while Angular's
|
|
3140
|
+
* `RouterLinkActive` on the same element says its route is active, the
|
|
3141
|
+
* element has the `selected` accessibility trait, as the selected tab of a
|
|
3142
|
+
* native tab bar does. On the web, `routerLinkActive` only changes classes, or
|
|
3143
|
+
* `aria-current` with `ariaCurrentWhenActive`; Lynx elements have no ARIA,
|
|
3144
|
+
* and `accessibility-traits` is how they say this.
|
|
3145
|
+
*
|
|
3146
|
+
* It keeps the element's own traits: `accessibility-traits="button"` becomes
|
|
3147
|
+
* `button,selected` while the link is active. On Android, which reads one
|
|
3148
|
+
* trait and has no selected trait, the element keeps its own traits as they
|
|
3149
|
+
* are.
|
|
3150
|
+
*
|
|
3151
|
+
* It's part of LYNX_ELEMENTS, so a component that imports LYNX_ELEMENTS and
|
|
3152
|
+
* Angular's `RouterLinkActive` gets it on every `routerLinkActive` element.
|
|
3153
|
+
* To add it to a component's host instead, list it in `hostDirectives` next
|
|
3154
|
+
* to `RouterLinkActive`.
|
|
3155
|
+
*
|
|
3156
|
+
* @usageNotes
|
|
3157
|
+
* ```ts
|
|
3158
|
+
* @Component({
|
|
3159
|
+
* imports: [LYNX_ELEMENTS, RouterLink, RouterLinkActive],
|
|
3160
|
+
* template: `
|
|
3161
|
+
* <view routerLink="/settings" routerLinkActive="active">
|
|
3162
|
+
* <text>Settings</text>
|
|
3163
|
+
* </view>
|
|
3164
|
+
* `,
|
|
3165
|
+
* })
|
|
3166
|
+
* ```
|
|
3167
|
+
*/
|
|
3168
|
+
export declare class LynxRouterLinkActive {
|
|
3169
|
+
constructor();
|
|
3170
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<LynxRouterLinkActive, never>;
|
|
3171
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<LynxRouterLinkActive, "[routerLinkActive]", never, {}, {}, never, never, true, never>;
|
|
3172
|
+
}
|
|
2999
3173
|
/**
|
|
3000
3174
|
* All Lynx native element directives as a single importable array.
|
|
3001
3175
|
* Add to the `imports` of any component whose template uses Lynx elements.
|
|
3002
3176
|
*/
|
|
3003
|
-
export declare const LYNX_ELEMENTS: readonly [typeof LynxView, typeof LynxText, typeof LynxInlineTruncation, typeof LynxImage, typeof LynxScrollView, typeof LynxList, typeof LynxListItem, typeof LynxBlock, typeof LynxIf, typeof LynxFor, typeof LynxFrame, typeof LynxInput, typeof LynxTextarea, typeof LynxInputValueAccessor, typeof LynxTextareaValueAccessor, typeof LynxOverlay, typeof LynxRefresh, typeof LynxRefreshHeader, typeof LynxScrollCoordinator, typeof LynxScrollCoordinatorHeader, typeof LynxScrollCoordinatorSlot, typeof LynxScrollCoordinatorSlotDrag, typeof LynxScrollCoordinatorToolbar, typeof LynxSvg, typeof LynxViewPager, typeof LynxViewPagerItem, typeof LynxBlurView, typeof LynxVideo, typeof LynxWebView, typeof LynxCoverView, typeof LynxTitleBarView];
|
|
3177
|
+
export declare const LYNX_ELEMENTS: readonly [typeof LynxView, typeof LynxText, typeof LynxInlineTruncation, typeof LynxImage, typeof LynxScrollView, typeof LynxList, typeof LynxListItem, typeof LynxBlock, typeof LynxIf, typeof LynxFor, typeof LynxFrame, typeof LynxInput, typeof LynxTextarea, typeof LynxInputValueAccessor, typeof LynxTextareaValueAccessor, typeof LynxOverlay, typeof LynxRefresh, typeof LynxRefreshHeader, typeof LynxScrollCoordinator, typeof LynxScrollCoordinatorHeader, typeof LynxScrollCoordinatorSlot, typeof LynxScrollCoordinatorSlotDrag, typeof LynxScrollCoordinatorToolbar, typeof LynxSvg, typeof LynxViewPager, typeof LynxViewPagerItem, typeof LynxBlurView, typeof LynxVideo, typeof LynxWebView, typeof LynxCoverView, typeof LynxTitleBarView, typeof LynxRouterLinkActive, typeof LynxAccessibilityTraits];
|
|
3178
|
+
type LynxEventType = 'bindEvent' | 'catchEvent' | 'capture-bindEvent' | 'capture-catchEvent' | 'global-bindEvent';
|
|
3179
|
+
declare const EVENT_PREFIXES: [string, LynxEventType][];
|
|
3180
|
+
/**
|
|
3181
|
+
* DOM event names whose Lynx event has another name. A listener for one of
|
|
3182
|
+
* them hears the Lynx event, bubbling, as if it were bound with `bind`: a
|
|
3183
|
+
* `(click)` listener runs on a tap. This is the mapping Lynx for Web makes
|
|
3184
|
+
* between the two (web-core's `W3cEventNameToLynx` turns a DOM `click` into
|
|
3185
|
+
* `tap`), and it's what lets Angular's own directives that listen for
|
|
3186
|
+
* `click`, such as `RouterLink`, work on Lynx elements.
|
|
3187
|
+
*/
|
|
3188
|
+
declare const DOM_EVENT_ALIASES: ReadonlyMap<string, string>;
|
|
3189
|
+
/**
|
|
3190
|
+
* The `nativeElement` of a Lynx element's `ElementRef`: AngularLynx's
|
|
3191
|
+
* wrapper around the native element, not a DOM element. Type an
|
|
3192
|
+
* `ElementRef` with it to call its methods, such as `animate()`, `invoke()`
|
|
3193
|
+
* or `setAccessibilityTrait()`.
|
|
3194
|
+
*
|
|
3195
|
+
* @usageNotes
|
|
3196
|
+
* ```ts
|
|
3197
|
+
* readonly option = viewChild.required<ElementRef<BaseLynxElement>>('option');
|
|
3198
|
+
* ```
|
|
3199
|
+
*/
|
|
3200
|
+
type BaseLynxElement = Pick<Element$1, 'setAttribute'> & {
|
|
3201
|
+
tagName: string;
|
|
3202
|
+
setProperty(name: string, value: any): void;
|
|
3203
|
+
getAttribute(name: string): string | null;
|
|
3204
|
+
removeAttribute(name: string): void;
|
|
3205
|
+
setStyle(key: string, value: unknown): void;
|
|
3206
|
+
removeStyle(key: string): void;
|
|
3207
|
+
setInlineStyles(inlineStyle: string): void;
|
|
3208
|
+
insertBefore(newChild: BaseLynxElement, refChild: BaseLynxElement | null): void;
|
|
3209
|
+
appendChild(newChild: BaseLynxElement): void;
|
|
3210
|
+
addClass(name: string): void;
|
|
3211
|
+
/**
|
|
3212
|
+
* Adds a class that stays when the whole class list is replaced, for
|
|
3213
|
+
* ViewEncapsulation.Emulated's scope classes (see EmulatedLynxRenderer).
|
|
3214
|
+
*/
|
|
3215
|
+
addScopeClass(name: string): void;
|
|
3216
|
+
removeClass(name: string): void;
|
|
3217
|
+
/**
|
|
3218
|
+
* Adds a trait to the element's own `accessibility-traits`, or takes it
|
|
3219
|
+
* away, keeping the traits the app sets. For state that changes, such as
|
|
3220
|
+
* `selected` on an active router link (see LynxRouterLinkActive). In a
|
|
3221
|
+
* template, LynxAccessibilityTraits does it from a binding.
|
|
3222
|
+
*/
|
|
3223
|
+
setAccessibilityTrait(trait: string, on: boolean): void;
|
|
3224
|
+
remove(): void;
|
|
3225
|
+
parentNode(): BaseLynxElement | null;
|
|
3226
|
+
nextSibling(): BaseLynxElement | null;
|
|
3227
|
+
querySelector(selector: string): BaseLynxElement | null;
|
|
3228
|
+
querySelectorAll(selector: string): BaseLynxElement[];
|
|
3229
|
+
addEventListener(name: string, cb: (event: any) => any): () => void;
|
|
3230
|
+
animate(keyframes: Record<string, string | number>[], options?: number | LynxAnimationOptions): BaseLynxAnimation;
|
|
3231
|
+
/**
|
|
3232
|
+
* Invokes a native UI method on this element (e.g. setValue, scrollTo).
|
|
3233
|
+
* LynxElement implements it via __InvokeUIMethod.
|
|
3234
|
+
*/
|
|
3235
|
+
invoke(methodName: string, params?: Record<string, unknown>): void;
|
|
3236
|
+
};
|
|
3004
3237
|
export declare class LynxLogger {
|
|
3005
3238
|
#private;
|
|
3006
3239
|
log(...args: unknown[]): void;
|
|
@@ -3153,38 +3386,6 @@ export declare class LynxNativeModule {
|
|
|
3153
3386
|
static ɵfac: i0.ɵɵFactoryDeclaration<LynxNativeModule, never>;
|
|
3154
3387
|
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
3155
3388
|
}
|
|
3156
|
-
type LynxEventType = 'bindEvent' | 'catchEvent' | 'capture-bindEvent' | 'capture-catchEvent' | 'global-bindEvent';
|
|
3157
|
-
declare const EVENT_PREFIXES: [string, LynxEventType][];
|
|
3158
|
-
type BaseLynxElement = Pick<Element$1, 'setAttribute'> & {
|
|
3159
|
-
tagName: string;
|
|
3160
|
-
setProperty(name: string, value: any): void;
|
|
3161
|
-
getAttribute(name: string): string | null;
|
|
3162
|
-
removeAttribute(name: string): void;
|
|
3163
|
-
setStyle(key: string, value: unknown): void;
|
|
3164
|
-
removeStyle(key: string): void;
|
|
3165
|
-
setInlineStyles(inlineStyle: string): void;
|
|
3166
|
-
insertBefore(newChild: BaseLynxElement, refChild: BaseLynxElement | null): void;
|
|
3167
|
-
appendChild(newChild: BaseLynxElement): void;
|
|
3168
|
-
addClass(name: string): void;
|
|
3169
|
-
/**
|
|
3170
|
-
* Adds a class that stays when the whole class list is replaced, for
|
|
3171
|
-
* ViewEncapsulation.Emulated's scope classes (see EmulatedLynxRenderer).
|
|
3172
|
-
*/
|
|
3173
|
-
addScopeClass(name: string): void;
|
|
3174
|
-
removeClass(name: string): void;
|
|
3175
|
-
remove(): void;
|
|
3176
|
-
parentNode(): BaseLynxElement | null;
|
|
3177
|
-
nextSibling(): BaseLynxElement | null;
|
|
3178
|
-
querySelector(selector: string): BaseLynxElement | null;
|
|
3179
|
-
querySelectorAll(selector: string): BaseLynxElement[];
|
|
3180
|
-
addEventListener(name: string, cb: (event: any) => any): () => void;
|
|
3181
|
-
animate(keyframes: Record<string, string | number>[], options?: number | LynxAnimationOptions): BaseLynxAnimation;
|
|
3182
|
-
/**
|
|
3183
|
-
* Invokes a native UI method on this element (e.g. setValue, scrollTo).
|
|
3184
|
-
* LynxElement implements it via __InvokeUIMethod.
|
|
3185
|
-
*/
|
|
3186
|
-
invoke(methodName: string, params?: Record<string, unknown>): void;
|
|
3187
|
-
};
|
|
3188
3389
|
declare class LynxElement implements BaseLynxElement {
|
|
3189
3390
|
#private;
|
|
3190
3391
|
get element(): ElementRef;
|
|
@@ -3228,6 +3429,12 @@ declare class LynxElement implements BaseLynxElement {
|
|
|
3228
3429
|
* creates one, and setAttribute whenever an attribute it depends on changes.
|
|
3229
3430
|
*/
|
|
3230
3431
|
updateBlurMaterial(): void;
|
|
3432
|
+
/**
|
|
3433
|
+
* Adds `trait` to the app's own `accessibility-traits`, or takes it away.
|
|
3434
|
+
* The app can still set its traits at any time: setAttribute merges the two
|
|
3435
|
+
* (see withAddedTraits), so neither undoes the other.
|
|
3436
|
+
*/
|
|
3437
|
+
setAccessibilityTrait(trait: string, on: boolean): void;
|
|
3231
3438
|
getAttribute(name: string): string;
|
|
3232
3439
|
removeAttribute(name: string): void;
|
|
3233
3440
|
setStyle(key: string, value: unknown): void;
|
|
@@ -3265,6 +3472,13 @@ declare class LynxElement implements BaseLynxElement {
|
|
|
3265
3472
|
* itself from the set via #cancelPendingRemoval, so only genuine destroys
|
|
3266
3473
|
* remain.
|
|
3267
3474
|
*/
|
|
3475
|
+
/**
|
|
3476
|
+
* Sends Lynx the attribute removals that weren't taken back this cycle
|
|
3477
|
+
* (see #removedAttributes). Called by `LynxRendererFactory2.end()` and the
|
|
3478
|
+
* settle flush, after removals and before `__FlushElementTree()`, so the
|
|
3479
|
+
* removals land in the same flush as the cycle's other mutations.
|
|
3480
|
+
*/
|
|
3481
|
+
static commitPendingAttributeRemovals(): void;
|
|
3268
3482
|
static commitPendingRemovals(): void;
|
|
3269
3483
|
/**
|
|
3270
3484
|
* Re-derives displayed whitespace for every text touched this cycle. Each dirty
|
|
@@ -3308,11 +3522,26 @@ declare class LynxElement implements BaseLynxElement {
|
|
|
3308
3522
|
* Angular's renderer.listen() calls this with event names like 'bindtap',
|
|
3309
3523
|
* 'catchtouchstart', 'bindscroll', etc. We strip the Lynx event prefix
|
|
3310
3524
|
* (bind/catch/capture-bind/capture-catch) to extract the native event name
|
|
3311
|
-
* and determine the event type for __AddEvent.
|
|
3312
|
-
*
|
|
3313
|
-
*
|
|
3525
|
+
* and determine the event type for __AddEvent. A DOM name Lynx calls
|
|
3526
|
+
* something else (see DOM_EVENT_ALIASES) listens for the Lynx event, so
|
|
3527
|
+
* `(click)`, and Angular's RouterLink with it, runs on a tap.
|
|
3528
|
+
* Other names (e.g. `mouseover`) are ignored: Lynx has no event for them.
|
|
3529
|
+
*
|
|
3530
|
+
* An element can have any number of listeners for one event, as on the
|
|
3531
|
+
* web: a template's `(bindtap)` next to a directive's host listener for
|
|
3532
|
+
* `click`, say. Native Lynx keeps one handler per event name, so each name
|
|
3533
|
+
* gets one native handler that runs all of them (see #syncNativeHandler).
|
|
3314
3534
|
*/
|
|
3315
3535
|
addEventListener(name: string, cb: (event: any) => any): () => void;
|
|
3536
|
+
/**
|
|
3537
|
+
* Removes a listener added with addEventListener, as the DOM method does,
|
|
3538
|
+
* for code that pairs the two on the element itself rather than going
|
|
3539
|
+
* through the renderer's cleanup function. Angular's `@defer` interaction
|
|
3540
|
+
* and hover triggers do, for their `click`, `keydown` and `mouseenter`
|
|
3541
|
+
* listeners; without it, their cleanup would throw. A name Lynx has no
|
|
3542
|
+
* event for was never added, so removing it does nothing.
|
|
3543
|
+
*/
|
|
3544
|
+
removeEventListener(name: string, cb: (event: any) => any): void;
|
|
3316
3545
|
}
|
|
3317
3546
|
/**
|
|
3318
3547
|
* Commits all queued genuine element removals — a free-function wrapper over
|
|
@@ -3321,6 +3550,14 @@ declare class LynxElement implements BaseLynxElement {
|
|
|
3321
3550
|
* keeping removals in the same flush as the cycle's other mutations.
|
|
3322
3551
|
*/
|
|
3323
3552
|
declare const processPendingRemovals: () => void;
|
|
3553
|
+
/**
|
|
3554
|
+
* Commits this cycle's attribute removals (see LynxElement's
|
|
3555
|
+
* `#removedAttributes`). A free-function wrapper over
|
|
3556
|
+
* `LynxElement.commitPendingAttributeRemovals()` so
|
|
3557
|
+
* `LynxRendererFactory2.end()` can drain them (via the lynx-element barrel)
|
|
3558
|
+
* right after element removals and before `__FlushElementTree()`.
|
|
3559
|
+
*/
|
|
3560
|
+
declare const processPendingAttributeRemovals: () => void;
|
|
3324
3561
|
/**
|
|
3325
3562
|
* Re-derives positional edge whitespace for every text touched this cycle — a
|
|
3326
3563
|
* free-function wrapper over `LynxElement.commitPendingTextNormalization()` so
|
|
@@ -4093,7 +4330,8 @@ export declare class LynxSessionStorage {
|
|
|
4093
4330
|
*
|
|
4094
4331
|
* On iOS and Android (Lynx 4.1), the main thread has no global `SystemInfo`,
|
|
4095
4332
|
* only `lynx.SystemInfo`, so that's read first. The background thread and the
|
|
4096
|
-
* web have the global.
|
|
4333
|
+
* web have the global. The main thread's copy has no `osVersion` either: see
|
|
4334
|
+
* {@link LynxSystemInfo.osVersion} for where that comes from instead.
|
|
4097
4335
|
*
|
|
4098
4336
|
* @usageNotes
|
|
4099
4337
|
* ```typescript
|
|
@@ -4124,7 +4362,13 @@ export declare class LynxSystemInfo {
|
|
|
4124
4362
|
*/
|
|
4125
4363
|
get engineVersion(): string;
|
|
4126
4364
|
/**
|
|
4127
|
-
* The current operating system version.
|
|
4365
|
+
* The current operating system version, such as `'26.1'` on iOS or `'15'`
|
|
4366
|
+
* on Android. Empty while it isn't known.
|
|
4367
|
+
*
|
|
4368
|
+
* The native main thread's SystemInfo lacks it, so there it comes from the
|
|
4369
|
+
* host app's `osVersion` global prop, or else from the background thread,
|
|
4370
|
+
* which answers shortly after the first frame. It reads a signal, so a
|
|
4371
|
+
* `computed()` that reads it updates when the answer arrives.
|
|
4128
4372
|
*/
|
|
4129
4373
|
get osVersion(): string;
|
|
4130
4374
|
/**
|
|
@@ -4184,6 +4428,22 @@ export declare class LynxTextMeasure {
|
|
|
4184
4428
|
static ɵfac: i0.ɵɵFactoryDeclaration<LynxTextMeasure, never>;
|
|
4185
4429
|
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
4186
4430
|
}
|
|
4431
|
+
/**
|
|
4432
|
+
* The Material 3 color roles that dynamic color gives, by Material's names.
|
|
4433
|
+
* The error roles aren't here: Material keeps them red whatever the
|
|
4434
|
+
* wallpaper.
|
|
4435
|
+
*/
|
|
4436
|
+
export declare const DYNAMIC_COLOR_ROLES: readonly ["primary", "onPrimary", "primaryContainer", "onPrimaryContainer", "inversePrimary", "secondary", "onSecondary", "secondaryContainer", "onSecondaryContainer", "tertiary", "onTertiary", "tertiaryContainer", "onTertiaryContainer", "background", "onBackground", "surface", "onSurface", "surfaceVariant", "onSurfaceVariant", "surfaceDim", "surfaceBright", "surfaceContainerLowest", "surfaceContainerLow", "surfaceContainer", "surfaceContainerHigh", "surfaceContainerHighest", "inverseSurface", "inverseOnSurface", "outline", "outlineVariant"];
|
|
4437
|
+
type DynamicColorRole = (typeof DYNAMIC_COLOR_ROLES)[number];
|
|
4438
|
+
/**
|
|
4439
|
+
* Each role's color, as a hex color such as `#6750a4`.
|
|
4440
|
+
*/
|
|
4441
|
+
type DynamicColorScheme = { readonly [R in DynamicColorRole]: string; };
|
|
4442
|
+
/** The color scheme for each appearance: the app can be in either. */
|
|
4443
|
+
type DynamicColors = {
|
|
4444
|
+
readonly light: DynamicColorScheme;
|
|
4445
|
+
readonly dark: DynamicColorScheme;
|
|
4446
|
+
};
|
|
4187
4447
|
/**
|
|
4188
4448
|
* Provides reactive access to the current Lynx theme ('Dark' or 'Light').
|
|
4189
4449
|
*
|
|
@@ -4211,6 +4471,22 @@ export declare class LynxTheme {
|
|
|
4211
4471
|
* Whether the current theme is dark mode. Reactive.
|
|
4212
4472
|
*/
|
|
4213
4473
|
readonly isDarkMode: import("@angular/core").Signal<boolean>;
|
|
4474
|
+
/**
|
|
4475
|
+
* The colors Android 12 and later take from the user's wallpaper (Material
|
|
4476
|
+
* You's dynamic color), as Material 3's color roles in light and dark, or
|
|
4477
|
+
* `null` where the host sends none.
|
|
4478
|
+
*
|
|
4479
|
+
* Lynx has no API for them, so they come from the host app, in its
|
|
4480
|
+
* `dynamicColors` global prop: `{ light, dark }`, each with a hex color,
|
|
4481
|
+
* such as `#6750a4`, for every role in {@link DYNAMIC_COLOR_ROLES}. The
|
|
4482
|
+
* Android app `ng build --platform android` makes sends them, and new ones
|
|
4483
|
+
* when the user changes their wallpaper or colors. iOS, the web preview and
|
|
4484
|
+
* Lynx Explorer have none.
|
|
4485
|
+
*
|
|
4486
|
+
* Both schemes come at once, so an app with a dark mode of its own can
|
|
4487
|
+
* follow it rather than the phone's.
|
|
4488
|
+
*/
|
|
4489
|
+
readonly dynamicColors: import("@angular/core").Signal<DynamicColors | null>;
|
|
4214
4490
|
static ɵfac: i0.ɵɵFactoryDeclaration<LynxTheme, never>;
|
|
4215
4491
|
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
4216
4492
|
}
|
|
@@ -4642,6 +4918,12 @@ declare const handlers: {
|
|
|
4642
4918
|
*/
|
|
4643
4919
|
callModule: (kind: ModuleKind, name: string, method: string, args: unknown[]) => unknown;
|
|
4644
4920
|
registerJSModule: (name: string, module: unknown) => void;
|
|
4921
|
+
/**
|
|
4922
|
+
* The OS version, for LynxSystemInfo on the main thread: native Lynx builds
|
|
4923
|
+
* that thread's SystemInfo without one, and the background thread's global
|
|
4924
|
+
* has it.
|
|
4925
|
+
*/
|
|
4926
|
+
osVersion: () => string | undefined;
|
|
4645
4927
|
/** The main thread's `fetch` (network/fetch.ts) sends its requests here. */
|
|
4646
4928
|
fetch: (id: number, request: RelayedRequest) => Promise<RelayedResponse>;
|
|
4647
4929
|
abortFetch: (id: number) => void;
|
|
@@ -4786,4 +5068,4 @@ declare global {
|
|
|
4786
5068
|
catchmouseleave: MouseEvent;
|
|
4787
5069
|
}
|
|
4788
5070
|
}
|
|
4789
|
-
export type { BackgroundFnHandle, BaseLynxAnimation, DataProcessorDefinition, DevToolsStats, ExposureEventDetail, FlingGestureEvent, GestureCallback, GestureCallbackWithState, GestureEvent, GlobalData, GlobalExposureEvent, InitData, InitDataRaw, LongPressGestureEvent, LynxAnimationOptions, LynxFontEntry, LynxFontFaceConfig, LynxFontStatus, LynxTraceOptions, MainThread, MainThreadFnHandle, NativeModuleMap, NativeModuleProxy, ObserverFrameRateOptions, PanGestureEvent, PinchGestureEvent, PortalConfig, PrefetchCacheTarget, PrefetchPriority, PrefetchRequest, PrefetchResultDetail, ResourcePrefetchData, ResourcePrefetchResult, RotationGestureEvent, SessionStorageSubscription, TapGestureEvent };
|
|
5071
|
+
export type { AccessibilityTrait, AccessibilityTraitStates, BackgroundFnHandle, BaseLynxAnimation, BaseLynxElement, DataProcessorDefinition, DevToolsStats, DynamicColorRole, DynamicColorScheme, DynamicColors, ExposureEventDetail, FlingGestureEvent, GestureCallback, GestureCallbackWithState, GestureEvent, GlobalData, GlobalExposureEvent, InitData, InitDataRaw, LongPressGestureEvent, LynxAnimationOptions, LynxFontEntry, LynxFontFaceConfig, LynxFontStatus, LynxTraceOptions, MainThread, MainThreadFnHandle, NativeModuleMap, NativeModuleProxy, ObserverFrameRateOptions, PanGestureEvent, PinchGestureEvent, PortalConfig, PrefetchCacheTarget, PrefetchPriority, PrefetchRequest, PrefetchResultDetail, ResourcePrefetchData, ResourcePrefetchResult, RotationGestureEvent, SessionStorageSubscription, TapGestureEvent };
|