@funhub/platform 0.1.154 → 0.1.156

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 (46) hide show
  1. package/dist/assets/icons/marquee-enter.mjs +2 -0
  2. package/dist/assets/images/marquee.mjs +1 -1
  3. package/dist/components/biz/basics/search/shared/components/search-box.mjs +1 -1
  4. package/dist/components/biz/basics/search/variants/basic-search/runtime/client.mjs +1 -1
  5. package/dist/components/biz/business/detail/shared/detail-operate.mjs +1 -1
  6. package/dist/components/biz/business/detail/shared/runtime-context-provider.mjs +1 -1
  7. package/dist/components/biz/business/detail/shared/use-video-detail-webview-bridge.mjs +1 -1
  8. package/dist/components/biz/business/detail/video-detail-actions/client.mjs +1 -1
  9. package/dist/components/biz/business/detail/video-detail-recommend/client.mjs +1 -1
  10. package/dist/components/biz/business/home-recommend/shared/home-recommend-base.mjs +1 -1
  11. package/dist/components/biz/business/large-feature-grid/client.mjs +1 -1
  12. package/dist/components/biz/business/marquee/client.mjs +1 -1
  13. package/dist/components/biz/business/profile/profile-header/client.mjs +1 -1
  14. package/dist/components/biz/business/profile/profile-header/user-profile-cover-background.mjs +1 -1
  15. package/dist/components/biz/business/profile/profile-main/shell.mjs +1 -1
  16. package/dist/components/biz/business/profile/profile-main/tabs/collect-tab/client.mjs +1 -1
  17. package/dist/components/biz/business/search-bar/variants/basic-search-bar/runtime/client.mjs +1 -1
  18. package/dist/components/biz/business/search-history/client.mjs +1 -1
  19. package/dist/components/common/image-crop-modal/image-crop-modal.mjs +2 -2
  20. package/dist/components/common/series-episodes/index.mjs +1 -1
  21. package/dist/components/pages/publish/components/upload-progress.mjs +1 -1
  22. package/dist/components/pages/search/hot-recommend.mjs +1 -1
  23. package/dist/components/pages/search/style.module.mjs +3 -31
  24. package/dist/components/pages/search/top-header.mjs +1 -1
  25. package/dist/components/pages/search-result/search-all.mjs +1 -1
  26. package/dist/components/pages/search-result/search-tab.mjs +1 -1
  27. package/dist/components/pages/search-result/search-user.mjs +1 -1
  28. package/dist/components/pages/search-result/search-video.mjs +1 -1
  29. package/dist/components/pages/video-detail/video-detail-client.mjs +1 -1
  30. package/dist/components/pages/video-list/index.mjs +1 -1
  31. package/dist/components/pages/video-list/video-list-client.mjs +1 -1
  32. package/dist/components/ui/badge.d.mts +1 -1
  33. package/dist/components/ui/button.d.mts +1 -1
  34. package/dist/components/ui/image.d.mts +4 -4
  35. package/dist/components/ui/item.mjs +1 -1
  36. package/dist/components/ui/loading.d.mts +42 -0
  37. package/dist/pages.mjs +1 -1
  38. package/dist/ui.d.mts +2 -2
  39. package/dist/ui.mjs +1 -1
  40. package/dist/utils/image-crop.mjs +1 -1
  41. package/dist/utils/tools.mjs +1 -1
  42. package/package.json +28 -28
  43. package/dist/components/common/image-crop/image-crop.mjs +0 -2
  44. package/dist/components/common/image-crop/show-image-crop.mjs +0 -2
  45. package/dist/components/ui/dots-loading.d.mts +0 -25
  46. package/dist/components/ui/dots-loading.mjs +0 -2
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@funhub/platform",
3
3
  "type": "module",
4
- "version": "0.1.154",
4
+ "version": "0.1.156",
5
5
  "private": false,
6
6
  "sideEffects": [
7
7
  "**/*.css"
@@ -70,30 +70,6 @@
70
70
  "dist",
71
71
  "theme.css"
72
72
  ],
73
- "scripts": {
74
- "dev:web": "next dev",
75
- "build:web": "next build",
76
- "prebuild": "pnpm i18n:build",
77
- "build": "cross-env TSDOWN_ENV=production tsdown",
78
- "predev": "pnpm i18n:build",
79
- "dev": "node scripts/dev-with-i18n-watch.mjs",
80
- "dev:core": "cross-env TSDOWN_ENV=development tsdown --watch",
81
- "publish:platform": "node scripts/publish-platform.mjs",
82
- "gen:api": "node ./scripts/generate-from-swagger.cjs",
83
- "pp": "pnpm publish:platform",
84
- "start": "next start",
85
- "prelint": "pnpm i18n:build",
86
- "lint": "eslint . --fix",
87
- "pretypecheck": "pnpm i18n:build",
88
- "typecheck": "tsc --noEmit",
89
- "i18n:find": "node scripts/i18n-locale-tool.mjs find",
90
- "i18n:set": "node scripts/i18n-locale-tool.mjs set",
91
- "i18n:flatten": "node scripts/i18n-flat-sync.mjs flatten",
92
- "i18n:build": "node scripts/i18n-flat-sync.mjs build",
93
- "i18n:watch": "node scripts/i18n-flat-sync.mjs watch",
94
- "i18n:check": "node scripts/i18n-flat-sync.mjs check",
95
- "pretest": "pnpm i18n:build"
96
- },
97
73
  "peerDependencies": {
98
74
  "@tanstack/query-core": ">=5",
99
75
  "@tanstack/react-query": ">=5",
@@ -142,7 +118,6 @@
142
118
  "zustand": "^5.0.9"
143
119
  },
144
120
  "devDependencies": {
145
- "@funhub/eslint-config": "workspace:*",
146
121
  "@svgr/webpack": "^8.1.0",
147
122
  "@types/crypto-js": "^4.2.2",
148
123
  "@types/lodash-es": "^4.17.12",
@@ -151,6 +126,31 @@
151
126
  "rollup-plugin-postcss": "^4.0.2",
152
127
  "rollup-preserve-directives": "^1.1.3",
153
128
  "tsdown": "0.20.3",
154
- "vite-plugin-svgr": "^4.3.0"
129
+ "vite-plugin-svgr": "^4.3.0",
130
+ "@funhub/eslint-config": "0.0.1"
131
+ },
132
+ "scripts": {
133
+ "dev:web": "next dev",
134
+ "build:web": "next build",
135
+ "prebuild": "pnpm i18n:build",
136
+ "build": "cross-env TSDOWN_ENV=production tsdown",
137
+ "predev": "pnpm i18n:build",
138
+ "dev": "node scripts/dev-with-i18n-watch.mjs",
139
+ "dev:core": "cross-env TSDOWN_ENV=development tsdown --watch",
140
+ "publish:platform": "node scripts/publish-platform.mjs",
141
+ "gen:api": "node ./scripts/generate-from-swagger.cjs",
142
+ "pp": "pnpm publish:platform",
143
+ "start": "next start",
144
+ "prelint": "pnpm i18n:build",
145
+ "lint": "eslint . --fix",
146
+ "pretypecheck": "pnpm i18n:build",
147
+ "typecheck": "tsc --noEmit",
148
+ "i18n:find": "node scripts/i18n-locale-tool.mjs find",
149
+ "i18n:set": "node scripts/i18n-locale-tool.mjs set",
150
+ "i18n:flatten": "node scripts/i18n-flat-sync.mjs flatten",
151
+ "i18n:build": "node scripts/i18n-flat-sync.mjs build",
152
+ "i18n:watch": "node scripts/i18n-flat-sync.mjs watch",
153
+ "i18n:check": "node scripts/i18n-flat-sync.mjs check",
154
+ "pretest": "pnpm i18n:build"
155
155
  }
156
- }
156
+ }
@@ -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};
@@ -1,25 +0,0 @@
1
-
2
- import * as React from "react";
3
- import * as react_jsx_runtime0 from "react/jsx-runtime";
4
-
5
- //#region components/ui/dots-loading.d.ts
6
- /** DotsLoading 组件属性。 */
7
- interface DotsLoadingProps extends React.HTMLAttributes<HTMLDivElement> {
8
- /**
9
- * 点的大小(px)。
10
- * @default 6
11
- */
12
- dotSize?: number;
13
- }
14
- /**
15
- * DotsLoading
16
- *
17
- * 三个点的 loading 动画,用于列表底部轻量提示。
18
- */
19
- declare function DotsLoading({
20
- className,
21
- dotSize,
22
- ...rest
23
- }: DotsLoadingProps): react_jsx_runtime0.JSX.Element;
24
- //#endregion
25
- export { DotsLoading };
@@ -1,2 +0,0 @@
1
-
2
- "use client";import{cn as e}from"../../utils/cn.mjs";import{jsx as t,jsxs as n}from"react/jsx-runtime";function r({className:r,dotSize:i=6,...a}){let o={width:i,height:i};return n(`div`,{className:e(`inline-flex items-center gap-2 text-text2`,r),role:`status`,"aria-label":`Loading`,...a,children:[t(`span`,{className:`inline-block rounded-full bg-current animate-bounce`,style:{...o,animationDelay:`0ms`}}),t(`span`,{className:`inline-block rounded-full bg-current animate-bounce`,style:{...o,animationDelay:`150ms`}}),t(`span`,{className:`inline-block rounded-full bg-current animate-bounce`,style:{...o,animationDelay:`300ms`}})]})}export{r as DotsLoading};