@funhub/platform 0.1.125 → 0.1.126

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 (138) hide show
  1. package/dist/components/biz/business/banner/variants/basic-banner/inspector-schema.d.mts +5 -5
  2. package/dist/components/biz/business/banner/variants/basic-banner/inspector-schema.mjs +1 -1
  3. package/dist/components/biz/business/banner/variants/basic-banner/material.d.mts +4 -6
  4. package/dist/components/biz/business/banner/variants/basic-banner/material.mjs +1 -1
  5. package/dist/components/biz/business/banner/variants/basic-banner/runtime/client.d.mts +1 -2
  6. package/dist/components/biz/business/banner-carousel/material.d.mts +4 -6
  7. package/dist/components/biz/business/banner-carousel/material.mjs +1 -1
  8. package/dist/components/biz/business/banner-carousel/schema.d.mts +5 -5
  9. package/dist/components/biz/business/banner-carousel/schema.mjs +1 -1
  10. package/dist/components/biz/business/channel-list/material.d.mts +4 -6
  11. package/dist/components/biz/business/channel-list/material.mjs +1 -1
  12. package/dist/components/biz/business/channel-list/schema.d.mts +5 -5
  13. package/dist/components/biz/business/channel-list/schema.mjs +1 -1
  14. package/dist/components/biz/business/detail/shared/registry.d.mts +25 -27
  15. package/dist/components/biz/business/detail/shared/registry.mjs +1 -1
  16. package/dist/components/biz/business/detail/video-detail-actions/material.d.mts +2 -2
  17. package/dist/components/biz/business/detail/video-detail-actions/material.mjs +1 -1
  18. package/dist/components/biz/business/detail/video-detail-actions/schema.d.mts +1 -2
  19. package/dist/components/biz/business/detail/video-detail-actions/schema.mjs +1 -1
  20. package/dist/components/biz/business/detail/video-detail-info/material.d.mts +4 -6
  21. package/dist/components/biz/business/detail/video-detail-info/material.mjs +1 -1
  22. package/dist/components/biz/business/detail/video-detail-info/schema.d.mts +4 -4
  23. package/dist/components/biz/business/detail/video-detail-info/schema.mjs +1 -1
  24. package/dist/components/biz/business/detail/video-detail-info-title-tags-episodes/material.d.mts +4 -6
  25. package/dist/components/biz/business/detail/video-detail-info-title-tags-episodes/material.mjs +1 -1
  26. package/dist/components/biz/business/detail/video-detail-info-title-tags-episodes/schema.d.mts +4 -4
  27. package/dist/components/biz/business/detail/video-detail-info-title-tags-episodes/schema.mjs +1 -1
  28. package/dist/components/biz/business/detail/video-detail-player/material.d.mts +2 -2
  29. package/dist/components/biz/business/detail/video-detail-player/material.mjs +1 -1
  30. package/dist/components/biz/business/detail/video-detail-player/schema.d.mts +1 -2
  31. package/dist/components/biz/business/detail/video-detail-player/schema.mjs +1 -1
  32. package/dist/components/biz/business/detail/video-detail-recommend/material.d.mts +10 -12
  33. package/dist/components/biz/business/detail/video-detail-recommend/material.mjs +1 -1
  34. package/dist/components/biz/business/detail/video-detail-recommend/schema.d.mts +11 -11
  35. package/dist/components/biz/business/detail/video-detail-recommend/schema.mjs +1 -1
  36. package/dist/components/biz/business/floating-ball/material.d.mts +4 -6
  37. package/dist/components/biz/business/floating-ball/material.mjs +1 -1
  38. package/dist/components/biz/business/floating-ball/schema.d.mts +4 -4
  39. package/dist/components/biz/business/floating-ball/schema.mjs +1 -1
  40. package/dist/components/biz/business/header-search/header-avatar-icon/material.d.mts +2 -2
  41. package/dist/components/biz/business/header-search/header-avatar-icon/material.mjs +1 -1
  42. package/dist/components/biz/business/header-search/header-avatar-icon/schema.d.mts +1 -2
  43. package/dist/components/biz/business/header-search/header-avatar-icon/schema.mjs +1 -1
  44. package/dist/components/biz/business/header-search/header-avatar-logo-search/material.d.mts +4 -6
  45. package/dist/components/biz/business/header-search/header-avatar-logo-search/material.mjs +1 -1
  46. package/dist/components/biz/business/header-search/header-avatar-logo-search/schema.d.mts +4 -4
  47. package/dist/components/biz/business/header-search/header-avatar-logo-search/schema.mjs +1 -1
  48. package/dist/components/biz/business/header-search/header-avatar-logo-search-icon/material.d.mts +4 -6
  49. package/dist/components/biz/business/header-search/header-avatar-logo-search-icon/material.mjs +1 -1
  50. package/dist/components/biz/business/header-search/header-avatar-logo-search-icon/schema.d.mts +4 -4
  51. package/dist/components/biz/business/header-search/header-avatar-logo-search-icon/schema.mjs +1 -1
  52. package/dist/components/biz/business/header-search/header-logo-search/material.d.mts +4 -6
  53. package/dist/components/biz/business/header-search/header-logo-search/material.mjs +1 -1
  54. package/dist/components/biz/business/header-search/header-logo-search/schema.d.mts +4 -4
  55. package/dist/components/biz/business/header-search/header-logo-search/schema.mjs +1 -1
  56. package/dist/components/biz/business/header-search/header-search/material.d.mts +2 -2
  57. package/dist/components/biz/business/header-search/header-search/material.mjs +1 -1
  58. package/dist/components/biz/business/header-search/header-search/schema.d.mts +1 -2
  59. package/dist/components/biz/business/header-search/header-search/schema.mjs +1 -1
  60. package/dist/components/biz/business/home-recommend/home-recommend-grid/client.d.mts +1 -2
  61. package/dist/components/biz/business/home-recommend/home-recommend-grid/inspector-schema.d.mts +13 -13
  62. package/dist/components/biz/business/home-recommend/home-recommend-grid/inspector-schema.mjs +1 -1
  63. package/dist/components/biz/business/home-recommend/home-recommend-grid/material.d.mts +12 -14
  64. package/dist/components/biz/business/home-recommend/home-recommend-grid/material.mjs +1 -1
  65. package/dist/components/biz/business/home-recommend/home-recommend-waterfall/client.d.mts +1 -2
  66. package/dist/components/biz/business/home-recommend/home-recommend-waterfall/inspector-schema.d.mts +11 -11
  67. package/dist/components/biz/business/home-recommend/home-recommend-waterfall/inspector-schema.mjs +1 -1
  68. package/dist/components/biz/business/home-recommend/home-recommend-waterfall/material.d.mts +10 -12
  69. package/dist/components/biz/business/home-recommend/home-recommend-waterfall/material.mjs +1 -1
  70. package/dist/components/biz/business/image-text-recommend/client.d.mts +1 -2
  71. package/dist/components/biz/business/image-text-recommend/material.d.mts +19 -21
  72. package/dist/components/biz/business/image-text-recommend/material.mjs +1 -1
  73. package/dist/components/biz/business/image-text-recommend/schema.d.mts +18 -19
  74. package/dist/components/biz/business/image-text-recommend/schema.mjs +1 -1
  75. package/dist/components/biz/business/large-feature-grid/material.d.mts +3 -3
  76. package/dist/components/biz/business/large-feature-grid/material.mjs +1 -1
  77. package/dist/components/biz/business/large-feature-grid/schema.mjs +1 -1
  78. package/dist/components/biz/business/marquee/client.d.mts +1 -2
  79. package/dist/components/biz/business/marquee/material.d.mts +15 -17
  80. package/dist/components/biz/business/marquee/material.mjs +1 -1
  81. package/dist/components/biz/business/marquee/schema.d.mts +14 -15
  82. package/dist/components/biz/business/marquee/schema.mjs +1 -1
  83. package/dist/components/biz/business/profile/profile-header/material.d.mts +3 -3
  84. package/dist/components/biz/business/profile/profile-header/material.mjs +1 -1
  85. package/dist/components/biz/business/profile/profile-header/schema.d.mts +1 -2
  86. package/dist/components/biz/business/profile/profile-header/schema.mjs +1 -1
  87. package/dist/components/biz/business/profile/profile-main/material.d.mts +2 -2
  88. package/dist/components/biz/business/profile/profile-main/material.mjs +1 -1
  89. package/dist/components/biz/business/profile/profile-main/schema.d.mts +1 -2
  90. package/dist/components/biz/business/profile/profile-main/schema.mjs +1 -1
  91. package/dist/components/biz/business/profile/profile-main/tabs/collect-tab/client.d.mts +1 -2
  92. package/dist/components/biz/business/profile/profile-main/tabs/history-tab/client.d.mts +1 -2
  93. package/dist/components/biz/business/profile/profile-main/tabs/like-tab/client.d.mts +1 -2
  94. package/dist/components/biz/business/profile/profile-main/tabs/publish-tab/client.d.mts +1 -2
  95. package/dist/components/biz/business/search-history/client.d.mts +1 -2
  96. package/dist/components/biz/business/search-history/material.d.mts +4 -6
  97. package/dist/components/biz/business/search-history/material.mjs +1 -1
  98. package/dist/components/biz/business/search-history/schema.d.mts +3 -4
  99. package/dist/components/biz/business/search-history/schema.mjs +1 -1
  100. package/dist/components/biz/business/search-input/material.d.mts +2 -2
  101. package/dist/components/biz/business/search-input/material.mjs +1 -1
  102. package/dist/components/biz/business/search-input/schema.d.mts +1 -2
  103. package/dist/components/biz/business/search-input/schema.mjs +1 -1
  104. package/dist/components/biz/business/shortcut-grid/material.d.mts +9 -11
  105. package/dist/components/biz/business/shortcut-grid/material.mjs +1 -1
  106. package/dist/components/biz/business/shortcut-grid/schema.d.mts +9 -9
  107. package/dist/components/biz/business/shortcut-grid/schema.mjs +1 -1
  108. package/dist/components/biz/business/tab-bar/material.d.mts +2 -2
  109. package/dist/components/biz/business/tab-bar/material.mjs +1 -1
  110. package/dist/components/biz/business/tab-bar/schema.d.mts +1 -2
  111. package/dist/components/biz/business/tab-bar/schema.mjs +1 -1
  112. package/dist/components/biz/business/text-recommend/client.d.mts +1 -2
  113. package/dist/components/biz/business/text-recommend/material.d.mts +6 -8
  114. package/dist/components/biz/business/text-recommend/material.mjs +1 -1
  115. package/dist/components/biz/business/text-recommend/schema.d.mts +5 -6
  116. package/dist/components/biz/business/text-recommend/schema.mjs +1 -1
  117. package/dist/components/biz/example/button/material.d.mts +7 -9
  118. package/dist/components/biz/example/button/material.mjs +1 -1
  119. package/dist/components/biz/example/button/schema.d.mts +8 -8
  120. package/dist/components/biz/example/button/schema.mjs +1 -1
  121. package/dist/components/biz/renderer/renderer.d.mts +1 -1
  122. package/dist/components/biz/renderer/renderer.mjs +1 -1
  123. package/dist/components/pages/login/verify.mjs +3 -3
  124. package/dist/components/pages/settings/_components/reset-password-drawer.mjs +4 -1
  125. package/dist/components/ui/badge.d.mts +1 -1
  126. package/dist/components/ui/button.d.mts +2 -2
  127. package/dist/materials.d.mts +10 -10
  128. package/dist/service/register-by-verify-email-code.d.mts +15 -0
  129. package/dist/service/register-by-verify-email-code.mjs +2 -0
  130. package/dist/service.d.mts +2 -1
  131. package/dist/service.mjs +1 -1
  132. package/dist/utils/schema/inspector.d.mts +141 -141
  133. package/dist/utils/schema/material.d.mts +2 -2
  134. package/dist/utils/schema/schema.d.mts +35 -70
  135. package/dist/utils/schema/schema.mjs +1 -1
  136. package/dist/utils/schema/utils.d.mts +0 -6
  137. package/dist/utils.d.mts +5 -5
  138. package/package.json +2 -1
@@ -1,147 +1,147 @@
1
1
 
2
- import z$1 from "zod";
2
+ import { z } from "zod";
3
3
 
4
4
  //#region utils/schema/inspector.d.ts
5
5
  type InspectorFieldOption<T> = Omit<T, 'type'>;
6
- declare const textInspectorFieldSchema: z$1.ZodObject<{
7
- type: z$1.ZodLiteral<"text">;
8
- defaultValue: z$1.ZodOptional<z$1.ZodString>;
9
- label: z$1.ZodString;
10
- description: z$1.ZodOptional<z$1.ZodString>;
11
- }, z$1.core.$strip>;
12
- type TextInspectorFieldOption = InspectorFieldOption<z$1.infer<typeof textInspectorFieldSchema>>;
13
- declare const textareaInspectorFieldSchema: z$1.ZodObject<{
14
- type: z$1.ZodLiteral<"textarea">;
15
- defaultValue: z$1.ZodOptional<z$1.ZodString>;
16
- label: z$1.ZodString;
17
- description: z$1.ZodOptional<z$1.ZodString>;
18
- }, z$1.core.$strip>;
19
- type TextareaInspectorFieldOption = InspectorFieldOption<z$1.infer<typeof textareaInspectorFieldSchema>>;
20
- declare const numberInspectorFieldSchema: z$1.ZodObject<{
21
- type: z$1.ZodLiteral<"number">;
22
- defaultValue: z$1.ZodOptional<z$1.ZodNumber>;
23
- label: z$1.ZodString;
24
- description: z$1.ZodOptional<z$1.ZodString>;
25
- }, z$1.core.$strip>;
26
- type NumberInspectorFieldOption = InspectorFieldOption<z$1.infer<typeof numberInspectorFieldSchema>>;
27
- declare const colorInspectorFieldSchema: z$1.ZodObject<{
28
- type: z$1.ZodLiteral<"color">;
29
- defaultValue: z$1.ZodOptional<z$1.ZodString>;
30
- label: z$1.ZodString;
31
- description: z$1.ZodOptional<z$1.ZodString>;
32
- }, z$1.core.$strip>;
33
- type ColorInspectorFieldOption = InspectorFieldOption<z$1.infer<typeof colorInspectorFieldSchema>>;
34
- declare const datetimeInspectorFieldSchema: z$1.ZodObject<{
35
- type: z$1.ZodLiteral<"datetime">;
36
- defaultValue: z$1.ZodOptional<z$1.ZodString>;
37
- label: z$1.ZodString;
38
- description: z$1.ZodOptional<z$1.ZodString>;
39
- }, z$1.core.$strip>;
40
- type DatetimeInspectorFieldOption = InspectorFieldOption<z$1.infer<typeof datetimeInspectorFieldSchema>>;
41
- declare const timeRangeInspectorFieldSchema: z$1.ZodObject<{
42
- type: z$1.ZodLiteral<"timeRange">;
43
- defaultValue: z$1.ZodOptional<z$1.ZodObject<{
44
- start: z$1.ZodString;
45
- end: z$1.ZodString;
46
- }, z$1.core.$strip>>;
47
- label: z$1.ZodString;
48
- description: z$1.ZodOptional<z$1.ZodString>;
49
- }, z$1.core.$strip>;
50
- type TimeRangeInspectorFieldOption = InspectorFieldOption<z$1.infer<typeof timeRangeInspectorFieldSchema>>;
51
- declare const selectInspectorFieldSchema: z$1.ZodObject<{
52
- type: z$1.ZodLiteral<"select">;
53
- defaultValue: z$1.ZodOptional<z$1.ZodString>;
54
- label: z$1.ZodString;
55
- description: z$1.ZodOptional<z$1.ZodString>;
56
- }, z$1.core.$strip>;
57
- type SelectInspectorFieldOption = InspectorFieldOption<z$1.infer<typeof selectInspectorFieldSchema>>;
58
- declare const checkboxInspectorFieldSchema: z$1.ZodObject<{
59
- type: z$1.ZodLiteral<"checkbox">;
60
- defaultValue: z$1.ZodOptional<z$1.ZodBoolean>;
61
- label: z$1.ZodString;
62
- description: z$1.ZodOptional<z$1.ZodString>;
63
- }, z$1.core.$strip>;
64
- type CheckboxInspectorFieldOption = InspectorFieldOption<z$1.infer<typeof checkboxInspectorFieldSchema>>;
65
- declare const switchInspectorFieldSchema: z$1.ZodObject<{
66
- type: z$1.ZodLiteral<"switch">;
67
- defaultValue: z$1.ZodOptional<z$1.ZodBoolean>;
68
- label: z$1.ZodString;
69
- description: z$1.ZodOptional<z$1.ZodString>;
70
- }, z$1.core.$strip>;
71
- type SwitchInspectorFieldOption = InspectorFieldOption<z$1.infer<typeof switchInspectorFieldSchema>>;
72
- declare const arrayInspectorFieldSchema: z$1.ZodObject<{
73
- type: z$1.ZodLiteral<"array">;
74
- defaultValue: z$1.ZodOptional<z$1.ZodArray<z$1.ZodUnknown>>;
75
- label: z$1.ZodString;
76
- description: z$1.ZodOptional<z$1.ZodString>;
77
- }, z$1.core.$strip>;
78
- type ArrayInspectorFieldOption = InspectorFieldOption<z$1.infer<typeof arrayInspectorFieldSchema>>;
79
- declare const objectInspectorFieldSchema: z$1.ZodObject<{
80
- type: z$1.ZodLiteral<"object">;
81
- defaultValue: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>>;
82
- label: z$1.ZodString;
83
- description: z$1.ZodOptional<z$1.ZodString>;
84
- }, z$1.core.$strip>;
85
- type ObjectInspectorFieldOption = InspectorFieldOption<z$1.infer<typeof objectInspectorFieldSchema>>;
86
- declare const componentInspectorFieldMetaSchema: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{
87
- type: z$1.ZodLiteral<"text">;
88
- defaultValue: z$1.ZodOptional<z$1.ZodString>;
89
- label: z$1.ZodString;
90
- description: z$1.ZodOptional<z$1.ZodString>;
91
- }, z$1.core.$strip>, z$1.ZodObject<{
92
- type: z$1.ZodLiteral<"textarea">;
93
- defaultValue: z$1.ZodOptional<z$1.ZodString>;
94
- label: z$1.ZodString;
95
- description: z$1.ZodOptional<z$1.ZodString>;
96
- }, z$1.core.$strip>, z$1.ZodObject<{
97
- type: z$1.ZodLiteral<"number">;
98
- defaultValue: z$1.ZodOptional<z$1.ZodNumber>;
99
- label: z$1.ZodString;
100
- description: z$1.ZodOptional<z$1.ZodString>;
101
- }, z$1.core.$strip>, z$1.ZodObject<{
102
- type: z$1.ZodLiteral<"color">;
103
- defaultValue: z$1.ZodOptional<z$1.ZodString>;
104
- label: z$1.ZodString;
105
- description: z$1.ZodOptional<z$1.ZodString>;
106
- }, z$1.core.$strip>, z$1.ZodObject<{
107
- type: z$1.ZodLiteral<"datetime">;
108
- defaultValue: z$1.ZodOptional<z$1.ZodString>;
109
- label: z$1.ZodString;
110
- description: z$1.ZodOptional<z$1.ZodString>;
111
- }, z$1.core.$strip>, z$1.ZodObject<{
112
- type: z$1.ZodLiteral<"timeRange">;
113
- defaultValue: z$1.ZodOptional<z$1.ZodObject<{
114
- start: z$1.ZodString;
115
- end: z$1.ZodString;
116
- }, z$1.core.$strip>>;
117
- label: z$1.ZodString;
118
- description: z$1.ZodOptional<z$1.ZodString>;
119
- }, z$1.core.$strip>, z$1.ZodObject<{
120
- type: z$1.ZodLiteral<"select">;
121
- defaultValue: z$1.ZodOptional<z$1.ZodString>;
122
- label: z$1.ZodString;
123
- description: z$1.ZodOptional<z$1.ZodString>;
124
- }, z$1.core.$strip>, z$1.ZodObject<{
125
- type: z$1.ZodLiteral<"checkbox">;
126
- defaultValue: z$1.ZodOptional<z$1.ZodBoolean>;
127
- label: z$1.ZodString;
128
- description: z$1.ZodOptional<z$1.ZodString>;
129
- }, z$1.core.$strip>, z$1.ZodObject<{
130
- type: z$1.ZodLiteral<"switch">;
131
- defaultValue: z$1.ZodOptional<z$1.ZodBoolean>;
132
- label: z$1.ZodString;
133
- description: z$1.ZodOptional<z$1.ZodString>;
134
- }, z$1.core.$strip>, z$1.ZodObject<{
135
- type: z$1.ZodLiteral<"array">;
136
- defaultValue: z$1.ZodOptional<z$1.ZodArray<z$1.ZodUnknown>>;
137
- label: z$1.ZodString;
138
- description: z$1.ZodOptional<z$1.ZodString>;
139
- }, z$1.core.$strip>, z$1.ZodObject<{
140
- type: z$1.ZodLiteral<"object">;
141
- defaultValue: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>>;
142
- label: z$1.ZodString;
143
- description: z$1.ZodOptional<z$1.ZodString>;
144
- }, z$1.core.$strip>], "type">;
145
- type ComponentInspectorFieldMeta = z$1.infer<typeof componentInspectorFieldMetaSchema>;
6
+ declare const textInspectorFieldSchema: z.ZodObject<{
7
+ type: z.ZodLiteral<"text">;
8
+ defaultValue: z.ZodOptional<z.ZodString>;
9
+ label: z.ZodString;
10
+ description: z.ZodOptional<z.ZodString>;
11
+ }, z.core.$strip>;
12
+ type TextInspectorFieldOption = InspectorFieldOption<z.infer<typeof textInspectorFieldSchema>>;
13
+ declare const textareaInspectorFieldSchema: z.ZodObject<{
14
+ type: z.ZodLiteral<"textarea">;
15
+ defaultValue: z.ZodOptional<z.ZodString>;
16
+ label: z.ZodString;
17
+ description: z.ZodOptional<z.ZodString>;
18
+ }, z.core.$strip>;
19
+ type TextareaInspectorFieldOption = InspectorFieldOption<z.infer<typeof textareaInspectorFieldSchema>>;
20
+ declare const numberInspectorFieldSchema: z.ZodObject<{
21
+ type: z.ZodLiteral<"number">;
22
+ defaultValue: z.ZodOptional<z.ZodNumber>;
23
+ label: z.ZodString;
24
+ description: z.ZodOptional<z.ZodString>;
25
+ }, z.core.$strip>;
26
+ type NumberInspectorFieldOption = InspectorFieldOption<z.infer<typeof numberInspectorFieldSchema>>;
27
+ declare const colorInspectorFieldSchema: z.ZodObject<{
28
+ type: z.ZodLiteral<"color">;
29
+ defaultValue: z.ZodOptional<z.ZodString>;
30
+ label: z.ZodString;
31
+ description: z.ZodOptional<z.ZodString>;
32
+ }, z.core.$strip>;
33
+ type ColorInspectorFieldOption = InspectorFieldOption<z.infer<typeof colorInspectorFieldSchema>>;
34
+ declare const datetimeInspectorFieldSchema: z.ZodObject<{
35
+ type: z.ZodLiteral<"datetime">;
36
+ defaultValue: z.ZodOptional<z.ZodString>;
37
+ label: z.ZodString;
38
+ description: z.ZodOptional<z.ZodString>;
39
+ }, z.core.$strip>;
40
+ type DatetimeInspectorFieldOption = InspectorFieldOption<z.infer<typeof datetimeInspectorFieldSchema>>;
41
+ declare const timeRangeInspectorFieldSchema: z.ZodObject<{
42
+ type: z.ZodLiteral<"timeRange">;
43
+ defaultValue: z.ZodOptional<z.ZodObject<{
44
+ start: z.ZodString;
45
+ end: z.ZodString;
46
+ }, z.core.$strip>>;
47
+ label: z.ZodString;
48
+ description: z.ZodOptional<z.ZodString>;
49
+ }, z.core.$strip>;
50
+ type TimeRangeInspectorFieldOption = InspectorFieldOption<z.infer<typeof timeRangeInspectorFieldSchema>>;
51
+ declare const selectInspectorFieldSchema: z.ZodObject<{
52
+ type: z.ZodLiteral<"select">;
53
+ defaultValue: z.ZodOptional<z.ZodString>;
54
+ label: z.ZodString;
55
+ description: z.ZodOptional<z.ZodString>;
56
+ }, z.core.$strip>;
57
+ type SelectInspectorFieldOption = InspectorFieldOption<z.infer<typeof selectInspectorFieldSchema>>;
58
+ declare const checkboxInspectorFieldSchema: z.ZodObject<{
59
+ type: z.ZodLiteral<"checkbox">;
60
+ defaultValue: z.ZodOptional<z.ZodBoolean>;
61
+ label: z.ZodString;
62
+ description: z.ZodOptional<z.ZodString>;
63
+ }, z.core.$strip>;
64
+ type CheckboxInspectorFieldOption = InspectorFieldOption<z.infer<typeof checkboxInspectorFieldSchema>>;
65
+ declare const switchInspectorFieldSchema: z.ZodObject<{
66
+ type: z.ZodLiteral<"switch">;
67
+ defaultValue: z.ZodOptional<z.ZodBoolean>;
68
+ label: z.ZodString;
69
+ description: z.ZodOptional<z.ZodString>;
70
+ }, z.core.$strip>;
71
+ type SwitchInspectorFieldOption = InspectorFieldOption<z.infer<typeof switchInspectorFieldSchema>>;
72
+ declare const arrayInspectorFieldSchema: z.ZodObject<{
73
+ type: z.ZodLiteral<"array">;
74
+ defaultValue: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
75
+ label: z.ZodString;
76
+ description: z.ZodOptional<z.ZodString>;
77
+ }, z.core.$strip>;
78
+ type ArrayInspectorFieldOption = InspectorFieldOption<z.infer<typeof arrayInspectorFieldSchema>>;
79
+ declare const objectInspectorFieldSchema: z.ZodObject<{
80
+ type: z.ZodLiteral<"object">;
81
+ defaultValue: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
82
+ label: z.ZodString;
83
+ description: z.ZodOptional<z.ZodString>;
84
+ }, z.core.$strip>;
85
+ type ObjectInspectorFieldOption = InspectorFieldOption<z.infer<typeof objectInspectorFieldSchema>>;
86
+ declare const componentInspectorFieldMetaSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
87
+ type: z.ZodLiteral<"text">;
88
+ defaultValue: z.ZodOptional<z.ZodString>;
89
+ label: z.ZodString;
90
+ description: z.ZodOptional<z.ZodString>;
91
+ }, z.core.$strip>, z.ZodObject<{
92
+ type: z.ZodLiteral<"textarea">;
93
+ defaultValue: z.ZodOptional<z.ZodString>;
94
+ label: z.ZodString;
95
+ description: z.ZodOptional<z.ZodString>;
96
+ }, z.core.$strip>, z.ZodObject<{
97
+ type: z.ZodLiteral<"number">;
98
+ defaultValue: z.ZodOptional<z.ZodNumber>;
99
+ label: z.ZodString;
100
+ description: z.ZodOptional<z.ZodString>;
101
+ }, z.core.$strip>, z.ZodObject<{
102
+ type: z.ZodLiteral<"color">;
103
+ defaultValue: z.ZodOptional<z.ZodString>;
104
+ label: z.ZodString;
105
+ description: z.ZodOptional<z.ZodString>;
106
+ }, z.core.$strip>, z.ZodObject<{
107
+ type: z.ZodLiteral<"datetime">;
108
+ defaultValue: z.ZodOptional<z.ZodString>;
109
+ label: z.ZodString;
110
+ description: z.ZodOptional<z.ZodString>;
111
+ }, z.core.$strip>, z.ZodObject<{
112
+ type: z.ZodLiteral<"timeRange">;
113
+ defaultValue: z.ZodOptional<z.ZodObject<{
114
+ start: z.ZodString;
115
+ end: z.ZodString;
116
+ }, z.core.$strip>>;
117
+ label: z.ZodString;
118
+ description: z.ZodOptional<z.ZodString>;
119
+ }, z.core.$strip>, z.ZodObject<{
120
+ type: z.ZodLiteral<"select">;
121
+ defaultValue: z.ZodOptional<z.ZodString>;
122
+ label: z.ZodString;
123
+ description: z.ZodOptional<z.ZodString>;
124
+ }, z.core.$strip>, z.ZodObject<{
125
+ type: z.ZodLiteral<"checkbox">;
126
+ defaultValue: z.ZodOptional<z.ZodBoolean>;
127
+ label: z.ZodString;
128
+ description: z.ZodOptional<z.ZodString>;
129
+ }, z.core.$strip>, z.ZodObject<{
130
+ type: z.ZodLiteral<"switch">;
131
+ defaultValue: z.ZodOptional<z.ZodBoolean>;
132
+ label: z.ZodString;
133
+ description: z.ZodOptional<z.ZodString>;
134
+ }, z.core.$strip>, z.ZodObject<{
135
+ type: z.ZodLiteral<"array">;
136
+ defaultValue: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
137
+ label: z.ZodString;
138
+ description: z.ZodOptional<z.ZodString>;
139
+ }, z.core.$strip>, z.ZodObject<{
140
+ type: z.ZodLiteral<"object">;
141
+ defaultValue: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
142
+ label: z.ZodString;
143
+ description: z.ZodOptional<z.ZodString>;
144
+ }, z.core.$strip>], "type">;
145
+ type ComponentInspectorFieldMeta = z.infer<typeof componentInspectorFieldMetaSchema>;
146
146
  //#endregion
147
147
  export { ArrayInspectorFieldOption, CheckboxInspectorFieldOption, ColorInspectorFieldOption, ComponentInspectorFieldMeta, DatetimeInspectorFieldOption, NumberInspectorFieldOption, ObjectInspectorFieldOption, SelectInspectorFieldOption, SwitchInspectorFieldOption, TextInspectorFieldOption, TextareaInspectorFieldOption, TimeRangeInspectorFieldOption };
@@ -1,7 +1,7 @@
1
1
 
2
2
  import { InferSchemaProps } from "./schema.mjs";
3
3
  import { ComponentProps, ComponentType, ReactNode } from "react";
4
- import z$1 from "zod";
4
+ import { z } from "zod";
5
5
 
6
6
  //#region utils/schema/material.d.ts
7
7
  /**
@@ -17,7 +17,7 @@ declare const MATERIAL_CATEGORY: {
17
17
  readonly 详情页: "详情页";
18
18
  };
19
19
  type MaterialCategory = typeof MATERIAL_CATEGORY[keyof typeof MATERIAL_CATEGORY];
20
- type MaterialPropsSchema = z$1.ZodObject<z$1.ZodRawShape>;
20
+ type MaterialPropsSchema = z.ZodObject<z.ZodRawShape>;
21
21
  type MaterialSchemaProps<TSchema extends MaterialPropsSchema> = InferSchemaProps<TSchema>;
22
22
  type InternalMaterialSchemaKey = 'mode';
23
23
  type SchemaExtraKeys<TSchemaProps, TComponentProps> = Exclude<keyof TSchemaProps, keyof TComponentProps | InternalMaterialSchemaKey>;
@@ -1,14 +1,14 @@
1
1
 
2
2
  import { ArrayInspectorFieldOption, CheckboxInspectorFieldOption, ColorInspectorFieldOption, ComponentInspectorFieldMeta, DatetimeInspectorFieldOption, NumberInspectorFieldOption, ObjectInspectorFieldOption, SelectInspectorFieldOption, SwitchInspectorFieldOption, TextInspectorFieldOption, TextareaInspectorFieldOption, TimeRangeInspectorFieldOption } from "./inspector.mjs";
3
- import z$1 from "zod";
3
+ import { z } from "zod";
4
4
 
5
5
  //#region utils/schema/schema.d.ts
6
6
  declare const INSPECTOR_META_KEY = "inspector";
7
- declare const materialComponentModeSchema: z$1.ZodEnum<{
7
+ declare const materialComponentModeSchema: z.ZodEnum<{
8
8
  renderer: "renderer";
9
9
  editor: "editor";
10
10
  }>;
11
- type MaterialComponentMode = z$1.infer<typeof materialComponentModeSchema>;
11
+ type MaterialComponentMode = z.infer<typeof materialComponentModeSchema>;
12
12
  type MaterialComponentProps<T = object> = {
13
13
  mode: MaterialComponentMode;
14
14
  } & T;
@@ -18,62 +18,55 @@ type MaterialComponentProps<T = object> = {
18
18
  * @param inspectorMeta
19
19
  * @returns
20
20
  */
21
- declare function withInspectorMeta<T extends z$1.ZodTypeAny>(schema: T, inspectorMeta: ComponentInspectorFieldMeta): T;
21
+ declare function withInspectorMeta<T extends z.ZodTypeAny>(schema: T, inspectorMeta: ComponentInspectorFieldMeta): T;
22
22
  /**
23
23
  * 定义组件props schema
24
24
  * 使用defineXXXPropSchema定义defaultValue时,目前仅限于在第一层定义
25
25
  * @param shape
26
26
  * @returns
27
27
  */
28
- declare function defineComponentPropsSchema<const TShape extends z$1.ZodRawShape>(shape: TShape): z$1.ZodObject<(keyof TShape & "mode" extends never ? { -readonly [P in keyof TShape]: TShape[P] } & {
29
- mode: z$1.ZodOptional<z$1.ZodEnum<{
28
+ declare function defineComponentPropsSchema<const TShape extends z.ZodRawShape>(shape: TShape): z.ZodObject<(keyof TShape & "mode" extends never ? { -readonly [P in keyof TShape]: TShape[P] } & {
29
+ mode: z.ZodOptional<z.ZodEnum<{
30
30
  renderer: "renderer";
31
31
  editor: "editor";
32
32
  }>>;
33
33
  } : { [K in keyof { -readonly [P in keyof TShape]: TShape[P] } as K extends "mode" ? never : K]: { -readonly [P in keyof TShape]: TShape[P] }[K] } & {
34
- mode: z$1.ZodOptional<z$1.ZodEnum<{
34
+ mode: z.ZodOptional<z.ZodEnum<{
35
35
  renderer: "renderer";
36
36
  editor: "editor";
37
37
  }>>;
38
- }) extends infer T ? { [k in keyof T]: T[k] } : never, z$1.core.$strip>;
38
+ }) extends infer T ? { [k in keyof T]: T[k] } : never, z.core.$strip>;
39
39
  interface SchemaHasDefaultValue {
40
40
  readonly __schemaHasDefaultValueBrand: never;
41
41
  }
42
42
  /**
43
43
  * 推导 schema 的 props 类型,兼容空 schema 的 strict index signature。
44
44
  */
45
- type InferSchemaProps<TSchema extends z$1.ZodTypeAny> = z$1.infer<TSchema> extends Record<string, never> ? {} : z$1.infer<TSchema>;
46
- type SchemaByRequired<TSchema extends z$1.ZodTypeAny, TRequired extends boolean | undefined> = TRequired extends false ? z$1.ZodOptional<TSchema> : TSchema;
47
- type MaybeSchemaWithDefaultValue<TSchema extends z$1.ZodTypeAny, TOption extends {
45
+ type InferSchemaProps<TSchema extends z.ZodTypeAny> = z.infer<TSchema>;
46
+ type SchemaByRequired<TSchema extends z.ZodTypeAny, TRequired extends boolean | undefined> = TRequired extends false ? z.ZodOptional<TSchema> : TSchema;
47
+ type MaybeSchemaWithDefaultValue<TSchema extends z.ZodTypeAny, TOption extends {
48
48
  defaultValue?: unknown;
49
49
  }> = TOption extends {
50
50
  defaultValue: infer TDefaultValue;
51
51
  } ? [TDefaultValue] extends [undefined] ? TSchema : TSchema & SchemaHasDefaultValue : TSchema;
52
52
  declare function defineTextPropSchema<const TOption extends TextInspectorFieldOption & {
53
53
  required?: boolean;
54
- }>(option: TOption): MaybeSchemaWithDefaultValue<SchemaByRequired<z$1.ZodString, TOption['required']>, TOption>;
54
+ }>(option: TOption): MaybeSchemaWithDefaultValue<SchemaByRequired<z.ZodString, TOption['required']>, TOption>;
55
55
  declare function defineTextareaPropSchema<const TOption extends TextareaInspectorFieldOption & {
56
56
  required?: boolean;
57
- }>(option: TOption): MaybeSchemaWithDefaultValue<SchemaByRequired<z$1.ZodString, TOption['required']>, TOption>;
57
+ }>(option: TOption): MaybeSchemaWithDefaultValue<SchemaByRequired<z.ZodString, TOption['required']>, TOption>;
58
58
  declare function defineNumberPropSchema<const TOption extends NumberInspectorFieldOption & {
59
59
  required?: boolean;
60
- }>(option: TOption): MaybeSchemaWithDefaultValue<SchemaByRequired<z$1.ZodNumber, TOption['required']>, TOption>;
60
+ }>(option: TOption): MaybeSchemaWithDefaultValue<SchemaByRequired<z.ZodNumber, TOption['required']>, TOption>;
61
61
  declare function defineColorPropSchema<const TOption extends ColorInspectorFieldOption & {
62
62
  required?: boolean;
63
- }>(option: TOption): MaybeSchemaWithDefaultValue<SchemaByRequired<z$1.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
- */
63
+ }>(option: TOption): MaybeSchemaWithDefaultValue<SchemaByRequired<z.ZodString, TOption['required']>, TOption>;
70
64
  declare function defineDatetimePropSchema<const TOption extends DatetimeInspectorFieldOption & {
71
65
  required?: boolean;
72
- }>(option: TOption): MaybeSchemaWithDefaultValue<SchemaByRequired<z$1.ZodString, TOption['required']>, TOption>;
73
- /** 时间段结构:{ start: 开始时间, end: 结束时间 },格式 YYYY-MM-DD HH:mm:ss */
66
+ }>(option: TOption): MaybeSchemaWithDefaultValue<SchemaByRequired<z.ZodString, TOption['required']>, TOption>;
74
67
  declare const timeRangeShape: {
75
- readonly start: z$1.ZodString;
76
- readonly end: z$1.ZodString;
68
+ readonly start: z.ZodString;
69
+ readonly end: z.ZodString;
77
70
  };
78
71
  interface TimeRangeValue {
79
72
  start: string;
@@ -82,68 +75,40 @@ interface TimeRangeValue {
82
75
  interface TimeRangeInspectorOption extends Omit<TimeRangeInspectorFieldOption, 'defaultValue'> {
83
76
  defaultValue?: TimeRangeValue;
84
77
  }
85
- /**
86
- * 定义时间段字段schema,用于开始时间+结束时间范围选择。
87
- * @param option inspector 字段配置
88
- * @returns zod schema
89
- */
90
78
  declare function defineTimeRangePropSchema<const TOption extends TimeRangeInspectorOption & {
91
79
  required?: boolean;
92
- }>(option: TOption): MaybeSchemaWithDefaultValue<SchemaByRequired<z$1.ZodObject<typeof timeRangeShape>, TOption['required']>, TOption>;
80
+ }>(option: TOption): MaybeSchemaWithDefaultValue<SchemaByRequired<z.ZodObject<typeof timeRangeShape>, TOption['required']>, TOption>;
93
81
  declare function defineSelectPropSchema<const TOption extends SelectInspectorFieldOption & {
94
82
  required?: boolean;
95
- }>(option: TOption): MaybeSchemaWithDefaultValue<SchemaByRequired<z$1.ZodString, TOption['required']>, TOption>;
83
+ }>(option: TOption): MaybeSchemaWithDefaultValue<SchemaByRequired<z.ZodString, TOption['required']>, TOption>;
96
84
  type StringTuple = readonly [string, ...string[]];
97
85
  type SelectEnumInspectorFieldOption<TValues extends StringTuple> = Omit<SelectInspectorFieldOption, 'defaultValue'> & {
98
86
  defaultValue?: TValues[number];
99
87
  };
100
- /**
101
- * 基于字符串元组定义select字段schema。
102
- * @param values 可选值元组
103
- * @param option inspector 字段配置
104
- * @returns zod schema
105
- */
106
88
  declare function defineSelectEnumPropSchema<const TValues extends StringTuple, const TOption extends SelectEnumInspectorFieldOption<TValues> & {
107
89
  required?: boolean;
108
- }>(values: TValues, option: TOption): MaybeSchemaWithDefaultValue<SchemaByRequired<z$1.ZodType<TValues[number]>, TOption['required']>, TOption>;
90
+ }>(values: TValues, option: TOption): MaybeSchemaWithDefaultValue<SchemaByRequired<z.ZodType<TValues[number]>, TOption['required']>, TOption>;
109
91
  declare function defineCheckboxPropSchema<const TOption extends CheckboxInspectorFieldOption & {
110
92
  required?: boolean;
111
- }>(option: TOption): MaybeSchemaWithDefaultValue<SchemaByRequired<z$1.ZodBoolean, TOption['required']>, TOption>;
93
+ }>(option: TOption): MaybeSchemaWithDefaultValue<SchemaByRequired<z.ZodBoolean, TOption['required']>, TOption>;
112
94
  declare function defineSwitchPropSchema<const TOption extends SwitchInspectorFieldOption & {
113
95
  required?: boolean;
114
- }>(option: TOption): MaybeSchemaWithDefaultValue<SchemaByRequired<z$1.ZodBoolean, TOption['required']>, TOption>;
115
- type SchemaShape<TSchema extends z$1.ZodObject<z$1.ZodRawShape>> = TSchema extends z$1.ZodObject<infer TShape> ? TShape : never;
116
- type SchemaFieldDefaultValue<TFieldSchema> = TFieldSchema extends z$1.ZodTypeAny ? TFieldSchema extends SchemaHasDefaultValue ? Exclude<z$1.infer<TFieldSchema>, undefined> : never : never;
117
- type SchemaDefaultProps<TSchema extends z$1.ZodObject<z$1.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
- */
123
- declare function getSchemaDefaultProps<const TSchema extends z$1.ZodObject<z$1.ZodRawShape>>(schema: TSchema): SchemaDefaultProps<TSchema>;
124
- type ArrayItemInspectorOption<TItemSchema extends z$1.ZodTypeAny> = Omit<ArrayInspectorFieldOption, 'defaultValue'> & {
125
- defaultValue?: z$1.infer<TItemSchema>[];
96
+ }>(option: TOption): MaybeSchemaWithDefaultValue<SchemaByRequired<z.ZodBoolean, TOption['required']>, TOption>;
97
+ type SchemaShape<TSchema extends z.ZodObject<z.ZodRawShape>> = TSchema extends z.ZodObject<infer TShape> ? TShape : never;
98
+ type SchemaFieldDefaultValue<TFieldSchema> = TFieldSchema extends z.ZodTypeAny ? TFieldSchema extends SchemaHasDefaultValue ? Exclude<z.infer<TFieldSchema>, undefined> : never : never;
99
+ 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]> };
100
+ declare function getSchemaDefaultProps<const TSchema extends z.ZodObject<z.ZodRawShape>>(schema: TSchema): SchemaDefaultProps<TSchema>;
101
+ type ArrayItemInspectorOption<TItemSchema extends z.ZodTypeAny> = Omit<ArrayInspectorFieldOption, 'defaultValue'> & {
102
+ defaultValue?: z.infer<TItemSchema>[];
126
103
  };
127
- type ObjectPropInspectorOption<TShape extends z$1.ZodRawShape> = Omit<ObjectInspectorFieldOption, 'defaultValue'> & {
128
- defaultValue?: z$1.infer<z$1.ZodObject<TShape>>;
104
+ type ObjectPropInspectorOption<TShape extends z.ZodRawShape> = Omit<ObjectInspectorFieldOption, 'defaultValue'> & {
105
+ defaultValue?: z.infer<z.ZodObject<TShape>>;
129
106
  };
130
- /**
131
- * 定义数组字段schema,支持声明数组项schema。
132
- * @param itemSchema 数组项schema
133
- * @param option inspector 字段配置
134
- * @returns zod schema
135
- */
136
- declare function defineArrayItemPropSchema<TItemSchema extends z$1.ZodTypeAny, const TOption extends ArrayItemInspectorOption<TItemSchema> & {
107
+ declare function defineArrayItemPropSchema<TItemSchema extends z.ZodTypeAny, const TOption extends ArrayItemInspectorOption<TItemSchema> & {
137
108
  required?: boolean;
138
- }>(itemSchema: TItemSchema, option: TOption): MaybeSchemaWithDefaultValue<SchemaByRequired<z$1.ZodArray<TItemSchema>, TOption['required']>, TOption>;
139
- /**
140
- * 定义对象字段schema,支持声明对象shape。
141
- * @param shape 对象字段shape
142
- * @param option inspector 字段配置
143
- * @returns zod schema
144
- */
145
- declare function defineObjectPropSchema<const TShape extends z$1.ZodRawShape, const TOption extends ObjectPropInspectorOption<TShape> & {
109
+ }>(itemSchema: TItemSchema, option: TOption): MaybeSchemaWithDefaultValue<SchemaByRequired<z.ZodArray<TItemSchema>, TOption['required']>, TOption>;
110
+ declare function defineObjectPropSchema<const TShape extends z.ZodRawShape, const TOption extends ObjectPropInspectorOption<TShape> & {
146
111
  required?: boolean;
147
- }>(shape: TShape, option: TOption): MaybeSchemaWithDefaultValue<SchemaByRequired<z$1.ZodObject<TShape>, TOption['required']>, TOption>;
112
+ }>(shape: TShape, option: TOption): MaybeSchemaWithDefaultValue<SchemaByRequired<z.ZodObject<TShape>, TOption['required']>, TOption>;
148
113
  //#endregion
149
114
  export { INSPECTOR_META_KEY, InferSchemaProps, MaterialComponentMode, MaterialComponentProps, SchemaHasDefaultValue, defineArrayItemPropSchema, defineCheckboxPropSchema, defineColorPropSchema, defineComponentPropsSchema, defineDatetimePropSchema, defineNumberPropSchema, defineObjectPropSchema, defineSelectEnumPropSchema, defineSelectPropSchema, defineSwitchPropSchema, defineTextPropSchema, defineTextareaPropSchema, defineTimeRangePropSchema, getSchemaDefaultProps, withInspectorMeta };
@@ -1,2 +1,2 @@
1
1
 
2
- import e from"zod";const t=`inspector`,n=e.enum([`renderer`,`editor`]);function r(e,n){return e.meta({...e.meta()??{},[t]:n})}function i(t){return e.object(t).extend({mode:n.optional()})}function a(e,t){return t===!1?e.optional():e}function o(e,t){return t.defaultValue,e}function s(t){let{required:n=!0,...i}=t;return o(r(a(e.string(),n),{type:`text`,...i}),t)}function c(t){let{required:n=!0,...i}=t;return o(r(a(e.string(),n),{type:`textarea`,...i}),t)}function l(t){let{required:n=!0,...i}=t;return o(r(a(e.number(),n),{type:`number`,...i}),t)}function u(t){let{required:n=!0,...i}=t;return o(r(a(e.string(),n),{type:`color`,...i}),t)}function d(t){let{required:n=!0,...i}=t;return o(r(a(e.string(),n),{type:`datetime`,...i}),t)}const f={start:e.string(),end:e.string()};function p(t){let{required:n=!0,...i}=t;return o(r(a(e.object(f),n),{type:`timeRange`,...i}),t)}function m(t){let{required:n=!0,...i}=t;return o(r(a(e.string(),n),{type:`select`,...i}),t)}function h(t,n){let{required:i=!0,...s}=n;return o(r(a(e.enum(t),i),{type:`select`,...s}),n)}function g(t){let{required:n=!0,...i}=t;return o(r(a(e.boolean(),n),{type:`checkbox`,...i}),t)}function _(t){let{required:n=!0,...i}=t;return o(r(a(e.boolean(),n),{type:`switch`,...i}),t)}function v(e){let n=e,r=new Set;for(;n&&!r.has(n);){r.add(n);let e=n.meta()?.[t];if(e)return e;let i=n.unwrap;if(typeof i!=`function`)break;let a=i.call(n);if(!a||a===n)break;n=a}}function y(e){let t={};for(let[n,r]of Object.entries(e.shape)){let e=v(r);e?.defaultValue!==void 0&&(t[n]=e.defaultValue)}return t}function b(t,n){let{required:i=!0,...s}=n;return o(r(a(e.array(t),i),{type:`array`,...s}),n)}function x(t,n){let{required:i=!0,...s}=n;return o(r(a(e.object(t),i),{type:`object`,...s}),n)}export{t as INSPECTOR_META_KEY,b as defineArrayItemPropSchema,g as defineCheckboxPropSchema,u as defineColorPropSchema,i as defineComponentPropsSchema,d as defineDatetimePropSchema,l as defineNumberPropSchema,x as defineObjectPropSchema,h as defineSelectEnumPropSchema,m as defineSelectPropSchema,_ as defineSwitchPropSchema,s as defineTextPropSchema,c as defineTextareaPropSchema,p as defineTimeRangePropSchema,y as getSchemaDefaultProps,r as withInspectorMeta};
2
+ import{z as e}from"zod";const t=`inspector`,n=e.enum([`renderer`,`editor`]);function r(e,n){return e.meta({...e.meta()??{},[t]:n})}function i(t){return e.object(t).extend({mode:n.optional()})}function a(e,t){return t===!1?e.optional():e}function o(e,t){return t.defaultValue,e}function s(t){let{required:n=!0,...i}=t;return o(r(a(e.string(),n),{type:`text`,...i}),t)}function c(t){let{required:n=!0,...i}=t;return o(r(a(e.string(),n),{type:`textarea`,...i}),t)}function l(t){let{required:n=!0,...i}=t;return o(r(a(e.number(),n),{type:`number`,...i}),t)}function u(t){let{required:n=!0,...i}=t;return o(r(a(e.string(),n),{type:`color`,...i}),t)}function d(t){let{required:n=!0,...i}=t;return o(r(a(e.string(),n),{type:`datetime`,...i}),t)}const f={start:e.string(),end:e.string()};function p(t){let{required:n=!0,...i}=t;return o(r(a(e.object(f),n),{type:`timeRange`,...i}),t)}function m(t){let{required:n=!0,...i}=t;return o(r(a(e.string(),n),{type:`select`,...i}),t)}function h(t,n){let{required:i=!0,...s}=n;return o(r(a(e.enum(t),i),{type:`select`,...s}),n)}function g(t){let{required:n=!0,...i}=t;return o(r(a(e.boolean(),n),{type:`checkbox`,...i}),t)}function _(t){let{required:n=!0,...i}=t;return o(r(a(e.boolean(),n),{type:`switch`,...i}),t)}function v(e){let n=e,r=new Set;for(;n&&!r.has(n);){r.add(n);let e=n.meta()?.[t];if(e)return e;let i=n.unwrap;if(typeof i!=`function`)break;let a=i.call(n);if(!a||a===n)break;n=a}}function y(e){let t={};for(let[n,r]of Object.entries(e.shape)){let e=v(r);e?.defaultValue!==void 0&&(t[n]=e.defaultValue)}return t}function b(t,n){let{required:i=!0,...s}=n;return o(r(a(e.array(t),i),{type:`array`,...s}),n)}function x(t,n){let{required:i=!0,...s}=n;return o(r(a(e.object(t),i),{type:`object`,...s}),n)}export{t as INSPECTOR_META_KEY,b as defineArrayItemPropSchema,g as defineCheckboxPropSchema,u as defineColorPropSchema,i as defineComponentPropsSchema,d as defineDatetimePropSchema,l as defineNumberPropSchema,x as defineObjectPropSchema,h as defineSelectEnumPropSchema,m as defineSelectPropSchema,_ as defineSwitchPropSchema,s as defineTextPropSchema,c as defineTextareaPropSchema,p as defineTimeRangePropSchema,y as getSchemaDefaultProps,r as withInspectorMeta};
@@ -11,16 +11,10 @@ type MaterialMapGroupByCategory<TMaterials extends readonly MaterialLike[]> = {
11
11
  }>[] };
12
12
  /**
13
13
  * 将物料数组转换为 type -> material 的映射。
14
- * 如果出现重复 type,会输出警告并以后者覆盖前者。
15
- * @param materials 通过 defineMaterial 定义的物料数组
16
- * @returns 以 material.type 为 key 的映射
17
14
  */
18
15
  declare function generateMaterialMap<const TMaterials extends readonly MaterialLike[]>(materials: TMaterials): MaterialMap<TMaterials>;
19
16
  /**
20
17
  * 将物料数组转换为 category -> material[] 的映射。
21
- * 同一分类下的物料顺序与入参数组保持一致。
22
- * @param materials 通过 defineMaterial 定义的物料数组
23
- * @returns 以 material.category 为 key 的映射
24
18
  */
25
19
  declare function generateMaterialMapGroupByCategory<const TMaterials extends readonly MaterialLike[]>(materials: TMaterials): MaterialMapGroupByCategory<TMaterials>;
26
20
  //#endregion
package/dist/utils.d.mts CHANGED
@@ -1,8 +1,5 @@
1
1
 
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 "./utils/schema/schema.mjs";
3
- import { defineMaterial, overwriteMaterial } from "./utils/schema/material.mjs";
4
- import { MaterialMap, generateMaterialMap, generateMaterialMapGroupByCategory } from "./utils/schema/utils.mjs";
5
- import "./utils/schema/index.mjs";
2
+ import { HttpClient, HttpError, RequestConfig, RequestMethod, ResponseData, httpClient } from "./utils/http.mjs";
6
3
  import { clearMyChannelsFromStorage, loadHiddenChannelIdsFromStorage, loadMyChannelsFromStorage, saveHiddenChannelIdsToStorage } from "./utils/channel-storage.mjs";
7
4
  import { cn } from "./utils/cn.mjs";
8
5
  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";
@@ -11,12 +8,15 @@ import { eventBus } from "./utils/event-bus.mjs";
11
8
  import { checkFollowStatus, followUser, getAppId, getCurrentUserId, unfollowUser } from "./utils/follow-service.mjs";
12
9
  import { getResUrl } from "./utils/get-res-url.mjs";
13
10
  import { disablePageScroll, enablePageScroll, normalizeClassName, pxToVw } from "./utils/helper.mjs";
14
- import { HttpClient, HttpError, RequestConfig, RequestMethod, ResponseData, httpClient } from "./utils/http.mjs";
15
11
  import { ImageCompressionQualityRule, compressImage, defaultImageCompressionMaxSizeMB, defaultImageCompressionQuality, getImageCompressionQuality, imageCompressionQualityRules } from "./utils/image-compression.mjs";
16
12
  import { components, loadComponent, rewriteComponent } from "./utils/loaders.mjs";
17
13
  import { createInputAndSelectFile, getCoverImage, getImageResolutionFromFile } from "./utils/media.mjs";
18
14
  import { PASSWORD_ALLOWED_SPECIAL_CHARS, PASSWORD_MAX_LENGTH, PASSWORD_MIN_LENGTH, PasswordValidationResult, PasswordValidationType, getFirstInvalidPasswordChar, getPasswordCharacterTypeCount, getPasswordValidationErrorText, validatePasswordPair } from "./utils/password-validator.mjs";
19
15
  import { PresignedUploadInfo, UploadToS3Options, UploadToS3Result, uploadToS3WithPresignedUrl } from "./utils/s3-uploader.mjs";
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";
18
+ import { MaterialMap, generateMaterialMap, generateMaterialMapGroupByCategory } from "./utils/schema/utils.mjs";
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
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 };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@funhub/platform",
3
3
  "type": "module",
4
- "version": "0.1.125",
4
+ "version": "0.1.126",
5
5
  "private": false,
6
6
  "sideEffects": [
7
7
  "**/*.css"
@@ -110,6 +110,7 @@
110
110
  "cac": "^6.7.14",
111
111
  "class-variance-authority": "^0.7.1",
112
112
  "clsx": "^2.1.1",
113
+ "create-funhub": "workspace:*",
113
114
  "crypto": "^1.0.1",
114
115
  "crypto-js": "^4.2.0",
115
116
  "dayjs": "^1.11.13",