earthnut 0.1.6 → 0.1.7
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/components/button/button.d.ts +6 -0
- package/components/button/index.d.ts +6 -0
- package/components/image/index.d.ts +12 -0
- package/components/image/types.d.ts +12 -0
- package/components/image/useSrcChange.d.ts +11 -0
- package/components/layout/EnLayoutContent.d.ts +6 -0
- package/components/layout/content.d.ts +6 -0
- package/components/layout/footer.d.ts +6 -0
- package/components/layout/generate-class.d.ts +6 -0
- package/components/layout/get-value.d.ts +6 -0
- package/components/layout/header.d.ts +6 -0
- package/components/layout/index.d.ts +6 -0
- package/components/layout/layout.d.ts +6 -0
- package/components/layout/sideBar.d.ts +6 -0
- package/components/layout/types.d.ts +6 -0
- package/components/marquee/MarqueeEle.d.ts +6 -0
- package/components/marquee/index.d.ts +6 -0
- package/components/marquee/type.d.ts +6 -0
- package/components/menu/index.d.ts +6 -0
- package/components/menu/menu.d.ts +6 -0
- package/components/ripples/Content.d.ts +8 -0
- package/components/ripples/LazyRippleEle.d.ts +51 -0
- package/components/ripples/RipplesEle.d.ts +7 -1
- package/components/ripples/index.d.ts +7 -0
- package/components/ripples/types.d.ts +7 -1
- package/components/ripples/useOptionUpdate.d.ts +7 -1
- package/customHooks/useAnimationFrame.d.ts +6 -0
- package/customHooks/useInputIsComposing.d.ts +6 -0
- package/customHooks/useRipples/buildBackground/create-background-color.d.ts +6 -0
- package/customHooks/useRipples/buildBackground/create-linear-gradient.d.ts +6 -0
- package/customHooks/useRipples/buildBackground/default-background/_createImageData.d.ts +6 -0
- package/customHooks/useRipples/buildBackground/default-background/circleDataList.d.ts +6 -0
- package/customHooks/useRipples/buildBackground/default-background/createCanvasElementBySize.d.ts +6 -0
- package/customHooks/useRipples/buildBackground/default-background/createDefault.d.ts +6 -0
- package/customHooks/useRipples/buildBackground/default-background/index.d.ts +6 -0
- package/customHooks/useRipples/buildBackground/load-image.d.ts +6 -0
- package/customHooks/useRipples/buildBackground/run-side.d.ts +6 -0
- package/customHooks/useRipples/buildBackground/type.d.ts +6 -0
- package/customHooks/useRipples/buildBackground/utils/bind-image.d.ts +6 -0
- package/customHooks/useRipples/buildBackground/utils/create-canvas-element.d.ts +7 -1
- package/customHooks/useRipples/buildBackground/utils/create-image-by-src.d.ts +6 -0
- package/customHooks/useRipples/buildBackground/utils/get-background-style.d.ts +6 -0
- package/customHooks/useRipples/buildBackground/utils/hide-css-background.d.ts +6 -0
- package/customHooks/useRipples/buildBackground/utils/restore-css-background.d.ts +6 -0
- package/customHooks/useRipples/callback/can-side.d.ts +6 -0
- package/customHooks/useRipples/callback/destroy.d.ts +6 -0
- package/customHooks/useRipples/callback/drop.d.ts +6 -0
- package/customHooks/useRipples/callback/extract-url.d.ts +6 -0
- package/customHooks/useRipples/callback/fade.d.ts +6 -0
- package/customHooks/useRipples/callback/get-new-image.d.ts +6 -0
- package/customHooks/useRipples/callback/reload-background.d.ts +6 -0
- package/customHooks/useRipples/callback/scale.d.ts +6 -0
- package/customHooks/useRipples/index.d.ts +6 -0
- package/customHooks/useRipples/init/index.d.ts +6 -0
- package/customHooks/useRipples/init/initEvent.d.ts +6 -0
- package/customHooks/useRipples/init/initShaders.d.ts +6 -0
- package/customHooks/useRipples/init/initTexture.d.ts +6 -0
- package/customHooks/useRipples/render/computeTextureBoundaries.d.ts +6 -0
- package/customHooks/useRipples/render/draw.d.ts +6 -0
- package/customHooks/useRipples/render/drawQuad.d.ts +6 -0
- package/customHooks/useRipples/render/dropAtPointer.d.ts +6 -0
- package/customHooks/useRipples/render/index.d.ts +6 -0
- package/customHooks/useRipples/render/swapBufferIndices.d.ts +6 -0
- package/customHooks/useRipples/render/update.d.ts +6 -0
- package/customHooks/useRipples/rippersData/defaultData.d.ts +6 -0
- package/customHooks/useRipples/rippersData/fadeData.d.ts +6 -0
- package/customHooks/useRipples/rippersData/index.d.ts +6 -0
- package/customHooks/useRipples/rippersData/loadConfig.d.ts +6 -0
- package/customHooks/useRipples/rippersData/renderData.d.ts +6 -0
- package/customHooks/useRipples/rippersData/useOptions.d.ts +6 -0
- package/customHooks/useRipples/rippersData/vertexSource.d.ts +6 -0
- package/customHooks/useRipples/ripple.html.d.ts +6 -0
- package/customHooks/useRipples/ripplesClass.d.ts +6 -0
- package/customHooks/useRipples/tools.d.ts +6 -0
- package/customHooks/useRipples/types.d.ts +6 -0
- package/customHooks/useRipples/use-lazy-ripple.d.ts +14 -0
- package/customHooks/useTimeId.d.ts +6 -0
- package/index.cjs +7 -1
- package/index.d.ts +15 -4
- package/index.mjs +7 -1
- package/package.json +3 -42
- package/BackgroundRipple/index.cjs +0 -1
- package/BackgroundRipple/index.mjs +0 -1
- package/Layout/index.cjs +0 -1
- package/Layout/index.mjs +0 -1
- package/components/index.d.ts +0 -3
- package/customHooks/index.d.ts +0 -5
- package/dog.d.ts +0 -2
- package/index.js.LICENSE.txt +0 -79
- package/useAnimationFrame/index.cjs +0 -1
- package/useAnimationFrame/index.mjs +0 -1
- package/useInputIsComposing/index.cjs +0 -1
- package/useInputIsComposing/index.mjs +0 -1
- package/useRipples/index.cjs +0 -1
- package/useRipples/index.mjs +0 -1
- package/useTimeId/index.cjs +0 -1
- package/useTimeId/index.mjs +0 -1
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license MIT
|
|
3
|
+
* earthnut@components/image/index.d.ts
|
|
4
|
+
* Copyright (c) 2025 earthnut.dev
|
|
5
|
+
* 请在项目根参看详细许可证明
|
|
6
|
+
*/
|
|
7
|
+
import React from 'react';
|
|
8
|
+
import { EnImageProps } from './types';
|
|
9
|
+
/** 简单的图像 */
|
|
10
|
+
declare const Image: React.ForwardRefExoticComponent<Omit<EnImageProps, "ref"> & React.RefAttributes<HTMLImageElement>>;
|
|
11
|
+
export { Image };
|
|
12
|
+
export type { EnImageProps };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license MIT
|
|
3
|
+
* earthnut@components/image/types.d.ts
|
|
4
|
+
* Copyright (c) 2025 earthnut.dev
|
|
5
|
+
* 请在项目根参看详细许可证明
|
|
6
|
+
*/
|
|
7
|
+
export type EnImageProps = {
|
|
8
|
+
/** 下载错误时展示的图像 */
|
|
9
|
+
errorSrc?: string;
|
|
10
|
+
/** 加载中的图像 */
|
|
11
|
+
loadingSrc?: string;
|
|
12
|
+
} & React.DetailedHTMLProps<React.ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license MIT
|
|
3
|
+
* earthnut@components/image/useSrcChange.d.ts
|
|
4
|
+
* Copyright (c) 2025 earthnut.dev
|
|
5
|
+
* 请在项目根参看详细许可证明
|
|
6
|
+
*/
|
|
7
|
+
/** 当地址触发变更 */
|
|
8
|
+
export declare function useSrcChange(src: string, fallbackSrc?: string): {
|
|
9
|
+
resultSrc: string;
|
|
10
|
+
loadComplete: number;
|
|
11
|
+
};
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license MIT
|
|
3
|
+
* earthnut@components/layout/EnLayoutContent.d.ts
|
|
4
|
+
* Copyright (c) 2025 earthnut.dev
|
|
5
|
+
* 请在项目根参看详细许可证明
|
|
6
|
+
*/
|
|
1
7
|
import { EnLayoutContentProps } from './types';
|
|
2
8
|
/** 元始的外壳 */
|
|
3
9
|
export declare const EnLayoutContent: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, EnLayoutContentProps>> & string;
|
|
@@ -1,2 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license MIT
|
|
3
|
+
* earthnut@components/layout/index.d.ts
|
|
4
|
+
* Copyright (c) 2025 earthnut.dev
|
|
5
|
+
* 请在项目根参看详细许可证明
|
|
6
|
+
*/
|
|
1
7
|
export { Layout, Layout as EnLayout, LayoutContent, LayoutContent as EnLayoutContent, LayoutHeader, LayoutHeader as EnLayoutHeader, LayoutFooter, LayoutFooter as EnLayoutFooter, LayoutSideBar, LayoutSideBar as EnLayoutSideBar, } from './layout';
|
|
2
8
|
export type { LayoutProps, LayoutSideBarProps, LayoutHeaderProps, LayoutFooterProps, } from './types';
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license MIT
|
|
3
|
+
* earthnut@components/layout/layout.d.ts
|
|
4
|
+
* Copyright (c) 2025 earthnut.dev
|
|
5
|
+
* 请在项目根参看详细许可证明
|
|
6
|
+
*/
|
|
1
7
|
import * as React from 'react';
|
|
2
8
|
import { InternalValueH as LayoutHeader } from './header';
|
|
3
9
|
import { InternalValueS as LayoutSideBar } from './sideBar';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license MIT
|
|
3
|
+
* earthnut@components/ripples/Content.d.ts
|
|
4
|
+
* Copyright (c) 2025 earthnut.dev
|
|
5
|
+
* 请在项目根参看详细许可证明
|
|
6
|
+
*/
|
|
7
|
+
/** 内容组件 */
|
|
8
|
+
export declare const Content: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license MIT
|
|
3
|
+
* earthnut@components/ripples/LazyRippleEle.d.ts
|
|
4
|
+
* Copyright (c) 2025 earthnut.dev
|
|
5
|
+
* 请在项目根参看详细许可证明
|
|
6
|
+
*/
|
|
7
|
+
/****************************************************************************
|
|
8
|
+
* @Author earthnut
|
|
9
|
+
* @Email earthnut.dev@outlook.com
|
|
10
|
+
* @ProjectName website
|
|
11
|
+
* @FileName index.tsx
|
|
12
|
+
* @CreateDate 周四 12/12/2024
|
|
13
|
+
* @Description 涟漪
|
|
14
|
+
****************************************************************************/
|
|
15
|
+
import { RipplesOptions } from '../../customHooks/useRipples/types';
|
|
16
|
+
import { RippleEle } from './types';
|
|
17
|
+
import * as React from 'react';
|
|
18
|
+
/**
|
|
19
|
+
*
|
|
20
|
+
* ### 一个 ripple 背景组件
|
|
21
|
+
*
|
|
22
|
+
*
|
|
23
|
+
* *需要为该组件或父组件设置背景,否则即便的渲染了,效果不明显*
|
|
24
|
+
*
|
|
25
|
+
* 参数 props 属性:
|
|
26
|
+
* - children 内嵌的 ReactNode
|
|
27
|
+
* - style 更改显示的样式
|
|
28
|
+
* - option 初始化 ripples 的原始数据
|
|
29
|
+
* @param props 使用参数
|
|
30
|
+
* @version 0.0.1
|
|
31
|
+
* @see https://earthnut.dev/earthnut/lazy-background-ripple
|
|
32
|
+
* @example
|
|
33
|
+
* 使用:
|
|
34
|
+
*
|
|
35
|
+
* ```ts
|
|
36
|
+
* import { BackgroundRipple } from 'earthnut/BackgroundRipple';
|
|
37
|
+
* // 也可以全量导入
|
|
38
|
+
* // import { BackgroundRipple } from 'earthnut';
|
|
39
|
+
* ...
|
|
40
|
+
* const animationFrameId = useAnimationFrame();
|
|
41
|
+
*
|
|
42
|
+
* return <BackgroundRipple>
|
|
43
|
+
* ...
|
|
44
|
+
* </BackgroundRipple>
|
|
45
|
+
* ```
|
|
46
|
+
*
|
|
47
|
+
*/
|
|
48
|
+
declare const LazyBackgroundRipple: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & {
|
|
49
|
+
option?: RipplesOptions;
|
|
50
|
+
} & React.RefAttributes<RippleEle>>;
|
|
51
|
+
export { LazyBackgroundRipple };
|
|
@@ -1,6 +1,12 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* @license MIT
|
|
3
|
+
* earthnut@components/ripples/RipplesEle.d.ts
|
|
4
|
+
* Copyright (c) 2025 earthnut.dev
|
|
5
|
+
* 请在项目根参看详细许可证明
|
|
6
|
+
*/
|
|
2
7
|
import { RipplesOptions } from '../../customHooks/useRipples/types';
|
|
3
8
|
import { RippleEle } from './types';
|
|
9
|
+
import * as React from 'react';
|
|
4
10
|
/**
|
|
5
11
|
*
|
|
6
12
|
* ### 一个 ripple 背景组件
|
|
@@ -1,4 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license MIT
|
|
3
|
+
* earthnut@components/ripples/index.d.ts
|
|
4
|
+
* Copyright (c) 2025 earthnut.dev
|
|
5
|
+
* 请在项目根参看详细许可证明
|
|
6
|
+
*/
|
|
1
7
|
import { RippleEle } from './types';
|
|
2
8
|
export { BackgroundRipple } from './RipplesEle';
|
|
9
|
+
export { LazyBackgroundRipple } from './LazyRippleEle';
|
|
3
10
|
export type { Ripples, BackgroundRipplesProps, RipplesOptions, RippleImgUrl, } from '../../customHooks/useRipples/index';
|
|
4
11
|
export type { RippleEle };
|
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* @license MIT
|
|
3
|
+
* earthnut@components/ripples/types.d.ts
|
|
4
|
+
* Copyright (c) 2025 earthnut.dev
|
|
5
|
+
* 请在项目根参看详细许可证明
|
|
6
|
+
*/
|
|
7
|
+
import { RipplesOptions } from '../../customHooks/useRipples';
|
|
2
8
|
export type RippleEle = {
|
|
3
9
|
/** 切换当前的状态 */
|
|
4
10
|
toggleState(): void;
|
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* @license MIT
|
|
3
|
+
* earthnut@components/ripples/useOptionUpdate.d.ts
|
|
4
|
+
* Copyright (c) 2025 earthnut.dev
|
|
5
|
+
* 请在项目根参看详细许可证明
|
|
6
|
+
*/
|
|
7
|
+
import { Ripples, RipplesOptions } from '../../customHooks/useRipples/index';
|
|
2
8
|
/**
|
|
3
9
|
* 更新参数数据
|
|
4
10
|
*/
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license MIT
|
|
3
|
+
* earthnut@customHooks/useAnimationFrame.d.ts
|
|
4
|
+
* Copyright (c) 2025 earthnut.dev
|
|
5
|
+
* 请在项目根参看详细许可证明
|
|
6
|
+
*/
|
|
1
7
|
/****************************************************************************
|
|
2
8
|
* @Author earthnut
|
|
3
9
|
* @Email earthnut.dev@outlook.com
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license MIT
|
|
3
|
+
* earthnut@customHooks/useInputIsComposing.d.ts
|
|
4
|
+
* Copyright (c) 2025 earthnut.dev
|
|
5
|
+
* 请在项目根参看详细许可证明
|
|
6
|
+
*/
|
|
1
7
|
/****************************************************************************
|
|
2
8
|
* @Author earthnut
|
|
3
9
|
* @Email earthnut.dev@outlook.com
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license MIT
|
|
3
|
+
* earthnut@customHooks/useRipples/buildBackground/create-background-color.d.ts
|
|
4
|
+
* Copyright (c) 2025 earthnut.dev
|
|
5
|
+
* 请在项目根参看详细许可证明
|
|
6
|
+
*/
|
|
1
7
|
import { Ripples } from '../ripplesClass';
|
|
2
8
|
/** 构建背景色 */
|
|
3
9
|
export declare function createBackgroundColor(this: Ripples): void;
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license MIT
|
|
3
|
+
* earthnut@customHooks/useRipples/buildBackground/create-linear-gradient.d.ts
|
|
4
|
+
* Copyright (c) 2025 earthnut.dev
|
|
5
|
+
* 请在项目根参看详细许可证明
|
|
6
|
+
*/
|
|
1
7
|
import { Ripples } from '../ripplesClass';
|
|
2
8
|
/** 构建渐变背景色图 */
|
|
3
9
|
export declare function createLinearGradient(this: Ripples): void;
|
package/customHooks/useRipples/buildBackground/default-background/createCanvasElementBySize.d.ts
CHANGED
|
@@ -1,2 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license MIT
|
|
3
|
+
* earthnut@customHooks/useRipples/buildBackground/default-background/createCanvasElementBySize.d.ts
|
|
4
|
+
* Copyright (c) 2025 earthnut.dev
|
|
5
|
+
* 请在项目根参看详细许可证明
|
|
6
|
+
*/
|
|
1
7
|
/** 通过尺寸创建一个默认图 */
|
|
2
8
|
export declare function createCanvasElementBySize(width: number, height: number): HTMLCanvasElement;
|
|
@@ -1,2 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license MIT
|
|
3
|
+
* earthnut@customHooks/useRipples/buildBackground/default-background/createDefault.d.ts
|
|
4
|
+
* Copyright (c) 2025 earthnut.dev
|
|
5
|
+
* 请在项目根参看详细许可证明
|
|
6
|
+
*/
|
|
1
7
|
/** 构建默认的背景图 */
|
|
2
8
|
export declare function createDefault(width: number, height: number): ImageData;
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license MIT
|
|
3
|
+
* earthnut@customHooks/useRipples/buildBackground/utils/bind-image.d.ts
|
|
4
|
+
* Copyright (c) 2025 earthnut.dev
|
|
5
|
+
* 请在项目根参看详细许可证明
|
|
6
|
+
*/
|
|
1
7
|
import { Ripples } from '../../ripplesClass';
|
|
2
8
|
import { DrawImage } from '../../rippersData/fadeData';
|
|
3
9
|
/** 绑定图片 */
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* @license MIT
|
|
3
|
+
* earthnut@customHooks/useRipples/buildBackground/utils/create-canvas-element.d.ts
|
|
4
|
+
* Copyright (c) 2025 earthnut.dev
|
|
5
|
+
* 请在项目根参看详细许可证明
|
|
6
|
+
*/
|
|
7
|
+
import { Ripples } from '../../../../components/ripples';
|
|
2
8
|
/** 根据给出的 html 数据构建一个 canvas */
|
|
3
9
|
export declare function createCanvasElement(this: Ripples, img: CanvasImageSource): HTMLCanvasElement;
|
|
@@ -1,2 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license MIT
|
|
3
|
+
* earthnut@customHooks/useRipples/buildBackground/utils/create-image-by-src.d.ts
|
|
4
|
+
* Copyright (c) 2025 earthnut.dev
|
|
5
|
+
* 请在项目根参看详细许可证明
|
|
6
|
+
*/
|
|
1
7
|
/** 根据给出的 src 获取一个 img 对象 */
|
|
2
8
|
export declare function createImageBySrc(src: string, width: number, height: number): HTMLImageElement;
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license MIT
|
|
3
|
+
* earthnut@customHooks/useRipples/buildBackground/utils/get-background-style.d.ts
|
|
4
|
+
* Copyright (c) 2025 earthnut.dev
|
|
5
|
+
* 请在项目根参看详细许可证明
|
|
6
|
+
*/
|
|
1
7
|
import { OriginStyle } from '../type';
|
|
2
8
|
/** 获取元素的样式 */
|
|
3
9
|
export declare function getBackgroundStyles(element: HTMLElement): OriginStyle;
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license MIT
|
|
3
|
+
* earthnut@customHooks/useRipples/callback/drop.d.ts
|
|
4
|
+
* Copyright (c) 2025 earthnut.dev
|
|
5
|
+
* 请在项目根参看详细许可证明
|
|
6
|
+
*/
|
|
1
7
|
import { Ripples } from '../ripplesClass';
|
|
2
8
|
/** 触发滴落效果 */
|
|
3
9
|
export declare function drop(this: Ripples, x: number, y: number, radius: number, strength: number): void;
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license MIT
|
|
3
|
+
* earthnut@customHooks/useRipples/callback/get-new-image.d.ts
|
|
4
|
+
* Copyright (c) 2025 earthnut.dev
|
|
5
|
+
* 请在项目根参看详细许可证明
|
|
6
|
+
*/
|
|
1
7
|
import { OriginStyle } from '../buildBackground/type';
|
|
2
8
|
import { UseOptions } from '../rippersData/useOptions';
|
|
3
9
|
/** 获取当前的背景图的地址 */
|