@fluid-topics/ft-reader-content 1.1.79 → 1.1.80
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.
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
display: flow-root;
|
|
29
29
|
min-height: ${M.itemContainerMinHeight};
|
|
30
30
|
}
|
|
31
|
-
`;var p=function(s,e,t,r){var o=arguments.length,i=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(s,e,t,r);else for(var n=s.length-1;n>=0;n--)(l=s[n])&&(i=(o<3?l(i):o>3?l(e,t,i):l(e,t))||i);return o>3&&i&&Object.defineProperty(e,t,i),i},L=class extends CustomEvent{constructor(e,t){super("visible-items-change",{detail:{visibleIndexes:e,visibleItems:t}})}},P=class extends Event{constructor(){super("scrolled-to-target")}},Te=s=>(s??[])[(s??[]).length-1],c=class extends d.FtLitElement{constructor(){super(...arguments),this.items=[],this.renderItem=()=>x.html``,this.getItemKey=(e,t)=>`${t} - ${JSON.stringify(e)}`,this.internalScroll=!1,this.renderBeforeFirst=1,this.renderAfterLast=1,this.ensureScrollToTarget=!1,this.visibleItems=[],this.scrolledToTarget=!1,this.scrolling=!1,this.renderApprovalTimeouts=[],this.renderedIndexes=new Set,this.scrollDebouncer=new d.Debouncer(5),this.scrollDoneDebouncer=new d.Debouncer(10),this.onVisibilityChange=e=>{let t=new Set(this.visibleItems),r=new Set;for(let o of e){let i=+o.target.getAttribute("data-item-index");o.intersectionRect.height>0?(t.add(i),r.add(i)):r.has(i)||t.delete(i)}this.visibleItems=[...t].sort((o,i)=>o-i)},this.intersectionObserver=new IntersectionObserver(this.onVisibilityChange),this.scrollingDebouncer=new d.Debouncer(50),this.ignoreNextScrollEvent=!1,this.scrollListener=()=>{var e;let t=this.ignoreNextScrollEvent;this.ignoreNextScrollEvent=!1,t||(this.scrolling=!0,this.scrollingDebouncer.run(()=>this.scrolling=!1));let r=this.scrollable.scrollTop,o=r-((e=this.lastScrollTop)!==null&&e!==void 0?e:0);if(this.lastScrollTop=r,this.scrolledToTarget
|
|
31
|
+
`;var p=function(s,e,t,r){var o=arguments.length,i=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(s,e,t,r);else for(var n=s.length-1;n>=0;n--)(l=s[n])&&(i=(o<3?l(i):o>3?l(e,t,i):l(e,t))||i);return o>3&&i&&Object.defineProperty(e,t,i),i},L=class extends CustomEvent{constructor(e,t){super("visible-items-change",{detail:{visibleIndexes:e,visibleItems:t}})}},P=class extends Event{constructor(){super("scrolled-to-target")}},Te=s=>(s??[])[(s??[]).length-1],c=class extends d.FtLitElement{constructor(){super(...arguments),this.items=[],this.renderItem=()=>x.html``,this.getItemKey=(e,t)=>`${t} - ${JSON.stringify(e)}`,this.internalScroll=!1,this.renderBeforeFirst=1,this.renderAfterLast=1,this.ensureScrollToTarget=!1,this.visibleItems=[],this.scrolledToTarget=!1,this.scrolling=!1,this.renderApprovalTimeouts=[],this.renderedIndexes=new Set,this.scrollDebouncer=new d.Debouncer(5),this.scrollDoneDebouncer=new d.Debouncer(10),this.onVisibilityChange=e=>{let t=new Set(this.visibleItems),r=new Set;for(let o of e){let i=+o.target.getAttribute("data-item-index");o.intersectionRect.height>0?(t.add(i),r.add(i)):r.has(i)||t.delete(i)}this.visibleItems=[...t].sort((o,i)=>o-i)},this.intersectionObserver=new IntersectionObserver(this.onVisibilityChange),this.scrollingDebouncer=new d.Debouncer(50),this.ignoreNextScrollEvent=!1,this.scrollListener=()=>{var e;let t=this.ignoreNextScrollEvent;this.ignoreNextScrollEvent=!1,t||(this.scrolling=!0,this.scrollingDebouncer.run(()=>this.scrolling=!1));let r=this.scrollable.scrollTop,o=r-((e=this.lastScrollTop)!==null&&e!==void 0?e:0);if(this.lastScrollTop=r,this.scrolledToTarget&&(this.restoreScrollIfNeeded(t?0:o),!t||this.scrollRestorationItem==null)){let i=this.searchFirstVisibleItem(r,this.itemsContainer.children);this.scrollRestorationItem=i?+i.getAttribute("data-item-index"):void 0,this.scrollRestorationOffset=r-this.getOffset(i)}},this.restoreScrollIfNeeded=(e=0)=>{var t;let r=this.scrollable.scrollHeight,o=r-((t=this.lastScrollHeight)!==null&&t!==void 0?t:r);if(this.lastScrollHeight=r,o!==0&&this.scrollRestorationItem!=null&&this.scrollRestorationOffset!=null&&this.scrolledToTarget){let i=this.getItem(this.scrollRestorationItem),l=this.getOffset(i),n=(0,d.minmax)(this.scrollRestorationItem===0?-l:1,this.scrollRestorationOffset,i.clientHeight-1),O=l+n+e-this.scrollable.scrollTop;(Math.abs(o-O)<4||Math.abs(O)>5)&&(this.ignoreNextScrollEvent=!0,this.scrollable.scrollTop+=O)}},this._shouldRestoreScroll=!1,this.scrollAdjustment=()=>{this.restoreScrollIfNeeded(),this.shouldRestoreScroll&&requestAnimationFrame(this.scrollAdjustment)},this.onMutation=()=>{for(let e of this.itemsContainer.children)this.intersectionObserver.observe(e)},this.mutationObserver=new MutationObserver(this.onMutation),this.resetVisibleItemsDebouncer=new d.Debouncer(10)}get scrollable(){var e;return(e=this._scrollable)!==null&&e!==void 0?e:document.body}set scrollable(e){var t,r,o,i;this._scrollable!==e&&((t=this._scrollable)===null||t===void 0||t.removeEventListener("scroll",this.scrollListener),this._scrollable&&this.initialOverflowAnchorValue&&(this.scrollable.style.overflowAnchor=this.initialOverflowAnchorValue),this._scrollable=e,(r=this._scrollable)===null||r===void 0||r.addEventListener("scroll",this.scrollListener),this.lastScrollTop=(o=this._scrollable)===null||o===void 0?void 0:o.scrollTop,this.lastScrollHeight=(i=this._scrollable)===null||i===void 0?void 0:i.scrollHeight,this._scrollable&&(this.initialOverflowAnchorValue=getComputedStyle(this._scrollable).overflowAnchor,this._scrollable.style.overflowAnchor="none"))}render(){return x.html`
|
|
32
32
|
<div class="items-container ${this.internalScroll?"scrollable":""}"
|
|
33
33
|
tabindex="-1"
|
|
34
34
|
@find-scrollable-parent=${this.findScrollableParent}>
|
|
@@ -69,7 +69,7 @@ Also for action icons.`,d.colorGray200),contentGlobalSubtle:r.extend("--ft-conte
|
|
|
69
69
|
display: flow-root;
|
|
70
70
|
min-height: ${fn.itemContainerMinHeight};
|
|
71
71
|
}
|
|
72
|
-
`;var F=function(o,e,t,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(o,e,t,n);else for(var c=o.length-1;c>=0;c--)(s=o[c])&&(a=(i<3?s(a):i>3?s(e,t,a):s(e,t))||a);return i>3&&a&&Object.defineProperty(e,t,a),a},un=class extends CustomEvent{constructor(e,t){super("visible-items-change",{detail:{visibleIndexes:e,visibleItems:t}})}},pn=class extends Event{constructor(){super("scrolled-to-target")}},Nl=o=>(o??[])[(o??[]).length-1],M=class extends ie{constructor(){super(...arguments),this.items=[],this.renderItem=()=>K``,this.getItemKey=(e,t)=>`${t} - ${JSON.stringify(e)}`,this.internalScroll=!1,this.renderBeforeFirst=1,this.renderAfterLast=1,this.ensureScrollToTarget=!1,this.visibleItems=[],this.scrolledToTarget=!1,this.scrolling=!1,this.renderApprovalTimeouts=[],this.renderedIndexes=new Set,this.scrollDebouncer=new Z(5),this.scrollDoneDebouncer=new Z(10),this.onVisibilityChange=e=>{let t=new Set(this.visibleItems),n=new Set;for(let i of e){let a=+i.target.getAttribute("data-item-index");i.intersectionRect.height>0?(t.add(a),n.add(a)):n.has(a)||t.delete(a)}this.visibleItems=[...t].sort((i,a)=>i-a)},this.intersectionObserver=new IntersectionObserver(this.onVisibilityChange),this.scrollingDebouncer=new Z(50),this.ignoreNextScrollEvent=!1,this.scrollListener=()=>{var e;let t=this.ignoreNextScrollEvent;this.ignoreNextScrollEvent=!1,t||(this.scrolling=!0,this.scrollingDebouncer.run(()=>this.scrolling=!1));let n=this.scrollable.scrollTop,i=n-((e=this.lastScrollTop)!==null&&e!==void 0?e:0);if(this.lastScrollTop=n,this.scrolledToTarget
|
|
72
|
+
`;var F=function(o,e,t,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(o,e,t,n);else for(var c=o.length-1;c>=0;c--)(s=o[c])&&(a=(i<3?s(a):i>3?s(e,t,a):s(e,t))||a);return i>3&&a&&Object.defineProperty(e,t,a),a},un=class extends CustomEvent{constructor(e,t){super("visible-items-change",{detail:{visibleIndexes:e,visibleItems:t}})}},pn=class extends Event{constructor(){super("scrolled-to-target")}},Nl=o=>(o??[])[(o??[]).length-1],M=class extends ie{constructor(){super(...arguments),this.items=[],this.renderItem=()=>K``,this.getItemKey=(e,t)=>`${t} - ${JSON.stringify(e)}`,this.internalScroll=!1,this.renderBeforeFirst=1,this.renderAfterLast=1,this.ensureScrollToTarget=!1,this.visibleItems=[],this.scrolledToTarget=!1,this.scrolling=!1,this.renderApprovalTimeouts=[],this.renderedIndexes=new Set,this.scrollDebouncer=new Z(5),this.scrollDoneDebouncer=new Z(10),this.onVisibilityChange=e=>{let t=new Set(this.visibleItems),n=new Set;for(let i of e){let a=+i.target.getAttribute("data-item-index");i.intersectionRect.height>0?(t.add(a),n.add(a)):n.has(a)||t.delete(a)}this.visibleItems=[...t].sort((i,a)=>i-a)},this.intersectionObserver=new IntersectionObserver(this.onVisibilityChange),this.scrollingDebouncer=new Z(50),this.ignoreNextScrollEvent=!1,this.scrollListener=()=>{var e;let t=this.ignoreNextScrollEvent;this.ignoreNextScrollEvent=!1,t||(this.scrolling=!0,this.scrollingDebouncer.run(()=>this.scrolling=!1));let n=this.scrollable.scrollTop,i=n-((e=this.lastScrollTop)!==null&&e!==void 0?e:0);if(this.lastScrollTop=n,this.scrolledToTarget&&(this.restoreScrollIfNeeded(t?0:i),!t||this.scrollRestorationItem==null)){let a=this.searchFirstVisibleItem(n,this.itemsContainer.children);this.scrollRestorationItem=a?+a.getAttribute("data-item-index"):void 0,this.scrollRestorationOffset=n-this.getOffset(a)}},this.restoreScrollIfNeeded=(e=0)=>{var t;let n=this.scrollable.scrollHeight,i=n-((t=this.lastScrollHeight)!==null&&t!==void 0?t:n);if(this.lastScrollHeight=n,i!==0&&this.scrollRestorationItem!=null&&this.scrollRestorationOffset!=null&&this.scrolledToTarget){let a=this.getItem(this.scrollRestorationItem),s=this.getOffset(a),c=Xr(this.scrollRestorationItem===0?-s:1,this.scrollRestorationOffset,a.clientHeight-1),l=s+c+e-this.scrollable.scrollTop;(Math.abs(i-l)<4||Math.abs(l)>5)&&(this.ignoreNextScrollEvent=!0,this.scrollable.scrollTop+=l)}},this._shouldRestoreScroll=!1,this.scrollAdjustment=()=>{this.restoreScrollIfNeeded(),this.shouldRestoreScroll&&requestAnimationFrame(this.scrollAdjustment)},this.onMutation=()=>{for(let e of this.itemsContainer.children)this.intersectionObserver.observe(e)},this.mutationObserver=new MutationObserver(this.onMutation),this.resetVisibleItemsDebouncer=new Z(10)}get scrollable(){var e;return(e=this._scrollable)!==null&&e!==void 0?e:document.body}set scrollable(e){var t,n,i,a;this._scrollable!==e&&((t=this._scrollable)===null||t===void 0||t.removeEventListener("scroll",this.scrollListener),this._scrollable&&this.initialOverflowAnchorValue&&(this.scrollable.style.overflowAnchor=this.initialOverflowAnchorValue),this._scrollable=e,(n=this._scrollable)===null||n===void 0||n.addEventListener("scroll",this.scrollListener),this.lastScrollTop=(i=this._scrollable)===null||i===void 0?void 0:i.scrollTop,this.lastScrollHeight=(a=this._scrollable)===null||a===void 0?void 0:a.scrollHeight,this._scrollable&&(this.initialOverflowAnchorValue=getComputedStyle(this._scrollable).overflowAnchor,this._scrollable.style.overflowAnchor="none"))}render(){return K`
|
|
73
73
|
<div class="items-container ${this.internalScroll?"scrollable":""}"
|
|
74
74
|
tabindex="-1"
|
|
75
75
|
@find-scrollable-parent=${this.findScrollableParent}>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluid-topics/ft-reader-content",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.80",
|
|
4
4
|
"description": "Main content for integrated reader",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Lit"
|
|
@@ -19,12 +19,12 @@
|
|
|
19
19
|
"url": "ssh://git@scm.mrs.antidot.net:2222/fluidtopics/ft-web-components.git"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@fluid-topics/ft-infinite-scroll": "1.1.
|
|
23
|
-
"@fluid-topics/ft-reader-topic-content": "1.1.
|
|
24
|
-
"@fluid-topics/ft-reader-topic-context": "1.1.
|
|
25
|
-
"@fluid-topics/ft-reader-topic-title": "1.1.
|
|
26
|
-
"@fluid-topics/ft-wc-utils": "1.1.
|
|
22
|
+
"@fluid-topics/ft-infinite-scroll": "1.1.80",
|
|
23
|
+
"@fluid-topics/ft-reader-topic-content": "1.1.80",
|
|
24
|
+
"@fluid-topics/ft-reader-topic-context": "1.1.80",
|
|
25
|
+
"@fluid-topics/ft-reader-topic-title": "1.1.80",
|
|
26
|
+
"@fluid-topics/ft-wc-utils": "1.1.80",
|
|
27
27
|
"lit": "3.1.0"
|
|
28
28
|
},
|
|
29
|
-
"gitHead": "
|
|
29
|
+
"gitHead": "9454653b9d84c51d905be4956706b7a0ef1aa2f6"
|
|
30
30
|
}
|