@difizen/libro-core 0.1.1 → 0.1.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.
Files changed (302) hide show
  1. package/es/add-cell/index.less +1 -1
  2. package/es/add-cell/libro-add-cell-slot-contribution.d.ts +1 -2
  3. package/es/add-cell/libro-add-cell-slot-contribution.d.ts.map +1 -1
  4. package/es/add-cell/libro-add-cell-slot-contribution.js +12 -6
  5. package/es/add-cell/libro-add-cell-view.d.ts +4 -4
  6. package/es/add-cell/libro-add-cell-view.d.ts.map +1 -1
  7. package/es/add-cell/libro-add-cell-view.js +4 -6
  8. package/es/cell/libro-cell-contribution.d.ts +1 -2
  9. package/es/cell/libro-cell-contribution.d.ts.map +1 -1
  10. package/es/cell/libro-cell-contribution.js +14 -8
  11. package/es/cell/libro-cell-model.d.ts +9 -0
  12. package/es/cell/libro-cell-model.d.ts.map +1 -1
  13. package/es/cell/libro-cell-model.js +53 -11
  14. package/es/cell/libro-cell-protocol.d.ts +2 -0
  15. package/es/cell/libro-cell-protocol.d.ts.map +1 -1
  16. package/es/cell/libro-cell-view.d.ts +6 -2
  17. package/es/cell/libro-cell-view.d.ts.map +1 -1
  18. package/es/cell/libro-cell-view.js +54 -24
  19. package/es/cell/libro-edit-cell-view.d.ts +6 -12
  20. package/es/cell/libro-edit-cell-view.d.ts.map +1 -1
  21. package/es/cell/libro-edit-cell-view.js +9 -4
  22. package/es/cell/libro-executable-cell-view.d.ts +2 -0
  23. package/es/cell/libro-executable-cell-view.d.ts.map +1 -1
  24. package/es/cell/libro-executable-cell-view.js +4 -1
  25. package/es/collapse-service.d.ts +1 -1
  26. package/es/collapse-service.d.ts.map +1 -1
  27. package/es/collapse-service.js +1 -1
  28. package/es/command/document-commands.d.ts +1 -2
  29. package/es/command/document-commands.d.ts.map +1 -1
  30. package/es/command/document-commands.js +3 -2
  31. package/es/command/kernel-command.d.ts.map +1 -1
  32. package/es/command/kernel-command.js +3 -0
  33. package/es/command/libro-command-contribution.d.ts +0 -1
  34. package/es/command/libro-command-contribution.d.ts.map +1 -1
  35. package/es/command/libro-command-contribution.js +179 -129
  36. package/es/command/libro-command-register.d.ts +0 -1
  37. package/es/command/libro-command-register.d.ts.map +1 -1
  38. package/es/command/libro-command-register.js +13 -7
  39. package/es/command/notebook-commands.d.ts.map +1 -1
  40. package/es/command/notebook-commands.js +17 -4
  41. package/es/components/cell-protocol.d.ts +5 -5
  42. package/es/components/cell-protocol.d.ts.map +1 -1
  43. package/es/components/dnd-cell-item-render.d.ts +6 -2
  44. package/es/components/dnd-cell-item-render.d.ts.map +1 -1
  45. package/es/components/dnd-cell-item-render.js +194 -89
  46. package/es/components/dnd-component/custom-drag-layer.d.ts +1 -1
  47. package/es/components/dnd-component/custom-drag-layer.d.ts.map +1 -1
  48. package/es/components/dnd-component/custom-drag-layer.js +3 -4
  49. package/es/components/dnd-component/default-dnd-content.d.ts +2 -1
  50. package/es/components/dnd-component/default-dnd-content.d.ts.map +1 -1
  51. package/es/components/dnd-component/default-dnd-content.js +100 -44
  52. package/es/components/dnd-component/dnd-context.js +1 -1
  53. package/es/components/dnd-component/dnd-list.d.ts +9 -5
  54. package/es/components/dnd-component/dnd-list.d.ts.map +1 -1
  55. package/es/components/dnd-component/dnd-list.js +93 -26
  56. package/es/components/dnd-component/index.d.ts +1 -1
  57. package/es/components/dnd-component/index.d.ts.map +1 -1
  58. package/es/components/dnd-component/index.js +2 -2
  59. package/es/components/dnd-component/index.less +8 -0
  60. package/es/components/dnd-component/overscanIndices-getter.d.ts +22 -0
  61. package/es/components/dnd-component/overscanIndices-getter.d.ts.map +1 -0
  62. package/es/components/dnd-component/overscanIndices-getter.js +58 -0
  63. package/es/components/dnd-component/virtualized-manager.d.ts +19 -0
  64. package/es/components/dnd-component/virtualized-manager.d.ts.map +1 -0
  65. package/es/components/dnd-component/virtualized-manager.js +60 -0
  66. package/es/components/index.d.ts +2 -2
  67. package/es/components/index.d.ts.map +1 -1
  68. package/es/components/index.js +2 -2
  69. package/es/components/libro-virtualized-render.d.ts +15 -0
  70. package/es/components/libro-virtualized-render.d.ts.map +1 -0
  71. package/es/components/libro-virtualized-render.js +174 -0
  72. package/es/content/index.d.ts +1 -0
  73. package/es/content/index.d.ts.map +1 -1
  74. package/es/content/index.js +2 -1
  75. package/es/content/libro-content-contribution.d.ts +2 -2
  76. package/es/content/libro-content-contribution.d.ts.map +1 -1
  77. package/es/content/libro-content-contribution.js +2 -3
  78. package/es/content/libro-content-module.d.ts.map +1 -1
  79. package/es/content/libro-content-module.js +3 -2
  80. package/es/content/libro-content-protocol.d.ts +5 -0
  81. package/es/content/libro-content-protocol.d.ts.map +1 -1
  82. package/es/content/libro-content-protocol.js +2 -1
  83. package/es/content/libro-content-service.d.ts +5 -3
  84. package/es/content/libro-content-service.d.ts.map +1 -1
  85. package/es/content/libro-content-service.js +36 -8
  86. package/es/content/libro-save-content-contribution.d.ts +6 -0
  87. package/es/content/libro-save-content-contribution.d.ts.map +1 -0
  88. package/es/content/libro-save-content-contribution.js +27 -0
  89. package/es/formatter/index.d.ts +6 -0
  90. package/es/formatter/index.d.ts.map +1 -0
  91. package/es/formatter/index.js +5 -0
  92. package/es/formatter/libro-formatter-json-contribution.d.ts +18 -0
  93. package/es/formatter/libro-formatter-json-contribution.d.ts.map +1 -0
  94. package/es/formatter/libro-formatter-json-contribution.js +41 -0
  95. package/es/formatter/libro-formatter-manager.d.ts +16 -0
  96. package/es/formatter/libro-formatter-manager.d.ts.map +1 -0
  97. package/es/formatter/libro-formatter-manager.js +86 -0
  98. package/es/formatter/libro-formatter-module.d.ts +3 -0
  99. package/es/formatter/libro-formatter-module.d.ts.map +1 -0
  100. package/es/formatter/libro-formatter-module.js +7 -0
  101. package/es/formatter/libro-formatter-protocol.d.ts +37 -0
  102. package/es/formatter/libro-formatter-protocol.d.ts.map +1 -0
  103. package/es/formatter/libro-formatter-protocol.js +18 -0
  104. package/es/formatter/libro-formatter-string-contribution.d.ts +18 -0
  105. package/es/formatter/libro-formatter-string-contribution.d.ts.map +1 -0
  106. package/es/formatter/libro-formatter-string-contribution.js +41 -0
  107. package/es/formatter/libro-formatter-trans-default-contribution.d.ts +7 -0
  108. package/es/formatter/libro-formatter-trans-default-contribution.d.ts.map +1 -0
  109. package/es/formatter/libro-formatter-trans-default-contribution.js +19 -0
  110. package/es/index.d.ts +5 -1
  111. package/es/index.d.ts.map +1 -1
  112. package/es/index.js +6 -2
  113. package/es/index.less +135 -58
  114. package/es/libro-context-key.d.ts.map +1 -1
  115. package/es/libro-model.d.ts +13 -2
  116. package/es/libro-model.d.ts.map +1 -1
  117. package/es/libro-model.js +149 -70
  118. package/es/libro-protocol.d.ts +44 -2
  119. package/es/libro-protocol.d.ts.map +1 -1
  120. package/es/libro-protocol.js +16 -3
  121. package/es/libro-service.d.ts +1 -1
  122. package/es/libro-service.d.ts.map +1 -1
  123. package/es/libro-service.js +29 -20
  124. package/es/{configuration/libro-configuration-contribution.d.ts → libro-setting-contribution.d.ts} +2 -2
  125. package/es/libro-setting-contribution.d.ts.map +1 -0
  126. package/es/{configuration/libro-configuration-contribution.js → libro-setting-contribution.js} +8 -9
  127. package/es/{configuration/libro-configuration.d.ts → libro-setting.d.ts} +3 -2
  128. package/es/libro-setting.d.ts.map +1 -0
  129. package/es/{configuration/libro-configuration.js → libro-setting.js} +17 -7
  130. package/es/libro-view.d.ts +21 -8
  131. package/es/libro-view.d.ts.map +1 -1
  132. package/es/libro-view.js +477 -338
  133. package/es/material-from-designer.d.ts +3 -0
  134. package/es/material-from-designer.d.ts.map +1 -1
  135. package/es/material-from-designer.js +112 -1
  136. package/es/module.d.ts.map +1 -1
  137. package/es/module.js +20 -5
  138. package/es/output/output-area.d.ts +3 -4
  139. package/es/output/output-area.d.ts.map +1 -1
  140. package/es/output/output-area.js +23 -16
  141. package/es/output/output-contribution.d.ts +0 -1
  142. package/es/output/output-contribution.d.ts.map +1 -1
  143. package/es/output/output-contribution.js +14 -9
  144. package/es/output/output-model.d.ts +2 -2
  145. package/es/output/output-model.d.ts.map +1 -1
  146. package/es/output/output-model.js +2 -2
  147. package/es/output/output-protocol.d.ts.map +1 -1
  148. package/es/output/output-protocol.js +0 -2
  149. package/es/settings/index.d.ts +5 -0
  150. package/es/settings/index.d.ts.map +1 -0
  151. package/es/settings/index.js +4 -0
  152. package/es/settings/index.less +3 -0
  153. package/es/settings/module.d.ts +3 -0
  154. package/es/settings/module.d.ts.map +1 -0
  155. package/es/settings/module.js +4 -0
  156. package/es/settings/setting-editor/configuration-panel-view.d.ts +13 -0
  157. package/es/settings/setting-editor/configuration-panel-view.d.ts.map +1 -0
  158. package/es/settings/setting-editor/configuration-panel-view.js +115 -0
  159. package/es/settings/setting-editor/configuration-render-contribution.d.ts +6 -0
  160. package/es/settings/setting-editor/configuration-render-contribution.d.ts.map +1 -0
  161. package/es/settings/setting-editor/configuration-render-contribution.js +77 -0
  162. package/es/settings/setting-editor/default-node-render.d.ts +9 -0
  163. package/es/settings/setting-editor/default-node-render.d.ts.map +1 -0
  164. package/es/settings/setting-editor/default-node-render.js +79 -0
  165. package/es/settings/setting-editor/index.d.ts +7 -0
  166. package/es/settings/setting-editor/index.d.ts.map +1 -0
  167. package/es/settings/setting-editor/index.js +6 -0
  168. package/es/settings/setting-editor/index.less +12 -0
  169. package/es/settings/setting-editor/module.d.ts +3 -0
  170. package/es/settings/setting-editor/module.d.ts.map +1 -0
  171. package/es/settings/setting-editor/module.js +7 -0
  172. package/es/settings/setting-editor/setting-editor-view.d.ts +15 -0
  173. package/es/settings/setting-editor/setting-editor-view.d.ts.map +1 -0
  174. package/es/settings/setting-editor/setting-editor-view.js +169 -0
  175. package/es/settings/setting-editor/setting-tree-service.d.ts +9 -0
  176. package/es/settings/setting-editor/setting-tree-service.d.ts.map +1 -0
  177. package/es/settings/setting-editor/setting-tree-service.js +118 -0
  178. package/es/settings/setting-editor/setting-tree-view.d.ts +19 -0
  179. package/es/settings/setting-editor/setting-tree-view.d.ts.map +1 -0
  180. package/es/settings/setting-editor/setting-tree-view.js +88 -0
  181. package/es/settings/settings-contribution.d.ts +7 -0
  182. package/es/settings/settings-contribution.d.ts.map +1 -0
  183. package/es/settings/settings-contribution.js +36 -0
  184. package/es/settings/settings-modal.d.ts +5 -0
  185. package/es/settings/settings-modal.d.ts.map +1 -0
  186. package/es/settings/settings-modal.js +53 -0
  187. package/es/settings/settings-modal.less +3 -0
  188. package/es/settings/settings-protocol.d.ts +4 -0
  189. package/es/settings/settings-protocol.d.ts.map +1 -0
  190. package/es/settings/settings-protocol.js +5 -0
  191. package/es/slot/libro-slot-manager.d.ts +2 -2
  192. package/es/slot/libro-slot-manager.d.ts.map +1 -1
  193. package/es/slot/libro-slot-manager.js +14 -8
  194. package/es/slot/libro-slot-view.d.ts +3 -3
  195. package/es/slot/libro-slot-view.d.ts.map +1 -1
  196. package/es/slot/libro-slot-view.js +2 -2
  197. package/es/theme/libro-color-registry.d.ts.map +1 -1
  198. package/es/theme/libro-color-registry.js +7 -0
  199. package/es/toolbar/all-outputs-scroll-icon.d.ts +3 -0
  200. package/es/toolbar/all-outputs-scroll-icon.d.ts.map +1 -0
  201. package/es/toolbar/all-outputs-scroll-icon.js +10 -0
  202. package/es/toolbar/libro-toolbar.d.ts +2 -1
  203. package/es/toolbar/libro-toolbar.d.ts.map +1 -1
  204. package/es/toolbar/libro-toolbar.js +44 -8
  205. package/es/toolbar/restart-clear-outputs-modal.d.ts +1 -2
  206. package/es/toolbar/restart-clear-outputs-modal.d.ts.map +1 -1
  207. package/es/toolbar/restart-clear-outputs-modal.js +2 -2
  208. package/es/toolbar/shutdown-modal.d.ts +1 -2
  209. package/es/toolbar/shutdown-modal.d.ts.map +1 -1
  210. package/es/toolbar/shutdown-modal.js +2 -2
  211. package/es/toolbar/side-toolar-more-select.d.ts.map +1 -1
  212. package/es/toolbar/side-toolar-more-select.js +2 -2
  213. package/es/virtualized-manager-helper.d.ts +11 -0
  214. package/es/virtualized-manager-helper.d.ts.map +1 -0
  215. package/es/virtualized-manager-helper.js +51 -0
  216. package/es/virtualized-manager.d.ts +19 -0
  217. package/es/virtualized-manager.d.ts.map +1 -0
  218. package/es/virtualized-manager.js +61 -0
  219. package/package.json +9 -6
  220. package/src/add-cell/index.less +1 -1
  221. package/src/add-cell/libro-add-cell-slot-contribution.ts +1 -4
  222. package/src/add-cell/libro-add-cell-view.tsx +13 -6
  223. package/src/cell/libro-cell-contribution.ts +2 -6
  224. package/src/cell/libro-cell-model.ts +57 -4
  225. package/src/cell/libro-cell-protocol.ts +2 -0
  226. package/src/cell/libro-cell-view.tsx +21 -9
  227. package/src/cell/libro-edit-cell-view.tsx +10 -9
  228. package/src/cell/libro-executable-cell-view.ts +6 -1
  229. package/src/collapse-service.ts +1 -1
  230. package/src/command/document-commands.ts +3 -5
  231. package/src/command/kernel-command.ts +3 -0
  232. package/src/command/libro-command-contribution.ts +107 -91
  233. package/src/command/libro-command-register.ts +1 -4
  234. package/src/command/notebook-commands.ts +16 -3
  235. package/src/components/cell-protocol.ts +5 -5
  236. package/src/components/dnd-cell-item-render.tsx +239 -92
  237. package/src/components/dnd-component/custom-drag-layer.tsx +5 -6
  238. package/src/components/dnd-component/default-dnd-content.tsx +113 -42
  239. package/src/components/dnd-component/dnd-context.tsx +1 -1
  240. package/src/components/dnd-component/dnd-list.tsx +135 -43
  241. package/src/components/dnd-component/index.less +8 -0
  242. package/src/components/dnd-component/index.tsx +1 -1
  243. package/src/components/dnd-component/overscanIndices-getter.ts +92 -0
  244. package/src/components/dnd-component/virtualized-manager.ts +34 -0
  245. package/src/components/index.ts +2 -2
  246. package/src/components/libro-virtualized-render.tsx +178 -0
  247. package/src/content/index.ts +1 -0
  248. package/src/content/libro-content-contribution.ts +2 -3
  249. package/src/content/libro-content-module.ts +11 -3
  250. package/src/content/libro-content-protocol.ts +6 -0
  251. package/src/content/libro-content-service.ts +26 -8
  252. package/src/content/libro-save-content-contribution.ts +12 -0
  253. package/src/formatter/index.ts +5 -0
  254. package/src/formatter/libro-formatter-json-contribution.ts +42 -0
  255. package/src/formatter/libro-formatter-manager.ts +85 -0
  256. package/src/formatter/libro-formatter-module.ts +19 -0
  257. package/src/formatter/libro-formatter-protocol.ts +63 -0
  258. package/src/formatter/libro-formatter-string-contribution.ts +41 -0
  259. package/src/formatter/libro-formatter-trans-default-contribution.ts +15 -0
  260. package/src/index.less +135 -58
  261. package/src/index.tsx +6 -1
  262. package/src/libro-context-key.ts +3 -3
  263. package/src/libro-model.ts +87 -23
  264. package/src/libro-protocol.ts +81 -4
  265. package/src/libro-service.ts +4 -13
  266. package/src/{configuration/libro-configuration-contribution.ts → libro-setting-contribution.ts} +7 -8
  267. package/src/{configuration/libro-configuration.ts → libro-setting.ts} +18 -7
  268. package/src/libro-view.tsx +273 -141
  269. package/src/material-from-designer.tsx +93 -1
  270. package/src/module.ts +29 -7
  271. package/src/output/output-area.tsx +18 -12
  272. package/src/output/output-contribution.ts +2 -6
  273. package/src/output/output-model.tsx +3 -3
  274. package/src/output/output-protocol.ts +0 -1
  275. package/src/settings/index.less +3 -0
  276. package/src/settings/index.ts +4 -0
  277. package/src/settings/module.ts +8 -0
  278. package/src/settings/setting-editor/configuration-panel-view.tsx +89 -0
  279. package/src/settings/setting-editor/configuration-render-contribution.ts +81 -0
  280. package/src/settings/setting-editor/default-node-render.tsx +65 -0
  281. package/src/settings/setting-editor/index.less +12 -0
  282. package/src/settings/setting-editor/index.ts +6 -0
  283. package/src/settings/setting-editor/module.ts +17 -0
  284. package/src/settings/setting-editor/setting-editor-view.tsx +93 -0
  285. package/src/settings/setting-editor/setting-tree-service.ts +82 -0
  286. package/src/settings/setting-editor/setting-tree-view.tsx +95 -0
  287. package/src/settings/settings-contribution.tsx +24 -0
  288. package/src/settings/settings-modal.less +3 -0
  289. package/src/settings/settings-modal.tsx +50 -0
  290. package/src/settings/settings-protocol.ts +7 -0
  291. package/src/slot/libro-slot-manager.ts +1 -3
  292. package/src/slot/libro-slot-view.tsx +2 -5
  293. package/src/theme/libro-color-registry.ts +6 -0
  294. package/src/toolbar/all-outputs-scroll-icon.tsx +19 -0
  295. package/src/toolbar/libro-toolbar.tsx +30 -5
  296. package/src/toolbar/restart-clear-outputs-modal.tsx +3 -3
  297. package/src/toolbar/shutdown-modal.tsx +3 -3
  298. package/src/toolbar/side-toolar-more-select.tsx +2 -1
  299. package/src/virtualized-manager-helper.ts +29 -0
  300. package/src/virtualized-manager.ts +34 -0
  301. package/es/configuration/libro-configuration-contribution.d.ts.map +0 -1
  302. package/es/configuration/libro-configuration.d.ts.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"default-dnd-content.d.ts","sourceRoot":"","sources":["../../../src/components/dnd-component/default-dnd-content.tsx"],"names":[],"mappings":"AAGA,OAAO,KAA+D,MAAM,OAAO,CAAC;AAQpF,OAAO,KAAK,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAIzE,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAE1D,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,QAAQ,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACf;AAED,eAAO,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAsPvD,CAAC;AAEF,eAAO,MAAM,uBAAuB,EAAE,mBAIrC,CAAC"}
1
+ {"version":3,"file":"default-dnd-content.d.ts","sourceRoot":"","sources":["../../../src/components/dnd-component/default-dnd-content.tsx"],"names":[],"mappings":"AAIA,OAAO,KAQN,MAAM,OAAO,CAAC;AAGf,OAAO,0BAA0B,CAAC;AAMlC,OAAO,KAAK,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAKzE,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAE1D,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,QAAQ,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACf;AAED,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAkTtD,CAAC;AAEF,eAAO,MAAM,uBAAuB,EAAE,mBAIrC,CAAC"}
@@ -1,30 +1,32 @@
1
- function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
1
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3
2
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4
3
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
5
4
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
6
5
  function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
6
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
7
7
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
8
8
  function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
9
9
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
10
10
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
11
11
  function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
12
12
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
13
- import { useConfigurationValue } from '@difizen/mana-app';
13
+ /* eslint-disable react-hooks/exhaustive-deps */
14
14
  import { getOrigin, useInject, ViewInstance } from '@difizen/mana-app';
15
- import React, { useEffect, useRef, useState, useCallback, forwardRef } from 'react';
15
+ import { useConfigurationValue } from '@difizen/mana-app';
16
+ import React, { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState, forwardRef } from 'react';
16
17
  import { useDrag, useDragDropManager, useDrop } from 'react-dnd';
17
18
  import { getEmptyImage } from 'react-dnd-html5-backend';
18
- import { CellService } from "../../cell/index.js";
19
+ import 'resize-observer-polyfill';
20
+ import { LibroCellService } from "../../cell/index.js";
19
21
  import { CellCollapsible } from "../../collapse-service.js";
20
- import { MultiSelectionWhenShiftClick } from "../../configuration/libro-configuration.js";
21
- import { isCellView, DragAreaKey } from "../../libro-protocol.js";
22
+ import { DragAreaKey, isCellView } from "../../libro-protocol.js";
23
+ import { MultiSelectionWhenShiftClick } from "../../libro-setting.js";
22
24
  import { HolderOutlined, PlusOutlined } from "../../material-from-designer.js";
23
- import { hasErrorOutput } from "../../output/index.js";
25
+ import { VirtualizedManagerHelper } from "../../virtualized-manager-helper.js";
24
26
  import { BetweenCellProvider } from "../cell-protocol.js";
25
27
  import { jsx as _jsx } from "react/jsx-runtime";
26
28
  import { jsxs as _jsxs } from "react/jsx-runtime";
27
- export var DefaultDndContent = function DefaultDndContent(_ref) {
29
+ export var DndCellContainer = function DndCellContainer(_ref) {
28
30
  var _instance$container;
29
31
  var cell = _ref.cell,
30
32
  index = _ref.index;
@@ -34,10 +36,39 @@ export var DefaultDndContent = function DefaultDndContent(_ref) {
34
36
  _useConfigurationValu2 = _slicedToArray(_useConfigurationValu, 1),
35
37
  multiSelectionWhenShiftClick = _useConfigurationValu2[0];
36
38
  var BetweenCellContent = useInject(BetweenCellProvider);
37
- var cellService = useInject(CellService);
39
+ var cellService = useInject(LibroCellService);
40
+ var virtualizedManagerHelper = useInject(VirtualizedManagerHelper);
41
+ var virtualizedManager = virtualizedManagerHelper.getOrCreate(cell.parent.model);
38
42
  var dragDropManager = useDragDropManager();
39
43
  var dragDropMonitor = dragDropManager.getMonitor();
40
44
  var ItemRender = getOrigin(instance.dndItemRender);
45
+ useLayoutEffect(function () {
46
+ if (_typeof(ref) !== 'object') {
47
+ return function () {
48
+ //
49
+ };
50
+ }
51
+ var el = ref === null || ref === void 0 ? void 0 : ref.current;
52
+ if (!el) {
53
+ return function () {
54
+ //
55
+ };
56
+ }
57
+ var resizeObserver = new ResizeObserver(function (entries) {
58
+ entries.forEach(function (entry) {
59
+ var isVisible = entry.contentRect.width !== 0 && entry.contentRect.height !== 0;
60
+ if (isVisible) {
61
+ var _ref$current;
62
+ cell.noEditorAreaHeight = ((_ref$current = ref.current) === null || _ref$current === void 0 ? void 0 : _ref$current.clientHeight) || 0;
63
+ }
64
+ });
65
+ });
66
+ resizeObserver.observe(el);
67
+ return function () {
68
+ cell.noEditorAreaHeight = 0;
69
+ resizeObserver.disconnect();
70
+ };
71
+ }, [ref, cell]);
41
72
  var handleFocus = useCallback(function (e) {
42
73
  var className = e.target.className;
43
74
  if (e.target.tagName === 'svg' || className && className && typeof className === 'string' && (className.includes('mana-toolbar-item') || className.includes('mana-toolbar'))) {
@@ -65,6 +96,8 @@ export var DefaultDndContent = function DefaultDndContent(_ref) {
65
96
  instance.model.selectCell(cell);
66
97
  instance.model.selections = [];
67
98
  }, [instance, cell]);
99
+ var scrollTimer = useRef(null);
100
+ var unsubscribe = useRef(null);
68
101
  var _useDrag = useDrag({
69
102
  type: DragAreaKey,
70
103
  item: {
@@ -78,41 +111,45 @@ export var DefaultDndContent = function DefaultDndContent(_ref) {
78
111
  },
79
112
  end: function end() {
80
113
  instance.isDragging = false;
114
+ if (scrollTimer.current) {
115
+ clearInterval(scrollTimer.current);
116
+ }
81
117
  }
82
118
  }, [cell, index]),
83
119
  _useDrag2 = _slicedToArray(_useDrag, 3),
84
120
  isDrag = _useDrag2[0].isDrag,
85
121
  drag = _useDrag2[1],
86
122
  preview = _useDrag2[2];
87
- dragDropMonitor.subscribeToStateChange(function () {
88
- instance.isDragging = dragDropMonitor.isDragging();
89
- });
90
123
  var libroViewContent = (_instance$container = instance.container) === null || _instance$container === void 0 || (_instance$container = _instance$container.current) === null || _instance$container === void 0 ? void 0 : _instance$container.getElementsByClassName('libro-view-content')[0];
91
- var scrollTimer = useRef(null);
92
124
  useEffect(function () {
93
- scrollTimer.current = setInterval(function () {
94
- var currentOffset = dragDropMonitor.getClientOffset();
95
- if (libroViewContent && instance.isDragging && currentOffset) {
96
- var libroViewClientRect = libroViewContent.getBoundingClientRect();
97
- var top = libroViewClientRect.top,
98
- bottom = libroViewClientRect.bottom;
99
- var y = currentOffset.y;
100
- var topLimit = top + 30;
101
- var bottomLimit = bottom - 50;
102
- if (y < topLimit) {
103
- libroViewContent.scrollTop -= 0.5;
104
- } else if (y > bottomLimit) {
105
- libroViewContent.scrollTop += 0.5;
125
+ unsubscribe.current = dragDropMonitor.subscribeToStateChange(function () {
126
+ instance.isDragging = dragDropMonitor.isDragging();
127
+ scrollTimer.current = setInterval(function () {
128
+ var currentOffset = dragDropMonitor.getClientOffset();
129
+ if (libroViewContent && instance.isDragging && currentOffset) {
130
+ var libroViewClientRect = libroViewContent.getBoundingClientRect();
131
+ var top = libroViewClientRect.top,
132
+ bottom = libroViewClientRect.bottom;
133
+ var y = currentOffset.y;
134
+ var topLimit = top + 30;
135
+ var bottomLimit = bottom - 50;
136
+ if (y < topLimit) {
137
+ libroViewContent.scrollTop -= 0.5;
138
+ } else if (y > bottomLimit) {
139
+ libroViewContent.scrollTop += 0.5;
140
+ }
106
141
  }
107
- }
108
- }, 10);
109
- return function () {
110
- if (scrollTimer.current) {
111
- clearInterval(scrollTimer.current);
112
- }
113
- };
114
- // eslint-disable-next-line react-hooks/exhaustive-deps
115
- }, []);
142
+ }, 10);
143
+ return function () {
144
+ if (scrollTimer.current) {
145
+ clearInterval(scrollTimer.current);
146
+ }
147
+ if (unsubscribe.current) {
148
+ unsubscribe.current();
149
+ }
150
+ };
151
+ });
152
+ }, [dragDropMonitor]);
116
153
  useEffect(function () {
117
154
  // This gets called after every render, by default
118
155
  // (the first one, and every one after that)
@@ -134,7 +171,7 @@ export var DefaultDndContent = function DefaultDndContent(_ref) {
134
171
  }), item.cell.parent.id).then(function (view) {
135
172
  view.dispose();
136
173
  return;
137
- }).catch(function () {
174
+ }).catch(function (e) {
138
175
  //
139
176
  });
140
177
  if (isCellView(item.cell)) {
@@ -156,17 +193,35 @@ export var DefaultDndContent = function DefaultDndContent(_ref) {
156
193
  }
157
194
  if (isDragInSelections) {
158
195
  instance.model.exchangeCells(instance.model.selections, dropIndex);
159
- instance.model.scrollToView(cell);
196
+ if (virtualizedManager.isVirtualized) {
197
+ instance.model.scrollToCellView({
198
+ cellIndex: dropIndex
199
+ });
200
+ } else {
201
+ instance.model.scrollToView(cell);
202
+ }
160
203
  return;
161
204
  }
162
205
  }
163
206
  if (dragIndex < dropIndex) {
164
207
  instance.model.exchangeCell(dragIndex, dropIndex - 1);
165
- instance.model.scrollToView(cell);
208
+ if (virtualizedManager.isVirtualized) {
209
+ instance.model.scrollToCellView({
210
+ cellIndex: dropIndex
211
+ });
212
+ } else {
213
+ instance.model.scrollToView(cell);
214
+ }
166
215
  }
167
216
  if (dragIndex > dropIndex) {
168
217
  instance.model.exchangeCell(dragIndex, dropIndex);
169
- instance.model.scrollToView(cell);
218
+ if (virtualizedManager.isVirtualized) {
219
+ instance.model.scrollToCellView({
220
+ cellIndex: dropIndex
221
+ });
222
+ } else {
223
+ instance.model.scrollToView(cell);
224
+ }
170
225
  }
171
226
  }
172
227
  return;
@@ -191,17 +246,18 @@ export var DefaultDndContent = function DefaultDndContent(_ref) {
191
246
  if (isDrag) {
192
247
  instance.model.mouseMode = 'drag';
193
248
  }
194
- var isSelected = instance.isSelected(cell);
249
+ var isMultiSelected = instance.model.selections.length !== 0 && instance.isSelected(cell);
195
250
  // let isMouseOver = false;
196
251
  var _useState = useState(false),
197
252
  _useState2 = _slicedToArray(_useState, 2),
198
253
  isMouseOverDragArea = _useState2[0],
199
254
  setIsMouseOverDragArea = _useState2[1];
200
- var hasCellHidden = cell.hasCellHidden();
201
- var hasErrorOutputs = hasErrorOutput(cell);
255
+ var hasCellHidden = useMemo(function () {
256
+ return cell.hasCellHidden();
257
+ }, [cell]);
202
258
  var isCollapsible = CellCollapsible.is(cell);
203
259
  return /*#__PURE__*/_jsxs("div", {
204
- className: "libro-dnd-cell-container ".concat(isSelected ? 'selected' : '', " ").concat(hasCellHidden ? 'hidden' : ''),
260
+ className: "libro-dnd-cell-container ".concat(isMultiSelected ? 'multi-selected' : '', " ").concat(hasCellHidden ? 'hidden' : ''),
205
261
  "data-handler-id": handlerId,
206
262
  style: {
207
263
  opacity: opacity
@@ -231,7 +287,7 @@ export var DefaultDndContent = function DefaultDndContent(_ref) {
231
287
  onFocus: handleFocus
232
288
  // onClick={e => e.preventDefault()}
233
289
  ,
234
- className: "libro-dnd-cell-content ".concat(hasErrorOutputs ? 'error' : ''),
290
+ className: "libro-dnd-cell-content",
235
291
  children: /*#__PURE__*/_jsx(ItemRender, {
236
292
  isDragOver: !!isDragOver,
237
293
  isDrag: !!isDrag,
@@ -1,5 +1,5 @@
1
- import { ViewInstance } from '@difizen/mana-app';
2
1
  import { getOrigin, useInject } from '@difizen/mana-app';
2
+ import { ViewInstance } from '@difizen/mana-app';
3
3
  import { DndProvider } from 'react-dnd';
4
4
  import { HTML5Backend } from 'react-dnd-html5-backend';
5
5
  import { jsx as _jsx } from "react/jsx-runtime";
@@ -1,10 +1,14 @@
1
- /// <reference types="react" resolution-mode="require"/>
1
+ import type { FC, ReactNode } from 'react';
2
+ import type { DndContentProps } from '../../libro-protocol.js';
2
3
  import type { LibroView } from '../../libro-view.js';
3
- export declare const DndCellContent: import("react").ForwardRefExoticComponent<{
4
+ import './index.less';
5
+ export declare const DndCellRender: FC<DndContentProps>;
6
+ export declare const DndCellsRender: import("react").ForwardRefExoticComponent<{
4
7
  libroView: LibroView;
8
+ addCellButtons: ReactNode;
5
9
  } & import("react").RefAttributes<HTMLDivElement>>;
6
- export declare function DndList({ libroView, children, }: {
10
+ export declare const DndList: import("react").ForwardRefExoticComponent<{
7
11
  libroView: LibroView;
8
- children: any;
9
- }): import("react/jsx-runtime").JSX.Element;
12
+ children: ReactNode;
13
+ } & import("react").RefAttributes<HTMLDivElement>>;
10
14
  //# sourceMappingURL=dnd-list.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"dnd-list.d.ts","sourceRoot":"","sources":["../../../src/components/dnd-component/dnd-list.tsx"],"names":[],"mappings":";AAUA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAcrD,eAAO,MAAM,cAAc;eAA2C,SAAS;kDAqB9E,CAAC;AAEF,wBAAgB,OAAO,CAAC,EACtB,SAAS,EACT,QAAQ,GACT,EAAE;IACD,SAAS,EAAE,SAAS,CAAC;IACrB,QAAQ,EAAE,GAAG,CAAC;CACf,2CAiEA"}
1
+ {"version":3,"file":"dnd-list.d.ts","sourceRoot":"","sources":["../../../src/components/dnd-component/dnd-list.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAO3C,OAAO,KAAK,EAAY,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAEzE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAKrD,OAAO,cAAc,CAAC;AAEtB,eAAO,MAAM,aAAa,EAAE,EAAE,CAAC,eAAe,CAY5C,CAAC;AAaH,eAAO,MAAM,cAAc;eAEZ,SAAS;oBAAkB,SAAS;kDAsFjD,CAAC;AAEH,eAAO,MAAM,OAAO;eAEL,SAAS;cAAY,SAAS;kDA2E3C,CAAC"}
@@ -14,48 +14,113 @@ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input ==
14
14
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
15
15
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
16
16
  import { getOrigin, useInject, useObserve, ViewInstance } from '@difizen/mana-app';
17
- import { forwardRef, memo } from 'react';
17
+ import classNames from 'classnames';
18
+ import { forwardRef, memo, useEffect, useState } from 'react';
18
19
  import { useDrop } from 'react-dnd';
19
20
  import { LibroCellService } from "../../cell/index.js";
20
21
  import { DragAreaKey, isCellView } from "../../libro-protocol.js";
22
+ import { VirtualizedManagerHelper } from "../../virtualized-manager-helper.js";
23
+ import { LibroCellsOutputRender } from "../libro-virtualized-render.js";
24
+ import "./index.less";
21
25
  import { jsx as _jsx } from "react/jsx-runtime";
26
+ import { Fragment as _Fragment } from "react/jsx-runtime";
22
27
  import { jsxs as _jsxs } from "react/jsx-runtime";
23
- var DndContent = function DndContent(_ref) {
28
+ export var DndCellRender = /*#__PURE__*/memo(function DndCellRender(_ref) {
24
29
  var cell = _ref.cell,
25
30
  index = _ref.index,
26
31
  props = _objectWithoutProperties(_ref, _excluded);
27
32
  var observableCell = useObserve(cell);
28
33
  var instance = useInject(ViewInstance);
29
- var DndContentRender = instance.dndContentRender;
30
- return /*#__PURE__*/_jsx(DndContentRender, _objectSpread({
34
+ var DndCellContainer = instance.dndContentRender;
35
+ return /*#__PURE__*/_jsx(DndCellContainer, _objectSpread({
31
36
  cell: observableCell,
32
37
  index: index
33
38
  }, props), cell.id);
39
+ });
40
+
41
+ // 定义一个函数用于渲染非虚拟列表时的单元格
42
+ var renderNonVirtualListCells = function renderNonVirtualListCells(cells) {
43
+ return /*#__PURE__*/_jsx("div", {
44
+ style: {
45
+ height: '100%',
46
+ overflow: 'visible'
47
+ },
48
+ children: cells.filter(function (cell) {
49
+ return !cell.collapsedHidden;
50
+ }).map(function (cell, index) {
51
+ return /*#__PURE__*/_jsx(DndCellRender, {
52
+ cell: cell,
53
+ index: index
54
+ }, cell.id);
55
+ })
56
+ });
34
57
  };
35
- var DndContentMemo = /*#__PURE__*/memo(DndContent);
36
- export var DndCellContent = /*#__PURE__*/forwardRef(function DndCellContent(_ref2, ref) {
37
- var libroView = _ref2.libroView;
58
+ export var DndCellsRender = /*#__PURE__*/forwardRef(function DndCellsRender(_ref2, ref) {
59
+ var libroView = _ref2.libroView,
60
+ addCellButtons = _ref2.addCellButtons;
38
61
  var LoadingRender = getOrigin(libroView.loadingRender);
62
+ var virtualizedManagerHelper = useInject(VirtualizedManagerHelper);
63
+ var virtualizedManager = virtualizedManagerHelper.getOrCreate(libroView.model);
39
64
  var cells = libroView.model.getCells().reduce(function (a, b) {
40
65
  if (a.indexOf(b) < 0) {
41
66
  a.push(b);
42
67
  }
43
68
  return a;
44
69
  }, []);
45
- return /*#__PURE__*/_jsxs("div", {
46
- className: "libro-dnd-cells-container",
47
- ref: ref,
48
- children: [!libroView.model.isInitialized && /*#__PURE__*/_jsx(LoadingRender, {}), libroView.model.isInitialized && cells.filter(function (cell) {
49
- return cell.collapsedHidden === false;
50
- }).map(function (cell, index) {
51
- return /*#__PURE__*/_jsx(DndContentMemo, {
52
- cell: cell,
53
- index: index
54
- }, cell.id);
55
- })]
70
+ var _useState = useState(false),
71
+ _useState2 = _slicedToArray(_useState, 2),
72
+ isVirtualList = _useState2[0],
73
+ setIsVirtualList = _useState2[1];
74
+ var _useState3 = useState(true),
75
+ _useState4 = _slicedToArray(_useState3, 2),
76
+ isJudging = _useState4[0],
77
+ setIsJudging = _useState4[1];
78
+ useEffect(function () {
79
+ if (!libroView.model.isInitialized) {
80
+ return;
81
+ }
82
+ var size = undefined;
83
+ var path = undefined;
84
+
85
+ // TODO: 类型处理
86
+ var model = libroView.model;
87
+ if (model.currentFileContents && model.currentFileContents.size) {
88
+ size = parseFloat((model.currentFileContents.size / 1048576).toFixed(3)); // 单位MB
89
+ path = model.currentFileContents.path || '';
90
+ }
91
+ setIsJudging(true);
92
+ virtualizedManager.openVirtualized(cells.length, size, path).then(function (willOpen) {
93
+ setIsVirtualList(willOpen);
94
+ return;
95
+ }).catch(function () {
96
+ setIsVirtualList(false);
97
+ }).finally(function () {
98
+ setIsJudging(false);
99
+ }).catch(function (e) {
100
+ //
101
+ });
102
+ // eslint-disable-next-line react-hooks/exhaustive-deps
103
+ }, [virtualizedManager, libroView.model.isInitialized]);
104
+ var isInitialized = libroView.model.isInitialized;
105
+ var isLoading = !isInitialized || isJudging;
106
+ var shouldRenderCells = isInitialized && !isJudging;
107
+ return /*#__PURE__*/_jsxs(_Fragment, {
108
+ children: [/*#__PURE__*/_jsxs("div", {
109
+ className: classNames('libro-dnd-cells-container', isVirtualList && 'virtual_list_container'),
110
+ ref: ref,
111
+ children: [isLoading && /*#__PURE__*/_jsx(LoadingRender, {}), /*#__PURE__*/_jsx(_Fragment, {
112
+ children: shouldRenderCells && /*#__PURE__*/_jsx(_Fragment, {
113
+ children: isVirtualList ? /*#__PURE__*/_jsx(LibroCellsOutputRender, {
114
+ cells: cells,
115
+ libroView: libroView,
116
+ addCellButtons: addCellButtons
117
+ }) : renderNonVirtualListCells(cells)
118
+ })
119
+ })]
120
+ }), shouldRenderCells && !isVirtualList && addCellButtons]
56
121
  });
57
122
  });
58
- export function DndList(_ref3) {
123
+ export var DndList = /*#__PURE__*/forwardRef(function DndList(_ref3, ref) {
59
124
  var libroView = _ref3.libroView,
60
125
  children = _ref3.children;
61
126
  var cellService = useInject(LibroCellService);
@@ -67,8 +132,9 @@ export function DndList(_ref3) {
67
132
  modelId: item.cell.model.id,
68
133
  singleSelectionDragPreview: true
69
134
  }), item.cell.parent.id).then(function (view) {
70
- return view.dispose();
71
- }).catch(function () {
135
+ view.dispose();
136
+ return;
137
+ }).catch(function (e) {
72
138
  //
73
139
  });
74
140
  if (isCellView(item.cell)) {
@@ -105,11 +171,12 @@ export function DndList(_ref3) {
105
171
  }),
106
172
  _useDrop2 = _slicedToArray(_useDrop, 2),
107
173
  drop = _useDrop2[1];
108
- return /*#__PURE__*/_jsxs("div", {
174
+ return /*#__PURE__*/_jsx("div", {
109
175
  className: "libro-dnd-list-container",
110
176
  ref: drop,
111
- children: [/*#__PURE__*/_jsx(DndCellContent, {
112
- libroView: libroView
113
- }), children]
177
+ children: /*#__PURE__*/_jsx(DndCellsRender, {
178
+ libroView: libroView,
179
+ addCellButtons: children
180
+ })
114
181
  });
115
- }
182
+ });
@@ -1,5 +1,5 @@
1
+ export * from './custom-drag-layer.js';
1
2
  export * from './default-dnd-content.js';
2
3
  export * from './dnd-context.js';
3
4
  export * from './dnd-list.js';
4
- export * from './custom-drag-layer.js';
5
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/dnd-component/index.tsx"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC;AACzC,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,wBAAwB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/dnd-component/index.tsx"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,0BAA0B,CAAC;AACzC,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC"}
@@ -1,4 +1,4 @@
1
+ export * from "./custom-drag-layer.js";
1
2
  export * from "./default-dnd-content.js";
2
3
  export * from "./dnd-context.js";
3
- export * from "./dnd-list.js";
4
- export * from "./custom-drag-layer.js";
4
+ export * from "./dnd-list.js";
@@ -0,0 +1,8 @@
1
+ .virtual_list_container {
2
+ height: 100%;
3
+ width: 100%;
4
+
5
+ // .ReactVirtualized__Grid__innerScrollContainer {
6
+ // overflow: auto !important;
7
+ // }
8
+ }
@@ -0,0 +1,22 @@
1
+ export type OverscanIndicesGetterParams = {
2
+ direction: 'horizontal' | 'vertical';
3
+ scrollDirection: -1 | 1;
4
+ cellCount: number;
5
+ overscanCellsCount: number;
6
+ startIndex: number;
7
+ stopIndex: number;
8
+ };
9
+ export type OverscanIndices = {
10
+ overscanStartIndex: number;
11
+ overscanStopIndex: number;
12
+ };
13
+ export declare const SCROLL_DIRECTION_BACKWARD = -1;
14
+ export declare const SCROLL_DIRECTION_FORWARD = 1;
15
+ export declare const SCROLL_DIRECTION_HORIZONTAL = "horizontal";
16
+ export declare const SCROLL_DIRECTION_VERTICAL = "vertical";
17
+ /**
18
+ * Calculates the number of cells to overscan before and after a specified range.
19
+ * This function ensures that overscanning doesn't exceed the available cells.
20
+ */
21
+ export default function libroOverscanIndicesGetter({ cellCount, overscanCellsCount, scrollDirection, startIndex, stopIndex, }: OverscanIndicesGetterParams): OverscanIndices;
22
+ //# sourceMappingURL=overscanIndices-getter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"overscanIndices-getter.d.ts","sourceRoot":"","sources":["../../../src/components/dnd-component/overscanIndices-getter.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,2BAA2B,GAAG;IAExC,SAAS,EAAE,YAAY,GAAG,UAAU,CAAC;IAGrC,eAAe,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC;IAGxB,SAAS,EAAE,MAAM,CAAC;IAGlB,kBAAkB,EAAE,MAAM,CAAC;IAG3B,UAAU,EAAE,MAAM,CAAC;IAGnB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,kBAAkB,EAAE,MAAM,CAAC;IAC3B,iBAAiB,EAAE,MAAM,CAAC;CAC3B,CAAC;AAEF,eAAO,MAAM,yBAAyB,KAAK,CAAC;AAC5C,eAAO,MAAM,wBAAwB,IAAI,CAAC;AAE1C,eAAO,MAAM,2BAA2B,eAAe,CAAC;AACxD,eAAO,MAAM,yBAAyB,aAAa,CAAC;AAIpD;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,0BAA0B,CAAC,EACjD,SAAS,EACT,kBAAkB,EAClB,eAAe,EACf,UAAU,EACV,SAAS,GACV,EAAE,2BAA2B,GAAG,eAAe,CAgD/C"}
@@ -0,0 +1,58 @@
1
+ export var SCROLL_DIRECTION_BACKWARD = -1;
2
+ export var SCROLL_DIRECTION_FORWARD = 1;
3
+ export var SCROLL_DIRECTION_HORIZONTAL = 'horizontal';
4
+ export var SCROLL_DIRECTION_VERTICAL = 'vertical';
5
+ var overscanIndicesCache = null;
6
+
7
+ /**
8
+ * Calculates the number of cells to overscan before and after a specified range.
9
+ * This function ensures that overscanning doesn't exceed the available cells.
10
+ */
11
+ export default function libroOverscanIndicesGetter(_ref) {
12
+ var cellCount = _ref.cellCount,
13
+ overscanCellsCount = _ref.overscanCellsCount,
14
+ scrollDirection = _ref.scrollDirection,
15
+ startIndex = _ref.startIndex,
16
+ stopIndex = _ref.stopIndex;
17
+ // Make sure we render at least 1 cell extra before and after (except near boundaries)
18
+ // This is necessary in order to support keyboard navigation (TAB/SHIFT+TAB) in some cases
19
+ // For more info see issues #625
20
+
21
+ // 计算 overscanIndices 的函数
22
+ var calculateOverscanIndices = function calculateOverscanIndices() {
23
+ var _overscanCellsCount = Math.max(1, overscanCellsCount);
24
+ var overscanIndices = null;
25
+ if (scrollDirection === SCROLL_DIRECTION_FORWARD) {
26
+ overscanIndices = {
27
+ overscanStartIndex: Math.max(0, startIndex - 1),
28
+ overscanStopIndex: Math.min(cellCount - 1, stopIndex + _overscanCellsCount)
29
+ };
30
+ } else {
31
+ overscanIndices = {
32
+ overscanStartIndex: Math.max(0, startIndex - _overscanCellsCount),
33
+ overscanStopIndex: Math.min(cellCount - 1, stopIndex + 1)
34
+ };
35
+ }
36
+ return overscanIndices;
37
+ };
38
+
39
+ // 检查缓存和时间戳函数
40
+ var checkCacheAndTimestamp = function checkCacheAndTimestamp() {
41
+ if (cellCount === 1) {
42
+ // 'horizontal' 方向 不用缓存
43
+ var overscanIndices = calculateOverscanIndices();
44
+ return overscanIndices;
45
+ }
46
+ if (overscanIndicesCache && Date.now() - overscanIndicesCache.timestamp < 500) {
47
+ return overscanIndicesCache.value;
48
+ } else {
49
+ var _overscanIndices = calculateOverscanIndices();
50
+ overscanIndicesCache = {
51
+ value: _overscanIndices,
52
+ timestamp: Date.now()
53
+ };
54
+ return _overscanIndices;
55
+ }
56
+ };
57
+ return checkCacheAndTimestamp();
58
+ }
@@ -0,0 +1,19 @@
1
+ export interface IVirtualizedManager {
2
+ openVirtualized: (length: number, size?: number) => Promise<boolean>;
3
+ isVirtualized: boolean;
4
+ }
5
+ export declare class VirtualizedManager implements IVirtualizedManager {
6
+ /**
7
+ * 因为进行isVirtualized判断过后才会渲染list
8
+ * 所以它用于滚动到某个cell的判断依据是没有问题的。
9
+ */
10
+ isVirtualized: boolean;
11
+ /**
12
+ *
13
+ * @param length cell个数
14
+ * @param size undefined 或者 单位 为B
15
+ * @returns 是否使用虚拟滚动
16
+ */
17
+ openVirtualized: (length: number, size?: number) => Promise<boolean>;
18
+ }
19
+ //# sourceMappingURL=virtualized-manager.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"virtualized-manager.d.ts","sourceRoot":"","sources":["../../../src/components/dnd-component/virtualized-manager.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,mBAAmB;IAClC,eAAe,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IACrE,aAAa,EAAE,OAAO,CAAC;CACxB;AAED,qBACa,kBAAmB,YAAW,mBAAmB;IAC5D;;;OAGG;IAEH,aAAa,UAAS;IAEtB;;;;;OAKG;IACH,eAAe,WAAkB,MAAM,SAAS,MAAM,sBAUpD;CACH"}