@funhub/platform 0.1.153 → 0.1.155
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/icons/marquee-enter.mjs +2 -0
- package/dist/components/biz/basics/search/shared/components/search-box.mjs +1 -1
- package/dist/components/biz/basics/search/variants/basic-search/runtime/client.mjs +1 -1
- package/dist/components/biz/business/banner/variants/basic-banner/inspector-schema.d.mts +5 -4
- package/dist/components/biz/business/banner/variants/basic-banner/inspector-schema.mjs +1 -1
- package/dist/components/biz/business/banner/variants/basic-banner/material.d.mts +3 -2
- package/dist/components/biz/business/banner-carousel/material.d.mts +3 -2
- package/dist/components/biz/business/banner-carousel/schema.d.mts +3 -2
- package/dist/components/biz/business/banner-carousel/schema.mjs +1 -1
- package/dist/components/biz/business/channel-list/material.d.mts +3 -2
- package/dist/components/biz/business/channel-list/schema.d.mts +3 -2
- package/dist/components/biz/business/channel-list/schema.mjs +1 -1
- package/dist/components/biz/business/detail/shared/detail-operate.mjs +1 -1
- package/dist/components/biz/business/detail/shared/registry.d.mts +17 -14
- package/dist/components/biz/business/detail/shared/runtime-context-provider.mjs +1 -1
- package/dist/components/biz/business/detail/shared/use-video-detail-webview-bridge.mjs +1 -1
- package/dist/components/biz/business/detail/video-detail-actions/schema.mjs +1 -1
- package/dist/components/biz/business/detail/video-detail-info/material.d.mts +3 -2
- package/dist/components/biz/business/detail/video-detail-info/schema.d.mts +3 -2
- package/dist/components/biz/business/detail/video-detail-info/schema.mjs +1 -1
- package/dist/components/biz/business/detail/video-detail-info/server.mjs +1 -1
- package/dist/components/biz/business/detail/video-detail-info-title-tags-episodes/material.d.mts +3 -2
- package/dist/components/biz/business/detail/video-detail-info-title-tags-episodes/schema.d.mts +3 -2
- package/dist/components/biz/business/detail/video-detail-info-title-tags-episodes/schema.mjs +1 -1
- package/dist/components/biz/business/detail/video-detail-player/schema.mjs +1 -1
- package/dist/components/biz/business/detail/video-detail-player-bridge-only/client.d.mts +1 -1
- package/dist/components/biz/business/detail/video-detail-player-bridge-only/client.mjs +1 -1
- package/dist/components/biz/business/detail/video-detail-player-bridge-only/schema.mjs +1 -1
- package/dist/components/biz/business/detail/video-detail-recommend/client.mjs +1 -1
- package/dist/components/biz/business/detail/video-detail-recommend/material.d.mts +11 -10
- package/dist/components/biz/business/detail/video-detail-recommend/schema.d.mts +11 -10
- package/dist/components/biz/business/detail/video-detail-recommend/schema.mjs +1 -1
- package/dist/components/biz/business/floating-ball/material.d.mts +3 -2
- package/dist/components/biz/business/floating-ball/schema.d.mts +5 -4
- package/dist/components/biz/business/floating-ball/schema.mjs +1 -1
- package/dist/components/biz/business/header-search/header-avatar-icon/schema.mjs +1 -1
- package/dist/components/biz/business/header-search/header-avatar-logo-search/material.d.mts +3 -2
- package/dist/components/biz/business/header-search/header-avatar-logo-search/schema.d.mts +3 -2
- package/dist/components/biz/business/header-search/header-avatar-logo-search/schema.mjs +1 -1
- package/dist/components/biz/business/header-search/header-avatar-logo-search-icon/material.d.mts +3 -2
- package/dist/components/biz/business/header-search/header-avatar-logo-search-icon/schema.d.mts +3 -2
- package/dist/components/biz/business/header-search/header-avatar-logo-search-icon/schema.mjs +1 -1
- package/dist/components/biz/business/header-search/header-logo-search/material.d.mts +3 -2
- package/dist/components/biz/business/header-search/header-logo-search/schema.d.mts +3 -2
- package/dist/components/biz/business/header-search/header-logo-search/schema.mjs +1 -1
- package/dist/components/biz/business/header-search/header-search/schema.mjs +1 -1
- package/dist/components/biz/business/home-recommend/home-recommend-grid/inspector-schema.d.mts +13 -12
- package/dist/components/biz/business/home-recommend/home-recommend-grid/inspector-schema.mjs +1 -1
- package/dist/components/biz/business/home-recommend/home-recommend-grid/material.d.mts +13 -12
- package/dist/components/biz/business/home-recommend/home-recommend-waterfall/inspector-schema.d.mts +11 -10
- package/dist/components/biz/business/home-recommend/home-recommend-waterfall/inspector-schema.mjs +1 -1
- package/dist/components/biz/business/home-recommend/home-recommend-waterfall/material.d.mts +11 -10
- package/dist/components/biz/business/home-recommend/shared/home-recommend-base.mjs +1 -1
- package/dist/components/biz/business/home-recommend/shared/home-recommend-server-data.mjs +1 -1
- package/dist/components/biz/business/home-recommend/shared/home-recommend-video-detail.mjs +1 -1
- package/dist/components/biz/business/image-text-recommend/material.d.mts +15 -14
- package/dist/components/biz/business/image-text-recommend/schema.d.mts +15 -14
- package/dist/components/biz/business/image-text-recommend/schema.mjs +1 -1
- package/dist/components/biz/business/large-feature-grid/client.mjs +1 -1
- package/dist/components/biz/business/large-feature-grid/schema.mjs +1 -1
- package/dist/components/biz/business/marquee/client.mjs +1 -1
- package/dist/components/biz/business/marquee/material.d.mts +8 -7
- package/dist/components/biz/business/marquee/schema.d.mts +26 -24
- package/dist/components/biz/business/marquee/schema.mjs +1 -1
- package/dist/components/biz/business/profile/profile-header/client.mjs +1 -1
- package/dist/components/biz/business/profile/profile-header/schema.mjs +1 -1
- package/dist/components/biz/business/profile/profile-header/user-profile-avatar.mjs +1 -1
- package/dist/components/biz/business/profile/profile-header/user-profile-cover-background.mjs +1 -1
- package/dist/components/biz/business/profile/profile-main/schema.mjs +1 -1
- package/dist/components/biz/business/profile/profile-main/shell.mjs +1 -1
- package/dist/components/biz/business/profile/profile-main/tabs/collect-tab/client.mjs +1 -1
- package/dist/components/biz/business/profile/profile-main/tabs/like-tab/client.d.mts +1 -1
- package/dist/components/biz/business/search-bar/variants/basic-search-bar/runtime/client.mjs +1 -1
- package/dist/components/biz/business/search-history/client.mjs +1 -1
- package/dist/components/biz/business/search-history/material.d.mts +3 -2
- package/dist/components/biz/business/search-history/schema.d.mts +3 -2
- package/dist/components/biz/business/search-history/schema.mjs +1 -1
- package/dist/components/biz/business/search-input/schema.mjs +1 -1
- package/dist/components/biz/business/shortcut-grid/material.d.mts +5 -4
- package/dist/components/biz/business/shortcut-grid/schema.d.mts +5 -4
- package/dist/components/biz/business/shortcut-grid/schema.mjs +1 -1
- package/dist/components/biz/business/tab-bar/schema.mjs +1 -1
- package/dist/components/biz/business/text-recommend/material.d.mts +4 -3
- package/dist/components/biz/business/text-recommend/schema.d.mts +4 -3
- package/dist/components/biz/business/text-recommend/schema.mjs +1 -1
- package/dist/components/biz/example/button/material.d.mts +9 -8
- package/dist/components/biz/example/button/schema.d.mts +21 -19
- package/dist/components/biz/example/button/schema.mjs +1 -1
- package/dist/components/common/image-crop-modal/image-crop-modal.mjs +2 -2
- package/dist/components/common/series-episodes/index.mjs +1 -1
- package/dist/components/common/video-player/process-m3u8-cache.mjs +1 -1
- package/dist/components/pages/collection-add/page.mjs +1 -1
- package/dist/components/pages/collection-create/form.mjs +1 -1
- package/dist/components/pages/collection-detail/detail.mjs +1 -1
- package/dist/components/pages/login/verify.mjs +1 -1
- package/dist/components/pages/publish/components/upload-progress.mjs +1 -1
- package/dist/components/pages/search/hot-recommend.mjs +1 -1
- package/dist/components/pages/search/style.module.mjs +3 -31
- package/dist/components/pages/search/top-header.mjs +1 -1
- package/dist/components/pages/search-result/search-all.mjs +1 -1
- package/dist/components/pages/search-result/search-tab.mjs +1 -1
- package/dist/components/pages/search-result/search-user.mjs +1 -1
- package/dist/components/pages/search-result/search-video.mjs +1 -1
- package/dist/components/pages/video-detail/video-detail-client.mjs +1 -1
- package/dist/components/pages/video-list/index.mjs +1 -1
- package/dist/components/pages/video-list/video-list-client.mjs +1 -1
- package/dist/components/ui/badge.d.mts +1 -1
- package/dist/components/ui/button.d.mts +1 -1
- package/dist/components/ui/image.d.mts +4 -4
- package/dist/components/ui/item.mjs +1 -1
- package/dist/components/ui/loading.d.mts +42 -0
- package/dist/hooks/use-first-row-height.d.mts +69 -0
- package/dist/hooks/use-first-row-height.mjs +2 -0
- package/dist/hooks/use-min-duration-loading.d.mts +18 -0
- package/dist/hooks/use-min-duration-loading.mjs +2 -0
- package/dist/hooks.d.mts +3 -1
- package/dist/hooks.mjs +1 -1
- package/dist/pages.mjs +1 -1
- package/dist/service/generated/client.d.mts +12 -4
- package/dist/service/generated/client.mjs +1 -1
- package/dist/service/generated/tanstack.d.mts +14 -4
- package/dist/service/generated/tanstack.mjs +1 -1
- package/dist/service/register-by-verify-email-code.d.mts +2 -2
- package/dist/service/register-by-verify-email-code.mjs +1 -1
- package/dist/service.d.mts +4 -4
- package/dist/service.mjs +1 -1
- package/dist/types.d.mts +548 -57
- package/dist/ui.d.mts +2 -1
- package/dist/ui.mjs +1 -1
- package/dist/utils/device-id.d.mts +14 -0
- package/dist/utils/device-id.mjs +2 -0
- package/dist/utils/http.mjs +1 -1
- package/dist/utils/image-crop.mjs +1 -1
- package/dist/utils/schema/index.d.mts +1 -1
- package/dist/utils/schema/inspector.d.mts +43 -71
- package/dist/utils/schema/schema.d.mts +59 -53
- package/dist/utils/schema/schema.mjs +1 -1
- package/dist/utils/tools.mjs +1 -1
- package/dist/utils.d.mts +3 -2
- package/dist/utils.mjs +1 -1
- package/package.json +1 -1
- package/dist/components/common/image-crop/image-crop.mjs +0 -2
- package/dist/components/common/image-crop/show-image-crop.mjs +0 -2
package/dist/utils.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
import{cn as e}from"./utils/cn.mjs";import{clearMyChannelsFromStorage as t,loadHiddenChannelIdsFromStorage as
|
|
2
|
+
import{cn as e}from"./utils/cn.mjs";import{clearMyChannelsFromStorage as t,loadHiddenChannelIdsFromStorage as ee,loadMyChannelsFromStorage as n,saveHiddenChannelIdsToStorage as r}from"./utils/channel-storage.mjs";import{debounceFun as i,formatVideoDuration as a,generateDynamicSign as o,generateUUID as s,getAtUserElement as c,getCookie as l,getCurrentSecondTime as u,getUserId as d,hashPassword as f,isClient as p,isMobileDevice as m,numToString as h,parseResolution as g,parseTextAtUserIds as _,randomString as v,removeCookie as y,replaceAtUserElement as b,replaceAtUserElementHtmlStr as x,secondToTime as S,setCookie as C,stringToNumber as w,stripHtmlTags as T,updateUrlParams as E}from"./utils/common.mjs";import D from"./utils/get-res-url.mjs";import{decryptImageToArrayBuffer as O,decryptImageToUint8Array as k,decryptImageUrl as A,guessImageContentTypeFromUrl as j,isEncryptedImageUrl as M,resolveImageUrl as N,shouldProbeImageUrl as P,shouldUseApiResDirectly as F}from"./utils/decrypt-image-client.mjs";import{getOrCreateDeviceId as I}from"./utils/device-id.mjs";import L from"./utils/event-bus.mjs";import R,{HttpClient as z,HttpError as B}from"./utils/http.mjs";import{checkFollowStatus as V,followUser as H,getAppId as U,getCurrentUserId as W,unfollowUser as G}from"./utils/follow-service.mjs";import{disablePageScroll as K,enablePageScroll as q,normalizeClassName as J,pxToVw as te}from"./utils/helper.mjs";import{compressImage as Y,defaultImageCompressionMaxSizeMB as X,defaultImageCompressionQuality as Z,getImageCompressionQuality as Q,imageCompressionQualityRules as ne}from"./utils/image-compression.mjs";import{components as re,loadComponent as ie,rewriteComponent as ae}from"./utils/loaders.mjs";import{createInputAndSelectFile as oe,getCoverImage as se,getImageResolutionFromFile as ce}from"./utils/media.mjs";import{PASSWORD_ALLOWED_SPECIAL_CHARS as le,PASSWORD_MAX_LENGTH as ue,PASSWORD_MIN_LENGTH as de,getFirstInvalidPasswordChar as fe,getPasswordCharacterTypeCount as pe,getPasswordValidationErrorText as me,validatePasswordPair as he}from"./utils/password-validator.mjs";import{uploadToS3WithPresignedUrl as ge}from"./utils/s3-uploader.mjs";import{defineMaterial as _e,overwriteMaterial as ve}from"./utils/schema/material.mjs";import{INSPECTOR_META_KEY as ye,array as be,boolean as xe,datetime as Se,defineComponentPropsSchema as Ce,enumSchema as $,getSchemaDefaultProps as we,number as Te,object as Ee,string as De,timeRange as Oe,withInspectorMeta as ke}from"./utils/schema/schema.mjs";import{generateMaterialMap as Ae,generateMaterialMapGroupByCategory as je}from"./utils/schema/utils.mjs";import{base64ToUint8Array as Me,uint8ArrayToBase64 as Ne,uint8ArrayToNumberArray as Pe}from"./utils/uint8.mjs";import{encryptBncBuffer as Fe,uploadFile as Ie}from"./utils/upload-file.mjs";import{useRouter as Le}from"./utils/use-compatible-router.mjs";export{L as EventBus,z as HttpClient,B as HttpError,ye as INSPECTOR_META_KEY,le as PASSWORD_ALLOWED_SPECIAL_CHARS,ue as PASSWORD_MAX_LENGTH,de as PASSWORD_MIN_LENGTH,be as array,Me as base64ToUint8Array,xe as boolean,V as checkFollowStatus,t as clearMyChannelsFromStorage,e as cn,re as components,Y as compressImage,oe as createInputAndSelectFile,Se as datetime,i as debounceFun,O as decryptImageToArrayBuffer,k as decryptImageToUint8Array,A as decryptImageUrl,X as defaultImageCompressionMaxSizeMB,Z as defaultImageCompressionQuality,Ce as defineComponentPropsSchema,_e as defineMaterial,K as disablePageScroll,q as enablePageScroll,Fe as encryptBncBuffer,$ as enum,$ as enumSchema,H as followUser,a as formatVideoDuration,o as generateDynamicSign,Ae as generateMaterialMap,je as generateMaterialMapGroupByCategory,s as generateUUID,U as getAppId,c as getAtUserElement,l as getCookie,se as getCoverImage,u as getCurrentSecondTime,W as getCurrentUserId,fe as getFirstInvalidPasswordChar,Q as getImageCompressionQuality,ce as getImageResolutionFromFile,I as getOrCreateDeviceId,pe as getPasswordCharacterTypeCount,me as getPasswordValidationErrorText,D as getResUrl,we as getSchemaDefaultProps,d as getUserId,j as guessImageContentTypeFromUrl,f as hashPassword,R as httpClient,ne as imageCompressionQualityRules,p as isClient,M as isEncryptedImageUrl,m as isMobileDevice,ie as loadComponent,ee as loadHiddenChannelIdsFromStorage,n as loadMyChannelsFromStorage,J as normalizeClassName,h as numToString,Te as number,Ee as object,ve as overwriteMaterial,g as parseResolution,_ as parseTextAtUserIds,te as pxToVw,v as randomString,y as removeCookie,b as replaceAtUserElement,x as replaceAtUserElementHtmlStr,N as resolveImageUrl,ae as rewriteComponent,r as saveHiddenChannelIdsToStorage,S as secondToTime,C as setCookie,P as shouldProbeImageUrl,F as shouldUseApiResDirectly,De as string,w as stringToNumber,T as stripHtmlTags,Oe as timeRange,Ne as uint8ArrayToBase64,Pe as uint8ArrayToNumberArray,G as unfollowUser,E as updateUrlParams,Ie as uploadFile,ge as uploadToS3WithPresignedUrl,Le as useRouter,he as validatePasswordPair,ke as withInspectorMeta};
|
package/package.json
CHANGED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
"use client";import{defaultImageCompressionQuality as e}from"../../../utils/image-compression.mjs";import{Dialog as t,DialogContent as n}from"../../ui/dialog.mjs";import{fileToDataUrl as r,getCroppedFile as i,getOptimalQuality as a,validateImageFile as o}from"../../../utils/image-crop.mjs";import{useCallback as s,useEffect as c,useMemo as l,useState as u}from"react";import{jsx as d,jsxs as f}from"react/jsx-runtime";import p from"react-easy-crop";function m({visible:m,file:h,quality:g,outputFormat:_=`jpeg`,maxWidth:v,maxHeight:y,cropShape:b=`round`,onCropComplete:x,onCancel:S,className:C}){let[w,T]=u(``),[E,D]=u(!1),[O,k]=u(``),[A,j]=u({crop:{x:0,y:0},zoom:1,croppedAreaPixels:null}),M=l(()=>g===void 0?h?a(h.size):e:g,[g,h]);c(()=>{if(!h||!m){T(``),k(``);return}if(!o(h)){k(`请选择有效的图片文件(支持 JPEG、PNG、WebP、GIF 格式)`);return}if(h.size>20*1024*1024){k(`文件大小不能超过 20MB`);return}D(!0),k(``),r(h).then(e=>{T(e),D(!1)}).catch(e=>{console.error(`图片加载失败:`,e),k(`图片加载失败,请重试`),D(!1)})},[h,m]),c(()=>{m&&j({crop:{x:0,y:0},zoom:1,croppedAreaPixels:null})},[m,h]);let N=s(e=>{j(t=>({...t,crop:e}))},[]),P=s(e=>{j(t=>({...t,zoom:e}))},[]),F=s((e,t)=>{j(e=>({...e,croppedAreaPixels:t}))},[]),I=s(async()=>{if(!h||!A.croppedAreaPixels){k(`请先选择裁剪区域`);return}D(!0),k(``);try{let e=`image/${_}`;x({file:await i(w,A.croppedAreaPixels,`cropped.${_}`,{fileType:e,quality:M,maxWidth:v,maxHeight:y,circular:b===`round`}),originalFile:h,cropArea:A.croppedAreaPixels})}catch(e){console.error(`裁剪失败:`,e),k(`裁剪失败,请重试`)}finally{D(!1)}},[h,A.croppedAreaPixels,M,_,v,y,b,w,x]),L=s(()=>{S()},[S]);return m?d(t,{open:m,onOpenChange:L,children:d(n,{showCloseButton:!1,className:`bg-black/90 !m-0 !p-0 !fixed !inset-0 !w-screen !h-screen !max-w-none !rounded-none !top-0 !left-0 !translate-x-0 !translate-y-0 !transform-none z-[9999] !pointer-events-auto ${C||``}`,children:f(`div`,{className:`relative flex h-full w-full flex-col`,children:[w&&!O&&f(`div`,{className:`absolute top-0 left-0 right-0 z-10 flex h-16 items-center justify-between px-4`,children:[d(`button`,{type:`button`,className:`flex h-full items-center justify-center px-4 text-white transition-colors hover:text-white/80`,onClick:L,disabled:E,children:d(`svg`,{className:`w-4 h-4`,xmlns:`http://www.w3.org/2000/svg`,fill:`currentColor`,viewBox:`0 0 16 16`,children:d(`path`,{d:`M14.55.2a.889.889 0 0 1 1.25 1.25l-.06.067L9.255 8l6.483 6.482.06.069a.888.888 0 0 1-1.25 1.25l-.067-.062L8 9.256l-6.482 6.483A.888.888 0 1 1 .26 14.482L6.742 8 .26 1.517.2 1.45A.888.888 0 0 1 1.45.2l.067.062 6.482 6.482L14.482.261l.068-.062Z`})})}),d(`button`,{type:`button`,className:`h-8 rounded-full bg-primary px-4 text-base font-medium text-primary-foreground transition-colors hover:bg-primary/80 disabled:opacity-50`,onClick:I,disabled:E||!A.croppedAreaPixels||!!O,children:`确定`})]}),f(`div`,{className:`relative flex-1 overflow-hidden bg-black`,children:[E&&f(`div`,{className:`absolute left-1/2 top-1/2 flex -translate-x-1/2 -translate-y-1/2 items-center gap-2 text-white`,children:[d(`div`,{className:`h-5 w-5 animate-spin rounded-full border-2 border-white/30 border-t-white`}),d(`span`,{children:`处理中...`})]}),O&&d(`div`,{className:`absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 text-center text-red-500`,children:O}),w&&!O&&d(p,{image:w,crop:A.crop,zoom:A.zoom,onCropChange:N,onZoomChange:P,onCropComplete:F,showGrid:!0,cropShape:b,restrictPosition:!0,zoomWithScroll:!0})]})]})})}):null}export{m as ImageCrop};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
"use client";import{ImageCrop as e}from"./image-crop.mjs";import"react";import{jsx as t}from"react/jsx-runtime";import{createRoot as n}from"react-dom/client";function r(r,i){return new Promise((a,o)=>{if(!r){o(Error(`文件参数不能为空`));return}if(![`image/jpeg`,`image/jpg`,`image/png`,`image/webp`,`image/gif`].includes(r.type)){o(Error(`不支持的文件类型,请选择图片文件`));return}if(r.size>20*1024*1024){o(Error(`文件大小不能超过 20MB`));return}if(i?.aspectRatio!==void 0&&(i.aspectRatio<=0||!Number.isFinite(i.aspectRatio))){o(Error(`aspectRatio 必须是一个大于0的有限数`));return}if(i?.quality!==void 0&&(i.quality<0||i.quality>1)){o(Error(`quality 必须在 0-1 之间`));return}if(i?.maxWidth!==void 0&&i.maxWidth<=0){o(Error(`maxWidth 必须大于0`));return}if(i?.maxHeight!==void 0&&i.maxHeight<=0){o(Error(`maxHeight 必须大于0`));return}let s=document.createElement(`div`);document.body.appendChild(s);let c=n(s),l=()=>{c.unmount(),document.body.removeChild(s)};c.render(t(e,{visible:!0,file:r,aspectRatio:i?.aspectRatio||1,quality:i?.quality,outputFormat:i?.outputFormat||`jpeg`,maxWidth:i?.maxWidth,maxHeight:i?.maxHeight,cropShape:i?.cropShape||`round`,onCropComplete:e=>{l(),a(e.file)},onCancel:()=>{l()}}))})}export{r as showImageCrop};
|