@tamagui/core 1.0.1-beta.212 → 1.0.1-beta.213
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/createFont.js
CHANGED
|
@@ -35,9 +35,10 @@ const fontWeights = [
|
|
|
35
35
|
const processSection = (section, keys) => {
|
|
36
36
|
if (typeof section === "string")
|
|
37
37
|
return section;
|
|
38
|
-
|
|
38
|
+
const sectionKeys = Object.keys(section);
|
|
39
|
+
let fillValue = section[sectionKeys[0]];
|
|
39
40
|
return Object.fromEntries(
|
|
40
|
-
keys.map((key) => {
|
|
41
|
+
[.../* @__PURE__ */ new Set([...keys, ...sectionKeys])].map((key) => {
|
|
41
42
|
const value = section[key] ?? fillValue;
|
|
42
43
|
fillValue = value;
|
|
43
44
|
return [key, value];
|
|
@@ -46,13 +47,13 @@ const processSection = (section, keys) => {
|
|
|
46
47
|
};
|
|
47
48
|
const createFont = (font) => {
|
|
48
49
|
const sizeKeys = Object.keys(font.size);
|
|
49
|
-
Object.fromEntries(
|
|
50
|
+
const processedFont = Object.fromEntries(
|
|
50
51
|
Object.entries(font).map(([key, section]) => {
|
|
51
52
|
const fillKeys = key === "face" ? fontWeights : sizeKeys;
|
|
52
53
|
return [key, processSection(section, fillKeys)];
|
|
53
54
|
})
|
|
54
55
|
);
|
|
55
|
-
return Object.freeze(
|
|
56
|
+
return Object.freeze(processedFont);
|
|
56
57
|
};
|
|
57
58
|
// Annotate the CommonJS export names for ESM import in node:
|
|
58
59
|
0 && (module.exports = {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/createFont.ts"],
|
|
4
|
-
"sourcesContent": ["import { FontWeightSteps, GenericFont } from './types'\n\nconst fontWeights: FontWeightSteps[] = [\n '100',\n '200',\n '300',\n '400',\n '500',\n '600',\n '700',\n '800',\n '900',\n]\n\nconst processSection = <T>(\n section: string | Record<string, T>,\n keys: string[]\n): string | Record<string, T> => {\n if (typeof section === 'string') return section\n\n
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,MAAM,cAAiC;AAAA,EACrC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAEA,MAAM,iBAAiB,CACrB,SACA,SAC+B;AAC/B,MAAI,OAAO,YAAY;AAAU,WAAO;AAExC,
|
|
4
|
+
"sourcesContent": ["import { FontWeightSteps, GenericFont } from './types'\n\nconst fontWeights: FontWeightSteps[] = [\n '100',\n '200',\n '300',\n '400',\n '500',\n '600',\n '700',\n '800',\n '900',\n]\n\nconst processSection = <T>(\n section: string | Record<string, T>,\n keys: string[]\n): string | Record<string, T> => {\n if (typeof section === 'string') return section\n\n const sectionKeys = Object.keys(section)\n let fillValue = section[sectionKeys[0]]\n\n return Object.fromEntries(\n [...new Set([...keys, ...sectionKeys])].map((key) => {\n const value = section[key] ?? fillValue\n fillValue = value\n return [key, value]\n })\n )\n}\n\nexport const createFont = <A extends GenericFont>(font: A): A => {\n const sizeKeys = Object.keys(font.size)\n\n const processedFont = Object.fromEntries(\n Object.entries(font).map(([key, section]) => {\n const fillKeys = key === 'face' ? fontWeights : sizeKeys\n\n return [key, processSection(section, fillKeys)]\n })\n )\n\n return Object.freeze(processedFont) as A\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,MAAM,cAAiC;AAAA,EACrC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAEA,MAAM,iBAAiB,CACrB,SACA,SAC+B;AAC/B,MAAI,OAAO,YAAY;AAAU,WAAO;AAExC,QAAM,cAAc,OAAO,KAAK,OAAO;AACvC,MAAI,YAAY,QAAQ,YAAY;AAEpC,SAAO,OAAO;AAAA,IACZ,CAAC,GAAG,oBAAI,IAAI,CAAC,GAAG,MAAM,GAAG,WAAW,CAAC,CAAC,EAAE,IAAI,CAAC,QAAQ;AACnD,YAAM,QAAQ,QAAQ,QAAQ;AAC9B,kBAAY;AACZ,aAAO,CAAC,KAAK,KAAK;AAAA,IACpB,CAAC;AAAA,EACH;AACF;AAEO,MAAM,aAAa,CAAwB,SAAe;AAC/D,QAAM,WAAW,OAAO,KAAK,KAAK,IAAI;AAEtC,QAAM,gBAAgB,OAAO;AAAA,IAC3B,OAAO,QAAQ,IAAI,EAAE,IAAI,CAAC,CAAC,KAAK,OAAO,MAAM;AAC3C,YAAM,WAAW,QAAQ,SAAS,cAAc;AAEhD,aAAO,CAAC,KAAK,eAAe,SAAS,QAAQ,CAAC;AAAA,IAChD,CAAC;AAAA,EACH;AAEA,SAAO,OAAO,OAAO,aAAa;AACpC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/esm/createFont.js
CHANGED
|
@@ -12,9 +12,10 @@ const fontWeights = [
|
|
|
12
12
|
const processSection = (section, keys) => {
|
|
13
13
|
if (typeof section === "string")
|
|
14
14
|
return section;
|
|
15
|
-
|
|
15
|
+
const sectionKeys = Object.keys(section);
|
|
16
|
+
let fillValue = section[sectionKeys[0]];
|
|
16
17
|
return Object.fromEntries(
|
|
17
|
-
keys.map((key) => {
|
|
18
|
+
[.../* @__PURE__ */ new Set([...keys, ...sectionKeys])].map((key) => {
|
|
18
19
|
const value = section[key] ?? fillValue;
|
|
19
20
|
fillValue = value;
|
|
20
21
|
return [key, value];
|
|
@@ -23,13 +24,13 @@ const processSection = (section, keys) => {
|
|
|
23
24
|
};
|
|
24
25
|
const createFont = (font) => {
|
|
25
26
|
const sizeKeys = Object.keys(font.size);
|
|
26
|
-
Object.fromEntries(
|
|
27
|
+
const processedFont = Object.fromEntries(
|
|
27
28
|
Object.entries(font).map(([key, section]) => {
|
|
28
29
|
const fillKeys = key === "face" ? fontWeights : sizeKeys;
|
|
29
30
|
return [key, processSection(section, fillKeys)];
|
|
30
31
|
})
|
|
31
32
|
);
|
|
32
|
-
return Object.freeze(
|
|
33
|
+
return Object.freeze(processedFont);
|
|
33
34
|
};
|
|
34
35
|
export {
|
|
35
36
|
createFont
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/createFont.ts"],
|
|
4
|
-
"sourcesContent": ["import { FontWeightSteps, GenericFont } from './types'\n\nconst fontWeights: FontWeightSteps[] = [\n '100',\n '200',\n '300',\n '400',\n '500',\n '600',\n '700',\n '800',\n '900',\n]\n\nconst processSection = <T>(\n section: string | Record<string, T>,\n keys: string[]\n): string | Record<string, T> => {\n if (typeof section === 'string') return section\n\n
|
|
5
|
-
"mappings": "AAEA,MAAM,cAAiC;AAAA,EACrC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAEA,MAAM,iBAAiB,CACrB,SACA,SAC+B;AAC/B,MAAI,OAAO,YAAY;AAAU,WAAO;AAExC,
|
|
4
|
+
"sourcesContent": ["import { FontWeightSteps, GenericFont } from './types'\n\nconst fontWeights: FontWeightSteps[] = [\n '100',\n '200',\n '300',\n '400',\n '500',\n '600',\n '700',\n '800',\n '900',\n]\n\nconst processSection = <T>(\n section: string | Record<string, T>,\n keys: string[]\n): string | Record<string, T> => {\n if (typeof section === 'string') return section\n\n const sectionKeys = Object.keys(section)\n let fillValue = section[sectionKeys[0]]\n\n return Object.fromEntries(\n [...new Set([...keys, ...sectionKeys])].map((key) => {\n const value = section[key] ?? fillValue\n fillValue = value\n return [key, value]\n })\n )\n}\n\nexport const createFont = <A extends GenericFont>(font: A): A => {\n const sizeKeys = Object.keys(font.size)\n\n const processedFont = Object.fromEntries(\n Object.entries(font).map(([key, section]) => {\n const fillKeys = key === 'face' ? fontWeights : sizeKeys\n\n return [key, processSection(section, fillKeys)]\n })\n )\n\n return Object.freeze(processedFont) as A\n}\n"],
|
|
5
|
+
"mappings": "AAEA,MAAM,cAAiC;AAAA,EACrC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAEA,MAAM,iBAAiB,CACrB,SACA,SAC+B;AAC/B,MAAI,OAAO,YAAY;AAAU,WAAO;AAExC,QAAM,cAAc,OAAO,KAAK,OAAO;AACvC,MAAI,YAAY,QAAQ,YAAY;AAEpC,SAAO,OAAO;AAAA,IACZ,CAAC,GAAG,oBAAI,IAAI,CAAC,GAAG,MAAM,GAAG,WAAW,CAAC,CAAC,EAAE,IAAI,CAAC,QAAQ;AACnD,YAAM,QAAQ,QAAQ,QAAQ;AAC9B,kBAAY;AACZ,aAAO,CAAC,KAAK,KAAK;AAAA,IACpB,CAAC;AAAA,EACH;AACF;AAEO,MAAM,aAAa,CAAwB,SAAe;AAC/D,QAAM,WAAW,OAAO,KAAK,KAAK,IAAI;AAEtC,QAAM,gBAAgB,OAAO;AAAA,IAC3B,OAAO,QAAQ,IAAI,EAAE,IAAI,CAAC,CAAC,KAAK,OAAO,MAAM;AAC3C,YAAM,WAAW,QAAQ,SAAS,cAAc;AAEhD,aAAO,CAAC,KAAK,eAAe,SAAS,QAAQ,CAAC;AAAA,IAChD,CAAC;AAAA,EACH;AAEA,SAAO,OAAO,OAAO,aAAa;AACpC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamagui/core",
|
|
3
|
-
"version": "1.0.1-beta.
|
|
3
|
+
"version": "1.0.1-beta.213",
|
|
4
4
|
"source": "src/index.ts",
|
|
5
5
|
"main": "dist/cjs",
|
|
6
6
|
"module": "dist/esm",
|
|
@@ -28,23 +28,23 @@
|
|
|
28
28
|
],
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"@expo/match-media": "^0.3.0",
|
|
31
|
-
"@tamagui/compose-refs": "^1.0.1-beta.
|
|
32
|
-
"@tamagui/constants": "^1.0.1-beta.
|
|
33
|
-
"@tamagui/helpers": "^1.0.1-beta.
|
|
34
|
-
"@tamagui/normalize-css-color-lite": "^1.0.1-beta.
|
|
35
|
-
"@tamagui/react-native-use-pressable": "^1.0.1-beta.
|
|
36
|
-
"@tamagui/react-native-use-responder-events": "^1.0.1-beta.
|
|
37
|
-
"@tamagui/types-react-native": "^1.0.1-beta.
|
|
38
|
-
"@tamagui/use-did-finish-ssr": "^1.0.1-beta.
|
|
39
|
-
"@tamagui/use-event": "^1.0.1-beta.
|
|
40
|
-
"@tamagui/use-force-update": "^1.0.1-beta.
|
|
31
|
+
"@tamagui/compose-refs": "^1.0.1-beta.213",
|
|
32
|
+
"@tamagui/constants": "^1.0.1-beta.213",
|
|
33
|
+
"@tamagui/helpers": "^1.0.1-beta.213",
|
|
34
|
+
"@tamagui/normalize-css-color-lite": "^1.0.1-beta.213",
|
|
35
|
+
"@tamagui/react-native-use-pressable": "^1.0.1-beta.213",
|
|
36
|
+
"@tamagui/react-native-use-responder-events": "^1.0.1-beta.213",
|
|
37
|
+
"@tamagui/types-react-native": "^1.0.1-beta.213",
|
|
38
|
+
"@tamagui/use-did-finish-ssr": "^1.0.1-beta.213",
|
|
39
|
+
"@tamagui/use-event": "^1.0.1-beta.213",
|
|
40
|
+
"@tamagui/use-force-update": "^1.0.1-beta.213"
|
|
41
41
|
},
|
|
42
42
|
"peerDependencies": {
|
|
43
43
|
"react": "*",
|
|
44
44
|
"react-dom": "*"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
|
-
"@tamagui/build": "^1.0.1-beta.
|
|
47
|
+
"@tamagui/build": "^1.0.1-beta.213",
|
|
48
48
|
"@types/node": "^16.11.9",
|
|
49
49
|
"@types/react": "^18.0.15",
|
|
50
50
|
"@types/react-native": "^0.69.2",
|
package/src/createFont.ts
CHANGED
|
@@ -18,10 +18,11 @@ const processSection = <T>(
|
|
|
18
18
|
): string | Record<string, T> => {
|
|
19
19
|
if (typeof section === 'string') return section
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
const sectionKeys = Object.keys(section)
|
|
22
|
+
let fillValue = section[sectionKeys[0]]
|
|
22
23
|
|
|
23
24
|
return Object.fromEntries(
|
|
24
|
-
keys.map((key) => {
|
|
25
|
+
[...new Set([...keys, ...sectionKeys])].map((key) => {
|
|
25
26
|
const value = section[key] ?? fillValue
|
|
26
27
|
fillValue = value
|
|
27
28
|
return [key, value]
|
|
@@ -32,7 +33,7 @@ const processSection = <T>(
|
|
|
32
33
|
export const createFont = <A extends GenericFont>(font: A): A => {
|
|
33
34
|
const sizeKeys = Object.keys(font.size)
|
|
34
35
|
|
|
35
|
-
Object.fromEntries(
|
|
36
|
+
const processedFont = Object.fromEntries(
|
|
36
37
|
Object.entries(font).map(([key, section]) => {
|
|
37
38
|
const fillKeys = key === 'face' ? fontWeights : sizeKeys
|
|
38
39
|
|
|
@@ -40,5 +41,5 @@ export const createFont = <A extends GenericFont>(font: A): A => {
|
|
|
40
41
|
})
|
|
41
42
|
)
|
|
42
43
|
|
|
43
|
-
return Object.freeze(
|
|
44
|
+
return Object.freeze(processedFont) as A
|
|
44
45
|
}
|