@yuneta/gobj-ui 5.3.2 → 5.3.3
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/package.json +1 -1
- package/src/c_yui_node.css +19 -0
- package/src/c_yui_node.js +5 -1
package/package.json
CHANGED
package/src/c_yui_node.css
CHANGED
|
@@ -41,6 +41,25 @@
|
|
|
41
41
|
flex: 0 0 auto;
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
+
/* A LINK node is the other case: its viewer IS the page, so it takes
|
|
45
|
+
* the remaining height and is BOUNDED by it — the box the stage gives
|
|
46
|
+
* a view the shell mounts, which is the whole promise of a link ("a
|
|
47
|
+
* viewer cannot tell whether the shell mounted it or a node did").
|
|
48
|
+
*
|
|
49
|
+
* Sized by content, as above, it overflows its host instead of
|
|
50
|
+
* shrinking, and a viewer that MEASURES its own box to size a canvas
|
|
51
|
+
* (C_G6_NODES_TREE and its ResizeObserver) then grows the box it just
|
|
52
|
+
* measured: observe → setSize → bigger box → observe. That gclass
|
|
53
|
+
* documents "setSize does not change the observed box, so there is no
|
|
54
|
+
* feedback loop", and it is right — as long as somebody bounds the
|
|
55
|
+
* height. Under a link, that somebody is this rule. */
|
|
56
|
+
.NODE_CONTENT_LINK {
|
|
57
|
+
display: flex;
|
|
58
|
+
flex-direction: column;
|
|
59
|
+
flex: 1 1 auto;
|
|
60
|
+
min-height: 0;
|
|
61
|
+
}
|
|
62
|
+
|
|
44
63
|
/* The index projection (a card grid, a list…) is the page when this
|
|
45
64
|
* node is the tip: it takes the remaining height and scrolls. */
|
|
46
65
|
.NODE_INDEX {
|
package/src/c_yui_node.js
CHANGED
|
@@ -760,7 +760,11 @@ function render_self(gobj)
|
|
|
760
760
|
if(view) {
|
|
761
761
|
let $v = gobj_read_attr(view, "$container");
|
|
762
762
|
if($v) {
|
|
763
|
-
|
|
763
|
+
/* A LINK's viewer IS the page and must be BOUNDED by the
|
|
764
|
+
* body; a plain content is a header above the index and
|
|
765
|
+
* keeps its natural height. Two boxes, so two classes. */
|
|
766
|
+
let $slot = createElement2(["div", {class: has_link(gobj)
|
|
767
|
+
? "NODE_CONTENT NODE_CONTENT_LINK" : "NODE_CONTENT"}]);
|
|
764
768
|
$slot.appendChild($v);
|
|
765
769
|
priv.$body.appendChild($slot);
|
|
766
770
|
}
|