one-design-next 0.0.42 → 0.0.43
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
CHANGED
|
@@ -10,13 +10,15 @@ export interface ArtifactProps {
|
|
|
10
10
|
thumbnailUrl?: string;
|
|
11
11
|
/** 右上角品牌 LOGO(16x16),不传时展示兜底占位块。 */
|
|
12
12
|
brandLogoUrl?: string;
|
|
13
|
+
/** 宽度模式:默认响应式;支持固定 354,或最小 354 且宽度自适应填充。 */
|
|
14
|
+
widthMode?: 'responsive' | 'fixed-354' | 'fill-min-354';
|
|
13
15
|
onOpen?: () => void;
|
|
14
16
|
}
|
|
15
17
|
/**
|
|
16
18
|
* 对话流内的单个产物摘要卡片。
|
|
17
19
|
* 本期聚焦单项展示,保留 `type` 字段以支持未来“报告 / 人群”等产物类型扩展。
|
|
18
20
|
*/
|
|
19
|
-
export declare function Artifact({ title, statRange, createdAt, status, thumbnailUrl, brandLogoUrl, onOpen, }: ArtifactProps): import("react").JSX.Element;
|
|
21
|
+
export declare function Artifact({ title, statRange, createdAt, status, thumbnailUrl, brandLogoUrl, widthMode, onOpen, }: ArtifactProps): import("react").JSX.Element;
|
|
20
22
|
export declare namespace Artifact {
|
|
21
23
|
var displayName: string;
|
|
22
24
|
}
|
package/dist/artifact/index.js
CHANGED
|
@@ -53,6 +53,8 @@ export function Artifact(_ref) {
|
|
|
53
53
|
status = _ref$status === void 0 ? 'Done' : _ref$status,
|
|
54
54
|
thumbnailUrl = _ref.thumbnailUrl,
|
|
55
55
|
brandLogoUrl = _ref.brandLogoUrl,
|
|
56
|
+
_ref$widthMode = _ref.widthMode,
|
|
57
|
+
widthMode = _ref$widthMode === void 0 ? 'responsive' : _ref$widthMode,
|
|
56
58
|
onOpen = _ref.onOpen;
|
|
57
59
|
var isGenerating = status === 'Generating';
|
|
58
60
|
var isInteractive = !!onOpen && !isGenerating;
|
|
@@ -191,14 +193,16 @@ export function Artifact(_ref) {
|
|
|
191
193
|
onMouseMove: handleMouseMove,
|
|
192
194
|
onMouseLeave: handleMouseLeave,
|
|
193
195
|
style: spotlightStyle,
|
|
194
|
-
"data-odn-artifact-status": status
|
|
196
|
+
"data-odn-artifact-status": status,
|
|
197
|
+
"data-odn-artifact-width-mode": widthMode
|
|
195
198
|
}, content) : /*#__PURE__*/React.createElement("div", {
|
|
196
199
|
"data-odn-artifact": true,
|
|
197
200
|
onMouseEnter: !isGenerating ? handleMouseEnter : undefined,
|
|
198
201
|
onMouseMove: !isGenerating ? handleMouseMove : undefined,
|
|
199
202
|
onMouseLeave: !isGenerating ? handleMouseLeave : undefined,
|
|
200
203
|
style: spotlightStyle,
|
|
201
|
-
"data-odn-artifact-status": status
|
|
204
|
+
"data-odn-artifact-status": status,
|
|
205
|
+
"data-odn-artifact-width-mode": widthMode
|
|
202
206
|
}, content);
|
|
203
207
|
}
|
|
204
208
|
Artifact.displayName = 'Artifact';
|
|
@@ -16,7 +16,7 @@ html {
|
|
|
16
16
|
width: min(100%, 376px);
|
|
17
17
|
height: var(--odn-artifact-copy-height);
|
|
18
18
|
display: grid;
|
|
19
|
-
grid-template-columns:
|
|
19
|
+
grid-template-columns: minmax(0, 1fr) var(--odn-artifact-visual-width);
|
|
20
20
|
align-items: stretch;
|
|
21
21
|
gap: 0;
|
|
22
22
|
text-align: left;
|
|
@@ -30,6 +30,17 @@ html {
|
|
|
30
30
|
transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
+
[data-odn-artifact][data-odn-artifact-width-mode=fixed-354] {
|
|
34
|
+
width: 354px;
|
|
35
|
+
max-width: 354px;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
[data-odn-artifact][data-odn-artifact-width-mode=fill-min-354] {
|
|
39
|
+
width: 100%;
|
|
40
|
+
min-width: 354px;
|
|
41
|
+
max-width: none;
|
|
42
|
+
}
|
|
43
|
+
|
|
33
44
|
button[data-odn-artifact] {
|
|
34
45
|
cursor: pointer;
|
|
35
46
|
font: inherit;
|
|
@@ -44,7 +55,7 @@ button[data-odn-artifact] {
|
|
|
44
55
|
[data-odn-artifact-copy] {
|
|
45
56
|
position: relative;
|
|
46
57
|
z-index: 1;
|
|
47
|
-
width:
|
|
58
|
+
width: 100%;
|
|
48
59
|
height: var(--odn-artifact-copy-height);
|
|
49
60
|
padding: var(--odn-artifact-padding-y) var(--odn-artifact-padding-right) var(--odn-artifact-padding-y) var(--odn-artifact-padding-left);
|
|
50
61
|
box-sizing: border-box;
|