@monster-orange/den-ui 0.7.0 → 0.7.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/README.md +95 -12
- package/bin/den-ui-parity.mjs +2 -0
- package/inventory/nav-inventory.d.ts +37 -0
- package/inventory/nav-inventory.js +232 -1
- package/inventory/reference/den-chromium-1280.json +338 -110
- package/inventory/reference/den-chromium-390.json +271 -39
- package/inventory/reference/den-webkit-1280.json +338 -110
- package/inventory/reference/den-webkit-390.json +271 -39
- package/package.json +1 -1
- package/src/kit.d.ts +2 -0
- package/src/kit.js +2 -0
- package/src/shell-client.js +41 -0
- package/src/shell-html.d.ts +30 -7
- package/src/shell-html.js +129 -31
- package/src/shell.css +277 -13
- package/src/strings.js +3 -0
- package/src/version.js +5 -1
package/src/shell-html.js
CHANGED
|
@@ -196,7 +196,11 @@ export function versionChipHtml({ version, lang } = {}) {
|
|
|
196
196
|
return (
|
|
197
197
|
'<button class="den-ib v-pill" id="version-pill" title="' +
|
|
198
198
|
esc(kitT(lang, "kit.version.title")) +
|
|
199
|
-
'"><span class="v-txt"
|
|
199
|
+
'"><span class="v-txt"' +
|
|
200
|
+
(version
|
|
201
|
+
? ' title="v' + esc(String(version).replace(/^v/, "")) + '"'
|
|
202
|
+
: "") +
|
|
203
|
+
">" +
|
|
200
204
|
esc(version ? "v" + String(version).replace(/^v/, "") : "v…") +
|
|
201
205
|
'</span><span class="v-pip" id="v-pip"></span></button>'
|
|
202
206
|
);
|
|
@@ -277,7 +281,15 @@ export function markHtml(mark) {
|
|
|
277
281
|
);
|
|
278
282
|
}
|
|
279
283
|
|
|
280
|
-
/**
|
|
284
|
+
/** Where the kit's search starts in a `start` slot (searchHtml's markup). */
|
|
285
|
+
const SEARCH_AT = '<button type="button" class="den-search"';
|
|
286
|
+
|
|
287
|
+
/**
|
|
288
|
+
* The top bar (header.den-top), in three parts (issue 303): the left part
|
|
289
|
+
* (☰, the brand, and what `start` holds before the search: the crumbs),
|
|
290
|
+
* the search in a fixed slot, and the chips (the host's `end`, then
|
|
291
|
+
* Report, the bell, the version and ◐ ▾, pinned to the right edge).
|
|
292
|
+
*/
|
|
281
293
|
export function topBarHtml({
|
|
282
294
|
product = {},
|
|
283
295
|
lang,
|
|
@@ -285,8 +297,13 @@ export function topBarHtml({
|
|
|
285
297
|
report = true,
|
|
286
298
|
} = {}) {
|
|
287
299
|
const name = product.name ?? "";
|
|
300
|
+
const start = slots.start || "";
|
|
301
|
+
const at = start.indexOf(SEARCH_AT);
|
|
302
|
+
const before = at < 0 ? start : start.slice(0, at);
|
|
303
|
+
const search = at < 0 ? "" : start.slice(at);
|
|
288
304
|
return (
|
|
289
305
|
'<header class="den-top">' +
|
|
306
|
+
'<div class="den-left">' +
|
|
290
307
|
'<button class="den-ib den-menu-btn" id="den-menu-btn" aria-label="' +
|
|
291
308
|
esc(kitT(lang, "kit.menu")) +
|
|
292
309
|
'" aria-expanded="false" aria-controls="den-rail">☰</button>' +
|
|
@@ -300,9 +317,15 @@ export function topBarHtml({
|
|
|
300
317
|
'<span class="den-title" data-nav-role="brand-title">' +
|
|
301
318
|
esc(name) +
|
|
302
319
|
"</span></a>" +
|
|
303
|
-
|
|
320
|
+
before +
|
|
321
|
+
"</div>" +
|
|
322
|
+
search +
|
|
304
323
|
'<div class="den-chips">' +
|
|
324
|
+
// The host's chips' group, always drawn (empty without chips): the
|
|
325
|
+
// bar's structure is the same in any host.
|
|
326
|
+
'<div class="den-end">' +
|
|
305
327
|
(slots.end || "") +
|
|
328
|
+
"</div>" +
|
|
306
329
|
(report === false ? "" : reportButtonHtml({ inTop: true, lang })) +
|
|
307
330
|
(slots.bell || "") +
|
|
308
331
|
versionChipHtml({ version: product.version, lang }) +
|
|
@@ -502,7 +525,12 @@ export function scopeHtml({ crumbs, label, lang, after } = {}) {
|
|
|
502
525
|
'"><span class="den-sep" aria-hidden="true">/</span>';
|
|
503
526
|
// Each separator after a crumb comes and goes with it: host content.
|
|
504
527
|
list.forEach((c, i) => {
|
|
505
|
-
|
|
528
|
+
// The last crumb is kept whole when the crumbs give way (issue 303).
|
|
529
|
+
const last = i === list.length - 1;
|
|
530
|
+
html += scopeCrumbHtml(
|
|
531
|
+
last ? { ...c, cls: (c.cls ? c.cls + " " : "") + "den-last" } : c,
|
|
532
|
+
lang,
|
|
533
|
+
);
|
|
506
534
|
if (i < list.length - 1)
|
|
507
535
|
html +=
|
|
508
536
|
'<span class="den-sep den-' +
|
|
@@ -515,25 +543,24 @@ export function scopeHtml({ crumbs, label, lang, after } = {}) {
|
|
|
515
543
|
}
|
|
516
544
|
|
|
517
545
|
/**
|
|
518
|
-
* The search field: the placeholder, then ⌘K inside it,
|
|
519
|
-
* host's palette or page opens on it: hydrateSearch).
|
|
520
|
-
* searchHtml({
|
|
521
|
-
*
|
|
522
|
-
*
|
|
546
|
+
* The search field: the kit's placeholder ("Search…"), then ⌘K inside it,
|
|
547
|
+
* as a button (the host's palette or page opens on it: hydrateSearch).
|
|
548
|
+
* searchHtml({ id?, shortcut?, lang })
|
|
549
|
+
* Its placeholder and its name ("Search") are the kit's words, in the
|
|
550
|
+
* page's language: one search in every product, so a host can't set them.
|
|
523
551
|
* `shortcut: false`: no ⌘K.
|
|
524
552
|
*/
|
|
525
|
-
export function searchHtml({
|
|
526
|
-
const ph = placeholder ?? kitT(lang, "kit.search.ph");
|
|
553
|
+
export function searchHtml({ id, shortcut, lang } = {}) {
|
|
527
554
|
const keys = shortcut !== false;
|
|
528
555
|
return (
|
|
529
556
|
'<button type="button" class="den-search" id="' +
|
|
530
557
|
esc(id || "den-search") +
|
|
531
|
-
'" aria-haspopup="dialog" data-nav-
|
|
558
|
+
'" aria-haspopup="dialog" data-nav-kit="search"' +
|
|
532
559
|
(keys ? ' aria-keyshortcuts="Meta+K Control+K"' : "") +
|
|
533
560
|
' aria-label="' +
|
|
534
|
-
esc(
|
|
535
|
-
'"><span class="den-search-ph"
|
|
536
|
-
esc(ph) +
|
|
561
|
+
esc(kitT(lang, "kit.search.label")) +
|
|
562
|
+
'"><span class="den-search-ph">' +
|
|
563
|
+
esc(kitT(lang, "kit.search.ph")) +
|
|
537
564
|
"</span>" +
|
|
538
565
|
(keys ? '<kbd aria-hidden="true">⌘K</kbd>' : "") +
|
|
539
566
|
'<span class="den-search-ic" aria-hidden="true">⌕</span></button>'
|
|
@@ -654,18 +681,76 @@ export function bellPanelHtml({
|
|
|
654
681
|
* name and tooltip read "label · detail". It is a rail entry (.den-ni)
|
|
655
682
|
* marked data-den-account. No label: nothing.
|
|
656
683
|
*/
|
|
684
|
+
/**
|
|
685
|
+
* Who is signed in, as the kit draws it (0.7.1): the name on the first
|
|
686
|
+
* line, @login on the second; @login alone when no name is known. The
|
|
687
|
+
* role is shown in the account menu's header only ({ menu: true }), on
|
|
688
|
+
* its own line. From data: { name?, login?, role? }; with no
|
|
689
|
+
* identity, { local: true } draws the kit's word for this computer. The old
|
|
690
|
+
* { label, detail } (or the menu's { name, detail }) still work for one
|
|
691
|
+
* release, as they were given, marked data-nav-legacy for the nav
|
|
692
|
+
* inventory. Returns { lines: [first, second?], shape, legacy, full }.
|
|
693
|
+
*/
|
|
694
|
+
export function accountWho(a, { menu = false } = {}) {
|
|
695
|
+
if (!a) return null;
|
|
696
|
+
const legacy = a.label != null || a.detail != null;
|
|
697
|
+
const name = a.name ?? a.label ?? "";
|
|
698
|
+
const login = a.login
|
|
699
|
+
? String(a.login).startsWith("@")
|
|
700
|
+
? String(a.login)
|
|
701
|
+
: "@" + a.login
|
|
702
|
+
: (a.detail ?? "");
|
|
703
|
+
// The role is shown in the account menu's header only, never in the
|
|
704
|
+
// rail's entry (it isn't part of the entry's shape).
|
|
705
|
+
const role = menu ? a.role || "" : "";
|
|
706
|
+
let first = name || login;
|
|
707
|
+
// No identity known at all: the kit's own word for this computer.
|
|
708
|
+
const local = !first && !!a.local;
|
|
709
|
+
if (local) first = kitT(a.lang, "kit.account.local");
|
|
710
|
+
if (!first) return null;
|
|
711
|
+
const second = name ? login : "";
|
|
712
|
+
const shape = [
|
|
713
|
+
name ? "name" : "",
|
|
714
|
+
a.login || a.detail ? "login" : "",
|
|
715
|
+
local ? "local" : "",
|
|
716
|
+
]
|
|
717
|
+
.filter(Boolean)
|
|
718
|
+
.join(",");
|
|
719
|
+
const lines = [first, second].filter(Boolean);
|
|
720
|
+
return {
|
|
721
|
+
lines,
|
|
722
|
+
role,
|
|
723
|
+
shape,
|
|
724
|
+
legacy,
|
|
725
|
+
full: lines.join(" · "),
|
|
726
|
+
};
|
|
727
|
+
}
|
|
728
|
+
|
|
729
|
+
function whoLinesHtml(who) {
|
|
730
|
+
return (
|
|
731
|
+
'<span class="den-acct-n">' +
|
|
732
|
+
esc(who.lines[0]) +
|
|
733
|
+
"</span>" +
|
|
734
|
+
(who.lines[1]
|
|
735
|
+
? '<span class="den-acct-l">' + esc(who.lines[1]) + "</span>"
|
|
736
|
+
: "") +
|
|
737
|
+
(who.role ? '<span class="den-acct-r">' + esc(who.role) + "</span>" : "")
|
|
738
|
+
);
|
|
739
|
+
}
|
|
740
|
+
|
|
657
741
|
export function accountHtml(a) {
|
|
658
|
-
|
|
659
|
-
|
|
742
|
+
const who = accountWho(a);
|
|
743
|
+
if (!who) return "";
|
|
744
|
+
const full = who.full;
|
|
660
745
|
const more = { ...(a.attrs || {}) };
|
|
661
746
|
if (a.id) more.id = a.id;
|
|
662
|
-
|
|
747
|
+
more["data-nav-shape"] = who.shape;
|
|
748
|
+
if (who.legacy) more["data-nav-legacy"] = "account";
|
|
749
|
+
// Who is signed in: the host's data (host content for the nav
|
|
750
|
+
// inventory, which compares its shape: which fields, how many lines).
|
|
663
751
|
const words =
|
|
664
|
-
'<span class="den-lbl" data-nav-role="account-name">' +
|
|
665
|
-
|
|
666
|
-
(a.detail
|
|
667
|
-
? '<span class="den-acct-d"> · ' + esc(a.detail) + "</span>"
|
|
668
|
-
: "") +
|
|
752
|
+
'<span class="den-lbl den-acct" data-nav-role="account-name">' +
|
|
753
|
+
whoLinesHtml(who) +
|
|
669
754
|
"</span>";
|
|
670
755
|
if (a.href == null && a.menu && !a.id) more.id = "den-account";
|
|
671
756
|
const open =
|
|
@@ -834,20 +919,33 @@ export function appearanceMenuHtml({
|
|
|
834
919
|
}
|
|
835
920
|
|
|
836
921
|
/**
|
|
837
|
-
* The account entry's menu: who is signed in (
|
|
838
|
-
* rule, then the entries.
|
|
839
|
-
* accountMenuHtml({ name
|
|
922
|
+
* The account entry's menu: who is signed in (accountWho: the name, then
|
|
923
|
+
* @login), a rule, then the entries.
|
|
924
|
+
* accountMenuHtml({ name?, login?, role?, items, lang })
|
|
925
|
+
* ({ name, detail } is the old path, for one release.)
|
|
840
926
|
* items: [{ label, href }] links, [{ label, id }] buttons (onPick "item"),
|
|
841
927
|
* or [{ label, action: { method?, url, csrf?, field? } }]: a form that
|
|
842
928
|
* posts to url on its own, with no script (csrf, if any, in a hidden
|
|
843
929
|
* field named `field`, "csrf" by default).
|
|
844
930
|
*/
|
|
845
|
-
export function accountMenuHtml({ name, detail, items } = {}) {
|
|
931
|
+
export function accountMenuHtml({ name, login, role, detail, items } = {}) {
|
|
846
932
|
const parts = [];
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
933
|
+
// The menu's { name, detail } were free text: the old path maps them
|
|
934
|
+
// as the entry's label and detail.
|
|
935
|
+
const w = accountWho(
|
|
936
|
+
detail != null ? { label: name, detail } : { name, login, role },
|
|
937
|
+
{ menu: true },
|
|
938
|
+
);
|
|
939
|
+
if (w)
|
|
940
|
+
parts.push(
|
|
941
|
+
'<div class="den-ml den-acct" data-nav-shape="' +
|
|
942
|
+
esc(w.shape) +
|
|
943
|
+
'"' +
|
|
944
|
+
(w.legacy ? ' data-nav-legacy="account"' : "") +
|
|
945
|
+
">" +
|
|
946
|
+
whoLinesHtml(w) +
|
|
947
|
+
"</div>",
|
|
948
|
+
);
|
|
851
949
|
const rows = (items || [])
|
|
852
950
|
.map((it) => {
|
|
853
951
|
if (!it || !it.label) return "";
|
package/src/shell.css
CHANGED
|
@@ -61,9 +61,36 @@ body.den-has-shell > #den-content {
|
|
|
61
61
|
top: 8px;
|
|
62
62
|
}
|
|
63
63
|
.den-top {
|
|
64
|
-
|
|
64
|
+
/* Issue 303: three parts. The left part (☰, the brand, the crumbs) and
|
|
65
|
+
the search have set widths, so the search sits at the same x and
|
|
66
|
+
width in every product whatever the host's words; the chips take the
|
|
67
|
+
rest, pinned to the right edge. The chips' column is never narrower
|
|
68
|
+
than the kit's own buttons (the host's chips count for nothing
|
|
69
|
+
there): when the bar is too narrow for all three, the left part gives
|
|
70
|
+
way. Settings: --den-top-left (444px), --den-top-search (304px). */
|
|
71
|
+
display: grid;
|
|
72
|
+
/* The search never moves (issue 303): its x is a function of the
|
|
73
|
+
viewport only, the same in any host. The left part is
|
|
74
|
+
--den-top-left (444px), less what the search and the kit's right
|
|
75
|
+
group need (--den-top-right, 380px); the right group gives way
|
|
76
|
+
inside its column (the host's chips, then the version's text),
|
|
77
|
+
never Report, the bell or ◐. searchSlot() in the inventory is the
|
|
78
|
+
same sum. */
|
|
79
|
+
grid-template-columns:
|
|
80
|
+
minmax(
|
|
81
|
+
0,
|
|
82
|
+
min(
|
|
83
|
+
var(--den-top-left, 444px),
|
|
84
|
+
calc(
|
|
85
|
+
100% - var(--den-top-search, 304px) - var(--den-top-right, 380px) -
|
|
86
|
+
16px
|
|
87
|
+
)
|
|
88
|
+
)
|
|
89
|
+
)
|
|
90
|
+
var(--den-top-search, 304px)
|
|
91
|
+
minmax(0, 1fr);
|
|
65
92
|
align-items: center;
|
|
66
|
-
gap: 8px;
|
|
93
|
+
column-gap: 8px;
|
|
67
94
|
height: var(--den-top-h);
|
|
68
95
|
box-sizing: border-box;
|
|
69
96
|
padding: 0 12px;
|
|
@@ -100,19 +127,31 @@ body.den-has-shell > #den-content {
|
|
|
100
127
|
background: var(--bar, none);
|
|
101
128
|
pointer-events: none;
|
|
102
129
|
}
|
|
130
|
+
.den-left {
|
|
131
|
+
grid-column: 1;
|
|
132
|
+
display: flex;
|
|
133
|
+
align-items: center;
|
|
134
|
+
gap: 8px;
|
|
135
|
+
min-width: 0;
|
|
136
|
+
}
|
|
137
|
+
/* The crumbs give way first: they shrink before the brand does. */
|
|
103
138
|
.den-brand {
|
|
104
139
|
display: flex;
|
|
105
140
|
align-items: center;
|
|
106
141
|
gap: 8px;
|
|
107
142
|
color: var(--text);
|
|
108
143
|
text-decoration: none;
|
|
109
|
-
flex
|
|
144
|
+
flex: 0 0.001 auto;
|
|
145
|
+
min-width: 0;
|
|
110
146
|
white-space: nowrap;
|
|
111
147
|
}
|
|
112
148
|
.den-title {
|
|
113
149
|
font: 600 15px var(--display);
|
|
114
150
|
margin: 0;
|
|
115
151
|
white-space: nowrap;
|
|
152
|
+
min-width: 0;
|
|
153
|
+
overflow: hidden;
|
|
154
|
+
text-overflow: ellipsis;
|
|
116
155
|
}
|
|
117
156
|
/* The mark's layout (0.7.0, from Den's own sheet): a centred box its
|
|
118
157
|
image fills, whatever the host's mark is. */
|
|
@@ -190,10 +229,112 @@ body.den-has-shell > #den-content {
|
|
|
190
229
|
display: none;
|
|
191
230
|
}
|
|
192
231
|
.den-chips {
|
|
232
|
+
grid-column: 3;
|
|
193
233
|
display: flex;
|
|
194
234
|
align-items: center;
|
|
235
|
+
justify-content: flex-end;
|
|
195
236
|
gap: 4px;
|
|
196
|
-
|
|
237
|
+
min-width: 0;
|
|
238
|
+
/* A clear gap after the search's ⌕. */
|
|
239
|
+
padding-left: 8px;
|
|
240
|
+
}
|
|
241
|
+
/* The kit's own buttons keep their size; the host's chips give way. */
|
|
242
|
+
.den-chips > * {
|
|
243
|
+
flex: none;
|
|
244
|
+
}
|
|
245
|
+
/* The version sits in a fixed slot (96px; 64px up to 1100px): its text
|
|
246
|
+
ends in "…" inside it (the whole version in the text's title), so
|
|
247
|
+
Report, the bell and ◐ sit at the same x in any host, anchored from
|
|
248
|
+
the right edge. */
|
|
249
|
+
.den-chips > .v-pill,
|
|
250
|
+
#den-shell .den-chips > .v-pill {
|
|
251
|
+
flex: none;
|
|
252
|
+
width: var(--den-top-version, 96px);
|
|
253
|
+
min-width: 0;
|
|
254
|
+
justify-content: center;
|
|
255
|
+
box-sizing: border-box;
|
|
256
|
+
}
|
|
257
|
+
@media (max-width: 1100px) {
|
|
258
|
+
.den-chips > .v-pill,
|
|
259
|
+
#den-shell .den-chips > .v-pill {
|
|
260
|
+
width: var(--den-top-version-md, 64px);
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
.den-chips > .v-pill .v-txt {
|
|
264
|
+
min-width: 0;
|
|
265
|
+
overflow: hidden;
|
|
266
|
+
text-overflow: ellipsis;
|
|
267
|
+
white-space: nowrap;
|
|
268
|
+
}
|
|
269
|
+
/* Report, the bell and ◐ are the kit's: their font and box are set here,
|
|
270
|
+
so a host's own rules (letter-spacing, box-sizing) can't size them. */
|
|
271
|
+
.den-chips > .den-rb-top,
|
|
272
|
+
.den-chips > #den-bell,
|
|
273
|
+
.den-chips > .appearance-btn {
|
|
274
|
+
font-family: var(--sans);
|
|
275
|
+
letter-spacing: normal;
|
|
276
|
+
word-spacing: normal;
|
|
277
|
+
text-transform: none;
|
|
278
|
+
box-sizing: border-box;
|
|
279
|
+
}
|
|
280
|
+
/* The host's chips (issue 303): the first to give way when the bar is
|
|
281
|
+
short. Their group takes the room left of the kit's buttons, right
|
|
282
|
+
aligned, clipped on the x axis only (a touch tap area still reaches
|
|
283
|
+
above and below); under 40px its chips hide, so none ever sits under
|
|
284
|
+
the search. */
|
|
285
|
+
.den-end {
|
|
286
|
+
display: flex;
|
|
287
|
+
align-items: center;
|
|
288
|
+
justify-content: flex-end;
|
|
289
|
+
gap: 4px;
|
|
290
|
+
flex: 1 1 0;
|
|
291
|
+
min-width: 0;
|
|
292
|
+
overflow-x: clip;
|
|
293
|
+
/* Its chips never widen the bar: the group's own width is the room. */
|
|
294
|
+
contain: inline-size;
|
|
295
|
+
}
|
|
296
|
+
/* A host chip gives way: its last part (its words, in a span) ends in
|
|
297
|
+
"…". */
|
|
298
|
+
/* Width 0, growing to its own width: a host chip takes only the room
|
|
299
|
+
there is, and counts for nothing in the chips' least width. */
|
|
300
|
+
.den-top .den-end > * {
|
|
301
|
+
width: auto;
|
|
302
|
+
flex: 0 1 auto;
|
|
303
|
+
max-width: max-content;
|
|
304
|
+
/* A shrunk chip keeps its dot and "…" (its words in its title and
|
|
305
|
+
name, set by the kit's hydration). */
|
|
306
|
+
min-width: 2.6em;
|
|
307
|
+
display: inline-flex;
|
|
308
|
+
align-items: center;
|
|
309
|
+
white-space: nowrap;
|
|
310
|
+
}
|
|
311
|
+
.den-top .den-end > * > :last-child {
|
|
312
|
+
min-width: 0;
|
|
313
|
+
overflow: hidden;
|
|
314
|
+
text-overflow: ellipsis;
|
|
315
|
+
white-space: nowrap;
|
|
316
|
+
}
|
|
317
|
+
@media not (pointer: coarse) {
|
|
318
|
+
.den-top .den-end > * {
|
|
319
|
+
overflow: hidden;
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
/* On a touch screen nothing is clipped, so a chip's 44px tap reaches
|
|
323
|
+
past its group. */
|
|
324
|
+
@media (pointer: coarse) {
|
|
325
|
+
.den-end {
|
|
326
|
+
overflow-x: visible;
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
/* A phone: nothing is clipped (touch or not, the bar looks the same);
|
|
330
|
+
the chips shrink to the room there is. */
|
|
331
|
+
@media (max-width: 720px) {
|
|
332
|
+
.den-end {
|
|
333
|
+
overflow-x: visible;
|
|
334
|
+
}
|
|
335
|
+
.den-top .den-end > * {
|
|
336
|
+
min-width: 0;
|
|
337
|
+
}
|
|
197
338
|
}
|
|
198
339
|
.den-user {
|
|
199
340
|
display: contents;
|
|
@@ -615,12 +756,21 @@ body.den-has-shell .den-upd {
|
|
|
615
756
|
/* The scope crumbs: / KEY value ▾ / … The search gives way first: the
|
|
616
757
|
crumbs keep their parts whole (each value is capped), so they never run
|
|
617
758
|
into one another. */
|
|
759
|
+
/* The crumbs (issue 303): each crumb a column of minmax(auto, max-content)
|
|
760
|
+
whose least width is 0 (min-width: 0), so the room there is goes to
|
|
761
|
+
every crumb alike until each is whole: a short crumb keeps its words, a
|
|
762
|
+
long one ends in an ellipsis, and the last crumb is kept whole. They
|
|
763
|
+
give way before the brand. */
|
|
618
764
|
.den-scope {
|
|
619
|
-
display:
|
|
765
|
+
display: grid;
|
|
766
|
+
grid-auto-flow: column;
|
|
767
|
+
grid-auto-columns: minmax(auto, max-content);
|
|
620
768
|
align-items: center;
|
|
621
|
-
gap: 2px;
|
|
622
|
-
|
|
623
|
-
|
|
769
|
+
column-gap: 2px;
|
|
770
|
+
/* Never narrower than what its crumbs can give: past that, the brand
|
|
771
|
+
gives way. */
|
|
772
|
+
min-width: min-content;
|
|
773
|
+
flex: 0 999 auto;
|
|
624
774
|
position: relative;
|
|
625
775
|
}
|
|
626
776
|
.den-sep {
|
|
@@ -634,6 +784,53 @@ body.den-has-shell .den-upd {
|
|
|
634
784
|
font-size: 13px;
|
|
635
785
|
min-width: 0;
|
|
636
786
|
}
|
|
787
|
+
/* The last crumb's least width is its whole self: it never gives way. */
|
|
788
|
+
.den-scope .den-ib.den-last {
|
|
789
|
+
min-width: auto;
|
|
790
|
+
}
|
|
791
|
+
.den-scope .den-ib > * {
|
|
792
|
+
flex: none;
|
|
793
|
+
}
|
|
794
|
+
/* The label gives way first (down to nothing), then the value ends in
|
|
795
|
+
"…": a crumb's value outlasts its label. Before the last crumb, a
|
|
796
|
+
value keeps about 4ch and its ▾. */
|
|
797
|
+
.den-scope .den-ib > .den-k {
|
|
798
|
+
flex: 0 1000 auto;
|
|
799
|
+
min-width: 0;
|
|
800
|
+
overflow: hidden;
|
|
801
|
+
white-space: nowrap;
|
|
802
|
+
}
|
|
803
|
+
.den-scope .den-ib:not(.den-last) > .den-v {
|
|
804
|
+
min-width: calc(5ch + 0.28em);
|
|
805
|
+
}
|
|
806
|
+
.den-scope .den-ib:not(.den-last) > :last-child:not(.den-v):not(.den-k) {
|
|
807
|
+
min-width: 4ch;
|
|
808
|
+
}
|
|
809
|
+
/* The value gives way (its ▾ stays): a static crumb's value, or a menu
|
|
810
|
+
crumb's value box and the name in it. */
|
|
811
|
+
.den-scope .den-ib > :last-child {
|
|
812
|
+
flex: 0 1 auto;
|
|
813
|
+
min-width: 0;
|
|
814
|
+
overflow: hidden;
|
|
815
|
+
text-overflow: ellipsis;
|
|
816
|
+
white-space: nowrap;
|
|
817
|
+
}
|
|
818
|
+
.den-scope .den-v {
|
|
819
|
+
display: inline-flex;
|
|
820
|
+
align-items: baseline;
|
|
821
|
+
/* The space between the value and its ▾. */
|
|
822
|
+
column-gap: 0.28em;
|
|
823
|
+
}
|
|
824
|
+
.den-scope .den-v > .den-vn {
|
|
825
|
+
flex: 0 1 auto;
|
|
826
|
+
min-width: 0;
|
|
827
|
+
overflow: hidden;
|
|
828
|
+
text-overflow: ellipsis;
|
|
829
|
+
white-space: nowrap;
|
|
830
|
+
}
|
|
831
|
+
.den-scope .den-v > :not(.den-vn) {
|
|
832
|
+
flex: none;
|
|
833
|
+
}
|
|
637
834
|
.den-k {
|
|
638
835
|
font: 11px var(--mono);
|
|
639
836
|
color: var(--faint);
|
|
@@ -656,9 +853,8 @@ body.den-has-shell .den-upd {
|
|
|
656
853
|
/* The search field, ⌘K inside it. Its sizes are content-box (a page may
|
|
657
854
|
reset everything to border-box). */
|
|
658
855
|
.den-search {
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
margin: 0 auto;
|
|
856
|
+
grid-column: 2;
|
|
857
|
+
margin: 0;
|
|
662
858
|
display: flex;
|
|
663
859
|
align-items: center;
|
|
664
860
|
gap: 8px;
|
|
@@ -813,6 +1009,25 @@ body.den-has-shell .den-upd {
|
|
|
813
1009
|
.den-acct-d {
|
|
814
1010
|
color: var(--faint);
|
|
815
1011
|
}
|
|
1012
|
+
/* Who is signed in (0.7.1): the name, then @login under it, quieter;
|
|
1013
|
+
the same in the rail's entry and the account menu's header. */
|
|
1014
|
+
.den-acct {
|
|
1015
|
+
display: flex;
|
|
1016
|
+
flex-direction: column;
|
|
1017
|
+
min-width: 0;
|
|
1018
|
+
}
|
|
1019
|
+
.den-acct-n,
|
|
1020
|
+
.den-acct-l,
|
|
1021
|
+
.den-acct-r {
|
|
1022
|
+
overflow: hidden;
|
|
1023
|
+
text-overflow: ellipsis;
|
|
1024
|
+
white-space: nowrap;
|
|
1025
|
+
}
|
|
1026
|
+
.den-acct-l,
|
|
1027
|
+
.den-acct-r {
|
|
1028
|
+
font-size: 11px;
|
|
1029
|
+
color: var(--faint);
|
|
1030
|
+
}
|
|
816
1031
|
|
|
817
1032
|
/* Narrow: the crumbs' keys and the optional crumb give way, then the
|
|
818
1033
|
crumbs hide and the search is its icon. */
|
|
@@ -824,12 +1039,23 @@ body.den-has-shell .den-upd {
|
|
|
824
1039
|
}
|
|
825
1040
|
}
|
|
826
1041
|
@media (max-width: 720px) {
|
|
1042
|
+
/* The search is its icon, in a slot after the brand: the same x in
|
|
1043
|
+
every product (--den-top-left-md, 200px; on a phone
|
|
1044
|
+
--den-top-left-sm, 62px: ☰ and the mark). */
|
|
1045
|
+
.den-top {
|
|
1046
|
+
grid-template-columns: minmax(0, var(--den-top-left-md, 200px)) auto minmax(
|
|
1047
|
+
min-content,
|
|
1048
|
+
1fr
|
|
1049
|
+
);
|
|
1050
|
+
}
|
|
1051
|
+
.den-chips {
|
|
1052
|
+
padding-left: 0;
|
|
1053
|
+
}
|
|
827
1054
|
.den-scope {
|
|
828
1055
|
display: none;
|
|
829
1056
|
}
|
|
830
1057
|
.den-search {
|
|
831
|
-
|
|
832
|
-
margin: 0 0 0 auto;
|
|
1058
|
+
margin: 0;
|
|
833
1059
|
}
|
|
834
1060
|
.den-search-ph,
|
|
835
1061
|
.den-search kbd {
|
|
@@ -839,6 +1065,12 @@ body.den-has-shell .den-upd {
|
|
|
839
1065
|
|
|
840
1066
|
/* A phone's tap targets: every top-bar button 32px or more each way. */
|
|
841
1067
|
@media (max-width: 479.98px) {
|
|
1068
|
+
.den-top {
|
|
1069
|
+
grid-template-columns: var(--den-top-left-sm, 62px) auto minmax(
|
|
1070
|
+
min-content,
|
|
1071
|
+
1fr
|
|
1072
|
+
);
|
|
1073
|
+
}
|
|
842
1074
|
.den-top button {
|
|
843
1075
|
min-height: 32px;
|
|
844
1076
|
min-width: 32px;
|
|
@@ -1008,3 +1240,35 @@ body.den-has-shell .den-upd {
|
|
|
1008
1240
|
display: none;
|
|
1009
1241
|
}
|
|
1010
1242
|
}
|
|
1243
|
+
|
|
1244
|
+
/* Touch (issue 303): .den-hit is the kit's 44×44px tap, for any control
|
|
1245
|
+
(the kit's top bar uses it, and a host may put it on its own buttons
|
|
1246
|
+
and tabs): a hit area centred on the control, transparent, with no
|
|
1247
|
+
change to its look or layout, on a touch screen only. Key hints
|
|
1248
|
+
(.den-kbd, and the bar's kbd) hide on a touch screen, wherever they
|
|
1249
|
+
are. */
|
|
1250
|
+
@media (pointer: coarse) {
|
|
1251
|
+
.den-hit,
|
|
1252
|
+
.den-top button,
|
|
1253
|
+
.den-top a[href] {
|
|
1254
|
+
position: relative;
|
|
1255
|
+
}
|
|
1256
|
+
.den-hit::after,
|
|
1257
|
+
.den-top button::after,
|
|
1258
|
+
.den-top a[href]::after {
|
|
1259
|
+
content: "";
|
|
1260
|
+
position: absolute;
|
|
1261
|
+
left: 50%;
|
|
1262
|
+
top: 50%;
|
|
1263
|
+
width: 100%;
|
|
1264
|
+
height: 100%;
|
|
1265
|
+
min-width: 44px;
|
|
1266
|
+
min-height: 44px;
|
|
1267
|
+
transform: translate(-50%, -50%);
|
|
1268
|
+
background: transparent;
|
|
1269
|
+
}
|
|
1270
|
+
.den-kbd,
|
|
1271
|
+
.den-top kbd {
|
|
1272
|
+
display: none;
|
|
1273
|
+
}
|
|
1274
|
+
}
|
package/src/strings.js
CHANGED
|
@@ -22,6 +22,7 @@ export const en = {
|
|
|
22
22
|
"kit.menu": "Menu",
|
|
23
23
|
"kit.scope": "Scope",
|
|
24
24
|
"kit.search.ph": "Search…",
|
|
25
|
+
"kit.account.local": "Local",
|
|
25
26
|
"kit.search.label": "Search",
|
|
26
27
|
"kit.bell": "Notifications",
|
|
27
28
|
"kit.bell.n": "Notifications: {n} unread",
|
|
@@ -179,6 +180,7 @@ export const es = {
|
|
|
179
180
|
"kit.menu": "Menú",
|
|
180
181
|
"kit.scope": "Ámbito",
|
|
181
182
|
"kit.search.ph": "Buscar…",
|
|
183
|
+
"kit.account.local": "Local",
|
|
182
184
|
"kit.search.label": "Buscar",
|
|
183
185
|
"kit.bell": "Notificaciones",
|
|
184
186
|
"kit.bell.n": "Notificaciones: {n} sin leer",
|
|
@@ -340,6 +342,7 @@ export const ja = {
|
|
|
340
342
|
"kit.menu": "メニュー",
|
|
341
343
|
"kit.scope": "スコープ",
|
|
342
344
|
"kit.search.ph": "検索…",
|
|
345
|
+
"kit.account.local": "ローカル",
|
|
343
346
|
"kit.search.label": "検索",
|
|
344
347
|
"kit.bell": "通知",
|
|
345
348
|
"kit.bell.n": "通知: 未読 {n} 件",
|
package/src/version.js
CHANGED
|
@@ -20,7 +20,11 @@ export function setVersion(label, root = document) {
|
|
|
20
20
|
? root.getElementById("version-pill")
|
|
21
21
|
: root.querySelector("#version-pill");
|
|
22
22
|
const txt = el?.querySelector(".v-txt");
|
|
23
|
-
if (txt && label)
|
|
23
|
+
if (txt && label) {
|
|
24
|
+
txt.textContent = label;
|
|
25
|
+
// The whole version, when the bar is short and the text ends in "…".
|
|
26
|
+
txt.title = label;
|
|
27
|
+
}
|
|
24
28
|
}
|
|
25
29
|
|
|
26
30
|
export function setUnread(on, root = document) {
|