@cleartrip/ct-design-native-styles 4.0.0-SNAPSHOT-rnwcleanup.4
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/dist/ct-design-native-styles.browser.cjs.js +2 -0
- package/dist/ct-design-native-styles.browser.cjs.js.map +1 -0
- package/dist/ct-design-native-styles.browser.esm.js +2 -0
- package/dist/ct-design-native-styles.browser.esm.js.map +1 -0
- package/dist/ct-design-native-styles.cjs.js +10 -0
- package/dist/ct-design-native-styles.cjs.js.map +1 -0
- package/dist/ct-design-native-styles.esm.js +6 -0
- package/dist/ct-design-native-styles.esm.js.map +1 -0
- package/dist/ct-design-native-styles.umd.js +16 -0
- package/dist/ct-design-native-styles.umd.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/package.json +37 -0
- package/src/index.native.ts +1 -0
- package/src/index.ts +7 -0
- package/src/mergeNativeStyles.native.ts +11 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ct-design-native-styles.browser.cjs.js","sources":["../packages/utils/native-styles/src/index.ts"],"sourcesContent":[null],"names":["_styles"],"mappings":"oFAIwB,SAAkBA,GAE1C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ct-design-native-styles.browser.esm.js","sources":["../packages/utils/native-styles/src/index.ts"],"sourcesContent":[null],"names":["mergeNativeStyles","_styles"],"mappings":"AAIwB,SAAAA,EAAkBC,GAE1C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ct-design-native-styles.cjs.js","sources":["../packages/utils/native-styles/src/index.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;AAIwB,SAAA,iBAAiB,CAAC,OAAkB,EAAA;AAC1D,IAAA,OAAO,SAAS,CAAC;AACnB;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ct-design-native-styles.esm.js","sources":["../packages/utils/native-styles/src/index.ts"],"sourcesContent":[null],"names":[],"mappings":"AAIwB,SAAA,iBAAiB,CAAC,OAAkB,EAAA;AAC1D,IAAA,OAAO,SAAS,CAAC;AACnB;;;;"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
(function (global, factory) {
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define(['exports'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.CTDesignNativeStyles = {}));
|
|
5
|
+
})(this, (function (exports) { 'use strict';
|
|
6
|
+
|
|
7
|
+
function mergeNativeStyles(_styles) {
|
|
8
|
+
return undefined;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
exports.default = mergeNativeStyles;
|
|
12
|
+
|
|
13
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
14
|
+
|
|
15
|
+
}));
|
|
16
|
+
//# sourceMappingURL=ct-design-native-styles.umd.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ct-design-native-styles.umd.js","sources":["../packages/utils/native-styles/src/index.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;IAIwB,SAAA,iBAAiB,CAAC,OAAkB,EAAA;IAC1D,IAAA,OAAO,SAAS,CAAC;IACnB;;;;;;;;;;"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../packages/utils/native-styles/src/index.ts"],"names":[],"mappings":"AAIA,MAAM,CAAC,OAAO,UAAU,iBAAiB,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,SAAS,CAEvE"}
|
package/package.json
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@cleartrip/ct-design-native-styles",
|
|
3
|
+
"version": "4.0.0-SNAPSHOT-rnwcleanup.4",
|
|
4
|
+
"description": "Shared React Native style merge (StyleSheet.flatten). Per-component style helpers live next to each component (e.g. Container ./style.ts on web).",
|
|
5
|
+
"types": "dist/index.d.ts",
|
|
6
|
+
"main": "dist/ct-design-native-styles.cjs.js",
|
|
7
|
+
"jsnext:main": "dist/ct-design-native-styles.esm.js",
|
|
8
|
+
"module": "dist/ct-design-native-styles.esm.js",
|
|
9
|
+
"react-native": "src/index.native.ts",
|
|
10
|
+
"sideEffects": false,
|
|
11
|
+
"browser": {
|
|
12
|
+
"./dist/ct-design-native-styles.esm.js": "./dist/ct-design-native-styles.browser.esm.js",
|
|
13
|
+
"./dist/ct-design-native-styles.cjs.js": "./dist/ct-design-native-styles.browser.cjs.js"
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"dist",
|
|
17
|
+
"src"
|
|
18
|
+
],
|
|
19
|
+
"peerDependencies": {
|
|
20
|
+
"react-native": ">=0.71.0"
|
|
21
|
+
},
|
|
22
|
+
"peerDependenciesMeta": {
|
|
23
|
+
"react-native": {
|
|
24
|
+
"optional": true
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
"publishConfig": {
|
|
28
|
+
"access": "public"
|
|
29
|
+
},
|
|
30
|
+
"author": "Cleartrip",
|
|
31
|
+
"license": "ISC",
|
|
32
|
+
"scripts": {
|
|
33
|
+
"watch-package": "rollup -c -w",
|
|
34
|
+
"build-package": "rollup -c",
|
|
35
|
+
"build-package:clean": "rm -rf dist && rollup -c"
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './mergeNativeStyles.native';
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { StyleSheet, type StyleProp, type ViewStyle } from 'react-native';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Merges an array of React Native styles into a single style using StyleSheet.flatten.
|
|
5
|
+
* Use with useMemo when styles depend on props/state.
|
|
6
|
+
*/
|
|
7
|
+
export default function mergeNativeStyles(styles: StyleProp<ViewStyle>[]): ViewStyle | undefined {
|
|
8
|
+
const flattened = styles.flat().filter((s): s is ViewStyle => s != null && typeof s === 'object');
|
|
9
|
+
if (flattened.length === 0) return undefined;
|
|
10
|
+
return StyleSheet.flatten(flattened) as ViewStyle;
|
|
11
|
+
}
|