@tamagui/web 1.88.21 → 1.88.23
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/esm/Tamagui.native.js +14 -41
- package/dist/esm/Tamagui.native.js.map +1 -1
- package/dist/esm/config.native.js +4 -40
- package/dist/esm/config.native.js.map +1 -1
- package/dist/esm/constants/accessibilityDirectMap.native.js +2 -27
- package/dist/esm/constants/accessibilityDirectMap.native.js.map +1 -1
- package/dist/esm/constants/constants.native.js +2 -26
- package/dist/esm/constants/constants.native.js.map +1 -1
- package/dist/esm/constants/isDevTools.native.js +2 -23
- package/dist/esm/constants/isDevTools.native.js.map +1 -1
- package/dist/esm/contexts/ComponentContext.native.js +4 -25
- package/dist/esm/contexts/ComponentContext.native.js.map +1 -1
- package/dist/esm/createComponent.native.js +108 -100
- package/dist/esm/createComponent.native.js.map +2 -2
- package/dist/esm/createFont.native.js +2 -23
- package/dist/esm/createFont.native.js.map +1 -1
- package/dist/esm/createShorthands.native.js +2 -23
- package/dist/esm/createShorthands.native.js.map +1 -1
- package/dist/esm/createTamagui.native.js +33 -40
- package/dist/esm/createTamagui.native.js.map +1 -1
- package/dist/esm/createTheme.native.js +2 -23
- package/dist/esm/createTheme.native.js.map +1 -1
- package/dist/esm/createTokens.native.js +4 -25
- package/dist/esm/createTokens.native.js.map +1 -1
- package/dist/esm/createVariable.native.js +10 -38
- package/dist/esm/createVariable.native.js.map +1 -1
- package/dist/esm/createVariables.native.js +7 -27
- package/dist/esm/createVariables.native.js.map +1 -1
- package/dist/esm/defaultComponentState.native.js +2 -25
- package/dist/esm/defaultComponentState.native.js.map +1 -1
- package/dist/esm/helpers/ThemeManager.native.js +12 -33
- package/dist/esm/helpers/ThemeManager.native.js.map +2 -2
- package/dist/esm/helpers/ThemeManagerContext.native.js +4 -25
- package/dist/esm/helpers/ThemeManagerContext.native.js.map +1 -1
- package/dist/esm/helpers/createMediaStyle.native.js +8 -28
- package/dist/esm/helpers/createMediaStyle.native.js.map +1 -1
- package/dist/esm/helpers/createShallowSetState.native.js +2 -25
- package/dist/esm/helpers/createShallowSetState.native.js.map +1 -1
- package/dist/esm/helpers/createStyledContext.native.js +11 -30
- package/dist/esm/helpers/createStyledContext.native.js.map +1 -1
- package/dist/esm/helpers/defaultOffset.native.js +2 -23
- package/dist/esm/helpers/defaultOffset.native.js.map +1 -1
- package/dist/esm/helpers/expandStyle.native.js +5 -26
- package/dist/esm/helpers/expandStyle.native.js.map +1 -1
- package/dist/esm/helpers/expandStyles.native.js +6 -26
- package/dist/esm/helpers/expandStyles.native.js.map +1 -1
- package/dist/esm/helpers/getExpandedShorthands.native.js +4 -25
- package/dist/esm/helpers/getExpandedShorthands.native.js.map +1 -1
- package/dist/esm/helpers/getFontLanguage.native.js +2 -23
- package/dist/esm/helpers/getFontLanguage.native.js.map +1 -1
- package/dist/esm/helpers/getGroupPropParts.native.js +4 -25
- package/dist/esm/helpers/getGroupPropParts.native.js.map +1 -1
- package/dist/esm/helpers/getSplitStyles.native.js +108 -83
- package/dist/esm/helpers/getSplitStyles.native.js.map +2 -2
- package/dist/esm/helpers/getStylesAtomic.native.js +2 -26
- package/dist/esm/helpers/getStylesAtomic.native.js.map +1 -1
- package/dist/esm/helpers/getThemeCSSRules.native.js +2 -23
- package/dist/esm/helpers/getThemeCSSRules.native.js.map +1 -1
- package/dist/esm/helpers/getVariantExtras.native.js +4 -26
- package/dist/esm/helpers/getVariantExtras.native.js.map +1 -1
- package/dist/esm/helpers/insertStyleRule.native.js +8 -36
- package/dist/esm/helpers/insertStyleRule.native.js.map +1 -1
- package/dist/esm/helpers/isObj.native.js +2 -23
- package/dist/esm/helpers/isObj.native.js.map +1 -1
- package/dist/esm/helpers/isTamaguiComponent.native.js +2 -23
- package/dist/esm/helpers/isTamaguiComponent.native.js.map +1 -1
- package/dist/esm/helpers/isTamaguiElement.native.js +5 -25
- package/dist/esm/helpers/isTamaguiElement.native.js.map +1 -1
- package/dist/esm/helpers/log.native.js +2 -23
- package/dist/esm/helpers/log.native.js.map +1 -1
- package/dist/esm/helpers/matchMedia.native.js +2 -24
- package/dist/esm/helpers/matchMedia.native.js.map +1 -1
- package/dist/esm/helpers/mergeProps.native.js +5 -25
- package/dist/esm/helpers/mergeProps.native.js.map +1 -1
- package/dist/esm/helpers/mergeVariants.native.js +2 -23
- package/dist/esm/helpers/mergeVariants.native.js.map +1 -1
- package/dist/esm/helpers/normalizeColor.native.js +7 -29
- package/dist/esm/helpers/normalizeColor.native.js.map +2 -2
- package/dist/esm/helpers/normalizeShadow.native.js +7 -27
- package/dist/esm/helpers/normalizeShadow.native.js.map +1 -1
- package/dist/esm/helpers/normalizeStyle.native.js +11 -28
- package/dist/esm/helpers/normalizeStyle.native.js.map +1 -1
- package/dist/esm/helpers/normalizeStylePropKeys.native.js +2 -23
- package/dist/esm/helpers/normalizeStylePropKeys.native.js.map +1 -1
- package/dist/esm/helpers/normalizeValueWithProperty.native.js +9 -29
- package/dist/esm/helpers/normalizeValueWithProperty.native.js.map +1 -1
- package/dist/esm/helpers/objectIdentityKey.native.js +2 -23
- package/dist/esm/helpers/objectIdentityKey.native.js.map +1 -1
- package/dist/esm/helpers/propMapper.native.js +31 -46
- package/dist/esm/helpers/propMapper.native.js.map +1 -1
- package/dist/esm/helpers/proxyThemeToParents.native.js +4 -26
- package/dist/esm/helpers/proxyThemeToParents.native.js.map +1 -1
- package/dist/esm/helpers/proxyThemeVariables.native.js +2 -23
- package/dist/esm/helpers/proxyThemeVariables.native.js.map +1 -1
- package/dist/esm/helpers/pseudoDescriptors.native.js +2 -25
- package/dist/esm/helpers/pseudoDescriptors.native.js.map +1 -1
- package/dist/esm/helpers/registerCSSVariable.native.js +5 -28
- package/dist/esm/helpers/registerCSSVariable.native.js.map +1 -1
- package/dist/esm/helpers/skipProps.native.js +2 -23
- package/dist/esm/helpers/skipProps.native.js.map +1 -1
- package/dist/esm/helpers/themeable.native.js +12 -31
- package/dist/esm/helpers/themeable.native.js.map +1 -1
- package/dist/esm/helpers/themes.native.js +5 -26
- package/dist/esm/helpers/themes.native.js.map +1 -1
- package/dist/esm/helpers/timer.native.js +2 -23
- package/dist/esm/helpers/timer.native.js.map +1 -1
- package/dist/esm/hooks/useConfiguration.native.js +7 -26
- package/dist/esm/hooks/useConfiguration.native.js.map +1 -1
- package/dist/esm/hooks/useDisableSSR.native.js +4 -25
- package/dist/esm/hooks/useDisableSSR.native.js.map +1 -1
- package/dist/esm/hooks/useIsTouchDevice.native.js +5 -25
- package/dist/esm/hooks/useIsTouchDevice.native.js.map +1 -1
- package/dist/esm/hooks/useMedia.native.js +14 -44
- package/dist/esm/hooks/useMedia.native.js.map +1 -1
- package/dist/esm/hooks/useProps.native.js +12 -29
- package/dist/esm/hooks/useProps.native.js.map +1 -1
- package/dist/esm/hooks/useTheme.native.js +27 -47
- package/dist/esm/hooks/useTheme.native.js.map +1 -1
- package/dist/esm/hooks/useThemeName.native.js +8 -26
- package/dist/esm/hooks/useThemeName.native.js.map +1 -1
- package/dist/esm/index.native.js +79 -155
- package/dist/esm/index.native.js.map +1 -1
- package/dist/esm/inject-styles.native.js +2 -23
- package/dist/esm/inject-styles.native.js.map +1 -1
- package/dist/esm/insertFont.native.js +10 -31
- package/dist/esm/insertFont.native.js.map +1 -1
- package/dist/esm/interfaces/CSSColorNames.native.js +0 -14
- package/dist/esm/interfaces/CSSColorNames.native.js.map +2 -2
- package/dist/esm/interfaces/GetRef.native.js +0 -14
- package/dist/esm/interfaces/GetRef.native.js.map +2 -2
- package/dist/esm/interfaces/KeyTypes.native.js +0 -14
- package/dist/esm/interfaces/KeyTypes.native.js.map +2 -2
- package/dist/esm/interfaces/RNExclusiveTypes.native.js +0 -14
- package/dist/esm/interfaces/RNExclusiveTypes.native.js.map +2 -2
- package/dist/esm/interfaces/Role.native.js +0 -14
- package/dist/esm/interfaces/Role.native.js.map +2 -2
- package/dist/esm/interfaces/TamaguiComponentEvents.native.js +0 -14
- package/dist/esm/interfaces/TamaguiComponentEvents.native.js.map +2 -2
- package/dist/esm/interfaces/TamaguiComponentPropsBaseBase.native.js +0 -14
- package/dist/esm/interfaces/TamaguiComponentPropsBaseBase.native.js.map +2 -2
- package/dist/esm/interfaces/TamaguiComponentState.native.js +0 -14
- package/dist/esm/interfaces/TamaguiComponentState.native.js.map +2 -2
- package/dist/esm/interfaces/WebOnlyPressEvents.native.js +0 -14
- package/dist/esm/interfaces/WebOnlyPressEvents.native.js.map +2 -2
- package/dist/esm/internalWithTheme.native.js +6 -26
- package/dist/esm/internalWithTheme.native.js.map +1 -1
- package/dist/esm/setupHooks.native.js +2 -24
- package/dist/esm/setupHooks.native.js.map +1 -1
- package/dist/esm/setupReactNative.native.js +2 -24
- package/dist/esm/setupReactNative.native.js.map +1 -1
- package/dist/esm/styled.native.js +8 -27
- package/dist/esm/styled.native.js.map +1 -1
- package/dist/esm/type-utils.native.js +0 -14
- package/dist/esm/type-utils.native.js.map +2 -2
- package/dist/esm/types.native.js +2 -21
- package/dist/esm/types.native.js.map +1 -1
- package/dist/esm/views/Configuration.native.js +7 -26
- package/dist/esm/views/Configuration.native.js.map +1 -1
- package/dist/esm/views/FontLanguage.native.js +7 -26
- package/dist/esm/views/FontLanguage.native.js.map +1 -1
- package/dist/esm/views/FontLanguage.types.native.js +0 -14
- package/dist/esm/views/FontLanguage.types.native.js.map +2 -2
- package/dist/esm/views/Slot.native.js +15 -33
- package/dist/esm/views/Slot.native.js.map +1 -1
- package/dist/esm/views/Stack.native.js +8 -27
- package/dist/esm/views/Stack.native.js.map +1 -1
- package/dist/esm/views/TamaguiProvider.native.js +11 -35
- package/dist/esm/views/TamaguiProvider.native.js.map +1 -1
- package/dist/esm/views/Text.native.js +7 -27
- package/dist/esm/views/Text.native.js.map +1 -1
- package/dist/esm/views/Theme.native.js +23 -47
- package/dist/esm/views/Theme.native.js.map +2 -2
- package/dist/esm/views/ThemeDebug.native.js +2 -23
- package/dist/esm/views/ThemeDebug.native.js.map +1 -1
- package/dist/esm/views/ThemeProvider.native.js +11 -28
- package/dist/esm/views/ThemeProvider.native.js.map +2 -2
- package/dist/esm/views/View.native.js +8 -27
- package/dist/esm/views/View.native.js.map +1 -1
- package/package.json +10 -10
|
@@ -1,23 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: !0 });
|
|
9
|
-
}, __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from == "object" || typeof from == "function")
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
13
|
-
return to;
|
|
14
|
-
};
|
|
15
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
16
|
-
var createFont_exports = {};
|
|
17
|
-
__export(createFont_exports, {
|
|
18
|
-
createFont: () => createFont
|
|
19
|
-
});
|
|
20
|
-
module.exports = __toCommonJS(createFont_exports);
|
|
21
1
|
const fontWeights = [
|
|
22
2
|
"100",
|
|
23
3
|
"200",
|
|
@@ -52,8 +32,7 @@ const fontWeights = [
|
|
|
52
32
|
);
|
|
53
33
|
return Object.freeze(processedFont);
|
|
54
34
|
};
|
|
55
|
-
|
|
56
|
-
0 && (module.exports = {
|
|
35
|
+
export {
|
|
57
36
|
createFont
|
|
58
|
-
}
|
|
37
|
+
};
|
|
59
38
|
//# sourceMappingURL=createFont.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/createFont.ts"],
|
|
4
|
-
"mappings": "
|
|
4
|
+
"mappings": "AAEA,MAAM,cAAkC;AAAA,EACtC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAEM,iBAAiB,CACrB,SACA,MACA,iBAC+B;AAC/B,MAAI,OAAO,WAAY;AAAU,WAAO;AAExC,QAAM,cAAc,OAAO,KAAK,OAAO;AACvC,MAAI,YAAY,QAAQ,YAAY,CAAC,CAAC;AAEtC,SAAO,OAAO;AAAA,IACZ,CAAC,GAAG,oBAAI,IAAI,CAAC,GAAG,MAAM,GAAG,WAAW,CAAC,CAAC,EAAE,IAAI,CAAC,QAAQ;AACnD,YAAM,QAAQ,QAAQ,GAAG,KAAK,gBAAgB;AAC9C,yBAAY,OACZ,eAAe,OACR,CAAC,KAAK,KAAK;AAAA,IACpB,CAAC;AAAA,EACH;AACF,GAEa,aAAa,CAAwB,SAAe;AAC/D,QAAM,WAAW,OAAO,KAAK,KAAK,IAAI,GAChC,gBAAgB,OAAO;AAAA,IAC3B,OAAO,QAAQ,IAAI,EAAE,IAAI,CAAC,CAAC,KAAK,OAAO,MAC9B;AAAA,MACL;AAAA,MACA;AAAA,QACE;AAAA,QACA,QAAQ,SAAS,cAAc;AAAA,QAC/B,QAAQ,SAAS,EAAE,QAAQ,KAAK,OAAO,IAAI;AAAA,MAC7C;AAAA,IACF,CACD;AAAA,EACH;AACA,SAAO,OAAO,OAAO,aAAa;AACpC;",
|
|
5
5
|
"names": []
|
|
6
6
|
}
|
|
@@ -1,28 +1,7 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: !0 });
|
|
9
|
-
}, __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from == "object" || typeof from == "function")
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
13
|
-
return to;
|
|
14
|
-
};
|
|
15
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
16
|
-
var createShorthands_exports = {};
|
|
17
|
-
__export(createShorthands_exports, {
|
|
18
|
-
createShorthands: () => createShorthands
|
|
19
|
-
});
|
|
20
|
-
module.exports = __toCommonJS(createShorthands_exports);
|
|
21
1
|
function createShorthands(shorthands) {
|
|
22
2
|
return Object.freeze(shorthands);
|
|
23
3
|
}
|
|
24
|
-
|
|
25
|
-
0 && (module.exports = {
|
|
4
|
+
export {
|
|
26
5
|
createShorthands
|
|
27
|
-
}
|
|
6
|
+
};
|
|
28
7
|
//# sourceMappingURL=createShorthands.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/createShorthands.ts"],
|
|
4
|
-
"mappings": "
|
|
4
|
+
"mappings": "AAIO,SAAS,iBAA6C,YAAkB;AAC7E,SAAO,OAAO,OAAO,UAAU;AACjC;",
|
|
5
5
|
"names": []
|
|
6
6
|
}
|
|
@@ -1,30 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
var createTamagui_exports = {};
|
|
17
|
-
__export(createTamagui_exports, {
|
|
18
|
-
createTamagui: () => createTamagui
|
|
19
|
-
});
|
|
20
|
-
module.exports = __toCommonJS(createTamagui_exports);
|
|
21
|
-
var import_constants = require("@tamagui/constants"), import_config = require("./config"), import_createVariables = require("./createVariables"), import_getThemeCSSRules = require("./helpers/getThemeCSSRules"), import_insertStyleRule = require("./helpers/insertStyleRule"), import_proxyThemeToParents = require("./helpers/proxyThemeToParents"), import_registerCSSVariable = require("./helpers/registerCSSVariable"), import_themes = require("./helpers/themes"), import_useMedia = require("./hooks/useMedia"), import_insertFont = require("./insertFont"), import_Tamagui = require("./Tamagui");
|
|
1
|
+
import { isWeb } from "@tamagui/constants";
|
|
2
|
+
import { configListeners, setConfig, setTokens } from "./config";
|
|
3
|
+
import { createVariables } from "./createVariables";
|
|
4
|
+
import { getThemeCSSRules } from "./helpers/getThemeCSSRules";
|
|
5
|
+
import {
|
|
6
|
+
getAllRules,
|
|
7
|
+
listenForSheetChanges,
|
|
8
|
+
scanAllSheets
|
|
9
|
+
} from "./helpers/insertStyleRule";
|
|
10
|
+
import { proxyThemesToParents } from "./helpers/proxyThemeToParents";
|
|
11
|
+
import { registerCSSVariable, variableToCSS } from "./helpers/registerCSSVariable";
|
|
12
|
+
import { ensureThemeVariable } from "./helpers/themes";
|
|
13
|
+
import { configureMedia } from "./hooks/useMedia";
|
|
14
|
+
import { parseFont, registerFontVariables } from "./insertFont";
|
|
15
|
+
import { Tamagui } from "./Tamagui";
|
|
22
16
|
const createdConfigs = /* @__PURE__ */ new WeakMap();
|
|
23
17
|
function createTamagui(configIn) {
|
|
24
18
|
var _a;
|
|
25
19
|
if (createdConfigs.has(configIn))
|
|
26
20
|
return configIn;
|
|
27
|
-
const tokensParsed = {}, tokens =
|
|
21
|
+
const tokensParsed = {}, tokens = createVariables(configIn.tokens || {});
|
|
28
22
|
if (configIn.tokens) {
|
|
29
23
|
const tokensMerged = {};
|
|
30
24
|
for (const cat in tokens) {
|
|
@@ -35,23 +29,23 @@ function createTamagui(configIn) {
|
|
|
35
29
|
tokensParsed[cat][prefixedKey] = val, tokensMerged[cat][prefixedKey] = val, tokensMerged[cat][key] = val;
|
|
36
30
|
}
|
|
37
31
|
}
|
|
38
|
-
|
|
32
|
+
setTokens(tokensMerged);
|
|
39
33
|
}
|
|
40
34
|
let foundThemes;
|
|
41
35
|
if (configIn.themes) {
|
|
42
36
|
const noThemes = Object.keys(configIn.themes).length === 0;
|
|
43
|
-
foundThemes =
|
|
37
|
+
foundThemes = scanAllSheets(noThemes, tokensParsed);
|
|
44
38
|
}
|
|
45
|
-
|
|
39
|
+
listenForSheetChanges();
|
|
46
40
|
let fontSizeTokens = null, fontsParsed;
|
|
47
41
|
if (configIn.fonts) {
|
|
48
42
|
const fontTokens = Object.fromEntries(
|
|
49
|
-
Object.entries(configIn.fonts).map(([k, v]) => [k,
|
|
43
|
+
Object.entries(configIn.fonts).map(([k, v]) => [k, createVariables(v, "f", !0)])
|
|
50
44
|
);
|
|
51
45
|
fontsParsed = (() => {
|
|
52
46
|
const res = {};
|
|
53
47
|
for (const familyName in fontTokens) {
|
|
54
|
-
const font = fontTokens[familyName], fontParsed =
|
|
48
|
+
const font = fontTokens[familyName], fontParsed = parseFont(font);
|
|
55
49
|
res[`$${familyName}`] = fontParsed, !fontSizeTokens && fontParsed.size && (fontSizeTokens = new Set(Object.keys(fontParsed.size)));
|
|
56
50
|
}
|
|
57
51
|
return res;
|
|
@@ -74,15 +68,15 @@ ${JSON.stringify(
|
|
|
74
68
|
2
|
|
75
69
|
)}`
|
|
76
70
|
);
|
|
77
|
-
|
|
71
|
+
isWeb && (registerCSSVariable(variable), declarations.push(variableToCSS(variable, key === "zIndex")));
|
|
78
72
|
}
|
|
79
|
-
if (
|
|
73
|
+
if (isWeb) {
|
|
80
74
|
let declarationsToRuleSet2 = function(decs, selector = "") {
|
|
81
75
|
return `:root${selector} {${sep}${[...decs].join(`;${sep}`)}${sep}}`;
|
|
82
76
|
};
|
|
83
77
|
var declarationsToRuleSet = declarationsToRuleSet2;
|
|
84
78
|
for (const key in fontsParsed) {
|
|
85
|
-
const fontParsed = fontsParsed[key], [name, language] = key.includes("_") ? key.split("_") : [key], fontVars =
|
|
79
|
+
const fontParsed = fontsParsed[key], [name, language] = key.includes("_") ? key.split("_") : [key], fontVars = registerFontVariables(fontParsed);
|
|
86
80
|
fontDeclarations[key] = {
|
|
87
81
|
name: name.slice(1),
|
|
88
82
|
declarations: fontVars,
|
|
@@ -99,13 +93,13 @@ ${JSON.stringify(
|
|
|
99
93
|
}
|
|
100
94
|
const themesIn = { ...configIn.themes }, dedupedThemes = foundThemes ?? getThemesDeduped(themesIn);
|
|
101
95
|
return {
|
|
102
|
-
themes:
|
|
96
|
+
themes: proxyThemesToParents(dedupedThemes),
|
|
103
97
|
cssRuleSets,
|
|
104
98
|
getThemeRulesSets() {
|
|
105
99
|
let themeRuleSets = [];
|
|
106
|
-
if (
|
|
100
|
+
if (isWeb)
|
|
107
101
|
for (const { names, theme } of dedupedThemes) {
|
|
108
|
-
const nextRules =
|
|
102
|
+
const nextRules = getThemeCSSRules({
|
|
109
103
|
config: configIn,
|
|
110
104
|
themeName: names[0],
|
|
111
105
|
names,
|
|
@@ -121,11 +115,11 @@ ${JSON.stringify(
|
|
|
121
115
|
const getCSS = ({ separator = `
|
|
122
116
|
`, sinceLastCall, exclude } = {}) => {
|
|
123
117
|
if (sinceLastCall && lastCSSInsertedRulesIndex >= 0) {
|
|
124
|
-
const rules =
|
|
118
|
+
const rules = getAllRules();
|
|
125
119
|
return lastCSSInsertedRulesIndex = rules.length, rules.slice(lastCSSInsertedRulesIndex).join(separator);
|
|
126
120
|
}
|
|
127
121
|
lastCSSInsertedRulesIndex = 0;
|
|
128
|
-
const runtimeStyles =
|
|
122
|
+
const runtimeStyles = getAllRules().join(separator);
|
|
129
123
|
return exclude === "design-system" ? runtimeStyles : `${`._ovs-contain {overscroll-behavior:contain;}
|
|
130
124
|
.is_Text .is_Text {display:inline-flex;}
|
|
131
125
|
._dsp_contents {display:contents;}
|
|
@@ -168,7 +162,7 @@ ${runtimeStyles}`;
|
|
|
168
162
|
// const tokens = [...getToken(tokens.size[0])]
|
|
169
163
|
// .spacer-sm + ._dsp_contents._dsp-sm-hidden { margin-left: -var(--${}) }
|
|
170
164
|
};
|
|
171
|
-
return
|
|
165
|
+
return configureMedia(config), setConfig(config), createdConfigs.set(config, !0), configListeners.size && (configListeners.forEach((cb) => cb(config)), configListeners.clear()), process.env.NODE_ENV === "development" && ((_a = process.env.DEBUG) != null && _a.startsWith("tamagui") && console.info("Tamagui config:", config), globalThis.Tamagui || (globalThis.Tamagui = Tamagui)), config;
|
|
172
166
|
}
|
|
173
167
|
function getThemesDeduped(themes) {
|
|
174
168
|
const dedupedThemes = [], existing = /* @__PURE__ */ new Map();
|
|
@@ -180,7 +174,7 @@ function getThemesDeduped(themes) {
|
|
|
180
174
|
}
|
|
181
175
|
const theme = { ...rawTheme };
|
|
182
176
|
for (const key2 in theme)
|
|
183
|
-
|
|
177
|
+
ensureThemeVariable(theme, key2);
|
|
184
178
|
const deduped = {
|
|
185
179
|
names: [themeName],
|
|
186
180
|
theme
|
|
@@ -189,8 +183,7 @@ function getThemesDeduped(themes) {
|
|
|
189
183
|
}
|
|
190
184
|
return dedupedThemes;
|
|
191
185
|
}
|
|
192
|
-
|
|
193
|
-
0 && (module.exports = {
|
|
186
|
+
export {
|
|
194
187
|
createTamagui
|
|
195
|
-
}
|
|
188
|
+
};
|
|
196
189
|
//# sourceMappingURL=createTamagui.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/createTamagui.ts"],
|
|
4
|
-
"mappings": "
|
|
4
|
+
"mappings": "AAAA,SAAS,aAAa;AAEtB,SAAS,iBAAiB,WAAW,iBAAiB;AAGtD,SAAS,uBAAuB;AAChC,SAAS,wBAAwB;AACjC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,4BAA4B;AACrC,SAAS,q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AAe,MAAM,GACrB,UAAU,MAAM,GAEhB,eAAe,IAAI,QAAQ,EAAI,GAE3B,gBAAgB,SAClB,gBAAgB,QAAQ,CAAC,OAAO,GAAG,MAAM,CAAC,GAC1C,gBAAgB,MAAM,IAGpB,QAAQ,IAAI,aAAa,mBACvB,aAAQ,IAAI,UAAZ,WAAmB,WAAW,cAChC,QAAQ,KAAK,mBAAmB,MAAM,GAEnC,WAAW,YACd,WAAW,UAAa,WAIrB;AACT;AAGA,SAAS,iBAAiB,QAAyC;AACjE,QAAM,gBAA+B,CAAC,GAChC,WAAW,oBAAI,IAA0B;AAG/C,aAAW,aAAa,QAAQ;AAE9B,UAAM,4BAA4B,UAAU,WAAW,MAAM,IACzD,SACA,UAAU,WAAW,OAAO,IAC1B,UACA,IAEA,WAAW,OAAO,SAAS,GAI3B,MACJ,4BACA,KAAK,UAAU,OAAO,QAAQ,QAAQ,EAAE,KAAK,CAAC,GAAG,MAAO,EAAE,CAAC,IAAI,EAAE,CAAC,IAAI,KAAK,CAAE,CAAC;AAGhF,QAAI,SAAS,IAAI,GAAG,GAAG;AAErB,MADU,SAAS,IAAI,GAAG,EACxB,MAAM,KAAK,SAAS;AACtB;AAAA,IACF;AAIA,UAAM,QAAQ,EAAE,GAAG,SAAS;AAE5B,eAAWC,QAAO;AAEhB,0BAAoB,OAAOA,IAAG;AAIhC,UAAM,UAAwB;AAAA,MAC5B,OAAO,CAAC,SAAS;AAAA,MACjB;AAAA,IACF;AACA,kBAAc,KAAK,OAAO,GAC1B,SAAS,IAAI,KAAK,OAAO;AAAA,EAC3B;AAEA,SAAO;AACT;",
|
|
5
5
|
"names": ["declarationsToRuleSet", "declarations", "key"]
|
|
6
6
|
}
|
|
@@ -1,26 +1,5 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: !0 });
|
|
9
|
-
}, __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from == "object" || typeof from == "function")
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
13
|
-
return to;
|
|
14
|
-
};
|
|
15
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
16
|
-
var createTheme_exports = {};
|
|
17
|
-
__export(createTheme_exports, {
|
|
18
|
-
createTheme: () => createTheme
|
|
19
|
-
});
|
|
20
|
-
module.exports = __toCommonJS(createTheme_exports);
|
|
21
1
|
const createTheme = (theme) => theme;
|
|
22
|
-
|
|
23
|
-
0 && (module.exports = {
|
|
2
|
+
export {
|
|
24
3
|
createTheme
|
|
25
|
-
}
|
|
4
|
+
};
|
|
26
5
|
//# sourceMappingURL=createTheme.js.map
|
|
@@ -1,29 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: !0 });
|
|
9
|
-
}, __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from == "object" || typeof from == "function")
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
13
|
-
return to;
|
|
14
|
-
};
|
|
15
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
16
|
-
var createTokens_exports = {};
|
|
17
|
-
__export(createTokens_exports, {
|
|
18
|
-
createTokens: () => createTokens
|
|
19
|
-
});
|
|
20
|
-
module.exports = __toCommonJS(createTokens_exports);
|
|
21
|
-
var import_createVariables = require("./createVariables");
|
|
1
|
+
import { createVariables } from "./createVariables";
|
|
22
2
|
function createTokens(tokens) {
|
|
23
|
-
return
|
|
3
|
+
return createVariables(tokens);
|
|
24
4
|
}
|
|
25
|
-
|
|
26
|
-
0 && (module.exports = {
|
|
5
|
+
export {
|
|
27
6
|
createTokens
|
|
28
|
-
}
|
|
7
|
+
};
|
|
29
8
|
//# sourceMappingURL=createTokens.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/createTokens.ts"],
|
|
4
|
-
"mappings": "
|
|
4
|
+
"mappings": "AACA,SAAS,uBAAuB;AAIzB,SAAS,aAAqC,QAA0B;AAC7E,SAAO,gBAAgB,MAAM;AAC/B;",
|
|
5
5
|
"names": []
|
|
6
6
|
}
|
|
@@ -1,33 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: !0 });
|
|
9
|
-
}, __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from == "object" || typeof from == "function")
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
13
|
-
return to;
|
|
14
|
-
};
|
|
15
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
16
|
-
var createVariable_exports = {};
|
|
17
|
-
__export(createVariable_exports, {
|
|
18
|
-
createCSSVariable: () => createCSSVariable,
|
|
19
|
-
createVariable: () => createVariable,
|
|
20
|
-
didGetVariableValue: () => didGetVariableValue,
|
|
21
|
-
getVariable: () => getVariable,
|
|
22
|
-
getVariableName: () => getVariableName,
|
|
23
|
-
getVariableValue: () => getVariableValue,
|
|
24
|
-
getVariableVariable: () => getVariableVariable,
|
|
25
|
-
isVariable: () => isVariable,
|
|
26
|
-
setDidGetVariableValue: () => setDidGetVariableValue,
|
|
27
|
-
variableToString: () => variableToString
|
|
28
|
-
});
|
|
29
|
-
module.exports = __toCommonJS(createVariable_exports);
|
|
30
|
-
var import_constants = require("@tamagui/constants"), import_helpers = require("@tamagui/helpers"), import_config = require("./config");
|
|
1
|
+
import { isWeb } from "@tamagui/constants";
|
|
2
|
+
import { simpleHash } from "@tamagui/helpers";
|
|
3
|
+
import { getConfig } from "./config";
|
|
31
4
|
const IS_VAR = "isVar", createVariable = (props, skipHash = !1) => {
|
|
32
5
|
if (!skipHash && isVariable(props))
|
|
33
6
|
return props;
|
|
@@ -35,13 +8,13 @@ const IS_VAR = "isVar", createVariable = (props, skipHash = !1) => {
|
|
|
35
8
|
return {
|
|
36
9
|
[IS_VAR]: !0,
|
|
37
10
|
key,
|
|
38
|
-
name: skipHash ? "" :
|
|
11
|
+
name: skipHash ? "" : simpleHash(name, 40),
|
|
39
12
|
val,
|
|
40
|
-
variable:
|
|
13
|
+
variable: isWeb ? skipHash ? `var(--${name})` : createCSSVariable(name) : ""
|
|
41
14
|
};
|
|
42
15
|
};
|
|
43
16
|
function variableToString(vrble, getValue = !1) {
|
|
44
|
-
return isVariable(vrble) ? !getValue &&
|
|
17
|
+
return isVariable(vrble) ? !getValue && isWeb && vrble.variable ? vrble.variable : `${vrble.val}` : `${vrble || ""}`;
|
|
45
18
|
}
|
|
46
19
|
function isVariable(v) {
|
|
47
20
|
return v && typeof v == "object" && IS_VAR in v;
|
|
@@ -49,7 +22,7 @@ function isVariable(v) {
|
|
|
49
22
|
function getVariable(nameOrVariable) {
|
|
50
23
|
if (setDidGetVariableValue(!0), isVariable(nameOrVariable))
|
|
51
24
|
return variableToString(nameOrVariable);
|
|
52
|
-
const tokens =
|
|
25
|
+
const tokens = getConfig().tokensParsed;
|
|
53
26
|
return variableToString(tokens[nameOrVariable] ?? nameOrVariable);
|
|
54
27
|
}
|
|
55
28
|
let accessed = !1;
|
|
@@ -66,11 +39,10 @@ function getVariableVariable(v) {
|
|
|
66
39
|
const createCSSVariable = (nameProp, includeVar = !0) => {
|
|
67
40
|
if (process.env.NODE_ENV === "development" && (!nameProp || typeof nameProp != "string"))
|
|
68
41
|
throw new Error(`createCSSVariable expected string, got: ${nameProp}`);
|
|
69
|
-
const name =
|
|
42
|
+
const name = simpleHash(nameProp, 60);
|
|
70
43
|
return includeVar ? `var(--${name})` : name;
|
|
71
44
|
};
|
|
72
|
-
|
|
73
|
-
0 && (module.exports = {
|
|
45
|
+
export {
|
|
74
46
|
createCSSVariable,
|
|
75
47
|
createVariable,
|
|
76
48
|
didGetVariableValue,
|
|
@@ -81,5 +53,5 @@ const createCSSVariable = (nameProp, includeVar = !0) => {
|
|
|
81
53
|
isVariable,
|
|
82
54
|
setDidGetVariableValue,
|
|
83
55
|
variableToString
|
|
84
|
-
}
|
|
56
|
+
};
|
|
85
57
|
//# sourceMappingURL=createVariable.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/createVariable.ts"],
|
|
4
|
-
"mappings": "
|
|
4
|
+
"mappings": "AAAA,SAAS,aAAa;AACtB,SAAS,kBAAkB;AAE3B,SAAS,iBAAiB;AAO1B,MAAM,SAAS,SAaF,iBAAiB,CAC5B,OACA,WA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O,aAAa,SAAS,IAAI,MAAM;AACzC;",
|
|
5
5
|
"names": []
|
|
6
6
|
}
|
|
@@ -1,24 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: !0 });
|
|
9
|
-
}, __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from == "object" || typeof from == "function")
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
13
|
-
return to;
|
|
14
|
-
};
|
|
15
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
16
|
-
var createVariables_exports = {};
|
|
17
|
-
__export(createVariables_exports, {
|
|
18
|
-
createVariables: () => createVariables
|
|
19
|
-
});
|
|
20
|
-
module.exports = __toCommonJS(createVariables_exports);
|
|
21
|
-
var import_helpers = require("@tamagui/helpers"), import_createVariable = require("./createVariable");
|
|
1
|
+
import { simpleHash } from "@tamagui/helpers";
|
|
2
|
+
import { createVariable, isVariable } from "./createVariable";
|
|
22
3
|
const cache = /* @__PURE__ */ new WeakMap(), createVariables = (tokens, parentPath = "", isFont = !1) => {
|
|
23
4
|
if (cache.has(tokens))
|
|
24
5
|
return tokens;
|
|
@@ -27,11 +8,11 @@ const cache = /* @__PURE__ */ new WeakMap(), createVariables = (tokens, parentPa
|
|
|
27
8
|
for (let keyIn in tokens) {
|
|
28
9
|
i++;
|
|
29
10
|
const val = tokens[keyIn], isPrefixed = keyIn[0] === "$", keyWithPrefix = isPrefixed ? keyIn : `$${keyIn}`, key = isPrefixed ? keyWithPrefix.slice(1) : keyIn;
|
|
30
|
-
if (
|
|
11
|
+
if (isVariable(val)) {
|
|
31
12
|
res[key] = val;
|
|
32
13
|
continue;
|
|
33
14
|
}
|
|
34
|
-
const niceKey =
|
|
15
|
+
const niceKey = simpleHash(key);
|
|
35
16
|
let name = isFont ? niceKey.slice(0, 2) : i;
|
|
36
17
|
if (name = parentPath ? `${parentPath}-${name}` : niceKey, val && typeof val == "object") {
|
|
37
18
|
res[key] = createVariables(
|
|
@@ -42,13 +23,12 @@ const cache = /* @__PURE__ */ new WeakMap(), createVariables = (tokens, parentPa
|
|
|
42
23
|
);
|
|
43
24
|
continue;
|
|
44
25
|
}
|
|
45
|
-
const finalValue =
|
|
26
|
+
const finalValue = isVariable(val) ? val : createVariable({ val, name, key: keyWithPrefix });
|
|
46
27
|
res[key] = finalValue;
|
|
47
28
|
}
|
|
48
29
|
return cache.set(res, !0), res;
|
|
49
30
|
};
|
|
50
|
-
|
|
51
|
-
0 && (module.exports = {
|
|
31
|
+
export {
|
|
52
32
|
createVariables
|
|
53
|
-
}
|
|
33
|
+
};
|
|
54
34
|
//# sourceMappingURL=createVariables.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/createVariables.ts"],
|
|
4
|
-
"mappings": "
|
|
4
|
+
"mappings": "AAAA,SAAS,kBAAkB;AAG3B,SAAS,gBAAgB,kBAAkB;AAc3C,MAAM,QAAQ,oBAAI,QAAQ,GAIb,kBAAkB,CAC7B,QACA,aAAa,IACb,SAAS,OACiB;AAC1B,MAAI,MAAM,IAAI,MAAM;AAAG,WAAO;AAE9B,QAAM,MAAW,CAAC;AAClB,MAAI,IAAI;AACR,WAAS,SAAS,QAAQ;AACxB;AACA,UAAM,MAAM,OAAO,KAAK,GAClB,aAAa,MAAM,CAAC,MAAM,KAC1B,gBAAgB,aAAa,QAAQ,IAAI,KAAK,IAC9C,MAAM,aAAa,cAAc,MAAM,CAAC,IAAI;AAClD,QAAI,WAAW,GAAG,GAAG;AACnB,UAAI,GAAG,IAAI;AACX;AAAA,IACF;AACA,UAAM,UAAU,WAAW,GAAG;AAC9B,QAAI,OAAO,SAAS,QAAQ,MAAM,GAAG,CAAC,IAAI;AAE1C,QADA,OAAO,aAAa,GAAG,UAAU,IAAI,IAAI,KAAK,SAC1C,OAAO,OAAO,OAAQ,UAAU;AAElC,UAAI,GAAG,IAAI;AAAA,QACT,OAAO,GAAG;AAAA,QACV;AAAA,QACA;AAAA;AAAA,MACF;AACA;AAAA,IACF;AACA,UAAM,aAAa,WAAW,GAAG,IAC7B,MACA,eAAe,EAAE,KAAK,MAAM,KAAK,cAAc,CAAC;AACpD,QAAI,GAAG,IAAI;AAAA,EACb;AAEA,eAAM,IAAI,KAAK,EAAI,GACZ;AACT;",
|
|
5
5
|
"names": []
|
|
6
6
|
}
|
|
@@ -1,25 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: !0 });
|
|
9
|
-
}, __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from == "object" || typeof from == "function")
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
13
|
-
return to;
|
|
14
|
-
};
|
|
15
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
16
|
-
var defaultComponentState_exports = {};
|
|
17
|
-
__export(defaultComponentState_exports, {
|
|
18
|
-
defaultComponentState: () => defaultComponentState,
|
|
19
|
-
defaultComponentStateMounted: () => defaultComponentStateMounted,
|
|
20
|
-
defaultComponentStateShouldEnter: () => defaultComponentStateShouldEnter
|
|
21
|
-
});
|
|
22
|
-
module.exports = __toCommonJS(defaultComponentState_exports);
|
|
23
1
|
const defaultComponentState = {
|
|
24
2
|
hover: !1,
|
|
25
3
|
press: !1,
|
|
@@ -33,10 +11,9 @@ const defaultComponentState = {
|
|
|
33
11
|
...defaultComponentState,
|
|
34
12
|
unmounted: "should-enter"
|
|
35
13
|
};
|
|
36
|
-
|
|
37
|
-
0 && (module.exports = {
|
|
14
|
+
export {
|
|
38
15
|
defaultComponentState,
|
|
39
16
|
defaultComponentStateMounted,
|
|
40
17
|
defaultComponentStateShouldEnter
|
|
41
|
-
}
|
|
18
|
+
};
|
|
42
19
|
//# sourceMappingURL=defaultComponentState.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/defaultComponentState.tsx"],
|
|
4
|
-
"mappings": "
|
|
4
|
+
"mappings": "AAEO,MAAM,wBAA+C;AAAA,EAC1D,OAAO;AAAA,EACP,OAAO;AAAA,EACP,SAAS;AAAA,EACT,OAAO;AAAA,EACP,WAAW;AACb,GAEa,+BAAsD;AAAA,EACjE,GAAG;AAAA,EACH,WAAW;AACb,GAEa,mCAA0D;AAAA,EACrE,GAAG;AAAA,EACH,WAAW;AACb;",
|
|
5
5
|
"names": []
|
|
6
6
|
}
|