@iasiv5/dsh-quota-watch 0.0.13 → 0.0.14
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 +15 -9
- package/package.json +1 -1
- package/src/client.mjs +15 -9
package/lib/client.js
CHANGED
|
@@ -170,9 +170,9 @@ var STYLE_TEXT = `
|
|
|
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; }
|
|
173
|
-
[data-
|
|
174
|
-
[data-
|
|
175
|
-
[data-
|
|
173
|
+
[data-sidebar-collapsed] [data-dsh-quota-watch-card] { display: flex; align-items: center; justify-content: center; width: 36px; margin: 0 0 12px; }
|
|
174
|
+
[data-sidebar-collapsed] [data-dsh-quota-watch-card] > .dqw-card { display: none; }
|
|
175
|
+
[data-sidebar-collapsed] [data-dsh-quota-watch-card] > .dqw-rail-trigger { display: inline-flex; }
|
|
176
176
|
.dqw-pop { position: fixed; z-index: 2147483000; min-width: 166px; max-width: 320px; padding: 10px 12px; border: 1px solid var(--dsw-alias-border-secondary, rgba(128,128,128,.35)); border-radius: 10px; background: var(--dsw-alias-bg-elevated, var(--dsw-alias-bg-base, #1f1f1f)); background: color-mix(in srgb, var(--dsw-alias-bg-base, #1f1f1f) 86%, transparent); -webkit-backdrop-filter: blur(14px) saturate(1.3); backdrop-filter: blur(14px) saturate(1.3); box-shadow: 0 8px 24px rgba(0,0,0,.25); color: var(--dsw-alias-label-primary, inherit); display: flex; flex-direction: column; gap: 8px; font: inherit; }
|
|
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; }
|
|
@@ -229,10 +229,16 @@ function formatTime(value, locale) {
|
|
|
229
229
|
if (typeof value !== "string" || value === "") return "";
|
|
230
230
|
const date = new Date(value);
|
|
231
231
|
if (Number.isNaN(date.getTime())) return "";
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
232
|
+
const dateLocale = locale === "zh" ? "zh-CN" : "en-US";
|
|
233
|
+
const dateParts = new Intl.DateTimeFormat(dateLocale, {
|
|
234
|
+
year: "numeric",
|
|
235
|
+
month: "2-digit",
|
|
236
|
+
day: "2-digit"
|
|
237
|
+
}).formatToParts(date);
|
|
238
|
+
const part = (type) => dateParts.find((item) => item.type === type)?.value ?? "";
|
|
239
|
+
const dateText = `${part("year")}/${part("month")}/${part("day")}`;
|
|
240
|
+
const timeText = new Intl.DateTimeFormat(dateLocale, { timeStyle: "short" }).format(date);
|
|
241
|
+
return `${dateText} ${timeText}`;
|
|
236
242
|
}
|
|
237
243
|
function text(doc, tag, className, value) {
|
|
238
244
|
const node = doc.createElement(tag);
|
|
@@ -678,9 +684,9 @@ function mountQuotaCard({
|
|
|
678
684
|
if (!disposed) place();
|
|
679
685
|
});
|
|
680
686
|
};
|
|
681
|
-
let sidebarCollapsed = Boolean(doc.querySelector("[data-
|
|
687
|
+
let sidebarCollapsed = Boolean(doc.querySelector("[data-sidebar-collapsed]"));
|
|
682
688
|
const syncSidebarMode = () => {
|
|
683
|
-
const nextCollapsed = Boolean(doc.querySelector("[data-
|
|
689
|
+
const nextCollapsed = Boolean(doc.querySelector("[data-sidebar-collapsed]"));
|
|
684
690
|
if (nextCollapsed === sidebarCollapsed) return;
|
|
685
691
|
sidebarCollapsed = nextCollapsed;
|
|
686
692
|
if (openKey !== void 0) {
|
package/package.json
CHANGED
package/src/client.mjs
CHANGED
|
@@ -92,9 +92,9 @@ const STYLE_TEXT = `
|
|
|
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; }
|
|
95
|
-
[data-
|
|
96
|
-
[data-
|
|
97
|
-
[data-
|
|
95
|
+
[data-sidebar-collapsed] [data-dsh-quota-watch-card] { display: flex; align-items: center; justify-content: center; width: 36px; margin: 0 0 12px; }
|
|
96
|
+
[data-sidebar-collapsed] [data-dsh-quota-watch-card] > .dqw-card { display: none; }
|
|
97
|
+
[data-sidebar-collapsed] [data-dsh-quota-watch-card] > .dqw-rail-trigger { display: inline-flex; }
|
|
98
98
|
.dqw-pop { position: fixed; z-index: 2147483000; min-width: 166px; max-width: 320px; padding: 10px 12px; border: 1px solid var(--dsw-alias-border-secondary, rgba(128,128,128,.35)); border-radius: 10px; background: var(--dsw-alias-bg-elevated, var(--dsw-alias-bg-base, #1f1f1f)); background: color-mix(in srgb, var(--dsw-alias-bg-base, #1f1f1f) 86%, transparent); -webkit-backdrop-filter: blur(14px) saturate(1.3); backdrop-filter: blur(14px) saturate(1.3); box-shadow: 0 8px 24px rgba(0,0,0,.25); color: var(--dsw-alias-label-primary, inherit); display: flex; flex-direction: column; gap: 8px; font: inherit; }
|
|
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; }
|
|
@@ -156,10 +156,16 @@ function formatTime(value, locale) {
|
|
|
156
156
|
if (typeof value !== 'string' || value === '') return ''
|
|
157
157
|
const date = new Date(value)
|
|
158
158
|
if (Number.isNaN(date.getTime())) return ''
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
159
|
+
const dateLocale = locale === 'zh' ? 'zh-CN' : 'en-US'
|
|
160
|
+
const dateParts = new Intl.DateTimeFormat(dateLocale, {
|
|
161
|
+
year: 'numeric',
|
|
162
|
+
month: '2-digit',
|
|
163
|
+
day: '2-digit',
|
|
164
|
+
}).formatToParts(date)
|
|
165
|
+
const part = (type) => dateParts.find((item) => item.type === type)?.value ?? ''
|
|
166
|
+
const dateText = `${part('year')}/${part('month')}/${part('day')}`
|
|
167
|
+
const timeText = new Intl.DateTimeFormat(dateLocale, { timeStyle: 'short' }).format(date)
|
|
168
|
+
return `${dateText} ${timeText}`
|
|
163
169
|
}
|
|
164
170
|
|
|
165
171
|
function text(doc, tag, className, value) {
|
|
@@ -647,9 +653,9 @@ export function mountQuotaCard({
|
|
|
647
653
|
})
|
|
648
654
|
}
|
|
649
655
|
|
|
650
|
-
let sidebarCollapsed = Boolean(doc.querySelector('[data-
|
|
656
|
+
let sidebarCollapsed = Boolean(doc.querySelector('[data-sidebar-collapsed]'))
|
|
651
657
|
const syncSidebarMode = () => {
|
|
652
|
-
const nextCollapsed = Boolean(doc.querySelector('[data-
|
|
658
|
+
const nextCollapsed = Boolean(doc.querySelector('[data-sidebar-collapsed]'))
|
|
653
659
|
if (nextCollapsed === sidebarCollapsed) return
|
|
654
660
|
sidebarCollapsed = nextCollapsed
|
|
655
661
|
if (openKey !== undefined) {
|