@tamagui/static 1.0.1-beta.103 → 1.0.1-beta.104
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/extractor/createExtractor.js +5 -39
- package/dist/cjs/extractor/createExtractor.js.map +2 -2
- package/dist/esm/extractor/createExtractor.js +6 -41
- package/dist/esm/extractor/createExtractor.js.map +2 -2
- package/dist/jsx/extractor/createExtractor.js +6 -41
- package/dist/jsx/extractor/createExtractor.js.map +2 -2
- package/package.json +8 -8
- package/src/extractor/createExtractor.ts +4 -60
- package/types/extractor/createExtractor.d.ts.map +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamagui/static",
|
|
3
|
-
"version": "1.0.1-beta.
|
|
3
|
+
"version": "1.0.1-beta.104",
|
|
4
4
|
"source": "src/index.ts",
|
|
5
5
|
"types": "./types/index.d.ts",
|
|
6
6
|
"main": "dist/cjs",
|
|
@@ -38,12 +38,12 @@
|
|
|
38
38
|
"@babel/parser": "^7.15.7",
|
|
39
39
|
"@babel/traverse": "^7.15.4",
|
|
40
40
|
"@expo/match-media": "^0.3.0",
|
|
41
|
-
"@tamagui/build": "^1.0.1-beta.
|
|
42
|
-
"@tamagui/core-node": "^1.0.1-beta.
|
|
43
|
-
"@tamagui/fake-react-native": "^1.0.1-beta.
|
|
44
|
-
"@tamagui/helpers": "^1.0.1-beta.
|
|
45
|
-
"@tamagui/patch-rnw": "^1.0.1-beta.
|
|
46
|
-
"@tamagui/proxy-worm": "^1.0.1-beta.
|
|
41
|
+
"@tamagui/build": "^1.0.1-beta.104",
|
|
42
|
+
"@tamagui/core-node": "^1.0.1-beta.104",
|
|
43
|
+
"@tamagui/fake-react-native": "^1.0.1-beta.104",
|
|
44
|
+
"@tamagui/helpers": "^1.0.1-beta.104",
|
|
45
|
+
"@tamagui/patch-rnw": "^1.0.1-beta.104",
|
|
46
|
+
"@tamagui/proxy-worm": "^1.0.1-beta.104",
|
|
47
47
|
"babel-literal-to-ast": "^2.1.0",
|
|
48
48
|
"esbuild": "^0.14.48",
|
|
49
49
|
"esbuild-register": "^3.3.2",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"fs-extra": "^10.1.0",
|
|
52
52
|
"invariant": "^2.2.4",
|
|
53
53
|
"lodash": "^4.17.21",
|
|
54
|
-
"tamagui": "^1.0.1-beta.
|
|
54
|
+
"tamagui": "^1.0.1-beta.104"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
57
|
"@babel/plugin-syntax-typescript": "^7.14.5",
|
|
@@ -13,9 +13,7 @@ import {
|
|
|
13
13
|
mediaQueryConfig,
|
|
14
14
|
proxyThemeVariables,
|
|
15
15
|
pseudoDescriptors,
|
|
16
|
-
stylePropsTransform,
|
|
17
16
|
} from '@tamagui/core-node'
|
|
18
|
-
import { difference, pick } from 'lodash'
|
|
19
17
|
import type { ViewStyle } from 'react-native'
|
|
20
18
|
|
|
21
19
|
import { FAILED_EVAL } from '../constants'
|
|
@@ -371,10 +369,8 @@ export function createExtractor() {
|
|
|
371
369
|
}
|
|
372
370
|
|
|
373
371
|
for (const atomic of atomics) {
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
out.rulesToInsert.push([atomic.identifier, rule])
|
|
377
|
-
}
|
|
372
|
+
out.rulesToInsert = out.rulesToInsert || []
|
|
373
|
+
out.rulesToInsert.push(atomic)
|
|
378
374
|
classNames[atomic.property] = atomic.identifier
|
|
379
375
|
}
|
|
380
376
|
|
|
@@ -391,8 +387,8 @@ export function createExtractor() {
|
|
|
391
387
|
}
|
|
392
388
|
|
|
393
389
|
if (out.rulesToInsert) {
|
|
394
|
-
for (const
|
|
395
|
-
onStyleRule?.(identifier,
|
|
390
|
+
for (const { identifier, rules } of out.rulesToInsert) {
|
|
391
|
+
onStyleRule?.(identifier, rules)
|
|
396
392
|
}
|
|
397
393
|
}
|
|
398
394
|
|
|
@@ -1706,22 +1702,6 @@ export function createExtractor() {
|
|
|
1706
1702
|
}
|
|
1707
1703
|
}
|
|
1708
1704
|
|
|
1709
|
-
function omitInvalidStyles(style: any) {
|
|
1710
|
-
if (staticConfig.validStyles) {
|
|
1711
|
-
for (const key in style) {
|
|
1712
|
-
if (
|
|
1713
|
-
stylePropsTransform[key] ||
|
|
1714
|
-
(!staticConfig.validStyles[key] &&
|
|
1715
|
-
!pseudoDescriptors[key] &&
|
|
1716
|
-
!/(hoverStyle|focusStyle|pressStyle)$/.test(key))
|
|
1717
|
-
) {
|
|
1718
|
-
if (shouldPrintDebug) console.log(' delete invalid style', key)
|
|
1719
|
-
delete style[key]
|
|
1720
|
-
}
|
|
1721
|
-
}
|
|
1722
|
-
}
|
|
1723
|
-
}
|
|
1724
|
-
|
|
1725
1705
|
// used to ensure we pass the entire prop bundle to getStyles
|
|
1726
1706
|
const completeStyles = getStyles(completeProps, 'completeStyles')
|
|
1727
1707
|
|
|
@@ -1729,33 +1709,6 @@ export function createExtractor() {
|
|
|
1729
1709
|
throw new Error(`Impossible, no styles`)
|
|
1730
1710
|
}
|
|
1731
1711
|
|
|
1732
|
-
// any extra styles added in postprocess should be added to first group as they wont be overriden
|
|
1733
|
-
const addInitialStyleKeys = shouldFlatten
|
|
1734
|
-
? difference(Object.keys(completeStyles), Object.keys(foundStaticProps))
|
|
1735
|
-
: []
|
|
1736
|
-
|
|
1737
|
-
if (addInitialStyleKeys.length) {
|
|
1738
|
-
const toAdd = pick(completeStyles, ...addInitialStyleKeys)
|
|
1739
|
-
const firstGroup = attrs.find((x) => x.type === 'style')
|
|
1740
|
-
if (shouldPrintDebug) {
|
|
1741
|
-
console.log(' toAdd', objToStr(toAdd))
|
|
1742
|
-
}
|
|
1743
|
-
if (!firstGroup) {
|
|
1744
|
-
attrs.unshift({ type: 'style', value: toAdd })
|
|
1745
|
-
} else {
|
|
1746
|
-
// because were adding fully processed, remove any unprocessed from first group
|
|
1747
|
-
omitInvalidStyles(firstGroup.value)
|
|
1748
|
-
Object.assign(firstGroup.value, toAdd)
|
|
1749
|
-
}
|
|
1750
|
-
}
|
|
1751
|
-
|
|
1752
|
-
if (shouldPrintDebug) {
|
|
1753
|
-
// prettier-ignore
|
|
1754
|
-
if (shouldFlatten) console.log(' -- addInitialStyleKeys', addInitialStyleKeys.join(', '))
|
|
1755
|
-
// prettier-ignore
|
|
1756
|
-
// console.log(' -- completeStyles:\n', logLines(objToStr(completeStyles)))
|
|
1757
|
-
}
|
|
1758
|
-
|
|
1759
1712
|
let getStyleError: any = null
|
|
1760
1713
|
|
|
1761
1714
|
// fix up ternaries, combine final style values
|
|
@@ -1815,15 +1768,6 @@ export function createExtractor() {
|
|
|
1815
1768
|
// map to HTML only name
|
|
1816
1769
|
attr.value.name.name = INLINE_EXTRACTABLE[name]
|
|
1817
1770
|
}
|
|
1818
|
-
|
|
1819
|
-
// if flattening expand turn variants into styles
|
|
1820
|
-
if (staticConfig.variants?.[name]) {
|
|
1821
|
-
const expanded = getStyles({})
|
|
1822
|
-
// attrs[i] = {
|
|
1823
|
-
// type: 'style',
|
|
1824
|
-
// value:
|
|
1825
|
-
// }
|
|
1826
|
-
}
|
|
1827
1771
|
}
|
|
1828
1772
|
}
|
|
1829
1773
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createExtractor.d.ts","sourceRoot":"","sources":["../../src/extractor/createExtractor.ts"],"names":[],"mappings":"AAEA,OAAiB,EAAE,QAAQ,EAAW,MAAM,iBAAiB,CAAA;AAC7D,OAAO,KAAK,CAAC,MAAM,cAAc,CAAA;AACjC,OAAO,EAGL,qBAAqB,
|
|
1
|
+
{"version":3,"file":"createExtractor.d.ts","sourceRoot":"","sources":["../../src/extractor/createExtractor.ts"],"names":[],"mappings":"AAEA,OAAiB,EAAE,QAAQ,EAAW,MAAM,iBAAiB,CAAA;AAC7D,OAAO,KAAK,CAAC,MAAM,cAAc,CAAA;AACjC,OAAO,EAGL,qBAAqB,EAQtB,MAAM,oBAAoB,CAAA;AAI3B,OAAO,EAIL,mBAAmB,EAEpB,MAAM,UAAU,CAAA;AAqCjB,oBAAY,SAAS,GAAG,UAAU,CAAC,OAAO,eAAe,CAAC,CAAA;AAI1D,wBAAgB,eAAe;;;;;;;;;;;;;;wBAgCb,SAAS,EAAE,OAAO,CAAC,GAAG,MAAM,iSAoBrC,mBAAmB;;;;;;;EAytD3B"}
|