weifuwu 0.61.2 → 0.62.0

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 (37) hide show
  1. package/README.md +100 -10
  2. package/dist/client/diff.d.ts +13 -1
  3. package/dist/client/index.js +3 -3
  4. package/dist/client/popup.d.ts +22 -0
  5. package/dist/client/types.d.ts +4 -0
  6. package/dist/components/AvatarGroup/AvatarGroup.d.ts +21 -0
  7. package/dist/components/CodeBlock/CodeBlock.d.ts +14 -0
  8. package/dist/components/Descriptions/Descriptions.d.ts +21 -0
  9. package/dist/components/Highlight/Highlight.d.ts +13 -0
  10. package/dist/components/Icon/Icon.d.ts +1 -1
  11. package/dist/components/InputNumber/InputNumber.d.ts +25 -0
  12. package/dist/components/List/List.d.ts +18 -0
  13. package/dist/components/Markdown/Markdown.d.ts +14 -0
  14. package/dist/components/Markdown/parser.d.ts +32 -0
  15. package/dist/components/Menu/Menu.d.ts +25 -0
  16. package/dist/components/MessageBubble/MessageBubble.d.ts +20 -0
  17. package/dist/components/PasswordInput/PasswordInput.d.ts +21 -0
  18. package/dist/components/Result/Result.d.ts +17 -0
  19. package/dist/components/TagsInput/TagsInput.d.ts +21 -0
  20. package/dist/components/Timeline/Timeline.d.ts +25 -0
  21. package/dist/components/index.d.ts +27 -0
  22. package/dist/components/index.js +7 -1
  23. package/dist/components/style.css +677 -1
  24. package/dist/db/postgres/connection.d.ts +24 -3
  25. package/dist/db/postgres/pool.d.ts +30 -8
  26. package/dist/db/redis/client.d.ts +43 -0
  27. package/dist/db/redis/connection.d.ts +12 -0
  28. package/dist/db/redis/pipeline.d.ts +26 -0
  29. package/dist/db/redis/pool.d.ts +27 -2
  30. package/dist/index.d.ts +1 -0
  31. package/dist/index.js +1055 -94
  32. package/dist/layout/weifuwu-layout.css +11 -1
  33. package/dist/postgres/types.d.ts +2 -1
  34. package/dist/redis/types.d.ts +6 -0
  35. package/dist/scheduler/cron.d.ts +26 -0
  36. package/dist/scheduler/index.d.ts +69 -0
  37. package/package.json +2 -4
@@ -0,0 +1,18 @@
1
+ /**
2
+ * weifuwu/components — List
3
+ *
4
+ * 通用列表:items + renderItem + header/footer/empty 占位。
5
+ * 定位:Table 大材小用的消息/文件/成员列表场景。
6
+ */
7
+ import type { Component } from '../../client/vnode.ts';
8
+ export interface ListProps<T = any> {
9
+ items: T[];
10
+ renderItem: (item: T, index: number) => any;
11
+ divided?: boolean;
12
+ header?: any;
13
+ footer?: any;
14
+ emptyText?: string;
15
+ emptyIcon?: any;
16
+ className?: string;
17
+ }
18
+ export declare const List: Component<ListProps>;
@@ -0,0 +1,14 @@
1
+ /**
2
+ * weifuwu/components — Markdown
3
+ *
4
+ * AI 回复/富文本渲染。安全子集解析 → VNode 渲染(天然转义,无 innerHTML 注入面)。
5
+ * 与 CodeBlock 组合渲染代码围栏。
6
+ */
7
+ import type { Component } from '../../client/vnode.ts';
8
+ import { type MdInline } from './parser.ts';
9
+ export interface MarkdownProps {
10
+ content: string;
11
+ className?: string;
12
+ }
13
+ export declare const Markdown: Component<MarkdownProps>;
14
+ export declare function renderInline(nodes: MdInline[]): any[];
@@ -0,0 +1,32 @@
1
+ /**
2
+ * weifuwu/components — Markdown 安全子集 parser
3
+ *
4
+ * 零依赖自研解析器,输出结构化 token(非 HTML 字符串)——
5
+ * 组件层以 VNode 渲染,天然转义任何用户/AI 内容(无 innerHTML 注入面)。
6
+ *
7
+ * 支持块级:标题(#~####) / 段落 / 列表(有序·无序) / 围栏代码块 / 引用 / 分割线
8
+ * 支持行内:**粗体** / *斜体* / `行内代码` / [文本](链接)
9
+ *
10
+ * 诚实裁剪:GFM 表格/任务列表/删除线/脚注/raw HTML/自动链接/语法高亮(见 roadmap)
11
+ */
12
+ export interface MdInline {
13
+ type: 'text' | 'code' | 'bold' | 'italic' | 'link';
14
+ text?: string;
15
+ href?: string;
16
+ children?: MdInline[];
17
+ }
18
+ export interface MdBlock {
19
+ type: 'heading' | 'paragraph' | 'list' | 'code' | 'quote' | 'hr';
20
+ level?: number;
21
+ inline?: MdInline[];
22
+ ordered?: boolean;
23
+ items?: MdInline[][];
24
+ lang?: string;
25
+ code?: string;
26
+ }
27
+ /** 链接安全:仅 http/https;javascript:/data:/vbscript: 一律拒绝 */
28
+ export declare function safeUrl(href: string): string | null;
29
+ /** 行内解析:code / bold / italic / link,其余为 text(有序优先防嵌套误判) */
30
+ export declare function parseInline(src: string): MdInline[];
31
+ /** 块级解析:逐行状态机 */
32
+ export declare function parseMarkdown(content: string): MdBlock[];
@@ -0,0 +1,25 @@
1
+ /**
2
+ * weifuwu/components — Menu
3
+ *
4
+ * 导航菜单(侧栏导航):分组项 + 图标 + 选中态 + 方向键导航 + Enter 激活。
5
+ * 用于 SaaS 应用侧边导航(替代手写 nav-item 循环)。
6
+ * 裁剪:不做子菜单展开/水平菜单栏(见 roadmap)。
7
+ */
8
+ import type { Component } from '../../client/vnode.ts';
9
+ export interface MenuItem {
10
+ key: string;
11
+ label: any;
12
+ icon?: any;
13
+ /** 分组标题(相邻同组项之间插分组头) */
14
+ group?: string;
15
+ active?: boolean;
16
+ danger?: boolean;
17
+ onClick?: () => void;
18
+ }
19
+ export interface MenuProps {
20
+ items: MenuItem[];
21
+ onSelect?: (key: string) => void;
22
+ activeKey?: string;
23
+ className?: string;
24
+ }
25
+ export declare const Menu: Component<MenuProps>;
@@ -0,0 +1,20 @@
1
+ /**
2
+ * weifuwu/components — MessageBubble
3
+ *
4
+ * 独立消息气泡(从 AiChat 气泡层抽取,业务聊天页复用)。
5
+ * 复用 layout 的 wf-bubble 原语:user → --own,assistant → --ai。
6
+ * content 支持文本或任意 VNode(可与 Markdown 组合)。
7
+ * 裁剪:不做打字指示动画(Loading 已有)。
8
+ */
9
+ import type { Component } from '../../client/vnode.ts';
10
+ export type MessageBubbleRole = 'user' | 'assistant';
11
+ export type MessageBubbleStatus = 'complete' | 'streaming' | 'error';
12
+ export interface MessageBubbleProps {
13
+ content: any;
14
+ role: MessageBubbleRole;
15
+ status?: MessageBubbleStatus;
16
+ /** 气泡尾部操作区(重试/复制按钮等,VNode 或数组) */
17
+ actions?: any;
18
+ className?: string;
19
+ }
20
+ export declare const MessageBubble: Component<MessageBubbleProps>;
@@ -0,0 +1,21 @@
1
+ /**
2
+ * weifuwu/components — PasswordInput
3
+ *
4
+ * 密码输入:眼睛按钮切换可见性。Input 子集(label/error/hint/required/autoComplete 透传)。
5
+ */
6
+ import type { Component } from '../../client/vnode.ts';
7
+ export interface PasswordInputProps {
8
+ value?: string;
9
+ onInput?: (e: Event) => void;
10
+ onChange?: (e: Event) => void;
11
+ label?: string;
12
+ name?: string;
13
+ placeholder?: string;
14
+ disabled?: boolean;
15
+ error?: string;
16
+ hint?: string;
17
+ required?: boolean;
18
+ autoComplete?: string;
19
+ className?: string;
20
+ }
21
+ export declare const PasswordInput: Component<PasswordInputProps>;
@@ -0,0 +1,17 @@
1
+ /**
2
+ * weifuwu/components — Result
3
+ *
4
+ * 结果页:status + title + desc + extra(操作按钮区)。
5
+ * 用于注册完成/操作成功/404/403 页。
6
+ * 裁剪:不做内置路由跳转(页面自身处理)。
7
+ */
8
+ import type { Component } from '../../client/vnode.ts';
9
+ export type ResultStatus = 'success' | 'error' | 'warning' | 'info';
10
+ export interface ResultProps {
11
+ status?: ResultStatus;
12
+ title: any;
13
+ desc?: any;
14
+ extra?: any;
15
+ className?: string;
16
+ }
17
+ export declare const Result: Component<ResultProps>;
@@ -0,0 +1,21 @@
1
+ /**
2
+ * weifuwu/components — TagsInput
3
+ *
4
+ * 标签输入:回车/逗号添加、Backspace 删除、去重、maxTags 限制。
5
+ * 中文输入法 composition 感知(输入法候选词确认的 Enter 不触发添加)。
6
+ * 裁剪:不做下拉建议(组合 Select searchable)。
7
+ */
8
+ import type { Component } from '../../client/vnode.ts';
9
+ export interface TagsInputProps {
10
+ value?: string[];
11
+ onChange?: (tags: string[]) => void;
12
+ placeholder?: string;
13
+ maxTags?: number;
14
+ allowDuplicates?: boolean;
15
+ disabled?: boolean;
16
+ label?: string;
17
+ error?: string;
18
+ hint?: string;
19
+ className?: string;
20
+ }
21
+ export declare const TagsInput: Component<TagsInputProps>;
@@ -0,0 +1,25 @@
1
+ /**
2
+ * weifuwu/components — Timeline
3
+ *
4
+ * 竖向时间线:节点(状态色圆点/自定义)+ 标题 + 时间 + 内容 + 连接线。
5
+ * 用于执行日志、审批历史、审计记录。
6
+ * 裁剪:不做横向时间线/折叠节点(见 roadmap)。
7
+ */
8
+ import type { Component } from '../../client/vnode.ts';
9
+ export type TimelineStatus = 'default' | 'info' | 'success' | 'warning' | 'error';
10
+ export interface TimelineItem {
11
+ key: string;
12
+ title: any;
13
+ time?: string;
14
+ content?: any;
15
+ status?: TimelineStatus;
16
+ /** 自定义节点内容(覆盖状态圆点) */
17
+ dot?: any;
18
+ onClick?: () => void;
19
+ }
20
+ export interface TimelineProps {
21
+ items: TimelineItem[];
22
+ mode?: 'left' | 'alternate';
23
+ reverse?: boolean;
24
+ }
25
+ export declare const Timeline: Component<TimelineProps>;
@@ -102,3 +102,30 @@ export { ApprovalCard } from './ApprovalCard/ApprovalCard.ts';
102
102
  export type { ApprovalCardProps, ApprovalStatus } from './ApprovalCard/ApprovalCard.ts';
103
103
  export { AiChat } from './AiChat/AiChat.ts';
104
104
  export type { AiChatProps, AiChatLabels } from './AiChat/AiChat.ts';
105
+ export { Markdown } from './Markdown/Markdown.ts';
106
+ export type { MarkdownProps } from './Markdown/Markdown.ts';
107
+ export { parseMarkdown, parseInline } from './Markdown/parser.ts';
108
+ export { CodeBlock } from './CodeBlock/CodeBlock.ts';
109
+ export type { CodeBlockProps } from './CodeBlock/CodeBlock.ts';
110
+ export { Timeline } from './Timeline/Timeline.ts';
111
+ export type { TimelineProps, TimelineItem, TimelineStatus } from './Timeline/Timeline.ts';
112
+ export { InputNumber } from './InputNumber/InputNumber.ts';
113
+ export type { InputNumberProps } from './InputNumber/InputNumber.ts';
114
+ export { Descriptions } from './Descriptions/Descriptions.ts';
115
+ export type { DescriptionsProps, DescriptionItem } from './Descriptions/Descriptions.ts';
116
+ export { AvatarGroup } from './AvatarGroup/AvatarGroup.ts';
117
+ export type { AvatarGroupProps, AvatarGroupItem } from './AvatarGroup/AvatarGroup.ts';
118
+ export { MessageBubble } from './MessageBubble/MessageBubble.ts';
119
+ export type { MessageBubbleProps, MessageBubbleRole, MessageBubbleStatus } from './MessageBubble/MessageBubble.ts';
120
+ export { Menu } from './Menu/Menu.ts';
121
+ export type { MenuProps, MenuItem } from './Menu/Menu.ts';
122
+ export { PasswordInput } from './PasswordInput/PasswordInput.ts';
123
+ export type { PasswordInputProps } from './PasswordInput/PasswordInput.ts';
124
+ export { TagsInput } from './TagsInput/TagsInput.ts';
125
+ export type { TagsInputProps } from './TagsInput/TagsInput.ts';
126
+ export { Highlight } from './Highlight/Highlight.ts';
127
+ export type { HighlightProps } from './Highlight/Highlight.ts';
128
+ export { List } from './List/List.ts';
129
+ export type { ListProps } from './List/List.ts';
130
+ export { Result } from './Result/Result.ts';
131
+ export type { ResultProps, ResultStatus } from './Result/Result.ts';