@hanzogui/web 7.0.0 → 7.3.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/LICENSE +40 -19
- package/dist/cjs/_withStableStyle.cjs +1 -1
- package/dist/cjs/_withStableStyle.native.js +1 -1
- package/dist/cjs/config.cjs +2 -2
- package/dist/cjs/config.native.js +2 -2
- package/dist/cjs/config.native.js.map +1 -1
- package/dist/cjs/constants/constants.cjs +3 -3
- package/dist/cjs/constants/constants.native.js +3 -3
- package/dist/cjs/createComponent.cjs +307 -530
- package/dist/cjs/createComponent.native.js +265 -588
- package/dist/cjs/createComponent.native.js.map +1 -1
- package/dist/cjs/createGui.cjs +19 -48
- package/dist/cjs/createGui.native.js +22 -65
- package/dist/cjs/createGui.native.js.map +1 -1
- package/dist/cjs/eventHandling.native.js +19 -9
- package/dist/cjs/eventHandling.native.js.map +1 -1
- package/dist/cjs/helpers/createDesignSystem.cjs +22 -36
- package/dist/cjs/helpers/createDesignSystem.native.js +19 -91
- package/dist/cjs/helpers/createDesignSystem.native.js.map +1 -1
- package/dist/cjs/helpers/defaultAnimationDriver.cjs +1 -1
- package/dist/cjs/helpers/defaultAnimationDriver.native.js +1 -1
- package/dist/cjs/helpers/expandStyle.cjs +11 -74
- package/dist/cjs/helpers/expandStyle.native.js +29 -81
- package/dist/cjs/helpers/expandStyle.native.js.map +1 -1
- package/dist/cjs/helpers/expandStyles.cjs +2 -15
- package/dist/cjs/helpers/expandStyles.native.js +7 -13
- package/dist/cjs/helpers/expandStyles.native.js.map +1 -1
- package/dist/cjs/helpers/getSplitStyles.cjs +233 -557
- package/dist/cjs/helpers/getSplitStyles.native.js +204 -659
- package/dist/cjs/helpers/getSplitStyles.native.js.map +1 -1
- package/dist/cjs/helpers/getThemeCSSRules.cjs +8 -16
- package/dist/cjs/helpers/getTokenForKey.cjs +32 -54
- package/dist/cjs/helpers/getTokenForKey.native.js +40 -59
- package/dist/cjs/helpers/getTokenForKey.native.js.map +1 -1
- package/dist/cjs/helpers/insertStyleRule.cjs +27 -79
- package/dist/cjs/helpers/insertStyleRule.native.js +16 -335
- package/dist/cjs/helpers/insertStyleRule.native.js.map +1 -1
- package/dist/cjs/helpers/isActivePlatform.cjs +2 -17
- package/dist/cjs/helpers/isActivePlatform.native.js +2 -17
- package/dist/cjs/helpers/isActivePlatform.native.js.map +1 -1
- package/dist/cjs/helpers/log.cjs +1 -4
- package/dist/cjs/helpers/log.native.js +1 -6
- package/dist/cjs/helpers/log.native.js.map +1 -1
- package/dist/cjs/helpers/propMapper.cjs +37 -110
- package/dist/cjs/helpers/propMapper.native.js +54 -131
- package/dist/cjs/helpers/propMapper.native.js.map +1 -1
- package/dist/cjs/helpers/skipProps.cjs +3 -11
- package/dist/cjs/helpers/skipProps.native.js +3 -11
- package/dist/cjs/helpers/skipProps.native.js.map +1 -1
- package/dist/cjs/helpers/useRenderElement.cjs +7 -18
- package/dist/cjs/helpers/useRenderElement.native.js +7 -15
- package/dist/cjs/helpers/useRenderElement.native.js.map +1 -1
- package/dist/cjs/helpers/wrapStyleTags.cjs +11 -15
- package/dist/cjs/helpers/wrapStyleTags.native.js +3 -22
- package/dist/cjs/helpers/wrapStyleTags.native.js.map +1 -1
- package/dist/cjs/hooks/getThemeProxied.cjs +10 -54
- package/dist/cjs/hooks/getThemeProxied.native.js +27 -48
- package/dist/cjs/hooks/getThemeProxied.native.js.map +1 -1
- package/dist/cjs/hooks/useTheme.cjs +2 -2
- package/dist/cjs/hooks/useTheme.native.js +2 -2
- package/dist/cjs/hooks/useTheme.native.js.map +1 -1
- package/dist/cjs/hooks/useThemeState.cjs +66 -124
- package/dist/cjs/hooks/useThemeState.native.js +64 -142
- package/dist/cjs/hooks/useThemeState.native.js.map +1 -1
- package/dist/cjs/insertFont.cjs +6 -15
- package/dist/cjs/insertFont.native.js +7 -23
- package/dist/cjs/insertFont.native.js.map +1 -1
- package/dist/cjs/setupReactNative.cjs +4 -24
- package/dist/cjs/setupReactNative.native.js +5 -26
- package/dist/cjs/setupReactNative.native.js.map +1 -1
- package/dist/cjs/views/GuiProvider.cjs +4 -6
- package/dist/cjs/views/GuiProvider.native.js +5 -7
- package/dist/cjs/views/GuiProvider.native.js.map +1 -1
- package/dist/cjs/views/Text.cjs +11 -18
- package/dist/cjs/views/Text.native.js +6 -14
- package/dist/cjs/views/Text.native.js.map +1 -1
- package/dist/cjs/views/ThemeProvider.cjs +9 -11
- package/dist/cjs/views/ThemeProvider.native.js +3 -16
- package/dist/cjs/views/ThemeProvider.native.js.map +1 -1
- package/dist/cjs/views/View.native.js.map +1 -1
- package/dist/esm/_withStableStyle.mjs +1 -1
- package/dist/esm/_withStableStyle.mjs.map +1 -1
- package/dist/esm/_withStableStyle.native.js +1 -1
- package/dist/esm/config.mjs +2 -2
- package/dist/esm/config.mjs.map +1 -1
- package/dist/esm/config.native.js +2 -2
- package/dist/esm/config.native.js.map +1 -1
- package/dist/esm/constants/constants.mjs +3 -3
- package/dist/esm/constants/constants.native.js +3 -3
- package/dist/esm/createComponent.mjs +311 -536
- package/dist/esm/createComponent.mjs.map +1 -1
- package/dist/esm/createComponent.native.js +265 -591
- package/dist/esm/createComponent.native.js.map +1 -1
- package/dist/esm/createGui.mjs +20 -51
- package/dist/esm/createGui.mjs.map +1 -1
- package/dist/esm/createGui.native.js +24 -70
- package/dist/esm/createGui.native.js.map +1 -1
- package/dist/esm/createVariables.mjs.map +1 -1
- package/dist/esm/createVariables.native.js.map +1 -1
- package/dist/esm/eventHandling.native.js +19 -9
- package/dist/esm/eventHandling.native.js.map +1 -1
- package/dist/esm/helpers/createDesignSystem.mjs +22 -36
- package/dist/esm/helpers/createDesignSystem.mjs.map +1 -1
- package/dist/esm/helpers/createDesignSystem.native.js +18 -90
- package/dist/esm/helpers/createDesignSystem.native.js.map +1 -1
- package/dist/esm/helpers/defaultAnimationDriver.mjs +1 -1
- package/dist/esm/helpers/defaultAnimationDriver.mjs.map +1 -1
- package/dist/esm/helpers/defaultAnimationDriver.native.js +1 -1
- package/dist/esm/helpers/expandStyle.mjs +12 -73
- package/dist/esm/helpers/expandStyle.mjs.map +1 -1
- package/dist/esm/helpers/expandStyle.native.js +28 -80
- package/dist/esm/helpers/expandStyle.native.js.map +1 -1
- package/dist/esm/helpers/expandStyles.mjs +2 -15
- package/dist/esm/helpers/expandStyles.mjs.map +1 -1
- package/dist/esm/helpers/expandStyles.native.js +7 -13
- package/dist/esm/helpers/expandStyles.native.js.map +1 -1
- package/dist/esm/helpers/getSplitStyles.mjs +236 -560
- package/dist/esm/helpers/getSplitStyles.mjs.map +1 -1
- package/dist/esm/helpers/getSplitStyles.native.js +205 -662
- package/dist/esm/helpers/getSplitStyles.native.js.map +1 -1
- package/dist/esm/helpers/getThemeCSSRules.mjs +8 -16
- package/dist/esm/helpers/getThemeCSSRules.mjs.map +1 -1
- package/dist/esm/helpers/getTokenForKey.mjs +32 -54
- package/dist/esm/helpers/getTokenForKey.mjs.map +1 -1
- package/dist/esm/helpers/getTokenForKey.native.js +40 -59
- package/dist/esm/helpers/getTokenForKey.native.js.map +1 -1
- package/dist/esm/helpers/insertStyleRule.mjs +27 -79
- package/dist/esm/helpers/insertStyleRule.mjs.map +1 -1
- package/dist/esm/helpers/insertStyleRule.native.js +14 -333
- package/dist/esm/helpers/insertStyleRule.native.js.map +1 -1
- package/dist/esm/helpers/isActivePlatform.mjs +2 -17
- package/dist/esm/helpers/isActivePlatform.mjs.map +1 -1
- package/dist/esm/helpers/isActivePlatform.native.js +2 -17
- package/dist/esm/helpers/isActivePlatform.native.js.map +1 -1
- package/dist/esm/helpers/log.mjs +1 -4
- package/dist/esm/helpers/log.mjs.map +1 -1
- package/dist/esm/helpers/log.native.js +1 -6
- package/dist/esm/helpers/log.native.js.map +1 -1
- package/dist/esm/helpers/propMapper.mjs +37 -108
- package/dist/esm/helpers/propMapper.mjs.map +1 -1
- package/dist/esm/helpers/propMapper.native.js +54 -131
- package/dist/esm/helpers/propMapper.native.js.map +1 -1
- package/dist/esm/helpers/skipProps.mjs +3 -10
- package/dist/esm/helpers/skipProps.mjs.map +1 -1
- package/dist/esm/helpers/skipProps.native.js +2 -10
- package/dist/esm/helpers/skipProps.native.js.map +1 -1
- package/dist/esm/helpers/useRenderElement.mjs +9 -22
- package/dist/esm/helpers/useRenderElement.mjs.map +1 -1
- package/dist/esm/helpers/useRenderElement.native.js +8 -17
- package/dist/esm/helpers/useRenderElement.native.js.map +1 -1
- package/dist/esm/helpers/wrapStyleTags.mjs +11 -15
- package/dist/esm/helpers/wrapStyleTags.mjs.map +1 -1
- package/dist/esm/helpers/wrapStyleTags.native.js +1 -20
- package/dist/esm/helpers/wrapStyleTags.native.js.map +1 -1
- package/dist/esm/hooks/getThemeProxied.mjs +11 -52
- package/dist/esm/hooks/getThemeProxied.mjs.map +1 -1
- package/dist/esm/hooks/getThemeProxied.native.js +27 -48
- package/dist/esm/hooks/getThemeProxied.native.js.map +1 -1
- package/dist/esm/hooks/useTheme.mjs +2 -2
- package/dist/esm/hooks/useTheme.mjs.map +1 -1
- package/dist/esm/hooks/useTheme.native.js +2 -2
- package/dist/esm/hooks/useTheme.native.js.map +1 -1
- package/dist/esm/hooks/useThemeState.mjs +67 -124
- package/dist/esm/hooks/useThemeState.mjs.map +1 -1
- package/dist/esm/hooks/useThemeState.native.js +64 -142
- package/dist/esm/hooks/useThemeState.native.js.map +1 -1
- package/dist/esm/insertFont.mjs +7 -17
- package/dist/esm/insertFont.mjs.map +1 -1
- package/dist/esm/insertFont.native.js +7 -24
- package/dist/esm/insertFont.native.js.map +1 -1
- package/dist/esm/setupReactNative.mjs +4 -24
- package/dist/esm/setupReactNative.mjs.map +1 -1
- package/dist/esm/setupReactNative.native.js +5 -26
- package/dist/esm/setupReactNative.native.js.map +1 -1
- package/dist/esm/views/GuiProvider.mjs +4 -6
- package/dist/esm/views/GuiProvider.mjs.map +1 -1
- package/dist/esm/views/GuiProvider.native.js +5 -7
- package/dist/esm/views/GuiProvider.native.js.map +1 -1
- package/dist/esm/views/Slot.mjs.map +1 -1
- package/dist/esm/views/Text.mjs +11 -18
- package/dist/esm/views/Text.mjs.map +1 -1
- package/dist/esm/views/Text.native.js +5 -12
- package/dist/esm/views/Text.native.js.map +1 -1
- package/dist/esm/views/Theme.mjs.map +1 -1
- package/dist/esm/views/ThemeProvider.mjs +9 -11
- package/dist/esm/views/ThemeProvider.mjs.map +1 -1
- package/dist/esm/views/ThemeProvider.native.js +1 -14
- package/dist/esm/views/ThemeProvider.native.js.map +1 -1
- package/dist/esm/views/View.mjs.map +1 -1
- package/dist/esm/views/View.native.js.map +1 -1
- package/package.json +30 -23
- package/src/_withStableStyle.tsx +2 -2
- package/src/config.ts +7 -4
- package/src/constants/accessibilityDirectMap.tsx +1 -1
- package/src/constants/constants.ts +3 -3
- package/src/createComponent.tsx +2 -2
- package/src/createGui.ts +2 -2
- package/src/eventHandling.native.ts +31 -10
- package/src/helpers/createMediaStyle.ts +1 -1
- package/src/helpers/defaultAnimationDriver.tsx +1 -1
- package/src/helpers/getSplitStyles.tsx +1 -1
- package/src/helpers/getTokenForKey.ts +42 -29
- package/src/helpers/insertStyleRule.tsx +2 -2
- package/src/helpers/isActivePlatform.ts +5 -5
- package/src/helpers/mergeProps.ts +1 -1
- package/src/helpers/skipProps.ts +1 -1
- package/src/helpers/useRenderElement.tsx +4 -1
- package/src/hooks/useTheme.tsx +2 -2
- package/src/interfaces/GuiComponentPropsBaseBase.tsx +10 -4
- package/src/styled.tsx +2 -2
- package/src/types.tsx +33 -24
- package/src/views/View.tsx +6 -1
- package/types/config.d.ts.map +1 -1
- package/types/eventHandling.native.d.ts.map +1 -1
- package/types/helpers/getTokenForKey.d.ts.map +1 -1
- package/types/helpers/isActivePlatform.d.ts +5 -5
- package/types/helpers/skipProps.d.ts +1 -1
- package/types/helpers/useRenderElement.d.ts.map +1 -1
- package/types/helpers/wrapStyleTags.d.ts +1 -1
- package/types/helpers/wrapStyleTags.d.ts.map +1 -1
- package/types/interfaces/GuiComponentPropsBaseBase.d.ts +3 -3
- package/types/interfaces/GuiComponentPropsBaseBase.d.ts.map +1 -1
- package/types/styled.d.ts +1 -1
- package/types/types.d.ts +17 -17
- package/types/types.d.ts.map +1 -1
- package/types/views/Configuration.d.ts +1 -1
- package/types/views/Configuration.d.ts.map +1 -1
- package/types/views/FontLanguage.d.ts +1 -1
- package/types/views/FontLanguage.native.d.ts +2 -1
- package/types/views/FontLanguage.native.d.ts.map +1 -1
- package/types/views/GuiProvider.d.ts +2 -1
- package/types/views/GuiProvider.d.ts.map +1 -1
- package/types/views/GuiRoot.d.ts +1 -1
- package/types/views/GuiRoot.d.ts.map +1 -1
- package/types/views/Slot.d.ts +1 -1
- package/types/views/ThemeProvider.d.ts +1 -1
- package/types/views/ThemeProvider.d.ts.map +1 -1
- package/types/views/View.d.ts.map +1 -1
- package/.turbo/turbo-build.log +0 -2
- package/inject-styles/index.cjs +0 -2
- package/inject-styles/index.js +0 -2
- package/tsconfig.json +0 -44
- package/tsconfig.test.json +0 -9
- package/vitest.config.d.ts +0 -3
- package/vitest.config.d.ts.map +0 -1
- package/vitest.config.ts +0 -14
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
import { composeEventHandlers } from '@hanzogui/helpers'
|
|
6
6
|
import { getGestureHandler } from '@hanzogui/native'
|
|
7
7
|
import React, { useRef } from 'react'
|
|
8
|
+
import { Platform, View } from 'react-native'
|
|
8
9
|
import { useMainThreadPressEvents } from './helpers/mainThreadPressEvents'
|
|
9
10
|
import type { StaticConfig, GuiComponentStateRef } from './types'
|
|
10
11
|
|
|
@@ -77,7 +78,7 @@ export function useEvents(
|
|
|
77
78
|
// _internalInstanceHandle on a null native view). By passing events down, the inner
|
|
78
79
|
// component handles gesture detection at its own level.
|
|
79
80
|
//
|
|
80
|
-
// Composite component special case - when styled() wraps a non-
|
|
81
|
+
// Composite component special case - when styled() wraps a non-Gui component
|
|
81
82
|
// (e.g. React.forwardRef), the elementType becomes that composite component.
|
|
82
83
|
// GestureDetector/responder wrapping around a composite component breaks during
|
|
83
84
|
// re-renders triggered by pressStyle state changes (the gesture/responder loses
|
|
@@ -153,14 +154,6 @@ export function useEvents(
|
|
|
153
154
|
}
|
|
154
155
|
// TODO update viewProps.hitSlop / events.delayLongPress!
|
|
155
156
|
|
|
156
|
-
// Claim responder to block parent RN Pressable/TouchableOpacity from firing.
|
|
157
|
-
// RNGH handles the actual press, but we need to tell the responder system
|
|
158
|
-
// that we're handling this touch to prevent it bubbling to parent pressables.
|
|
159
|
-
if (hasPressEvents) {
|
|
160
|
-
viewProps.onStartShouldSetResponder = () => true
|
|
161
|
-
viewProps.onResponderTerminationRequest = () => false
|
|
162
|
-
}
|
|
163
|
-
|
|
164
157
|
return gestureRef.current
|
|
165
158
|
}
|
|
166
159
|
|
|
@@ -202,5 +195,33 @@ export function wrapWithGestureDetector(
|
|
|
202
195
|
return content
|
|
203
196
|
}
|
|
204
197
|
|
|
205
|
-
|
|
198
|
+
const detector = React.createElement(
|
|
199
|
+
GestureDetector,
|
|
200
|
+
{ gesture: gestureToUse },
|
|
201
|
+
content
|
|
202
|
+
)
|
|
203
|
+
|
|
204
|
+
// wrap in a responder-claiming View OUTSIDE the GestureDetector.
|
|
205
|
+
// this blocks parent RN Pressable/TouchableOpacity from firing when
|
|
206
|
+
// a press lands on this component, without causing the RNGH deadlock
|
|
207
|
+
// that happens when responder claims are applied to a view inside
|
|
208
|
+
// the gesture-managed subtree (RNGH intercepts UIManager.setJSResponder
|
|
209
|
+
// globally — when the claimant is one of its own gesture targets it
|
|
210
|
+
// creates a coordination conflict, especially at scale on first mount).
|
|
211
|
+
return React.createElement(
|
|
212
|
+
View,
|
|
213
|
+
{
|
|
214
|
+
collapsable: false,
|
|
215
|
+
// display: contents keeps the wrapper transparent to layout (new arch /
|
|
216
|
+
// Fabric) so it doesn't become an extra flex child and shift siblings.
|
|
217
|
+
style: responderWrapperStyle,
|
|
218
|
+
onStartShouldSetResponder: responderClaim,
|
|
219
|
+
onResponderTerminationRequest: responderDeny,
|
|
220
|
+
},
|
|
221
|
+
detector
|
|
222
|
+
)
|
|
206
223
|
}
|
|
224
|
+
|
|
225
|
+
const responderClaim = () => true
|
|
226
|
+
const responderDeny = () => false
|
|
227
|
+
const responderWrapperStyle = { display: 'contents' } as const
|
|
@@ -3,7 +3,7 @@ import { mediaObjectToString } from './mediaObjectToString'
|
|
|
3
3
|
import type { IsMediaType, MediaQueries, MediaStyleObject, StyleObject } from '../types'
|
|
4
4
|
import { getGroupPropParts, type GroupParts } from './getGroupPropParts'
|
|
5
5
|
|
|
6
|
-
// TODO have this be used by extractMediaStyle in
|
|
6
|
+
// TODO have this be used by extractMediaStyle in gui static
|
|
7
7
|
// not synced to static/constants for now
|
|
8
8
|
export const MEDIA_SEP = '_'
|
|
9
9
|
|
|
@@ -2,7 +2,7 @@ import type { AnimationDriver } from '../types'
|
|
|
2
2
|
|
|
3
3
|
const noAnimationDriver = (method: string): any => {
|
|
4
4
|
console.warn(
|
|
5
|
-
`No animation driver configured. To use ${method}, you must pass \`animations\` to createGui. See: https://gui.
|
|
5
|
+
`No animation driver configured. To use ${method}, you must pass \`animations\` to createGui. See: https://gui.dev/docs/core/animations`
|
|
6
6
|
)
|
|
7
7
|
}
|
|
8
8
|
|
|
@@ -1039,7 +1039,7 @@ export const getSplitStyles: StyleSplitter = (
|
|
|
1039
1039
|
function mergeMediaStyle(key: string, val: any, originalVal?: any) {
|
|
1040
1040
|
// on native, non-style keys from media queries (like numberOfLines)
|
|
1041
1041
|
// need to go to viewProps, not style
|
|
1042
|
-
if (process.env.
|
|
1042
|
+
if (process.env.GUI_TARGET === 'native') {
|
|
1043
1043
|
if (!isValidStyleKey(key, validStyles, accept)) {
|
|
1044
1044
|
viewProps[key] = val
|
|
1045
1045
|
return
|
|
@@ -18,6 +18,20 @@ const fontShorthand = {
|
|
|
18
18
|
let didLogMissingToken = false
|
|
19
19
|
const colorKeys = tokenCategories.color
|
|
20
20
|
|
|
21
|
+
// flat reverse-lookup: tokenCategoryByKey[propName] → category name.
|
|
22
|
+
// replaces an O(categories) for-in scan at the hot path below that
|
|
23
|
+
// iterates every category on every `$token` prop resolve. a sootsim
|
|
24
|
+
// scroll profile of Uniswap spent material worker CPU walking five
|
|
25
|
+
// categories per prop per render — one `key in tokenCategoryByKey`
|
|
26
|
+
// lookup collapses that to O(1). tokenCategories is module-constant so
|
|
27
|
+
// it's safe to flatten once at module init.
|
|
28
|
+
const tokenCategoryByKey: Record<string, string> = {}
|
|
29
|
+
for (const _cat in tokenCategories) {
|
|
30
|
+
for (const _k in tokenCategories[_cat as keyof typeof tokenCategories]) {
|
|
31
|
+
tokenCategoryByKey[_k] = _cat
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
21
35
|
// mutable state for font family tracking across propMapper
|
|
22
36
|
let _lastFontFamilyToken: any = null
|
|
23
37
|
|
|
@@ -123,37 +137,36 @@ export const getTokenForKey = (
|
|
|
123
137
|
break
|
|
124
138
|
}
|
|
125
139
|
}
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
140
|
+
const cat = tokenCategoryByKey[key]
|
|
141
|
+
if (cat !== undefined) {
|
|
142
|
+
const res = tokensParsed[cat]?.[value]
|
|
129
143
|
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
it also often can be because you have a duplicated
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
144
|
+
if (res != null) {
|
|
145
|
+
valOrVar = res
|
|
146
|
+
hasSet = true
|
|
147
|
+
} else {
|
|
148
|
+
if (process.env.NODE_ENV === 'development') {
|
|
149
|
+
if (process.env.GUI_DISABLE_MISSING_TOKEN_LOG !== '1') {
|
|
150
|
+
if (!didLogMissingToken) {
|
|
151
|
+
didLogMissingToken = true
|
|
152
|
+
console.groupCollapsed(
|
|
153
|
+
`[gui] Warning: missing token ${key} in category ${cat} - ${value} (open for details)`
|
|
154
|
+
)
|
|
155
|
+
console.info(
|
|
156
|
+
`Note: this could just be due to you not setting all the theme tokens Gui expects, which is harmless, but
|
|
157
|
+
it also often can be because you have a duplicated Gui in your bundle, which can cause tricky bugs.`
|
|
158
|
+
)
|
|
159
|
+
console.info(
|
|
160
|
+
`To see if you have duplicated dependencies, in Chrome DevTools hit CMD+P and type GuiProvider.
|
|
147
161
|
If you see both a .cjs and a .mjs entry, it's duplicated.`
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
}
|
|
162
|
+
)
|
|
163
|
+
console.info(
|
|
164
|
+
`You can debug that issue by opening the .mjs and .cjs files and setting a breakpoint at the top of each.`
|
|
165
|
+
)
|
|
166
|
+
console.info(
|
|
167
|
+
`We only log this warning one time as it's sometimes harmless, to disable this log entirely set process.env.GUI_DISABLE_MISSING_TOKEN_LOG=1.`
|
|
168
|
+
)
|
|
169
|
+
console.groupEnd()
|
|
157
170
|
}
|
|
158
171
|
}
|
|
159
172
|
}
|
|
@@ -8,7 +8,7 @@ import type {
|
|
|
8
8
|
TokensParsed,
|
|
9
9
|
} from '../types'
|
|
10
10
|
|
|
11
|
-
// only cache
|
|
11
|
+
// only cache gui styles
|
|
12
12
|
// TODO merge totalSelectorsInserted and allSelectors?
|
|
13
13
|
const scannedCache = new WeakMap<CSSStyleSheet, string>()
|
|
14
14
|
const totalSelectorsInserted = new Map<string, number>()
|
|
@@ -267,7 +267,7 @@ function getGuiSelector(
|
|
|
267
267
|
return collectThemes ? [id, rule, true] : [id, rule]
|
|
268
268
|
}
|
|
269
269
|
} else if (rule instanceof CSSMediaRule) {
|
|
270
|
-
//
|
|
270
|
+
// gui only ever inserts 1 rule per media
|
|
271
271
|
if (rule.cssRules.length > 1) return
|
|
272
272
|
return getGuiSelector(rule.cssRules[0])
|
|
273
273
|
}
|
|
@@ -5,11 +5,11 @@ import { currentPlatform, isAndroid, isIos, isTV } from '@hanzogui/constants'
|
|
|
5
5
|
* platform selectors reliably override more general ones regardless of the order
|
|
6
6
|
* props are declared.
|
|
7
7
|
*
|
|
8
|
-
* Cascade (low
|
|
9
|
-
* $platform-native / $platform-web
|
|
10
|
-
* $platform-android / $platform-ios
|
|
11
|
-
* $platform-tv
|
|
12
|
-
* $platform-androidtv / $platform-tvos
|
|
8
|
+
* Cascade (low → high importance):
|
|
9
|
+
* $platform-native / $platform-web → bump 0 (widest)
|
|
10
|
+
* $platform-android / $platform-ios → bump 1 (OS-specific)
|
|
11
|
+
* $platform-tv → bump 2 (TV subset of Android/iOS)
|
|
12
|
+
* $platform-androidtv / $platform-tvos → bump 3 (most specific)
|
|
13
13
|
*
|
|
14
14
|
* @param mediaKeyShort - Platform media key without the leading '$' (e.g. 'platform-tv', 'platform-androidtv')
|
|
15
15
|
*/
|
package/src/helpers/skipProps.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { nativeOnlyProps } from './nativeOnlyProps'
|
|
|
2
2
|
import { webPropsToSkip } from './webPropsToSkip'
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
|
-
* These are props that dont pass down below
|
|
5
|
+
* These are props that dont pass down below Gui styled components
|
|
6
6
|
*/
|
|
7
7
|
export const skipProps = {
|
|
8
8
|
untilMeasured: 1,
|
|
@@ -32,7 +32,10 @@ export function evaluateRenderProp(
|
|
|
32
32
|
// String tag - swap element type, reuse props from defaultElement
|
|
33
33
|
if (typeof render === 'string') {
|
|
34
34
|
// on native, ignore lowercase tags (html/jsx elements like "div", "span")
|
|
35
|
-
if (
|
|
35
|
+
if (
|
|
36
|
+
process.env.GUI_TARGET === 'native' &&
|
|
37
|
+
render[0] === render[0].toLowerCase()
|
|
38
|
+
) {
|
|
36
39
|
return defaultElement
|
|
37
40
|
}
|
|
38
41
|
return createElement(render, props, defaultChildren)
|
package/src/hooks/useTheme.tsx
CHANGED
|
@@ -32,9 +32,9 @@ export const useThemeWithState = (
|
|
|
32
32
|
if (!props.passThrough && !themeState?.theme) {
|
|
33
33
|
if (process.env.GUI_DISABLE_NO_THEME_WARNING !== '1') {
|
|
34
34
|
console.error(
|
|
35
|
-
`[
|
|
35
|
+
`[gui] No theme found, this could be due to an invalid theme name (given theme props ${JSON.stringify(
|
|
36
36
|
props
|
|
37
|
-
)}).\n\nIf this is intended and you are using
|
|
37
|
+
)}).\n\nIf this is intended and you are using Gui without any themes, you can disable this warning by setting the environment variable GUI_DISABLE_NO_THEME_WARNING=1`
|
|
38
38
|
)
|
|
39
39
|
}
|
|
40
40
|
}
|
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type {
|
|
2
|
+
DebugProp,
|
|
3
|
+
ThemeName,
|
|
4
|
+
GroupNames,
|
|
5
|
+
Role,
|
|
6
|
+
GuiComponentState,
|
|
7
|
+
} from '../types'
|
|
2
8
|
|
|
3
9
|
export type GuiComponentPropsBaseBase = {
|
|
4
10
|
target?: string
|
|
@@ -62,13 +68,13 @@ export type GuiComponentPropsBaseBase = {
|
|
|
62
68
|
|
|
63
69
|
/**
|
|
64
70
|
* Marks this component as a group for use in styling children based on parents named group
|
|
65
|
-
* See: https://gui.
|
|
71
|
+
* See: https://gui.dev/docs/intro/props
|
|
66
72
|
*/
|
|
67
73
|
group?: GroupNames | boolean
|
|
68
74
|
|
|
69
75
|
/**
|
|
70
76
|
* Works only alongside group, when children of the group are using container based sizing on native you can hide them until parent is measured.
|
|
71
|
-
* See: https://gui.
|
|
77
|
+
* See: https://gui.dev/docs/intro/props
|
|
72
78
|
*/
|
|
73
79
|
untilMeasured?: 'hide' | 'show'
|
|
74
80
|
|
|
@@ -105,7 +111,7 @@ export type GuiComponentPropsBaseBase = {
|
|
|
105
111
|
|
|
106
112
|
/**
|
|
107
113
|
* Adds some area outside the typical bounds of the component for touch actions to register.
|
|
108
|
-
*
|
|
114
|
+
* Gui uses Pressable internally so it supports `number | Insets` rather than just `Insets`
|
|
109
115
|
*/
|
|
110
116
|
hitSlop?: number | Insets | null
|
|
111
117
|
}
|
package/src/styled.tsx
CHANGED
|
@@ -82,7 +82,7 @@ type TextLikeElements =
|
|
|
82
82
|
| 'u'
|
|
83
83
|
| 'var'
|
|
84
84
|
|
|
85
|
-
// props that conflict with
|
|
85
|
+
// props that conflict with gui style props
|
|
86
86
|
type ConflictingHTMLProps =
|
|
87
87
|
| 'color'
|
|
88
88
|
| 'display'
|
|
@@ -213,7 +213,7 @@ export function styledHtml<
|
|
|
213
213
|
}
|
|
214
214
|
|
|
215
215
|
/**
|
|
216
|
-
* styled() for creating
|
|
216
|
+
* styled() for creating Gui components from other components.
|
|
217
217
|
*/
|
|
218
218
|
function styled<
|
|
219
219
|
ParentComponent extends StylableComponent,
|
package/src/types.tsx
CHANGED
|
@@ -298,13 +298,13 @@ export type GuiComponentPropsBaseBase = {
|
|
|
298
298
|
|
|
299
299
|
/**
|
|
300
300
|
* Marks this component as a group for use in styling children based on parents named group
|
|
301
|
-
* See: https://gui.
|
|
301
|
+
* See: https://gui.dev/docs/intro/props
|
|
302
302
|
*/
|
|
303
303
|
group?: GroupNames | boolean
|
|
304
304
|
|
|
305
305
|
/**
|
|
306
306
|
* Works only alongside group, when children of the group are using container based sizing on native you can hide them until parent is measured.
|
|
307
|
-
* See: https://gui.
|
|
307
|
+
* See: https://gui.dev/docs/intro/props
|
|
308
308
|
*/
|
|
309
309
|
untilMeasured?: 'hide' | 'show'
|
|
310
310
|
|
|
@@ -341,7 +341,7 @@ export type GuiComponentPropsBaseBase = {
|
|
|
341
341
|
|
|
342
342
|
/**
|
|
343
343
|
* Adds some area outside the typical bounds of the component for touch actions to register.
|
|
344
|
-
*
|
|
344
|
+
* Gui uses Pressable internally so it supports `number | Insets` rather than just `Insets`
|
|
345
345
|
*/
|
|
346
346
|
hitSlop?: number | Insets | null
|
|
347
347
|
|
|
@@ -513,7 +513,7 @@ export interface GuiElementMethods {
|
|
|
513
513
|
|
|
514
514
|
/**
|
|
515
515
|
* Cross-platform element ref type. On web, includes GuiElementMethods
|
|
516
|
-
* (measure, focus, blur) which
|
|
516
|
+
* (measure, focus, blur) which Gui adds at runtime. On native, View
|
|
517
517
|
* already has these via NativeMethods.
|
|
518
518
|
*/
|
|
519
519
|
export type GuiElement = (HTMLElement & GuiElementMethods) | View
|
|
@@ -528,7 +528,8 @@ export type GuiTextElement = (HTMLElement & GuiElementMethods) | RNText
|
|
|
528
528
|
* const ref = useRef<GuiWebElement<HTMLInputElement>>(null)
|
|
529
529
|
* // ref.current has both HTMLInputElement props and GuiElementMethods
|
|
530
530
|
*/
|
|
531
|
-
export type GuiWebElement<T extends HTMLElement = HTMLElement> = T &
|
|
531
|
+
export type GuiWebElement<T extends HTMLElement = HTMLElement> = T &
|
|
532
|
+
GuiElementMethods
|
|
532
533
|
|
|
533
534
|
export type DebugProp = boolean | 'break' | 'verbose' | 'visualize' | 'profile'
|
|
534
535
|
|
|
@@ -720,7 +721,7 @@ type TokenifyRecord<A extends object> = {
|
|
|
720
721
|
type CoerceToVariable<A> = A extends Variable ? A : Variable<A>
|
|
721
722
|
|
|
722
723
|
export type GuiBaseTheme = {
|
|
723
|
-
// defined for our
|
|
724
|
+
// defined for our gui kit , we could do this inside `gui`
|
|
724
725
|
// but maybe helpful to have some sort of universally shared things +
|
|
725
726
|
// + enforce if they want their own, redefine in their design sys
|
|
726
727
|
background: VariableColorVal
|
|
@@ -780,7 +781,7 @@ type GenericAnimations = {
|
|
|
780
781
|
//
|
|
781
782
|
// const config = createGui(...)
|
|
782
783
|
// type MyConfig = typeof config
|
|
783
|
-
// declare module '
|
|
784
|
+
// declare module 'hanzogui' {
|
|
784
785
|
// export interface GuiCustomConfig extends MyConfig {}
|
|
785
786
|
// }
|
|
786
787
|
// now your whole app/kit should be typed correctly
|
|
@@ -1074,19 +1075,19 @@ type AutocompleteSpecificTokensSetting = boolean | 'except-special'
|
|
|
1074
1075
|
export interface GenericGuiSettings {
|
|
1075
1076
|
/**
|
|
1076
1077
|
* When true, flexBasis will be set to 0 when flex is positive. This will be
|
|
1077
|
-
* the default in v2 of
|
|
1078
|
+
* the default in v2 of Gui alongside an alternative mode for web compat.
|
|
1078
1079
|
*/
|
|
1079
1080
|
styleCompat?: 'react-native' | 'legacy'
|
|
1080
1081
|
|
|
1081
1082
|
// TODO
|
|
1082
1083
|
/**
|
|
1083
|
-
* When true,
|
|
1084
|
+
* When true, Gui will always prefer a more specific style prop over a
|
|
1084
1085
|
* less specific one.
|
|
1085
1086
|
*
|
|
1086
|
-
* By default,
|
|
1087
|
+
* By default, Gui processes all style props in order of definition on the
|
|
1087
1088
|
* object. This is a bit strange to most people, but it gets around many
|
|
1088
1089
|
* annoying issues with specificity. You can see our docs on this here:
|
|
1089
|
-
* https://gui.
|
|
1090
|
+
* https://gui.dev/docs/intro/styles#style-order-is-important
|
|
1090
1091
|
*
|
|
1091
1092
|
* But this can be confusing in simple cases, like when you do:
|
|
1092
1093
|
*
|
|
@@ -1134,12 +1135,12 @@ export interface GenericGuiSettings {
|
|
|
1134
1135
|
autocompleteSpecificTokens?: AutocompleteSpecificTokensSetting
|
|
1135
1136
|
|
|
1136
1137
|
/**
|
|
1137
|
-
* On iOS, this enables a mode where
|
|
1138
|
+
* On iOS, this enables a mode where Gui returns color values using
|
|
1138
1139
|
* `DynamicColorIOS` This is a React Native built in feature, you can read the
|
|
1139
1140
|
* docs here: https://reactnative.dev/docs/dynamiccolorios
|
|
1140
1141
|
*
|
|
1141
1142
|
* We're working to make this enabled by default without any setting, but
|
|
1142
|
-
*
|
|
1143
|
+
* Gui themes support inversing and/or changing to light/dark at any point
|
|
1143
1144
|
* in the tree. We haven't implemented support for either of these cases when
|
|
1144
1145
|
* combined with this feature.
|
|
1145
1146
|
*
|
|
@@ -1188,7 +1189,7 @@ export interface GenericGuiSettings {
|
|
|
1188
1189
|
/**
|
|
1189
1190
|
* If building a non-server rendered app, set this to true.
|
|
1190
1191
|
*
|
|
1191
|
-
* For SSR compatibility on the web,
|
|
1192
|
+
* For SSR compatibility on the web, Gui will render once with the settings
|
|
1192
1193
|
* from `mediaQueryDefaultActive` set for all media queries. Then, it will render
|
|
1193
1194
|
* again after the initial render using the proper media query values. This is so that
|
|
1194
1195
|
* hydration will match perfectly with the server.
|
|
@@ -1218,7 +1219,7 @@ export interface GenericGuiSettings {
|
|
|
1218
1219
|
/**
|
|
1219
1220
|
* If you want to style your <body> tag to use theme CSS variables on web, you
|
|
1220
1221
|
* must place the theme className onto the body element or above. This will do so.
|
|
1221
|
-
* If disabled,
|
|
1222
|
+
* If disabled, Gui will place the className onto the element rendered by
|
|
1222
1223
|
* the GuiProvider
|
|
1223
1224
|
*
|
|
1224
1225
|
* @default html
|
|
@@ -1226,7 +1227,7 @@ export interface GenericGuiSettings {
|
|
|
1226
1227
|
addThemeClassName?: 'body' | 'html' | false
|
|
1227
1228
|
|
|
1228
1229
|
/**
|
|
1229
|
-
* Sets the default position value for all
|
|
1230
|
+
* Sets the default position value for all Gui components.
|
|
1230
1231
|
* @default 'static'
|
|
1231
1232
|
*/
|
|
1232
1233
|
defaultPosition?: 'static' | 'relative'
|
|
@@ -1551,7 +1552,10 @@ type WebOnlySizeValue =
|
|
|
1551
1552
|
| 'max-content'
|
|
1552
1553
|
| 'min-content'
|
|
1553
1554
|
|
|
1554
|
-
type UserAllowedStyleValuesSetting = Exclude<
|
|
1555
|
+
type UserAllowedStyleValuesSetting = Exclude<
|
|
1556
|
+
GuiSettings['allowedStyleValues'],
|
|
1557
|
+
undefined
|
|
1558
|
+
>
|
|
1555
1559
|
|
|
1556
1560
|
export type GetThemeValueSettingForCategory<
|
|
1557
1561
|
Cat extends keyof AllowedStyleValuesSettingPerCategory,
|
|
@@ -1581,7 +1585,8 @@ export type GetThemeValueFallbackFor<
|
|
|
1581
1585
|
export type ThemeValueFallback =
|
|
1582
1586
|
// for backwards compat with overriding the type we make this either UnionableString
|
|
1583
1587
|
// or never if they don't define any UserAllowedStyleValuesSetting
|
|
1584
|
-
(GuiSettings extends { allowedStyleValues: any } ? never : UnionableString)
|
|
1588
|
+
| (GuiSettings extends { allowedStyleValues: any } ? never : UnionableString)
|
|
1589
|
+
| Variable
|
|
1585
1590
|
|
|
1586
1591
|
export type AllowedValueSettingSpace = GetThemeValueSettingForCategory<'space'>
|
|
1587
1592
|
export type AllowedValueSettingSize = GetThemeValueSettingForCategory<'size'>
|
|
@@ -1706,14 +1711,18 @@ export type NonSpecificTokens =
|
|
|
1706
1711
|
|
|
1707
1712
|
export type Token =
|
|
1708
1713
|
| NonSpecificTokens
|
|
1709
|
-
| (GuiSettings extends { autocompleteSpecificTokens: false }
|
|
1714
|
+
| (GuiSettings extends { autocompleteSpecificTokens: false }
|
|
1715
|
+
? never
|
|
1716
|
+
: SpecificTokens)
|
|
1710
1717
|
|
|
1711
1718
|
export type ColorStyleProp = ThemeValueFallbackColor | ColorTokens
|
|
1712
1719
|
|
|
1713
1720
|
// fonts
|
|
1714
1721
|
type DefaultFont = GuiSettings['defaultFont']
|
|
1715
1722
|
|
|
1716
|
-
export type Fonts = DefaultFont extends string
|
|
1723
|
+
export type Fonts = DefaultFont extends string
|
|
1724
|
+
? GuiConfig['fonts'][DefaultFont]
|
|
1725
|
+
: never
|
|
1717
1726
|
|
|
1718
1727
|
export type Font = ParseFont<Fonts>
|
|
1719
1728
|
|
|
@@ -2421,7 +2430,7 @@ interface ExtraBaseProps {
|
|
|
2421
2430
|
* Transitions are defined using `createGui` typically in a gui.config.ts file.
|
|
2422
2431
|
* Pass a string transition name here and it uses an animation driver to execute it.
|
|
2423
2432
|
*
|
|
2424
|
-
* See: https://gui.
|
|
2433
|
+
* See: https://gui.dev/docs/core/animations
|
|
2425
2434
|
*/
|
|
2426
2435
|
transition?: TransitionProp | null
|
|
2427
2436
|
|
|
@@ -2805,7 +2814,7 @@ export type StaticConfigPublic = {
|
|
|
2805
2814
|
validStyles?: { [key: string]: boolean }
|
|
2806
2815
|
|
|
2807
2816
|
/**
|
|
2808
|
-
* Accept
|
|
2817
|
+
* Accept Gui tokens for these props (key for the prop key, val for the token category)
|
|
2809
2818
|
*/
|
|
2810
2819
|
accept?: {
|
|
2811
2820
|
[key: string]: keyof Tokens | 'style' | 'textStyle'
|
|
@@ -2833,9 +2842,9 @@ export type StaticConfigPublic = {
|
|
|
2833
2842
|
isReactNative?: boolean
|
|
2834
2843
|
|
|
2835
2844
|
/**
|
|
2836
|
-
* By default if styled() doesn't recognize a parent
|
|
2845
|
+
* By default if styled() doesn't recognize a parent Gui component or specific react-native views,
|
|
2837
2846
|
* it will assume the passed in component only accepts style={} for react-native compatibility.
|
|
2838
|
-
* Setting `acceptsClassName: true` indicates
|
|
2847
|
+
* Setting `acceptsClassName: true` indicates Gui can pass in className props.
|
|
2839
2848
|
*/
|
|
2840
2849
|
acceptsClassName?: boolean
|
|
2841
2850
|
|
package/src/views/View.tsx
CHANGED
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import { validStyles } from '@hanzogui/helpers'
|
|
2
2
|
|
|
3
3
|
import { createComponent } from '../createComponent'
|
|
4
|
-
import type {
|
|
4
|
+
import type {
|
|
5
|
+
StackNonStyleProps,
|
|
6
|
+
StackStyle,
|
|
7
|
+
StackStyleBase,
|
|
8
|
+
GuiElement,
|
|
9
|
+
} from '../types'
|
|
5
10
|
|
|
6
11
|
export type View = GuiElement
|
|
7
12
|
export type ViewNonStyleProps = StackNonStyleProps
|
package/types/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,eAAe,EAEf,kBAAkB,EAClB,iBAAiB,EACjB,KAAK,EACL,MAAM,EACN,YAAY,EACb,MAAM,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,eAAe,EAEf,k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AC,EAAE,MAAM,CAAA;QACZ,KAAK,CAAC,EAAE,MAAM,CAAA;KACf,CAAA;CACN,CAAA;AAED,eAAO,IAAI,SAAS,EAAE,SAAS,GAAG,SAAS,CAAA;AAE3C,wBAAgB,QAAQ,CAAC,IAAI,EAAE,SAAS,QAIvC;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,eAAe,QAyBxE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eventHandling.native.d.ts","sourceRoot":"","sources":["../src/eventHandling.native.ts"],"names":[],"mappings":"AAAA;;GAEG;
|
|
1
|
+
{"version":3,"file":"eventHandling.native.d.ts","sourceRoot":"","sources":["../src/eventHandling.native.ts"],"names":[],"mappings":"AAAA;;GAEG;AAOH,OAAO,KAAK,EAAE,YAAY,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAA;AAGjE,wBAAgB,YAAY,OAE3B;AAED,wBAAgB,SAAS,CACvB,MAAM,EAAE,GAAG,EACX,SAAS,EAAE,GAAG,EACd,QAAQ,EAAE;IAAE,OAAO,EAAE,oBAAoB,CAAA;CAAE,EAC3C,YAAY,EAAE,YAAY,EAC1B,KAAK,CAAC,EAAE,OAAO,EACf,kBAAkB,CAAC,EAAE,OAAO,EAC5B,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,OA8I1B;AAED,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,GAAG,EACZ,OAAO,EAAE,GAAG,EACZ,QAAQ,EAAE;IAAE,OAAO,EAAE,oBAAoB,CAAA;CAAE,EAC3C,KAAK,CAAC,EAAE,OAAO,EACf,oBAAoB,CAAC,EAAE,OAAO,OAkD/B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getTokenForKey.d.ts","sourceRoot":"","sources":["../../src/helpers/getTokenForKey.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,aAAa,EACb,iBAAiB,EACjB,eAAe,EACf,QAAQ,EACT,MAAM,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"getTokenForKey.d.ts","sourceRoot":"","sources":["../../src/helpers/getTokenForKey.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,aAAa,EACb,iBAAiB,EACjB,eAAe,EACf,QAAQ,EACT,MAAM,UAAU,CAAA;AA6BjB,wBAAgB,sBAAsB,QAErC;AAED,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,GAAG,QAEhD;AAED,eAAO,MAAM,cAAc,GACzB,KAAK,MAAM,EACX,OAAO,MAAM,EACb,YAAY,eAAe,EAC3B,YAAY,OAAO,CAAC,aAAa,CAAC,QA6JnC,CAAA;AAED,wBAAgB,oBAAoB,CAClC,GAAG,EAAE,MAAM,EACX,QAAQ,EAAE,QAAQ,GAAG,GAAG,EACxB,aAAa,CAAC,EAAE,iBAAiB,OAwBlC"}
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
* platform selectors reliably override more general ones regardless of the order
|
|
4
4
|
* props are declared.
|
|
5
5
|
*
|
|
6
|
-
* Cascade (low
|
|
7
|
-
* $platform-native / $platform-web
|
|
8
|
-
* $platform-android / $platform-ios
|
|
9
|
-
* $platform-tv
|
|
10
|
-
* $platform-androidtv / $platform-tvos
|
|
6
|
+
* Cascade (low → high importance):
|
|
7
|
+
* $platform-native / $platform-web → bump 0 (widest)
|
|
8
|
+
* $platform-android / $platform-ios → bump 1 (OS-specific)
|
|
9
|
+
* $platform-tv → bump 2 (TV subset of Android/iOS)
|
|
10
|
+
* $platform-androidtv / $platform-tvos → bump 3 (most specific)
|
|
11
11
|
*
|
|
12
12
|
* @param mediaKeyShort - Platform media key without the leading '$' (e.g. 'platform-tv', 'platform-androidtv')
|
|
13
13
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useRenderElement.d.ts","sourceRoot":"","sources":["../../src/helpers/useRenderElement.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,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type { StyleObject } from '../types';
|
|
2
|
-
export declare function getStyleTags(styles: StyleObject[]): import("react
|
|
2
|
+
export declare function getStyleTags(styles: StyleObject[]): import("react").JSX.Element | undefined;
|
|
3
3
|
//# sourceMappingURL=wrapStyleTags.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wrapStyleTags.d.ts","sourceRoot":"","sources":["../../src/helpers/wrapStyleTags.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AAI3C,wBAAgB,YAAY,CAAC,MAAM,EAAE,WAAW,EAAE,
|
|
1
|
+
{"version":3,"file":"wrapStyleTags.d.ts","sourceRoot":"","sources":["../../src/helpers/wrapStyleTags.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AAI3C,wBAAgB,YAAY,CAAC,MAAM,EAAE,WAAW,EAAE,2CAyBjD"}
|
|
@@ -47,12 +47,12 @@ export type GuiComponentPropsBaseBase = {
|
|
|
47
47
|
theme?: ThemeName | null;
|
|
48
48
|
/**
|
|
49
49
|
* Marks this component as a group for use in styling children based on parents named group
|
|
50
|
-
* See: https://gui.
|
|
50
|
+
* See: https://gui.dev/docs/intro/props
|
|
51
51
|
*/
|
|
52
52
|
group?: GroupNames | boolean;
|
|
53
53
|
/**
|
|
54
54
|
* Works only alongside group, when children of the group are using container based sizing on native you can hide them until parent is measured.
|
|
55
|
-
* See: https://gui.
|
|
55
|
+
* See: https://gui.dev/docs/intro/props
|
|
56
56
|
*/
|
|
57
57
|
untilMeasured?: 'hide' | 'show';
|
|
58
58
|
/**
|
|
@@ -82,7 +82,7 @@ export type GuiComponentPropsBaseBase = {
|
|
|
82
82
|
disableClassName?: boolean;
|
|
83
83
|
/**
|
|
84
84
|
* Adds some area outside the typical bounds of the component for touch actions to register.
|
|
85
|
-
*
|
|
85
|
+
* Gui uses Pressable internally so it supports `number | Insets` rather than just `Insets`
|
|
86
86
|
*/
|
|
87
87
|
hitSlop?: number | Insets | null;
|
|
88
88
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GuiComponentPropsBaseBase.d.ts","sourceRoot":"","sources":["../../src/interfaces/GuiComponentPropsBaseBase.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"GuiComponentPropsBaseBase.d.ts","sourceRoot":"","sources":["../../src/interfaces/GuiComponentPropsBaseBase.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,SAAS,EACT,SAAS,EACT,UAAU,EACV,IAAI,EACJ,iBAAiB,EAClB,MAAM,UAAU,CAAA;AAEjB,MAAM,MAAM,yBAAyB,GAAG;IACtC,MAAM,CAAC,EAAE,MAAM,CAAA;IAEf,OAAO,CAAC,EAAE,MAAM,CAAA;IAEhB;;;;;;;;;;OAUG;IACH,OAAO,CAAC,EAAE,OAAO,GAAG,cAAc,GAAG,kBAAkB,GAAG,KAAK,CAAA;IAE/D,uBAAuB,CAAC,EAAE;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE,CAAA;IAC5C,QAAQ,CAAC,EAAE,GAAG,GAAG,GAAG,EAAE,CAAA;IAEtB,KAAK,CAAC,EAAE,SAAS,CAAA;IAEjB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAElB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAElB;;OAEG;IACH,YAAY,CAAC,EAAE,OAAO,CAAA;IAEtB;;OAEG;IACH,EAAE,CAAC,EAAE,MAAM,CAAA;IAEX;;;;;OAKG;IACH,MAAM,CAAC,EACH,MAAM,qBAAqB,GAC3B,CAAC,MAAM,GAAG,EAAE,CAAC,GACb,KAAK,CAAC,YAAY,GAClB,CAAC,CACC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG;QAAE,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;KAAE,EAC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