squircle-view 0.0.0-stage → 0.2.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 +20 -0
- package/README.md +82 -2
- package/SquircleView.podspec +22 -0
- package/android/CMakeLists.txt +17 -0
- package/android/build.gradle +78 -0
- package/android/src/main/AndroidManifest.xml +2 -0
- package/android/src/main/cpp/SquircleGeometryJni.cpp +52 -0
- package/android/src/main/java/com/squircleview/SquircleViewManager.kt +72 -0
- package/android/src/main/java/com/squircleview/SquircleViewPackage.kt +16 -0
- package/android/src/main/java/com/squircleview/geometry/SquircleGeometry.kt +58 -0
- package/android/src/main/java/com/squircleview/style/SquircleStyle.kt +142 -0
- package/android/src/main/java/com/squircleview/views/SquircleView.kt +361 -0
- package/common/cpp/SquircleGeometry.cpp +248 -0
- package/common/cpp/SquircleGeometry.h +75 -0
- package/ios/Geometry/SquirclePath.h +21 -0
- package/ios/Geometry/SquirclePath.mm +39 -0
- package/ios/Layers/SquircleBorderLayer.h +24 -0
- package/ios/Layers/SquircleBorderLayer.m +102 -0
- package/ios/Views/SquircleView.h +16 -0
- package/ios/Views/SquircleView.mm +337 -0
- package/lib/module/components/index.js +4 -0
- package/lib/module/components/index.js.map +1 -0
- package/lib/module/components/squircle-view.js +22 -0
- package/lib/module/components/squircle-view.js.map +1 -0
- package/lib/module/components/squircle-view.native.js +23 -0
- package/lib/module/components/squircle-view.native.js.map +1 -0
- package/lib/module/constants/index.js +5 -0
- package/lib/module/constants/index.js.map +1 -0
- package/lib/module/constants/native.constants.js +10 -0
- package/lib/module/constants/native.constants.js.map +1 -0
- package/lib/module/constants/squircle.constants.js +5 -0
- package/lib/module/constants/squircle.constants.js.map +1 -0
- package/lib/module/index.js +4 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/interfaces/index.js +5 -0
- package/lib/module/interfaces/index.js.map +1 -0
- package/lib/module/interfaces/squircle-style.interface.js +4 -0
- package/lib/module/interfaces/squircle-style.interface.js.map +1 -0
- package/lib/module/interfaces/squircle-view.interface.js +4 -0
- package/lib/module/interfaces/squircle-view.interface.js.map +1 -0
- package/lib/module/package.json +1 -0
- package/lib/module/root/index.js +4 -0
- package/lib/module/root/index.js.map +1 -0
- package/lib/module/types/index.js +5 -0
- package/lib/module/types/index.js.map +1 -0
- package/lib/module/types/native-component-registry.d.js +2 -0
- package/lib/module/types/native-component-registry.d.js.map +1 -0
- package/lib/module/types/native.types.js +4 -0
- package/lib/module/types/native.types.js.map +1 -0
- package/lib/module/types/squircle.types.js +4 -0
- package/lib/module/types/squircle.types.js.map +1 -0
- package/lib/module/utils/index.js +4 -0
- package/lib/module/utils/index.js.map +1 -0
- package/lib/module/utils/style.utils.js +22 -0
- package/lib/module/utils/style.utils.js.map +1 -0
- package/lib/module/views/SquircleViewNativeComponent.ts +12 -0
- package/lib/module/views/index.js +15 -0
- package/lib/module/views/index.js.map +1 -0
- package/lib/typescript/package.json +1 -0
- package/lib/typescript/src/components/index.d.ts +2 -0
- package/lib/typescript/src/components/index.d.ts.map +1 -0
- package/lib/typescript/src/components/squircle-view.d.ts +5 -0
- package/lib/typescript/src/components/squircle-view.d.ts.map +1 -0
- package/lib/typescript/src/components/squircle-view.native.d.ts +5 -0
- package/lib/typescript/src/components/squircle-view.native.d.ts.map +1 -0
- package/lib/typescript/src/constants/index.d.ts +3 -0
- package/lib/typescript/src/constants/index.d.ts.map +1 -0
- package/lib/typescript/src/constants/native.constants.d.ts +8 -0
- package/lib/typescript/src/constants/native.constants.d.ts.map +1 -0
- package/lib/typescript/src/constants/squircle.constants.d.ts +3 -0
- package/lib/typescript/src/constants/squircle.constants.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +2 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/lib/typescript/src/interfaces/index.d.ts +3 -0
- package/lib/typescript/src/interfaces/index.d.ts.map +1 -0
- package/lib/typescript/src/interfaces/squircle-style.interface.d.ts +7 -0
- package/lib/typescript/src/interfaces/squircle-style.interface.d.ts.map +1 -0
- package/lib/typescript/src/interfaces/squircle-view.interface.d.ts +10 -0
- package/lib/typescript/src/interfaces/squircle-view.interface.d.ts.map +1 -0
- package/lib/typescript/src/root/index.d.ts +6 -0
- package/lib/typescript/src/root/index.d.ts.map +1 -0
- package/lib/typescript/src/types/index.d.ts +3 -0
- package/lib/typescript/src/types/index.d.ts.map +1 -0
- package/lib/typescript/src/types/native.types.d.ts +5 -0
- package/lib/typescript/src/types/native.types.d.ts.map +1 -0
- package/lib/typescript/src/types/squircle.types.d.ts +6 -0
- package/lib/typescript/src/types/squircle.types.d.ts.map +1 -0
- package/lib/typescript/src/utils/index.d.ts +2 -0
- package/lib/typescript/src/utils/index.d.ts.map +1 -0
- package/lib/typescript/src/utils/style.utils.d.ts +6 -0
- package/lib/typescript/src/utils/style.utils.d.ts.map +1 -0
- package/lib/typescript/src/views/SquircleViewNativeComponent.d.ts +8 -0
- package/lib/typescript/src/views/SquircleViewNativeComponent.d.ts.map +1 -0
- package/lib/typescript/src/views/index.d.ts +7 -0
- package/lib/typescript/src/views/index.d.ts.map +1 -0
- package/package.json +200 -4
- package/src/components/index.ts +1 -0
- package/src/components/squircle-view.native.tsx +34 -0
- package/src/components/squircle-view.tsx +24 -0
- package/src/constants/index.ts +2 -0
- package/src/constants/native.constants.ts +9 -0
- package/src/constants/squircle.constants.ts +3 -0
- package/src/index.ts +1 -0
- package/src/interfaces/index.ts +2 -0
- package/src/interfaces/squircle-style.interface.ts +8 -0
- package/src/interfaces/squircle-view.interface.ts +11 -0
- package/src/root/index.ts +5 -0
- package/src/types/index.ts +2 -0
- package/src/types/native-component-registry.d.ts +15 -0
- package/src/types/native.types.ts +8 -0
- package/src/types/squircle.types.ts +7 -0
- package/src/utils/index.ts +1 -0
- package/src/utils/style.utils.ts +17 -0
- package/src/views/SquircleViewNativeComponent.ts +12 -0
- package/src/views/index.ts +27 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../src","sources":["types/index.ts"],"mappings":";;AAAA,cAAc,mBAAgB;AAC9B,cAAc,qBAAkB","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../src","sources":["types/native-component-registry.d.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../src","sources":["types/native.types.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../src","sources":["types/squircle.types.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../src","sources":["utils/index.ts"],"mappings":";;AAAA,cAAc,kBAAe","ignoreList":[]}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { StyleSheet } from 'react-native';
|
|
4
|
+
const splitSquircleStyle = style => {
|
|
5
|
+
const flattened = StyleSheet.flatten(style);
|
|
6
|
+
if (flattened?.borderSmoothing === undefined) {
|
|
7
|
+
return {
|
|
8
|
+
style,
|
|
9
|
+
borderSmoothing: undefined
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
const {
|
|
13
|
+
borderSmoothing,
|
|
14
|
+
...viewStyle
|
|
15
|
+
} = flattened;
|
|
16
|
+
return {
|
|
17
|
+
style: viewStyle,
|
|
18
|
+
borderSmoothing
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
export { splitSquircleStyle };
|
|
22
|
+
//# sourceMappingURL=style.utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["StyleSheet","splitSquircleStyle","style","flattened","flatten","borderSmoothing","undefined","viewStyle"],"sourceRoot":"../../../src","sources":["utils/style.utils.ts"],"mappings":";;AAAA,SAASA,UAAU,QAAwB,cAAc;AAKzD,MAAMC,kBAAkB,GACtBC,KAAQ,IACW;EACnB,MAAMC,SAAS,GAAGH,UAAU,CAACI,OAAO,CAACF,KAAK,CAAC;EAC3C,IAAIC,SAAS,EAAEE,eAAe,KAAKC,SAAS,EAAE;IAC5C,OAAO;MAAEJ,KAAK;MAAEG,eAAe,EAAEC;IAAU,CAAC;EAC9C;EACA,MAAM;IAAED,eAAe;IAAE,GAAGE;EAAU,CAAC,GAAGJ,SAAS;EACnD,OAAO;IAAED,KAAK,EAAEK,SAAS;IAAEF;EAAgB,CAAC;AAC9C,CAAC;AAED,SAASJ,kBAAkB","ignoreList":[]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { CodegenTypes, HostComponent, ViewProps } from 'react-native';
|
|
2
|
+
import { codegenNativeComponent } from 'react-native';
|
|
3
|
+
|
|
4
|
+
interface INativeSquircleViewProps extends ViewProps {
|
|
5
|
+
borderSmoothing?: CodegenTypes.WithDefault<CodegenTypes.Float, 0>;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export type { INativeSquircleViewProps };
|
|
9
|
+
|
|
10
|
+
export default codegenNativeComponent<INativeSquircleViewProps>(
|
|
11
|
+
'SquircleView'
|
|
12
|
+
) as HostComponent<INativeSquircleViewProps>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
// Registers the codegen view config outside the spec module, so Fast Refresh can re-run this file without registering the view twice.
|
|
4
|
+
// eslint-disable-next-line @react-native/no-deep-imports
|
|
5
|
+
import { get } from 'react-native/Libraries/NativeComponent/NativeComponentRegistry';
|
|
6
|
+
import { NATIVE_VIEW_NAMES } from "../constants/index.js";
|
|
7
|
+
const registry = globalThis;
|
|
8
|
+
const NativeSquircleView = registry.__squircleViewNativeComponent ?? (registry.__squircleViewNativeComponent = get(NATIVE_VIEW_NAMES.SQUIRCLE_VIEW, () => ({
|
|
9
|
+
uiViewClassName: NATIVE_VIEW_NAMES.SQUIRCLE_VIEW,
|
|
10
|
+
validAttributes: {
|
|
11
|
+
borderSmoothing: true
|
|
12
|
+
}
|
|
13
|
+
})));
|
|
14
|
+
export { NativeSquircleView };
|
|
15
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["get","NATIVE_VIEW_NAMES","registry","globalThis","NativeSquircleView","__squircleViewNativeComponent","SQUIRCLE_VIEW","uiViewClassName","validAttributes","borderSmoothing"],"sourceRoot":"../../../src","sources":["views/index.ts"],"mappings":";;AACA;AACA;AACA,SAASA,GAAG,QAAQ,gEAAgE;AAEpF,SAASC,iBAAiB,QAAQ,uBAAc;AAKhD,MAAMC,QAAQ,GAAGC,UAEhB;AAED,MAAMC,kBAAuC,GAC3CF,QAAQ,CAACG,6BAA6B,KACrCH,QAAQ,CAACG,6BAA6B,GAAGL,GAAG,CAC3CC,iBAAiB,CAACK,aAAa,EAC/B,OAAO;EACLC,eAAe,EAAEN,iBAAiB,CAACK,aAAa;EAChDE,eAAe,EAAE;IAAEC,eAAe,EAAE;EAAK;AAC3C,CAAC,CACH,CAAC,CAAC;AAIJ,SAASL,kBAAkB","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"type":"module"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"squircle-view.d.ts","sourceRoot":"","sources":["../../../../src/components/squircle-view.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,OAAO,KAAK,EAAkB,kBAAkB,EAAE,MAAM,wBAAe,CAAC;AAIxE,QAAA,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAW9C,CAAC;AAIF,OAAO,EAAE,YAAY,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"squircle-view.native.d.ts","sourceRoot":"","sources":["../../../../src/components/squircle-view.native.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,OAAO,KAAK,EAAkB,kBAAkB,EAAE,MAAM,wBAAe,CAAC;AAIxE,QAAA,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAqB9C,CAAC;AAIF,OAAO,EAAE,YAAY,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/constants/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAoB,CAAC;AACnC,cAAc,yBAAsB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"native.constants.d.ts","sourceRoot":"","sources":["../../../../src/constants/native.constants.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,iBAAiB;;CAEoB,CAAC;AAE5C,QAAA,MAAM,eAAe;;CAEsB,CAAC;AAE5C,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"squircle.constants.d.ts","sourceRoot":"","sources":["../../../../src/constants/squircle.constants.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,wBAAwB,EAAE,MAAU,CAAC;AAE3C,OAAO,EAAE,wBAAwB,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAQ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/interfaces/index.ts"],"names":[],"mappings":"AAAA,cAAc,+BAA4B,CAAC;AAC3C,cAAc,8BAA2B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"squircle-style.interface.d.ts","sourceRoot":"","sources":["../../../../src/interfaces/squircle-style.interface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzD,UAAU,cAAc;IACtB,KAAK,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC5B,eAAe,EAAE,MAAM,GAAG,SAAS,CAAC;CACrC;AAED,YAAY,EAAE,cAAc,EAAE,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Ref } from 'react';
|
|
2
|
+
import type { HostInstance, StyleProp, ViewProps } from 'react-native';
|
|
3
|
+
import type { TSquircleViewStyle } from '../types/index.js';
|
|
4
|
+
interface ISquircleViewProps extends ViewProps {
|
|
5
|
+
style?: StyleProp<TSquircleViewStyle>;
|
|
6
|
+
borderSmoothing?: number;
|
|
7
|
+
ref?: Ref<HostInstance>;
|
|
8
|
+
}
|
|
9
|
+
export type { ISquircleViewProps };
|
|
10
|
+
//# sourceMappingURL=squircle-view.interface.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"squircle-view.interface.d.ts","sourceRoot":"","sources":["../../../../src/interfaces/squircle-view.interface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACvE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAU,CAAC;AAEnD,UAAU,kBAAmB,SAAQ,SAAS;IAC5C,KAAK,CAAC,EAAE,SAAS,CAAC,kBAAkB,CAAC,CAAC;IACtC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,GAAG,CAAC,EAAE,GAAG,CAAC,YAAY,CAAC,CAAC;CACzB;AAED,YAAY,EAAE,kBAAkB,EAAE,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { SquircleView } from '../components/index.js';
|
|
2
|
+
export type { ISquircleViewProps } from '../interfaces/index.js';
|
|
3
|
+
export type { TSquircleViewStyle } from '../types/index.js';
|
|
4
|
+
export type { ISquircleViewProps as SquircleViewProps } from '../interfaces/index.js';
|
|
5
|
+
export type { TSquircleViewStyle as SquircleViewStyle } from '../types/index.js';
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/root/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAe,CAAC;AAC7C,YAAY,EAAE,kBAAkB,EAAE,MAAM,wBAAe,CAAC;AACxD,YAAY,EAAE,kBAAkB,EAAE,MAAM,mBAAU,CAAC;AACnD,YAAY,EAAE,kBAAkB,IAAI,iBAAiB,EAAE,MAAM,wBAAe,CAAC;AAC7E,YAAY,EAAE,kBAAkB,IAAI,iBAAiB,EAAE,MAAM,mBAAU,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAgB,CAAC;AAC/B,cAAc,qBAAkB,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { COMPONENT_NAMES, NATIVE_VIEW_NAMES } from '../constants/index.js';
|
|
2
|
+
type TNativeViewName = (typeof NATIVE_VIEW_NAMES)[keyof typeof NATIVE_VIEW_NAMES];
|
|
3
|
+
type TComponentName = (typeof COMPONENT_NAMES)[keyof typeof COMPONENT_NAMES];
|
|
4
|
+
export type { TNativeViewName, TComponentName };
|
|
5
|
+
//# sourceMappingURL=native.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"native.types.d.ts","sourceRoot":"","sources":["../../../../src/types/native.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,uBAAc,CAAC;AAEvE,KAAK,eAAe,GAClB,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,OAAO,iBAAiB,CAAC,CAAC;AAE7D,KAAK,cAAc,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,OAAO,eAAe,CAAC,CAAC;AAE7E,YAAY,EAAE,eAAe,EAAE,cAAc,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"squircle.types.d.ts","sourceRoot":"","sources":["../../../../src/types/squircle.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9C,KAAK,kBAAkB,GAAG,SAAS,GAAG;IACpC,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B,CAAC;AAEF,YAAY,EAAE,kBAAkB,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAe,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type StyleProp } from 'react-native';
|
|
2
|
+
import type { ISquircleStyle } from '../interfaces/index.js';
|
|
3
|
+
import type { TSquircleViewStyle } from '../types/index.js';
|
|
4
|
+
declare const splitSquircleStyle: <T extends StyleProp<TSquircleViewStyle>>(style: T) => ISquircleStyle;
|
|
5
|
+
export { splitSquircleStyle };
|
|
6
|
+
//# sourceMappingURL=style.utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"style.utils.d.ts","sourceRoot":"","sources":["../../../../src/utils/style.utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAE1D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAe,CAAC;AACpD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAU,CAAC;AAEnD,QAAA,MAAM,kBAAkB,GAAI,CAAC,SAAS,SAAS,CAAC,kBAAkB,CAAC,EACjE,OAAO,CAAC,KACP,cAOF,CAAC;AAEF,OAAO,EAAE,kBAAkB,EAAE,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { CodegenTypes, HostComponent, ViewProps } from 'react-native';
|
|
2
|
+
interface INativeSquircleViewProps extends ViewProps {
|
|
3
|
+
borderSmoothing?: CodegenTypes.WithDefault<CodegenTypes.Float, 0>;
|
|
4
|
+
}
|
|
5
|
+
export type { INativeSquircleViewProps };
|
|
6
|
+
declare const _default: HostComponent<INativeSquircleViewProps>;
|
|
7
|
+
export default _default;
|
|
8
|
+
//# sourceMappingURL=SquircleViewNativeComponent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SquircleViewNativeComponent.d.ts","sourceRoot":"","sources":["../../../../src/views/SquircleViewNativeComponent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAG3E,UAAU,wBAAyB,SAAQ,SAAS;IAClD,eAAe,CAAC,EAAE,YAAY,CAAC,WAAW,CAAC,YAAY,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;CACnE;AAED,YAAY,EAAE,wBAAwB,EAAE,CAAC;wBAIpC,aAAa,CAAC,wBAAwB,CAAC;AAF5C,wBAE6C"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { HostComponent } from 'react-native';
|
|
2
|
+
import type { INativeSquircleViewProps } from './SquircleViewNativeComponent';
|
|
3
|
+
type TNativeSquircleView = HostComponent<INativeSquircleViewProps>;
|
|
4
|
+
declare const NativeSquircleView: TNativeSquircleView;
|
|
5
|
+
export type { INativeSquircleViewProps } from './SquircleViewNativeComponent';
|
|
6
|
+
export { NativeSquircleView };
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/views/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAMlD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAE9E,KAAK,mBAAmB,GAAG,aAAa,CAAC,wBAAwB,CAAC,CAAC;AAMnE,QAAA,MAAM,kBAAkB,EAAE,mBAQtB,CAAC;AAEL,YAAY,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAE9E,OAAO,EAAE,kBAAkB,EAAE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,202 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "squircle-view",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "A drop-in React Native View with smooth, continuous corners.",
|
|
5
|
+
"main": "./lib/module/index.js",
|
|
6
|
+
"types": "./lib/typescript/src/index.d.ts",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"squircle-view-source": "./src/index.ts",
|
|
10
|
+
"types": "./lib/typescript/src/index.d.ts",
|
|
11
|
+
"default": "./lib/module/index.js"
|
|
12
|
+
},
|
|
13
|
+
"./package.json": "./package.json"
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"src",
|
|
17
|
+
"lib",
|
|
18
|
+
"android",
|
|
19
|
+
"ios",
|
|
20
|
+
"common",
|
|
21
|
+
"*.podspec",
|
|
22
|
+
"react-native.config.js",
|
|
23
|
+
"!ios/build",
|
|
24
|
+
"!android/build",
|
|
25
|
+
"!android/gradle",
|
|
26
|
+
"!android/gradlew",
|
|
27
|
+
"!android/gradlew.bat",
|
|
28
|
+
"!android/local.properties",
|
|
29
|
+
"!**/__tests__",
|
|
30
|
+
"!**/__fixtures__",
|
|
31
|
+
"!**/__mocks__",
|
|
32
|
+
"!**/.*"
|
|
33
|
+
],
|
|
34
|
+
"scripts": {
|
|
35
|
+
"example": "yarn workspace squircle-view-example",
|
|
36
|
+
"clean": "del-cli lib",
|
|
37
|
+
"prepare": "bob build",
|
|
38
|
+
"typecheck": "tsc",
|
|
39
|
+
"lint": "eslint \"**/*.{js,ts,tsx}\"",
|
|
40
|
+
"test": "jest",
|
|
41
|
+
"test:native": "mkdir -p build && c++ -std=c++20 -Wall -Wextra -Werror -Icommon/cpp common/cpp/SquircleGeometry.cpp common/cpp/__tests__/SquircleGeometryTests.cpp -o build/squircle-geometry-tests && ./build/squircle-geometry-tests",
|
|
42
|
+
"release": "release-it --only-version",
|
|
43
|
+
"test:watch": "jest --watch"
|
|
44
|
+
},
|
|
45
|
+
"keywords": [
|
|
46
|
+
"react-native",
|
|
47
|
+
"ios",
|
|
48
|
+
"android",
|
|
49
|
+
"squircle",
|
|
50
|
+
"smooth-corners",
|
|
51
|
+
"continuous-corners",
|
|
52
|
+
"border-radius",
|
|
53
|
+
"view"
|
|
54
|
+
],
|
|
55
|
+
"repository": {
|
|
56
|
+
"type": "git",
|
|
57
|
+
"url": "git+https://github.com/rit3zh/squircle-view.git"
|
|
58
|
+
},
|
|
59
|
+
"author": "rit3zh <thisismyn07@gmail.com> (https://github.com/rit3zh)",
|
|
60
|
+
"license": "MIT",
|
|
61
|
+
"bugs": {
|
|
62
|
+
"url": "https://github.com/rit3zh/squircle-view/issues"
|
|
63
|
+
},
|
|
64
|
+
"homepage": "https://github.com/rit3zh/squircle-view#readme",
|
|
65
|
+
"publishConfig": {
|
|
66
|
+
"registry": "https://registry.npmjs.org/"
|
|
67
|
+
},
|
|
68
|
+
"devDependencies": {
|
|
69
|
+
"@commitlint/config-conventional": "^21.2.0",
|
|
70
|
+
"@eslint/compat": "^2.1.0",
|
|
71
|
+
"@eslint/eslintrc": "^3.3.6",
|
|
72
|
+
"@eslint/js": "^9.39.5",
|
|
73
|
+
"@jest/globals": "^29.7.0",
|
|
74
|
+
"@react-native/babel-preset": "0.86.2",
|
|
75
|
+
"@react-native/eslint-config": "0.86.2",
|
|
76
|
+
"@react-native/jest-preset": "0.86.2",
|
|
77
|
+
"@release-it/conventional-changelog": "^12.0.0",
|
|
78
|
+
"@testing-library/react-native": "^13",
|
|
79
|
+
"@types/react": "^19.2.0",
|
|
80
|
+
"@types/react-test-renderer": "^19",
|
|
81
|
+
"commitlint": "^21.2.1",
|
|
82
|
+
"del-cli": "^7.0.0",
|
|
83
|
+
"eslint": "^9.39.5",
|
|
84
|
+
"eslint-config-prettier": "^10.1.8",
|
|
85
|
+
"eslint-plugin-ft-flow": "^3.0.11",
|
|
86
|
+
"eslint-plugin-prettier": "^5.5.6",
|
|
87
|
+
"jest": "^29.7.0",
|
|
88
|
+
"lefthook": "^2.1.10",
|
|
89
|
+
"prettier": "^3.9.6",
|
|
90
|
+
"react": "19.2.3",
|
|
91
|
+
"react-native": "0.86.3",
|
|
92
|
+
"react-native-builder-bob": "^0.43.1",
|
|
93
|
+
"react-test-renderer": "19.2.3",
|
|
94
|
+
"release-it": "^21.0.1",
|
|
95
|
+
"turbo": "^2.10.8",
|
|
96
|
+
"typescript": "^6.0.3"
|
|
97
|
+
},
|
|
98
|
+
"peerDependencies": {
|
|
99
|
+
"react": "*",
|
|
100
|
+
"react-native": "*"
|
|
101
|
+
},
|
|
102
|
+
"workspaces": [
|
|
103
|
+
"example"
|
|
104
|
+
],
|
|
105
|
+
"packageManager": "yarn@4.11.0",
|
|
106
|
+
"react-native-builder-bob": {
|
|
107
|
+
"source": "src",
|
|
108
|
+
"output": "lib",
|
|
109
|
+
"targets": [
|
|
110
|
+
[
|
|
111
|
+
"module",
|
|
112
|
+
{
|
|
113
|
+
"esm": true
|
|
114
|
+
}
|
|
115
|
+
],
|
|
116
|
+
[
|
|
117
|
+
"typescript",
|
|
118
|
+
{
|
|
119
|
+
"project": "tsconfig.build.json"
|
|
120
|
+
}
|
|
121
|
+
]
|
|
122
|
+
]
|
|
123
|
+
},
|
|
124
|
+
"codegenConfig": {
|
|
125
|
+
"name": "SquircleViewSpec",
|
|
126
|
+
"type": "components",
|
|
127
|
+
"jsSrcsDir": "src/views",
|
|
128
|
+
"android": {
|
|
129
|
+
"javaPackageName": "com.squircleview"
|
|
130
|
+
},
|
|
131
|
+
"ios": {
|
|
132
|
+
"components": {
|
|
133
|
+
"SquircleView": {
|
|
134
|
+
"className": "SquircleView"
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
},
|
|
139
|
+
"prettier": {
|
|
140
|
+
"quoteProps": "consistent",
|
|
141
|
+
"singleQuote": true,
|
|
142
|
+
"tabWidth": 2,
|
|
143
|
+
"trailingComma": "es5",
|
|
144
|
+
"useTabs": false
|
|
145
|
+
},
|
|
146
|
+
"jest": {
|
|
147
|
+
"preset": "@react-native/jest-preset",
|
|
148
|
+
"testEnvironmentOptions": {
|
|
149
|
+
"customExportConditions": [
|
|
150
|
+
"require",
|
|
151
|
+
"react-native",
|
|
152
|
+
"squircle-view-source"
|
|
153
|
+
]
|
|
154
|
+
},
|
|
155
|
+
"transformIgnorePatterns": [
|
|
156
|
+
"node_modules/(?!((jest-)?react-native|@react-native(-community)?|@testing-library)/)"
|
|
157
|
+
],
|
|
158
|
+
"modulePathIgnorePatterns": [
|
|
159
|
+
"<rootDir>/example/node_modules",
|
|
160
|
+
"<rootDir>/lib/",
|
|
161
|
+
"<rootDir>/inspo/"
|
|
162
|
+
],
|
|
163
|
+
"testMatch": [
|
|
164
|
+
"<rootDir>/src/**/__tests__/**/*.test.ts?(x)"
|
|
165
|
+
]
|
|
166
|
+
},
|
|
167
|
+
"commitlint": {
|
|
168
|
+
"extends": [
|
|
169
|
+
"@commitlint/config-conventional"
|
|
170
|
+
]
|
|
171
|
+
},
|
|
172
|
+
"release-it": {
|
|
173
|
+
"git": {
|
|
174
|
+
"commitMessage": "chore: release ${version}",
|
|
175
|
+
"tagName": "v${version}"
|
|
176
|
+
},
|
|
177
|
+
"npm": {
|
|
178
|
+
"publish": true
|
|
179
|
+
},
|
|
180
|
+
"github": {
|
|
181
|
+
"release": true
|
|
182
|
+
},
|
|
183
|
+
"plugins": {
|
|
184
|
+
"@release-it/conventional-changelog": {
|
|
185
|
+
"preset": {
|
|
186
|
+
"name": "angular"
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
},
|
|
191
|
+
"create-react-native-library": {
|
|
192
|
+
"type": "fabric-view",
|
|
193
|
+
"languages": "kotlin-objc",
|
|
194
|
+
"tools": [
|
|
195
|
+
"eslint",
|
|
196
|
+
"jest",
|
|
197
|
+
"lefthook",
|
|
198
|
+
"release-it"
|
|
199
|
+
],
|
|
200
|
+
"version": "0.63.1"
|
|
201
|
+
}
|
|
202
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { SquircleView } from './squircle-view';
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { useMemo } from 'react';
|
|
3
|
+
|
|
4
|
+
import { COMPONENT_NAMES, DEFAULT_BORDER_SMOOTHING } from '../constants';
|
|
5
|
+
import type { ISquircleStyle, ISquircleViewProps } from '../interfaces';
|
|
6
|
+
import { splitSquircleStyle } from '../utils';
|
|
7
|
+
import { NativeSquircleView } from '../views';
|
|
8
|
+
|
|
9
|
+
const SquircleView: React.FC<ISquircleViewProps> = ({
|
|
10
|
+
style,
|
|
11
|
+
borderSmoothing,
|
|
12
|
+
...rest
|
|
13
|
+
}: ISquircleViewProps): React.JSX.Element => {
|
|
14
|
+
const squircleStyle = useMemo<ISquircleStyle>(
|
|
15
|
+
() => splitSquircleStyle(style),
|
|
16
|
+
[style]
|
|
17
|
+
);
|
|
18
|
+
|
|
19
|
+
return (
|
|
20
|
+
<NativeSquircleView
|
|
21
|
+
{...rest}
|
|
22
|
+
style={squircleStyle.style}
|
|
23
|
+
borderSmoothing={
|
|
24
|
+
squircleStyle.borderSmoothing ??
|
|
25
|
+
borderSmoothing ??
|
|
26
|
+
DEFAULT_BORDER_SMOOTHING
|
|
27
|
+
}
|
|
28
|
+
/>
|
|
29
|
+
);
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
SquircleView.displayName = COMPONENT_NAMES.SQUIRCLE_VIEW;
|
|
33
|
+
|
|
34
|
+
export { SquircleView };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { useMemo } from 'react';
|
|
3
|
+
import { View, type StyleProp } from 'react-native';
|
|
4
|
+
import { COMPONENT_NAMES } from '../constants';
|
|
5
|
+
import type { ISquircleStyle, ISquircleViewProps } from '../interfaces';
|
|
6
|
+
import { splitSquircleStyle } from '../utils';
|
|
7
|
+
import type { TSquircleViewStyle } from '../types';
|
|
8
|
+
|
|
9
|
+
const SquircleView: React.FC<ISquircleViewProps> = ({
|
|
10
|
+
style,
|
|
11
|
+
borderSmoothing: _borderSmoothing,
|
|
12
|
+
...rest
|
|
13
|
+
}: ISquircleViewProps): React.JSX.Element & React.ReactNode => {
|
|
14
|
+
const squircleStyle = useMemo<ISquircleStyle>(
|
|
15
|
+
() => splitSquircleStyle<StyleProp<TSquircleViewStyle>>(style),
|
|
16
|
+
[style]
|
|
17
|
+
);
|
|
18
|
+
|
|
19
|
+
return <View {...rest} style={squircleStyle.style} />;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
SquircleView.displayName = COMPONENT_NAMES.SQUIRCLE_VIEW;
|
|
23
|
+
|
|
24
|
+
export { SquircleView };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
const NATIVE_VIEW_NAMES = {
|
|
2
|
+
SQUIRCLE_VIEW: 'SquircleView',
|
|
3
|
+
} as const satisfies Record<string, string>;
|
|
4
|
+
|
|
5
|
+
const COMPONENT_NAMES = {
|
|
6
|
+
SQUIRCLE_VIEW: 'SquircleView',
|
|
7
|
+
} as const satisfies Record<string, string>;
|
|
8
|
+
|
|
9
|
+
export { NATIVE_VIEW_NAMES, COMPONENT_NAMES };
|
package/src/index.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './root';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Ref } from 'react';
|
|
2
|
+
import type { HostInstance, StyleProp, ViewProps } from 'react-native';
|
|
3
|
+
import type { TSquircleViewStyle } from '../types';
|
|
4
|
+
|
|
5
|
+
interface ISquircleViewProps extends ViewProps {
|
|
6
|
+
style?: StyleProp<TSquircleViewStyle>;
|
|
7
|
+
borderSmoothing?: number;
|
|
8
|
+
ref?: Ref<HostInstance>;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export type { ISquircleViewProps };
|