@iasiv5/dsh-quota-watch 0.0.15 → 0.0.16

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/lib/client.js CHANGED
@@ -166,7 +166,7 @@ var STYLE_TEXT = `
166
166
  .dqw-stale-mark { flex: none; font-size: 9px; line-height: 14px; color: var(--dsw-alias-label-warning, #b46900); cursor: help; }
167
167
  .dqw-errtext { font-size: 10px; line-height: 14px; opacity: .7; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
168
168
  .dqw-rail-trigger { display: none; flex: none; align-items: center; justify-content: center; width: 36px; height: 36px; margin: 0; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--dsw-alias-label-primary, inherit); cursor: pointer; transition: background-color .12s, color .12s; }
169
- .dqw-rail-trigger svg { display: block; width: 20px; height: 20px; }
169
+ .dqw-rail-trigger svg { display: block; width: 22px; height: 22px; }
170
170
  .dqw-rail-trigger:hover:not(:disabled) { background: var(--dsw-alias-interactive-bg-hover, rgba(128,128,128,.12)); color: var(--dsw-alias-label-primary, inherit); }
171
171
  .dqw-rail-trigger:active:not(:disabled), .dqw-rail-trigger[aria-expanded="true"] { background: var(--dsw-alias-interactive-bg-active, rgba(128,128,128,.18)); color: var(--dsw-alias-label-primary, inherit); }
172
172
  .dqw-rail-trigger:focus-visible { outline: 2px solid var(--dsw-alias-brand-primary, #5b8def); outline-offset: 2px; }
@@ -177,6 +177,7 @@ var STYLE_TEXT = `
177
177
  @supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) { .dqw-pop { background: var(--dsw-alias-bg-elevated, var(--dsw-alias-bg-base, #1f1f1f)); } }
178
178
  .dqw-pop[hidden] { display: none; }
179
179
  .dqw-pop *, .dqw-pop *::before, .dqw-pop *::after { box-sizing: border-box; }
180
+ .dqw-pop-header { display: flex; align-items: center; gap: 6px; min-width: 0; }
180
181
  .dqw-pop-title { margin: 0; font-size: 11px; font-weight: 600; line-height: 16px; }
181
182
  .dqw-pop-back { display: inline-flex; flex: none; align-items: center; justify-content: center; width: 28px; height: 28px; margin: 0; padding: 0; border: 0; border-radius: 6px; background: transparent; color: var(--dsw-alias-label-secondary, inherit); cursor: pointer; }
182
183
  .dqw-pop-back svg { display: block; width: 16px; height: 16px; }
@@ -251,8 +252,8 @@ function quotaIcon(doc) {
251
252
  const namespace = "http://www.w3.org/2000/svg";
252
253
  const svg = doc.createElementNS(namespace, "svg");
253
254
  svg.setAttribute("viewBox", "0 0 24 24");
254
- svg.setAttribute("width", "20");
255
- svg.setAttribute("height", "20");
255
+ svg.setAttribute("width", "22");
256
+ svg.setAttribute("height", "22");
256
257
  svg.setAttribute("fill", "none");
257
258
  svg.setAttribute("stroke", "currentColor");
258
259
  svg.setAttribute("stroke-width", "1.7");
@@ -260,17 +261,21 @@ function quotaIcon(doc) {
260
261
  svg.setAttribute("stroke-linejoin", "round");
261
262
  svg.setAttribute("aria-hidden", "true");
262
263
  svg.setAttribute("focusable", "false");
263
- const arc = doc.createElementNS(namespace, "path");
264
- arc.setAttribute("d", "M4 17a8 8 0 0 1 16 0H4");
264
+ const dial = doc.createElementNS(namespace, "circle");
265
+ dial.setAttribute("cx", "12");
266
+ dial.setAttribute("cy", "12");
267
+ dial.setAttribute("r", "9");
268
+ const ticks = doc.createElementNS(namespace, "path");
269
+ ticks.setAttribute("d", "M12 2.7v2.1M12 19.2v2.1M2.7 12h2.1M19.2 12h2.1M5.43 5.43l1.49 1.49M17.08 17.08l1.49 1.49M18.57 5.43l-1.49 1.49M6.92 17.08l-1.49 1.49");
265
270
  const needle = doc.createElementNS(namespace, "path");
266
- needle.setAttribute("d", "m12 17 3.2-5.2");
271
+ needle.setAttribute("d", "M12 12l4.5-4");
267
272
  const hub = doc.createElementNS(namespace, "circle");
268
273
  hub.setAttribute("cx", "12");
269
- hub.setAttribute("cy", "17");
270
- hub.setAttribute("r", "1");
274
+ hub.setAttribute("cy", "12");
275
+ hub.setAttribute("r", "1.2");
271
276
  hub.setAttribute("fill", "currentColor");
272
277
  hub.setAttribute("stroke", "none");
273
- svg.append(arc, needle, hub);
278
+ svg.append(dial, ticks, needle, hub);
274
279
  return svg;
275
280
  }
276
281
  function backIcon(doc) {
@@ -497,6 +502,8 @@ function mountQuotaCard({
497
502
  function renderDetail(detail, key, provider, fromRail = false) {
498
503
  detail.replaceChildren();
499
504
  if (fromRail) {
505
+ const header = doc.createElement("div");
506
+ header.className = "dqw-pop-header";
500
507
  const back = doc.createElement("button");
501
508
  back.type = "button";
502
509
  back.className = "dqw-pop-back";
@@ -504,7 +511,8 @@ function mountQuotaCard({
504
511
  back.setAttribute("aria-label", copy.backToOverview);
505
512
  back.title = copy.backToOverview;
506
513
  back.append(backIcon(doc));
507
- detail.append(back, text(doc, "p", "dqw-pop-title", copy.providerNames[key]));
514
+ header.append(back, text(doc, "p", "dqw-pop-title", copy.providerNames[key]));
515
+ detail.append(header);
508
516
  }
509
517
  if (provider?.status === "stale") {
510
518
  detail.append(text(doc, "p", "dqw-error", `${copy.stale}${provider.error ? `: ${provider.error}` : ""}`));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iasiv5/dsh-quota-watch",
3
- "version": "0.0.15",
3
+ "version": "0.0.16",
4
4
  "description": "DSH Web sidebar monitor for GLM Coding Plan quotas and GitHub Copilot credits",
5
5
  "type": "module",
6
6
  "main": "./src/host.mjs",
package/src/client.mjs CHANGED
@@ -88,7 +88,7 @@ const STYLE_TEXT = `
88
88
  .dqw-stale-mark { flex: none; font-size: 9px; line-height: 14px; color: var(--dsw-alias-label-warning, #b46900); cursor: help; }
89
89
  .dqw-errtext { font-size: 10px; line-height: 14px; opacity: .7; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
90
90
  .dqw-rail-trigger { display: none; flex: none; align-items: center; justify-content: center; width: 36px; height: 36px; margin: 0; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--dsw-alias-label-primary, inherit); cursor: pointer; transition: background-color .12s, color .12s; }
91
- .dqw-rail-trigger svg { display: block; width: 20px; height: 20px; }
91
+ .dqw-rail-trigger svg { display: block; width: 22px; height: 22px; }
92
92
  .dqw-rail-trigger:hover:not(:disabled) { background: var(--dsw-alias-interactive-bg-hover, rgba(128,128,128,.12)); color: var(--dsw-alias-label-primary, inherit); }
93
93
  .dqw-rail-trigger:active:not(:disabled), .dqw-rail-trigger[aria-expanded="true"] { background: var(--dsw-alias-interactive-bg-active, rgba(128,128,128,.18)); color: var(--dsw-alias-label-primary, inherit); }
94
94
  .dqw-rail-trigger:focus-visible { outline: 2px solid var(--dsw-alias-brand-primary, #5b8def); outline-offset: 2px; }
@@ -99,6 +99,7 @@ const STYLE_TEXT = `
99
99
  @supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) { .dqw-pop { background: var(--dsw-alias-bg-elevated, var(--dsw-alias-bg-base, #1f1f1f)); } }
100
100
  .dqw-pop[hidden] { display: none; }
101
101
  .dqw-pop *, .dqw-pop *::before, .dqw-pop *::after { box-sizing: border-box; }
102
+ .dqw-pop-header { display: flex; align-items: center; gap: 6px; min-width: 0; }
102
103
  .dqw-pop-title { margin: 0; font-size: 11px; font-weight: 600; line-height: 16px; }
103
104
  .dqw-pop-back { display: inline-flex; flex: none; align-items: center; justify-content: center; width: 28px; height: 28px; margin: 0; padding: 0; border: 0; border-radius: 6px; background: transparent; color: var(--dsw-alias-label-secondary, inherit); cursor: pointer; }
104
105
  .dqw-pop-back svg { display: block; width: 16px; height: 16px; }
@@ -180,8 +181,8 @@ function quotaIcon(doc) {
180
181
  const namespace = 'http://www.w3.org/2000/svg'
181
182
  const svg = doc.createElementNS(namespace, 'svg')
182
183
  svg.setAttribute('viewBox', '0 0 24 24')
183
- svg.setAttribute('width', '20')
184
- svg.setAttribute('height', '20')
184
+ svg.setAttribute('width', '22')
185
+ svg.setAttribute('height', '22')
185
186
  svg.setAttribute('fill', 'none')
186
187
  svg.setAttribute('stroke', 'currentColor')
187
188
  svg.setAttribute('stroke-width', '1.7')
@@ -189,17 +190,21 @@ function quotaIcon(doc) {
189
190
  svg.setAttribute('stroke-linejoin', 'round')
190
191
  svg.setAttribute('aria-hidden', 'true')
191
192
  svg.setAttribute('focusable', 'false')
192
- const arc = doc.createElementNS(namespace, 'path')
193
- arc.setAttribute('d', 'M4 17a8 8 0 0 1 16 0H4')
193
+ const dial = doc.createElementNS(namespace, 'circle')
194
+ dial.setAttribute('cx', '12')
195
+ dial.setAttribute('cy', '12')
196
+ dial.setAttribute('r', '9')
197
+ const ticks = doc.createElementNS(namespace, 'path')
198
+ ticks.setAttribute('d', 'M12 2.7v2.1M12 19.2v2.1M2.7 12h2.1M19.2 12h2.1M5.43 5.43l1.49 1.49M17.08 17.08l1.49 1.49M18.57 5.43l-1.49 1.49M6.92 17.08l-1.49 1.49')
194
199
  const needle = doc.createElementNS(namespace, 'path')
195
- needle.setAttribute('d', 'm12 17 3.2-5.2')
200
+ needle.setAttribute('d', 'M12 12l4.5-4')
196
201
  const hub = doc.createElementNS(namespace, 'circle')
197
202
  hub.setAttribute('cx', '12')
198
- hub.setAttribute('cy', '17')
199
- hub.setAttribute('r', '1')
203
+ hub.setAttribute('cy', '12')
204
+ hub.setAttribute('r', '1.2')
200
205
  hub.setAttribute('fill', 'currentColor')
201
206
  hub.setAttribute('stroke', 'none')
202
- svg.append(arc, needle, hub)
207
+ svg.append(dial, ticks, needle, hub)
203
208
  return svg
204
209
  }
205
210
 
@@ -447,6 +452,8 @@ export function mountQuotaCard({
447
452
  function renderDetail(detail, key, provider, fromRail = false) {
448
453
  detail.replaceChildren()
449
454
  if (fromRail) {
455
+ const header = doc.createElement('div')
456
+ header.className = 'dqw-pop-header'
450
457
  const back = doc.createElement('button')
451
458
  back.type = 'button'
452
459
  back.className = 'dqw-pop-back'
@@ -454,7 +461,8 @@ export function mountQuotaCard({
454
461
  back.setAttribute('aria-label', copy.backToOverview)
455
462
  back.title = copy.backToOverview
456
463
  back.append(backIcon(doc))
457
- detail.append(back, text(doc, 'p', 'dqw-pop-title', copy.providerNames[key]))
464
+ header.append(back, text(doc, 'p', 'dqw-pop-title', copy.providerNames[key]))
465
+ detail.append(header)
458
466
  }
459
467
  if (provider?.status === 'stale') {
460
468
  detail.append(text(doc, 'p', 'dqw-error', `${copy.stale}${provider.error ? `: ${provider.error}` : ''}`))