@tamagui/helpers 1.132.16-1754534218765 → 1.132.16
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/cjs/concatClassName.cjs +78 -0
- package/dist/cjs/concatClassName.js +69 -0
- package/dist/cjs/concatClassName.js.map +6 -0
- package/dist/cjs/concatClassName.native.js +69 -0
- package/dist/cjs/concatClassName.native.js.map +6 -0
- package/dist/cjs/index.cjs +1 -0
- package/dist/cjs/index.js +1 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/index.native.js +2 -0
- package/dist/cjs/index.native.js.map +1 -1
- package/dist/esm/concatClassName.js +53 -0
- package/dist/esm/concatClassName.js.map +6 -0
- package/dist/esm/concatClassName.mjs +55 -0
- package/dist/esm/concatClassName.mjs.map +1 -0
- package/dist/esm/concatClassName.native.js +47 -0
- package/dist/esm/concatClassName.native.js.map +1 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/index.mjs +1 -0
- package/dist/esm/index.mjs.map +1 -1
- package/dist/esm/index.native.js +1 -0
- package/dist/esm/index.native.js.map +1 -1
- package/package.json +4 -4
- package/src/concatClassName.ts +100 -0
- package/src/index.ts +1 -0
- package/types/concatClassName.d.ts +8 -0
- package/types/concatClassName.d.ts.map +1 -0
- package/types/index.d.ts +1 -0
- package/types/index.d.ts.map +1 -1
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all) __defProp(target, name, {
|
|
7
|
+
get: all[name],
|
|
8
|
+
enumerable: !0
|
|
9
|
+
});
|
|
10
|
+
},
|
|
11
|
+
__copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
|
|
13
|
+
get: () => from[key],
|
|
14
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
15
|
+
});
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
19
|
+
value: !0
|
|
20
|
+
}), mod);
|
|
21
|
+
var concatClassName_exports = {};
|
|
22
|
+
__export(concatClassName_exports, {
|
|
23
|
+
concatClassName: () => concatClassName
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(concatClassName_exports);
|
|
26
|
+
function concatClassName(_cn) {
|
|
27
|
+
const args = arguments,
|
|
28
|
+
usedPrefixes = [];
|
|
29
|
+
let final = "";
|
|
30
|
+
const len = args.length;
|
|
31
|
+
let propObjects = null;
|
|
32
|
+
for (let x = len; x >= 0; x--) {
|
|
33
|
+
const cns = args[x];
|
|
34
|
+
if (!cns) continue;
|
|
35
|
+
if (!Array.isArray(cns) && typeof cns != "string") {
|
|
36
|
+
propObjects = propObjects || [], propObjects.push(cns);
|
|
37
|
+
continue;
|
|
38
|
+
}
|
|
39
|
+
const names = Array.isArray(cns) ? cns : cns.split(" "),
|
|
40
|
+
numNames = names.length;
|
|
41
|
+
for (let i = numNames - 1; i >= 0; i--) {
|
|
42
|
+
const name = names[i];
|
|
43
|
+
if (!name || name === " ") continue;
|
|
44
|
+
if (name[0] !== "_") {
|
|
45
|
+
final = name + " " + final;
|
|
46
|
+
continue;
|
|
47
|
+
}
|
|
48
|
+
const splitIndex = name.indexOf("-");
|
|
49
|
+
if (splitIndex < 1) {
|
|
50
|
+
final = name + " " + final;
|
|
51
|
+
continue;
|
|
52
|
+
}
|
|
53
|
+
const isMediaQuery = name[splitIndex + 1] === "_",
|
|
54
|
+
styleKey = name.slice(1, name.lastIndexOf("-")),
|
|
55
|
+
mediaKey = isMediaQuery ? name.slice(splitIndex + 2, splitIndex + 7) : null,
|
|
56
|
+
uid = mediaKey ? styleKey + mediaKey : styleKey;
|
|
57
|
+
if (usedPrefixes.indexOf(uid) > -1) continue;
|
|
58
|
+
usedPrefixes.push(uid);
|
|
59
|
+
const propName = styleKey;
|
|
60
|
+
propName && propObjects && propObjects.some(po => {
|
|
61
|
+
if (mediaKey) {
|
|
62
|
+
const propKey = pseudoInvert[mediaKey];
|
|
63
|
+
return po && po[propKey] && propName in po[propKey] && po[propKey] !== null;
|
|
64
|
+
}
|
|
65
|
+
return po && propName in po && po[propName] !== null;
|
|
66
|
+
}) || (final = name + " " + final);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
return final;
|
|
70
|
+
}
|
|
71
|
+
const pseudoInvert = {
|
|
72
|
+
hover: "hoverStyle",
|
|
73
|
+
focus: "focusStyle",
|
|
74
|
+
press: "pressStyle",
|
|
75
|
+
focusVisible: "focusVisibleStyle",
|
|
76
|
+
focusWithin: "focusWithinStyle",
|
|
77
|
+
disabled: "disabledStyle"
|
|
78
|
+
};
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: !0 });
|
|
8
|
+
}, __copyProps = (to, from, except, desc) => {
|
|
9
|
+
if (from && typeof from == "object" || typeof from == "function")
|
|
10
|
+
for (let key of __getOwnPropNames(from))
|
|
11
|
+
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
12
|
+
return to;
|
|
13
|
+
};
|
|
14
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
15
|
+
var concatClassName_exports = {};
|
|
16
|
+
__export(concatClassName_exports, {
|
|
17
|
+
concatClassName: () => concatClassName
|
|
18
|
+
});
|
|
19
|
+
module.exports = __toCommonJS(concatClassName_exports);
|
|
20
|
+
function concatClassName(_cn) {
|
|
21
|
+
const args = arguments, usedPrefixes = [];
|
|
22
|
+
let final = "";
|
|
23
|
+
const len = args.length;
|
|
24
|
+
let propObjects = null;
|
|
25
|
+
for (let x = len; x >= 0; x--) {
|
|
26
|
+
const cns = args[x];
|
|
27
|
+
if (!cns) continue;
|
|
28
|
+
if (!Array.isArray(cns) && typeof cns != "string") {
|
|
29
|
+
propObjects = propObjects || [], propObjects.push(cns);
|
|
30
|
+
continue;
|
|
31
|
+
}
|
|
32
|
+
const names = Array.isArray(cns) ? cns : cns.split(" "), numNames = names.length;
|
|
33
|
+
for (let i = numNames - 1; i >= 0; i--) {
|
|
34
|
+
const name = names[i];
|
|
35
|
+
if (!name || name === " ") continue;
|
|
36
|
+
if (name[0] !== "_") {
|
|
37
|
+
final = name + " " + final;
|
|
38
|
+
continue;
|
|
39
|
+
}
|
|
40
|
+
const splitIndex = name.indexOf("-");
|
|
41
|
+
if (splitIndex < 1) {
|
|
42
|
+
final = name + " " + final;
|
|
43
|
+
continue;
|
|
44
|
+
}
|
|
45
|
+
const isMediaQuery = name[splitIndex + 1] === "_", styleKey = name.slice(1, name.lastIndexOf("-")), mediaKey = isMediaQuery ? name.slice(splitIndex + 2, splitIndex + 7) : null, uid = mediaKey ? styleKey + mediaKey : styleKey;
|
|
46
|
+
if (usedPrefixes.indexOf(uid) > -1)
|
|
47
|
+
continue;
|
|
48
|
+
usedPrefixes.push(uid);
|
|
49
|
+
const propName = styleKey;
|
|
50
|
+
propName && propObjects && propObjects.some((po) => {
|
|
51
|
+
if (mediaKey) {
|
|
52
|
+
const propKey = pseudoInvert[mediaKey];
|
|
53
|
+
return po && po[propKey] && propName in po[propKey] && po[propKey] !== null;
|
|
54
|
+
}
|
|
55
|
+
return po && propName in po && po[propName] !== null;
|
|
56
|
+
}) || (final = name + " " + final);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
return final;
|
|
60
|
+
}
|
|
61
|
+
const pseudoInvert = {
|
|
62
|
+
hover: "hoverStyle",
|
|
63
|
+
focus: "focusStyle",
|
|
64
|
+
press: "pressStyle",
|
|
65
|
+
focusVisible: "focusVisibleStyle",
|
|
66
|
+
focusWithin: "focusWithinStyle",
|
|
67
|
+
disabled: "disabledStyle"
|
|
68
|
+
};
|
|
69
|
+
//# sourceMappingURL=concatClassName.js.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/concatClassName.ts"],
|
|
4
|
+
"mappings": ";;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAUO,SAAS,gBAAgB,KAAqD;AACnF,QAAM,OAAO,WACP,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,IAAK;AACV,QAAI,CAAC,MAAM,QAAQ,GAAG,KAAK,OAAO,OAAQ,UAAU;AAElD,oBAAc,eAAe,CAAC,GAC9B,YAAY,KAAK,GAAG;AACpB;AAAA,IACF;AAEA,UAAM,QAAQ,MAAM,QAAQ,GAAG,IAAI,MAAM,IAAI,MAAM,GAAG,GAChD,WAAW,MAAM;AACvB,aAAS,IAAI,WAAW,GAAG,KAAK,GAAG,KAAK;AACtC,YAAM,OAAO,MAAM,CAAC;AAEpB,UAAI,CAAC,QAAQ,SAAS,IAAK;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;AAKA,YAAM,eAHW,KAAK,aAAa,CAAC,MAGF,KAK5B,WAAW,KAAK,MAAM,GAAG,KAAK,YAAY,GAAG,CAAC,GAE9C,WAAW,eAAe,KAAK,MAAM,aAAa,GAAG,aAAa,CAAC,IAAI,MACvE,MAAM,WAAW,WAAW,WAAW;AAG7C,UAAI,aAAa,QAAQ,GAAG,IAAI;AAE9B;AAEF,mBAAa,KAAK,GAAG;AAGrB,YAAM,WAAW;AACjB,MAAI,YAAY,eAEZ,YAAY,KAAK,CAAC,OAAO;AACvB,YAAI,UAAU;AACZ,gBAAM,UAAU,aAAa,QAAQ;AACrC,iBAAO,MAAM,GAAG,OAAO,KAAK,YAAY,GAAG,OAAO,KAAK,GAAG,OAAO,MAAM;AAAA,QACzE;AAEA,eADY,MAAM,YAAY,MAAM,GAAG,QAAQ,MAAM;AAAA,MAEvD,CAAC,MAOL,QAAQ,OAAO,MAAM;AAAA,IACvB;AAAA,EACF;AAEA,SAAO;AACT;AAEA,MAAM,eAAe;AAAA,EACnB,OAAO;AAAA,EACP,OAAO;AAAA,EACP,OAAO;AAAA,EACP,cAAc;AAAA,EACd,aAAa;AAAA,EACb,UAAU;AACZ;",
|
|
5
|
+
"names": []
|
|
6
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: !0 });
|
|
9
|
+
}, __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from == "object" || typeof from == "function")
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
13
|
+
return to;
|
|
14
|
+
};
|
|
15
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
16
|
+
var concatClassName_exports = {};
|
|
17
|
+
__export(concatClassName_exports, {
|
|
18
|
+
concatClassName: () => concatClassName
|
|
19
|
+
});
|
|
20
|
+
module.exports = __toCommonJS(concatClassName_exports);
|
|
21
|
+
function concatClassName(_cn) {
|
|
22
|
+
for (var args = arguments, usedPrefixes = [], final = "", len = args.length, propObjects = null, x = len; x >= 0; x--) {
|
|
23
|
+
var _loop = function(i2) {
|
|
24
|
+
var name = names[i2];
|
|
25
|
+
if (!name || name === " ") return "continue";
|
|
26
|
+
if (name[0] !== "_")
|
|
27
|
+
return final = name + " " + final, "continue";
|
|
28
|
+
var splitIndex = name.indexOf("-");
|
|
29
|
+
if (splitIndex < 1)
|
|
30
|
+
return final = name + " " + final, "continue";
|
|
31
|
+
var nextChar = name[splitIndex + 1], isMediaQuery = nextChar === "_", styleKey = name.slice(1, name.lastIndexOf("-")), mediaKey = isMediaQuery ? name.slice(splitIndex + 2, splitIndex + 7) : null, uid = mediaKey ? styleKey + mediaKey : styleKey;
|
|
32
|
+
if (usedPrefixes.indexOf(uid) > -1)
|
|
33
|
+
return "continue";
|
|
34
|
+
usedPrefixes.push(uid);
|
|
35
|
+
var propName = styleKey;
|
|
36
|
+
if (propName && propObjects && propObjects.some(function(po) {
|
|
37
|
+
if (mediaKey) {
|
|
38
|
+
var propKey = pseudoInvert[mediaKey];
|
|
39
|
+
return po && po[propKey] && propName in po[propKey] && po[propKey] !== null;
|
|
40
|
+
}
|
|
41
|
+
var res = po && propName in po && po[propName] !== null;
|
|
42
|
+
return res;
|
|
43
|
+
}))
|
|
44
|
+
return "continue";
|
|
45
|
+
final = name + " " + final;
|
|
46
|
+
}, cns = args[x];
|
|
47
|
+
if (cns) {
|
|
48
|
+
if (!Array.isArray(cns) && typeof cns != "string") {
|
|
49
|
+
propObjects = propObjects || [], propObjects.push(cns);
|
|
50
|
+
continue;
|
|
51
|
+
}
|
|
52
|
+
for (var names = Array.isArray(cns) ? cns : cns.split(" "), numNames = names.length, i = numNames - 1; i >= 0; i--) _loop(i);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
return final;
|
|
56
|
+
}
|
|
57
|
+
var pseudoInvert = {
|
|
58
|
+
hover: "hoverStyle",
|
|
59
|
+
focus: "focusStyle",
|
|
60
|
+
press: "pressStyle",
|
|
61
|
+
focusVisible: "focusVisibleStyle",
|
|
62
|
+
focusWithin: "focusWithinStyle",
|
|
63
|
+
disabled: "disabledStyle"
|
|
64
|
+
};
|
|
65
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
66
|
+
0 && (module.exports = {
|
|
67
|
+
concatClassName
|
|
68
|
+
});
|
|
69
|
+
//# sourceMappingURL=concatClassName.js.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/concatClassName.ts"],
|
|
4
|
+
"mappings": ";;;;;;;;;;;;;;;AAAA;;;;;AAUO,SAASA,gBAAgBC,KAA2C;AAOzE,WANMC,OAAOC,WACPC,eAAyB,CAAA,GAC3BC,QAAQ,IAENC,MAAMJ,KAAKK,QACbC,cAAmB,MACdC,IAAIH,KAAKG,KAAK,GAAGA,KAAK;;AAc3B,UAAMC,OAAOC,MAAMC,EAAAA;AAEnB,UAAI,CAACF,QAAQA,SAAS,IAAK,QAAA;AAC3B,UAAIA,KAAK,CAAA,MAAO;AAEdL,uBAAQK,OAAO,MAAML,OACrB;AAGF,UAAMQ,aAAaH,KAAKI,QAAQ,GAAA;AAChC,UAAID,aAAa;AACfR,uBAAQK,OAAO,MAAML,OAErB;AAGF,UAAMU,WAAWL,KAAKG,aAAa,CAAA,GAG7BG,eAAeD,aAAa,KAK5BE,WAAWP,KAAKQ,MAAM,GAAGR,KAAKS,YAAY,GAAA,CAAA,GAE1CC,WAAWJ,eAAeN,KAAKQ,MAAML,aAAa,GAAGA,aAAa,CAAA,IAAK,MACvEQ,MAAMD,WAAWH,WAAWG,WAAWH;AAG7C,UAAIb,aAAaU,QAAQO,GAAAA,IAAO;AAE9B,eAAA;AAEFjB,mBAAakB,KAAKD,GAAAA;AAGlB,UAAME,WAAWN;AACjB,UAAIM,YAAYf,eAEZA,YAAYgB,KAAK,SAACC,IAAAA;AAChB,YAAIL,UAAU;AACZ,cAAMM,UAAUC,aAAaP,QAAAA;AAC7B,iBAAOK,MAAMA,GAAGC,OAAAA,KAAYH,YAAYE,GAAGC,OAAAA,KAAYD,GAAGC,OAAAA,MAAa;QACzE;AACA,YAAME,MAAMH,MAAMF,YAAYE,MAAMA,GAAGF,QAAAA,MAAc;AACrD,eAAOK;MACT,CAAA;AAGA,eAAA;AAIJvB,cAAQK,OAAO,MAAML;IACvB,GApEMwB,MAAM3B,KAAKO,CAAAA;AAEjB,QAAKoB,KACL;UAAI,CAACC,MAAMC,QAAQF,GAAAA,KAAQ,OAAOA,OAAQ,UAAU;AAElDrB,sBAAcA,eAAe,CAAA,GAC7BA,YAAYc,KAAKO,GAAAA;AACjB;MACF;AAIA,eAFMlB,QAAQmB,MAAMC,QAAQF,GAAAA,IAAOA,MAAMA,IAAIG,MAAM,GAAA,GAC7CC,WAAWtB,MAAMJ,QACdK,IAAIqB,WAAW,GAAGrB,KAAK,GAAGA,IAAAA,OAAAA,CAAAA;;EAyDrC;AAEA,SAAOP;AACT;AAEA,IAAMsB,eAAe;EACnBO,OAAO;EACPC,OAAO;EACPC,OAAO;EACPC,cAAc;EACdC,aAAa;EACbC,UAAU;AACZ;",
|
|
5
|
+
"names": ["concatClassName", "_cn", "args", "arguments", "usedPrefixes", "final", "len", "length", "propObjects", "x", "name", "names", "i", "splitIndex", "indexOf", "nextChar", "isMediaQuery", "styleKey", "slice", "lastIndexOf", "mediaKey", "uid", "push", "propName", "some", "po", "propKey", "pseudoInvert", "res", "cns", "Array", "isArray", "split", "numNames", "hover", "focus", "press", "focusVisible", "focusWithin", "disabled"]
|
|
6
|
+
}
|
package/dist/cjs/index.cjs
CHANGED
|
@@ -18,6 +18,7 @@ module.exports = __toCommonJS(index_exports);
|
|
|
18
18
|
__reExport(index_exports, require("@tamagui/simple-hash"), module.exports);
|
|
19
19
|
__reExport(index_exports, require("./clamp.cjs"), module.exports);
|
|
20
20
|
__reExport(index_exports, require("./composeEventHandlers.cjs"), module.exports);
|
|
21
|
+
__reExport(index_exports, require("./concatClassName.cjs"), module.exports);
|
|
21
22
|
__reExport(index_exports, require("./types.cjs"), module.exports);
|
|
22
23
|
__reExport(index_exports, require("./shouldRenderNativePlatform.cjs"), module.exports);
|
|
23
24
|
__reExport(index_exports, require("./validStyleProps.cjs"), module.exports);
|
package/dist/cjs/index.js
CHANGED
|
@@ -14,6 +14,7 @@ module.exports = __toCommonJS(index_exports);
|
|
|
14
14
|
__reExport(index_exports, require("@tamagui/simple-hash"), module.exports);
|
|
15
15
|
__reExport(index_exports, require("./clamp"), module.exports);
|
|
16
16
|
__reExport(index_exports, require("./composeEventHandlers"), module.exports);
|
|
17
|
+
__reExport(index_exports, require("./concatClassName"), module.exports);
|
|
17
18
|
__reExport(index_exports, require("./types"), module.exports);
|
|
18
19
|
__reExport(index_exports, require("./shouldRenderNativePlatform"), module.exports);
|
|
19
20
|
__reExport(index_exports, require("./validStyleProps"), module.exports);
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/index.ts"],
|
|
4
|
-
"mappings": ";;;;;;;;;;;AAAA;AAAA;AAAA,0BAAc,iCAAd;AACA,0BAAc,oBADd;AAEA,0BAAc,mCAFd;AAGA,0BAAc,
|
|
4
|
+
"mappings": ";;;;;;;;;;;AAAA;AAAA;AAAA,0BAAc,iCAAd;AACA,0BAAc,oBADd;AAEA,0BAAc,mCAFd;AAGA,0BAAc,8BAHd;AAIA,0BAAc,oBAJd;AAKA,0BAAc,yCALd;AAMA,0BAAc,8BANd;AAOA,0BAAc,mCAPd;",
|
|
5
5
|
"names": []
|
|
6
6
|
}
|
package/dist/cjs/index.native.js
CHANGED
|
@@ -15,6 +15,7 @@ module.exports = __toCommonJS(index_exports);
|
|
|
15
15
|
__reExport(index_exports, require("@tamagui/simple-hash"), module.exports);
|
|
16
16
|
__reExport(index_exports, require("./clamp"), module.exports);
|
|
17
17
|
__reExport(index_exports, require("./composeEventHandlers"), module.exports);
|
|
18
|
+
__reExport(index_exports, require("./concatClassName"), module.exports);
|
|
18
19
|
__reExport(index_exports, require("./types"), module.exports);
|
|
19
20
|
__reExport(index_exports, require("./shouldRenderNativePlatform"), module.exports);
|
|
20
21
|
__reExport(index_exports, require("./validStyleProps"), module.exports);
|
|
@@ -24,6 +25,7 @@ __reExport(index_exports, require("./withStaticProperties"), module.exports);
|
|
|
24
25
|
...require("@tamagui/simple-hash"),
|
|
25
26
|
...require("./clamp"),
|
|
26
27
|
...require("./composeEventHandlers"),
|
|
28
|
+
...require("./concatClassName"),
|
|
27
29
|
...require("./types"),
|
|
28
30
|
...require("./shouldRenderNativePlatform"),
|
|
29
31
|
...require("./validStyleProps"),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/index.ts"],
|
|
4
|
-
"mappings": ";;;;;;;;;;;;AAAA;;0BAAc,iCAAd;AACA,0BAAc,oBADd;AAEA,0BAAc,mCAFd;AAGA,0BAAc,
|
|
4
|
+
"mappings": ";;;;;;;;;;;;AAAA;;0BAAc,iCAAd;AACA,0BAAc,oBADd;AAEA,0BAAc,mCAFd;AAGA,0BAAc,8BAHd;AAIA,0BAAc,oBAJd;AAKA,0BAAc,yCALd;AAMA,0BAAc,8BANd;AAOA,0BAAc,mCAPd;",
|
|
5
5
|
"names": []
|
|
6
6
|
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
function concatClassName(_cn) {
|
|
2
|
+
const args = arguments, usedPrefixes = [];
|
|
3
|
+
let final = "";
|
|
4
|
+
const len = args.length;
|
|
5
|
+
let propObjects = null;
|
|
6
|
+
for (let x = len; x >= 0; x--) {
|
|
7
|
+
const cns = args[x];
|
|
8
|
+
if (!cns) continue;
|
|
9
|
+
if (!Array.isArray(cns) && typeof cns != "string") {
|
|
10
|
+
propObjects = propObjects || [], propObjects.push(cns);
|
|
11
|
+
continue;
|
|
12
|
+
}
|
|
13
|
+
const names = Array.isArray(cns) ? cns : cns.split(" "), numNames = names.length;
|
|
14
|
+
for (let i = numNames - 1; i >= 0; i--) {
|
|
15
|
+
const name = names[i];
|
|
16
|
+
if (!name || name === " ") continue;
|
|
17
|
+
if (name[0] !== "_") {
|
|
18
|
+
final = name + " " + final;
|
|
19
|
+
continue;
|
|
20
|
+
}
|
|
21
|
+
const splitIndex = name.indexOf("-");
|
|
22
|
+
if (splitIndex < 1) {
|
|
23
|
+
final = name + " " + final;
|
|
24
|
+
continue;
|
|
25
|
+
}
|
|
26
|
+
const isMediaQuery = name[splitIndex + 1] === "_", styleKey = name.slice(1, name.lastIndexOf("-")), mediaKey = isMediaQuery ? name.slice(splitIndex + 2, splitIndex + 7) : null, uid = mediaKey ? styleKey + mediaKey : styleKey;
|
|
27
|
+
if (usedPrefixes.indexOf(uid) > -1)
|
|
28
|
+
continue;
|
|
29
|
+
usedPrefixes.push(uid);
|
|
30
|
+
const propName = styleKey;
|
|
31
|
+
propName && propObjects && propObjects.some((po) => {
|
|
32
|
+
if (mediaKey) {
|
|
33
|
+
const propKey = pseudoInvert[mediaKey];
|
|
34
|
+
return po && po[propKey] && propName in po[propKey] && po[propKey] !== null;
|
|
35
|
+
}
|
|
36
|
+
return po && propName in po && po[propName] !== null;
|
|
37
|
+
}) || (final = name + " " + final);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
return final;
|
|
41
|
+
}
|
|
42
|
+
const pseudoInvert = {
|
|
43
|
+
hover: "hoverStyle",
|
|
44
|
+
focus: "focusStyle",
|
|
45
|
+
press: "pressStyle",
|
|
46
|
+
focusVisible: "focusVisibleStyle",
|
|
47
|
+
focusWithin: "focusWithinStyle",
|
|
48
|
+
disabled: "disabledStyle"
|
|
49
|
+
};
|
|
50
|
+
export {
|
|
51
|
+
concatClassName
|
|
52
|
+
};
|
|
53
|
+
//# sourceMappingURL=concatClassName.js.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/concatClassName.ts"],
|
|
4
|
+
"mappings": "AAUO,SAAS,gBAAgB,KAAqD;AACnF,QAAM,OAAO,WACP,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,IAAK;AACV,QAAI,CAAC,MAAM,QAAQ,GAAG,KAAK,OAAO,OAAQ,UAAU;AAElD,oBAAc,eAAe,CAAC,GAC9B,YAAY,KAAK,GAAG;AACpB;AAAA,IACF;AAEA,UAAM,QAAQ,MAAM,QAAQ,GAAG,IAAI,MAAM,IAAI,MAAM,GAAG,GAChD,WAAW,MAAM;AACvB,aAAS,IAAI,WAAW,GAAG,KAAK,GAAG,KAAK;AACtC,YAAM,OAAO,MAAM,CAAC;AAEpB,UAAI,CAAC,QAAQ,SAAS,IAAK;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;AAKA,YAAM,eAHW,KAAK,aAAa,CAAC,MAGF,KAK5B,WAAW,KAAK,MAAM,GAAG,KAAK,YAAY,GAAG,CAAC,GAE9C,WAAW,eAAe,KAAK,MAAM,aAAa,GAAG,aAAa,CAAC,IAAI,MACvE,MAAM,WAAW,WAAW,WAAW;AAG7C,UAAI,aAAa,QAAQ,GAAG,IAAI;AAE9B;AAEF,mBAAa,KAAK,GAAG;AAGrB,YAAM,WAAW;AACjB,MAAI,YAAY,eAEZ,YAAY,KAAK,CAAC,OAAO;AACvB,YAAI,UAAU;AACZ,gBAAM,UAAU,aAAa,QAAQ;AACrC,iBAAO,MAAM,GAAG,OAAO,KAAK,YAAY,GAAG,OAAO,KAAK,GAAG,OAAO,MAAM;AAAA,QACzE;AAEA,eADY,MAAM,YAAY,MAAM,GAAG,QAAQ,MAAM;AAAA,MAEvD,CAAC,MAOL,QAAQ,OAAO,MAAM;AAAA,IACvB;AAAA,EACF;AAEA,SAAO;AACT;AAEA,MAAM,eAAe;AAAA,EACnB,OAAO;AAAA,EACP,OAAO;AAAA,EACP,OAAO;AAAA,EACP,cAAc;AAAA,EACd,aAAa;AAAA,EACb,UAAU;AACZ;",
|
|
5
|
+
"names": []
|
|
6
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
function concatClassName(_cn) {
|
|
2
|
+
const args = arguments,
|
|
3
|
+
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) continue;
|
|
10
|
+
if (!Array.isArray(cns) && typeof cns != "string") {
|
|
11
|
+
propObjects = propObjects || [], propObjects.push(cns);
|
|
12
|
+
continue;
|
|
13
|
+
}
|
|
14
|
+
const names = Array.isArray(cns) ? cns : cns.split(" "),
|
|
15
|
+
numNames = names.length;
|
|
16
|
+
for (let i = numNames - 1; i >= 0; i--) {
|
|
17
|
+
const name = names[i];
|
|
18
|
+
if (!name || name === " ") continue;
|
|
19
|
+
if (name[0] !== "_") {
|
|
20
|
+
final = name + " " + final;
|
|
21
|
+
continue;
|
|
22
|
+
}
|
|
23
|
+
const splitIndex = name.indexOf("-");
|
|
24
|
+
if (splitIndex < 1) {
|
|
25
|
+
final = name + " " + final;
|
|
26
|
+
continue;
|
|
27
|
+
}
|
|
28
|
+
const isMediaQuery = name[splitIndex + 1] === "_",
|
|
29
|
+
styleKey = name.slice(1, name.lastIndexOf("-")),
|
|
30
|
+
mediaKey = isMediaQuery ? name.slice(splitIndex + 2, splitIndex + 7) : null,
|
|
31
|
+
uid = mediaKey ? styleKey + mediaKey : styleKey;
|
|
32
|
+
if (usedPrefixes.indexOf(uid) > -1) continue;
|
|
33
|
+
usedPrefixes.push(uid);
|
|
34
|
+
const propName = styleKey;
|
|
35
|
+
propName && propObjects && propObjects.some(po => {
|
|
36
|
+
if (mediaKey) {
|
|
37
|
+
const propKey = pseudoInvert[mediaKey];
|
|
38
|
+
return po && po[propKey] && propName in po[propKey] && po[propKey] !== null;
|
|
39
|
+
}
|
|
40
|
+
return po && propName in po && po[propName] !== null;
|
|
41
|
+
}) || (final = name + " " + final);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
return final;
|
|
45
|
+
}
|
|
46
|
+
const pseudoInvert = {
|
|
47
|
+
hover: "hoverStyle",
|
|
48
|
+
focus: "focusStyle",
|
|
49
|
+
press: "pressStyle",
|
|
50
|
+
focusVisible: "focusVisibleStyle",
|
|
51
|
+
focusWithin: "focusWithinStyle",
|
|
52
|
+
disabled: "disabledStyle"
|
|
53
|
+
};
|
|
54
|
+
export { concatClassName };
|
|
55
|
+
//# sourceMappingURL=concatClassName.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["concatClassName","_cn","args","arguments","usedPrefixes","final","len","length","propObjects","x","cns","Array","isArray","push","names","split","numNames","i","name","splitIndex","indexOf","isMediaQuery","styleKey","slice","lastIndexOf","mediaKey","uid","propName","some","po","propKey","pseudoInvert","hover","focus","press","focusVisible","focusWithin","disabled"],"sources":["../../src/concatClassName.ts"],"sourcesContent":[null],"mappings":"AAUO,SAASA,gBAAgBC,GAAA,EAAqD;EACnF,MAAMC,IAAA,GAAOC,SAAA;IACPC,YAAA,GAAyB,EAAC;EAChC,IAAIC,KAAA,GAAQ;EAEZ,MAAMC,GAAA,GAAMJ,IAAA,CAAKK,MAAA;EACjB,IAAIC,WAAA,GAAmB;EACvB,SAASC,CAAA,GAAIH,GAAA,EAAKG,CAAA,IAAK,GAAGA,CAAA,IAAK;IAC7B,MAAMC,GAAA,GAAMR,IAAA,CAAKO,CAAC;IAElB,IAAI,CAACC,GAAA,EAAK;IACV,IAAI,CAACC,KAAA,CAAMC,OAAA,CAAQF,GAAG,KAAK,OAAOA,GAAA,IAAQ,UAAU;MAElDF,WAAA,GAAcA,WAAA,IAAe,EAAC,EAC9BA,WAAA,CAAYK,IAAA,CAAKH,GAAG;MACpB;IACF;IAEA,MAAMI,KAAA,GAAQH,KAAA,CAAMC,OAAA,CAAQF,GAAG,IAAIA,GAAA,GAAMA,GAAA,CAAIK,KAAA,CAAM,GAAG;MAChDC,QAAA,GAAWF,KAAA,CAAMP,MAAA;IACvB,SAASU,CAAA,GAAID,QAAA,GAAW,GAAGC,CAAA,IAAK,GAAGA,CAAA,IAAK;MACtC,MAAMC,IAAA,GAAOJ,KAAA,CAAMG,CAAC;MAEpB,IAAI,CAACC,IAAA,IAAQA,IAAA,KAAS,KAAK;MAC3B,IAAIA,IAAA,CAAK,CAAC,MAAM,KAAK;QAEnBb,KAAA,GAAQa,IAAA,GAAO,MAAMb,KAAA;QACrB;MACF;MAEA,MAAMc,UAAA,GAAaD,IAAA,CAAKE,OAAA,CAAQ,GAAG;MACnC,IAAID,UAAA,GAAa,GAAG;QAClBd,KAAA,GAAQa,IAAA,GAAO,MAAMb,KAAA;QAErB;MACF;MAKA,MAAMgB,YAAA,GAHWH,IAAA,CAAKC,UAAA,GAAa,CAAC,MAGF;QAK5BG,QAAA,GAAWJ,IAAA,CAAKK,KAAA,CAAM,GAAGL,IAAA,CAAKM,WAAA,CAAY,GAAG,CAAC;QAE9CC,QAAA,GAAWJ,YAAA,GAAeH,IAAA,CAAKK,KAAA,CAAMJ,UAAA,GAAa,GAAGA,UAAA,GAAa,CAAC,IAAI;QACvEO,GAAA,GAAMD,QAAA,GAAWH,QAAA,GAAWG,QAAA,GAAWH,QAAA;MAG7C,IAAIlB,YAAA,CAAagB,OAAA,CAAQM,GAAG,IAAI,IAE9B;MAEFtB,YAAA,CAAaS,IAAA,CAAKa,GAAG;MAGrB,MAAMC,QAAA,GAAWL,QAAA;MACbK,QAAA,IAAYnB,WAAA,IAEZA,WAAA,CAAYoB,IAAA,CAAMC,EAAA,IAAO;QACvB,IAAIJ,QAAA,EAAU;UACZ,MAAMK,OAAA,GAAUC,YAAA,CAAaN,QAAQ;UACrC,OAAOI,EAAA,IAAMA,EAAA,CAAGC,OAAO,KAAKH,QAAA,IAAYE,EAAA,CAAGC,OAAO,KAAKD,EAAA,CAAGC,OAAO,MAAM;QACzE;QAEA,OADYD,EAAA,IAAMF,QAAA,IAAYE,EAAA,IAAMA,EAAA,CAAGF,QAAQ,MAAM;MAEvD,CAAC,MAOLtB,KAAA,GAAQa,IAAA,GAAO,MAAMb,KAAA;IACvB;EACF;EAEA,OAAOA,KAAA;AACT;AAEA,MAAM0B,YAAA,GAAe;EACnBC,KAAA,EAAO;EACPC,KAAA,EAAO;EACPC,KAAA,EAAO;EACPC,YAAA,EAAc;EACdC,WAAA,EAAa;EACbC,QAAA,EAAU;AACZ","ignoreList":[]}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
function concatClassName(_cn) {
|
|
2
|
+
for (var args = arguments, usedPrefixes = [], final = "", len = args.length, propObjects = null, x = len; x >= 0; x--) {
|
|
3
|
+
var _loop = function (i2) {
|
|
4
|
+
var name = names[i2];
|
|
5
|
+
if (!name || name === " ") return "continue";
|
|
6
|
+
if (name[0] !== "_") return final = name + " " + final, "continue";
|
|
7
|
+
var splitIndex = name.indexOf("-");
|
|
8
|
+
if (splitIndex < 1) return final = name + " " + final, "continue";
|
|
9
|
+
var nextChar = name[splitIndex + 1],
|
|
10
|
+
isMediaQuery = nextChar === "_",
|
|
11
|
+
styleKey = name.slice(1, name.lastIndexOf("-")),
|
|
12
|
+
mediaKey = isMediaQuery ? name.slice(splitIndex + 2, splitIndex + 7) : null,
|
|
13
|
+
uid = mediaKey ? styleKey + mediaKey : styleKey;
|
|
14
|
+
if (usedPrefixes.indexOf(uid) > -1) return "continue";
|
|
15
|
+
usedPrefixes.push(uid);
|
|
16
|
+
var propName = styleKey;
|
|
17
|
+
if (propName && propObjects && propObjects.some(function (po) {
|
|
18
|
+
if (mediaKey) {
|
|
19
|
+
var propKey = pseudoInvert[mediaKey];
|
|
20
|
+
return po && po[propKey] && propName in po[propKey] && po[propKey] !== null;
|
|
21
|
+
}
|
|
22
|
+
var res = po && propName in po && po[propName] !== null;
|
|
23
|
+
return res;
|
|
24
|
+
})) return "continue";
|
|
25
|
+
final = name + " " + final;
|
|
26
|
+
},
|
|
27
|
+
cns = args[x];
|
|
28
|
+
if (cns) {
|
|
29
|
+
if (!Array.isArray(cns) && typeof cns != "string") {
|
|
30
|
+
propObjects = propObjects || [], propObjects.push(cns);
|
|
31
|
+
continue;
|
|
32
|
+
}
|
|
33
|
+
for (var names = Array.isArray(cns) ? cns : cns.split(" "), numNames = names.length, i = numNames - 1; i >= 0; i--) _loop(i);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
return final;
|
|
37
|
+
}
|
|
38
|
+
var pseudoInvert = {
|
|
39
|
+
hover: "hoverStyle",
|
|
40
|
+
focus: "focusStyle",
|
|
41
|
+
press: "pressStyle",
|
|
42
|
+
focusVisible: "focusVisibleStyle",
|
|
43
|
+
focusWithin: "focusWithinStyle",
|
|
44
|
+
disabled: "disabledStyle"
|
|
45
|
+
};
|
|
46
|
+
export { concatClassName };
|
|
47
|
+
//# sourceMappingURL=concatClassName.native.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["concatClassName","_cn","args","arguments","usedPrefixes","final","len","length","propObjects","x","_loop","i2","name","names","splitIndex","indexOf","nextChar","isMediaQuery","styleKey","slice","lastIndexOf","mediaKey","uid","push","propName","some","po","propKey","pseudoInvert","res","cns","Array","isArray","split","numNames","i","hover","focus","press","focusVisible","focusWithin","disabled"],"sources":["../../src/concatClassName.ts"],"sourcesContent":[null],"mappings":"AAUO,SAASA,gBAAgBC,GAAA,EAAqD;EACnF,SAAMC,IAAO,GAAAC,SACP,EAAAC,YAAyB,GAAC,IAAAC,KAAA,OAAAC,GAAA,GAAAJ,IAAA,CAAAK,MAAA,EAAAC,WAAA,SAAAC,CAAA,GAAAH,GAAA,EAAAG,CAAA,OAAAA,CAAA;IAChC,IAAIC,KAAA,GAAQ,SAAAA,CAAAC,EAAA;QAEZ,IAAMC,IAAM,GAAAC,KAAK,CAAAF,EAAA;QACb,KAAAC,IAAA,IAAAA,IAAmB;QACvB,IAAAA,IAAS,CAAI,OAAK,GAAK,EACrB,OAAMP,KAAM,GAAMO,IAAA,SAAAP,KAAA;QAElB,IAAKS,UAAK,GAAAF,IAAA,CAAAG,OAAA;QACV,IAAKD,UAAM,GAAQ,GAEjB,OAAAT,KAAc,GAAAO,IAAA,SAAgBP,KAC9B,YAAY;QACZ,IAAAW,QAAA,GAAAJ,IAAA,CAAAE,UAAA;UAAAG,YAAA,GAAAD,QAAA;UAAAE,QAAA,GAAAN,IAAA,CAAAO,KAAA,IAAAP,IAAA,CAAAQ,WAAA;UAAAC,QAAA,GAAAJ,YAAA,GAAAL,IAAA,CAAAO,KAAA,CAAAL,UAAA,MAAAA,UAAA;UAAAQ,GAAA,GAAAD,QAAA,GAAAH,QAAA,GAAAG,QAAA,GAAAH,QAAA;QACF,IAAAd,YAAA,CAAAW,OAAA,CAAAO,GAAA,QAEA,OAAM,UAAc;QAEpBlB,YAAa,CAAAmB,IAAA,CAAAD,GAAA,CAAW;QACtB,IAAAE,QAAM,GAAON,QAAO;QAEpB,IAAIM,QAAC,IAAQhB,WAAc,IAAAA,WAAA,CAAAiB,IAAA,WAAAC,EAAA;UAC3B,IAAIL,QAAM,EAAM;YAEd,IAAAM,OAAQ,GAAOC,YAAM,CAAAP,QAAA;YACrB,OAAAK,EAAA,IAAAA,EAAA,CAAAC,OAAA,KAAAH,QAAA,IAAAE,EAAA,CAAAC,OAAA,KAAAD,EAAA,CAAAC,OAAA;UACF;UAEA,IAAME,GAAA,GAAAH,EAAA,IAAAF,QAAkB,IAAAE,EAAQ,IAAGA,EAAA,CAAAF,QAAA;UACnC,OAAIK,GAAA;QACF,IAEA;QACFxB,KAAA,GAAAO,IAAA,SAAAP,KAAA;MAKA;MAAAyB,GAAA,GAAM5B,IAAA,CAAAO,CAAA;IAWN,IAAAqB,GAAI;MAEF,KAAAC,KAAA,CAAAC,OAAA,CAAAF,GAAA,YAAAA,GAAA;QAEFtB,WAAa,GAAAA,WAAQ,QAAAA,WAAA,CAAAe,IAAA,CAAAO,GAAA;QAGrB;MACI;MAGE,SAAIjB,KAAA,GAAUkB,KAAA,CAAAC,OAAA,CAAAF,GAAA,IAAAA,GAAA,GAAAA,GAAA,CAAAG,KAAA,OAAAC,QAAA,GAAArB,KAAA,CAAAN,MAAA,EAAA4B,CAAA,GAAAD,QAAA,MAAAC,CAAA,OAAAA,CAAA,IAAAzB,KAAA,CAAAyB,CAAA;IACZ;EACA;EAAuE,OACzE9B,KAAA;AAEA;AADqD,IAAAuB,YAS3D;EAAqBQ,KACvB;EACFC,KAAA;EAEAC,KAAA,EAAO;EACTC,YAAA;EAEAC,WAAM,oBAAe;EACnBC,QAAO;AAAA;AACA,SAEPzC,eAAc","ignoreList":[]}
|
package/dist/esm/index.js
CHANGED
package/dist/esm/index.js.map
CHANGED
package/dist/esm/index.mjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export * from "@tamagui/simple-hash";
|
|
2
2
|
export * from "./clamp.mjs";
|
|
3
3
|
export * from "./composeEventHandlers.mjs";
|
|
4
|
+
export * from "./concatClassName.mjs";
|
|
4
5
|
export * from "./types.mjs";
|
|
5
6
|
export * from "./shouldRenderNativePlatform.mjs";
|
|
6
7
|
export * from "./validStyleProps.mjs";
|
package/dist/esm/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":"AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":[],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":"AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc","ignoreList":[]}
|
package/dist/esm/index.native.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export * from "@tamagui/simple-hash";
|
|
2
2
|
export * from "./clamp.native.js";
|
|
3
3
|
export * from "./composeEventHandlers.native.js";
|
|
4
|
+
export * from "./concatClassName.native.js";
|
|
4
5
|
export * from "./types.native.js";
|
|
5
6
|
export * from "./shouldRenderNativePlatform.native.js";
|
|
6
7
|
export * from "./validStyleProps.native.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":"AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":[],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":"AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamagui/helpers",
|
|
3
|
-
"version": "1.132.16
|
|
3
|
+
"version": "1.132.16",
|
|
4
4
|
"source": "src/index.ts",
|
|
5
5
|
"types": "./types/index.d.ts",
|
|
6
6
|
"main": "dist/cjs",
|
|
@@ -19,11 +19,11 @@
|
|
|
19
19
|
"clean:build": "tamagui-build clean:build"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@tamagui/constants": "1.132.16
|
|
23
|
-
"@tamagui/simple-hash": "1.132.16
|
|
22
|
+
"@tamagui/constants": "1.132.16",
|
|
23
|
+
"@tamagui/simple-hash": "1.132.16"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
|
-
"@tamagui/build": "1.132.16
|
|
26
|
+
"@tamagui/build": "1.132.16",
|
|
27
27
|
"react": "*"
|
|
28
28
|
},
|
|
29
29
|
"publishConfig": {
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
// perf sensitive so doing some weird stuff
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* next - take objects:
|
|
5
|
+
*
|
|
6
|
+
* { _shorthand: 'postfix' }
|
|
7
|
+
*
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
export function concatClassName(...args: any[]): any
|
|
11
|
+
export function concatClassName(_cn: Record<string, any> | null | undefined): string {
|
|
12
|
+
const args = arguments
|
|
13
|
+
const usedPrefixes: string[] = []
|
|
14
|
+
let final = ''
|
|
15
|
+
|
|
16
|
+
const len = args.length
|
|
17
|
+
let propObjects: any = null
|
|
18
|
+
for (let x = len; x >= 0; x--) {
|
|
19
|
+
const cns = args[x]
|
|
20
|
+
|
|
21
|
+
if (!cns) continue
|
|
22
|
+
if (!Array.isArray(cns) && typeof cns !== 'string') {
|
|
23
|
+
// is prop object
|
|
24
|
+
propObjects = propObjects || []
|
|
25
|
+
propObjects.push(cns)
|
|
26
|
+
continue
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const names = Array.isArray(cns) ? cns : cns.split(' ')
|
|
30
|
+
const numNames = names.length
|
|
31
|
+
for (let i = numNames - 1; i >= 0; i--) {
|
|
32
|
+
const name = names[i]
|
|
33
|
+
|
|
34
|
+
if (!name || name === ' ') continue
|
|
35
|
+
if (name[0] !== '_') {
|
|
36
|
+
// not snack style (todo slightly stronger heuristic)
|
|
37
|
+
final = name + ' ' + final
|
|
38
|
+
continue
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
const splitIndex = name.indexOf('-')
|
|
42
|
+
if (splitIndex < 1) {
|
|
43
|
+
final = name + ' ' + final
|
|
44
|
+
// if (shouldDebug) console.log('debug exclude:', name, final)
|
|
45
|
+
continue
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
const nextChar = name[splitIndex + 1]
|
|
49
|
+
// synced to static-ui constants
|
|
50
|
+
// MEDIA_SEP
|
|
51
|
+
const isMediaQuery = nextChar === '_'
|
|
52
|
+
// PSEUDO_SEP
|
|
53
|
+
// commenting out three things to make pseudos override properly
|
|
54
|
+
// (leave in for a bit to see if other bugs pop up later):
|
|
55
|
+
// 1. const isPseudoQuery = nextChar === '0'
|
|
56
|
+
const styleKey = name.slice(1, name.lastIndexOf('-'))
|
|
57
|
+
// 2. isMediaQuery || isPseudoQuery
|
|
58
|
+
const mediaKey = isMediaQuery ? name.slice(splitIndex + 2, splitIndex + 7) : null
|
|
59
|
+
const uid = mediaKey ? styleKey + mediaKey : styleKey
|
|
60
|
+
// 3. && !isPseudoQuery
|
|
61
|
+
|
|
62
|
+
if (usedPrefixes.indexOf(uid) > -1) {
|
|
63
|
+
// if (shouldDebug) console.log('debug exclude:', usedPrefixes, name)
|
|
64
|
+
continue
|
|
65
|
+
}
|
|
66
|
+
usedPrefixes.push(uid)
|
|
67
|
+
|
|
68
|
+
// overrides for full safety
|
|
69
|
+
const propName = styleKey
|
|
70
|
+
if (propName && propObjects) {
|
|
71
|
+
if (
|
|
72
|
+
propObjects.some((po) => {
|
|
73
|
+
if (mediaKey) {
|
|
74
|
+
const propKey = pseudoInvert[mediaKey]
|
|
75
|
+
return po && po[propKey] && propName in po[propKey] && po[propKey] !== null
|
|
76
|
+
}
|
|
77
|
+
const res = po && propName in po && po[propName] !== null
|
|
78
|
+
return res
|
|
79
|
+
})
|
|
80
|
+
) {
|
|
81
|
+
// if (shouldDebug) console.log('debug exclude:', name)
|
|
82
|
+
continue
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
final = name + ' ' + final
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
return final
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
const pseudoInvert = {
|
|
94
|
+
hover: 'hoverStyle',
|
|
95
|
+
focus: 'focusStyle',
|
|
96
|
+
press: 'pressStyle',
|
|
97
|
+
focusVisible: 'focusVisibleStyle',
|
|
98
|
+
focusWithin: 'focusWithinStyle',
|
|
99
|
+
disabled: 'disabledStyle',
|
|
100
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"concatClassName.d.ts","sourceRoot":"","sources":["../src/concatClassName.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AAEH,wBAAgB,eAAe,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,GAAG,CAAA"}
|
package/types/index.d.ts
CHANGED
package/types/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAA;AACpC,cAAc,SAAS,CAAA;AACvB,cAAc,wBAAwB,CAAA;AACtC,cAAc,SAAS,CAAA;AACvB,cAAc,8BAA8B,CAAA;AAC5C,cAAc,mBAAmB,CAAA;AACjC,cAAc,wBAAwB,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAA;AACpC,cAAc,SAAS,CAAA;AACvB,cAAc,wBAAwB,CAAA;AACtC,cAAc,mBAAmB,CAAA;AACjC,cAAc,SAAS,CAAA;AACvB,cAAc,8BAA8B,CAAA;AAC5C,cAAc,mBAAmB,CAAA;AACjC,cAAc,wBAAwB,CAAA"}
|