@yuneta/gobj-ui 7.23.23 → 7.23.24
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/dist/gobj-ui.cjs.js +11 -3
- package/dist/gobj-ui.es.js +11 -3
- package/package.json +1 -1
- package/src/c_yui_gobj_tree_js.js +14 -1
- package/src/c_yui_json.css +27 -0
- package/src/c_yui_json_graph.js +14 -0
package/dist/gobj-ui.cjs.js
CHANGED
|
@@ -10924,7 +10924,11 @@ function build_graph$3(gobj) {
|
|
|
10924
10924
|
}
|
|
10925
10925
|
},
|
|
10926
10926
|
layout: layout_cfg.g6_layout,
|
|
10927
|
-
behaviors: [
|
|
10927
|
+
behaviors: [
|
|
10928
|
+
"drag-canvas",
|
|
10929
|
+
"zoom-canvas",
|
|
10930
|
+
"drag-element"
|
|
10931
|
+
]
|
|
10928
10932
|
});
|
|
10929
10933
|
if (priv.theme) graph.setTheme(priv.theme);
|
|
10930
10934
|
graph.on(_antv_g6.NodeEvent.CLICK, (evt) => {
|
|
@@ -13423,7 +13427,7 @@ function build_ui$8(gobj) {
|
|
|
13423
13427
|
{
|
|
13424
13428
|
id: priv.canvas_id,
|
|
13425
13429
|
class: "gobj-tree-container",
|
|
13426
|
-
style: "height:100%; min-height:0; border: 1px solid var(--bulma-border-weak); border-radius:0.2rem;"
|
|
13430
|
+
style: "height:100%; min-height:0; border: 1px solid var(--bulma-border-weak); border-radius:0.2rem; touch-action:none; -webkit-user-select:none; user-select:none;"
|
|
13427
13431
|
},
|
|
13428
13432
|
[]
|
|
13429
13433
|
]]
|
|
@@ -13615,7 +13619,11 @@ function build_graph$2(gobj) {
|
|
|
13615
13619
|
}
|
|
13616
13620
|
},
|
|
13617
13621
|
layout: layout_cfg.g6_layout,
|
|
13618
|
-
behaviors: [
|
|
13622
|
+
behaviors: [
|
|
13623
|
+
"drag-canvas",
|
|
13624
|
+
"zoom-canvas",
|
|
13625
|
+
"drag-element"
|
|
13626
|
+
]
|
|
13619
13627
|
});
|
|
13620
13628
|
if (priv.theme) graph.setTheme(priv.theme);
|
|
13621
13629
|
graph.on("aftertransform", () => {
|
package/dist/gobj-ui.es.js
CHANGED
|
@@ -10919,7 +10919,11 @@ function build_graph$3(gobj) {
|
|
|
10919
10919
|
}
|
|
10920
10920
|
},
|
|
10921
10921
|
layout: layout_cfg.g6_layout,
|
|
10922
|
-
behaviors: [
|
|
10922
|
+
behaviors: [
|
|
10923
|
+
"drag-canvas",
|
|
10924
|
+
"zoom-canvas",
|
|
10925
|
+
"drag-element"
|
|
10926
|
+
]
|
|
10923
10927
|
});
|
|
10924
10928
|
if (priv.theme) graph.setTheme(priv.theme);
|
|
10925
10929
|
graph.on(NodeEvent.CLICK, (evt) => {
|
|
@@ -13418,7 +13422,7 @@ function build_ui$8(gobj) {
|
|
|
13418
13422
|
{
|
|
13419
13423
|
id: priv.canvas_id,
|
|
13420
13424
|
class: "gobj-tree-container",
|
|
13421
|
-
style: "height:100%; min-height:0; border: 1px solid var(--bulma-border-weak); border-radius:0.2rem;"
|
|
13425
|
+
style: "height:100%; min-height:0; border: 1px solid var(--bulma-border-weak); border-radius:0.2rem; touch-action:none; -webkit-user-select:none; user-select:none;"
|
|
13422
13426
|
},
|
|
13423
13427
|
[]
|
|
13424
13428
|
]]
|
|
@@ -13610,7 +13614,11 @@ function build_graph$2(gobj) {
|
|
|
13610
13614
|
}
|
|
13611
13615
|
},
|
|
13612
13616
|
layout: layout_cfg.g6_layout,
|
|
13613
|
-
behaviors: [
|
|
13617
|
+
behaviors: [
|
|
13618
|
+
"drag-canvas",
|
|
13619
|
+
"zoom-canvas",
|
|
13620
|
+
"drag-element"
|
|
13621
|
+
]
|
|
13614
13622
|
});
|
|
13615
13623
|
if (priv.theme) graph.setTheme(priv.theme);
|
|
13616
13624
|
graph.on("aftertransform", () => {
|
package/package.json
CHANGED
|
@@ -407,7 +407,13 @@ function build_ui(gobj)
|
|
|
407
407
|
['div', {class: 'C_YUI_GOBJ_TREE_JS', style: 'height:100%; display:flex; flex-direction:column; position:relative;'}, [
|
|
408
408
|
['div', {class: 'is-flex-grow-0 is-flex toolbar_yui_gobj_tree'}, $toolbar],
|
|
409
409
|
['div', {class: 'is-flex-grow-1', style: 'height:100%; min-height:0; overflow:hidden;'}, [
|
|
410
|
-
|
|
410
|
+
/* `touch-action` and `user-select` inline because this gclass loads no
|
|
411
|
+
* stylesheet of its own: G6 puts `touch-action: none` on its canvas and
|
|
412
|
+
* nothing on the html nodes over it, so without this a finger dragging a
|
|
413
|
+
* card makes a page scroll and stops dead after ~20px; and a card is
|
|
414
|
+
* text, so a mouse drag would start a selection. Same two rules
|
|
415
|
+
* `lib_graph.css` carries for the treedb graph. */
|
|
416
|
+
['div', {id: priv.canvas_id, class: 'gobj-tree-container', style: 'height:100%; min-height:0; border: 1px solid var(--bulma-border-weak); border-radius:0.2rem; touch-action:none; -webkit-user-select:none; user-select:none;'}, [
|
|
411
417
|
]]
|
|
412
418
|
]]
|
|
413
419
|
]]
|
|
@@ -650,6 +656,13 @@ function build_graph(gobj)
|
|
|
650
656
|
behaviors: [
|
|
651
657
|
'drag-canvas',
|
|
652
658
|
'zoom-canvas',
|
|
659
|
+
/* Move a card by dragging it. The position is not kept --
|
|
660
|
+
* this tree is rebuilt from the live gobj tree on every
|
|
661
|
+
* refresh -- and it is still worth having: pulling two
|
|
662
|
+
* cards apart to read the lines between them is the whole
|
|
663
|
+
* use of it. `enable` REPLACES a behavior's default rather
|
|
664
|
+
* than adding to it, so it is not passed. */
|
|
665
|
+
'drag-element',
|
|
653
666
|
],
|
|
654
667
|
});
|
|
655
668
|
|
package/src/c_yui_json.css
CHANGED
|
@@ -293,6 +293,33 @@
|
|
|
293
293
|
z-index: 1;
|
|
294
294
|
}
|
|
295
295
|
|
|
296
|
+
/*
|
|
297
|
+
* The graph mount, once its cards can be DRAGGED.
|
|
298
|
+
*
|
|
299
|
+
* Two problems, both of them the browser's rather than G6's, and both
|
|
300
|
+
* already paid for once in the treedb graph (`lib_graph.css`):
|
|
301
|
+
*
|
|
302
|
+
* G6 puts `touch-action: none` on its CANVAS and NOTHING on the html
|
|
303
|
+
* nodes, which are ordinary DIVs layered over it. So a finger landing
|
|
304
|
+
* on a card made a page scroll: two `pointermove`s through, then the
|
|
305
|
+
* browser decided the gesture was a scroll and killed the stream with
|
|
306
|
+
* `pointercancel` -- the card followed for about 20px and stopped dead
|
|
307
|
+
* while the page slid.
|
|
308
|
+
*
|
|
309
|
+
* And a card is text: dragging one starts a text selection, and the
|
|
310
|
+
* wash stays until the next click somewhere else. Nothing on this
|
|
311
|
+
* canvas is prose.
|
|
312
|
+
*
|
|
313
|
+
* On the CONTAINER and not the cards: every layer G6 stacks in here is
|
|
314
|
+
* a DIV over a canvas that already refuses the browser's gestures, and
|
|
315
|
+
* they have to agree.
|
|
316
|
+
*/
|
|
317
|
+
.C_YUI_JSON .json-graph-container {
|
|
318
|
+
touch-action: none;
|
|
319
|
+
-webkit-user-select: none;
|
|
320
|
+
user-select: none;
|
|
321
|
+
}
|
|
322
|
+
|
|
296
323
|
/*
|
|
297
324
|
* Disable any transition a host stylesheet might inject.
|
|
298
325
|
*/
|
package/src/c_yui_json_graph.js
CHANGED
|
@@ -694,6 +694,20 @@ function build_graph(gobj)
|
|
|
694
694
|
behaviors: [
|
|
695
695
|
'drag-canvas',
|
|
696
696
|
'zoom-canvas',
|
|
697
|
+
/*
|
|
698
|
+
* Move a card by dragging it. The position is NOT kept:
|
|
699
|
+
* the graph is rebuilt from the document on every refresh,
|
|
700
|
+
* fold and layout change, and there is nothing here to
|
|
701
|
+
* save it to -- this is a viewer over a value somebody
|
|
702
|
+
* handed it, not a document of its own. Deliberate: being
|
|
703
|
+
* able to pull two cards apart to read the lines between
|
|
704
|
+
* them is worth having even when it lasts one session.
|
|
705
|
+
*
|
|
706
|
+
* No `enable`: a behavior's `enable` REPLACES the default,
|
|
707
|
+
* it does not add to it, and the default here is exactly
|
|
708
|
+
* what is wanted.
|
|
709
|
+
*/
|
|
710
|
+
'drag-element',
|
|
697
711
|
],
|
|
698
712
|
});
|
|
699
713
|
|