dsh-image-lite 0.2.0 → 0.2.1
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/assets/icon.svg +19 -0
- package/client.js +73 -21
- package/locale/en.json +6 -0
- package/locale/zh.json +6 -0
- package/package.json +6 -2
package/assets/icon.svg
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<svg width="36" height="36" viewBox="0 0 36 36" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<!-- Subject: one framed picture with a landscape inside — the studio's own
|
|
3
|
+
output at its simplest. Drafted to references/artwork.md: 36x36 canvas,
|
|
4
|
+
no tile or background (Plugin Manager draws the tile), ink box 22x17
|
|
5
|
+
centred on (18,18), flat two-stop gradient borrowed from the installed
|
|
6
|
+
icons it sits beside (#69B9FF -> #324DE2), no text, no effects. -->
|
|
7
|
+
<rect x="7" y="9.5" width="22" height="17" rx="3.2" stroke="url(#igl-frame)" stroke-width="2.2"/>
|
|
8
|
+
<path d="M9.6 23.4l4.5-4.4a2.1 2.1 0 0 1 2.9 0l2.1 2.1" stroke="url(#igl-frame)" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
9
|
+
<circle cx="13.4" cy="15.3" r="1.85" fill="url(#igl-frame)"/>
|
|
10
|
+
<defs>
|
|
11
|
+
<linearGradient id="igl-frame" x1="18" y1="9.5" x2="18" y2="26.5" gradientUnits="userSpaceOnUse">
|
|
12
|
+
<stop stop-color="#69B9FF"/>
|
|
13
|
+
<stop offset="1" stop-color="#324DE2"/>
|
|
14
|
+
</linearGradient>
|
|
15
|
+
</defs>
|
|
16
|
+
</svg>
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
package/client.js
CHANGED
|
@@ -28,14 +28,71 @@ window.__ModuleLoader__.load({
|
|
|
28
28
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' })
|
|
29
29
|
|
|
30
30
|
const React = require('react')
|
|
31
|
-
//
|
|
32
|
-
//
|
|
33
|
-
//
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
31
|
+
// Glyphs are drawn here instead of imported. `@deepseek-ai/dsh-client-ui-primitives`
|
|
32
|
+
// exports no generic icon set (only its own `GuideArtwork*` illustrations), and a
|
|
33
|
+
// third-party client's module table need not resolve it at all — so every glyph
|
|
34
|
+
// used to fall through to a text label. Local SVGs render on any release, keep the
|
|
35
|
+
// product's stroke weight, and inherit `currentColor` from the button around them.
|
|
36
|
+
const glyph = (props, ...children) => React.createElement('svg', {
|
|
37
|
+
width: props.size ?? 16,
|
|
38
|
+
height: props.size ?? 16,
|
|
39
|
+
viewBox: '0 0 16 16',
|
|
40
|
+
fill: 'none',
|
|
41
|
+
stroke: 'currentColor',
|
|
42
|
+
strokeWidth: 1.4,
|
|
43
|
+
strokeLinecap: 'round',
|
|
44
|
+
strokeLinejoin: 'round',
|
|
45
|
+
className: props.className,
|
|
46
|
+
'aria-hidden': 'true',
|
|
47
|
+
focusable: 'false',
|
|
48
|
+
}, ...children)
|
|
49
|
+
const glyphPath = (d, extra) => React.createElement('path', { d, ...extra })
|
|
50
|
+
|
|
51
|
+
function IconClose(props) {
|
|
52
|
+
return glyph(props, glyphPath('M4.6 4.6l6.8 6.8'), glyphPath('M11.4 4.6l-6.8 6.8'))
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
function IconTrash(props) {
|
|
56
|
+
return glyph(props,
|
|
57
|
+
glyphPath('M3 4.4h10'),
|
|
58
|
+
glyphPath('M6.4 4.4V3.1h3.2v1.3'),
|
|
59
|
+
glyphPath('M4.7 4.4l.6 8.1a.9.9 0 0 0 .9.8h3.6a.9.9 0 0 0 .9-.8l.6-8.1'),
|
|
60
|
+
glyphPath('M6.8 6.8v4.2'),
|
|
61
|
+
glyphPath('M9.2 6.8v4.2'))
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
function IconPlus(props) {
|
|
65
|
+
return glyph(props, glyphPath('M8 3.6v8.8'), glyphPath('M3.6 8h8.8'))
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
function IconSparkle(props) {
|
|
69
|
+
return glyph(props, glyphPath('M8 2.6c.55 2.5 1.9 3.85 4.4 4.4-2.5.55-3.85 1.9-4.4 4.4-.55-2.5-1.9-3.85-4.4-4.4 2.5-.55 3.85-1.9 4.4-4.4Z'))
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
// The 开始 guide capsule draws a fixed-palette 36px illustration (the same
|
|
73
|
+
// contract the shipped `GuideArtwork*` components follow): one framed
|
|
74
|
+
// picture, the studio's own output at its simplest, so the card stops
|
|
75
|
+
// showing the guide's cube placeholder. Flat #539CFA keeps it legible on the
|
|
76
|
+
// guide's dark card; the plugin row's icon in `assets/icon.svg` carries the
|
|
77
|
+
// same drawing as a gradient, where it sits beside other gradient icons.
|
|
78
|
+
function StudioArtwork({ size = 36, className } = {}) {
|
|
79
|
+
return React.createElement('svg', {
|
|
80
|
+
width: size,
|
|
81
|
+
height: size,
|
|
82
|
+
className,
|
|
83
|
+
viewBox: '0 0 36 36',
|
|
84
|
+
fill: 'none',
|
|
85
|
+
xmlns: 'http://www.w3.org/2000/svg',
|
|
86
|
+
'aria-hidden': 'true',
|
|
87
|
+
focusable: 'false',
|
|
88
|
+
},
|
|
89
|
+
React.createElement('rect', { x: 7, y: 9.5, width: 22, height: 17, rx: 3.2, stroke: '#539CFA', strokeWidth: 2.2 }),
|
|
90
|
+
React.createElement('path', {
|
|
91
|
+
d: 'M9.6 23.4l4.5-4.4a2.1 2.1 0 0 1 2.9 0l2.1 2.1',
|
|
92
|
+
stroke: '#539CFA', strokeWidth: 2.2, strokeLinecap: 'round', strokeLinejoin: 'round',
|
|
93
|
+
}),
|
|
94
|
+
React.createElement('circle', { cx: 13.4, cy: 15.3, r: 1.85, fill: '#539CFA' }),
|
|
95
|
+
)
|
|
39
96
|
}
|
|
40
97
|
// A `position: fixed` overlay is still clipped when an ancestor creates a
|
|
41
98
|
// containing block (`transform` / `filter` / `contain`) — the right sidebar
|
|
@@ -48,12 +105,6 @@ window.__ModuleLoader__.load({
|
|
|
48
105
|
} catch {
|
|
49
106
|
portalFactory = null
|
|
50
107
|
}
|
|
51
|
-
const pickIcon = (...names) => names.map((n) => primitives[n]).find((v) => typeof v === 'function')
|
|
52
|
-
const IconClose = pickIcon('IconCloseOutline16', 'IconCloseOutlineRegular', 'IconCloseOutlineMedium')
|
|
53
|
-
const IconTrash = pickIcon('IconTrashOutline16', 'IconTrashOutlineRegular', 'IconTrashOutlineMedium')
|
|
54
|
-
const IconPlus = pickIcon('IconPlusOutline16', 'IconPlusOutlineRegular', 'IconPlusOutlineMedium')
|
|
55
|
-
const IconSparkle = pickIcon('IconSparkle16', 'IconSparkleRegular', 'IconSparkleMedium')
|
|
56
|
-
|
|
57
108
|
const ENTRY_NS = 'image-gen-lite'
|
|
58
109
|
const LOCALE_NS = 'image-gen-lite'
|
|
59
110
|
const RPC_CHANNEL = '/image-gen-lite'
|
|
@@ -722,7 +773,7 @@ window.__ModuleLoader__.load({
|
|
|
722
773
|
display: 'inline-flex', alignItems: 'center', justifyContent: 'center',
|
|
723
774
|
},
|
|
724
775
|
onClick: onClose,
|
|
725
|
-
},
|
|
776
|
+
}, React.createElement(IconClose, { size: 16 })),
|
|
726
777
|
)
|
|
727
778
|
|
|
728
779
|
// No portal runtime (older bundle): still better than a clipped overlay.
|
|
@@ -786,7 +837,7 @@ window.__ModuleLoader__.load({
|
|
|
786
837
|
const text = textParts.join('\n')
|
|
787
838
|
return React.createElement('div', { style: { display: 'flex', flexDirection: 'column', gap: 6, padding: '4px 0' } },
|
|
788
839
|
React.createElement('div', { style: { display: 'flex', alignItems: 'center', gap: 6 } },
|
|
789
|
-
|
|
840
|
+
React.createElement(IconSparkle, { size: 14 }),
|
|
790
841
|
React.createElement('span', {
|
|
791
842
|
style: { fontSize: 13, lineHeight: '20px', overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' },
|
|
792
843
|
}, `${TOOL_NAME}: ${derivePrompt(argsRaw)}`)),
|
|
@@ -976,7 +1027,7 @@ window.__ModuleLoader__.load({
|
|
|
976
1027
|
? React.createElement('button', {
|
|
977
1028
|
type: 'button', className: 'dsh-igl-btn',
|
|
978
1029
|
onClick: () => setEditing(draftFromProvider(null, providers)),
|
|
979
|
-
},
|
|
1030
|
+
}, React.createElement(IconPlus, { size: 12 }), t('addProvider'))
|
|
980
1031
|
: null,
|
|
981
1032
|
),
|
|
982
1033
|
editing !== null
|
|
@@ -1284,7 +1335,7 @@ window.__ModuleLoader__.load({
|
|
|
1284
1335
|
React.createElement('div', { style: { display: 'flex', gap: 6, flex: 'none' } },
|
|
1285
1336
|
React.createElement('button', { type: 'button', className: 'dsh-igl-btn', onClick: onEdit }, t('editProvider')),
|
|
1286
1337
|
React.createElement('button', { type: 'button', className: 'dsh-igl-btn', onClick: onDelete, 'aria-label': t('deleteProvider') },
|
|
1287
|
-
|
|
1338
|
+
React.createElement(IconTrash, { size: 12 })),
|
|
1288
1339
|
),
|
|
1289
1340
|
)
|
|
1290
1341
|
}
|
|
@@ -1653,7 +1704,7 @@ window.__ModuleLoader__.load({
|
|
|
1653
1704
|
},
|
|
1654
1705
|
'aria-label': t('removeRef'),
|
|
1655
1706
|
onClick: () => removeRef(ref),
|
|
1656
|
-
},
|
|
1707
|
+
}, React.createElement(IconTrash, { size: 12 })),
|
|
1657
1708
|
))),
|
|
1658
1709
|
),
|
|
1659
1710
|
React.createElement('div', { style: css.row },
|
|
@@ -1713,7 +1764,7 @@ window.__ModuleLoader__.load({
|
|
|
1713
1764
|
function StudioTitle(props) {
|
|
1714
1765
|
const t = props.t ?? translateFactory(en)
|
|
1715
1766
|
return React.createElement(React.Fragment, null,
|
|
1716
|
-
|
|
1767
|
+
React.createElement(IconSparkle, { size: 16 }),
|
|
1717
1768
|
React.createElement('span', { style: { fontSize: 13, lineHeight: '20px' } }, t('title')),
|
|
1718
1769
|
)
|
|
1719
1770
|
}
|
|
@@ -1726,7 +1777,7 @@ window.__ModuleLoader__.load({
|
|
|
1726
1777
|
title: t('cornerTooltip'),
|
|
1727
1778
|
'aria-label': t('cornerTooltip'),
|
|
1728
1779
|
onClick: props.openStudio,
|
|
1729
|
-
},
|
|
1780
|
+
}, React.createElement(IconSparkle, { size: 16 }))
|
|
1730
1781
|
}
|
|
1731
1782
|
|
|
1732
1783
|
// ---------------------------------------------------------------- configForms
|
|
@@ -1815,6 +1866,7 @@ window.__ModuleLoader__.load({
|
|
|
1815
1866
|
order: 30,
|
|
1816
1867
|
title: () => t('guideTitle'),
|
|
1817
1868
|
description: () => t('guideDescription'),
|
|
1869
|
+
icon: StudioArtwork,
|
|
1818
1870
|
}],
|
|
1819
1871
|
keepMounted: true,
|
|
1820
1872
|
}))
|
package/locale/en.json
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
{
|
|
2
|
+
"meta": {
|
|
3
|
+
"title": "Image studio lite",
|
|
4
|
+
"description": "Generate images from the conversation with the image_generate_lite tool, or work in the 生图工作台 sidebar tab. The model library, default model and default image spec live in this plugin's own settings card."
|
|
5
|
+
}
|
|
6
|
+
}
|
package/locale/zh.json
ADDED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-image-lite",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "DSH 生图插件支持双模式生图:直接对话大模型,通过 image_generate_lite 工具生图;或在侧边栏「生图工作台」处理生图任务。",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"deepseek",
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
],
|
|
14
14
|
"type": "module",
|
|
15
15
|
"main": "index.js",
|
|
16
|
+
"icon": "./assets/icon.svg",
|
|
16
17
|
"scripts": {
|
|
17
18
|
"test": "node --test test/*.test.js"
|
|
18
19
|
},
|
|
@@ -20,6 +21,8 @@
|
|
|
20
21
|
".": "./index.js",
|
|
21
22
|
"./client": "./client.js",
|
|
22
23
|
"./wire": "./wire.js",
|
|
24
|
+
"./icon": "./assets/icon.svg",
|
|
25
|
+
"./locale/*.json": "./locale/*.json",
|
|
23
26
|
"./package.json": "./package.json"
|
|
24
27
|
},
|
|
25
28
|
"files": [
|
|
@@ -30,6 +33,8 @@
|
|
|
30
33
|
"README.md",
|
|
31
34
|
"docs/how-it-works.svg",
|
|
32
35
|
"docs/how-it-works.en.svg",
|
|
36
|
+
"assets/icon.svg",
|
|
37
|
+
"locale/*.json",
|
|
33
38
|
"LICENSE"
|
|
34
39
|
],
|
|
35
40
|
"repository": {
|
|
@@ -53,7 +58,6 @@
|
|
|
53
58
|
"platform": "web",
|
|
54
59
|
"inject": [
|
|
55
60
|
"@deepseek-ai/dsh-client-ui-renderer",
|
|
56
|
-
"@deepseek-ai/dsh-client-ui-primitives",
|
|
57
61
|
"@deepseek-ai/dsh-client-locale"
|
|
58
62
|
]
|
|
59
63
|
}
|