earthnut 0.1.5 → 0.1.7-alpha.0

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.
Files changed (101) hide show
  1. package/705/index.cjs +7 -0
  2. package/705/index.mjs +7 -0
  3. package/BackgroundRipple/index.cjs +7 -1
  4. package/BackgroundRipple/index.mjs +7 -1
  5. package/Layout/index.cjs +7 -1
  6. package/Layout/index.mjs +6 -0
  7. package/LazyBackgroundRipple/index.cjs +7 -0
  8. package/LazyBackgroundRipple/index.mjs +7 -0
  9. package/README.md +1 -1
  10. package/components/button/button.d.ts +6 -0
  11. package/components/button/index.d.ts +6 -0
  12. package/components/index.d.ts +11 -2
  13. package/components/layout/EnLayoutContent.d.ts +6 -0
  14. package/components/layout/content.d.ts +6 -0
  15. package/components/layout/footer.d.ts +6 -0
  16. package/components/layout/generate-class.d.ts +6 -0
  17. package/components/layout/get-value.d.ts +6 -0
  18. package/components/layout/header.d.ts +6 -0
  19. package/components/layout/index.d.ts +6 -0
  20. package/components/layout/layout.d.ts +6 -0
  21. package/components/layout/sideBar.d.ts +6 -0
  22. package/components/layout/types.d.ts +6 -0
  23. package/components/marquee/MarqueeEle.d.ts +6 -0
  24. package/components/marquee/index.d.ts +6 -0
  25. package/components/marquee/type.d.ts +6 -0
  26. package/components/menu/index.d.ts +6 -0
  27. package/components/menu/menu.d.ts +6 -0
  28. package/components/ripples/Content.d.ts +8 -0
  29. package/components/ripples/LazyRippleEle.d.ts +51 -0
  30. package/components/ripples/RipplesEle.d.ts +10 -2
  31. package/components/ripples/index.d.ts +7 -0
  32. package/components/ripples/types.d.ts +6 -0
  33. package/components/ripples/useOptionUpdate.d.ts +8 -2
  34. package/customHooks/index.d.ts +7 -0
  35. package/customHooks/useAnimationFrame.d.ts +6 -0
  36. package/customHooks/useInputIsComposing.d.ts +6 -0
  37. package/customHooks/useRipples/buildBackground/create-background-color.d.ts +6 -0
  38. package/customHooks/useRipples/buildBackground/create-linear-gradient.d.ts +6 -0
  39. package/customHooks/useRipples/buildBackground/default-background/_createImageData.d.ts +6 -0
  40. package/customHooks/useRipples/buildBackground/default-background/circleDataList.d.ts +6 -0
  41. package/customHooks/useRipples/buildBackground/default-background/createCanvasElementBySize.d.ts +6 -0
  42. package/customHooks/useRipples/buildBackground/default-background/createDefault.d.ts +6 -0
  43. package/customHooks/useRipples/buildBackground/default-background/index.d.ts +6 -0
  44. package/customHooks/useRipples/buildBackground/load-image.d.ts +6 -0
  45. package/customHooks/useRipples/buildBackground/run-side.d.ts +6 -0
  46. package/customHooks/useRipples/buildBackground/type.d.ts +6 -0
  47. package/customHooks/useRipples/buildBackground/utils/bind-image.d.ts +6 -0
  48. package/customHooks/useRipples/buildBackground/utils/create-canvas-element.d.ts +6 -0
  49. package/customHooks/useRipples/buildBackground/utils/create-image-by-src.d.ts +6 -0
  50. package/customHooks/useRipples/buildBackground/utils/get-background-style.d.ts +6 -0
  51. package/customHooks/useRipples/buildBackground/utils/hide-css-background.d.ts +6 -0
  52. package/customHooks/useRipples/buildBackground/utils/restore-css-background.d.ts +6 -0
  53. package/customHooks/useRipples/callback/can-side.d.ts +6 -0
  54. package/customHooks/useRipples/callback/destroy.d.ts +6 -0
  55. package/customHooks/useRipples/callback/drop.d.ts +6 -0
  56. package/customHooks/useRipples/callback/extract-url.d.ts +6 -0
  57. package/customHooks/useRipples/callback/fade.d.ts +6 -0
  58. package/customHooks/useRipples/callback/get-new-image.d.ts +6 -0
  59. package/customHooks/useRipples/callback/reload-background.d.ts +6 -0
  60. package/customHooks/useRipples/callback/scale.d.ts +6 -0
  61. package/customHooks/useRipples/index.d.ts +8 -2
  62. package/customHooks/useRipples/init/index.d.ts +6 -0
  63. package/customHooks/useRipples/init/initEvent.d.ts +6 -0
  64. package/customHooks/useRipples/init/initShaders.d.ts +6 -0
  65. package/customHooks/useRipples/init/initTexture.d.ts +6 -0
  66. package/customHooks/useRipples/render/computeTextureBoundaries.d.ts +6 -0
  67. package/customHooks/useRipples/render/draw.d.ts +6 -0
  68. package/customHooks/useRipples/render/drawQuad.d.ts +6 -0
  69. package/customHooks/useRipples/render/dropAtPointer.d.ts +6 -0
  70. package/customHooks/useRipples/render/index.d.ts +6 -0
  71. package/customHooks/useRipples/render/swapBufferIndices.d.ts +6 -0
  72. package/customHooks/useRipples/render/update.d.ts +6 -0
  73. package/customHooks/useRipples/rippersData/defaultData.d.ts +6 -0
  74. package/customHooks/useRipples/rippersData/fadeData.d.ts +6 -0
  75. package/customHooks/useRipples/rippersData/index.d.ts +6 -0
  76. package/customHooks/useRipples/rippersData/loadConfig.d.ts +6 -0
  77. package/customHooks/useRipples/rippersData/renderData.d.ts +6 -0
  78. package/customHooks/useRipples/rippersData/useOptions.d.ts +6 -0
  79. package/customHooks/useRipples/rippersData/vertexSource.d.ts +6 -0
  80. package/customHooks/useRipples/ripple.html.d.ts +6 -0
  81. package/customHooks/useRipples/ripplesClass.d.ts +6 -0
  82. package/customHooks/useRipples/tools.d.ts +6 -0
  83. package/customHooks/useRipples/types.d.ts +8 -9
  84. package/customHooks/useRipples/use-lazy-ripple.d.ts +13 -0
  85. package/customHooks/useTimeId.d.ts +7 -1
  86. package/dog.d.ts +6 -0
  87. package/index.cjs +7 -1
  88. package/index.d.ts +8 -4
  89. package/index.mjs +7 -1
  90. package/package.json +16 -5
  91. package/useAnimationFrame/index.cjs +6 -0
  92. package/useAnimationFrame/index.mjs +6 -0
  93. package/useInputIsComposing/index.cjs +6 -0
  94. package/useInputIsComposing/index.mjs +6 -0
  95. package/useLazyRipples/index.cjs +7 -0
  96. package/useLazyRipples/index.mjs +7 -0
  97. package/useRipples/index.cjs +7 -1
  98. package/useRipples/index.mjs +7 -1
  99. package/useTimeId/index.cjs +7 -1
  100. package/useTimeId/index.mjs +7 -1
  101. package/index.js.LICENSE.txt +0 -79
@@ -1,3 +1,9 @@
1
+ /**
2
+ * @license MIT
3
+ * earthnut@customHooks/useRipples/buildBackground/utils/restore-css-background.d.ts
4
+ * Copyright (c) 2025 earthnut.dev
5
+ * 请在项目根参看详细许可证明
6
+ */
1
7
  import { Ripples } from '../../ripplesClass';
2
8
  /**
3
9
  * 恢复背景样式
@@ -1,3 +1,9 @@
1
+ /**
2
+ * @license MIT
3
+ * earthnut@customHooks/useRipples/callback/can-side.d.ts
4
+ * Copyright (c) 2025 earthnut.dev
5
+ * 请在项目根参看详细许可证明
6
+ */
1
7
  import { Ripples } from '../ripplesClass';
2
8
  /**
3
9
  * 是否能执行渐变
@@ -1,3 +1,9 @@
1
+ /**
2
+ * @license MIT
3
+ * earthnut@customHooks/useRipples/callback/destroy.d.ts
4
+ * Copyright (c) 2025 earthnut.dev
5
+ * 请在项目根参看详细许可证明
6
+ */
1
7
  import { Ripples } from '../ripplesClass';
2
8
  /** 注销 */
3
9
  export declare function destroy(this: Ripples): void;
@@ -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,2 +1,8 @@
1
+ /**
2
+ * @license MIT
3
+ * earthnut@customHooks/useRipples/callback/extract-url.d.ts
4
+ * Copyright (c) 2025 earthnut.dev
5
+ * 请在项目根参看详细许可证明
6
+ */
1
7
  /** 检测数据是否为 url 外联图像地址 */
2
8
  export declare function extractUrl(value: string): string | null;
@@ -1,3 +1,9 @@
1
+ /**
2
+ * @license MIT
3
+ * earthnut@customHooks/useRipples/callback/fade.d.ts
4
+ * Copyright (c) 2025 earthnut.dev
5
+ * 请在项目根参看详细许可证明
6
+ */
1
7
  import { Ripples } from '../ripplesClass';
2
8
  /** 两个图像间的淡入淡出 */
3
9
  export declare function fade(this: Ripples): any;
@@ -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
  /** 获取当前的背景图的地址 */
@@ -1,3 +1,9 @@
1
+ /**
2
+ * @license MIT
3
+ * earthnut@customHooks/useRipples/callback/reload-background.d.ts
4
+ * Copyright (c) 2025 earthnut.dev
5
+ * 请在项目根参看详细许可证明
6
+ */
1
7
  import { Ripples } from '../ripplesClass';
2
8
  /**
3
9
  * 重新加载背景图片
@@ -1,2 +1,8 @@
1
+ /**
2
+ * @license MIT
3
+ * earthnut@customHooks/useRipples/callback/scale.d.ts
4
+ * Copyright (c) 2025 earthnut.dev
5
+ * 请在项目根参看详细许可证明
6
+ */
1
7
  /** 缩放效果 (暂未用到) */
2
8
  export declare function scale(): void;
@@ -1,3 +1,9 @@
1
+ /**
2
+ * @license MIT
3
+ * earthnut@customHooks/useRipples/index.d.ts
4
+ * Copyright (c) 2025 earthnut.dev
5
+ * 请在项目根参看详细许可证明
6
+ */
1
7
  import { BackgroundRipplesProps, RippleImgUrl, RipplesOptions } from './types';
2
8
  import { Ripples } from './ripplesClass';
3
9
  /**
@@ -6,7 +12,7 @@ import { Ripples } from './ripplesClass';
6
12
  *
7
13
  *
8
14
  * @param canvas `usrRef` 包裹的 `HTMLCanvasElement`,用于绘制图像
9
- * @param props 初始化的
15
+ * @param option 初始化的
10
16
  * @version 0.0.3
11
17
  * @see https://earthnut.dev/use-ripples
12
18
  * @see JQuery https://github.com/sirxemic/jquery.ripples
@@ -36,5 +42,5 @@ import { Ripples } from './ripplesClass';
36
42
  * ```
37
43
  *
38
44
  */
39
- export declare function useRipples(canvas: React.RefObject<HTMLCanvasElement | null>, props?: BackgroundRipplesProps): React.RefObject<Ripples | null>;
45
+ export declare function useRipples(canvas: React.RefObject<HTMLCanvasElement | null>, option?: RipplesOptions): React.RefObject<Ripples | null>;
40
46
  export type { Ripples, BackgroundRipplesProps, RipplesOptions, RippleImgUrl };
@@ -1,3 +1,9 @@
1
+ /**
2
+ * @license MIT
3
+ * earthnut@customHooks/useRipples/init/index.d.ts
4
+ * Copyright (c) 2025 earthnut.dev
5
+ * 请在项目根参看详细许可证明
6
+ */
1
7
  import { Ripples } from '../ripplesClass';
2
8
  /**
3
9
  * 初始化 webGL
@@ -1,3 +1,9 @@
1
+ /**
2
+ * @license MIT
3
+ * earthnut@customHooks/useRipples/init/initEvent.d.ts
4
+ * Copyright (c) 2025 earthnut.dev
5
+ * 请在项目根参看详细许可证明
6
+ */
1
7
  import { Ripples } from '../ripplesClass';
2
8
  /**
3
9
  * 初始化事件
@@ -1,3 +1,9 @@
1
+ /**
2
+ * @license MIT
3
+ * earthnut@customHooks/useRipples/init/initShaders.d.ts
4
+ * Copyright (c) 2025 earthnut.dev
5
+ * 请在项目根参看详细许可证明
6
+ */
1
7
  import { Ripples } from '../ripplesClass';
2
8
  /**
3
9
  *
@@ -1,3 +1,9 @@
1
+ /**
2
+ * @license MIT
3
+ * earthnut@customHooks/useRipples/init/initTexture.d.ts
4
+ * Copyright (c) 2025 earthnut.dev
5
+ * 请在项目根参看详细许可证明
6
+ */
1
7
  import { Ripples } from '../ripplesClass';
2
8
  /**
3
9
  *
@@ -1,3 +1,9 @@
1
+ /**
2
+ * @license MIT
3
+ * earthnut@customHooks/useRipples/render/computeTextureBoundaries.d.ts
4
+ * Copyright (c) 2025 earthnut.dev
5
+ * 请在项目根参看详细许可证明
6
+ */
1
7
  import { Ripples } from '../ripplesClass';
2
8
  /** 计算纹理边界及背景图 */
3
9
  export declare function computeTextureBoundaries(this: Ripples): void;
@@ -1,3 +1,9 @@
1
+ /**
2
+ * @license MIT
3
+ * earthnut@customHooks/useRipples/render/draw.d.ts
4
+ * Copyright (c) 2025 earthnut.dev
5
+ * 请在项目根参看详细许可证明
6
+ */
1
7
  import { Ripples } from '../ripplesClass';
2
8
  /**
3
9
  *
@@ -1,3 +1,9 @@
1
+ /**
2
+ * @license MIT
3
+ * earthnut@customHooks/useRipples/render/drawQuad.d.ts
4
+ * Copyright (c) 2025 earthnut.dev
5
+ * 请在项目根参看详细许可证明
6
+ */
1
7
  import { Ripples } from '../ripplesClass';
2
8
  /**
3
9
  *
@@ -1,3 +1,9 @@
1
+ /**
2
+ * @license MIT
3
+ * earthnut@customHooks/useRipples/render/dropAtPointer.d.ts
4
+ * Copyright (c) 2025 earthnut.dev
5
+ * 请在项目根参看详细许可证明
6
+ */
1
7
  import { Ripples } from '../ripplesClass';
2
8
  /**
3
9
  *
@@ -1,3 +1,9 @@
1
+ /**
2
+ * @license MIT
3
+ * earthnut@customHooks/useRipples/render/index.d.ts
4
+ * Copyright (c) 2025 earthnut.dev
5
+ * 请在项目根参看详细许可证明
6
+ */
1
7
  import { Ripples } from '../ripplesClass';
2
8
  /**
3
9
  * 开启绘制
@@ -1,3 +1,9 @@
1
+ /**
2
+ * @license MIT
3
+ * earthnut@customHooks/useRipples/render/swapBufferIndices.d.ts
4
+ * Copyright (c) 2025 earthnut.dev
5
+ * 请在项目根参看详细许可证明
6
+ */
1
7
  import { Ripples } from '../ripplesClass';
2
8
  /**
3
9
  * swap 缓冲区索引
@@ -1,3 +1,9 @@
1
+ /**
2
+ * @license MIT
3
+ * earthnut@customHooks/useRipples/render/update.d.ts
4
+ * Copyright (c) 2025 earthnut.dev
5
+ * 请在项目根参看详细许可证明
6
+ */
1
7
  import { Ripples } from '../ripplesClass';
2
8
  /**
3
9
  * 更新
@@ -1,3 +1,9 @@
1
+ /**
2
+ * @license MIT
3
+ * earthnut@customHooks/useRipples/rippersData/defaultData.d.ts
4
+ * Copyright (c) 2025 earthnut.dev
5
+ * 请在项目根参看详细许可证明
6
+ */
1
7
  import { RipplesDefaultData } from '../types';
2
8
  /**
3
9
  * 默认值
@@ -1,3 +1,9 @@
1
+ /**
2
+ * @license MIT
3
+ * earthnut@customHooks/useRipples/rippersData/fadeData.d.ts
4
+ * Copyright (c) 2025 earthnut.dev
5
+ * 请在项目根参看详细许可证明
6
+ */
1
7
  import { Ripples } from '../ripplesClass';
2
8
  export type DrawImage = {
3
9
  /** 资源 */
@@ -1,3 +1,9 @@
1
+ /**
2
+ * @license MIT
3
+ * earthnut@customHooks/useRipples/rippersData/index.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/rippersData/loadConfig.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/rippersData/renderData.d.ts
4
+ * Copyright (c) 2025 earthnut.dev
5
+ * 请在项目根参看详细许可证明
6
+ */
1
7
  import { OriginStyle } from '../buildBackground/type';
2
8
  import { Ripples } from '../ripplesClass';
3
9
  import { Program, Textures } from '../types';
@@ -1,3 +1,9 @@
1
+ /**
2
+ * @license MIT
3
+ * earthnut@customHooks/useRipples/rippersData/useOptions.d.ts
4
+ * Copyright (c) 2025 earthnut.dev
5
+ * 请在项目根参看详细许可证明
6
+ */
1
7
  import { ImageCrossOrigin, RippleImgUrl, RipplesUseOptions } from '../types';
2
8
  /** 用户使用参数 */
3
9
  export declare class UseOptions {
@@ -1,3 +1,9 @@
1
+ /**
2
+ * @license MIT
3
+ * earthnut@customHooks/useRipples/rippersData/vertexSource.d.ts
4
+ * Copyright (c) 2025 earthnut.dev
5
+ * 请在项目根参看详细许可证明
6
+ */
1
7
  /**
2
8
  *
3
9
  */
@@ -1,3 +1,9 @@
1
+ /**
2
+ * @license MIT
3
+ * earthnut@customHooks/useRipples/ripple.html.d.ts
4
+ * Copyright (c) 2025 earthnut.dev
5
+ * 请在项目根参看详细许可证明
6
+ */
1
7
  import { Ripples } from './ripplesClass';
2
8
  import { RipplesOptions } from './types';
3
9
  /**
@@ -1,3 +1,9 @@
1
+ /**
2
+ * @license MIT
3
+ * earthnut@customHooks/useRipples/ripplesClass.d.ts
4
+ * Copyright (c) 2025 earthnut.dev
5
+ * 请在项目根参看详细许可证明
6
+ */
1
7
  import { RipplesData } from './rippersData';
2
8
  import { RipplesOptions } from './types';
3
9
  import { RipplesRenderData } from './rippersData/renderData';
@@ -1,3 +1,9 @@
1
+ /**
2
+ * @license MIT
3
+ * earthnut@customHooks/useRipples/tools.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/types.d.ts
4
+ * Copyright (c) 2025 earthnut.dev
5
+ * 请在项目根参看详细许可证明
6
+ */
1
7
  /****************************************************************************
2
8
  * @Author earthnut
3
9
  * @Email earthnut.dev@outlook.com
@@ -6,7 +12,6 @@
6
12
  * @CreateDate 周二 12/17/2024
7
13
  * @Description BackgroundRipples 的类型声明文件
8
14
  ****************************************************************************/
9
- import { CSSProperties, ReactElement } from 'react';
10
15
  export type ImageCrossOrigin = 'anonymous' | 'use-credentials' | 'no-cors';
11
16
  /**
12
17
  *
@@ -29,13 +34,7 @@ export type ImageCrossOrigin = 'anonymous' | 'use-credentials' | 'no-cors';
29
34
  * - darkMode 暗黑模式,仅用于在默认的背景图时更改默认背景图的背景色,如果使用了 `imgUrl` 配置,请执行处理色差异常
30
35
  *
31
36
  */
32
- export interface BackgroundRipplesProps {
33
- /**
34
- * 用于设定外层的样式
35
- */
36
- style?: CSSProperties;
37
- /** 子元素 */
38
- children?: ReactElement | ReactElement[];
37
+ export type BackgroundRipplesProps = React.HTMLAttributes<HTMLDivElement> & {
39
38
  /**
40
39
  * ## 可设定涟漪的参数
41
40
  *
@@ -53,7 +52,7 @@ export interface BackgroundRipplesProps {
53
52
  * - darkMode 暗黑模式,仅用于在默认的背景图时更改默认背景图的背景色,如果使用了 `imgUrl` 配置,请执行处理色差异常
54
53
  */
55
54
  option?: RipplesOptions;
56
- }
55
+ };
57
56
  /**
58
57
  *
59
58
  * WebGLProgram
@@ -0,0 +1,13 @@
1
+ /**
2
+ * @license MIT
3
+ * earthnut@customHooks/useRipples/use-lazy-ripple.d.ts
4
+ * Copyright (c) 2025 earthnut.dev
5
+ * 请在项目根参看详细许可证明
6
+ */
7
+ import { useRipples } from '.';
8
+ /** 动态加载包含的自定义的钩子 */
9
+ export declare function useLazyRipples(): {
10
+ hook: typeof useRipples | undefined;
11
+ isLoading: boolean;
12
+ error: null;
13
+ };
@@ -1,3 +1,9 @@
1
+ /**
2
+ * @license MIT
3
+ * earthnut@customHooks/useTimeId.d.ts
4
+ * Copyright (c) 2025 earthnut.dev
5
+ * 请在项目根参看详细许可证明
6
+ */
1
7
  /**
2
8
  *
3
9
  * ### 导出一个使用 `useRef` 创建的 `NodeJS.Timeout`
@@ -5,7 +11,7 @@
5
11
  * 该数值在组件卸载时会自动调用 `clearTimeout` 清理
6
12
  *
7
13
  * @version 0.0.3
8
- * @see https://earthnut.dev/use-time-id
14
+ * @see https://earthnut.dev/custom-hooks/use-time-id
9
15
  * @example
10
16
  *
11
17
  * 使用:
package/dog.d.ts CHANGED
@@ -1,2 +1,8 @@
1
+ /**
2
+ * @license MIT
3
+ * earthnut@dog.d.ts
4
+ * Copyright (c) 2025 earthnut.dev
5
+ * 请在项目根参看详细许可证明
6
+ */
1
7
  /** 开发环境执行,该方法在 env === 'production' 时通过 babel 和 webpack 过滤移除 */
2
8
  export declare const dog: import("@qqi/log").DevLog;