@tamagui/web 3.0.0-beta.807.1 → 3.0.0-beta.831.1
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/config.cjs +1 -1
- package/dist/cjs/config.native.cjs +1 -1
- package/dist/cjs/config.native.js +1 -1
- package/dist/cjs/config.native.js.map +1 -1
- package/dist/cjs/createComponent.cjs +28 -18
- package/dist/cjs/createComponent.native.cjs +30 -20
- package/dist/cjs/createComponent.native.js +30 -20
- package/dist/cjs/createComponent.native.js.map +1 -1
- package/dist/cjs/createStyledHOC.cjs +54 -4
- package/dist/cjs/createStyledHOC.native.cjs +55 -4
- package/dist/cjs/createStyledHOC.native.js +55 -4
- package/dist/cjs/createStyledHOC.native.js.map +1 -1
- package/dist/cjs/createTokens.cjs +1 -1
- package/dist/cjs/createTokens.native.cjs +1 -1
- package/dist/cjs/createTokens.native.js +1 -1
- package/dist/cjs/createTokens.native.js.map +1 -1
- package/dist/cjs/dom/html.cjs +147 -99
- package/dist/cjs/dom/htmlRuntime.native.cjs +6 -2
- package/dist/cjs/dom/htmlRuntime.native.js +6 -2
- package/dist/cjs/dom/htmlRuntime.native.js.map +1 -1
- package/dist/cjs/dom/primitives.native.cjs +16 -13
- package/dist/cjs/dom/primitives.native.js +16 -13
- package/dist/cjs/dom/primitives.native.js.map +1 -1
- package/dist/cjs/helpers/componentDisplayName.cjs +1 -11
- package/dist/cjs/helpers/componentDisplayName.native.cjs +1 -11
- package/dist/cjs/helpers/componentDisplayName.native.js +1 -11
- package/dist/cjs/helpers/componentDisplayName.native.js.map +1 -1
- package/dist/cjs/helpers/directStyleCSS.cjs +101 -104
- package/dist/cjs/helpers/formatDiagnostic.cjs +2 -4
- package/dist/cjs/helpers/formatDiagnostic.native.cjs +2 -4
- package/dist/cjs/helpers/formatDiagnostic.native.js +2 -4
- package/dist/cjs/helpers/formatDiagnostic.native.js.map +1 -1
- package/dist/cjs/helpers/getCSSStylesAtomic.cjs +10 -10
- package/dist/cjs/helpers/getSplitStyles.cjs +168 -600
- package/dist/cjs/helpers/getSplitStyles.native.cjs +168 -762
- package/dist/cjs/helpers/getSplitStyles.native.js +168 -762
- package/dist/cjs/helpers/getSplitStyles.native.js.map +1 -1
- package/dist/cjs/helpers/splitStyleProps.cjs +46 -0
- package/dist/cjs/helpers/splitStyleProps.native.cjs +49 -0
- package/dist/cjs/helpers/splitStyleProps.native.js +51 -0
- package/dist/cjs/helpers/splitStyleProps.native.js.map +1 -0
- package/dist/cjs/helpers/styleStaticConfig.cjs +76 -0
- package/dist/cjs/helpers/styleStaticConfig.native.cjs +79 -0
- package/dist/cjs/helpers/styleStaticConfig.native.js +81 -0
- package/dist/cjs/helpers/styleStaticConfig.native.js.map +1 -0
- package/dist/cjs/helpers/tokenCategories.cjs +32 -71
- package/dist/cjs/helpers/tokenCategories.native.cjs +34 -73
- package/dist/cjs/helpers/tokenCategories.native.js +34 -73
- package/dist/cjs/helpers/tokenCategories.native.js.map +1 -1
- package/dist/cjs/helpers/variantResolvers.cjs +87 -0
- package/dist/cjs/helpers/variantResolvers.native.cjs +140 -0
- package/dist/cjs/helpers/variantResolvers.native.js +142 -0
- package/dist/cjs/helpers/variantResolvers.native.js.map +1 -0
- package/dist/cjs/hooks/useSplitStyles.cjs +2 -2
- package/dist/cjs/hooks/useSplitStyles.native.cjs +2 -2
- package/dist/cjs/hooks/useSplitStyles.native.js +2 -2
- package/dist/cjs/hooks/useSplitStyles.native.js.map +1 -1
- package/dist/cjs/index.cjs +3 -9
- package/dist/cjs/index.native.cjs +3 -9
- package/dist/cjs/index.native.js +3 -9
- package/dist/cjs/index.native.js.map +1 -1
- package/dist/cjs/internal-runtime.cjs +8 -7
- package/dist/cjs/internal-runtime.native.cjs +8 -7
- package/dist/cjs/internal-runtime.native.js +8 -7
- package/dist/cjs/internal-runtime.native.js.map +1 -1
- package/dist/cjs/static-resolve.cjs +6 -5
- package/dist/cjs/static-resolve.native.cjs +6 -5
- package/dist/cjs/static-resolve.native.js +6 -5
- package/dist/cjs/static-resolve.native.js.map +1 -1
- package/dist/cjs/styled.cjs +4 -56
- package/dist/cjs/styled.native.cjs +4 -58
- package/dist/cjs/styled.native.js +4 -58
- package/dist/cjs/styled.native.js.map +1 -1
- package/dist/cjs/types.cjs +1 -21
- package/dist/cjs/types.native.cjs +1 -21
- package/dist/cjs/types.native.js +1 -21
- package/dist/cjs/types.native.js.map +1 -1
- package/dist/cjs/views/Text.cjs +4 -2
- package/dist/cjs/views/Text.native.cjs +4 -2
- package/dist/cjs/views/Text.native.js +4 -2
- package/dist/cjs/views/Text.native.js.map +1 -1
- package/dist/cjs/views/View.cjs +4 -2
- package/dist/cjs/views/View.native.cjs +4 -2
- package/dist/cjs/views/View.native.js +4 -2
- package/dist/cjs/views/View.native.js.map +1 -1
- package/dist/esm/config.mjs +1 -1
- package/dist/esm/config.mjs.map +1 -1
- package/dist/esm/config.native.js +1 -1
- package/dist/esm/config.native.js.map +1 -1
- package/dist/esm/createComponent.mjs +29 -19
- package/dist/esm/createComponent.mjs.map +1 -1
- package/dist/esm/createComponent.native.js +31 -21
- package/dist/esm/createComponent.native.js.map +1 -1
- package/dist/esm/createStyledHOC.mjs +55 -5
- package/dist/esm/createStyledHOC.mjs.map +1 -1
- package/dist/esm/createStyledHOC.native.js +56 -5
- package/dist/esm/createStyledHOC.native.js.map +1 -1
- package/dist/esm/createTokens.mjs +1 -1
- package/dist/esm/createTokens.mjs.map +1 -1
- package/dist/esm/createTokens.native.js +1 -1
- package/dist/esm/createTokens.native.js.map +1 -1
- package/dist/esm/dom/html.mjs +147 -99
- package/dist/esm/dom/html.mjs.map +1 -1
- package/dist/esm/dom/htmlRuntime.native.js +7 -3
- package/dist/esm/dom/htmlRuntime.native.js.map +1 -1
- package/dist/esm/dom/primitives.native.js +16 -13
- package/dist/esm/dom/primitives.native.js.map +1 -1
- package/dist/esm/helpers/componentDisplayName.mjs +1 -8
- package/dist/esm/helpers/componentDisplayName.mjs.map +1 -1
- package/dist/esm/helpers/componentDisplayName.native.js +1 -8
- package/dist/esm/helpers/componentDisplayName.native.js.map +1 -1
- package/dist/esm/helpers/directStyleCSS.mjs +101 -104
- package/dist/esm/helpers/directStyleCSS.mjs.map +1 -1
- package/dist/esm/helpers/formatDiagnostic.mjs +2 -4
- package/dist/esm/helpers/formatDiagnostic.mjs.map +1 -1
- package/dist/esm/helpers/formatDiagnostic.native.js +2 -4
- package/dist/esm/helpers/formatDiagnostic.native.js.map +1 -1
- package/dist/esm/helpers/getCSSStylesAtomic.mjs +10 -10
- package/dist/esm/helpers/getCSSStylesAtomic.mjs.map +1 -1
- package/dist/esm/helpers/getSplitStyles.mjs +166 -594
- package/dist/esm/helpers/getSplitStyles.mjs.map +1 -1
- package/dist/esm/helpers/getSplitStyles.native.js +166 -757
- package/dist/esm/helpers/getSplitStyles.native.js.map +1 -1
- package/dist/esm/helpers/splitStyleProps.mjs +27 -0
- package/dist/esm/helpers/splitStyleProps.mjs.map +1 -0
- package/dist/esm/helpers/splitStyleProps.native.js +28 -0
- package/dist/esm/helpers/splitStyleProps.native.js.map +1 -0
- package/dist/esm/helpers/styleStaticConfig.mjs +57 -0
- package/dist/esm/helpers/styleStaticConfig.mjs.map +1 -0
- package/dist/esm/helpers/styleStaticConfig.native.js +58 -0
- package/dist/esm/helpers/styleStaticConfig.native.js.map +1 -0
- package/dist/esm/helpers/tokenCategories.mjs +33 -72
- package/dist/esm/helpers/tokenCategories.mjs.map +1 -1
- package/dist/esm/helpers/tokenCategories.native.js +35 -74
- package/dist/esm/helpers/tokenCategories.native.js.map +1 -1
- package/dist/esm/helpers/variantResolvers.mjs +65 -0
- package/dist/esm/helpers/variantResolvers.mjs.map +1 -0
- package/dist/esm/helpers/variantResolvers.native.js +116 -0
- package/dist/esm/helpers/variantResolvers.native.js.map +1 -0
- package/dist/esm/hooks/useSplitStyles.mjs +2 -2
- package/dist/esm/hooks/useSplitStyles.mjs.map +1 -1
- package/dist/esm/hooks/useSplitStyles.native.js +2 -2
- package/dist/esm/hooks/useSplitStyles.native.js.map +1 -1
- package/dist/esm/index.js +3 -5
- package/dist/esm/index.mjs +3 -5
- package/dist/esm/index.native.js +3 -5
- package/dist/esm/internal-runtime.mjs +8 -7
- package/dist/esm/internal-runtime.mjs.map +1 -1
- package/dist/esm/internal-runtime.native.js +8 -7
- package/dist/esm/internal-runtime.native.js.map +1 -1
- package/dist/esm/static-resolve.mjs +8 -6
- package/dist/esm/static-resolve.mjs.map +1 -1
- package/dist/esm/static-resolve.native.js +8 -6
- package/dist/esm/static-resolve.native.js.map +1 -1
- package/dist/esm/styled.mjs +6 -57
- package/dist/esm/styled.mjs.map +1 -1
- package/dist/esm/styled.native.js +6 -59
- package/dist/esm/styled.native.js.map +1 -1
- package/dist/esm/types.mjs +1 -18
- package/dist/esm/types.mjs.map +1 -1
- package/dist/esm/types.native.js +1 -18
- package/dist/esm/types.native.js.map +1 -1
- package/dist/esm/views/Text.mjs +4 -2
- package/dist/esm/views/Text.mjs.map +1 -1
- package/dist/esm/views/Text.native.js +4 -2
- package/dist/esm/views/Text.native.js.map +1 -1
- package/dist/esm/views/View.mjs +4 -2
- package/dist/esm/views/View.mjs.map +1 -1
- package/dist/esm/views/View.native.js +4 -2
- package/dist/esm/views/View.native.js.map +1 -1
- package/package.json +15 -15
- package/src/config.ts +1 -1
- package/src/createComponent.tsx +41 -30
- package/src/createStyledHOC.tsx +56 -9
- package/src/createTokens.ts +1 -1
- package/src/dom/html.tsx +778 -877
- package/src/dom/htmlRuntime.native.tsx +7 -3
- package/src/dom/primitives.native.tsx +30 -39
- package/src/helpers/componentDisplayName.ts +0 -11
- package/src/helpers/directStyleCSS.ts +91 -112
- package/src/helpers/formatDiagnostic.ts +2 -4
- package/src/helpers/getCSSStylesAtomic.ts +32 -26
- package/src/helpers/getSplitStyles.tsx +315 -1119
- package/src/helpers/getVariantExtras.tsx +3 -3
- package/src/helpers/splitStyleProps.ts +166 -0
- package/src/helpers/styleFrontend.ts +8 -4
- package/src/helpers/styleStaticConfig.ts +88 -0
- package/src/helpers/tokenCategories.ts +62 -93
- package/src/helpers/variantResolvers.ts +121 -0
- package/src/hooks/useSplitStyles.tsx +17 -2
- package/src/hooks/useTheme.tsx +1 -1
- package/src/index.ts +8 -4
- package/src/internal-runtime.ts +10 -9
- package/src/static-resolve.ts +18 -14
- package/src/styled.tsx +7 -264
- package/src/types.tsx +19 -40
- package/src/views/Text.tsx +6 -7
- package/src/views/View.tsx +6 -7
- package/types/createComponent.d.ts.map +1 -1
- package/types/createStyledHOC.d.ts.map +1 -1
- package/types/dom/html.d.ts.map +1 -1
- package/types/dom/htmlRuntime.native.d.ts.map +1 -1
- package/types/dom/primitives.native.d.ts.map +1 -1
- package/types/helpers/componentDisplayName.d.ts +0 -3
- package/types/helpers/componentDisplayName.d.ts.map +1 -1
- package/types/helpers/directStyleCSS.d.ts.map +1 -1
- package/types/helpers/formatDiagnostic.d.ts.map +1 -1
- package/types/helpers/getCSSStylesAtomic.d.ts +17 -15
- package/types/helpers/getCSSStylesAtomic.d.ts.map +1 -1
- package/types/helpers/getSplitStyles.d.ts +6 -6
- package/types/helpers/getSplitStyles.d.ts.map +1 -1
- package/types/helpers/splitStyleProps.d.ts +44 -0
- package/types/helpers/splitStyleProps.d.ts.map +1 -0
- package/types/helpers/styleFrontend.d.ts +4 -4
- package/types/helpers/styleFrontend.d.ts.map +1 -1
- package/types/helpers/styleStaticConfig.d.ts +19 -0
- package/types/helpers/styleStaticConfig.d.ts.map +1 -0
- package/types/helpers/tokenCategories.d.ts +1 -1
- package/types/helpers/tokenCategories.d.ts.map +1 -1
- package/types/helpers/variantResolvers.d.ts +9 -0
- package/types/helpers/variantResolvers.d.ts.map +1 -0
- package/types/hooks/useSplitStyles.d.ts.map +1 -1
- package/types/index.d.ts +2 -4
- package/types/index.d.ts.map +1 -1
- package/types/internal-runtime.d.ts.map +1 -1
- package/types/static-resolve.d.ts +2 -2
- package/types/static-resolve.d.ts.map +1 -1
- package/types/styled.d.ts +3 -39
- package/types/styled.d.ts.map +1 -1
- package/types/types.d.ts +2 -12
- package/types/types.d.ts.map +1 -1
- package/types/views/Text.d.ts.map +1 -1
- package/types/views/View.d.ts.map +1 -1
- package/dist/cjs/helpers/getDefaultProps.cjs +0 -24
- package/dist/cjs/helpers/getDefaultProps.native.cjs +0 -28
- package/dist/cjs/helpers/getDefaultProps.native.js +0 -30
- package/dist/cjs/helpers/getDefaultProps.native.js.map +0 -1
- package/dist/cjs/helpers/themeable.cjs +0 -92
- package/dist/cjs/helpers/themeable.native.cjs +0 -95
- package/dist/cjs/helpers/themeable.native.js +0 -97
- package/dist/cjs/helpers/themeable.native.js.map +0 -1
- package/dist/cjs/hooks/useProps.cjs +0 -129
- package/dist/cjs/hooks/useProps.native.cjs +0 -135
- package/dist/cjs/hooks/useProps.native.js +0 -137
- package/dist/cjs/hooks/useProps.native.js.map +0 -1
- package/dist/esm/helpers/getDefaultProps.mjs +0 -4
- package/dist/esm/helpers/getDefaultProps.mjs.map +0 -1
- package/dist/esm/helpers/getDefaultProps.native.js +0 -6
- package/dist/esm/helpers/getDefaultProps.native.js.map +0 -1
- package/dist/esm/helpers/themeable.mjs +0 -67
- package/dist/esm/helpers/themeable.mjs.map +0 -1
- package/dist/esm/helpers/themeable.native.js +0 -68
- package/dist/esm/helpers/themeable.native.js.map +0 -1
- package/dist/esm/hooks/useProps.mjs +0 -100
- package/dist/esm/hooks/useProps.mjs.map +0 -1
- package/dist/esm/hooks/useProps.native.js +0 -104
- package/dist/esm/hooks/useProps.native.js.map +0 -1
- package/src/helpers/getDefaultProps.ts +0 -3
- package/src/helpers/themeable.tsx +0 -96
- package/src/hooks/useProps.tsx +0 -186
- package/types/helpers/getDefaultProps.d.ts +0 -3
- package/types/helpers/getDefaultProps.d.ts.map +0 -1
- package/types/helpers/themeable.d.ts +0 -3
- package/types/helpers/themeable.d.ts.map +0 -1
- package/types/hooks/useProps.d.ts +0 -39
- package/types/hooks/useProps.d.ts.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ComponentType, FunctionComponent } from 'react'
|
|
2
2
|
import { jsx } from 'react/jsx-runtime'
|
|
3
3
|
|
|
4
|
-
import {
|
|
4
|
+
import { componentDisplayName } from '../helpers/componentDisplayName'
|
|
5
5
|
import { DOMText } from './primitives.native'
|
|
6
6
|
|
|
7
7
|
/**
|
|
@@ -203,7 +203,9 @@ export function createDOMTagFactory(tables: DOMPropTables) {
|
|
|
203
203
|
): Frame {
|
|
204
204
|
const Tag: FunctionComponent<Record<string, any>> = (props) =>
|
|
205
205
|
jsx(Component, resolveDOMProps(props, tag, spec, tables))
|
|
206
|
-
|
|
206
|
+
Tag.displayName = tag
|
|
207
|
+
;(Tag as any)[componentDisplayName] = tag
|
|
208
|
+
return Tag as unknown as Frame
|
|
207
209
|
}
|
|
208
210
|
}
|
|
209
211
|
|
|
@@ -217,5 +219,7 @@ export function unsupportedDOMTag(tag: string, note: string) {
|
|
|
217
219
|
const Tag: { (): never; displayName?: string } = () => {
|
|
218
220
|
throw new Error(`html.${tag} is not supported on native: ${note}`)
|
|
219
221
|
}
|
|
220
|
-
|
|
222
|
+
Tag.displayName = tag
|
|
223
|
+
;(Tag as any)[componentDisplayName] = tag
|
|
224
|
+
return Tag
|
|
221
225
|
}
|
|
@@ -32,7 +32,6 @@ import type {
|
|
|
32
32
|
DOMViewProps,
|
|
33
33
|
} from './contract'
|
|
34
34
|
import { createComponent } from '../createComponent'
|
|
35
|
-
import { setComponentDisplayName } from '../helpers/componentDisplayName'
|
|
36
35
|
import { textStaticConfig } from '../views/Text'
|
|
37
36
|
import { viewStaticConfig } from '../views/View'
|
|
38
37
|
|
|
@@ -554,44 +553,36 @@ function renderDOMTextInput(resolved: DOMTextInputProps) {
|
|
|
554
553
|
return jsx(TextInput, next)
|
|
555
554
|
}
|
|
556
555
|
|
|
557
|
-
const DOMRuntimeViewFrame =
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
createComponent({
|
|
588
|
-
...textStaticConfig,
|
|
589
|
-
neverSkipProps: domEventProps,
|
|
590
|
-
Component: DOMTextInput as any,
|
|
591
|
-
neverFlatten: true,
|
|
592
|
-
}),
|
|
593
|
-
'DOMRuntimeTextInput'
|
|
594
|
-
)
|
|
556
|
+
const DOMRuntimeViewFrame = createComponent({
|
|
557
|
+
...viewStaticConfig,
|
|
558
|
+
validStyles: { ...viewStaticConfig.validStyles, ...textStaticConfig.validStyles },
|
|
559
|
+
neverSkipProps: domEventProps,
|
|
560
|
+
Component: DOMView as any,
|
|
561
|
+
neverFlatten: true,
|
|
562
|
+
displayName: 'DOMRuntimeView',
|
|
563
|
+
})
|
|
564
|
+
const DOMRuntimeTextFrame = createComponent({
|
|
565
|
+
...textStaticConfig,
|
|
566
|
+
neverSkipProps: domEventProps,
|
|
567
|
+
Component: DOMText as any,
|
|
568
|
+
neverFlatten: true,
|
|
569
|
+
displayName: 'DOMRuntimeText',
|
|
570
|
+
})
|
|
571
|
+
const DOMRuntimeImageFrame = createComponent({
|
|
572
|
+
...viewStaticConfig,
|
|
573
|
+
validStyles: { ...viewStaticConfig.validStyles, ...textStaticConfig.validStyles },
|
|
574
|
+
neverSkipProps: domEventProps,
|
|
575
|
+
Component: DOMImage as any,
|
|
576
|
+
neverFlatten: true,
|
|
577
|
+
displayName: 'DOMRuntimeImage',
|
|
578
|
+
})
|
|
579
|
+
const DOMRuntimeTextInputFrame = createComponent({
|
|
580
|
+
...textStaticConfig,
|
|
581
|
+
neverSkipProps: domEventProps,
|
|
582
|
+
Component: DOMTextInput as any,
|
|
583
|
+
neverFlatten: true,
|
|
584
|
+
displayName: 'DOMRuntimeTextInput',
|
|
585
|
+
})
|
|
595
586
|
|
|
596
587
|
function runtimeProps<T extends DOMMetadata>(props: T) {
|
|
597
588
|
const { __styles, ...rest } = props
|
|
@@ -1,14 +1,3 @@
|
|
|
1
1
|
export const componentDisplayName = /* @__PURE__ */ Symbol.for(
|
|
2
2
|
'tamagui.componentDisplayName'
|
|
3
3
|
)
|
|
4
|
-
|
|
5
|
-
export function setComponentDisplayName<T extends { displayName?: string }>(
|
|
6
|
-
component: T,
|
|
7
|
-
displayName?: string
|
|
8
|
-
) {
|
|
9
|
-
if (displayName) {
|
|
10
|
-
component.displayName = displayName
|
|
11
|
-
;(component as any)[componentDisplayName] = displayName
|
|
12
|
-
}
|
|
13
|
-
return component
|
|
14
|
-
}
|
|
@@ -57,25 +57,20 @@ export function requestBorderStyleDefault(
|
|
|
57
57
|
if (!target) return
|
|
58
58
|
const requests = ((state as DirectAtomicState).flatBorderDefaultRequests ||= [])
|
|
59
59
|
for (let index = 0; index < requests.length; index++) {
|
|
60
|
-
if (requests[index]
|
|
60
|
+
if (requests[index][0] === target && requests[index][3] === identity) {
|
|
61
61
|
return
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
for (let index = 0; index < wrapperCount; index++) {
|
|
68
|
-
wrappers[index] = wrapperSource[wrapperStart + index]
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
requests.push({
|
|
72
|
-
property: target,
|
|
73
|
-
value: 'solid',
|
|
64
|
+
requests.push([
|
|
65
|
+
target,
|
|
66
|
+
'solid',
|
|
74
67
|
condition,
|
|
75
68
|
identity,
|
|
76
69
|
selector,
|
|
77
|
-
|
|
78
|
-
|
|
70
|
+
wrapperSource,
|
|
71
|
+
wrapperStart,
|
|
72
|
+
wrapperCount,
|
|
73
|
+
])
|
|
79
74
|
}
|
|
80
75
|
|
|
81
76
|
export function directStyleSignature(
|
|
@@ -105,16 +100,16 @@ function registerSlot(
|
|
|
105
100
|
const ordered: AtomicSlotEntry[] = []
|
|
106
101
|
for (let index = 0; index < entries.length; index++) {
|
|
107
102
|
const entry = entries[index]
|
|
108
|
-
let value = entry
|
|
109
|
-
if (entry
|
|
103
|
+
let value = entry[1]
|
|
104
|
+
if (entry[0] === 'transform' && Array.isArray(value)) {
|
|
110
105
|
value = transformsToString(value)
|
|
111
106
|
}
|
|
112
|
-
|
|
113
|
-
const precedence = entry
|
|
107
|
+
entry[1] = normalizeValueWithProperty(value, entry[0])
|
|
108
|
+
const precedence = entry[2] ? Math.floor(entry[2] / 256) : -1
|
|
114
109
|
let insertAt = ordered.length
|
|
115
110
|
while (insertAt > 0) {
|
|
116
111
|
const before = ordered[insertAt - 1]
|
|
117
|
-
const beforePrecedence = before
|
|
112
|
+
const beforePrecedence = before[2] ? Math.floor(before[2] / 256) : -1
|
|
118
113
|
if (beforePrecedence <= precedence) break
|
|
119
114
|
insertAt--
|
|
120
115
|
}
|
|
@@ -123,32 +118,24 @@ function registerSlot(
|
|
|
123
118
|
let signature = ''
|
|
124
119
|
for (let index = 0; index < ordered.length; index++) {
|
|
125
120
|
const entry = ordered[index]
|
|
126
|
-
signature += directStyleSignature(entry
|
|
121
|
+
signature += directStyleSignature(entry[0], entry[1], entry[3])
|
|
127
122
|
}
|
|
128
123
|
const built = buildAtomicSlotCSS(atomicKey, ordered, signature)
|
|
129
124
|
if (!built) return
|
|
130
|
-
const styleObject = (
|
|
125
|
+
const styleObject = (built[3] ||= [
|
|
131
126
|
atomicKey,
|
|
132
|
-
built
|
|
133
|
-
built
|
|
127
|
+
built[2],
|
|
128
|
+
built[0],
|
|
134
129
|
undefined,
|
|
135
|
-
built
|
|
130
|
+
built[1],
|
|
136
131
|
]) as StyleObject
|
|
137
132
|
;(state.flatAtomics ||= {})[atomicKey] = styleObject
|
|
138
|
-
state.classNames[atomicKey] = built
|
|
133
|
+
state.classNames[atomicKey] = built[0]
|
|
139
134
|
}
|
|
140
135
|
|
|
141
|
-
// shared scratch for streamed single-
|
|
142
|
-
|
|
143
|
-
const
|
|
144
|
-
property: '',
|
|
145
|
-
value: '',
|
|
146
|
-
condition: 0,
|
|
147
|
-
identity: '',
|
|
148
|
-
selector: '',
|
|
149
|
-
wrappers: undefined,
|
|
150
|
-
}
|
|
151
|
-
const streamSlot: AtomicSlotEntry[] = [streamEntry]
|
|
136
|
+
// shared synchronous scratch for streamed and composition single-entry slots
|
|
137
|
+
const scratchEntry: AtomicSlotEntry = ['', '', 0, '', '', undefined, 0, 0]
|
|
138
|
+
const singleSlot: AtomicSlotEntry[] = [scratchEntry]
|
|
152
139
|
|
|
153
140
|
function appendSlotEntry(
|
|
154
141
|
list: AtomicSlotEntry[],
|
|
@@ -164,23 +151,26 @@ function appendSlotEntry(
|
|
|
164
151
|
original?: any
|
|
165
152
|
) {
|
|
166
153
|
for (let index = 0; index < list.length; index++) {
|
|
167
|
-
if (list[index]
|
|
154
|
+
if (list[index][3] === identity) {
|
|
168
155
|
// a weak write never displaces the identity's existing contribution
|
|
169
156
|
if (weak) return
|
|
170
|
-
list[index]
|
|
171
|
-
list[index]
|
|
172
|
-
list[index]
|
|
157
|
+
list[index][1] = value
|
|
158
|
+
list[index][2] = condition
|
|
159
|
+
list[index][8] = original
|
|
173
160
|
return
|
|
174
161
|
}
|
|
175
162
|
}
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
163
|
+
list.push([
|
|
164
|
+
property,
|
|
165
|
+
value,
|
|
166
|
+
condition,
|
|
167
|
+
identity,
|
|
168
|
+
selector,
|
|
169
|
+
wrapperSource,
|
|
170
|
+
wrapperStart,
|
|
171
|
+
wrapperCount,
|
|
172
|
+
original,
|
|
173
|
+
])
|
|
184
174
|
}
|
|
185
175
|
|
|
186
176
|
/**
|
|
@@ -233,7 +223,7 @@ export function streamAtomic(
|
|
|
233
223
|
const atomics = direct.flatAtomics
|
|
234
224
|
const streamed = atomics ? atomics[property] : undefined
|
|
235
225
|
if (singleEntry) {
|
|
236
|
-
if (singleEntry
|
|
226
|
+
if (singleEntry[3] !== identity) {
|
|
237
227
|
// second distinct contribution: promote the single into a combined slot
|
|
238
228
|
delete singleEntries![property]
|
|
239
229
|
const list = ((direct.flatSlots ||= {})[property] = [singleEntry])
|
|
@@ -259,14 +249,7 @@ export function streamAtomic(
|
|
|
259
249
|
// style object, so promotion needs no side record
|
|
260
250
|
if (identity) {
|
|
261
251
|
const list = ((direct.flatSlots ||= {})[property] = [
|
|
262
|
-
|
|
263
|
-
property,
|
|
264
|
-
value: (streamed as any)[1],
|
|
265
|
-
condition: 0,
|
|
266
|
-
identity: '',
|
|
267
|
-
selector: '',
|
|
268
|
-
wrappers: undefined,
|
|
269
|
-
},
|
|
252
|
+
[property, (streamed as any)[1], 0, '', '', undefined, 0, 0],
|
|
270
253
|
])
|
|
271
254
|
appendSlotEntry(
|
|
272
255
|
list,
|
|
@@ -315,15 +298,15 @@ export function streamAtomic(
|
|
|
315
298
|
if (!identity) {
|
|
316
299
|
const memo = probeRawSlotIdentity(property, value)
|
|
317
300
|
if (memo) {
|
|
318
|
-
const styleObject = (
|
|
301
|
+
const styleObject = (memo[3] ||= [
|
|
319
302
|
property,
|
|
320
|
-
memo
|
|
321
|
-
memo
|
|
303
|
+
memo[2],
|
|
304
|
+
memo[0],
|
|
322
305
|
undefined,
|
|
323
|
-
memo
|
|
306
|
+
memo[1],
|
|
324
307
|
]) as StyleObject
|
|
325
308
|
;(direct.flatAtomics ||= {})[property] = styleObject
|
|
326
|
-
state.classNames[property] = memo
|
|
309
|
+
state.classNames[property] = memo[0]
|
|
327
310
|
return
|
|
328
311
|
}
|
|
329
312
|
}
|
|
@@ -332,49 +315,46 @@ export function streamAtomic(
|
|
|
332
315
|
value = transformsToString(value)
|
|
333
316
|
}
|
|
334
317
|
const normalized = normalizeValueWithProperty(value, property)
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
for (let index = 0; index < wrapperCount; index++) {
|
|
344
|
-
wrappers[index] = wrapperSource[wrapperStart + index]
|
|
345
|
-
}
|
|
346
|
-
}
|
|
347
|
-
streamEntry.wrappers = wrappers
|
|
318
|
+
scratchEntry[0] = property
|
|
319
|
+
scratchEntry[1] = normalized
|
|
320
|
+
scratchEntry[2] = condition
|
|
321
|
+
scratchEntry[3] = identity
|
|
322
|
+
scratchEntry[4] = selector
|
|
323
|
+
scratchEntry[5] = wrapperSource
|
|
324
|
+
scratchEntry[6] = wrapperStart
|
|
325
|
+
scratchEntry[7] = wrapperCount
|
|
348
326
|
const built = buildAtomicSlotCSS(
|
|
349
327
|
property,
|
|
350
|
-
|
|
328
|
+
singleSlot,
|
|
351
329
|
directStyleSignature(property, normalized, identity)
|
|
352
330
|
)
|
|
353
|
-
|
|
354
|
-
|
|
331
|
+
scratchEntry[5] = undefined
|
|
332
|
+
scratchEntry[1] = ''
|
|
355
333
|
if (!built) return
|
|
356
334
|
if (!identity) {
|
|
357
335
|
storeRawSlotIdentity(property, rawValue, built)
|
|
358
336
|
}
|
|
359
337
|
if (identity) {
|
|
360
|
-
;(direct.flatSingleEntries ||= {})[property] =
|
|
338
|
+
;(direct.flatSingleEntries ||= {})[property] = [
|
|
361
339
|
property,
|
|
362
|
-
|
|
340
|
+
normalized,
|
|
363
341
|
condition,
|
|
364
342
|
identity,
|
|
365
343
|
selector,
|
|
366
|
-
|
|
367
|
-
|
|
344
|
+
wrapperSource,
|
|
345
|
+
wrapperStart,
|
|
346
|
+
wrapperCount,
|
|
347
|
+
]
|
|
368
348
|
}
|
|
369
|
-
const styleObject = (
|
|
349
|
+
const styleObject = (built[3] ||= [
|
|
370
350
|
property,
|
|
371
|
-
built
|
|
372
|
-
built
|
|
351
|
+
built[2],
|
|
352
|
+
built[0],
|
|
373
353
|
undefined,
|
|
374
|
-
built
|
|
354
|
+
built[1],
|
|
375
355
|
]) as StyleObject
|
|
376
356
|
;(direct.flatAtomics ||= {})[property] = styleObject
|
|
377
|
-
state.classNames[property] = built
|
|
357
|
+
state.classNames[property] = built[0]
|
|
378
358
|
}
|
|
379
359
|
|
|
380
360
|
/**
|
|
@@ -394,10 +374,10 @@ export function completeStreamingCSS(state: GetStyleState) {
|
|
|
394
374
|
direct.flatBorderDefaultRequests = undefined
|
|
395
375
|
for (let index = 0; index < requests.length; index++) {
|
|
396
376
|
const request = requests[index]
|
|
397
|
-
const target = request
|
|
377
|
+
const target = request[0]
|
|
398
378
|
const targetSingle = singleEntries ? singleEntries[target] : undefined
|
|
399
379
|
if (targetSingle) {
|
|
400
|
-
if (targetSingle
|
|
380
|
+
if (targetSingle[3] === request[3]) continue
|
|
401
381
|
// promote so the synthetic joins the target's combined slot
|
|
402
382
|
delete singleEntries![target]
|
|
403
383
|
;((direct.flatSlots ||= {})[target] = [targetSingle]).push(request)
|
|
@@ -407,7 +387,7 @@ export function completeStreamingCSS(state: GetStyleState) {
|
|
|
407
387
|
if (slot) {
|
|
408
388
|
let covered = false
|
|
409
389
|
for (let t = 0; t < slot.length; t++) {
|
|
410
|
-
if (!slot[t]
|
|
390
|
+
if (!slot[t][2] || slot[t][3] === request[3]) {
|
|
411
391
|
covered = true
|
|
412
392
|
break
|
|
413
393
|
}
|
|
@@ -427,14 +407,16 @@ export function completeStreamingCSS(state: GetStyleState) {
|
|
|
427
407
|
if (cssMode && state.transformAccumulator) {
|
|
428
408
|
const transform = finalizeTransformAccumulator(state.transformAccumulator)
|
|
429
409
|
state.transformAccumulator = undefined
|
|
430
|
-
const accumulated: AtomicSlotEntry =
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
410
|
+
const accumulated: AtomicSlotEntry = [
|
|
411
|
+
'transform',
|
|
412
|
+
Array.isArray(transform) ? transformsToString(transform) : transform,
|
|
413
|
+
0,
|
|
414
|
+
'',
|
|
415
|
+
'',
|
|
416
|
+
undefined,
|
|
417
|
+
0,
|
|
418
|
+
0,
|
|
419
|
+
]
|
|
438
420
|
const slot = direct.flatSlots ? direct.flatSlots.transform : undefined
|
|
439
421
|
const transformSingle = singleEntries ? singleEntries.transform : undefined
|
|
440
422
|
if (slot) {
|
|
@@ -484,15 +466,6 @@ export function flushDirectStyles(state: GetStyleState, clear = false) {
|
|
|
484
466
|
if (clear) direct.flatAtomics = undefined
|
|
485
467
|
}
|
|
486
468
|
|
|
487
|
-
const compositionEntry: AtomicSlotEntry = {
|
|
488
|
-
property: '',
|
|
489
|
-
value: '',
|
|
490
|
-
condition: 0,
|
|
491
|
-
identity: '',
|
|
492
|
-
selector: '',
|
|
493
|
-
wrappers: undefined,
|
|
494
|
-
}
|
|
495
|
-
|
|
496
469
|
export function addComposition(state: GetStyleState, property: 'translate' | 'scale') {
|
|
497
470
|
if (!canGenerateCSS || state.classNames[property]) return
|
|
498
471
|
const value =
|
|
@@ -501,22 +474,28 @@ export function addComposition(state: GetStyleState, property: 'translate' | 'sc
|
|
|
501
474
|
: 'var(--t-scale-x, 1) var(--t-scale-y, 1)'
|
|
502
475
|
const defaults =
|
|
503
476
|
property === 'translate' ? '--t-x:0px;--t-y:0px' : '--t-scale-x:1;--t-scale-y:1'
|
|
504
|
-
|
|
505
|
-
|
|
477
|
+
scratchEntry[0] = property
|
|
478
|
+
scratchEntry[1] = value
|
|
479
|
+
scratchEntry[2] = 0
|
|
480
|
+
scratchEntry[3] = ''
|
|
481
|
+
scratchEntry[4] = ''
|
|
482
|
+
scratchEntry[5] = undefined
|
|
483
|
+
scratchEntry[6] = 0
|
|
484
|
+
scratchEntry[7] = 0
|
|
506
485
|
const built = buildAtomicSlotCSS(
|
|
507
486
|
property,
|
|
508
|
-
|
|
487
|
+
singleSlot,
|
|
509
488
|
directStyleSignature(property, value, '')
|
|
510
489
|
)
|
|
511
490
|
if (!built) return
|
|
512
|
-
const identifier = built
|
|
513
|
-
const rules = built.
|
|
491
|
+
const identifier = built[0]
|
|
492
|
+
const rules = built[1].slice()
|
|
514
493
|
rules.unshift(`:where(.${identifier}){${defaults}}`)
|
|
515
494
|
if (shouldInsertStyleRules(identifier)) {
|
|
516
495
|
updateRules(identifier, rules)
|
|
517
496
|
state.flatRulesToInsert![identifier] = [
|
|
518
497
|
property,
|
|
519
|
-
built
|
|
498
|
+
built[2],
|
|
520
499
|
identifier,
|
|
521
500
|
undefined,
|
|
522
501
|
rules,
|
|
@@ -32,10 +32,8 @@ function formatDiagnosticValue(
|
|
|
32
32
|
|
|
33
33
|
const keys: string[] = []
|
|
34
34
|
for (const key in value) {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
if (keys.length === 6) break
|
|
38
|
-
}
|
|
35
|
+
keys.push(key)
|
|
36
|
+
if (keys.length === 6) break
|
|
39
37
|
}
|
|
40
38
|
const hasMore = keys.length === 6
|
|
41
39
|
if (hasMore) keys.pop()
|
|
@@ -57,13 +57,13 @@ export function getCSSStyleAtomic(
|
|
|
57
57
|
let conf: TamaguiInternalConfig | null = null
|
|
58
58
|
let confRevision = 0
|
|
59
59
|
|
|
60
|
-
export type SlotIdentity =
|
|
61
|
-
identifier: string
|
|
62
|
-
rules: string[]
|
|
63
|
-
value: any
|
|
60
|
+
export type SlotIdentity = [
|
|
61
|
+
identifier: string,
|
|
62
|
+
rules: string[],
|
|
63
|
+
value: any,
|
|
64
64
|
/** finished wrapper, cached so a repeat build allocates nothing */
|
|
65
|
-
styleObject?: unknown
|
|
66
|
-
|
|
65
|
+
styleObject?: unknown,
|
|
66
|
+
]
|
|
67
67
|
|
|
68
68
|
const getStyleObject = (
|
|
69
69
|
val: any,
|
|
@@ -136,17 +136,19 @@ const getStyleObject = (
|
|
|
136
136
|
// cascade at equal specificity). Cached per (atomicKey, signature): a slot
|
|
137
137
|
// that resolves to the same content is the same class, however it got there.
|
|
138
138
|
|
|
139
|
-
export
|
|
140
|
-
property: string
|
|
141
|
-
value: any
|
|
142
|
-
condition: number
|
|
143
|
-
identity: string
|
|
144
|
-
selector: string
|
|
145
|
-
|
|
139
|
+
export type AtomicSlotEntry = [
|
|
140
|
+
property: string,
|
|
141
|
+
value: any,
|
|
142
|
+
condition: number,
|
|
143
|
+
identity: string,
|
|
144
|
+
selector: string,
|
|
145
|
+
wrapperSource: readonly string[] | undefined,
|
|
146
|
+
wrapperStart: number,
|
|
147
|
+
wrapperCount: number,
|
|
146
148
|
/** authored value, carried only on deferred platform-pseudo passes so an
|
|
147
149
|
* inline conversion preserves provenance */
|
|
148
|
-
original?: any
|
|
149
|
-
|
|
150
|
+
original?: any,
|
|
151
|
+
]
|
|
150
152
|
|
|
151
153
|
const slotIdentities = new Map<string, Map<string, SlotIdentity>>()
|
|
152
154
|
let slotIdentitiesSize = 0
|
|
@@ -247,8 +249,8 @@ export function buildAtomicSlotCSS(
|
|
|
247
249
|
}
|
|
248
250
|
shortProp ||= 'x'
|
|
249
251
|
let identifier = `_${shortProp}-${hash}`
|
|
250
|
-
if (atomicKey === 'pointerEvents' && entries.length === 1 && !entries[0]
|
|
251
|
-
const value = entries[0]
|
|
252
|
+
if (atomicKey === 'pointerEvents' && entries.length === 1 && !entries[0][2]) {
|
|
253
|
+
const value = entries[0][1]
|
|
252
254
|
if (value === 'box-none') identifier = '_pe-boxnone'
|
|
253
255
|
else if (value === 'box-only') identifier = '_pe-boxonly'
|
|
254
256
|
}
|
|
@@ -260,21 +262,23 @@ export function buildAtomicSlotCSS(
|
|
|
260
262
|
for (const entry of entries) {
|
|
261
263
|
// values arrive normalized: the slot signature normalized them so the
|
|
262
264
|
// identity hash and the rule text agree
|
|
263
|
-
const value = entry
|
|
265
|
+
const value = entry[1]
|
|
264
266
|
lastValue = value
|
|
265
267
|
const entryRules = createAtomicRules(
|
|
266
268
|
identifier,
|
|
267
|
-
entry
|
|
269
|
+
entry[0],
|
|
268
270
|
value,
|
|
269
|
-
entry
|
|
270
|
-
entry
|
|
271
|
+
entry[4],
|
|
272
|
+
entry[5],
|
|
271
273
|
2,
|
|
272
|
-
slotClassRepetitions(atomicKey, entry
|
|
274
|
+
slotClassRepetitions(atomicKey, entry[2]),
|
|
275
|
+
entry[6],
|
|
276
|
+
entry[7]
|
|
273
277
|
)
|
|
274
278
|
for (const rule of entryRules) rules.push(rule)
|
|
275
279
|
}
|
|
276
280
|
|
|
277
|
-
const built: SlotIdentity =
|
|
281
|
+
const built: SlotIdentity = [identifier, rules, lastValue]
|
|
278
282
|
if (slotIdentitiesSize > 10_000) {
|
|
279
283
|
slotIdentities.clear()
|
|
280
284
|
slotIdentitiesSize = 0
|
|
@@ -320,7 +324,9 @@ function createAtomicRules(
|
|
|
320
324
|
condition = '',
|
|
321
325
|
wrappers?: readonly string[],
|
|
322
326
|
direct: boolean | 2 = false,
|
|
323
|
-
classRepetitions = 1
|
|
327
|
+
classRepetitions = 1,
|
|
328
|
+
wrapperStart = 0,
|
|
329
|
+
wrapperCount = wrappers?.length || 0
|
|
324
330
|
): string[] {
|
|
325
331
|
// longhands get .cls.cls for higher specificity over shorthands
|
|
326
332
|
const repetitions =
|
|
@@ -399,10 +405,10 @@ function createAtomicRules(
|
|
|
399
405
|
}
|
|
400
406
|
}
|
|
401
407
|
|
|
402
|
-
if (wrappers
|
|
408
|
+
if (wrappers && wrapperCount) {
|
|
403
409
|
for (let ruleIndex = 0; ruleIndex < rules.length; ruleIndex++) {
|
|
404
410
|
let rule = rules[ruleIndex]
|
|
405
|
-
for (let index =
|
|
411
|
+
for (let index = wrapperStart + wrapperCount - 1; index >= wrapperStart; index--) {
|
|
406
412
|
rule = `${wrappers[index]} {${rule}}`
|
|
407
413
|
}
|
|
408
414
|
rules[ruleIndex] = rule
|