@tamagui/font 1.89.0-1706483140977 → 1.89.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/dist/esm/index.native.js
CHANGED
|
@@ -1,27 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
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 src_exports = {};
|
|
17
|
-
__export(src_exports, {
|
|
18
|
-
addFont: () => addFont
|
|
19
|
-
});
|
|
20
|
-
module.exports = __toCommonJS(src_exports);
|
|
21
|
-
var import_constants = require("@tamagui/constants"), import_web = require("@tamagui/web");
|
|
1
|
+
import { isWeb } from "@tamagui/constants";
|
|
2
|
+
import {
|
|
3
|
+
createVariables,
|
|
4
|
+
getConfig,
|
|
5
|
+
parseFont,
|
|
6
|
+
registerFontVariables
|
|
7
|
+
} from "@tamagui/web";
|
|
22
8
|
function addFont(props) {
|
|
23
9
|
var _a;
|
|
24
|
-
const config =
|
|
10
|
+
const config = getConfig(), { fontFamilyName: fontFamilyNameIn, fontFamily: fontFamilyIn } = props;
|
|
25
11
|
if (process.env.NODE_ENV === "development") {
|
|
26
12
|
if (!config)
|
|
27
13
|
throw new Error("No config");
|
|
@@ -34,10 +20,10 @@ function addFont(props) {
|
|
|
34
20
|
function declarationsToRuleSet(decs, selector = "") {
|
|
35
21
|
return `:root${selector} {${sep}${[...decs].join(`;${sep}`)}${sep}}`;
|
|
36
22
|
}
|
|
37
|
-
if (
|
|
38
|
-
const fontFamilyToken =
|
|
23
|
+
if (isWeb) {
|
|
24
|
+
const fontFamilyToken = createVariables(fontFamilyIn, "f", !0), parsedFontFamily = parseFont(fontFamilyToken), fontFamilyNameParsed = `$${fontFamilyNameIn}`;
|
|
39
25
|
if (config.fontsParsed[fontFamilyNameParsed] = parsedFontFamily, props.insertCSS) {
|
|
40
|
-
const [ff_name, ff_language] = fontFamilyNameParsed.includes("_") ? fontFamilyNameParsed.split("_") : [fontFamilyNameParsed], fontVars =
|
|
26
|
+
const [ff_name, ff_language] = fontFamilyNameParsed.includes("_") ? fontFamilyNameParsed.split("_") : [fontFamilyNameParsed], fontVars = registerFontVariables(parsedFontFamily), fontDeclaration = {
|
|
41
27
|
[fontFamilyNameIn]: {
|
|
42
28
|
name: ff_name.slice(1),
|
|
43
29
|
declarations: fontVars,
|
|
@@ -55,8 +41,7 @@ function addFont(props) {
|
|
|
55
41
|
}
|
|
56
42
|
}
|
|
57
43
|
}
|
|
58
|
-
|
|
59
|
-
0 && (module.exports = {
|
|
44
|
+
export {
|
|
60
45
|
addFont
|
|
61
|
-
}
|
|
46
|
+
};
|
|
62
47
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/index.ts"],
|
|
4
|
-
"mappings": "
|
|
4
|
+
"mappings": "AAAA,SAAS,aAAa;AACtB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAGA,SAAS,QAAQ,OAMrB;AAfH;AAgBE,QAAM,SAAS,UAAU,GACnB,EAAE,gBAAgB,kBAAkB,YAAY,aAAa,IAAI;AAEvE,MAAI,QAAQ,IAAI,aAAa,eAAe;AAC1C,QAAI,CAAC;AACH,YAAM,IAAI,MAAM,WAAW;AAE7B,UAAM,aAAa,OAAO,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,SAAS,KAAK,YAAY,KAAK,GAC3B,cACF,cAAS,kBAAT,WAAwB,YAAY,YAE/B;AAAA,QACL;AAAA,QACA;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF;",
|
|
5
5
|
"names": []
|
|
6
6
|
}
|
package/dist/jsx/index.native.js
CHANGED
|
@@ -1,27 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
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 src_exports = {};
|
|
17
|
-
__export(src_exports, {
|
|
18
|
-
addFont: () => addFont
|
|
19
|
-
});
|
|
20
|
-
module.exports = __toCommonJS(src_exports);
|
|
21
|
-
var import_constants = require("@tamagui/constants"), import_web = require("@tamagui/web");
|
|
1
|
+
import { isWeb } from "@tamagui/constants";
|
|
2
|
+
import {
|
|
3
|
+
createVariables,
|
|
4
|
+
getConfig,
|
|
5
|
+
parseFont,
|
|
6
|
+
registerFontVariables
|
|
7
|
+
} from "@tamagui/web";
|
|
22
8
|
function addFont(props) {
|
|
23
9
|
var _a;
|
|
24
|
-
const config =
|
|
10
|
+
const config = getConfig(), { fontFamilyName: fontFamilyNameIn, fontFamily: fontFamilyIn } = props;
|
|
25
11
|
if (process.env.NODE_ENV === "development") {
|
|
26
12
|
if (!config)
|
|
27
13
|
throw new Error("No config");
|
|
@@ -34,10 +20,10 @@ function addFont(props) {
|
|
|
34
20
|
function declarationsToRuleSet(decs, selector = "") {
|
|
35
21
|
return `:root${selector} {${sep}${[...decs].join(`;${sep}`)}${sep}}`;
|
|
36
22
|
}
|
|
37
|
-
if (
|
|
38
|
-
const fontFamilyToken =
|
|
23
|
+
if (isWeb) {
|
|
24
|
+
const fontFamilyToken = createVariables(fontFamilyIn, "f", !0), parsedFontFamily = parseFont(fontFamilyToken), fontFamilyNameParsed = `$${fontFamilyNameIn}`;
|
|
39
25
|
if (config.fontsParsed[fontFamilyNameParsed] = parsedFontFamily, props.insertCSS) {
|
|
40
|
-
const [ff_name, ff_language] = fontFamilyNameParsed.includes("_") ? fontFamilyNameParsed.split("_") : [fontFamilyNameParsed], fontVars =
|
|
26
|
+
const [ff_name, ff_language] = fontFamilyNameParsed.includes("_") ? fontFamilyNameParsed.split("_") : [fontFamilyNameParsed], fontVars = registerFontVariables(parsedFontFamily), fontDeclaration = {
|
|
41
27
|
[fontFamilyNameIn]: {
|
|
42
28
|
name: ff_name.slice(1),
|
|
43
29
|
declarations: fontVars,
|
|
@@ -55,8 +41,7 @@ function addFont(props) {
|
|
|
55
41
|
}
|
|
56
42
|
}
|
|
57
43
|
}
|
|
58
|
-
|
|
59
|
-
0 && (module.exports = {
|
|
44
|
+
export {
|
|
60
45
|
addFont
|
|
61
|
-
}
|
|
46
|
+
};
|
|
62
47
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/index.ts"],
|
|
4
|
-
"mappings": "
|
|
4
|
+
"mappings": "AAAA,SAAS,aAAa;AACtB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAGA,SAAS,QAAQ,OAMrB;AAfH;AAgBE,QAAM,SAAS,UAAU,GACnB,EAAE,gBAAgB,kBAAkB,YAAY,aAAa,IAAI;AAEvE,MAAI,QAAQ,IAAI,aAAa,eAAe;AAC1C,QAAI,CAAC;AAC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AM,YAAY,SAAS,eAAe,GAAG,WAAW,EAAE,CAAC,GAC3D,SAAS,KAAK,YAAY,KAAK,GAC3B,cACF,cAAS,kBAAT,WAAwB,YAAY,YAE/B;AAAA,QACL;AAAA,QACA;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF;",
|
|
5
5
|
"names": []
|
|
6
6
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamagui/font",
|
|
3
|
-
"version": "1.89.0
|
|
3
|
+
"version": "1.89.0",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"source": "src/index.ts",
|
|
6
6
|
"types": "./types/index.d.ts",
|
|
@@ -21,14 +21,14 @@
|
|
|
21
21
|
"clean:build": "tamagui-build clean:build"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@tamagui/constants": "1.89.0
|
|
25
|
-
"@tamagui/web": "1.89.0
|
|
24
|
+
"@tamagui/constants": "1.89.0",
|
|
25
|
+
"@tamagui/web": "1.89.0"
|
|
26
26
|
},
|
|
27
27
|
"peerDependencies": {
|
|
28
28
|
"react": "*"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
|
-
"@tamagui/build": "1.89.0
|
|
31
|
+
"@tamagui/build": "1.89.0",
|
|
32
32
|
"react": "^18.2.0"
|
|
33
33
|
},
|
|
34
34
|
"publishConfig": {
|