@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
|
@@ -3,7 +3,7 @@ import { ApplicationRef, Component, DOCUMENT, DestroyRef, Directive, ElementRef,
|
|
|
3
3
|
import { ReplaySubject, Subject, firstValueFrom } from "rxjs";
|
|
4
4
|
import { APP_BASE_HREF, IMAGE_CONFIG, Location, LocationStrategy, PlatformLocation, getLocaleId } from "@angular/common";
|
|
5
5
|
import { NG_VALUE_ACCESSOR } from "@angular/forms";
|
|
6
|
-
import { provideRouter as provideRouter$1, withRouterConfig } from "@angular/router";
|
|
6
|
+
import { RouterLinkActive, provideRouter as provideRouter$1, withRouterConfig } from "@angular/router";
|
|
7
7
|
import { bootstrapApplication as bootstrapApplication$1 } from "@angular/platform-browser";
|
|
8
8
|
const ALPHABET = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
|
9
9
|
const VALUES = new Map(Array.from(ALPHABET, (char, index) => [char, index]));
|
|
@@ -241,6 +241,7 @@ const handlers = {
|
|
|
241
241
|
registerJSModule: (name, module) => {
|
|
242
242
|
lynxApi("registerModule")(name, restoreFunctions(module));
|
|
243
243
|
},
|
|
244
|
+
osVersion: () => typeof SystemInfo !== "undefined" ? SystemInfo.osVersion : void 0,
|
|
244
245
|
fetch: (id, request) => fetchForMainThread(id, request),
|
|
245
246
|
abortFetch: (id) => abortFetchForMainThread(id)
|
|
246
247
|
};
|
|
@@ -512,6 +513,121 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
512
513
|
args: [{ providedIn: "root" }]
|
|
513
514
|
}]
|
|
514
515
|
});
|
|
516
|
+
const initDataUpdates = new Subject();
|
|
517
|
+
const globalDataUpdates = new Subject();
|
|
518
|
+
const asRecord = (data) => typeof data === "object" && data !== null ? data : {};
|
|
519
|
+
const applyInitDataUpdate = (data, reset) => {
|
|
520
|
+
const host = lynx;
|
|
521
|
+
const next = {
|
|
522
|
+
...reset ? {} : host.__initData,
|
|
523
|
+
...asRecord(data)
|
|
524
|
+
};
|
|
525
|
+
host.__initData = next;
|
|
526
|
+
initDataUpdates.next(next);
|
|
527
|
+
return next;
|
|
528
|
+
};
|
|
529
|
+
const applyGlobalDataUpdate = (data) => {
|
|
530
|
+
const next = {
|
|
531
|
+
...lynx.__globalProps,
|
|
532
|
+
...asRecord(data)
|
|
533
|
+
};
|
|
534
|
+
lynx.__globalProps = next;
|
|
535
|
+
globalDataUpdates.next(next);
|
|
536
|
+
return next;
|
|
537
|
+
};
|
|
538
|
+
var LynxGlobalData = class LynxGlobalData {
|
|
539
|
+
globalData = signal(typeof lynx !== "undefined" && lynx.__globalProps || {}, ...ngDevMode ? [{ debugName: "globalData" }] : /* istanbul ignore next */ []);
|
|
540
|
+
constructor() {
|
|
541
|
+
const subscription = globalDataUpdates.subscribe((data) => this.globalData.set(data));
|
|
542
|
+
inject(DestroyRef).onDestroy(() => subscription.unsubscribe());
|
|
543
|
+
}
|
|
544
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
545
|
+
minVersion: "12.0.0",
|
|
546
|
+
version: "22.2.1",
|
|
547
|
+
ngImport: i0,
|
|
548
|
+
type: LynxGlobalData,
|
|
549
|
+
deps: [],
|
|
550
|
+
target: i0.ɵɵFactoryTarget.Injectable
|
|
551
|
+
});
|
|
552
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({
|
|
553
|
+
minVersion: "12.0.0",
|
|
554
|
+
version: "22.2.1",
|
|
555
|
+
ngImport: i0,
|
|
556
|
+
type: LynxGlobalData,
|
|
557
|
+
providedIn: "root"
|
|
558
|
+
});
|
|
559
|
+
};
|
|
560
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
561
|
+
minVersion: "12.0.0",
|
|
562
|
+
version: "22.2.1",
|
|
563
|
+
ngImport: i0,
|
|
564
|
+
type: LynxGlobalData,
|
|
565
|
+
decorators: [{
|
|
566
|
+
type: Injectable,
|
|
567
|
+
args: [{ providedIn: "root" }]
|
|
568
|
+
}],
|
|
569
|
+
ctorParameters: () => []
|
|
570
|
+
});
|
|
571
|
+
const MEDIA_QUERIES = {
|
|
572
|
+
reduceMotion: "(prefers-reduced-motion: reduce)",
|
|
573
|
+
reduceTransparency: "(prefers-reduced-transparency: reduce)",
|
|
574
|
+
increaseContrast: "(prefers-contrast: more)"
|
|
575
|
+
};
|
|
576
|
+
const isOn = (data, setting) => data[setting] === true || data[setting] === "true";
|
|
577
|
+
const pageWindow = () => {
|
|
578
|
+
if (!__WEB__ || typeof __GetPageElement !== "function") return void 0;
|
|
579
|
+
return __GetPageElement()?.ownerDocument?.defaultView ?? void 0;
|
|
580
|
+
};
|
|
581
|
+
const watchMediaQueries = (destroyRef) => {
|
|
582
|
+
const win = pageWindow();
|
|
583
|
+
const signals = {};
|
|
584
|
+
for (const setting of Object.keys(MEDIA_QUERIES)) {
|
|
585
|
+
const query = typeof win?.matchMedia === "function" ? win.matchMedia(MEDIA_QUERIES[setting]) : void 0;
|
|
586
|
+
const matches = signal(query?.matches ?? false, ...ngDevMode ? [{ debugName: "matches" }] : /* istanbul ignore next */ []);
|
|
587
|
+
if (query) {
|
|
588
|
+
const update = () => matches.set(query.matches);
|
|
589
|
+
query.addEventListener("change", update);
|
|
590
|
+
destroyRef.onDestroy(() => query.removeEventListener("change", update));
|
|
591
|
+
}
|
|
592
|
+
signals[setting] = matches.asReadonly();
|
|
593
|
+
}
|
|
594
|
+
return signals;
|
|
595
|
+
};
|
|
596
|
+
var LynxAccessibilitySettings = class LynxAccessibilitySettings {
|
|
597
|
+
#globalData = inject(LynxGlobalData);
|
|
598
|
+
#media = watchMediaQueries(inject(DestroyRef));
|
|
599
|
+
reduceMotion = this.#setting("reduceMotion");
|
|
600
|
+
reduceTransparency = this.#setting("reduceTransparency");
|
|
601
|
+
increaseContrast = this.#setting("increaseContrast");
|
|
602
|
+
#setting(setting) {
|
|
603
|
+
return computed(() => isOn(this.#globalData.globalData(), setting) || this.#media[setting]());
|
|
604
|
+
}
|
|
605
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
606
|
+
minVersion: "12.0.0",
|
|
607
|
+
version: "22.2.1",
|
|
608
|
+
ngImport: i0,
|
|
609
|
+
type: LynxAccessibilitySettings,
|
|
610
|
+
deps: [],
|
|
611
|
+
target: i0.ɵɵFactoryTarget.Injectable
|
|
612
|
+
});
|
|
613
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({
|
|
614
|
+
minVersion: "12.0.0",
|
|
615
|
+
version: "22.2.1",
|
|
616
|
+
ngImport: i0,
|
|
617
|
+
type: LynxAccessibilitySettings,
|
|
618
|
+
providedIn: "root"
|
|
619
|
+
});
|
|
620
|
+
};
|
|
621
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
622
|
+
minVersion: "12.0.0",
|
|
623
|
+
version: "22.2.1",
|
|
624
|
+
ngImport: i0,
|
|
625
|
+
type: LynxAccessibilitySettings,
|
|
626
|
+
decorators: [{
|
|
627
|
+
type: Injectable,
|
|
628
|
+
args: [{ providedIn: "root" }]
|
|
629
|
+
}]
|
|
630
|
+
});
|
|
515
631
|
var LynxPerformance = class LynxPerformance {
|
|
516
632
|
#perf = this.#resolve();
|
|
517
633
|
#resolve() {
|
|
@@ -646,61 +762,6 @@ const registerDataProcessors = (definition) => {
|
|
|
646
762
|
}
|
|
647
763
|
};
|
|
648
764
|
};
|
|
649
|
-
const initDataUpdates = new Subject();
|
|
650
|
-
const globalDataUpdates = new Subject();
|
|
651
|
-
const asRecord = (data) => typeof data === "object" && data !== null ? data : {};
|
|
652
|
-
const applyInitDataUpdate = (data, reset) => {
|
|
653
|
-
const host = lynx;
|
|
654
|
-
const next = {
|
|
655
|
-
...reset ? {} : host.__initData,
|
|
656
|
-
...asRecord(data)
|
|
657
|
-
};
|
|
658
|
-
host.__initData = next;
|
|
659
|
-
initDataUpdates.next(next);
|
|
660
|
-
return next;
|
|
661
|
-
};
|
|
662
|
-
const applyGlobalDataUpdate = (data) => {
|
|
663
|
-
const next = {
|
|
664
|
-
...lynx.__globalProps,
|
|
665
|
-
...asRecord(data)
|
|
666
|
-
};
|
|
667
|
-
lynx.__globalProps = next;
|
|
668
|
-
globalDataUpdates.next(next);
|
|
669
|
-
return next;
|
|
670
|
-
};
|
|
671
|
-
var LynxGlobalData = class LynxGlobalData {
|
|
672
|
-
globalData = signal(typeof lynx !== "undefined" && lynx.__globalProps || {}, ...ngDevMode ? [{ debugName: "globalData" }] : /* istanbul ignore next */ []);
|
|
673
|
-
constructor() {
|
|
674
|
-
const subscription = globalDataUpdates.subscribe((data) => this.globalData.set(data));
|
|
675
|
-
inject(DestroyRef).onDestroy(() => subscription.unsubscribe());
|
|
676
|
-
}
|
|
677
|
-
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
678
|
-
minVersion: "12.0.0",
|
|
679
|
-
version: "22.2.1",
|
|
680
|
-
ngImport: i0,
|
|
681
|
-
type: LynxGlobalData,
|
|
682
|
-
deps: [],
|
|
683
|
-
target: i0.ɵɵFactoryTarget.Injectable
|
|
684
|
-
});
|
|
685
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({
|
|
686
|
-
minVersion: "12.0.0",
|
|
687
|
-
version: "22.2.1",
|
|
688
|
-
ngImport: i0,
|
|
689
|
-
type: LynxGlobalData,
|
|
690
|
-
providedIn: "root"
|
|
691
|
-
});
|
|
692
|
-
};
|
|
693
|
-
i0.ɵɵngDeclareClassMetadata({
|
|
694
|
-
minVersion: "12.0.0",
|
|
695
|
-
version: "22.2.1",
|
|
696
|
-
ngImport: i0,
|
|
697
|
-
type: LynxGlobalData,
|
|
698
|
-
decorators: [{
|
|
699
|
-
type: Injectable,
|
|
700
|
-
args: [{ providedIn: "root" }]
|
|
701
|
-
}],
|
|
702
|
-
ctorParameters: () => []
|
|
703
|
-
});
|
|
704
765
|
var LynxInitData = class LynxInitData {
|
|
705
766
|
initData = signal(typeof lynx !== "undefined" && lynx.__initData || {}, ...ngDevMode ? [{ debugName: "initData" }] : /* istanbul ignore next */ []);
|
|
706
767
|
constructor() {
|
|
@@ -1726,6 +1787,7 @@ var LynxBlurView = class LynxBlurView extends LynxElementBase {
|
|
|
1726
1787
|
"android-capture-target";
|
|
1727
1788
|
"experimental-update-blur-radius";
|
|
1728
1789
|
"blur-effect";
|
|
1790
|
+
"blur-material";
|
|
1729
1791
|
spacing;
|
|
1730
1792
|
"glass-interactive";
|
|
1731
1793
|
"glass-tint-color";
|
|
@@ -1752,6 +1814,7 @@ var LynxBlurView = class LynxBlurView extends LynxElementBase {
|
|
|
1752
1814
|
"android-capture-target": "android-capture-target",
|
|
1753
1815
|
"experimental-update-blur-radius": "experimental-update-blur-radius",
|
|
1754
1816
|
"blur-effect": "blur-effect",
|
|
1817
|
+
"blur-material": "blur-material",
|
|
1755
1818
|
spacing: "spacing",
|
|
1756
1819
|
"glass-interactive": "glass-interactive",
|
|
1757
1820
|
"glass-tint-color": "glass-tint-color",
|
|
@@ -1778,6 +1841,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
1778
1841
|
"android-capture-target",
|
|
1779
1842
|
"experimental-update-blur-radius",
|
|
1780
1843
|
"blur-effect",
|
|
1844
|
+
"blur-material",
|
|
1781
1845
|
"spacing",
|
|
1782
1846
|
"glass-interactive",
|
|
1783
1847
|
"glass-tint-color",
|
|
@@ -3304,6 +3368,99 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
3304
3368
|
}]
|
|
3305
3369
|
}]
|
|
3306
3370
|
});
|
|
3371
|
+
const ROUTER_LINK_ACTIVE_CHANGE = new InjectionToken("router-link-active-change");
|
|
3372
|
+
var LynxRouterLinkActive = class LynxRouterLinkActive {
|
|
3373
|
+
constructor() {
|
|
3374
|
+
const activeChange = inject(ROUTER_LINK_ACTIVE_CHANGE, { optional: true })?.();
|
|
3375
|
+
if (!activeChange) return;
|
|
3376
|
+
const element = inject(ElementRef).nativeElement;
|
|
3377
|
+
const subscription = activeChange.subscribe((active) => element.setAccessibilityTrait("selected", active));
|
|
3378
|
+
inject(DestroyRef).onDestroy(() => subscription.unsubscribe());
|
|
3379
|
+
}
|
|
3380
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
3381
|
+
minVersion: "12.0.0",
|
|
3382
|
+
version: "22.2.1",
|
|
3383
|
+
ngImport: i0,
|
|
3384
|
+
type: LynxRouterLinkActive,
|
|
3385
|
+
deps: [],
|
|
3386
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
3387
|
+
});
|
|
3388
|
+
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
3389
|
+
minVersion: "14.0.0",
|
|
3390
|
+
version: "22.2.1",
|
|
3391
|
+
type: LynxRouterLinkActive,
|
|
3392
|
+
isStandalone: true,
|
|
3393
|
+
selector: "[routerLinkActive]",
|
|
3394
|
+
ngImport: i0
|
|
3395
|
+
});
|
|
3396
|
+
};
|
|
3397
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
3398
|
+
minVersion: "12.0.0",
|
|
3399
|
+
version: "22.2.1",
|
|
3400
|
+
ngImport: i0,
|
|
3401
|
+
type: LynxRouterLinkActive,
|
|
3402
|
+
decorators: [{
|
|
3403
|
+
type: Directive,
|
|
3404
|
+
args: [{ selector: "[routerLinkActive]" }]
|
|
3405
|
+
}],
|
|
3406
|
+
ctorParameters: () => []
|
|
3407
|
+
});
|
|
3408
|
+
var LynxAccessibilityTraits = class LynxAccessibilityTraits {
|
|
3409
|
+
lynxAccessibilityTraits = input(...ngDevMode ? [void 0, { debugName: "lynxAccessibilityTraits" }] : /* istanbul ignore next */ []);
|
|
3410
|
+
#element = inject(ElementRef).nativeElement;
|
|
3411
|
+
#added = [];
|
|
3412
|
+
constructor() {
|
|
3413
|
+
effect(() => {
|
|
3414
|
+
const states = this.lynxAccessibilityTraits() ?? {};
|
|
3415
|
+
const on = Object.keys(states).filter((trait) => states[trait]);
|
|
3416
|
+
for (const trait of this.#added) if (!on.includes(trait)) this.#element.setAccessibilityTrait(trait, false);
|
|
3417
|
+
for (const trait of on) this.#element.setAccessibilityTrait(trait, true);
|
|
3418
|
+
this.#added = on;
|
|
3419
|
+
});
|
|
3420
|
+
}
|
|
3421
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
3422
|
+
minVersion: "12.0.0",
|
|
3423
|
+
version: "22.2.1",
|
|
3424
|
+
ngImport: i0,
|
|
3425
|
+
type: LynxAccessibilityTraits,
|
|
3426
|
+
deps: [],
|
|
3427
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
3428
|
+
});
|
|
3429
|
+
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
3430
|
+
minVersion: "17.1.0",
|
|
3431
|
+
version: "22.2.1",
|
|
3432
|
+
type: LynxAccessibilityTraits,
|
|
3433
|
+
isStandalone: true,
|
|
3434
|
+
selector: "[lynxAccessibilityTraits]",
|
|
3435
|
+
inputs: { lynxAccessibilityTraits: {
|
|
3436
|
+
classPropertyName: "lynxAccessibilityTraits",
|
|
3437
|
+
publicName: "lynxAccessibilityTraits",
|
|
3438
|
+
isSignal: true,
|
|
3439
|
+
isRequired: false,
|
|
3440
|
+
transformFunction: null
|
|
3441
|
+
} },
|
|
3442
|
+
ngImport: i0
|
|
3443
|
+
});
|
|
3444
|
+
};
|
|
3445
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
3446
|
+
minVersion: "12.0.0",
|
|
3447
|
+
version: "22.2.1",
|
|
3448
|
+
ngImport: i0,
|
|
3449
|
+
type: LynxAccessibilityTraits,
|
|
3450
|
+
decorators: [{
|
|
3451
|
+
type: Directive,
|
|
3452
|
+
args: [{ selector: "[lynxAccessibilityTraits]" }]
|
|
3453
|
+
}],
|
|
3454
|
+
ctorParameters: () => [],
|
|
3455
|
+
propDecorators: { lynxAccessibilityTraits: [{
|
|
3456
|
+
type: i0.Input,
|
|
3457
|
+
args: [{
|
|
3458
|
+
isSignal: true,
|
|
3459
|
+
alias: "lynxAccessibilityTraits",
|
|
3460
|
+
required: false
|
|
3461
|
+
}]
|
|
3462
|
+
}] }
|
|
3463
|
+
});
|
|
3307
3464
|
const LYNX_ELEMENTS = [
|
|
3308
3465
|
LynxView,
|
|
3309
3466
|
LynxText,
|
|
@@ -3335,7 +3492,9 @@ const LYNX_ELEMENTS = [
|
|
|
3335
3492
|
LynxVideo,
|
|
3336
3493
|
LynxWebView,
|
|
3337
3494
|
LynxCoverView,
|
|
3338
|
-
LynxTitleBarView
|
|
3495
|
+
LynxTitleBarView,
|
|
3496
|
+
LynxRouterLinkActive,
|
|
3497
|
+
LynxAccessibilityTraits
|
|
3339
3498
|
];
|
|
3340
3499
|
const LOG_EVENT = "__lynx_log__";
|
|
3341
3500
|
const logUrl = () => __DEV__ && typeof __DEV_LOG_URL__ !== "undefined" ? __DEV_LOG_URL__ : "";
|
|
@@ -3942,12 +4101,21 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
3942
4101
|
args: [{ providedIn: "root" }]
|
|
3943
4102
|
}]
|
|
3944
4103
|
});
|
|
4104
|
+
const hostOsVersion = () => {
|
|
4105
|
+
const value = typeof lynx !== "undefined" ? lynx.__globalProps?.["osVersion"] : void 0;
|
|
4106
|
+
return typeof value === "string" && value !== "" ? value : void 0;
|
|
4107
|
+
};
|
|
3945
4108
|
var LynxSystemInfo = class LynxSystemInfo {
|
|
3946
4109
|
#info;
|
|
4110
|
+
#osVersion = signal(void 0, ...ngDevMode ? [{ debugName: "#osVersion" }] : /* istanbul ignore next */ []);
|
|
3947
4111
|
constructor() {
|
|
3948
4112
|
const info = (typeof lynx !== "undefined" ? lynx.SystemInfo : void 0) ?? (typeof SystemInfo !== "undefined" ? SystemInfo : void 0);
|
|
3949
4113
|
if (!info) throw new Error("SystemInfo is not available in this environment");
|
|
3950
4114
|
this.#info = info;
|
|
4115
|
+
this.#osVersion.set(info.osVersion || hostOsVersion());
|
|
4116
|
+
if (this.#osVersion() === void 0 && isMainThread()) callOnBackground("osVersion").then((version) => {
|
|
4117
|
+
if (version) this.#osVersion.set(version);
|
|
4118
|
+
}, () => {});
|
|
3951
4119
|
}
|
|
3952
4120
|
get platform() {
|
|
3953
4121
|
return this.#info.platform;
|
|
@@ -3956,7 +4124,7 @@ var LynxSystemInfo = class LynxSystemInfo {
|
|
|
3956
4124
|
return this.#info.engineVersion;
|
|
3957
4125
|
}
|
|
3958
4126
|
get osVersion() {
|
|
3959
|
-
return this.#
|
|
4127
|
+
return this.#osVersion() ?? "";
|
|
3960
4128
|
}
|
|
3961
4129
|
get pixelWidth() {
|
|
3962
4130
|
return this.#info.pixelWidth;
|
|
@@ -4182,12 +4350,71 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
4182
4350
|
args: [{ providedIn: "root" }]
|
|
4183
4351
|
}]
|
|
4184
4352
|
});
|
|
4353
|
+
const DYNAMIC_COLOR_ROLES = [
|
|
4354
|
+
"primary",
|
|
4355
|
+
"onPrimary",
|
|
4356
|
+
"primaryContainer",
|
|
4357
|
+
"onPrimaryContainer",
|
|
4358
|
+
"inversePrimary",
|
|
4359
|
+
"secondary",
|
|
4360
|
+
"onSecondary",
|
|
4361
|
+
"secondaryContainer",
|
|
4362
|
+
"onSecondaryContainer",
|
|
4363
|
+
"tertiary",
|
|
4364
|
+
"onTertiary",
|
|
4365
|
+
"tertiaryContainer",
|
|
4366
|
+
"onTertiaryContainer",
|
|
4367
|
+
"background",
|
|
4368
|
+
"onBackground",
|
|
4369
|
+
"surface",
|
|
4370
|
+
"onSurface",
|
|
4371
|
+
"surfaceVariant",
|
|
4372
|
+
"onSurfaceVariant",
|
|
4373
|
+
"surfaceDim",
|
|
4374
|
+
"surfaceBright",
|
|
4375
|
+
"surfaceContainerLowest",
|
|
4376
|
+
"surfaceContainerLow",
|
|
4377
|
+
"surfaceContainer",
|
|
4378
|
+
"surfaceContainerHigh",
|
|
4379
|
+
"surfaceContainerHighest",
|
|
4380
|
+
"inverseSurface",
|
|
4381
|
+
"inverseOnSurface",
|
|
4382
|
+
"outline",
|
|
4383
|
+
"outlineVariant"
|
|
4384
|
+
];
|
|
4385
|
+
const HEX_COLOR = /^#[0-9a-f]{6}$/i;
|
|
4386
|
+
const parseScheme = (value) => {
|
|
4387
|
+
if (typeof value !== "object" || value === null) return null;
|
|
4388
|
+
const colors = value;
|
|
4389
|
+
const scheme = {};
|
|
4390
|
+
for (const role of DYNAMIC_COLOR_ROLES) {
|
|
4391
|
+
const color = colors[role];
|
|
4392
|
+
if (typeof color !== "string" || !HEX_COLOR.test(color)) return null;
|
|
4393
|
+
scheme[role] = color;
|
|
4394
|
+
}
|
|
4395
|
+
return scheme;
|
|
4396
|
+
};
|
|
4397
|
+
const parseDynamicColors = (value) => {
|
|
4398
|
+
if (typeof value !== "object" || value === null) return null;
|
|
4399
|
+
const { light, dark } = value;
|
|
4400
|
+
const lightScheme = parseScheme(light);
|
|
4401
|
+
const darkScheme = parseScheme(dark);
|
|
4402
|
+
return lightScheme && darkScheme ? {
|
|
4403
|
+
light: lightScheme,
|
|
4404
|
+
dark: darkScheme
|
|
4405
|
+
} : null;
|
|
4406
|
+
};
|
|
4407
|
+
const sameColors = (a, b) => a === b || a !== null && b !== null && DYNAMIC_COLOR_ROLES.every((role) => a.light[role] === b.light[role] && a.dark[role] === b.dark[role]);
|
|
4185
4408
|
var LynxTheme = class LynxTheme {
|
|
4186
4409
|
#globalData = inject(LynxGlobalData);
|
|
4187
4410
|
theme = computed(() => {
|
|
4188
4411
|
return this.#globalData.globalData()["theme"] ?? "Light";
|
|
4189
4412
|
}, ...ngDevMode ? [{ debugName: "theme" }] : /* istanbul ignore next */ []);
|
|
4190
4413
|
isDarkMode = computed(() => this.theme() === "Dark", ...ngDevMode ? [{ debugName: "isDarkMode" }] : /* istanbul ignore next */ []);
|
|
4414
|
+
dynamicColors = computed(() => parseDynamicColors(this.#globalData.globalData()["dynamicColors"]), {
|
|
4415
|
+
...ngDevMode ? { debugName: "dynamicColors" } : /* istanbul ignore next */ {},
|
|
4416
|
+
equal: sameColors
|
|
4417
|
+
});
|
|
4191
4418
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
4192
4419
|
minVersion: "12.0.0",
|
|
4193
4420
|
version: "22.2.1",
|
|
@@ -4673,7 +4900,7 @@ const isAndroid = () => {
|
|
|
4673
4900
|
const createBlurViewElement = (pageId) => {
|
|
4674
4901
|
const element = __CreateElement("blur-view", pageId);
|
|
4675
4902
|
if (!__WEB__ && isAndroid()) __SetAttribute(element, "android-capture-target", ANDROID_BLUR_CAPTURE_TARGET);
|
|
4676
|
-
if (__WEB__ && __MAIN_THREAD__) import("./blotch-angular-lynx-web-glass-
|
|
4903
|
+
if (__WEB__ && __MAIN_THREAD__) import("./blotch-angular-lynx-web-glass-zlVeee5K.mjs").then(({ attachWebGlass }) => attachWebGlass(element)).catch(() => {});
|
|
4677
4904
|
return element;
|
|
4678
4905
|
};
|
|
4679
4906
|
const createCommentElement = (pageId) => {
|
|
@@ -4884,6 +5111,61 @@ const sanitizeSvgContent = (content) => {
|
|
|
4884
5111
|
return normalized === null ? before : `${before}stroke-dasharray:${normalized};`;
|
|
4885
5112
|
});
|
|
4886
5113
|
};
|
|
5114
|
+
const LONG_PRESS_SLOP = 10;
|
|
5115
|
+
const TAP_GRACE = 300;
|
|
5116
|
+
let tapsDropped = false;
|
|
5117
|
+
let longPresses = 0;
|
|
5118
|
+
const dropsTap = () => tapsDropped;
|
|
5119
|
+
const pointOf = (event) => {
|
|
5120
|
+
const { x = 0, y = 0 } = typeof event.detail === "object" && event.detail !== null ? event.detail : event;
|
|
5121
|
+
return {
|
|
5122
|
+
x,
|
|
5123
|
+
y
|
|
5124
|
+
};
|
|
5125
|
+
};
|
|
5126
|
+
var WebLongPress = class {
|
|
5127
|
+
#fire;
|
|
5128
|
+
#timer;
|
|
5129
|
+
#start = null;
|
|
5130
|
+
#fired = false;
|
|
5131
|
+
constructor(fire) {
|
|
5132
|
+
this.#fire = fire;
|
|
5133
|
+
}
|
|
5134
|
+
start = (event) => {
|
|
5135
|
+
if (event.button !== void 0 && event.button !== 0) return;
|
|
5136
|
+
this.#stop();
|
|
5137
|
+
this.#fired = false;
|
|
5138
|
+
const point = pointOf(event);
|
|
5139
|
+
this.#start = point;
|
|
5140
|
+
this.#timer = setTimeout(() => {
|
|
5141
|
+
this.#timer = void 0;
|
|
5142
|
+
this.#fired = true;
|
|
5143
|
+
longPresses++;
|
|
5144
|
+
tapsDropped = true;
|
|
5145
|
+
this.#fire(point);
|
|
5146
|
+
}, 500);
|
|
5147
|
+
};
|
|
5148
|
+
move = (event) => {
|
|
5149
|
+
if (!this.#start) return;
|
|
5150
|
+
const { x, y } = pointOf(event);
|
|
5151
|
+
if (Math.hypot(x - this.#start.x, y - this.#start.y) > LONG_PRESS_SLOP) this.#stop();
|
|
5152
|
+
};
|
|
5153
|
+
end = () => {
|
|
5154
|
+
this.#stop();
|
|
5155
|
+
this.#start = null;
|
|
5156
|
+
if (this.#fired) {
|
|
5157
|
+
this.#fired = false;
|
|
5158
|
+
const longPress = longPresses;
|
|
5159
|
+
setTimeout(() => {
|
|
5160
|
+
if (longPress === longPresses) tapsDropped = false;
|
|
5161
|
+
}, TAP_GRACE);
|
|
5162
|
+
}
|
|
5163
|
+
};
|
|
5164
|
+
#stop() {
|
|
5165
|
+
if (this.#timer !== void 0) clearTimeout(this.#timer);
|
|
5166
|
+
this.#timer = void 0;
|
|
5167
|
+
}
|
|
5168
|
+
};
|
|
4887
5169
|
const EVENT_PREFIXES = [
|
|
4888
5170
|
["capture-bind", "capture-bindEvent"],
|
|
4889
5171
|
["capture-catch", "capture-catchEvent"],
|
|
@@ -4891,12 +5173,62 @@ const EVENT_PREFIXES = [
|
|
|
4891
5173
|
["catch", "catchEvent"],
|
|
4892
5174
|
["bind", "bindEvent"]
|
|
4893
5175
|
];
|
|
5176
|
+
const DOM_EVENT_ALIASES = /* @__PURE__ */ new Map([["click", "tap"]]);
|
|
4894
5177
|
var _a;
|
|
5178
|
+
const nativeEventKey = (type, name) => type === "global-bindEvent" ? `global:${name}` : name;
|
|
5179
|
+
const combinedEventType = (listeners) => {
|
|
5180
|
+
if (listeners[0].eventType === "global-bindEvent") return "global-bindEvent";
|
|
5181
|
+
const capture = listeners.every((l) => l.eventType.startsWith("capture-"));
|
|
5182
|
+
const stops = listeners.some((l) => l.eventType.endsWith("catchEvent"));
|
|
5183
|
+
if (capture) return stops ? "capture-catchEvent" : "capture-bindEvent";
|
|
5184
|
+
return stops ? "catchEvent" : "bindEvent";
|
|
5185
|
+
};
|
|
5186
|
+
const parseEventName = (name) => {
|
|
5187
|
+
const alias = DOM_EVENT_ALIASES.get(name);
|
|
5188
|
+
if (alias) return {
|
|
5189
|
+
eventType: "bindEvent",
|
|
5190
|
+
eventName: alias
|
|
5191
|
+
};
|
|
5192
|
+
for (const [prefix, eventType] of EVENT_PREFIXES) if (name.startsWith(prefix)) return {
|
|
5193
|
+
eventType,
|
|
5194
|
+
eventName: name.slice(prefix.length)
|
|
5195
|
+
};
|
|
5196
|
+
};
|
|
5197
|
+
const withAddedTraits = (own, added) => {
|
|
5198
|
+
if (added.length === 0 || isAndroid()) return own;
|
|
5199
|
+
const traits = own == null ? [] : String(own).split(",").map((trait) => trait.trim()).filter((trait) => trait !== "" && trait !== "none");
|
|
5200
|
+
for (const trait of added) if (!traits.includes(trait)) traits.push(trait);
|
|
5201
|
+
return traits.join(",");
|
|
5202
|
+
};
|
|
5203
|
+
const isCustomProperty = (name) => name.startsWith("--");
|
|
4895
5204
|
const wouldFormCycle = (parent, candidate) => {
|
|
4896
5205
|
const candidateId = __GetElementUniqueID(candidate);
|
|
4897
5206
|
for (let cur = parent; cur; cur = __GetParent(cur)) if (__GetElementUniqueID(cur) === candidateId) return true;
|
|
4898
5207
|
return false;
|
|
4899
5208
|
};
|
|
5209
|
+
const ancestry = (element) => {
|
|
5210
|
+
const path = [];
|
|
5211
|
+
for (let cur = element; cur; cur = __GetParent(cur)) path.push(cur);
|
|
5212
|
+
return path;
|
|
5213
|
+
};
|
|
5214
|
+
const flushesBefore = (first, second) => {
|
|
5215
|
+
const firstPath = ancestry(first);
|
|
5216
|
+
const secondPath = ancestry(second);
|
|
5217
|
+
const secondDepth = new Map(secondPath.map((element, depth) => [__GetElementUniqueID(element), depth]));
|
|
5218
|
+
for (let depth = 0; depth < firstPath.length; depth++) {
|
|
5219
|
+
const shared = secondDepth.get(__GetElementUniqueID(firstPath[depth]));
|
|
5220
|
+
if (shared === void 0) continue;
|
|
5221
|
+
if (depth === 0) return true;
|
|
5222
|
+
if (shared === 0) return false;
|
|
5223
|
+
const order = __GetChildren(firstPath[depth]).map((child) => __GetElementUniqueID(child));
|
|
5224
|
+
return order.indexOf(__GetElementUniqueID(firstPath[depth - 1])) < order.indexOf(__GetElementUniqueID(secondPath[shared - 1]));
|
|
5225
|
+
}
|
|
5226
|
+
return false;
|
|
5227
|
+
};
|
|
5228
|
+
const isIOS = () => {
|
|
5229
|
+
return ((typeof lynx !== "undefined" ? lynx.SystemInfo : void 0) ?? (typeof SystemInfo !== "undefined" ? SystemInfo : void 0))?.platform === "iOS";
|
|
5230
|
+
};
|
|
5231
|
+
const insertHidesBlurView = (parent, child) => !__WEB__ && child.tagName === "blur-view" && parent.tagName !== "blur-view" && isIOS();
|
|
4900
5232
|
const isTextish = (el) => el.tagName === "text" || el.tagName === "raw-text";
|
|
4901
5233
|
var LynxElement = class {
|
|
4902
5234
|
#nativeRef;
|
|
@@ -4917,7 +5249,12 @@ var LynxElement = class {
|
|
|
4917
5249
|
#inlineStyleWhole = null;
|
|
4918
5250
|
#inlineStyleKeys = /* @__PURE__ */ new Map();
|
|
4919
5251
|
#runtimeStyle = "";
|
|
5252
|
+
#customProperties = /* @__PURE__ */ new Map();
|
|
5253
|
+
#ownTraits = null;
|
|
5254
|
+
#addedTraits = [];
|
|
4920
5255
|
#listeners = [];
|
|
5256
|
+
#webLongPress = null;
|
|
5257
|
+
#nativeHandlers = /* @__PURE__ */ new Map();
|
|
4921
5258
|
#text;
|
|
4922
5259
|
#rawText;
|
|
4923
5260
|
#children = [];
|
|
@@ -4925,6 +5262,8 @@ var LynxElement = class {
|
|
|
4925
5262
|
#paintingDead = false;
|
|
4926
5263
|
static #pendingRemovals = /* @__PURE__ */ new Set();
|
|
4927
5264
|
static #pendingTextNormalization = /* @__PURE__ */ new Set();
|
|
5265
|
+
static #pendingAttributeRemovals = /* @__PURE__ */ new Set();
|
|
5266
|
+
#removedAttributes = /* @__PURE__ */ new Set();
|
|
4928
5267
|
static #byNativeId = /* @__PURE__ */ new Map();
|
|
4929
5268
|
static #canonicalFor(ref) {
|
|
4930
5269
|
return _a.#byNativeId.get(__GetElementUniqueID(ref)) ?? new _a(ref);
|
|
@@ -4967,7 +5306,18 @@ var LynxElement = class {
|
|
|
4967
5306
|
this.#dataset[key] = value;
|
|
4968
5307
|
} else {
|
|
4969
5308
|
if (this.tagName === "svg" && name === "content" && typeof value === "string") value = sanitizeSvgContent(value);
|
|
4970
|
-
|
|
5309
|
+
if (name === "accessibility-traits") {
|
|
5310
|
+
this.#ownTraits = value ?? null;
|
|
5311
|
+
value = withAddedTraits(this.#ownTraits, this.#addedTraits);
|
|
5312
|
+
}
|
|
5313
|
+
if (value == null) {
|
|
5314
|
+
this.#removedAttributes.add(name);
|
|
5315
|
+
_a.#pendingAttributeRemovals.add(this);
|
|
5316
|
+
scheduleSettleFlush();
|
|
5317
|
+
} else {
|
|
5318
|
+
this.#removedAttributes.delete(name);
|
|
5319
|
+
__SetAttribute(this.element, name, value);
|
|
5320
|
+
}
|
|
4971
5321
|
if (value == null) this.#attrs.delete(name);
|
|
4972
5322
|
else this.#attrs.set(name, value);
|
|
4973
5323
|
if (this.tagName === "raw-text" && name === "text") {
|
|
@@ -4982,6 +5332,11 @@ var LynxElement = class {
|
|
|
4982
5332
|
updateBlurMaterial() {
|
|
4983
5333
|
if (usesAndroidBlurMaterials()) this.#setRuntimeStyle(androidBlurMaterialStyle(this.#attrs));
|
|
4984
5334
|
}
|
|
5335
|
+
setAccessibilityTrait(trait, on) {
|
|
5336
|
+
if (this.#addedTraits.includes(trait) === on) return;
|
|
5337
|
+
this.#addedTraits = on ? [...this.#addedTraits, trait] : this.#addedTraits.filter((added) => added !== trait);
|
|
5338
|
+
this.setAttribute("accessibility-traits", this.#ownTraits);
|
|
5339
|
+
}
|
|
4985
5340
|
getAttribute(name) {
|
|
4986
5341
|
return __GetAttributeByName(this.element, name);
|
|
4987
5342
|
}
|
|
@@ -4989,10 +5344,25 @@ var LynxElement = class {
|
|
|
4989
5344
|
this.setAttribute(name, null);
|
|
4990
5345
|
}
|
|
4991
5346
|
setStyle(key, value) {
|
|
5347
|
+
if (isCustomProperty(key)) {
|
|
5348
|
+
if (value == null || value === "") {
|
|
5349
|
+
this.removeStyle(key);
|
|
5350
|
+
return;
|
|
5351
|
+
}
|
|
5352
|
+
const text = String(value);
|
|
5353
|
+
if (this.#customProperties.get(key) === text) return;
|
|
5354
|
+
this.#customProperties.set(key, text);
|
|
5355
|
+
this.#rewriteInlineStyle();
|
|
5356
|
+
return;
|
|
5357
|
+
}
|
|
4992
5358
|
__AddInlineStyle(this.element, key, value);
|
|
4993
5359
|
this.#inlineStyleKeys.set(key, value);
|
|
4994
5360
|
}
|
|
4995
5361
|
removeStyle(key) {
|
|
5362
|
+
if (isCustomProperty(key)) {
|
|
5363
|
+
if (this.#customProperties.delete(key)) this.#rewriteInlineStyle();
|
|
5364
|
+
return;
|
|
5365
|
+
}
|
|
4996
5366
|
__AddInlineStyle(this.element, key, null);
|
|
4997
5367
|
this.#inlineStyleKeys.delete(key);
|
|
4998
5368
|
}
|
|
@@ -5001,30 +5371,48 @@ var LynxElement = class {
|
|
|
5001
5371
|
this.#inlineStyleWhole = inlineStyle;
|
|
5002
5372
|
}
|
|
5003
5373
|
#withRuntimeStyle(inlineStyle) {
|
|
5004
|
-
if (!this.#runtimeStyle) return inlineStyle;
|
|
5005
|
-
|
|
5374
|
+
if (!this.#runtimeStyle && this.#customProperties.size === 0) return inlineStyle;
|
|
5375
|
+
const variables = [...this.#customProperties].map(([name, value]) => `${name}: ${value}`).join("; ");
|
|
5376
|
+
return [
|
|
5377
|
+
this.#runtimeStyle,
|
|
5378
|
+
inlineStyle?.replace(/[\s;]+$/, ""),
|
|
5379
|
+
variables
|
|
5380
|
+
].filter(Boolean).join("; ");
|
|
5006
5381
|
}
|
|
5007
5382
|
#setRuntimeStyle(style) {
|
|
5008
5383
|
if (style === this.#runtimeStyle) return;
|
|
5009
5384
|
this.#runtimeStyle = style;
|
|
5385
|
+
this.#rewriteInlineStyle();
|
|
5386
|
+
}
|
|
5387
|
+
#rewriteInlineStyle() {
|
|
5010
5388
|
__SetInlineStyles(this.element, this.#withRuntimeStyle(this.#inlineStyleWhole));
|
|
5011
5389
|
for (const [key, value] of this.#inlineStyleKeys) __AddInlineStyle(this.element, key, value);
|
|
5012
5390
|
}
|
|
5013
5391
|
insertBefore(newChild, refChild) {
|
|
5014
5392
|
if (newChild.isRootPageElement) return;
|
|
5015
5393
|
newChild.#cancelPendingRemoval();
|
|
5394
|
+
newChild.#removeIfMoveWouldBeLost(this);
|
|
5016
5395
|
newChild.#recreateIfDead();
|
|
5017
5396
|
if (refChild == null) this.appendChild(newChild);
|
|
5018
5397
|
else {
|
|
5019
5398
|
if (wouldFormCycle(this.element, newChild.element)) return;
|
|
5020
|
-
|
|
5399
|
+
if (insertHidesBlurView(this, newChild)) this.#appendBefore(newChild, refChild);
|
|
5400
|
+
else __InsertElementBefore(this.element, newChild.element, refChild.element);
|
|
5021
5401
|
this.#adoptChild(newChild, refChild);
|
|
5022
5402
|
if (isTextish(this) || isTextish(newChild)) _a.#enqueueTextNormalization(newChild);
|
|
5023
5403
|
}
|
|
5024
5404
|
}
|
|
5405
|
+
#appendBefore(newChild, refChild) {
|
|
5406
|
+
const childId = __GetElementUniqueID(newChild.element);
|
|
5407
|
+
const following = [];
|
|
5408
|
+
for (let sibling = refChild.element; sibling; sibling = __NextElement(sibling)) if (__GetElementUniqueID(sibling) !== childId) following.push(sibling);
|
|
5409
|
+
__AppendElement(this.element, newChild.element);
|
|
5410
|
+
for (const sibling of following) __AppendElement(this.element, sibling);
|
|
5411
|
+
}
|
|
5025
5412
|
appendChild(newChild) {
|
|
5026
5413
|
if (newChild.isRootPageElement) return;
|
|
5027
5414
|
newChild.#cancelPendingRemoval();
|
|
5415
|
+
newChild.#removeIfMoveWouldBeLost(this);
|
|
5028
5416
|
newChild.#recreateIfDead();
|
|
5029
5417
|
if (wouldFormCycle(this.element, newChild.element)) return;
|
|
5030
5418
|
__AppendElement(this.element, newChild.element);
|
|
@@ -5072,6 +5460,15 @@ var LynxElement = class {
|
|
|
5072
5460
|
}
|
|
5073
5461
|
_a.#pendingRemovals.add(this);
|
|
5074
5462
|
}
|
|
5463
|
+
static commitPendingAttributeRemovals() {
|
|
5464
|
+
if (_a.#pendingAttributeRemovals.size === 0) return;
|
|
5465
|
+
const elements = [..._a.#pendingAttributeRemovals];
|
|
5466
|
+
_a.#pendingAttributeRemovals.clear();
|
|
5467
|
+
for (const el of elements) {
|
|
5468
|
+
for (const name of el.#removedAttributes) __SetAttribute(el.element, name, null);
|
|
5469
|
+
el.#removedAttributes.clear();
|
|
5470
|
+
}
|
|
5471
|
+
}
|
|
5075
5472
|
static commitPendingRemovals() {
|
|
5076
5473
|
if (_a.#pendingRemovals.size === 0) return;
|
|
5077
5474
|
const items = [..._a.#pendingRemovals];
|
|
@@ -5128,6 +5525,12 @@ var LynxElement = class {
|
|
|
5128
5525
|
#cancelPendingRemoval() {
|
|
5129
5526
|
_a.#pendingRemovals.delete(this);
|
|
5130
5527
|
}
|
|
5528
|
+
#removeIfMoveWouldBeLost(newParent) {
|
|
5529
|
+
if (__WEB__ || this.#paintingDead || this._virtualParent) return;
|
|
5530
|
+
const oldParent = __GetParent(this.element);
|
|
5531
|
+
if (!oldParent || __GetElementUniqueID(oldParent) === __GetElementUniqueID(newParent.element)) return;
|
|
5532
|
+
if (flushesBefore(newParent.element, oldParent)) this.#doRemove();
|
|
5533
|
+
}
|
|
5131
5534
|
#doRemove() {
|
|
5132
5535
|
const parent = this.parentNode();
|
|
5133
5536
|
if (!parent) return;
|
|
@@ -5173,9 +5576,9 @@ var LynxElement = class {
|
|
|
5173
5576
|
const inlineStyle = this.#withRuntimeStyle(this.#inlineStyleWhole);
|
|
5174
5577
|
if (inlineStyle != null) __SetInlineStyles(fresh, inlineStyle);
|
|
5175
5578
|
for (const [key, value] of this.#inlineStyleKeys) __AddInlineStyle(fresh, key, value);
|
|
5176
|
-
for (const { eventType, eventName,
|
|
5579
|
+
for (const { eventType, eventName, dispatch } of this.#nativeHandlers.values()) __AddEvent(fresh, eventType, eventName, {
|
|
5177
5580
|
type: "worklet",
|
|
5178
|
-
value:
|
|
5581
|
+
value: dispatch
|
|
5179
5582
|
});
|
|
5180
5583
|
for (const child of this.#children) {
|
|
5181
5584
|
child.#recreateSubtree();
|
|
@@ -5213,46 +5616,96 @@ var LynxElement = class {
|
|
|
5213
5616
|
return anim;
|
|
5214
5617
|
}
|
|
5215
5618
|
addEventListener(name, cb) {
|
|
5216
|
-
|
|
5217
|
-
|
|
5218
|
-
|
|
5219
|
-
eventName = name.slice(prefix.length);
|
|
5220
|
-
eventType = type;
|
|
5221
|
-
break;
|
|
5222
|
-
}
|
|
5223
|
-
if (!eventType) return () => {};
|
|
5224
|
-
const listener = (event) => {
|
|
5225
|
-
if (event && typeof event === "object") {
|
|
5226
|
-
if (typeof event.stopPropagation !== "function") event.stopPropagation = () => {};
|
|
5227
|
-
if (typeof event.preventDefault !== "function") event.preventDefault = () => {};
|
|
5228
|
-
if (typeof event.stopImmediatePropagation !== "function") event.stopImmediatePropagation = () => {};
|
|
5229
|
-
}
|
|
5230
|
-
const result = cb(event);
|
|
5231
|
-
scheduleSettleFlush();
|
|
5232
|
-
return result;
|
|
5233
|
-
};
|
|
5619
|
+
const parsed = parseEventName(name);
|
|
5620
|
+
if (!parsed) return () => {};
|
|
5621
|
+
if (__WEB__ && parsed.eventName === "longpress") this.#listenForWebLongPress();
|
|
5234
5622
|
const entry = {
|
|
5235
|
-
|
|
5236
|
-
|
|
5237
|
-
listener
|
|
5623
|
+
...parsed,
|
|
5624
|
+
listener: cb
|
|
5238
5625
|
};
|
|
5239
5626
|
this.#listeners.push(entry);
|
|
5240
|
-
|
|
5241
|
-
|
|
5242
|
-
|
|
5627
|
+
this.#syncNativeHandler(entry);
|
|
5628
|
+
return () => this.#removeListener(entry);
|
|
5629
|
+
}
|
|
5630
|
+
removeEventListener(name, cb) {
|
|
5631
|
+
const parsed = parseEventName(name);
|
|
5632
|
+
if (!parsed) return;
|
|
5633
|
+
const entry = this.#listeners.find((other) => other.listener === cb && other.eventType === parsed.eventType && other.eventName === parsed.eventName);
|
|
5634
|
+
if (entry) this.#removeListener(entry);
|
|
5635
|
+
}
|
|
5636
|
+
#listenForWebLongPress() {
|
|
5637
|
+
if (this.#webLongPress) return;
|
|
5638
|
+
const press = new WebLongPress((detail) => {
|
|
5639
|
+
const entry = this.#listeners.find((listener) => listener.eventName === "longpress");
|
|
5640
|
+
if (entry) this.#dispatch(entry, {
|
|
5641
|
+
type: "longpress",
|
|
5642
|
+
detail
|
|
5643
|
+
});
|
|
5243
5644
|
});
|
|
5244
|
-
|
|
5245
|
-
|
|
5246
|
-
|
|
5247
|
-
|
|
5248
|
-
|
|
5645
|
+
this.#webLongPress = press;
|
|
5646
|
+
this.addEventListener("bindtouchstart", press.start);
|
|
5647
|
+
this.addEventListener("bindmousedown", press.start);
|
|
5648
|
+
this.addEventListener("bindtouchmove", press.move);
|
|
5649
|
+
this.addEventListener("bindmousemove", press.move);
|
|
5650
|
+
for (const end of [
|
|
5651
|
+
"touchend",
|
|
5652
|
+
"touchcancel",
|
|
5653
|
+
"mouseup",
|
|
5654
|
+
"mouseleave"
|
|
5655
|
+
]) this.addEventListener(`bind${end}`, press.end);
|
|
5656
|
+
}
|
|
5657
|
+
#removeListener(entry) {
|
|
5658
|
+
const i = this.#listeners.indexOf(entry);
|
|
5659
|
+
if (i < 0) return;
|
|
5660
|
+
this.#listeners.splice(i, 1);
|
|
5661
|
+
this.#syncNativeHandler(entry);
|
|
5662
|
+
}
|
|
5663
|
+
#listenersLike(entry) {
|
|
5664
|
+
const key = nativeEventKey(entry.eventType, entry.eventName);
|
|
5665
|
+
return this.#listeners.filter((other) => nativeEventKey(other.eventType, other.eventName) === key);
|
|
5666
|
+
}
|
|
5667
|
+
#syncNativeHandler(entry) {
|
|
5668
|
+
const key = nativeEventKey(entry.eventType, entry.eventName);
|
|
5669
|
+
const listeners = this.#listenersLike(entry);
|
|
5670
|
+
const current = this.#nativeHandlers.get(key);
|
|
5671
|
+
const eventType = listeners.length ? combinedEventType(listeners) : null;
|
|
5672
|
+
if (current?.eventType === eventType) return;
|
|
5673
|
+
if (current) {
|
|
5674
|
+
__AddEvent(this.element, current.eventType, entry.eventName, void 0);
|
|
5675
|
+
this.#nativeHandlers.delete(key);
|
|
5676
|
+
}
|
|
5677
|
+
if (!eventType) return;
|
|
5678
|
+
const handler = {
|
|
5679
|
+
eventType,
|
|
5680
|
+
eventName: entry.eventName,
|
|
5681
|
+
dispatch: current?.dispatch ?? ((event) => this.#dispatch(entry, event))
|
|
5249
5682
|
};
|
|
5683
|
+
this.#nativeHandlers.set(key, handler);
|
|
5684
|
+
__AddEvent(this.element, eventType, entry.eventName, {
|
|
5685
|
+
type: "worklet",
|
|
5686
|
+
value: handler.dispatch
|
|
5687
|
+
});
|
|
5688
|
+
}
|
|
5689
|
+
#dispatch(entry, event) {
|
|
5690
|
+
if (event && typeof event === "object") {
|
|
5691
|
+
if (typeof event.stopPropagation !== "function") event.stopPropagation = () => {};
|
|
5692
|
+
if (typeof event.preventDefault !== "function") event.preventDefault = () => {};
|
|
5693
|
+
if (typeof event.stopImmediatePropagation !== "function") event.stopImmediatePropagation = () => {};
|
|
5694
|
+
}
|
|
5695
|
+
if (__WEB__ && entry.eventName === "tap" && dropsTap()) return void 0;
|
|
5696
|
+
let result;
|
|
5697
|
+
for (const other of this.#listenersLike(entry)) if (this.#listeners.includes(other)) result = other.listener(event);
|
|
5698
|
+
scheduleSettleFlush();
|
|
5699
|
+
return result;
|
|
5250
5700
|
}
|
|
5251
5701
|
};
|
|
5252
5702
|
_a = LynxElement;
|
|
5253
5703
|
const processPendingRemovals = () => {
|
|
5254
5704
|
LynxElement.commitPendingRemovals();
|
|
5255
5705
|
};
|
|
5706
|
+
const processPendingAttributeRemovals = () => {
|
|
5707
|
+
LynxElement.commitPendingAttributeRemovals();
|
|
5708
|
+
};
|
|
5256
5709
|
const processPendingTextNormalization = () => {
|
|
5257
5710
|
LynxElement.commitPendingTextNormalization();
|
|
5258
5711
|
};
|
|
@@ -5264,6 +5717,7 @@ const scheduleSettleFlush = () => {
|
|
|
5264
5717
|
settleFlushScheduled = false;
|
|
5265
5718
|
if (isInsideChangeDetection()) return;
|
|
5266
5719
|
LynxElement.commitPendingRemovals();
|
|
5720
|
+
LynxElement.commitPendingAttributeRemovals();
|
|
5267
5721
|
LynxElement.commitPendingTextNormalization();
|
|
5268
5722
|
__FlushElementTree();
|
|
5269
5723
|
});
|
|
@@ -5700,6 +6154,7 @@ var LynxRendererFactory2 = class LynxRendererFactory2 {
|
|
|
5700
6154
|
}
|
|
5701
6155
|
/* v8 ignore stop */
|
|
5702
6156
|
processPendingRemovals();
|
|
6157
|
+
processPendingAttributeRemovals();
|
|
5703
6158
|
processPendingTextNormalization();
|
|
5704
6159
|
if (!isFirstRenderPending()) __FlushElementTree();
|
|
5705
6160
|
processPendingListUpdates();
|
|
@@ -6051,7 +6506,7 @@ var LynxBackButton = class LynxBackButton {
|
|
|
6051
6506
|
Promise.resolve().then(() => shell?.setBackHandlerEnabled(enabled)).catch(() => hasShell = false);
|
|
6052
6507
|
});
|
|
6053
6508
|
const emitter = modules.getJSModule("GlobalEventEmitter");
|
|
6054
|
-
Promise.resolve().then(() => emitter?.addListener(BACK_EVENT, () =>
|
|
6509
|
+
Promise.resolve().then(() => emitter?.addListener(BACK_EVENT, () => location.back())).catch(() => {});
|
|
6055
6510
|
}
|
|
6056
6511
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
6057
6512
|
minVersion: "12.0.0",
|
|
@@ -6091,7 +6546,14 @@ const provideRouter = (routes, ...features) => {
|
|
|
6091
6546
|
useClass: LynxLocationStrategy
|
|
6092
6547
|
},
|
|
6093
6548
|
provideRouter$1(routes, withRouterConfig({ resolveNavigationPromiseOnError: true }), ...features),
|
|
6094
|
-
provideEnvironmentInitializer(() => inject(LynxBackButton))
|
|
6549
|
+
provideEnvironmentInitializer(() => inject(LynxBackButton)),
|
|
6550
|
+
{
|
|
6551
|
+
provide: ROUTER_LINK_ACTIVE_CHANGE,
|
|
6552
|
+
useValue: () => inject(RouterLinkActive, {
|
|
6553
|
+
self: true,
|
|
6554
|
+
optional: true
|
|
6555
|
+
})?.isActiveChange ?? null
|
|
6556
|
+
}
|
|
6095
6557
|
]);
|
|
6096
6558
|
};
|
|
6097
6559
|
globalThis.__lynxLastError = "";
|
|
@@ -8079,6 +8541,6 @@ const bootstrapOnMainThread = async (rootComponent, options) => {
|
|
|
8079
8541
|
if (__WEB__ && !wasHydrating) setTimeout(() => __FlushElementTree(), 0);
|
|
8080
8542
|
return appRef;
|
|
8081
8543
|
};
|
|
8082
|
-
export { BaseGesture, ComposedGesture, ContinuousGesture, FlingDirection, FlingGesture, Gesture, GestureState, GestureStateManager, GestureType, LYNX_ELEMENTS, LYNX_FORM_ACCESSORS, LongPressGesture, LynxAccessibility, LynxAnimation, LynxBlock, LynxBlurView, LynxCoverView, LynxDevTools, LynxErrorHandler, LynxExposure, LynxFont, LynxFor, LynxFrame, LynxGestureDetector, LynxGlobalData, LynxGlobalExposure, LynxIf, LynxImage, LynxInitData, LynxInlineTruncation, LynxInput, LynxInputValueAccessor, LynxList, LynxListItem, LynxLocale, LynxLocationStrategy, LynxLogger, LynxMainThread, LynxMainThreadEvent, LynxNativeModule, LynxOverlay, LynxPerformance, LynxPlatformLocation, LynxPortal, LynxRefresh, LynxRefreshHeader, LynxResourcePrefetch, LynxRouteReuseStrategy, LynxSafeArea, LynxScrollCoordinator, LynxScrollCoordinatorHeader, LynxScrollCoordinatorSlot, LynxScrollCoordinatorSlotDrag, LynxScrollCoordinatorToolbar, LynxScrollView, LynxSessionStorage, LynxSvg, LynxSystemInfo, LynxText, LynxTextMeasure, LynxTextarea, LynxTextareaValueAccessor, LynxTheme, LynxTitleBarView, LynxTransition, LynxTransitionGroup, LynxVideo, LynxView, LynxViewPager, LynxViewPagerItem, LynxWebView, MainThreadElement, MainThreadRef, PanGesture, PinchGesture, PortalRef, RotationGesture, SAFE_AREA_INSET_BOTTOM, SAFE_AREA_INSET_LEFT, SAFE_AREA_INSET_RIGHT, SAFE_AREA_INSET_TOP, TapGesture, backgroundFn, bootstrapApplication, createMainThreadRef, getLynxAppLocale, loadLazyBundle, mainThreadFn, provideLocale, provideRenderer, provideRouter, registerDataProcessors, ɵhmrAccept, ɵstartBackgroundThread };
|
|
8544
|
+
export { BaseGesture, ComposedGesture, ContinuousGesture, DYNAMIC_COLOR_ROLES, FlingDirection, FlingGesture, Gesture, GestureState, GestureStateManager, GestureType, LYNX_ELEMENTS, LYNX_FORM_ACCESSORS, LongPressGesture, LynxAccessibility, LynxAccessibilitySettings, LynxAccessibilityTraits, LynxAnimation, LynxBlock, LynxBlurView, LynxCoverView, LynxDevTools, LynxErrorHandler, LynxExposure, LynxFont, LynxFor, LynxFrame, LynxGestureDetector, LynxGlobalData, LynxGlobalExposure, LynxIf, LynxImage, LynxInitData, LynxInlineTruncation, LynxInput, LynxInputValueAccessor, LynxList, LynxListItem, LynxLocale, LynxLocationStrategy, LynxLogger, LynxMainThread, LynxMainThreadEvent, LynxNativeModule, LynxOverlay, LynxPerformance, LynxPlatformLocation, LynxPortal, LynxRefresh, LynxRefreshHeader, LynxResourcePrefetch, LynxRouteReuseStrategy, LynxRouterLinkActive, LynxSafeArea, LynxScrollCoordinator, LynxScrollCoordinatorHeader, LynxScrollCoordinatorSlot, LynxScrollCoordinatorSlotDrag, LynxScrollCoordinatorToolbar, LynxScrollView, LynxSessionStorage, LynxSvg, LynxSystemInfo, LynxText, LynxTextMeasure, LynxTextarea, LynxTextareaValueAccessor, LynxTheme, LynxTitleBarView, LynxTransition, LynxTransitionGroup, LynxVideo, LynxView, LynxViewPager, LynxViewPagerItem, LynxWebView, MainThreadElement, MainThreadRef, PanGesture, PinchGesture, PortalRef, RotationGesture, SAFE_AREA_INSET_BOTTOM, SAFE_AREA_INSET_LEFT, SAFE_AREA_INSET_RIGHT, SAFE_AREA_INSET_TOP, TapGesture, backgroundFn, bootstrapApplication, createMainThreadRef, getLynxAppLocale, loadLazyBundle, mainThreadFn, provideLocale, provideRenderer, provideRouter, registerDataProcessors, ɵhmrAccept, ɵstartBackgroundThread };
|
|
8083
8545
|
|
|
8084
8546
|
//# sourceMappingURL=blotch-angular-lynx.mjs.map
|