@symbiote-native/glass-effect 0.0.0-stage → 0.1.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.
- package/LICENSE +21 -0
- package/README.md +205 -2
- package/build/angular/glass/index.android.d.ts +7 -0
- package/build/angular/glass/index.android.js +97 -0
- package/build/angular/glass/index.d.ts +1 -0
- package/build/angular/glass/index.ios.d.ts +9 -0
- package/build/angular/glass/index.ios.js +116 -0
- package/build/angular/glass/index.js +2 -0
- package/build/angular/glass/shared.d.ts +16 -0
- package/build/angular/glass/shared.js +121 -0
- package/build/angular/index.d.ts +2 -0
- package/build/angular/index.js +3 -0
- package/build/core/glass-effect.d.ts +62 -0
- package/build/core/glass-effect.js +71 -0
- package/build/core/index.d.ts +1 -0
- package/build/core/index.js +1 -0
- package/build/react/glass-effect.d.ts +17 -0
- package/build/react/glass-effect.js +14 -0
- package/build/react/index.d.ts +3 -0
- package/build/react/index.js +3 -0
- package/build/solid/glass-effect.d.ts +16 -0
- package/build/solid/glass-effect.js +6 -0
- package/build/solid/index.d.ts +3 -0
- package/build/solid/index.js +3 -0
- package/build/svelte/glass-container.svelte +14 -0
- package/build/svelte/glass-container.svelte.d.ts +4 -0
- package/build/svelte/glass-props.d.ts +13 -0
- package/build/svelte/glass-props.js +1 -0
- package/build/svelte/glass-view.svelte +10 -0
- package/build/svelte/glass-view.svelte.d.ts +4 -0
- package/build/svelte/index.d.ts +4 -0
- package/build/svelte/index.js +4 -0
- package/build/vue/glass-effect.d.ts +9 -0
- package/build/vue/glass-effect.js +20 -0
- package/build/vue/index.d.ts +3 -0
- package/build/vue/index.js +3 -0
- package/build-ngc/angular/glass/index.android.d.ts +12 -0
- package/build-ngc/angular/glass/index.android.js +51 -0
- package/build-ngc/angular/glass/index.android.js.map +1 -0
- package/build-ngc/angular/glass/index.d.ts +1 -0
- package/build-ngc/angular/glass/index.ios.d.ts +14 -0
- package/build-ngc/angular/glass/index.ios.js +74 -0
- package/build-ngc/angular/glass/index.ios.js.map +1 -0
- package/build-ngc/angular/glass/index.js +3 -0
- package/build-ngc/angular/glass/index.js.map +1 -0
- package/build-ngc/angular/glass/shared.d.ts +21 -0
- package/build-ngc/angular/glass/shared.js +50 -0
- package/build-ngc/angular/glass/shared.js.map +1 -0
- package/build-ngc/angular/index.d.ts +2 -0
- package/build-ngc/angular/index.js +4 -0
- package/build-ngc/angular/index.js.map +1 -0
- package/build-ngc/core/glass-effect.d.ts +62 -0
- package/build-ngc/core/glass-effect.js +72 -0
- package/build-ngc/core/glass-effect.js.map +1 -0
- package/build-ngc/core/index.d.ts +1 -0
- package/build-ngc/core/index.js +2 -0
- package/build-ngc/core/index.js.map +1 -0
- package/native-link.json +5 -0
- package/package.json +145 -3
- package/src/angular/glass/index.android.ts +31 -0
- package/src/angular/glass/index.ios.ts +61 -0
- package/src/angular/glass/index.ts +2 -0
- package/src/angular/glass/shared.ts +38 -0
- package/src/angular/index.ts +15 -0
- package/src/core/glass-effect.ts +160 -0
- package/src/core/index.ts +16 -0
- package/src/react/glass-effect.ts +34 -0
- package/src/react/index.ts +17 -0
- package/src/solid/glass-effect.ts +27 -0
- package/src/solid/index.ts +17 -0
- package/src/svelte/glass-container.svelte +14 -0
- package/src/svelte/glass-props.ts +18 -0
- package/src/svelte/glass-view.svelte +10 -0
- package/src/svelte/index.ts +18 -0
- package/src/svelte/svelte-ambient.d.ts +6 -0
- package/src/svelte/svelte-compile.test-helper.ts +6 -0
- package/src/vue/glass-effect.ts +39 -0
- package/src/vue/index.ts +17 -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,206 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @symbiote-native/glass-effect
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[`expo-glass-effect`](https://docs.expo.dev/versions/latest/sdk/glass-effect/) for **every**
|
|
4
|
+
[SymbioteNative](../../README.md) adapter: React, Vue, Svelte, Solid and Angular. Liquid Glass
|
|
5
|
+
native views on iOS 26, a plain `View` everywhere else.
|
|
6
|
+
|
|
7
|
+
Built the same way as [`@symbiote-native/clipboard`](../clipboard)'s `ClipboardPasteButton`, an
|
|
8
|
+
`expo-modules-core` native view reached through `requireNativeViewManager` (see the
|
|
9
|
+
`symbiote-expo-native-module` project skill: why `expo-modules-core` is depended on directly and never
|
|
10
|
+
the `expo` meta-package, why the upstream JS is hand-ported into `core/`, and how autolinking finds the
|
|
11
|
+
native module). One render function in `core/` returns a descriptor and every adapter only turns it into
|
|
12
|
+
its own element.
|
|
13
|
+
|
|
14
|
+
## Install
|
|
15
|
+
|
|
16
|
+
**New app:**
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
npx @symbiote-native/cli new my-app --glass-effect
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
**Existing SymbioteNative app:**
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
npx @symbiote-native/cli add --glass-effect
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Either way: installs `@symbiote-native/glass-effect` and wires the native autolinking automatically,
|
|
29
|
+
see [`@symbiote-native/cli`](../cli).
|
|
30
|
+
|
|
31
|
+
<details>
|
|
32
|
+
<summary>Manual install (no CLI - installing and wiring native autolinking by hand)</summary>
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
npm install @symbiote-native/glass-effect
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Depends on `expo-glass-effect` and `expo-modules-core` directly (regular dependencies, pinned to exact
|
|
39
|
+
versions, since this package's `core/` is hand-ported against one specific native API shape).
|
|
40
|
+
Never install `expo-glass-effect` yourself, and never add the `expo` package to this project: it bundles
|
|
41
|
+
its own Metro/Babel pipeline that conflicts with this project's own.
|
|
42
|
+
|
|
43
|
+
### Required one-time step: native autolinking wiring
|
|
44
|
+
|
|
45
|
+
`expo-glass-effect`'s native code is discovered by `expo-modules-autolinking`, not by RN's own
|
|
46
|
+
`react-native.config.cjs` mechanism. Wire it into the native host app **once**, it covers this package
|
|
47
|
+
and every other `expo-modules-core` package with zero further changes. The steps and the
|
|
48
|
+
mechanics behind them are in the `symbiote-expo-native-module` skill and in
|
|
49
|
+
[`@symbiote-native/network`](../network)'s README; the reference app is `examples/expo-react`.
|
|
50
|
+
|
|
51
|
+
</details>
|
|
52
|
+
|
|
53
|
+
## Shape
|
|
54
|
+
|
|
55
|
+
```
|
|
56
|
+
src/core/ glass-effect.ts - props, isLiquidGlassAvailable, isGlassEffectAPIAvailable,
|
|
57
|
+
renderGlassView / renderGlassContainer (native root on iOS, a plain View
|
|
58
|
+
without the glass props elsewhere).
|
|
59
|
+
src/react/ @symbiote-native/glass-effect/react - GlassView, GlassContainer
|
|
60
|
+
src/vue/ @symbiote-native/glass-effect/vue - GlassView, GlassContainer
|
|
61
|
+
src/svelte/ @symbiote-native/glass-effect/svelte - GlassView, GlassContainer (.svelte)
|
|
62
|
+
src/solid/ @symbiote-native/glass-effect/solid - GlassView, GlassContainer
|
|
63
|
+
src/angular/glass/ @symbiote-native/glass-effect/angular - GlassView, GlassContainer
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
Angular keeps one file set per platform (`index.ios.ts`, `index.android.ts`) because a template spells
|
|
67
|
+
the native tag statically, so an `__expo_app_identifier__` suffix makes it warn instead of render.
|
|
68
|
+
`native-link.json` declares `android.modules: []`, upstream has no Android folder.
|
|
69
|
+
|
|
70
|
+
## Use it
|
|
71
|
+
|
|
72
|
+
### React
|
|
73
|
+
|
|
74
|
+
```tsx
|
|
75
|
+
import { GlassContainer, GlassView } from '@symbiote-native/glass-effect/react';
|
|
76
|
+
|
|
77
|
+
<GlassContainer spacing={8}>
|
|
78
|
+
<GlassView glassEffectStyle="clear" tintColor="rgba(255, 59, 48, 0.7)" isInteractive>
|
|
79
|
+
<Text>Glass</Text>
|
|
80
|
+
</GlassView>
|
|
81
|
+
</GlassContainer>;
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
### Vue
|
|
85
|
+
|
|
86
|
+
```vue
|
|
87
|
+
<script setup lang="ts">
|
|
88
|
+
import { GlassContainer, GlassView } from '@symbiote-native/glass-effect/vue';
|
|
89
|
+
</script>
|
|
90
|
+
|
|
91
|
+
<template>
|
|
92
|
+
<GlassContainer :spacing="8">
|
|
93
|
+
<GlassView glass-effect-style="clear" tint-color="rgba(255, 59, 48, 0.7)" is-interactive>
|
|
94
|
+
<text>Glass</text>
|
|
95
|
+
</GlassView>
|
|
96
|
+
</GlassContainer>
|
|
97
|
+
</template>
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
### Angular
|
|
101
|
+
|
|
102
|
+
```ts
|
|
103
|
+
import { GlassContainer, GlassView } from '@symbiote-native/glass-effect/angular';
|
|
104
|
+
|
|
105
|
+
@Component({
|
|
106
|
+
imports: [GlassContainer, GlassView],
|
|
107
|
+
template: `
|
|
108
|
+
<GlassContainer [spacing]="8">
|
|
109
|
+
<GlassView glassEffectStyle="clear" tintColor="rgba(255, 59, 48, 0.7)" [isInteractive]="true">
|
|
110
|
+
<text>Glass</text>
|
|
111
|
+
</GlassView>
|
|
112
|
+
</GlassContainer>
|
|
113
|
+
`,
|
|
114
|
+
})
|
|
115
|
+
export class Card {}
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
### Svelte
|
|
119
|
+
|
|
120
|
+
```svelte
|
|
121
|
+
<script lang="ts">
|
|
122
|
+
import { GlassContainer, GlassView } from '@symbiote-native/glass-effect/svelte';
|
|
123
|
+
</script>
|
|
124
|
+
|
|
125
|
+
<GlassContainer spacing={8}>
|
|
126
|
+
<GlassView glassEffectStyle="clear" tintColor="rgba(255, 59, 48, 0.7)" isInteractive={true}>
|
|
127
|
+
<text>Glass</text>
|
|
128
|
+
</GlassView>
|
|
129
|
+
</GlassContainer>
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
### Solid
|
|
133
|
+
|
|
134
|
+
```tsx
|
|
135
|
+
import { GlassContainer, GlassView } from '@symbiote-native/glass-effect/solid';
|
|
136
|
+
|
|
137
|
+
<GlassContainer spacing={8}>
|
|
138
|
+
<GlassView glassEffectStyle="clear" tintColor="rgba(255, 59, 48, 0.7)" isInteractive>
|
|
139
|
+
<text>Glass</text>
|
|
140
|
+
</GlassView>
|
|
141
|
+
</GlassContainer>;
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
## API
|
|
145
|
+
|
|
146
|
+
```ts
|
|
147
|
+
<GlassView
|
|
148
|
+
glassEffectStyle?={'regular' | 'clear' | 'none' | { style, animate, animationDuration }}
|
|
149
|
+
tintColor?={ColorValue | PlatformColor | DynamicColorIOS}
|
|
150
|
+
isInteractive?={boolean} // default false
|
|
151
|
+
colorScheme?={'auto' | 'light' | 'dark'}
|
|
152
|
+
style? testID? nativeID? onLayout? ...View accessibility and responder props
|
|
153
|
+
/>
|
|
154
|
+
<GlassContainer spacing?={number} ...> // views inside blend when closer than `spacing`
|
|
155
|
+
|
|
156
|
+
isLiquidGlassAvailable(): boolean // system, compiler and Info.plist checks, false off iOS
|
|
157
|
+
isGlassEffectAPIAvailable(): boolean // the API exists at runtime, some iOS 26 betas lack it
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
Ported from upstream's `GlassView.tsx` and `GlassContainer.tsx`.
|
|
161
|
+
|
|
162
|
+
## Notes
|
|
163
|
+
|
|
164
|
+
- **iOS 26 and later only.** Older iOS, Android and the fallback render a plain `View` without the
|
|
165
|
+
glass props, and `isLiquidGlassAvailable()` reports `false` there.
|
|
166
|
+
- **`isLiquidGlassAvailable()` checks the build, not only the phone.** It validates the system
|
|
167
|
+
version, the compiler version the app was built with and the `UIDesignRequiresCompatibility`
|
|
168
|
+
setting in `Info.plist`. `isGlassEffectAPIAvailable()` checks the API at runtime, because some iOS
|
|
169
|
+
26 betas lack it and crash.
|
|
170
|
+
- **Glass does not survive an opacity of 0.** Setting `opacity` to `0` on a `GlassView` or on any
|
|
171
|
+
parent stops the glass from rendering at all. Fade it with the `animate` and `animationDuration`
|
|
172
|
+
fields of `glassEffectStyle` instead.
|
|
173
|
+
- **Merge glass views with `GlassContainer`.** Views inside one container blend into each other when
|
|
174
|
+
they come within `spacing` of each other.
|
|
175
|
+
- **The native view is the root and the children sit inside it**, so what you put in a `GlassView`
|
|
176
|
+
is laid out and touched like the content of any `View`.
|
|
177
|
+
- **Not ported.** Nothing: the upstream package has no web or Android variant beyond the plain `View`.
|
|
178
|
+
|
|
179
|
+
## Common questions
|
|
180
|
+
|
|
181
|
+
- **A plain view, no glass.** Needs iOS 26 or later, an app built with the iOS 26 SDK (Xcode 26) and
|
|
182
|
+
no `UIDesignRequiresCompatibility = true` in `Info.plist`. Log `isLiquidGlassAvailable()`.
|
|
183
|
+
- **The glass disappears when its parent fades.** An opacity of 0 on the view or any ancestor stops
|
|
184
|
+
it rendering (an iOS 26.1 bug). Fade with `glassEffectStyle={{ style, animate: true,
|
|
185
|
+
animationDuration }}` or toggle the style to `none` while a wrapper is invisible.
|
|
186
|
+
- **`colorScheme` does not update.** Fixed upstream in `expo-glass-effect` 55.0.8, update.
|
|
187
|
+
- **One corner radius is ignored.** Fixed upstream before the SDK 55 release, update.
|
|
188
|
+
- **Merging two shapes.** Put them in one `GlassContainer` and set `spacing`.
|
|
189
|
+
- **Android.** No upstream implementation, both components render a plain `View`.
|
|
190
|
+
|
|
191
|
+
Sources: [Expo docs: GlassEffect](https://docs.expo.dev/versions/latest/sdk/glass-effect/),
|
|
192
|
+
[expo/expo#41024](https://github.com/expo/expo/issues/41024),
|
|
193
|
+
[expo/expo#50097](https://github.com/expo/expo/issues/50097),
|
|
194
|
+
[expo/expo#43743](https://github.com/expo/expo/issues/43743),
|
|
195
|
+
[expo/expo#40778](https://github.com/expo/expo/issues/40778).
|
|
196
|
+
|
|
197
|
+
## Test it
|
|
198
|
+
|
|
199
|
+
No device is needed for the logic. The core tests (`src/core/*.test.ts`) replace `expo-modules-core`
|
|
200
|
+
(`requireNativeViewManager`, `Platform`) and assert the descriptor a render function returns. The
|
|
201
|
+
adapter tests (`src/{react,vue,solid,angular}/**/*.test.*`, `vitest`) render the real component over the
|
|
202
|
+
recording Fabric with an injected view config and assert the committed payload, and Svelte's
|
|
203
|
+
`*.smoke.test.ts` compile the `.svelte` files and mount them. Painting itself is verified on a device in
|
|
204
|
+
the six `examples/expo-*` canary apps (`examples/expo-react`, `examples/expo-vue-sfc`,
|
|
205
|
+
`examples/expo-vue-tsx`, `examples/expo-svelte`, `examples/expo-solid`, `examples/expo-angular`), see the
|
|
206
|
+
parent [README](../../README.md).
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { GlassContainerBase, GlassViewBase } from './shared';
|
|
2
|
+
/** Angular twin of `expo-glass-effect`'s `GlassView`, a plain View off iOS */
|
|
3
|
+
export declare class GlassView extends GlassViewBase {
|
|
4
|
+
}
|
|
5
|
+
/** Angular twin of `expo-glass-effect`'s `GlassContainer`, a plain View off iOS */
|
|
6
|
+
export declare class GlassContainer extends GlassContainerBase {
|
|
7
|
+
}
|
|
@@ -0,0 +1,97 @@
|
|
|
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 } from '@angular/core';
|
|
36
|
+
import { DescriptorHost } from '@symbiote-native/angular';
|
|
37
|
+
import { GlassContainerBase, GlassViewBase } from './shared.js';
|
|
38
|
+
/** Angular twin of `expo-glass-effect`'s `GlassView`, a plain View off iOS */
|
|
39
|
+
let GlassView = (() => {
|
|
40
|
+
let _classDecorators = [Component({
|
|
41
|
+
selector: 'GlassView',
|
|
42
|
+
standalone: true,
|
|
43
|
+
imports: [DescriptorHost],
|
|
44
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
45
|
+
template: `@if (descriptor; as node) {
|
|
46
|
+
<symbiote-descriptor-host [node]="node"
|
|
47
|
+
><ng-content
|
|
48
|
+
/></symbiote-descriptor-host>
|
|
49
|
+
}`,
|
|
50
|
+
})];
|
|
51
|
+
let _classDescriptor;
|
|
52
|
+
let _classExtraInitializers = [];
|
|
53
|
+
let _classThis;
|
|
54
|
+
let _classSuper = GlassViewBase;
|
|
55
|
+
var GlassView = class extends _classSuper {
|
|
56
|
+
static { _classThis = this; }
|
|
57
|
+
static {
|
|
58
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
59
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
60
|
+
GlassView = _classThis = _classDescriptor.value;
|
|
61
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
62
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
return GlassView = _classThis;
|
|
66
|
+
})();
|
|
67
|
+
export { GlassView };
|
|
68
|
+
/** Angular twin of `expo-glass-effect`'s `GlassContainer`, a plain View off iOS */
|
|
69
|
+
let GlassContainer = (() => {
|
|
70
|
+
let _classDecorators = [Component({
|
|
71
|
+
selector: 'GlassContainer',
|
|
72
|
+
standalone: true,
|
|
73
|
+
imports: [DescriptorHost],
|
|
74
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
75
|
+
template: `@if (descriptor; as node) {
|
|
76
|
+
<symbiote-descriptor-host [node]="node"
|
|
77
|
+
><ng-content
|
|
78
|
+
/></symbiote-descriptor-host>
|
|
79
|
+
}`,
|
|
80
|
+
})];
|
|
81
|
+
let _classDescriptor;
|
|
82
|
+
let _classExtraInitializers = [];
|
|
83
|
+
let _classThis;
|
|
84
|
+
let _classSuper = GlassContainerBase;
|
|
85
|
+
var GlassContainer = class extends _classSuper {
|
|
86
|
+
static { _classThis = this; }
|
|
87
|
+
static {
|
|
88
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
89
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
90
|
+
GlassContainer = _classThis = _classDescriptor.value;
|
|
91
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
92
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
return GlassContainer = _classThis;
|
|
96
|
+
})();
|
|
97
|
+
export { GlassContainer };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { GlassContainer, GlassView } from './index.ios';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { GlassContainerBase, GlassViewBase } from './shared';
|
|
2
|
+
/** Angular twin of `expo-glass-effect`'s `GlassView`, content goes inside the native view */
|
|
3
|
+
export declare class GlassView extends GlassViewBase {
|
|
4
|
+
constructor();
|
|
5
|
+
}
|
|
6
|
+
/** Angular twin of `expo-glass-effect`'s `GlassContainer`, merges the glass views it holds */
|
|
7
|
+
export declare class GlassContainer extends GlassContainerBase {
|
|
8
|
+
constructor();
|
|
9
|
+
}
|
|
@@ -0,0 +1,116 @@
|
|
|
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, NO_ERRORS_SCHEMA, } from '@angular/core';
|
|
36
|
+
import { SymbioteHostPropsDirective } from '@symbiote-native/angular';
|
|
37
|
+
import { warnIfViewNameIsDynamic } from '@symbiote-native/engine';
|
|
38
|
+
import { GLASS_EFFECT_MODULE_NAME } from '../../core/index.js';
|
|
39
|
+
import { GlassContainerBase, GlassViewBase } from './shared.js';
|
|
40
|
+
const VIEW_TAG = 'ViewManagerAdapter_ExpoGlassEffect_GlassView';
|
|
41
|
+
const CONTAINER_TAG = 'ViewManagerAdapter_ExpoGlassEffect_GlassContainer';
|
|
42
|
+
/** Angular twin of `expo-glass-effect`'s `GlassView`, content goes inside the native view */
|
|
43
|
+
let GlassView = (() => {
|
|
44
|
+
let _classDecorators = [Component({
|
|
45
|
+
selector: 'GlassView',
|
|
46
|
+
standalone: true,
|
|
47
|
+
imports: [SymbioteHostPropsDirective],
|
|
48
|
+
schemas: [NO_ERRORS_SCHEMA],
|
|
49
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
50
|
+
// Имя тега это нативное имя view, его нельзя собрать динамически
|
|
51
|
+
template: `@if (descriptor; as node) {
|
|
52
|
+
<ViewManagerAdapter_ExpoGlassEffect_GlassView
|
|
53
|
+
[symbioteHostProps]="node.props"
|
|
54
|
+
>
|
|
55
|
+
<ng-content />
|
|
56
|
+
</ViewManagerAdapter_ExpoGlassEffect_GlassView>
|
|
57
|
+
}`,
|
|
58
|
+
})];
|
|
59
|
+
let _classDescriptor;
|
|
60
|
+
let _classExtraInitializers = [];
|
|
61
|
+
let _classThis;
|
|
62
|
+
let _classSuper = GlassViewBase;
|
|
63
|
+
var GlassView = class extends _classSuper {
|
|
64
|
+
static { _classThis = this; }
|
|
65
|
+
static {
|
|
66
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
67
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
68
|
+
GlassView = _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
|
+
constructor() {
|
|
73
|
+
super();
|
|
74
|
+
warnIfViewNameIsDynamic(VIEW_TAG, GLASS_EFFECT_MODULE_NAME, 'GlassView');
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
return GlassView = _classThis;
|
|
78
|
+
})();
|
|
79
|
+
export { GlassView };
|
|
80
|
+
/** Angular twin of `expo-glass-effect`'s `GlassContainer`, merges the glass views it holds */
|
|
81
|
+
let GlassContainer = (() => {
|
|
82
|
+
let _classDecorators = [Component({
|
|
83
|
+
selector: 'GlassContainer',
|
|
84
|
+
standalone: true,
|
|
85
|
+
imports: [SymbioteHostPropsDirective],
|
|
86
|
+
schemas: [NO_ERRORS_SCHEMA],
|
|
87
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
88
|
+
template: `@if (descriptor; as node) {
|
|
89
|
+
<ViewManagerAdapter_ExpoGlassEffect_GlassContainer
|
|
90
|
+
[symbioteHostProps]="node.props"
|
|
91
|
+
>
|
|
92
|
+
<ng-content />
|
|
93
|
+
</ViewManagerAdapter_ExpoGlassEffect_GlassContainer>
|
|
94
|
+
}`,
|
|
95
|
+
})];
|
|
96
|
+
let _classDescriptor;
|
|
97
|
+
let _classExtraInitializers = [];
|
|
98
|
+
let _classThis;
|
|
99
|
+
let _classSuper = GlassContainerBase;
|
|
100
|
+
var GlassContainer = class extends _classSuper {
|
|
101
|
+
static { _classThis = this; }
|
|
102
|
+
static {
|
|
103
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
104
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
105
|
+
GlassContainer = _classThis = _classDescriptor.value;
|
|
106
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
107
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
108
|
+
}
|
|
109
|
+
constructor() {
|
|
110
|
+
super();
|
|
111
|
+
warnIfViewNameIsDynamic(CONTAINER_TAG, GLASS_EFFECT_MODULE_NAME, 'GlassContainer');
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
return GlassContainer = _classThis;
|
|
115
|
+
})();
|
|
116
|
+
export { GlassContainer };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { NativeViewBase } from '@symbiote-native/angular';
|
|
2
|
+
import type { IDescriptor } from '@symbiote-native/components';
|
|
3
|
+
import type { IGlassContainerProps, IGlassViewProps } from '../../core';
|
|
4
|
+
export declare abstract class GlassViewBase extends NativeViewBase {
|
|
5
|
+
glassEffectStyle?: IGlassViewProps['glassEffectStyle'];
|
|
6
|
+
tintColor?: IGlassViewProps['tintColor'];
|
|
7
|
+
isInteractive?: IGlassViewProps['isInteractive'];
|
|
8
|
+
colorScheme?: IGlassViewProps['colorScheme'];
|
|
9
|
+
protected readonly propNames: readonly ["glassEffectStyle", "tintColor", "isInteractive", "colorScheme"];
|
|
10
|
+
protected renderView(props: object): IDescriptor;
|
|
11
|
+
}
|
|
12
|
+
export declare abstract class GlassContainerBase extends NativeViewBase {
|
|
13
|
+
spacing?: IGlassContainerProps['spacing'];
|
|
14
|
+
protected readonly propNames: readonly ["spacing"];
|
|
15
|
+
protected renderView(props: object): IDescriptor;
|
|
16
|
+
}
|
|
@@ -0,0 +1,121 @@
|
|
|
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 { renderGlassContainer, renderGlassView } from '../../core/index.js';
|
|
38
|
+
// Inputs и сборка дескриптора общие, платформы различаются только шаблоном
|
|
39
|
+
let GlassViewBase = (() => {
|
|
40
|
+
let _classDecorators = [Directive()];
|
|
41
|
+
let _classDescriptor;
|
|
42
|
+
let _classExtraInitializers = [];
|
|
43
|
+
let _classThis;
|
|
44
|
+
let _classSuper = NativeViewBase;
|
|
45
|
+
let _glassEffectStyle_decorators;
|
|
46
|
+
let _glassEffectStyle_initializers = [];
|
|
47
|
+
let _glassEffectStyle_extraInitializers = [];
|
|
48
|
+
let _tintColor_decorators;
|
|
49
|
+
let _tintColor_initializers = [];
|
|
50
|
+
let _tintColor_extraInitializers = [];
|
|
51
|
+
let _isInteractive_decorators;
|
|
52
|
+
let _isInteractive_initializers = [];
|
|
53
|
+
let _isInteractive_extraInitializers = [];
|
|
54
|
+
let _colorScheme_decorators;
|
|
55
|
+
let _colorScheme_initializers = [];
|
|
56
|
+
let _colorScheme_extraInitializers = [];
|
|
57
|
+
var GlassViewBase = class extends _classSuper {
|
|
58
|
+
static { _classThis = this; }
|
|
59
|
+
static {
|
|
60
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
61
|
+
_glassEffectStyle_decorators = [Input()];
|
|
62
|
+
_tintColor_decorators = [Input()];
|
|
63
|
+
_isInteractive_decorators = [Input()];
|
|
64
|
+
_colorScheme_decorators = [Input()];
|
|
65
|
+
__esDecorate(null, null, _glassEffectStyle_decorators, { kind: "field", name: "glassEffectStyle", static: false, private: false, access: { has: obj => "glassEffectStyle" in obj, get: obj => obj.glassEffectStyle, set: (obj, value) => { obj.glassEffectStyle = value; } }, metadata: _metadata }, _glassEffectStyle_initializers, _glassEffectStyle_extraInitializers);
|
|
66
|
+
__esDecorate(null, null, _tintColor_decorators, { kind: "field", name: "tintColor", static: false, private: false, access: { has: obj => "tintColor" in obj, get: obj => obj.tintColor, set: (obj, value) => { obj.tintColor = value; } }, metadata: _metadata }, _tintColor_initializers, _tintColor_extraInitializers);
|
|
67
|
+
__esDecorate(null, null, _isInteractive_decorators, { kind: "field", name: "isInteractive", static: false, private: false, access: { has: obj => "isInteractive" in obj, get: obj => obj.isInteractive, set: (obj, value) => { obj.isInteractive = value; } }, metadata: _metadata }, _isInteractive_initializers, _isInteractive_extraInitializers);
|
|
68
|
+
__esDecorate(null, null, _colorScheme_decorators, { kind: "field", name: "colorScheme", static: false, private: false, access: { has: obj => "colorScheme" in obj, get: obj => obj.colorScheme, set: (obj, value) => { obj.colorScheme = value; } }, metadata: _metadata }, _colorScheme_initializers, _colorScheme_extraInitializers);
|
|
69
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
70
|
+
GlassViewBase = _classThis = _classDescriptor.value;
|
|
71
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
72
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
73
|
+
}
|
|
74
|
+
glassEffectStyle = __runInitializers(this, _glassEffectStyle_initializers, void 0);
|
|
75
|
+
tintColor = (__runInitializers(this, _glassEffectStyle_extraInitializers), __runInitializers(this, _tintColor_initializers, void 0));
|
|
76
|
+
isInteractive = (__runInitializers(this, _tintColor_extraInitializers), __runInitializers(this, _isInteractive_initializers, void 0));
|
|
77
|
+
colorScheme = (__runInitializers(this, _isInteractive_extraInitializers), __runInitializers(this, _colorScheme_initializers, void 0));
|
|
78
|
+
propNames = (__runInitializers(this, _colorScheme_extraInitializers), [
|
|
79
|
+
'glassEffectStyle',
|
|
80
|
+
'tintColor',
|
|
81
|
+
'isInteractive',
|
|
82
|
+
'colorScheme',
|
|
83
|
+
]);
|
|
84
|
+
renderView(props) {
|
|
85
|
+
return renderGlassView(props);
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
return GlassViewBase = _classThis;
|
|
89
|
+
})();
|
|
90
|
+
export { GlassViewBase };
|
|
91
|
+
let GlassContainerBase = (() => {
|
|
92
|
+
let _classDecorators = [Directive()];
|
|
93
|
+
let _classDescriptor;
|
|
94
|
+
let _classExtraInitializers = [];
|
|
95
|
+
let _classThis;
|
|
96
|
+
let _classSuper = NativeViewBase;
|
|
97
|
+
let _spacing_decorators;
|
|
98
|
+
let _spacing_initializers = [];
|
|
99
|
+
let _spacing_extraInitializers = [];
|
|
100
|
+
var GlassContainerBase = class extends _classSuper {
|
|
101
|
+
static { _classThis = this; }
|
|
102
|
+
static {
|
|
103
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
104
|
+
_spacing_decorators = [Input()];
|
|
105
|
+
__esDecorate(null, null, _spacing_decorators, { kind: "field", name: "spacing", static: false, private: false, access: { has: obj => "spacing" in obj, get: obj => obj.spacing, set: (obj, value) => { obj.spacing = value; } }, metadata: _metadata }, _spacing_initializers, _spacing_extraInitializers);
|
|
106
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
107
|
+
GlassContainerBase = _classThis = _classDescriptor.value;
|
|
108
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
109
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
110
|
+
}
|
|
111
|
+
spacing = __runInitializers(this, _spacing_initializers, void 0);
|
|
112
|
+
propNames = (__runInitializers(this, _spacing_extraInitializers), [
|
|
113
|
+
'spacing',
|
|
114
|
+
]);
|
|
115
|
+
renderView(props) {
|
|
116
|
+
return renderGlassContainer(props);
|
|
117
|
+
}
|
|
118
|
+
};
|
|
119
|
+
return GlassContainerBase = _classThis;
|
|
120
|
+
})();
|
|
121
|
+
export { GlassContainerBase };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { GlassContainer, GlassView } from './glass';
|
|
2
|
+
export { GLASS_EFFECT_MODULE_NAME, glassContainerName, glassViewName, isGlassEffectAPIAvailable, isLiquidGlassAvailable, type IGlassColorScheme, type IGlassContainerProps, type IGlassEffectStyleConfig, type IGlassStyle, type IGlassViewProps, } from '../core';
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
// @symbiote-native/glass-effect/angular: компоненты `GlassView` и `GlassContainer` поверх общего ядра
|
|
2
|
+
export { GlassContainer, GlassView } from './glass';
|
|
3
|
+
export { GLASS_EFFECT_MODULE_NAME, glassContainerName, glassViewName, isGlassEffectAPIAvailable, isLiquidGlassAvailable, } from '../core/index.js';
|