@tamagui/web 1.57.2 → 1.57.4
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/contexts/AnimationDriverContext.js +30 -0
- package/dist/cjs/contexts/AnimationDriverContext.js.map +6 -0
- package/dist/cjs/contexts/ButtonNestingContext.js +30 -0
- package/dist/cjs/contexts/ButtonNestingContext.js.map +6 -0
- package/dist/cjs/contexts/FontLanguageContext.js +30 -0
- package/dist/cjs/contexts/FontLanguageContext.js.map +6 -0
- package/dist/cjs/contexts/TextAncestorContext.js +30 -0
- package/dist/cjs/contexts/TextAncestorContext.js.map +6 -0
- package/dist/cjs/createComponent.js +3 -2
- package/dist/cjs/createComponent.js.map +1 -1
- package/dist/cjs/helpers/ThemeManager.js +10 -13
- package/dist/cjs/helpers/ThemeManager.js.map +2 -2
- package/dist/cjs/helpers/createPropMapper.js +455 -0
- package/dist/cjs/helpers/createPropMapper.js.map +6 -0
- package/dist/cjs/helpers/extendStaticConfig.js +93 -0
- package/dist/cjs/helpers/extendStaticConfig.js.map +6 -0
- package/dist/cjs/helpers/getSplitStyles.js +11 -44
- package/dist/cjs/helpers/getSplitStyles.js.map +1 -1
- package/dist/cjs/helpers/getThemeCSSRules.js +26 -30
- package/dist/cjs/helpers/getThemeCSSRules.js.map +1 -1
- package/dist/cjs/helpers/parseStaticConfig.js +40 -0
- package/dist/cjs/helpers/parseStaticConfig.js.map +6 -0
- package/dist/cjs/helpers/useShallowSetState.js +47 -0
- package/dist/cjs/helpers/useShallowSetState.js.map +6 -0
- package/dist/cjs/hooks/useSafeRef.js +59 -0
- package/dist/cjs/hooks/useSafeRef.js.map +6 -0
- package/dist/cjs/hooks/useServerHooks.js +36 -0
- package/dist/cjs/hooks/useServerHooks.js.map +6 -0
- package/dist/cjs/hooks/useTheme.js +7 -19
- package/dist/cjs/hooks/useTheme.js.map +1 -1
- package/dist/esm/contexts/AnimationDriverContext.js +6 -0
- package/dist/esm/contexts/AnimationDriverContext.js.map +6 -0
- package/dist/esm/contexts/ButtonNestingContext.js +6 -0
- package/dist/esm/contexts/ButtonNestingContext.js.map +6 -0
- package/dist/esm/contexts/FontLanguageContext.js +6 -0
- package/dist/esm/contexts/FontLanguageContext.js.map +6 -0
- package/dist/esm/contexts/TextAncestorContext.js +6 -0
- package/dist/esm/contexts/TextAncestorContext.js.map +6 -0
- package/dist/esm/createComponent.js +3 -2
- package/dist/esm/createComponent.js.map +1 -1
- package/dist/esm/helpers/ThemeManager.js +3 -6
- package/dist/esm/helpers/ThemeManager.js.map +1 -1
- package/dist/esm/helpers/createPropMapper.js +429 -0
- package/dist/esm/helpers/createPropMapper.js.map +6 -0
- package/dist/esm/helpers/extendStaticConfig.js +67 -0
- package/dist/esm/helpers/extendStaticConfig.js.map +6 -0
- package/dist/esm/helpers/getSplitStyles.js +11 -44
- package/dist/esm/helpers/getSplitStyles.js.map +1 -1
- package/dist/esm/helpers/getThemeCSSRules.js +26 -30
- package/dist/esm/helpers/getThemeCSSRules.js.map +1 -1
- package/dist/esm/helpers/parseStaticConfig.js +16 -0
- package/dist/esm/helpers/parseStaticConfig.js.map +6 -0
- package/dist/esm/helpers/useShallowSetState.js +23 -0
- package/dist/esm/helpers/useShallowSetState.js.map +6 -0
- package/dist/esm/hooks/useSafeRef.js +35 -0
- package/dist/esm/hooks/useSafeRef.js.map +6 -0
- package/dist/esm/hooks/useServerHooks.js +11 -0
- package/dist/esm/hooks/useServerHooks.js.map +6 -0
- package/dist/esm/hooks/useTheme.js +7 -19
- package/dist/esm/hooks/useTheme.js.map +1 -1
- package/package.json +9 -9
- package/src/createComponent.tsx +4 -3
- package/src/helpers/ThemeManager.tsx +4 -8
- package/src/helpers/getSplitStyles.tsx +11 -49
- package/src/helpers/getThemeCSSRules.ts +31 -36
- package/src/hooks/useTheme.tsx +9 -24
- package/types/contexts/AnimationDriverContext.d.ts.map +1 -0
- package/types/contexts/ButtonNestingContext.d.ts.map +1 -0
- package/types/contexts/FontLanguageContext.d.ts.map +1 -0
- package/types/contexts/TextAncestorContext.d.ts.map +1 -0
- package/types/createComponent.d.ts.map +1 -1
- package/types/helpers/ThemeManager.d.ts +2 -2
- package/types/helpers/ThemeManager.d.ts.map +1 -1
- package/types/helpers/createPropMapper.d.ts.map +1 -0
- package/types/helpers/getSplitStyles.d.ts.map +1 -1
- package/types/helpers/getThemeCSSRules.d.ts.map +1 -1
- package/types/helpers/parseStaticConfig.d.ts.map +1 -0
- package/types/helpers/useShallowSetState.d.ts.map +1 -0
- package/types/hooks/useSafeRef.d.ts.map +1 -0
- package/types/hooks/useServerHooks.d.ts.map +1 -0
- package/types/hooks/useTheme.d.ts +1 -4
- package/types/hooks/useTheme.d.ts.map +1 -1
|
@@ -134,16 +134,6 @@ export const getSplitStyles: StyleSplitter = (
|
|
|
134
134
|
elementType,
|
|
135
135
|
debug
|
|
136
136
|
) => {
|
|
137
|
-
let time: any
|
|
138
|
-
if (
|
|
139
|
-
!process.env.TAMAGUI_IS_CORE_NODE &&
|
|
140
|
-
process.env.NODE_ENV === 'development' &&
|
|
141
|
-
debug === 'profile'
|
|
142
|
-
) {
|
|
143
|
-
const timer = require('@tamagui/timer').timer()
|
|
144
|
-
time = timer.start()
|
|
145
|
-
}
|
|
146
|
-
|
|
147
137
|
conf = conf || getConfig()
|
|
148
138
|
const { shorthands } = conf
|
|
149
139
|
const {
|
|
@@ -196,8 +186,6 @@ export const getSplitStyles: StyleSplitter = (
|
|
|
196
186
|
debug,
|
|
197
187
|
}
|
|
198
188
|
|
|
199
|
-
if (process.env.NODE_ENV === 'development' && time) time`style:setup`
|
|
200
|
-
|
|
201
189
|
if (
|
|
202
190
|
process.env.NODE_ENV === 'development' &&
|
|
203
191
|
debug &&
|
|
@@ -250,10 +238,7 @@ export const getSplitStyles: StyleSplitter = (
|
|
|
250
238
|
}
|
|
251
239
|
}
|
|
252
240
|
|
|
253
|
-
if (process.env.NODE_ENV === 'development' && time) time`style:loop:start`
|
|
254
241
|
for (const keyOg in props) {
|
|
255
|
-
if (process.env.NODE_ENV === 'development' && time) time`style:loop:start1`
|
|
256
|
-
|
|
257
242
|
let keyInit = keyOg
|
|
258
243
|
let valInit = props[keyOg]
|
|
259
244
|
|
|
@@ -266,16 +251,18 @@ export const getSplitStyles: StyleSplitter = (
|
|
|
266
251
|
if (keyInit in usedKeys) continue
|
|
267
252
|
if (keyInit in skipProps && !isHOC) {
|
|
268
253
|
if (keyInit === 'group') {
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
254
|
+
if (process.env.TAMAGUI_TARGET === 'web') {
|
|
255
|
+
// add container style
|
|
256
|
+
const identifier = `t_group_${valInit}`
|
|
257
|
+
const containerCSS = {
|
|
258
|
+
identifier,
|
|
259
|
+
property: 'container',
|
|
260
|
+
rules: [
|
|
261
|
+
`.${identifier} { container-name: ${valInit}; container-type: inline-size; }`,
|
|
262
|
+
],
|
|
263
|
+
}
|
|
264
|
+
addStyleToInsertRules(rulesToInsert, containerCSS)
|
|
277
265
|
}
|
|
278
|
-
addStyleToInsertRules(rulesToInsert, containerCSS)
|
|
279
266
|
}
|
|
280
267
|
continue
|
|
281
268
|
}
|
|
@@ -283,7 +270,6 @@ export const getSplitStyles: StyleSplitter = (
|
|
|
283
270
|
const valInitType = typeof valInit
|
|
284
271
|
|
|
285
272
|
styleState.curProps[keyInit] = valInit
|
|
286
|
-
if (process.env.NODE_ENV === 'development' && time) time`style:loop:set-cur-prop`
|
|
287
273
|
|
|
288
274
|
// TODO this is duplicated! but seems to be fixing some bugs so leaving got now
|
|
289
275
|
if (process.env.TAMAGUI_TARGET === 'web') {
|
|
@@ -360,8 +346,6 @@ export const getSplitStyles: StyleSplitter = (
|
|
|
360
346
|
}
|
|
361
347
|
}
|
|
362
348
|
|
|
363
|
-
if (process.env.NODE_ENV === 'development' && time) time`style:loop:accessibility-map`
|
|
364
|
-
|
|
365
349
|
if (keyInit === 'dataSet') {
|
|
366
350
|
for (const keyInit in valInit) {
|
|
367
351
|
viewProps[`data-${hyphenate(keyInit)}`] = valInit[keyInit]
|
|
@@ -636,14 +620,10 @@ export const getSplitStyles: StyleSplitter = (
|
|
|
636
620
|
|
|
637
621
|
const avoidPropMap = isMediaOrPseudo || (!isVariant && !isValidStyleKeyInit)
|
|
638
622
|
|
|
639
|
-
if (process.env.NODE_ENV === 'development' && time) time`style:loop:setup`
|
|
640
|
-
|
|
641
623
|
const expanded = avoidPropMap
|
|
642
624
|
? ([[keyInit, valInit]] as const)
|
|
643
625
|
: propMapper(keyInit, valInit, styleState)
|
|
644
626
|
|
|
645
|
-
if (process.env.NODE_ENV === 'development' && time) time`style:loop:propMapper`
|
|
646
|
-
|
|
647
627
|
const next = getPropMappedFontFamily(expanded)
|
|
648
628
|
if (next) {
|
|
649
629
|
styleState.fontFamily = next
|
|
@@ -680,11 +660,7 @@ export const getSplitStyles: StyleSplitter = (
|
|
|
680
660
|
|
|
681
661
|
if (!expanded) continue
|
|
682
662
|
|
|
683
|
-
if (process.env.NODE_ENV === 'development' && time) time`style:loop:pre-expand`
|
|
684
|
-
|
|
685
663
|
for (const [key, val] of expanded) {
|
|
686
|
-
if (process.env.NODE_ENV === 'development' && time) time`style:loop:expand:start`
|
|
687
|
-
|
|
688
664
|
if (val == null) continue
|
|
689
665
|
if (key in usedKeys) continue
|
|
690
666
|
|
|
@@ -693,9 +669,6 @@ export const getSplitStyles: StyleSplitter = (
|
|
|
693
669
|
isMediaOrPseudo = isMedia || isPseudo
|
|
694
670
|
isVariant = variants && key in variants
|
|
695
671
|
|
|
696
|
-
if (process.env.NODE_ENV === 'development' && time)
|
|
697
|
-
time`style:loop:expand:is-checks`
|
|
698
|
-
|
|
699
672
|
if (inlineProps?.has(key) || (IS_STATIC && inlineWhenUnflattened?.has(key))) {
|
|
700
673
|
viewProps[key] = props[key] ?? val
|
|
701
674
|
}
|
|
@@ -1081,8 +1054,6 @@ export const getSplitStyles: StyleSplitter = (
|
|
|
1081
1054
|
}
|
|
1082
1055
|
} // end prop loop
|
|
1083
1056
|
|
|
1084
|
-
if (process.env.NODE_ENV === 'development' && time) time`style:loop`
|
|
1085
|
-
|
|
1086
1057
|
// merge after the prop loop - this way pseudos apply and set usedKeys and then this wont clobber them
|
|
1087
1058
|
// otherwise styled(styleable(), { bg: 'red', pressStyle: { bg: 'pink' } })
|
|
1088
1059
|
// will pass down a style={} + pressStyle={} but pressStyle will go behind style depending on how you pass it
|
|
@@ -1257,8 +1228,6 @@ export const getSplitStyles: StyleSplitter = (
|
|
|
1257
1228
|
}
|
|
1258
1229
|
}
|
|
1259
1230
|
|
|
1260
|
-
if (process.env.NODE_ENV === 'development' && time) time`style:after-loop`
|
|
1261
|
-
|
|
1262
1231
|
const result: GetStyleResult = {
|
|
1263
1232
|
space,
|
|
1264
1233
|
hasMedia,
|
|
@@ -1274,8 +1243,6 @@ export const getSplitStyles: StyleSplitter = (
|
|
|
1274
1243
|
mediaGroups,
|
|
1275
1244
|
}
|
|
1276
1245
|
|
|
1277
|
-
if (process.env.NODE_ENV === 'development' && time) time`style:create-result`
|
|
1278
|
-
|
|
1279
1246
|
// native: swap out the right family based on weight/style
|
|
1280
1247
|
if (process.env.TAMAGUI_TARGET === 'native') {
|
|
1281
1248
|
if (style.fontFamily) {
|
|
@@ -1327,11 +1294,6 @@ export const getSplitStyles: StyleSplitter = (
|
|
|
1327
1294
|
}
|
|
1328
1295
|
}
|
|
1329
1296
|
|
|
1330
|
-
if (process.env.NODE_ENV === 'development' && time) {
|
|
1331
|
-
time`rest`
|
|
1332
|
-
time.print()
|
|
1333
|
-
}
|
|
1334
|
-
|
|
1335
1297
|
return result
|
|
1336
1298
|
}
|
|
1337
1299
|
|
|
@@ -21,7 +21,7 @@ export function getThemeCSSRules(props: {
|
|
|
21
21
|
const { config, themeName, theme, names } = props
|
|
22
22
|
|
|
23
23
|
// special case for SSR
|
|
24
|
-
const hasDarkLight = 'light' in config.themes
|
|
24
|
+
const hasDarkLight = 'light' in config.themes || 'dark' in config.themes
|
|
25
25
|
const CNP = `.${THEME_CLASSNAME_PREFIX}`
|
|
26
26
|
let vars = ''
|
|
27
27
|
|
|
@@ -40,17 +40,19 @@ export function getThemeCSSRules(props: {
|
|
|
40
40
|
vars += `--${simpleHash(themeKey, 40)}:${value};`
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
const
|
|
43
|
+
const isDarkBase = themeName === 'dark'
|
|
44
|
+
const isLightBase = themeName === 'light'
|
|
44
45
|
const baseSelectors = names.map((name) => `${CNP}${name}`)
|
|
45
46
|
const selectorsSet = new Set(baseSelectors)
|
|
46
47
|
|
|
47
48
|
// since we dont specify dark/light in classnames we have to do an awkward specificity war
|
|
48
49
|
// use config.maxDarkLightNesting to determine how deep you can nest until it breaks
|
|
49
50
|
if (hasDarkLight) {
|
|
51
|
+
const maxDepth = config.maxDarkLightNesting ?? 3
|
|
52
|
+
|
|
50
53
|
for (const subName of names) {
|
|
51
|
-
const isDark =
|
|
52
|
-
const isLight =
|
|
53
|
-
const maxDepth = config.maxDarkLightNesting ?? 3
|
|
54
|
+
const isDark = isDarkBase || subName.startsWith('dark_')
|
|
55
|
+
const isLight = !isDark && (isLightBase || subName.startsWith('light_'))
|
|
54
56
|
|
|
55
57
|
if (!(isDark || isLight)) {
|
|
56
58
|
// neither light nor dark subtheme, just generate one selector with :root:root which
|
|
@@ -60,45 +62,38 @@ export function getThemeCSSRules(props: {
|
|
|
60
62
|
}
|
|
61
63
|
|
|
62
64
|
const childSelector = `${CNP}${subName.replace(/^(dark|light)_/, '')}`
|
|
65
|
+
const order = isDark ? ['dark', 'light'] : ['light', 'dark']
|
|
66
|
+
const [stronger, weaker] = order
|
|
67
|
+
const numSelectors = Math.round(maxDepth * 1.5)
|
|
63
68
|
|
|
64
|
-
|
|
69
|
+
for (let depth = 0; depth < numSelectors; depth++) {
|
|
70
|
+
const isOdd = depth % 2 === 1
|
|
65
71
|
|
|
66
|
-
|
|
67
|
-
if (
|
|
68
|
-
|
|
72
|
+
// wtf is this continue:
|
|
73
|
+
if (isOdd && depth < 3) {
|
|
74
|
+
continue
|
|
69
75
|
}
|
|
70
|
-
const [stronger, weaker] = order
|
|
71
|
-
const numSelectors = Math.round(maxDepth * 1.5)
|
|
72
|
-
|
|
73
|
-
for (let depth = 0; depth < numSelectors; depth++) {
|
|
74
|
-
const isOdd = depth % 2 === 1
|
|
75
|
-
|
|
76
|
-
// wtf is this continue:
|
|
77
|
-
if (isOdd && depth < 3) {
|
|
78
|
-
continue
|
|
79
|
-
}
|
|
80
76
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
77
|
+
const parents = new Array(depth + 1).fill(0).map((_, psi) => {
|
|
78
|
+
return `${CNP}${psi % 2 === 0 ? stronger : weaker}`
|
|
79
|
+
})
|
|
84
80
|
|
|
85
|
-
|
|
81
|
+
let parentSelectors = parents.length > 1 ? parents.slice(1) : parents
|
|
86
82
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
83
|
+
if (isOdd) {
|
|
84
|
+
const [_first, second, ...rest] = parentSelectors
|
|
85
|
+
parentSelectors = [second, ...rest, second]
|
|
86
|
+
}
|
|
91
87
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
88
|
+
const lastParentSelector = parentSelectors[parentSelectors.length - 1]
|
|
89
|
+
const nextChildSelector =
|
|
90
|
+
childSelector === lastParentSelector ? '' : childSelector
|
|
95
91
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
}
|
|
92
|
+
// for light/dark/light:
|
|
93
|
+
selectorsSet.add(`${parentSelectors.join(' ')} ${nextChildSelector}`.trim())
|
|
94
|
+
selectorsSet.add(
|
|
95
|
+
`${parentSelectors.join(' ')} ${nextChildSelector}.is_inversed`.trim()
|
|
96
|
+
)
|
|
102
97
|
}
|
|
103
98
|
}
|
|
104
99
|
}
|
package/src/hooks/useTheme.tsx
CHANGED
|
@@ -32,9 +32,7 @@ const emptyProps = { name: null }
|
|
|
32
32
|
|
|
33
33
|
function getDefaultThemeProxied() {
|
|
34
34
|
const config = getConfig()
|
|
35
|
-
return getThemeProxied(
|
|
36
|
-
theme: config.themes[Object.keys(config.themes)[0]],
|
|
37
|
-
})
|
|
35
|
+
return getThemeProxied(config.themes[Object.keys(config.themes)[0]])
|
|
38
36
|
}
|
|
39
37
|
|
|
40
38
|
type ThemeGettable<Val> = Val & {
|
|
@@ -99,14 +97,7 @@ export const useThemeWithState = (
|
|
|
99
97
|
}
|
|
100
98
|
|
|
101
99
|
const themeProxied = useMemo(() => {
|
|
102
|
-
return getThemeProxied(
|
|
103
|
-
{
|
|
104
|
-
theme,
|
|
105
|
-
themeManager,
|
|
106
|
-
},
|
|
107
|
-
keys.current,
|
|
108
|
-
props.debug
|
|
109
|
-
)
|
|
100
|
+
return getThemeProxied(theme, themeManager, keys.current, props.debug)
|
|
110
101
|
}, [theme, name, className, themeManager])
|
|
111
102
|
|
|
112
103
|
if (process.env.NODE_ENV === 'development' && props.debug === 'verbose') {
|
|
@@ -120,13 +111,8 @@ export const useThemeWithState = (
|
|
|
120
111
|
}
|
|
121
112
|
|
|
122
113
|
export function getThemeProxied(
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
themeManager,
|
|
126
|
-
}: {
|
|
127
|
-
theme: ThemeParsed
|
|
128
|
-
themeManager?: ThemeManager
|
|
129
|
-
},
|
|
114
|
+
theme: ThemeParsed,
|
|
115
|
+
themeManager?: ThemeManager,
|
|
130
116
|
keys?: string[],
|
|
131
117
|
debug?: DebugProp
|
|
132
118
|
): UseThemeResult {
|
|
@@ -198,7 +184,6 @@ export const useChangeThemeEffect = (
|
|
|
198
184
|
} = props
|
|
199
185
|
|
|
200
186
|
const parentManager = useContext(ThemeManagerContext)
|
|
201
|
-
const hasThemeUpdatingProps = getHasThemeUpdatingProps(props)
|
|
202
187
|
|
|
203
188
|
if (disable) {
|
|
204
189
|
if (!parentManager) throw `❌ 2`
|
|
@@ -330,13 +315,13 @@ export const useChangeThemeEffect = (
|
|
|
330
315
|
// returns previous theme manager if no change
|
|
331
316
|
let themeManager: ThemeManager = parentManager!
|
|
332
317
|
let state: ThemeManagerState | undefined
|
|
318
|
+
const hasThemeUpdatingProps = getHasThemeUpdatingProps(props)
|
|
333
319
|
|
|
334
|
-
const getNewThemeManager = () => {
|
|
335
|
-
return new ThemeManager(props, root ? 'root' : parentManager)
|
|
336
|
-
}
|
|
337
|
-
|
|
338
|
-
// only if has updating theme props
|
|
339
320
|
if (hasThemeUpdatingProps) {
|
|
321
|
+
const getNewThemeManager = () => {
|
|
322
|
+
return new ThemeManager(props, root ? 'root' : parentManager)
|
|
323
|
+
}
|
|
324
|
+
|
|
340
325
|
if (prev?.themeManager) {
|
|
341
326
|
themeManager = prev.themeManager
|
|
342
327
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AnimationDriverContext.d.ts","sourceRoot":"","sources":["../../src/contexts/AnimationDriverContext.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAE1C,eAAO,MAAM,sBAAsB,iDAA8C,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ButtonNestingContext.d.ts","sourceRoot":"","sources":["../../src/contexts/ButtonNestingContext.tsx"],"names":[],"mappings":";AAEA,eAAO,MAAM,oBAAoB,kCAAuB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FontLanguageContext.d.ts","sourceRoot":"","sources":["../../src/contexts/FontLanguageContext.tsx"],"names":[],"mappings":";AAIA,eAAO,MAAM,mBAAmB;;UAAkD,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TextAncestorContext.d.ts","sourceRoot":"","sources":["../../src/contexts/TextAncestorContext.tsx"],"names":[],"mappings":";AAEA,eAAO,MAAM,mBAAmB,kCAAuB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createComponent.d.ts","sourceRoot":"","sources":["../src/createComponent.tsx"],"names":[],"mappings":"AAIA,OAAO,KAaN,MAAM,OAAO,CAAA;AAiBd,OAAO,EAEL,SAAS,EAIT,cAAc,EACd,UAAU,EACV,WAAW,EACX,UAAU,EACV,YAAY,EACZ,gBAAgB,EAEhB,qBAAqB,EACrB,cAAc,EAEd,SAAS,EAGV,MAAM,SAAS,CAAA;AAQhB,eAAO,MAAM,qBAAqB,EAAE,qBAMnC,CAAA;AAoBD,eAAO,MAAM,QAAQ,eAAsB,CAAA;AAmB3C,wBAAgB,eAAe,CAC7B,kBAAkB,SAAS,UAAU,GAAG,SAAS,GAAG,EAAE,EACtD,GAAG,GAAG,cAAc,EACpB,SAAS,GAAG,KAAK,EACjB,YAAY,EAAE,YAAY,
|
|
1
|
+
{"version":3,"file":"createComponent.d.ts","sourceRoot":"","sources":["../src/createComponent.tsx"],"names":[],"mappings":"AAIA,OAAO,KAaN,MAAM,OAAO,CAAA;AAiBd,OAAO,EAEL,SAAS,EAIT,cAAc,EACd,UAAU,EACV,WAAW,EACX,UAAU,EACV,YAAY,EACZ,gBAAgB,EAEhB,qBAAqB,EACrB,cAAc,EAEd,SAAS,EAGV,MAAM,SAAS,CAAA;AAQhB,eAAO,MAAM,qBAAqB,EAAE,qBAMnC,CAAA;AAoBD,eAAO,MAAM,QAAQ,eAAsB,CAAA;AAmB3C,wBAAgB,eAAe,CAC7B,kBAAkB,SAAS,UAAU,GAAG,SAAS,GAAG,EAAE,EACtD,GAAG,GAAG,cAAc,EACpB,SAAS,GAAG,KAAK,EACjB,YAAY,EAAE,YAAY,4DAokC3B;AAGD,wBAAgB,QAAQ,CAAC,KAAK,EAAE;IAAE,QAAQ,CAAC,EAAE,GAAG,CAAA;CAAE,OAEjD;AAMD,eAAO,MAAM,MAAM,0DA8CjB,CAAA;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAChC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC1B,KAAK,CAAC,EAAE,UAAU,CAAA;IAClB,SAAS,CAAC,EAAE,OAAO,GAAG,MAAM,CAAA;IAC5B,SAAS,CAAC,EAAE,cAAc,CAAA;IAC1B,SAAS,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC3B,KAAK,CAAC,EAAE,SAAS,CAAA;CAClB,CAAA;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,mBAAmB,mBAkGxD"}
|
|
@@ -15,7 +15,7 @@ export type ThemeManagerState = {
|
|
|
15
15
|
componentName?: string;
|
|
16
16
|
inverse?: boolean;
|
|
17
17
|
};
|
|
18
|
-
export declare function getHasThemeUpdatingProps(props: ThemeProps): boolean;
|
|
18
|
+
export declare function getHasThemeUpdatingProps(props: ThemeProps): string | boolean | undefined;
|
|
19
19
|
export declare class ThemeManager {
|
|
20
20
|
props: ThemeProps;
|
|
21
21
|
id: number;
|
|
@@ -28,7 +28,7 @@ export declare class ThemeManager {
|
|
|
28
28
|
updateStateFromProps(props?: ThemeProps & {
|
|
29
29
|
forceTheme?: ThemeParsed;
|
|
30
30
|
}, shouldNotify?: boolean): true | ThemeManagerState | undefined;
|
|
31
|
-
updateState(nextState: ThemeManagerState, shouldNotify?: boolean):
|
|
31
|
+
updateState(nextState: ThemeManagerState, shouldNotify?: boolean): void;
|
|
32
32
|
getStateIfChanged(props?: ThemeProps, state?: ThemeManagerState | null, parentManager?: ThemeManager | null): ThemeManagerState | null | undefined;
|
|
33
33
|
getStateShouldChange(nextState: ThemeManagerState | null, state?: ThemeManagerState | null): boolean;
|
|
34
34
|
getState(props?: ThemeProps, parentManager?: ThemeManager | null): ThemeManagerState | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThemeManager.d.ts","sourceRoot":"","sources":["../../src/helpers/ThemeManager.tsx"],"names":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E,UAAU,CAAC,EAAE,WAAW,CAAA;KAAqB,EACnE,YAAY,UAAO;IAerB,WAAW,CAAC,SAAS,EAAE,iBAAiB,EAAE,YAAY,UAAO;IAkB7D,iBAAiB,CACf,KAAK,aAAa,EAClB,KAAK,GAAE,iBAAiB,GAAG,IAAiB,EAC5C,aAAa,sBAAqB;IAapC,oBAAoB,CAClB,SAAS,EAAE,iBAAiB,GAAG,IAAI,EACnC,KAAK,GAAE,iBAAiB,GAAG,IAAiB;IAQ9C,QAAQ,CAAC,KAAK,aAAa,EAAE,aAAa,sBAAqB;IAO/D,QAAQ,EAAE,GAAG,CAAC,MAAM,CAAC,GAAG,IAAI,CAAO;IACnC,IAAI,OAAO,gBAMV;IAED,MAAM,CAAC,MAAM,UAAQ;IAIrB,aAAa,CAAC,EAAE,EAAE,aAAa,EAAE,OAAO,CAAC,EAAE,MAAM;CAalD;AAuKD,wBAAgB,4BAA4B,CAAC,YAAY,CAAC,EAAE,YAAY,GAAG,IAAI,4CAe9E"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createPropMapper.d.ts","sourceRoot":"","sources":["../../src/helpers/createPropMapper.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAEV,UAAU,EACV,kBAAkB,EAElB,qBAAqB,EAEtB,MAAM,UAAU,CAAA;AASjB,MAAM,MAAM,oBAAoB,GAC5B,MAAM,GACN,OAAO,GACP,UAAU,GACV,MAAM,GACN,iBAAiB,CAAA;AAErB,eAAO,MAAM,gBAAgB,iBAAkB,kBAAkB,eA+FhE,CAAA;AAqHD,wBAAgB,+BAA+B,CAAC,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,qBAAqB,sBA2BtF;AAMD,eAAO,MAAM,uBAAuB,cAAe,GAAG,QAErD,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getSplitStyles.d.ts","sourceRoot":"","sources":["../../src/helpers/getSplitStyles.tsx"],"names":[],"mappings":"AAmCA,O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AAE,YAAY,EAC1B,KAAK,EAAE,WAAW,EAClB,SAAS,EAAE,MAAM,EACjB,cAAc,EAAE,qBAAqB,EACrC,UAAU,EAAE,eAAe,EAC3B,iBAAiB,CAAC,EAAE,cAAc,GAAG,IAAI,EACzC,OAAO,CAAC,EAAE,iBAAiB,EAE3B,WAAW,CAAC,EAAE,MAAM,EACpB,KAAK,CAAC,EAAE,SAAS,KACd,cAAc,CAAA;AAEnB,eAAO,MAAM,UAAU,MAAM,CAAA;AAuB7B,eAAO,MAAM,cAAc,EAAE,aAqpC5B,CAAA;AAqDD,eAAO,MAAM,WAAW,eACV,aAAa,UACjB,MAAM,WACL,MAAM,wBACO,OAAO,KAC5B,cAuBF,CAAA;AA0BD,eAAO,MAAM,cAAc,EAAE,aAQ5B,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getThemeCSSRules.d.ts","sourceRoot":"","sources":["../../src/helpers/getThemeCSSRules.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AAG/D,wBAAgB,gBAAgB,CAAC,KAAK,EAAE;IACtC,MAAM,EAAE,kBAAkB,CAAA;IAC1B,SAAS,EAAE,MAAM,CAAA;IACjB,KAAK,EAAE,WAAW,CAAA;IAClB,KAAK,EAAE,MAAM,EAAE,CAAA;CAChB,
|
|
1
|
+
{"version":3,"file":"getThemeCSSRules.d.ts","sourceRoot":"","sources":["../../src/helpers/getThemeCSSRules.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AAG/D,wBAAgB,gBAAgB,CAAC,KAAK,EAAE;IACtC,MAAM,EAAE,kBAAkB,CAAA;IAC1B,SAAS,EAAE,MAAM,CAAA;IACjB,KAAK,EAAE,WAAW,CAAA;IAClB,KAAK,EAAE,MAAM,EAAE,CAAA;CAChB,YAuJA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parseStaticConfig.d.ts","sourceRoot":"","sources":["../../src/helpers/parseStaticConfig.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAA;AAGhE,eAAO,MAAM,iBAAiB,WAAY,QAAQ,YAAY,CAAC,KAAG,kBAUjE,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useShallowSetState.d.ts","sourceRoot":"","sources":["../../src/helpers/useShallowSetState.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsB,MAAM,OAAO,CAAA;AAE1C,OAAO,EAAE,SAAS,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAA;AAE3D,wBAAgB,kBAAkB,CAAC,KAAK,SAAS,qBAAqB,EACpE,MAAM,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC,EACnD,KAAK,CAAC,EAAE,SAAS,EACjB,SAAS,CAAC,EAAE,MAAM,UAGT,QAAQ,KAAK,CAAC,UAexB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSafeRef.d.ts","sourceRoot":"","sources":["../../src/hooks/useSafeRef.ts"],"names":[],"mappings":"AAcA,eAAO,MAAM,UAAU;;CA8BtB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useServerHooks.d.ts","sourceRoot":"","sources":["../../src/hooks/useServerHooks.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAExC,eAAO,MAAM,cAAc,iBAEf,CAAA;AAEZ,eAAO,MAAM,YAAY,eAEf,CAAA"}
|
|
@@ -15,10 +15,7 @@ type UseThemeResult = {
|
|
|
15
15
|
};
|
|
16
16
|
export declare const useTheme: (props?: ThemeProps) => UseThemeResult;
|
|
17
17
|
export declare const useThemeWithState: (props: ThemeProps) => [ChangedThemeResponse, ThemeParsed];
|
|
18
|
-
export declare function getThemeProxied(
|
|
19
|
-
theme: ThemeParsed;
|
|
20
|
-
themeManager?: ThemeManager;
|
|
21
|
-
}, keys?: string[], debug?: DebugProp): UseThemeResult;
|
|
18
|
+
export declare function getThemeProxied(theme: ThemeParsed, themeManager?: ThemeManager, keys?: string[], debug?: DebugProp): UseThemeResult;
|
|
22
19
|
export declare const activeThemeManagers: Set<ThemeManager>;
|
|
23
20
|
export declare const useChangeThemeEffect: (props: ThemeProps, root?: boolean, keys?: string[], shouldUpdate?: () => boolean | undefined) => ChangedThemeResponse;
|
|
24
21
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useTheme.d.ts","sourceRoot":"","sources":["../../src/hooks/useTheme.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,QAAQ,EAAe,MAAM,mBAAmB,CAAA;AAEzD,OAAO,EACL,YAAY,EACZ,iBAAiB,EAElB,MAAM,yBAAyB,CAAA;AAEhC,OAAO,KAAK,EACV,SAAS,EACT,WAAW,EACX,UAAU,EAEV,WAAW,EACX,kBAAkB,EACnB,MAAM,UAAU,CAAA;AAGjB,MAAM,MAAM,oBAAoB,GAAG;IACjC,KAAK,EAAE,iBAAiB,CAAA;IACxB,YAAY,EAAE,YAAY,CAAA;IAC1B,UAAU,EAAE,OAAO,CAAA;IACnB,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB,CAAA;
|
|
1
|
+
{"version":3,"file":"useTheme.d.ts","sourceRoot":"","sources":["../../src/hooks/useTheme.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,QAAQ,EAAe,MAAM,mBAAmB,CAAA;AAEzD,OAAO,EACL,YAAY,EACZ,iBAAiB,EAElB,MAAM,yBAAyB,CAAA;AAEhC,OAAO,KAAK,EACV,SAAS,EACT,WAAW,EACX,UAAU,EAEV,WAAW,EACX,kBAAkB,EACnB,MAAM,UAAU,CAAA;AAGjB,MAAM,MA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