@funhub/platform 0.1.152 → 0.1.154
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.
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{Button as e}from"../../../ui/button.mjs";import t from"../../../../utils/event-bus.mjs";import{
|
|
2
|
+
"use client";import{Button as e}from"../../../ui/button.mjs";import t from"../../../../utils/event-bus.mjs";import{useUserStore as n}from"../../../../store/modules/user-store.mjs";import{useRouter as r}from"../../../../utils/use-compatible-router.mjs";import{Box as i}from"../../../ui/box.mjs";import{Text as a}from"../../../ui/text.mjs";import{eventKey as o}from"../../../../constants/event-key.mjs";import{useSearchHistory as s}from"../../../../hooks/use-search-history.mjs";import{DeleteConfirmDialog as c}from"../../../common/delete-confirm-dialog/delete-confirm-dialog.mjs";import{useMemo as l,useState as u}from"react";import{jsx as d,jsxs as f}from"react/jsx-runtime";import{usePathname as p,useSearchParams as m}from"next/navigation";function h(e,t){let n=Array.from(e);return n.length<=t?e:`${n.slice(0,t).join(``)}...`}function g(g){let{title:_,rows:v=1,clearText:y,confirmDescription:b,onHistoryClick:x,mode:S=`renderer`}=g,C=_??`搜索历史`,w=y??`清空`,T=b??`确定要清除所有搜索历史吗?`,E=l(()=>[`搜索历史1`,`搜索历史2`,`搜索历史3`],[]),[D,O]=u(!1),k=r(),A=p(),j=m(),{userInfo:M}=n(),{history:N,addHistory:P,clearHistory:F}=s({storageKey:M?.user_id||`guest`}),I=()=>{F(),O(!1),t.emit(o.SEARCH_HISTORY_UPDATE)},L=l(()=>(N.length?N:S===`editor`?E:[]).slice(0,v*10),[N,S,E,v]);if(L.length===0)return null;let R=e=>{if(P(e),x){x(e);return}let t=new URLSearchParams(j.toString());t.set(`q`,e);let n=A.includes(`/search-result`)?A:`/search-result`;k.push(`${n}?${t.toString()}`)};return f(i,{className:`px-4 py-2`,children:[f(i,{className:`flex justify-between items-center mb-2`,children:[d(a,{className:`text-[16px] font-bold text-text1`,children:C}),d(e,{variant:`ghost`,size:`sm`,className:`text-text3 text-[12px] p-0 h-auto`,onClick:()=>O(!0),children:w})]}),d(i,{className:`flex flex-wrap gap-2 overflow-hidden`,style:{maxHeight:`${v*30}px`},children:L.map((e,t)=>d(i,{className:`px-3 py-1 bg-bg2 rounded-full cursor-pointer`,onClick:()=>R(e),children:d(a,{className:`text-[14px] text-text2`,children:h(e,8)})},t))}),d(c,{open:D,onOpenChange:O,onConfirm:I,title:``,description:T})]})}export{g as SearchHistoryClient};
|
|
@@ -6,7 +6,7 @@ import * as class_variance_authority_types0 from "class-variance-authority/types
|
|
|
6
6
|
//#region components/ui/badge.d.ts
|
|
7
7
|
/** badgeVariants 工具定义。 */
|
|
8
8
|
declare const badgeVariants: (props?: ({
|
|
9
|
-
variant?: "
|
|
9
|
+
variant?: "default" | "destructive" | "secondary" | "outline" | "ghost" | "link" | null | undefined;
|
|
10
10
|
} & class_variance_authority_types0.ClassProp) | undefined) => string;
|
|
11
11
|
/** Badge 组件。 */
|
|
12
12
|
declare function Badge({
|
|
@@ -8,7 +8,7 @@ import * as class_variance_authority_types0 from "class-variance-authority/types
|
|
|
8
8
|
//#region components/ui/button-group.d.ts
|
|
9
9
|
/** buttonGroupVariants 工具定义。 */
|
|
10
10
|
declare const buttonGroupVariants: (props?: ({
|
|
11
|
-
orientation?: "
|
|
11
|
+
orientation?: "horizontal" | "vertical" | null | undefined;
|
|
12
12
|
} & class_variance_authority_types0.ClassProp) | undefined) => string;
|
|
13
13
|
/** ButtonGroupText 组件属性。 */
|
|
14
14
|
type ButtonGroupTextProps = useRender.ComponentProps<'div'>;
|
|
@@ -7,8 +7,8 @@ import * as class_variance_authority_types0 from "class-variance-authority/types
|
|
|
7
7
|
//#region components/ui/button.d.ts
|
|
8
8
|
/** buttonVariants 工具定义。 */
|
|
9
9
|
declare const buttonVariants: (props?: ({
|
|
10
|
-
variant?: "
|
|
11
|
-
size?: "default" | "
|
|
10
|
+
variant?: "default" | "destructive" | "secondary" | "outline" | "ghost" | "link" | null | undefined;
|
|
11
|
+
size?: "default" | "xs" | "sm" | "lg" | "icon" | "icon-xs" | "icon-sm" | "icon-lg" | null | undefined;
|
|
12
12
|
} & class_variance_authority_types0.ClassProp) | undefined) => string;
|
|
13
13
|
/** Button 组件属性。 */
|
|
14
14
|
type ButtonProps = Button.Props & VariantProps<typeof buttonVariants> & {
|
|
@@ -51,7 +51,7 @@ declare function FieldGroup({
|
|
|
51
51
|
}: FieldGroupProps): react_jsx_runtime0.JSX.Element;
|
|
52
52
|
/** fieldVariants 工具定义。 */
|
|
53
53
|
declare const fieldVariants: (props?: ({
|
|
54
|
-
orientation?: "
|
|
54
|
+
orientation?: "horizontal" | "vertical" | "responsive" | null | undefined;
|
|
55
55
|
} & class_variance_authority_types0.ClassProp) | undefined) => string;
|
|
56
56
|
/** Field 组件。 */
|
|
57
57
|
declare function Field({
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@funhub/platform",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.154",
|
|
5
5
|
"private": false,
|
|
6
6
|
"sideEffects": [
|
|
7
7
|
"**/*.css"
|
|
@@ -70,6 +70,30 @@
|
|
|
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
|
+
},
|
|
73
97
|
"peerDependencies": {
|
|
74
98
|
"@tanstack/query-core": ">=5",
|
|
75
99
|
"@tanstack/react-query": ">=5",
|
|
@@ -118,6 +142,7 @@
|
|
|
118
142
|
"zustand": "^5.0.9"
|
|
119
143
|
},
|
|
120
144
|
"devDependencies": {
|
|
145
|
+
"@funhub/eslint-config": "workspace:*",
|
|
121
146
|
"@svgr/webpack": "^8.1.0",
|
|
122
147
|
"@types/crypto-js": "^4.2.2",
|
|
123
148
|
"@types/lodash-es": "^4.17.12",
|
|
@@ -126,31 +151,6 @@
|
|
|
126
151
|
"rollup-plugin-postcss": "^4.0.2",
|
|
127
152
|
"rollup-preserve-directives": "^1.1.3",
|
|
128
153
|
"tsdown": "0.20.3",
|
|
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"
|
|
154
|
+
"vite-plugin-svgr": "^4.3.0"
|
|
155
155
|
}
|
|
156
|
-
}
|
|
156
|
+
}
|