@yuneta/gobj-ui 7.26.5 → 7.26.7
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 +141 -25
- package/dist/gobj-ui.cjs.js +1358 -429
- package/dist/gobj-ui.es.js +1349 -430
- package/index.js +18 -2
- package/package.json +2 -2
- package/src/c_g6_nodes_tree.js +41 -0
- package/src/c_yui_form.js +287 -91
- package/src/c_yui_gclass.js +6 -2
- package/src/c_yui_gobj_tree_js.js +15 -4
- package/src/c_yui_json_graph.js +40 -13
- package/src/c_yui_map.js +115 -75
- package/src/c_yui_nav.js +53 -14
- package/src/c_yui_pager.js +14 -9
- package/src/c_yui_period.js +16 -6
- package/src/c_yui_shell.js +116 -30
- package/src/c_yui_treedb_topic_with_form.js +111 -46
- package/src/c_yui_treedb_topics.js +77 -7
- package/src/c_yui_uplot.js +1 -1
- package/src/c_yui_window.js +70 -24
- package/src/c_yui_window_manager.js +7 -3
- package/src/c_yui_wizard.js +23 -8
- package/src/delete_impact.js +5 -3
- package/src/form_json_field.js +116 -0
- package/src/form_json_field.test.js +43 -0
- package/src/form_json_field.wiring.test.js +137 -0
- package/src/lib_icons.js +395 -0
- package/src/lib_icons.test.js +214 -0
- package/src/schema_to_c.js +17 -1
- package/src/schema_to_c.test.js +7 -0
- package/src/shell_route_map.js +6 -0
- package/src/treedb_topics_transport.wiring.test.js +9 -1
- package/src/window_veto_back.wiring.test.js +101 -0
- package/src/wizard_chrome.wiring.test.js +87 -0
- package/src/yui_dev.js +10 -3
- package/src/yui_icons.css +20 -0
- package/src/yui_table_filter_clear.js +44 -44
- package/vite-plugin-yuneta-html.js +28 -6
package/dist/gobj-ui.es.js
CHANGED
|
@@ -1044,6 +1044,7 @@ function mt_stop$20(gobj) {
|
|
|
1044
1044
|
st.items = {};
|
|
1045
1045
|
st.active_route = null;
|
|
1046
1046
|
}
|
|
1047
|
+
gobj_stop_children(gobj);
|
|
1047
1048
|
}
|
|
1048
1049
|
/***************************************************************
|
|
1049
1050
|
* Framework Method: Destroy
|
|
@@ -1836,7 +1837,7 @@ function build_toolbar_action_item(gobj, it) {
|
|
|
1836
1837
|
btn_attrs["aria-haspopup"] = "menu";
|
|
1837
1838
|
btn_attrs["aria-expanded"] = "false";
|
|
1838
1839
|
}
|
|
1839
|
-
let tip = it.tooltip ||
|
|
1840
|
+
let tip = it.tooltip || i18n_aria;
|
|
1840
1841
|
if (tip) {
|
|
1841
1842
|
btn_attrs.title = tip;
|
|
1842
1843
|
btn_attrs["data-i18n-title"] = tip;
|
|
@@ -1889,6 +1890,11 @@ function build_toolbar_brand_item(gobj, it) {
|
|
|
1889
1890
|
Object.assign(attrs, link);
|
|
1890
1891
|
} else if (action_type === "") tag = "div";
|
|
1891
1892
|
else attrs.type = "button";
|
|
1893
|
+
let tip = it.tooltip || i18n_aria;
|
|
1894
|
+
if (tag !== "div" && tip) {
|
|
1895
|
+
attrs.title = tip;
|
|
1896
|
+
attrs["data-i18n-title"] = tip;
|
|
1897
|
+
}
|
|
1892
1898
|
let $item = createElement2([
|
|
1893
1899
|
tag,
|
|
1894
1900
|
attrs,
|
|
@@ -1933,7 +1939,7 @@ function build_toolbar_avatar_item(gobj, it) {
|
|
|
1933
1939
|
attrs["aria-haspopup"] = "menu";
|
|
1934
1940
|
attrs["aria-expanded"] = "false";
|
|
1935
1941
|
}
|
|
1936
|
-
let tip = it.tooltip ||
|
|
1942
|
+
let tip = it.tooltip || i18n_aria;
|
|
1937
1943
|
if (tip) {
|
|
1938
1944
|
attrs.title = tip;
|
|
1939
1945
|
attrs["data-i18n-title"] = tip;
|
|
@@ -2005,7 +2011,7 @@ function build_toolbar_connection_item(gobj, it) {
|
|
|
2005
2011
|
"aria-label": aria_key,
|
|
2006
2012
|
"data-i18n-aria-label": i18n_aria
|
|
2007
2013
|
};
|
|
2008
|
-
let tip = it.tooltip ||
|
|
2014
|
+
let tip = it.tooltip || i18n_aria;
|
|
2009
2015
|
if (tip) {
|
|
2010
2016
|
attrs.title = tip;
|
|
2011
2017
|
attrs["data-i18n-title"] = tip;
|
|
@@ -2138,6 +2144,11 @@ function open_toolbar_dropdown(gobj, item, action, $trigger) {
|
|
|
2138
2144
|
$panel.style.right = "auto";
|
|
2139
2145
|
$panel.style.left = `${Math.round(left)}px`;
|
|
2140
2146
|
}
|
|
2147
|
+
let max_h = window.innerHeight - Math.max(0, pos.top) - margin;
|
|
2148
|
+
if (max_h > 0) {
|
|
2149
|
+
$panel.style.maxHeight = `${Math.round(max_h)}px`;
|
|
2150
|
+
$panel.style.overflowY = "auto";
|
|
2151
|
+
}
|
|
2141
2152
|
yui_shell_translate(gobj, $panel);
|
|
2142
2153
|
let backdrop = (ev) => {
|
|
2143
2154
|
if ($panel.contains(ev.target)) return;
|
|
@@ -2145,7 +2156,10 @@ function open_toolbar_dropdown(gobj, item, action, $trigger) {
|
|
|
2145
2156
|
close_toolbar_dropdown(gobj);
|
|
2146
2157
|
};
|
|
2147
2158
|
document.addEventListener("mousedown", backdrop, true);
|
|
2148
|
-
let dismiss = () =>
|
|
2159
|
+
let dismiss = (ev) => {
|
|
2160
|
+
if (ev && ev.type === "scroll" && ev.target && ev.target !== document && $panel.contains(ev.target)) return;
|
|
2161
|
+
close_toolbar_dropdown(gobj);
|
|
2162
|
+
};
|
|
2149
2163
|
document.addEventListener("scroll", dismiss, {
|
|
2150
2164
|
capture: true,
|
|
2151
2165
|
passive: true
|
|
@@ -2244,7 +2258,11 @@ function build_dropdown_row(gobj, sub, idx) {
|
|
|
2244
2258
|
"data-dropdown-item-id": sub.id || "",
|
|
2245
2259
|
"aria-label": aria_key
|
|
2246
2260
|
};
|
|
2247
|
-
if (i18n_aria)
|
|
2261
|
+
if (i18n_aria) {
|
|
2262
|
+
attrs["data-i18n-aria-label"] = i18n_aria;
|
|
2263
|
+
attrs.title = i18n_aria;
|
|
2264
|
+
attrs["data-i18n-title"] = i18n_aria;
|
|
2265
|
+
}
|
|
2248
2266
|
let $btn = createElement2([
|
|
2249
2267
|
"button",
|
|
2250
2268
|
attrs,
|
|
@@ -2306,7 +2324,10 @@ function drawers(gobj, menu_id) {
|
|
|
2306
2324
|
************************************************************/
|
|
2307
2325
|
function push_escape(gobj, layer, handler) {
|
|
2308
2326
|
let priv = gobj.priv;
|
|
2309
|
-
if (!priv || !priv.escape_stack)
|
|
2327
|
+
if (!priv || !priv.escape_stack) {
|
|
2328
|
+
log_warning(`C_YUI_SHELL: push_escape('${layer}') on a shell that is gone: Escape will not close it`);
|
|
2329
|
+
return;
|
|
2330
|
+
}
|
|
2310
2331
|
priv.escape_stack.push({
|
|
2311
2332
|
layer,
|
|
2312
2333
|
handler
|
|
@@ -2362,9 +2383,10 @@ function pop_escape(gobj, handler) {
|
|
|
2362
2383
|
function drain_overlays(gobj) {
|
|
2363
2384
|
let priv = gobj.priv;
|
|
2364
2385
|
if (!priv || !priv.overlay_stack) return;
|
|
2386
|
+
let entries = priv.overlay_stack.splice(0);
|
|
2365
2387
|
let kept = [];
|
|
2366
|
-
while (
|
|
2367
|
-
let entry =
|
|
2388
|
+
while (entries.length > 0) {
|
|
2389
|
+
let entry = entries.pop();
|
|
2368
2390
|
if (entry.keep_on_navigate) {
|
|
2369
2391
|
kept.unshift(entry);
|
|
2370
2392
|
continue;
|
|
@@ -2375,7 +2397,7 @@ function drain_overlays(gobj) {
|
|
|
2375
2397
|
log_warning(`C_YUI_SHELL: overlay close on navigation failed: ${e}`);
|
|
2376
2398
|
}
|
|
2377
2399
|
}
|
|
2378
|
-
|
|
2400
|
+
priv.overlay_stack.unshift(...kept);
|
|
2379
2401
|
}
|
|
2380
2402
|
function retag_overlay_hash(gobj, st, hash) {
|
|
2381
2403
|
let priv = gobj.priv;
|
|
@@ -2514,7 +2536,10 @@ function update_secondary_nav_visibility(gobj, entry) {
|
|
|
2514
2536
|
************************************************************/
|
|
2515
2537
|
function ac_nav_clicked(gobj, event, kw, src) {
|
|
2516
2538
|
let route = kw && kw.route || "";
|
|
2517
|
-
if (empty_string(route))
|
|
2539
|
+
if (empty_string(route)) {
|
|
2540
|
+
log_warning(`C_YUI_SHELL: ${event} with no route, from ${gobj_short_name(src)}`);
|
|
2541
|
+
return -1;
|
|
2542
|
+
}
|
|
2518
2543
|
route = remembered_position(gobj, route);
|
|
2519
2544
|
if (gobj_read_attr(gobj, "use_hash") && !route_restores_url(gobj, route)) {
|
|
2520
2545
|
let target_hash = route_to_hash(route);
|
|
@@ -2552,17 +2577,19 @@ function ac_nav_item_close(gobj, event, kw, src) {
|
|
|
2552
2577
|
* FSM
|
|
2553
2578
|
***************************************************************/
|
|
2554
2579
|
/***************************************************************
|
|
2555
|
-
* EV_CONNECTION_STATE
|
|
2556
|
-
*
|
|
2557
|
-
* to EVERY event of its shell with one attr
|
|
2558
|
-
* ask for
|
|
2559
|
-
*
|
|
2560
|
-
* and adding
|
|
2561
|
-
*
|
|
2562
|
-
*
|
|
2580
|
+
* EV_CONNECTION_STATE and EV_ICONS_CHANGED are OPTIONAL facts: a
|
|
2581
|
+
* view that needs one subscribes to it by name. An app that
|
|
2582
|
+
* subscribed to EVERY event of its shell with one attr
|
|
2583
|
+
* (`subscriber`) did not ask for them and does not declare them --
|
|
2584
|
+
* published to it anyway, each would be an FSM error in the app
|
|
2585
|
+
* every time it fires, and adding one to the shell a breaking
|
|
2586
|
+
* change for every such app (7.26.6 did exactly that with
|
|
2587
|
+
* EV_ICONS_CHANGED). So they reach only the subscribers that
|
|
2588
|
+
* declare them. Every other event of the shell goes out as before.
|
|
2563
2589
|
***************************************************************/
|
|
2590
|
+
var OPTIONAL_EVENTS = /* @__PURE__ */ new Set(["EV_CONNECTION_STATE", "EV_ICONS_CHANGED"]);
|
|
2564
2591
|
function mt_publication_pre_filter(gobj, subs, event, kw) {
|
|
2565
|
-
if (event
|
|
2592
|
+
if (!OPTIONAL_EVENTS.has(event)) return 1;
|
|
2566
2593
|
let subscriber = subs && subs.subscriber;
|
|
2567
2594
|
if (!subscriber || !gobj_has_event(subscriber, event, 0)) return 0;
|
|
2568
2595
|
return 1;
|
|
@@ -2603,6 +2630,7 @@ function create_gclass$22(gclass_name) {
|
|
|
2603
2630
|
["EV_ROUTE_REQUESTED", event_flag_t.EVF_OUTPUT_EVENT | event_flag_t.EVF_PUBLIC_EVENT | event_flag_t.EVF_NO_WARN_SUBS],
|
|
2604
2631
|
["EV_ROUTE_CHANGED", event_flag_t.EVF_OUTPUT_EVENT | event_flag_t.EVF_PUBLIC_EVENT | event_flag_t.EVF_NO_WARN_SUBS],
|
|
2605
2632
|
["EV_LANGUAGE_CHANGED", event_flag_t.EVF_OUTPUT_EVENT | event_flag_t.EVF_PUBLIC_EVENT | event_flag_t.EVF_NO_WARN_SUBS],
|
|
2633
|
+
["EV_ICONS_CHANGED", event_flag_t.EVF_OUTPUT_EVENT | event_flag_t.EVF_PUBLIC_EVENT | event_flag_t.EVF_NO_WARN_SUBS],
|
|
2606
2634
|
["EV_CONNECTION_STATE", event_flag_t.EVF_OUTPUT_EVENT | event_flag_t.EVF_NO_WARN_SUBS]
|
|
2607
2635
|
];
|
|
2608
2636
|
__gclass__$22 = gclass_create(gclass_name, event_types, states, gmt$22, 0, attrs_table$22, PRIVATE_DATA$22, 0, 0, 0, gclass_flag_t.gcflag_no_check_output_events);
|
|
@@ -2893,7 +2921,7 @@ function yui_shell_set_translator(shell_gobj, t) {
|
|
|
2893
2921
|
*
|
|
2894
2922
|
* The division of labour, unchanged: LIBRARY-built DOM is
|
|
2895
2923
|
* translated through here; APP view gclasses translate their own
|
|
2896
|
-
* DOM (they own a `t` — see
|
|
2924
|
+
* DOM (they own a `t` — see build_view_gobj).
|
|
2897
2925
|
*
|
|
2898
2926
|
* Silent no-op with no shell or no translator: an app that never
|
|
2899
2927
|
* registered one keeps the previous behaviour instead of losing
|
|
@@ -2906,6 +2934,22 @@ function yui_shell_translate(shell_gobj, $el) {
|
|
|
2906
2934
|
refresh_language($el, priv.translator);
|
|
2907
2935
|
}
|
|
2908
2936
|
/************************************************************
|
|
2937
|
+
* The user icons changed (lib_icons.js: yui_icons_set_user,
|
|
2938
|
+
* yui_icons_put_user, yui_icons_remove_user): PUBLISH it, so
|
|
2939
|
+
* the views that decided at render time whether a name is an
|
|
2940
|
+
* icon draw it again.
|
|
2941
|
+
*
|
|
2942
|
+
* The registry is a module and knows no shell; the view that
|
|
2943
|
+
* fed it calls this.
|
|
2944
|
+
************************************************************/
|
|
2945
|
+
function yui_shell_icons_changed(shell_gobj) {
|
|
2946
|
+
if (!shell_gobj || !is_gobj(shell_gobj)) {
|
|
2947
|
+
log_error("yui_shell_icons_changed(): no shell");
|
|
2948
|
+
return;
|
|
2949
|
+
}
|
|
2950
|
+
gobj_publish_event(shell_gobj, "EV_ICONS_CHANGED", {});
|
|
2951
|
+
}
|
|
2952
|
+
/************************************************************
|
|
2909
2953
|
* Set the backend-connection state painted by every
|
|
2910
2954
|
* type:"connection" toolbar item. Host/event-driven: the
|
|
2911
2955
|
* app calls this from its transport handlers (EV_ON_OPEN →
|
|
@@ -3554,7 +3598,7 @@ function yui_shell_confirm_yesnocancel(shell, message, opts) {
|
|
|
3554
3598
|
*
|
|
3555
3599
|
* Window - position fixed
|
|
3556
3600
|
*
|
|
3557
|
-
* Copyright (c) 2025, ArtGins.
|
|
3601
|
+
* Copyright (c) 2025-2026, ArtGins.
|
|
3558
3602
|
* All Rights Reserved.
|
|
3559
3603
|
***********************************************************************/
|
|
3560
3604
|
/***************************************************************
|
|
@@ -3637,15 +3681,7 @@ function mt_create$21(gobj) {
|
|
|
3637
3681
|
title_prefix: gobj_read_str_attr(gobj, "title_prefix") || "",
|
|
3638
3682
|
icon: gobj_read_attr(gobj, "icon") || ""
|
|
3639
3683
|
}, gobj);
|
|
3640
|
-
} else if (gobj_read_bool_attr(gobj, "back_dismissable"))
|
|
3641
|
-
let shell = yui_shell_of(gobj);
|
|
3642
|
-
if (shell) {
|
|
3643
|
-
let overlay = yui_shell_register_overlay(shell, function() {
|
|
3644
|
-
close_window(gobj);
|
|
3645
|
-
}, { keep_on_navigate: gobj_read_bool_attr(gobj, "keep_on_navigate") });
|
|
3646
|
-
gobj_write_attr(gobj, "back_overlay", overlay);
|
|
3647
|
-
}
|
|
3648
|
-
}
|
|
3684
|
+
} else if (gobj_read_bool_attr(gobj, "back_dismissable")) register_back_overlay(gobj);
|
|
3649
3685
|
let on_win_resize = function() {
|
|
3650
3686
|
handleResize(gobj);
|
|
3651
3687
|
};
|
|
@@ -3765,7 +3801,7 @@ function build_default_header(gobj) {
|
|
|
3765
3801
|
if (!empty_string(prefix)) items.push([
|
|
3766
3802
|
"span",
|
|
3767
3803
|
{ class: "WINDOW_TITLE_PREFIX has-text-weight-semibold" },
|
|
3768
|
-
prefix
|
|
3804
|
+
document.createTextNode(String(prefix))
|
|
3769
3805
|
]);
|
|
3770
3806
|
if (!empty_string(title)) items.push([
|
|
3771
3807
|
"span",
|
|
@@ -3808,7 +3844,9 @@ function resolve_manager(gobj) {
|
|
|
3808
3844
|
let m = gobj_read_pointer_attr(gobj, "manager");
|
|
3809
3845
|
if (!m) return null;
|
|
3810
3846
|
if (typeof m === "string") {
|
|
3811
|
-
|
|
3847
|
+
let name = m;
|
|
3848
|
+
m = gobj_find_service(name, false) || null;
|
|
3849
|
+
if (!m) log_warning(`${GCLASS_NAME$21}: window manager '${name}' not found: no dock, no minimize`);
|
|
3812
3850
|
gobj_write_attr(gobj, "manager", m);
|
|
3813
3851
|
}
|
|
3814
3852
|
return m;
|
|
@@ -3918,6 +3956,8 @@ function build_ui$18(gobj) {
|
|
|
3918
3956
|
{
|
|
3919
3957
|
class: "WINDOW_MIN yui-wc wc-min",
|
|
3920
3958
|
type: "button",
|
|
3959
|
+
title: t("minimize"),
|
|
3960
|
+
"data-i18n-title": "minimize",
|
|
3921
3961
|
"aria-label": t("minimize"),
|
|
3922
3962
|
"data-i18n-aria-label": "minimize",
|
|
3923
3963
|
style: gobj_read_bool_attr(gobj, "showMin") && gobj_read_pointer_attr(gobj, "manager") ? "" : "display:none;"
|
|
@@ -3933,6 +3973,8 @@ function build_ui$18(gobj) {
|
|
|
3933
3973
|
{
|
|
3934
3974
|
class: "WINDOW_MAX yui-wc wc-max",
|
|
3935
3975
|
type: "button",
|
|
3976
|
+
title: t("maximize"),
|
|
3977
|
+
"data-i18n-title": "maximize",
|
|
3936
3978
|
"aria-label": t("maximize"),
|
|
3937
3979
|
"data-i18n-aria-label": "maximize",
|
|
3938
3980
|
style: gobj_read_bool_attr(gobj, "showMax") ? "" : "display:none;"
|
|
@@ -3948,13 +3990,15 @@ function build_ui$18(gobj) {
|
|
|
3948
3990
|
{
|
|
3949
3991
|
class: "WINDOW_CLOSE yui-wc wc-close",
|
|
3950
3992
|
type: "button",
|
|
3993
|
+
title: t("close"),
|
|
3994
|
+
"data-i18n-title": "close",
|
|
3951
3995
|
"aria-label": t("close"),
|
|
3952
3996
|
"data-i18n-aria-label": "close"
|
|
3953
3997
|
},
|
|
3954
3998
|
WC_CLOSE,
|
|
3955
3999
|
{ click: (evt) => {
|
|
3956
4000
|
evt.stopPropagation();
|
|
3957
|
-
|
|
4001
|
+
gobj_send_event(gobj, "EV_CLOSE_WINDOW", {}, gobj);
|
|
3958
4002
|
} }
|
|
3959
4003
|
]
|
|
3960
4004
|
]
|
|
@@ -4090,6 +4134,27 @@ function destroy_ui$13(gobj) {
|
|
|
4090
4134
|
}
|
|
4091
4135
|
}
|
|
4092
4136
|
/************************************************************
|
|
4137
|
+
* Register this floating window in the shell's overlay history,
|
|
4138
|
+
* so the browser Back closes it.
|
|
4139
|
+
*
|
|
4140
|
+
* The shell takes the entry off its stack BEFORE it calls the
|
|
4141
|
+
* close function (Back, or a route change draining overlays). When
|
|
4142
|
+
* a subscriber of EV_WINDOW_TO_CLOSE vetoes the close, the window
|
|
4143
|
+
* stays up with no entry: Back would no longer close it, and it
|
|
4144
|
+
* would float over the next views. So a window that survives its
|
|
4145
|
+
* own close function registers again.
|
|
4146
|
+
************************************************************/
|
|
4147
|
+
function register_back_overlay(gobj) {
|
|
4148
|
+
let shell = yui_shell_of(gobj);
|
|
4149
|
+
if (!shell) return;
|
|
4150
|
+
let overlay = yui_shell_register_overlay(shell, function() {
|
|
4151
|
+
gobj_write_attr(gobj, "back_overlay", null);
|
|
4152
|
+
close_window(gobj);
|
|
4153
|
+
if (!gobj_is_destroying(gobj) && !gobj_read_attr(gobj, "back_overlay")) register_back_overlay(gobj);
|
|
4154
|
+
}, { keep_on_navigate: gobj_read_bool_attr(gobj, "keep_on_navigate") });
|
|
4155
|
+
gobj_write_attr(gobj, "back_overlay", overlay);
|
|
4156
|
+
}
|
|
4157
|
+
/************************************************************
|
|
4093
4158
|
*
|
|
4094
4159
|
************************************************************/
|
|
4095
4160
|
function close_window(gobj) {
|
|
@@ -4107,12 +4172,12 @@ function close_window(gobj) {
|
|
|
4107
4172
|
no_label: "no",
|
|
4108
4173
|
cancel_label: "cancel"
|
|
4109
4174
|
}).then(function(answer) {
|
|
4110
|
-
if (answer
|
|
4111
|
-
|
|
4112
|
-
|
|
4113
|
-
|
|
4114
|
-
|
|
4115
|
-
|
|
4175
|
+
if (answer !== "yes") return;
|
|
4176
|
+
if (gobj_is_destroying(gobj)) return;
|
|
4177
|
+
if (on_close) on_close();
|
|
4178
|
+
if (gobj_is_running(gobj)) gobj_stop(gobj);
|
|
4179
|
+
gobj_stop_children(gobj);
|
|
4180
|
+
gobj_destroy(gobj);
|
|
4116
4181
|
});
|
|
4117
4182
|
}
|
|
4118
4183
|
/************************************************************
|
|
@@ -4147,8 +4212,12 @@ function set_max_icon(gobj, maximized) {
|
|
|
4147
4212
|
if (!$container) return;
|
|
4148
4213
|
let $btn = $container.querySelector(".wc-max");
|
|
4149
4214
|
if ($btn) {
|
|
4215
|
+
let key = maximized ? "restore" : "maximize";
|
|
4150
4216
|
$btn.innerHTML = maximized ? WC_RESTORE : WC_MAX;
|
|
4151
|
-
$btn.setAttribute("
|
|
4217
|
+
$btn.setAttribute("title", t(key));
|
|
4218
|
+
$btn.setAttribute("data-i18n-title", key);
|
|
4219
|
+
$btn.setAttribute("aria-label", t(key));
|
|
4220
|
+
$btn.setAttribute("data-i18n-aria-label", key);
|
|
4152
4221
|
}
|
|
4153
4222
|
}
|
|
4154
4223
|
/************************************************************
|
|
@@ -4791,7 +4860,7 @@ function ac_register_window(gobj, event, kw, src) {
|
|
|
4791
4860
|
if (prefix) label_items.push([
|
|
4792
4861
|
"span",
|
|
4793
4862
|
{ class: "yui-dock-label-prefix" },
|
|
4794
|
-
prefix
|
|
4863
|
+
document.createTextNode(String(prefix))
|
|
4795
4864
|
]);
|
|
4796
4865
|
if (title_key) label_items.push([
|
|
4797
4866
|
"span",
|
|
@@ -4804,7 +4873,7 @@ function ac_register_window(gobj, event, kw, src) {
|
|
|
4804
4873
|
if (label_items.length === 0) label_items.push([
|
|
4805
4874
|
"span",
|
|
4806
4875
|
{ class: "yui-dock-label-kind" },
|
|
4807
|
-
title
|
|
4876
|
+
document.createTextNode(String(title))
|
|
4808
4877
|
]);
|
|
4809
4878
|
let entry = {
|
|
4810
4879
|
gobj: win,
|
|
@@ -4831,6 +4900,8 @@ function ac_register_window(gobj, event, kw, src) {
|
|
|
4831
4900
|
{
|
|
4832
4901
|
class: "yui-dock-close",
|
|
4833
4902
|
type: "button",
|
|
4903
|
+
title: t("close"),
|
|
4904
|
+
"data-i18n-title": "close",
|
|
4834
4905
|
"aria-label": t("close"),
|
|
4835
4906
|
"data-i18n-aria-label": "close"
|
|
4836
4907
|
},
|
|
@@ -5095,6 +5166,8 @@ function build_ui$17(gobj) {
|
|
|
5095
5166
|
"button",
|
|
5096
5167
|
{
|
|
5097
5168
|
class: "yui-pager-back button is-white is-hidden",
|
|
5169
|
+
title: t("back"),
|
|
5170
|
+
"data-i18n-title": "back",
|
|
5098
5171
|
"aria-label": t("back"),
|
|
5099
5172
|
"data-i18n-aria-label": "back"
|
|
5100
5173
|
},
|
|
@@ -5120,6 +5193,8 @@ function build_ui$17(gobj) {
|
|
|
5120
5193
|
"button",
|
|
5121
5194
|
{
|
|
5122
5195
|
class: "yui-pager-discard button is-white is-hidden",
|
|
5196
|
+
title: t("discard"),
|
|
5197
|
+
"data-i18n-title": "discard",
|
|
5123
5198
|
"aria-label": t("discard"),
|
|
5124
5199
|
"data-i18n-aria-label": "discard"
|
|
5125
5200
|
},
|
|
@@ -5200,13 +5275,12 @@ function render_header(gobj) {
|
|
|
5200
5275
|
let $discard = $container.querySelector(".yui-pager-discard");
|
|
5201
5276
|
$back.classList.toggle("is-hidden", !model.show_back);
|
|
5202
5277
|
let $back_icon = $back.querySelector("i");
|
|
5203
|
-
|
|
5204
|
-
|
|
5205
|
-
|
|
5206
|
-
|
|
5207
|
-
|
|
5208
|
-
|
|
5209
|
-
}
|
|
5278
|
+
let back_key = model.back_kind === "close" ? "close" : "back";
|
|
5279
|
+
$back_icon.className = back_key === "close" ? "yi-xmark" : "yi-arrow-left";
|
|
5280
|
+
$back.setAttribute("title", t(back_key));
|
|
5281
|
+
$back.setAttribute("data-i18n-title", back_key);
|
|
5282
|
+
$back.setAttribute("aria-label", t(back_key));
|
|
5283
|
+
$back.setAttribute("data-i18n-aria-label", back_key);
|
|
5210
5284
|
$discard.classList.toggle("is-hidden", !model.show_discard);
|
|
5211
5285
|
$title.setAttribute("data-i18n", model.title);
|
|
5212
5286
|
$title.textContent = t(model.title);
|
|
@@ -5614,6 +5688,8 @@ function mt_destroy$18(gobj) {
|
|
|
5614
5688
|
* Build UI
|
|
5615
5689
|
************************************************************/
|
|
5616
5690
|
function build_ui$16(gobj) {
|
|
5691
|
+
let back_label = gobj_read_attr(gobj, "back_label");
|
|
5692
|
+
let next_label = gobj_read_attr(gobj, "next_label");
|
|
5617
5693
|
let $container = createElement2([
|
|
5618
5694
|
"div",
|
|
5619
5695
|
{
|
|
@@ -5661,8 +5737,10 @@ function build_ui$16(gobj) {
|
|
|
5661
5737
|
"button",
|
|
5662
5738
|
{
|
|
5663
5739
|
class: "yui-wizard-back button",
|
|
5664
|
-
|
|
5665
|
-
"data-i18n-
|
|
5740
|
+
title: t(back_label),
|
|
5741
|
+
"data-i18n-title": back_label,
|
|
5742
|
+
"aria-label": t(back_label),
|
|
5743
|
+
"data-i18n-aria-label": back_label
|
|
5666
5744
|
},
|
|
5667
5745
|
[[
|
|
5668
5746
|
"span",
|
|
@@ -5672,9 +5750,9 @@ function build_ui$16(gobj) {
|
|
|
5672
5750
|
"span",
|
|
5673
5751
|
{
|
|
5674
5752
|
class: "is-hidden-mobile",
|
|
5675
|
-
i18n:
|
|
5753
|
+
i18n: back_label
|
|
5676
5754
|
},
|
|
5677
|
-
|
|
5755
|
+
back_label
|
|
5678
5756
|
]],
|
|
5679
5757
|
{ click: function(evt) {
|
|
5680
5758
|
evt.stopPropagation();
|
|
@@ -5684,16 +5762,18 @@ function build_ui$16(gobj) {
|
|
|
5684
5762
|
"button",
|
|
5685
5763
|
{
|
|
5686
5764
|
class: "yui-wizard-primary button is-link",
|
|
5687
|
-
|
|
5688
|
-
"data-i18n-
|
|
5765
|
+
title: t(next_label),
|
|
5766
|
+
"data-i18n-title": next_label,
|
|
5767
|
+
"aria-label": t(next_label),
|
|
5768
|
+
"data-i18n-aria-label": next_label
|
|
5689
5769
|
},
|
|
5690
5770
|
[[
|
|
5691
5771
|
"span",
|
|
5692
5772
|
{
|
|
5693
5773
|
class: "yui-wizard-primary-label",
|
|
5694
|
-
i18n:
|
|
5774
|
+
i18n: next_label
|
|
5695
5775
|
},
|
|
5696
|
-
|
|
5776
|
+
next_label
|
|
5697
5777
|
]],
|
|
5698
5778
|
{ click: function(evt) {
|
|
5699
5779
|
evt.stopPropagation();
|
|
@@ -5752,14 +5832,19 @@ function render_chrome(gobj) {
|
|
|
5752
5832
|
let $title = $container.querySelector(".yui-wizard-title");
|
|
5753
5833
|
let $counter = $container.querySelector(".yui-wizard-counter");
|
|
5754
5834
|
let $back = $container.querySelector(".yui-wizard-back");
|
|
5835
|
+
let $primary = $container.querySelector(".yui-wizard-primary");
|
|
5755
5836
|
let $plabel = $container.querySelector(".yui-wizard-primary-label");
|
|
5756
|
-
$title.setAttribute("i18n", model.title);
|
|
5757
|
-
$title.textContent = model.title;
|
|
5837
|
+
$title.setAttribute("data-i18n", model.title);
|
|
5838
|
+
$title.textContent = t(model.title);
|
|
5758
5839
|
if (model.count > 0) $counter.textContent = `${model.idx + 1} / ${model.count}`;
|
|
5759
5840
|
else $counter.textContent = "";
|
|
5760
5841
|
$back.classList.toggle("is-hidden", !model.show_back);
|
|
5761
|
-
$plabel.setAttribute("i18n", model.primary_label);
|
|
5762
|
-
$plabel.textContent = model.primary_label;
|
|
5842
|
+
$plabel.setAttribute("data-i18n", model.primary_label);
|
|
5843
|
+
$plabel.textContent = t(model.primary_label);
|
|
5844
|
+
$primary.setAttribute("title", t(model.primary_label));
|
|
5845
|
+
$primary.setAttribute("data-i18n-title", model.primary_label);
|
|
5846
|
+
$primary.setAttribute("aria-label", t(model.primary_label));
|
|
5847
|
+
$primary.setAttribute("data-i18n-aria-label", model.primary_label);
|
|
5763
5848
|
for (let i = 0; i < priv.steps.length; i++) {
|
|
5764
5849
|
let s = priv.steps[i];
|
|
5765
5850
|
if (s.$el) s.$el.classList.toggle("is-hidden", i !== model.idx);
|
|
@@ -7085,6 +7170,496 @@ function yui_watch_theme(gobj, event = "EV_THEME") {
|
|
|
7085
7170
|
}
|
|
7086
7171
|
} };
|
|
7087
7172
|
}
|
|
7173
|
+
//#endregion
|
|
7174
|
+
//#region src/lib_icons.js
|
|
7175
|
+
/*********************************************************
|
|
7176
|
+
* lib_icons.js
|
|
7177
|
+
*
|
|
7178
|
+
* Two icon systems are managed here:
|
|
7179
|
+
*
|
|
7180
|
+
* 1. FA-style CSS icons (yui_icons.css)
|
|
7181
|
+
* Usage: <i class="yi-save"></i>
|
|
7182
|
+
* Color: inherits currentColor from parent via CSS mask.
|
|
7183
|
+
*
|
|
7184
|
+
* 2. SVG symbol icons for G6 toolbar (and any other component
|
|
7185
|
+
* that uses <use xlink:href="#id">).
|
|
7186
|
+
* Symbols are injected once into the DOM.
|
|
7187
|
+
* All symbol ids are prefixed with "g6-icon-" to avoid
|
|
7188
|
+
* conflicts with other DOM elements.
|
|
7189
|
+
* Icon paths come from:
|
|
7190
|
+
* fontawesome-free-7.1.0-web/sprites/solid.svg
|
|
7191
|
+
*
|
|
7192
|
+
* G6 toolbar items are managed via CSS class names (className
|
|
7193
|
+
* field in getItems()) using YuiToolbar in c_g6_nodes_tree.js.
|
|
7194
|
+
* This lets lib_graph.js state functions (set_submit_state,
|
|
7195
|
+
* disableElements, …) work on toolbar icons exactly like on
|
|
7196
|
+
* regular Bulma/FA buttons — no icon-specific helpers needed.
|
|
7197
|
+
*
|
|
7198
|
+
* 3. User icons: the icons a user adds as DATA, one node of the
|
|
7199
|
+
* treedb system topic `__icons__` each (id = name, svg = drawing).
|
|
7200
|
+
* They join system 1 at run time: each becomes a rule
|
|
7201
|
+
* `.yi-u-<id>::before` in a stylesheet of their own, so every
|
|
7202
|
+
* component that draws an icon by class name draws them too.
|
|
7203
|
+
* `yi-u-` is the user's namespace, and the reason a user icon can
|
|
7204
|
+
* never replace an icon of the library.
|
|
7205
|
+
*
|
|
7206
|
+
* Copyright (c) 2025-2026, ArtGins.
|
|
7207
|
+
* All Rights Reserved.
|
|
7208
|
+
*********************************************************/
|
|
7209
|
+
var CUSTOM_SVG_ICONS_ID = "g6-custom-svgicons";
|
|
7210
|
+
var ICONS = `<svg xmlns="http://www.w3.org/2000/svg">
|
|
7211
|
+
<!-- magnifying-glass-plus -->
|
|
7212
|
+
<symbol id="g6-icon-zoom-in" viewBox="0 0 512 512">
|
|
7213
|
+
<path fill="currentColor" d="M416 208c0 45.9-14.9 88.3-40 122.7L502.6 457.4c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L330.7 376C296.3 401.1 253.9 416 208 416 93.1 416 0 322.9 0 208S93.1 0 208 0 416 93.1 416 208zM208 112c-13.3 0-24 10.7-24 24l0 48-48 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l48 0 0 48c0 13.3 10.7 24 24 24s24-10.7 24-24l0-48 48 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-48 0 0-48c0-13.3-10.7-24-24-24z"/>
|
|
7214
|
+
</symbol>
|
|
7215
|
+
<!-- magnifying-glass-minus -->
|
|
7216
|
+
<symbol id="g6-icon-zoom-out" viewBox="0 0 512 512">
|
|
7217
|
+
<path fill="currentColor" d="M416 208c0 45.9-14.9 88.3-40 122.7L502.6 457.4c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L330.7 376C296.3 401.1 253.9 416 208 416 93.1 416 0 322.9 0 208S93.1 0 208 0 416 93.1 416 208zM136 184c-13.3 0-24 10.7-24 24s10.7 24 24 24l144 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-144 0z"/>
|
|
7218
|
+
</symbol>
|
|
7219
|
+
<!-- house (reset zoom: back to original 100% view) -->
|
|
7220
|
+
<symbol id="g6-icon-home" viewBox="0 0 512 512">
|
|
7221
|
+
<path fill="currentColor" d="M277.8 8.6c-12.3-11.4-31.3-11.4-43.5 0l-224 208c-9.6 9-12.8 22.9-8 35.1S18.8 272 32 272l16 0 0 176c0 35.3 28.7 64 64 64l288 0c35.3 0 64-28.7 64-64l0-176 16 0c13.2 0 25-8.1 29.8-20.3s1.6-26.2-8-35.1l-224-208zM240 320l32 0c26.5 0 48 21.5 48 48l0 96-128 0 0-96c0-26.5 21.5-48 48-48z"/>
|
|
7222
|
+
</symbol>
|
|
7223
|
+
<!-- expand (zoom to fit) -->
|
|
7224
|
+
<symbol id="g6-icon-fit" viewBox="0 0 448 512">
|
|
7225
|
+
<path fill="currentColor" d="M32 32C14.3 32 0 46.3 0 64l0 96c0 17.7 14.3 32 32 32s32-14.3 32-32l0-64 64 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L32 32zM64 352c0-17.7-14.3-32-32-32S0 334.3 0 352l0 96c0 17.7 14.3 32 32 32l96 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-64 0 0-64zM320 32c-17.7 0-32 14.3-32 32s14.3 32 32 32l64 0 0 64c0 17.7 14.3 32 32 32s32-14.3 32-32l0-96c0-17.7-14.3-32-32-32l-96 0zM448 352c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 64-64 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l96 0c17.7 0 32-14.3 32-32l0-96z"/>
|
|
7226
|
+
</symbol>
|
|
7227
|
+
<!-- fit to selection: the same corner brackets as the fit icon,
|
|
7228
|
+
around a marked object. The two sit side by side in the
|
|
7229
|
+
toolbar and have to read as a family, which a borrowed glyph
|
|
7230
|
+
would not. (No backticks in here: the sprite lives inside a
|
|
7231
|
+
template literal.) -->
|
|
7232
|
+
<symbol id="g6-icon-fit-selection" viewBox="0 0 448 512">
|
|
7233
|
+
<path fill="currentColor" d="M32 32C14.3 32 0 46.3 0 64l0 96c0 17.7 14.3 32 32 32s32-14.3 32-32l0-64 64 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L32 32zM64 352c0-17.7-14.3-32-32-32S0 334.3 0 352l0 96c0 17.7 14.3 32 32 32l96 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-64 0 0-64zM320 32c-17.7 0-32 14.3-32 32s14.3 32 32 32l64 0 0 64c0 17.7 14.3 32 32 32s32-14.3 32-32l0-96c0-17.7-14.3-32-32-32l-96 0zM448 352c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 64-64 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l96 0c17.7 0 32-14.3 32-32l0-96z"/>
|
|
7234
|
+
<rect fill="currentColor" x="144" y="176" width="160" height="160" rx="24"/>
|
|
7235
|
+
</symbol>
|
|
7236
|
+
<!-- crosshairs (center) -->
|
|
7237
|
+
<symbol id="g6-icon-center" viewBox="0 0 576 512">
|
|
7238
|
+
<path fill="currentColor" d="M288-16c17.7 0 32 14.3 32 32l0 18.3c98.1 14 175.7 91.6 189.7 189.7l18.3 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-18.3 0c-14 98.1-91.6 175.7-189.7 189.7l0 18.3c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-18.3C157.9 463.7 80.3 386.1 66.3 288L48 288c-17.7 0-32-14.3-32-32s14.3-32 32-32l18.3 0C80.3 125.9 157.9 48.3 256 34.3L256 16c0-17.7 14.3-32 32-32zM131.2 288c12.7 62.7 62.1 112.1 124.8 124.8l0-12.8c0-17.7 14.3-32 32-32s32 14.3 32 32l0 12.8c62.7-12.7 112.1-62.1 124.8-124.8L432 288c-17.7 0-32-14.3-32-32s14.3-32 32-32l12.8 0C432.1 161.3 382.7 111.9 320 99.2l0 12.8c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-12.8C193.3 111.9 143.9 161.3 131.2 224l12.8 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-12.8 0zM288 208a48 48 0 1 1 0 96 48 48 0 1 1 0-96z"/>
|
|
7239
|
+
</symbol>
|
|
7240
|
+
<!-- up-right-and-down-left-from-center (enter fullscreen) -->
|
|
7241
|
+
<symbol id="g6-icon-fullscreen" viewBox="0 0 512 512">
|
|
7242
|
+
<path fill="currentColor" d="M344 0L488 0c13.3 0 24 10.7 24 24l0 144c0 9.7-5.8 18.5-14.8 22.2s-19.3 1.7-26.2-5.2l-39-39-87 87c-9.4 9.4-24.6 9.4-33.9 0l-32-32c-9.4-9.4-9.4-24.6 0-33.9l87-87-39-39c-6.9-6.9-8.9-17.2-5.2-26.2S334.3 0 344 0zM168 512L24 512c-13.3 0-24-10.7-24-24L0 344c0-9.7 5.8-18.5 14.8-22.2S34.1 320.2 41 327l39 39 87-87c9.4-9.4 24.6-9.4 33.9 0l32 32c9.4 9.4 9.4 24.6 0 33.9l-87 87 39 39c6.9 6.9 8.9 17.2 5.2 26.2S177.7 512 168 512z"/>
|
|
7243
|
+
</symbol>
|
|
7244
|
+
<!-- down-left-and-up-right-to-center (exit fullscreen) -->
|
|
7245
|
+
<symbol id="g6-icon-fullscreen-exit" viewBox="0 0 512 512">
|
|
7246
|
+
<path fill="currentColor" d="M439.5 7c9.4-9.4 24.6-9.4 33.9 0l32 32c9.4 9.4 9.4 24.6 0 33.9l-87 87 39 39c6.9 6.9 8.9 17.2 5.2 26.2S450.2 240 440.5 240l-144 0c-13.3 0-24-10.7-24-24l0-144c0-9.7 5.8-18.5 14.8-22.2s19.3-1.7 26.2 5.2l39 39 87-87zM72.5 272l144 0c13.3 0 24 10.7 24 24l0 144c0 9.7-5.8 18.5-14.8 22.2s-19.3 1.7-26.2-5.2l-39-39-87 87c-9.4 9.4-24.6 9.4-33.9 0l-32-32c-9.4-9.4-9.4-24.6 0-33.9l87-87-39-39c-6.9-6.9-8.9-17.2-5.2-26.2S62.8 272 72.5 272z"/>
|
|
7247
|
+
</symbol>
|
|
7248
|
+
<!-- arrow-rotate-left (undo) -->
|
|
7249
|
+
<symbol id="g6-icon-undo" viewBox="0 0 512 512">
|
|
7250
|
+
<path fill="currentColor" d="M256 64c-56.8 0-107.9 24.7-143.1 64l47.1 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 192c-17.7 0-32-14.3-32-32L0 32C0 14.3 14.3 0 32 0S64 14.3 64 32l0 54.7C110.9 33.6 179.5 0 256 0 397.4 0 512 114.6 512 256S397.4 512 256 512c-87 0-163.9-43.4-210.1-109.7-10.1-14.5-6.6-34.4 7.9-44.6s34.4-6.6 44.6 7.9c34.8 49.8 92.4 82.3 157.6 82.3 106 0 192-86 192-192S362 64 256 64z"/>
|
|
7251
|
+
</symbol>
|
|
7252
|
+
<!-- arrow-rotate-right (redo) -->
|
|
7253
|
+
<symbol id="g6-icon-redo" viewBox="0 0 512 512">
|
|
7254
|
+
<path fill="currentColor" d="M436.7 74.7L448 85.4 448 32c0-17.7 14.3-32 32-32s32 14.3 32 32l0 128c0 17.7-14.3 32-32 32l-128 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l47.9 0-7.6-7.2c-.2-.2-.4-.4-.6-.6-75-75-196.5-75-271.5 0s-75 196.5 0 271.5 196.5 75 271.5 0c8.2-8.2 15.5-16.9 21.9-26.1 10.1-14.5 30.1-18 44.6-7.9s18 30.1 7.9 44.6c-8.5 12.2-18.2 23.8-29.1 34.7-100 100-262.1 100-362 0S-25 175 75 75c99.9-99.9 261.7-100 361.7-.3z"/>
|
|
7255
|
+
</symbol>
|
|
7256
|
+
<!-- pen (edit node) -->
|
|
7257
|
+
<symbol id="g6-icon-edit" viewBox="0 0 512 512">
|
|
7258
|
+
<path fill="currentColor" d="M352.9 21.2L308 66.1 445.9 204 490.8 159.1C504.4 145.6 512 127.2 512 108s-7.6-37.6-21.2-51.1L455.1 21.2C441.6 7.6 423.2 0 404 0s-37.6 7.6-51.1 21.2zM274.1 100L58.9 315.1c-10.7 10.7-18.5 24.1-22.6 38.7L.9 481.6c-2.3 8.3 0 17.3 6.2 23.4s15.1 8.5 23.4 6.2l127.8-35.5c14.6-4.1 27.9-11.8 38.7-22.6L412 237.9 274.1 100z"/>
|
|
7259
|
+
</symbol>
|
|
7260
|
+
<!-- trash-can (delete) -->
|
|
7261
|
+
<symbol id="g6-icon-delete" viewBox="0 0 448 512">
|
|
7262
|
+
<path fill="currentColor" d="M136.7 5.9C141.1-7.2 153.3-16 167.1-16l113.9 0c13.8 0 26 8.8 30.4 21.9L320 32 416 32c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 96C14.3 96 0 81.7 0 64S14.3 32 32 32l96 0 8.7-26.1zM32 144l384 0 0 304c0 35.3-28.7 64-64 64L96 512c-35.3 0-64-28.7-64-64l0-304zm88 64c-13.3 0-24 10.7-24 24l0 192c0 13.3 10.7 24 24 24s24-10.7 24-24l0-192c0-13.3-10.7-24-24-24zm104 0c-13.3 0-24 10.7-24 24l0 192c0 13.3 10.7 24 24 24s24-10.7 24-24l0-192c0-13.3-10.7-24-24-24zm104 0c-13.3 0-24 10.7-24 24l0 192c0 13.3 10.7 24 24 24s24-10.7 24-24l0-192c0-13.3-10.7-24-24-24z"/>
|
|
7263
|
+
</symbol>
|
|
7264
|
+
<!-- link (link nodes) -->
|
|
7265
|
+
<symbol id="g6-icon-link" viewBox="0 0 576 512">
|
|
7266
|
+
<path fill="currentColor" d="M419.5 96c-16.6 0-32.7 4.5-46.8 12.7-15.8-16-34.2-29.4-54.5-39.5 28.2-24 64.1-37.2 101.3-37.2 86.4 0 156.5 70 156.5 156.5 0 41.5-16.5 81.3-45.8 110.6l-71.1 71.1c-29.3 29.3-69.1 45.8-110.6 45.8-86.4 0-156.5-70-156.5-156.5 0-1.5 0-3 .1-4.5 .5-17.7 15.2-31.6 32.9-31.1s31.6 15.2 31.1 32.9c0 .9 0 1.8 0 2.6 0 51.1 41.4 92.5 92.5 92.5 24.5 0 48-9.7 65.4-27.1l71.1-71.1c17.3-17.3 27.1-40.9 27.1-65.4 0-51.1-41.4-92.5-92.5-92.5zM275.2 173.3c-1.9-.8-3.8-1.9-5.5-3.1-12.6-6.5-27-10.2-42.1-10.2-24.5 0-48 9.7-65.4 27.1L91.1 258.2c-17.3 17.3-27.1 40.9-27.1 65.4 0 51.1 41.4 92.5 92.5 92.5 16.5 0 32.6-4.4 46.7-12.6 15.8 16 34.2 29.4 54.6 39.5-28.2 23.9-64 37.2-101.3 37.2-86.4 0-156.5-70-156.5-156.5 0-41.5 16.5-81.3 45.8-110.6l71.1-71.1c29.3-29.3 69.1-45.8 110.6-45.8 86.6 0 156.5 70.6 156.5 156.9 0 1.3 0 2.6 0 3.9-.4 17.7-15.1 31.6-32.8 31.2s-31.6-15.1-31.2-32.8c0-.8 0-1.5 0-2.3 0-33.7-18-63.3-44.8-79.6z"/>
|
|
7267
|
+
</symbol>
|
|
7268
|
+
<!-- link-slash (unlink) -->
|
|
7269
|
+
<symbol id="g6-icon-unlink" viewBox="0 0 576 512">
|
|
7270
|
+
<path fill="currentColor" d="M41-24.9c-9.4-9.4-24.6-9.4-33.9 0S-2.3-.3 7 9.1l528 528c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-122-122c4.2-3.4 8.3-7.1 12.1-10.9l71.1-71.1c29.3-29.3 45.8-69.1 45.8-110.6 0-86.4-70-156.5-156.5-156.5-37.3 0-73.1 13.3-101.3 37.2 20.3 10.1 38.7 23.5 54.5 39.5 14.1-8.3 30.2-12.7 46.8-12.7 51.1 0 92.5 41.4 92.5 92.5 0 24.5-9.7 48-27.1 65.4l-71.1 71.1c-3.9 3.9-8.1 7.4-12.6 10.5l-47.5-47.5c16.5-.9 29.7-14.4 30.2-31.1 0-1.3 0-2.6 0-3.9 0-86.3-69.9-156.9-156.5-156.9-19.2 0-37.9 3.5-55.5 10.2L41-24.9zM225.9 160c.6 0 1.1 0 1.7 0 15.1 0 29.5 3.7 42.1 10.2 1.8 1.2 3.6 2.3 5.5 3.1 26.8 16.3 44.8 45.9 44.8 79.6 0 .4 0 .8 0 1.2L225.9 160zM346.2 416L192 261.8c1.2 84.6 69.6 152.9 154.1 154.1zM139.7 209.5l-45.3-45.3-48.6 48.6c-29.3 29.3-45.8 69.1-45.8 110.6 0 86.4 70 156.5 156.5 156.5 37.2 0 73.1-13.3 101.3-37.2-20.3-10.1-38.8-23.5-54.6-39.5-14 8.2-30.1 12.6-46.7 12.6-51.1 0-92.5-41.4-92.5-92.5 0-24.5 9.7-48 27.1-65.4l48.6-48.6z"/>
|
|
7271
|
+
</symbol>
|
|
7272
|
+
<!-- play (run node) -->
|
|
7273
|
+
<symbol id="g6-icon-run" viewBox="0 0 448 512">
|
|
7274
|
+
<path fill="currentColor" d="M91.2 36.9c-12.4-6.8-27.4-6.5-39.6 .7S32 57.9 32 72l0 368c0 14.1 7.5 27.2 19.6 34.4s27.2 7.5 39.6 .7l336-184c12.8-7 20.8-20.5 20.8-35.1s-8-28.1-20.8-35.1l-336-184z"/>
|
|
7275
|
+
</symbol>
|
|
7276
|
+
<!-- clone (copy size to other nodes/ports) -->
|
|
7277
|
+
<symbol id="g6-icon-resize" viewBox="0 0 512 512">
|
|
7278
|
+
<path fill="currentColor" d="M288 448l-224 0 0-224 48 0 0-64-48 0c-35.3 0-64 28.7-64 64L0 448c0 35.3 28.7 64 64 64l224 0c35.3 0 64-28.7 64-64l0-48-64 0 0 48zm-64-96l224 0c35.3 0 64-28.7 64-64l0-224c0-35.3-28.7-64-64-64L224 0c-35.3 0-64 28.7-64 64l0 224c0 35.3 28.7 64 64 64z"/>
|
|
7279
|
+
</symbol>
|
|
7280
|
+
<!-- plus (create node). Deliberately NOT the FA7 solid plus:
|
|
7281
|
+
its arms are ~14% of the width and read thin next to the
|
|
7282
|
+
other solid glyphs. Bold geometric plus (~23% arm
|
|
7283
|
+
thickness) with long arms (32..480) so it reads as a "+",
|
|
7284
|
+
not a stubby Red-Cross square. -->
|
|
7285
|
+
<symbol id="g6-icon-plus" viewBox="0 0 512 512">
|
|
7286
|
+
<path fill="currentColor" d="M316 32 L316 196 L480 196 L480 316 L316 316 L316 480 L196 480 L196 316 L32 316 L32 196 L196 196 L196 32 Z"/>
|
|
7287
|
+
</symbol>
|
|
7288
|
+
<!-- ellipsis-vertical (unfold the floating toolbar).
|
|
7289
|
+
The strip it stands for is a vertical stack, and a vertical
|
|
7290
|
+
ellipsis is what "there is more of this here" is drawn as
|
|
7291
|
+
everywhere else. -->
|
|
7292
|
+
<symbol id="g6-icon-toolbar-show" viewBox="0 0 128 512">
|
|
7293
|
+
<path fill="currentColor" d="M64 360a56 56 0 1 0 0 112 56 56 0 1 0 0-112zm0-160a56 56 0 1 0 0 112 56 56 0 1 0 0-112zM120 96A56 56 0 1 0 8 96a56 56 0 1 0 112 0z"/>
|
|
7294
|
+
</symbol>
|
|
7295
|
+
<!-- xmark (fold the floating toolbar away).
|
|
7296
|
+
Not a chevron: the two toolbars sit on OPPOSITE edges, so a
|
|
7297
|
+
direction would point the wrong way on one of them. What the
|
|
7298
|
+
button does is close an overlay, and that is an x. -->
|
|
7299
|
+
<symbol id="g6-icon-toolbar-hide" viewBox="0 0 384 512">
|
|
7300
|
+
<path fill="currentColor" d="M342.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192 210.7 86.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L146.7 256 41.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192 301.3 297.4 406.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.3 256 342.6 150.6z"/>
|
|
7301
|
+
</symbol>
|
|
7302
|
+
<!-- dashed marquee (selection mode).
|
|
7303
|
+
The band ITSELF, because that is what the button turns on: a
|
|
7304
|
+
drag on the canvas draws one and a tap picks a card. Not the
|
|
7305
|
+
fit-to-selection glyph next to it in the other toolbar -- that
|
|
7306
|
+
one is solid brackets around a solid object and means "put the
|
|
7307
|
+
camera on what is picked", which is the opposite end of the
|
|
7308
|
+
gesture. Dashes: 16 segments of 59 with gaps of 36 over a
|
|
7309
|
+
perimeter of 1520, so they land on the corners. -->
|
|
7310
|
+
<symbol id="g6-icon-select-mode" viewBox="0 0 512 512">
|
|
7311
|
+
<rect x="46" y="86" width="420" height="340" fill="none"
|
|
7312
|
+
stroke="currentColor" stroke-width="40"
|
|
7313
|
+
stroke-dasharray="59 36"/>
|
|
7314
|
+
</symbol>
|
|
7315
|
+
<!-- location-crosshairs (anchor the camera on one element).
|
|
7316
|
+
The SAME path as the DOM toolbars and their yi-location-crosshairs
|
|
7317
|
+
mask: the two toolbars sit in one console, and a control that
|
|
7318
|
+
does one thing has to be drawn one way. -->
|
|
7319
|
+
<symbol id="g6-icon-anchor" viewBox="0 0 576 512">
|
|
7320
|
+
<path fill="currentColor" d="M288-16c17.7 0 32 14.3 32 32l0 18.3c98.1 14 175.7 91.6 189.7 189.7l18.3 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-18.3 0c-14 98.1-91.6 175.7-189.7 189.7l0 18.3c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-18.3C157.9 463.7 80.3 386.1 66.3 288L48 288c-17.7 0-32-14.3-32-32s14.3-32 32-32l18.3 0C80.3 125.9 157.9 48.3 256 34.3L256 16c0-17.7 14.3-32 32-32zM128 256a160 160 0 1 0 320 0 160 160 0 1 0 -320 0zm160-96a96 96 0 1 1 0 192 96 96 0 1 1 0-192z"/>
|
|
7321
|
+
</symbol>
|
|
7322
|
+
<!-- floppy-disk (save) -->
|
|
7323
|
+
<symbol id="g6-icon-save" viewBox="0 0 448 512">
|
|
7324
|
+
<path fill="currentColor" d="M64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-242.7c0-17-6.7-33.3-18.7-45.3L352 50.7C340 38.7 323.7 32 306.7 32L64 32zm32 96c0-17.7 14.3-32 32-32l160 0c17.7 0 32 14.3 32 32l0 64c0 17.7-14.3 32-32 32l-160 0c-17.7 0-32-14.3-32-32l0-64zM224 288a64 64 0 1 1 0 128 64 64 0 1 1 0-128z"/>
|
|
7325
|
+
</symbol>
|
|
7326
|
+
</svg>`;
|
|
7327
|
+
function inject_svg_icons() {
|
|
7328
|
+
if (document.getElementById(CUSTOM_SVG_ICONS_ID)) return;
|
|
7329
|
+
const div = document.createElement("div");
|
|
7330
|
+
div.id = CUSTOM_SVG_ICONS_ID;
|
|
7331
|
+
div.style.display = "none";
|
|
7332
|
+
div.innerHTML = ICONS;
|
|
7333
|
+
document.body.appendChild(div);
|
|
7334
|
+
}
|
|
7335
|
+
var __icon_defined__ = {};
|
|
7336
|
+
function yui_icon_is_defined(name) {
|
|
7337
|
+
if (!name || typeof name !== "string") return false;
|
|
7338
|
+
if (__icon_defined__[name] !== void 0) return __icon_defined__[name];
|
|
7339
|
+
let defined = false;
|
|
7340
|
+
try {
|
|
7341
|
+
const el = document.createElement("i");
|
|
7342
|
+
el.className = name;
|
|
7343
|
+
el.style.position = "absolute";
|
|
7344
|
+
el.style.visibility = "hidden";
|
|
7345
|
+
el.style.pointerEvents = "none";
|
|
7346
|
+
document.body.appendChild(el);
|
|
7347
|
+
const st = window.getComputedStyle(el, "::before");
|
|
7348
|
+
const mask = st.maskImage || st.webkitMaskImage || "";
|
|
7349
|
+
defined = !!mask && mask !== "none";
|
|
7350
|
+
document.body.removeChild(el);
|
|
7351
|
+
} catch (e) {
|
|
7352
|
+
defined = false;
|
|
7353
|
+
}
|
|
7354
|
+
__icon_defined__[name] = defined;
|
|
7355
|
+
return defined;
|
|
7356
|
+
}
|
|
7357
|
+
/************************************************************
|
|
7358
|
+
*
|
|
7359
|
+
* User icons
|
|
7360
|
+
*
|
|
7361
|
+
************************************************************/
|
|
7362
|
+
var ICONS_TOPIC = "__icons__";
|
|
7363
|
+
var ICONS_SVG_COL = "svg";
|
|
7364
|
+
var USER_ICON_PREFIX = "yi-u-";
|
|
7365
|
+
var USER_ICON_ID_RE = /^[a-z0-9]+(-[a-z0-9]+)*$/;
|
|
7366
|
+
var USER_ICON_MAX_SVG = 32768;
|
|
7367
|
+
var USER_ICONS_STYLE_ID = "yui-user-icons";
|
|
7368
|
+
var SVG_NS = "http://www.w3.org/2000/svg";
|
|
7369
|
+
var SVG_ELEMENTS = [
|
|
7370
|
+
"svg",
|
|
7371
|
+
"g",
|
|
7372
|
+
"path",
|
|
7373
|
+
"circle",
|
|
7374
|
+
"ellipse",
|
|
7375
|
+
"rect",
|
|
7376
|
+
"line",
|
|
7377
|
+
"polyline",
|
|
7378
|
+
"polygon"
|
|
7379
|
+
];
|
|
7380
|
+
var SVG_ATTRIBUTES = [
|
|
7381
|
+
"d",
|
|
7382
|
+
"cx",
|
|
7383
|
+
"cy",
|
|
7384
|
+
"r",
|
|
7385
|
+
"rx",
|
|
7386
|
+
"ry",
|
|
7387
|
+
"x",
|
|
7388
|
+
"y",
|
|
7389
|
+
"x1",
|
|
7390
|
+
"y1",
|
|
7391
|
+
"x2",
|
|
7392
|
+
"y2",
|
|
7393
|
+
"width",
|
|
7394
|
+
"height",
|
|
7395
|
+
"points",
|
|
7396
|
+
"transform",
|
|
7397
|
+
"fill",
|
|
7398
|
+
"fill-rule",
|
|
7399
|
+
"fill-opacity",
|
|
7400
|
+
"clip-rule",
|
|
7401
|
+
"opacity",
|
|
7402
|
+
"stroke",
|
|
7403
|
+
"stroke-width",
|
|
7404
|
+
"stroke-linecap",
|
|
7405
|
+
"stroke-linejoin",
|
|
7406
|
+
"stroke-miterlimit",
|
|
7407
|
+
"stroke-opacity",
|
|
7408
|
+
"stroke-dasharray"
|
|
7409
|
+
];
|
|
7410
|
+
var SVG_VALUE_RE = /^[a-zA-Z0-9\s.,#%()+-]*$/;
|
|
7411
|
+
var __user_icons__ = /* @__PURE__ */ new Map();
|
|
7412
|
+
/************************************************************
|
|
7413
|
+
* Is this field the drawing of an icon of __icons__?
|
|
7414
|
+
* The form edits it as a text area with a preview, and the
|
|
7415
|
+
* table shows the icon instead of the svg source.
|
|
7416
|
+
************************************************************/
|
|
7417
|
+
function yui_icons_is_svg_field(topic_name, field_name) {
|
|
7418
|
+
return topic_name === "__icons__" && field_name === ICONS_SVG_COL;
|
|
7419
|
+
}
|
|
7420
|
+
/************************************************************
|
|
7421
|
+
* The class of the user icon named `id`.
|
|
7422
|
+
************************************************************/
|
|
7423
|
+
function yui_user_icon_class(id) {
|
|
7424
|
+
return USER_ICON_PREFIX + id;
|
|
7425
|
+
}
|
|
7426
|
+
/************************************************************
|
|
7427
|
+
* Rebuild an svg from its SHAPES only.
|
|
7428
|
+
*
|
|
7429
|
+
* Return {svg, dropped} -- svg is the clean markup, dropped the
|
|
7430
|
+
* names of what was left out -- or {error} when there is
|
|
7431
|
+
* nothing to draw. The error is one of a FIXED set, so a GUI
|
|
7432
|
+
* can translate it: "empty svg", "svg too big", "not an svg
|
|
7433
|
+
* document", "svg without size", "svg without shapes". The markup is never inserted anywhere as
|
|
7434
|
+
* it came: it is parsed, and a new one is written from the
|
|
7435
|
+
* elements and attributes allowed above.
|
|
7436
|
+
************************************************************/
|
|
7437
|
+
function yui_svg_sanitize(svg_text) {
|
|
7438
|
+
if (typeof svg_text !== "string" || !svg_text.trim()) return { error: "empty svg" };
|
|
7439
|
+
if (svg_text.length > USER_ICON_MAX_SVG) return { error: "svg too big" };
|
|
7440
|
+
let doc;
|
|
7441
|
+
try {
|
|
7442
|
+
doc = new DOMParser().parseFromString(svg_text, "image/svg+xml");
|
|
7443
|
+
} catch (e) {
|
|
7444
|
+
return { error: "not an svg document" };
|
|
7445
|
+
}
|
|
7446
|
+
let root = doc && doc.documentElement;
|
|
7447
|
+
if (!root || root.getElementsByTagName("parsererror").length > 0) return { error: "not an svg document" };
|
|
7448
|
+
return rebuild_svg_from_shapes(root);
|
|
7449
|
+
}
|
|
7450
|
+
/************************************************************
|
|
7451
|
+
* The second half of yui_svg_sanitize(), on a PARSED tree:
|
|
7452
|
+
* anything with `localName`, `attributes` ({name, localName,
|
|
7453
|
+
* prefix, value}), `children` and `getAttribute()` -- a DOM
|
|
7454
|
+
* element, or the plain objects a test builds.
|
|
7455
|
+
************************************************************/
|
|
7456
|
+
function rebuild_svg_from_shapes(root) {
|
|
7457
|
+
if (!root || root.localName !== "svg") return { error: "not an svg document" };
|
|
7458
|
+
let dropped = /* @__PURE__ */ new Set();
|
|
7459
|
+
let shapes = 0;
|
|
7460
|
+
function value_is_safe(value) {
|
|
7461
|
+
return SVG_VALUE_RE.test(value) && !/url\s*\(/i.test(value);
|
|
7462
|
+
}
|
|
7463
|
+
function clean_attrs(el, allowed) {
|
|
7464
|
+
let out = "";
|
|
7465
|
+
for (const attr of Array.from(el.attributes || [])) {
|
|
7466
|
+
let name = attr.localName || attr.name;
|
|
7467
|
+
if (attr.prefix || !allowed.includes(name)) {
|
|
7468
|
+
if (name !== "xmlns" && attr.prefix !== "xmlns") dropped.add(`@${attr.name}`);
|
|
7469
|
+
continue;
|
|
7470
|
+
}
|
|
7471
|
+
let value = String(attr.value).trim();
|
|
7472
|
+
if (!value_is_safe(value)) {
|
|
7473
|
+
dropped.add(`@${attr.name}`);
|
|
7474
|
+
continue;
|
|
7475
|
+
}
|
|
7476
|
+
out += ` ${name}="${value}"`;
|
|
7477
|
+
}
|
|
7478
|
+
return out;
|
|
7479
|
+
}
|
|
7480
|
+
function clean_node(el) {
|
|
7481
|
+
let name = el.localName;
|
|
7482
|
+
if (!SVG_ELEMENTS.includes(name) || name === "svg") {
|
|
7483
|
+
dropped.add(name);
|
|
7484
|
+
return "";
|
|
7485
|
+
}
|
|
7486
|
+
if (name !== "g") shapes++;
|
|
7487
|
+
let inner = "";
|
|
7488
|
+
for (const child of Array.from(el.children || [])) inner += clean_node(child);
|
|
7489
|
+
return `<${name}${clean_attrs(el, SVG_ATTRIBUTES)}>${inner}</${name}>`;
|
|
7490
|
+
}
|
|
7491
|
+
let view_box = (root.getAttribute("viewBox") || "").trim();
|
|
7492
|
+
if (!/^-?[\d.]+([\s,]+-?[\d.]+){3}$/.test(view_box)) {
|
|
7493
|
+
let w = parseFloat(root.getAttribute("width"));
|
|
7494
|
+
let h = parseFloat(root.getAttribute("height"));
|
|
7495
|
+
if (!(w > 0 && h > 0)) return { error: "svg without size" };
|
|
7496
|
+
view_box = `0 0 ${w} ${h}`;
|
|
7497
|
+
}
|
|
7498
|
+
const ROOT_ATTRIBUTES = [
|
|
7499
|
+
"fill",
|
|
7500
|
+
"fill-rule",
|
|
7501
|
+
"stroke",
|
|
7502
|
+
"stroke-width",
|
|
7503
|
+
"stroke-linecap",
|
|
7504
|
+
"stroke-linejoin"
|
|
7505
|
+
];
|
|
7506
|
+
let root_attrs = "";
|
|
7507
|
+
for (const name of ROOT_ATTRIBUTES) {
|
|
7508
|
+
let value = (root.getAttribute(name) || "").trim();
|
|
7509
|
+
if (value && value_is_safe(value)) root_attrs += ` ${name}="${value}"`;
|
|
7510
|
+
else if (value) dropped.add(`@${name}`);
|
|
7511
|
+
}
|
|
7512
|
+
for (const attr of Array.from(root.attributes || [])) {
|
|
7513
|
+
let name = attr.localName || attr.name;
|
|
7514
|
+
if (attr.prefix === "xmlns" || name === "xmlns" || [
|
|
7515
|
+
"viewBox",
|
|
7516
|
+
"width",
|
|
7517
|
+
"height",
|
|
7518
|
+
"version"
|
|
7519
|
+
].includes(name) || !attr.prefix && ROOT_ATTRIBUTES.includes(name)) continue;
|
|
7520
|
+
dropped.add(`@${attr.name}`);
|
|
7521
|
+
}
|
|
7522
|
+
let inner = "";
|
|
7523
|
+
for (const child of Array.from(root.children || [])) inner += clean_node(child);
|
|
7524
|
+
if (shapes === 0) return { error: "svg without shapes" };
|
|
7525
|
+
return {
|
|
7526
|
+
svg: `<svg xmlns="${SVG_NS}" viewBox="${view_box}"${root_attrs}>${inner}</svg>`,
|
|
7527
|
+
dropped: Array.from(dropped)
|
|
7528
|
+
};
|
|
7529
|
+
}
|
|
7530
|
+
/************************************************************
|
|
7531
|
+
* The CSS `url(...)` of an svg, to be used as a mask.
|
|
7532
|
+
* Every character that could end the string or the url is
|
|
7533
|
+
* percent-encoded.
|
|
7534
|
+
************************************************************/
|
|
7535
|
+
function svg_mask_url(svg) {
|
|
7536
|
+
return `url("data:image/svg+xml,${encodeURIComponent(svg)}")`;
|
|
7537
|
+
}
|
|
7538
|
+
/************************************************************
|
|
7539
|
+
* An element that shows an svg as an icon, before it is
|
|
7540
|
+
* registered (a form preview, a cell of __icons__ itself).
|
|
7541
|
+
* Return {element} or {error}.
|
|
7542
|
+
************************************************************/
|
|
7543
|
+
function yui_svg_icon_element(svg_text) {
|
|
7544
|
+
let clean = yui_svg_sanitize(svg_text);
|
|
7545
|
+
if (clean.error) return { error: clean.error };
|
|
7546
|
+
let el = document.createElement("span");
|
|
7547
|
+
el.className = "USER_ICON_PREVIEW";
|
|
7548
|
+
let mask = svg_mask_url(clean.svg);
|
|
7549
|
+
el.style.setProperty("-webkit-mask-image", mask);
|
|
7550
|
+
el.style.setProperty("mask-image", mask);
|
|
7551
|
+
return {
|
|
7552
|
+
element: el,
|
|
7553
|
+
dropped: clean.dropped
|
|
7554
|
+
};
|
|
7555
|
+
}
|
|
7556
|
+
/************************************************************
|
|
7557
|
+
* Write the stylesheet of the user icons again, from the map.
|
|
7558
|
+
************************************************************/
|
|
7559
|
+
function rebuild_user_icons_stylesheet() {
|
|
7560
|
+
let css = "";
|
|
7561
|
+
for (const [id, icon] of __user_icons__) css += `.${yui_user_icon_class(id)}::before {-webkit-mask-image: ${icon.mask}; mask-image: ${icon.mask};}\n`;
|
|
7562
|
+
try {
|
|
7563
|
+
let el = document.getElementById(USER_ICONS_STYLE_ID);
|
|
7564
|
+
if (!el) {
|
|
7565
|
+
el = document.createElement("style");
|
|
7566
|
+
el.id = USER_ICONS_STYLE_ID;
|
|
7567
|
+
document.head.appendChild(el);
|
|
7568
|
+
}
|
|
7569
|
+
el.textContent = css;
|
|
7570
|
+
} catch (e) {
|
|
7571
|
+
log_error(`user icons: cannot write the stylesheet: ${e}`);
|
|
7572
|
+
}
|
|
7573
|
+
for (const name of Object.keys(__icon_defined__)) if (name.startsWith("yi-u-")) delete __icon_defined__[name];
|
|
7574
|
+
}
|
|
7575
|
+
/************************************************************
|
|
7576
|
+
* Validate one node of __icons__.
|
|
7577
|
+
* Return the entry to keep, or null (warning logged).
|
|
7578
|
+
************************************************************/
|
|
7579
|
+
function user_icon_entry(node) {
|
|
7580
|
+
let id = node && node.id;
|
|
7581
|
+
if (typeof id !== "string" || !USER_ICON_ID_RE.test(id)) {
|
|
7582
|
+
log_warning(`user icons: bad icon name '${id}': lowercase letters, digits and '-' only`);
|
|
7583
|
+
return null;
|
|
7584
|
+
}
|
|
7585
|
+
let clean = yui_svg_sanitize(node.svg);
|
|
7586
|
+
if (clean.error) {
|
|
7587
|
+
log_warning(`user icons: icon '${id}' not drawn: ${clean.error}`);
|
|
7588
|
+
return null;
|
|
7589
|
+
}
|
|
7590
|
+
return {
|
|
7591
|
+
svg: clean.svg,
|
|
7592
|
+
mask: svg_mask_url(clean.svg)
|
|
7593
|
+
};
|
|
7594
|
+
}
|
|
7595
|
+
/************************************************************
|
|
7596
|
+
* Replace every user icon with the nodes of __icons__.
|
|
7597
|
+
* Return the number of icons registered.
|
|
7598
|
+
************************************************************/
|
|
7599
|
+
function yui_icons_set_user(nodes) {
|
|
7600
|
+
__user_icons__.clear();
|
|
7601
|
+
if (Array.isArray(nodes)) for (const node of nodes) {
|
|
7602
|
+
let entry = user_icon_entry(node);
|
|
7603
|
+
if (entry) __user_icons__.set(node.id, entry);
|
|
7604
|
+
}
|
|
7605
|
+
else if (nodes) log_error(`user icons: the nodes of ${ICONS_TOPIC} must be a list`);
|
|
7606
|
+
rebuild_user_icons_stylesheet();
|
|
7607
|
+
return __user_icons__.size;
|
|
7608
|
+
}
|
|
7609
|
+
/************************************************************
|
|
7610
|
+
* A node of __icons__ was created or updated.
|
|
7611
|
+
* Return true if the icon is drawn.
|
|
7612
|
+
************************************************************/
|
|
7613
|
+
function yui_icons_put_user(node) {
|
|
7614
|
+
let entry = user_icon_entry(node);
|
|
7615
|
+
if (entry) __user_icons__.set(node.id, entry);
|
|
7616
|
+
else if (node && typeof node.id === "string") __user_icons__.delete(node.id);
|
|
7617
|
+
rebuild_user_icons_stylesheet();
|
|
7618
|
+
return !!entry;
|
|
7619
|
+
}
|
|
7620
|
+
/************************************************************
|
|
7621
|
+
* A node of __icons__ was deleted.
|
|
7622
|
+
************************************************************/
|
|
7623
|
+
function yui_icons_remove_user(id) {
|
|
7624
|
+
__user_icons__.delete(id);
|
|
7625
|
+
rebuild_user_icons_stylesheet();
|
|
7626
|
+
}
|
|
7627
|
+
/************************************************************
|
|
7628
|
+
* Every icon a user can choose: the library's, read from the
|
|
7629
|
+
* loaded stylesheets (an app may extend yui_icons.css, so it
|
|
7630
|
+
* is asked, not listed), then the user's.
|
|
7631
|
+
* Return [{name, user}], each half sorted by name.
|
|
7632
|
+
************************************************************/
|
|
7633
|
+
function yui_icons_list() {
|
|
7634
|
+
let library = /* @__PURE__ */ new Set();
|
|
7635
|
+
try {
|
|
7636
|
+
for (const sheet of Array.from(document.styleSheets || [])) {
|
|
7637
|
+
if (sheet.ownerNode && sheet.ownerNode.id === USER_ICONS_STYLE_ID) continue;
|
|
7638
|
+
let rules;
|
|
7639
|
+
try {
|
|
7640
|
+
rules = sheet.cssRules;
|
|
7641
|
+
} catch (e) {
|
|
7642
|
+
continue;
|
|
7643
|
+
}
|
|
7644
|
+
for (const rule of Array.from(rules || [])) {
|
|
7645
|
+
let selector = rule.selectorText || "";
|
|
7646
|
+
for (const m of selector.matchAll(/\.(yi-[a-z0-9-]+)::?before/g)) if (!m[1].startsWith("yi-u-")) library.add(m[1]);
|
|
7647
|
+
}
|
|
7648
|
+
}
|
|
7649
|
+
} catch (e) {
|
|
7650
|
+
log_error(`user icons: cannot read the stylesheets: ${e}`);
|
|
7651
|
+
}
|
|
7652
|
+
let list = Array.from(library).sort().map((name) => ({
|
|
7653
|
+
name,
|
|
7654
|
+
user: false
|
|
7655
|
+
}));
|
|
7656
|
+
let users = Array.from(__user_icons__.keys()).sort();
|
|
7657
|
+
for (const id of users) list.push({
|
|
7658
|
+
name: yui_user_icon_class(id),
|
|
7659
|
+
user: true
|
|
7660
|
+
});
|
|
7661
|
+
return list;
|
|
7662
|
+
}
|
|
7088
7663
|
/************************************************************
|
|
7089
7664
|
* JSON type discriminator (viewer vocabulary)
|
|
7090
7665
|
************************************************************/
|
|
@@ -7483,6 +8058,107 @@ function datetime_local_to_epoch(value) {
|
|
|
7483
8058
|
return Math.floor(date.getTime() / 1e3);
|
|
7484
8059
|
}
|
|
7485
8060
|
//#endregion
|
|
8061
|
+
//#region src/form_json_field.js
|
|
8062
|
+
/***********************************************************************
|
|
8063
|
+
* form_json_field.js
|
|
8064
|
+
*
|
|
8065
|
+
* Pure logic of a json field of C_YUI_FORM: what a jsoneditor
|
|
8066
|
+
* holds, read as the value its column stores.
|
|
8067
|
+
*
|
|
8068
|
+
* The editor answers its content in one of two shapes -- {json}
|
|
8069
|
+
* (tree mode) or {text} (text mode, whatever the reader typed).
|
|
8070
|
+
* A text that does not parse used to be caught and replaced by
|
|
8071
|
+
* `{}` or `[]`, and SAVED: a trailing comma wiped the column, with
|
|
8072
|
+
* no log and no message. A text that is not json, or json of the
|
|
8073
|
+
* wrong shape (a list in a dict column), is an error now, and the
|
|
8074
|
+
* form refuses to save while a field holds one.
|
|
8075
|
+
*
|
|
8076
|
+
* Copyright (c) 2026, ArtGins.
|
|
8077
|
+
* All Rights Reserved.
|
|
8078
|
+
***********************************************************************/
|
|
8079
|
+
var SHAPE_OF_TYPE = {
|
|
8080
|
+
object: "dict",
|
|
8081
|
+
dict: "dict",
|
|
8082
|
+
template: "dict",
|
|
8083
|
+
array: "list",
|
|
8084
|
+
list: "list",
|
|
8085
|
+
table: "list",
|
|
8086
|
+
coordinates: "container"
|
|
8087
|
+
};
|
|
8088
|
+
/************************************************************
|
|
8089
|
+
* The shape `type` stores: "dict", "list", "container" or "any".
|
|
8090
|
+
************************************************************/
|
|
8091
|
+
function json_field_shape(type) {
|
|
8092
|
+
return SHAPE_OF_TYPE[type] || "any";
|
|
8093
|
+
}
|
|
8094
|
+
/************************************************************
|
|
8095
|
+
* The empty value of a shape: what a blank editor stores.
|
|
8096
|
+
************************************************************/
|
|
8097
|
+
function json_field_empty(shape) {
|
|
8098
|
+
if (shape === "list") return [];
|
|
8099
|
+
return {};
|
|
8100
|
+
}
|
|
8101
|
+
function value_fits(value, shape) {
|
|
8102
|
+
let is_list = Array.isArray(value);
|
|
8103
|
+
let is_dict = value !== null && typeof value === "object" && !is_list;
|
|
8104
|
+
switch (shape) {
|
|
8105
|
+
case "dict": return is_dict;
|
|
8106
|
+
case "list": return is_list;
|
|
8107
|
+
case "container": return is_dict || is_list;
|
|
8108
|
+
default: return true;
|
|
8109
|
+
}
|
|
8110
|
+
}
|
|
8111
|
+
/************************************************************
|
|
8112
|
+
* Parse what a json field holds.
|
|
8113
|
+
*
|
|
8114
|
+
* `value` is a json string (what the form reads out of an editor)
|
|
8115
|
+
* or an already parsed value; an editor's content goes through
|
|
8116
|
+
* json_editor_value() first.
|
|
8117
|
+
* Returns {value, error}: `error` is "" when the value is good, else
|
|
8118
|
+
* an i18n key; `value` is then the empty value of the shape and must
|
|
8119
|
+
* NOT be stored.
|
|
8120
|
+
*
|
|
8121
|
+
* A blank text is not an error: it is the empty value.
|
|
8122
|
+
************************************************************/
|
|
8123
|
+
function parse_json_field(value, type) {
|
|
8124
|
+
let shape = json_field_shape(type);
|
|
8125
|
+
if (typeof value === "string") {
|
|
8126
|
+
if (value.trim() === "") return {
|
|
8127
|
+
value: json_field_empty(shape),
|
|
8128
|
+
error: ""
|
|
8129
|
+
};
|
|
8130
|
+
try {
|
|
8131
|
+
value = JSON.parse(value);
|
|
8132
|
+
} catch (e) {
|
|
8133
|
+
return {
|
|
8134
|
+
value: json_field_empty(shape),
|
|
8135
|
+
error: "invalid json"
|
|
8136
|
+
};
|
|
8137
|
+
}
|
|
8138
|
+
}
|
|
8139
|
+
if (value === void 0) return {
|
|
8140
|
+
value: json_field_empty(shape),
|
|
8141
|
+
error: ""
|
|
8142
|
+
};
|
|
8143
|
+
if (!value_fits(value, shape)) return {
|
|
8144
|
+
value: json_field_empty(shape),
|
|
8145
|
+
error: "invalid json"
|
|
8146
|
+
};
|
|
8147
|
+
return {
|
|
8148
|
+
value,
|
|
8149
|
+
error: ""
|
|
8150
|
+
};
|
|
8151
|
+
}
|
|
8152
|
+
/************************************************************
|
|
8153
|
+
* What a jsoneditor content ({text} or {json}) holds: the
|
|
8154
|
+
* text as typed, or the tree-mode json.
|
|
8155
|
+
************************************************************/
|
|
8156
|
+
function json_editor_value(content) {
|
|
8157
|
+
if (!content) return;
|
|
8158
|
+
if (content.text !== void 0) return content.text;
|
|
8159
|
+
return content.json;
|
|
8160
|
+
}
|
|
8161
|
+
//#endregion
|
|
7486
8162
|
//#region src/c_yui_form.js
|
|
7487
8163
|
/***********************************************************************
|
|
7488
8164
|
* c_yui_form.js
|
|
@@ -7847,10 +8523,61 @@ function build_ui$15(gobj) {
|
|
|
7847
8523
|
function destroy_ui$10(gobj) {
|
|
7848
8524
|
let $container = gobj_read_attr(gobj, "$container");
|
|
7849
8525
|
if ($container) {
|
|
8526
|
+
destroy_widgets(gobj, $container);
|
|
7850
8527
|
if ($container.parentNode) $container.parentNode.removeChild($container);
|
|
7851
8528
|
gobj_write_attr(gobj, "$container", null);
|
|
7852
8529
|
}
|
|
7853
8530
|
}
|
|
8531
|
+
/************************************************************
|
|
8532
|
+
* The icon a table cell draws as its control (delete the row,
|
|
8533
|
+
* add a nested row): an element, so it carries its name. Drawn
|
|
8534
|
+
* by Tabulator on every render, so t() at render time is
|
|
8535
|
+
* current.
|
|
8536
|
+
************************************************************/
|
|
8537
|
+
function cell_icon(icon_class, key) {
|
|
8538
|
+
let $i = document.createElement("i");
|
|
8539
|
+
$i.className = icon_class;
|
|
8540
|
+
$i.setAttribute("title", t(key));
|
|
8541
|
+
$i.setAttribute("aria-label", t(key));
|
|
8542
|
+
return $i;
|
|
8543
|
+
}
|
|
8544
|
+
/************************************************************
|
|
8545
|
+
* Destroy the third-party widgets the form built. Removing
|
|
8546
|
+
* their DOM is not enough: Tom Select keeps listeners on
|
|
8547
|
+
* `document` and `window`, the jsoneditor is a live Svelte app
|
|
8548
|
+
* and a Tabulator keeps its observers -- each one a closure over
|
|
8549
|
+
* this form, alive for the life of the page. Nested tables go
|
|
8550
|
+
* first: their parent's destroy drops the rows they hang from.
|
|
8551
|
+
************************************************************/
|
|
8552
|
+
function destroy_widgets(gobj, $container) {
|
|
8553
|
+
let destroy = (what, widget) => {
|
|
8554
|
+
try {
|
|
8555
|
+
widget.destroy();
|
|
8556
|
+
} catch (e) {
|
|
8557
|
+
log_warning(`${gobj_short_name(gobj)}: cannot destroy ${what}: ${e}`);
|
|
8558
|
+
}
|
|
8559
|
+
};
|
|
8560
|
+
$container.querySelectorAll(".yui-tabulator-table-nested").forEach(($el) => {
|
|
8561
|
+
if ($el.tabulator) {
|
|
8562
|
+
destroy("nested table", $el.tabulator);
|
|
8563
|
+
$el.tabulator = null;
|
|
8564
|
+
}
|
|
8565
|
+
});
|
|
8566
|
+
$container.querySelectorAll(".yui-form-data-input").forEach(($el) => {
|
|
8567
|
+
if ($el.tom_select) {
|
|
8568
|
+
destroy("select", $el.tom_select);
|
|
8569
|
+
$el.tom_select = null;
|
|
8570
|
+
}
|
|
8571
|
+
if ($el.jsoneditor) {
|
|
8572
|
+
destroy("json editor", $el.jsoneditor);
|
|
8573
|
+
$el.jsoneditor = null;
|
|
8574
|
+
}
|
|
8575
|
+
if ($el.tabulator) {
|
|
8576
|
+
destroy("table", $el.tabulator);
|
|
8577
|
+
$el.tabulator = null;
|
|
8578
|
+
}
|
|
8579
|
+
});
|
|
8580
|
+
}
|
|
7854
8581
|
/******************************************************************
|
|
7855
8582
|
* Build form with bulma and createElement2
|
|
7856
8583
|
******************************************************************/
|
|
@@ -7908,6 +8635,7 @@ function build_form(gobj) {
|
|
|
7908
8635
|
function build_html_form(gobj, $form, prefix, template) {
|
|
7909
8636
|
Object.entries(template).forEach(([key, value]) => {
|
|
7910
8637
|
const field_desc = template_get_field_desc(key, value);
|
|
8638
|
+
if (!prefix && yui_icons_is_svg_field(gobj_read_str_attr(gobj, "topic_name"), field_desc.name)) field_desc.type = "svg";
|
|
7911
8639
|
let html_field_conf = build_form_field_conf(gobj, field_desc);
|
|
7912
8640
|
html_field_conf.name = field_desc.name;
|
|
7913
8641
|
let topic_name = gobj_read_str_attr(gobj, "topic_name");
|
|
@@ -8005,8 +8733,17 @@ function build_form_field_conf(gobj, field_desc) {
|
|
|
8005
8733
|
case "file":
|
|
8006
8734
|
field_conf.tag = "file";
|
|
8007
8735
|
break;
|
|
8008
|
-
case "image":
|
|
8009
8736
|
case "icon":
|
|
8737
|
+
field_conf.tag = "select2";
|
|
8738
|
+
field_conf.options = yui_icons_list().map((icon) => icon.name);
|
|
8739
|
+
break;
|
|
8740
|
+
case "svg":
|
|
8741
|
+
field_conf.tag = "textarea";
|
|
8742
|
+
field_conf.extras.rows = 6;
|
|
8743
|
+
field_conf.extras.spellcheck = "false";
|
|
8744
|
+
field_conf.extras.class = "textarea is-family-monospace";
|
|
8745
|
+
break;
|
|
8746
|
+
case "image":
|
|
8010
8747
|
case "string":
|
|
8011
8748
|
field_conf.tag = "input";
|
|
8012
8749
|
field_conf.inputType = "text";
|
|
@@ -8394,7 +9131,13 @@ function create_form_field(gobj, $form, prefix, field_desc, { tag, inputType, na
|
|
|
8394
9131
|
{ class: "" },
|
|
8395
9132
|
[[
|
|
8396
9133
|
"button",
|
|
8397
|
-
{
|
|
9134
|
+
{
|
|
9135
|
+
class: "button p-1",
|
|
9136
|
+
title: t("add"),
|
|
9137
|
+
"data-i18n-title": "add",
|
|
9138
|
+
"aria-label": t("add"),
|
|
9139
|
+
"data-i18n-aria-label": "add"
|
|
9140
|
+
},
|
|
8398
9141
|
[[
|
|
8399
9142
|
"span",
|
|
8400
9143
|
{ class: "icon m-0" },
|
|
@@ -8531,6 +9274,7 @@ function create_form_field(gobj, $form, prefix, field_desc, { tag, inputType, na
|
|
|
8531
9274
|
else if (required) attrs.required = "";
|
|
8532
9275
|
$extend = createElement2(["textarea", attrs]);
|
|
8533
9276
|
$control.appendChild($extend);
|
|
9277
|
+
if (field_desc.type === "svg") attach_svg_preview(gobj, $control, $extend);
|
|
8534
9278
|
break;
|
|
8535
9279
|
}
|
|
8536
9280
|
case "select": {
|
|
@@ -8551,7 +9295,7 @@ function create_form_field(gobj, $form, prefix, field_desc, { tag, inputType, na
|
|
|
8551
9295
|
value: option,
|
|
8552
9296
|
i18n: option
|
|
8553
9297
|
},
|
|
8554
|
-
option
|
|
9298
|
+
document.createTextNode(String(option))
|
|
8555
9299
|
]),
|
|
8556
9300
|
{ "change": function(evt) {
|
|
8557
9301
|
gobj_send_event(gobj, "EV_RECORD_CHANGED", {}, gobj);
|
|
@@ -8569,6 +9313,7 @@ function create_form_field(gobj, $form, prefix, field_desc, { tag, inputType, na
|
|
|
8569
9313
|
log_error(sprintf("%s: select2 field '%s' options not an array (type=%s, real_type=%s); rendering empty", gobj_short_name(gobj), name, field_desc.type, field_desc.real_type));
|
|
8570
9314
|
opts = [];
|
|
8571
9315
|
}
|
|
9316
|
+
let is_icon = field_desc.type === "icon";
|
|
8572
9317
|
let extend = [
|
|
8573
9318
|
"select",
|
|
8574
9319
|
{
|
|
@@ -8576,7 +9321,11 @@ function create_form_field(gobj, $form, prefix, field_desc, { tag, inputType, na
|
|
|
8576
9321
|
class: "",
|
|
8577
9322
|
multiple: true
|
|
8578
9323
|
},
|
|
8579
|
-
opts.map((option) => [
|
|
9324
|
+
opts.map((option) => is_icon ? [
|
|
9325
|
+
"option",
|
|
9326
|
+
{ value: option },
|
|
9327
|
+
option
|
|
9328
|
+
] : [
|
|
8580
9329
|
"option",
|
|
8581
9330
|
{
|
|
8582
9331
|
value: option,
|
|
@@ -8590,7 +9339,8 @@ function create_form_field(gobj, $form, prefix, field_desc, { tag, inputType, na
|
|
|
8590
9339
|
$extend.tom_select = new TomSelect($extend, {
|
|
8591
9340
|
allowEmptyOption: true,
|
|
8592
9341
|
placeholder,
|
|
8593
|
-
maxItems: field_desc.type === "fkey" && field_desc.real_type === "string" ? 1 : null,
|
|
9342
|
+
maxItems: is_icon || field_desc.type === "fkey" && field_desc.real_type === "string" ? 1 : null,
|
|
9343
|
+
render: is_icon ? icon_select_render() : void 0,
|
|
8594
9344
|
plugins: {
|
|
8595
9345
|
"clear_button": { "title": t("remove all selected options") },
|
|
8596
9346
|
"no_active_items": {},
|
|
@@ -8624,13 +9374,19 @@ function create_form_field(gobj, $form, prefix, field_desc, { tag, inputType, na
|
|
|
8624
9374
|
break;
|
|
8625
9375
|
}
|
|
8626
9376
|
case "radio": {
|
|
8627
|
-
let
|
|
8628
|
-
|
|
8629
|
-
|
|
8630
|
-
|
|
8631
|
-
|
|
8632
|
-
|
|
8633
|
-
|
|
9377
|
+
let label_key = String(options === void 0 || options === null ? "" : options);
|
|
9378
|
+
$extend = createElement2([
|
|
9379
|
+
"label",
|
|
9380
|
+
{ class: "radio" },
|
|
9381
|
+
[["input", {
|
|
9382
|
+
type: "radio",
|
|
9383
|
+
name
|
|
9384
|
+
}], [
|
|
9385
|
+
"span",
|
|
9386
|
+
{ i18n: label_key },
|
|
9387
|
+
label_key
|
|
9388
|
+
]]
|
|
9389
|
+
]);
|
|
8634
9390
|
$control.appendChild($extend);
|
|
8635
9391
|
break;
|
|
8636
9392
|
}
|
|
@@ -8650,6 +9406,10 @@ function create_form_field(gobj, $form, prefix, field_desc, { tag, inputType, na
|
|
|
8650
9406
|
props: {
|
|
8651
9407
|
readOnly: !!readonly,
|
|
8652
9408
|
onChange: function() {
|
|
9409
|
+
if ($extend.yui_json_error) {
|
|
9410
|
+
check_json_editor($extend);
|
|
9411
|
+
mark_field_validity($extend);
|
|
9412
|
+
}
|
|
8653
9413
|
gobj_send_event(gobj, "EV_RECORD_CHANGED", {}, gobj);
|
|
8654
9414
|
},
|
|
8655
9415
|
timestampTag: function({ field, value, path }) {
|
|
@@ -8758,6 +9518,71 @@ function attach_color_value($control, $input) {
|
|
|
8758
9518
|
$control.appendChild($value);
|
|
8759
9519
|
}
|
|
8760
9520
|
/******************************************************************
|
|
9521
|
+
* How the icon picker draws a name: the icon, then the name.
|
|
9522
|
+
* The names come from yui_icons_list() -- class names, already
|
|
9523
|
+
* [a-z0-9-] -- and are escaped anyway, because they are written
|
|
9524
|
+
* as markup.
|
|
9525
|
+
******************************************************************/
|
|
9526
|
+
function icon_select_render() {
|
|
9527
|
+
function draw(data, escape) {
|
|
9528
|
+
return `<div class="ICON_SELECT_ITEM"><span class="icon"><i class="${escape(data.value)}" aria-hidden="true"></i></span><span>${escape(data.text)}</span></div>`;
|
|
9529
|
+
}
|
|
9530
|
+
return {
|
|
9531
|
+
option: draw,
|
|
9532
|
+
item: draw
|
|
9533
|
+
};
|
|
9534
|
+
}
|
|
9535
|
+
/******************************************************************
|
|
9536
|
+
* Why a drawing cannot be an icon, in the reader's language.
|
|
9537
|
+
* The causes are the fixed set yui_svg_sanitize() answers, each
|
|
9538
|
+
* written here as a literal t() so validate-locales sees it.
|
|
9539
|
+
******************************************************************/
|
|
9540
|
+
function svg_error_text(error) {
|
|
9541
|
+
switch (error) {
|
|
9542
|
+
case "empty svg": return t("empty svg");
|
|
9543
|
+
case "svg too big": return t("svg too big");
|
|
9544
|
+
case "not an svg document": return t("not an svg document");
|
|
9545
|
+
case "svg without size": return t("svg without size");
|
|
9546
|
+
case "svg without shapes": return t("svg without shapes");
|
|
9547
|
+
default:
|
|
9548
|
+
log_error(`svg_error_text(): unknown cause '${error}'`);
|
|
9549
|
+
return error;
|
|
9550
|
+
}
|
|
9551
|
+
}
|
|
9552
|
+
/******************************************************************
|
|
9553
|
+
* The icon a drawing (`svg` of __icons__) makes, below its text
|
|
9554
|
+
* area, redrawn as it is typed: what is saved is what the app
|
|
9555
|
+
* will show. A drawing that cannot be drawn says why, and what
|
|
9556
|
+
* the sanitizer left out is named.
|
|
9557
|
+
******************************************************************/
|
|
9558
|
+
function attach_svg_preview(gobj, $control, $textarea) {
|
|
9559
|
+
let $preview = createElement2([
|
|
9560
|
+
"div",
|
|
9561
|
+
{ class: "SVG_PREVIEW is-flex is-align-items-center mt-2" },
|
|
9562
|
+
[["span", { class: "SVG_PREVIEW_ICON icon is-large is-size-3" }], ["span", { class: "SVG_PREVIEW_NOTE is-size-7 yui-text-quiet ml-2" }]]
|
|
9563
|
+
]);
|
|
9564
|
+
$control.appendChild($preview);
|
|
9565
|
+
let $icon = $preview.querySelector(".SVG_PREVIEW_ICON");
|
|
9566
|
+
let $note = $preview.querySelector(".SVG_PREVIEW_NOTE");
|
|
9567
|
+
function redraw() {
|
|
9568
|
+
$icon.replaceChildren();
|
|
9569
|
+
$note.textContent = "";
|
|
9570
|
+
if (!$textarea.value || !$textarea.value.trim()) return;
|
|
9571
|
+
let preview = yui_svg_icon_element($textarea.value);
|
|
9572
|
+
if (preview.error) {
|
|
9573
|
+
$note.textContent = svg_error_text(preview.error);
|
|
9574
|
+
return;
|
|
9575
|
+
}
|
|
9576
|
+
$icon.appendChild(preview.element);
|
|
9577
|
+
if (preview.dropped && preview.dropped.length > 0) $note.textContent = `${t("left out")}: ${preview.dropped.join(" ")}`;
|
|
9578
|
+
}
|
|
9579
|
+
$textarea.yui_svg_preview = redraw;
|
|
9580
|
+
$textarea.addEventListener("input", function() {
|
|
9581
|
+
redraw();
|
|
9582
|
+
gobj_send_event(gobj, "EV_RECORD_CHANGED", {}, gobj);
|
|
9583
|
+
});
|
|
9584
|
+
}
|
|
9585
|
+
/******************************************************************
|
|
8761
9586
|
* `readonly` is an attribute of a TEXT control and of nothing else.
|
|
8762
9587
|
*
|
|
8763
9588
|
* A `<select>` ignores it. So does a checkbox, and so does a radio:
|
|
@@ -8908,7 +9733,7 @@ function create_tabulator$1(gobj, $extend, name, template) {
|
|
|
8908
9733
|
};
|
|
8909
9734
|
if (gobj_read_bool_attr(gobj, "with_delete_row_btn")) columns.push({
|
|
8910
9735
|
formatter: function(cell, formatterParams) {
|
|
8911
|
-
return "
|
|
9736
|
+
return cell_icon("yi-trash has-text-danger", "delete");
|
|
8912
9737
|
},
|
|
8913
9738
|
width: 40,
|
|
8914
9739
|
hozAlign: "center",
|
|
@@ -8989,7 +9814,7 @@ function template2columns(gobj, columns, template, sub_elements) {
|
|
|
8989
9814
|
});
|
|
8990
9815
|
Object.assign(column, {
|
|
8991
9816
|
formatter: function(cell, formatterParams) {
|
|
8992
|
-
return "
|
|
9817
|
+
return cell_icon("yi-plus has-text-link", "add");
|
|
8993
9818
|
},
|
|
8994
9819
|
hozAlign: "center",
|
|
8995
9820
|
cellClick: function(evt, cell) {
|
|
@@ -9131,6 +9956,7 @@ function template2columns(gobj, columns, template, sub_elements) {
|
|
|
9131
9956
|
* out-of-range number is more precise than anything generic here.
|
|
9132
9957
|
************************************************************/
|
|
9133
9958
|
function field_validation_message($input) {
|
|
9959
|
+
if ($input.yui_json_error) return t($input.yui_json_error);
|
|
9134
9960
|
let v = $input.validity;
|
|
9135
9961
|
if (v && v.valueMissing) return t("this field is required");
|
|
9136
9962
|
return $input.validationMessage;
|
|
@@ -9143,7 +9969,7 @@ function field_validation_message($input) {
|
|
|
9143
9969
|
function mark_field_validity($input) {
|
|
9144
9970
|
let $h = $input.parentNode ? $input.parentNode.querySelector(".help") : null;
|
|
9145
9971
|
let v = $input.validity;
|
|
9146
|
-
if (!v || v.valid) {
|
|
9972
|
+
if ((!v || v.valid) && !$input.yui_json_error) {
|
|
9147
9973
|
$input.classList.remove("is-danger");
|
|
9148
9974
|
if ($h) {
|
|
9149
9975
|
$h.textContent = "";
|
|
@@ -9164,6 +9990,12 @@ function mark_field_validity($input) {
|
|
|
9164
9990
|
function validate_form(gobj, $form) {
|
|
9165
9991
|
let validated = true;
|
|
9166
9992
|
if (!$form.checkValidity()) validated = false;
|
|
9993
|
+
$form.querySelectorAll(".jsoneditor.yui-form-data-input").forEach(($editor) => {
|
|
9994
|
+
if (!check_json_editor($editor)) {
|
|
9995
|
+
validated = false;
|
|
9996
|
+
mark_field_validity($editor);
|
|
9997
|
+
}
|
|
9998
|
+
});
|
|
9167
9999
|
$form.querySelectorAll(".yui-tabulator-table").forEach(($table) => {
|
|
9168
10000
|
if (!$table.tabulator.validate()) validated = false;
|
|
9169
10001
|
$table.querySelectorAll(".yui-tabulator-table-nested").forEach(($table_nested) => {
|
|
@@ -9173,6 +10005,22 @@ function validate_form(gobj, $form) {
|
|
|
9173
10005
|
return validated;
|
|
9174
10006
|
}
|
|
9175
10007
|
/************************************************************
|
|
10008
|
+
* Does the jsoneditor `$editor` hold json its column can store?
|
|
10009
|
+
* Leaves the answer on the element (`yui_json_error`, an i18n key
|
|
10010
|
+
* or ""), where mark_field_validity() reads it.
|
|
10011
|
+
************************************************************/
|
|
10012
|
+
function check_json_editor($editor) {
|
|
10013
|
+
let jsoneditor = $editor.jsoneditor;
|
|
10014
|
+
let field_desc = $editor.field_desc;
|
|
10015
|
+
if (!jsoneditor || !field_desc || $editor.hasAttribute("readonly")) {
|
|
10016
|
+
$editor.yui_json_error = "";
|
|
10017
|
+
return true;
|
|
10018
|
+
}
|
|
10019
|
+
let r = parse_json_field(json_editor_value(jsoneditor.get()), field_desc.type);
|
|
10020
|
+
$editor.yui_json_error = r.error;
|
|
10021
|
+
return !r.error;
|
|
10022
|
+
}
|
|
10023
|
+
/************************************************************
|
|
9176
10024
|
* Function to get input value based on its type
|
|
9177
10025
|
************************************************************/
|
|
9178
10026
|
function getInputValue($input) {
|
|
@@ -9272,7 +10120,10 @@ function clear_data(gobj, $form) {
|
|
|
9272
10120
|
else if ($input.type === "radio") $input.checked = false;
|
|
9273
10121
|
else if ($input.type === "datetime-local") $input.value = null;
|
|
9274
10122
|
else if ($input.type === "select-multiple") $input.tom_select.clear();
|
|
9275
|
-
else
|
|
10123
|
+
else {
|
|
10124
|
+
$input.value = null;
|
|
10125
|
+
if ($input.yui_svg_preview) $input.yui_svg_preview();
|
|
10126
|
+
}
|
|
9276
10127
|
}
|
|
9277
10128
|
});
|
|
9278
10129
|
$form.querySelectorAll(".FILE_FIELD").forEach(($file) => {
|
|
@@ -9373,12 +10224,17 @@ function set_form_values(gobj, template, $form, record) {
|
|
|
9373
10224
|
break;
|
|
9374
10225
|
case "textarea":
|
|
9375
10226
|
$input.value = value;
|
|
10227
|
+
if ($input.yui_svg_preview) $input.yui_svg_preview();
|
|
9376
10228
|
break;
|
|
9377
10229
|
case "select":
|
|
9378
10230
|
$input.value = value;
|
|
9379
10231
|
break;
|
|
9380
10232
|
case "select2":
|
|
9381
10233
|
$input.tom_select.clear();
|
|
10234
|
+
if (field_desc && field_desc.type === "icon" && is_string(value) && value && !$input.tom_select.options[value]) $input.tom_select.addOption({
|
|
10235
|
+
value,
|
|
10236
|
+
text: value
|
|
10237
|
+
});
|
|
9382
10238
|
$input.tom_select.setValue(value);
|
|
9383
10239
|
break;
|
|
9384
10240
|
case "checkbox":
|
|
@@ -9475,6 +10331,7 @@ function treedb_value_2_form_value(gobj, field_desc, value) {
|
|
|
9475
10331
|
case "color":
|
|
9476
10332
|
case "image":
|
|
9477
10333
|
case "icon":
|
|
10334
|
+
case "svg":
|
|
9478
10335
|
case "tel":
|
|
9479
10336
|
case "template":
|
|
9480
10337
|
case "table":
|
|
@@ -9521,23 +10378,23 @@ function treedb_value_2_form_value(gobj, field_desc, value) {
|
|
|
9521
10378
|
return value;
|
|
9522
10379
|
}
|
|
9523
10380
|
/************************************************************
|
|
10381
|
+
* A json field's value, parsed. validate_form() refuses a field
|
|
10382
|
+
* that does not parse, so reaching the error here is a path that
|
|
10383
|
+
* skipped it: logged, never quiet.
|
|
10384
|
+
************************************************************/
|
|
10385
|
+
function parse_json_value(gobj, field_desc, value) {
|
|
10386
|
+
let r = parse_json_field(value, field_desc.type);
|
|
10387
|
+
if (r.error) log_error(`${gobj_short_name(gobj)}: field '${field_desc.name}' (${field_desc.type}) holds no valid json, stored as empty`);
|
|
10388
|
+
return r.value;
|
|
10389
|
+
}
|
|
10390
|
+
/************************************************************
|
|
9524
10391
|
* Convert from frontend to backend
|
|
9525
10392
|
* operation: "create" "update"
|
|
9526
10393
|
************************************************************/
|
|
9527
10394
|
function form_value_2_treedb_value(gobj, field_desc, value) {
|
|
9528
10395
|
let type = field_desc.type;
|
|
9529
10396
|
let real_type = field_desc.real_type;
|
|
9530
|
-
if (gobj_read_str_attr(gobj, "render_mode") === "edit" && (type === "template" || type === "table" || type === "coordinates"))
|
|
9531
|
-
if (is_string(value)) try {
|
|
9532
|
-
value = JSON.parse(value);
|
|
9533
|
-
} catch (e) {
|
|
9534
|
-
value = type === "table" ? [] : {};
|
|
9535
|
-
}
|
|
9536
|
-
if (type === "table") {
|
|
9537
|
-
if (!is_array(value)) value = [];
|
|
9538
|
-
} else if (!is_object(value) && !is_array(value)) value = {};
|
|
9539
|
-
return value;
|
|
9540
|
-
}
|
|
10397
|
+
if (gobj_read_str_attr(gobj, "render_mode") === "edit" && (type === "template" || type === "table" || type === "coordinates")) return parse_json_value(gobj, field_desc, value);
|
|
9541
10398
|
switch (type) {
|
|
9542
10399
|
case "file": break;
|
|
9543
10400
|
case "fkey":
|
|
@@ -9565,19 +10422,16 @@ function form_value_2_treedb_value(gobj, field_desc, value) {
|
|
|
9565
10422
|
default: log_error("incompatible type for time: " + real_type);
|
|
9566
10423
|
}
|
|
9567
10424
|
break;
|
|
10425
|
+
case "icon":
|
|
10426
|
+
if (Array.isArray(value)) value = value.length > 0 ? value[0] : "";
|
|
10427
|
+
break;
|
|
9568
10428
|
case "date":
|
|
9569
10429
|
case "color":
|
|
9570
10430
|
case "image":
|
|
9571
|
-
case "
|
|
9572
|
-
case "
|
|
10431
|
+
case "tel":
|
|
10432
|
+
case "svg": break;
|
|
9573
10433
|
case "template":
|
|
9574
|
-
|
|
9575
|
-
value = JSON.parse(value);
|
|
9576
|
-
} catch (e) {
|
|
9577
|
-
value = {};
|
|
9578
|
-
}
|
|
9579
|
-
else if (is_object(value)) {}
|
|
9580
|
-
if (!is_object(value)) value = {};
|
|
10434
|
+
value = parse_json_value(gobj, field_desc, value);
|
|
9581
10435
|
break;
|
|
9582
10436
|
case "table":
|
|
9583
10437
|
case "id":
|
|
@@ -9594,13 +10448,7 @@ function form_value_2_treedb_value(gobj, field_desc, value) {
|
|
|
9594
10448
|
case "dict": break;
|
|
9595
10449
|
case "array":
|
|
9596
10450
|
case "list":
|
|
9597
|
-
|
|
9598
|
-
value = JSON.parse(value);
|
|
9599
|
-
} catch (e) {
|
|
9600
|
-
value = [];
|
|
9601
|
-
}
|
|
9602
|
-
else if (is_array(value)) {}
|
|
9603
|
-
if (!is_array(value)) value = [];
|
|
10451
|
+
value = parse_json_value(gobj, field_desc, value);
|
|
9604
10452
|
break;
|
|
9605
10453
|
case "real":
|
|
9606
10454
|
value = parseFloat(value) || 0;
|
|
@@ -9609,12 +10457,7 @@ function form_value_2_treedb_value(gobj, field_desc, value) {
|
|
|
9609
10457
|
value = parseBoolean(value);
|
|
9610
10458
|
break;
|
|
9611
10459
|
case "blob":
|
|
9612
|
-
|
|
9613
|
-
value = JSON.parse(value);
|
|
9614
|
-
} catch (e) {
|
|
9615
|
-
value = {};
|
|
9616
|
-
}
|
|
9617
|
-
else if (is_object(value)) {} else if (is_array(value)) {} else value = {};
|
|
10460
|
+
value = parse_json_value(gobj, field_desc, value);
|
|
9618
10461
|
break;
|
|
9619
10462
|
case "number": break;
|
|
9620
10463
|
case "coordinates":
|
|
@@ -9754,7 +10597,9 @@ function ac_add_table_row(gobj, event, kw, src) {
|
|
|
9754
10597
|
}
|
|
9755
10598
|
});
|
|
9756
10599
|
}
|
|
9757
|
-
}).catch(function(error) {
|
|
10600
|
+
}).catch(function(error) {
|
|
10601
|
+
log_error(`${gobj_short_name(gobj)}: cannot add a table row: ${error}`);
|
|
10602
|
+
});
|
|
9758
10603
|
setTimeout(function() {
|
|
9759
10604
|
if ($row) {
|
|
9760
10605
|
let $tabulator = $row.closest(".yui-tabulator-table");
|
|
@@ -10227,7 +11072,7 @@ function yui_maplibre_relocalize(map, t) {
|
|
|
10227
11072
|
*
|
|
10228
11073
|
* Map Manager
|
|
10229
11074
|
*
|
|
10230
|
-
* Copyright (c) 2025, ArtGins.
|
|
11075
|
+
* Copyright (c) 2025-2026, ArtGins.
|
|
10231
11076
|
* All Rights Reserved.
|
|
10232
11077
|
***********************************************************************/
|
|
10233
11078
|
/***************************************************************
|
|
@@ -10373,6 +11218,7 @@ function mt_start$16(gobj) {
|
|
|
10373
11218
|
function mt_stop$16(gobj) {
|
|
10374
11219
|
let shell = yui_shell_of(gobj);
|
|
10375
11220
|
if (shell) gobj_unsubscribe_event(shell, "EV_LANGUAGE_CHANGED", {}, gobj);
|
|
11221
|
+
gobj_stop_children(gobj);
|
|
10376
11222
|
return 0;
|
|
10377
11223
|
}
|
|
10378
11224
|
/***************************************************************
|
|
@@ -10662,52 +11508,24 @@ function find_device(gobj, id) {
|
|
|
10662
11508
|
return null;
|
|
10663
11509
|
}
|
|
10664
11510
|
/************************************************************
|
|
10665
|
-
* Event handler for click
|
|
11511
|
+
* Event handler for click: maplibre's callback only turns the
|
|
11512
|
+
* click into an event; the work is ac_marker_clicked().
|
|
11513
|
+
* Plain json: the marker's identity and where it is.
|
|
10666
11514
|
************************************************************/
|
|
10667
11515
|
function onClick(gobj, e) {
|
|
10668
|
-
|
|
10669
|
-
|
|
10670
|
-
|
|
10671
|
-
|
|
10672
|
-
if (gobj_service) {
|
|
10673
|
-
let window_service_name = `window-map-${clean_name(gobj_name(gobj_service))}`;
|
|
10674
|
-
let popupContent = createElement2([
|
|
10675
|
-
"div",
|
|
10676
|
-
{ class: "xmap columns m-0 p-0 is-flex-wrap-wrap" },
|
|
10677
|
-
gobj_read_attr(gobj_service, "$container")
|
|
10678
|
-
]);
|
|
10679
|
-
let gobj_window = gobj_create_service(window_service_name, "C_YUI_WINDOW", {
|
|
10680
|
-
$parent: document.getElementById("top-layer"),
|
|
10681
|
-
width: 700,
|
|
10682
|
-
height: 500,
|
|
10683
|
-
auto_save_size_and_position: false,
|
|
10684
|
-
center: true,
|
|
10685
|
-
showMax: false,
|
|
10686
|
-
content_size: true,
|
|
10687
|
-
title_prefix: gobj_name(gobj_service),
|
|
10688
|
-
title: "",
|
|
10689
|
-
icon: "yi-location-dot",
|
|
10690
|
-
logical_class: "MAP_MARKER_WINDOW",
|
|
10691
|
-
body: popupContent
|
|
10692
|
-
}, gobj);
|
|
10693
|
-
if (!gobj_window) {
|
|
10694
|
-
log_error(`${gobj_name(gobj)}: cannot create the marker window`);
|
|
10695
|
-
return;
|
|
10696
|
-
}
|
|
10697
|
-
gobj_start(gobj_window);
|
|
10698
|
-
} else {
|
|
10699
|
-
const popup = new maplibregl.Popup({
|
|
10700
|
-
closeButton: true,
|
|
10701
|
-
closeOnClick: true,
|
|
10702
|
-
closeOnMove: true,
|
|
10703
|
-
anchor: "center",
|
|
10704
|
-
maxWidth: "none"
|
|
10705
|
-
});
|
|
10706
|
-
const popupContent = `
|
|
10707
|
-
<b>${properties.name}</b><br>Id: ${properties.id}
|
|
10708
|
-
`;
|
|
10709
|
-
popup.setLngLat(coordinates).setHTML(popupContent).addTo(map);
|
|
11516
|
+
let feature = e && e.features && e.features[0];
|
|
11517
|
+
if (!feature) {
|
|
11518
|
+
log_error(`${gobj_name(gobj)}: marker click with no feature`);
|
|
11519
|
+
return;
|
|
10710
11520
|
}
|
|
11521
|
+
let properties = feature.properties || {};
|
|
11522
|
+
let coordinates = feature.geometry.coordinates.slice();
|
|
11523
|
+
gobj_send_event(gobj, "EV_MARKER_CLICKED", {
|
|
11524
|
+
gobj_service_name: properties.gobj_service_name || "",
|
|
11525
|
+
name: properties.name !== void 0 ? String(properties.name) : "",
|
|
11526
|
+
id: properties.id !== void 0 ? String(properties.id) : "",
|
|
11527
|
+
coordinates
|
|
11528
|
+
}, gobj);
|
|
10711
11529
|
}
|
|
10712
11530
|
/************************************************************
|
|
10713
11531
|
* Event handlers for dragging
|
|
@@ -10816,6 +11634,68 @@ function ac_refresh$7(gobj, event, kw, src) {
|
|
|
10816
11634
|
return 0;
|
|
10817
11635
|
}
|
|
10818
11636
|
/************************************************************
|
|
11637
|
+
* EV_MARKER_CLICKED {gobj_service_name, name, id, coordinates}
|
|
11638
|
+
*
|
|
11639
|
+
* A marker backed by a gobj service opens that service's view in
|
|
11640
|
+
* a window -- ONE per marker: a second click is told to the open
|
|
11641
|
+
* one (EV_SHOW). (It created a second window under the same service
|
|
11642
|
+
* name, moved the one $container into it and left the first one
|
|
11643
|
+
* empty; closing the first then unregistered the second's name.)
|
|
11644
|
+
* A marker without a service gets a popup with its name and id.
|
|
11645
|
+
************************************************************/
|
|
11646
|
+
function ac_marker_clicked(gobj, event, kw, src) {
|
|
11647
|
+
const map = gobj.priv.xmap;
|
|
11648
|
+
const gobj_service = kw.gobj_service_name ? gobj_find_service(kw.gobj_service_name, false) : null;
|
|
11649
|
+
if (gobj_service) {
|
|
11650
|
+
let window_service_name = `window-map-${clean_name(gobj_name(gobj_service))}`;
|
|
11651
|
+
let gobj_window = gobj_find_service(window_service_name, false);
|
|
11652
|
+
if (gobj_window) {
|
|
11653
|
+
gobj_send_event(gobj_window, "EV_SHOW", {}, gobj);
|
|
11654
|
+
return 0;
|
|
11655
|
+
}
|
|
11656
|
+
let popupContent = createElement2([
|
|
11657
|
+
"div",
|
|
11658
|
+
{ class: "xmap columns m-0 p-0 is-flex-wrap-wrap" },
|
|
11659
|
+
gobj_read_attr(gobj_service, "$container")
|
|
11660
|
+
]);
|
|
11661
|
+
gobj_window = gobj_create_service(window_service_name, "C_YUI_WINDOW", {
|
|
11662
|
+
$parent: document.getElementById("top-layer"),
|
|
11663
|
+
width: 700,
|
|
11664
|
+
height: 500,
|
|
11665
|
+
auto_save_size_and_position: false,
|
|
11666
|
+
center: true,
|
|
11667
|
+
showMax: false,
|
|
11668
|
+
content_size: true,
|
|
11669
|
+
title_prefix: gobj_name(gobj_service),
|
|
11670
|
+
title: "",
|
|
11671
|
+
icon: "yi-location-dot",
|
|
11672
|
+
logical_class: "MAP_MARKER_WINDOW",
|
|
11673
|
+
body: popupContent
|
|
11674
|
+
}, gobj);
|
|
11675
|
+
if (!gobj_window) {
|
|
11676
|
+
log_error(`${gobj_name(gobj)}: cannot create the marker window`);
|
|
11677
|
+
return -1;
|
|
11678
|
+
}
|
|
11679
|
+
gobj_start(gobj_window);
|
|
11680
|
+
return 0;
|
|
11681
|
+
}
|
|
11682
|
+
const popup = new maplibregl.Popup({
|
|
11683
|
+
closeButton: true,
|
|
11684
|
+
closeOnClick: true,
|
|
11685
|
+
closeOnMove: true,
|
|
11686
|
+
anchor: "center",
|
|
11687
|
+
maxWidth: "none"
|
|
11688
|
+
});
|
|
11689
|
+
let $content = document.createElement("div");
|
|
11690
|
+
let $name = document.createElement("b");
|
|
11691
|
+
$name.textContent = kw.name;
|
|
11692
|
+
$content.appendChild($name);
|
|
11693
|
+
$content.appendChild(document.createElement("br"));
|
|
11694
|
+
$content.appendChild(document.createTextNode(`Id: ${kw.id}`));
|
|
11695
|
+
popup.setLngLat(kw.coordinates).setDOMContent($content).addTo(map);
|
|
11696
|
+
return 0;
|
|
11697
|
+
}
|
|
11698
|
+
/************************************************************
|
|
10819
11699
|
*
|
|
10820
11700
|
************************************************************/
|
|
10821
11701
|
function ac_select(gobj, event, kw, src) {
|
|
@@ -10863,6 +11743,7 @@ function create_gclass$16(gclass_name) {
|
|
|
10863
11743
|
["EV_MAP_ON_LOAD", 0],
|
|
10864
11744
|
["EV_REFRESH", 0],
|
|
10865
11745
|
["EV_SELECT", 0],
|
|
11746
|
+
["EV_MARKER_CLICKED", 0],
|
|
10866
11747
|
["EV_SHOW", 0],
|
|
10867
11748
|
["EV_HIDE", 0]
|
|
10868
11749
|
], [["ST_IDLE", [
|
|
@@ -10896,6 +11777,11 @@ function create_gclass$16(gclass_name) {
|
|
|
10896
11777
|
ac_select,
|
|
10897
11778
|
null
|
|
10898
11779
|
],
|
|
11780
|
+
[
|
|
11781
|
+
"EV_MARKER_CLICKED",
|
|
11782
|
+
ac_marker_clicked,
|
|
11783
|
+
null
|
|
11784
|
+
],
|
|
10899
11785
|
[
|
|
10900
11786
|
"EV_SHOW",
|
|
10901
11787
|
ac_show$11,
|
|
@@ -11062,7 +11948,7 @@ function build_ui$14(gobj) {
|
|
|
11062
11948
|
class: "C_YUI_UPLOT",
|
|
11063
11949
|
style: "overflow:auto;"
|
|
11064
11950
|
}]);
|
|
11065
|
-
|
|
11951
|
+
gobj_write_attr(gobj, "$container", $container);
|
|
11066
11952
|
gobj_write_bool_attr(gobj, "own_container", true);
|
|
11067
11953
|
}
|
|
11068
11954
|
let uPlot_options = {
|
|
@@ -12424,7 +13310,7 @@ function ensure_drag_canvas_patch() {
|
|
|
12424
13310
|
* Displays JSON data as a hierarchical graph visualization
|
|
12425
13311
|
* Migrated from mx_json_viewer.js (mxGraph)
|
|
12426
13312
|
*
|
|
12427
|
-
* Copyright (c) 2025, ArtGins.
|
|
13313
|
+
* Copyright (c) 2025-2026, ArtGins.
|
|
12428
13314
|
* All Rights Reserved.
|
|
12429
13315
|
***********************************************************************/
|
|
12430
13316
|
/***************************************************************
|
|
@@ -12920,7 +13806,12 @@ function build_graph$4(gobj) {
|
|
|
12920
13806
|
});
|
|
12921
13807
|
if (priv.theme) graph.setTheme(priv.theme);
|
|
12922
13808
|
graph.on(NodeEvent.CLICK, (evt) => {
|
|
12923
|
-
|
|
13809
|
+
let client = evt && evt.client ? evt.client : null;
|
|
13810
|
+
gobj_send_event(gobj, "EV_NODE_CLICK", {
|
|
13811
|
+
id: evt && evt.target && evt.target.id ? String(evt.target.id) : "",
|
|
13812
|
+
client_x: client && typeof client.x === "number" ? client.x : 0,
|
|
13813
|
+
client_y: client && typeof client.y === "number" ? client.y : 0
|
|
13814
|
+
}, gobj);
|
|
12924
13815
|
});
|
|
12925
13816
|
graph.on("aftertransform", () => {
|
|
12926
13817
|
yui_graph_update_zoom(gobj_read_attr(gobj, "$container"), priv.graph);
|
|
@@ -13851,7 +14742,7 @@ function ac_center$4(gobj, event, kw, src) {
|
|
|
13851
14742
|
function ac_node_click$4(gobj, event, kw, src) {
|
|
13852
14743
|
let priv = gobj.priv;
|
|
13853
14744
|
let graph = priv.graph;
|
|
13854
|
-
let node_id = kw.
|
|
14745
|
+
let node_id = kw.id;
|
|
13855
14746
|
let nodedata;
|
|
13856
14747
|
try {
|
|
13857
14748
|
nodedata = graph.getNodeData(node_id);
|
|
@@ -17927,6 +18818,10 @@ function build_zone(gobj, zone) {
|
|
|
17927
18818
|
{
|
|
17928
18819
|
class: "GCLASS_ZONE_TOGGLE",
|
|
17929
18820
|
type: "button",
|
|
18821
|
+
title: t(zone.key),
|
|
18822
|
+
"data-i18n-title": zone.key,
|
|
18823
|
+
"aria-label": t(zone.key),
|
|
18824
|
+
"data-i18n-aria-label": zone.key,
|
|
17930
18825
|
"aria-expanded": collapsed ? "false" : "true"
|
|
17931
18826
|
},
|
|
17932
18827
|
[
|
|
@@ -18056,12 +18951,12 @@ function build_attrs(attrs) {
|
|
|
18056
18951
|
[
|
|
18057
18952
|
"td",
|
|
18058
18953
|
{ class: "GCLASS_CELL_DEFAULT" },
|
|
18059
|
-
a.default_value
|
|
18954
|
+
document.createTextNode(String(a.default_value ?? ""))
|
|
18060
18955
|
],
|
|
18061
18956
|
[
|
|
18062
18957
|
"td",
|
|
18063
18958
|
{ class: "GCLASS_CELL_DESC" },
|
|
18064
|
-
a.description
|
|
18959
|
+
document.createTextNode(String(a.description ?? ""))
|
|
18065
18960
|
]
|
|
18066
18961
|
]
|
|
18067
18962
|
];
|
|
@@ -19937,6 +20832,10 @@ function mt_destroy$9(gobj) {
|
|
|
19937
20832
|
cancelAnimationFrame(priv._resize_raf);
|
|
19938
20833
|
priv._resize_raf = 0;
|
|
19939
20834
|
}
|
|
20835
|
+
if (priv.find_timer) {
|
|
20836
|
+
clearTimeout(priv.find_timer);
|
|
20837
|
+
priv.find_timer = null;
|
|
20838
|
+
}
|
|
19940
20839
|
if (priv.graph) {
|
|
19941
20840
|
priv.graph.destroy();
|
|
19942
20841
|
priv.graph = null;
|
|
@@ -20343,7 +21242,12 @@ function build_graph$2(gobj) {
|
|
|
20343
21242
|
save_view_state(gobj);
|
|
20344
21243
|
});
|
|
20345
21244
|
graph.on(NodeEvent.CLICK, (evt) => {
|
|
20346
|
-
|
|
21245
|
+
let client = evt && evt.client ? evt.client : null;
|
|
21246
|
+
gobj_send_event(gobj, "EV_NODE_CLICK", {
|
|
21247
|
+
id: evt && evt.target && evt.target.id ? String(evt.target.id) : "",
|
|
21248
|
+
client_x: client && typeof client.x === "number" ? client.x : 0,
|
|
21249
|
+
client_y: client && typeof client.y === "number" ? client.y : 0
|
|
21250
|
+
}, gobj);
|
|
20347
21251
|
});
|
|
20348
21252
|
graph.on(CanvasEvent.CLICK, (evt) => {
|
|
20349
21253
|
hide_popover(gobj);
|
|
@@ -21355,7 +22259,7 @@ function ac_center$2(gobj, event, kw, src) {
|
|
|
21355
22259
|
function ac_node_click$3(gobj, event, kw, src) {
|
|
21356
22260
|
let priv = gobj.priv;
|
|
21357
22261
|
let graph = priv.graph;
|
|
21358
|
-
let node_id = kw.
|
|
22262
|
+
let node_id = kw.id;
|
|
21359
22263
|
let node_data = priv.node_by_id && priv.node_by_id[node_id] || null;
|
|
21360
22264
|
if (!node_data) try {
|
|
21361
22265
|
let nd = graph.getNodeData(node_id);
|
|
@@ -21371,8 +22275,8 @@ function ac_node_click$3(gobj, event, kw, src) {
|
|
|
21371
22275
|
gobj_post_event(gobj, "EV_CENTER_ANCHOR", {}, gobj);
|
|
21372
22276
|
return 0;
|
|
21373
22277
|
}
|
|
21374
|
-
let client_x = kw.
|
|
21375
|
-
let client_y = kw.
|
|
22278
|
+
let client_x = kw.client_x || 0;
|
|
22279
|
+
let client_y = kw.client_y || 0;
|
|
21376
22280
|
show_popover(gobj, node_data, client_x, client_y);
|
|
21377
22281
|
return 0;
|
|
21378
22282
|
}
|
|
@@ -22023,7 +22927,7 @@ function is_decorative(it) {
|
|
|
22023
22927
|
var attrs_table$7 = [
|
|
22024
22928
|
SDATA(data_type_t.DTP_POINTER, "subscriber", 0, null, "Subscriber of output events"),
|
|
22025
22929
|
SDATA(data_type_t.DTP_STRING, "menu_id", 0, "", "Id of the menu this nav renders"),
|
|
22026
|
-
SDATA(data_type_t.DTP_STRING, "nav_label", 0, "", "
|
|
22930
|
+
SDATA(data_type_t.DTP_STRING, "nav_label", 0, "", "i18n key of the label for aria/heading; falls back to 'navigation'"),
|
|
22027
22931
|
SDATA(data_type_t.DTP_JSON, "menu_items", 0, null, "Array of menu items to render"),
|
|
22028
22932
|
SDATA(data_type_t.DTP_STRING, "zone", 0, "", "Zone id where this nav lives"),
|
|
22029
22933
|
SDATA(data_type_t.DTP_STRING, "layout", 0, "vertical", "vertical|icon-bar|tabs|drawer|submenu|accordion"),
|
|
@@ -22038,7 +22942,10 @@ var attrs_table$7 = [
|
|
|
22038
22942
|
SDATA_END()
|
|
22039
22943
|
];
|
|
22040
22944
|
var __nav_aria_seq__ = 0;
|
|
22041
|
-
var PRIVATE_DATA$7 = {
|
|
22945
|
+
var PRIVATE_DATA$7 = {
|
|
22946
|
+
click_handler: null,
|
|
22947
|
+
key_handler: null
|
|
22948
|
+
};
|
|
22042
22949
|
var __gclass__$7 = null;
|
|
22043
22950
|
/******************************
|
|
22044
22951
|
* Framework Methods
|
|
@@ -22074,6 +22981,7 @@ function mt_destroy$7(gobj) {
|
|
|
22074
22981
|
let $c = gobj_read_attr(gobj, "$container");
|
|
22075
22982
|
let priv = gobj.priv;
|
|
22076
22983
|
if ($c && priv && priv.click_handler) $c.removeEventListener("click", priv.click_handler);
|
|
22984
|
+
if ($c && priv && priv.key_handler) $c.removeEventListener("keydown", priv.key_handler);
|
|
22077
22985
|
if ($c && $c.parentNode) $c.parentNode.removeChild($c);
|
|
22078
22986
|
gobj_write_attr(gobj, "$container", null);
|
|
22079
22987
|
}
|
|
@@ -22091,7 +22999,7 @@ function build_ui$7(gobj) {
|
|
|
22091
22999
|
}
|
|
22092
23000
|
let items = gobj_read_attr(gobj, "menu_items") || [];
|
|
22093
23001
|
let zone = gobj_read_attr(gobj, "zone") || "";
|
|
22094
|
-
|
|
23002
|
+
gobj_read_attr(gobj, "menu_id");
|
|
22095
23003
|
let $container;
|
|
22096
23004
|
switch (layout) {
|
|
22097
23005
|
case "vertical":
|
|
@@ -22135,8 +23043,9 @@ function build_ui$7(gobj) {
|
|
|
22135
23043
|
if (layout !== "drawer") {
|
|
22136
23044
|
$container.setAttribute("role", "navigation");
|
|
22137
23045
|
if (!$container.hasAttribute("aria-label")) {
|
|
22138
|
-
let label = gobj_read_attr(gobj, "nav_label") ||
|
|
22139
|
-
$container.setAttribute("aria-label", label);
|
|
23046
|
+
let label = gobj_read_attr(gobj, "nav_label") || "navigation";
|
|
23047
|
+
$container.setAttribute("aria-label", t(label));
|
|
23048
|
+
$container.setAttribute("data-i18n-aria-label", label);
|
|
22140
23049
|
}
|
|
22141
23050
|
}
|
|
22142
23051
|
wire_clicks(gobj, $container);
|
|
@@ -22155,6 +23064,7 @@ function rebuild(gobj) {
|
|
|
22155
23064
|
let next = $old ? $old.nextSibling : null;
|
|
22156
23065
|
let was_hidden = !!($old && $old.classList.contains("is-hidden"));
|
|
22157
23066
|
if ($old && priv.click_handler) $old.removeEventListener("click", priv.click_handler);
|
|
23067
|
+
if ($old && priv.key_handler) $old.removeEventListener("keydown", priv.key_handler);
|
|
22158
23068
|
build_ui$7(gobj);
|
|
22159
23069
|
let $new = gobj_read_attr(gobj, "$container");
|
|
22160
23070
|
if ($new && was_hidden) $new.classList.add("is-hidden");
|
|
@@ -22259,6 +23169,7 @@ function render_tabs(gobj, items) {
|
|
|
22259
23169
|
class: "icon is-small yui-nav-close ml-2",
|
|
22260
23170
|
"data-close-item": it.id,
|
|
22261
23171
|
role: "button",
|
|
23172
|
+
tabindex: "0",
|
|
22262
23173
|
"aria-label": t("close"),
|
|
22263
23174
|
"data-i18n-aria-label": "close",
|
|
22264
23175
|
title: t("close"),
|
|
@@ -22269,12 +23180,15 @@ function render_tabs(gobj, items) {
|
|
|
22269
23180
|
"aria-hidden": "true"
|
|
22270
23181
|
}]
|
|
22271
23182
|
]);
|
|
23183
|
+
let label = it.name || "";
|
|
22272
23184
|
let a_attrs = {
|
|
22273
23185
|
href: it.route ? "#" + it.route : "#",
|
|
22274
23186
|
"data-item-id": it.id,
|
|
22275
|
-
"data-route": it.route || ""
|
|
23187
|
+
"data-route": it.route || "",
|
|
23188
|
+
"aria-label": label || it.id
|
|
22276
23189
|
};
|
|
22277
|
-
|
|
23190
|
+
if (label) a_attrs["data-i18n-aria-label"] = label;
|
|
23191
|
+
let tip = it.tooltip || it.aria_label || label;
|
|
22278
23192
|
if (tip) {
|
|
22279
23193
|
a_attrs.title = tip;
|
|
22280
23194
|
a_attrs["data-i18n-title"] = tip;
|
|
@@ -22420,12 +23334,13 @@ function render_backbar(gobj) {
|
|
|
22420
23334
|
]);
|
|
22421
23335
|
}
|
|
22422
23336
|
function render_drawer(gobj, items) {
|
|
22423
|
-
let menu_id = gobj_read_attr(gobj, "menu_id") || "drawer";
|
|
22424
23337
|
let wrap = document.createElement("div");
|
|
22425
23338
|
wrap.className = "yui-drawer";
|
|
22426
23339
|
wrap.setAttribute("role", "dialog");
|
|
22427
23340
|
wrap.setAttribute("aria-modal", "true");
|
|
22428
|
-
|
|
23341
|
+
let nav_label = gobj_read_attr(gobj, "nav_label") || "navigation";
|
|
23342
|
+
wrap.setAttribute("aria-label", t(nav_label));
|
|
23343
|
+
wrap.setAttribute("data-i18n-aria-label", nav_label);
|
|
22429
23344
|
let back = document.createElement("div");
|
|
22430
23345
|
back.className = "yui-drawer-backdrop";
|
|
22431
23346
|
back.setAttribute("data-close-drawer", "1");
|
|
@@ -22433,7 +23348,8 @@ function render_drawer(gobj, items) {
|
|
|
22433
23348
|
let panel = document.createElement("div");
|
|
22434
23349
|
panel.className = "yui-drawer-panel";
|
|
22435
23350
|
panel.setAttribute("role", "navigation");
|
|
22436
|
-
panel.setAttribute("aria-label",
|
|
23351
|
+
panel.setAttribute("aria-label", t(nav_label));
|
|
23352
|
+
panel.setAttribute("data-i18n-aria-label", nav_label);
|
|
22437
23353
|
panel.appendChild(render_vertical(gobj, items));
|
|
22438
23354
|
wrap.appendChild(back);
|
|
22439
23355
|
wrap.appendChild(panel);
|
|
@@ -22487,7 +23403,13 @@ function render_accordion(gobj, items) {
|
|
|
22487
23403
|
"aria-expanded": "false",
|
|
22488
23404
|
"aria-controls": body_id
|
|
22489
23405
|
};
|
|
22490
|
-
if (!empty_string(head_text))
|
|
23406
|
+
if (!empty_string(head_text)) {
|
|
23407
|
+
head_attrs.i18n = head_text;
|
|
23408
|
+
head_attrs.title = head_text;
|
|
23409
|
+
head_attrs["data-i18n-title"] = head_text;
|
|
23410
|
+
head_attrs["aria-label"] = head_text;
|
|
23411
|
+
head_attrs["data-i18n-aria-label"] = head_text;
|
|
23412
|
+
}
|
|
22491
23413
|
let $hdr = createElement2([
|
|
22492
23414
|
"button",
|
|
22493
23415
|
head_attrs,
|
|
@@ -22573,7 +23495,7 @@ function item_li(gobj, it, opts) {
|
|
|
22573
23495
|
"aria-label": aria_key
|
|
22574
23496
|
};
|
|
22575
23497
|
if (label) a_attrs["data-i18n-aria-label"] = label;
|
|
22576
|
-
let tip = it.tooltip || it.aria_label;
|
|
23498
|
+
let tip = it.tooltip || it.aria_label || label;
|
|
22577
23499
|
if (tip) {
|
|
22578
23500
|
a_attrs.title = tip;
|
|
22579
23501
|
a_attrs["data-i18n-title"] = tip;
|
|
@@ -22627,7 +23549,7 @@ function item_iconbar(gobj, it, opts) {
|
|
|
22627
23549
|
"aria-label": label || it.id
|
|
22628
23550
|
};
|
|
22629
23551
|
if (label) a_attrs["data-i18n-aria-label"] = label;
|
|
22630
|
-
let tip = it.tooltip || it.aria_label;
|
|
23552
|
+
let tip = it.tooltip || it.aria_label || label;
|
|
22631
23553
|
if (tip) {
|
|
22632
23554
|
a_attrs.title = tip;
|
|
22633
23555
|
a_attrs["data-i18n-title"] = tip;
|
|
@@ -22695,6 +23617,14 @@ function wire_clicks(gobj, $container) {
|
|
|
22695
23617
|
};
|
|
22696
23618
|
$container.addEventListener("click", handler);
|
|
22697
23619
|
priv.click_handler = handler;
|
|
23620
|
+
let key_handler = (ev) => {
|
|
23621
|
+
if (ev.key !== "Enter" && ev.key !== " ") return;
|
|
23622
|
+
let target = ev.target;
|
|
23623
|
+
if (!target || !target.closest || !target.closest("[data-close-item]")) return;
|
|
23624
|
+
handler(ev);
|
|
23625
|
+
};
|
|
23626
|
+
$container.addEventListener("keydown", key_handler);
|
|
23627
|
+
priv.key_handler = key_handler;
|
|
22698
23628
|
}
|
|
22699
23629
|
/***************************
|
|
22700
23630
|
* Actions
|
|
@@ -22749,7 +23679,7 @@ function ac_route_changed(gobj, event, kw, src) {
|
|
|
22749
23679
|
return 0;
|
|
22750
23680
|
}
|
|
22751
23681
|
function css_escape(s) {
|
|
22752
|
-
return String(s).replace(/"/g, "\\\"");
|
|
23682
|
+
return String(s).replace(/\\/g, "\\\\").replace(/"/g, "\\\"");
|
|
22753
23683
|
}
|
|
22754
23684
|
/***************************************************************
|
|
22755
23685
|
* FSM
|
|
@@ -22969,6 +23899,8 @@ function build_body(shell, t) {
|
|
|
22969
23899
|
type: "text",
|
|
22970
23900
|
placeholder: t("filter", { defaultValue: "Filter…" }),
|
|
22971
23901
|
"data-i18n-placeholder": "filter",
|
|
23902
|
+
title: t("filter", { defaultValue: "Filter" }),
|
|
23903
|
+
"data-i18n-title": "filter",
|
|
22972
23904
|
"aria-label": t("filter", { defaultValue: "Filter" }),
|
|
22973
23905
|
"data-i18n-aria-label": "filter"
|
|
22974
23906
|
}]);
|
|
@@ -23056,6 +23988,10 @@ function build_body(shell, t) {
|
|
|
23056
23988
|
"button",
|
|
23057
23989
|
{
|
|
23058
23990
|
class: "button is-small ROUTEMAP_PRINT",
|
|
23991
|
+
title: t("print", { defaultValue: "Print" }),
|
|
23992
|
+
"data-i18n-title": "print",
|
|
23993
|
+
"aria-label": t("print", { defaultValue: "Print" }),
|
|
23994
|
+
"data-i18n-aria-label": "print",
|
|
23059
23995
|
i18n: "print"
|
|
23060
23996
|
},
|
|
23061
23997
|
t("print", { defaultValue: "Print" })
|
|
@@ -24812,6 +25748,43 @@ function request_treedb_descs$1(gobj) {
|
|
|
24812
25748
|
if (ret) log_error(ret);
|
|
24813
25749
|
}
|
|
24814
25750
|
/************************************************************
|
|
25751
|
+
* A user view shows the topics of the user and, of the system
|
|
25752
|
+
* topics, only __icons__: its nodes are what the user ADDS to
|
|
25753
|
+
* the app (the icons a column `icon` can name), so editing them
|
|
25754
|
+
* is the user's business. The other `__` topics are the
|
|
25755
|
+
* treedb's own bookkeeping.
|
|
25756
|
+
************************************************************/
|
|
25757
|
+
function topic_is_shown(topic_name) {
|
|
25758
|
+
return topic_name.substring(0, 2) !== "__" || topic_name === "__icons__";
|
|
25759
|
+
}
|
|
25760
|
+
/************************************************************
|
|
25761
|
+
* The nodes of __icons__ are the user icons of the app: each
|
|
25762
|
+
* load and each write of them goes to the icon registry
|
|
25763
|
+
* (lib_icons.js), and the shell tells the views that decided
|
|
25764
|
+
* at render time whether a name was an icon.
|
|
25765
|
+
*
|
|
25766
|
+
* how: "load" (nodes = the whole topic), "put" (one node
|
|
25767
|
+
* created or updated) or "remove" (one node deleted).
|
|
25768
|
+
************************************************************/
|
|
25769
|
+
function feed_user_icons(gobj, how, nodes) {
|
|
25770
|
+
switch (how) {
|
|
25771
|
+
case "load":
|
|
25772
|
+
yui_icons_set_user(nodes);
|
|
25773
|
+
break;
|
|
25774
|
+
case "put":
|
|
25775
|
+
for (const node of nodes) yui_icons_put_user(node);
|
|
25776
|
+
break;
|
|
25777
|
+
case "remove":
|
|
25778
|
+
for (const node of nodes) if (node && typeof node.id === "string") yui_icons_remove_user(node.id);
|
|
25779
|
+
break;
|
|
25780
|
+
default:
|
|
25781
|
+
log_error(`${gobj_short_name(gobj)}: feed_user_icons(): unknown '${how}'`);
|
|
25782
|
+
return;
|
|
25783
|
+
}
|
|
25784
|
+
let shell = yui_shell_of(gobj);
|
|
25785
|
+
if (shell) yui_shell_icons_changed(shell);
|
|
25786
|
+
}
|
|
25787
|
+
/************************************************************
|
|
24815
25788
|
* Response of remote command
|
|
24816
25789
|
************************************************************/
|
|
24817
25790
|
function process_treedb_descs$1(gobj) {
|
|
@@ -24821,7 +25794,7 @@ function process_treedb_descs$1(gobj) {
|
|
|
24821
25794
|
let treedb_name = gobj_read_str_attr(gobj, "treedb_name");
|
|
24822
25795
|
let readonly = gobj_read_bool_attr(gobj, "readonly");
|
|
24823
25796
|
for (const [key, desc] of Object.entries(descs)) {
|
|
24824
|
-
if (system
|
|
25797
|
+
if (!system && !topic_is_shown(key)) continue;
|
|
24825
25798
|
let kw_topic_form = {
|
|
24826
25799
|
subscriber: gobj,
|
|
24827
25800
|
readonly,
|
|
@@ -24830,7 +25803,7 @@ function process_treedb_descs$1(gobj) {
|
|
|
24830
25803
|
treedb_name,
|
|
24831
25804
|
topic_name: key,
|
|
24832
25805
|
desc,
|
|
24833
|
-
with_remote_paging: gobj_read_bool_attr(gobj, "with_remote_paging"),
|
|
25806
|
+
with_remote_paging: key !== "__icons__" && gobj_read_bool_attr(gobj, "with_remote_paging"),
|
|
24834
25807
|
page_size: gobj_read_integer_attr(gobj, "page_size"),
|
|
24835
25808
|
with_selection_bar: gobj_read_bool_attr(gobj, "with_selection_bar"),
|
|
24836
25809
|
form_waits_for_answer: true
|
|
@@ -24882,7 +25855,7 @@ function register_sub_routes$1(gobj) {
|
|
|
24882
25855
|
gclass: "C_YUI_TREEDB_SCHEMA"
|
|
24883
25856
|
});
|
|
24884
25857
|
if (is_object(descs)) for (let topic of Object.keys(descs)) {
|
|
24885
|
-
if (!system && topic
|
|
25858
|
+
if (!system && !topic_is_shown(topic)) continue;
|
|
24886
25859
|
nodes.push({
|
|
24887
25860
|
route: base + "/" + topic,
|
|
24888
25861
|
label: topic,
|
|
@@ -25483,6 +26456,7 @@ function ac_mt_command_answer$2(gobj, event, kw, src) {
|
|
|
25483
26456
|
}, gobj);
|
|
25484
26457
|
} else {
|
|
25485
26458
|
forget_topic_rereads(gobj, topic_name);
|
|
26459
|
+
if (topic_name === "__icons__") feed_user_icons(gobj, "load", answer.rows);
|
|
25486
26460
|
gobj_send_event(gobj_topic_form, "EV_LOAD_NODES", answer.rows, gobj);
|
|
25487
26461
|
}
|
|
25488
26462
|
}
|
|
@@ -25731,6 +26705,7 @@ function ac_treedb_node_created$1(gobj, event, kw, src) {
|
|
|
25731
26705
|
let topic_name = kw_get_str(gobj, kw, "topic_name", "", 0);
|
|
25732
26706
|
let node = kw_get_dict_value(gobj, kw, "node", null, 0);
|
|
25733
26707
|
if (treedb_name === gobj_read_str_attr(gobj, "treedb_name")) {
|
|
26708
|
+
if (topic_name === "__icons__") feed_user_icons(gobj, "put", [node]);
|
|
25734
26709
|
let gobj_formtable = get_gobj_formtable(gobj, topic_name);
|
|
25735
26710
|
gobj_send_event(gobj_formtable, "EV_LOAD_NODE_CREATED", [node], gobj);
|
|
25736
26711
|
}
|
|
@@ -25744,6 +26719,7 @@ function ac_treedb_node_updated$1(gobj, event, kw, src) {
|
|
|
25744
26719
|
let topic_name = kw_get_str(gobj, kw, "topic_name", "", 0);
|
|
25745
26720
|
let node = kw_get_dict_value(gobj, kw, "node", null, 0);
|
|
25746
26721
|
if (treedb_name === gobj_read_str_attr(gobj, "treedb_name")) {
|
|
26722
|
+
if (topic_name === "__icons__") feed_user_icons(gobj, "put", [node]);
|
|
25747
26723
|
let gobj_formtable = get_gobj_formtable(gobj, topic_name);
|
|
25748
26724
|
gobj_send_event(gobj_formtable, "EV_LOAD_NODE_UPDATED", [node], gobj);
|
|
25749
26725
|
}
|
|
@@ -25778,6 +26754,7 @@ function ac_treedb_node_deleted$1(gobj, event, kw, src) {
|
|
|
25778
26754
|
let topic_name = kw_get_str(gobj, kw, "topic_name", "", 0);
|
|
25779
26755
|
let node = kw_get_dict_value(gobj, kw, "node", null, 0);
|
|
25780
26756
|
if (treedb_name === gobj_read_str_attr(gobj, "treedb_name")) {
|
|
26757
|
+
if (topic_name === "__icons__") feed_user_icons(gobj, "remove", [node]);
|
|
25781
26758
|
let gobj_formtable = get_gobj_formtable(gobj, topic_name);
|
|
25782
26759
|
gobj_send_event(gobj_formtable, "EV_NODE_DELETED", [node], gobj);
|
|
25783
26760
|
}
|
|
@@ -26555,46 +27532,46 @@ function yui_selection_bar(t, opts) {
|
|
|
26555
27532
|
/***********************************************************************
|
|
26556
27533
|
* yui_table_filter_clear.js
|
|
26557
27534
|
*
|
|
26558
|
-
*
|
|
26559
|
-
*
|
|
26560
|
-
*
|
|
26561
|
-
*
|
|
26562
|
-
*
|
|
26563
|
-
*
|
|
26564
|
-
*
|
|
26565
|
-
*
|
|
26566
|
-
*
|
|
26567
|
-
*
|
|
26568
|
-
* - **
|
|
26569
|
-
*
|
|
26570
|
-
*
|
|
26571
|
-
*
|
|
26572
|
-
*
|
|
26573
|
-
*
|
|
26574
|
-
*
|
|
26575
|
-
*
|
|
26576
|
-
* - **
|
|
26577
|
-
* `setHeaderFilterValue(field, "")`
|
|
26578
|
-
*
|
|
26579
|
-
*
|
|
26580
|
-
*
|
|
26581
|
-
*
|
|
26582
|
-
* - **
|
|
26583
|
-
*
|
|
26584
|
-
*
|
|
26585
|
-
*
|
|
26586
|
-
*
|
|
26587
|
-
* `querySelector
|
|
26588
|
-
*
|
|
27535
|
+
* THE ✕ OF A TABULATOR'S HEADER FILTERS.
|
|
27536
|
+
*
|
|
27537
|
+
* A column filter is set by typing and removed by DELETING what
|
|
27538
|
+
* was typed, letter by letter, and nothing in the header says it
|
|
27539
|
+
* can be removed. With several columns filtered, getting the
|
|
27540
|
+
* whole table back is an exercise of memory: which ones did I
|
|
27541
|
+
* touch. The ✕ says it and does it.
|
|
27542
|
+
*
|
|
27543
|
+
* THREE DECISIONS THAT ARE NOT OBVIOUS:
|
|
27544
|
+
*
|
|
27545
|
+
* - **It shows while the filter has content, focused or not.**
|
|
27546
|
+
* The opposite of a form's ✕ (`yui_inputs.js`), which appears
|
|
27547
|
+
* only on the field being edited so as not to light a cross on
|
|
27548
|
+
* every filled field. Here the use case is the reverse: the
|
|
27549
|
+
* filter is already set, the focus is elsewhere, and what is
|
|
27550
|
+
* wanted is to see it and remove it. Hidden behind the focus it
|
|
27551
|
+
* would take two clicks.
|
|
27552
|
+
*
|
|
27553
|
+
* - **It clears through the API, not by faking keys.**
|
|
27554
|
+
* `setHeaderFilterValue(field, "")` is what Tabulator offers,
|
|
27555
|
+
* and it keeps the value and the filter consistent. Synthesising
|
|
27556
|
+
* an `input` on the `<input>` depends on what that filter's
|
|
27557
|
+
* editor listens to, which changes with the column type.
|
|
27558
|
+
*
|
|
27559
|
+
* - **The header is walked, the editor is not wrapped.** The
|
|
27560
|
+
* columns are built from the topic's schema, so there is no
|
|
27561
|
+
* single place to wrap the editor; and the header rebuilds
|
|
27562
|
+
* itself when the columns change. The walk is idempotent -- it
|
|
27563
|
+
* marks what already has its cross -- and is triggered by a
|
|
27564
|
+
* one-pass `querySelector`, so repeating it on every render
|
|
27565
|
+
* costs nothing.
|
|
26589
27566
|
*
|
|
26590
27567
|
* Copyright (c) 2026, ArtGins.
|
|
26591
27568
|
* All Rights Reserved.
|
|
26592
27569
|
***********************************************************************/
|
|
26593
27570
|
var MARK = "data-yui-filter-clear";
|
|
26594
27571
|
/***************************************************************
|
|
26595
|
-
*
|
|
27572
|
+
* Put (or put back) the ✕ of every header filter of `table`.
|
|
26596
27573
|
*
|
|
26597
|
-
*
|
|
27574
|
+
* Idempotent: the ones that already have it are skipped.
|
|
26598
27575
|
***************************************************************/
|
|
26599
27576
|
function decorate(table) {
|
|
26600
27577
|
if (!table || !table.element) return;
|
|
@@ -26632,11 +27609,11 @@ function decorate(table) {
|
|
|
26632
27609
|
}
|
|
26633
27610
|
}
|
|
26634
27611
|
/***************************************************************
|
|
26635
|
-
*
|
|
27612
|
+
* Hook the ✕ onto a table already created.
|
|
26636
27613
|
*
|
|
26637
|
-
*
|
|
26638
|
-
*
|
|
26639
|
-
*
|
|
27614
|
+
* Called once, with the table built. The hooks cover the two
|
|
27615
|
+
* moments the header appears or is rebuilt: when it is built
|
|
27616
|
+
* and when the columns change.
|
|
26640
27617
|
***************************************************************/
|
|
26641
27618
|
function yui_table_filter_clear(table) {
|
|
26642
27619
|
if (!table) return;
|
|
@@ -26649,182 +27626,6 @@ function yui_table_filter_clear(table) {
|
|
|
26649
27626
|
});
|
|
26650
27627
|
}
|
|
26651
27628
|
//#endregion
|
|
26652
|
-
//#region src/lib_icons.js
|
|
26653
|
-
/*********************************************************
|
|
26654
|
-
* lib_icons.js
|
|
26655
|
-
*
|
|
26656
|
-
* Two icon systems are managed here:
|
|
26657
|
-
*
|
|
26658
|
-
* 1. FA-style CSS icons (yui_icons.css)
|
|
26659
|
-
* Usage: <i class="yi-save"></i>
|
|
26660
|
-
* Color: inherits currentColor from parent via CSS mask.
|
|
26661
|
-
*
|
|
26662
|
-
* 2. SVG symbol icons for G6 toolbar (and any other component
|
|
26663
|
-
* that uses <use xlink:href="#id">).
|
|
26664
|
-
* Symbols are injected once into the DOM.
|
|
26665
|
-
* All symbol ids are prefixed with "g6-icon-" to avoid
|
|
26666
|
-
* conflicts with other DOM elements.
|
|
26667
|
-
* Icon paths come from:
|
|
26668
|
-
* fontawesome-free-7.1.0-web/sprites/solid.svg
|
|
26669
|
-
*
|
|
26670
|
-
* G6 toolbar items are managed via CSS class names (className
|
|
26671
|
-
* field in getItems()) using YuiToolbar in c_g6_nodes_tree.js.
|
|
26672
|
-
* This lets lib_graph.js state functions (set_submit_state,
|
|
26673
|
-
* disableElements, …) work on toolbar icons exactly like on
|
|
26674
|
-
* regular Bulma/FA buttons — no icon-specific helpers needed.
|
|
26675
|
-
*
|
|
26676
|
-
* Copyright (c) 2025-2026, ArtGins.
|
|
26677
|
-
* All Rights Reserved.
|
|
26678
|
-
*********************************************************/
|
|
26679
|
-
var CUSTOM_SVG_ICONS_ID = "g6-custom-svgicons";
|
|
26680
|
-
var ICONS = `<svg xmlns="http://www.w3.org/2000/svg">
|
|
26681
|
-
<!-- magnifying-glass-plus -->
|
|
26682
|
-
<symbol id="g6-icon-zoom-in" viewBox="0 0 512 512">
|
|
26683
|
-
<path fill="currentColor" d="M416 208c0 45.9-14.9 88.3-40 122.7L502.6 457.4c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L330.7 376C296.3 401.1 253.9 416 208 416 93.1 416 0 322.9 0 208S93.1 0 208 0 416 93.1 416 208zM208 112c-13.3 0-24 10.7-24 24l0 48-48 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l48 0 0 48c0 13.3 10.7 24 24 24s24-10.7 24-24l0-48 48 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-48 0 0-48c0-13.3-10.7-24-24-24z"/>
|
|
26684
|
-
</symbol>
|
|
26685
|
-
<!-- magnifying-glass-minus -->
|
|
26686
|
-
<symbol id="g6-icon-zoom-out" viewBox="0 0 512 512">
|
|
26687
|
-
<path fill="currentColor" d="M416 208c0 45.9-14.9 88.3-40 122.7L502.6 457.4c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L330.7 376C296.3 401.1 253.9 416 208 416 93.1 416 0 322.9 0 208S93.1 0 208 0 416 93.1 416 208zM136 184c-13.3 0-24 10.7-24 24s10.7 24 24 24l144 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-144 0z"/>
|
|
26688
|
-
</symbol>
|
|
26689
|
-
<!-- house (reset zoom: back to original 100% view) -->
|
|
26690
|
-
<symbol id="g6-icon-home" viewBox="0 0 512 512">
|
|
26691
|
-
<path fill="currentColor" d="M277.8 8.6c-12.3-11.4-31.3-11.4-43.5 0l-224 208c-9.6 9-12.8 22.9-8 35.1S18.8 272 32 272l16 0 0 176c0 35.3 28.7 64 64 64l288 0c35.3 0 64-28.7 64-64l0-176 16 0c13.2 0 25-8.1 29.8-20.3s1.6-26.2-8-35.1l-224-208zM240 320l32 0c26.5 0 48 21.5 48 48l0 96-128 0 0-96c0-26.5 21.5-48 48-48z"/>
|
|
26692
|
-
</symbol>
|
|
26693
|
-
<!-- expand (zoom to fit) -->
|
|
26694
|
-
<symbol id="g6-icon-fit" viewBox="0 0 448 512">
|
|
26695
|
-
<path fill="currentColor" d="M32 32C14.3 32 0 46.3 0 64l0 96c0 17.7 14.3 32 32 32s32-14.3 32-32l0-64 64 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L32 32zM64 352c0-17.7-14.3-32-32-32S0 334.3 0 352l0 96c0 17.7 14.3 32 32 32l96 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-64 0 0-64zM320 32c-17.7 0-32 14.3-32 32s14.3 32 32 32l64 0 0 64c0 17.7 14.3 32 32 32s32-14.3 32-32l0-96c0-17.7-14.3-32-32-32l-96 0zM448 352c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 64-64 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l96 0c17.7 0 32-14.3 32-32l0-96z"/>
|
|
26696
|
-
</symbol>
|
|
26697
|
-
<!-- fit to selection: the same corner brackets as the fit icon,
|
|
26698
|
-
around a marked object. The two sit side by side in the
|
|
26699
|
-
toolbar and have to read as a family, which a borrowed glyph
|
|
26700
|
-
would not. (No backticks in here: the sprite lives inside a
|
|
26701
|
-
template literal.) -->
|
|
26702
|
-
<symbol id="g6-icon-fit-selection" viewBox="0 0 448 512">
|
|
26703
|
-
<path fill="currentColor" d="M32 32C14.3 32 0 46.3 0 64l0 96c0 17.7 14.3 32 32 32s32-14.3 32-32l0-64 64 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L32 32zM64 352c0-17.7-14.3-32-32-32S0 334.3 0 352l0 96c0 17.7 14.3 32 32 32l96 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-64 0 0-64zM320 32c-17.7 0-32 14.3-32 32s14.3 32 32 32l64 0 0 64c0 17.7 14.3 32 32 32s32-14.3 32-32l0-96c0-17.7-14.3-32-32-32l-96 0zM448 352c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 64-64 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l96 0c17.7 0 32-14.3 32-32l0-96z"/>
|
|
26704
|
-
<rect fill="currentColor" x="144" y="176" width="160" height="160" rx="24"/>
|
|
26705
|
-
</symbol>
|
|
26706
|
-
<!-- crosshairs (center) -->
|
|
26707
|
-
<symbol id="g6-icon-center" viewBox="0 0 576 512">
|
|
26708
|
-
<path fill="currentColor" d="M288-16c17.7 0 32 14.3 32 32l0 18.3c98.1 14 175.7 91.6 189.7 189.7l18.3 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-18.3 0c-14 98.1-91.6 175.7-189.7 189.7l0 18.3c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-18.3C157.9 463.7 80.3 386.1 66.3 288L48 288c-17.7 0-32-14.3-32-32s14.3-32 32-32l18.3 0C80.3 125.9 157.9 48.3 256 34.3L256 16c0-17.7 14.3-32 32-32zM131.2 288c12.7 62.7 62.1 112.1 124.8 124.8l0-12.8c0-17.7 14.3-32 32-32s32 14.3 32 32l0 12.8c62.7-12.7 112.1-62.1 124.8-124.8L432 288c-17.7 0-32-14.3-32-32s14.3-32 32-32l12.8 0C432.1 161.3 382.7 111.9 320 99.2l0 12.8c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-12.8C193.3 111.9 143.9 161.3 131.2 224l12.8 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-12.8 0zM288 208a48 48 0 1 1 0 96 48 48 0 1 1 0-96z"/>
|
|
26709
|
-
</symbol>
|
|
26710
|
-
<!-- up-right-and-down-left-from-center (enter fullscreen) -->
|
|
26711
|
-
<symbol id="g6-icon-fullscreen" viewBox="0 0 512 512">
|
|
26712
|
-
<path fill="currentColor" d="M344 0L488 0c13.3 0 24 10.7 24 24l0 144c0 9.7-5.8 18.5-14.8 22.2s-19.3 1.7-26.2-5.2l-39-39-87 87c-9.4 9.4-24.6 9.4-33.9 0l-32-32c-9.4-9.4-9.4-24.6 0-33.9l87-87-39-39c-6.9-6.9-8.9-17.2-5.2-26.2S334.3 0 344 0zM168 512L24 512c-13.3 0-24-10.7-24-24L0 344c0-9.7 5.8-18.5 14.8-22.2S34.1 320.2 41 327l39 39 87-87c9.4-9.4 24.6-9.4 33.9 0l32 32c9.4 9.4 9.4 24.6 0 33.9l-87 87 39 39c6.9 6.9 8.9 17.2 5.2 26.2S177.7 512 168 512z"/>
|
|
26713
|
-
</symbol>
|
|
26714
|
-
<!-- down-left-and-up-right-to-center (exit fullscreen) -->
|
|
26715
|
-
<symbol id="g6-icon-fullscreen-exit" viewBox="0 0 512 512">
|
|
26716
|
-
<path fill="currentColor" d="M439.5 7c9.4-9.4 24.6-9.4 33.9 0l32 32c9.4 9.4 9.4 24.6 0 33.9l-87 87 39 39c6.9 6.9 8.9 17.2 5.2 26.2S450.2 240 440.5 240l-144 0c-13.3 0-24-10.7-24-24l0-144c0-9.7 5.8-18.5 14.8-22.2s19.3-1.7 26.2 5.2l39 39 87-87zM72.5 272l144 0c13.3 0 24 10.7 24 24l0 144c0 9.7-5.8 18.5-14.8 22.2s-19.3 1.7-26.2-5.2l-39-39-87 87c-9.4 9.4-24.6 9.4-33.9 0l-32-32c-9.4-9.4-9.4-24.6 0-33.9l87-87-39-39c-6.9-6.9-8.9-17.2-5.2-26.2S62.8 272 72.5 272z"/>
|
|
26717
|
-
</symbol>
|
|
26718
|
-
<!-- arrow-rotate-left (undo) -->
|
|
26719
|
-
<symbol id="g6-icon-undo" viewBox="0 0 512 512">
|
|
26720
|
-
<path fill="currentColor" d="M256 64c-56.8 0-107.9 24.7-143.1 64l47.1 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 192c-17.7 0-32-14.3-32-32L0 32C0 14.3 14.3 0 32 0S64 14.3 64 32l0 54.7C110.9 33.6 179.5 0 256 0 397.4 0 512 114.6 512 256S397.4 512 256 512c-87 0-163.9-43.4-210.1-109.7-10.1-14.5-6.6-34.4 7.9-44.6s34.4-6.6 44.6 7.9c34.8 49.8 92.4 82.3 157.6 82.3 106 0 192-86 192-192S362 64 256 64z"/>
|
|
26721
|
-
</symbol>
|
|
26722
|
-
<!-- arrow-rotate-right (redo) -->
|
|
26723
|
-
<symbol id="g6-icon-redo" viewBox="0 0 512 512">
|
|
26724
|
-
<path fill="currentColor" d="M436.7 74.7L448 85.4 448 32c0-17.7 14.3-32 32-32s32 14.3 32 32l0 128c0 17.7-14.3 32-32 32l-128 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l47.9 0-7.6-7.2c-.2-.2-.4-.4-.6-.6-75-75-196.5-75-271.5 0s-75 196.5 0 271.5 196.5 75 271.5 0c8.2-8.2 15.5-16.9 21.9-26.1 10.1-14.5 30.1-18 44.6-7.9s18 30.1 7.9 44.6c-8.5 12.2-18.2 23.8-29.1 34.7-100 100-262.1 100-362 0S-25 175 75 75c99.9-99.9 261.7-100 361.7-.3z"/>
|
|
26725
|
-
</symbol>
|
|
26726
|
-
<!-- pen (edit node) -->
|
|
26727
|
-
<symbol id="g6-icon-edit" viewBox="0 0 512 512">
|
|
26728
|
-
<path fill="currentColor" d="M352.9 21.2L308 66.1 445.9 204 490.8 159.1C504.4 145.6 512 127.2 512 108s-7.6-37.6-21.2-51.1L455.1 21.2C441.6 7.6 423.2 0 404 0s-37.6 7.6-51.1 21.2zM274.1 100L58.9 315.1c-10.7 10.7-18.5 24.1-22.6 38.7L.9 481.6c-2.3 8.3 0 17.3 6.2 23.4s15.1 8.5 23.4 6.2l127.8-35.5c14.6-4.1 27.9-11.8 38.7-22.6L412 237.9 274.1 100z"/>
|
|
26729
|
-
</symbol>
|
|
26730
|
-
<!-- trash-can (delete) -->
|
|
26731
|
-
<symbol id="g6-icon-delete" viewBox="0 0 448 512">
|
|
26732
|
-
<path fill="currentColor" d="M136.7 5.9C141.1-7.2 153.3-16 167.1-16l113.9 0c13.8 0 26 8.8 30.4 21.9L320 32 416 32c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 96C14.3 96 0 81.7 0 64S14.3 32 32 32l96 0 8.7-26.1zM32 144l384 0 0 304c0 35.3-28.7 64-64 64L96 512c-35.3 0-64-28.7-64-64l0-304zm88 64c-13.3 0-24 10.7-24 24l0 192c0 13.3 10.7 24 24 24s24-10.7 24-24l0-192c0-13.3-10.7-24-24-24zm104 0c-13.3 0-24 10.7-24 24l0 192c0 13.3 10.7 24 24 24s24-10.7 24-24l0-192c0-13.3-10.7-24-24-24zm104 0c-13.3 0-24 10.7-24 24l0 192c0 13.3 10.7 24 24 24s24-10.7 24-24l0-192c0-13.3-10.7-24-24-24z"/>
|
|
26733
|
-
</symbol>
|
|
26734
|
-
<!-- link (link nodes) -->
|
|
26735
|
-
<symbol id="g6-icon-link" viewBox="0 0 576 512">
|
|
26736
|
-
<path fill="currentColor" d="M419.5 96c-16.6 0-32.7 4.5-46.8 12.7-15.8-16-34.2-29.4-54.5-39.5 28.2-24 64.1-37.2 101.3-37.2 86.4 0 156.5 70 156.5 156.5 0 41.5-16.5 81.3-45.8 110.6l-71.1 71.1c-29.3 29.3-69.1 45.8-110.6 45.8-86.4 0-156.5-70-156.5-156.5 0-1.5 0-3 .1-4.5 .5-17.7 15.2-31.6 32.9-31.1s31.6 15.2 31.1 32.9c0 .9 0 1.8 0 2.6 0 51.1 41.4 92.5 92.5 92.5 24.5 0 48-9.7 65.4-27.1l71.1-71.1c17.3-17.3 27.1-40.9 27.1-65.4 0-51.1-41.4-92.5-92.5-92.5zM275.2 173.3c-1.9-.8-3.8-1.9-5.5-3.1-12.6-6.5-27-10.2-42.1-10.2-24.5 0-48 9.7-65.4 27.1L91.1 258.2c-17.3 17.3-27.1 40.9-27.1 65.4 0 51.1 41.4 92.5 92.5 92.5 16.5 0 32.6-4.4 46.7-12.6 15.8 16 34.2 29.4 54.6 39.5-28.2 23.9-64 37.2-101.3 37.2-86.4 0-156.5-70-156.5-156.5 0-41.5 16.5-81.3 45.8-110.6l71.1-71.1c29.3-29.3 69.1-45.8 110.6-45.8 86.6 0 156.5 70.6 156.5 156.9 0 1.3 0 2.6 0 3.9-.4 17.7-15.1 31.6-32.8 31.2s-31.6-15.1-31.2-32.8c0-.8 0-1.5 0-2.3 0-33.7-18-63.3-44.8-79.6z"/>
|
|
26737
|
-
</symbol>
|
|
26738
|
-
<!-- link-slash (unlink) -->
|
|
26739
|
-
<symbol id="g6-icon-unlink" viewBox="0 0 576 512">
|
|
26740
|
-
<path fill="currentColor" d="M41-24.9c-9.4-9.4-24.6-9.4-33.9 0S-2.3-.3 7 9.1l528 528c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-122-122c4.2-3.4 8.3-7.1 12.1-10.9l71.1-71.1c29.3-29.3 45.8-69.1 45.8-110.6 0-86.4-70-156.5-156.5-156.5-37.3 0-73.1 13.3-101.3 37.2 20.3 10.1 38.7 23.5 54.5 39.5 14.1-8.3 30.2-12.7 46.8-12.7 51.1 0 92.5 41.4 92.5 92.5 0 24.5-9.7 48-27.1 65.4l-71.1 71.1c-3.9 3.9-8.1 7.4-12.6 10.5l-47.5-47.5c16.5-.9 29.7-14.4 30.2-31.1 0-1.3 0-2.6 0-3.9 0-86.3-69.9-156.9-156.5-156.9-19.2 0-37.9 3.5-55.5 10.2L41-24.9zM225.9 160c.6 0 1.1 0 1.7 0 15.1 0 29.5 3.7 42.1 10.2 1.8 1.2 3.6 2.3 5.5 3.1 26.8 16.3 44.8 45.9 44.8 79.6 0 .4 0 .8 0 1.2L225.9 160zM346.2 416L192 261.8c1.2 84.6 69.6 152.9 154.1 154.1zM139.7 209.5l-45.3-45.3-48.6 48.6c-29.3 29.3-45.8 69.1-45.8 110.6 0 86.4 70 156.5 156.5 156.5 37.2 0 73.1-13.3 101.3-37.2-20.3-10.1-38.8-23.5-54.6-39.5-14 8.2-30.1 12.6-46.7 12.6-51.1 0-92.5-41.4-92.5-92.5 0-24.5 9.7-48 27.1-65.4l48.6-48.6z"/>
|
|
26741
|
-
</symbol>
|
|
26742
|
-
<!-- play (run node) -->
|
|
26743
|
-
<symbol id="g6-icon-run" viewBox="0 0 448 512">
|
|
26744
|
-
<path fill="currentColor" d="M91.2 36.9c-12.4-6.8-27.4-6.5-39.6 .7S32 57.9 32 72l0 368c0 14.1 7.5 27.2 19.6 34.4s27.2 7.5 39.6 .7l336-184c12.8-7 20.8-20.5 20.8-35.1s-8-28.1-20.8-35.1l-336-184z"/>
|
|
26745
|
-
</symbol>
|
|
26746
|
-
<!-- clone (copy size to other nodes/ports) -->
|
|
26747
|
-
<symbol id="g6-icon-resize" viewBox="0 0 512 512">
|
|
26748
|
-
<path fill="currentColor" d="M288 448l-224 0 0-224 48 0 0-64-48 0c-35.3 0-64 28.7-64 64L0 448c0 35.3 28.7 64 64 64l224 0c35.3 0 64-28.7 64-64l0-48-64 0 0 48zm-64-96l224 0c35.3 0 64-28.7 64-64l0-224c0-35.3-28.7-64-64-64L224 0c-35.3 0-64 28.7-64 64l0 224c0 35.3 28.7 64 64 64z"/>
|
|
26749
|
-
</symbol>
|
|
26750
|
-
<!-- plus (create node). Deliberately NOT the FA7 solid plus:
|
|
26751
|
-
its arms are ~14% of the width and read thin next to the
|
|
26752
|
-
other solid glyphs. Bold geometric plus (~23% arm
|
|
26753
|
-
thickness) with long arms (32..480) so it reads as a "+",
|
|
26754
|
-
not a stubby Red-Cross square. -->
|
|
26755
|
-
<symbol id="g6-icon-plus" viewBox="0 0 512 512">
|
|
26756
|
-
<path fill="currentColor" d="M316 32 L316 196 L480 196 L480 316 L316 316 L316 480 L196 480 L196 316 L32 316 L32 196 L196 196 L196 32 Z"/>
|
|
26757
|
-
</symbol>
|
|
26758
|
-
<!-- ellipsis-vertical (unfold the floating toolbar).
|
|
26759
|
-
The strip it stands for is a vertical stack, and a vertical
|
|
26760
|
-
ellipsis is what "there is more of this here" is drawn as
|
|
26761
|
-
everywhere else. -->
|
|
26762
|
-
<symbol id="g6-icon-toolbar-show" viewBox="0 0 128 512">
|
|
26763
|
-
<path fill="currentColor" d="M64 360a56 56 0 1 0 0 112 56 56 0 1 0 0-112zm0-160a56 56 0 1 0 0 112 56 56 0 1 0 0-112zM120 96A56 56 0 1 0 8 96a56 56 0 1 0 112 0z"/>
|
|
26764
|
-
</symbol>
|
|
26765
|
-
<!-- xmark (fold the floating toolbar away).
|
|
26766
|
-
Not a chevron: the two toolbars sit on OPPOSITE edges, so a
|
|
26767
|
-
direction would point the wrong way on one of them. What the
|
|
26768
|
-
button does is close an overlay, and that is an x. -->
|
|
26769
|
-
<symbol id="g6-icon-toolbar-hide" viewBox="0 0 384 512">
|
|
26770
|
-
<path fill="currentColor" d="M342.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192 210.7 86.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L146.7 256 41.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192 301.3 297.4 406.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.3 256 342.6 150.6z"/>
|
|
26771
|
-
</symbol>
|
|
26772
|
-
<!-- dashed marquee (selection mode).
|
|
26773
|
-
The band ITSELF, because that is what the button turns on: a
|
|
26774
|
-
drag on the canvas draws one and a tap picks a card. Not the
|
|
26775
|
-
fit-to-selection glyph next to it in the other toolbar -- that
|
|
26776
|
-
one is solid brackets around a solid object and means "put the
|
|
26777
|
-
camera on what is picked", which is the opposite end of the
|
|
26778
|
-
gesture. Dashes: 16 segments of 59 with gaps of 36 over a
|
|
26779
|
-
perimeter of 1520, so they land on the corners. -->
|
|
26780
|
-
<symbol id="g6-icon-select-mode" viewBox="0 0 512 512">
|
|
26781
|
-
<rect x="46" y="86" width="420" height="340" fill="none"
|
|
26782
|
-
stroke="currentColor" stroke-width="40"
|
|
26783
|
-
stroke-dasharray="59 36"/>
|
|
26784
|
-
</symbol>
|
|
26785
|
-
<!-- location-crosshairs (anchor the camera on one element).
|
|
26786
|
-
The SAME path as the DOM toolbars and their yi-location-crosshairs
|
|
26787
|
-
mask: the two toolbars sit in one console, and a control that
|
|
26788
|
-
does one thing has to be drawn one way. -->
|
|
26789
|
-
<symbol id="g6-icon-anchor" viewBox="0 0 576 512">
|
|
26790
|
-
<path fill="currentColor" d="M288-16c17.7 0 32 14.3 32 32l0 18.3c98.1 14 175.7 91.6 189.7 189.7l18.3 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-18.3 0c-14 98.1-91.6 175.7-189.7 189.7l0 18.3c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-18.3C157.9 463.7 80.3 386.1 66.3 288L48 288c-17.7 0-32-14.3-32-32s14.3-32 32-32l18.3 0C80.3 125.9 157.9 48.3 256 34.3L256 16c0-17.7 14.3-32 32-32zM128 256a160 160 0 1 0 320 0 160 160 0 1 0 -320 0zm160-96a96 96 0 1 1 0 192 96 96 0 1 1 0-192z"/>
|
|
26791
|
-
</symbol>
|
|
26792
|
-
<!-- floppy-disk (save) -->
|
|
26793
|
-
<symbol id="g6-icon-save" viewBox="0 0 448 512">
|
|
26794
|
-
<path fill="currentColor" d="M64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-242.7c0-17-6.7-33.3-18.7-45.3L352 50.7C340 38.7 323.7 32 306.7 32L64 32zm32 96c0-17.7 14.3-32 32-32l160 0c17.7 0 32 14.3 32 32l0 64c0 17.7-14.3 32-32 32l-160 0c-17.7 0-32-14.3-32-32l0-64zM224 288a64 64 0 1 1 0 128 64 64 0 1 1 0-128z"/>
|
|
26795
|
-
</symbol>
|
|
26796
|
-
</svg>`;
|
|
26797
|
-
function inject_svg_icons() {
|
|
26798
|
-
if (document.getElementById(CUSTOM_SVG_ICONS_ID)) return;
|
|
26799
|
-
const div = document.createElement("div");
|
|
26800
|
-
div.id = CUSTOM_SVG_ICONS_ID;
|
|
26801
|
-
div.style.display = "none";
|
|
26802
|
-
div.innerHTML = ICONS;
|
|
26803
|
-
document.body.appendChild(div);
|
|
26804
|
-
}
|
|
26805
|
-
var __icon_defined__ = {};
|
|
26806
|
-
function yui_icon_is_defined(name) {
|
|
26807
|
-
if (!name || typeof name !== "string") return false;
|
|
26808
|
-
if (__icon_defined__[name] !== void 0) return __icon_defined__[name];
|
|
26809
|
-
let defined = false;
|
|
26810
|
-
try {
|
|
26811
|
-
const el = document.createElement("i");
|
|
26812
|
-
el.className = name;
|
|
26813
|
-
el.style.position = "absolute";
|
|
26814
|
-
el.style.visibility = "hidden";
|
|
26815
|
-
el.style.pointerEvents = "none";
|
|
26816
|
-
document.body.appendChild(el);
|
|
26817
|
-
const st = window.getComputedStyle(el, "::before");
|
|
26818
|
-
const mask = st.maskImage || st.webkitMaskImage || "";
|
|
26819
|
-
defined = !!mask && mask !== "none";
|
|
26820
|
-
document.body.removeChild(el);
|
|
26821
|
-
} catch (e) {
|
|
26822
|
-
defined = false;
|
|
26823
|
-
}
|
|
26824
|
-
__icon_defined__[name] = defined;
|
|
26825
|
-
return defined;
|
|
26826
|
-
}
|
|
26827
|
-
//#endregion
|
|
26828
27629
|
//#region src/yui_row_search.js
|
|
26829
27630
|
/***********************************************************************
|
|
26830
27631
|
* yui_row_search.js
|
|
@@ -27440,7 +28241,10 @@ function mt_create$5(gobj) {
|
|
|
27440
28241
|
***************************************************************/
|
|
27441
28242
|
function mt_start$5(gobj) {
|
|
27442
28243
|
let shell = yui_shell_of(gobj);
|
|
27443
|
-
if (shell)
|
|
28244
|
+
if (shell) {
|
|
28245
|
+
gobj_subscribe_event(shell, "EV_LANGUAGE_CHANGED", {}, gobj);
|
|
28246
|
+
gobj_subscribe_event(shell, "EV_ICONS_CHANGED", {}, gobj);
|
|
28247
|
+
}
|
|
27444
28248
|
create_tabulator(gobj);
|
|
27445
28249
|
}
|
|
27446
28250
|
/***************************************************************
|
|
@@ -27448,7 +28252,10 @@ function mt_start$5(gobj) {
|
|
|
27448
28252
|
***************************************************************/
|
|
27449
28253
|
function mt_stop$5(gobj) {
|
|
27450
28254
|
let shell = yui_shell_of(gobj);
|
|
27451
|
-
if (shell)
|
|
28255
|
+
if (shell) {
|
|
28256
|
+
gobj_unsubscribe_event(shell, "EV_LANGUAGE_CHANGED", {}, gobj);
|
|
28257
|
+
gobj_unsubscribe_event(shell, "EV_ICONS_CHANGED", {}, gobj);
|
|
28258
|
+
}
|
|
27452
28259
|
close_form_dialog(gobj);
|
|
27453
28260
|
close_schema_dialog(gobj);
|
|
27454
28261
|
close_cell_json_dialog(gobj);
|
|
@@ -27456,6 +28263,7 @@ function mt_stop$5(gobj) {
|
|
|
27456
28263
|
close_cell_file_dialog(gobj);
|
|
27457
28264
|
close_hook_choice(gobj);
|
|
27458
28265
|
drop_pending_assets(gobj);
|
|
28266
|
+
drop_pending_pages(gobj);
|
|
27459
28267
|
table__destroy(gobj);
|
|
27460
28268
|
}
|
|
27461
28269
|
/***************************************************************
|
|
@@ -28165,7 +28973,13 @@ function create_tabulator(gobj) {
|
|
|
28165
28973
|
let formatterParams;
|
|
28166
28974
|
const field_desc = treedb_get_field_desc(col);
|
|
28167
28975
|
if (field_desc.is_hidden) continue;
|
|
28976
|
+
if (yui_icons_is_svg_field(gobj_read_str_attr(gobj, "topic_name"), col.id)) field_desc.type = "svg";
|
|
28168
28977
|
switch (field_desc.type) {
|
|
28978
|
+
case "svg":
|
|
28979
|
+
hozAlign = "center";
|
|
28980
|
+
vertAlign = "middle";
|
|
28981
|
+
colFormatter = svg_cell_formatter;
|
|
28982
|
+
break;
|
|
28169
28983
|
case "hook":
|
|
28170
28984
|
hozAlign = "center";
|
|
28171
28985
|
cellClick = function(e, cell) {
|
|
@@ -28369,6 +29183,7 @@ function create_tabulator(gobj) {
|
|
|
28369
29183
|
else try {
|
|
28370
29184
|
n = tabulator.getDataCount("active");
|
|
28371
29185
|
} catch (e) {
|
|
29186
|
+
log_warning(`${gobj_short_name(gobj)}: cannot count the table's rows: ${e}`);
|
|
28372
29187
|
n = 0;
|
|
28373
29188
|
}
|
|
28374
29189
|
let paged = gobj_read_bool_attr(gobj, "with_remote_paging");
|
|
@@ -28554,6 +29369,30 @@ function icon_formatter(cell) {
|
|
|
28554
29369
|
}]);
|
|
28555
29370
|
}
|
|
28556
29371
|
/************************************************************
|
|
29372
|
+
* Cell of the drawing of a user icon (`svg` of __icons__): the
|
|
29373
|
+
* icon itself, as the app will draw it. A drawing that cannot
|
|
29374
|
+
* be drawn says why, in plain grey -- the same honest half as
|
|
29375
|
+
* an unknown icon name in icon_formatter.
|
|
29376
|
+
************************************************************/
|
|
29377
|
+
function svg_cell_formatter(cell) {
|
|
29378
|
+
let svg = cell.getValue();
|
|
29379
|
+
if (!is_string(svg) || empty_string(svg)) return "";
|
|
29380
|
+
let preview = yui_svg_icon_element(svg);
|
|
29381
|
+
if (preview.error) {
|
|
29382
|
+
let text = svg_error_text(preview.error);
|
|
29383
|
+
return createElement2([
|
|
29384
|
+
"span",
|
|
29385
|
+
{
|
|
29386
|
+
class: "ICON_CELL_UNKNOWN is-size-7 yui-text-quiet",
|
|
29387
|
+
title: text
|
|
29388
|
+
},
|
|
29389
|
+
text
|
|
29390
|
+
]);
|
|
29391
|
+
}
|
|
29392
|
+
preview.element.classList.add("ICON_CELL");
|
|
29393
|
+
return preview.element;
|
|
29394
|
+
}
|
|
29395
|
+
/************************************************************
|
|
28557
29396
|
* Cell of a col holding a JSON document (dict/list/blob/
|
|
28558
29397
|
* template/coordinates/…): a one-line truncated preview,
|
|
28559
29398
|
* marked as a link because the click opens the whole value
|
|
@@ -28574,7 +29413,9 @@ function build_json_cell_preview(value) {
|
|
|
28574
29413
|
{
|
|
28575
29414
|
class: "JSON_CELL",
|
|
28576
29415
|
title: t("show json"),
|
|
28577
|
-
"data-i18n-title": "show json"
|
|
29416
|
+
"data-i18n-title": "show json",
|
|
29417
|
+
"aria-label": t("show json"),
|
|
29418
|
+
"data-i18n-aria-label": "show json"
|
|
28578
29419
|
},
|
|
28579
29420
|
[["span", { class: "JSON_CELL_ICON icon yi-eye" }], [
|
|
28580
29421
|
"span",
|
|
@@ -29574,33 +30415,15 @@ function transform__form_value_2_treedb_value(gobj, col, value, operation) {
|
|
|
29574
30415
|
case "object":
|
|
29575
30416
|
case "dict":
|
|
29576
30417
|
case "template":
|
|
29577
|
-
if (is_string(value)) try {
|
|
29578
|
-
value = JSON.parse(value);
|
|
29579
|
-
} catch (e) {
|
|
29580
|
-
value = {};
|
|
29581
|
-
}
|
|
29582
|
-
else if (is_object(value)) {}
|
|
29583
|
-
if (!is_object(value)) value = {};
|
|
29584
|
-
break;
|
|
29585
30418
|
case "array":
|
|
29586
30419
|
case "list":
|
|
29587
|
-
if (is_string(value)) try {
|
|
29588
|
-
value = JSON.parse(value);
|
|
29589
|
-
} catch (e) {
|
|
29590
|
-
value = [];
|
|
29591
|
-
}
|
|
29592
|
-
else if (is_array(value)) {}
|
|
29593
|
-
if (!is_array(value)) value = [];
|
|
29594
|
-
break;
|
|
29595
30420
|
case "coordinates":
|
|
29596
|
-
case "blob":
|
|
29597
|
-
|
|
29598
|
-
|
|
29599
|
-
|
|
29600
|
-
value = {};
|
|
29601
|
-
}
|
|
29602
|
-
else if (is_object(value)) {} else if (is_array(value)) {} else value = {};
|
|
30421
|
+
case "blob": {
|
|
30422
|
+
let r = parse_json_field(value, field_desc.type);
|
|
30423
|
+
if (r.error) log_warning(`${gobj_short_name(gobj)}: column '${col.id}' (${field_desc.type}) holds no valid json, taken as empty`);
|
|
30424
|
+
value = r.value;
|
|
29603
30425
|
break;
|
|
30426
|
+
}
|
|
29604
30427
|
case "enum":
|
|
29605
30428
|
switch (field_desc.real_type) {
|
|
29606
30429
|
case "string":
|
|
@@ -29781,6 +30604,24 @@ function ac_language_changed$4(gobj, event, kw, src) {
|
|
|
29781
30604
|
}
|
|
29782
30605
|
return 0;
|
|
29783
30606
|
}
|
|
30607
|
+
/************************************************************
|
|
30608
|
+
* The user icons changed (published by the shell): the cells
|
|
30609
|
+
* of an `icon` column decided when they were drawn whether
|
|
30610
|
+
* their name was an icon, so they are drawn again.
|
|
30611
|
+
************************************************************/
|
|
30612
|
+
function ac_icons_changed(gobj, event, kw, src) {
|
|
30613
|
+
let tabulator = gobj_read_attr(gobj, "tabulator");
|
|
30614
|
+
if (!tabulator) return 0;
|
|
30615
|
+
let desc = gobj_read_attr(gobj, "desc");
|
|
30616
|
+
if ((desc && Array.isArray(desc.cols) ? desc.cols : []).filter((col) => col && col.id && treedb_get_field_desc(col).type === "icon").length === 0) return 0;
|
|
30617
|
+
try {
|
|
30618
|
+
for (const row of tabulator.getRows()) row.reformat();
|
|
30619
|
+
} catch (e) {
|
|
30620
|
+
log_error(`${gobj_short_name(gobj)}: cannot redraw the icon cells: ${e}`);
|
|
30621
|
+
return -1;
|
|
30622
|
+
}
|
|
30623
|
+
return 0;
|
|
30624
|
+
}
|
|
29784
30625
|
function ac_load_nodes(gobj, event, kw, src) {
|
|
29785
30626
|
let data = kw;
|
|
29786
30627
|
if (!is_array(data)) {
|
|
@@ -30541,6 +31382,21 @@ function request_page(gobj, page, size) {
|
|
|
30541
31382
|
});
|
|
30542
31383
|
}
|
|
30543
31384
|
/************************************************************
|
|
31385
|
+
* The view stops: no page request is waited for any more. Each
|
|
31386
|
+
* one's watchdog would otherwise fire EV_PAGE_TIMEOUT on a gobj
|
|
31387
|
+
* stopped -- or destroyed -- 20 s later.
|
|
31388
|
+
************************************************************/
|
|
31389
|
+
function drop_pending_pages(gobj) {
|
|
31390
|
+
let priv = gobj.priv;
|
|
31391
|
+
let pending = priv._pending_pages || {};
|
|
31392
|
+
priv._pending_pages = {};
|
|
31393
|
+
for (let req_id of Object.keys(pending)) {
|
|
31394
|
+
let pend = pending[req_id];
|
|
31395
|
+
if (pend.timer) window.clearTimeout(pend.timer);
|
|
31396
|
+
pend.reject(/* @__PURE__ */ new Error("the view stopped"));
|
|
31397
|
+
}
|
|
31398
|
+
}
|
|
31399
|
+
/************************************************************
|
|
30544
31400
|
* Settle a parked page request, however it ended.
|
|
30545
31401
|
************************************************************/
|
|
30546
31402
|
function settle_page(gobj, req_id, value, error) {
|
|
@@ -30901,6 +31757,11 @@ function create_gclass$5(gclass_name) {
|
|
|
30901
31757
|
ac_language_changed$4,
|
|
30902
31758
|
null
|
|
30903
31759
|
],
|
|
31760
|
+
[
|
|
31761
|
+
"EV_ICONS_CHANGED",
|
|
31762
|
+
ac_icons_changed,
|
|
31763
|
+
null
|
|
31764
|
+
],
|
|
30904
31765
|
[
|
|
30905
31766
|
"EV_LOAD_NODES",
|
|
30906
31767
|
ac_load_nodes,
|
|
@@ -31139,6 +32000,7 @@ function create_gclass$5(gclass_name) {
|
|
|
31139
32000
|
]]];
|
|
31140
32001
|
const event_types = [
|
|
31141
32002
|
["EV_LANGUAGE_CHANGED", 0],
|
|
32003
|
+
["EV_ICONS_CHANGED", 0],
|
|
31142
32004
|
["EV_LOAD_NODES", 0],
|
|
31143
32005
|
["EV_LOAD_NODE_CREATED", 0],
|
|
31144
32006
|
["EV_LOAD_NODE_UPDATED", 0],
|
|
@@ -62823,6 +63685,7 @@ function start_node_resize(gobj, e, mx, my) {
|
|
|
62823
63685
|
function onPointerUp(ev) {
|
|
62824
63686
|
document.removeEventListener("pointermove", onPointerMove);
|
|
62825
63687
|
document.removeEventListener("pointerup", onPointerUp);
|
|
63688
|
+
document.removeEventListener("pointercancel", onPointerCancel);
|
|
62826
63689
|
const dLeft = (currentRect.left - origVpRect.left) / zoom;
|
|
62827
63690
|
const dTop = (currentRect.top - origVpRect.top) / zoom;
|
|
62828
63691
|
const dRight = (currentRect.right - origVpRect.right) / zoom;
|
|
@@ -62856,8 +63719,15 @@ function start_node_resize(gobj, e, mx, my) {
|
|
|
62856
63719
|
mark_graph_dirty(gobj);
|
|
62857
63720
|
});
|
|
62858
63721
|
}
|
|
63722
|
+
function onPointerCancel(ev) {
|
|
63723
|
+
document.removeEventListener("pointermove", onPointerMove);
|
|
63724
|
+
document.removeEventListener("pointerup", onPointerUp);
|
|
63725
|
+
document.removeEventListener("pointercancel", onPointerCancel);
|
|
63726
|
+
update_resize_handles_position(gobj);
|
|
63727
|
+
}
|
|
62859
63728
|
document.addEventListener("pointermove", onPointerMove);
|
|
62860
63729
|
document.addEventListener("pointerup", onPointerUp);
|
|
63730
|
+
document.addEventListener("pointercancel", onPointerCancel);
|
|
62861
63731
|
}
|
|
62862
63732
|
/************************************************************
|
|
62863
63733
|
* Port selection and individual port resizing
|
|
@@ -63445,6 +64315,7 @@ function start_link_drag(gobj, e) {
|
|
|
63445
64315
|
function onPointerUp(ev) {
|
|
63446
64316
|
document.removeEventListener("pointermove", onPointerMove);
|
|
63447
64317
|
document.removeEventListener("pointerup", onPointerUp);
|
|
64318
|
+
document.removeEventListener("pointercancel", onPointerCancel);
|
|
63448
64319
|
priv.$container.style.cursor = "";
|
|
63449
64320
|
if (priv._link_drag_svg) {
|
|
63450
64321
|
priv._link_drag_svg.remove();
|
|
@@ -63458,8 +64329,20 @@ function start_link_drag(gobj, e) {
|
|
|
63458
64329
|
if (target) try_complete_link(gobj, target.node_id, target.port_key);
|
|
63459
64330
|
else exit_linking_mode(gobj);
|
|
63460
64331
|
}
|
|
64332
|
+
function onPointerCancel(ev) {
|
|
64333
|
+
document.removeEventListener("pointermove", onPointerMove);
|
|
64334
|
+
document.removeEventListener("pointerup", onPointerUp);
|
|
64335
|
+
document.removeEventListener("pointercancel", onPointerCancel);
|
|
64336
|
+
priv.$container.style.cursor = "";
|
|
64337
|
+
if (priv._link_drag_svg) {
|
|
64338
|
+
priv._link_drag_svg.remove();
|
|
64339
|
+
priv._link_drag_svg = null;
|
|
64340
|
+
}
|
|
64341
|
+
exit_linking_mode(gobj);
|
|
64342
|
+
}
|
|
63461
64343
|
document.addEventListener("pointermove", onPointerMove);
|
|
63462
64344
|
document.addEventListener("pointerup", onPointerUp);
|
|
64345
|
+
document.addEventListener("pointercancel", onPointerCancel);
|
|
63463
64346
|
}
|
|
63464
64347
|
/************************************************************
|
|
63465
64348
|
* Find if a canvas point hits a valid hook port during
|
|
@@ -63646,6 +64529,7 @@ function start_port_resize(gobj, e) {
|
|
|
63646
64529
|
function onPointerUp(ev) {
|
|
63647
64530
|
document.removeEventListener("pointermove", onPointerMove);
|
|
63648
64531
|
document.removeEventListener("pointerup", onPointerUp);
|
|
64532
|
+
document.removeEventListener("pointercancel", onPointerCancel);
|
|
63649
64533
|
const dx = ev.clientX - clientCx;
|
|
63650
64534
|
const dy = ev.clientY - clientCy;
|
|
63651
64535
|
let vpR = Math.max(PORT_HANDLE_SIZE, Math.sqrt(dx * dx + dy * dy));
|
|
@@ -63668,8 +64552,15 @@ function start_port_resize(gobj, e) {
|
|
|
63668
64552
|
mark_graph_dirty(gobj);
|
|
63669
64553
|
});
|
|
63670
64554
|
}
|
|
64555
|
+
function onPointerCancel(ev) {
|
|
64556
|
+
document.removeEventListener("pointermove", onPointerMove);
|
|
64557
|
+
document.removeEventListener("pointerup", onPointerUp);
|
|
64558
|
+
document.removeEventListener("pointercancel", onPointerCancel);
|
|
64559
|
+
update_port_resize_handles_position(gobj);
|
|
64560
|
+
}
|
|
63671
64561
|
document.addEventListener("pointermove", onPointerMove);
|
|
63672
64562
|
document.addEventListener("pointerup", onPointerUp);
|
|
64563
|
+
document.addEventListener("pointercancel", onPointerCancel);
|
|
63673
64564
|
}
|
|
63674
64565
|
/************************************************************
|
|
63675
64566
|
* Edge selection: show a floating properties icon near
|
|
@@ -71728,6 +72619,7 @@ var JSON_FIELDS$1 = [
|
|
|
71728
72619
|
"properties",
|
|
71729
72620
|
"pkey2s"
|
|
71730
72621
|
];
|
|
72622
|
+
var C_BACKSLASH = "\\\\";
|
|
71731
72623
|
var JSON_BACKSLASH = "\\\\\\\\";
|
|
71732
72624
|
var JSON_DQUOTE = "\\\\\\\"";
|
|
71733
72625
|
var JSON_QUOTE = "\\\\u0027";
|
|
@@ -71833,7 +72725,19 @@ function c_scalar(value, key) {
|
|
|
71833
72725
|
* themselves.
|
|
71834
72726
|
***************************************************************/
|
|
71835
72727
|
function c_text(text) {
|
|
71836
|
-
return text.replace(/\\/g, JSON_BACKSLASH).replace(/"/g, JSON_DQUOTE).replace(/'/g, JSON_QUOTE);
|
|
72728
|
+
return text.replace(/\\/g, JSON_BACKSLASH).replace(/"/g, JSON_DQUOTE).replace(/'/g, JSON_QUOTE).replace(/[\u0000-\u001f\u007f]/g, json_control);
|
|
72729
|
+
}
|
|
72730
|
+
var JSON_SHORT_ESCAPES = {
|
|
72731
|
+
"\n": "n",
|
|
72732
|
+
"\r": "r",
|
|
72733
|
+
" ": "t",
|
|
72734
|
+
"\b": "b",
|
|
72735
|
+
"\f": "f"
|
|
72736
|
+
};
|
|
72737
|
+
function json_control(ch) {
|
|
72738
|
+
let short = JSON_SHORT_ESCAPES[ch];
|
|
72739
|
+
if (short) return C_BACKSLASH + short;
|
|
72740
|
+
return "\\\\u" + ch.charCodeAt(0).toString(16).padStart(4, "0");
|
|
71837
72741
|
}
|
|
71838
72742
|
/***************************************************************
|
|
71839
72743
|
* Render a value at `indent`, appending its lines to `lines`.
|
|
@@ -78154,16 +79058,19 @@ function build_ui(gobj) {
|
|
|
78154
79058
|
gobj_write_attr(gobj, "$container", $container);
|
|
78155
79059
|
}
|
|
78156
79060
|
function build_mode_button(gobj, mode) {
|
|
79061
|
+
let name = mode_name(mode);
|
|
78157
79062
|
let $btn = createElement2([
|
|
78158
79063
|
"button",
|
|
78159
79064
|
{
|
|
78160
79065
|
class: `button YUI_PERIOD_MODE YUI_PERIOD_MODE_${mode.id.toUpperCase()}`,
|
|
78161
|
-
type: "button"
|
|
79066
|
+
type: "button",
|
|
79067
|
+
title: name,
|
|
79068
|
+
"aria-label": name
|
|
78162
79069
|
},
|
|
78163
79070
|
[[
|
|
78164
79071
|
"span",
|
|
78165
79072
|
{ class: "YUI_PERIOD_MODE_TEXT" },
|
|
78166
|
-
|
|
79073
|
+
name
|
|
78167
79074
|
]]
|
|
78168
79075
|
]);
|
|
78169
79076
|
$btn.addEventListener("click", () => {
|
|
@@ -78185,16 +79092,19 @@ function build_more_menu(gobj) {
|
|
|
78185
79092
|
]);
|
|
78186
79093
|
for (let mode of priv.modes) {
|
|
78187
79094
|
if (!mode.overflow) continue;
|
|
79095
|
+
let name = mode_name(mode);
|
|
78188
79096
|
let $item = createElement2([
|
|
78189
79097
|
"a",
|
|
78190
79098
|
{
|
|
78191
79099
|
class: `dropdown-item YUI_PERIOD_MODE YUI_PERIOD_MODE_${mode.id.toUpperCase()}`,
|
|
78192
|
-
href: "#"
|
|
79100
|
+
href: "#",
|
|
79101
|
+
title: name,
|
|
79102
|
+
"aria-label": name
|
|
78193
79103
|
},
|
|
78194
79104
|
[[
|
|
78195
79105
|
"span",
|
|
78196
79106
|
{ class: "YUI_PERIOD_MODE_TEXT" },
|
|
78197
|
-
|
|
79107
|
+
name
|
|
78198
79108
|
]]
|
|
78199
79109
|
]);
|
|
78200
79110
|
$item.addEventListener("click", (ev) => {
|
|
@@ -78492,7 +79402,11 @@ function render_calendar(gobj) {
|
|
|
78492
79402
|
"button",
|
|
78493
79403
|
{
|
|
78494
79404
|
class: "button is-ghost mt-2 YUI_PERIOD_CAL_TODAY",
|
|
78495
|
-
type: "button"
|
|
79405
|
+
type: "button",
|
|
79406
|
+
title: t("today"),
|
|
79407
|
+
"data-i18n-title": "today",
|
|
79408
|
+
"aria-label": t("today"),
|
|
79409
|
+
"data-i18n-aria-label": "today"
|
|
78496
79410
|
},
|
|
78497
79411
|
[[
|
|
78498
79412
|
"span",
|
|
@@ -78820,8 +79734,11 @@ function ac_language_changed(gobj, event, kw, src) {
|
|
|
78820
79734
|
let priv = gobj.priv;
|
|
78821
79735
|
for (let mode of priv.modes) {
|
|
78822
79736
|
if (!mode.$btn) continue;
|
|
79737
|
+
let name = mode_name(mode);
|
|
78823
79738
|
let $text = mode.$btn.querySelector(".YUI_PERIOD_MODE_TEXT");
|
|
78824
|
-
if ($text) $text.textContent =
|
|
79739
|
+
if ($text) $text.textContent = name;
|
|
79740
|
+
mode.$btn.setAttribute("title", name);
|
|
79741
|
+
mode.$btn.setAttribute("aria-label", name);
|
|
78825
79742
|
}
|
|
78826
79743
|
repaint(gobj);
|
|
78827
79744
|
if (priv.$calendar) render_calendar(gobj);
|
|
@@ -80253,7 +81170,9 @@ function build_control_bar() {
|
|
|
80253
81170
|
"data-dir": key,
|
|
80254
81171
|
type: "button",
|
|
80255
81172
|
title: t(title),
|
|
80256
|
-
"data-i18n-title": title
|
|
81173
|
+
"data-i18n-title": title,
|
|
81174
|
+
"aria-label": t(title),
|
|
81175
|
+
"data-i18n-aria-label": title
|
|
80257
81176
|
},
|
|
80258
81177
|
glyph,
|
|
80259
81178
|
{ click: (ev) => {
|
|
@@ -80685,6 +81604,6 @@ function setup_json_pad(self) {
|
|
|
80685
81604
|
return win;
|
|
80686
81605
|
}
|
|
80687
81606
|
//#endregion
|
|
80688
|
-
export { EditControl, MarkerControl, YUI_FILE_ACCEPT, YUI_PERIODS, YUI_PERIODS_DEFAULT, YUI_ROLLING, addClasses, apply_dev_traces, attach_clear, build_dev_panel, dev_window_was_open, disableElements, enableElements, epoch_to_local_input, epoch_to_ms, expose_view_container, fmt_epoch, getStrokeColor, infer_period, info_traffic, inject_svg_icons, is_current_period, iso_week, local_input_to_epoch, ms_to_epoch, period_bounds, period_bounds_epoch, period_label, period_name, period_shift, period_spec, period_start, refresh_clear, register_c_g6_nodes_tree, register_c_yui_form, register_c_yui_fsm_graph, register_c_yui_gclass, register_c_yui_gobj_tree_js, register_c_yui_json, register_c_yui_json_graph, register_c_yui_json_pad, register_c_yui_map, register_c_yui_nav, register_c_yui_pager, register_c_yui_period, register_c_yui_schema_editor, register_c_yui_service_view, register_c_yui_shell, register_c_yui_treedb_graph, register_c_yui_treedb_schema, register_c_yui_treedb_topic_with_form, register_c_yui_treedb_topics, register_c_yui_uplot, register_c_yui_window, register_c_yui_window_manager, register_c_yui_wizard, removeChildElements, removeClasses, rolling_bounds, safe_locale, set_active_state, set_cancel_state, set_pressed_state, set_submit_state, setup_dev, setup_frontend_view, setup_json_pad, toggleClasses, yui_array_buffer_to_base64, yui_asset_element, yui_asset_id, yui_asset_ids, yui_asset_missing, yui_asset_src, yui_file_control, yui_file_id_label, yui_file_read, yui_file_sha256, yui_file_size_label, yui_files_manifest, yui_is_dark, yui_mount_service_view, yui_shell_close_drawer, yui_shell_close_dropdown, yui_shell_confirm_danger, yui_shell_confirm_ok, yui_shell_confirm_yesno, yui_shell_confirm_yesnocancel, yui_shell_navigate, yui_shell_open_drawer, yui_shell_overlay_dismissed, yui_shell_pop_escape, yui_shell_push_escape, yui_shell_refresh_avatars, yui_shell_register_event_handler, yui_shell_register_overlay, yui_shell_set_avatar_provider, yui_shell_set_connection_state, yui_shell_set_sub_routes, yui_shell_set_toolbar_item_badge, yui_shell_set_toolbar_item_icon, yui_shell_set_translator, yui_shell_show_error, yui_shell_show_info, yui_shell_show_modal, yui_shell_show_route_map, yui_shell_show_warning, yui_shell_toggle_drawer, yui_shell_unpark_route, yui_theme_now, yui_toolbar, yui_watch_theme };
|
|
81607
|
+
export { EditControl, ICONS_TOPIC, MarkerControl, USER_ICON_PREFIX, YUI_FILE_ACCEPT, YUI_PERIODS, YUI_PERIODS_DEFAULT, YUI_ROLLING, addClasses, apply_dev_traces, attach_clear, build_dev_panel, dev_window_was_open, disableElements, enableElements, epoch_to_local_input, epoch_to_ms, expose_view_container, fmt_epoch, getStrokeColor, infer_period, info_traffic, inject_svg_icons, is_current_period, iso_week, local_input_to_epoch, ms_to_epoch, period_bounds, period_bounds_epoch, period_label, period_name, period_shift, period_spec, period_start, refresh_clear, register_c_g6_nodes_tree, register_c_yui_form, register_c_yui_fsm_graph, register_c_yui_gclass, register_c_yui_gobj_tree_js, register_c_yui_json, register_c_yui_json_graph, register_c_yui_json_pad, register_c_yui_map, register_c_yui_nav, register_c_yui_pager, register_c_yui_period, register_c_yui_schema_editor, register_c_yui_service_view, register_c_yui_shell, register_c_yui_treedb_graph, register_c_yui_treedb_schema, register_c_yui_treedb_topic_with_form, register_c_yui_treedb_topics, register_c_yui_uplot, register_c_yui_window, register_c_yui_window_manager, register_c_yui_wizard, removeChildElements, removeClasses, rolling_bounds, safe_locale, set_active_state, set_cancel_state, set_pressed_state, set_submit_state, setup_dev, setup_frontend_view, setup_json_pad, toggleClasses, yui_array_buffer_to_base64, yui_asset_element, yui_asset_id, yui_asset_ids, yui_asset_missing, yui_asset_src, yui_file_control, yui_file_id_label, yui_file_read, yui_file_sha256, yui_file_size_label, yui_files_manifest, yui_icon_is_defined, yui_icons_list, yui_icons_put_user, yui_icons_remove_user, yui_icons_set_user, yui_is_dark, yui_mount_service_view, yui_shell_close_drawer, yui_shell_close_dropdown, yui_shell_confirm_danger, yui_shell_confirm_ok, yui_shell_confirm_yesno, yui_shell_confirm_yesnocancel, yui_shell_navigate, yui_shell_open_drawer, yui_shell_overlay_dismissed, yui_shell_pop_escape, yui_shell_push_escape, yui_shell_refresh_avatars, yui_shell_register_event_handler, yui_shell_register_overlay, yui_shell_set_avatar_provider, yui_shell_set_connection_state, yui_shell_set_sub_routes, yui_shell_set_toolbar_item_badge, yui_shell_set_toolbar_item_icon, yui_shell_set_translator, yui_shell_show_error, yui_shell_show_info, yui_shell_show_modal, yui_shell_show_route_map, yui_shell_show_warning, yui_shell_toggle_drawer, yui_shell_unpark_route, yui_svg_icon_element, yui_svg_sanitize, yui_theme_now, yui_toolbar, yui_user_icon_class, yui_watch_theme };
|
|
80689
81608
|
|
|
80690
81609
|
//# sourceMappingURL=gobj-ui.es.js.map
|