mol_dump_lib 0.0.847 → 0.0.849

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/node.js CHANGED
@@ -5774,51 +5774,60 @@ var $;
5774
5774
 
5775
5775
  ;
5776
5776
  ($.$mol_list) = class $mol_list extends ($.$mol_view) {
5777
- rows(){
5778
- return [];
5779
- }
5780
5777
  gap_before(){
5781
5778
  return 0;
5782
5779
  }
5783
- gap_after(){
5784
- return 0;
5785
- }
5786
- render_visible_only(){
5787
- return true;
5788
- }
5789
- render_over(){
5790
- return 0;
5791
- }
5792
- sub(){
5793
- return (this.rows());
5794
- }
5795
- Empty(){
5780
+ Gap_before(){
5796
5781
  const obj = new this.$.$mol_view();
5782
+ (obj.style) = () => ({"paddingTop": (this.gap_before())});
5797
5783
  return obj;
5798
5784
  }
5799
- Gap_before(){
5785
+ Empty(){
5800
5786
  const obj = new this.$.$mol_view();
5801
- (obj.style) = () => ({"paddingTop": (this.gap_before())});
5802
5787
  return obj;
5803
5788
  }
5789
+ gap_after(){
5790
+ return 0;
5791
+ }
5804
5792
  Gap_after(){
5805
5793
  const obj = new this.$.$mol_view();
5806
5794
  (obj.style) = () => ({"paddingTop": (this.gap_after())});
5807
5795
  return obj;
5808
5796
  }
5797
+ rows(){
5798
+ return [
5799
+ (this.Gap_before()),
5800
+ (this.Empty()),
5801
+ (this.Gap_after())
5802
+ ];
5803
+ }
5804
+ render_visible_only(){
5805
+ return true;
5806
+ }
5807
+ render_over(){
5808
+ return 0.1;
5809
+ }
5810
+ sub(){
5811
+ return (this.rows());
5812
+ }
5809
5813
  item_height_min(id){
5810
5814
  return 1;
5811
5815
  }
5812
5816
  item_width_min(id){
5813
5817
  return 1;
5814
5818
  }
5819
+ view_window_shift(next){
5820
+ if(next !== undefined) return next;
5821
+ return 0;
5822
+ }
5815
5823
  view_window(){
5816
5824
  return [0, 0];
5817
5825
  }
5818
5826
  };
5819
- ($mol_mem(($.$mol_list.prototype), "Empty"));
5820
5827
  ($mol_mem(($.$mol_list.prototype), "Gap_before"));
5828
+ ($mol_mem(($.$mol_list.prototype), "Empty"));
5821
5829
  ($mol_mem(($.$mol_list.prototype), "Gap_after"));
5830
+ ($mol_mem(($.$mol_list.prototype), "view_window_shift"));
5822
5831
 
5823
5832
 
5824
5833
  ;
@@ -5902,7 +5911,15 @@ var $;
5902
5911
  class $mol_list extends $.$mol_list {
5903
5912
  sub() {
5904
5913
  const rows = this.rows();
5905
- return (rows.length === 0) ? [this.Empty()] : rows;
5914
+ const next = (rows.length === 0) ? [this.Empty()] : rows;
5915
+ const prev = $mol_mem_cached(() => this.sub());
5916
+ const [start, end] = $mol_mem_cached(() => this.view_window()) ?? [0, 0];
5917
+ if (prev && $mol_mem_cached(() => prev[start] !== next[start])) {
5918
+ const index = $mol_mem_cached(() => next.indexOf(prev[start])) ?? -1;
5919
+ if (index >= 0)
5920
+ this.view_window_shift(index - start);
5921
+ }
5922
+ return next;
5906
5923
  }
5907
5924
  render_visible_only() {
5908
5925
  return this.$.$mol_support_css_overflow_anchor();
@@ -5917,6 +5934,9 @@ var $;
5917
5934
  if (next)
5918
5935
  return next;
5919
5936
  let [min, max] = $mol_mem_cached(() => this.view_window()) ?? [0, 0];
5937
+ const shift = this.view_window_shift();
5938
+ min += shift;
5939
+ max += shift;
5920
5940
  let max2 = max = Math.min(max, kids.length);
5921
5941
  let min2 = min = Math.max(0, Math.min(min, max - 1));
5922
5942
  const anchoring = this.render_visible_only();
@@ -6060,7 +6080,7 @@ var $;
6060
6080
  "use strict";
6061
6081
  var $;
6062
6082
  (function ($) {
6063
- $mol_style_attach("mol/list/list.view.css", "[mol_list] {\n\twill-change: contents;\n\tdisplay: flex;\n\tflex-direction: column;\n\tflex-shrink: 0;\n\tmax-width: 100%;\n\t/* display: flex;\n\talign-items: stretch;\n\talign-content: stretch; */\n\ttransition: none;\n\tmin-height: 1.5rem;\n}\n\n[mol_list_gap_before] ,\n[mol_list_gap_after] {\n\tdisplay: block !important;\n\tflex: none;\n\ttransition: none;\n\toverflow-anchor: none;\n}\n");
6083
+ $mol_style_attach("mol/list/list.view.css", "[mol_list] {\n\twill-change: contents;\n\tdisplay: flex;\n\tflex-direction: column;\n\tflex-shrink: 0;\n\tmax-width: 100%;\n\t/* display: flex;\n\talign-items: stretch;\n\talign-content: stretch; */\n\ttransition: none;\n\tmin-height: 1.5rem;\n\t/* will-change: contents; */\n}\n\n[mol_list_gap_before] ,\n[mol_list_gap_after] {\n\tdisplay: block !important;\n\tflex: none;\n\ttransition: none;\n\toverflow-anchor: none;\n}\n");
6064
6084
  })($ || ($ = {}));
6065
6085
 
6066
6086
  ;