@zuzjs/ui 0.7.8 → 0.7.9
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/comps/Box/index.d.ts +1 -2
- package/dist/cjs/comps/Box/index.js +14 -12
- package/dist/cjs/comps/Button/index.d.ts +1 -1
- package/dist/cjs/comps/Button/types.d.ts +1 -1
- package/dist/cjs/comps/ColorScheme/index.d.ts +3 -2
- package/dist/cjs/comps/ColorScheme/index.js +24 -9
- package/dist/cjs/comps/ColorScheme/types.d.ts +4 -0
- package/dist/cjs/comps/ColorScheme/types.js +1 -0
- package/dist/cjs/comps/ContextMenu/index.js +1 -2
- package/dist/cjs/comps/Crumb/index.d.ts +4 -0
- package/dist/cjs/comps/Crumb/index.js +13 -0
- package/dist/cjs/comps/Crumb/types.d.ts +11 -0
- package/dist/cjs/comps/Crumb/types.js +1 -0
- package/dist/cjs/comps/Drawer/index.js +16 -15
- package/dist/cjs/comps/Form/index.d.ts +3 -59
- package/dist/cjs/comps/Form/types.d.ts +43 -0
- package/dist/cjs/comps/Form/types.js +1 -0
- package/dist/cjs/comps/Icon/index.js +0 -1
- package/dist/cjs/comps/Image/index.js +0 -1
- package/dist/cjs/comps/KeyboardKeys/index.d.ts +8 -0
- package/dist/cjs/comps/KeyboardKeys/index.js +33 -0
- package/dist/cjs/comps/KeyboardKeys/types.d.ts +13 -0
- package/dist/cjs/comps/KeyboardKeys/types.js +51 -0
- package/dist/cjs/comps/Label/index.js +0 -1
- package/dist/cjs/comps/List/index.d.ts +3 -0
- package/dist/cjs/comps/List/index.js +4 -4
- package/dist/cjs/comps/List/item.js +5 -1
- package/dist/cjs/comps/List/types.d.ts +4 -1
- package/dist/cjs/comps/Network/index.js +3 -5
- package/dist/cjs/comps/Pagination/index.js +2 -2
- package/dist/cjs/comps/ScrollView/index.d.ts +5 -0
- package/dist/cjs/comps/ScrollView/index.js +13 -0
- package/dist/cjs/comps/ScrollView/types.d.ts +6 -0
- package/dist/cjs/comps/ScrollView/types.js +1 -0
- package/dist/cjs/comps/Search/index.d.ts +7 -10
- package/dist/cjs/comps/Search/index.js +10 -6
- package/dist/cjs/comps/Search/types.d.ts +12 -0
- package/dist/cjs/comps/Search/types.js +1 -0
- package/dist/cjs/comps/Segmented/index.d.ts +3 -2
- package/dist/cjs/comps/Segmented/index.js +6 -5
- package/dist/cjs/comps/Segmented/item.js +11 -2
- package/dist/cjs/comps/Segmented/types.d.ts +5 -1
- package/dist/cjs/comps/Select/index.d.ts +1 -1
- package/dist/cjs/comps/Select/types.d.ts +1 -1
- package/dist/cjs/comps/Sheet/index.js +8 -5
- package/dist/cjs/comps/Spinner/index.js +1 -2
- package/dist/cjs/comps/TabView/index.d.ts +1 -1
- package/dist/cjs/comps/TabView/types.d.ts +2 -2
- package/dist/cjs/comps/Table/index.js +12 -5
- package/dist/cjs/comps/Table/row.js +3 -2
- package/dist/cjs/comps/Table/types.d.ts +88 -1
- package/dist/cjs/comps/Text/index.d.ts +2 -0
- package/dist/cjs/comps/Text/index.js +4 -2
- package/dist/cjs/comps/TextArea/index.d.ts +2 -0
- package/dist/cjs/comps/TextArea/index.js +3 -4
- package/dist/cjs/comps/Treeview/index.js +3 -2
- package/dist/cjs/comps/Treeview/item.d.ts +1 -1
- package/dist/cjs/comps/Treeview/item.js +5 -4
- package/dist/cjs/comps/Treeview/types.d.ts +1 -1
- package/dist/cjs/comps/VideoPlayer/index.d.ts +2 -0
- package/dist/cjs/comps/VideoPlayer/index.js +7 -0
- package/dist/cjs/comps/index.d.ts +26 -18
- package/dist/cjs/comps/index.js +8 -0
- package/dist/cjs/funs/css.d.ts +3 -3
- package/dist/cjs/funs/css.js +20 -18
- package/dist/cjs/funs/index.d.ts +1 -0
- package/dist/cjs/funs/index.js +10 -0
- package/dist/cjs/funs/stylesheet.js +5 -0
- package/dist/cjs/hooks/index.d.ts +13 -6
- package/dist/cjs/hooks/index.js +14 -7
- package/dist/cjs/hooks/useAnchorPosition.d.ts +1 -2
- package/dist/cjs/hooks/useAnchorPosition.js +1 -0
- package/dist/cjs/hooks/useBase.js +27 -13
- package/dist/cjs/hooks/useCalendar.js +1 -0
- package/dist/cjs/hooks/useColorScheme.js +2 -2
- package/dist/cjs/hooks/useContextMenu.js +1 -0
- package/dist/cjs/hooks/useDB.js +1 -0
- package/dist/cjs/hooks/useDebounce.js +2 -1
- package/dist/cjs/hooks/useDelayed.js +2 -1
- package/dist/cjs/hooks/useDevice.js +1 -0
- package/dist/cjs/hooks/useDimensions.js +2 -1
- package/dist/cjs/hooks/useDom.d.ts +2 -0
- package/dist/cjs/hooks/useDom.js +3 -0
- package/dist/cjs/hooks/useDomMutation.d.ts +3 -0
- package/dist/cjs/hooks/useDomMutation.js +19 -0
- package/dist/cjs/hooks/useDrag.js +2 -1
- package/dist/cjs/hooks/useFileManager.d.ts +2 -0
- package/dist/cjs/hooks/useFileManager.js +3 -0
- package/dist/cjs/hooks/useImage.js +1 -0
- package/dist/cjs/hooks/useIntersectionObserver.js +2 -1
- package/dist/cjs/hooks/useMediaPlayer.d.ts +32 -0
- package/dist/cjs/hooks/useMediaPlayer.js +86 -0
- package/dist/cjs/hooks/useMergedRefs.d.ts +2 -0
- package/dist/cjs/hooks/useMergedRefs.js +14 -0
- package/dist/cjs/hooks/useMutationObserver.d.ts +3 -0
- package/dist/cjs/hooks/useMutationObserver.js +20 -0
- package/dist/cjs/hooks/useNetworkStatus.js +2 -1
- package/dist/cjs/hooks/usePlayer.d.ts +32 -0
- package/dist/cjs/hooks/usePlayer.js +85 -0
- package/dist/cjs/hooks/useResizeObserver.js +2 -1
- package/dist/cjs/hooks/useScrollbar.d.ts +16 -0
- package/dist/cjs/hooks/useScrollbar.js +160 -0
- package/dist/cjs/hooks/useSheet.js +1 -0
- package/dist/cjs/hooks/useShortcuts.d.ts +7 -0
- package/dist/cjs/hooks/useShortcuts.js +29 -0
- package/dist/cjs/hooks/useSlider.d.ts +7 -0
- package/dist/cjs/hooks/useSlider.js +23 -0
- package/dist/cjs/hooks/useTruncateText.d.ts +2 -0
- package/dist/cjs/hooks/useTruncateText.js +17 -0
- package/dist/cjs/hooks/useViewTransition.d.ts +2 -0
- package/dist/cjs/hooks/useViewTransition.js +13 -0
- package/dist/cjs/types/enums.d.ts +1 -0
- package/dist/cjs/types/enums.js +1 -0
- package/dist/cjs/types/index.d.ts +2 -1
- package/dist/cjs/types/interfaces.d.ts +2 -0
- package/dist/css/styles.css +1 -1
- package/dist/esm/comps/Box/index.d.ts +1 -2
- package/dist/esm/comps/Box/index.js +14 -12
- package/dist/esm/comps/Button/index.d.ts +1 -1
- package/dist/esm/comps/Button/types.d.ts +1 -1
- package/dist/esm/comps/ColorScheme/index.d.ts +3 -2
- package/dist/esm/comps/ColorScheme/index.js +24 -9
- package/dist/esm/comps/ColorScheme/types.d.ts +4 -0
- package/dist/esm/comps/ColorScheme/types.js +1 -0
- package/dist/esm/comps/ContextMenu/index.js +1 -2
- package/dist/esm/comps/Crumb/index.d.ts +4 -0
- package/dist/esm/comps/Crumb/index.js +13 -0
- package/dist/esm/comps/Crumb/types.d.ts +11 -0
- package/dist/esm/comps/Crumb/types.js +1 -0
- package/dist/esm/comps/Drawer/index.js +16 -15
- package/dist/esm/comps/Form/index.d.ts +3 -59
- package/dist/esm/comps/Form/types.d.ts +43 -0
- package/dist/esm/comps/Form/types.js +1 -0
- package/dist/esm/comps/Icon/index.js +0 -1
- package/dist/esm/comps/Image/index.js +0 -1
- package/dist/esm/comps/KeyboardKeys/index.d.ts +8 -0
- package/dist/esm/comps/KeyboardKeys/index.js +33 -0
- package/dist/esm/comps/KeyboardKeys/types.d.ts +13 -0
- package/dist/esm/comps/KeyboardKeys/types.js +51 -0
- package/dist/esm/comps/Label/index.js +0 -1
- package/dist/esm/comps/List/index.d.ts +3 -0
- package/dist/esm/comps/List/index.js +4 -4
- package/dist/esm/comps/List/item.js +5 -1
- package/dist/esm/comps/List/types.d.ts +4 -1
- package/dist/esm/comps/Network/index.js +3 -5
- package/dist/esm/comps/Pagination/index.js +2 -2
- package/dist/esm/comps/ScrollView/index.d.ts +5 -0
- package/dist/esm/comps/ScrollView/index.js +13 -0
- package/dist/esm/comps/ScrollView/types.d.ts +6 -0
- package/dist/esm/comps/ScrollView/types.js +1 -0
- package/dist/esm/comps/Search/index.d.ts +7 -10
- package/dist/esm/comps/Search/index.js +10 -6
- package/dist/esm/comps/Search/types.d.ts +12 -0
- package/dist/esm/comps/Search/types.js +1 -0
- package/dist/esm/comps/Segmented/index.d.ts +3 -2
- package/dist/esm/comps/Segmented/index.js +6 -5
- package/dist/esm/comps/Segmented/item.js +11 -2
- package/dist/esm/comps/Segmented/types.d.ts +5 -1
- package/dist/esm/comps/Select/index.d.ts +1 -1
- package/dist/esm/comps/Select/types.d.ts +1 -1
- package/dist/esm/comps/Sheet/index.js +8 -5
- package/dist/esm/comps/Spinner/index.js +1 -2
- package/dist/esm/comps/TabView/index.d.ts +1 -1
- package/dist/esm/comps/TabView/types.d.ts +2 -2
- package/dist/esm/comps/Table/index.js +12 -5
- package/dist/esm/comps/Table/row.js +3 -2
- package/dist/esm/comps/Table/types.d.ts +88 -1
- package/dist/esm/comps/Text/index.d.ts +2 -0
- package/dist/esm/comps/Text/index.js +4 -2
- package/dist/esm/comps/TextArea/index.d.ts +2 -0
- package/dist/esm/comps/TextArea/index.js +3 -4
- package/dist/esm/comps/Treeview/index.js +3 -2
- package/dist/esm/comps/Treeview/item.d.ts +1 -1
- package/dist/esm/comps/Treeview/item.js +5 -4
- package/dist/esm/comps/Treeview/types.d.ts +1 -1
- package/dist/esm/comps/VideoPlayer/index.d.ts +2 -0
- package/dist/esm/comps/VideoPlayer/index.js +7 -0
- package/dist/esm/comps/index.d.ts +26 -18
- package/dist/esm/comps/index.js +8 -0
- package/dist/esm/funs/css.d.ts +3 -3
- package/dist/esm/funs/css.js +20 -18
- package/dist/esm/funs/index.d.ts +1 -0
- package/dist/esm/funs/index.js +10 -0
- package/dist/esm/funs/stylesheet.js +5 -0
- package/dist/esm/hooks/index.d.ts +13 -6
- package/dist/esm/hooks/index.js +14 -7
- package/dist/esm/hooks/useAnchorPosition.d.ts +1 -2
- package/dist/esm/hooks/useAnchorPosition.js +1 -0
- package/dist/esm/hooks/useBase.js +27 -13
- package/dist/esm/hooks/useCalendar.js +1 -0
- package/dist/esm/hooks/useColorScheme.js +2 -2
- package/dist/esm/hooks/useContextMenu.js +1 -0
- package/dist/esm/hooks/useDB.js +1 -0
- package/dist/esm/hooks/useDebounce.js +2 -1
- package/dist/esm/hooks/useDelayed.js +2 -1
- package/dist/esm/hooks/useDevice.js +1 -0
- package/dist/esm/hooks/useDimensions.js +2 -1
- package/dist/esm/hooks/useDom.d.ts +2 -0
- package/dist/esm/hooks/useDom.js +3 -0
- package/dist/esm/hooks/useDomMutation.d.ts +3 -0
- package/dist/esm/hooks/useDomMutation.js +19 -0
- package/dist/esm/hooks/useDrag.js +2 -1
- package/dist/esm/hooks/useFileManager.d.ts +2 -0
- package/dist/esm/hooks/useFileManager.js +3 -0
- package/dist/esm/hooks/useImage.js +1 -0
- package/dist/esm/hooks/useIntersectionObserver.js +2 -1
- package/dist/esm/hooks/useMediaPlayer.d.ts +32 -0
- package/dist/esm/hooks/useMediaPlayer.js +86 -0
- package/dist/esm/hooks/useMergedRefs.d.ts +2 -0
- package/dist/esm/hooks/useMergedRefs.js +14 -0
- package/dist/esm/hooks/useMutationObserver.d.ts +3 -0
- package/dist/esm/hooks/useMutationObserver.js +20 -0
- package/dist/esm/hooks/useNetworkStatus.js +2 -1
- package/dist/esm/hooks/usePlayer.d.ts +32 -0
- package/dist/esm/hooks/usePlayer.js +85 -0
- package/dist/esm/hooks/useResizeObserver.js +2 -1
- package/dist/esm/hooks/useScrollbar.d.ts +16 -0
- package/dist/esm/hooks/useScrollbar.js +160 -0
- package/dist/esm/hooks/useSheet.js +1 -0
- package/dist/esm/hooks/useShortcuts.d.ts +7 -0
- package/dist/esm/hooks/useShortcuts.js +29 -0
- package/dist/esm/hooks/useSlider.d.ts +7 -0
- package/dist/esm/hooks/useSlider.js +23 -0
- package/dist/esm/hooks/useTruncateText.d.ts +2 -0
- package/dist/esm/hooks/useTruncateText.js +17 -0
- package/dist/esm/hooks/useViewTransition.d.ts +2 -0
- package/dist/esm/hooks/useViewTransition.js +13 -0
- package/dist/esm/types/enums.d.ts +1 -0
- package/dist/esm/types/enums.js +1 -0
- package/dist/esm/types/index.d.ts +2 -1
- package/dist/esm/types/interfaces.d.ts +2 -0
- package/dist/tsconfig.esm.tsbuildinfo +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -9,7 +9,7 @@ export { default as AutoComplete } from './AutoComplete';
|
|
|
9
9
|
export * from './AutoComplete/types';
|
|
10
10
|
export { default as Avatar } from './Avatar';
|
|
11
11
|
export * from './Avatar/types';
|
|
12
|
-
export {
|
|
12
|
+
export { default as Box, type BoxProps } from './Box';
|
|
13
13
|
export { default as Button } from './Button';
|
|
14
14
|
export * from './Button/types';
|
|
15
15
|
export { default as CheckBox } from './CheckBox';
|
|
@@ -19,7 +19,9 @@ export { default as ContextMenu } from './ContextMenu';
|
|
|
19
19
|
export * from './ContextMenu/types';
|
|
20
20
|
export { default as CookiesConsent } from './CookiesConsent';
|
|
21
21
|
export * from './CookiesConsent/types';
|
|
22
|
-
export {
|
|
22
|
+
export { default as Cover, type CoverProps } from './Cover';
|
|
23
|
+
export { default as Crumb } from './Crumb';
|
|
24
|
+
export * from './Crumb/types';
|
|
23
25
|
export { default as Drawer } from './Drawer';
|
|
24
26
|
export * from './Drawer/types';
|
|
25
27
|
/**Editor */
|
|
@@ -29,43 +31,49 @@ export * from './Editor/types';
|
|
|
29
31
|
export { default as withEditor } from './Editor/withEditor';
|
|
30
32
|
export { default as Fab } from './Fab';
|
|
31
33
|
export * from './Fab/types';
|
|
32
|
-
export {
|
|
33
|
-
export {
|
|
34
|
-
export
|
|
35
|
-
export {
|
|
36
|
-
export {
|
|
37
|
-
export {
|
|
34
|
+
export { default as Filters, type FilterProps } from './Filters';
|
|
35
|
+
export { default as Form } from './Form';
|
|
36
|
+
export * from './Form/types';
|
|
37
|
+
export { default as Icon, type IconProps } from './Icon';
|
|
38
|
+
export { default as Image, type ImageProps } from './Image';
|
|
39
|
+
export { default as Input, type InputProps } from './Input';
|
|
40
|
+
export { default as KeyboardKeys } from './KeyboardKeys';
|
|
41
|
+
export * from './KeyboardKeys/types';
|
|
42
|
+
export { default as Label, type LabelProps } from './Label';
|
|
38
43
|
export { default as List } from './List';
|
|
39
44
|
export * from './List/types';
|
|
40
45
|
export { default as NetworkStatus } from './Network';
|
|
41
46
|
export * from './Network/types';
|
|
42
|
-
export {
|
|
43
|
-
export {
|
|
44
|
-
export {
|
|
47
|
+
export { default as Overlay, type OverlayProps } from './Overlay';
|
|
48
|
+
export { default as Password, type PasswordProps } from './Password';
|
|
49
|
+
export { default as PinInput, type PinInputProps } from './PinInput';
|
|
45
50
|
export { default as Pagination } from './Pagination';
|
|
46
51
|
export * from './Pagination/types';
|
|
47
52
|
export { default as ProgressBar } from './ProgressBar';
|
|
48
53
|
export * from './ProgressBar/types';
|
|
49
54
|
export { default as Radio } from './Radio';
|
|
50
55
|
export * from './Radio/types';
|
|
51
|
-
export {
|
|
56
|
+
export { default as ScrollView } from './ScrollView';
|
|
57
|
+
export * from './ScrollView/types';
|
|
58
|
+
export { default as Search } from './Search';
|
|
59
|
+
export * from './Search/types';
|
|
52
60
|
export { default as SelectTabs } from './Segmented';
|
|
53
61
|
export * from './Segmented/types';
|
|
54
62
|
export { default as Select } from './Select';
|
|
55
63
|
export * from './Select/types';
|
|
56
|
-
export {
|
|
64
|
+
export { default as Sheet, type SheetHandler, type SheetProps } from './Sheet';
|
|
57
65
|
export { default as SideBar } from './Sidebar';
|
|
58
66
|
export * from './Sidebar/types';
|
|
59
|
-
export {
|
|
60
|
-
export {
|
|
61
|
-
export {
|
|
67
|
+
export { default as Slider, type SliderProps } from './Slider';
|
|
68
|
+
export { default as Span, type SpanProps } from './Span';
|
|
69
|
+
export { default as Spinner, type SpinnerProps } from './Spinner';
|
|
62
70
|
export { default as Switch } from './Switch';
|
|
63
71
|
export { default as Table } from './Table';
|
|
64
72
|
export * from './Table/types';
|
|
65
73
|
export { default as TabView } from './TabView';
|
|
66
74
|
export * from './TabView/types';
|
|
67
|
-
export {
|
|
68
|
-
export {
|
|
75
|
+
export { default as Text, type TextProps } from './Text';
|
|
76
|
+
export { default as Textarea, type TextAreaProps } from './TextArea';
|
|
69
77
|
export { default as TextWheel } from './TextWheel';
|
|
70
78
|
export * from './TextWheel/types';
|
|
71
79
|
export { default as ToolTip } from './Tooltip';
|
package/dist/cjs/comps/index.js
CHANGED
|
@@ -20,6 +20,8 @@ export * from './ContextMenu/types';
|
|
|
20
20
|
export { default as CookiesConsent } from './CookiesConsent';
|
|
21
21
|
export * from './CookiesConsent/types';
|
|
22
22
|
export { default as Cover } from './Cover';
|
|
23
|
+
export { default as Crumb } from './Crumb';
|
|
24
|
+
export * from './Crumb/types';
|
|
23
25
|
export { default as Drawer } from './Drawer';
|
|
24
26
|
export * from './Drawer/types';
|
|
25
27
|
/**Editor */
|
|
@@ -31,9 +33,12 @@ export { default as Fab } from './Fab';
|
|
|
31
33
|
export * from './Fab/types';
|
|
32
34
|
export { default as Filters } from './Filters';
|
|
33
35
|
export { default as Form } from './Form';
|
|
36
|
+
export * from './Form/types';
|
|
34
37
|
export { default as Icon } from './Icon';
|
|
35
38
|
export { default as Image } from './Image';
|
|
36
39
|
export { default as Input } from './Input';
|
|
40
|
+
export { default as KeyboardKeys } from './KeyboardKeys';
|
|
41
|
+
export * from './KeyboardKeys/types';
|
|
37
42
|
export { default as Label } from './Label';
|
|
38
43
|
export { default as List } from './List';
|
|
39
44
|
export * from './List/types';
|
|
@@ -48,7 +53,10 @@ export { default as ProgressBar } from './ProgressBar';
|
|
|
48
53
|
export * from './ProgressBar/types';
|
|
49
54
|
export { default as Radio } from './Radio';
|
|
50
55
|
export * from './Radio/types';
|
|
56
|
+
export { default as ScrollView } from './ScrollView';
|
|
57
|
+
export * from './ScrollView/types';
|
|
51
58
|
export { default as Search } from './Search';
|
|
59
|
+
export * from './Search/types';
|
|
52
60
|
export { default as SelectTabs } from './Segmented';
|
|
53
61
|
export * from './Segmented/types';
|
|
54
62
|
export { default as Select } from './Select';
|
package/dist/cjs/funs/css.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { OptionValues } from "commander";
|
|
2
2
|
import Hashids from "hashids";
|
|
3
|
+
import { dynamicObject } from "../types";
|
|
3
4
|
import { TRANSITION_CURVES, TRANSITIONS } from "../types/enums.js";
|
|
4
|
-
import { OptionValues } from "commander";
|
|
5
5
|
declare class CSS {
|
|
6
6
|
cache: dynamicObject;
|
|
7
7
|
PROPS: dynamicObject;
|
|
@@ -52,7 +52,7 @@ declare class CSS {
|
|
|
52
52
|
export default CSS;
|
|
53
53
|
export declare const buildWithStyles: (source: dynamicObject) => dynamicObject;
|
|
54
54
|
export declare const getAnimationCurve: (curve?: string | TRANSITION_CURVES) => string;
|
|
55
|
-
export declare const animationTransition: (transition: TRANSITIONS) => {
|
|
55
|
+
export declare const animationTransition: (transition: TRANSITIONS, offset?: number, dialog?: boolean) => {
|
|
56
56
|
from: {};
|
|
57
57
|
to: {};
|
|
58
58
|
};
|
package/dist/cjs/funs/css.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { __SALT, FIELNAME_KEY, isColor, isHexColor, isNumber, LINE_KEY, setDeep } from "./index.js";
|
|
2
|
-
import { cssAnimationCurves, cssDirect, cssFilterKeys, cssProps, cssPropsWithColor, cssTransformKeys, cssWithKeys } from "./stylesheet.js";
|
|
3
1
|
import Hashids from "hashids";
|
|
4
|
-
import { TRANSITION_CURVES, TRANSITIONS } from "../types/enums.js";
|
|
5
2
|
import md5 from "md5";
|
|
6
3
|
import pc from "picocolors";
|
|
4
|
+
import { TRANSITION_CURVES, TRANSITIONS } from "../types/enums.js";
|
|
5
|
+
import { __SALT, FIELNAME_KEY, isColor, isHexColor, isNumber, LINE_KEY, setDeep } from "./index.js";
|
|
6
|
+
import { cssAnimationCurves, cssDirect, cssFilterKeys, cssProps, cssPropsWithColor, cssTransformKeys, cssWithKeys } from "./stylesheet.js";
|
|
7
7
|
class CSS {
|
|
8
8
|
cache;
|
|
9
9
|
PROPS;
|
|
@@ -935,39 +935,41 @@ export const getAnimationCurve = (curve) => {
|
|
|
935
935
|
switch (curve.toUpperCase()) {
|
|
936
936
|
case TRANSITION_CURVES.Bounce:
|
|
937
937
|
return `var(--bounce)`;
|
|
938
|
-
// return `linear( 0, 0.0039, 0.0157, 0.0352, 0.0625 9.09%,
|
|
939
|
-
// 0.1407, 0.25, 0.3908, 0.5625, 0.7654,
|
|
940
|
-
// 1, 0.8907, 0.8125 45.45%, 0.7852, 0.7657,
|
|
941
|
-
// 0.7539, 0.75, 0.7539, 0.7657, 0.7852,
|
|
942
|
-
// 0.8125 63.64%, 0.8905, 1 72.73%, 0.9727, 0.9532,
|
|
943
|
-
// 0.9414, 0.9375, 0.9414, 0.9531, 0.9726,
|
|
944
|
-
// 1, 0.9883, 0.9844, 0.9883, 1 )`
|
|
945
|
-
break;
|
|
946
938
|
case TRANSITION_CURVES.Spring:
|
|
947
939
|
// return `cubic-bezier(0.2, -0.36, 0, 1.46)`
|
|
948
940
|
return `var(--spring)`;
|
|
949
|
-
break;
|
|
950
941
|
case TRANSITION_CURVES.EaseInOut:
|
|
951
942
|
// return `cubic-bezier(0.42, 0, 0.58, 1)`
|
|
952
943
|
return `ease-in-out`;
|
|
953
|
-
break;
|
|
954
944
|
default:
|
|
955
945
|
return `linear`;
|
|
956
946
|
}
|
|
957
947
|
};
|
|
958
|
-
export const animationTransition = (transition) => {
|
|
948
|
+
export const animationTransition = (transition, offset = 0, dialog = false) => {
|
|
959
949
|
let _from = {};
|
|
960
950
|
let _to = {};
|
|
961
951
|
switch (transition) {
|
|
962
952
|
case TRANSITIONS.SlideInLeft:
|
|
963
953
|
case TRANSITIONS.SlideInRight:
|
|
964
|
-
_from = { x: transition == TRANSITIONS.SlideInLeft ?
|
|
965
|
-
|
|
954
|
+
_from = { x: transition == TRANSITIONS.SlideInLeft ?
|
|
955
|
+
dialog ? `-${50 + (offset || 10)}%` : -20 :
|
|
956
|
+
dialog ? `-${50 - (offset || 10)}%` : 20,
|
|
957
|
+
y: dialog ? `-50%` : 0,
|
|
958
|
+
opacity: 0 };
|
|
959
|
+
_to = { x: dialog ? `-50%` : 0, y: dialog ? `-50%` : 0, opacity: 1 };
|
|
966
960
|
break;
|
|
967
961
|
case TRANSITIONS.SlideInTop:
|
|
968
962
|
case TRANSITIONS.SlideInBottom:
|
|
969
|
-
_from = {
|
|
970
|
-
|
|
963
|
+
_from = {
|
|
964
|
+
y: transition == TRANSITIONS.SlideInTop ?
|
|
965
|
+
//Top
|
|
966
|
+
dialog ? `-${50 + (offset || 10)}%` : -20
|
|
967
|
+
//Bottom
|
|
968
|
+
: dialog ? `-${50 - (offset || 10)}%` : 20,
|
|
969
|
+
x: dialog ? `-50%` : 0,
|
|
970
|
+
opacity: 0
|
|
971
|
+
};
|
|
972
|
+
_to = { y: dialog ? `-50%` : 0, x: dialog ? `-50%` : 0, opacity: 1 };
|
|
971
973
|
break;
|
|
972
974
|
case TRANSITIONS.ScaleIn:
|
|
973
975
|
_from = { scale: 0, opacity: 0 };
|
package/dist/cjs/funs/index.d.ts
CHANGED
|
@@ -74,3 +74,4 @@ export declare const getPositionAroundElement: (x: number, y: number, distance:
|
|
|
74
74
|
export declare const clamp: (value: number, min: number, max: number) => number;
|
|
75
75
|
export declare function mergeRefs<T>(...refs: (Ref<T> | undefined)[]): Ref<T>;
|
|
76
76
|
export declare const slugify: (text: string, separator?: string) => string;
|
|
77
|
+
export declare const truncate: (selector: string, lines?: number) => void;
|
package/dist/cjs/funs/index.js
CHANGED
|
@@ -536,3 +536,13 @@ export const slugify = (text, separator = "-") => {
|
|
|
536
536
|
.replace(new RegExp(`\\${separator}{2,}`, "g"), separator) // Remove duplicate separators
|
|
537
537
|
.replace(new RegExp(`^\\${separator}|\\${separator}$`, "g"), ""); // Trim separators from ends
|
|
538
538
|
};
|
|
539
|
+
export const truncate = (selector, lines = 2) => {
|
|
540
|
+
const elements = document.querySelectorAll(selector);
|
|
541
|
+
elements.forEach((el) => {
|
|
542
|
+
const lineHeight = parseFloat(window.getComputedStyle(el).lineHeight);
|
|
543
|
+
const maxHeight = lineHeight * lines;
|
|
544
|
+
while (el.scrollHeight > maxHeight) {
|
|
545
|
+
el.textContent = el.textContent?.trim().slice(0, -1) + '…';
|
|
546
|
+
}
|
|
547
|
+
});
|
|
548
|
+
};
|
|
@@ -325,14 +325,19 @@ export const cssDirect = {
|
|
|
325
325
|
"brightness": "filter: brightness(__VALUE__);",
|
|
326
326
|
"ratio": "aspect-ratio: __VALUE__;",
|
|
327
327
|
"center-h": "left: 50%;transform: translateX(-50%);",
|
|
328
|
+
"center-x": "left: 50%;transform: translateX(-50%);",
|
|
328
329
|
"center-v": "top: 50%;transform: translateY(-50%);",
|
|
330
|
+
"center-y": "top: 50%;transform: translateY(-50%);",
|
|
329
331
|
"no-overflow": "overflow: hidden;",
|
|
332
|
+
"no-overflow-x": "overflow-x: hidden;",
|
|
333
|
+
"no-overflow-y": "overflow-y: hidden;",
|
|
330
334
|
"overflow-x": "overflow-x: auto;",
|
|
331
335
|
"overflow-y": "overflow-x: auto;",
|
|
332
336
|
"space-pre": "white-space: pre;",
|
|
333
337
|
"white-space-pre": "white-space: pre;",
|
|
334
338
|
"text-wrap": "width: 98%;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;",
|
|
335
339
|
"text-clip": "color: transparent;background-clip: text;-webkit-background-clip: text;",
|
|
340
|
+
"word-break": "wordc-break: break-word;",
|
|
336
341
|
};
|
|
337
342
|
export const cssPropsWithColor = [
|
|
338
343
|
// Regular CSS keys
|
|
@@ -5,16 +5,23 @@ export { useColorScheme } from './useColorScheme';
|
|
|
5
5
|
export { default as useContextMenu } from './useContextMenu';
|
|
6
6
|
export { default as useDB, type IDBOptions, type IDBSchema } from './useDB';
|
|
7
7
|
export { default as useDebounce } from './useDebounce';
|
|
8
|
+
/**
|
|
9
|
+
* @deprecated use useDelayed hook instead
|
|
10
|
+
*/
|
|
11
|
+
export { default as useDelayed, default as useMounted } from './useDelayed';
|
|
8
12
|
export { default as useDevice } from './useDevice';
|
|
9
13
|
export { default as useDimensions } from './useDimensions';
|
|
14
|
+
export { default as useMediaPlayer, type MediaPlayerProps, type MediaType } from './useMediaPlayer';
|
|
15
|
+
export { default as useMergedRefs } from './useMergedRefs';
|
|
16
|
+
export { default as useMutationObserver, type MutationCallback } from './useMutationObserver';
|
|
10
17
|
export { default as useDrag, type DragOptions } from './useDrag';
|
|
18
|
+
export { default as useFileManager } from './useFileManager';
|
|
11
19
|
export { default as useImage } from './useImage';
|
|
12
20
|
export { default as useIntersectionObserver } from './useIntersectionObserver';
|
|
13
|
-
export { default as
|
|
14
|
-
|
|
15
|
-
* @deprecated use useDelayed hook instead
|
|
16
|
-
*/
|
|
17
|
-
export { default as useMounted } from './useDelayed';
|
|
18
|
-
export { default as useDelayed } from './useDelayed';
|
|
21
|
+
export { default as useScrollbar } from './useScrollbar';
|
|
22
|
+
export { default as useShortcuts } from './useShortcuts';
|
|
19
23
|
export { default as useNetworkStatus } from './useNetworkStatus';
|
|
20
24
|
export { default as useResizeObserver } from './useResizeObserver';
|
|
25
|
+
export { default as useSlider } from './useSlider';
|
|
26
|
+
export { default as useTruncateText } from './useTruncateText';
|
|
27
|
+
export { default as useViewTransition } from './useViewTransition';
|
package/dist/cjs/hooks/index.js
CHANGED
|
@@ -5,17 +5,24 @@ export { useColorScheme } from './useColorScheme';
|
|
|
5
5
|
export { default as useContextMenu } from './useContextMenu';
|
|
6
6
|
export { default as useDB } from './useDB';
|
|
7
7
|
export { default as useDebounce } from './useDebounce';
|
|
8
|
+
/**
|
|
9
|
+
* @deprecated use useDelayed hook instead
|
|
10
|
+
*/
|
|
11
|
+
export { default as useDelayed, default as useMounted } from './useDelayed';
|
|
8
12
|
export { default as useDevice } from './useDevice';
|
|
9
13
|
export { default as useDimensions } from './useDimensions';
|
|
14
|
+
export { default as useMediaPlayer } from './useMediaPlayer';
|
|
15
|
+
export { default as useMergedRefs } from './useMergedRefs';
|
|
16
|
+
export { default as useMutationObserver } from './useMutationObserver';
|
|
10
17
|
export { default as useDrag } from './useDrag';
|
|
18
|
+
export { default as useFileManager } from './useFileManager';
|
|
19
|
+
//useFilter
|
|
11
20
|
export { default as useImage } from './useImage';
|
|
12
21
|
export { default as useIntersectionObserver } from './useIntersectionObserver';
|
|
13
|
-
export { default as
|
|
14
|
-
|
|
15
|
-
* @deprecated use useDelayed hook instead
|
|
16
|
-
*/
|
|
17
|
-
export { default as useMounted } from './useDelayed';
|
|
18
|
-
export { default as useDelayed } from './useDelayed';
|
|
22
|
+
export { default as useScrollbar } from './useScrollbar';
|
|
23
|
+
export { default as useShortcuts } from './useShortcuts';
|
|
19
24
|
export { default as useNetworkStatus } from './useNetworkStatus';
|
|
20
25
|
export { default as useResizeObserver } from './useResizeObserver';
|
|
21
|
-
|
|
26
|
+
export { default as useSlider } from './useSlider';
|
|
27
|
+
export { default as useTruncateText } from './useTruncateText';
|
|
28
|
+
export { default as useViewTransition } from './useViewTransition';
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { RefObject } from "react";
|
|
2
1
|
export type AnchorOptions = {
|
|
3
2
|
offsetX?: number;
|
|
4
3
|
offsetY?: number;
|
|
@@ -9,6 +8,6 @@ declare const useAnchorPosition: (parent?: HTMLElement, event?: MouseEvent, opti
|
|
|
9
8
|
top: number;
|
|
10
9
|
left: number;
|
|
11
10
|
};
|
|
12
|
-
targetRef: RefObject<HTMLDivElement | null>;
|
|
11
|
+
targetRef: import("react").RefObject<HTMLDivElement | null>;
|
|
13
12
|
};
|
|
14
13
|
export default useAnchorPosition;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { cleanProps, css } from "../funs";
|
|
2
2
|
import { buildWithStyles, getAnimationCurve, getAnimationTransition } from "../funs/css";
|
|
3
3
|
import { cssFilterKeys, cssTransformKeys, cssWithKeys } from "../funs/stylesheet";
|
|
4
|
-
|
|
4
|
+
let useDrag = null;
|
|
5
5
|
const buildSkeletonStyle = (s) => {
|
|
6
6
|
const makeValue = (v, unit = `px`) => {
|
|
7
7
|
return v ?
|
|
@@ -29,12 +29,15 @@ const buildSkeletonStyle = (s) => {
|
|
|
29
29
|
return style;
|
|
30
30
|
};
|
|
31
31
|
const useBase = (props) => {
|
|
32
|
-
const { as, fx, animate, skeleton, className, shimmer, propsToRemove, draggable, dragOptions, ...rest } = props || {};
|
|
32
|
+
const { as, fx, animate, transition: autoTransition, skeleton, className, shimmer, propsToRemove, draggable, dragOptions, ...rest } = props || {};
|
|
33
33
|
let cx = [];
|
|
34
34
|
if (as) {
|
|
35
35
|
cx = css().Build(`string` == typeof as ? as : as.join(` `)).cx;
|
|
36
36
|
}
|
|
37
|
-
const { transition, from, to, when, duration, delay, curve } =
|
|
37
|
+
const { transition, from, to, when, duration, delay, curve } = autoTransition ? {
|
|
38
|
+
transition: autoTransition,
|
|
39
|
+
duration: 0.3
|
|
40
|
+
} : fx || animate || {};
|
|
38
41
|
let _style = {};
|
|
39
42
|
if (undefined === when) {
|
|
40
43
|
_style = transition ? getAnimationTransition(transition, true) : { ...from, ...to };
|
|
@@ -67,19 +70,30 @@ const useBase = (props) => {
|
|
|
67
70
|
});
|
|
68
71
|
_transition.transition = _transitionList.join(`, `);
|
|
69
72
|
}
|
|
70
|
-
// console.log(_style, _transition)
|
|
71
|
-
const
|
|
73
|
+
// // console.log(_style, _transition)
|
|
74
|
+
const is = typeof window !== "undefined";
|
|
72
75
|
let dragProps = {};
|
|
73
76
|
let dragStyle = {};
|
|
74
|
-
if (draggable) {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
77
|
+
if (draggable && is) {
|
|
78
|
+
if (!useDrag) {
|
|
79
|
+
import("./useDrag")
|
|
80
|
+
.then(module => {
|
|
81
|
+
useDrag = module.default;
|
|
82
|
+
})
|
|
83
|
+
.catch(err => {
|
|
84
|
+
console.error("Error loading useDrag:", err);
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
if (useDrag) {
|
|
88
|
+
const drag = useDrag(dragOptions);
|
|
89
|
+
dragProps = {
|
|
90
|
+
onMouseDown: drag.onMouseDown,
|
|
91
|
+
};
|
|
92
|
+
dragStyle = {
|
|
93
|
+
transform: `translate(${drag.position.x}px, ${drag.position.y}px)`,
|
|
94
|
+
};
|
|
95
|
+
}
|
|
81
96
|
}
|
|
82
|
-
// console.log(`x`, buildWithStyles(_style),)
|
|
83
97
|
return {
|
|
84
98
|
style: {
|
|
85
99
|
...buildWithStyles(_style),
|
|
@@ -71,8 +71,8 @@ const Theme = ({ children, storageKey, forceTheme }) => {
|
|
|
71
71
|
useEffect(() => {
|
|
72
72
|
applyColorScheme((forceTheme || colorScheme || `system`));
|
|
73
73
|
}, [colorScheme]);
|
|
74
|
-
return (_jsxs(ThemeContext, { value: { colorScheme: colorScheme, resolvedScheme: resolvedTheme, setColorScheme: switchColorScheme }, children: [_jsx("script", { suppressHydrationWarning: true, dangerouslySetInnerHTML: {
|
|
75
|
-
__html:
|
|
74
|
+
return (_jsxs(ThemeContext, { value: { colorScheme: colorScheme, resolvedScheme: resolvedTheme, setColorScheme: switchColorScheme }, children: [forceTheme ? null : _jsx("script", { suppressHydrationWarning: true, dangerouslySetInnerHTML: {
|
|
75
|
+
__html: `const el = document.documentElement
|
|
76
76
|
const themes = ['light', 'dark']
|
|
77
77
|
let theme = localStorage.getItem(\`${storageKey}\`) || "system";
|
|
78
78
|
if (theme === "system") {
|
package/dist/cjs/hooks/useDB.js
CHANGED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { useEffect, useRef } from "react";
|
|
2
|
+
const useMutationObserver = (target, callback, options = { childList: true, subtree: true }) => {
|
|
3
|
+
const observerRef = useRef(null);
|
|
4
|
+
useEffect(() => {
|
|
5
|
+
if (!target)
|
|
6
|
+
return;
|
|
7
|
+
// Create a new MutationObserver and pass the callback
|
|
8
|
+
observerRef.current = new MutationObserver(callback);
|
|
9
|
+
// Start observing the target element
|
|
10
|
+
observerRef.current.observe(target, options);
|
|
11
|
+
// Cleanup function to disconnect the observer
|
|
12
|
+
return () => {
|
|
13
|
+
if (observerRef.current) {
|
|
14
|
+
observerRef.current.disconnect();
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
}, [target, callback, options]);
|
|
18
|
+
};
|
|
19
|
+
export default useMutationObserver;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
import { useEffect, useState } from 'react';
|
|
2
3
|
const useIntersectionObserver = (refs, options = {}) => {
|
|
3
4
|
const [intersectionRatio, setIntersectionRatio] = useState(refs && refs.length > 0 ? new Array(refs.length).fill(0) : []);
|
|
4
5
|
useEffect(() => {
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export type MediaType = "video" | "audio";
|
|
2
|
+
export type MediaPlayerProps = {
|
|
3
|
+
src: string;
|
|
4
|
+
type?: MediaType;
|
|
5
|
+
autoPlay?: boolean;
|
|
6
|
+
loop?: boolean;
|
|
7
|
+
controls?: boolean;
|
|
8
|
+
};
|
|
9
|
+
declare const useMediaPlayer: ({ src, type, autoPlay, loop, controls }: MediaPlayerProps) => {
|
|
10
|
+
mediaRef: import("react").RefObject<(HTMLVideoElement & HTMLAudioElement) | null>;
|
|
11
|
+
isPlaying: boolean;
|
|
12
|
+
togglePlay: () => void;
|
|
13
|
+
seek: (time: number) => void;
|
|
14
|
+
volume: number;
|
|
15
|
+
changeVolume: (newVolume: number) => void;
|
|
16
|
+
isFullscreen: boolean;
|
|
17
|
+
toggleFullscreen: () => void;
|
|
18
|
+
currentTime: number;
|
|
19
|
+
duration: number;
|
|
20
|
+
handleTimeUpdate: () => void;
|
|
21
|
+
handleLoadedMetadata: () => void;
|
|
22
|
+
mediaProps: {
|
|
23
|
+
ref: import("react").RefObject<(HTMLVideoElement & HTMLAudioElement) | null>;
|
|
24
|
+
src: string;
|
|
25
|
+
autoPlay: boolean;
|
|
26
|
+
loop: boolean;
|
|
27
|
+
controls: boolean;
|
|
28
|
+
onTimeUpdate: () => void;
|
|
29
|
+
onLoadedMetadata: () => void;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
export default useMediaPlayer;
|