@htyf-mp/taro-rn-style-transformer 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. package/README.md +174 -0
  2. package/dist/config/rn-stylelint.json +4 -0
  3. package/dist/index.d.ts +8 -0
  4. package/dist/index.js +86 -0
  5. package/dist/index.js.map +1 -0
  6. package/dist/transforms/StyleSheet/ColorPropType.d.ts +10 -0
  7. package/dist/transforms/StyleSheet/ColorPropType.js +76 -0
  8. package/dist/transforms/StyleSheet/ColorPropType.js.map +1 -0
  9. package/dist/transforms/StyleSheet/ImageResizeMode.d.ts +6 -0
  10. package/dist/transforms/StyleSheet/ImageResizeMode.js +54 -0
  11. package/dist/transforms/StyleSheet/ImageResizeMode.js.map +1 -0
  12. package/dist/transforms/StyleSheet/ImageStylePropTypes.d.ts +106 -0
  13. package/dist/transforms/StyleSheet/ImageStylePropTypes.js +81 -0
  14. package/dist/transforms/StyleSheet/ImageStylePropTypes.js.map +1 -0
  15. package/dist/transforms/StyleSheet/LayoutPropTypes.d.ts +399 -0
  16. package/dist/transforms/StyleSheet/LayoutPropTypes.js +566 -0
  17. package/dist/transforms/StyleSheet/LayoutPropTypes.js.map +1 -0
  18. package/dist/transforms/StyleSheet/ShadowPropTypesIOS.d.ts +32 -0
  19. package/dist/transforms/StyleSheet/ShadowPropTypesIOS.js +86 -0
  20. package/dist/transforms/StyleSheet/ShadowPropTypesIOS.js.map +1 -0
  21. package/dist/transforms/StyleSheet/StyleSheetValidation.d.ts +15 -0
  22. package/dist/transforms/StyleSheet/StyleSheetValidation.js +71 -0
  23. package/dist/transforms/StyleSheet/StyleSheetValidation.js.map +1 -0
  24. package/dist/transforms/StyleSheet/TextStylePropTypes.d.ts +154 -0
  25. package/dist/transforms/StyleSheet/TextStylePropTypes.js +127 -0
  26. package/dist/transforms/StyleSheet/TextStylePropTypes.js.map +1 -0
  27. package/dist/transforms/StyleSheet/TransformPropTypes.d.ts +45 -0
  28. package/dist/transforms/StyleSheet/TransformPropTypes.js +129 -0
  29. package/dist/transforms/StyleSheet/TransformPropTypes.js.map +1 -0
  30. package/dist/transforms/StyleSheet/ViewStylePropTypes.d.ts +126 -0
  31. package/dist/transforms/StyleSheet/ViewStylePropTypes.js +72 -0
  32. package/dist/transforms/StyleSheet/ViewStylePropTypes.js.map +1 -0
  33. package/dist/transforms/StyleSheet/deprecatedPropType.d.ts +13 -0
  34. package/dist/transforms/StyleSheet/deprecatedPropType.js +32 -0
  35. package/dist/transforms/StyleSheet/deprecatedPropType.js.map +1 -0
  36. package/dist/transforms/StyleSheet/index.d.ts +2 -0
  37. package/dist/transforms/StyleSheet/index.js +9 -0
  38. package/dist/transforms/StyleSheet/index.js.map +1 -0
  39. package/dist/transforms/StyleSheet/normalizeColor.d.ts +10 -0
  40. package/dist/transforms/StyleSheet/normalizeColor.js +341 -0
  41. package/dist/transforms/StyleSheet/normalizeColor.js.map +1 -0
  42. package/dist/transforms/index.d.ts +56 -0
  43. package/dist/transforms/index.js +221 -0
  44. package/dist/transforms/index.js.map +1 -0
  45. package/dist/transforms/less.d.ts +2 -0
  46. package/dist/transforms/less.js +70 -0
  47. package/dist/transforms/less.js.map +1 -0
  48. package/dist/transforms/postcss.d.ts +13 -0
  49. package/dist/transforms/postcss.js +135 -0
  50. package/dist/transforms/postcss.js.map +1 -0
  51. package/dist/transforms/sass.d.ts +2 -0
  52. package/dist/transforms/sass.js +162 -0
  53. package/dist/transforms/sass.js.map +1 -0
  54. package/dist/transforms/stylus.d.ts +3 -0
  55. package/dist/transforms/stylus.js +110 -0
  56. package/dist/transforms/stylus.js.map +1 -0
  57. package/dist/types/index.d.ts +205 -0
  58. package/dist/types/index.js +6 -0
  59. package/dist/types/index.js.map +1 -0
  60. package/dist/utils/index.d.ts +21 -0
  61. package/dist/utils/index.js +240 -0
  62. package/dist/utils/index.js.map +1 -0
  63. package/dist/utils/lessImport.d.ts +5 -0
  64. package/dist/utils/lessImport.js +45 -0
  65. package/dist/utils/lessImport.js.map +1 -0
  66. package/dist/utils/reporterSkip.d.ts +7 -0
  67. package/dist/utils/reporterSkip.js +27 -0
  68. package/dist/utils/reporterSkip.js.map +1 -0
  69. package/package.json +56 -0
@@ -0,0 +1,86 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ var __importDefault = (this && this.__importDefault) || function (mod) {
36
+ return (mod && mod.__esModule) ? mod : { "default": mod };
37
+ };
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ /**
40
+ * Copyright (c) 2015-present, Facebook, Inc.
41
+ *
42
+ * This source code is licensed under the MIT license found in the
43
+ * LICENSE file in the root directory of this source tree.
44
+ *
45
+ *
46
+ * @format
47
+ */
48
+ // @ts-ignore
49
+ const ReactPropTypes = __importStar(require("prop-types"));
50
+ const ColorPropType_1 = __importDefault(require("./ColorPropType"));
51
+ /**
52
+ * These props can be used to dynamically generate shadows on views, images, text, etc.
53
+ *
54
+ * Because they are dynamically generated, they may cause performance regressions. Static
55
+ * shadow image asset may be a better way to go for optimal performance.
56
+ *
57
+ * These properties are iOS only - for similar functionality on Android, use the [`elevation`
58
+ * property](docs/viewstyleproptypes.html#elevation).
59
+ */
60
+ const ShadowPropTypesIOS = {
61
+ /**
62
+ * Sets the drop shadow color
63
+ * @platform ios
64
+ */
65
+ shadowColor: ColorPropType_1.default,
66
+ /**
67
+ * Sets the drop shadow offset
68
+ * @platform ios
69
+ */
70
+ shadowOffset: ReactPropTypes.shape({
71
+ width: ReactPropTypes.number,
72
+ height: ReactPropTypes.number
73
+ }),
74
+ /**
75
+ * Sets the drop shadow opacity (multiplied by the color's alpha component)
76
+ * @platform ios
77
+ */
78
+ shadowOpacity: ReactPropTypes.number,
79
+ /**
80
+ * Sets the drop shadow blur radius
81
+ * @platform ios
82
+ */
83
+ shadowRadius: ReactPropTypes.number
84
+ };
85
+ exports.default = ShadowPropTypesIOS;
86
+ //# sourceMappingURL=ShadowPropTypesIOS.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ShadowPropTypesIOS.js","sourceRoot":"","sources":["../../../src/transforms/StyleSheet/ShadowPropTypesIOS.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;GAQG;AACH,aAAa;AACb,MAAY,cAAc,uCAAkB;AAE5C,oEAA2C;AAE3C;;;;;;;;GAQG;AACH,MAAM,kBAAkB,GAAG;IACzB;;;OAGG;IACH,WAAW,EAAE,uBAAa;IAC1B;;;OAGG;IACH,YAAY,EAAE,cAAc,CAAC,KAAK,CAAC;QACjC,KAAK,EAAE,cAAc,CAAC,MAAM;QAC5B,MAAM,EAAE,cAAc,CAAC,MAAM;KAC9B,CAAC;IACF;;;OAGG;IACH,aAAa,EAAE,cAAc,CAAC,MAAM;IACpC;;;OAGG;IACH,YAAY,EAAE,cAAc,CAAC,MAAM;CACpC,CAAA;kBAEc,kBAAkB"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Copyright (c) 2015-present, Facebook, Inc.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ * @format
8
+ *
9
+ */
10
+ declare class StyleSheetValidation {
11
+ static validateStyleProp(prop: any, style: any, caller: any): void;
12
+ static validateStyle(name: any, styles: any): void;
13
+ static addValidStylePropTypes(stylePropTypes: any): void;
14
+ }
15
+ export default StyleSheetValidation;
@@ -0,0 +1,71 @@
1
+ "use strict";
2
+ /**
3
+ * Copyright (c) 2015-present, Facebook, Inc.
4
+ *
5
+ * This source code is licensed under the MIT license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ *
8
+ * @format
9
+ *
10
+ */
11
+ var __importDefault = (this && this.__importDefault) || function (mod) {
12
+ return (mod && mod.__esModule) ? mod : { "default": mod };
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ // @ts-ignore
16
+ const invariant_1 = __importDefault(require("fbjs/lib/invariant"));
17
+ const ImageStylePropTypes_1 = __importDefault(require("./ImageStylePropTypes"));
18
+ const TextStylePropTypes_1 = __importDefault(require("./TextStylePropTypes"));
19
+ const ViewStylePropTypes_1 = __importDefault(require("./ViewStylePropTypes"));
20
+ // Hardcoded because this is a legit case but we don't want to load it from
21
+ // a private API. We might likely want to unify style sheet creation with how it
22
+ // is done in the DOM so this might move into React. I know what I'm doing so
23
+ // plz don't fire me.
24
+ const ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
25
+ class StyleSheetValidation {
26
+ // @ts-ignore
27
+ static validateStyleProp(prop, style, caller) {
28
+ // @ts-ignore
29
+ if (allStylePropTypes[prop] === undefined) {
30
+ const message1 = '"' + prop + '" 不是一个有效的 React Native 样式属性';
31
+ // const message2 =
32
+ // '\nValid style props: ' +
33
+ // JSON.stringify(Object.keys(allStylePropTypes).sort(), null, ' ')
34
+ // styleError(message1, style, caller, message2)
35
+ styleError(message1, style, caller);
36
+ }
37
+ // @ts-ignore
38
+ const error = allStylePropTypes[prop](style, prop, caller, 'prop', null, ReactPropTypesSecret);
39
+ if (error) {
40
+ styleError(error.message, style, caller);
41
+ }
42
+ }
43
+ // @ts-ignore
44
+ static validateStyle(name, styles) {
45
+ for (const prop in styles[name]) {
46
+ StyleSheetValidation.validateStyleProp(prop, styles[name], 'StyleSheet ' + name);
47
+ }
48
+ }
49
+ // @ts-ignore
50
+ static addValidStylePropTypes(stylePropTypes) {
51
+ for (const key in stylePropTypes) {
52
+ // @ts-ignore
53
+ allStylePropTypes[key] = stylePropTypes[key];
54
+ }
55
+ }
56
+ }
57
+ // @ts-ignore
58
+ const styleError = function (message1, style, caller, message2) {
59
+ (0, invariant_1.default)(false, message1 +
60
+ '\n' +
61
+ (caller || '<<unknown>>') +
62
+ ': ' +
63
+ JSON.stringify(style, null, ' ') +
64
+ (message2 || ''));
65
+ };
66
+ const allStylePropTypes = {};
67
+ StyleSheetValidation.addValidStylePropTypes(ImageStylePropTypes_1.default);
68
+ StyleSheetValidation.addValidStylePropTypes(TextStylePropTypes_1.default);
69
+ StyleSheetValidation.addValidStylePropTypes(ViewStylePropTypes_1.default);
70
+ exports.default = StyleSheetValidation;
71
+ //# sourceMappingURL=StyleSheetValidation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StyleSheetValidation.js","sourceRoot":"","sources":["../../../src/transforms/StyleSheet/StyleSheetValidation.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;;;;;AAEH,aAAa;AACb,mEAA0C;AAE1C,gFAAuD;AACvD,8EAAqD;AACrD,8EAAqD;AAErD,2EAA2E;AAC3E,gFAAgF;AAChF,6EAA6E;AAC7E,qBAAqB;AACr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BAAS,EACP,KAAK,EACL,QAAQ;QACR,IAAI;QACJ,CAAC,MAAM,IAAI,aAAa,CAAC;QACzB,IAAI;QACJ,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,IAAI,EAAE,IAAI,CAAC;QACjC,CAAC,QAAQ,IAAI,EAAE,CAAC,CACjB,CAAA;AACH,CAAC,CAAA;AAED,MAAM,iBAAiB,GAAG,EAAE,CAAA;AAE5B,oBAAoB,CAAC,sBAAsB,CAAC,6BAAmB,CAAC,CAAA;AAChE,oBAAoB,CAAC,sBAAsB,CAAC,4BAAkB,CAAC,CAAA;AAC/D,oBAAoB,CAAC,sBAAsB,CAAC,4BAAkB,CAAC,CAAA;kBAEhD,oBAAoB"}
@@ -0,0 +1,154 @@
1
+ /**
2
+ * Copyright (c) 2015-present, Facebook, Inc.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ * @format
8
+ *
9
+ */
10
+ declare const TextStylePropTypes: {
11
+ display: any;
12
+ width: any;
13
+ height: any;
14
+ start: any;
15
+ end: any;
16
+ top: any;
17
+ left: any;
18
+ right: any;
19
+ bottom: any;
20
+ minWidth: any;
21
+ maxWidth: any;
22
+ minHeight: any;
23
+ maxHeight: any;
24
+ margin: any;
25
+ marginVertical: any;
26
+ marginHorizontal: any;
27
+ marginTop: any;
28
+ marginBottom: any;
29
+ marginLeft: any;
30
+ marginRight: any;
31
+ marginStart: any;
32
+ marginEnd: any;
33
+ padding: any;
34
+ paddingVertical: any;
35
+ paddingHorizontal: any;
36
+ paddingTop: any;
37
+ paddingBottom: any;
38
+ paddingLeft: any;
39
+ paddingRight: any;
40
+ paddingStart: any;
41
+ paddingEnd: any;
42
+ borderStartWidth: any;
43
+ borderEndWidth: any;
44
+ position: any;
45
+ flexDirection: any;
46
+ flexWrap: any;
47
+ justifyContent: any;
48
+ alignItems: any;
49
+ alignSelf: any;
50
+ alignContent: any;
51
+ overflow: any;
52
+ flex: any;
53
+ flexGrow: any;
54
+ flexShrink: any;
55
+ flexBasis: any;
56
+ aspectRatio: any;
57
+ zIndex: any;
58
+ direction: any;
59
+ rowGap: any;
60
+ columnGap: any;
61
+ gap: any;
62
+ shadowColor: (props: any, propName: any, componentName: any, location: any, propFullName: any) => Error | undefined;
63
+ shadowOffset: any;
64
+ shadowOpacity: any;
65
+ shadowRadius: any;
66
+ transform: any;
67
+ transformOrigin: any;
68
+ transformMatrix: (props: any, propName: any, _componentName: any) => Error | undefined;
69
+ decomposedMatrix: (props: any, propName: any, _componentName: any) => Error | undefined;
70
+ scaleX: (props: any, propName: any, componentName: any, ...rest: any[]) => any;
71
+ scaleY: (props: any, propName: any, componentName: any, ...rest: any[]) => any;
72
+ rotation: (props: any, propName: any, componentName: any, ...rest: any[]) => any;
73
+ translateX: (props: any, propName: any, componentName: any, ...rest: any[]) => any;
74
+ translateY: (props: any, propName: any, componentName: any, ...rest: any[]) => any;
75
+ backfaceVisibility: any;
76
+ backgroundColor: (props: any, propName: any, componentName: any, location: any, propFullName: any) => Error | undefined;
77
+ borderColor: (props: any, propName: any, componentName: any, location: any, propFullName: any) => Error | undefined;
78
+ borderBlockColor: (props: any, propName: any, componentName: any, location: any, propFullName: any) => Error | undefined;
79
+ borderBlockStartColor: (props: any, propName: any, componentName: any, location: any, propFullName: any) => Error | undefined;
80
+ borderBlockEndColor: (props: any, propName: any, componentName: any, location: any, propFullName: any) => Error | undefined;
81
+ borderTopColor: (props: any, propName: any, componentName: any, location: any, propFullName: any) => Error | undefined;
82
+ borderRightColor: (props: any, propName: any, componentName: any, location: any, propFullName: any) => Error | undefined;
83
+ borderBottomColor: (props: any, propName: any, componentName: any, location: any, propFullName: any) => Error | undefined;
84
+ borderLeftColor: (props: any, propName: any, componentName: any, location: any, propFullName: any) => Error | undefined;
85
+ borderStartColor: (props: any, propName: any, componentName: any, location: any, propFullName: any) => Error | undefined;
86
+ borderEndColor: (props: any, propName: any, componentName: any, location: any, propFullName: any) => Error | undefined;
87
+ borderRadius: any;
88
+ borderTopLeftRadius: any;
89
+ borderTopRightRadius: any;
90
+ borderTopStartRadius: any;
91
+ borderTopEndRadius: any;
92
+ borderBottomLeftRadius: any;
93
+ borderBottomRightRadius: any;
94
+ borderBottomStartRadius: any;
95
+ borderBottomEndRadius: any;
96
+ borderStartStartRadius: any;
97
+ borderStartEndRadius: any;
98
+ borderEndStartRadius: any;
99
+ borderEndEndRadius: any;
100
+ borderStyle: any;
101
+ borderWidth: any;
102
+ borderTopWidth: any;
103
+ borderRightWidth: any;
104
+ borderBottomWidth: any;
105
+ borderLeftWidth: any;
106
+ opacity: any;
107
+ pointerEvents: any;
108
+ cursor: any;
109
+ elevation: any;
110
+ borderCurve: any;
111
+ color: (props: any, propName: any, componentName: any, location: any, propFullName: any) => Error | undefined;
112
+ fontFamily: any;
113
+ fontSize: any;
114
+ fontStyle: any;
115
+ /**
116
+ * Specifies font weight. The values 'normal' and 'bold' are supported for
117
+ * most fonts. Not all fonts have a variant for each of the numeric values,
118
+ * in that case the closest one is chosen.
119
+ */
120
+ fontWeight: any;
121
+ textShadowOffset: any;
122
+ textShadowRadius: any;
123
+ textShadowColor: (props: any, propName: any, componentName: any, location: any, propFullName: any) => Error | undefined;
124
+ letterSpacing: any;
125
+ lineHeight: any;
126
+ /**
127
+ * Specifies text alignment. The value 'justify' is only supported on iOS and
128
+ * fallbacks to `left` on Android.
129
+ */
130
+ textAlign: any;
131
+ textDecorationLine: any;
132
+ textTransform: any;
133
+ userSelect: any;
134
+ /**
135
+ * @platform ios
136
+ */
137
+ fontVariant: any;
138
+ textDecorationColor: (props: any, propName: any, componentName: any, location: any, propFullName: any) => Error | undefined;
139
+ textDecorationStyle: any;
140
+ writingDirection: any;
141
+ /**
142
+ * @platform android
143
+ */
144
+ textAlignVertical: any;
145
+ verticalAlign: any;
146
+ /**
147
+ * Set to `false` to remove extra font padding intended to make space for certain ascenders / descenders.
148
+ * With some fonts, this padding can make text look slightly misaligned when centered vertically.
149
+ * For best results also set `textAlignVertical` to `center`. Default is true.
150
+ * @platform android
151
+ */
152
+ includeFontPadding: any;
153
+ };
154
+ export default TextStylePropTypes;
@@ -0,0 +1,127 @@
1
+ /**
2
+ * Copyright (c) 2015-present, Facebook, Inc.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ * @format
8
+ *
9
+ */
10
+ 'use strict';
11
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
12
+ if (k2 === undefined) k2 = k;
13
+ var desc = Object.getOwnPropertyDescriptor(m, k);
14
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
15
+ desc = { enumerable: true, get: function() { return m[k]; } };
16
+ }
17
+ Object.defineProperty(o, k2, desc);
18
+ }) : (function(o, m, k, k2) {
19
+ if (k2 === undefined) k2 = k;
20
+ o[k2] = m[k];
21
+ }));
22
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
23
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
24
+ }) : function(o, v) {
25
+ o["default"] = v;
26
+ });
27
+ var __importStar = (this && this.__importStar) || (function () {
28
+ var ownKeys = function(o) {
29
+ ownKeys = Object.getOwnPropertyNames || function (o) {
30
+ var ar = [];
31
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
32
+ return ar;
33
+ };
34
+ return ownKeys(o);
35
+ };
36
+ return function (mod) {
37
+ if (mod && mod.__esModule) return mod;
38
+ var result = {};
39
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
40
+ __setModuleDefault(result, mod);
41
+ return result;
42
+ };
43
+ })();
44
+ var __importDefault = (this && this.__importDefault) || function (mod) {
45
+ return (mod && mod.__esModule) ? mod : { "default": mod };
46
+ };
47
+ Object.defineProperty(exports, "__esModule", { value: true });
48
+ // @ts-ignore
49
+ const ReactPropTypes = __importStar(require("prop-types"));
50
+ const ColorPropType_1 = __importDefault(require("./ColorPropType"));
51
+ const ViewStylePropTypes_1 = __importDefault(require("./ViewStylePropTypes"));
52
+ const TextStylePropTypes = Object.assign(Object.assign({}, ViewStylePropTypes_1.default), { color: ColorPropType_1.default, fontFamily: ReactPropTypes.string, fontSize: ReactPropTypes.number, fontStyle: ReactPropTypes.oneOf(['normal', 'italic']),
53
+ /**
54
+ * Specifies font weight. The values 'normal' and 'bold' are supported for
55
+ * most fonts. Not all fonts have a variant for each of the numeric values,
56
+ * in that case the closest one is chosen.
57
+ */
58
+ fontWeight: ReactPropTypes.oneOf([
59
+ 'normal' /* default */,
60
+ 'bold',
61
+ '100',
62
+ '200',
63
+ '300',
64
+ '400',
65
+ '500',
66
+ '600',
67
+ '700',
68
+ '800',
69
+ '900',
70
+ 'ultralight',
71
+ 'thin',
72
+ 'light',
73
+ 'medium',
74
+ 'regular',
75
+ 'semibold',
76
+ 'condensedBold',
77
+ 'condensed',
78
+ 'heavy',
79
+ 'black'
80
+ ]), textShadowOffset: ReactPropTypes.shape({
81
+ width: ReactPropTypes.number,
82
+ height: ReactPropTypes.number
83
+ }), textShadowRadius: ReactPropTypes.number, textShadowColor: ColorPropType_1.default, letterSpacing: ReactPropTypes.number, lineHeight: ReactPropTypes.number,
84
+ /**
85
+ * Specifies text alignment. The value 'justify' is only supported on iOS and
86
+ * fallbacks to `left` on Android.
87
+ */
88
+ textAlign: ReactPropTypes.oneOf([
89
+ 'auto',
90
+ 'left',
91
+ 'right',
92
+ 'center',
93
+ 'justify'
94
+ ]), textDecorationLine: ReactPropTypes.oneOf([
95
+ 'none',
96
+ 'underline',
97
+ 'line-through',
98
+ 'underline line-through'
99
+ ]), textTransform: ReactPropTypes.oneOf(['none', 'capitalize', 'uppercase', 'lowercase']), userSelect: ReactPropTypes.oneOf(['auto', 'none', 'text', 'contain', 'all']),
100
+ /**
101
+ * @platform ios
102
+ */
103
+ fontVariant: ReactPropTypes.arrayOf(ReactPropTypes.oneOf([
104
+ 'small-caps',
105
+ 'oldstyle-nums',
106
+ 'lining-nums',
107
+ 'tabular-nums',
108
+ 'proportional-nums'
109
+ ])), textDecorationColor: ColorPropType_1.default, textDecorationStyle: ReactPropTypes.oneOf([
110
+ 'solid' /* default */,
111
+ 'double',
112
+ 'dotted',
113
+ 'dashed'
114
+ ]), writingDirection: ReactPropTypes.oneOf(['auto' /* default */, 'ltr', 'rtl']),
115
+ /**
116
+ * @platform android
117
+ */
118
+ textAlignVertical: ReactPropTypes.oneOf(['auto', 'top', 'bottom', 'center']), verticalAlign: ReactPropTypes.oneOf(['auto', 'top', 'bottom', 'middle']),
119
+ /**
120
+ * Set to `false` to remove extra font padding intended to make space for certain ascenders / descenders.
121
+ * With some fonts, this padding can make text look slightly misaligned when centered vertically.
122
+ * For best results also set `textAlignVertical` to `center`. Default is true.
123
+ * @platform android
124
+ */
125
+ includeFontPadding: ReactPropTypes.bool });
126
+ exports.default = TextStylePropTypes;
127
+ //# sourceMappingURL=TextStylePropTypes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TextStylePropTypes.js","sourceRoot":"","sources":["../../../src/transforms/StyleSheet/TextStylePropTypes.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,YAAY,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEZ,aAAa;AACb,MAAY,cAAc,uCAAkB;AAE5C,oEAA2C;AAC3C,8EAAqD;AAErD,MAAM,kBAAkB,mCACnB,4BAAkB,KAErB,KAAK,EAAE,uBAAa,EACpB,UAAU,EAAE,cAAc,CAAC,MAAM,EACjC,QAAQ,EAAE,cAAc,CAAC,MAAM,EAC/B,SAAS,EAAE,cAAc,CAAC,KAAK,CAAC,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;IACrD;;;;OAIG;IACH,UAAU,EAAE,cAAc,CAAC,KAAK,CAAC;QAC/B,QAAQ,CAAC,aAAa;QACtB,MAAM;QACN,KAAK;QACL,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c,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,aAAa,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;IAE5E;;OAEG;IACH,iBAAiB,EAAE,cAAc,CAAC,KAAK,CAAC,CAAC,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC,EAC5E,aAAa,EAAE,cAAc,CAAC,KAAK,CAAC,CAAC,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC;IACxE;;;;;OAKG;IACH,kBAAkB,EAAE,cAAc,CAAC,IAAI,GACxC,CAAA;kBAEc,kBAAkB"}
@@ -0,0 +1,45 @@
1
+ /**
2
+ * Copyright (c) 2015-present, Facebook, Inc.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ * @format
8
+ *
9
+ */
10
+ declare const TransformMatrixPropType: (props: any, propName: any, _componentName: any) => Error | undefined;
11
+ declare const DecomposedMatrixPropType: (props: any, propName: any, _componentName: any) => Error | undefined;
12
+ declare const TransformPropTypes: {
13
+ /**
14
+ * `transform` accepts an array of transformation objects. Each object specifies
15
+ * the property that will be transformed as the key, and the value to use in the
16
+ * transformation. Objects should not be combined. Use a single key/value pair
17
+ * per object.
18
+ *
19
+ * The rotate transformations require a string so that the transform may be
20
+ * expressed in degrees (deg) or radians (rad). For example:
21
+ *
22
+ * `transform([{ rotateX: '45deg' }, { rotateZ: '0.785398rad' }])`
23
+ *
24
+ * The skew transformations require a string so that the transform may be
25
+ * expressed in degrees (deg). For example:
26
+ *
27
+ * `transform([{ skewX: '45deg' }])`
28
+ */
29
+ transform: any;
30
+ transformOrigin: any;
31
+ /**
32
+ * Deprecated. Use the transform prop instead.
33
+ */
34
+ transformMatrix: typeof TransformMatrixPropType;
35
+ /**
36
+ * Deprecated. Use the transform prop instead.
37
+ */
38
+ decomposedMatrix: typeof DecomposedMatrixPropType;
39
+ scaleX: (props: any, propName: any, componentName: any, ...rest: any[]) => any;
40
+ scaleY: (props: any, propName: any, componentName: any, ...rest: any[]) => any;
41
+ rotation: (props: any, propName: any, componentName: any, ...rest: any[]) => any;
42
+ translateX: (props: any, propName: any, componentName: any, ...rest: any[]) => any;
43
+ translateY: (props: any, propName: any, componentName: any, ...rest: any[]) => any;
44
+ };
45
+ export default TransformPropTypes;
@@ -0,0 +1,129 @@
1
+ /**
2
+ * Copyright (c) 2015-present, Facebook, Inc.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ * @format
8
+ *
9
+ */
10
+ 'use strict';
11
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
12
+ if (k2 === undefined) k2 = k;
13
+ var desc = Object.getOwnPropertyDescriptor(m, k);
14
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
15
+ desc = { enumerable: true, get: function() { return m[k]; } };
16
+ }
17
+ Object.defineProperty(o, k2, desc);
18
+ }) : (function(o, m, k, k2) {
19
+ if (k2 === undefined) k2 = k;
20
+ o[k2] = m[k];
21
+ }));
22
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
23
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
24
+ }) : function(o, v) {
25
+ o["default"] = v;
26
+ });
27
+ var __importStar = (this && this.__importStar) || (function () {
28
+ var ownKeys = function(o) {
29
+ ownKeys = Object.getOwnPropertyNames || function (o) {
30
+ var ar = [];
31
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
32
+ return ar;
33
+ };
34
+ return ownKeys(o);
35
+ };
36
+ return function (mod) {
37
+ if (mod && mod.__esModule) return mod;
38
+ var result = {};
39
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
40
+ __setModuleDefault(result, mod);
41
+ return result;
42
+ };
43
+ })();
44
+ var __importDefault = (this && this.__importDefault) || function (mod) {
45
+ return (mod && mod.__esModule) ? mod : { "default": mod };
46
+ };
47
+ Object.defineProperty(exports, "__esModule", { value: true });
48
+ // @ts-ignore
49
+ const ReactPropTypes = __importStar(require("prop-types"));
50
+ const deprecatedPropType_1 = __importDefault(require("./deprecatedPropType"));
51
+ const TransformMatrixPropType = function (
52
+ // @ts-ignore
53
+ props,
54
+ // @ts-ignore
55
+ propName,
56
+ // @ts-ignore
57
+ _componentName) {
58
+ if (props[propName]) {
59
+ return new Error('The transformMatrix style property is deprecated. ' +
60
+ 'Use `transform: [{ matrix: ... }]` instead.');
61
+ }
62
+ };
63
+ const DecomposedMatrixPropType = function (
64
+ // @ts-ignore
65
+ props,
66
+ // @ts-ignore
67
+ propName,
68
+ // @ts-ignore
69
+ _componentName) {
70
+ if (props[propName]) {
71
+ return new Error('The decomposedMatrix style property is deprecated. ' +
72
+ 'Use `transform: [...]` instead.');
73
+ }
74
+ };
75
+ const TransformPropTypes = {
76
+ /**
77
+ * `transform` accepts an array of transformation objects. Each object specifies
78
+ * the property that will be transformed as the key, and the value to use in the
79
+ * transformation. Objects should not be combined. Use a single key/value pair
80
+ * per object.
81
+ *
82
+ * The rotate transformations require a string so that the transform may be
83
+ * expressed in degrees (deg) or radians (rad). For example:
84
+ *
85
+ * `transform([{ rotateX: '45deg' }, { rotateZ: '0.785398rad' }])`
86
+ *
87
+ * The skew transformations require a string so that the transform may be
88
+ * expressed in degrees (deg). For example:
89
+ *
90
+ * `transform([{ skewX: '45deg' }])`
91
+ */
92
+ transform: ReactPropTypes.arrayOf(ReactPropTypes.oneOfType([
93
+ ReactPropTypes.shape({ perspective: ReactPropTypes.number }),
94
+ ReactPropTypes.shape({ rotate: ReactPropTypes.string }),
95
+ ReactPropTypes.shape({ rotateX: ReactPropTypes.string }),
96
+ ReactPropTypes.shape({ rotateY: ReactPropTypes.string }),
97
+ ReactPropTypes.shape({ rotateZ: ReactPropTypes.string }),
98
+ ReactPropTypes.shape({ scale: ReactPropTypes.number }),
99
+ ReactPropTypes.shape({ scaleX: ReactPropTypes.number }),
100
+ ReactPropTypes.shape({ scaleY: ReactPropTypes.number }),
101
+ ReactPropTypes.shape({ translateX: ReactPropTypes.number }),
102
+ ReactPropTypes.shape({ translateY: ReactPropTypes.number }),
103
+ ReactPropTypes.shape({ skewX: ReactPropTypes.string }),
104
+ ReactPropTypes.shape({ skewY: ReactPropTypes.string })
105
+ ])),
106
+ transformOrigin: ReactPropTypes.oneOfType([
107
+ ReactPropTypes.arrayOf(ReactPropTypes.oneOfType([
108
+ ReactPropTypes.number,
109
+ ReactPropTypes.string
110
+ ])),
111
+ ReactPropTypes.string
112
+ ]),
113
+ /**
114
+ * Deprecated. Use the transform prop instead.
115
+ */
116
+ transformMatrix: TransformMatrixPropType,
117
+ /**
118
+ * Deprecated. Use the transform prop instead.
119
+ */
120
+ decomposedMatrix: DecomposedMatrixPropType,
121
+ /* Deprecated transform props used on Android only */
122
+ scaleX: (0, deprecatedPropType_1.default)(ReactPropTypes.number, 'Use the transform prop instead.'),
123
+ scaleY: (0, deprecatedPropType_1.default)(ReactPropTypes.number, 'Use the transform prop instead.'),
124
+ rotation: (0, deprecatedPropType_1.default)(ReactPropTypes.number, 'Use the transform prop instead.'),
125
+ translateX: (0, deprecatedPropType_1.default)(ReactPropTypes.number, 'Use the transform prop instead.'),
126
+ translateY: (0, deprecatedPropType_1.default)(ReactPropTypes.number, 'Use the transform prop instead.')
127
+ };
128
+ exports.default = TransformPropTypes;
129
+ //# sourceMappingURL=TransformPropTypes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TransformPropTypes.js","sourceRoot":"","sources":["../../../src/transforms/StyleSheet/TransformPropTypes.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,YAAY,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEZ,aAAa;AACb,MAAY,cAAc,uCAAkB;AAE5C,8EAAqD;AAErD,MAAM,uBAAuB,GAAG;AA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