one-design-next 0.0.68 → 0.0.70
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/artifact/index.d.ts +4 -2
- package/dist/artifact/index.js +5 -3
- package/dist/composer/index.d.ts +24 -35
- package/dist/composer/index.js +212 -106
- package/dist/composer/style/index.css +57 -5
- package/dist/drawer/index.d.ts +5 -0
- package/dist/drawer/index.js +3 -0
- package/dist/icon/svg-data.d.ts +20 -0
- package/dist/icon/svg-data.js +1 -1
- package/dist/icon/types.d.ts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/modal-base/index.d.ts +7 -0
- package/dist/modal-base/index.js +12 -2
- package/dist/pop-base/index.d.ts +8 -0
- package/dist/pop-base/index.js +8 -1
- package/dist/pop-base/style/index.css +8 -0
- package/dist/preview-panel/index.d.ts +11 -5
- package/dist/preview-panel/index.js +15 -9
- package/dist/preview-panel/style/index.css +3 -1
- package/dist/skill-slot/index.d.ts +20 -7
- package/dist/skill-slot/index.js +191 -105
- package/dist/skill-slot/style/index.css +71 -20
- package/dist/tooltip/index.js +30 -13
- package/package.json +1 -1
package/dist/artifact/index.d.ts
CHANGED
|
@@ -6,19 +6,21 @@ export interface ArtifactProps {
|
|
|
6
6
|
createdAt?: string;
|
|
7
7
|
/** 预留字段:当前卡片不展示。 */
|
|
8
8
|
type?: string;
|
|
9
|
-
status?: 'Generating' | 'Done' | (string &
|
|
9
|
+
status?: 'Generating' | 'Done' | (string & NonNullable<unknown>);
|
|
10
10
|
thumbnailUrl?: string;
|
|
11
11
|
/** 右上角品牌 LOGO(16x16),不传时展示兜底占位块。 */
|
|
12
12
|
brandLogoUrl?: string;
|
|
13
13
|
/** 宽度模式:默认响应式;支持固定 354,或最小 354 且宽度自适应填充。 */
|
|
14
14
|
widthMode?: 'responsive' | 'fixed-354' | 'fill-min-354';
|
|
15
|
+
/** Done 状态下第三行文案,默认"查看详情"。 */
|
|
16
|
+
openText?: string;
|
|
15
17
|
onOpen?: () => void;
|
|
16
18
|
}
|
|
17
19
|
/**
|
|
18
20
|
* 对话流内的单个产物摘要卡片。
|
|
19
21
|
* 本期聚焦单项展示,保留 `type` 字段以支持未来“报告 / 人群”等产物类型扩展。
|
|
20
22
|
*/
|
|
21
|
-
export declare function Artifact({ title, statRange, createdAt, status, thumbnailUrl, brandLogoUrl, widthMode, onOpen, }: ArtifactProps): import("react").JSX.Element;
|
|
23
|
+
export declare function Artifact({ title, statRange, createdAt, status, thumbnailUrl, brandLogoUrl, widthMode, openText, onOpen, }: ArtifactProps): import("react").JSX.Element;
|
|
22
24
|
export declare namespace Artifact {
|
|
23
25
|
var displayName: string;
|
|
24
26
|
}
|
package/dist/artifact/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
2
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
3
|
-
import { useState } from 'react';
|
|
4
3
|
import { motion } from 'motion/react';
|
|
4
|
+
import { useState } from 'react';
|
|
5
5
|
import Icon from "../icon";
|
|
6
6
|
import "./style";
|
|
7
7
|
var PEN_VARIANTS = {
|
|
@@ -45,6 +45,8 @@ export function Artifact(_ref) {
|
|
|
45
45
|
brandLogoUrl = _ref.brandLogoUrl,
|
|
46
46
|
_ref$widthMode = _ref.widthMode,
|
|
47
47
|
widthMode = _ref$widthMode === void 0 ? 'responsive' : _ref$widthMode,
|
|
48
|
+
_ref$openText = _ref.openText,
|
|
49
|
+
openText = _ref$openText === void 0 ? '查看详情' : _ref$openText,
|
|
48
50
|
onOpen = _ref.onOpen;
|
|
49
51
|
var isGenerating = status === 'Generating';
|
|
50
52
|
var isInteractive = !!onOpen && !isGenerating;
|
|
@@ -85,9 +87,9 @@ export function Artifact(_ref) {
|
|
|
85
87
|
'--odn-artifact-spot-opacity': spotlight.active && !isGenerating ? 1 : 0
|
|
86
88
|
};
|
|
87
89
|
var createdAtText = createdAt !== null && createdAt !== void 0 ? createdAt : formatCreatedAtToMinute(new Date());
|
|
88
|
-
var secondLineText = createdAtText;
|
|
90
|
+
var secondLineText = isGenerating ? createdAtText : statRange;
|
|
89
91
|
var isDone = status === 'Done';
|
|
90
|
-
var thirdLineText = status === 'Generating' ? '生成中' : isDone ?
|
|
92
|
+
var thirdLineText = status === 'Generating' ? '生成中' : isDone ? openText : createdAt !== null && createdAt !== void 0 ? createdAt : '创建时间:--';
|
|
91
93
|
var content = /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
92
94
|
"data-odn-artifact-spotlight": true,
|
|
93
95
|
"aria-hidden": true
|
package/dist/composer/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
import type { Attachment, ChipData, ComposerSegment, SendMeta, SkillItem } from '../_genui-types';
|
|
2
3
|
import type { IconName } from '../icon';
|
|
3
|
-
import
|
|
4
|
-
import type { ChipData } from '../_genui-types';
|
|
4
|
+
import { type SkillSlotProps } from '../skill-slot';
|
|
5
5
|
import type { ComposerParamPanelContext } from './param-panel';
|
|
6
6
|
import './style';
|
|
7
7
|
export type { ComposerParamPanelContext } from './param-panel';
|
|
@@ -12,16 +12,26 @@ export type SubmitType = 'enter' | 'shiftEnter';
|
|
|
12
12
|
* 工具按钮的自定义配置。
|
|
13
13
|
* - `icon`:图标名称(Icon 组件的 name),字段不传则不渲染图标。
|
|
14
14
|
* - `label`:按钮文字,字段不传则不渲染文字。
|
|
15
|
+
* - `tooltip`:入口 hover 说明;字段不传继承默认;传 `false` 关闭。
|
|
15
16
|
* - 整个配置对象不传(key 不存在于 `toolConfigs`)时使用内置默认值。
|
|
16
|
-
* -
|
|
17
|
+
* - 仅传 `tooltip`(不传 icon / label)时:保留默认图标与文案,只覆盖说明。
|
|
18
|
+
* - 传了配置对象且 icon / label 均未设置、也未传 tooltip 时(`{}`),兜底显示工具英文名
|
|
17
19
|
* (如 "attachment" / "webSearch" / "skill")作为 label,无图标,
|
|
18
20
|
* 方便开发者一眼看出配置遗漏。
|
|
19
21
|
*/
|
|
20
22
|
export interface ComposerToolConfig {
|
|
21
23
|
/** 图标名称,类型与 Icon 组件的 name 一致 */
|
|
22
|
-
icon?: IconName | (string &
|
|
24
|
+
icon?: IconName | (string & Record<never, never>);
|
|
23
25
|
label?: string;
|
|
26
|
+
/** 工具入口 hover 时展示的功能说明;传 `false` 可关闭 */
|
|
27
|
+
tooltip?: React.ReactNode;
|
|
24
28
|
}
|
|
29
|
+
/**
|
|
30
|
+
* Composer 向内嵌 SkillSlot 透传的配置袋。
|
|
31
|
+
* 技能目录(skills / skillGroups)应由「技能管理」模块维护后注入此处;
|
|
32
|
+
* Composer 只负责触发入口与选中后插入 chip,不是目录 SSOT。
|
|
33
|
+
*/
|
|
34
|
+
export type ComposerSkillSlotProps = Pick<SkillSlotProps, 'skills' | 'skillGroups' | 'showGroupTitles' | 'menuMaxHeight' | 'menuWidth' | 'onManageSkills' | 'skillManageFooter'>;
|
|
25
35
|
export interface ComposerRef {
|
|
26
36
|
/** 聚焦输入框 */
|
|
27
37
|
focus: (options?: FocusOptions) => void;
|
|
@@ -101,7 +111,7 @@ export interface ComposerProps {
|
|
|
101
111
|
* 形态变体:
|
|
102
112
|
* - `full`(默认):textarea 独占一行,工具栏常驻下方。
|
|
103
113
|
* - `lite`:单行紧凑布局,textarea 夹在左侧工具按钮和右侧发送按钮之间;
|
|
104
|
-
* 当内容撑出多行时自动升格为 `full`
|
|
114
|
+
* 当内容撑出多行时自动升格为 `full` 布局,内容回到单行时自动降格。
|
|
105
115
|
*/
|
|
106
116
|
variant?: ComposerVariant;
|
|
107
117
|
/**
|
|
@@ -118,7 +128,7 @@ export interface ComposerProps {
|
|
|
118
128
|
*/
|
|
119
129
|
toolsLabeled?: boolean;
|
|
120
130
|
/**
|
|
121
|
-
* 各工具按钮的自定义配置(icon / label)。按 `ComposerTool` 类型做 key:
|
|
131
|
+
* 各工具按钮的自定义配置(icon / label / tooltip)。按 `ComposerTool` 类型做 key:
|
|
122
132
|
* - `attachment`:附件按钮
|
|
123
133
|
* - `webSearch`:联网按钮
|
|
124
134
|
* - `skill`:技能按钮
|
|
@@ -127,46 +137,25 @@ export interface ComposerProps {
|
|
|
127
137
|
* - key 不存在于 `toolConfigs` → 使用内置默认值(如附件 = paperclip + '附件')
|
|
128
138
|
* - key 存在但配置对象中只有 `icon` → 只渲染图标
|
|
129
139
|
* - key 存在但配置对象中只有 `label` → 只渲染文字
|
|
140
|
+
* - key 存在但只传 `tooltip` → 保留默认 icon / label,只覆盖 hover 说明
|
|
130
141
|
* - key 存在但配置对象为空 `{}` → 兜底显示工具英文名(如 "attachment")作为 label,无图标
|
|
142
|
+
* - `tooltip` 传 `false` 可关闭该入口的 tooltip
|
|
131
143
|
*
|
|
132
144
|
* @example
|
|
133
145
|
* ```tsx
|
|
134
146
|
* toolConfigs={{
|
|
135
|
-
* attachment: {
|
|
136
|
-
* webSearch: { label: '搜索' },
|
|
137
|
-
* skill: { icon: 'command' },
|
|
147
|
+
* attachment: { tooltip: '上传材料,补充上下文' }, // 只改说明
|
|
148
|
+
* webSearch: { label: '搜索' }, // 仅文字
|
|
149
|
+
* skill: { icon: 'command' }, // 仅图标
|
|
138
150
|
* }}
|
|
139
151
|
* ```
|
|
140
152
|
*/
|
|
141
153
|
toolConfigs?: Partial<Record<ComposerTool, ComposerToolConfig>>;
|
|
142
|
-
/** 技能列表;当 tools 包含 'skill' 时生效 */
|
|
143
|
-
skills?: SkillItem[];
|
|
144
|
-
/**
|
|
145
|
-
* 分组技能列表(优先级高于 `skills`)。
|
|
146
|
-
* menu 变体下按分组名分隔展示,组间带标题。
|
|
147
|
-
*/
|
|
148
|
-
skillGroups?: SkillGroup[];
|
|
149
|
-
/**
|
|
150
|
-
* 技能管理回调。提供后会在 skill 弹窗底部渲染按钮。
|
|
151
|
-
*/
|
|
152
|
-
onManageSkills?: () => void;
|
|
153
|
-
/**
|
|
154
|
-
* 技能管理按钮的自定义内容(ReactNode)。
|
|
155
|
-
* 仅在 `onManageSkills` 提供时生效。
|
|
156
|
-
* 不传时默认渲染「技能管理」文字 + 右箭头图标。
|
|
157
|
-
*/
|
|
158
|
-
skillManageFooter?: React.ReactNode;
|
|
159
|
-
/**
|
|
160
|
-
* skill 弹窗列表的最大高度(px)。超出此高度后出现滚动条。
|
|
161
|
-
* 不传则不限高(适合 skill 较少的场景)。
|
|
162
|
-
* @default undefined(不限高)
|
|
163
|
-
*/
|
|
164
|
-
skillMenuMaxHeight?: number;
|
|
165
154
|
/**
|
|
166
|
-
*
|
|
167
|
-
*
|
|
155
|
+
* 向内嵌 SkillSlot 透传的配置袋。
|
|
156
|
+
* 技能目录由业务 / 技能管理模块维护后注入;Composer 只负责触发入口与插入 chip。
|
|
168
157
|
*/
|
|
169
|
-
|
|
158
|
+
skillSlotProps?: ComposerSkillSlotProps;
|
|
170
159
|
/**
|
|
171
160
|
* 提交模式:
|
|
172
161
|
* - `'enter'`(默认):Enter 发送,Shift+Enter 换行
|