@expo/ui 0.2.0-alpha.7 → 0.2.0-alpha.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/android/build.gradle +2 -2
- package/build/swift-ui/GlassEffectContainer/index.d.ts +15 -0
- package/build/swift-ui/GlassEffectContainer/index.d.ts.map +1 -0
- package/build/swift-ui/GlassEffectContainer/index.js +8 -0
- package/build/swift-ui/GlassEffectContainer/index.js.map +1 -0
- package/build/swift-ui/Namespace.d.ts +34 -0
- package/build/swift-ui/Namespace.d.ts.map +1 -0
- package/build/swift-ui/Namespace.js +31 -0
- package/build/swift-ui/Namespace.js.map +1 -0
- package/build/swift-ui/index.d.ts +2 -0
- package/build/swift-ui/index.d.ts.map +1 -1
- package/build/swift-ui/index.js +2 -0
- package/build/swift-ui/index.js.map +1 -1
- package/build/swift-ui/modifiers/index.d.ts +5 -1
- package/build/swift-ui/modifiers/index.d.ts.map +1 -1
- package/build/swift-ui/modifiers/index.js +7 -0
- package/build/swift-ui/modifiers/index.js.map +1 -1
- package/expo-module.config.json +1 -1
- package/ios/Convertibles/AlignmentOptions.swift +58 -0
- package/ios/ExpoUIModule.swift +8 -0
- package/ios/GlassEffectContainerView.swift +32 -0
- package/ios/Modifiers/CommonViewModifiers.swift +3 -1
- package/ios/Modifiers/View+FrameModifiers.swift +0 -35
- package/ios/Modifiers/View+ModifierArray.swift +9 -3
- package/ios/Modifiers/ViewModifierRegistry.swift +303 -367
- package/ios/NamespaceRegistry.swift +26 -0
- package/ios/NamespaceView.swift +28 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/{0.2.0-alpha.7/expo.modules.ui-0.2.0-alpha.7.module → 0.2.0-alpha.9/expo.modules.ui-0.2.0-alpha.9.module} +7 -7
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-alpha.9/expo.modules.ui-0.2.0-alpha.9.module.md5 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-alpha.9/expo.modules.ui-0.2.0-alpha.9.module.sha1 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-alpha.9/expo.modules.ui-0.2.0-alpha.9.module.sha256 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-alpha.9/expo.modules.ui-0.2.0-alpha.9.module.sha512 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/{0.2.0-alpha.7/expo.modules.ui-0.2.0-alpha.7.pom → 0.2.0-alpha.9/expo.modules.ui-0.2.0-alpha.9.pom} +1 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-alpha.9/expo.modules.ui-0.2.0-alpha.9.pom.md5 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-alpha.9/expo.modules.ui-0.2.0-alpha.9.pom.sha1 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-alpha.9/expo.modules.ui-0.2.0-alpha.9.pom.sha256 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-alpha.9/expo.modules.ui-0.2.0-alpha.9.pom.sha512 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/maven-metadata.xml +4 -4
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/maven-metadata.xml.md5 +1 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/maven-metadata.xml.sha1 +1 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/maven-metadata.xml.sha256 +1 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/maven-metadata.xml.sha512 +1 -1
- package/package.json +3 -3
- package/src/swift-ui/GlassEffectContainer/index.tsx +27 -0
- package/src/swift-ui/Namespace.tsx +46 -0
- package/src/swift-ui/index.tsx +2 -0
- package/src/swift-ui/modifiers/index.ts +10 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-alpha.7/expo.modules.ui-0.2.0-alpha.7.module.md5 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-alpha.7/expo.modules.ui-0.2.0-alpha.7.module.sha1 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-alpha.7/expo.modules.ui-0.2.0-alpha.7.module.sha256 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-alpha.7/expo.modules.ui-0.2.0-alpha.7.module.sha512 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-alpha.7/expo.modules.ui-0.2.0-alpha.7.pom.md5 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-alpha.7/expo.modules.ui-0.2.0-alpha.7.pom.sha1 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-alpha.7/expo.modules.ui-0.2.0-alpha.7.pom.sha256 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/0.2.0-alpha.7/expo.modules.ui-0.2.0-alpha.7.pom.sha512 +0 -1
- /package/local-maven-repo/expo/modules/ui/expo.modules.ui/{0.2.0-alpha.7/expo.modules.ui-0.2.0-alpha.7-sources.jar → 0.2.0-alpha.9/expo.modules.ui-0.2.0-alpha.9-sources.jar} +0 -0
- /package/local-maven-repo/expo/modules/ui/expo.modules.ui/{0.2.0-alpha.7/expo.modules.ui-0.2.0-alpha.7-sources.jar.md5 → 0.2.0-alpha.9/expo.modules.ui-0.2.0-alpha.9-sources.jar.md5} +0 -0
- /package/local-maven-repo/expo/modules/ui/expo.modules.ui/{0.2.0-alpha.7/expo.modules.ui-0.2.0-alpha.7-sources.jar.sha1 → 0.2.0-alpha.9/expo.modules.ui-0.2.0-alpha.9-sources.jar.sha1} +0 -0
- /package/local-maven-repo/expo/modules/ui/expo.modules.ui/{0.2.0-alpha.7/expo.modules.ui-0.2.0-alpha.7-sources.jar.sha256 → 0.2.0-alpha.9/expo.modules.ui-0.2.0-alpha.9-sources.jar.sha256} +0 -0
- /package/local-maven-repo/expo/modules/ui/expo.modules.ui/{0.2.0-alpha.7/expo.modules.ui-0.2.0-alpha.7-sources.jar.sha512 → 0.2.0-alpha.9/expo.modules.ui-0.2.0-alpha.9-sources.jar.sha512} +0 -0
- /package/local-maven-repo/expo/modules/ui/expo.modules.ui/{0.2.0-alpha.7/expo.modules.ui-0.2.0-alpha.7.aar → 0.2.0-alpha.9/expo.modules.ui-0.2.0-alpha.9.aar} +0 -0
- /package/local-maven-repo/expo/modules/ui/expo.modules.ui/{0.2.0-alpha.7/expo.modules.ui-0.2.0-alpha.7.aar.md5 → 0.2.0-alpha.9/expo.modules.ui-0.2.0-alpha.9.aar.md5} +0 -0
- /package/local-maven-repo/expo/modules/ui/expo.modules.ui/{0.2.0-alpha.7/expo.modules.ui-0.2.0-alpha.7.aar.sha1 → 0.2.0-alpha.9/expo.modules.ui-0.2.0-alpha.9.aar.sha1} +0 -0
- /package/local-maven-repo/expo/modules/ui/expo.modules.ui/{0.2.0-alpha.7/expo.modules.ui-0.2.0-alpha.7.aar.sha256 → 0.2.0-alpha.9/expo.modules.ui-0.2.0-alpha.9.aar.sha256} +0 -0
- /package/local-maven-repo/expo/modules/ui/expo.modules.ui/{0.2.0-alpha.7/expo.modules.ui-0.2.0-alpha.7.aar.sha512 → 0.2.0-alpha.9/expo.modules.ui-0.2.0-alpha.9.aar.sha512} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -10,6 +10,17 @@
|
|
|
10
10
|
|
|
11
11
|
### 💡 Others
|
|
12
12
|
|
|
13
|
+
## 0.2.0-alpha.9 — 2025-09-03
|
|
14
|
+
|
|
15
|
+
_This version does not introduce any user-facing changes._
|
|
16
|
+
|
|
17
|
+
## 0.2.0-alpha.8 — 2025-09-02
|
|
18
|
+
|
|
19
|
+
### 💡 Others
|
|
20
|
+
|
|
21
|
+
- Used convertibles to process modifiers' parameters. ([#39231](https://github.com/expo/expo/pull/39231) by [@kudo](https://github.com/kudo))
|
|
22
|
+
- Migrated `AnimationModifier` to convertibles. ([#39326](https://github.com/expo/expo/pull/39326) by [@kudo](https://github.com/kudo))
|
|
23
|
+
|
|
13
24
|
## 0.2.0-alpha.7 — 2025-08-31
|
|
14
25
|
|
|
15
26
|
_This version does not introduce any user-facing changes._
|
|
@@ -23,6 +34,7 @@ _This version does not introduce any user-facing changes._
|
|
|
23
34
|
### 🎉 New features
|
|
24
35
|
|
|
25
36
|
- [iOS] Add `animation` modifier. ([#38954](https://github.com/expo/expo/pull/38954) by [@nishan](https://github.com/intergalacticspacehighway))
|
|
37
|
+
- [iOS] Add `GlassEffectContainer`, `glassEffectId` and `Namespaces` support. ([#39070](https://github.com/expo/expo/pull/39070) by [@nishan](https://github.com/intergalacticspacehighway))
|
|
26
38
|
|
|
27
39
|
### 🐛 Bug fixes
|
|
28
40
|
|
package/android/build.gradle
CHANGED
|
@@ -12,13 +12,13 @@ apply plugin: 'expo-module-gradle-plugin'
|
|
|
12
12
|
apply plugin: 'org.jetbrains.kotlin.plugin.compose'
|
|
13
13
|
|
|
14
14
|
group = 'expo.modules.ui'
|
|
15
|
-
version = '0.2.0-alpha.
|
|
15
|
+
version = '0.2.0-alpha.9'
|
|
16
16
|
|
|
17
17
|
android {
|
|
18
18
|
namespace "expo.modules.ui"
|
|
19
19
|
defaultConfig {
|
|
20
20
|
versionCode 1
|
|
21
|
-
versionName "0.2.0-alpha.
|
|
21
|
+
versionName "0.2.0-alpha.9"
|
|
22
22
|
}
|
|
23
23
|
buildFeatures {
|
|
24
24
|
compose true
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type CommonViewModifierProps } from '../types';
|
|
2
|
+
export type GlassEffectContainerProps = {
|
|
3
|
+
/**
|
|
4
|
+
* The children of the `GlassEffectContainer` component.
|
|
5
|
+
* These should be views with `.glassEffect()` modifiers applied.
|
|
6
|
+
*/
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
/**
|
|
9
|
+
* The spacing between glass elements in the container.
|
|
10
|
+
* This controls how close elements need to be to start blending together.
|
|
11
|
+
*/
|
|
12
|
+
spacing?: number;
|
|
13
|
+
} & CommonViewModifierProps;
|
|
14
|
+
export declare function GlassEffectContainer(props: GlassEffectContainerProps): import("react").JSX.Element;
|
|
15
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/swift-ui/GlassEffectContainer/index.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,uBAAuB,EAAE,MAAM,UAAU,CAAC;AAExD,MAAM,MAAM,yBAAyB,GAAG;IACtC;;;OAGG;IACH,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,GAAG,uBAAuB,CAAC;AAO5B,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,yBAAyB,+BAGpE"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { requireNativeView } from 'expo';
|
|
2
|
+
import { createViewModifierEventListener } from '../modifiers/utils';
|
|
3
|
+
const GlassEffectContainerNativeView = requireNativeView('ExpoUI', 'GlassEffectContainerView');
|
|
4
|
+
export function GlassEffectContainer(props) {
|
|
5
|
+
const eventProp = props.modifiers ? createViewModifierEventListener(props.modifiers) : undefined;
|
|
6
|
+
return <GlassEffectContainerNativeView {...props} {...eventProp}/>;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/swift-ui/GlassEffectContainer/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAC;AAEzC,OAAO,EAAE,+BAA+B,EAAE,MAAM,oBAAoB,CAAC;AAkBrE,MAAM,8BAA8B,GAClC,iBAAiB,CAAC,QAAQ,EAAE,0BAA0B,CAAC,CAAC;AAE1D,MAAM,UAAU,oBAAoB,CAAC,KAAgC;IACnE,MAAM,SAAS,GAAG,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,+BAA+B,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IACjG,OAAO,CAAC,8BAA8B,CAAC,IAAI,KAAK,CAAC,CAAC,IAAI,SAAS,CAAC,EAAG,CAAC;AACtE,CAAC","sourcesContent":["import { requireNativeView } from 'expo';\n\nimport { createViewModifierEventListener } from '../modifiers/utils';\nimport { type CommonViewModifierProps } from '../types';\n\nexport type GlassEffectContainerProps = {\n /**\n * The children of the `GlassEffectContainer` component.\n * These should be views with `.glassEffect()` modifiers applied.\n */\n children: React.ReactNode;\n /**\n * The spacing between glass elements in the container.\n * This controls how close elements need to be to start blending together.\n */\n spacing?: number;\n} & CommonViewModifierProps;\n\ntype NativeGlassEffectContainerProps = GlassEffectContainerProps;\n\nconst GlassEffectContainerNativeView: React.ComponentType<NativeGlassEffectContainerProps> =\n requireNativeView('ExpoUI', 'GlassEffectContainerView');\n\nexport function GlassEffectContainer(props: GlassEffectContainerProps) {\n const eventProp = props.modifiers ? createViewModifierEventListener(props.modifiers) : undefined;\n return <GlassEffectContainerNativeView {...props} {...eventProp} />;\n}\n"]}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export type NamespaceProps = {
|
|
2
|
+
/**
|
|
3
|
+
* The ID of the namespace. You can generate one with the `useId` react hook.
|
|
4
|
+
*/
|
|
5
|
+
id: string;
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* A component that provides a SwiftUI [`Namespace`](https://developer.apple.com/documentation/swiftui/namespace) to its children.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```tsx
|
|
13
|
+
* const namespaceId = React.useId();
|
|
14
|
+
* return (
|
|
15
|
+
* <Namespace id={namespaceId}>
|
|
16
|
+
* <GlassEffectContainer>
|
|
17
|
+
* <Image
|
|
18
|
+
* systemName="paintbrush.fill"
|
|
19
|
+
* modifiers={[
|
|
20
|
+
* glassEffect({
|
|
21
|
+
* glass: {
|
|
22
|
+
* variant: 'clear',
|
|
23
|
+
* },
|
|
24
|
+
* }),
|
|
25
|
+
* glassEffectId('paintbrush', namespaceId),
|
|
26
|
+
* ]}
|
|
27
|
+
* />
|
|
28
|
+
* </GlassEffectContainer>
|
|
29
|
+
* </Namespace>
|
|
30
|
+
* );
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
export declare function Namespace(props: NamespaceProps): import("react").JSX.Element;
|
|
34
|
+
//# sourceMappingURL=Namespace.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Namespace.d.ts","sourceRoot":"","sources":["../../src/swift-ui/Namespace.tsx"],"names":[],"mappings":"AAEA,MAAM,MAAM,cAAc,GAAG;IAC3B;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,CAAC;AASF;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,cAAc,+BAE9C"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { requireNativeView } from 'expo';
|
|
2
|
+
const NativeNamespaceView = requireNativeView('ExpoUI', 'NamespaceView');
|
|
3
|
+
/**
|
|
4
|
+
* A component that provides a SwiftUI [`Namespace`](https://developer.apple.com/documentation/swiftui/namespace) to its children.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```tsx
|
|
8
|
+
* const namespaceId = React.useId();
|
|
9
|
+
* return (
|
|
10
|
+
* <Namespace id={namespaceId}>
|
|
11
|
+
* <GlassEffectContainer>
|
|
12
|
+
* <Image
|
|
13
|
+
* systemName="paintbrush.fill"
|
|
14
|
+
* modifiers={[
|
|
15
|
+
* glassEffect({
|
|
16
|
+
* glass: {
|
|
17
|
+
* variant: 'clear',
|
|
18
|
+
* },
|
|
19
|
+
* }),
|
|
20
|
+
* glassEffectId('paintbrush', namespaceId),
|
|
21
|
+
* ]}
|
|
22
|
+
* />
|
|
23
|
+
* </GlassEffectContainer>
|
|
24
|
+
* </Namespace>
|
|
25
|
+
* );
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
export function Namespace(props) {
|
|
29
|
+
return <NativeNamespaceView {...props}/>;
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=Namespace.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Namespace.js","sourceRoot":"","sources":["../../src/swift-ui/Namespace.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAC;AAazC,MAAM,mBAAmB,GAA8C,iBAAiB,CACtF,QAAQ,EACR,eAAe,CAChB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,UAAU,SAAS,CAAC,KAAqB;IAC7C,OAAO,CAAC,mBAAmB,CAAC,IAAI,KAAK,CAAC,EAAG,CAAC;AAC5C,CAAC","sourcesContent":["import { requireNativeView } from 'expo';\n\nexport type NamespaceProps = {\n /**\n * The ID of the namespace. You can generate one with the `useId` react hook.\n */\n id: string;\n\n children: React.ReactNode;\n};\n\ntype NativeNamespaceProps = NamespaceProps;\n\nconst NativeNamespaceView: React.ComponentType<NativeNamespaceProps> = requireNativeView(\n 'ExpoUI',\n 'NamespaceView'\n);\n\n/**\n * A component that provides a SwiftUI [`Namespace`](https://developer.apple.com/documentation/swiftui/namespace) to its children.\n *\n * @example\n * ```tsx\n * const namespaceId = React.useId();\n * return (\n * <Namespace id={namespaceId}>\n * <GlassEffectContainer>\n * <Image\n * systemName=\"paintbrush.fill\"\n * modifiers={[\n * glassEffect({\n * glass: {\n * variant: 'clear',\n * },\n * }),\n * glassEffectId('paintbrush', namespaceId),\n * ]}\n * />\n * </GlassEffectContainer>\n * </Namespace>\n * );\n * ```\n */\nexport function Namespace(props: NamespaceProps) {\n return <NativeNamespaceView {...props} />;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/swift-ui/index.tsx"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,eAAe,CAAC;AAC9B,cAAc,0BAA0B,CAAC;AACzC,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/swift-ui/index.tsx"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,eAAe,CAAC;AAC9B,cAAc,0BAA0B,CAAC;AACzC,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,wBAAwB,CAAC"}
|
package/build/swift-ui/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/swift-ui/index.tsx"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,eAAe,CAAC;AAC9B,cAAc,0BAA0B,CAAC;AACzC,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC","sourcesContent":["export * from './BottomSheet';\nexport * from './Button';\nexport * from './Chart';\nexport * from './ColorPicker';\nexport * from './ContentUnavailableView';\nexport * from './ContextMenu';\nexport * from './DatePicker';\nexport * from './DisclosureGroup';\nexport * from './Form';\nexport * from './Gauge';\nexport * from './Host';\nexport * from './Image';\nexport * from './Label';\nexport * from './Layout';\nexport * from './List';\nexport * from './Picker';\nexport * from './Progress';\nexport * from './Section';\nexport * from './ShareLink';\nexport * from './Slider';\nexport * from './Spacer';\nexport * from './Switch';\nexport * from './Text';\nexport * from './TextField';\nexport * from './SecureField';\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/swift-ui/index.tsx"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,eAAe,CAAC;AAC9B,cAAc,0BAA0B,CAAC;AACzC,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,wBAAwB,CAAC","sourcesContent":["export * from './BottomSheet';\nexport * from './Button';\nexport * from './Chart';\nexport * from './ColorPicker';\nexport * from './ContentUnavailableView';\nexport * from './ContextMenu';\nexport * from './DatePicker';\nexport * from './DisclosureGroup';\nexport * from './Form';\nexport * from './Gauge';\nexport * from './Host';\nexport * from './Image';\nexport * from './Label';\nexport * from './Layout';\nexport * from './List';\nexport * from './Picker';\nexport * from './Progress';\nexport * from './Section';\nexport * from './ShareLink';\nexport * from './Slider';\nexport * from './Spacer';\nexport * from './Switch';\nexport * from './Text';\nexport * from './TextField';\nexport * from './SecureField';\nexport * from './Namespace';\nexport * from './GlassEffectContainer';\n"]}
|
|
@@ -225,11 +225,15 @@ export declare const glassEffect: (params?: {
|
|
|
225
225
|
};
|
|
226
226
|
shape?: "circle" | "capsule" | "rectangle" | "ellipse";
|
|
227
227
|
}) => ModifierConfig;
|
|
228
|
+
/**
|
|
229
|
+
* Associates an identity value to Liquid Glass effects defined within a `GlassEffectContainer`.
|
|
230
|
+
*/
|
|
231
|
+
export declare const glassEffectId: (id: string, namespaceId: string) => ModifierConfig;
|
|
228
232
|
/**
|
|
229
233
|
* Union type of all built-in modifier return types.
|
|
230
234
|
* This provides type safety for the modifiers array.
|
|
231
235
|
*/
|
|
232
|
-
export type BuiltInModifier = ReturnType<typeof background> | ReturnType<typeof cornerRadius> | ReturnType<typeof shadow> | ReturnType<typeof frame> | ReturnType<typeof padding> | ReturnType<typeof fixedSize> | ReturnType<typeof onTapGesture> | ReturnType<typeof onLongPressGesture> | ReturnType<typeof opacity> | ReturnType<typeof clipShape> | ReturnType<typeof border> | ReturnType<typeof scaleEffect> | ReturnType<typeof rotationEffect> | ReturnType<typeof offset> | ReturnType<typeof foregroundColor> | ReturnType<typeof tint> | ReturnType<typeof hidden> | ReturnType<typeof zIndex> | ReturnType<typeof blur> | ReturnType<typeof brightness> | ReturnType<typeof contrast> | ReturnType<typeof saturation> | ReturnType<typeof hueRotation> | ReturnType<typeof colorInvert> | ReturnType<typeof grayscale> | ReturnType<typeof accessibilityLabel> | ReturnType<typeof accessibilityHint> | ReturnType<typeof accessibilityValue> | ReturnType<typeof layoutPriority> | ReturnType<typeof mask> | ReturnType<typeof overlay> | ReturnType<typeof backgroundOverlay> | ReturnType<typeof aspectRatio> | ReturnType<typeof clipped> | ReturnType<typeof glassEffect> | ReturnType<typeof animation>;
|
|
236
|
+
export type BuiltInModifier = ReturnType<typeof background> | ReturnType<typeof cornerRadius> | ReturnType<typeof shadow> | ReturnType<typeof frame> | ReturnType<typeof padding> | ReturnType<typeof fixedSize> | ReturnType<typeof onTapGesture> | ReturnType<typeof onLongPressGesture> | ReturnType<typeof opacity> | ReturnType<typeof clipShape> | ReturnType<typeof border> | ReturnType<typeof scaleEffect> | ReturnType<typeof rotationEffect> | ReturnType<typeof offset> | ReturnType<typeof foregroundColor> | ReturnType<typeof tint> | ReturnType<typeof hidden> | ReturnType<typeof zIndex> | ReturnType<typeof blur> | ReturnType<typeof brightness> | ReturnType<typeof contrast> | ReturnType<typeof saturation> | ReturnType<typeof hueRotation> | ReturnType<typeof colorInvert> | ReturnType<typeof grayscale> | ReturnType<typeof accessibilityLabel> | ReturnType<typeof accessibilityHint> | ReturnType<typeof accessibilityValue> | ReturnType<typeof layoutPriority> | ReturnType<typeof mask> | ReturnType<typeof overlay> | ReturnType<typeof backgroundOverlay> | ReturnType<typeof aspectRatio> | ReturnType<typeof clipped> | ReturnType<typeof glassEffect> | ReturnType<typeof glassEffectId> | ReturnType<typeof animation>;
|
|
233
237
|
/**
|
|
234
238
|
* Main ViewModifier type that supports both built-in and 3rd party modifiers.
|
|
235
239
|
* 3rd party modifiers should return ModifierConfig objects with their own type strings.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/swift-ui/modifiers/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAiBlE;;;GAGG;AACH,eAAO,MAAM,UAAU,GAAI,OAAO,MAAM,mBAA4C,CAAC;AAErF;;;GAGG;AACH,eAAO,MAAM,YAAY,GAAI,QAAQ,MAAM,mBAA+C,CAAC;AAE3F;;GAEG;AACH,eAAO,MAAM,MAAM,GAAI,QAAQ;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,CAAC,CA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E1B;;GAEG;AACH,eAAO,MAAM,UAAU,GAAI,OAAO,GAAG,KAAG,KAAK,IAAI,cAEhD,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,eAAe,GAAI,WAAW,OAAO,EAAE,KAAG,cAAc,EAEpE,CAAC;AAEF,cAAc,mBAAmB,CAAC"}
|
|
@@ -192,6 +192,13 @@ export const clipped = (clipped = true) => createModifier('clipped', { clipped }
|
|
|
192
192
|
* Applies a glass effect to a view.
|
|
193
193
|
*/
|
|
194
194
|
export const glassEffect = (params) => createModifier('glassEffect', params);
|
|
195
|
+
/**
|
|
196
|
+
* Associates an identity value to Liquid Glass effects defined within a `GlassEffectContainer`.
|
|
197
|
+
*/
|
|
198
|
+
export const glassEffectId = (id, namespaceId) => createModifier('glassEffectId', {
|
|
199
|
+
id,
|
|
200
|
+
namespaceId,
|
|
201
|
+
});
|
|
195
202
|
// =============================================================================
|
|
196
203
|
// Utility Functions
|
|
197
204
|
// =============================================================================
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/swift-ui/modifiers/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,cAAc,EAAkB,MAAM,kBAAkB,CAAC;AAElE;;GAEG;AACH,SAAS,+BAA+B,CACtC,IAAY,EACZ,aAAkC,EAClC,SAA8B,EAAE;IAEhC,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,MAAM,EAAE,aAAa,EAAE,CAAC;AACnD,CAAC;AAED,gFAAgF;AAChF,8BAA8B;AAC9B,gFAAgF;AAEhF;;;GAGG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,KAAa,EAAE,EAAE,CAAC,cAAc,CAAC,YAAY,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;AAErF;;;GAGG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,MAAc,EAAE,EAAE,CAAC,cAAc,CAAC,cAAc,EAAE,EAAE,MAA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oB,EAAoB,EAAE;IACxE,OAAO,SAAS,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;AACtC,CAAC,CAAC;AAEF,cAAc,mBAAmB,CAAC","sourcesContent":["/**\n * Core modifier factory and type definitions for SwiftUI view modifiers.\n * This system allows both built-in and 3rd party modifiers to use the same API.\n */\n\nimport { animation } from './animation/index';\nimport { createModifier, ModifierConfig } from './createModifier';\n\n/**\n * Creates a modifier with an event listener.\n */\nfunction createModifierWithEventListener(\n type: string,\n eventListener: (args: any) => void,\n params: Record<string, any> = {}\n): ModifierConfig {\n return { $type: type, ...params, eventListener };\n}\n\n// =============================================================================\n// Built-in Modifier Functions\n// =============================================================================\n\n/**\n * Sets the background of a view.\n * @param color - The background color (hex string, e.g., '#FF0000')\n */\nexport const background = (color: string) => createModifier('background', { color });\n\n/**\n * Applies corner radius to a view.\n * @param radius - The corner radius value\n */\nexport const cornerRadius = (radius: number) => createModifier('cornerRadius', { radius });\n\n/**\n * Adds a shadow to a view.\n */\nexport const shadow = (params: { radius: number; x?: number; y?: number; color?: string }) =>\n createModifier('shadow', params);\n\n/**\n * Sets the frame properties of a view.\n */\nexport const frame = (params: {\n width?: number;\n height?: number;\n minWidth?: number;\n maxWidth?: number;\n minHeight?: number;\n maxHeight?: number;\n idealWidth?: number;\n idealHeight?: number;\n alignment?:\n | 'center'\n | 'leading'\n | 'trailing'\n | 'top'\n | 'bottom'\n | 'topLeading'\n | 'topTrailing'\n | 'bottomLeading'\n | 'bottomTrailing';\n}) => createModifier('frame', params);\n\n/**\n * Sets padding on a view.\n * Supports individual edges or shorthand properties.\n */\nexport const padding = (params: {\n top?: number;\n bottom?: number;\n leading?: number;\n trailing?: number;\n horizontal?: number;\n vertical?: number;\n all?: number;\n}) => createModifier('padding', params);\n\n/**\n * Controls fixed size behavior.\n * @param enabled - Whether the view should use its natural size\n */\nexport const fixedSize = (enabled: boolean = true) => createModifier('fixedSize', { enabled });\n\n/**\n * Adds a tap gesture recognizer.\n * @param handler - Function to call when tapped\n */\nexport const onTapGesture = (handler: () => void) =>\n createModifierWithEventListener('onTapGesture', handler);\n\n/**\n * Adds a long press gesture recognizer.\n * @param handler - Function to call when long pressed\n * @param minimumDuration - Minimum duration for long press (default: 0.5s)\n */\nexport const onLongPressGesture = (handler: () => void, minimumDuration?: number) =>\n createModifierWithEventListener('onLongPressGesture', handler, {\n minimumDuration: minimumDuration ?? 0.5,\n });\n\n// Note: Complex gesture modifiers like onDragGesture are not available\n// in the modifier system. Use component-level props instead.\n\n/**\n * Sets the opacity of a view.\n * @param value - Opacity value between 0 and 1\n */\nexport const opacity = (value: number) => createModifier('opacity', { value });\n\n/**\n * Clips the view to a specific shape.\n * @param shape - The clipping shape\n * @param cornerRadius - Corner radius for rounded rectangle (default: 8)\n */\nexport const clipShape = (\n shape: 'rectangle' | 'circle' | 'roundedRectangle',\n cornerRadius?: number\n) => createModifier('clipShape', { shape, cornerRadius });\n\n/**\n * Adds a border to a view.\n */\nexport const border = (params: { color: string; width?: number }) =>\n createModifier('border', params);\n\n/**\n * Applies scaling transformation.\n * @param scale - Scale factor (1.0 = normal size)\n */\nexport const scaleEffect = (scale: number) => createModifier('scaleEffect', { scale });\n\n/**\n * Applies rotation transformation.\n * @param angle - Rotation angle in degrees\n */\nexport const rotationEffect = (angle: number) => createModifier('rotationEffect', { angle });\n\n/**\n * Applies an offset (translation) to a view.\n */\nexport const offset = (params: { x?: number; y?: number }) => createModifier('offset', params);\n\n/**\n * Sets the foreground color/tint of a view.\n * @param color - The foreground color (hex string)\n */\nexport const foregroundColor = (color: string) => createModifier('foregroundColor', { color });\n\n/**\n * Sets the tint color of a view.\n * @param color - The tint color (hex string)\n */\nexport const tint = (color: string) => createModifier('tint', { color });\n\n/**\n * Hides or shows a view.\n * @param hidden - Whether the view should be hidden\n */\nexport const hidden = (hidden: boolean = true) => createModifier('hidden', { hidden });\n\n/**\n * Sets the z-index (display order) of a view.\n * @param index - The z-index value\n */\nexport const zIndex = (index: number) => createModifier('zIndex', { index });\n\n/**\n * Applies blur to a view.\n * @param radius - The blur radius\n */\nexport const blur = (radius: number) => createModifier('blur', { radius });\n\n/**\n * Adjusts the brightness of a view.\n * @param amount - Brightness adjustment (-1 to 1)\n */\nexport const brightness = (amount: number) => createModifier('brightness', { amount });\n\n/**\n * Adjusts the contrast of a view.\n * @param amount - Contrast multiplier (0 to infinity, 1 = normal)\n */\nexport const contrast = (amount: number) => createModifier('contrast', { amount });\n\n/**\n * Adjusts the saturation of a view.\n * @param amount - Saturation multiplier (0 to infinity, 1 = normal)\n */\nexport const saturation = (amount: number) => createModifier('saturation', { amount });\n\n/**\n * Applies a hue rotation to a view.\n * @param angle - Hue rotation angle in degrees\n */\nexport const hueRotation = (angle: number) => createModifier('hueRotation', { angle });\n\n/**\n * Inverts the colors of a view.\n * @param inverted - Whether to invert colors\n */\nexport const colorInvert = (inverted: boolean = true) =>\n createModifier('colorInvert', { inverted });\n\n/**\n * Makes a view grayscale.\n * @param amount - Grayscale amount (0 to 1)\n */\nexport const grayscale = (amount: number) => createModifier('grayscale', { amount });\n\n/**\n * Sets accessibility label for the view.\n * @param label - The accessibility label\n */\nexport const accessibilityLabel = (label: string) =>\n createModifier('accessibilityLabel', { label });\n\n/**\n * Sets accessibility hint for the view.\n * @param hint - The accessibility hint\n */\nexport const accessibilityHint = (hint: string) => createModifier('accessibilityHint', { hint });\n\n/**\n * Sets accessibility value for the view.\n * @param value - The accessibility value\n */\nexport const accessibilityValue = (value: string) =>\n createModifier('accessibilityValue', { value });\n\n/**\n * Sets layout priority for the view.\n * @param priority - Layout priority value\n */\nexport const layoutPriority = (priority: number) => createModifier('layoutPriority', { priority });\n\n/**\n * Applies a mask to the view.\n * @param shape - The masking shape\n * @param cornerRadius - Corner radius for rounded rectangle (default: 8)\n */\nexport const mask = (shape: 'rectangle' | 'circle' | 'roundedRectangle', cornerRadius?: number) =>\n createModifier('mask', { shape, cornerRadius });\n\n/**\n * Overlays another view on top.\n * @param color - Overlay color\n * @param alignment - Overlay alignment\n */\nexport const overlay = (params: {\n color?: string;\n alignment?: 'center' | 'top' | 'bottom' | 'leading' | 'trailing';\n}) => createModifier('overlay', params);\n\n/**\n * Adds a background behind the view.\n * @param color - Background color\n * @param alignment - Background alignment\n */\nexport const backgroundOverlay = (params: {\n color?: string;\n alignment?: 'center' | 'top' | 'bottom' | 'leading' | 'trailing';\n}) => createModifier('backgroundOverlay', params);\n\n/**\n * Sets aspect ratio constraint.\n * @param ratio - Width/height aspect ratio\n * @param contentMode - How content fits the aspect ratio\n */\nexport const aspectRatio = (params: { ratio: number; contentMode?: 'fit' | 'fill' }) =>\n createModifier('aspectRatio', params);\n\n/**\n * Clips content to bounds.\n * @param clipped - Whether to clip content\n */\nexport const clipped = (clipped: boolean = true) => createModifier('clipped', { clipped });\n\n/**\n * Applies a glass effect to a view.\n */\nexport const glassEffect = (params?: {\n glass?: {\n variant: 'regular' | 'clear' | 'identity';\n interactive?: boolean;\n tint?: string;\n };\n shape?: 'circle' | 'capsule' | 'rectangle' | 'ellipse';\n}) => createModifier('glassEffect', params);\n\n// =============================================================================\n// Type Definitions\n// =============================================================================\n\n/**\n * Union type of all built-in modifier return types.\n * This provides type safety for the modifiers array.\n */\nexport type BuiltInModifier =\n | ReturnType<typeof background>\n | ReturnType<typeof cornerRadius>\n | ReturnType<typeof shadow>\n | ReturnType<typeof frame>\n | ReturnType<typeof padding>\n | ReturnType<typeof fixedSize>\n | ReturnType<typeof onTapGesture>\n | ReturnType<typeof onLongPressGesture>\n | ReturnType<typeof opacity>\n | ReturnType<typeof clipShape>\n | ReturnType<typeof border>\n | ReturnType<typeof scaleEffect>\n | ReturnType<typeof rotationEffect>\n | ReturnType<typeof offset>\n | ReturnType<typeof foregroundColor>\n | ReturnType<typeof tint>\n | ReturnType<typeof hidden>\n | ReturnType<typeof zIndex>\n | ReturnType<typeof blur>\n | ReturnType<typeof brightness>\n | ReturnType<typeof contrast>\n | ReturnType<typeof saturation>\n | ReturnType<typeof hueRotation>\n | ReturnType<typeof colorInvert>\n | ReturnType<typeof grayscale>\n | ReturnType<typeof accessibilityLabel>\n | ReturnType<typeof accessibilityHint>\n | ReturnType<typeof accessibilityValue>\n | ReturnType<typeof layoutPriority>\n | ReturnType<typeof mask>\n | ReturnType<typeof overlay>\n | ReturnType<typeof backgroundOverlay>\n | ReturnType<typeof aspectRatio>\n | ReturnType<typeof clipped>\n | ReturnType<typeof glassEffect>\n | ReturnType<typeof animation>;\n\n/**\n * Main ViewModifier type that supports both built-in and 3rd party modifiers.\n * 3rd party modifiers should return ModifierConfig objects with their own type strings.\n */\nexport type ViewModifier = BuiltInModifier | ModifierConfig;\n\n// =============================================================================\n// Utility Functions\n// =============================================================================\n\n/**\n * Creates a custom modifier for 3rd party libraries.\n * This function is exported so 3rd party packages can create their own modifiers.\n *\n * @example\n * ```typescript\n * // In a 3rd party package\n * export const blurEffect = (params: { radius: number; style?: string }) =>\n * createModifier('blurEffect', params);\n * ```\n */\nexport { createModifier };\n\n/**\n * Type guard to check if a value is a valid modifier.\n */\nexport const isModifier = (value: any): value is ModifierConfig => {\n return typeof value === 'object' && value !== null && typeof value.$type === 'string';\n};\n\n/**\n * Filters an array to only include valid modifiers.\n */\nexport const filterModifiers = (modifiers: unknown[]): ModifierConfig[] => {\n return modifiers.filter(isModifier);\n};\n\nexport * from './animation/index';\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/swift-ui/modifiers/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,cAAc,EAAkB,MAAM,kBAAkB,CAAC;AAElE;;GAEG;AACH,SAAS,+BAA+B,CACtC,IAAY,EACZ,aAAkC,EAClC,SAA8B,EAAE;IAEhC,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,MAAM,EAAE,aAAa,EAAE,CAAC;AACnD,CAAC;AAED,gFAAgF;AAChF,8BAA8B;AAC9B,gFAAgF;AAEhF;;;GAGG;AACH,MAAM,CAAC,MAAM,U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C;AAuDL,gFAAgF;AAChF,oBAAoB;AACpB,gFAAgF;AAEhF;;;;;;;;;;GAUG;AACH,OAAO,EAAE,cAAc,EAAE,CAAC;AAE1B;;GAEG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,KAAU,EAA2B,EAAE;IAChE,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,CAAC,KAAK,KAAK,QAAQ,CAAC;AACxF,CAAC,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,SAAoB,EAAoB,EAAE;IACxE,OAAO,SAAS,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;AACtC,CAAC,CAAC;AAEF,cAAc,mBAAmB,CAAC","sourcesContent":["/**\n * Core modifier factory and type definitions for SwiftUI view modifiers.\n * This system allows both built-in and 3rd party modifiers to use the same API.\n */\n\nimport { animation } from './animation/index';\nimport { createModifier, ModifierConfig } from './createModifier';\n\n/**\n * Creates a modifier with an event listener.\n */\nfunction createModifierWithEventListener(\n type: string,\n eventListener: (args: any) => void,\n params: Record<string, any> = {}\n): ModifierConfig {\n return { $type: type, ...params, eventListener };\n}\n\n// =============================================================================\n// Built-in Modifier Functions\n// =============================================================================\n\n/**\n * Sets the background of a view.\n * @param color - The background color (hex string, e.g., '#FF0000')\n */\nexport const background = (color: string) => createModifier('background', { color });\n\n/**\n * Applies corner radius to a view.\n * @param radius - The corner radius value\n */\nexport const cornerRadius = (radius: number) => createModifier('cornerRadius', { radius });\n\n/**\n * Adds a shadow to a view.\n */\nexport const shadow = (params: { radius: number; x?: number; y?: number; color?: string }) =>\n createModifier('shadow', params);\n\n/**\n * Sets the frame properties of a view.\n */\nexport const frame = (params: {\n width?: number;\n height?: number;\n minWidth?: number;\n maxWidth?: number;\n minHeight?: number;\n maxHeight?: number;\n idealWidth?: number;\n idealHeight?: number;\n alignment?:\n | 'center'\n | 'leading'\n | 'trailing'\n | 'top'\n | 'bottom'\n | 'topLeading'\n | 'topTrailing'\n | 'bottomLeading'\n | 'bottomTrailing';\n}) => createModifier('frame', params);\n\n/**\n * Sets padding on a view.\n * Supports individual edges or shorthand properties.\n */\nexport const padding = (params: {\n top?: number;\n bottom?: number;\n leading?: number;\n trailing?: number;\n horizontal?: number;\n vertical?: number;\n all?: number;\n}) => createModifier('padding', params);\n\n/**\n * Controls fixed size behavior.\n * @param enabled - Whether the view should use its natural size\n */\nexport const fixedSize = (enabled: boolean = true) => createModifier('fixedSize', { enabled });\n\n/**\n * Adds a tap gesture recognizer.\n * @param handler - Function to call when tapped\n */\nexport const onTapGesture = (handler: () => void) =>\n createModifierWithEventListener('onTapGesture', handler);\n\n/**\n * Adds a long press gesture recognizer.\n * @param handler - Function to call when long pressed\n * @param minimumDuration - Minimum duration for long press (default: 0.5s)\n */\nexport const onLongPressGesture = (handler: () => void, minimumDuration?: number) =>\n createModifierWithEventListener('onLongPressGesture', handler, {\n minimumDuration: minimumDuration ?? 0.5,\n });\n\n// Note: Complex gesture modifiers like onDragGesture are not available\n// in the modifier system. Use component-level props instead.\n\n/**\n * Sets the opacity of a view.\n * @param value - Opacity value between 0 and 1\n */\nexport const opacity = (value: number) => createModifier('opacity', { value });\n\n/**\n * Clips the view to a specific shape.\n * @param shape - The clipping shape\n * @param cornerRadius - Corner radius for rounded rectangle (default: 8)\n */\nexport const clipShape = (\n shape: 'rectangle' | 'circle' | 'roundedRectangle',\n cornerRadius?: number\n) => createModifier('clipShape', { shape, cornerRadius });\n\n/**\n * Adds a border to a view.\n */\nexport const border = (params: { color: string; width?: number }) =>\n createModifier('border', params);\n\n/**\n * Applies scaling transformation.\n * @param scale - Scale factor (1.0 = normal size)\n */\nexport const scaleEffect = (scale: number) => createModifier('scaleEffect', { scale });\n\n/**\n * Applies rotation transformation.\n * @param angle - Rotation angle in degrees\n */\nexport const rotationEffect = (angle: number) => createModifier('rotationEffect', { angle });\n\n/**\n * Applies an offset (translation) to a view.\n */\nexport const offset = (params: { x?: number; y?: number }) => createModifier('offset', params);\n\n/**\n * Sets the foreground color/tint of a view.\n * @param color - The foreground color (hex string)\n */\nexport const foregroundColor = (color: string) => createModifier('foregroundColor', { color });\n\n/**\n * Sets the tint color of a view.\n * @param color - The tint color (hex string)\n */\nexport const tint = (color: string) => createModifier('tint', { color });\n\n/**\n * Hides or shows a view.\n * @param hidden - Whether the view should be hidden\n */\nexport const hidden = (hidden: boolean = true) => createModifier('hidden', { hidden });\n\n/**\n * Sets the z-index (display order) of a view.\n * @param index - The z-index value\n */\nexport const zIndex = (index: number) => createModifier('zIndex', { index });\n\n/**\n * Applies blur to a view.\n * @param radius - The blur radius\n */\nexport const blur = (radius: number) => createModifier('blur', { radius });\n\n/**\n * Adjusts the brightness of a view.\n * @param amount - Brightness adjustment (-1 to 1)\n */\nexport const brightness = (amount: number) => createModifier('brightness', { amount });\n\n/**\n * Adjusts the contrast of a view.\n * @param amount - Contrast multiplier (0 to infinity, 1 = normal)\n */\nexport const contrast = (amount: number) => createModifier('contrast', { amount });\n\n/**\n * Adjusts the saturation of a view.\n * @param amount - Saturation multiplier (0 to infinity, 1 = normal)\n */\nexport const saturation = (amount: number) => createModifier('saturation', { amount });\n\n/**\n * Applies a hue rotation to a view.\n * @param angle - Hue rotation angle in degrees\n */\nexport const hueRotation = (angle: number) => createModifier('hueRotation', { angle });\n\n/**\n * Inverts the colors of a view.\n * @param inverted - Whether to invert colors\n */\nexport const colorInvert = (inverted: boolean = true) =>\n createModifier('colorInvert', { inverted });\n\n/**\n * Makes a view grayscale.\n * @param amount - Grayscale amount (0 to 1)\n */\nexport const grayscale = (amount: number) => createModifier('grayscale', { amount });\n\n/**\n * Sets accessibility label for the view.\n * @param label - The accessibility label\n */\nexport const accessibilityLabel = (label: string) =>\n createModifier('accessibilityLabel', { label });\n\n/**\n * Sets accessibility hint for the view.\n * @param hint - The accessibility hint\n */\nexport const accessibilityHint = (hint: string) => createModifier('accessibilityHint', { hint });\n\n/**\n * Sets accessibility value for the view.\n * @param value - The accessibility value\n */\nexport const accessibilityValue = (value: string) =>\n createModifier('accessibilityValue', { value });\n\n/**\n * Sets layout priority for the view.\n * @param priority - Layout priority value\n */\nexport const layoutPriority = (priority: number) => createModifier('layoutPriority', { priority });\n\n/**\n * Applies a mask to the view.\n * @param shape - The masking shape\n * @param cornerRadius - Corner radius for rounded rectangle (default: 8)\n */\nexport const mask = (shape: 'rectangle' | 'circle' | 'roundedRectangle', cornerRadius?: number) =>\n createModifier('mask', { shape, cornerRadius });\n\n/**\n * Overlays another view on top.\n * @param color - Overlay color\n * @param alignment - Overlay alignment\n */\nexport const overlay = (params: {\n color?: string;\n alignment?: 'center' | 'top' | 'bottom' | 'leading' | 'trailing';\n}) => createModifier('overlay', params);\n\n/**\n * Adds a background behind the view.\n * @param color - Background color\n * @param alignment - Background alignment\n */\nexport const backgroundOverlay = (params: {\n color?: string;\n alignment?: 'center' | 'top' | 'bottom' | 'leading' | 'trailing';\n}) => createModifier('backgroundOverlay', params);\n\n/**\n * Sets aspect ratio constraint.\n * @param ratio - Width/height aspect ratio\n * @param contentMode - How content fits the aspect ratio\n */\nexport const aspectRatio = (params: { ratio: number; contentMode?: 'fit' | 'fill' }) =>\n createModifier('aspectRatio', params);\n\n/**\n * Clips content to bounds.\n * @param clipped - Whether to clip content\n */\nexport const clipped = (clipped: boolean = true) => createModifier('clipped', { clipped });\n\n/**\n * Applies a glass effect to a view.\n */\nexport const glassEffect = (params?: {\n glass?: {\n variant: 'regular' | 'clear' | 'identity';\n interactive?: boolean;\n tint?: string;\n };\n shape?: 'circle' | 'capsule' | 'rectangle' | 'ellipse';\n}) => createModifier('glassEffect', params);\n\n/**\n * Associates an identity value to Liquid Glass effects defined within a `GlassEffectContainer`.\n */\nexport const glassEffectId = (id: string, namespaceId: string) =>\n createModifier('glassEffectId', {\n id,\n namespaceId,\n });\n\n// =============================================================================\n// Type Definitions\n// =============================================================================\n\n/**\n * Union type of all built-in modifier return types.\n * This provides type safety for the modifiers array.\n */\nexport type BuiltInModifier =\n | ReturnType<typeof background>\n | ReturnType<typeof cornerRadius>\n | ReturnType<typeof shadow>\n | ReturnType<typeof frame>\n | ReturnType<typeof padding>\n | ReturnType<typeof fixedSize>\n | ReturnType<typeof onTapGesture>\n | ReturnType<typeof onLongPressGesture>\n | ReturnType<typeof opacity>\n | ReturnType<typeof clipShape>\n | ReturnType<typeof border>\n | ReturnType<typeof scaleEffect>\n | ReturnType<typeof rotationEffect>\n | ReturnType<typeof offset>\n | ReturnType<typeof foregroundColor>\n | ReturnType<typeof tint>\n | ReturnType<typeof hidden>\n | ReturnType<typeof zIndex>\n | ReturnType<typeof blur>\n | ReturnType<typeof brightness>\n | ReturnType<typeof contrast>\n | ReturnType<typeof saturation>\n | ReturnType<typeof hueRotation>\n | ReturnType<typeof colorInvert>\n | ReturnType<typeof grayscale>\n | ReturnType<typeof accessibilityLabel>\n | ReturnType<typeof accessibilityHint>\n | ReturnType<typeof accessibilityValue>\n | ReturnType<typeof layoutPriority>\n | ReturnType<typeof mask>\n | ReturnType<typeof overlay>\n | ReturnType<typeof backgroundOverlay>\n | ReturnType<typeof aspectRatio>\n | ReturnType<typeof clipped>\n | ReturnType<typeof glassEffect>\n | ReturnType<typeof glassEffectId>\n | ReturnType<typeof animation>;\n\n/**\n * Main ViewModifier type that supports both built-in and 3rd party modifiers.\n * 3rd party modifiers should return ModifierConfig objects with their own type strings.\n */\nexport type ViewModifier = BuiltInModifier | ModifierConfig;\n\n// =============================================================================\n// Utility Functions\n// =============================================================================\n\n/**\n * Creates a custom modifier for 3rd party libraries.\n * This function is exported so 3rd party packages can create their own modifiers.\n *\n * @example\n * ```typescript\n * // In a 3rd party package\n * export const blurEffect = (params: { radius: number; style?: string }) =>\n * createModifier('blurEffect', params);\n * ```\n */\nexport { createModifier };\n\n/**\n * Type guard to check if a value is a valid modifier.\n */\nexport const isModifier = (value: any): value is ModifierConfig => {\n return typeof value === 'object' && value !== null && typeof value.$type === 'string';\n};\n\n/**\n * Filters an array to only include valid modifiers.\n */\nexport const filterModifiers = (modifiers: unknown[]): ModifierConfig[] => {\n return modifiers.filter(isModifier);\n};\n\nexport * from './animation/index';\n"]}
|
package/expo-module.config.json
CHANGED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
// Copyright 2015-present 650 Industries. All rights reserved.
|
|
2
|
+
|
|
3
|
+
import ExpoModulesCore
|
|
4
|
+
import SwiftUI
|
|
5
|
+
|
|
6
|
+
internal enum AlignmentOptions: String, Enumerable {
|
|
7
|
+
case center
|
|
8
|
+
case leading
|
|
9
|
+
case trailing
|
|
10
|
+
case top
|
|
11
|
+
case bottom
|
|
12
|
+
case topLeading
|
|
13
|
+
case topTrailing
|
|
14
|
+
case bottomLeading
|
|
15
|
+
case bottomTrailing
|
|
16
|
+
|
|
17
|
+
case centerFirstTextBaseline
|
|
18
|
+
case centerLastTextBaseline
|
|
19
|
+
case leadingFirstTextBaseline
|
|
20
|
+
case leadingLastTextBaseline
|
|
21
|
+
case trailingFirstTextBaseline
|
|
22
|
+
case trailingLastTextBaseline
|
|
23
|
+
|
|
24
|
+
func toAlignment() -> SwiftUI.Alignment {
|
|
25
|
+
switch self {
|
|
26
|
+
case .center:
|
|
27
|
+
return .center
|
|
28
|
+
case .leading:
|
|
29
|
+
return .leading
|
|
30
|
+
case .trailing:
|
|
31
|
+
return .trailing
|
|
32
|
+
case .top:
|
|
33
|
+
return .top
|
|
34
|
+
case .bottom:
|
|
35
|
+
return .bottom
|
|
36
|
+
case .topLeading:
|
|
37
|
+
return .topLeading
|
|
38
|
+
case .topTrailing:
|
|
39
|
+
return .topTrailing
|
|
40
|
+
case .bottomLeading:
|
|
41
|
+
return .bottomLeading
|
|
42
|
+
case .bottomTrailing:
|
|
43
|
+
return .bottomTrailing
|
|
44
|
+
case .centerFirstTextBaseline:
|
|
45
|
+
return .centerFirstTextBaseline
|
|
46
|
+
case .centerLastTextBaseline:
|
|
47
|
+
return .centerLastTextBaseline
|
|
48
|
+
case .leadingFirstTextBaseline:
|
|
49
|
+
return .leadingFirstTextBaseline
|
|
50
|
+
case .leadingLastTextBaseline:
|
|
51
|
+
return .leadingLastTextBaseline
|
|
52
|
+
case .trailingFirstTextBaseline:
|
|
53
|
+
return .trailingFirstTextBaseline
|
|
54
|
+
case .trailingLastTextBaseline:
|
|
55
|
+
return .trailingLastTextBaseline
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
package/ios/ExpoUIModule.swift
CHANGED
|
@@ -6,6 +6,12 @@ public final class ExpoUIModule: Module {
|
|
|
6
6
|
public func definition() -> ModuleDefinition {
|
|
7
7
|
Name("ExpoUI")
|
|
8
8
|
|
|
9
|
+
OnDestroy {
|
|
10
|
+
Task { @MainActor in
|
|
11
|
+
NamespaceRegistry.shared.removeAll()
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
9
15
|
View(BottomSheetView.self)
|
|
10
16
|
View(Button.self)
|
|
11
17
|
View(ChartView.self)
|
|
@@ -43,5 +49,7 @@ public final class ExpoUIModule: Module {
|
|
|
43
49
|
}
|
|
44
50
|
}
|
|
45
51
|
View(VStackView.self)
|
|
52
|
+
View(NamespaceView.self)
|
|
53
|
+
View(GlassEffectContainerView.self)
|
|
46
54
|
}
|
|
47
55
|
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
// Copyright 2025-present 650 Industries. All rights reserved.
|
|
2
|
+
|
|
3
|
+
import SwiftUI
|
|
4
|
+
import ExpoModulesCore
|
|
5
|
+
|
|
6
|
+
internal final class GlassEffectContainerViewProps: ExpoSwiftUI.ViewProps, CommonViewModifierProps {
|
|
7
|
+
@Field var fixedSize: Bool?
|
|
8
|
+
@Field var frame: FrameOptions?
|
|
9
|
+
@Field var padding: PaddingOptions?
|
|
10
|
+
@Field var testID: String?
|
|
11
|
+
@Field var modifiers: ModifierArray?
|
|
12
|
+
@Field var spacing: Double?
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
internal struct GlassEffectContainerView: ExpoSwiftUI.View {
|
|
16
|
+
@ObservedObject var props: GlassEffectContainerViewProps
|
|
17
|
+
|
|
18
|
+
var body: some View {
|
|
19
|
+
if #available(iOS 26.0, macOS 26.0, tvOS 26.0, *) {
|
|
20
|
+
#if compiler(>=6.2) // Xcode 26
|
|
21
|
+
GlassEffectContainer(spacing: CGFloat(props.spacing ?? 0.0)) {
|
|
22
|
+
Children()
|
|
23
|
+
}
|
|
24
|
+
.modifier(CommonViewModifiers(props: props))
|
|
25
|
+
#else
|
|
26
|
+
Children()
|
|
27
|
+
#endif
|
|
28
|
+
} else {
|
|
29
|
+
Children()
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -9,6 +9,8 @@ internal protocol CommonViewModifierProps: ObservableObject {
|
|
|
9
9
|
var padding: PaddingOptions? { get }
|
|
10
10
|
var testID: String? { get }
|
|
11
11
|
var modifiers: ModifierArray? { get }
|
|
12
|
+
|
|
13
|
+
var appContext: AppContext? { get }
|
|
12
14
|
var globalEventDispatcher: EventDispatcher { get }
|
|
13
15
|
}
|
|
14
16
|
|
|
@@ -22,6 +24,6 @@ internal struct CommonViewModifiers<Props: CommonViewModifierProps>: ViewModifie
|
|
|
22
24
|
.applyFrame(props.frame, defaultAlignment: defaultFrameAlignment)
|
|
23
25
|
.applyPadding(props.padding)
|
|
24
26
|
.applyAccessibilityIdentifier(props.testID)
|
|
25
|
-
.applyModifiers(props.modifiers, globalEventDispatcher: props.globalEventDispatcher)
|
|
27
|
+
.applyModifiers(props.modifiers, appContext: props.appContext, globalEventDispatcher: props.globalEventDispatcher)
|
|
26
28
|
}
|
|
27
29
|
}
|
|
@@ -3,41 +3,6 @@
|
|
|
3
3
|
import ExpoModulesCore
|
|
4
4
|
import SwiftUI
|
|
5
5
|
|
|
6
|
-
internal enum AlignmentOptions: String, Enumerable {
|
|
7
|
-
case center
|
|
8
|
-
case leading
|
|
9
|
-
case trailing
|
|
10
|
-
case top
|
|
11
|
-
case bottom
|
|
12
|
-
case topLeading
|
|
13
|
-
case topTrailing
|
|
14
|
-
case bottomLeading
|
|
15
|
-
case bottomTrailing
|
|
16
|
-
|
|
17
|
-
func toAlignment() -> Alignment {
|
|
18
|
-
switch self {
|
|
19
|
-
case .center:
|
|
20
|
-
return .center
|
|
21
|
-
case .leading:
|
|
22
|
-
return .leading
|
|
23
|
-
case .trailing:
|
|
24
|
-
return .trailing
|
|
25
|
-
case .top:
|
|
26
|
-
return .top
|
|
27
|
-
case .bottom:
|
|
28
|
-
return .bottom
|
|
29
|
-
case .topLeading:
|
|
30
|
-
return .topLeading
|
|
31
|
-
case .topTrailing:
|
|
32
|
-
return .topTrailing
|
|
33
|
-
case .bottomLeading:
|
|
34
|
-
return .bottomLeading
|
|
35
|
-
case .bottomTrailing:
|
|
36
|
-
return .bottomTrailing
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
|
|
41
6
|
internal struct FrameOptions: Record {
|
|
42
7
|
@Field var width: Double?
|
|
43
8
|
@Field var height: Double?
|
|
@@ -11,14 +11,20 @@ internal extension View {
|
|
|
11
11
|
* Applies an array of modifiers to a view using the ViewModifierRegistry.
|
|
12
12
|
*/
|
|
13
13
|
@ViewBuilder
|
|
14
|
-
func applyModifiers(_ modifiers: ModifierArray?, globalEventDispatcher: EventDispatcher) -> some View {
|
|
15
|
-
if let modifiers
|
|
14
|
+
func applyModifiers(_ modifiers: ModifierArray?, appContext: AppContext?, globalEventDispatcher: EventDispatcher) -> some View {
|
|
15
|
+
if let modifiers, let appContext {
|
|
16
16
|
modifiers.reduce(AnyView(self)) { currentView, modifierConfig in
|
|
17
17
|
guard let type = modifierConfig["$type"] as? String else {
|
|
18
18
|
return currentView
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
return ViewModifierRegistry.shared.applyModifier(
|
|
21
|
+
return ViewModifierRegistry.shared.applyModifier(
|
|
22
|
+
type,
|
|
23
|
+
to: currentView,
|
|
24
|
+
appContext: appContext,
|
|
25
|
+
globalEventDispatcher: globalEventDispatcher,
|
|
26
|
+
params: modifierConfig
|
|
27
|
+
)
|
|
22
28
|
}
|
|
23
29
|
} else {
|
|
24
30
|
self
|