dsh-gpt-image-playground 0.2.3 → 0.2.5

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.
@@ -20,9 +20,15 @@ Changes made to the redistributed build:
20
20
  2. Two oversized UI fonts (`HarmonyOS_Sans_SC_Regular`, `HarmonyOS_Sans_SC_Medium`,
21
21
  ~15.7 MB total) are removed to keep the package small. The app makes no font
22
22
  requests in its default configuration and falls back to the system font.
23
- 3. Three header controls ("安装为应用", "下载客户端", "操作指南") are hidden at
23
+ 3. Interface elements that only apply to the standalone site are hidden at
24
24
  runtime by CSS injected into the frame by `lib/client.js`. The shipped
25
- JavaScript is untouched.
25
+ JavaScript is untouched:
26
+ - header controls "安装为应用", "下载客户端", "操作指南"
27
+ - the red "NEW" update badge next to the title (and the update dialog it opens)
28
+ - the product title's link to the upstream repository (the label stays, the
29
+ anchor loses `href`/`target`/`rel`)
30
+ - the settings "关于" tab
31
+ - the settings header's upstream version, replaced with this plugin's version
26
32
 
27
33
  No other files of the build were edited.
28
34
 
package/lib/client.js CHANGED
@@ -34,6 +34,11 @@ window.__ModuleLoader__.load({
34
34
  * download) and "操作指南" (upstream guide). Hidden inside the frame by
35
35
  * `aria-label`, so upstream markup changes cannot break the rest of the UI.
36
36
  *
37
+ * The red "NEW" badge next to the title announces an upstream release and
38
+ * opens an "update available" dialog — pointless here, since updating means
39
+ * replacing the vendored build. It has no aria-label, so it is matched by
40
+ * its title prefix and, as a fallback, by the badge's red background.
41
+ *
37
42
  * The settings "关于" tab is marked by `decorateFrame` (its label is text,
38
43
  * which CSS cannot match) and hidden through the `data-dsh-gipg-about` rule.
39
44
  */
@@ -42,14 +47,13 @@ window.__ModuleLoader__.load({
42
47
  'a[aria-label="下载客户端"]',
43
48
  'button[aria-label="操作指南"]',
44
49
  'button[data-dsh-gipg-about="1"]',
50
+ 'header button[title^="新版本"]',
51
+ 'header h1 > button[class*="bg-red-500"]',
45
52
  ]
46
53
  const TRIM_STYLE_ID = 'dsh-gipg-trim'
47
54
  const ABOUT_LABEL = '关于'
48
55
 
49
- /**
50
- * What the settings header shows. The badge carries the plugin's own
51
- * version; the vendored upstream build stays available in the tooltip.
52
- */
56
+ /** What the settings header shows: the plugin's own version, nothing else. */
53
57
  function versionLabel(pluginVersion) {
54
58
  return pluginVersion ? `v${pluginVersion}` : undefined
55
59
  }
@@ -67,7 +71,11 @@ window.__ModuleLoader__.load({
67
71
  if (!doc.getElementById(TRIM_STYLE_ID)) {
68
72
  const style = doc.createElement('style')
69
73
  style.id = TRIM_STYLE_ID
70
- style.textContent = `${FRAME_TRIM.join(',')}{display:none!important}`
74
+ style.textContent = [
75
+ `${FRAME_TRIM.join(',')}{display:none!important}`,
76
+ // A de-linked title still looks like a link on hover without this.
77
+ 'header h1 a[data-dsh-gipg-nolink]{pointer-events:none;cursor:default;text-decoration:none}',
78
+ ].join('\n')
71
79
  doc.head.appendChild(style)
72
80
  }
73
81
  const label = versionLabel(versions && versions.pluginVersion)
@@ -75,6 +83,16 @@ window.__ModuleLoader__.load({
75
83
  for (const button of doc.querySelectorAll('button')) {
76
84
  if ((button.textContent || '').trim() === ABOUT_LABEL) button.setAttribute('data-dsh-gipg-about', '1')
77
85
  }
86
+ // The product title is a link to the upstream repository on the
87
+ // standalone site. Inside DSH it should read as a plain label, so the
88
+ // anchor keeps its text and styling but loses every navigational bit.
89
+ for (const anchor of doc.querySelectorAll('header h1 a')) {
90
+ if (!/github\.com/.test(anchor.getAttribute('href') ?? '')) continue
91
+ anchor.removeAttribute('href')
92
+ anchor.removeAttribute('target')
93
+ anchor.removeAttribute('rel')
94
+ anchor.setAttribute('data-dsh-gipg-nolink', '1')
95
+ }
78
96
  if (!label) return
79
97
  for (const span of doc.querySelectorAll('span')) {
80
98
  const text = (span.textContent || '').trim()
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-gpt-image-playground",
3
- "version": "0.2.3",
3
+ "version": "0.2.5",
4
4
  "description": "GPT Image Playground as a DeepSeek Harness plugin: the upstream image generation and editing workbench, vendored, served same-origin, with an optional API proxy.",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",