@funhub/platform 0.1.133 → 0.1.135

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 (193) hide show
  1. package/dist/biz.d.mts +12 -12
  2. package/dist/cli/init/create-client.mjs +2 -0
  3. package/dist/cli/init/create-sdk.mjs +2 -0
  4. package/dist/cli/init/shared/command.mjs +2 -0
  5. package/dist/cli/init/shared/constants.mjs +2 -0
  6. package/dist/cli/init/shared/create-project.mjs +3 -0
  7. package/dist/cli/init/shared/file.mjs +2 -0
  8. package/dist/cli/init/shared/package-manager.mjs +2 -0
  9. package/dist/cli/init/shared/prompts.mjs +2 -0
  10. package/dist/cli/init/shared/template.mjs +2 -0
  11. package/dist/cli.d.mts +2 -0
  12. package/dist/cli.mjs +4 -0
  13. package/dist/components/biz/business/banner/index.d.mts +1 -1
  14. package/dist/components/biz/business/banner/variants/basic-banner/index.d.mts +2 -2
  15. package/dist/components/biz/business/banner/variants/basic-banner/inspector-schema.d.mts +25 -3
  16. package/dist/components/biz/business/banner/variants/basic-banner/inspector-schema.mjs +1 -1
  17. package/dist/components/biz/business/banner/variants/basic-banner/material.d.mts +20 -1
  18. package/dist/components/biz/business/banner/variants/basic-banner/material.mjs +1 -1
  19. package/dist/components/biz/business/banner/variants/basic-banner/runtime/client.d.mts +2 -1
  20. package/dist/components/biz/business/banner-carousel/material.d.mts +23 -1
  21. package/dist/components/biz/business/banner-carousel/material.mjs +1 -1
  22. package/dist/components/biz/business/banner-carousel/schema.d.mts +28 -0
  23. package/dist/components/biz/business/banner-carousel/schema.mjs +1 -1
  24. package/dist/components/biz/business/banner-carousel/server.d.mts +18 -0
  25. package/dist/components/biz/business/channel-list/client.d.mts +8 -0
  26. package/dist/components/biz/business/channel-list/material.d.mts +19 -1
  27. package/dist/components/biz/business/channel-list/material.mjs +1 -1
  28. package/dist/components/biz/business/channel-list/schema.d.mts +30 -0
  29. package/dist/components/biz/business/channel-list/schema.mjs +1 -1
  30. package/dist/components/biz/business/detail/shared/registry.d.mts +75 -2
  31. package/dist/components/biz/business/detail/shared/registry.mjs +1 -1
  32. package/dist/components/biz/business/detail/video-detail-actions/client.d.mts +12 -2
  33. package/dist/components/biz/business/detail/video-detail-actions/index.d.mts +4 -4
  34. package/dist/components/biz/business/detail/video-detail-actions/material.d.mts +13 -1
  35. package/dist/components/biz/business/detail/video-detail-actions/material.mjs +1 -1
  36. package/dist/components/biz/business/detail/video-detail-actions/schema.d.mts +20 -1
  37. package/dist/components/biz/business/detail/video-detail-actions/schema.mjs +1 -1
  38. package/dist/components/biz/business/detail/video-detail-actions/server.d.mts +15 -2
  39. package/dist/components/biz/business/detail/video-detail-info/client.d.mts +14 -2
  40. package/dist/components/biz/business/detail/video-detail-info/index.d.mts +4 -4
  41. package/dist/components/biz/business/detail/video-detail-info/material.d.mts +16 -1
  42. package/dist/components/biz/business/detail/video-detail-info/material.mjs +1 -1
  43. package/dist/components/biz/business/detail/video-detail-info/schema.d.mts +22 -1
  44. package/dist/components/biz/business/detail/video-detail-info/schema.mjs +1 -1
  45. package/dist/components/biz/business/detail/video-detail-info/server.d.mts +15 -2
  46. package/dist/components/biz/business/detail/video-detail-info-title-tags-episodes/client.d.mts +14 -2
  47. package/dist/components/biz/business/detail/video-detail-info-title-tags-episodes/index.d.mts +4 -4
  48. package/dist/components/biz/business/detail/video-detail-info-title-tags-episodes/material.d.mts +16 -1
  49. package/dist/components/biz/business/detail/video-detail-info-title-tags-episodes/material.mjs +1 -1
  50. package/dist/components/biz/business/detail/video-detail-info-title-tags-episodes/schema.d.mts +22 -1
  51. package/dist/components/biz/business/detail/video-detail-info-title-tags-episodes/schema.mjs +1 -1
  52. package/dist/components/biz/business/detail/video-detail-info-title-tags-episodes/server.d.mts +15 -2
  53. package/dist/components/biz/business/detail/video-detail-player/client.d.mts +13 -2
  54. package/dist/components/biz/business/detail/video-detail-player/index.d.mts +4 -4
  55. package/dist/components/biz/business/detail/video-detail-player/material.d.mts +13 -1
  56. package/dist/components/biz/business/detail/video-detail-player/material.mjs +1 -1
  57. package/dist/components/biz/business/detail/video-detail-player/schema.d.mts +22 -1
  58. package/dist/components/biz/business/detail/video-detail-player/schema.mjs +1 -1
  59. package/dist/components/biz/business/detail/video-detail-player/server.d.mts +10 -2
  60. package/dist/components/biz/business/detail/video-detail-recommend/client.d.mts +22 -2
  61. package/dist/components/biz/business/detail/video-detail-recommend/index.d.mts +4 -4
  62. package/dist/components/biz/business/detail/video-detail-recommend/material.d.mts +40 -1
  63. package/dist/components/biz/business/detail/video-detail-recommend/material.mjs +1 -1
  64. package/dist/components/biz/business/detail/video-detail-recommend/schema.d.mts +42 -1
  65. package/dist/components/biz/business/detail/video-detail-recommend/schema.mjs +1 -1
  66. package/dist/components/biz/business/detail/video-detail-recommend/server.d.mts +10 -2
  67. package/dist/components/biz/business/floating-ball/index.d.mts +2 -2
  68. package/dist/components/biz/business/floating-ball/material.d.mts +16 -1
  69. package/dist/components/biz/business/floating-ball/material.mjs +1 -1
  70. package/dist/components/biz/business/floating-ball/schema.d.mts +16 -3
  71. package/dist/components/biz/business/floating-ball/schema.mjs +1 -1
  72. package/dist/components/biz/business/header-search/header-avatar-icon/client.d.mts +13 -2
  73. package/dist/components/biz/business/header-search/header-avatar-icon/index.d.mts +4 -4
  74. package/dist/components/biz/business/header-search/header-avatar-icon/material.d.mts +13 -1
  75. package/dist/components/biz/business/header-search/header-avatar-icon/material.mjs +1 -1
  76. package/dist/components/biz/business/header-search/header-avatar-icon/schema.d.mts +18 -1
  77. package/dist/components/biz/business/header-search/header-avatar-icon/schema.mjs +1 -1
  78. package/dist/components/biz/business/header-search/header-avatar-icon/server.d.mts +10 -2
  79. package/dist/components/biz/business/header-search/header-avatar-logo-search/client.d.mts +11 -2
  80. package/dist/components/biz/business/header-search/header-avatar-logo-search/index.d.mts +4 -4
  81. package/dist/components/biz/business/header-search/header-avatar-logo-search/material.d.mts +16 -1
  82. package/dist/components/biz/business/header-search/header-avatar-logo-search/material.mjs +1 -1
  83. package/dist/components/biz/business/header-search/header-avatar-logo-search/schema.d.mts +22 -1
  84. package/dist/components/biz/business/header-search/header-avatar-logo-search/schema.mjs +1 -1
  85. package/dist/components/biz/business/header-search/header-avatar-logo-search/server.d.mts +10 -2
  86. package/dist/components/biz/business/header-search/header-avatar-logo-search-icon/client.d.mts +11 -2
  87. package/dist/components/biz/business/header-search/header-avatar-logo-search-icon/index.d.mts +4 -4
  88. package/dist/components/biz/business/header-search/header-avatar-logo-search-icon/material.d.mts +16 -1
  89. package/dist/components/biz/business/header-search/header-avatar-logo-search-icon/material.mjs +1 -1
  90. package/dist/components/biz/business/header-search/header-avatar-logo-search-icon/schema.d.mts +20 -1
  91. package/dist/components/biz/business/header-search/header-avatar-logo-search-icon/schema.mjs +1 -1
  92. package/dist/components/biz/business/header-search/header-avatar-logo-search-icon/server.d.mts +10 -2
  93. package/dist/components/biz/business/header-search/header-logo-search/client.d.mts +13 -2
  94. package/dist/components/biz/business/header-search/header-logo-search/index.d.mts +4 -4
  95. package/dist/components/biz/business/header-search/header-logo-search/material.d.mts +16 -1
  96. package/dist/components/biz/business/header-search/header-logo-search/material.mjs +1 -1
  97. package/dist/components/biz/business/header-search/header-logo-search/schema.d.mts +22 -1
  98. package/dist/components/biz/business/header-search/header-logo-search/schema.mjs +1 -1
  99. package/dist/components/biz/business/header-search/header-logo-search/server.d.mts +10 -2
  100. package/dist/components/biz/business/header-search/header-search/client.d.mts +13 -2
  101. package/dist/components/biz/business/header-search/header-search/index.d.mts +4 -4
  102. package/dist/components/biz/business/header-search/header-search/material.d.mts +13 -1
  103. package/dist/components/biz/business/header-search/header-search/material.mjs +1 -1
  104. package/dist/components/biz/business/header-search/header-search/schema.d.mts +18 -1
  105. package/dist/components/biz/business/header-search/header-search/schema.mjs +1 -1
  106. package/dist/components/biz/business/header-search/header-search/server.d.mts +10 -2
  107. package/dist/components/biz/business/home-recommend/home-recommend-grid/client.d.mts +2 -1
  108. package/dist/components/biz/business/home-recommend/home-recommend-grid/index.d.mts +2 -2
  109. package/dist/components/biz/business/home-recommend/home-recommend-grid/inspector-schema.d.mts +52 -3
  110. package/dist/components/biz/business/home-recommend/home-recommend-grid/inspector-schema.mjs +1 -1
  111. package/dist/components/biz/business/home-recommend/home-recommend-grid/material.d.mts +43 -1
  112. package/dist/components/biz/business/home-recommend/home-recommend-grid/material.mjs +1 -1
  113. package/dist/components/biz/business/home-recommend/home-recommend-waterfall/client.d.mts +2 -1
  114. package/dist/components/biz/business/home-recommend/home-recommend-waterfall/index.d.mts +2 -2
  115. package/dist/components/biz/business/home-recommend/home-recommend-waterfall/inspector-schema.d.mts +47 -3
  116. package/dist/components/biz/business/home-recommend/home-recommend-waterfall/inspector-schema.mjs +1 -1
  117. package/dist/components/biz/business/home-recommend/home-recommend-waterfall/material.d.mts +40 -1
  118. package/dist/components/biz/business/home-recommend/home-recommend-waterfall/material.mjs +1 -1
  119. package/dist/components/biz/business/home-recommend/index.d.mts +2 -2
  120. package/dist/components/biz/business/image-text-recommend/client.d.mts +2 -1
  121. package/dist/components/biz/business/image-text-recommend/index.d.mts +2 -2
  122. package/dist/components/biz/business/image-text-recommend/material.d.mts +35 -1
  123. package/dist/components/biz/business/image-text-recommend/material.mjs +1 -1
  124. package/dist/components/biz/business/image-text-recommend/schema.d.mts +31 -1
  125. package/dist/components/biz/business/image-text-recommend/schema.mjs +1 -1
  126. package/dist/components/biz/business/index.d.mts +11 -11
  127. package/dist/components/biz/business/large-feature-grid/material.d.mts +9 -1
  128. package/dist/components/biz/business/large-feature-grid/material.mjs +1 -1
  129. package/dist/components/biz/business/large-feature-grid/schema.mjs +1 -1
  130. package/dist/components/biz/business/marquee/client.d.mts +2 -1
  131. package/dist/components/biz/business/marquee/index.d.mts +2 -2
  132. package/dist/components/biz/business/marquee/material.d.mts +34 -1
  133. package/dist/components/biz/business/marquee/material.mjs +1 -1
  134. package/dist/components/biz/business/marquee/schema.d.mts +30 -1
  135. package/dist/components/biz/business/marquee/schema.mjs +1 -1
  136. package/dist/components/biz/business/profile/index.d.mts +1 -1
  137. package/dist/components/biz/business/profile/profile-header/material.d.mts +31 -2
  138. package/dist/components/biz/business/profile/profile-header/material.mjs +1 -1
  139. package/dist/components/biz/business/profile/profile-header/schema.d.mts +11 -3
  140. package/dist/components/biz/business/profile/profile-header/schema.mjs +1 -1
  141. package/dist/components/biz/business/profile/profile-main/index.d.mts +1 -1
  142. package/dist/components/biz/business/profile/profile-main/material.d.mts +13 -1
  143. package/dist/components/biz/business/profile/profile-main/material.mjs +1 -1
  144. package/dist/components/biz/business/profile/profile-main/schema.d.mts +11 -3
  145. package/dist/components/biz/business/profile/profile-main/schema.mjs +1 -1
  146. package/dist/components/biz/business/profile/profile-main/tabs/collect-tab/client.d.mts +2 -1
  147. package/dist/components/biz/business/profile/profile-main/tabs/history-tab/client.d.mts +2 -1
  148. package/dist/components/biz/business/profile/profile-main/tabs/like-tab/client.d.mts +2 -1
  149. package/dist/components/biz/business/profile/profile-main/tabs/publish-tab/client.d.mts +2 -1
  150. package/dist/components/biz/business/search-history/client.d.mts +2 -1
  151. package/dist/components/biz/business/search-history/index.d.mts +2 -2
  152. package/dist/components/biz/business/search-history/material.d.mts +16 -1
  153. package/dist/components/biz/business/search-history/material.mjs +1 -1
  154. package/dist/components/biz/business/search-history/schema.d.mts +13 -1
  155. package/dist/components/biz/business/search-history/schema.mjs +1 -1
  156. package/dist/components/biz/business/search-input/index.d.mts +2 -2
  157. package/dist/components/biz/business/search-input/material.d.mts +13 -1
  158. package/dist/components/biz/business/search-input/material.mjs +1 -1
  159. package/dist/components/biz/business/search-input/schema.d.mts +11 -3
  160. package/dist/components/biz/business/search-input/schema.mjs +1 -1
  161. package/dist/components/biz/business/shortcut-grid/client.d.mts +12 -0
  162. package/dist/components/biz/business/shortcut-grid/material.d.mts +22 -1
  163. package/dist/components/biz/business/shortcut-grid/material.mjs +1 -1
  164. package/dist/components/biz/business/shortcut-grid/schema.d.mts +26 -0
  165. package/dist/components/biz/business/shortcut-grid/schema.mjs +1 -1
  166. package/dist/components/biz/business/shortcut-grid/server.d.mts +11 -0
  167. package/dist/components/biz/business/tab-bar/index.d.mts +2 -2
  168. package/dist/components/biz/business/tab-bar/material.d.mts +13 -1
  169. package/dist/components/biz/business/tab-bar/material.mjs +1 -1
  170. package/dist/components/biz/business/tab-bar/schema.d.mts +11 -3
  171. package/dist/components/biz/business/tab-bar/schema.mjs +1 -1
  172. package/dist/components/biz/business/text-recommend/client.d.mts +2 -1
  173. package/dist/components/biz/business/text-recommend/index.d.mts +2 -2
  174. package/dist/components/biz/business/text-recommend/material.d.mts +19 -1
  175. package/dist/components/biz/business/text-recommend/material.mjs +1 -1
  176. package/dist/components/biz/business/text-recommend/schema.d.mts +15 -1
  177. package/dist/components/biz/business/text-recommend/schema.mjs +1 -1
  178. package/dist/components/biz/example/button/index.d.mts +2 -2
  179. package/dist/components/biz/example/button/material.d.mts +24 -1
  180. package/dist/components/biz/example/button/material.mjs +1 -1
  181. package/dist/components/biz/example/button/schema.d.mts +30 -3
  182. package/dist/components/biz/example/button/schema.mjs +1 -1
  183. package/dist/components/biz/renderer/renderer.d.mts +2 -1
  184. package/dist/components/biz/renderer/renderer.mjs +1 -1
  185. package/dist/components/pages/settings/_components/reset-password-drawer.mjs +1 -1
  186. package/dist/components/ui/badge.d.mts +1 -1
  187. package/dist/components/ui/button.d.mts +1 -1
  188. package/dist/materials.d.mts +10 -10
  189. package/dist/utils/schema/index.d.mts +1 -1
  190. package/dist/utils/schema/material.d.mts +1 -1
  191. package/dist/utils/schema/schema.d.mts +35 -0
  192. package/dist/utils.d.mts +3 -3
  193. package/package.json +8 -3
@@ -1,5 +1,28 @@
1
1
 
2
+ import { SchemaHasDefaultValue } from "../../../../utils/schema/schema.mjs";
3
+ import { DefineMaterialOption } from "../../../../utils/schema/material.mjs";
4
+ import "../../../../utils.mjs";
5
+ import { ButtonClient } from "./client.mjs";
6
+ import { Button } from "./server.mjs";
7
+ import * as zod from "zod";
8
+ import * as zod_v4_core0 from "zod/v4/core";
9
+
2
10
  //#region components/biz/example/button/material.d.ts
3
- declare const exampleButtonMaterial: any;
11
+ declare const exampleButtonMaterial: DefineMaterialOption<typeof Button, typeof ButtonClient, zod.ZodObject<{
12
+ text: zod.ZodString & SchemaHasDefaultValue;
13
+ variant: zod.ZodType<"default" | "blue" | "red", unknown, zod_v4_core0.$ZodTypeInternals<"default" | "blue" | "red", unknown>> & SchemaHasDefaultValue;
14
+ disabled: zod.ZodOptional<zod.ZodBoolean> & SchemaHasDefaultValue;
15
+ loading: zod.ZodOptional<zod.ZodBoolean>;
16
+ items: zod.ZodOptional<zod.ZodArray<zod.ZodObject<{
17
+ name: zod.ZodOptional<zod.ZodString>;
18
+ }, zod_v4_core0.$strip>>> & SchemaHasDefaultValue;
19
+ info: zod.ZodOptional<zod.ZodObject<{
20
+ readonly address: zod.ZodOptional<zod.ZodString>;
21
+ }, zod_v4_core0.$strip>> & SchemaHasDefaultValue;
22
+ mode: zod.ZodOptional<zod.ZodEnum<{
23
+ renderer: "renderer";
24
+ editor: "editor";
25
+ }>>;
26
+ }, zod_v4_core0.$strip>, "example-button", "行为组件">;
4
27
  //#endregion
5
28
  export { exampleButtonMaterial };
@@ -1,2 +1,2 @@
1
1
 
2
- import{ButtonClient as e}from"./client.mjs";import{buttonInspectorPropsSchema as t}from"./schema.mjs";import{Button as n}from"./server.mjs";import{defineMaterial as r}from"create-funhub/sdk";const i=r({type:`example-button`,name:`按钮`,icon:`/icon/button.png`,category:`行为组件`,serverComponent:n,clientComponent:e,propsSchema:t});export{i as exampleButtonMaterial};
2
+ import{defineMaterial as e}from"../../../../utils/schema/material.mjs";import{ButtonClient as t}from"./client.mjs";import{buttonInspectorPropsSchema as n}from"./schema.mjs";import{Button as r}from"./server.mjs";const i=e({type:`example-button`,name:`按钮`,icon:`/icon/button.png`,category:`行为组件`,serverComponent:r,clientComponent:t,propsSchema:n});export{i as exampleButtonMaterial};
@@ -1,12 +1,39 @@
1
1
 
2
- import { InferSchemaProps } from "create-funhub/sdk";
2
+ import { InferSchemaProps, SchemaHasDefaultValue } from "../../../../utils/schema/schema.mjs";
3
+ import "../../../../utils.mjs";
4
+ import z$1 from "zod";
3
5
 
4
6
  //#region components/biz/example/button/schema.d.ts
5
7
  /**
6
8
  * 定义可以被低代码右侧inspector编辑的props
7
9
  */
8
- declare const buttonInspectorPropsSchema: any;
9
- declare const buttonInspectorDefaultProps: any;
10
+ declare const buttonInspectorPropsSchema: z$1.ZodObject<{
11
+ text: z$1.ZodString & SchemaHasDefaultValue;
12
+ variant: z$1.ZodType<"default" | "blue" | "red", unknown, z$1.core.$ZodTypeInternals<"default" | "blue" | "red", unknown>> & SchemaHasDefaultValue;
13
+ disabled: z$1.ZodOptional<z$1.ZodBoolean> & SchemaHasDefaultValue;
14
+ loading: z$1.ZodOptional<z$1.ZodBoolean>;
15
+ items: z$1.ZodOptional<z$1.ZodArray<z$1.ZodObject<{
16
+ name: z$1.ZodOptional<z$1.ZodString>;
17
+ }, z$1.core.$strip>>> & SchemaHasDefaultValue;
18
+ info: z$1.ZodOptional<z$1.ZodObject<{
19
+ readonly address: z$1.ZodOptional<z$1.ZodString>;
20
+ }, z$1.core.$strip>> & SchemaHasDefaultValue;
21
+ mode: z$1.ZodOptional<z$1.ZodEnum<{
22
+ renderer: "renderer";
23
+ editor: "editor";
24
+ }>>;
25
+ }, z$1.core.$strip>;
26
+ declare const buttonInspectorDefaultProps: {
27
+ text: string;
28
+ variant: "default" | "blue" | "red";
29
+ disabled: boolean;
30
+ items: {
31
+ name?: string | undefined;
32
+ }[];
33
+ info: {
34
+ address?: string | undefined;
35
+ };
36
+ };
10
37
  type ButtonInspectorProps<T extends object = object> = InferSchemaProps<typeof buttonInspectorPropsSchema> & T;
11
38
  /**
12
39
  * 基于ButtonInspectorProps再派生出组件真正的props(因为不是所有props都需要被编辑,比如说下面的children就不需要,但是button组件又需要传入children)
@@ -1,2 +1,2 @@
1
1
 
2
- import{buttonVariantOptions as e}from"./variants.mjs";import t from"zod";import{defineArrayItemPropSchema as n,defineCheckboxPropSchema as r,defineComponentPropsSchema as i,defineObjectPropSchema as a,defineSelectEnumPropSchema as o,defineSwitchPropSchema as s,defineTextPropSchema as c,getSchemaDefaultProps as l}from"create-funhub/sdk";const u=i({text:c({label:`文本`,defaultValue:`example button`}),variant:o(e,{label:`变体`,defaultValue:`red`}),disabled:r({label:`禁用`,defaultValue:!1,required:!1}),loading:s({label:`加载`,required:!1}),items:n(t.object({name:c({label:`名称`,required:!1})}),{required:!1,label:`items`,defaultValue:[{name:`string`}]}),info:a({address:c({label:`地址`,required:!1})},{label:`info`,required:!1,defaultValue:{address:`SHENZHEN`}})}),d=l(u);export{d as buttonInspectorDefaultProps,u as buttonInspectorPropsSchema};
2
+ import{defineArrayItemPropSchema as e,defineCheckboxPropSchema as t,defineComponentPropsSchema as n,defineObjectPropSchema as r,defineSelectEnumPropSchema as i,defineSwitchPropSchema as a,defineTextPropSchema as o,getSchemaDefaultProps as s}from"../../../../utils/schema/schema.mjs";import{buttonVariantOptions as c}from"./variants.mjs";import l from"zod";const u=n({text:o({label:`文本`,defaultValue:`example button`}),variant:i(c,{label:`变体`,defaultValue:`red`}),disabled:t({label:`禁用`,defaultValue:!1,required:!1}),loading:a({label:`加载`,required:!1}),items:e(l.object({name:o({label:`名称`,required:!1})}),{required:!1,label:`items`,defaultValue:[{name:`string`}]}),info:r({address:o({label:`地址`,required:!1})},{label:`info`,required:!1,defaultValue:{address:`SHENZHEN`}})}),d=s(u);export{d as buttonInspectorDefaultProps,u as buttonInspectorPropsSchema};
@@ -1,8 +1,9 @@
1
1
 
2
+ import { DefineMaterialOption } from "../../../utils/schema/material.mjs";
3
+ import "../../../utils.mjs";
2
4
  import { ComponentType, ReactNode } from "react";
3
5
  import * as react_jsx_runtime0 from "react/jsx-runtime";
4
6
  import z$1 from "zod";
5
- import { DefineMaterialOption } from "create-funhub/sdk";
6
7
 
7
8
  //#region components/biz/renderer/renderer.d.ts
8
9
  type NodeInspectorProps = Record<string, unknown>;
@@ -1,2 +1,2 @@
1
1
 
2
- import{cn as e}from"../../../utils/cn.mjs";import{materials_exports as t}from"../../../materials.mjs";import{Fragment as n,jsx as r,jsxs as i}from"react/jsx-runtime";import{generateMaterialMap as a}from"create-funhub/sdk";function o(e,t){let n=t.props,r=e.propsSchema.safeParse(n);return r.success?{isValid:!0,props:r.data}:{isValid:!1,props:n,message:r.error?.message}}function s(e){let{document:t,materialMap:a,nodeId:c,ancestors:l,mode:u}=e;if(l.has(c))return null;let d=t.page.nodes[c];if(!d)return null;let f=new Set(l);f.add(c);let p=d.children.map(e=>r(s,{document:t,materialMap:a,nodeId:e,ancestors:f,mode:u},e)),m=a[d.type];if(!m)return p.length===0?null:r(n,{children:p});let h=o(m,d);return h.isValid?r(u===`client`?m.clientComponent:m.serverComponent,{...h.props,children:p}):i(`div`,{children:[`组件配置错误`,h.message]})}function c(n){let{className:i,document:o,materials:c,mode:l=`server`}=n,u=o.page.nodes[o.page.rootId];if(!u)return r(`div`,{className:e(`funhub-renderer`,i)});let d=a(c??Object.values(t));return r(`div`,{className:e(`funhub-renderer`,i),children:r(s,{document:o,materialMap:d,nodeId:u.id,ancestors:new Set,mode:l})})}export{c as Renderer};
2
+ import{cn as e}from"../../../utils/cn.mjs";import{generateMaterialMap as t}from"../../../utils/schema/utils.mjs";import{materials_exports as n}from"../../../materials.mjs";import{Fragment as r,jsx as i,jsxs as a}from"react/jsx-runtime";function o(e,t){let n=t.props,r=e.propsSchema.safeParse(n);return r.success?{isValid:!0,props:r.data}:{isValid:!1,props:n,message:r.error?.message}}function s(e){let{document:t,materialMap:n,nodeId:c,ancestors:l,mode:u}=e;if(l.has(c))return null;let d=t.page.nodes[c];if(!d)return null;let f=new Set(l);f.add(c);let p=d.children.map(e=>i(s,{document:t,materialMap:n,nodeId:e,ancestors:f,mode:u},e)),m=n[d.type];if(!m)return p.length===0?null:i(r,{children:p});let h=o(m,d);return h.isValid?i(u===`client`?m.clientComponent:m.serverComponent,{...h.props,children:p}):a(`div`,{children:[`组件配置错误`,h.message]})}function c(r){let{className:a,document:o,materials:c,mode:l=`server`}=r,u=o.page.nodes[o.page.rootId];if(!u)return i(`div`,{className:e(`funhub-renderer`,a)});let d=t(c??Object.values(n));return i(`div`,{className:e(`funhub-renderer`,a),children:i(s,{document:o,materialMap:d,nodeId:u.id,ancestors:new Set,mode:l})})}export{c as Renderer};
@@ -1,5 +1,5 @@
1
1
 
2
- "use client";import{Button as e}from"../../../ui/button.mjs";import{hashPassword as t}from"../../../../utils/common.mjs";import{useUserStore as n}from"../../../../store/modules/user-store.mjs";import{pUserResetPassword as r,pUserSendResetPasswordEmailCode as i,pUserVerifyResetPasswordEmailCode as a}from"../../../../service/generated/client.mjs";import{getPasswordValidationErrorText as o,validatePasswordPair as ee}from"../../../../utils/password-validator.mjs";import{Box as s}from"../../../ui/box.mjs";import{Drawer as c,DrawerContent as te,DrawerDescription as l,DrawerHeader as u,DrawerTitle as ne}from"../../../ui/drawer.mjs";import{Text as d}from"../../../ui/text.mjs";import f from"../../../ui/legacy/button.mjs";import{EyeIcon as p}from"../../../../assets/icons/eye-icon.mjs";import{EyeOffIcon as m}from"../../../../assets/icons/eye-off-icon.mjs";import{HeaderNav as h}from"../../../common/header-nav/client.mjs";import g from"../../../ui/legacy/input.mjs";import{useEffect as _,useMemo as v,useRef as y,useState as b}from"react";import{jsx as x,jsxs as S}from"react/jsx-runtime";import{toast as C}from"sonner";import{useTranslations as w}from"next-intl";function T(T){let E=w(`components.pages.settings.components`),{open:re,onOpenChange:D}=T,O=n(e=>e.userInfo),[k,A]=b([,,,,,,].fill(``)),[j,M]=b(0),N=y(null),ie=k.some(e=>e===``),[P,F]=b(``),I=y(null),[ae,L]=b(60),[R,z]=b(!1);async function B(){if(R)return;let e=C.loading(E(`resetPasswordDrawer.sending`));try{let t=await i({user_id:O?.user_id});t.code===0?(C.success(E(`resetPasswordDrawer.codeSentSuccess`),{id:e}),z(!0),L(60),F(``)):C.error(t.message||E(`resetPasswordDrawer.sendFailed`),{id:e})}catch(t){console.error(t),C.error(E(`resetPasswordDrawer.sendFailed`),{id:e})}}function V(){W(e=>e===1?e:e+1)}async function H(){let e=C.loading(E(`resetPasswordDrawer.verifying`));try{F(``);let t=await a({user_id:O?.user_id,email_code:k.join(``)});t.code===0?(C.success(E(`resetPasswordDrawer.verifySuccess`),{id:e}),V()):(F(t.message||E(`resetPasswordDrawer.verifyFailed`)),C.error(t.message||E(`resetPasswordDrawer.verifyFailed`),{id:e}))}catch(t){console.error(t),F(E(`resetPasswordDrawer.verifyFailed`)),C.error(E(`resetPasswordDrawer.verifyFailed`),{id:e})}}_(()=>{if(R)return I.current=setInterval(()=>{L(e=>e<=1?(I.current&&clearInterval(I.current),z(!1),60):e-1)},1e3),()=>{I.current&&clearInterval(I.current)}},[R]);let[U,W]=b(0);_(()=>{U===0&&N.current?.focus()},[U]);let[G,K]=b({password:``,confirmPassword:``}),[q,J]=b(!1),[Y,oe]=b(!1),[X,se]=b(!1),Z=v(()=>ee(G.password,G.confirmPassword),[G.password,G.confirmPassword]),Q=v(()=>o(Z),[Z]),$=v(()=>q||G.password.length===0||G.confirmPassword.length===0||Z.type!==`none`,[q,G.password.length,G.confirmPassword.length,Z.type]);async function ce(){if($)return;let e=C.loading(E(`resetPasswordDrawer.submitting`));try{J(!0);let n=await r({user_id:O?.user_id,password:t(G.password)});n.code===0?(C.success(E(`resetPasswordDrawer.passwordResetSuccess`),{id:e}),K({password:``,confirmPassword:``}),A([,,,,,,].fill(``)),M(0),D(!1)):C.error(n.message||E(`resetPasswordDrawer.resetFailed`),{id:e})}catch(t){console.error(t),C.error(E(`resetPasswordDrawer.resetFailed`),{id:e})}finally{J(!1)}}function le(e){let t=e.target.value.replace(/\D/g,``);if(t.length===0)return;let n=[...k],r=t.split(``),i=j;for(let e of r){if(i>=6)break;n[i]=e,i+=1}A(n),M(Math.min(i,5)),P&&F(``)}function ue(e){if(e.key===`Backspace`){e.preventDefault();let t=[...k];t[j]?t[j]=``:j>0&&(t[j-1]=``,M(j-1)),A(t),P&&F(``);return}e.key===`ArrowLeft`&&j>0&&M(j-1),e.key===`ArrowRight`&&j<5&&M(j+1)}function de(e){M(e),N.current?.focus()}let fe=S(s,{className:`p-6`,children:[S(s,{className:`space-y-[12px]`,children:[x(d,{className:`text-[24px] leading-[32px] font-bold text-text1`,children:`请输入验证码`}),S(s,{className:`flex items-center justify-between gap-[8px]`,children:[S(d,{className:`min-w-0 flex-1 truncate text-[12px] leading-[16px] text-text2`,children:[E(`resetPasswordDrawer.boundEmailNotice`),x(d,{className:`dark:text-white text-white`,children:O?.email}),E(`resetPasswordDrawer.verifyHint`)]}),x(e,{variant:`link`,disabled:R,onClick:B,className:`h-auto shrink-0 rounded-[10px] bg-line1 px-[10px] py-[4px] text-[10px] leading-[12px] text-text1 no-underline hover:no-underline disabled:opacity-60`,children:R?`${E(`resetPasswordDrawer.sendCode`)} (${ae}s)`:E(`resetPasswordDrawer.sendCode`)})]})]}),S(s,{className:`mt-[28px]`,children:[S(s,{className:`relative`,children:[x(`input`,{ref:N,type:`text`,inputMode:`numeric`,pattern:`[0-9]*`,value:``,onChange:le,onKeyDown:ue,className:`absolute inset-0 h-full w-full opacity-0 pointer-events-none`,autoComplete:`one-time-code`}),x(s,{className:`flex justify-between gap-[10px]`,children:k.map((e,t)=>x(s,{onClick:()=>de(t),className:`
2
+ "use client";import{Button as e}from"../../../ui/button.mjs";import{hashPassword as t}from"../../../../utils/common.mjs";import{useUserStore as n}from"../../../../store/modules/user-store.mjs";import{pUserResetPassword as r,pUserSendResetPasswordEmailCode as i,pUserVerifyResetPasswordEmailCode as a}from"../../../../service/generated/client.mjs";import{getPasswordValidationErrorText as o,validatePasswordPair as ee}from"../../../../utils/password-validator.mjs";import{Box as s}from"../../../ui/box.mjs";import{Drawer as c,DrawerContent as te,DrawerDescription as l,DrawerHeader as u,DrawerTitle as ne}from"../../../ui/drawer.mjs";import{Text as d}from"../../../ui/text.mjs";import f from"../../../ui/legacy/button.mjs";import{EyeIcon as p}from"../../../../assets/icons/eye-icon.mjs";import{EyeOffIcon as m}from"../../../../assets/icons/eye-off-icon.mjs";import{HeaderNav as h}from"../../../common/header-nav/client.mjs";import g from"../../../ui/legacy/input.mjs";import{useEffect as _,useMemo as v,useRef as y,useState as b}from"react";import{jsx as x,jsxs as S}from"react/jsx-runtime";import{toast as C}from"sonner";import{useTranslations as w}from"next-intl";function T(T){let E=w(`components.pages.settings.components`),{open:re,onOpenChange:D}=T,O=n(e=>e.userInfo),[k,A]=b([,,,,,,].fill(``)),[j,M]=b(0),N=y(null),ie=k.includes(``),[P,F]=b(``),I=y(null),[ae,L]=b(60),[R,z]=b(!1);async function B(){if(R)return;let e=C.loading(E(`resetPasswordDrawer.sending`));try{let t=await i({user_id:O?.user_id});t.code===0?(C.success(E(`resetPasswordDrawer.codeSentSuccess`),{id:e}),z(!0),L(60),F(``)):C.error(t.message||E(`resetPasswordDrawer.sendFailed`),{id:e})}catch(t){console.error(t),C.error(E(`resetPasswordDrawer.sendFailed`),{id:e})}}function V(){W(e=>e===1?e:e+1)}async function H(){let e=C.loading(E(`resetPasswordDrawer.verifying`));try{F(``);let t=await a({user_id:O?.user_id,email_code:k.join(``)});t.code===0?(C.success(E(`resetPasswordDrawer.verifySuccess`),{id:e}),V()):(F(t.message||E(`resetPasswordDrawer.verifyFailed`)),C.error(t.message||E(`resetPasswordDrawer.verifyFailed`),{id:e}))}catch(t){console.error(t),F(E(`resetPasswordDrawer.verifyFailed`)),C.error(E(`resetPasswordDrawer.verifyFailed`),{id:e})}}_(()=>{if(R)return I.current=setInterval(()=>{L(e=>e<=1?(I.current&&clearInterval(I.current),z(!1),60):e-1)},1e3),()=>{I.current&&clearInterval(I.current)}},[R]);let[U,W]=b(0);_(()=>{U===0&&N.current?.focus()},[U]);let[G,K]=b({password:``,confirmPassword:``}),[q,J]=b(!1),[Y,oe]=b(!1),[X,se]=b(!1),Z=v(()=>ee(G.password,G.confirmPassword),[G.password,G.confirmPassword]),Q=v(()=>o(Z),[Z]),$=v(()=>q||G.password.length===0||G.confirmPassword.length===0||Z.type!==`none`,[q,G.password.length,G.confirmPassword.length,Z.type]);async function ce(){if($)return;let e=C.loading(E(`resetPasswordDrawer.submitting`));try{J(!0);let n=await r({user_id:O?.user_id,password:t(G.password)});n.code===0?(C.success(E(`resetPasswordDrawer.passwordResetSuccess`),{id:e}),K({password:``,confirmPassword:``}),A([,,,,,,].fill(``)),M(0),D(!1)):C.error(n.message||E(`resetPasswordDrawer.resetFailed`),{id:e})}catch(t){console.error(t),C.error(E(`resetPasswordDrawer.resetFailed`),{id:e})}finally{J(!1)}}function le(e){let t=e.target.value.replace(/\D/g,``);if(t.length===0)return;let n=[...k],r=t.split(``),i=j;for(let e of r){if(i>=6)break;n[i]=e,i+=1}A(n),M(Math.min(i,5)),P&&F(``)}function ue(e){if(e.key===`Backspace`){e.preventDefault();let t=[...k];t[j]?t[j]=``:j>0&&(t[j-1]=``,M(j-1)),A(t),P&&F(``);return}e.key===`ArrowLeft`&&j>0&&M(j-1),e.key===`ArrowRight`&&j<5&&M(j+1)}function de(e){M(e),N.current?.focus()}let fe=S(s,{className:`p-6`,children:[S(s,{className:`space-y-[12px]`,children:[x(d,{className:`text-[24px] leading-[32px] font-bold text-text1`,children:`请输入验证码`}),S(s,{className:`flex items-center justify-between gap-[8px]`,children:[S(d,{className:`min-w-0 flex-1 truncate text-[12px] leading-[16px] text-text2`,children:[E(`resetPasswordDrawer.boundEmailNotice`),x(d,{className:`dark:text-white text-white`,children:O?.email}),E(`resetPasswordDrawer.verifyHint`)]}),x(e,{variant:`link`,disabled:R,onClick:B,className:`h-auto shrink-0 rounded-[10px] bg-line1 px-[10px] py-[4px] text-[10px] leading-[12px] text-text1 no-underline hover:no-underline disabled:opacity-60`,children:R?`${E(`resetPasswordDrawer.sendCode`)} (${ae}s)`:E(`resetPasswordDrawer.sendCode`)})]})]}),S(s,{className:`mt-[28px]`,children:[S(s,{className:`relative`,children:[x(`input`,{ref:N,type:`text`,inputMode:`numeric`,pattern:`[0-9]*`,value:``,onChange:le,onKeyDown:ue,className:`absolute inset-0 h-full w-full opacity-0 pointer-events-none`,autoComplete:`one-time-code`}),x(s,{className:`flex justify-between gap-[10px]`,children:k.map((e,t)=>x(s,{onClick:()=>de(t),className:`
3
3
  h-[48px] flex-1 rounded-[6px] border-2 flex items-center justify-center cursor-pointer transition-all duration-200
4
4
  ${P?`border-theme5 bg-line1`:t===j?`border-theme3 bg-theme3/10`:`border-transparent bg-line1`}
5
5
  `,children:x(d,{className:`text-[24px] leading-none font-semibold text-text1 select-none`,children:e})},`${t}-${e||`empty`}`))})]}),x(s,{className:`min-h-[22px] pt-[8px]`,children:x(d,{className:`text-[12px] leading-[18px] text-theme5`,children:P})}),x(f,{onClick:H,disabled:ie,className:`mt-[180px] w-full h-15 !rounded-[30px] !text-[18px] font-bold leading-6.5 bg-theme6 disabled:bg-theme6/40 disabled:text-text3 active:opacity-90 !px-0 !py-0`,children:`提交`})]})]}),pe=S(s,{className:`p-6`,children:[x(s,{children:x(d,{className:`text-text2`,children:E(`resetPasswordDrawer.setNewPasswordHint`)})}),S(s,{className:`mt-6 space-y-6`,children:[S(s,{className:`flex relative items-center px-2 rounded-[50px] h-16.5 bg-line1 border ${Q?`border-theme5`:`border-line1`}`,children:[x(g,{value:G.password,onChange:e=>K(t=>({...t,password:e})),placeholder:E(`resetPasswordDrawer.passwordPlaceholder`),type:Y?`text`:`password`,autoComplete:`new-password`,autoCorrect:`off`,autoCapitalize:`none`,spellCheck:!1,"data-lpignore":`true`,"data-1p-ignore":`true`,"data-form-type":`other`,className:`pr-10`}),x(`button`,{type:`button`,onClick:()=>oe(!Y),className:`absolute right-4 top-1/2 -translate-y-1/2 text-text2 hover:text-text1 transition-colors`,children:x(Y?m:p,{className:`w-5 h-5`})})]}),S(s,{className:`flex relative items-center px-2 rounded-[50px] h-16.5 bg-line1 border ${Z.type===`not-match`?`border-theme5`:`border-line1`}`,children:[x(g,{value:G.confirmPassword,onChange:e=>K(t=>({...t,confirmPassword:e})),placeholder:E(`resetPasswordDrawer.confirmPasswordPlaceholder`),type:X?`text`:`password`,autoComplete:`new-password`,autoCorrect:`off`,autoCapitalize:`none`,spellCheck:!1,"data-lpignore":`true`,"data-1p-ignore":`true`,"data-form-type":`other`,className:`pr-10`}),x(`button`,{type:`button`,onClick:()=>se(!X),className:`absolute right-4 top-1/2 -translate-y-1/2 text-text2 hover:text-text1 transition-colors`,children:x(X?m:p,{className:`w-5 h-5`})})]}),Q?x(s,{children:x(d,{className:`min-h-[22px] text-[14px] text-theme5 px-[12px]`,children:Q})}):null,x(f,{onClick:ce,disabled:$,className:`w-full h-15 !rounded-[30px] !text-[18px] font-bold leading-6.5 bg-theme6 disabled:bg-theme6/40 disabled:text-text3 active:opacity-90 !px-0 !py-0`,children:E(q?`resetPasswordDrawer.submitting`:`resetPasswordDrawer.resetPassword`)})]})]});return S(c,{open:re,onOpenChange:D,direction:`right`,handleOnly:!0,children:[S(u,{className:`hidden`,children:[x(ne,{children:E(`resetPasswordDrawer.title`)}),x(l,{children:E(`resetPasswordDrawer.title`)})]}),S(te,{className:`!w-full`,children:[x(h,{onBack:()=>D(!1),title:E(`resetPasswordDrawer.title`)}),U===0&&fe,U===1&&pe]})]})}export{T as ResetPasswordDrawer};
@@ -6,7 +6,7 @@ import * as class_variance_authority_types0 from "class-variance-authority/types
6
6
  //#region components/ui/badge.d.ts
7
7
  /** badgeVariants 工具定义。 */
8
8
  declare const badgeVariants: (props?: ({
9
- variant?: "default" | "link" | "destructive" | "outline" | "secondary" | "ghost" | null | undefined;
9
+ variant?: "link" | "default" | "destructive" | "secondary" | "outline" | "ghost" | null | undefined;
10
10
  } & class_variance_authority_types0.ClassProp) | undefined) => string;
11
11
  /** Badge 组件。 */
12
12
  declare function Badge({
@@ -7,7 +7,7 @@ import * as class_variance_authority_types0 from "class-variance-authority/types
7
7
  //#region components/ui/button.d.ts
8
8
  /** buttonVariants 工具定义。 */
9
9
  declare const buttonVariants: (props?: ({
10
- variant?: "default" | "link" | "destructive" | "outline" | "secondary" | "ghost" | null | undefined;
10
+ variant?: "link" | "default" | "destructive" | "secondary" | "outline" | "ghost" | null | undefined;
11
11
  size?: "default" | "icon" | "xs" | "sm" | "lg" | "icon-xs" | "icon-sm" | "icon-lg" | null | undefined;
12
12
  } & class_variance_authority_types0.ClassProp) | undefined) => string;
13
13
  /** Button 组件属性。 */
@@ -1,4 +1,14 @@
1
1
 
2
+ import { videoDetailPlayerMaterial } from "./components/biz/business/detail/video-detail-player/material.mjs";
3
+ import "./components/biz/business/detail/video-detail-player/index.mjs";
4
+ import { videoDetailInfoMaterial } from "./components/biz/business/detail/video-detail-info/material.mjs";
5
+ import "./components/biz/business/detail/video-detail-info/index.mjs";
6
+ import { videoDetailInfoTitleTagsEpisodesMaterial } from "./components/biz/business/detail/video-detail-info-title-tags-episodes/material.mjs";
7
+ import "./components/biz/business/detail/video-detail-info-title-tags-episodes/index.mjs";
8
+ import { videoDetailActionsMaterial } from "./components/biz/business/detail/video-detail-actions/material.mjs";
9
+ import "./components/biz/business/detail/video-detail-actions/index.mjs";
10
+ import { videoDetailRecommendMaterial } from "./components/biz/business/detail/video-detail-recommend/material.mjs";
11
+ import "./components/biz/business/detail/video-detail-recommend/index.mjs";
2
12
  import { floatingBallMaterial } from "./components/biz/business/floating-ball/material.mjs";
3
13
  import { homeRecommendGridMaterial } from "./components/biz/business/home-recommend/home-recommend-grid/material.mjs";
4
14
  import { homeRecommendWaterfallMaterial } from "./components/biz/business/home-recommend/home-recommend-waterfall/material.mjs";
@@ -13,16 +23,6 @@ import { textRecommendMaterial } from "./components/biz/business/text-recommend/
13
23
  import { exampleButtonMaterial } from "./components/biz/example/button/material.mjs";
14
24
  import { BannerCarouselMaterial } from "./components/biz/business/banner-carousel/material.mjs";
15
25
  import { channelListMaterial } from "./components/biz/business/channel-list/material.mjs";
16
- import { videoDetailActionsMaterial } from "./components/biz/business/detail/video-detail-actions/material.mjs";
17
- import "./components/biz/business/detail/video-detail-actions/index.mjs";
18
- import { videoDetailInfoMaterial } from "./components/biz/business/detail/video-detail-info/material.mjs";
19
- import "./components/biz/business/detail/video-detail-info/index.mjs";
20
- import { videoDetailInfoTitleTagsEpisodesMaterial } from "./components/biz/business/detail/video-detail-info-title-tags-episodes/material.mjs";
21
- import "./components/biz/business/detail/video-detail-info-title-tags-episodes/index.mjs";
22
- import { videoDetailPlayerMaterial } from "./components/biz/business/detail/video-detail-player/material.mjs";
23
- import "./components/biz/business/detail/video-detail-player/index.mjs";
24
- import { videoDetailRecommendMaterial } from "./components/biz/business/detail/video-detail-recommend/material.mjs";
25
- import "./components/biz/business/detail/video-detail-recommend/index.mjs";
26
26
  import { headerAvatarIconMaterial } from "./components/biz/business/header-search/header-avatar-icon/material.mjs";
27
27
  import { headerAvatarLogoSearchMaterial } from "./components/biz/business/header-search/header-avatar-logo-search/material.mjs";
28
28
  import { headerAvatarLogoSearchIconMaterial } from "./components/biz/business/header-search/header-avatar-logo-search-icon/material.mjs";
@@ -1,4 +1,4 @@
1
1
 
2
2
  import { INSPECTOR_META_KEY, InferSchemaProps, MaterialComponentMode, MaterialComponentProps, SchemaHasDefaultValue, defineArrayItemPropSchema, defineCheckboxPropSchema, defineColorPropSchema, defineComponentPropsSchema, defineDatetimePropSchema, defineNumberPropSchema, defineObjectPropSchema, defineSelectEnumPropSchema, defineSelectPropSchema, defineSwitchPropSchema, defineTextPropSchema, defineTextareaPropSchema, defineTimeRangePropSchema, getSchemaDefaultProps, withInspectorMeta } from "./schema.mjs";
3
- import { defineMaterial, overwriteMaterial } from "./material.mjs";
3
+ import { DefineMaterialOption, MaterialCategory, OverwriteMaterialOption, defineMaterial, overwriteMaterial } from "./material.mjs";
4
4
  import { MaterialMap, generateMaterialMap, generateMaterialMapGroupByCategory } from "./utils.mjs";
@@ -51,4 +51,4 @@ interface OverwriteMaterialOption<TServerComponent extends ComponentType<any>, T
51
51
  */
52
52
  declare function overwriteMaterial<TRawServerComponent extends ComponentType<any>, TRawClientComponent extends ComponentType<any>, TPropsSchema extends MaterialPropsSchema, TType extends string, TCategory extends MaterialCategory, TServerComponent extends ComponentType<any> = TRawServerComponent, TClientComponent extends ComponentType<any> = TRawClientComponent>(rawMaterial: DefineMaterialOption<TRawServerComponent, TRawClientComponent, TPropsSchema, TType, TCategory>, option?: OverwriteMaterialOption<TServerComponent, TClientComponent, TPropsSchema, TCategory>): DefineMaterialOption<TServerComponent, TClientComponent, TPropsSchema, TType, TCategory>;
53
53
  //#endregion
54
- export { DefineMaterialOption, MaterialCategory, defineMaterial, overwriteMaterial };
54
+ export { DefineMaterialOption, MaterialCategory, OverwriteMaterialOption, defineMaterial, overwriteMaterial };
@@ -61,9 +61,16 @@ declare function defineNumberPropSchema<const TOption extends NumberInspectorFie
61
61
  declare function defineColorPropSchema<const TOption extends ColorInspectorFieldOption & {
62
62
  required?: boolean;
63
63
  }>(option: TOption): MaybeSchemaWithDefaultValue<SchemaByRequired<z.ZodString, TOption['required']>, TOption>;
64
+ /**
65
+ * 定义日期时间字段schema,用于时间段选择。
66
+ * 值为 ISO 8601 或 YYYY-MM-DD HH:mm:ss 格式字符串。
67
+ * @param option inspector 字段配置
68
+ * @returns zod schema
69
+ */
64
70
  declare function defineDatetimePropSchema<const TOption extends DatetimeInspectorFieldOption & {
65
71
  required?: boolean;
66
72
  }>(option: TOption): MaybeSchemaWithDefaultValue<SchemaByRequired<z.ZodString, TOption['required']>, TOption>;
73
+ /** 时间段结构:{ start: 开始时间, end: 结束时间 },格式 YYYY-MM-DD HH:mm:ss */
67
74
  declare const timeRangeShape: {
68
75
  readonly start: z.ZodString;
69
76
  readonly end: z.ZodString;
@@ -75,6 +82,11 @@ interface TimeRangeValue {
75
82
  interface TimeRangeInspectorOption extends Omit<TimeRangeInspectorFieldOption, 'defaultValue'> {
76
83
  defaultValue?: TimeRangeValue;
77
84
  }
85
+ /**
86
+ * 定义时间段字段schema,用于开始时间+结束时间范围选择。
87
+ * @param option inspector 字段配置
88
+ * @returns zod schema
89
+ */
78
90
  declare function defineTimeRangePropSchema<const TOption extends TimeRangeInspectorOption & {
79
91
  required?: boolean;
80
92
  }>(option: TOption): MaybeSchemaWithDefaultValue<SchemaByRequired<z.ZodObject<typeof timeRangeShape>, TOption['required']>, TOption>;
@@ -85,6 +97,12 @@ type StringTuple = readonly [string, ...string[]];
85
97
  type SelectEnumInspectorFieldOption<TValues extends StringTuple> = Omit<SelectInspectorFieldOption, 'defaultValue'> & {
86
98
  defaultValue?: TValues[number];
87
99
  };
100
+ /**
101
+ * 基于字符串元组定义select字段schema。
102
+ * @param values 可选值元组
103
+ * @param option inspector 字段配置
104
+ * @returns zod schema
105
+ */
88
106
  declare function defineSelectEnumPropSchema<const TValues extends StringTuple, const TOption extends SelectEnumInspectorFieldOption<TValues> & {
89
107
  required?: boolean;
90
108
  }>(values: TValues, option: TOption): MaybeSchemaWithDefaultValue<SchemaByRequired<z.ZodType<TValues[number]>, TOption['required']>, TOption>;
@@ -97,6 +115,11 @@ declare function defineSwitchPropSchema<const TOption extends SwitchInspectorFie
97
115
  type SchemaShape<TSchema extends z.ZodObject<z.ZodRawShape>> = TSchema extends z.ZodObject<infer TShape> ? TShape : never;
98
116
  type SchemaFieldDefaultValue<TFieldSchema> = TFieldSchema extends z.ZodTypeAny ? TFieldSchema extends SchemaHasDefaultValue ? Exclude<z.infer<TFieldSchema>, undefined> : never : never;
99
117
  type SchemaDefaultProps<TSchema extends z.ZodObject<z.ZodRawShape>> = { [Key in keyof SchemaShape<TSchema> as [SchemaFieldDefaultValue<SchemaShape<TSchema>[Key]>] extends [never] ? never : Key]: SchemaFieldDefaultValue<SchemaShape<TSchema>[Key]> };
118
+ /**
119
+ * 提取schema中定义的默认props
120
+ * @param schema
121
+ * @returns
122
+ */
100
123
  declare function getSchemaDefaultProps<const TSchema extends z.ZodObject<z.ZodRawShape>>(schema: TSchema): SchemaDefaultProps<TSchema>;
101
124
  type ArrayItemInspectorOption<TItemSchema extends z.ZodTypeAny> = Omit<ArrayInspectorFieldOption, 'defaultValue'> & {
102
125
  defaultValue?: z.infer<TItemSchema>[];
@@ -104,9 +127,21 @@ type ArrayItemInspectorOption<TItemSchema extends z.ZodTypeAny> = Omit<ArrayInsp
104
127
  type ObjectPropInspectorOption<TShape extends z.ZodRawShape> = Omit<ObjectInspectorFieldOption, 'defaultValue'> & {
105
128
  defaultValue?: z.infer<z.ZodObject<TShape>>;
106
129
  };
130
+ /**
131
+ * 定义数组字段schema,支持声明数组项schema。
132
+ * @param itemSchema 数组项schema
133
+ * @param option inspector 字段配置
134
+ * @returns zod schema
135
+ */
107
136
  declare function defineArrayItemPropSchema<TItemSchema extends z.ZodTypeAny, const TOption extends ArrayItemInspectorOption<TItemSchema> & {
108
137
  required?: boolean;
109
138
  }>(itemSchema: TItemSchema, option: TOption): MaybeSchemaWithDefaultValue<SchemaByRequired<z.ZodArray<TItemSchema>, TOption['required']>, TOption>;
139
+ /**
140
+ * 定义对象字段schema,支持声明对象shape。
141
+ * @param shape 对象字段shape
142
+ * @param option inspector 字段配置
143
+ * @returns zod schema
144
+ */
110
145
  declare function defineObjectPropSchema<const TShape extends z.ZodRawShape, const TOption extends ObjectPropInspectorOption<TShape> & {
111
146
  required?: boolean;
112
147
  }>(shape: TShape, option: TOption): MaybeSchemaWithDefaultValue<SchemaByRequired<z.ZodObject<TShape>, TOption['required']>, TOption>;
package/dist/utils.d.mts CHANGED
@@ -1,5 +1,4 @@
1
1
 
2
- import { HttpClient, HttpError, RequestConfig, RequestMethod, ResponseData, httpClient } from "./utils/http.mjs";
3
2
  import { clearMyChannelsFromStorage, loadHiddenChannelIdsFromStorage, loadMyChannelsFromStorage, saveHiddenChannelIdsToStorage } from "./utils/channel-storage.mjs";
4
3
  import { cn } from "./utils/cn.mjs";
5
4
  import { debounceFun, formatVideoDuration, generateDynamicSign, generateUUID, getAtUserElement, getCookie, getCurrentSecondTime, getUserId, hashPassword, isClient, isMobileDevice, numToString, parseResolution, parseTextAtUserIds, randomString, removeCookie, replaceAtUserElement, replaceAtUserElementHtmlStr, secondToTime, setCookie, stringToNumber, stripHtmlTags, updateUrlParams } from "./utils/common.mjs";
@@ -8,15 +7,16 @@ import { eventBus } from "./utils/event-bus.mjs";
8
7
  import { checkFollowStatus, followUser, getAppId, getCurrentUserId, unfollowUser } from "./utils/follow-service.mjs";
9
8
  import { getResUrl } from "./utils/get-res-url.mjs";
10
9
  import { disablePageScroll, enablePageScroll, normalizeClassName, pxToVw } from "./utils/helper.mjs";
10
+ import { HttpClient, HttpError, RequestConfig, RequestMethod, ResponseData, httpClient } from "./utils/http.mjs";
11
11
  import { ImageCompressionQualityRule, compressImage, defaultImageCompressionMaxSizeMB, defaultImageCompressionQuality, getImageCompressionQuality, imageCompressionQualityRules } from "./utils/image-compression.mjs";
12
12
  import { components, loadComponent, rewriteComponent } from "./utils/loaders.mjs";
13
13
  import { createInputAndSelectFile, getCoverImage, getImageResolutionFromFile } from "./utils/media.mjs";
14
14
  import { PASSWORD_ALLOWED_SPECIAL_CHARS, PASSWORD_MAX_LENGTH, PASSWORD_MIN_LENGTH, PasswordValidationResult, PasswordValidationType, getFirstInvalidPasswordChar, getPasswordCharacterTypeCount, getPasswordValidationErrorText, validatePasswordPair } from "./utils/password-validator.mjs";
15
15
  import { PresignedUploadInfo, UploadToS3Options, UploadToS3Result, uploadToS3WithPresignedUrl } from "./utils/s3-uploader.mjs";
16
16
  import { INSPECTOR_META_KEY, InferSchemaProps, MaterialComponentMode, MaterialComponentProps, SchemaHasDefaultValue, defineArrayItemPropSchema, defineCheckboxPropSchema, defineColorPropSchema, defineComponentPropsSchema, defineDatetimePropSchema, defineNumberPropSchema, defineObjectPropSchema, defineSelectEnumPropSchema, defineSelectPropSchema, defineSwitchPropSchema, defineTextPropSchema, defineTextareaPropSchema, defineTimeRangePropSchema, getSchemaDefaultProps, withInspectorMeta } from "./utils/schema/schema.mjs";
17
- import { defineMaterial, overwriteMaterial } from "./utils/schema/material.mjs";
17
+ import { DefineMaterialOption, MaterialCategory, OverwriteMaterialOption, defineMaterial, overwriteMaterial } from "./utils/schema/material.mjs";
18
18
  import { MaterialMap, generateMaterialMap, generateMaterialMapGroupByCategory } from "./utils/schema/utils.mjs";
19
19
  import "./utils/schema/index.mjs";
20
20
  import { base64ToUint8Array, uint8ArrayToBase64, uint8ArrayToNumberArray } from "./utils/uint8.mjs";
21
21
  import { UploadFileResult, encryptBncBuffer, uploadFile } from "./utils/upload-file.mjs";
22
- export { eventBus as EventBus, HttpClient, HttpError, INSPECTOR_META_KEY, ImageCompressionQualityRule, InferSchemaProps, MaterialComponentMode, MaterialComponentProps, MaterialMap, PASSWORD_ALLOWED_SPECIAL_CHARS, PASSWORD_MAX_LENGTH, PASSWORD_MIN_LENGTH, PasswordValidationResult, PasswordValidationType, PresignedUploadInfo, RequestConfig, RequestMethod, ResponseData, SchemaHasDefaultValue, UploadFileResult, UploadToS3Options, UploadToS3Result, base64ToUint8Array, checkFollowStatus, clearMyChannelsFromStorage, cn, components, compressImage, createInputAndSelectFile, debounceFun, decryptImageToArrayBuffer, decryptImageToUint8Array, decryptImageUrl, defaultImageCompressionMaxSizeMB, defaultImageCompressionQuality, defineArrayItemPropSchema, defineCheckboxPropSchema, defineColorPropSchema, defineComponentPropsSchema, defineDatetimePropSchema, defineMaterial, defineNumberPropSchema, defineObjectPropSchema, defineSelectEnumPropSchema, defineSelectPropSchema, defineSwitchPropSchema, defineTextPropSchema, defineTextareaPropSchema, defineTimeRangePropSchema, disablePageScroll, enablePageScroll, encryptBncBuffer, followUser, formatVideoDuration, generateDynamicSign, generateMaterialMap, generateMaterialMapGroupByCategory, generateUUID, getAppId, getAtUserElement, getCookie, getCoverImage, getCurrentSecondTime, getCurrentUserId, getFirstInvalidPasswordChar, getImageCompressionQuality, getImageResolutionFromFile, getPasswordCharacterTypeCount, getPasswordValidationErrorText, getResUrl, getSchemaDefaultProps, getUserId, guessImageContentTypeFromUrl, hashPassword, httpClient, imageCompressionQualityRules, isClient, isEncryptedImageUrl, isMobileDevice, loadComponent, loadHiddenChannelIdsFromStorage, loadMyChannelsFromStorage, normalizeClassName, numToString, overwriteMaterial, parseResolution, parseTextAtUserIds, pxToVw, randomString, removeCookie, replaceAtUserElement, replaceAtUserElementHtmlStr, resolveImageUrl, rewriteComponent, saveHiddenChannelIdsToStorage, secondToTime, setCookie, shouldProbeImageUrl, shouldUseApiResDirectly, stringToNumber, stripHtmlTags, uint8ArrayToBase64, uint8ArrayToNumberArray, unfollowUser, updateUrlParams, uploadFile, uploadToS3WithPresignedUrl, validatePasswordPair, withInspectorMeta };
22
+ export { DefineMaterialOption, eventBus as EventBus, HttpClient, HttpError, INSPECTOR_META_KEY, ImageCompressionQualityRule, InferSchemaProps, MaterialCategory, MaterialComponentMode, MaterialComponentProps, MaterialMap, OverwriteMaterialOption, PASSWORD_ALLOWED_SPECIAL_CHARS, PASSWORD_MAX_LENGTH, PASSWORD_MIN_LENGTH, PasswordValidationResult, PasswordValidationType, PresignedUploadInfo, RequestConfig, RequestMethod, ResponseData, SchemaHasDefaultValue, UploadFileResult, UploadToS3Options, UploadToS3Result, base64ToUint8Array, checkFollowStatus, clearMyChannelsFromStorage, cn, components, compressImage, createInputAndSelectFile, debounceFun, decryptImageToArrayBuffer, decryptImageToUint8Array, decryptImageUrl, defaultImageCompressionMaxSizeMB, defaultImageCompressionQuality, defineArrayItemPropSchema, defineCheckboxPropSchema, defineColorPropSchema, defineComponentPropsSchema, defineDatetimePropSchema, defineMaterial, defineNumberPropSchema, defineObjectPropSchema, defineSelectEnumPropSchema, defineSelectPropSchema, defineSwitchPropSchema, defineTextPropSchema, defineTextareaPropSchema, defineTimeRangePropSchema, disablePageScroll, enablePageScroll, encryptBncBuffer, followUser, formatVideoDuration, generateDynamicSign, generateMaterialMap, generateMaterialMapGroupByCategory, generateUUID, getAppId, getAtUserElement, getCookie, getCoverImage, getCurrentSecondTime, getCurrentUserId, getFirstInvalidPasswordChar, getImageCompressionQuality, getImageResolutionFromFile, getPasswordCharacterTypeCount, getPasswordValidationErrorText, getResUrl, getSchemaDefaultProps, getUserId, guessImageContentTypeFromUrl, hashPassword, httpClient, imageCompressionQualityRules, isClient, isEncryptedImageUrl, isMobileDevice, loadComponent, loadHiddenChannelIdsFromStorage, loadMyChannelsFromStorage, normalizeClassName, numToString, overwriteMaterial, parseResolution, parseTextAtUserIds, pxToVw, randomString, removeCookie, replaceAtUserElement, replaceAtUserElementHtmlStr, resolveImageUrl, rewriteComponent, saveHiddenChannelIdsToStorage, secondToTime, setCookie, shouldProbeImageUrl, shouldUseApiResDirectly, stringToNumber, stripHtmlTags, uint8ArrayToBase64, uint8ArrayToNumberArray, unfollowUser, updateUrlParams, uploadFile, uploadToS3WithPresignedUrl, validatePasswordPair, withInspectorMeta };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@funhub/platform",
3
3
  "type": "module",
4
- "version": "0.1.133",
4
+ "version": "0.1.135",
5
5
  "private": false,
6
6
  "sideEffects": [
7
7
  "**/*.css"
@@ -62,6 +62,9 @@
62
62
  },
63
63
  "./theme.css": "./theme.css"
64
64
  },
65
+ "bin": {
66
+ "funhub-platform": "./dist/cli.mjs"
67
+ },
65
68
  "files": [
66
69
  "config",
67
70
  "dist",
@@ -80,6 +83,7 @@
80
83
  "@aws-sdk/client-s3": "^3.890.0",
81
84
  "@aws-sdk/lib-storage": "^3.890.0",
82
85
  "@base-ui/react": "^1.0.0",
86
+ "@clack/prompts": "^1.1.0",
83
87
  "@ncdai/react-wheel-picker": "^1.1.0",
84
88
  "@next/bundle-analyzer": "^16.1.6",
85
89
  "browser-image-compression": "^2.0.2",
@@ -91,6 +95,7 @@
91
95
  "dayjs": "^1.11.13",
92
96
  "embla-carousel-react": "^8.6.0",
93
97
  "foxact": "^0.2.52",
98
+ "giget": "^3.1.2",
94
99
  "html-react-parser": "^5.2.11",
95
100
  "immer": "^10.1.1",
96
101
  "input-otp": "^1.4.2",
@@ -98,6 +103,7 @@
98
103
  "lucide-react": "^0.562.0",
99
104
  "next-themes": "^0.4.6",
100
105
  "nuqs": "^2.8.6",
106
+ "package-manager-detector": "^1.6.0",
101
107
  "photoswipe": "^5.4.4",
102
108
  "react-content-loader": "^7.1.2",
103
109
  "react-easy-crop": "^5.5.6",
@@ -109,8 +115,7 @@
109
115
  "xgplayer": "^3.0.23",
110
116
  "xgplayer-hls": "^3.0.23",
111
117
  "zod": "^4.3.6",
112
- "zustand": "^5.0.9",
113
- "create-funhub": "0.1.0"
118
+ "zustand": "^5.0.9"
114
119
  },
115
120
  "devDependencies": {
116
121
  "@svgr/webpack": "^8.1.0",