@tamagui/helpers 1.26.0 → 1.27.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tamagui/helpers",
3
- "version": "1.26.0",
3
+ "version": "1.27.0",
4
4
  "source": "src/index.ts",
5
5
  "types": "./types/index.d.ts",
6
6
  "main": "dist/cjs",
@@ -19,10 +19,10 @@
19
19
  "clean:build": "tamagui-build clean:build"
20
20
  },
21
21
  "dependencies": {
22
- "@tamagui/simple-hash": "1.26.0"
22
+ "@tamagui/simple-hash": "1.27.0"
23
23
  },
24
24
  "devDependencies": {
25
- "@tamagui/build": "1.26.0"
25
+ "@tamagui/build": "1.27.0"
26
26
  },
27
27
  "publishConfig": {
28
28
  "access": "public"
@@ -1,7 +0,0 @@
1
- function clamp(value, [min, max]) {
2
- return Math.min(max, Math.max(min, value));
3
- }
4
- export {
5
- clamp
6
- };
7
- //# sourceMappingURL=clamp.mjs.map
@@ -1,6 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/clamp.ts"],
4
- "mappings": "AAAO,SAAS,MAAM,OAAe,CAAC,KAAK,GAAG,GAA6B;AACzE,SAAO,KAAK,IAAI,KAAK,KAAK,IAAI,KAAK,KAAK,CAAC;AAC3C;",
5
- "names": []
6
- }
@@ -1,16 +0,0 @@
1
- function composeEventHandlers(og, next, { checkDefaultPrevented = true } = {}) {
2
- if (!og || !next) {
3
- return next || og;
4
- }
5
- return function composedEventHandler(event) {
6
- og == null ? void 0 : og(event);
7
- if (!event || !(checkDefaultPrevented && "defaultPrevented" in event) || // @ts-ignore
8
- "defaultPrevented" in event && !event.defaultPrevented) {
9
- return next == null ? void 0 : next(event);
10
- }
11
- };
12
- }
13
- export {
14
- composeEventHandlers
15
- };
16
- //# sourceMappingURL=composeEventHandlers.mjs.map
@@ -1,6 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/composeEventHandlers.ts"],
4
- "mappings": "AAIO,SAAS,qBACd,IACA,MACA,EAAE,wBAAwB,KAAK,IAAI,CAAC,GACpC;AACA,MAAI,CAAC,MAAM,CAAC,MAAM;AAChB,WAAO,QAAQ;AAAA,EACjB;AACA,SAAO,SAAS,qBAAqB,OAAU;AAC7C,6BAAK;AACL,QACE,CAAC,SACD,EAAE,yBAAyB,sBAAsB;AAAA,IAEhD,sBAAsB,SAAS,CAAC,MAAM,kBACvC;AACA,aAAO,6BAAO;AAAA,IAChB;AAAA,EACF;AACF;",
5
- "names": []
6
- }
@@ -1,66 +0,0 @@
1
- function concatClassName(_cn) {
2
- const args = arguments;
3
- const usedPrefixes = [];
4
- let final = "";
5
- const len = args.length;
6
- let propObjects = null;
7
- for (let x = len; x >= 0; x--) {
8
- const cns = args[x];
9
- if (!cns)
10
- continue;
11
- if (!Array.isArray(cns) && typeof cns !== "string") {
12
- propObjects = propObjects || [];
13
- propObjects.push(cns);
14
- continue;
15
- }
16
- const names = Array.isArray(cns) ? cns : cns.split(" ");
17
- const numNames = names.length;
18
- for (let i = numNames - 1; i >= 0; i--) {
19
- const name = names[i];
20
- if (!name || name === " ")
21
- continue;
22
- if (name[0] !== "_") {
23
- final = name + " " + final;
24
- continue;
25
- }
26
- const splitIndex = name.indexOf("-");
27
- if (splitIndex < 1) {
28
- final = name + " " + final;
29
- continue;
30
- }
31
- const nextChar = name[splitIndex + 1];
32
- const isMediaQuery = nextChar === "_";
33
- const styleKey = name.slice(1, name.lastIndexOf("-"));
34
- const mediaKey = isMediaQuery ? name.slice(splitIndex + 2, splitIndex + 7) : null;
35
- const uid = mediaKey ? styleKey + mediaKey : styleKey;
36
- if (usedPrefixes.indexOf(uid) > -1) {
37
- continue;
38
- }
39
- usedPrefixes.push(uid);
40
- const propName = styleKey;
41
- if (propName && propObjects) {
42
- if (propObjects.some((po) => {
43
- if (mediaKey) {
44
- const propKey = pseudoInvert[mediaKey];
45
- return po && po[propKey] && propName in po[propKey] && po[propKey] !== null;
46
- }
47
- const res = po && propName in po && po[propName] !== null;
48
- return res;
49
- })) {
50
- continue;
51
- }
52
- }
53
- final = name + " " + final;
54
- }
55
- }
56
- return final;
57
- }
58
- const pseudoInvert = {
59
- hover: "hoverStyle",
60
- focus: "focusStyle",
61
- press: "pressStyle"
62
- };
63
- export {
64
- concatClassName
65
- };
66
- //# sourceMappingURL=concatClassName.mjs.map
@@ -1,6 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/concatClassName.ts"],
4
- "mappings": "AAUO,SAAS,gBAAgB,KAAqD;AACnF,QAAM,OAAO;AACb,QAAM,eAAyB,CAAC;AAChC,MAAI,QAAQ;AAEZ,QAAM,MAAM,KAAK;AACjB,MAAI,cAAmB;AACvB,WAAS,IAAI,KAAK,KAAK,GAAG,KAAK;AAC7B,UAAM,MAAM,KAAK,CAAC;AAElB,QAAI,CAAC;AAAK;AACV,QAAI,CAAC,MAAM,QAAQ,GAAG,KAAK,OAAO,QAAQ,UAAU;AAElD,oBAAc,eAAe,CAAC;AAC9B,kBAAY,KAAK,GAAG;AACpB;AAAA,IACF;AAEA,UAAM,QAAQ,MAAM,QAAQ,GAAG,IAAI,MAAM,IAAI,MAAM,GAAG;AACtD,UAAM,WAAW,MAAM;AACvB,aAAS,IAAI,WAAW,GAAG,KAAK,GAAG,KAAK;AACtC,YAAM,OAAO,MAAM,CAAC;AAEpB,UAAI,CAAC,QAAQ,SAAS;AAAK;AAC3B,UAAI,KAAK,CAAC,MAAM,KAAK;AAEnB,gBAAQ,OAAO,MAAM;AACrB;AAAA,MACF;AAEA,YAAM,aAAa,KAAK,QAAQ,GAAG;AACnC,UAAI,aAAa,GAAG;AAClB,gBAAQ,OAAO,MAAM;AAErB;AAAA,MACF;AAEA,YAAM,WAAW,KAAK,aAAa,CAAC;AAGpC,YAAM,eAAe,aAAa;AAKlC,YAAM,WAAW,KAAK,MAAM,GAAG,KAAK,YAAY,GAAG,CAAC;AAEpD,YAAM,WAAW,eAAe,KAAK,MAAM,aAAa,GAAG,aAAa,CAAC,IAAI;AAC7E,YAAM,MAAM,WAAW,WAAW,WAAW;AAG7C,UAAI,aAAa,QAAQ,GAAG,IAAI,IAAI;AAElC;AAAA,MACF;AACA,mBAAa,KAAK,GAAG;AAGrB,YAAM,WAAW;AACjB,UAAI,YAAY,aAAa;AAC3B,YACE,YAAY,KAAK,CAAC,OAAO;AACvB,cAAI,UAAU;AACZ,kBAAM,UAAU,aAAa,QAAQ;AACrC,mBAAO,MAAM,GAAG,OAAO,KAAK,YAAY,GAAG,OAAO,KAAK,GAAG,OAAO,MAAM;AAAA,UACzE;AACA,gBAAM,MAAM,MAAM,YAAY,MAAM,GAAG,QAAQ,MAAM;AACrD,iBAAO;AAAA,QACT,CAAC,GACD;AAEA;AAAA,QACF;AAAA,MACF;AAEA,cAAQ,OAAO,MAAM;AAAA,IACvB;AAAA,EACF;AAEA,SAAO;AACT;AAEA,MAAM,eAAe;AAAA,EACnB,OAAO;AAAA,EACP,OAAO;AAAA,EACP,OAAO;AACT;",
5
- "names": []
6
- }
@@ -1,7 +0,0 @@
1
- export * from "./clamp";
2
- export * from "./composeEventHandlers";
3
- export * from "./concatClassName";
4
- export * from "./validStyleProps";
5
- export * from "./types";
6
- export * from "@tamagui/simple-hash";
7
- //# sourceMappingURL=index.mjs.map
@@ -1,6 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/index.ts"],
4
- "mappings": "AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;",
5
- "names": []
6
- }
@@ -1 +0,0 @@
1
- //# sourceMappingURL=types.mjs.map
@@ -1,6 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": [],
4
- "mappings": "",
5
- "names": []
6
- }
@@ -1,185 +0,0 @@
1
- import { isAndroid } from "@tamagui/constants";
2
- const stylePropsTransform = Object.freeze({
3
- x: true,
4
- y: true,
5
- scale: true,
6
- perspective: true,
7
- scaleX: true,
8
- scaleY: true,
9
- skewX: true,
10
- skewY: true,
11
- matrix: true,
12
- rotate: true,
13
- rotateY: true,
14
- rotateX: true,
15
- rotateZ: true
16
- });
17
- const validStylesOnBaseProps = Object.freeze({
18
- placeholderTextColor: true
19
- });
20
- const stylePropsView = Object.freeze({
21
- backfaceVisibility: true,
22
- backgroundColor: true,
23
- borderBottomColor: true,
24
- borderBottomEndRadius: true,
25
- borderBottomLeftRadius: true,
26
- borderBottomRightRadius: true,
27
- borderBottomStartRadius: true,
28
- borderBottomWidth: true,
29
- borderColor: true,
30
- borderEndColor: true,
31
- borderLeftColor: true,
32
- borderLeftWidth: true,
33
- borderRadius: true,
34
- borderRightColor: true,
35
- borderRightWidth: true,
36
- borderStartColor: true,
37
- borderStyle: true,
38
- borderTopColor: true,
39
- borderTopEndRadius: true,
40
- borderTopLeftRadius: true,
41
- borderTopRightRadius: true,
42
- borderTopStartRadius: true,
43
- borderTopWidth: true,
44
- borderWidth: true,
45
- opacity: true,
46
- transform: true,
47
- alignContent: true,
48
- alignItems: true,
49
- alignSelf: true,
50
- aspectRatio: true,
51
- borderEndWidth: true,
52
- borderStartWidth: true,
53
- bottom: true,
54
- display: true,
55
- end: true,
56
- flex: true,
57
- flexBasis: true,
58
- flexDirection: true,
59
- flexGrow: true,
60
- flexShrink: true,
61
- flexWrap: true,
62
- gap: true,
63
- columnGap: true,
64
- rowGap: true,
65
- height: true,
66
- justifyContent: true,
67
- left: true,
68
- margin: true,
69
- marginBottom: true,
70
- marginEnd: true,
71
- marginHorizontal: true,
72
- marginLeft: true,
73
- marginRight: true,
74
- marginStart: true,
75
- marginTop: true,
76
- marginVertical: true,
77
- maxHeight: true,
78
- maxWidth: true,
79
- minHeight: true,
80
- minWidth: true,
81
- overflow: true,
82
- padding: true,
83
- paddingBottom: true,
84
- paddingEnd: true,
85
- paddingHorizontal: true,
86
- paddingLeft: true,
87
- paddingRight: true,
88
- paddingStart: true,
89
- paddingTop: true,
90
- paddingVertical: true,
91
- position: true,
92
- right: true,
93
- start: true,
94
- top: true,
95
- width: true,
96
- zIndex: true,
97
- direction: true,
98
- shadowColor: true,
99
- shadowOffset: true,
100
- shadowOpacity: true,
101
- shadowRadius: true,
102
- ...validStylesOnBaseProps,
103
- ...stylePropsTransform,
104
- // allow a few web only ones
105
- ...process.env.TAMAGUI_TARGET === "web" && {
106
- // RN doesn't support specific border styles per-edge
107
- borderBottomStyle: true,
108
- borderTopStyle: true,
109
- borderLeftStyle: true,
110
- borderRightStyle: true,
111
- overflowX: true,
112
- overflowY: true,
113
- userSelect: true,
114
- cursor: true,
115
- contain: true,
116
- pointerEvents: true,
117
- boxSizing: true,
118
- boxShadow: true,
119
- outlineColor: true,
120
- outlineStyle: true,
121
- outlineOffset: true,
122
- outlineWidth: true
123
- },
124
- ...isAndroid ? { elevationAndroid: true } : {}
125
- });
126
- const stylePropsFont = Object.freeze({
127
- fontFamily: true,
128
- fontSize: true,
129
- fontStyle: true,
130
- fontWeight: true,
131
- letterSpacing: true,
132
- lineHeight: true,
133
- textTransform: true
134
- });
135
- const stylePropsTextOnly = Object.freeze({
136
- color: true,
137
- ...stylePropsFont,
138
- textAlign: true,
139
- textDecorationLine: true,
140
- textDecorationStyle: true,
141
- textDecorationColor: true,
142
- textShadowColor: true,
143
- textShadowOffset: true,
144
- textShadowRadius: true,
145
- // allow some web only ones
146
- ...process.env.TAMAGUI_TARGET === "web" && {
147
- whiteSpace: true,
148
- wordWrap: true,
149
- textOverflow: true,
150
- textDecorationDistance: true,
151
- userSelect: true,
152
- selectable: true,
153
- cursor: true,
154
- WebkitLineClamp: true,
155
- WebkitBoxOrient: true
156
- }
157
- });
158
- const stylePropsText = Object.freeze({
159
- ...stylePropsView,
160
- ...stylePropsTextOnly
161
- });
162
- const stylePropsAll = stylePropsText;
163
- const validPseudoKeys = Object.freeze({
164
- enterStyle: true,
165
- exitStyle: true,
166
- hoverStyle: true,
167
- pressStyle: true,
168
- focusStyle: true
169
- });
170
- const validStyles = Object.freeze({
171
- ...validPseudoKeys,
172
- ...stylePropsView
173
- });
174
- export {
175
- stylePropsAll,
176
- stylePropsFont,
177
- stylePropsText,
178
- stylePropsTextOnly,
179
- stylePropsTransform,
180
- stylePropsView,
181
- validPseudoKeys,
182
- validStyles,
183
- validStylesOnBaseProps
184
- };
185
- //# sourceMappingURL=validStyleProps.mjs.map
@@ -1,6 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/validStyleProps.ts"],
4
- "mappings": "AACA,SAAS,iBAAiB;AACnB,MAAM,sBAAsB,OAAO,OAAO;AAAA,EAC/C,GAAG;AAAA,EACH,GAAG;AAAA,EACH,OAAO;AAAA,EACP,aAAa;AAAA,EACb,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,SAAS;AAAA,EACT,SAAS;AACX,CAAC;AAEM,MAAM,yBAAyB,OAAO,OAAO;AAAA,EAClD,sBAAsB;AACxB,CAAC;AAEM,MAAM,iBAAiB,OAAO,OAAO;AAAA,EAC1C,oBAAoB;AAAA,EACpB,iBAAiB;AAAA,EACjB,mBAAmB;AAAA,EACnB,uBAAuB;AAAA,EACvB,wBAAwB;AAAA,EACxB,yBAAyB;AAAA,EACzB,yBAAyB;AAAA,EACzB,mBAAmB;AAAA,EACnB,aAAa;AAAA,EACb,gBAAgB;AAAA,EAChB,iBAAiB;AAAA,EACjB,iBAAiB;AAAA,EACjB,cAAc;AAAA,EACd,kBAAkB;AAAA,EAClB,kBAAkB;AAAA,EAClB,kBAAkB;AAAA,EAClB,aAAa;AAAA,EACb,gBAAgB;AAAA,EAChB,oBAAoB;AAAA,EACpB,qBAAqB;AAAA,EACrB,sBAAsB;AAAA,EACtB,sBAAsB;AAAA,EACtB,gBAAgB;AAAA,EAChB,aAAa;AAAA,EACb,SAAS;AAAA,EACT,WAAW;AAAA,EACX,cAAc;AAAA,EACd,YAAY;AAAA,E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