@nylas/react 1.1.2 → 1.1.4

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.
Files changed (172) hide show
  1. package/dist/add-circle-icon_2.entry-6753bd65.js +25 -0
  2. package/dist/add-circle-icon_2.entry-cd9a7f37.cjs +1 -0
  3. package/dist/archive-icon.entry-434d1696.js +15 -0
  4. package/dist/archive-icon.entry-7cb1c265.cjs +1 -0
  5. package/dist/arrow-icon.entry-20b50784.js +15 -0
  6. package/dist/{arrow-icon.entry-a924df13.cjs → arrow-icon.entry-83c3105b.cjs} +1 -1
  7. package/dist/bold-icon.entry-0e3d84e1.cjs +1 -0
  8. package/dist/bold-icon.entry-34b18d0d.js +15 -0
  9. package/dist/{button-component_2.entry-b9d3f6a2.cjs → button-component_2.entry-54101987.cjs} +1 -1
  10. package/dist/{button-component_2.entry-93aa59a2.js → button-component_2.entry-8a5e99da.js} +7 -7
  11. package/dist/calendar-agenda-fill-icon_51.entry-1920adc2.cjs +7 -0
  12. package/dist/{calendar-agenda-fill-icon_48.entry-476bc4ef.js → calendar-agenda-fill-icon_51.entry-a351dca5.js} +997 -917
  13. package/dist/{calendar-cancel-icon.entry-11bb8656.cjs → calendar-cancel-icon.entry-00756264.cjs} +1 -1
  14. package/dist/{calendar-cancel-icon.entry-ee0acc54.js → calendar-cancel-icon.entry-f83e9b41.js} +2 -2
  15. package/dist/{calendar-check-icon_2.entry-54a82e1e.js → calendar-check-icon_2.entry-1817540c.js} +7 -7
  16. package/dist/{calendar-check-icon_2.entry-14548656.cjs → calendar-check-icon_2.entry-6ac948fc.cjs} +1 -1
  17. package/dist/{calendar-icon.entry-29f7003b.js → calendar-icon.entry-362428bf.js} +4 -4
  18. package/dist/{calendar-icon.entry-1a17f887.cjs → calendar-icon.entry-68e53f52.cjs} +1 -1
  19. package/dist/{checkbox-component_2.entry-dfec10cb.js → checkbox-component_2.entry-0d7c1916.js} +3 -3
  20. package/dist/{checkbox-component_2.entry-84a17232.cjs → checkbox-component_2.entry-5ce9807d.cjs} +1 -1
  21. package/dist/{chevron-icon_3.entry-826e81d4.js → chevron-icon_3.entry-37c087a7.js} +8 -8
  22. package/dist/{chevron-icon_3.entry-5da08d02.cjs → chevron-icon_3.entry-89c52603.cjs} +1 -1
  23. package/dist/{clock-icon_4.entry-36d97f00.js → clock-icon_4.entry-2e78febe.js} +11 -11
  24. package/dist/{clock-icon_4.entry-dafdd895.cjs → clock-icon_4.entry-496058ef.cjs} +1 -1
  25. package/dist/{constants-50c3e067-fed7fb48.js → constants-c31dccfe-04b9cd8a.js} +2 -2
  26. package/dist/{constants-50c3e067-1fe54cf3.cjs → constants-c31dccfe-1a739653.cjs} +2 -2
  27. package/dist/{copy-icon.entry-6d1a649d.js → copy-icon.entry-6d4e05b0.js} +7 -7
  28. package/dist/{copy-icon.entry-eec265da.cjs → copy-icon.entry-a1baee33.cjs} +1 -1
  29. package/dist/delete-icon.entry-e98b336e.cjs +1 -0
  30. package/dist/delete-icon.entry-ea06b42a.js +15 -0
  31. package/dist/document-refresh-icon.entry-09750b52.cjs +1 -0
  32. package/dist/document-refresh-icon.entry-afae6621.js +15 -0
  33. package/dist/elements/index.d.ts +2 -11
  34. package/dist/feedbackSync-ab657d65-e650e46d.cjs +448 -0
  35. package/dist/feedbackSync-ab657d65-e8b7c001.js +6035 -0
  36. package/dist/folder-icon.entry-5c3f4e8f.cjs +1 -0
  37. package/dist/folder-icon.entry-6096fbf4.js +15 -0
  38. package/dist/forward-icon.entry-4089e3bb.cjs +1 -0
  39. package/dist/forward-icon.entry-da319c05.js +15 -0
  40. package/dist/{globe-icon.entry-154ccdb5.js → globe-icon.entry-59f4c2f9.js} +4 -4
  41. package/dist/{globe-icon.entry-95fc0408.cjs → globe-icon.entry-e8ca972e.cjs} +1 -1
  42. package/dist/{google-logo-icon_4.entry-68cfa3fe.js → google-logo-icon_4.entry-d4b8926f.js} +331 -289
  43. package/dist/google-logo-icon_4.entry-e2001f83.cjs +1 -0
  44. package/dist/inbox-icon.entry-70dae5ec.js +15 -0
  45. package/dist/inbox-icon.entry-80ee9082.cjs +1 -0
  46. package/dist/index-6b9d4b01.cjs +81 -0
  47. package/dist/{index-1322d804.js → index-e475e0c0.js} +3126 -3103
  48. package/dist/index.d.ts +1 -1
  49. package/dist/{index.es-79f5b771-08cc349d.cjs → index.es-b475d61f-68a74a28.cjs} +5 -5
  50. package/dist/{index.es-79f5b771-04cd3414.js → index.es-b475d61f-bfa2cba2.js} +125 -131
  51. package/dist/{info-icon_2.entry-49261a0a.js → info-icon_2.entry-2bb60213.js} +3 -3
  52. package/dist/{info-icon_2.entry-2af880b8.cjs → info-icon_2.entry-f1b1dfba.cjs} +1 -1
  53. package/dist/{input-color-picker.entry-aefe0e26.js → input-color-picker.entry-5ae45a9e.js} +3 -3
  54. package/dist/{input-color-picker.entry-57adff77.cjs → input-color-picker.entry-b669f7fb.cjs} +1 -1
  55. package/dist/{input-component.entry-d7c2724b.js → input-component.entry-cb958501.js} +2 -2
  56. package/dist/{input-component.entry-09c3c9b6.cjs → input-component.entry-eeb95361.cjs} +1 -1
  57. package/dist/{input-dropdown.entry-e7d26273.cjs → input-dropdown.entry-0b458f68.cjs} +1 -1
  58. package/dist/{input-dropdown.entry-e573ade0.js → input-dropdown.entry-962605f8.js} +4 -4
  59. package/dist/italic-icon.entry-4a89e289.cjs +1 -0
  60. package/dist/italic-icon.entry-5be07509.js +15 -0
  61. package/dist/{multi-select-dropdown.entry-15cacb87.js → multi-select-dropdown.entry-3084e1fc.js} +5 -5
  62. package/dist/{multi-select-dropdown.entry-46b2b1c9.cjs → multi-select-dropdown.entry-a66408a2.cjs} +1 -1
  63. package/dist/nylas-booked-event-card_12.entry-227ccf31.cjs +1 -0
  64. package/dist/{nylas-booked-event-card_12.entry-3921071a.js → nylas-booked-event-card_12.entry-29e2a4b1.js} +84 -81
  65. package/dist/{nylas-form-card.entry-ca835017.js → nylas-form-card.entry-33b4c295.js} +15 -15
  66. package/dist/{nylas-form-card.entry-db3f0e3b.cjs → nylas-form-card.entry-8465eccf.cjs} +1 -1
  67. package/dist/{nylas-if-state.entry-4159d41d.js → nylas-if-state.entry-9d96fc87.js} +2 -2
  68. package/dist/{nylas-if-state.entry-5410607c.cjs → nylas-if-state.entry-adb6103a.cjs} +1 -1
  69. package/dist/{nylas-login.entry-590e7fba.js → nylas-login.entry-3f7c195e.js} +7 -7
  70. package/dist/{nylas-login.entry-f1d7bc7d.cjs → nylas-login.entry-78b968d1.cjs} +1 -1
  71. package/dist/nylas-provider.entry-19635620.js +264 -0
  72. package/dist/nylas-provider.entry-b918d0f6.cjs +1 -0
  73. package/dist/nylas-reminder-emails.entry-ec79b757.js +168 -0
  74. package/dist/nylas-reminder-emails.entry-ee76db24.cjs +4 -0
  75. package/dist/{nylas-reminder-time_2.entry-0357f280.js → nylas-reminder-time_2.entry-105de2d0.js} +42 -39
  76. package/dist/nylas-reminder-time_2.entry-83ecc1d4.cjs +1 -0
  77. package/dist/{nylas-scheduler-editor.entry-d2c3bddc.cjs → nylas-scheduler-editor.entry-cfed7ae2.cjs} +2 -2
  78. package/dist/{nylas-scheduler-editor.entry-6bb290ed.js → nylas-scheduler-editor.entry-e848771f.js} +7 -7
  79. package/dist/nylas-scheduling.entry-da987c02.js +400 -0
  80. package/dist/nylas-scheduling.entry-e989cf9e.cjs +1 -0
  81. package/dist/{nylas-time-window-picker.entry-1b449403.cjs → nylas-time-window-picker.entry-1f76b577.cjs} +1 -1
  82. package/dist/{nylas-time-window-picker.entry-260f52a6.js → nylas-time-window-picker.entry-3c6b29d9.js} +20 -20
  83. package/dist/{person-icon.entry-ed6786db.js → person-icon.entry-79fcd9fb.js} +4 -4
  84. package/dist/{person-icon.entry-b4ce06b7.cjs → person-icon.entry-82bbb87c.cjs} +1 -1
  85. package/dist/play-icon.entry-3f357ea4.cjs +1 -0
  86. package/dist/play-icon.entry-97b40470.js +15 -0
  87. package/dist/react.cjs +1 -1
  88. package/dist/react.js +109 -118
  89. package/dist/{refresh-icon.entry-87af05b0.js → refresh-icon.entry-1427a5e6.js} +5 -5
  90. package/dist/{refresh-icon.entry-21ac359d.cjs → refresh-icon.entry-7ce5ec90.cjs} +1 -1
  91. package/dist/{register-component-ea95564d-a64ee107.cjs → register-component-679c1308-b5a96acf.cjs} +1 -1
  92. package/dist/{register-component-ea95564d-843da1da.js → register-component-679c1308-de697ecb.js} +1 -1
  93. package/dist/reply-all-icon.entry-cf8114db.cjs +1 -0
  94. package/dist/reply-all-icon.entry-f1165660.js +15 -0
  95. package/dist/reply-icon.entry-3a601cff.js +15 -0
  96. package/dist/reply-icon.entry-3db337c9.cjs +1 -0
  97. package/dist/{scheduler-config-store-2a3b403d-8553b685.js → scheduler-config-store-2a3b403d-e5210f72.js} +1 -1
  98. package/dist/{scheduler-config-store-2a3b403d-88840eb1.cjs → scheduler-config-store-2a3b403d-e6f5bcab.cjs} +1 -1
  99. package/dist/scheduler-store-908886c8-62d14677.cjs +1 -0
  100. package/dist/{scheduler-store-9ff4914b-d1a624f8.js → scheduler-store-908886c8-b0f43cb9.js} +2 -2
  101. package/dist/sent-icon.entry-2c7bd48e.js +15 -0
  102. package/dist/sent-icon.entry-708b9a2b.cjs +1 -0
  103. package/dist/spam-icon.entry-3106ed3d.js +15 -0
  104. package/dist/spam-icon.entry-fa8b80c6.cjs +1 -0
  105. package/dist/star-icon.entry-88501c8b.cjs +1 -0
  106. package/dist/star-icon.entry-b15601ca.js +15 -0
  107. package/dist/stop-icon.entry-3475e257.cjs +1 -0
  108. package/dist/stop-icon.entry-f926a8db.js +15 -0
  109. package/dist/{textarea-component.entry-cbffb0b0.cjs → textarea-component.entry-683c2959.cjs} +1 -1
  110. package/dist/{textarea-component.entry-dad42f20.js → textarea-component.entry-d1f4dd9a.js} +2 -2
  111. package/dist/{time-period-selector.entry-e54d0989.cjs → time-period-selector.entry-8cfdf750.cjs} +1 -1
  112. package/dist/{time-period-selector.entry-79c94da3.js → time-period-selector.entry-e97f86fd.js} +2 -2
  113. package/dist/{translate-icon.entry-ef6266c4.js → translate-icon.entry-09c5574f.js} +2 -2
  114. package/dist/{translate-icon.entry-8e9eeeba.cjs → translate-icon.entry-5757c37c.cjs} +1 -1
  115. package/dist/trash-fill-icon.entry-470ec1ff.js +15 -0
  116. package/dist/trash-fill-icon.entry-4bbfabcc.cjs +1 -0
  117. package/dist/underline-icon.entry-6d729068.cjs +1 -0
  118. package/dist/underline-icon.entry-9fe74ba7.js +15 -0
  119. package/dist/{warning-icon.entry-34c85de2.cjs → warning-icon.entry-c1d48318.cjs} +1 -1
  120. package/dist/{warning-icon.entry-adf18211.js → warning-icon.entry-d924f8f9.js} +5 -5
  121. package/package.json +2 -2
  122. package/dist/add-circle-icon_2.entry-611be49d.js +0 -25
  123. package/dist/add-circle-icon_2.entry-f1383568.cjs +0 -1
  124. package/dist/archive-icon_7.entry-59cc6868.cjs +0 -1
  125. package/dist/archive-icon_7.entry-5e6ba9e7.js +0 -75
  126. package/dist/arrow-icon.entry-9c19a803.js +0 -15
  127. package/dist/bold-icon_3.entry-2935a3df.js +0 -35
  128. package/dist/bold-icon_3.entry-ffe02f93.cjs +0 -1
  129. package/dist/calendar-agenda-fill-icon_48.entry-c4ea84b3.cjs +0 -7
  130. package/dist/delete-icon_2.entry-160ba41e.cjs +0 -1
  131. package/dist/delete-icon_2.entry-528a3879.js +0 -25
  132. package/dist/document-refresh-icon.entry-276704dc.cjs +0 -1
  133. package/dist/document-refresh-icon.entry-6565f3b5.js +0 -15
  134. package/dist/elements-dc5b338e-2d3857dc.js +0 -28031
  135. package/dist/elements-dc5b338e-b06b2857.cjs +0 -16516
  136. package/dist/flow-40ff9cea-6f8c30e2.cjs +0 -9
  137. package/dist/flow-40ff9cea-ee70fdf5.js +0 -505
  138. package/dist/focus-visible-e8093c16-47e61336.cjs +0 -1
  139. package/dist/focus-visible-e8093c16-6f68eb89.js +0 -84
  140. package/dist/forward-icon_6.entry-ed6ab66a.js +0 -953
  141. package/dist/forward-icon_6.entry-fed8994d.cjs +0 -3
  142. package/dist/google-logo-icon_4.entry-afffb209.cjs +0 -1
  143. package/dist/index-c4e817ef.cjs +0 -82
  144. package/dist/mailbox-store-9c52a3fa-27f8f7e6.js +0 -380
  145. package/dist/mailbox-store-9c52a3fa-6b39645f.cjs +0 -1
  146. package/dist/nylas-booked-event-card_12.entry-47c5381d.cjs +0 -1
  147. package/dist/nylas-list-folders.entry-0f143930.cjs +0 -1
  148. package/dist/nylas-list-folders.entry-6b4a3d96.js +0 -120
  149. package/dist/nylas-list-threads.entry-62108562.js +0 -70
  150. package/dist/nylas-list-threads.entry-68b6f32b.cjs +0 -1
  151. package/dist/nylas-mailbox-pagination.entry-8377fdee.cjs +0 -1
  152. package/dist/nylas-mailbox-pagination.entry-ba1af8fb.js +0 -101
  153. package/dist/nylas-mailbox-toolbar-button.entry-4497acd0.js +0 -82
  154. package/dist/nylas-mailbox-toolbar-button.entry-6a5d8387.cjs +0 -1
  155. package/dist/nylas-mailbox.entry-917c22f5.js +0 -134
  156. package/dist/nylas-mailbox.entry-a07652b4.cjs +0 -1
  157. package/dist/nylas-provider.entry-0e520ac3.cjs +0 -1
  158. package/dist/nylas-provider.entry-20c47b14.js +0 -145
  159. package/dist/nylas-reminder-emails.entry-088ee120.js +0 -129
  160. package/dist/nylas-reminder-emails.entry-69626e7f.cjs +0 -4
  161. package/dist/nylas-reminder-time_2.entry-b5c181db.cjs +0 -1
  162. package/dist/nylas-scheduling.entry-bc9c25c5.js +0 -359
  163. package/dist/nylas-scheduling.entry-dc92d5e7.cjs +0 -1
  164. package/dist/nylas-threads-refresh.entry-45d7d171.js +0 -74
  165. package/dist/nylas-threads-refresh.entry-6636e7b1.cjs +0 -1
  166. package/dist/nylas-threads-search.entry-4460aa9b.js +0 -69
  167. package/dist/nylas-threads-search.entry-ae87695a.cjs +0 -1
  168. package/dist/nylas-view-thread.entry-5821630b.js +0 -203
  169. package/dist/nylas-view-thread.entry-5a9b353a.cjs +0 -1
  170. package/dist/play-icon_2.entry-261ea828.js +0 -25
  171. package/dist/play-icon_2.entry-87fe39a9.cjs +0 -1
  172. package/dist/scheduler-store-9ff4914b-63dc472a.cjs +0 -1
@@ -1,9 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});/**
2
- * @license
3
- * Copyright 2021 Google LLC
4
- * SPDX-License-Identifier: BSD-3-Clause
5
- */class g{constructor(i){this._map=new Map,this._roundAverageSize=!1,this.totalSize=0,(i==null?void 0:i.roundAverageSize)===!0&&(this._roundAverageSize=!0)}set(i,t){const s=this._map.get(i)||0;this._map.set(i,t),this.totalSize+=t-s}get averageSize(){if(this._map.size>0){const i=this.totalSize/this._map.size;return this._roundAverageSize?Math.round(i):i}return 0}getSize(i){return this._map.get(i)}clear(){this._map.clear(),this.totalSize=0}}/**
6
- * @license
7
- * Copyright 2021 Google LLC
8
- * SPDX-License-Identifier: BSD-3-Clause
9
- */function f(o){return o==="horizontal"?"width":"height"}class d{_getDefaultConfig(){return{direction:"vertical"}}constructor(i,t){this._latestCoords={left:0,top:0},this._direction=null,this._viewportSize={width:0,height:0},this.totalScrollSize={width:0,height:0},this.offsetWithinScroller={left:0,top:0},this._pendingReflow=!1,this._pendingLayoutUpdate=!1,this._pin=null,this._firstVisible=0,this._lastVisible=0,this._physicalMin=0,this._physicalMax=0,this._first=-1,this._last=-1,this._sizeDim="height",this._secondarySizeDim="width",this._positionDim="top",this._secondaryPositionDim="left",this._scrollPosition=0,this._scrollError=0,this._items=[],this._scrollSize=1,this._overhang=1e3,this._hostSink=i,Promise.resolve().then(()=>this.config=t||this._getDefaultConfig())}set config(i){Object.assign(this,Object.assign({},this._getDefaultConfig(),i))}get config(){return{direction:this.direction}}get items(){return this._items}set items(i){this._setItems(i)}_setItems(i){i!==this._items&&(this._items=i,this._scheduleReflow())}get direction(){return this._direction}set direction(i){i=i==="horizontal"?i:"vertical",i!==this._direction&&(this._direction=i,this._sizeDim=i==="horizontal"?"width":"height",this._secondarySizeDim=i==="horizontal"?"height":"width",this._positionDim=i==="horizontal"?"left":"top",this._secondaryPositionDim=i==="horizontal"?"top":"left",this._triggerReflow())}get viewportSize(){return this._viewportSize}set viewportSize(i){const{_viewDim1:t,_viewDim2:s}=this;Object.assign(this._viewportSize,i),s!==this._viewDim2?this._scheduleLayoutUpdate():t!==this._viewDim1&&this._checkThresholds()}get viewportScroll(){return this._latestCoords}set viewportScroll(i){Object.assign(this._latestCoords,i);const t=this._scrollPosition;this._scrollPosition=this._latestCoords[this._positionDim],Math.abs(t-this._scrollPosition)>=1&&this._checkThresholds()}reflowIfNeeded(i=!1){(i||this._pendingReflow)&&(this._pendingReflow=!1,this._reflow())}set pin(i){this._pin=i,this._triggerReflow()}get pin(){if(this._pin!==null){const{index:i,block:t}=this._pin;return{index:Math.max(0,Math.min(i,this.items.length-1)),block:t}}return null}_clampScrollPosition(i){return Math.max(-this.offsetWithinScroller[this._positionDim],Math.min(i,this.totalScrollSize[f(this.direction)]-this._viewDim1))}unpin(){this._pin!==null&&(this._sendUnpinnedMessage(),this._pin=null)}_updateLayout(){}get _viewDim1(){return this._viewportSize[this._sizeDim]}get _viewDim2(){return this._viewportSize[this._secondarySizeDim]}_scheduleReflow(){this._pendingReflow=!0}_scheduleLayoutUpdate(){this._pendingLayoutUpdate=!0,this._scheduleReflow()}_triggerReflow(){this._scheduleLayoutUpdate(),Promise.resolve().then(()=>this.reflowIfNeeded())}_reflow(){this._pendingLayoutUpdate&&(this._updateLayout(),this._pendingLayoutUpdate=!1),this._updateScrollSize(),this._setPositionFromPin(),this._getActiveItems(),this._updateVisibleIndices(),this._sendStateChangedMessage()}_setPositionFromPin(){if(this.pin!==null){const i=this._scrollPosition,{index:t,block:s}=this.pin;this._scrollPosition=this._calculateScrollIntoViewPosition({index:t,block:s||"start"})-this.offsetWithinScroller[this._positionDim],this._scrollError=i-this._scrollPosition}}_calculateScrollIntoViewPosition(i){const{block:t}=i,s=Math.min(this.items.length,Math.max(0,i.index)),h=this._getItemPosition(s)[this._positionDim];let n=h;if(t!=="start"){const l=this._getItemSize(s)[this._sizeDim];if(t==="center")n=h-.5*this._viewDim1+.5*l;else{const e=h-this._viewDim1+l;if(t==="end")n=e;else{const r=this._scrollPosition;n=Math.abs(r-h)<Math.abs(r-e)?h:e}}}return n+=this.offsetWithinScroller[this._positionDim],this._clampScrollPosition(n)}getScrollIntoViewCoordinates(i){return{[this._positionDim]:this._calculateScrollIntoViewPosition(i)}}_sendUnpinnedMessage(){this._hostSink({type:"unpinned"})}_sendVisibilityChangedMessage(){this._hostSink({type:"visibilityChanged",firstVisible:this._firstVisible,lastVisible:this._lastVisible})}_sendStateChangedMessage(){const i=new Map;if(this._first!==-1&&this._last!==-1)for(let s=this._first;s<=this._last;s++)i.set(s,this._getItemPosition(s));const t={type:"stateChanged",scrollSize:{[this._sizeDim]:this._scrollSize,[this._secondarySizeDim]:null},range:{first:this._first,last:this._last,firstVisible:this._firstVisible,lastVisible:this._lastVisible},childPositions:i};this._scrollError&&(t.scrollError={[this._positionDim]:this._scrollError,[this._secondaryPositionDim]:0},this._scrollError=0),this._hostSink(t)}get _num(){return this._first===-1||this._last===-1?0:this._last-this._first+1}_checkThresholds(){if(this._viewDim1===0&&this._num>0||this._pin!==null)this._scheduleReflow();else{const i=Math.max(0,this._scrollPosition-this._overhang),t=Math.min(this._scrollSize,this._scrollPosition+this._viewDim1+this._overhang);this._physicalMin>i||this._physicalMax<t?this._scheduleReflow():this._updateVisibleIndices({emit:!0})}}_updateVisibleIndices(i){if(this._first===-1||this._last===-1)return;let t=this._first;for(;t<this._last&&Math.round(this._getItemPosition(t)[this._positionDim]+this._getItemSize(t)[this._sizeDim])<=Math.round(this._scrollPosition);)t++;let s=this._last;for(;s>this._first&&Math.round(this._getItemPosition(s)[this._positionDim])>=Math.round(this._scrollPosition+this._viewDim1);)s--;(t!==this._firstVisible||s!==this._lastVisible)&&(this._firstVisible=t,this._lastVisible=s,i&&i.emit&&this._sendVisibilityChangedMessage())}}function m(o){return o==="horizontal"?"marginLeft":"marginTop"}function u(o){return o==="horizontal"?"marginRight":"marginBottom"}function S(o){return o==="horizontal"?"xOffset":"yOffset"}function z(o,i){const t=[o,i].sort();return t[1]<=0?Math.min(...t):t[0]>=0?Math.max(...t):t[0]+t[1]}class p{constructor(){this._childSizeCache=new g,this._marginSizeCache=new g,this._metricsCache=new Map}update(i,t){var h,n;const s=new Set;Object.keys(i).forEach(l=>{const e=Number(l);this._metricsCache.set(e,i[e]),this._childSizeCache.set(e,i[e][f(t)]),s.add(e),s.add(e+1)});for(const l of s){const e=((h=this._metricsCache.get(l))==null?void 0:h[m(t)])||0,r=((n=this._metricsCache.get(l-1))==null?void 0:n[u(t)])||0;this._marginSizeCache.set(l,z(e,r))}}get averageChildSize(){return this._childSizeCache.averageSize}get totalChildSize(){return this._childSizeCache.totalSize}get averageMarginSize(){return this._marginSizeCache.averageSize}get totalMarginSize(){return this._marginSizeCache.totalSize}getLeadingMarginValue(i,t){var s;return((s=this._metricsCache.get(i))==null?void 0:s[m(t)])||0}getChildSize(i){return this._childSizeCache.getSize(i)}getMarginSize(i){return this._marginSizeCache.getSize(i)}clear(){this._childSizeCache.clear(),this._marginSizeCache.clear(),this._metricsCache.clear()}}class M extends d{constructor(){super(...arguments),this._itemSize={width:100,height:100},this._physicalItems=new Map,this._newPhysicalItems=new Map,this._metricsCache=new p,this._anchorIdx=null,this._anchorPos=null,this._stable=!0,this._measureChildren=!0,this._estimate=!0}get measureChildren(){return this._measureChildren}updateItemSizes(i){this._metricsCache.update(i,this.direction),this._scheduleReflow()}_getPhysicalItem(i){return this._newPhysicalItems.get(i)??this._physicalItems.get(i)}_getSize(i){return this._getPhysicalItem(i)&&this._metricsCache.getChildSize(i)}_getAverageSize(){return this._metricsCache.averageChildSize||this._itemSize[this._sizeDim]}_estimatePosition(i){const t=this._metricsCache;if(this._first===-1||this._last===-1)return t.averageMarginSize+i*(t.averageMarginSize+this._getAverageSize());if(i<this._first){const s=this._first-i;return this._getPhysicalItem(this._first).pos-(t.getMarginSize(this._first-1)||t.averageMarginSize)-(s*t.averageChildSize+(s-1)*t.averageMarginSize)}else{const s=i-this._last;return this._getPhysicalItem(this._last).pos+(t.getChildSize(this._last)||t.averageChildSize)+(t.getMarginSize(this._last)||t.averageMarginSize)+s*(t.averageChildSize+t.averageMarginSize)}}_getPosition(i){const t=this._getPhysicalItem(i),{averageMarginSize:s}=this._metricsCache;return i===0?this._metricsCache.getMarginSize(0)??s:t?t.pos:this._estimatePosition(i)}_calculateAnchor(i,t){return i<=0?0:t>this._scrollSize-this._viewDim1?this.items.length-1:Math.max(0,Math.min(this.items.length-1,Math.floor((i+t)/2/this._delta)))}_getAnchor(i,t){if(this._physicalItems.size===0)return this._calculateAnchor(i,t);if(this._first<0)return this._calculateAnchor(i,t);if(this._last<0)return this._calculateAnchor(i,t);const s=this._getPhysicalItem(this._first),h=this._getPhysicalItem(this._last),n=s.pos;if(h.pos+this._metricsCache.getChildSize(this._last)<i)return this._calculateAnchor(i,t);if(n>t)return this._calculateAnchor(i,t);let r=this._firstVisible-1,a=-1/0;for(;a<i;)a=this._getPhysicalItem(++r).pos+this._metricsCache.getChildSize(r);return r}_getActiveItems(){this._viewDim1===0||this.items.length===0?this._clearItems():this._getItems()}_clearItems(){this._first=-1,this._last=-1,this._physicalMin=0,this._physicalMax=0;const i=this._newPhysicalItems;this._newPhysicalItems=this._physicalItems,this._newPhysicalItems.clear(),this._physicalItems=i,this._stable=!0}_getItems(){const i=this._newPhysicalItems;this._stable=!0;let t,s;if(this.pin!==null){const{index:a}=this.pin;this._anchorIdx=a,this._anchorPos=this._getPosition(a)}if(t=this._scrollPosition-this._overhang,s=this._scrollPosition+this._viewDim1+this._overhang,s<0||t>this._scrollSize){this._clearItems();return}(this._anchorIdx===null||this._anchorPos===null)&&(this._anchorIdx=this._getAnchor(t,s),this._anchorPos=this._getPosition(this._anchorIdx));let h=this._getSize(this._anchorIdx);h===void 0&&(this._stable=!1,h=this._getAverageSize());const n=this._metricsCache.getMarginSize(this._anchorIdx)??this._metricsCache.averageMarginSize,l=this._metricsCache.getMarginSize(this._anchorIdx+1)??this._metricsCache.averageMarginSize;this._anchorIdx===0&&(this._anchorPos=n),this._anchorIdx===this.items.length-1&&(this._anchorPos=this._scrollSize-l-h);let e=0;for(this._anchorPos+h+l<t&&(e=t-(this._anchorPos+h+l)),this._anchorPos-n>s&&(e=s-(this._anchorPos-n)),e&&(this._scrollPosition-=e,t-=e,s-=e,this._scrollError+=e),i.set(this._anchorIdx,{pos:this._anchorPos,size:h}),this._first=this._last=this._anchorIdx,this._physicalMin=this._anchorPos-n,this._physicalMax=this._anchorPos+h+l;this._physicalMin>t&&this._first>0;){let a=this._getSize(--this._first);a===void 0&&(this._stable=!1,a=this._getAverageSize());let _=this._metricsCache.getMarginSize(this._first);_===void 0&&(this._stable=!1,_=this._metricsCache.averageMarginSize),this._physicalMin-=a;const c=this._physicalMin;if(i.set(this._first,{pos:c,size:a}),this._physicalMin-=_,this._stable===!1&&this._estimate===!1)break}for(;this._physicalMax<s&&this._last<this.items.length-1;){let a=this._getSize(++this._last);a===void 0&&(this._stable=!1,a=this._getAverageSize());let _=this._metricsCache.getMarginSize(this._last);_===void 0&&(this._stable=!1,_=this._metricsCache.averageMarginSize);const c=this._physicalMax;if(i.set(this._last,{pos:c,size:a}),this._physicalMax+=a+_,!this._stable&&!this._estimate)break}const r=this._calculateError();r&&(this._physicalMin-=r,this._physicalMax-=r,this._anchorPos-=r,this._scrollPosition-=r,i.forEach(a=>a.pos-=r),this._scrollError+=r),this._stable&&(this._newPhysicalItems=this._physicalItems,this._newPhysicalItems.clear(),this._physicalItems=i)}_calculateError(){return this._first===0?this._physicalMin:this._physicalMin<=0?this._physicalMin-this._first*this._delta:this._last===this.items.length-1?this._physicalMax-this._scrollSize:this._physicalMax>=this._scrollSize?this._physicalMax-this._scrollSize+(this.items.length-1-this._last)*this._delta:0}_reflow(){const{_first:i,_last:t}=this;super._reflow(),(this._first===-1&&this._last==-1||this._first===i&&this._last===t)&&this._resetReflowState()}_resetReflowState(){this._anchorIdx=null,this._anchorPos=null,this._stable=!0}_updateScrollSize(){const{averageMarginSize:i}=this._metricsCache;this._scrollSize=Math.max(1,this.items.length*(i+this._getAverageSize())+i)}get _delta(){const{averageMarginSize:i}=this._metricsCache;return this._getAverageSize()+i}_getItemPosition(i){return{[this._positionDim]:this._getPosition(i),[this._secondaryPositionDim]:0,[S(this.direction)]:-(this._metricsCache.getLeadingMarginValue(i,this.direction)??this._metricsCache.averageMarginSize)}}_getItemSize(i){return{[this._sizeDim]:this._getSize(i)||this._getAverageSize(),[this._secondarySizeDim]:this._itemSize[this._secondarySizeDim]}}_viewDim2Changed(){this._metricsCache.clear(),this._scheduleReflow()}}exports.FlowLayout=M;
@@ -1,505 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright 2021 Google LLC
4
- * SPDX-License-Identifier: BSD-3-Clause
5
- */
6
- class g {
7
- constructor(i) {
8
- this._map = /* @__PURE__ */ new Map(), this._roundAverageSize = !1, this.totalSize = 0, (i == null ? void 0 : i.roundAverageSize) === !0 && (this._roundAverageSize = !0);
9
- }
10
- set(i, t) {
11
- const s = this._map.get(i) || 0;
12
- this._map.set(i, t), this.totalSize += t - s;
13
- }
14
- get averageSize() {
15
- if (this._map.size > 0) {
16
- const i = this.totalSize / this._map.size;
17
- return this._roundAverageSize ? Math.round(i) : i;
18
- }
19
- return 0;
20
- }
21
- getSize(i) {
22
- return this._map.get(i);
23
- }
24
- clear() {
25
- this._map.clear(), this.totalSize = 0;
26
- }
27
- }
28
- /**
29
- * @license
30
- * Copyright 2021 Google LLC
31
- * SPDX-License-Identifier: BSD-3-Clause
32
- */
33
- function f(o) {
34
- return o === "horizontal" ? "width" : "height";
35
- }
36
- class d {
37
- _getDefaultConfig() {
38
- return {
39
- direction: "vertical"
40
- };
41
- }
42
- constructor(i, t) {
43
- this._latestCoords = { left: 0, top: 0 }, this._direction = null, this._viewportSize = { width: 0, height: 0 }, this.totalScrollSize = { width: 0, height: 0 }, this.offsetWithinScroller = { left: 0, top: 0 }, this._pendingReflow = !1, this._pendingLayoutUpdate = !1, this._pin = null, this._firstVisible = 0, this._lastVisible = 0, this._physicalMin = 0, this._physicalMax = 0, this._first = -1, this._last = -1, this._sizeDim = "height", this._secondarySizeDim = "width", this._positionDim = "top", this._secondaryPositionDim = "left", this._scrollPosition = 0, this._scrollError = 0, this._items = [], this._scrollSize = 1, this._overhang = 1e3, this._hostSink = i, Promise.resolve().then(() => this.config = t || this._getDefaultConfig());
44
- }
45
- set config(i) {
46
- Object.assign(this, Object.assign({}, this._getDefaultConfig(), i));
47
- }
48
- get config() {
49
- return {
50
- direction: this.direction
51
- };
52
- }
53
- /**
54
- * Maximum index of children + 1, to help estimate total height of the scroll
55
- * space.
56
- */
57
- get items() {
58
- return this._items;
59
- }
60
- set items(i) {
61
- this._setItems(i);
62
- }
63
- _setItems(i) {
64
- i !== this._items && (this._items = i, this._scheduleReflow());
65
- }
66
- /**
67
- * Primary scrolling direction.
68
- */
69
- get direction() {
70
- return this._direction;
71
- }
72
- set direction(i) {
73
- i = i === "horizontal" ? i : "vertical", i !== this._direction && (this._direction = i, this._sizeDim = i === "horizontal" ? "width" : "height", this._secondarySizeDim = i === "horizontal" ? "height" : "width", this._positionDim = i === "horizontal" ? "left" : "top", this._secondaryPositionDim = i === "horizontal" ? "top" : "left", this._triggerReflow());
74
- }
75
- /**
76
- * Height and width of the viewport.
77
- */
78
- get viewportSize() {
79
- return this._viewportSize;
80
- }
81
- set viewportSize(i) {
82
- const { _viewDim1: t, _viewDim2: s } = this;
83
- Object.assign(this._viewportSize, i), s !== this._viewDim2 ? this._scheduleLayoutUpdate() : t !== this._viewDim1 && this._checkThresholds();
84
- }
85
- /**
86
- * Scroll offset of the viewport.
87
- */
88
- get viewportScroll() {
89
- return this._latestCoords;
90
- }
91
- set viewportScroll(i) {
92
- Object.assign(this._latestCoords, i);
93
- const t = this._scrollPosition;
94
- this._scrollPosition = this._latestCoords[this._positionDim], Math.abs(t - this._scrollPosition) >= 1 && this._checkThresholds();
95
- }
96
- /**
97
- * Perform a reflow if one has been scheduled.
98
- */
99
- reflowIfNeeded(i = !1) {
100
- (i || this._pendingReflow) && (this._pendingReflow = !1, this._reflow());
101
- }
102
- set pin(i) {
103
- this._pin = i, this._triggerReflow();
104
- }
105
- get pin() {
106
- if (this._pin !== null) {
107
- const { index: i, block: t } = this._pin;
108
- return {
109
- index: Math.max(0, Math.min(i, this.items.length - 1)),
110
- block: t
111
- };
112
- }
113
- return null;
114
- }
115
- _clampScrollPosition(i) {
116
- return Math.max(-this.offsetWithinScroller[this._positionDim], Math.min(i, this.totalScrollSize[f(this.direction)] - this._viewDim1));
117
- }
118
- unpin() {
119
- this._pin !== null && (this._sendUnpinnedMessage(), this._pin = null);
120
- }
121
- _updateLayout() {
122
- }
123
- // protected _viewDim2Changed(): void {
124
- // this._scheduleLayoutUpdate();
125
- // }
126
- /**
127
- * The height or width of the viewport, whichever corresponds to the scrolling direction.
128
- */
129
- get _viewDim1() {
130
- return this._viewportSize[this._sizeDim];
131
- }
132
- /**
133
- * The height or width of the viewport, whichever does NOT correspond to the scrolling direction.
134
- */
135
- get _viewDim2() {
136
- return this._viewportSize[this._secondarySizeDim];
137
- }
138
- _scheduleReflow() {
139
- this._pendingReflow = !0;
140
- }
141
- _scheduleLayoutUpdate() {
142
- this._pendingLayoutUpdate = !0, this._scheduleReflow();
143
- }
144
- // For triggering a reflow based on incoming changes to
145
- // the layout config.
146
- _triggerReflow() {
147
- this._scheduleLayoutUpdate(), Promise.resolve().then(() => this.reflowIfNeeded());
148
- }
149
- _reflow() {
150
- this._pendingLayoutUpdate && (this._updateLayout(), this._pendingLayoutUpdate = !1), this._updateScrollSize(), this._setPositionFromPin(), this._getActiveItems(), this._updateVisibleIndices(), this._sendStateChangedMessage();
151
- }
152
- /**
153
- * If we are supposed to be pinned to a particular
154
- * item or set of coordinates, we set `_scrollPosition`
155
- * accordingly and adjust `_scrollError` as needed
156
- * so that the virtualizer can keep the scroll
157
- * position in the DOM in sync
158
- */
159
- _setPositionFromPin() {
160
- if (this.pin !== null) {
161
- const i = this._scrollPosition, { index: t, block: s } = this.pin;
162
- this._scrollPosition = this._calculateScrollIntoViewPosition({
163
- index: t,
164
- block: s || "start"
165
- }) - this.offsetWithinScroller[this._positionDim], this._scrollError = i - this._scrollPosition;
166
- }
167
- }
168
- /**
169
- * Calculate the coordinates to scroll to, given
170
- * a request to scroll to the element at a specific
171
- * index.
172
- *
173
- * Supports the same positioning options (`start`,
174
- * `center`, `end`, `nearest`) as the standard
175
- * `Element.scrollIntoView()` method, but currently
176
- * only considers the provided value in the `block`
177
- * dimension, since we don't yet have any layouts
178
- * that support virtualization in two dimensions.
179
- */
180
- _calculateScrollIntoViewPosition(i) {
181
- const { block: t } = i, s = Math.min(this.items.length, Math.max(0, i.index)), h = this._getItemPosition(s)[this._positionDim];
182
- let n = h;
183
- if (t !== "start") {
184
- const l = this._getItemSize(s)[this._sizeDim];
185
- if (t === "center")
186
- n = h - 0.5 * this._viewDim1 + 0.5 * l;
187
- else {
188
- const e = h - this._viewDim1 + l;
189
- if (t === "end")
190
- n = e;
191
- else {
192
- const r = this._scrollPosition;
193
- n = Math.abs(r - h) < Math.abs(r - e) ? h : e;
194
- }
195
- }
196
- }
197
- return n += this.offsetWithinScroller[this._positionDim], this._clampScrollPosition(n);
198
- }
199
- getScrollIntoViewCoordinates(i) {
200
- return {
201
- [this._positionDim]: this._calculateScrollIntoViewPosition(i)
202
- };
203
- }
204
- _sendUnpinnedMessage() {
205
- this._hostSink({
206
- type: "unpinned"
207
- });
208
- }
209
- _sendVisibilityChangedMessage() {
210
- this._hostSink({
211
- type: "visibilityChanged",
212
- firstVisible: this._firstVisible,
213
- lastVisible: this._lastVisible
214
- });
215
- }
216
- _sendStateChangedMessage() {
217
- const i = /* @__PURE__ */ new Map();
218
- if (this._first !== -1 && this._last !== -1)
219
- for (let s = this._first; s <= this._last; s++)
220
- i.set(s, this._getItemPosition(s));
221
- const t = {
222
- type: "stateChanged",
223
- scrollSize: {
224
- [this._sizeDim]: this._scrollSize,
225
- [this._secondarySizeDim]: null
226
- },
227
- range: {
228
- first: this._first,
229
- last: this._last,
230
- firstVisible: this._firstVisible,
231
- lastVisible: this._lastVisible
232
- },
233
- childPositions: i
234
- };
235
- this._scrollError && (t.scrollError = {
236
- [this._positionDim]: this._scrollError,
237
- [this._secondaryPositionDim]: 0
238
- }, this._scrollError = 0), this._hostSink(t);
239
- }
240
- /**
241
- * Number of items to display.
242
- */
243
- get _num() {
244
- return this._first === -1 || this._last === -1 ? 0 : this._last - this._first + 1;
245
- }
246
- _checkThresholds() {
247
- if (this._viewDim1 === 0 && this._num > 0 || this._pin !== null)
248
- this._scheduleReflow();
249
- else {
250
- const i = Math.max(0, this._scrollPosition - this._overhang), t = Math.min(this._scrollSize, this._scrollPosition + this._viewDim1 + this._overhang);
251
- this._physicalMin > i || this._physicalMax < t ? this._scheduleReflow() : this._updateVisibleIndices({ emit: !0 });
252
- }
253
- }
254
- /**
255
- * Find the indices of the first and last items to intersect the viewport.
256
- * Emit a visibleindiceschange event when either index changes.
257
- */
258
- _updateVisibleIndices(i) {
259
- if (this._first === -1 || this._last === -1)
260
- return;
261
- let t = this._first;
262
- for (; t < this._last && Math.round(this._getItemPosition(t)[this._positionDim] + this._getItemSize(t)[this._sizeDim]) <= Math.round(this._scrollPosition); )
263
- t++;
264
- let s = this._last;
265
- for (; s > this._first && Math.round(this._getItemPosition(s)[this._positionDim]) >= Math.round(this._scrollPosition + this._viewDim1); )
266
- s--;
267
- (t !== this._firstVisible || s !== this._lastVisible) && (this._firstVisible = t, this._lastVisible = s, i && i.emit && this._sendVisibilityChangedMessage());
268
- }
269
- }
270
- function m(o) {
271
- return o === "horizontal" ? "marginLeft" : "marginTop";
272
- }
273
- function u(o) {
274
- return o === "horizontal" ? "marginRight" : "marginBottom";
275
- }
276
- function S(o) {
277
- return o === "horizontal" ? "xOffset" : "yOffset";
278
- }
279
- function z(o, i) {
280
- const t = [o, i].sort();
281
- return t[1] <= 0 ? Math.min(...t) : t[0] >= 0 ? Math.max(...t) : t[0] + t[1];
282
- }
283
- class p {
284
- constructor() {
285
- this._childSizeCache = new g(), this._marginSizeCache = new g(), this._metricsCache = /* @__PURE__ */ new Map();
286
- }
287
- update(i, t) {
288
- var h, n;
289
- const s = /* @__PURE__ */ new Set();
290
- Object.keys(i).forEach((l) => {
291
- const e = Number(l);
292
- this._metricsCache.set(e, i[e]), this._childSizeCache.set(e, i[e][f(t)]), s.add(e), s.add(e + 1);
293
- });
294
- for (const l of s) {
295
- const e = ((h = this._metricsCache.get(l)) == null ? void 0 : h[m(t)]) || 0, r = ((n = this._metricsCache.get(l - 1)) == null ? void 0 : n[u(t)]) || 0;
296
- this._marginSizeCache.set(l, z(e, r));
297
- }
298
- }
299
- get averageChildSize() {
300
- return this._childSizeCache.averageSize;
301
- }
302
- get totalChildSize() {
303
- return this._childSizeCache.totalSize;
304
- }
305
- get averageMarginSize() {
306
- return this._marginSizeCache.averageSize;
307
- }
308
- get totalMarginSize() {
309
- return this._marginSizeCache.totalSize;
310
- }
311
- getLeadingMarginValue(i, t) {
312
- var s;
313
- return ((s = this._metricsCache.get(i)) == null ? void 0 : s[m(t)]) || 0;
314
- }
315
- getChildSize(i) {
316
- return this._childSizeCache.getSize(i);
317
- }
318
- getMarginSize(i) {
319
- return this._marginSizeCache.getSize(i);
320
- }
321
- clear() {
322
- this._childSizeCache.clear(), this._marginSizeCache.clear(), this._metricsCache.clear();
323
- }
324
- }
325
- class M extends d {
326
- constructor() {
327
- super(...arguments), this._itemSize = { width: 100, height: 100 }, this._physicalItems = /* @__PURE__ */ new Map(), this._newPhysicalItems = /* @__PURE__ */ new Map(), this._metricsCache = new p(), this._anchorIdx = null, this._anchorPos = null, this._stable = !0, this._measureChildren = !0, this._estimate = !0;
328
- }
329
- // protected _defaultConfig: BaseLayoutConfig = Object.assign({}, super._defaultConfig, {
330
- // })
331
- // constructor(config: Layout1dConfig) {
332
- // super(config);
333
- // }
334
- get measureChildren() {
335
- return this._measureChildren;
336
- }
337
- /**
338
- * Determine the average size of all children represented in the sizes
339
- * argument.
340
- */
341
- updateItemSizes(i) {
342
- this._metricsCache.update(i, this.direction), this._scheduleReflow();
343
- }
344
- /**
345
- * Set the average item size based on the total length and number of children
346
- * in range.
347
- */
348
- // _updateItemSize() {
349
- // // Keep integer values.
350
- // this._itemSize[this._sizeDim] = this._metricsCache.averageChildSize;
351
- // }
352
- _getPhysicalItem(i) {
353
- return this._newPhysicalItems.get(i) ?? this._physicalItems.get(i);
354
- }
355
- _getSize(i) {
356
- return this._getPhysicalItem(i) && this._metricsCache.getChildSize(i);
357
- }
358
- _getAverageSize() {
359
- return this._metricsCache.averageChildSize || this._itemSize[this._sizeDim];
360
- }
361
- _estimatePosition(i) {
362
- const t = this._metricsCache;
363
- if (this._first === -1 || this._last === -1)
364
- return t.averageMarginSize + i * (t.averageMarginSize + this._getAverageSize());
365
- if (i < this._first) {
366
- const s = this._first - i;
367
- return this._getPhysicalItem(this._first).pos - (t.getMarginSize(this._first - 1) || t.averageMarginSize) - (s * t.averageChildSize + (s - 1) * t.averageMarginSize);
368
- } else {
369
- const s = i - this._last;
370
- return this._getPhysicalItem(this._last).pos + (t.getChildSize(this._last) || t.averageChildSize) + (t.getMarginSize(this._last) || t.averageMarginSize) + s * (t.averageChildSize + t.averageMarginSize);
371
- }
372
- }
373
- /**
374
- * Returns the position in the scrolling direction of the item at idx.
375
- * Estimates it if the item at idx is not in the DOM.
376
- */
377
- _getPosition(i) {
378
- const t = this._getPhysicalItem(i), { averageMarginSize: s } = this._metricsCache;
379
- return i === 0 ? this._metricsCache.getMarginSize(0) ?? s : t ? t.pos : this._estimatePosition(i);
380
- }
381
- _calculateAnchor(i, t) {
382
- return i <= 0 ? 0 : t > this._scrollSize - this._viewDim1 ? this.items.length - 1 : Math.max(0, Math.min(this.items.length - 1, Math.floor((i + t) / 2 / this._delta)));
383
- }
384
- _getAnchor(i, t) {
385
- if (this._physicalItems.size === 0)
386
- return this._calculateAnchor(i, t);
387
- if (this._first < 0)
388
- return this._calculateAnchor(i, t);
389
- if (this._last < 0)
390
- return this._calculateAnchor(i, t);
391
- const s = this._getPhysicalItem(this._first), h = this._getPhysicalItem(this._last), n = s.pos;
392
- if (h.pos + this._metricsCache.getChildSize(this._last) < i)
393
- return this._calculateAnchor(i, t);
394
- if (n > t)
395
- return this._calculateAnchor(i, t);
396
- let r = this._firstVisible - 1, a = -1 / 0;
397
- for (; a < i; )
398
- a = this._getPhysicalItem(++r).pos + this._metricsCache.getChildSize(r);
399
- return r;
400
- }
401
- /**
402
- * Updates _first and _last based on items that should be in the current
403
- * viewed range.
404
- */
405
- _getActiveItems() {
406
- this._viewDim1 === 0 || this.items.length === 0 ? this._clearItems() : this._getItems();
407
- }
408
- /**
409
- * Sets the range to empty.
410
- */
411
- _clearItems() {
412
- this._first = -1, this._last = -1, this._physicalMin = 0, this._physicalMax = 0;
413
- const i = this._newPhysicalItems;
414
- this._newPhysicalItems = this._physicalItems, this._newPhysicalItems.clear(), this._physicalItems = i, this._stable = !0;
415
- }
416
- /*
417
- * Updates _first and _last based on items that should be in the given range.
418
- */
419
- _getItems() {
420
- const i = this._newPhysicalItems;
421
- this._stable = !0;
422
- let t, s;
423
- if (this.pin !== null) {
424
- const { index: a } = this.pin;
425
- this._anchorIdx = a, this._anchorPos = this._getPosition(a);
426
- }
427
- if (t = this._scrollPosition - this._overhang, s = this._scrollPosition + this._viewDim1 + this._overhang, s < 0 || t > this._scrollSize) {
428
- this._clearItems();
429
- return;
430
- }
431
- (this._anchorIdx === null || this._anchorPos === null) && (this._anchorIdx = this._getAnchor(t, s), this._anchorPos = this._getPosition(this._anchorIdx));
432
- let h = this._getSize(this._anchorIdx);
433
- h === void 0 && (this._stable = !1, h = this._getAverageSize());
434
- const n = this._metricsCache.getMarginSize(this._anchorIdx) ?? this._metricsCache.averageMarginSize, l = this._metricsCache.getMarginSize(this._anchorIdx + 1) ?? this._metricsCache.averageMarginSize;
435
- this._anchorIdx === 0 && (this._anchorPos = n), this._anchorIdx === this.items.length - 1 && (this._anchorPos = this._scrollSize - l - h);
436
- let e = 0;
437
- for (this._anchorPos + h + l < t && (e = t - (this._anchorPos + h + l)), this._anchorPos - n > s && (e = s - (this._anchorPos - n)), e && (this._scrollPosition -= e, t -= e, s -= e, this._scrollError += e), i.set(this._anchorIdx, { pos: this._anchorPos, size: h }), this._first = this._last = this._anchorIdx, this._physicalMin = this._anchorPos - n, this._physicalMax = this._anchorPos + h + l; this._physicalMin > t && this._first > 0; ) {
438
- let a = this._getSize(--this._first);
439
- a === void 0 && (this._stable = !1, a = this._getAverageSize());
440
- let _ = this._metricsCache.getMarginSize(this._first);
441
- _ === void 0 && (this._stable = !1, _ = this._metricsCache.averageMarginSize), this._physicalMin -= a;
442
- const c = this._physicalMin;
443
- if (i.set(this._first, { pos: c, size: a }), this._physicalMin -= _, this._stable === !1 && this._estimate === !1)
444
- break;
445
- }
446
- for (; this._physicalMax < s && this._last < this.items.length - 1; ) {
447
- let a = this._getSize(++this._last);
448
- a === void 0 && (this._stable = !1, a = this._getAverageSize());
449
- let _ = this._metricsCache.getMarginSize(this._last);
450
- _ === void 0 && (this._stable = !1, _ = this._metricsCache.averageMarginSize);
451
- const c = this._physicalMax;
452
- if (i.set(this._last, { pos: c, size: a }), this._physicalMax += a + _, !this._stable && !this._estimate)
453
- break;
454
- }
455
- const r = this._calculateError();
456
- r && (this._physicalMin -= r, this._physicalMax -= r, this._anchorPos -= r, this._scrollPosition -= r, i.forEach((a) => a.pos -= r), this._scrollError += r), this._stable && (this._newPhysicalItems = this._physicalItems, this._newPhysicalItems.clear(), this._physicalItems = i);
457
- }
458
- _calculateError() {
459
- return this._first === 0 ? this._physicalMin : this._physicalMin <= 0 ? this._physicalMin - this._first * this._delta : this._last === this.items.length - 1 ? this._physicalMax - this._scrollSize : this._physicalMax >= this._scrollSize ? this._physicalMax - this._scrollSize + (this.items.length - 1 - this._last) * this._delta : 0;
460
- }
461
- _reflow() {
462
- const { _first: i, _last: t } = this;
463
- super._reflow(), (this._first === -1 && this._last == -1 || this._first === i && this._last === t) && this._resetReflowState();
464
- }
465
- _resetReflowState() {
466
- this._anchorIdx = null, this._anchorPos = null, this._stable = !0;
467
- }
468
- _updateScrollSize() {
469
- const { averageMarginSize: i } = this._metricsCache;
470
- this._scrollSize = Math.max(1, this.items.length * (i + this._getAverageSize()) + i);
471
- }
472
- /**
473
- * Returns the average size (precise or estimated) of an item in the scrolling direction,
474
- * including any surrounding space.
475
- */
476
- get _delta() {
477
- const { averageMarginSize: i } = this._metricsCache;
478
- return this._getAverageSize() + i;
479
- }
480
- /**
481
- * Returns the top and left positioning of the item at idx.
482
- */
483
- _getItemPosition(i) {
484
- return {
485
- [this._positionDim]: this._getPosition(i),
486
- [this._secondaryPositionDim]: 0,
487
- [S(this.direction)]: -(this._metricsCache.getLeadingMarginValue(i, this.direction) ?? this._metricsCache.averageMarginSize)
488
- };
489
- }
490
- /**
491
- * Returns the height and width of the item at idx.
492
- */
493
- _getItemSize(i) {
494
- return {
495
- [this._sizeDim]: this._getSize(i) || this._getAverageSize(),
496
- [this._secondarySizeDim]: this._itemSize[this._secondarySizeDim]
497
- };
498
- }
499
- _viewDim2Changed() {
500
- this._metricsCache.clear(), this._scheduleReflow();
501
- }
502
- }
503
- export {
504
- M as FlowLayout
505
- };
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const T=require("./index-c4e817ef.cjs");require("react");require("react-dom");var f={exports:{}};(function(V,A){(function(r,i){i()})(T.commonjsGlobal,function(){function r(n){var o=!0,u=!1,a=null,v={text:!0,search:!0,url:!0,tel:!0,email:!0,password:!0,number:!0,date:!0,month:!0,week:!0,time:!0,datetime:!0,"datetime-local":!0};function s(e){return!!(e&&e!==document&&e.nodeName!=="HTML"&&e.nodeName!=="BODY"&&"classList"in e&&"contains"in e.classList)}function b(e){var g=e.type,l=e.tagName;return!!(l==="INPUT"&&v[g]&&!e.readOnly||l==="TEXTAREA"&&!e.readOnly||e.isContentEditable)}function c(e){e.classList.contains("focus-visible")||(e.classList.add("focus-visible"),e.setAttribute("data-focus-visible-added",""))}function E(e){e.hasAttribute("data-focus-visible-added")&&(e.classList.remove("focus-visible"),e.removeAttribute("data-focus-visible-added"))}function L(e){e.metaKey||e.altKey||e.ctrlKey||(s(n.activeElement)&&c(n.activeElement),o=!0)}function d(e){o=!1}function y(e){s(e.target)&&(o||b(e.target))&&c(e.target)}function p(e){s(e.target)&&(e.target.classList.contains("focus-visible")||e.target.hasAttribute("data-focus-visible-added"))&&(u=!0,window.clearTimeout(a),a=window.setTimeout(function(){u=!1},100),E(e.target))}function w(e){document.visibilityState==="hidden"&&(u&&(o=!0),m())}function m(){document.addEventListener("mousemove",t),document.addEventListener("mousedown",t),document.addEventListener("mouseup",t),document.addEventListener("pointermove",t),document.addEventListener("pointerdown",t),document.addEventListener("pointerup",t),document.addEventListener("touchmove",t),document.addEventListener("touchstart",t),document.addEventListener("touchend",t)}function h(){document.removeEventListener("mousemove",t),document.removeEventListener("mousedown",t),document.removeEventListener("mouseup",t),document.removeEventListener("pointermove",t),document.removeEventListener("pointerdown",t),document.removeEventListener("pointerup",t),document.removeEventListener("touchmove",t),document.removeEventListener("touchstart",t),document.removeEventListener("touchend",t)}function t(e){e.target.nodeName&&e.target.nodeName.toLowerCase()==="html"||(o=!1,h())}document.addEventListener("keydown",L,!0),document.addEventListener("mousedown",d,!0),document.addEventListener("pointerdown",d,!0),document.addEventListener("touchstart",d,!0),document.addEventListener("visibilitychange",w,!0),m(),n.addEventListener("focus",y,!0),n.addEventListener("blur",p,!0),n.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&n.host?n.host.setAttribute("data-js-focus-visible",""):n.nodeType===Node.DOCUMENT_NODE&&(document.documentElement.classList.add("js-focus-visible"),document.documentElement.setAttribute("data-js-focus-visible",""))}if(typeof window<"u"&&typeof document<"u"){window.applyFocusVisiblePolyfill=r;var i;try{i=new CustomEvent("focus-visible-polyfill-ready")}catch{i=document.createEvent("CustomEvent"),i.initCustomEvent("focus-visible-polyfill-ready",!1,!1,{})}window.dispatchEvent(i)}typeof document<"u"&&r(document)})})();const N=f.exports,O=Object.freeze(Object.assign(Object.create(null),f.exports,{default:N}));exports.f=O;
@@ -1,84 +0,0 @@
1
- import { i as T } from "./index-1322d804.js";
2
- import "react";
3
- import "react-dom";
4
- var f = { exports: {} };
5
- (function(V, A) {
6
- (function(r, i) {
7
- i();
8
- })(T, function() {
9
- function r(n) {
10
- var o = !0, u = !1, a = null, v = {
11
- text: !0,
12
- search: !0,
13
- url: !0,
14
- tel: !0,
15
- email: !0,
16
- password: !0,
17
- number: !0,
18
- date: !0,
19
- month: !0,
20
- week: !0,
21
- time: !0,
22
- datetime: !0,
23
- "datetime-local": !0
24
- };
25
- function s(e) {
26
- return !!(e && e !== document && e.nodeName !== "HTML" && e.nodeName !== "BODY" && "classList" in e && "contains" in e.classList);
27
- }
28
- function E(e) {
29
- var g = e.type, l = e.tagName;
30
- return !!(l === "INPUT" && v[g] && !e.readOnly || l === "TEXTAREA" && !e.readOnly || e.isContentEditable);
31
- }
32
- function c(e) {
33
- e.classList.contains("focus-visible") || (e.classList.add("focus-visible"), e.setAttribute("data-focus-visible-added", ""));
34
- }
35
- function b(e) {
36
- e.hasAttribute("data-focus-visible-added") && (e.classList.remove("focus-visible"), e.removeAttribute("data-focus-visible-added"));
37
- }
38
- function L(e) {
39
- e.metaKey || e.altKey || e.ctrlKey || (s(n.activeElement) && c(n.activeElement), o = !0);
40
- }
41
- function d(e) {
42
- o = !1;
43
- }
44
- function y(e) {
45
- s(e.target) && (o || E(e.target)) && c(e.target);
46
- }
47
- function p(e) {
48
- s(e.target) && (e.target.classList.contains("focus-visible") || e.target.hasAttribute("data-focus-visible-added")) && (u = !0, window.clearTimeout(a), a = window.setTimeout(function() {
49
- u = !1;
50
- }, 100), b(e.target));
51
- }
52
- function w(e) {
53
- document.visibilityState === "hidden" && (u && (o = !0), m());
54
- }
55
- function m() {
56
- document.addEventListener("mousemove", t), document.addEventListener("mousedown", t), document.addEventListener("mouseup", t), document.addEventListener("pointermove", t), document.addEventListener("pointerdown", t), document.addEventListener("pointerup", t), document.addEventListener("touchmove", t), document.addEventListener("touchstart", t), document.addEventListener("touchend", t);
57
- }
58
- function h() {
59
- document.removeEventListener("mousemove", t), document.removeEventListener("mousedown", t), document.removeEventListener("mouseup", t), document.removeEventListener("pointermove", t), document.removeEventListener("pointerdown", t), document.removeEventListener("pointerup", t), document.removeEventListener("touchmove", t), document.removeEventListener("touchstart", t), document.removeEventListener("touchend", t);
60
- }
61
- function t(e) {
62
- e.target.nodeName && e.target.nodeName.toLowerCase() === "html" || (o = !1, h());
63
- }
64
- document.addEventListener("keydown", L, !0), document.addEventListener("mousedown", d, !0), document.addEventListener("pointerdown", d, !0), document.addEventListener("touchstart", d, !0), document.addEventListener("visibilitychange", w, !0), m(), n.addEventListener("focus", y, !0), n.addEventListener("blur", p, !0), n.nodeType === Node.DOCUMENT_FRAGMENT_NODE && n.host ? n.host.setAttribute("data-js-focus-visible", "") : n.nodeType === Node.DOCUMENT_NODE && (document.documentElement.classList.add("js-focus-visible"), document.documentElement.setAttribute("data-js-focus-visible", ""));
65
- }
66
- if (typeof window < "u" && typeof document < "u") {
67
- window.applyFocusVisiblePolyfill = r;
68
- var i;
69
- try {
70
- i = new CustomEvent("focus-visible-polyfill-ready");
71
- } catch {
72
- i = document.createEvent("CustomEvent"), i.initCustomEvent("focus-visible-polyfill-ready", !1, !1, {});
73
- }
74
- window.dispatchEvent(i);
75
- }
76
- typeof document < "u" && r(document);
77
- });
78
- })();
79
- const N = f.exports, M = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.assign(/* @__PURE__ */ Object.create(null), f.exports, {
80
- default: N
81
- }));
82
- export {
83
- M as f
84
- };