@bifrostui/utils 2.0.0-alpha.0 → 2.0.0-alpha.2
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/directionLocationUtil.d.ts +27 -12
- package/dist/directionLocationUtil.js +101 -55
- package/dist/domUtils/addClass.d.ts +1 -0
- package/dist/domUtils/addClass.js +46 -0
- package/dist/domUtils/index.d.ts +3 -0
- package/dist/domUtils/index.js +35 -0
- package/dist/domUtils/index.miniapp.d.ts +3 -0
- package/dist/domUtils/index.miniapp.js +35 -0
- package/dist/domUtils/rect.d.ts +12 -0
- package/dist/domUtils/rect.js +46 -0
- package/dist/domUtils/rect.miniapp.d.ts +2 -0
- package/dist/domUtils/rect.miniapp.js +86 -0
- package/dist/domUtils/removeClass.d.ts +1 -0
- package/dist/domUtils/removeClass.js +47 -0
- package/dist/getBoundingClientRect/index.d.ts +1 -1
- package/dist/getBoundingClientRect/index.js +13 -0
- package/dist/getBoundingClientRect/index.miniapp.d.ts +1 -2
- package/dist/getBoundingClientRect/index.miniapp.js +34 -5
- package/dist/getRootContainer/index.d.ts +2 -0
- package/dist/{getRootElement → getRootContainer}/index.js +8 -8
- package/dist/getRootContainer/index.miniapp.d.ts +3 -0
- package/dist/{getRootElement → getRootContainer}/index.miniapp.js +4 -4
- package/dist/hooks/index.d.ts +2 -2
- package/dist/hooks/index.js +8 -0
- package/dist/hooks/useTouchEmulator.d.ts +7 -1
- package/dist/hooks/useTouchEmulator.js +36 -10
- package/dist/index.d.ts +4 -3
- package/dist/index.js +15 -3
- package/dist/isMini.d.ts +2 -1
- package/dist/isMini.js +3 -0
- package/dist/render.d.ts +2 -2
- package/es/directionLocationUtil.d.ts +27 -12
- package/es/directionLocationUtil.js +91 -55
- package/es/domUtils/addClass.d.ts +1 -0
- package/es/domUtils/addClass.js +23 -0
- package/es/domUtils/index.d.ts +3 -0
- package/es/domUtils/index.js +9 -0
- package/es/domUtils/index.miniapp.d.ts +3 -0
- package/es/domUtils/index.miniapp.js +9 -0
- package/es/domUtils/rect.d.ts +12 -0
- package/es/domUtils/rect.js +22 -0
- package/es/domUtils/rect.miniapp.d.ts +2 -0
- package/es/domUtils/rect.miniapp.js +54 -0
- package/es/domUtils/removeClass.d.ts +1 -0
- package/es/domUtils/removeClass.js +24 -0
- package/es/getBoundingClientRect/index.d.ts +1 -1
- package/es/getBoundingClientRect/index.js +13 -0
- package/es/getBoundingClientRect/index.miniapp.d.ts +1 -2
- package/es/getBoundingClientRect/index.miniapp.js +34 -5
- package/es/getRootContainer/index.d.ts +2 -0
- package/es/getRootContainer/index.js +9 -0
- package/es/getRootContainer/index.miniapp.d.ts +3 -0
- package/es/{getRootElement → getRootContainer}/index.miniapp.js +4 -4
- package/es/hooks/index.d.ts +2 -2
- package/es/hooks/index.js +10 -1
- package/es/hooks/useTouchEmulator.d.ts +7 -1
- package/es/hooks/useTouchEmulator.js +29 -10
- package/es/index.d.ts +4 -3
- package/es/index.js +13 -2
- package/es/isMini.d.ts +2 -1
- package/es/isMini.js +2 -0
- package/es/render.d.ts +2 -2
- package/package.json +2 -2
- package/dist/getRootElement/index.d.ts +0 -2
- package/dist/getRootElement/index.miniapp.d.ts +0 -3
- package/es/getRootElement/index.d.ts +0 -2
- package/es/getRootElement/index.js +0 -9
- package/es/getRootElement/index.miniapp.d.ts +0 -3
package/es/index.d.ts
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
export { default as debounce } from './debounce';
|
2
|
-
export { getStylesAndLocation, triggerEventTransform, parsePlacement, } from './directionLocationUtil';
|
2
|
+
export { getStylesAndLocation, getNewDirectionLocation, triggerEventTransform, parsePlacement, } from './directionLocationUtil';
|
3
3
|
export { default as convertHexToRGBA } from './hex2rgba';
|
4
|
-
export { useDidMountEffect, useEventCallback, useForkRef, useTouchEmulator, useValue, useDomReady, useSize, useDomCss, useTouch, useUniqueId, } from './hooks';
|
4
|
+
export { useDidMountEffect, useEventCallback, useForkRef, useTouchEmulator, touchEmulator, emulateTouchStart, emulateTouchMove, emulateTouchEnd, useValue, useDomReady, useSize, useDomCss, useTouch, useUniqueId, } from './hooks';
|
5
5
|
export { default as isDev } from './isDev';
|
6
6
|
export { isMini, isWeapp, isAlipay, isMiniapp } from './isMini';
|
7
7
|
export { default as setRef } from './setRef';
|
@@ -9,8 +9,9 @@ export { default as throttle } from './throttle';
|
|
9
9
|
export { default as toArray } from './toArray';
|
10
10
|
export { default as blockTouch } from './touchBlocker';
|
11
11
|
export { easing, duration, getTransitionProps, createTransitions, } from './transitions';
|
12
|
-
export { default as
|
12
|
+
export { default as getRootContainer } from './getRootContainer';
|
13
13
|
export { default as getBoundingClientRect } from './getBoundingClientRect';
|
14
|
+
export * from './domUtils';
|
14
15
|
export * from './isType';
|
15
16
|
export * from './render';
|
16
17
|
export * from './themeCreator';
|
package/es/index.js
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
import { default as default2 } from "./debounce";
|
2
2
|
import {
|
3
3
|
getStylesAndLocation,
|
4
|
+
getNewDirectionLocation,
|
4
5
|
triggerEventTransform,
|
5
6
|
parsePlacement
|
6
7
|
} from "./directionLocationUtil";
|
@@ -10,6 +11,10 @@ import {
|
|
10
11
|
useEventCallback,
|
11
12
|
useForkRef,
|
12
13
|
useTouchEmulator,
|
14
|
+
touchEmulator,
|
15
|
+
emulateTouchStart,
|
16
|
+
emulateTouchMove,
|
17
|
+
emulateTouchEnd,
|
13
18
|
useValue,
|
14
19
|
useDomReady,
|
15
20
|
useSize,
|
@@ -29,8 +34,9 @@ import {
|
|
29
34
|
getTransitionProps,
|
30
35
|
createTransitions
|
31
36
|
} from "./transitions";
|
32
|
-
import { default as default9 } from "./
|
37
|
+
import { default as default9 } from "./getRootContainer";
|
33
38
|
import { default as default10 } from "./getBoundingClientRect";
|
39
|
+
export * from "./domUtils";
|
34
40
|
export * from "./isType";
|
35
41
|
export * from "./render";
|
36
42
|
export * from "./themeCreator";
|
@@ -41,8 +47,12 @@ export {
|
|
41
47
|
default2 as debounce,
|
42
48
|
duration,
|
43
49
|
easing,
|
50
|
+
emulateTouchEnd,
|
51
|
+
emulateTouchMove,
|
52
|
+
emulateTouchStart,
|
44
53
|
default10 as getBoundingClientRect,
|
45
|
-
|
54
|
+
getNewDirectionLocation,
|
55
|
+
default9 as getRootContainer,
|
46
56
|
getStylesAndLocation,
|
47
57
|
getTransitionProps,
|
48
58
|
isAlipay,
|
@@ -54,6 +64,7 @@ export {
|
|
54
64
|
default5 as setRef,
|
55
65
|
default6 as throttle,
|
56
66
|
default7 as toArray,
|
67
|
+
touchEmulator,
|
57
68
|
triggerEventTransform,
|
58
69
|
useDidMountEffect,
|
59
70
|
useDomCss,
|
package/es/isMini.d.ts
CHANGED
package/es/isMini.js
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
const isMini = typeof process.env.TARO_ENV === "string";
|
2
2
|
const isWeapp = process.env.TARO_ENV === "weapp";
|
3
3
|
const isAlipay = process.env.TARO_ENV === "alipay";
|
4
|
+
const isTt = process.env.TARO_ENV === "tt";
|
4
5
|
const isMiniapp = () => {
|
5
6
|
return isMini;
|
6
7
|
};
|
@@ -8,5 +9,6 @@ export {
|
|
8
9
|
isAlipay,
|
9
10
|
isMini,
|
10
11
|
isMiniapp,
|
12
|
+
isTt,
|
11
13
|
isWeapp
|
12
14
|
};
|
package/es/render.d.ts
CHANGED
@@ -8,6 +8,6 @@ type ContainerType = (Element | DocumentFragment) & {
|
|
8
8
|
export declare function testModernRender(node: ReactElement, container: ContainerType, isTest: boolean): void;
|
9
9
|
export declare function render(node: ReactElement, container: ContainerType): void;
|
10
10
|
/** @private Test usage. Not work in prod */
|
11
|
-
export declare function testLegacyUnmount(container: ContainerType, isTest: boolean):
|
12
|
-
export declare function unmount(container: ContainerType):
|
11
|
+
export declare function testLegacyUnmount(container: ContainerType, isTest: boolean): any;
|
12
|
+
export declare function unmount(container: ContainerType): any;
|
13
13
|
export {};
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@bifrostui/utils",
|
3
|
-
"version": "2.0.0-alpha.
|
3
|
+
"version": "2.0.0-alpha.2",
|
4
4
|
"description": "BUI React utilities for building components.",
|
5
5
|
"main": "dist/index.js",
|
6
6
|
"module": "es/index.js",
|
@@ -17,7 +17,7 @@
|
|
17
17
|
},
|
18
18
|
"dependencies": {
|
19
19
|
"react-is": "^18.0.0",
|
20
|
-
"@bifrostui/styles": "2.0.0-alpha.
|
20
|
+
"@bifrostui/styles": "2.0.0-alpha.2"
|
21
21
|
},
|
22
22
|
"peerDependencies": {
|
23
23
|
"@tarojs/runtime": "^3.0.0",
|
@@ -1,9 +0,0 @@
|
|
1
|
-
const getRootElement = (rootEle) => {
|
2
|
-
const rootElement = typeof rootEle === "function" ? rootEle() : rootEle;
|
3
|
-
const defaultRootElement = document.body;
|
4
|
-
return rootElement || defaultRootElement;
|
5
|
-
};
|
6
|
-
var getRootElement_default = getRootElement;
|
7
|
-
export {
|
8
|
-
getRootElement_default as default
|
9
|
-
};
|