@funhub/platform 0.1.21 → 0.1.23

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 (219) hide show
  1. package/dist/biz.d.mts +17 -10
  2. package/dist/biz.mjs +1 -1
  3. package/dist/common.d.mts +3 -1
  4. package/dist/common.mjs +1 -1
  5. package/dist/components/biz/basics/logo/variants/basic-logo/runtime/client.mjs +1 -1
  6. package/dist/components/biz/basics/search/variants/simple-search/runtime/client.mjs +1 -1
  7. package/dist/components/biz/business/banner/variants/basic-banner/material.mjs +1 -1
  8. package/dist/components/biz/business/comment/reply-detail.mjs +1 -1
  9. package/dist/components/biz/business/detail/detail-follow-action.mjs +1 -1
  10. package/dist/components/biz/business/detail/detail-info-title.mjs +1 -1
  11. package/dist/components/biz/business/detail/detail-introduction.mjs +1 -1
  12. package/dist/components/biz/business/detail/detail-operate.mjs +1 -1
  13. package/dist/components/biz/business/detail/materials/registry.d.mts +39 -45
  14. package/dist/components/biz/business/detail/materials/registry.mjs +1 -1
  15. package/dist/components/biz/business/detail/materials/video-detail-actions/client.d.mts +2 -9
  16. package/dist/components/biz/business/detail/materials/video-detail-actions/index.d.mts +3 -3
  17. package/dist/components/biz/business/detail/materials/video-detail-actions/material.d.mts +9 -3
  18. package/dist/components/biz/business/detail/materials/video-detail-actions/schema.d.mts +7 -1
  19. package/dist/components/biz/business/detail/materials/video-detail-actions/server.d.mts +1 -1
  20. package/dist/components/biz/business/detail/materials/video-detail-info/client.d.mts +2 -13
  21. package/dist/components/biz/business/detail/materials/video-detail-info/index.d.mts +3 -3
  22. package/dist/components/biz/business/detail/materials/video-detail-info/material.d.mts +13 -3
  23. package/dist/components/biz/business/detail/materials/video-detail-info/schema.d.mts +9 -1
  24. package/dist/components/biz/business/detail/materials/video-detail-info/server.d.mts +1 -1
  25. package/dist/components/biz/business/detail/materials/video-detail-info-title/client.d.mts +2 -7
  26. package/dist/components/biz/business/detail/materials/video-detail-info-title/index.d.mts +3 -3
  27. package/dist/components/biz/business/detail/materials/video-detail-info-title/material.d.mts +9 -3
  28. package/dist/components/biz/business/detail/materials/video-detail-info-title/schema.d.mts +6 -1
  29. package/dist/components/biz/business/detail/materials/video-detail-info-title/server.d.mts +1 -1
  30. package/dist/components/biz/business/detail/materials/video-detail-info-title-tags-episodes/client.d.mts +2 -11
  31. package/dist/components/biz/business/detail/materials/video-detail-info-title-tags-episodes/index.d.mts +3 -3
  32. package/dist/components/biz/business/detail/materials/video-detail-info-title-tags-episodes/material.d.mts +13 -3
  33. package/dist/components/biz/business/detail/materials/video-detail-info-title-tags-episodes/schema.d.mts +8 -1
  34. package/dist/components/biz/business/detail/materials/video-detail-info-title-tags-episodes/server.d.mts +1 -1
  35. package/dist/components/biz/business/detail/materials/video-detail-player/client.d.mts +2 -11
  36. package/dist/components/biz/business/detail/materials/video-detail-player/index.d.mts +3 -3
  37. package/dist/components/biz/business/detail/materials/video-detail-player/material.d.mts +9 -3
  38. package/dist/components/biz/business/detail/materials/video-detail-player/schema.d.mts +8 -1
  39. package/dist/components/biz/business/detail/materials/video-detail-player/server.d.mts +1 -1
  40. package/dist/components/biz/business/detail/materials/video-detail-recommend/client.d.mts +2 -6
  41. package/dist/components/biz/business/detail/materials/video-detail-recommend/client.mjs +1 -1
  42. package/dist/components/biz/business/detail/materials/video-detail-recommend/index.d.mts +3 -3
  43. package/dist/components/biz/business/detail/materials/video-detail-recommend/material.d.mts +36 -3
  44. package/dist/components/biz/business/detail/materials/video-detail-recommend/schema.d.mts +5 -1
  45. package/dist/components/biz/business/detail/materials/video-detail-recommend/server.d.mts +1 -1
  46. package/dist/components/biz/business/detail/post-recommend-list.mjs +1 -1
  47. package/dist/components/biz/business/floating-ball/client.d.mts +12 -0
  48. package/dist/components/biz/business/floating-ball/client.mjs +2 -0
  49. package/dist/components/biz/business/floating-ball/material.d.mts +10 -0
  50. package/dist/components/biz/business/floating-ball/material.mjs +2 -0
  51. package/dist/components/biz/business/floating-ball/schema.d.mts +14 -0
  52. package/dist/components/biz/business/floating-ball/schema.mjs +2 -0
  53. package/dist/components/biz/business/floating-ball/server.mjs +2 -0
  54. package/dist/components/biz/business/header-search/header-avatar-icon/client.d.mts +12 -0
  55. package/dist/components/biz/business/header-search/header-avatar-icon/client.mjs +2 -0
  56. package/dist/components/biz/business/header-search/header-avatar-icon/index.d.mts +5 -0
  57. package/dist/components/biz/business/header-search/header-avatar-icon/material.d.mts +10 -0
  58. package/dist/components/biz/business/header-search/header-avatar-icon/material.mjs +2 -0
  59. package/dist/components/biz/business/header-search/header-avatar-icon/schema.d.mts +14 -0
  60. package/dist/components/biz/business/header-search/header-avatar-icon/schema.mjs +2 -0
  61. package/dist/components/biz/business/header-search/header-avatar-icon/server.d.mts +3 -0
  62. package/dist/components/biz/business/header-search/header-avatar-icon/server.mjs +2 -0
  63. package/dist/components/biz/business/header-search/header-avatar-logo-search/client.d.mts +12 -0
  64. package/dist/components/biz/business/header-search/header-avatar-logo-search/client.mjs +2 -0
  65. package/dist/components/biz/business/header-search/header-avatar-logo-search/index.d.mts +5 -0
  66. package/dist/components/biz/business/header-search/header-avatar-logo-search/material.d.mts +10 -0
  67. package/dist/components/biz/business/header-search/header-avatar-logo-search/material.mjs +2 -0
  68. package/dist/components/biz/business/header-search/header-avatar-logo-search/schema.d.mts +14 -0
  69. package/dist/components/biz/business/header-search/header-avatar-logo-search/schema.mjs +2 -0
  70. package/dist/components/biz/business/header-search/header-avatar-logo-search/server.d.mts +3 -0
  71. package/dist/components/biz/business/header-search/header-avatar-logo-search/server.mjs +2 -0
  72. package/dist/components/biz/business/header-search/header-avatar-logo-search-icon/client.d.mts +12 -0
  73. package/dist/components/biz/business/header-search/header-avatar-logo-search-icon/client.mjs +2 -0
  74. package/dist/components/biz/business/header-search/header-avatar-logo-search-icon/index.d.mts +5 -0
  75. package/dist/components/biz/business/header-search/header-avatar-logo-search-icon/material.d.mts +10 -0
  76. package/dist/components/biz/business/header-search/header-avatar-logo-search-icon/material.mjs +2 -0
  77. package/dist/components/biz/business/header-search/header-avatar-logo-search-icon/schema.d.mts +14 -0
  78. package/dist/components/biz/business/header-search/header-avatar-logo-search-icon/schema.mjs +2 -0
  79. package/dist/components/biz/business/header-search/header-avatar-logo-search-icon/server.d.mts +3 -0
  80. package/dist/components/biz/business/header-search/header-avatar-logo-search-icon/server.mjs +2 -0
  81. package/dist/components/biz/business/header-search/header-logo-search/client.d.mts +12 -0
  82. package/dist/components/biz/business/header-search/header-logo-search/client.mjs +2 -0
  83. package/dist/components/biz/business/header-search/header-logo-search/index.d.mts +5 -0
  84. package/dist/components/biz/business/header-search/header-logo-search/material.d.mts +10 -0
  85. package/dist/components/biz/business/header-search/header-logo-search/material.mjs +2 -0
  86. package/dist/components/biz/business/header-search/header-logo-search/schema.d.mts +14 -0
  87. package/dist/components/biz/business/header-search/header-logo-search/schema.mjs +2 -0
  88. package/dist/components/biz/business/header-search/header-logo-search/server.d.mts +3 -0
  89. package/dist/components/biz/business/header-search/header-logo-search/server.mjs +2 -0
  90. package/dist/components/biz/business/header-search/header-search/client.d.mts +12 -0
  91. package/dist/components/biz/business/header-search/header-search/client.mjs +2 -0
  92. package/dist/components/biz/business/header-search/header-search/index.d.mts +5 -0
  93. package/dist/components/biz/business/header-search/header-search/material.d.mts +10 -0
  94. package/dist/components/biz/business/header-search/header-search/material.mjs +2 -0
  95. package/dist/components/biz/business/header-search/header-search/schema.d.mts +14 -0
  96. package/dist/components/biz/business/header-search/header-search/schema.mjs +2 -0
  97. package/dist/components/biz/business/header-search/header-search/server.d.mts +3 -0
  98. package/dist/components/biz/business/header-search/header-search/server.mjs +2 -0
  99. package/dist/components/biz/business/header-search/index.d.mts +11 -0
  100. package/dist/components/biz/business/home-recommend/index.d.mts +9 -0
  101. package/dist/components/biz/business/home-recommend/shared/home-recommend-base.mjs +2 -0
  102. package/dist/components/biz/business/home-recommend/types.d.mts +25 -0
  103. package/dist/components/biz/business/home-recommend/variants/home-recommend-grid/defaults/default-props.d.mts +10 -0
  104. package/dist/components/biz/business/home-recommend/variants/home-recommend-grid/defaults/default-props.mjs +2 -0
  105. package/dist/components/biz/business/home-recommend/variants/home-recommend-grid/index.d.mts +4 -0
  106. package/dist/components/biz/business/home-recommend/variants/home-recommend-grid/index.mjs +2 -0
  107. package/dist/components/biz/business/home-recommend/variants/home-recommend-grid/runtime/client.d.mts +13 -0
  108. package/dist/components/biz/business/home-recommend/variants/home-recommend-grid/runtime/client.mjs +2 -0
  109. package/dist/components/biz/business/home-recommend/variants/home-recommend-grid/schema/component.mjs +2 -0
  110. package/dist/components/biz/business/home-recommend/variants/home-recommend-grid/schema/data.schema.mjs +2 -0
  111. package/dist/components/biz/business/home-recommend/variants/home-recommend-grid/schema/event.schema.mjs +2 -0
  112. package/dist/components/biz/business/home-recommend/variants/home-recommend-grid/schema/index.d.mts +8 -0
  113. package/dist/components/biz/business/home-recommend/variants/home-recommend-grid/schema/index.mjs +2 -0
  114. package/dist/components/biz/business/home-recommend/variants/home-recommend-grid/schema/props.schema.mjs +2 -0
  115. package/dist/components/biz/business/home-recommend/variants/home-recommend-grid/schema/style.schema.mjs +2 -0
  116. package/dist/components/biz/business/home-recommend/variants/home-recommend-waterfall/defaults/default-props.d.mts +10 -0
  117. package/dist/components/biz/business/home-recommend/variants/home-recommend-waterfall/defaults/default-props.mjs +2 -0
  118. package/dist/components/biz/business/home-recommend/variants/home-recommend-waterfall/index.d.mts +4 -0
  119. package/dist/components/biz/business/home-recommend/variants/home-recommend-waterfall/index.mjs +2 -0
  120. package/dist/components/biz/business/home-recommend/variants/home-recommend-waterfall/runtime/client.d.mts +13 -0
  121. package/dist/components/biz/business/home-recommend/variants/home-recommend-waterfall/runtime/client.mjs +2 -0
  122. package/dist/components/biz/business/home-recommend/variants/home-recommend-waterfall/schema/component.mjs +2 -0
  123. package/dist/components/biz/business/home-recommend/variants/home-recommend-waterfall/schema/data.schema.mjs +2 -0
  124. package/dist/components/biz/business/home-recommend/variants/home-recommend-waterfall/schema/event.schema.mjs +2 -0
  125. package/dist/components/biz/business/home-recommend/variants/home-recommend-waterfall/schema/index.d.mts +8 -0
  126. package/dist/components/biz/business/home-recommend/variants/home-recommend-waterfall/schema/index.mjs +2 -0
  127. package/dist/components/biz/business/home-recommend/variants/home-recommend-waterfall/schema/props.schema.mjs +2 -0
  128. package/dist/components/biz/business/home-recommend/variants/home-recommend-waterfall/schema/style.schema.mjs +2 -0
  129. package/dist/components/biz/business/index.d.mts +21 -14
  130. package/dist/components/biz/business/index.mjs +1 -1
  131. package/dist/components/biz/business/large-feature-grid/client.d.mts +12 -0
  132. package/dist/components/biz/business/large-feature-grid/client.mjs +2 -0
  133. package/dist/components/biz/business/large-feature-grid/material.d.mts +10 -0
  134. package/dist/components/biz/business/large-feature-grid/material.mjs +2 -0
  135. package/dist/components/biz/business/large-feature-grid/schema.d.mts +14 -0
  136. package/dist/components/biz/business/large-feature-grid/schema.mjs +2 -0
  137. package/dist/components/biz/business/large-feature-grid/server.mjs +2 -0
  138. package/dist/components/biz/business/nav-bar/variants/basic-nav-bar/runtime/client.mjs +1 -1
  139. package/dist/components/biz/business/profile/profile-header/material.d.mts +9 -0
  140. package/dist/components/biz/business/profile/profile-header/material.mjs +2 -0
  141. package/dist/components/biz/business/profile/profile-main/material.d.mts +9 -0
  142. package/dist/components/biz/business/profile/profile-main/material.mjs +2 -0
  143. package/dist/components/biz/business/shortcut-grid/client.d.mts +12 -0
  144. package/dist/components/biz/business/shortcut-grid/client.mjs +2 -0
  145. package/dist/components/biz/business/shortcut-grid/material.d.mts +10 -0
  146. package/dist/components/biz/business/shortcut-grid/material.mjs +2 -0
  147. package/dist/components/biz/business/shortcut-grid/schema.d.mts +14 -0
  148. package/dist/components/biz/business/shortcut-grid/schema.mjs +2 -0
  149. package/dist/components/biz/business/shortcut-grid/server.mjs +2 -0
  150. package/dist/components/biz/renderer/renderer.d.mts +2 -1
  151. package/dist/components/biz/utils/helpers/get-channel-list.d.mts +20 -0
  152. package/dist/components/biz/utils/helpers/get-channel-list.mjs +2 -0
  153. package/dist/components/biz/utils/index.d.mts +5 -4
  154. package/dist/components/biz/utils/schema/component.d.mts +1 -1
  155. package/dist/components/biz/utils/transformers/data.d.mts +3 -0
  156. package/dist/components/biz/utils/transformers/data.mjs +1 -1
  157. package/dist/components/common/blocked-dialog/blocked-dialog.d.mts +10 -0
  158. package/dist/components/common/blocked-dialog/blocked-dialog.mjs +2 -0
  159. package/dist/components/common/blocked-dialog/index.d.mts +2 -0
  160. package/dist/components/common/follow-button/index.mjs +1 -1
  161. package/dist/components/common/funhub-provider/funhub-provider.mjs +1 -1
  162. package/dist/components/common/icons/video.mjs +2 -0
  163. package/dist/components/common/list/video-list/video-list-item.d.mts +1 -1
  164. package/dist/components/common/list/video-list/video-list-item.mjs +1 -1
  165. package/dist/components/common/photo-grid/index.mjs +1 -1
  166. package/dist/components/common/top-nav-bar/client.mjs +1 -1
  167. package/dist/components/common/top-nav-bar/index.mjs +1 -1
  168. package/dist/components/pages/(follow)/_components/follow-button/index.mjs +1 -1
  169. package/dist/components/pages/feed-series/feed-series-client.mjs +1 -1
  170. package/dist/components/pages/feedback/_components/feedback-form.mjs +1 -1
  171. package/dist/components/pages/home/index.mjs +1 -1
  172. package/dist/components/pages/post-detail/post-detail-client.mjs +1 -1
  173. package/dist/components/pages/profile/_components/tabs/collect-tab/client.mjs +1 -1
  174. package/dist/components/pages/profile/_components/tabs/collect-tab/server.mjs +1 -1
  175. package/dist/components/pages/profile/_components/tabs/history-tab/client.mjs +1 -1
  176. package/dist/components/pages/profile/_components/tabs/like-tab/client.mjs +1 -1
  177. package/dist/components/pages/profile/_components/user-profile-container/client.mjs +1 -1
  178. package/dist/components/pages/profile/_components/user-profile-header/client.mjs +1 -1
  179. package/dist/components/pages/profile/utils.mjs +1 -1
  180. package/dist/components/pages/search/search-result/search-all.mjs +1 -1
  181. package/dist/components/pages/search/search-result/search-video-info.mjs +1 -1
  182. package/dist/components/pages/search/top-header.mjs +1 -1
  183. package/dist/components/pages/user-follow/_components/follow-top-header.mjs +1 -1
  184. package/dist/components/pages/video-detail/video-detail-client.mjs +1 -1
  185. package/dist/components/pages/video-list/index.d.mts +16 -0
  186. package/dist/components/pages/video-list/index.mjs +2 -0
  187. package/dist/components/pages/video-list/types.mjs +2 -0
  188. package/dist/components/pages/video-list/video-list-client.mjs +2 -0
  189. package/dist/components/pages/video-list/video-list-item.mjs +2 -0
  190. package/dist/components/ui/badge.d.mts +1 -1
  191. package/dist/components/ui/button.d.mts +1 -1
  192. package/dist/components/ui/image.d.mts +4 -4
  193. package/dist/hooks/use-content-operate.mjs +1 -1
  194. package/dist/i18n/locales/en.mjs +3 -1
  195. package/dist/i18n/locales/zh-CN.mjs +3 -1
  196. package/dist/materials.d.mts +24 -1
  197. package/dist/materials.mjs +1 -1
  198. package/dist/pages.d.mts +2 -1
  199. package/dist/pages.mjs +1 -1
  200. package/dist/service/generated/client.d.mts +28 -12
  201. package/dist/service/generated/client.mjs +1 -1
  202. package/dist/service/generated/tanstack.d.mts +34 -14
  203. package/dist/service/generated/tanstack.mjs +1 -1
  204. package/dist/service.d.mts +3 -3
  205. package/dist/service.mjs +1 -1
  206. package/dist/store/create-store.mjs +1 -1
  207. package/dist/store/modules/blocked-modal-store.d.mts +26 -0
  208. package/dist/store/modules/blocked-modal-store.mjs +2 -0
  209. package/dist/store/modules/user-store.d.mts +1 -1
  210. package/dist/store/modules/user-store.mjs +1 -1
  211. package/dist/store.d.mts +2 -1
  212. package/dist/store.mjs +1 -1
  213. package/dist/types.d.mts +1348 -129
  214. package/dist/utils/http.mjs +1 -1
  215. package/dist/utils/schema/index.d.mts +1 -1
  216. package/dist/utils/schema/material.d.mts +5 -0
  217. package/dist/utils/schema/utils.d.mts +1 -1
  218. package/dist/utils.d.mts +2 -2
  219. package/package.json +1 -1
@@ -1,2 +1,2 @@
1
1
 
2
- import{getCookie as e,isClient as t}from"./common.mjs";import{useUserStore as n}from"../store/modules/user-store.mjs";import{toast as r}from"sonner";const i=process.env.NEXT_PUBLIC_API_BASE||``;let a=!1;var o=class extends Error{constructor(e,t,n){super(t),this.status=e,this.response=n}};function s(e){if(!e)return``;let t=new URLSearchParams;Object.entries(e).forEach(([e,n])=>{n!=null&&t.append(e,String(n))});let n=t.toString();return n?`?${n}`:``}function c(e=1e4,t){let n=new AbortController,r=setTimeout(()=>n.abort(),e);return t&&t.addEventListener(`abort`,()=>n.abort()),{signal:n.signal,clear:()=>clearTimeout(r)}}var l=class{constructor(){this.baseURL=i,this.defaultConfig={method:`GET`,timeout:1e4,cache:`default`}}async buildHeaders(e){return{"Content-Type":`application/json`,...e}}buildURL(e,t){return`${e.startsWith(`http`)?e:`${this.baseURL}${e.startsWith(`/`)?``:`/`}${e}`}${s(t)}`}async executeOnce(i){let{url:s,method:l=`GET`,data:u,params:d,timeout:f,cache:p,revalidate:m,tags:h,signal:g}=i,_=await this.buildHeaders(i.headers),v=l===`GET`||l===`HEAD`;if(t()){let t=await e(`token`),n=await e(`userId`);t&&(_.Authorization=`Bearer ${t}`),n&&(_[`X-User-Id`]=n)}let y;!v&&u!==void 0&&(u instanceof FormData?(delete _[`Content-Type`],y=u):y=JSON.stringify(u));let{signal:b,clear:x}=c(f,g),S=this.buildURL(s,d);try{let e=await fetch(S,{method:l,headers:_,body:y,cache:p,signal:b,next:{revalidate:m??0,tags:h}});if(!e.ok)throw new o(e.status,e.statusText,await e.text());let i=await e.json();if(i.code===401)if(t())a||(a=!0,r.error(`登录已过期,请重新登录`),n.getState().logout(),setTimeout(()=>{a=!1},3e3));else throw new o(i.code,i.message,i);if(i.code!==0)throw new o(i.code,i.message,i);return i}finally{x()}}async request(e){let t={...this.defaultConfig,...e};return await this.executeOnce(t)}get(e,t){return this.request({...t,method:`GET`,url:e})}post(e,t){return this.request({...t,method:`POST`,url:e})}put(e,t){return this.request({...t,method:`PUT`,url:e})}delete(e,t){return this.request({...t,method:`DELETE`,url:e})}patch(e,t){return this.request({...t,method:`PATCH`,url:e})}};const u=new l;export{l as HttpClient,o as HttpError,u as default};
2
+ import{getCookie as e,isClient as t}from"./common.mjs";import{useBlockedModalStore as n}from"../store/modules/blocked-modal-store.mjs";import{useUserStore as r}from"../store/modules/user-store.mjs";import{toast as i}from"sonner";const a=process.env.NEXT_PUBLIC_API_BASE||``;let o=!1,s=!1,c=null;var l=class extends Error{constructor(e,t,n){super(t),this.status=e,this.response=n}};function u(e){if(!e)return``;let t=new URLSearchParams;Object.entries(e).forEach(([e,n])=>{n!=null&&t.append(e,String(n))});let n=t.toString();return n?`?${n}`:``}function d(e=1e4,t){let n=new AbortController,r=setTimeout(()=>n.abort(),e);return t&&t.addEventListener(`abort`,()=>n.abort()),{signal:n.signal,clear:()=>clearTimeout(r)}}function f(){t()&&(s||(s=!0,r.getState().logout(),setTimeout(()=>{s=!1},1e3)))}var p=class{constructor(){this.baseURL=a,this.defaultConfig={method:`GET`,timeout:1e4,cache:`default`}}async buildHeaders(e){return{"Content-Type":`application/json`,...e}}buildURL(e,t){return`${e.startsWith(`http`)?e:`${this.baseURL}${e.startsWith(`/`)?``:`/`}${e}`}${u(t)}`}async executeOnce(a){let{url:s,method:u=`GET`,data:p,params:m,timeout:h,cache:g,revalidate:_,tags:v,signal:y}=a,b=await this.buildHeaders(a.headers),x=``,S=u===`GET`||u===`HEAD`;if(t()){x=await e(`token`);let t=await e(`userId`);if(x&&(b.Authorization=`Bearer ${x}`),t&&(b[`X-User-Id`]=t),c?.token&&c.token!==x&&(c=null),x&&c?.token===x)throw f(),new l(403,`账号已被封禁`,{code:403,message:`账号已被封禁`,data:{blocked_remark:c.blockedRemark,blocked_end_time:c.blockedEndTime}})}let C;!S&&p!==void 0&&(p instanceof FormData?(delete b[`Content-Type`],C=p):C=JSON.stringify(p));let{signal:w,clear:T}=d(h,y),E=this.buildURL(s,m);try{let e=await fetch(E,{method:u,headers:b,body:C,cache:g,signal:w,next:{revalidate:_??0,tags:v}}),a=e.status===401||e.status===403;if(!e.ok&&!a)throw new l(e.status,e.statusText,await e.text());let s=await e.json(),d=a&&e.status===401||s?.code===401,p=a&&e.status===403||s?.code===403;if(d)if(t())o||(o=!0,i.error(`登录已过期,请重新登录`),r.getState().logout(),setTimeout(()=>{o=!1},3e3));else throw new l(s.code,s.message,s);if(p){let e=typeof s?.data?.blocked_remark==`string`?s.data.blocked_remark:``,r=Number(s?.data?.blocked_end_time),i={blockedRemark:e,blockedEndTime:Number.isFinite(r)&&r>0?Math.floor(r):0};if(t()){let e=x,t=c?.token===e;e&&(c={token:e,...i}),t||n.getState().open(i),f()}throw new l(s.code,s.message,s)}if(s.code!==0)throw new l(s.code,s.message,s);return s}finally{T()}}async request(e){let t={...this.defaultConfig,...e};return await this.executeOnce(t)}get(e,t){return this.request({...t,method:`GET`,url:e})}post(e,t){return this.request({...t,method:`POST`,url:e})}put(e,t){return this.request({...t,method:`PUT`,url:e})}delete(e,t){return this.request({...t,method:`DELETE`,url:e})}patch(e,t){return this.request({...t,method:`PATCH`,url:e})}};const m=new p;export{p as HttpClient,l as HttpError,m as default};
@@ -1,4 +1,4 @@
1
1
 
2
2
  import { INSPECTOR_META_KEY, InferSchemaProps, MaterialComponentProps, SchemaHasDefaultValue, defineArrayItemPropSchema, defineCheckboxPropSchema, defineColorPropSchema, defineComponentPropsSchema, defineNumberPropSchema, defineObjectPropSchema, defineSelectEnumPropSchema, defineSelectPropSchema, defineSwitchPropSchema, defineTextPropSchema, defineTextareaPropSchema, getSchemaDefaultProps, withInspectorMeta } from "./schema.mjs";
3
3
  import { defineMaterial, overwriteMaterial } from "./material.mjs";
4
- import { generateMaterialMap } from "./utils.mjs";
4
+ import { MaterialMap, generateMaterialMap } from "./utils.mjs";
@@ -11,6 +11,11 @@ declare const MATERIAL_CATEGORY: {
11
11
  readonly TOP: "TOP";
12
12
  readonly CENTER: "CENTER";
13
13
  readonly BOTTOM: "BOTTOM";
14
+ readonly 内容组件: "内容组件";
15
+ readonly 金刚组件: "金刚组件";
16
+ readonly 大图宫格: "大图宫格";
17
+ readonly 顶部功能: "顶部功能";
18
+ readonly 行为组件: "行为组件";
14
19
  };
15
20
  type MaterialPropsSchema = z.ZodObject<z.ZodRawShape>;
16
21
  type MaterialSchemaProps<TSchema extends MaterialPropsSchema> = InferSchemaProps<TSchema>;
@@ -14,4 +14,4 @@ type MaterialMap<TMaterials extends readonly MaterialLike[]> = { [Type in TMater
14
14
  */
15
15
  declare function generateMaterialMap<const TMaterials extends readonly MaterialLike[]>(materials: TMaterials): MaterialMap<TMaterials>;
16
16
  //#endregion
17
- export { generateMaterialMap };
17
+ export { MaterialMap, generateMaterialMap };
package/dist/utils.d.mts CHANGED
@@ -1,7 +1,7 @@
1
1
 
2
2
  import { INSPECTOR_META_KEY, InferSchemaProps, MaterialComponentProps, SchemaHasDefaultValue, defineArrayItemPropSchema, defineCheckboxPropSchema, defineColorPropSchema, defineComponentPropsSchema, defineNumberPropSchema, defineObjectPropSchema, defineSelectEnumPropSchema, defineSelectPropSchema, defineSwitchPropSchema, defineTextPropSchema, defineTextareaPropSchema, getSchemaDefaultProps, withInspectorMeta } from "./utils/schema/schema.mjs";
3
3
  import { defineMaterial, overwriteMaterial } from "./utils/schema/material.mjs";
4
- import { generateMaterialMap } from "./utils/schema/utils.mjs";
4
+ import { MaterialMap, generateMaterialMap } from "./utils/schema/utils.mjs";
5
5
  import "./utils/schema/index.mjs";
6
6
  import { clearMyChannelsFromStorage, loadHiddenChannelIdsFromStorage, loadMyChannelsFromStorage, saveHiddenChannelIdsToStorage } from "./utils/channel-storage.mjs";
7
7
  import { cn } from "./utils/cn.mjs";
@@ -18,4 +18,4 @@ import { createInputAndSelectFile, getCoverImage, getImageResolutionFromFile } f
18
18
  import { PresignedUploadInfo, UploadToS3Options, UploadToS3Result, uploadToS3WithPresignedUrl } from "./utils/s3-uploader.mjs";
19
19
  import { base64ToUint8Array, uint8ArrayToBase64, uint8ArrayToNumberArray } from "./utils/uint8.mjs";
20
20
  import { UploadFileResult, encryptBncBuffer, uploadFile } from "./utils/upload-file.mjs";
21
- export { eventBus as EventBus, HttpClient, HttpError, INSPECTOR_META_KEY, ImageCompressionQualityRule, InferSchemaProps, MaterialComponentProps, 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, defineMaterial, defineNumberPropSchema, defineObjectPropSchema, defineSelectEnumPropSchema, defineSelectPropSchema, defineSwitchPropSchema, defineTextPropSchema, defineTextareaPropSchema, disablePageScroll, enablePageScroll, encryptBncBuffer, followUser, formatVideoDuration, generateDynamicSign, generateMaterialMap, generateUUID, getAppId, getAtUserElement, getCookie, getCoverImage, getCurrentSecondTime, getCurrentUserId, getImageCompressionQuality, getImageResolutionFromFile, getResUrl, getSchemaDefaultProps, getUserId, guessImageContentTypeFromUrl, hashPassword, httpClient, imageCompressionQualityRules, isClient, isEncryptedImageUrl, isMobileDevice, loadComponent, loadHiddenChannelIdsFromStorage, loadMyChannelsFromStorage, normalizeClassName, numToString, overwriteMaterial, parseResolution, parseTextAtUserIds, pxToVw, randomString, removeCookie, replaceAtUserElement, replaceAtUserElementHtmlStr, rewriteComponent, saveHiddenChannelIdsToStorage, secondToTime, setCookie, stringToNumber, stripHtmlTags, uint8ArrayToBase64, uint8ArrayToNumberArray, unfollowUser, updateUrlParams, uploadFile, uploadToS3WithPresignedUrl, withInspectorMeta };
21
+ export { eventBus as EventBus, HttpClient, HttpError, INSPECTOR_META_KEY, ImageCompressionQualityRule, InferSchemaProps, MaterialComponentProps, MaterialMap, 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, defineMaterial, defineNumberPropSchema, defineObjectPropSchema, defineSelectEnumPropSchema, defineSelectPropSchema, defineSwitchPropSchema, defineTextPropSchema, defineTextareaPropSchema, disablePageScroll, enablePageScroll, encryptBncBuffer, followUser, formatVideoDuration, generateDynamicSign, generateMaterialMap, generateUUID, getAppId, getAtUserElement, getCookie, getCoverImage, getCurrentSecondTime, getCurrentUserId, getImageCompressionQuality, getImageResolutionFromFile, getResUrl, getSchemaDefaultProps, getUserId, guessImageContentTypeFromUrl, hashPassword, httpClient, imageCompressionQualityRules, isClient, isEncryptedImageUrl, isMobileDevice, loadComponent, loadHiddenChannelIdsFromStorage, loadMyChannelsFromStorage, normalizeClassName, numToString, overwriteMaterial, parseResolution, parseTextAtUserIds, pxToVw, randomString, removeCookie, replaceAtUserElement, replaceAtUserElementHtmlStr, rewriteComponent, saveHiddenChannelIdsToStorage, secondToTime, setCookie, stringToNumber, stripHtmlTags, uint8ArrayToBase64, uint8ArrayToNumberArray, unfollowUser, updateUrlParams, uploadFile, uploadToS3WithPresignedUrl, withInspectorMeta };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@funhub/platform",
3
3
  "type": "module",
4
- "version": "0.1.21",
4
+ "version": "0.1.23",
5
5
  "private": false,
6
6
  "sideEffects": [
7
7
  "**/*.css"