@yuneta/gobj-ui 7.23.87 → 7.23.88
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 +10 -0
- package/dist/gobj-ui.cjs.js +28 -19
- package/dist/gobj-ui.es.js +28 -19
- package/package.json +1 -1
- package/src/c_yui_treedb_graph.js +69 -35
package/README.md
CHANGED
|
@@ -1529,6 +1529,16 @@ forwards them as `EV_SET_HIDDEN_TOPICS`, `EV_SET_MAIN_TOPIC`,
|
|
|
1529
1529
|
`main topic`, `highlight topic`, `loose records`, `hidden topics`; `legend`
|
|
1530
1530
|
is no longer used.
|
|
1531
1531
|
|
|
1532
|
+
**The main topic's chip is not a disabled button** (`7.23.88`): it cannot be
|
|
1533
|
+
hidden, so its body is a `div` wearing the `.button` skin — bold, at full
|
|
1534
|
+
strength, with a gold star — and not a toggle painted at Bulma's half
|
|
1535
|
+
opacity, which is what made the trunk of the tree the weakest chip of the
|
|
1536
|
+
strip. The star takes `--bulma-warning-on-scheme` and not `--bulma-warning`:
|
|
1537
|
+
the raw brand gold is 1.75:1 on a light ground. The count dropped
|
|
1538
|
+
`has-text-grey` (3.86:1 in dark) for the chip's own colour at 80%, and the
|
|
1539
|
+
chips dropped `is-small`: the strip scrolls sideways, so it never had to fit
|
|
1540
|
+
a chip per topic on one row.
|
|
1541
|
+
|
|
1532
1542
|
**The strip is repainted on a language change** (`7.23.84`): its chips are
|
|
1533
1543
|
drawn on `EV_LEGEND_STATE`, which arrives after a reconcile and not when the
|
|
1534
1544
|
language changes, and a chip's title says an ACTION that depends on the
|
package/dist/gobj-ui.cjs.js
CHANGED
|
@@ -61960,7 +61960,7 @@ function build_ui$3(gobj) {
|
|
|
61960
61960
|
"div",
|
|
61961
61961
|
{
|
|
61962
61962
|
class: "GRAPH_LEGEND is-flex-grow-0",
|
|
61963
|
-
style: "display:flex; flex-wrap:nowrap; align-items:center; gap:.35rem; padding:.3rem .5rem; overflow-x:auto; min-height:2.
|
|
61963
|
+
style: "display:flex; flex-wrap:nowrap; align-items:center; gap:.35rem; padding:.3rem .5rem; overflow-x:auto; min-height:2.9rem;"
|
|
61964
61964
|
},
|
|
61965
61965
|
[]
|
|
61966
61966
|
],
|
|
@@ -63276,7 +63276,9 @@ function ac_set_operation_mode(gobj, event, kw, src) {
|
|
|
63276
63276
|
************************************************************/
|
|
63277
63277
|
var LEGEND_GLYPH_STYLE = `font-size:${YUI_TOOLBAR_ICON_SIZE}; line-height:1; color:inherit;`;
|
|
63278
63278
|
var LEGEND_NAME_STYLE = "font-size:1rem; line-height:1.2;";
|
|
63279
|
-
var LEGEND_COUNT_STYLE = "margin-left:.4rem; font-size:.875rem;";
|
|
63279
|
+
var LEGEND_COUNT_STYLE = "margin-left:.4rem; font-size:.875rem; opacity:.8;";
|
|
63280
|
+
var LEGEND_MAIN_NAME_STYLE = "font-size:1rem; line-height:1.2; font-weight:700;";
|
|
63281
|
+
var LEGEND_STAR_MAIN_STYLE = LEGEND_GLYPH_STYLE + " color:var(--bulma-warning-on-scheme, var(--bulma-warning, #ffdd57));";
|
|
63280
63282
|
function refresh_legend(gobj) {
|
|
63281
63283
|
let priv = gobj.priv;
|
|
63282
63284
|
let $container = (0, _yuneta_gobj_js.gobj_read_attr)(gobj, "$container");
|
|
@@ -63302,20 +63304,20 @@ function refresh_legend(gobj) {
|
|
|
63302
63304
|
"span",
|
|
63303
63305
|
{
|
|
63304
63306
|
class: "GRAPH_LEGEND_NAME",
|
|
63305
|
-
style: LEGEND_NAME_STYLE + (hidden ? " text-decoration:line-through; opacity:.6;" : "")
|
|
63307
|
+
style: (is_main ? LEGEND_MAIN_NAME_STYLE : LEGEND_NAME_STYLE) + (hidden ? " text-decoration:line-through; opacity:.6;" : "")
|
|
63306
63308
|
},
|
|
63307
63309
|
topic_name
|
|
63308
63310
|
], [
|
|
63309
63311
|
"span",
|
|
63310
63312
|
{
|
|
63311
|
-
class: "GRAPH_LEGEND_COUNT
|
|
63313
|
+
class: "GRAPH_LEGEND_COUNT",
|
|
63312
63314
|
style: LEGEND_COUNT_STYLE
|
|
63313
63315
|
},
|
|
63314
63316
|
hidden ? `${entry.total}` : `${entry.visible}/${entry.total}`
|
|
63315
63317
|
]);
|
|
63316
63318
|
let body_key = is_main ? "main topic" : hidden ? "show topic" : "hide topic";
|
|
63317
63319
|
let body_attrs = {
|
|
63318
|
-
class: "GRAPH_LEGEND_ITEM button
|
|
63320
|
+
class: "GRAPH_LEGEND_ITEM button" + (focused ? " GRAPH_LEGEND_FOCUSED" : "") + (is_main ? " GRAPH_LEGEND_MAIN" : ""),
|
|
63319
63321
|
type: "button",
|
|
63320
63322
|
style: "gap:0; flex:0 0 auto;" + (focused ? " box-shadow: inset 0 0 0 2px var(--bulma-text, #2e333d);" : ""),
|
|
63321
63323
|
title: (0, i18next.t)(body_key),
|
|
@@ -63323,8 +63325,15 @@ function refresh_legend(gobj) {
|
|
|
63323
63325
|
"aria-label": topic_name,
|
|
63324
63326
|
"aria-pressed": hidden ? "false" : "true"
|
|
63325
63327
|
};
|
|
63326
|
-
|
|
63327
|
-
|
|
63328
|
+
let $body;
|
|
63329
|
+
if (is_main) {
|
|
63330
|
+
delete body_attrs["aria-pressed"];
|
|
63331
|
+
$body = (0, _yuneta_gobj_js.createElement2)([
|
|
63332
|
+
"div",
|
|
63333
|
+
body_attrs,
|
|
63334
|
+
controls
|
|
63335
|
+
]);
|
|
63336
|
+
} else $body = (0, _yuneta_gobj_js.createElement2)([
|
|
63328
63337
|
"button",
|
|
63329
63338
|
body_attrs,
|
|
63330
63339
|
controls,
|
|
@@ -63340,9 +63349,9 @@ function refresh_legend(gobj) {
|
|
|
63340
63349
|
if (is_main && state.main_chosen) extras.push([
|
|
63341
63350
|
"button",
|
|
63342
63351
|
{
|
|
63343
|
-
class: "GRAPH_LEGEND_STAR button
|
|
63352
|
+
class: "GRAPH_LEGEND_STAR button pressed_state",
|
|
63344
63353
|
type: "button",
|
|
63345
|
-
style: "padding:0 .
|
|
63354
|
+
style: "padding:0 .5rem;",
|
|
63346
63355
|
title: (0, i18next.t)("main topic"),
|
|
63347
63356
|
"data-i18n-title": "main topic",
|
|
63348
63357
|
"aria-label": (0, i18next.t)("main topic"),
|
|
@@ -63351,7 +63360,7 @@ function refresh_legend(gobj) {
|
|
|
63351
63360
|
},
|
|
63352
63361
|
[[
|
|
63353
63362
|
"span",
|
|
63354
|
-
{ style:
|
|
63363
|
+
{ style: LEGEND_STAR_MAIN_STYLE },
|
|
63355
63364
|
"★"
|
|
63356
63365
|
]],
|
|
63357
63366
|
{ click: (evt) => {
|
|
@@ -63365,23 +63374,23 @@ function refresh_legend(gobj) {
|
|
|
63365
63374
|
else if (is_main) extras.push([
|
|
63366
63375
|
"span",
|
|
63367
63376
|
{
|
|
63368
|
-
class: "GRAPH_LEGEND_STAR button
|
|
63369
|
-
style: "padding:0 .
|
|
63377
|
+
class: "GRAPH_LEGEND_STAR button",
|
|
63378
|
+
style: "padding:0 .5rem; cursor:default;",
|
|
63370
63379
|
title: (0, i18next.t)("main topic"),
|
|
63371
63380
|
"data-i18n-title": "main topic"
|
|
63372
63381
|
},
|
|
63373
63382
|
[[
|
|
63374
63383
|
"span",
|
|
63375
|
-
{ style:
|
|
63384
|
+
{ style: LEGEND_STAR_MAIN_STYLE },
|
|
63376
63385
|
"★"
|
|
63377
63386
|
]]
|
|
63378
63387
|
]);
|
|
63379
63388
|
else if (!hidden) extras.push([
|
|
63380
63389
|
"button",
|
|
63381
63390
|
{
|
|
63382
|
-
class: "GRAPH_LEGEND_STAR button
|
|
63391
|
+
class: "GRAPH_LEGEND_STAR button",
|
|
63383
63392
|
type: "button",
|
|
63384
|
-
style: "padding:0 .
|
|
63393
|
+
style: "padding:0 .5rem;",
|
|
63385
63394
|
title: (0, i18next.t)("main topic"),
|
|
63386
63395
|
"data-i18n-title": "main topic",
|
|
63387
63396
|
"aria-label": (0, i18next.t)("main topic"),
|
|
@@ -63403,9 +63412,9 @@ function refresh_legend(gobj) {
|
|
|
63403
63412
|
if (!hidden && entry.linked && entry.loose > 0) extras.push([
|
|
63404
63413
|
"button",
|
|
63405
63414
|
{
|
|
63406
|
-
class: "GRAPH_LEGEND_LOOSE button
|
|
63415
|
+
class: "GRAPH_LEGEND_LOOSE button" + (entry.loose_shown ? " pressed_state" : ""),
|
|
63407
63416
|
type: "button",
|
|
63408
|
-
style: "padding:0 .
|
|
63417
|
+
style: "padding:0 .55rem;",
|
|
63409
63418
|
title: (0, i18next.t)("loose records"),
|
|
63410
63419
|
"data-i18n-title": "loose records",
|
|
63411
63420
|
"aria-label": (0, i18next.t)("loose records"),
|
|
@@ -63424,9 +63433,9 @@ function refresh_legend(gobj) {
|
|
|
63424
63433
|
if (!hidden) extras.push([
|
|
63425
63434
|
"button",
|
|
63426
63435
|
{
|
|
63427
|
-
class: "GRAPH_LEGEND_FOCUS button
|
|
63436
|
+
class: "GRAPH_LEGEND_FOCUS button" + (focused ? " pressed_state" : ""),
|
|
63428
63437
|
type: "button",
|
|
63429
|
-
style: "padding:0 .
|
|
63438
|
+
style: "padding:0 .5rem;",
|
|
63430
63439
|
title: (0, i18next.t)("highlight topic"),
|
|
63431
63440
|
"data-i18n-title": "highlight topic",
|
|
63432
63441
|
"aria-label": (0, i18next.t)("highlight topic"),
|
package/dist/gobj-ui.es.js
CHANGED
|
@@ -61955,7 +61955,7 @@ function build_ui$3(gobj) {
|
|
|
61955
61955
|
"div",
|
|
61956
61956
|
{
|
|
61957
61957
|
class: "GRAPH_LEGEND is-flex-grow-0",
|
|
61958
|
-
style: "display:flex; flex-wrap:nowrap; align-items:center; gap:.35rem; padding:.3rem .5rem; overflow-x:auto; min-height:2.
|
|
61958
|
+
style: "display:flex; flex-wrap:nowrap; align-items:center; gap:.35rem; padding:.3rem .5rem; overflow-x:auto; min-height:2.9rem;"
|
|
61959
61959
|
},
|
|
61960
61960
|
[]
|
|
61961
61961
|
],
|
|
@@ -63271,7 +63271,9 @@ function ac_set_operation_mode(gobj, event, kw, src) {
|
|
|
63271
63271
|
************************************************************/
|
|
63272
63272
|
var LEGEND_GLYPH_STYLE = `font-size:${YUI_TOOLBAR_ICON_SIZE}; line-height:1; color:inherit;`;
|
|
63273
63273
|
var LEGEND_NAME_STYLE = "font-size:1rem; line-height:1.2;";
|
|
63274
|
-
var LEGEND_COUNT_STYLE = "margin-left:.4rem; font-size:.875rem;";
|
|
63274
|
+
var LEGEND_COUNT_STYLE = "margin-left:.4rem; font-size:.875rem; opacity:.8;";
|
|
63275
|
+
var LEGEND_MAIN_NAME_STYLE = "font-size:1rem; line-height:1.2; font-weight:700;";
|
|
63276
|
+
var LEGEND_STAR_MAIN_STYLE = LEGEND_GLYPH_STYLE + " color:var(--bulma-warning-on-scheme, var(--bulma-warning, #ffdd57));";
|
|
63275
63277
|
function refresh_legend(gobj) {
|
|
63276
63278
|
let priv = gobj.priv;
|
|
63277
63279
|
let $container = gobj_read_attr(gobj, "$container");
|
|
@@ -63297,20 +63299,20 @@ function refresh_legend(gobj) {
|
|
|
63297
63299
|
"span",
|
|
63298
63300
|
{
|
|
63299
63301
|
class: "GRAPH_LEGEND_NAME",
|
|
63300
|
-
style: LEGEND_NAME_STYLE + (hidden ? " text-decoration:line-through; opacity:.6;" : "")
|
|
63302
|
+
style: (is_main ? LEGEND_MAIN_NAME_STYLE : LEGEND_NAME_STYLE) + (hidden ? " text-decoration:line-through; opacity:.6;" : "")
|
|
63301
63303
|
},
|
|
63302
63304
|
topic_name
|
|
63303
63305
|
], [
|
|
63304
63306
|
"span",
|
|
63305
63307
|
{
|
|
63306
|
-
class: "GRAPH_LEGEND_COUNT
|
|
63308
|
+
class: "GRAPH_LEGEND_COUNT",
|
|
63307
63309
|
style: LEGEND_COUNT_STYLE
|
|
63308
63310
|
},
|
|
63309
63311
|
hidden ? `${entry.total}` : `${entry.visible}/${entry.total}`
|
|
63310
63312
|
]);
|
|
63311
63313
|
let body_key = is_main ? "main topic" : hidden ? "show topic" : "hide topic";
|
|
63312
63314
|
let body_attrs = {
|
|
63313
|
-
class: "GRAPH_LEGEND_ITEM button
|
|
63315
|
+
class: "GRAPH_LEGEND_ITEM button" + (focused ? " GRAPH_LEGEND_FOCUSED" : "") + (is_main ? " GRAPH_LEGEND_MAIN" : ""),
|
|
63314
63316
|
type: "button",
|
|
63315
63317
|
style: "gap:0; flex:0 0 auto;" + (focused ? " box-shadow: inset 0 0 0 2px var(--bulma-text, #2e333d);" : ""),
|
|
63316
63318
|
title: t(body_key),
|
|
@@ -63318,8 +63320,15 @@ function refresh_legend(gobj) {
|
|
|
63318
63320
|
"aria-label": topic_name,
|
|
63319
63321
|
"aria-pressed": hidden ? "false" : "true"
|
|
63320
63322
|
};
|
|
63321
|
-
|
|
63322
|
-
|
|
63323
|
+
let $body;
|
|
63324
|
+
if (is_main) {
|
|
63325
|
+
delete body_attrs["aria-pressed"];
|
|
63326
|
+
$body = createElement2([
|
|
63327
|
+
"div",
|
|
63328
|
+
body_attrs,
|
|
63329
|
+
controls
|
|
63330
|
+
]);
|
|
63331
|
+
} else $body = createElement2([
|
|
63323
63332
|
"button",
|
|
63324
63333
|
body_attrs,
|
|
63325
63334
|
controls,
|
|
@@ -63335,9 +63344,9 @@ function refresh_legend(gobj) {
|
|
|
63335
63344
|
if (is_main && state.main_chosen) extras.push([
|
|
63336
63345
|
"button",
|
|
63337
63346
|
{
|
|
63338
|
-
class: "GRAPH_LEGEND_STAR button
|
|
63347
|
+
class: "GRAPH_LEGEND_STAR button pressed_state",
|
|
63339
63348
|
type: "button",
|
|
63340
|
-
style: "padding:0 .
|
|
63349
|
+
style: "padding:0 .5rem;",
|
|
63341
63350
|
title: t("main topic"),
|
|
63342
63351
|
"data-i18n-title": "main topic",
|
|
63343
63352
|
"aria-label": t("main topic"),
|
|
@@ -63346,7 +63355,7 @@ function refresh_legend(gobj) {
|
|
|
63346
63355
|
},
|
|
63347
63356
|
[[
|
|
63348
63357
|
"span",
|
|
63349
|
-
{ style:
|
|
63358
|
+
{ style: LEGEND_STAR_MAIN_STYLE },
|
|
63350
63359
|
"★"
|
|
63351
63360
|
]],
|
|
63352
63361
|
{ click: (evt) => {
|
|
@@ -63360,23 +63369,23 @@ function refresh_legend(gobj) {
|
|
|
63360
63369
|
else if (is_main) extras.push([
|
|
63361
63370
|
"span",
|
|
63362
63371
|
{
|
|
63363
|
-
class: "GRAPH_LEGEND_STAR button
|
|
63364
|
-
style: "padding:0 .
|
|
63372
|
+
class: "GRAPH_LEGEND_STAR button",
|
|
63373
|
+
style: "padding:0 .5rem; cursor:default;",
|
|
63365
63374
|
title: t("main topic"),
|
|
63366
63375
|
"data-i18n-title": "main topic"
|
|
63367
63376
|
},
|
|
63368
63377
|
[[
|
|
63369
63378
|
"span",
|
|
63370
|
-
{ style:
|
|
63379
|
+
{ style: LEGEND_STAR_MAIN_STYLE },
|
|
63371
63380
|
"★"
|
|
63372
63381
|
]]
|
|
63373
63382
|
]);
|
|
63374
63383
|
else if (!hidden) extras.push([
|
|
63375
63384
|
"button",
|
|
63376
63385
|
{
|
|
63377
|
-
class: "GRAPH_LEGEND_STAR button
|
|
63386
|
+
class: "GRAPH_LEGEND_STAR button",
|
|
63378
63387
|
type: "button",
|
|
63379
|
-
style: "padding:0 .
|
|
63388
|
+
style: "padding:0 .5rem;",
|
|
63380
63389
|
title: t("main topic"),
|
|
63381
63390
|
"data-i18n-title": "main topic",
|
|
63382
63391
|
"aria-label": t("main topic"),
|
|
@@ -63398,9 +63407,9 @@ function refresh_legend(gobj) {
|
|
|
63398
63407
|
if (!hidden && entry.linked && entry.loose > 0) extras.push([
|
|
63399
63408
|
"button",
|
|
63400
63409
|
{
|
|
63401
|
-
class: "GRAPH_LEGEND_LOOSE button
|
|
63410
|
+
class: "GRAPH_LEGEND_LOOSE button" + (entry.loose_shown ? " pressed_state" : ""),
|
|
63402
63411
|
type: "button",
|
|
63403
|
-
style: "padding:0 .
|
|
63412
|
+
style: "padding:0 .55rem;",
|
|
63404
63413
|
title: t("loose records"),
|
|
63405
63414
|
"data-i18n-title": "loose records",
|
|
63406
63415
|
"aria-label": t("loose records"),
|
|
@@ -63419,9 +63428,9 @@ function refresh_legend(gobj) {
|
|
|
63419
63428
|
if (!hidden) extras.push([
|
|
63420
63429
|
"button",
|
|
63421
63430
|
{
|
|
63422
|
-
class: "GRAPH_LEGEND_FOCUS button
|
|
63431
|
+
class: "GRAPH_LEGEND_FOCUS button" + (focused ? " pressed_state" : ""),
|
|
63423
63432
|
type: "button",
|
|
63424
|
-
style: "padding:0 .
|
|
63433
|
+
style: "padding:0 .5rem;",
|
|
63425
63434
|
title: t("highlight topic"),
|
|
63426
63435
|
"data-i18n-title": "highlight topic",
|
|
63427
63436
|
"aria-label": t("highlight topic"),
|
package/package.json
CHANGED
|
@@ -403,7 +403,7 @@ function build_ui(gobj)
|
|
|
403
403
|
['div', {class: 'GRAPH_LEGEND is-flex-grow-0',
|
|
404
404
|
style: 'display:flex; flex-wrap:nowrap; align-items:center; ' +
|
|
405
405
|
'gap:.35rem; padding:.3rem .5rem; overflow-x:auto; ' +
|
|
406
|
-
'min-height:2.
|
|
406
|
+
'min-height:2.9rem;'}, []],
|
|
407
407
|
['div', {class: `GRAPH_BODY is-flex-grow-1 ${padding}`, style: 'height:100%; min-height:0; overflow:hidden;'}, [
|
|
408
408
|
['div', {id: priv.canvas_id, class: `GRAPH_CANVAS graph-container`, style: 'height:100%; min-height:0;border: 1px solid var(--bulma-border-weak);border-radius:0.2rem;'}, [
|
|
409
409
|
]]
|
|
@@ -2455,19 +2455,41 @@ function ac_set_operation_mode(gobj, event, kw, src)
|
|
|
2455
2455
|
* into the URL, so what you are looking at stays linkable.
|
|
2456
2456
|
************************************************************/
|
|
2457
2457
|
/* The legend is the strip UNDER the toolbar, and the two are read as
|
|
2458
|
-
* one thing:
|
|
2459
|
-
*
|
|
2460
|
-
*
|
|
2461
|
-
*
|
|
2462
|
-
*
|
|
2463
|
-
* sets. In `em` they were 18px and 14.4px against the toolbar's 24px
|
|
2464
|
-
* and 16px: three sizes in two strips.
|
|
2458
|
+
* one thing: it is a layer CONTROL, so it is built at the toolbar's
|
|
2459
|
+
* size and not one step under it. `is-small` was kept for its
|
|
2460
|
+
* padding, on the argument that a chip per topic has to fit on one
|
|
2461
|
+
* row -- and the strip SCROLLS sideways (`overflow-x:auto`), so it
|
|
2462
|
+
* never had to fit anything. It is gone.
|
|
2465
2463
|
*
|
|
2466
2464
|
* The count is the one deliberate step down: it is the number beside
|
|
2467
|
-
* the name, not the name.
|
|
2465
|
+
* the name, not the name. `has-text-grey` is what it used to wear,
|
|
2466
|
+
* and Bulma's grey on the dark scheme is 3.86:1 -- under the 4.5 that
|
|
2467
|
+
* small text needs, which is why it read as a smudge. It takes the
|
|
2468
|
+
* chip's own colour at 80%: 12:1 in dark, 10:1 in light, and still
|
|
2469
|
+
* visibly secondary. */
|
|
2468
2470
|
const LEGEND_GLYPH_STYLE = `font-size:${YUI_TOOLBAR_ICON_SIZE}; line-height:1; color:inherit;`;
|
|
2469
2471
|
const LEGEND_NAME_STYLE = 'font-size:1rem; line-height:1.2;';
|
|
2470
|
-
const LEGEND_COUNT_STYLE = 'margin-left:.4rem; font-size:.875rem;';
|
|
2472
|
+
const LEGEND_COUNT_STYLE = 'margin-left:.4rem; font-size:.875rem; opacity:.8;';
|
|
2473
|
+
|
|
2474
|
+
/* The MAIN topic is the trunk the whole tree hangs from, and it was
|
|
2475
|
+
* the one chip drawn as unavailable: its body was a `<button
|
|
2476
|
+
* disabled>` (because it cannot be hidden) and Bulma paints that at
|
|
2477
|
+
* half opacity, with its star a grey `span` beside four bright ones.
|
|
2478
|
+
* The most important chip of the strip read as the dead one.
|
|
2479
|
+
*
|
|
2480
|
+
* It is not a button any more -- a control that does nothing should
|
|
2481
|
+
* not look like a control that is broken. It is a `div` wearing the
|
|
2482
|
+
* same `.button` skin, at full strength, with the name in bold and
|
|
2483
|
+
* the star in gold. */
|
|
2484
|
+
const LEGEND_MAIN_NAME_STYLE = LEGEND_NAME_STYLE + ' font-weight:700;';
|
|
2485
|
+
/* `--bulma-warning-on-scheme` and NOT `--bulma-warning`: the raw
|
|
2486
|
+
* brand colour is the same bright gold in both schemes, which is
|
|
2487
|
+
* 10.4:1 on the dark ground and **1.75:1** on the light one -- a
|
|
2488
|
+
* star nobody could see in daylight. The `-on-scheme` variant is
|
|
2489
|
+
* what Bulma keeps for a brand colour used as INK: the same hue,
|
|
2490
|
+
* darkened to 23% lightness when the scheme is light. */
|
|
2491
|
+
const LEGEND_STAR_MAIN_STYLE = LEGEND_GLYPH_STYLE +
|
|
2492
|
+
' color:var(--bulma-warning-on-scheme, var(--bulma-warning, #ffdd57));';
|
|
2471
2493
|
|
|
2472
2494
|
/* The focused chip is HIGHLIGHTED, not pressed. The body of a chip is
|
|
2473
2495
|
* the show/hide toggle, and that is what its `aria-pressed` says;
|
|
@@ -2531,10 +2553,10 @@ function refresh_legend(gobj)
|
|
|
2531
2553
|
`border:1px solid rgba(0,0,0,.25);` +
|
|
2532
2554
|
(hidden? 'opacity:.35;' : '')}],
|
|
2533
2555
|
['span', {class: 'GRAPH_LEGEND_NAME',
|
|
2534
|
-
style: LEGEND_NAME_STYLE +
|
|
2556
|
+
style: (is_main? LEGEND_MAIN_NAME_STYLE : LEGEND_NAME_STYLE) +
|
|
2535
2557
|
(hidden? ' text-decoration:line-through; opacity:.6;' : '')},
|
|
2536
2558
|
topic_name],
|
|
2537
|
-
['span', {class: 'GRAPH_LEGEND_COUNT
|
|
2559
|
+
['span', {class: 'GRAPH_LEGEND_COUNT',
|
|
2538
2560
|
style: LEGEND_COUNT_STYLE},
|
|
2539
2561
|
hidden? `${entry.total}` : `${entry.visible}/${entry.total}`]
|
|
2540
2562
|
);
|
|
@@ -2546,7 +2568,7 @@ function refresh_legend(gobj)
|
|
|
2546
2568
|
* and a `disabled="undefined"` button is a disabled button --
|
|
2547
2569
|
* every chip was dead except its star. */
|
|
2548
2570
|
let body_attrs = {
|
|
2549
|
-
class: 'GRAPH_LEGEND_ITEM button
|
|
2571
|
+
class: 'GRAPH_LEGEND_ITEM button' +
|
|
2550
2572
|
(focused? ' GRAPH_LEGEND_FOCUSED' : '') +
|
|
2551
2573
|
(is_main? ' GRAPH_LEGEND_MAIN' : ''),
|
|
2552
2574
|
type: 'button',
|
|
@@ -2562,18 +2584,26 @@ function refresh_legend(gobj)
|
|
|
2562
2584
|
'aria-label': topic_name,
|
|
2563
2585
|
'aria-pressed': hidden? 'false' : 'true',
|
|
2564
2586
|
};
|
|
2587
|
+
/* The main topic cannot be hidden, so its body is not a toggle
|
|
2588
|
+
* and must not be drawn as one that is broken: a `div` with the
|
|
2589
|
+
* same `.button` skin, at full strength. `disabled` on a button
|
|
2590
|
+
* is Bulma's half opacity, which put the trunk of the tree in
|
|
2591
|
+
* the strip's weakest chip. */
|
|
2592
|
+
let $body;
|
|
2565
2593
|
if(is_main) {
|
|
2566
|
-
body_attrs
|
|
2594
|
+
delete body_attrs['aria-pressed'];
|
|
2595
|
+
$body = createElement2(['div', body_attrs, controls]);
|
|
2596
|
+
} else {
|
|
2597
|
+
$body = createElement2(
|
|
2598
|
+
['button', body_attrs, controls, {
|
|
2599
|
+
click: (evt) => {
|
|
2600
|
+
evt.stopPropagation();
|
|
2601
|
+
gobj_send_event(gobj, "EV_LEGEND_TOPIC",
|
|
2602
|
+
{topic: topic_name, action: "toggle"}, gobj);
|
|
2603
|
+
}
|
|
2604
|
+
}]
|
|
2605
|
+
);
|
|
2567
2606
|
}
|
|
2568
|
-
let $body = createElement2(
|
|
2569
|
-
['button', body_attrs, controls, {
|
|
2570
|
-
click: (evt) => {
|
|
2571
|
-
evt.stopPropagation();
|
|
2572
|
-
gobj_send_event(gobj, "EV_LEGEND_TOPIC",
|
|
2573
|
-
{topic: topic_name, action: "toggle"}, gobj);
|
|
2574
|
-
}
|
|
2575
|
-
}]
|
|
2576
|
-
);
|
|
2577
2607
|
|
|
2578
2608
|
let extras = [];
|
|
2579
2609
|
|
|
@@ -2582,13 +2612,13 @@ function refresh_legend(gobj)
|
|
|
2582
2612
|
* is a button too: pressing it hands the choice back to the
|
|
2583
2613
|
* graph (deduced again). On a deduced one it is a mark. */
|
|
2584
2614
|
if(is_main && state.main_chosen) {
|
|
2585
|
-
extras.push(['button', {class: 'GRAPH_LEGEND_STAR button
|
|
2586
|
-
type: 'button', style: 'padding:0 .
|
|
2615
|
+
extras.push(['button', {class: 'GRAPH_LEGEND_STAR button pressed_state',
|
|
2616
|
+
type: 'button', style: 'padding:0 .5rem;',
|
|
2587
2617
|
title: t('main topic'), 'data-i18n-title': 'main topic',
|
|
2588
2618
|
'aria-label': t('main topic'),
|
|
2589
2619
|
'data-i18n-aria-label': 'main topic',
|
|
2590
2620
|
'aria-pressed': 'true'},
|
|
2591
|
-
[['span', {style:
|
|
2621
|
+
[['span', {style: LEGEND_STAR_MAIN_STYLE}, '★']], {
|
|
2592
2622
|
click: (evt) => {
|
|
2593
2623
|
evt.stopPropagation();
|
|
2594
2624
|
gobj_send_event(gobj, "EV_LEGEND_TOPIC",
|
|
@@ -2596,13 +2626,17 @@ function refresh_legend(gobj)
|
|
|
2596
2626
|
}
|
|
2597
2627
|
}]);
|
|
2598
2628
|
} else if(is_main) {
|
|
2599
|
-
|
|
2600
|
-
|
|
2629
|
+
/* Deduced, not chosen: a MARK and not a button. Gold and at
|
|
2630
|
+
* full strength all the same -- `is-static` painted it the
|
|
2631
|
+
* grey of something switched off, next to four bright
|
|
2632
|
+
* stars that only offer to become this one. */
|
|
2633
|
+
extras.push(['span', {class: 'GRAPH_LEGEND_STAR button',
|
|
2634
|
+
style: 'padding:0 .5rem; cursor:default;',
|
|
2601
2635
|
title: t('main topic'), 'data-i18n-title': 'main topic'},
|
|
2602
|
-
[['span', {style:
|
|
2636
|
+
[['span', {style: LEGEND_STAR_MAIN_STYLE}, '★']]]);
|
|
2603
2637
|
} else if(!hidden) {
|
|
2604
|
-
extras.push(['button', {class: 'GRAPH_LEGEND_STAR button
|
|
2605
|
-
type: 'button', style: 'padding:0 .
|
|
2638
|
+
extras.push(['button', {class: 'GRAPH_LEGEND_STAR button',
|
|
2639
|
+
type: 'button', style: 'padding:0 .5rem;',
|
|
2606
2640
|
title: t('main topic'), 'data-i18n-title': 'main topic',
|
|
2607
2641
|
'aria-label': t('main topic'),
|
|
2608
2642
|
'data-i18n-aria-label': 'main topic'},
|
|
@@ -2620,9 +2654,9 @@ function refresh_legend(gobj)
|
|
|
2620
2654
|
* the schema hangs from the main one. */
|
|
2621
2655
|
if(!hidden && entry.linked && entry.loose > 0) {
|
|
2622
2656
|
extras.push(['button', {
|
|
2623
|
-
class: 'GRAPH_LEGEND_LOOSE button
|
|
2657
|
+
class: 'GRAPH_LEGEND_LOOSE button' +
|
|
2624
2658
|
(entry.loose_shown? ' pressed_state' : ''),
|
|
2625
|
-
type: 'button', style: 'padding:0 .
|
|
2659
|
+
type: 'button', style: 'padding:0 .55rem;',
|
|
2626
2660
|
title: t('loose records'), 'data-i18n-title': 'loose records',
|
|
2627
2661
|
'aria-label': t('loose records'),
|
|
2628
2662
|
'data-i18n-aria-label': 'loose records',
|
|
@@ -2638,9 +2672,9 @@ function refresh_legend(gobj)
|
|
|
2638
2672
|
|
|
2639
2673
|
if(!hidden) {
|
|
2640
2674
|
extras.push(['button', {
|
|
2641
|
-
class: 'GRAPH_LEGEND_FOCUS button
|
|
2675
|
+
class: 'GRAPH_LEGEND_FOCUS button' +
|
|
2642
2676
|
(focused? ' pressed_state' : ''),
|
|
2643
|
-
type: 'button', style: 'padding:0 .
|
|
2677
|
+
type: 'button', style: 'padding:0 .5rem;',
|
|
2644
2678
|
title: t('highlight topic'), 'data-i18n-title': 'highlight topic',
|
|
2645
2679
|
'aria-label': t('highlight topic'),
|
|
2646
2680
|
'data-i18n-aria-label': 'highlight topic',
|