@symbiote-native/blur 0.0.0-stage → 0.0.0

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.
Files changed (84) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +51 -2
  3. package/build/angular/blur-target-view/index.android.d.ts +7 -0
  4. package/build/angular/blur-target-view/index.android.js +84 -0
  5. package/build/angular/blur-target-view/index.d.ts +1 -0
  6. package/build/angular/blur-target-view/index.ios.d.ts +6 -0
  7. package/build/angular/blur-target-view/index.ios.js +76 -0
  8. package/build/angular/blur-target-view/index.js +2 -0
  9. package/build/angular/blur-target-view/shared.d.ts +9 -0
  10. package/build/angular/blur-target-view/shared.js +64 -0
  11. package/build/angular/blur-view.d.ts +23 -0
  12. package/build/angular/blur-view.js +136 -0
  13. package/build/angular/index.d.ts +3 -0
  14. package/build/angular/index.js +4 -0
  15. package/build/core/blur.d.ts +53 -0
  16. package/build/core/blur.js +104 -0
  17. package/build/core/index.d.ts +1 -0
  18. package/build/core/index.js +1 -0
  19. package/build/react/blur.d.ts +18 -0
  20. package/build/react/blur.js +18 -0
  21. package/build/react/index.d.ts +3 -0
  22. package/build/react/index.js +3 -0
  23. package/build/solid/blur.d.ts +19 -0
  24. package/build/solid/blur.js +17 -0
  25. package/build/solid/index.d.ts +3 -0
  26. package/build/solid/index.js +3 -0
  27. package/build/svelte/blur-props.d.ts +13 -0
  28. package/build/svelte/blur-props.js +1 -0
  29. package/build/svelte/blur-target-view.svelte +14 -0
  30. package/build/svelte/blur-target-view.svelte.d.ts +4 -0
  31. package/build/svelte/blur-view.svelte +21 -0
  32. package/build/svelte/blur-view.svelte.d.ts +4 -0
  33. package/build/svelte/index.d.ts +4 -0
  34. package/build/svelte/index.js +4 -0
  35. package/build/vue/blur.d.ts +12 -0
  36. package/build/vue/blur.js +50 -0
  37. package/build/vue/index.d.ts +3 -0
  38. package/build/vue/index.js +3 -0
  39. package/build-ngc/angular/blur-target-view/index.android.d.ts +10 -0
  40. package/build-ngc/angular/blur-target-view/index.android.js +40 -0
  41. package/build-ngc/angular/blur-target-view/index.android.js.map +1 -0
  42. package/build-ngc/angular/blur-target-view/index.d.ts +1 -0
  43. package/build-ngc/angular/blur-target-view/index.ios.d.ts +9 -0
  44. package/build-ngc/angular/blur-target-view/index.ios.js +27 -0
  45. package/build-ngc/angular/blur-target-view/index.ios.js.map +1 -0
  46. package/build-ngc/angular/blur-target-view/index.js +3 -0
  47. package/build-ngc/angular/blur-target-view/index.js.map +1 -0
  48. package/build-ngc/angular/blur-target-view/shared.d.ts +12 -0
  49. package/build-ngc/angular/blur-target-view/shared.js +20 -0
  50. package/build-ngc/angular/blur-target-view/shared.js.map +1 -0
  51. package/build-ngc/angular/blur-view.d.ts +26 -0
  52. package/build-ngc/angular/blur-view.js +77 -0
  53. package/build-ngc/angular/blur-view.js.map +1 -0
  54. package/build-ngc/angular/index.d.ts +3 -0
  55. package/build-ngc/angular/index.js +5 -0
  56. package/build-ngc/angular/index.js.map +1 -0
  57. package/build-ngc/core/blur.d.ts +53 -0
  58. package/build-ngc/core/blur.js +105 -0
  59. package/build-ngc/core/blur.js.map +1 -0
  60. package/build-ngc/core/index.d.ts +1 -0
  61. package/build-ngc/core/index.js +2 -0
  62. package/build-ngc/core/index.js.map +1 -0
  63. package/native-link.json +12 -0
  64. package/package.json +145 -3
  65. package/src/angular/blur-target-view/index.android.ts +39 -0
  66. package/src/angular/blur-target-view/index.ios.ts +25 -0
  67. package/src/angular/blur-target-view/index.ts +2 -0
  68. package/src/angular/blur-target-view/shared.ts +21 -0
  69. package/src/angular/blur-view.ts +85 -0
  70. package/src/angular/index.ts +13 -0
  71. package/src/core/blur.ts +210 -0
  72. package/src/core/index.ts +15 -0
  73. package/src/react/blur.ts +46 -0
  74. package/src/react/index.ts +14 -0
  75. package/src/solid/blur.ts +54 -0
  76. package/src/solid/index.ts +14 -0
  77. package/src/svelte/blur-props.ts +18 -0
  78. package/src/svelte/blur-target-view.svelte +14 -0
  79. package/src/svelte/blur-view.svelte +21 -0
  80. package/src/svelte/index.ts +15 -0
  81. package/src/svelte/svelte-ambient.d.ts +6 -0
  82. package/src/svelte/svelte-compile.test-helper.ts +6 -0
  83. package/src/vue/blur.ts +82 -0
  84. package/src/vue/index.ts +14 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 A. Prokopenko
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,52 @@
1
- # Temporary Holding Version
1
+ # @symbiote-native/blur
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ [`expo-blur`](https://docs.expo.dev/versions/latest/sdk/blur-view/) for **every**
4
+ [SymbioteNative](../../README.md) adapter: React, Vue, Svelte, Solid and Angular. `BlurView` blurs
5
+ what is behind it, `BlurTargetView` marks the content Android blurs.
6
+
7
+ ## Install
8
+
9
+ ```bash
10
+ npx @symbiote-native/cli new my-app --blur # new app
11
+ npx @symbiote-native/cli add --blur # existing app
12
+ ```
13
+
14
+ Manual: `npm install @symbiote-native/blur`, then wire `expo-modules-autolinking` once per app.
15
+ Never install `expo-blur` or the `expo` meta-package yourself.
16
+
17
+ ## Usage
18
+
19
+ ```tsx
20
+ import { BlurTargetView, BlurView } from '@symbiote-native/blur/react';
21
+
22
+ const target = useRef<IHostInstance>(null);
23
+
24
+ <BlurTargetView ref={target}>
25
+ <Image source={photo} />
26
+ </BlurTargetView>;
27
+ <BlurView blurTarget={target} blurMethod="dimezisBlurView" tint="light" intensity={60}>
28
+ <Text>Over the blur</Text>
29
+ </BlurView>;
30
+ ```
31
+
32
+ Same props on every adapter: `tint`, `intensity`, `blurMethod`, `blurReductionFactor` and the View
33
+ surface. `blurTarget` takes each framework's own reference to the `BlurTargetView`:
34
+
35
+ | Adapter | Target reference |
36
+ | ------- | -------------------------------------- |
37
+ | React | `ref` object on `BlurTargetView` |
38
+ | Vue | template ref on `BlurTargetView` |
39
+ | Svelte | `bind:ref` on `BlurTargetView` |
40
+ | Solid | `ref={setTarget}` signal value |
41
+ | Angular | template reference variable `#target` |
42
+
43
+ ## Layout
44
+
45
+ A transparent `View` holds the style and children, with the native blur filling it behind them.
46
+ `BlurTargetView` is native on Android and a plain `View` on iOS, where blur needs no target.
47
+
48
+ ## Not ported
49
+
50
+ The web variant (`BlurView.web.tsx`, `getBackgroundColor`) and the Reanimated `getAnimatableRef` hook.
51
+ Angular templates spell the Android target tag statically, so an `__expo_app_identifier__` suffix makes
52
+ it warn instead of render.
@@ -0,0 +1,7 @@
1
+ import { BlurTargetViewBase } from './shared';
2
+ /** Angular twin of `expo-blur`'s `BlurTargetView`, the native target view on Android */
3
+ export declare class BlurTargetView extends BlurTargetViewBase {
4
+ private readonly hostRef;
5
+ constructor();
6
+ get nativeElement(): unknown;
7
+ }
@@ -0,0 +1,84 @@
1
+ var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
2
+ function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
3
+ var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
4
+ var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
5
+ var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
6
+ var _, done = false;
7
+ for (var i = decorators.length - 1; i >= 0; i--) {
8
+ var context = {};
9
+ for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
10
+ for (var p in contextIn.access) context.access[p] = contextIn.access[p];
11
+ context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
12
+ var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
13
+ if (kind === "accessor") {
14
+ if (result === void 0) continue;
15
+ if (result === null || typeof result !== "object") throw new TypeError("Object expected");
16
+ if (_ = accept(result.get)) descriptor.get = _;
17
+ if (_ = accept(result.set)) descriptor.set = _;
18
+ if (_ = accept(result.init)) initializers.unshift(_);
19
+ }
20
+ else if (_ = accept(result)) {
21
+ if (kind === "field") initializers.unshift(_);
22
+ else descriptor[key] = _;
23
+ }
24
+ }
25
+ if (target) Object.defineProperty(target, contextIn.name, descriptor);
26
+ done = true;
27
+ };
28
+ var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
29
+ var useValue = arguments.length > 2;
30
+ for (var i = 0; i < initializers.length; i++) {
31
+ value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
32
+ }
33
+ return useValue ? value : void 0;
34
+ };
35
+ import { ChangeDetectionStrategy, Component, ElementRef, NO_ERRORS_SCHEMA, ViewChild, } from '@angular/core';
36
+ import { warnIfViewNameIsDynamic } from '@symbiote-native/engine';
37
+ import { SymbioteHostPropsDirective } from '@symbiote-native/angular';
38
+ import { BLUR_MODULE_NAME } from '../../core/index.js';
39
+ import { BlurTargetViewBase } from './shared.js';
40
+ const TEMPLATE_TAG = 'ViewManagerAdapter_ExpoBlur_ExpoBlurTargetView';
41
+ /** Angular twin of `expo-blur`'s `BlurTargetView`, the native target view on Android */
42
+ let BlurTargetView = (() => {
43
+ let _classDecorators = [Component({
44
+ selector: 'BlurTargetView',
45
+ standalone: true,
46
+ imports: [SymbioteHostPropsDirective],
47
+ schemas: [NO_ERRORS_SCHEMA],
48
+ changeDetection: ChangeDetectionStrategy.OnPush,
49
+ // Имя тега это нативное имя view, его нельзя собрать динамически
50
+ template: `<ViewManagerAdapter_ExpoBlur_ExpoBlurTargetView #host [symbioteHostProps]="hostProps">
51
+ <ng-content />
52
+ </ViewManagerAdapter_ExpoBlur_ExpoBlurTargetView>`,
53
+ })];
54
+ let _classDescriptor;
55
+ let _classExtraInitializers = [];
56
+ let _classThis;
57
+ let _classSuper = BlurTargetViewBase;
58
+ let _hostRef_decorators;
59
+ let _hostRef_initializers = [];
60
+ let _hostRef_extraInitializers = [];
61
+ var BlurTargetView = class extends _classSuper {
62
+ static { _classThis = this; }
63
+ static {
64
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
65
+ _hostRef_decorators = [ViewChild('host', { read: ElementRef, static: true })];
66
+ __esDecorate(null, null, _hostRef_decorators, { kind: "field", name: "hostRef", static: false, private: false, access: { has: obj => "hostRef" in obj, get: obj => obj.hostRef, set: (obj, value) => { obj.hostRef = value; } }, metadata: _metadata }, _hostRef_initializers, _hostRef_extraInitializers);
67
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
68
+ BlurTargetView = _classThis = _classDescriptor.value;
69
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
70
+ __runInitializers(_classThis, _classExtraInitializers);
71
+ }
72
+ hostRef = __runInitializers(this, _hostRef_initializers, void 0);
73
+ constructor() {
74
+ super();
75
+ __runInitializers(this, _hostRef_extraInitializers);
76
+ warnIfViewNameIsDynamic(TEMPLATE_TAG, BLUR_MODULE_NAME, 'ExpoBlurTargetView');
77
+ }
78
+ get nativeElement() {
79
+ return this.hostRef.nativeElement;
80
+ }
81
+ };
82
+ return BlurTargetView = _classThis;
83
+ })();
84
+ export { BlurTargetView };
@@ -0,0 +1 @@
1
+ export { BlurTargetView } from './index.ios';
@@ -0,0 +1,6 @@
1
+ import { BlurTargetViewBase } from './shared';
2
+ /** Angular twin of `expo-blur`'s `BlurTargetView`, a plain View on iOS */
3
+ export declare class BlurTargetView extends BlurTargetViewBase {
4
+ private readonly hostRef;
5
+ get nativeElement(): unknown;
6
+ }
@@ -0,0 +1,76 @@
1
+ var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
2
+ function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
3
+ var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
4
+ var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
5
+ var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
6
+ var _, done = false;
7
+ for (var i = decorators.length - 1; i >= 0; i--) {
8
+ var context = {};
9
+ for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
10
+ for (var p in contextIn.access) context.access[p] = contextIn.access[p];
11
+ context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
12
+ var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
13
+ if (kind === "accessor") {
14
+ if (result === void 0) continue;
15
+ if (result === null || typeof result !== "object") throw new TypeError("Object expected");
16
+ if (_ = accept(result.get)) descriptor.get = _;
17
+ if (_ = accept(result.set)) descriptor.set = _;
18
+ if (_ = accept(result.init)) initializers.unshift(_);
19
+ }
20
+ else if (_ = accept(result)) {
21
+ if (kind === "field") initializers.unshift(_);
22
+ else descriptor[key] = _;
23
+ }
24
+ }
25
+ if (target) Object.defineProperty(target, contextIn.name, descriptor);
26
+ done = true;
27
+ };
28
+ var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
29
+ var useValue = arguments.length > 2;
30
+ for (var i = 0; i < initializers.length; i++) {
31
+ value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
32
+ }
33
+ return useValue ? value : void 0;
34
+ };
35
+ import { ChangeDetectionStrategy, Component, ElementRef, ViewChild, } from '@angular/core';
36
+ import { SymbioteHostPropsDirective, View } from '@symbiote-native/angular';
37
+ import { BlurTargetViewBase } from './shared.js';
38
+ /** Angular twin of `expo-blur`'s `BlurTargetView`, a plain View on iOS */
39
+ let BlurTargetView = (() => {
40
+ let _classDecorators = [Component({
41
+ selector: 'BlurTargetView',
42
+ standalone: true,
43
+ imports: [SymbioteHostPropsDirective, View],
44
+ changeDetection: ChangeDetectionStrategy.OnPush,
45
+ template: `<view #host [symbioteHostProps]="hostProps"><ng-content /></view>`,
46
+ })];
47
+ let _classDescriptor;
48
+ let _classExtraInitializers = [];
49
+ let _classThis;
50
+ let _classSuper = BlurTargetViewBase;
51
+ let _hostRef_decorators;
52
+ let _hostRef_initializers = [];
53
+ let _hostRef_extraInitializers = [];
54
+ var BlurTargetView = class extends _classSuper {
55
+ static { _classThis = this; }
56
+ static {
57
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
58
+ _hostRef_decorators = [ViewChild('host', { read: ElementRef, static: true })];
59
+ __esDecorate(null, null, _hostRef_decorators, { kind: "field", name: "hostRef", static: false, private: false, access: { has: obj => "hostRef" in obj, get: obj => obj.hostRef, set: (obj, value) => { obj.hostRef = value; } }, metadata: _metadata }, _hostRef_initializers, _hostRef_extraInitializers);
60
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
61
+ BlurTargetView = _classThis = _classDescriptor.value;
62
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
63
+ __runInitializers(_classThis, _classExtraInitializers);
64
+ }
65
+ hostRef = __runInitializers(this, _hostRef_initializers, void 0);
66
+ get nativeElement() {
67
+ return this.hostRef.nativeElement;
68
+ }
69
+ constructor() {
70
+ super(...arguments);
71
+ __runInitializers(this, _hostRef_extraInitializers);
72
+ }
73
+ };
74
+ return BlurTargetView = _classThis;
75
+ })();
76
+ export { BlurTargetView };
@@ -0,0 +1,2 @@
1
+ // Базовая точка для headless и tsc, Metro берёт `index.ios` или `index.android`
2
+ export { BlurTargetView } from './index.ios.js';
@@ -0,0 +1,9 @@
1
+ import { NativeViewBase } from '@symbiote-native/angular';
2
+ import type { IDescriptor } from '@symbiote-native/components';
3
+ export declare abstract class BlurTargetViewBase extends NativeViewBase {
4
+ /** Нужен свойству `blurTarget` у `BlurView`, чтобы найти host-узел */
5
+ abstract readonly nativeElement: unknown;
6
+ protected readonly propNames: readonly [];
7
+ protected renderView(props: object): IDescriptor;
8
+ get hostProps(): Record<string, unknown>;
9
+ }
@@ -0,0 +1,64 @@
1
+ var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
2
+ function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
3
+ var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
4
+ var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
5
+ var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
6
+ var _, done = false;
7
+ for (var i = decorators.length - 1; i >= 0; i--) {
8
+ var context = {};
9
+ for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
10
+ for (var p in contextIn.access) context.access[p] = contextIn.access[p];
11
+ context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
12
+ var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
13
+ if (kind === "accessor") {
14
+ if (result === void 0) continue;
15
+ if (result === null || typeof result !== "object") throw new TypeError("Object expected");
16
+ if (_ = accept(result.get)) descriptor.get = _;
17
+ if (_ = accept(result.set)) descriptor.set = _;
18
+ if (_ = accept(result.init)) initializers.unshift(_);
19
+ }
20
+ else if (_ = accept(result)) {
21
+ if (kind === "field") initializers.unshift(_);
22
+ else descriptor[key] = _;
23
+ }
24
+ }
25
+ if (target) Object.defineProperty(target, contextIn.name, descriptor);
26
+ done = true;
27
+ };
28
+ var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
29
+ var useValue = arguments.length > 2;
30
+ for (var i = 0; i < initializers.length; i++) {
31
+ value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
32
+ }
33
+ return useValue ? value : void 0;
34
+ };
35
+ import { Directive, Input } from '@angular/core';
36
+ import { NativeViewBase } from '@symbiote-native/angular';
37
+ import { renderBlurTargetView } from '../../core/index.js';
38
+ // Платформы различаются только тегом в шаблоне, остальное общее
39
+ let BlurTargetViewBase = (() => {
40
+ let _classDecorators = [Directive()];
41
+ let _classDescriptor;
42
+ let _classExtraInitializers = [];
43
+ let _classThis;
44
+ let _classSuper = NativeViewBase;
45
+ var BlurTargetViewBase = class extends _classSuper {
46
+ static { _classThis = this; }
47
+ static {
48
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
49
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
50
+ BlurTargetViewBase = _classThis = _classDescriptor.value;
51
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
52
+ __runInitializers(_classThis, _classExtraInitializers);
53
+ }
54
+ propNames = [];
55
+ renderView(props) {
56
+ return renderBlurTargetView(props);
57
+ }
58
+ get hostProps() {
59
+ return this.descriptor?.props ?? {};
60
+ }
61
+ };
62
+ return BlurTargetViewBase = _classThis;
63
+ })();
64
+ export { BlurTargetViewBase };
@@ -0,0 +1,23 @@
1
+ import { type AfterViewInit, type OnChanges, type OnDestroy, type SimpleChanges } from '@angular/core';
2
+ import { NativeViewBase } from '@symbiote-native/angular';
3
+ import type { IDescriptor } from '@symbiote-native/components';
4
+ import type { IBlurViewProps } from '../core';
5
+ /** Angular twin of `expo-blur`'s `BlurView`, the projected content paints over the blur */
6
+ export declare class BlurView extends NativeViewBase implements AfterViewInit, OnChanges, OnDestroy {
7
+ tint?: IBlurViewProps['tint'];
8
+ intensity?: IBlurViewProps['intensity'];
9
+ blurReductionFactor?: IBlurViewProps['blurReductionFactor'];
10
+ experimentalBlurMethod?: IBlurViewProps['experimentalBlurMethod'];
11
+ blurMethod?: IBlurViewProps['blurMethod'];
12
+ /** Template ref на `BlurTargetView`, его содержимое это фон для размытия */
13
+ blurTarget?: unknown;
14
+ protected readonly propNames: readonly ["tint", "intensity", "blurReductionFactor", "experimentalBlurMethod", "blurMethod"];
15
+ private blurTargetId;
16
+ private cancelWatch;
17
+ private isViewReady;
18
+ protected renderView(props: object): IDescriptor;
19
+ ngAfterViewInit(): void;
20
+ ngOnChanges(changes: SimpleChanges): void;
21
+ protected disposeView(): void;
22
+ private watchTarget;
23
+ }
@@ -0,0 +1,136 @@
1
+ var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
2
+ function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
3
+ var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
4
+ var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
5
+ var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
6
+ var _, done = false;
7
+ for (var i = decorators.length - 1; i >= 0; i--) {
8
+ var context = {};
9
+ for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
10
+ for (var p in contextIn.access) context.access[p] = contextIn.access[p];
11
+ context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
12
+ var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
13
+ if (kind === "accessor") {
14
+ if (result === void 0) continue;
15
+ if (result === null || typeof result !== "object") throw new TypeError("Object expected");
16
+ if (_ = accept(result.get)) descriptor.get = _;
17
+ if (_ = accept(result.set)) descriptor.set = _;
18
+ if (_ = accept(result.init)) initializers.unshift(_);
19
+ }
20
+ else if (_ = accept(result)) {
21
+ if (kind === "field") initializers.unshift(_);
22
+ else descriptor[key] = _;
23
+ }
24
+ }
25
+ if (target) Object.defineProperty(target, contextIn.name, descriptor);
26
+ done = true;
27
+ };
28
+ var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
29
+ var useValue = arguments.length > 2;
30
+ for (var i = 0; i < initializers.length; i++) {
31
+ value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
32
+ }
33
+ return useValue ? value : void 0;
34
+ };
35
+ import { ChangeDetectionStrategy, Component, Input, } from '@angular/core';
36
+ import { DescriptorHost, NativeViewBase, hostNodeOf, } from '@symbiote-native/angular';
37
+ import { renderBlurView, warnBlurProps, watchBlurTarget } from '../core/index.js';
38
+ /** Angular twin of `expo-blur`'s `BlurView`, the projected content paints over the blur */
39
+ let BlurView = (() => {
40
+ let _classDecorators = [Component({
41
+ selector: 'BlurView',
42
+ standalone: true,
43
+ imports: [DescriptorHost],
44
+ changeDetection: ChangeDetectionStrategy.OnPush,
45
+ template: `@if (descriptor; as node) {
46
+ <symbiote-descriptor-host [node]="node"><ng-content /></symbiote-descriptor-host>
47
+ }`,
48
+ })];
49
+ let _classDescriptor;
50
+ let _classExtraInitializers = [];
51
+ let _classThis;
52
+ let _classSuper = NativeViewBase;
53
+ let _tint_decorators;
54
+ let _tint_initializers = [];
55
+ let _tint_extraInitializers = [];
56
+ let _intensity_decorators;
57
+ let _intensity_initializers = [];
58
+ let _intensity_extraInitializers = [];
59
+ let _blurReductionFactor_decorators;
60
+ let _blurReductionFactor_initializers = [];
61
+ let _blurReductionFactor_extraInitializers = [];
62
+ let _experimentalBlurMethod_decorators;
63
+ let _experimentalBlurMethod_initializers = [];
64
+ let _experimentalBlurMethod_extraInitializers = [];
65
+ let _blurMethod_decorators;
66
+ let _blurMethod_initializers = [];
67
+ let _blurMethod_extraInitializers = [];
68
+ let _blurTarget_decorators;
69
+ let _blurTarget_initializers = [];
70
+ let _blurTarget_extraInitializers = [];
71
+ var BlurView = class extends _classSuper {
72
+ static { _classThis = this; }
73
+ static {
74
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
75
+ _tint_decorators = [Input()];
76
+ _intensity_decorators = [Input()];
77
+ _blurReductionFactor_decorators = [Input()];
78
+ _experimentalBlurMethod_decorators = [Input()];
79
+ _blurMethod_decorators = [Input()];
80
+ _blurTarget_decorators = [Input()];
81
+ __esDecorate(null, null, _tint_decorators, { kind: "field", name: "tint", static: false, private: false, access: { has: obj => "tint" in obj, get: obj => obj.tint, set: (obj, value) => { obj.tint = value; } }, metadata: _metadata }, _tint_initializers, _tint_extraInitializers);
82
+ __esDecorate(null, null, _intensity_decorators, { kind: "field", name: "intensity", static: false, private: false, access: { has: obj => "intensity" in obj, get: obj => obj.intensity, set: (obj, value) => { obj.intensity = value; } }, metadata: _metadata }, _intensity_initializers, _intensity_extraInitializers);
83
+ __esDecorate(null, null, _blurReductionFactor_decorators, { kind: "field", name: "blurReductionFactor", static: false, private: false, access: { has: obj => "blurReductionFactor" in obj, get: obj => obj.blurReductionFactor, set: (obj, value) => { obj.blurReductionFactor = value; } }, metadata: _metadata }, _blurReductionFactor_initializers, _blurReductionFactor_extraInitializers);
84
+ __esDecorate(null, null, _experimentalBlurMethod_decorators, { kind: "field", name: "experimentalBlurMethod", static: false, private: false, access: { has: obj => "experimentalBlurMethod" in obj, get: obj => obj.experimentalBlurMethod, set: (obj, value) => { obj.experimentalBlurMethod = value; } }, metadata: _metadata }, _experimentalBlurMethod_initializers, _experimentalBlurMethod_extraInitializers);
85
+ __esDecorate(null, null, _blurMethod_decorators, { kind: "field", name: "blurMethod", static: false, private: false, access: { has: obj => "blurMethod" in obj, get: obj => obj.blurMethod, set: (obj, value) => { obj.blurMethod = value; } }, metadata: _metadata }, _blurMethod_initializers, _blurMethod_extraInitializers);
86
+ __esDecorate(null, null, _blurTarget_decorators, { kind: "field", name: "blurTarget", static: false, private: false, access: { has: obj => "blurTarget" in obj, get: obj => obj.blurTarget, set: (obj, value) => { obj.blurTarget = value; } }, metadata: _metadata }, _blurTarget_initializers, _blurTarget_extraInitializers);
87
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
88
+ BlurView = _classThis = _classDescriptor.value;
89
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
90
+ __runInitializers(_classThis, _classExtraInitializers);
91
+ }
92
+ tint = __runInitializers(this, _tint_initializers, void 0);
93
+ intensity = (__runInitializers(this, _tint_extraInitializers), __runInitializers(this, _intensity_initializers, void 0));
94
+ blurReductionFactor = (__runInitializers(this, _intensity_extraInitializers), __runInitializers(this, _blurReductionFactor_initializers, void 0));
95
+ experimentalBlurMethod = (__runInitializers(this, _blurReductionFactor_extraInitializers), __runInitializers(this, _experimentalBlurMethod_initializers, void 0));
96
+ blurMethod = (__runInitializers(this, _experimentalBlurMethod_extraInitializers), __runInitializers(this, _blurMethod_initializers, void 0));
97
+ /** Template ref на `BlurTargetView`, его содержимое это фон для размытия */
98
+ blurTarget = (__runInitializers(this, _blurMethod_extraInitializers), __runInitializers(this, _blurTarget_initializers, void 0));
99
+ propNames = (__runInitializers(this, _blurTarget_extraInitializers), [
100
+ 'tint',
101
+ 'intensity',
102
+ 'blurReductionFactor',
103
+ 'experimentalBlurMethod',
104
+ 'blurMethod',
105
+ ]);
106
+ blurTargetId;
107
+ cancelWatch = () => { };
108
+ isViewReady = false;
109
+ renderView(props) {
110
+ return renderBlurView(props, this.blurTargetId);
111
+ }
112
+ // Цель ставится при создании представления соседа, поэтому ждём `ngAfterViewInit`
113
+ ngAfterViewInit() {
114
+ this.isViewReady = true;
115
+ this.watchTarget();
116
+ warnBlurProps(Object.fromEntries(this.propNames.map(name => [name, Reflect.get(this, name)])), this.blurTarget !== undefined);
117
+ }
118
+ ngOnChanges(changes) {
119
+ super.ngOnChanges(changes);
120
+ if (this.isViewReady && 'blurTarget' in changes)
121
+ this.watchTarget();
122
+ }
123
+ disposeView() {
124
+ this.cancelWatch();
125
+ }
126
+ watchTarget() {
127
+ this.cancelWatch();
128
+ this.cancelWatch = watchBlurTarget(hostNodeOf(this.blurTarget), id => {
129
+ this.blurTargetId = id;
130
+ this.changeDetector.markForCheck();
131
+ });
132
+ }
133
+ };
134
+ return BlurView = _classThis;
135
+ })();
136
+ export { BlurView };
@@ -0,0 +1,3 @@
1
+ export { BlurView } from './blur-view';
2
+ export { BlurTargetView } from './blur-target-view';
3
+ export { BLUR_MODULE_NAME, blurTargetViewName, blurViewName, type IBlurMethod, type IBlurTint, type IBlurViewProps, type IBlurTargetViewProps, } from '../core';
@@ -0,0 +1,4 @@
1
+ // @symbiote-native/blur/angular: компоненты `BlurView` и `BlurTargetView` поверх общего ядра
2
+ export { BlurView } from './blur-view.js';
3
+ export { BlurTargetView } from './blur-target-view';
4
+ export { BLUR_MODULE_NAME, blurTargetViewName, blurViewName, } from '../core/index.js';
@@ -0,0 +1,53 @@
1
+ import type { IAccessibilityProps, IAriaProps, IDescriptor, IResponderProps } from '@symbiote-native/components';
2
+ import type { IStyleProp, ISymbioteEvent, IViewStyle } from '@symbiote-native/engine';
3
+ export declare const BLUR_MODULE_NAME = "ExpoBlur";
4
+ declare const BLUR_METHODS: readonly ["none", "dimezisBlurView", "dimezisBlurViewSdk31Plus"];
5
+ /** Метод размытия на Android: `none` это полупрозрачный view, остальные нативный BlurView */
6
+ export type IBlurMethod = (typeof BLUR_METHODS)[number];
7
+ export type IBlurTint = 'light' | 'dark' | 'default' | 'extraLight' | 'regular' | 'prominent' | 'systemUltraThinMaterial' | 'systemThinMaterial' | 'systemMaterial' | 'systemThickMaterial' | 'systemChromeMaterial' | 'systemUltraThinMaterialLight' | 'systemThinMaterialLight' | 'systemMaterialLight' | 'systemThickMaterialLight' | 'systemChromeMaterialLight' | 'systemUltraThinMaterialDark' | 'systemThinMaterialDark' | 'systemMaterialDark' | 'systemThickMaterialDark' | 'systemChromeMaterialDark';
8
+ type IViewSurface = IAccessibilityProps & IAriaProps & IResponderProps & {
9
+ style?: IStyleProp<IViewStyle>;
10
+ testID?: string;
11
+ nativeID?: string;
12
+ onLayout?: (event: ISymbioteEvent) => void;
13
+ };
14
+ export type IBlurViewProps = IViewSurface & {
15
+ /** @default 'default' */
16
+ tint?: IBlurTint;
17
+ /**
18
+ * Сила размытия от 1 до 100
19
+ * @default 50
20
+ */
21
+ intensity?: number;
22
+ /**
23
+ * Делитель силы размытия на Android
24
+ * @default 4
25
+ * @platform android
26
+ */
27
+ blurReductionFactor?: number;
28
+ /**
29
+ * @deprecated Use `blurMethod` instead
30
+ * @platform android
31
+ */
32
+ experimentalBlurMethod?: IBlurMethod;
33
+ /**
34
+ * @default 'none'
35
+ * @platform android
36
+ */
37
+ blurMethod?: IBlurMethod;
38
+ };
39
+ export type IBlurTargetViewProps = IViewSurface;
40
+ export declare const blurViewName: () => string;
41
+ export declare const blurTargetViewName: () => string;
42
+ export declare const ensureBlurRegistered: () => boolean;
43
+ export declare const ensureBlurTargetRegistered: () => boolean;
44
+ /** Предупреждения из `componentDidMount` upstream, зовутся один раз при монтировании */
45
+ export declare function warnBlurProps(props: object, hasBlurTarget: boolean): void;
46
+ /**
47
+ * Отдаёт нативный тег цели размытия после её коммита, у не-узла отдаёт `undefined`
48
+ * Адаптер сам приводит свой ref к host-узлу, возвращённая функция отменяет ожидание
49
+ */
50
+ export declare function watchBlurTarget(target: unknown, onId: (id: number | undefined) => void): () => void;
51
+ export declare function renderBlurView(props: object, blurTargetId: number | null | undefined): IDescriptor;
52
+ export declare function renderBlurTargetView(props: object): IDescriptor;
53
+ export {};