@tamagui/core 1.0.1-beta.106 → 1.0.1-beta.109
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/Pressability.js +1 -0
- package/dist/cjs/Pressability.js.map +1 -1
- package/dist/cjs/Pressability.native.js +1 -0
- package/dist/cjs/Pressability.native.js.map +1 -1
- package/dist/cjs/Tamagui.js +1 -0
- package/dist/cjs/Tamagui.js.map +1 -1
- package/dist/cjs/ThemeContext.js +1 -0
- package/dist/cjs/ThemeContext.js.map +1 -1
- package/dist/cjs/ThemeManager.js +1 -0
- package/dist/cjs/ThemeManager.js.map +1 -1
- package/dist/cjs/conf.js +1 -0
- package/dist/cjs/conf.js.map +1 -1
- package/dist/cjs/constants/constants.js +9 -21
- package/dist/cjs/constants/constants.js.map +1 -1
- package/dist/cjs/constants/platform.js +1 -0
- package/dist/cjs/constants/platform.js.map +1 -1
- package/dist/cjs/contexts/ButtonInsideButtonContext.js +1 -0
- package/dist/cjs/contexts/ButtonInsideButtonContext.js.map +1 -1
- package/dist/cjs/createComponent.js +114 -216
- package/dist/cjs/createComponent.js.map +2 -2
- package/dist/cjs/createFont.js +1 -0
- package/dist/cjs/createFont.js.map +1 -1
- package/dist/cjs/createShorthands.js +1 -0
- package/dist/cjs/createShorthands.js.map +1 -1
- package/dist/cjs/createTamagui.js +7 -27
- package/dist/cjs/createTamagui.js.map +2 -2
- package/dist/cjs/createTheme.js +1 -0
- package/dist/cjs/createTheme.js.map +1 -1
- package/dist/cjs/createTokens.js +1 -0
- package/dist/cjs/createTokens.js.map +1 -1
- package/dist/cjs/createVariable.js +1 -0
- package/dist/cjs/createVariable.js.map +1 -1
- package/dist/cjs/createVariables.js +1 -0
- package/dist/cjs/createVariables.js.map +1 -1
- package/dist/cjs/defaultComponentState.js +1 -0
- package/dist/cjs/helpers/RNComponents.js +1 -0
- package/dist/cjs/helpers/RNComponents.js.map +1 -1
- package/dist/cjs/helpers/areEqualSets.js +1 -0
- package/dist/cjs/helpers/areEqualSets.js.map +1 -1
- package/dist/cjs/helpers/assignNativePropsToWeb.js +1 -0
- package/dist/cjs/helpers/assignNativePropsToWeb.js.map +1 -1
- package/dist/cjs/helpers/assignNativePropsToWeb.native.js +1 -0
- package/dist/cjs/helpers/assignNativePropsToWeb.native.js.map +1 -1
- package/dist/cjs/helpers/calc.js +1 -0
- package/dist/cjs/helpers/calc.js.map +1 -1
- package/dist/cjs/helpers/createMediaStyle.js +1 -0
- package/dist/cjs/helpers/createMediaStyle.js.map +1 -1
- package/dist/cjs/helpers/createPropMapper.js +1 -0
- package/dist/cjs/helpers/createPropMapper.js.map +1 -1
- package/dist/cjs/helpers/createShallowUpdate.js +2 -15
- package/dist/cjs/helpers/createShallowUpdate.js.map +1 -1
- package/dist/cjs/helpers/createTamaguiProvider.js +12 -38
- package/dist/cjs/helpers/createTamaguiProvider.js.map +2 -2
- package/dist/cjs/helpers/cssHash.js +1 -0
- package/dist/cjs/helpers/cssHash.js.map +1 -1
- package/dist/cjs/helpers/expandStyle.js +7 -19
- package/dist/cjs/helpers/expandStyle.js.map +1 -1
- package/dist/cjs/helpers/expandStyles.js +21 -32
- package/dist/cjs/helpers/expandStyles.js.map +1 -1
- package/dist/cjs/helpers/extendStaticConfig.js +30 -29
- package/dist/cjs/helpers/extendStaticConfig.js.map +1 -1
- package/dist/cjs/helpers/fixNativeShadow.js +1 -0
- package/dist/cjs/helpers/fixNativeShadow.js.map +1 -1
- package/dist/cjs/helpers/getExpandedShorthands.js +1 -0
- package/dist/cjs/helpers/getExpandedShorthands.js.map +1 -1
- package/dist/cjs/helpers/getFont.js +1 -0
- package/dist/cjs/helpers/getFont.js.map +1 -1
- package/dist/cjs/helpers/getSize.js +1 -0
- package/dist/cjs/helpers/getSize.js.map +1 -1
- package/dist/cjs/helpers/getSplitStyles.js +21 -30
- package/dist/cjs/helpers/getSplitStyles.js.map +1 -1
- package/dist/cjs/helpers/getStackSize.js +1 -0
- package/dist/cjs/helpers/getStackSize.js.map +1 -1
- package/dist/cjs/helpers/getStylesAtomic.js +2 -15
- package/dist/cjs/helpers/getStylesAtomic.js.map +2 -2
- package/dist/cjs/helpers/getStylesAtomic.native.js +1 -0
- package/dist/cjs/helpers/getStylesAtomic.native.js.map +1 -1
- package/dist/cjs/helpers/getVariantExtras.js +1 -0
- package/dist/cjs/helpers/getVariantExtras.js.map +1 -1
- package/dist/cjs/helpers/insertStyleRule.js +1 -0
- package/dist/cjs/helpers/insertStyleRule.js.map +1 -1
- package/dist/cjs/helpers/isObj.js +1 -0
- package/dist/cjs/helpers/isObj.js.map +1 -1
- package/dist/cjs/helpers/isTamaguiComponent.js +1 -0
- package/dist/cjs/helpers/isTamaguiComponent.js.map +1 -1
- package/dist/cjs/helpers/isTamaguiElement.js +1 -0
- package/dist/cjs/helpers/isTamaguiElement.js.map +1 -1
- package/dist/cjs/helpers/matchMedia.js +1 -0
- package/dist/cjs/helpers/matchMedia.js.map +1 -1
- package/dist/cjs/helpers/matchMedia.native.js +1 -0
- package/dist/cjs/helpers/matchMedia.native.js.map +1 -1
- package/dist/cjs/helpers/mergeProps.js +1 -0
- package/dist/cjs/helpers/mergeProps.js.map +1 -1
- package/dist/cjs/helpers/mergeTransform.js +1 -0
- package/dist/cjs/helpers/mergeTransform.js.map +1 -1
- package/dist/cjs/helpers/nativeGestureHandler.native.js +1 -0
- package/dist/cjs/helpers/nativeGestureHandler.native.js.map +1 -1
- package/dist/cjs/helpers/normalizeColor.js +1 -0
- package/dist/cjs/helpers/normalizeColor.js.map +1 -1
- package/dist/cjs/helpers/normalizeValueWithProperty.js +1 -0
- package/dist/cjs/helpers/normalizeValueWithProperty.js.map +1 -1
- package/dist/cjs/helpers/proxyThemeVariables.js +1 -0
- package/dist/cjs/helpers/proxyThemeVariables.js.map +1 -1
- package/dist/cjs/helpers/pseudoDescriptors.js +1 -0
- package/dist/cjs/helpers/pseudoDescriptors.js.map +1 -1
- package/dist/cjs/helpers/registerCSSVariable.js +1 -0
- package/dist/cjs/helpers/registerCSSVariable.js.map +1 -1
- package/dist/cjs/helpers/startTransition.js +1 -0
- package/dist/cjs/helpers/startTransition.js.map +1 -1
- package/dist/cjs/helpers/themeable.js +3 -31
- package/dist/cjs/helpers/themeable.js.map +1 -1
- package/dist/cjs/helpers/validate.js +6 -28
- package/dist/cjs/helpers/validate.js.map +1 -1
- package/dist/cjs/helpers/withStaticProperties.js +1 -0
- package/dist/cjs/helpers/withStaticProperties.js.map +1 -1
- package/dist/cjs/helpers/wrapThemeManagerContext.js +1 -0
- package/dist/cjs/helpers/wrapThemeManagerContext.js.map +1 -1
- package/dist/cjs/hooks/getThemeUnwrapped.js +1 -0
- package/dist/cjs/hooks/getThemeUnwrapped.js.map +1 -1
- package/dist/cjs/hooks/useConstant.js +1 -0
- package/dist/cjs/hooks/useConstant.js.map +1 -1
- package/dist/cjs/hooks/useFeatures.js +9 -38
- package/dist/cjs/hooks/useFeatures.js.map +1 -1
- package/dist/cjs/hooks/useId.js +1 -0
- package/dist/cjs/hooks/useId.js.map +1 -1
- package/dist/cjs/hooks/useIsMounted.js +1 -0
- package/dist/cjs/hooks/useIsMounted.js.map +1 -1
- package/dist/cjs/hooks/useIsSSR.js +1 -0
- package/dist/cjs/hooks/useIsSSR.js.map +1 -1
- package/dist/cjs/hooks/useIsTouchDevice.js +2 -1
- package/dist/cjs/hooks/useIsTouchDevice.js.map +2 -2
- package/dist/cjs/hooks/useMedia.js +19 -26
- package/dist/cjs/hooks/useMedia.js.map +2 -2
- package/dist/cjs/hooks/usePressable.js +2 -15
- package/dist/cjs/hooks/usePressable.js.map +1 -1
- package/dist/cjs/hooks/useTheme.js +8 -22
- package/dist/cjs/hooks/useTheme.js.map +1 -1
- package/dist/cjs/hooks/useUnmountEffect.js +1 -0
- package/dist/cjs/hooks/useUnmountEffect.js.map +1 -1
- package/dist/cjs/index.js +1 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/insertFont.js +1 -0
- package/dist/cjs/insertFont.js.map +1 -1
- package/dist/cjs/static.js +1 -0
- package/dist/cjs/static.js.map +1 -1
- package/dist/cjs/styled.js +10 -36
- package/dist/cjs/styled.js.map +1 -1
- package/dist/cjs/types-rnw.js +1 -0
- package/dist/cjs/types-rnw.js.map +1 -1
- package/dist/cjs/types.js +1 -0
- package/dist/cjs/types.js.map +1 -1
- package/dist/cjs/views/Slot.js +15 -40
- package/dist/cjs/views/Slot.js.map +1 -1
- package/dist/cjs/views/Stack.js +4 -19
- package/dist/cjs/views/Stack.js.map +1 -1
- package/dist/cjs/views/Text.js +13 -22
- package/dist/cjs/views/Text.js.map +1 -1
- package/dist/cjs/views/TextAncestorContext.js +1 -0
- package/dist/cjs/views/TextAncestorContext.js.map +1 -1
- package/dist/cjs/views/Theme.js +1 -0
- package/dist/cjs/views/Theme.js.map +1 -1
- package/dist/cjs/views/ThemeInverse.js +1 -0
- package/dist/cjs/views/ThemeInverse.js.map +1 -1
- package/dist/cjs/views/ThemeProvider.js +1 -0
- package/dist/cjs/views/ThemeProvider.js.map +1 -1
- package/dist/cjs/views/ThemeReset.js +1 -0
- package/dist/cjs/views/ThemeReset.js.map +1 -1
- package/dist/esm/constants/constants.js +8 -23
- package/dist/esm/constants/constants.js.map +1 -1
- package/dist/esm/createComponent.js +113 -218
- package/dist/esm/createComponent.js.map +2 -2
- package/dist/esm/createTamagui.js +7 -30
- package/dist/esm/createTamagui.js.map +2 -2
- package/dist/esm/helpers/createShallowUpdate.js +1 -17
- package/dist/esm/helpers/createShallowUpdate.js.map +1 -1
- package/dist/esm/helpers/createTamaguiProvider.js +11 -40
- package/dist/esm/helpers/createTamaguiProvider.js.map +2 -2
- package/dist/esm/helpers/expandStyle.js +6 -21
- package/dist/esm/helpers/expandStyle.js.map +1 -1
- package/dist/esm/helpers/expandStyles.js +20 -34
- package/dist/esm/helpers/expandStyles.js.map +1 -1
- package/dist/esm/helpers/extendStaticConfig.js +29 -31
- package/dist/esm/helpers/extendStaticConfig.js.map +1 -1
- package/dist/esm/helpers/getSplitStyles.js +20 -32
- package/dist/esm/helpers/getSplitStyles.js.map +1 -1
- package/dist/esm/helpers/getStylesAtomic.js +1 -16
- package/dist/esm/helpers/getStylesAtomic.js.map +2 -2
- package/dist/esm/helpers/themeable.js +2 -33
- package/dist/esm/helpers/themeable.js.map +1 -1
- package/dist/esm/helpers/validate.js +5 -30
- package/dist/esm/helpers/validate.js.map +1 -1
- package/dist/esm/hooks/useFeatures.js +8 -40
- package/dist/esm/hooks/useFeatures.js.map +1 -1
- package/dist/esm/hooks/useIsTouchDevice.js +1 -1
- package/dist/esm/hooks/useIsTouchDevice.js.map +2 -2
- package/dist/esm/hooks/useMedia.js +18 -28
- package/dist/esm/hooks/useMedia.js.map +2 -2
- package/dist/esm/hooks/usePressable.js +1 -16
- package/dist/esm/hooks/usePressable.js.map +1 -1
- package/dist/esm/hooks/useTheme.js +7 -24
- package/dist/esm/hooks/useTheme.js.map +1 -1
- package/dist/esm/styled.js +9 -38
- package/dist/esm/styled.js.map +1 -1
- package/dist/esm/views/Slot.js +14 -42
- package/dist/esm/views/Slot.js.map +1 -1
- package/dist/esm/views/Stack.js +3 -21
- package/dist/esm/views/Stack.js.map +1 -1
- package/dist/esm/views/Text.js +12 -24
- package/dist/esm/views/Text.js.map +1 -1
- package/package.json +10 -10
- package/types/createComponent.d.ts.map +1 -1
- package/types/createTamagui.d.ts +2 -1
- package/types/createTamagui.d.ts.map +1 -1
- package/types/helpers/createTamaguiProvider.d.ts +1 -0
- package/types/helpers/createTamaguiProvider.d.ts.map +1 -1
- package/types/helpers/getStylesAtomic.d.ts.map +1 -1
- package/types/hooks/useMedia.d.ts.map +1 -1
- package/types/views/ThemeInverse.d.ts +1 -0
- package/types/views/ThemeInverse.d.ts.map +1 -1
- package/types/views/ThemeProvider.d.ts +1 -0
- package/types/views/ThemeProvider.d.ts.map +1 -1
- package/dist/cjs/constants/rnw.js +0 -32
- package/dist/cjs/constants/rnw.js.map +0 -7
- package/dist/cjs/constants/rnw.native.js +0 -28
- package/dist/cjs/constants/rnw.native.js.map +0 -7
- package/dist/cjs/helpers/getTextSize.js +0 -55
- package/dist/cjs/helpers/getTextSize.js.map +0 -7
- package/dist/cjs/hooks/useEvent.js +0 -34
- package/dist/cjs/hooks/useEvent.js.map +0 -7
- package/dist/cjs/hooks/useGet.js +0 -39
- package/dist/cjs/hooks/useGet.js.map +0 -7
- package/dist/cjs/hooks/usePrevious.js +0 -1
- package/dist/cjs/hooks/usePrevious.js.map +0 -7
- package/dist/cjs/startTransition.js +0 -32
- package/dist/cjs/startTransition.js.map +0 -7
- package/dist/esm/constants/rnw.js +0 -6
- package/dist/esm/constants/rnw.js.map +0 -7
- package/dist/esm/constants/rnw.native.js +0 -5
- package/dist/esm/constants/rnw.native.js.map +0 -7
- package/dist/esm/helpers/getTextSize.js +0 -32
- package/dist/esm/helpers/getTextSize.js.map +0 -7
- package/dist/esm/hooks/useEvent.js +0 -11
- package/dist/esm/hooks/useEvent.js.map +0 -7
- package/dist/esm/hooks/useGet.js +0 -16
- package/dist/esm/hooks/useGet.js.map +0 -7
- package/dist/esm/hooks/usePrevious.js +0 -1
- package/dist/esm/hooks/usePrevious.js.map +0 -7
- package/dist/esm/startTransition.js +0 -6
- package/dist/esm/startTransition.js.map +0 -7
- package/types/constants/rnw.d.ts +0 -2
- package/types/constants/rnw.d.ts.map +0 -1
- package/types/constants/rnw.native.d.ts +0 -2
- package/types/constants/rnw.native.d.ts.map +0 -1
- package/types/hooks/useEvent.d.ts +0 -4
- package/types/hooks/useEvent.d.ts.map +0 -1
- package/types/hooks/useGet.d.ts +0 -2
- package/types/hooks/useGet.d.ts.map +0 -1
- package/types/hooks/usePrevious.d.ts +0 -1
- package/types/hooks/usePrevious.d.ts.map +0 -1
- package/types/startTransition.d.ts +0 -3
- package/types/startTransition.d.ts.map +0 -1
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __export = (target, all) => {
|
|
8
|
-
for (var name in all)
|
|
9
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
-
};
|
|
11
|
-
var __copyProps = (to, from, except, desc) => {
|
|
12
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
-
for (let key of __getOwnPropNames(from))
|
|
14
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
-
}
|
|
17
|
-
return to;
|
|
18
|
-
};
|
|
19
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
|
|
20
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
21
|
-
var startTransition_exports = {};
|
|
22
|
-
__export(startTransition_exports, {
|
|
23
|
-
startTransition: () => startTransition
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(startTransition_exports);
|
|
26
|
-
var import_react = __toESM(require("react"));
|
|
27
|
-
const startTransition = import_react.default.startTransition || ((cb) => cb());
|
|
28
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
29
|
-
0 && (module.exports = {
|
|
30
|
-
startTransition
|
|
31
|
-
});
|
|
32
|
-
//# sourceMappingURL=startTransition.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/startTransition.ts"],
|
|
4
|
-
"sourcesContent": ["import React from 'react'\n\n// backwards compat\nexport const startTransition = React.startTransition || ((cb) => cb())\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAkB;AAGX,MAAM,kBAAkB,qBAAM,mBAAoB,EAAC,OAAO,GAAG;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { getVariableValue } from "../createVariable";
|
|
2
|
-
const getTextSize = (val = "$4", { fonts, theme, props }) => {
|
|
3
|
-
var _a, _b, _c;
|
|
4
|
-
const family = getVariableValue(props.fontFamily) || "$body";
|
|
5
|
-
const font = fonts[family] || fonts["$body"];
|
|
6
|
-
if (!font) {
|
|
7
|
-
console.warn("\u26A0\uFE0F no font found", { family, fontTokens: Object.keys(fonts), val });
|
|
8
|
-
return {};
|
|
9
|
-
}
|
|
10
|
-
const fontFamily = font.family;
|
|
11
|
-
const fontSize = props.fontSize || font.size[val];
|
|
12
|
-
const lineHeight = props.lineHeight || font.lineHeight[val];
|
|
13
|
-
const fontWeight = props.fontWeight || font.weight[val];
|
|
14
|
-
const letterSpacing = props.letterSpacing || font.letterSpacing[val];
|
|
15
|
-
const fontStyle = props.fontStyle || ((_a = font.style) == null ? void 0 : _a[val]);
|
|
16
|
-
const textTransform = props.textTransform || ((_b = font.transform) == null ? void 0 : _b[val]);
|
|
17
|
-
const color = props.color || ((_c = font.color) == null ? void 0 : _c[val]) || theme.color;
|
|
18
|
-
return {
|
|
19
|
-
color,
|
|
20
|
-
fontStyle,
|
|
21
|
-
textTransform,
|
|
22
|
-
fontFamily,
|
|
23
|
-
fontWeight,
|
|
24
|
-
letterSpacing,
|
|
25
|
-
fontSize,
|
|
26
|
-
lineHeight
|
|
27
|
-
};
|
|
28
|
-
};
|
|
29
|
-
export {
|
|
30
|
-
getTextSize
|
|
31
|
-
};
|
|
32
|
-
//# sourceMappingURL=getTextSize.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/helpers/getTextSize.tsx"],
|
|
4
|
-
"sourcesContent": ["import { getVariableValue } from '../createVariable'\nimport { FontSizeTokens, TextProps, VariantSpreadFunction } from '../types'\n\nexport const getTextSize: VariantSpreadFunction<TextProps, FontSizeTokens> = (\n val = '$4',\n { fonts, theme, props }\n) => {\n const family = getVariableValue(props.fontFamily) || '$body'\n const font = fonts[family] || fonts['$body']\n if (!font) {\n console.warn('\u26A0\uFE0F no font found', { family, fontTokens: Object.keys(fonts), val })\n return {} as any\n }\n const fontFamily = font.family\n const fontSize = props.fontSize || font.size[val]\n const lineHeight = props.lineHeight || font.lineHeight[val]\n const fontWeight = props.fontWeight || font.weight[val]\n const letterSpacing = props.letterSpacing || font.letterSpacing[val]\n const fontStyle = props.fontStyle || font.style?.[val]\n const textTransform = props.textTransform || font.transform?.[val]\n const color = props.color || font.color?.[val] || theme.color\n return {\n color,\n fontStyle,\n textTransform,\n fontFamily,\n fontWeight,\n letterSpacing,\n fontSize,\n lineHeight,\n } as any\n}\n"],
|
|
5
|
-
"mappings": "AAAA;AAGO,MAAM,cAAgE,CAC3E,MAAM,MACN,EAAE,OAAO,OAAO,YACb;AANL;AAOE,QAAM,SAAS,iBAAiB,MAAM,UAAU,KAAK;AACrD,QAAM,OAAO,MAAM,WAAW,MAAM;AACpC,MAAI,CAAC,MAAM;AACT,YAAQ,KAAK,8BAAoB,EAAE,QAAQ,YAAY,OAAO,KAAK,KAAK,GAAG,IAAI,CAAC;AAChF,WAAO,CAAC;AAAA,EACV;AACA,QAAM,aAAa,KAAK;AACxB,QAAM,WAAW,MAAM,YAAY,KAAK,KAAK;AAC7C,QAAM,aAAa,MAAM,cAAc,KAAK,WAAW;AACvD,QAAM,aAAa,MAAM,cAAc,KAAK,OAAO;AACnD,QAAM,gBAAgB,MAAM,iBAAiB,KAAK,cAAc;AAChE,QAAM,YAAY,MAAM,aAAa,YAAK,UAAL,mBAAa;AAClD,QAAM,gBAAgB,MAAM,iBAAiB,YAAK,cAAL,mBAAiB;AAC9D,QAAM,QAAQ,MAAM,SAAS,YAAK,UAAL,mBAAa,SAAQ,MAAM;AACxD,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { useGet } from "./useGet";
|
|
2
|
-
function useEvent(callback) {
|
|
3
|
-
return useGet(callback, defaultValue, true);
|
|
4
|
-
}
|
|
5
|
-
const defaultValue = () => {
|
|
6
|
-
throw new Error("Cannot call an event handler while rendering.");
|
|
7
|
-
};
|
|
8
|
-
export {
|
|
9
|
-
useEvent
|
|
10
|
-
};
|
|
11
|
-
//# sourceMappingURL=useEvent.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/hooks/useEvent.tsx"],
|
|
4
|
-
"sourcesContent": ["import { useGet } from './useGet'\n\ntype AnyFunction = (...args: any[]) => any\n\nexport function useEvent<T extends AnyFunction>(callback?: T): T {\n return useGet(callback, defaultValue, true) as T\n}\n\nconst defaultValue = () => {\n throw new Error('Cannot call an event handler while rendering.')\n}\n"],
|
|
5
|
-
"mappings": "AAAA;AAIO,kBAAyC,UAAiB;AAC/D,SAAO,OAAO,UAAU,cAAc,IAAI;AAC5C;AAEA,MAAM,eAAe,MAAM;AACzB,QAAM,IAAI,MAAM,+CAA+C;AACjE;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
package/dist/esm/hooks/useGet.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { useCallback, useRef } from "react";
|
|
2
|
-
import { useIsomorphicLayoutEffect } from "../constants/platform";
|
|
3
|
-
function useGet(currentValue, initialValue, forwardToFunction) {
|
|
4
|
-
const curRef = useRef(initialValue ?? currentValue);
|
|
5
|
-
useIsomorphicLayoutEffect(() => {
|
|
6
|
-
curRef.current = currentValue;
|
|
7
|
-
});
|
|
8
|
-
return useCallback(forwardToFunction ? (...args) => {
|
|
9
|
-
var _a;
|
|
10
|
-
return (_a = curRef.current) == null ? void 0 : _a.apply(null, args);
|
|
11
|
-
} : () => curRef.current, []);
|
|
12
|
-
}
|
|
13
|
-
export {
|
|
14
|
-
useGet
|
|
15
|
-
};
|
|
16
|
-
//# sourceMappingURL=useGet.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/hooks/useGet.tsx"],
|
|
4
|
-
"sourcesContent": ["import { useCallback, useRef } from 'react'\n\nimport { useIsomorphicLayoutEffect } from '../constants/platform'\n\n// keeps a reference to the current value easily\n\nexport function useGet<A>(\n currentValue: A,\n initialValue?: any,\n forwardToFunction?: boolean\n): () => A {\n const curRef = useRef<any>(initialValue ?? currentValue)\n useIsomorphicLayoutEffect(() => {\n curRef.current = currentValue\n })\n // eslint-disable-next-line react-hooks/exhaustive-deps\n return useCallback(\n forwardToFunction ? (...args) => curRef.current?.apply(null, args) : () => curRef.current,\n []\n )\n}\n"],
|
|
5
|
-
"mappings": "AAAA;AAEA;AAIO,gBACL,cACA,cACA,mBACS;AACT,QAAM,SAAS,OAAY,gBAAgB,YAAY;AACvD,4BAA0B,MAAM;AAC9B,WAAO,UAAU;AAAA,EACnB,CAAC;AAED,SAAO,YACL,oBAAoB,IAAI,SAAM;AAjBlC;AAiBqC,wBAAO,YAAP,mBAAgB,MAAM,MAAM;AAAA,MAAQ,MAAM,OAAO,SAClF,CAAC,CACH;AACF;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
//# sourceMappingURL=usePrevious.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/startTransition.ts"],
|
|
4
|
-
"sourcesContent": ["import React from 'react'\n\n// backwards compat\nexport const startTransition = React.startTransition || ((cb) => cb())\n"],
|
|
5
|
-
"mappings": "AAAA;AAGO,MAAM,kBAAkB,MAAM,mBAAoB,EAAC,OAAO,GAAG;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
package/types/constants/rnw.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"rnw.d.ts","sourceRoot":"","sources":["../../src/constants/rnw.tsx"],"names":[],"mappings":"AAEA,eAAO,MAAM,GAAG,KAAwB,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"rnw.native.d.ts","sourceRoot":"","sources":["../../src/constants/rnw.native.tsx"],"names":[],"mappings":"AAAA,eAAO,MAAM,GAAG,KAAY,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useEvent.d.ts","sourceRoot":"","sources":["../../src/hooks/useEvent.tsx"],"names":[],"mappings":"AAEA,aAAK,WAAW,GAAG,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAA;AAE1C,wBAAgB,QAAQ,CAAC,CAAC,SAAS,WAAW,EAAE,QAAQ,CAAC,EAAE,CAAC,GAAG,CAAC,CAE/D"}
|
package/types/hooks/useGet.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useGet.d.ts","sourceRoot":"","sources":["../../src/hooks/useGet.tsx"],"names":[],"mappings":"AAMA,wBAAgB,MAAM,CAAC,CAAC,EACtB,YAAY,EAAE,CAAC,EACf,YAAY,CAAC,EAAE,GAAG,EAClB,iBAAiB,CAAC,EAAE,OAAO,GAC1B,MAAM,CAAC,CAUT"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
//# sourceMappingURL=usePrevious.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"usePrevious.d.ts","sourceRoot":"","sources":["../../src/hooks/usePrevious.tsx"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"startTransition.d.ts","sourceRoot":"","sources":["../src/startTransition.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,eAAO,MAAM,eAAe,8BAA0C,CAAA"}
|