@milkdown/crepe 7.4.0 → 7.5.1

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 (424) hide show
  1. package/lib/cjs/clsx-dASsG01A.js +6 -0
  2. package/lib/cjs/clsx-dASsG01A.js.map +1 -0
  3. package/lib/cjs/{index-5PcT4iSf.js → index--2zEz40J.js} +8 -22
  4. package/lib/cjs/{index-5PcT4iSf.js.map → index--2zEz40J.js.map} +1 -1
  5. package/lib/cjs/{index-lrFGGa_l.js → index-5n9R-QCl.js} +5 -19
  6. package/lib/cjs/{index-lrFGGa_l.js.map → index-5n9R-QCl.js.map} +1 -1
  7. package/lib/cjs/{index-SxWWV8XD.js → index-HEdBw63r.js} +8 -22
  8. package/lib/cjs/{index-SxWWV8XD.js.map → index-HEdBw63r.js.map} +1 -1
  9. package/lib/cjs/{index-vlxA_KJ8.js → index-Hlt9dRH5.js} +5 -19
  10. package/lib/cjs/{index-vlxA_KJ8.js.map → index-Hlt9dRH5.js.map} +1 -1
  11. package/lib/cjs/{index-TEjdwq--.js → index-KCW2CzRk.js} +8 -22
  12. package/lib/{esm/index-DoEghZHy.js.map → cjs/index-KCW2CzRk.js.map} +1 -1
  13. package/lib/cjs/{index-qRg5-QJH.js → index-KSZhahYb.js} +6 -20
  14. package/lib/cjs/{index-qRg5-QJH.js.map → index-KSZhahYb.js.map} +1 -1
  15. package/lib/cjs/index-N1cRxqdw.js +39 -0
  16. package/lib/cjs/index-N1cRxqdw.js.map +1 -0
  17. package/lib/cjs/{index-fkT0ywfA.js → index-NNo_VSEA.js} +5 -19
  18. package/lib/cjs/{index-fkT0ywfA.js.map → index-NNo_VSEA.js.map} +1 -1
  19. package/lib/cjs/{index-OtaMLv5l.js → index-O1bDbloo.js} +5 -19
  20. package/lib/cjs/{index-OtaMLv5l.js.map → index-O1bDbloo.js.map} +1 -1
  21. package/lib/cjs/{index-mJ47ZWO2.js → index-OPh9naof.js} +8 -22
  22. package/lib/cjs/{index-mJ47ZWO2.js.map → index-OPh9naof.js.map} +1 -1
  23. package/lib/cjs/{index-OA_u95ey.js → index-PAhfZtcH.js} +5 -19
  24. package/lib/cjs/{index-OA_u95ey.js.map → index-PAhfZtcH.js.map} +1 -1
  25. package/lib/cjs/{index-zBr61zy6.js → index-PeRHVz4A.js} +5 -19
  26. package/lib/{esm/index-6P9Xk934.js.map → cjs/index-PeRHVz4A.js.map} +1 -1
  27. package/lib/cjs/{index-llNS_EuP.js → index-U7GWrg-w.js} +26 -470
  28. package/lib/cjs/index-U7GWrg-w.js.map +1 -0
  29. package/lib/cjs/{index-wXLifZgm.js → index-UTb0Az5e.js} +2 -2
  30. package/lib/cjs/{index-wXLifZgm.js.map → index-UTb0Az5e.js.map} +1 -1
  31. package/lib/cjs/{index-t_GA5F26.js → index-UnEAyH8X.js} +5 -19
  32. package/lib/cjs/{index-t_GA5F26.js.map → index-UnEAyH8X.js.map} +1 -1
  33. package/lib/cjs/{index-i0_v2uVp.js → index-VCkq0ru1.js} +5 -19
  34. package/lib/{esm/index-4QzlLVWs.js.map → cjs/index-VCkq0ru1.js.map} +1 -1
  35. package/lib/cjs/{index-OIQn1x0L.js → index-WQl7Du53.js} +4 -18
  36. package/lib/cjs/index-WQl7Du53.js.map +1 -0
  37. package/lib/cjs/{index-GEIgbcVc.js → index-ahL5MvrQ.js} +28 -42
  38. package/lib/cjs/{index-GEIgbcVc.js.map → index-ahL5MvrQ.js.map} +1 -1
  39. package/lib/cjs/{index-tbEq3xma.js → index-bpgWLeRY.js} +5 -19
  40. package/lib/cjs/{index-tbEq3xma.js.map → index-bpgWLeRY.js.map} +1 -1
  41. package/lib/cjs/index-dEVmN_aj.js +26 -0
  42. package/lib/cjs/index-dEVmN_aj.js.map +1 -0
  43. package/lib/cjs/{index-w9buMrFW.js → index-fZupvR_f.js} +8 -22
  44. package/lib/{esm/index-hQaRWeq1.js.map → cjs/index-fZupvR_f.js.map} +1 -1
  45. package/lib/cjs/{index-ortUqbAp.js → index-gSM-jgti.js} +5 -19
  46. package/lib/{esm/index-oMy83ynO.js.map → cjs/index-gSM-jgti.js.map} +1 -1
  47. package/lib/cjs/{index-LdEYPSZc.js → index-jlPr_A_N.js} +5 -19
  48. package/lib/cjs/{index-LdEYPSZc.js.map → index-jlPr_A_N.js.map} +1 -1
  49. package/lib/cjs/index-ocxd4A-M.js +675 -0
  50. package/lib/cjs/index-ocxd4A-M.js.map +1 -0
  51. package/lib/cjs/{index-xqKfEyRA.js → index-rFFAL9YA.js} +14 -17
  52. package/lib/cjs/index-rFFAL9YA.js.map +1 -0
  53. package/lib/cjs/index-tlx25I_m.js +36 -0
  54. package/lib/cjs/index-tlx25I_m.js.map +1 -0
  55. package/lib/cjs/index-tqAbVyds.js +28 -0
  56. package/lib/cjs/index-tqAbVyds.js.map +1 -0
  57. package/lib/cjs/index-udZSknd8.js +167 -0
  58. package/lib/cjs/index-udZSknd8.js.map +1 -0
  59. package/lib/cjs/index-uleaJDBC.js +19 -0
  60. package/lib/cjs/index-uleaJDBC.js.map +1 -0
  61. package/lib/cjs/{index-de3dfsQr.js → index-urB-WDqA.js} +7 -21
  62. package/lib/cjs/{index-de3dfsQr.js.map → index-urB-WDqA.js.map} +1 -1
  63. package/lib/cjs/{index-78P4PeZ9.js → index-xWgWtxUR.js} +6 -20
  64. package/lib/cjs/{index-78P4PeZ9.js.map → index-xWgWtxUR.js.map} +1 -1
  65. package/lib/cjs/index-z6pe2alg.js.map +1 -1
  66. package/lib/cjs/index.js +150 -13
  67. package/lib/cjs/index.js.map +1 -1
  68. package/lib/cjs/todoList-YYRQo7wG.js +404 -0
  69. package/lib/cjs/todoList-YYRQo7wG.js.map +1 -0
  70. package/lib/esm/clsx-RxCLxYpD.js +4 -0
  71. package/lib/esm/clsx-RxCLxYpD.js.map +1 -0
  72. package/lib/esm/{index-a-SAfeeT.js → index-1NetiFdJ.js} +8 -22
  73. package/lib/esm/{index-a-SAfeeT.js.map → index-1NetiFdJ.js.map} +1 -1
  74. package/lib/esm/{index-NmjiRA0M.js → index-2I_xbjAZ.js} +28 -42
  75. package/lib/esm/{index-NmjiRA0M.js.map → index-2I_xbjAZ.js.map} +1 -1
  76. package/lib/esm/{index-Grquo08f.js → index-2huXYfuJ.js} +8 -22
  77. package/lib/esm/{index-Grquo08f.js.map → index-2huXYfuJ.js.map} +1 -1
  78. package/lib/esm/{index-U8q-F7hU.js → index-4x6_TVZv.js} +5 -19
  79. package/lib/esm/{index-U8q-F7hU.js.map → index-4x6_TVZv.js.map} +1 -1
  80. package/lib/esm/index-6JoGWH2I.js +17 -0
  81. package/lib/esm/index-6JoGWH2I.js.map +1 -0
  82. package/lib/esm/{index-x-zW6gKj.js → index-A-dNwMMf.js} +2 -2
  83. package/lib/esm/{index-x-zW6gKj.js.map → index-A-dNwMMf.js.map} +1 -1
  84. package/lib/esm/{index-oMy83ynO.js → index-AV99ipmP.js} +5 -19
  85. package/lib/{cjs/index-ortUqbAp.js.map → esm/index-AV99ipmP.js.map} +1 -1
  86. package/lib/esm/{index-VyZguCIt.js → index-CMGDOz11.js} +10 -13
  87. package/lib/esm/index-CMGDOz11.js.map +1 -0
  88. package/lib/esm/index-HlPKwzLC.js +34 -0
  89. package/lib/esm/index-HlPKwzLC.js.map +1 -0
  90. package/lib/esm/index-Jvxff1vU.js.map +1 -1
  91. package/lib/esm/{index-vwrMVELn.js → index-PC2bahtq.js} +5 -19
  92. package/lib/esm/{index-vwrMVELn.js.map → index-PC2bahtq.js.map} +1 -1
  93. package/lib/esm/{index-UBeneu17.js → index-QBYz82jZ.js} +5 -19
  94. package/lib/esm/{index-UBeneu17.js.map → index-QBYz82jZ.js.map} +1 -1
  95. package/lib/esm/{index-bsED907r.js → index-W1pAMr_8.js} +6 -20
  96. package/lib/esm/{index-bsED907r.js.map → index-W1pAMr_8.js.map} +1 -1
  97. package/lib/esm/{index-q-qE7-96.js → index-Xzdc2jbA.js} +25 -469
  98. package/lib/esm/index-Xzdc2jbA.js.map +1 -0
  99. package/lib/esm/{index-A9zdyi2L.js → index-ZAtZWqJQ.js} +5 -19
  100. package/lib/esm/{index-A9zdyi2L.js.map → index-ZAtZWqJQ.js.map} +1 -1
  101. package/lib/esm/index-_A9vu1ED.js +673 -0
  102. package/lib/esm/index-_A9vu1ED.js.map +1 -0
  103. package/lib/esm/{index-U71v7KdA.js → index-bnSKBrbD.js} +5 -19
  104. package/lib/esm/{index-U71v7KdA.js.map → index-bnSKBrbD.js.map} +1 -1
  105. package/lib/esm/index-fVrfHXda.js +24 -0
  106. package/lib/esm/index-fVrfHXda.js.map +1 -0
  107. package/lib/esm/{index-PkBZpDL4.js → index-ftnOhuRS.js} +4 -18
  108. package/lib/esm/index-ftnOhuRS.js.map +1 -0
  109. package/lib/esm/{index-4oMdufW4.js → index-iQPB0Rdl.js} +6 -20
  110. package/lib/esm/{index-4oMdufW4.js.map → index-iQPB0Rdl.js.map} +1 -1
  111. package/lib/esm/{index-0khVa44f.js → index-kPj3-TKp.js} +5 -19
  112. package/lib/esm/{index-0khVa44f.js.map → index-kPj3-TKp.js.map} +1 -1
  113. package/lib/esm/{index-hQaRWeq1.js → index-kgOR7SZ6.js} +8 -22
  114. package/lib/{cjs/index-w9buMrFW.js.map → esm/index-kgOR7SZ6.js.map} +1 -1
  115. package/lib/esm/index-lm00PM0y.js +165 -0
  116. package/lib/esm/index-lm00PM0y.js.map +1 -0
  117. package/lib/esm/{index-4QzlLVWs.js → index-m49Bj3q7.js} +5 -19
  118. package/lib/{cjs/index-i0_v2uVp.js.map → esm/index-m49Bj3q7.js.map} +1 -1
  119. package/lib/esm/index-ohmbt6Ys.js +37 -0
  120. package/lib/esm/index-ohmbt6Ys.js.map +1 -0
  121. package/lib/esm/{index-DoEghZHy.js → index-sWVjGw-3.js} +8 -22
  122. package/lib/esm/index-sWVjGw-3.js.map +1 -0
  123. package/lib/esm/{index-L7VXk-jT.js → index-twh8lL5o.js} +5 -19
  124. package/lib/esm/{index-L7VXk-jT.js.map → index-twh8lL5o.js.map} +1 -1
  125. package/lib/esm/{index-6P9Xk934.js → index-v02MCz4_.js} +5 -19
  126. package/lib/{cjs/index-zBr61zy6.js.map → esm/index-v02MCz4_.js.map} +1 -1
  127. package/lib/esm/index-v3rvbocl.js +26 -0
  128. package/lib/esm/index-v3rvbocl.js.map +1 -0
  129. package/lib/esm/{index-7BVeXLQZ.js → index-wEXT8mbN.js} +5 -19
  130. package/lib/esm/{index-7BVeXLQZ.js.map → index-wEXT8mbN.js.map} +1 -1
  131. package/lib/esm/{index-rwcSpYkt.js → index-wFIac5Kw.js} +7 -21
  132. package/lib/esm/{index-rwcSpYkt.js.map → index-wFIac5Kw.js.map} +1 -1
  133. package/lib/esm/{index-bVubJ6Rv.js → index-wg94ewRo.js} +8 -22
  134. package/lib/esm/{index-bVubJ6Rv.js.map → index-wg94ewRo.js.map} +1 -1
  135. package/lib/esm/index.js +152 -11
  136. package/lib/esm/index.js.map +1 -1
  137. package/lib/esm/todoList-9QsDDcmB.js +368 -0
  138. package/lib/esm/todoList-9QsDDcmB.js.map +1 -0
  139. package/lib/theme/_internal/classic-common.css +3 -2
  140. package/lib/theme/common/block-edit.css +3 -1
  141. package/lib/theme/common/code-mirror.css +15 -0
  142. package/lib/theme/common/cursor.css +1 -1
  143. package/lib/theme/common/image-block.css +2 -0
  144. package/lib/theme/common/link-tooltip.css +10 -13
  145. package/lib/theme/common/list-item.css +16 -1
  146. package/lib/theme/common/prosemirror.css +1 -1
  147. package/lib/theme/common/style.css +1 -0
  148. package/lib/theme/common/table.css +217 -0
  149. package/lib/theme/common/toolbar.css +11 -4
  150. package/lib/theme/{classic-dark → crepe-dark}/style.css +2 -2
  151. package/lib/theme/frame/style.css +28 -0
  152. package/lib/theme/frame-dark/style.css +28 -0
  153. package/lib/theme/nord/style.css +28 -0
  154. package/lib/theme/nord-dark/style.css +28 -0
  155. package/lib/types/core/crepe.d.ts +5 -3
  156. package/lib/types/core/crepe.d.ts.map +1 -1
  157. package/lib/types/core/slice.d.ts +2 -2
  158. package/lib/types/core/slice.d.ts.map +1 -1
  159. package/lib/types/feature/block-edit/handle/component.d.ts +3 -0
  160. package/lib/types/feature/block-edit/handle/component.d.ts.map +1 -1
  161. package/lib/types/feature/block-edit/handle/index.d.ts +5 -4
  162. package/lib/types/feature/block-edit/handle/index.d.ts.map +1 -1
  163. package/lib/types/feature/block-edit/index.d.ts +43 -2
  164. package/lib/types/feature/block-edit/index.d.ts.map +1 -1
  165. package/lib/types/feature/block-edit/menu/component.d.ts +3 -1
  166. package/lib/types/feature/block-edit/menu/component.d.ts.map +1 -1
  167. package/lib/types/feature/block-edit/menu/config.d.ts +3 -12
  168. package/lib/types/feature/block-edit/menu/config.d.ts.map +1 -1
  169. package/lib/types/feature/block-edit/menu/group-builder.d.ts +29 -0
  170. package/lib/types/feature/block-edit/menu/group-builder.d.ts.map +1 -0
  171. package/lib/types/feature/block-edit/menu/index.d.ts +5 -4
  172. package/lib/types/feature/block-edit/menu/index.d.ts.map +1 -1
  173. package/lib/types/feature/block-edit/menu/utils.d.ts +28 -0
  174. package/lib/types/feature/block-edit/menu/utils.d.ts.map +1 -0
  175. package/lib/types/feature/code-mirror/index.d.ts +9 -1
  176. package/lib/types/feature/code-mirror/index.d.ts.map +1 -1
  177. package/lib/types/feature/cursor/index.d.ts +1 -1
  178. package/lib/types/feature/cursor/index.d.ts.map +1 -1
  179. package/lib/types/feature/image-block/index.d.ts +19 -2
  180. package/lib/types/feature/image-block/index.d.ts.map +1 -1
  181. package/lib/types/feature/index.d.ts +17 -2
  182. package/lib/types/feature/index.d.ts.map +1 -1
  183. package/lib/types/feature/link-tooltip/index.d.ts +12 -2
  184. package/lib/types/feature/link-tooltip/index.d.ts.map +1 -1
  185. package/lib/types/feature/list-item/index.d.ts +8 -2
  186. package/lib/types/feature/list-item/index.d.ts.map +1 -1
  187. package/lib/types/feature/placeholder/index.d.ts +2 -2
  188. package/lib/types/feature/placeholder/index.d.ts.map +1 -1
  189. package/lib/types/feature/shared.d.ts +3 -1
  190. package/lib/types/feature/shared.d.ts.map +1 -1
  191. package/lib/types/feature/table/index.d.ts +16 -0
  192. package/lib/types/feature/table/index.d.ts.map +1 -0
  193. package/lib/types/feature/toolbar/component.d.ts +3 -1
  194. package/lib/types/feature/toolbar/component.d.ts.map +1 -1
  195. package/lib/types/feature/toolbar/index.d.ts +11 -2
  196. package/lib/types/feature/toolbar/index.d.ts.map +1 -1
  197. package/lib/types/icons/alignCenter.d.ts +2 -0
  198. package/lib/types/icons/alignCenter.d.ts.map +1 -0
  199. package/lib/types/icons/alignLeft.d.ts +2 -0
  200. package/lib/types/icons/alignLeft.d.ts.map +1 -0
  201. package/lib/types/icons/alignRight.d.ts +2 -0
  202. package/lib/types/icons/alignRight.d.ts.map +1 -0
  203. package/lib/types/icons/bold.d.ts +2 -0
  204. package/lib/types/icons/bold.d.ts.map +1 -0
  205. package/lib/types/{feature/list-item/consts.d.ts → icons/bullet.d.ts} +1 -1
  206. package/lib/types/icons/bullet.d.ts.map +1 -0
  207. package/lib/types/icons/bulletList.d.ts +2 -0
  208. package/lib/types/icons/bulletList.d.ts.map +1 -0
  209. package/lib/types/icons/caption.d.ts +2 -0
  210. package/lib/types/icons/caption.d.ts.map +1 -0
  211. package/lib/types/icons/checkBoxChecked.d.ts +2 -0
  212. package/lib/types/icons/checkBoxChecked.d.ts.map +1 -0
  213. package/lib/types/icons/checkBoxUnchecked.d.ts +2 -0
  214. package/lib/types/icons/checkBoxUnchecked.d.ts.map +1 -0
  215. package/lib/types/icons/chevronDown.d.ts +2 -0
  216. package/lib/types/icons/chevronDown.d.ts.map +1 -0
  217. package/lib/types/icons/clear.d.ts +2 -0
  218. package/lib/types/icons/clear.d.ts.map +1 -0
  219. package/lib/types/icons/code.d.ts +2 -0
  220. package/lib/types/icons/code.d.ts.map +1 -0
  221. package/lib/types/icons/confirm.d.ts +2 -0
  222. package/lib/types/icons/confirm.d.ts.map +1 -0
  223. package/lib/types/icons/divider.d.ts +2 -0
  224. package/lib/types/icons/divider.d.ts.map +1 -0
  225. package/lib/types/icons/dragHandle.d.ts +2 -0
  226. package/lib/types/icons/dragHandle.d.ts.map +1 -0
  227. package/lib/types/icons/edit.d.ts +2 -0
  228. package/lib/types/icons/edit.d.ts.map +1 -0
  229. package/lib/types/icons/h1.d.ts +2 -0
  230. package/lib/types/icons/h1.d.ts.map +1 -0
  231. package/lib/types/icons/h2.d.ts +2 -0
  232. package/lib/types/icons/h2.d.ts.map +1 -0
  233. package/lib/types/icons/h3.d.ts +2 -0
  234. package/lib/types/icons/h3.d.ts.map +1 -0
  235. package/lib/types/icons/h4.d.ts +2 -0
  236. package/lib/types/icons/h4.d.ts.map +1 -0
  237. package/lib/types/icons/h5.d.ts +2 -0
  238. package/lib/types/icons/h5.d.ts.map +1 -0
  239. package/lib/types/icons/h6.d.ts +2 -0
  240. package/lib/types/icons/h6.d.ts.map +1 -0
  241. package/lib/types/icons/image.d.ts +2 -0
  242. package/lib/types/icons/image.d.ts.map +1 -0
  243. package/lib/types/icons/index.d.ts +36 -0
  244. package/lib/types/icons/index.d.ts.map +1 -0
  245. package/lib/types/icons/italic.d.ts +2 -0
  246. package/lib/types/icons/italic.d.ts.map +1 -0
  247. package/lib/types/icons/link.d.ts +2 -0
  248. package/lib/types/icons/link.d.ts.map +1 -0
  249. package/lib/types/icons/menu.d.ts +2 -0
  250. package/lib/types/icons/menu.d.ts.map +1 -0
  251. package/lib/types/icons/orderedList.d.ts +2 -0
  252. package/lib/types/icons/orderedList.d.ts.map +1 -0
  253. package/lib/types/icons/plus.d.ts +2 -0
  254. package/lib/types/icons/plus.d.ts.map +1 -0
  255. package/lib/types/icons/quote.d.ts +2 -0
  256. package/lib/types/icons/quote.d.ts.map +1 -0
  257. package/lib/types/icons/remove.d.ts +2 -0
  258. package/lib/types/icons/remove.d.ts.map +1 -0
  259. package/lib/types/icons/search.d.ts +2 -0
  260. package/lib/types/icons/search.d.ts.map +1 -0
  261. package/lib/types/icons/strikethrough.d.ts +2 -0
  262. package/lib/types/icons/strikethrough.d.ts.map +1 -0
  263. package/lib/types/icons/table.d.ts +2 -0
  264. package/lib/types/icons/table.d.ts.map +1 -0
  265. package/lib/types/icons/text.d.ts +2 -0
  266. package/lib/types/icons/text.d.ts.map +1 -0
  267. package/lib/types/icons/todoList.d.ts +2 -0
  268. package/lib/types/icons/todoList.d.ts.map +1 -0
  269. package/lib/types/utils/index.d.ts +1 -1
  270. package/lib/types/utils/index.d.ts.map +1 -1
  271. package/package.json +9 -23
  272. package/src/core/crepe.ts +15 -9
  273. package/src/core/slice.ts +2 -2
  274. package/src/feature/block-edit/handle/component.ts +13 -29
  275. package/src/feature/block-edit/handle/index.ts +16 -17
  276. package/src/feature/block-edit/index.ts +50 -5
  277. package/src/feature/block-edit/menu/component.ts +6 -7
  278. package/src/feature/block-edit/menu/config.ts +203 -274
  279. package/src/feature/block-edit/menu/group-builder.ts +50 -0
  280. package/src/feature/block-edit/menu/index.ts +11 -8
  281. package/src/feature/block-edit/menu/utils.ts +89 -0
  282. package/src/feature/code-mirror/index.ts +27 -19
  283. package/src/feature/cursor/index.ts +3 -4
  284. package/src/feature/image-block/index.ts +34 -41
  285. package/src/feature/index.ts +23 -3
  286. package/src/feature/link-tooltip/index.ts +23 -10
  287. package/src/feature/list-item/index.ts +21 -9
  288. package/src/feature/placeholder/index.ts +11 -6
  289. package/src/feature/shared.ts +4 -1
  290. package/src/feature/table/index.ts +54 -0
  291. package/src/feature/toolbar/component.ts +29 -11
  292. package/src/feature/toolbar/index.ts +21 -9
  293. package/src/icons/alignCenter.ts +7 -0
  294. package/src/icons/alignLeft.ts +7 -0
  295. package/src/icons/alignRight.ts +7 -0
  296. package/src/icons/bold.ts +7 -0
  297. package/src/{feature/list-item/consts.ts → icons/bullet.ts} +3 -3
  298. package/src/icons/bulletList.ts +14 -0
  299. package/src/icons/caption.ts +7 -0
  300. package/src/icons/checkBoxChecked.ts +14 -0
  301. package/src/icons/checkBoxUnchecked.ts +14 -0
  302. package/src/icons/chevronDown.ts +7 -0
  303. package/src/icons/clear.ts +14 -0
  304. package/src/icons/code.ts +14 -0
  305. package/src/icons/confirm.ts +14 -0
  306. package/src/icons/divider.ts +14 -0
  307. package/src/icons/dragHandle.ts +7 -0
  308. package/src/icons/edit.ts +14 -0
  309. package/src/icons/h1.ts +14 -0
  310. package/src/icons/h2.ts +14 -0
  311. package/src/icons/h3.ts +14 -0
  312. package/src/icons/h4.ts +14 -0
  313. package/src/icons/h5.ts +14 -0
  314. package/src/icons/h6.ts +14 -0
  315. package/src/icons/image.ts +14 -0
  316. package/src/icons/index.ts +35 -0
  317. package/src/icons/italic.ts +7 -0
  318. package/src/icons/link.ts +7 -0
  319. package/src/icons/menu.ts +14 -0
  320. package/src/icons/orderedList.ts +14 -0
  321. package/src/icons/plus.ts +14 -0
  322. package/src/icons/quote.ts +14 -0
  323. package/src/icons/remove.ts +7 -0
  324. package/src/icons/search.ts +7 -0
  325. package/src/icons/strikethrough.ts +7 -0
  326. package/src/icons/table.ts +14 -0
  327. package/src/icons/text.ts +14 -0
  328. package/src/icons/todoList.ts +7 -0
  329. package/src/theme/_internal/classic-common.css +3 -2
  330. package/src/theme/common/block-edit.css +3 -1
  331. package/src/theme/common/code-mirror.css +13 -0
  332. package/src/theme/common/cursor.css +1 -1
  333. package/src/theme/common/image-block.css +2 -0
  334. package/src/theme/common/link-tooltip.css +11 -14
  335. package/src/theme/common/list-item.css +9 -0
  336. package/src/theme/common/prosemirror.css +1 -1
  337. package/src/theme/common/style.css +1 -0
  338. package/src/theme/common/table.css +204 -0
  339. package/src/theme/common/toolbar.css +14 -4
  340. package/src/theme/{classic-dark → crepe-dark}/style.css +2 -2
  341. package/src/theme/frame/style.css +28 -0
  342. package/src/theme/frame-dark/style.css +28 -0
  343. package/src/theme/nord/style.css +28 -0
  344. package/src/theme/nord-dark/style.css +28 -0
  345. package/src/utils/index.ts +1 -1
  346. package/lib/cjs/_view-TbSIR42F.js +0 -27
  347. package/lib/cjs/_view-TbSIR42F.js.map +0 -1
  348. package/lib/cjs/clsx-7JLENl8W.js +0 -62
  349. package/lib/cjs/clsx-7JLENl8W.js.map +0 -1
  350. package/lib/cjs/composed-offset-position.browser.min-FwypoGc1.js +0 -1138
  351. package/lib/cjs/composed-offset-position.browser.min-FwypoGc1.js.map +0 -1
  352. package/lib/cjs/helper-OEW-2Vxr.js +0 -9
  353. package/lib/cjs/helper-OEW-2Vxr.js.map +0 -1
  354. package/lib/cjs/index-2oxl5Zo4.js +0 -551
  355. package/lib/cjs/index-2oxl5Zo4.js.map +0 -1
  356. package/lib/cjs/index-GKolgvC5.js +0 -505
  357. package/lib/cjs/index-GKolgvC5.js.map +0 -1
  358. package/lib/cjs/index-JAqL0ybh.js +0 -55
  359. package/lib/cjs/index-JAqL0ybh.js.map +0 -1
  360. package/lib/cjs/index-Ne_pk53w.js +0 -178
  361. package/lib/cjs/index-Ne_pk53w.js.map +0 -1
  362. package/lib/cjs/index-O3vRXWIP.js +0 -199
  363. package/lib/cjs/index-O3vRXWIP.js.map +0 -1
  364. package/lib/cjs/index-OIQn1x0L.js.map +0 -1
  365. package/lib/cjs/index-PF7s7DOo.js +0 -386
  366. package/lib/cjs/index-PF7s7DOo.js.map +0 -1
  367. package/lib/cjs/index-TEjdwq--.js.map +0 -1
  368. package/lib/cjs/index-kNI3S3lF.js +0 -22477
  369. package/lib/cjs/index-kNI3S3lF.js.map +0 -1
  370. package/lib/cjs/index-kvO8ReCY.js +0 -1960
  371. package/lib/cjs/index-kvO8ReCY.js.map +0 -1
  372. package/lib/cjs/index-llNS_EuP.js.map +0 -1
  373. package/lib/cjs/index-xqKfEyRA.js.map +0 -1
  374. package/lib/cjs/meta-q8q9fHyr.js +0 -14
  375. package/lib/cjs/meta-q8q9fHyr.js.map +0 -1
  376. package/lib/cjs/schema-7d3meDfB.js +0 -74
  377. package/lib/cjs/schema-7d3meDfB.js.map +0 -1
  378. package/lib/cjs/tooltip-plugin-Mk9fRTxI.js +0 -200
  379. package/lib/cjs/tooltip-plugin-Mk9fRTxI.js.map +0 -1
  380. package/lib/esm/_view-JjtfhQ8k.js +0 -25
  381. package/lib/esm/_view-JjtfhQ8k.js.map +0 -1
  382. package/lib/esm/clsx-R7WFaNKL.js +0 -52
  383. package/lib/esm/clsx-R7WFaNKL.js.map +0 -1
  384. package/lib/esm/composed-offset-position.browser.min-Tnm31e-m.js +0 -1132
  385. package/lib/esm/composed-offset-position.browser.min-Tnm31e-m.js.map +0 -1
  386. package/lib/esm/helper-iYEjPbOY.js +0 -7
  387. package/lib/esm/helper-iYEjPbOY.js.map +0 -1
  388. package/lib/esm/index-218OjRxG.js +0 -549
  389. package/lib/esm/index-218OjRxG.js.map +0 -1
  390. package/lib/esm/index-AHPvVH4H.js +0 -197
  391. package/lib/esm/index-AHPvVH4H.js.map +0 -1
  392. package/lib/esm/index-Bg5GFp0g.js +0 -384
  393. package/lib/esm/index-Bg5GFp0g.js.map +0 -1
  394. package/lib/esm/index-JkHHp3K-.js +0 -22445
  395. package/lib/esm/index-JkHHp3K-.js.map +0 -1
  396. package/lib/esm/index-PkBZpDL4.js.map +0 -1
  397. package/lib/esm/index-TNMG6UrN.js +0 -53
  398. package/lib/esm/index-TNMG6UrN.js.map +0 -1
  399. package/lib/esm/index-VyZguCIt.js.map +0 -1
  400. package/lib/esm/index-h1arGiXv.js +0 -1958
  401. package/lib/esm/index-h1arGiXv.js.map +0 -1
  402. package/lib/esm/index-pHsvfB_I.js +0 -503
  403. package/lib/esm/index-pHsvfB_I.js.map +0 -1
  404. package/lib/esm/index-q-qE7-96.js.map +0 -1
  405. package/lib/esm/index-u8tWJbca.js +0 -176
  406. package/lib/esm/index-u8tWJbca.js.map +0 -1
  407. package/lib/esm/meta-3ZYGAGrY.js +0 -12
  408. package/lib/esm/meta-3ZYGAGrY.js.map +0 -1
  409. package/lib/esm/schema-hVsy-vme.js +0 -71
  410. package/lib/esm/schema-hVsy-vme.js.map +0 -1
  411. package/lib/esm/tooltip-plugin-vZefVSGL.js +0 -194
  412. package/lib/esm/tooltip-plugin-vZefVSGL.js.map +0 -1
  413. package/lib/types/feature/block-edit/menu/icons.d.ts +0 -14
  414. package/lib/types/feature/block-edit/menu/icons.d.ts.map +0 -1
  415. package/lib/types/feature/link-tooltip/consts.d.ts +0 -5
  416. package/lib/types/feature/link-tooltip/consts.d.ts.map +0 -1
  417. package/lib/types/feature/list-item/consts.d.ts.map +0 -1
  418. package/lib/types/feature/toolbar/consts.d.ts +0 -5
  419. package/lib/types/feature/toolbar/consts.d.ts.map +0 -1
  420. package/src/feature/block-edit/menu/icons.ts +0 -170
  421. package/src/feature/link-tooltip/consts.ts +0 -46
  422. package/src/feature/toolbar/consts.ts +0 -25
  423. /package/lib/theme/{classic → crepe}/style.css +0 -0
  424. /package/src/theme/{classic → crepe}/style.css +0 -0
@@ -1,1132 +0,0 @@
1
- const oppositeSideMap = {
2
- left: 'right',
3
- right: 'left',
4
- bottom: 'top',
5
- top: 'bottom'
6
- };
7
- const oppositeAlignmentMap = {
8
- start: 'end',
9
- end: 'start'
10
- };
11
- function evaluate(value, param) {
12
- return typeof value === 'function' ? value(param) : value;
13
- }
14
- function getSide(placement) {
15
- return placement.split('-')[0];
16
- }
17
- function getAlignment(placement) {
18
- return placement.split('-')[1];
19
- }
20
- function getOppositeAxis(axis) {
21
- return axis === 'x' ? 'y' : 'x';
22
- }
23
- function getAxisLength(axis) {
24
- return axis === 'y' ? 'height' : 'width';
25
- }
26
- function getSideAxis(placement) {
27
- return ['top', 'bottom'].includes(getSide(placement)) ? 'y' : 'x';
28
- }
29
- function getAlignmentAxis(placement) {
30
- return getOppositeAxis(getSideAxis(placement));
31
- }
32
- function getAlignmentSides(placement, rects, rtl) {
33
- if (rtl === void 0) {
34
- rtl = false;
35
- }
36
- const alignment = getAlignment(placement);
37
- const alignmentAxis = getAlignmentAxis(placement);
38
- const length = getAxisLength(alignmentAxis);
39
- let mainAlignmentSide = alignmentAxis === 'x' ? alignment === (rtl ? 'end' : 'start') ? 'right' : 'left' : alignment === 'start' ? 'bottom' : 'top';
40
- if (rects.reference[length] > rects.floating[length]) {
41
- mainAlignmentSide = getOppositePlacement(mainAlignmentSide);
42
- }
43
- return [mainAlignmentSide, getOppositePlacement(mainAlignmentSide)];
44
- }
45
- function getExpandedPlacements(placement) {
46
- const oppositePlacement = getOppositePlacement(placement);
47
- return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)];
48
- }
49
- function getOppositeAlignmentPlacement(placement) {
50
- return placement.replace(/start|end/g, alignment => oppositeAlignmentMap[alignment]);
51
- }
52
- function getSideList(side, isStart, rtl) {
53
- const lr = ['left', 'right'];
54
- const rl = ['right', 'left'];
55
- const tb = ['top', 'bottom'];
56
- const bt = ['bottom', 'top'];
57
- switch (side) {
58
- case 'top':
59
- case 'bottom':
60
- if (rtl) return isStart ? rl : lr;
61
- return isStart ? lr : rl;
62
- case 'left':
63
- case 'right':
64
- return isStart ? tb : bt;
65
- default:
66
- return [];
67
- }
68
- }
69
- function getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) {
70
- const alignment = getAlignment(placement);
71
- let list = getSideList(getSide(placement), direction === 'start', rtl);
72
- if (alignment) {
73
- list = list.map(side => side + "-" + alignment);
74
- if (flipAlignment) {
75
- list = list.concat(list.map(getOppositeAlignmentPlacement));
76
- }
77
- }
78
- return list;
79
- }
80
- function getOppositePlacement(placement) {
81
- return placement.replace(/left|right|bottom|top/g, side => oppositeSideMap[side]);
82
- }
83
- function expandPaddingObject(padding) {
84
- return {
85
- top: 0,
86
- right: 0,
87
- bottom: 0,
88
- left: 0,
89
- ...padding
90
- };
91
- }
92
- function getPaddingObject(padding) {
93
- return typeof padding !== 'number' ? expandPaddingObject(padding) : {
94
- top: padding,
95
- right: padding,
96
- bottom: padding,
97
- left: padding
98
- };
99
- }
100
- function rectToClientRect(rect) {
101
- return {
102
- ...rect,
103
- top: rect.y,
104
- left: rect.x,
105
- right: rect.x + rect.width,
106
- bottom: rect.y + rect.height
107
- };
108
- }
109
-
110
- function computeCoordsFromPlacement(_ref, placement, rtl) {
111
- let {
112
- reference,
113
- floating
114
- } = _ref;
115
- const sideAxis = getSideAxis(placement);
116
- const alignmentAxis = getAlignmentAxis(placement);
117
- const alignLength = getAxisLength(alignmentAxis);
118
- const side = getSide(placement);
119
- const isVertical = sideAxis === 'y';
120
- const commonX = reference.x + reference.width / 2 - floating.width / 2;
121
- const commonY = reference.y + reference.height / 2 - floating.height / 2;
122
- const commonAlign = reference[alignLength] / 2 - floating[alignLength] / 2;
123
- let coords;
124
- switch (side) {
125
- case 'top':
126
- coords = {
127
- x: commonX,
128
- y: reference.y - floating.height
129
- };
130
- break;
131
- case 'bottom':
132
- coords = {
133
- x: commonX,
134
- y: reference.y + reference.height
135
- };
136
- break;
137
- case 'right':
138
- coords = {
139
- x: reference.x + reference.width,
140
- y: commonY
141
- };
142
- break;
143
- case 'left':
144
- coords = {
145
- x: reference.x - floating.width,
146
- y: commonY
147
- };
148
- break;
149
- default:
150
- coords = {
151
- x: reference.x,
152
- y: reference.y
153
- };
154
- }
155
- switch (getAlignment(placement)) {
156
- case 'start':
157
- coords[alignmentAxis] -= commonAlign * (rtl && isVertical ? -1 : 1);
158
- break;
159
- case 'end':
160
- coords[alignmentAxis] += commonAlign * (rtl && isVertical ? -1 : 1);
161
- break;
162
- }
163
- return coords;
164
- }
165
-
166
- /**
167
- * Computes the `x` and `y` coordinates that will place the floating element
168
- * next to a reference element when it is given a certain positioning strategy.
169
- *
170
- * This export does not have any `platform` interface logic. You will need to
171
- * write one for the platform you are using Floating UI with.
172
- */
173
- const computePosition$1 = async (reference, floating, config) => {
174
- const {
175
- placement = 'bottom',
176
- strategy = 'absolute',
177
- middleware = [],
178
- platform
179
- } = config;
180
- const validMiddleware = middleware.filter(Boolean);
181
- const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(floating));
182
- let rects = await platform.getElementRects({
183
- reference,
184
- floating,
185
- strategy
186
- });
187
- let {
188
- x,
189
- y
190
- } = computeCoordsFromPlacement(rects, placement, rtl);
191
- let statefulPlacement = placement;
192
- let middlewareData = {};
193
- let resetCount = 0;
194
- for (let i = 0; i < validMiddleware.length; i++) {
195
- const {
196
- name,
197
- fn
198
- } = validMiddleware[i];
199
- const {
200
- x: nextX,
201
- y: nextY,
202
- data,
203
- reset
204
- } = await fn({
205
- x,
206
- y,
207
- initialPlacement: placement,
208
- placement: statefulPlacement,
209
- strategy,
210
- middlewareData,
211
- rects,
212
- platform,
213
- elements: {
214
- reference,
215
- floating
216
- }
217
- });
218
- x = nextX != null ? nextX : x;
219
- y = nextY != null ? nextY : y;
220
- middlewareData = {
221
- ...middlewareData,
222
- [name]: {
223
- ...middlewareData[name],
224
- ...data
225
- }
226
- };
227
- if (reset && resetCount <= 50) {
228
- resetCount++;
229
- if (typeof reset === 'object') {
230
- if (reset.placement) {
231
- statefulPlacement = reset.placement;
232
- }
233
- if (reset.rects) {
234
- rects = reset.rects === true ? await platform.getElementRects({
235
- reference,
236
- floating,
237
- strategy
238
- }) : reset.rects;
239
- }
240
- ({
241
- x,
242
- y
243
- } = computeCoordsFromPlacement(rects, statefulPlacement, rtl));
244
- }
245
- i = -1;
246
- continue;
247
- }
248
- }
249
- return {
250
- x,
251
- y,
252
- placement: statefulPlacement,
253
- strategy,
254
- middlewareData
255
- };
256
- };
257
-
258
- /**
259
- * Resolves with an object of overflow side offsets that determine how much the
260
- * element is overflowing a given clipping boundary on each side.
261
- * - positive = overflowing the boundary by that number of pixels
262
- * - negative = how many pixels left before it will overflow
263
- * - 0 = lies flush with the boundary
264
- * @see https://floating-ui.com/docs/detectOverflow
265
- */
266
- async function detectOverflow(state, options) {
267
- var _await$platform$isEle;
268
- if (options === void 0) {
269
- options = {};
270
- }
271
- const {
272
- x,
273
- y,
274
- platform,
275
- rects,
276
- elements,
277
- strategy
278
- } = state;
279
- const {
280
- boundary = 'clippingAncestors',
281
- rootBoundary = 'viewport',
282
- elementContext = 'floating',
283
- altBoundary = false,
284
- padding = 0
285
- } = evaluate(options, state);
286
- const paddingObject = getPaddingObject(padding);
287
- const altContext = elementContext === 'floating' ? 'reference' : 'floating';
288
- const element = elements[altBoundary ? altContext : elementContext];
289
- const clippingClientRect = rectToClientRect(await platform.getClippingRect({
290
- element: ((_await$platform$isEle = await (platform.isElement == null ? void 0 : platform.isElement(element))) != null ? _await$platform$isEle : true) ? element : element.contextElement || (await (platform.getDocumentElement == null ? void 0 : platform.getDocumentElement(elements.floating))),
291
- boundary,
292
- rootBoundary,
293
- strategy
294
- }));
295
- const rect = elementContext === 'floating' ? {
296
- ...rects.floating,
297
- x,
298
- y
299
- } : rects.reference;
300
- const offsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating));
301
- const offsetScale = (await (platform.isElement == null ? void 0 : platform.isElement(offsetParent))) ? (await (platform.getScale == null ? void 0 : platform.getScale(offsetParent))) || {
302
- x: 1,
303
- y: 1
304
- } : {
305
- x: 1,
306
- y: 1
307
- };
308
- const elementClientRect = rectToClientRect(platform.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform.convertOffsetParentRelativeRectToViewportRelativeRect({
309
- rect,
310
- offsetParent,
311
- strategy
312
- }) : rect);
313
- return {
314
- top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y,
315
- bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y,
316
- left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x,
317
- right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x
318
- };
319
- }
320
-
321
- /**
322
- * Optimizes the visibility of the floating element by flipping the `placement`
323
- * in order to keep it in view when the preferred placement(s) will overflow the
324
- * clipping boundary. Alternative to `autoPlacement`.
325
- * @see https://floating-ui.com/docs/flip
326
- */
327
- const flip$1 = function (options) {
328
- if (options === void 0) {
329
- options = {};
330
- }
331
- return {
332
- name: 'flip',
333
- options,
334
- async fn(state) {
335
- var _middlewareData$arrow, _middlewareData$flip;
336
- const {
337
- placement,
338
- middlewareData,
339
- rects,
340
- initialPlacement,
341
- platform,
342
- elements
343
- } = state;
344
- const {
345
- mainAxis: checkMainAxis = true,
346
- crossAxis: checkCrossAxis = true,
347
- fallbackPlacements: specifiedFallbackPlacements,
348
- fallbackStrategy = 'bestFit',
349
- fallbackAxisSideDirection = 'none',
350
- flipAlignment = true,
351
- ...detectOverflowOptions
352
- } = evaluate(options, state);
353
-
354
- // If a reset by the arrow was caused due to an alignment offset being
355
- // added, we should skip any logic now since `flip()` has already done its
356
- // work.
357
- // https://github.com/floating-ui/floating-ui/issues/2549#issuecomment-1719601643
358
- if ((_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {
359
- return {};
360
- }
361
- const side = getSide(placement);
362
- const isBasePlacement = getSide(initialPlacement) === initialPlacement;
363
- const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));
364
- const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement));
365
- if (!specifiedFallbackPlacements && fallbackAxisSideDirection !== 'none') {
366
- fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));
367
- }
368
- const placements = [initialPlacement, ...fallbackPlacements];
369
- const overflow = await detectOverflow(state, detectOverflowOptions);
370
- const overflows = [];
371
- let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || [];
372
- if (checkMainAxis) {
373
- overflows.push(overflow[side]);
374
- }
375
- if (checkCrossAxis) {
376
- const sides = getAlignmentSides(placement, rects, rtl);
377
- overflows.push(overflow[sides[0]], overflow[sides[1]]);
378
- }
379
- overflowsData = [...overflowsData, {
380
- placement,
381
- overflows
382
- }];
383
-
384
- // One or more sides is overflowing.
385
- if (!overflows.every(side => side <= 0)) {
386
- var _middlewareData$flip2, _overflowsData$filter;
387
- const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1;
388
- const nextPlacement = placements[nextIndex];
389
- if (nextPlacement) {
390
- // Try next placement and re-run the lifecycle.
391
- return {
392
- data: {
393
- index: nextIndex,
394
- overflows: overflowsData
395
- },
396
- reset: {
397
- placement: nextPlacement
398
- }
399
- };
400
- }
401
-
402
- // First, find the candidates that fit on the mainAxis side of overflow,
403
- // then find the placement that fits the best on the main crossAxis side.
404
- let resetPlacement = (_overflowsData$filter = overflowsData.filter(d => d.overflows[0] <= 0).sort((a, b) => a.overflows[1] - b.overflows[1])[0]) == null ? void 0 : _overflowsData$filter.placement;
405
-
406
- // Otherwise fallback.
407
- if (!resetPlacement) {
408
- switch (fallbackStrategy) {
409
- case 'bestFit':
410
- {
411
- var _overflowsData$map$so;
412
- const placement = (_overflowsData$map$so = overflowsData.map(d => [d.placement, d.overflows.filter(overflow => overflow > 0).reduce((acc, overflow) => acc + overflow, 0)]).sort((a, b) => a[1] - b[1])[0]) == null ? void 0 : _overflowsData$map$so[0];
413
- if (placement) {
414
- resetPlacement = placement;
415
- }
416
- break;
417
- }
418
- case 'initialPlacement':
419
- resetPlacement = initialPlacement;
420
- break;
421
- }
422
- }
423
- if (placement !== resetPlacement) {
424
- return {
425
- reset: {
426
- placement: resetPlacement
427
- }
428
- };
429
- }
430
- }
431
- return {};
432
- }
433
- };
434
- };
435
-
436
- // For type backwards-compatibility, the `OffsetOptions` type was also
437
- // Derivable.
438
- async function convertValueToCoords(state, options) {
439
- const {
440
- placement,
441
- platform,
442
- elements
443
- } = state;
444
- const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));
445
- const side = getSide(placement);
446
- const alignment = getAlignment(placement);
447
- const isVertical = getSideAxis(placement) === 'y';
448
- const mainAxisMulti = ['left', 'top'].includes(side) ? -1 : 1;
449
- const crossAxisMulti = rtl && isVertical ? -1 : 1;
450
- const rawValue = evaluate(options, state);
451
-
452
- // eslint-disable-next-line prefer-const
453
- let {
454
- mainAxis,
455
- crossAxis,
456
- alignmentAxis
457
- } = typeof rawValue === 'number' ? {
458
- mainAxis: rawValue,
459
- crossAxis: 0,
460
- alignmentAxis: null
461
- } : {
462
- mainAxis: 0,
463
- crossAxis: 0,
464
- alignmentAxis: null,
465
- ...rawValue
466
- };
467
- if (alignment && typeof alignmentAxis === 'number') {
468
- crossAxis = alignment === 'end' ? alignmentAxis * -1 : alignmentAxis;
469
- }
470
- return isVertical ? {
471
- x: crossAxis * crossAxisMulti,
472
- y: mainAxis * mainAxisMulti
473
- } : {
474
- x: mainAxis * mainAxisMulti,
475
- y: crossAxis * crossAxisMulti
476
- };
477
- }
478
-
479
- /**
480
- * Modifies the placement by translating the floating element along the
481
- * specified axes.
482
- * A number (shorthand for `mainAxis` or distance), or an axes configuration
483
- * object may be passed.
484
- * @see https://floating-ui.com/docs/offset
485
- */
486
- const offset = function (options) {
487
- if (options === void 0) {
488
- options = 0;
489
- }
490
- return {
491
- name: 'offset',
492
- options,
493
- async fn(state) {
494
- var _middlewareData$offse, _middlewareData$arrow;
495
- const {
496
- x,
497
- y,
498
- placement,
499
- middlewareData
500
- } = state;
501
- const diffCoords = await convertValueToCoords(state, options);
502
-
503
- // If the placement is the same and the arrow caused an alignment offset
504
- // then we don't need to change the positioning coordinates.
505
- if (placement === ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse.placement) && (_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {
506
- return {};
507
- }
508
- return {
509
- x: x + diffCoords.x,
510
- y: y + diffCoords.y,
511
- data: {
512
- ...diffCoords,
513
- placement
514
- }
515
- };
516
- }
517
- };
518
- };
519
-
520
- /**
521
- * Custom positioning reference element.
522
- * @see https://floating-ui.com/docs/virtual-elements
523
- */
524
-
525
- const min = Math.min;
526
- const max = Math.max;
527
- const round = Math.round;
528
- const createCoords = v => ({
529
- x: v,
530
- y: v
531
- });
532
-
533
- function getNodeName(node) {
534
- if (isNode(node)) {
535
- return (node.nodeName || '').toLowerCase();
536
- }
537
- // Mocked nodes in testing environments may not be instances of Node. By
538
- // returning `#document` an infinite loop won't occur.
539
- // https://github.com/floating-ui/floating-ui/issues/2317
540
- return '#document';
541
- }
542
- function getWindow(node) {
543
- var _node$ownerDocument;
544
- return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window;
545
- }
546
- function getDocumentElement(node) {
547
- var _ref;
548
- return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement;
549
- }
550
- function isNode(value) {
551
- return value instanceof Node || value instanceof getWindow(value).Node;
552
- }
553
- function isElement(value) {
554
- return value instanceof Element || value instanceof getWindow(value).Element;
555
- }
556
- function isHTMLElement(value) {
557
- return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement;
558
- }
559
- function isShadowRoot(value) {
560
- // Browsers without `ShadowRoot` support.
561
- if (typeof ShadowRoot === 'undefined') {
562
- return false;
563
- }
564
- return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot;
565
- }
566
- function isOverflowElement(element) {
567
- const {
568
- overflow,
569
- overflowX,
570
- overflowY,
571
- display
572
- } = getComputedStyle$1(element);
573
- return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !['inline', 'contents'].includes(display);
574
- }
575
- function isTableElement(element) {
576
- return ['table', 'td', 'th'].includes(getNodeName(element));
577
- }
578
- function isContainingBlock(element) {
579
- const webkit = isWebKit();
580
- const css = getComputedStyle$1(element);
581
-
582
- // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
583
- return css.transform !== 'none' || css.perspective !== 'none' || (css.containerType ? css.containerType !== 'normal' : false) || !webkit && (css.backdropFilter ? css.backdropFilter !== 'none' : false) || !webkit && (css.filter ? css.filter !== 'none' : false) || ['transform', 'perspective', 'filter'].some(value => (css.willChange || '').includes(value)) || ['paint', 'layout', 'strict', 'content'].some(value => (css.contain || '').includes(value));
584
- }
585
- function getContainingBlock(element) {
586
- let currentNode = getParentNode(element);
587
- while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) {
588
- if (isContainingBlock(currentNode)) {
589
- return currentNode;
590
- } else {
591
- currentNode = getParentNode(currentNode);
592
- }
593
- }
594
- return null;
595
- }
596
- function isWebKit() {
597
- if (typeof CSS === 'undefined' || !CSS.supports) return false;
598
- return CSS.supports('-webkit-backdrop-filter', 'none');
599
- }
600
- function isLastTraversableNode(node) {
601
- return ['html', 'body', '#document'].includes(getNodeName(node));
602
- }
603
- function getComputedStyle$1(element) {
604
- return getWindow(element).getComputedStyle(element);
605
- }
606
- function getNodeScroll(element) {
607
- if (isElement(element)) {
608
- return {
609
- scrollLeft: element.scrollLeft,
610
- scrollTop: element.scrollTop
611
- };
612
- }
613
- return {
614
- scrollLeft: element.pageXOffset,
615
- scrollTop: element.pageYOffset
616
- };
617
- }
618
- function getParentNode(node) {
619
- if (getNodeName(node) === 'html') {
620
- return node;
621
- }
622
- const result =
623
- // Step into the shadow DOM of the parent of a slotted node.
624
- node.assignedSlot ||
625
- // DOM Element detected.
626
- node.parentNode ||
627
- // ShadowRoot detected.
628
- isShadowRoot(node) && node.host ||
629
- // Fallback.
630
- getDocumentElement(node);
631
- return isShadowRoot(result) ? result.host : result;
632
- }
633
- function getNearestOverflowAncestor(node) {
634
- const parentNode = getParentNode(node);
635
- if (isLastTraversableNode(parentNode)) {
636
- return node.ownerDocument ? node.ownerDocument.body : node.body;
637
- }
638
- if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) {
639
- return parentNode;
640
- }
641
- return getNearestOverflowAncestor(parentNode);
642
- }
643
- function getOverflowAncestors(node, list, traverseIframes) {
644
- var _node$ownerDocument2;
645
- if (list === void 0) {
646
- list = [];
647
- }
648
- if (traverseIframes === void 0) {
649
- traverseIframes = true;
650
- }
651
- const scrollableAncestor = getNearestOverflowAncestor(node);
652
- const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body);
653
- const win = getWindow(scrollableAncestor);
654
- if (isBody) {
655
- return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], win.frameElement && traverseIframes ? getOverflowAncestors(win.frameElement) : []);
656
- }
657
- return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));
658
- }
659
-
660
- function getCssDimensions(element) {
661
- const css = getComputedStyle$1(element);
662
- // In testing environments, the `width` and `height` properties are empty
663
- // strings for SVG elements, returning NaN. Fallback to `0` in this case.
664
- let width = parseFloat(css.width) || 0;
665
- let height = parseFloat(css.height) || 0;
666
- const hasOffset = isHTMLElement(element);
667
- const offsetWidth = hasOffset ? element.offsetWidth : width;
668
- const offsetHeight = hasOffset ? element.offsetHeight : height;
669
- const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight;
670
- if (shouldFallback) {
671
- width = offsetWidth;
672
- height = offsetHeight;
673
- }
674
- return {
675
- width,
676
- height,
677
- $: shouldFallback
678
- };
679
- }
680
-
681
- function unwrapElement(element) {
682
- return !isElement(element) ? element.contextElement : element;
683
- }
684
-
685
- function getScale(element) {
686
- const domElement = unwrapElement(element);
687
- if (!isHTMLElement(domElement)) {
688
- return createCoords(1);
689
- }
690
- const rect = domElement.getBoundingClientRect();
691
- const {
692
- width,
693
- height,
694
- $
695
- } = getCssDimensions(domElement);
696
- let x = ($ ? round(rect.width) : rect.width) / width;
697
- let y = ($ ? round(rect.height) : rect.height) / height;
698
-
699
- // 0, NaN, or Infinity should always fallback to 1.
700
-
701
- if (!x || !Number.isFinite(x)) {
702
- x = 1;
703
- }
704
- if (!y || !Number.isFinite(y)) {
705
- y = 1;
706
- }
707
- return {
708
- x,
709
- y
710
- };
711
- }
712
-
713
- const noOffsets = /*#__PURE__*/createCoords(0);
714
- function getVisualOffsets(element) {
715
- const win = getWindow(element);
716
- if (!isWebKit() || !win.visualViewport) {
717
- return noOffsets;
718
- }
719
- return {
720
- x: win.visualViewport.offsetLeft,
721
- y: win.visualViewport.offsetTop
722
- };
723
- }
724
- function shouldAddVisualOffsets(element, isFixed, floatingOffsetParent) {
725
- if (isFixed === void 0) {
726
- isFixed = false;
727
- }
728
- if (!floatingOffsetParent || isFixed && floatingOffsetParent !== getWindow(element)) {
729
- return false;
730
- }
731
- return isFixed;
732
- }
733
-
734
- function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) {
735
- if (includeScale === void 0) {
736
- includeScale = false;
737
- }
738
- if (isFixedStrategy === void 0) {
739
- isFixedStrategy = false;
740
- }
741
- const clientRect = element.getBoundingClientRect();
742
- const domElement = unwrapElement(element);
743
- let scale = createCoords(1);
744
- if (includeScale) {
745
- if (offsetParent) {
746
- if (isElement(offsetParent)) {
747
- scale = getScale(offsetParent);
748
- }
749
- } else {
750
- scale = getScale(element);
751
- }
752
- }
753
- const visualOffsets = shouldAddVisualOffsets(domElement, isFixedStrategy, offsetParent) ? getVisualOffsets(domElement) : createCoords(0);
754
- let x = (clientRect.left + visualOffsets.x) / scale.x;
755
- let y = (clientRect.top + visualOffsets.y) / scale.y;
756
- let width = clientRect.width / scale.x;
757
- let height = clientRect.height / scale.y;
758
- if (domElement) {
759
- const win = getWindow(domElement);
760
- const offsetWin = offsetParent && isElement(offsetParent) ? getWindow(offsetParent) : offsetParent;
761
- let currentWin = win;
762
- let currentIFrame = currentWin.frameElement;
763
- while (currentIFrame && offsetParent && offsetWin !== currentWin) {
764
- const iframeScale = getScale(currentIFrame);
765
- const iframeRect = currentIFrame.getBoundingClientRect();
766
- const css = getComputedStyle$1(currentIFrame);
767
- const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x;
768
- const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y;
769
- x *= iframeScale.x;
770
- y *= iframeScale.y;
771
- width *= iframeScale.x;
772
- height *= iframeScale.y;
773
- x += left;
774
- y += top;
775
- currentWin = getWindow(currentIFrame);
776
- currentIFrame = currentWin.frameElement;
777
- }
778
- }
779
- return rectToClientRect({
780
- width,
781
- height,
782
- x,
783
- y
784
- });
785
- }
786
-
787
- const topLayerSelectors = [':popover-open', ':modal'];
788
- function isTopLayer(floating) {
789
- return topLayerSelectors.some(selector => {
790
- try {
791
- return floating.matches(selector);
792
- } catch (e) {
793
- return false;
794
- }
795
- });
796
- }
797
-
798
- function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
799
- let {
800
- elements,
801
- rect,
802
- offsetParent,
803
- strategy
804
- } = _ref;
805
- const isFixed = strategy === 'fixed';
806
- const documentElement = getDocumentElement(offsetParent);
807
- const topLayer = elements ? isTopLayer(elements.floating) : false;
808
- if (offsetParent === documentElement || topLayer && isFixed) {
809
- return rect;
810
- }
811
- let scroll = {
812
- scrollLeft: 0,
813
- scrollTop: 0
814
- };
815
- let scale = createCoords(1);
816
- const offsets = createCoords(0);
817
- const isOffsetParentAnElement = isHTMLElement(offsetParent);
818
- if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
819
- if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {
820
- scroll = getNodeScroll(offsetParent);
821
- }
822
- if (isHTMLElement(offsetParent)) {
823
- const offsetRect = getBoundingClientRect(offsetParent);
824
- scale = getScale(offsetParent);
825
- offsets.x = offsetRect.x + offsetParent.clientLeft;
826
- offsets.y = offsetRect.y + offsetParent.clientTop;
827
- }
828
- }
829
- return {
830
- width: rect.width * scale.x,
831
- height: rect.height * scale.y,
832
- x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x,
833
- y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y
834
- };
835
- }
836
-
837
- function getClientRects(element) {
838
- return Array.from(element.getClientRects());
839
- }
840
-
841
- function getWindowScrollBarX(element) {
842
- // If <html> has a CSS width greater than the viewport, then this will be
843
- // incorrect for RTL.
844
- return getBoundingClientRect(getDocumentElement(element)).left + getNodeScroll(element).scrollLeft;
845
- }
846
-
847
- // Gets the entire size of the scrollable document area, even extending outside
848
- // of the `<html>` and `<body>` rect bounds if horizontally scrollable.
849
- function getDocumentRect(element) {
850
- const html = getDocumentElement(element);
851
- const scroll = getNodeScroll(element);
852
- const body = element.ownerDocument.body;
853
- const width = max(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth);
854
- const height = max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight);
855
- let x = -scroll.scrollLeft + getWindowScrollBarX(element);
856
- const y = -scroll.scrollTop;
857
- if (getComputedStyle$1(body).direction === 'rtl') {
858
- x += max(html.clientWidth, body.clientWidth) - width;
859
- }
860
- return {
861
- width,
862
- height,
863
- x,
864
- y
865
- };
866
- }
867
-
868
- function getViewportRect(element, strategy) {
869
- const win = getWindow(element);
870
- const html = getDocumentElement(element);
871
- const visualViewport = win.visualViewport;
872
- let width = html.clientWidth;
873
- let height = html.clientHeight;
874
- let x = 0;
875
- let y = 0;
876
- if (visualViewport) {
877
- width = visualViewport.width;
878
- height = visualViewport.height;
879
- const visualViewportBased = isWebKit();
880
- if (!visualViewportBased || visualViewportBased && strategy === 'fixed') {
881
- x = visualViewport.offsetLeft;
882
- y = visualViewport.offsetTop;
883
- }
884
- }
885
- return {
886
- width,
887
- height,
888
- x,
889
- y
890
- };
891
- }
892
-
893
- // Returns the inner client rect, subtracting scrollbars if present.
894
- function getInnerBoundingClientRect(element, strategy) {
895
- const clientRect = getBoundingClientRect(element, true, strategy === 'fixed');
896
- const top = clientRect.top + element.clientTop;
897
- const left = clientRect.left + element.clientLeft;
898
- const scale = isHTMLElement(element) ? getScale(element) : createCoords(1);
899
- const width = element.clientWidth * scale.x;
900
- const height = element.clientHeight * scale.y;
901
- const x = left * scale.x;
902
- const y = top * scale.y;
903
- return {
904
- width,
905
- height,
906
- x,
907
- y
908
- };
909
- }
910
- function getClientRectFromClippingAncestor(element, clippingAncestor, strategy) {
911
- let rect;
912
- if (clippingAncestor === 'viewport') {
913
- rect = getViewportRect(element, strategy);
914
- } else if (clippingAncestor === 'document') {
915
- rect = getDocumentRect(getDocumentElement(element));
916
- } else if (isElement(clippingAncestor)) {
917
- rect = getInnerBoundingClientRect(clippingAncestor, strategy);
918
- } else {
919
- const visualOffsets = getVisualOffsets(element);
920
- rect = {
921
- ...clippingAncestor,
922
- x: clippingAncestor.x - visualOffsets.x,
923
- y: clippingAncestor.y - visualOffsets.y
924
- };
925
- }
926
- return rectToClientRect(rect);
927
- }
928
- function hasFixedPositionAncestor(element, stopNode) {
929
- const parentNode = getParentNode(element);
930
- if (parentNode === stopNode || !isElement(parentNode) || isLastTraversableNode(parentNode)) {
931
- return false;
932
- }
933
- return getComputedStyle$1(parentNode).position === 'fixed' || hasFixedPositionAncestor(parentNode, stopNode);
934
- }
935
-
936
- // A "clipping ancestor" is an `overflow` element with the characteristic of
937
- // clipping (or hiding) child elements. This returns all clipping ancestors
938
- // of the given element up the tree.
939
- function getClippingElementAncestors(element, cache) {
940
- const cachedResult = cache.get(element);
941
- if (cachedResult) {
942
- return cachedResult;
943
- }
944
- let result = getOverflowAncestors(element, [], false).filter(el => isElement(el) && getNodeName(el) !== 'body');
945
- let currentContainingBlockComputedStyle = null;
946
- const elementIsFixed = getComputedStyle$1(element).position === 'fixed';
947
- let currentNode = elementIsFixed ? getParentNode(element) : element;
948
-
949
- // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
950
- while (isElement(currentNode) && !isLastTraversableNode(currentNode)) {
951
- const computedStyle = getComputedStyle$1(currentNode);
952
- const currentNodeIsContaining = isContainingBlock(currentNode);
953
- if (!currentNodeIsContaining && computedStyle.position === 'fixed') {
954
- currentContainingBlockComputedStyle = null;
955
- }
956
- const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === 'static' && !!currentContainingBlockComputedStyle && ['absolute', 'fixed'].includes(currentContainingBlockComputedStyle.position) || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode);
957
- if (shouldDropCurrentNode) {
958
- // Drop non-containing blocks.
959
- result = result.filter(ancestor => ancestor !== currentNode);
960
- } else {
961
- // Record last containing block for next iteration.
962
- currentContainingBlockComputedStyle = computedStyle;
963
- }
964
- currentNode = getParentNode(currentNode);
965
- }
966
- cache.set(element, result);
967
- return result;
968
- }
969
-
970
- // Gets the maximum area that the element is visible in due to any number of
971
- // clipping ancestors.
972
- function getClippingRect(_ref) {
973
- let {
974
- element,
975
- boundary,
976
- rootBoundary,
977
- strategy
978
- } = _ref;
979
- const elementClippingAncestors = boundary === 'clippingAncestors' ? getClippingElementAncestors(element, this._c) : [].concat(boundary);
980
- const clippingAncestors = [...elementClippingAncestors, rootBoundary];
981
- const firstClippingAncestor = clippingAncestors[0];
982
- const clippingRect = clippingAncestors.reduce((accRect, clippingAncestor) => {
983
- const rect = getClientRectFromClippingAncestor(element, clippingAncestor, strategy);
984
- accRect.top = max(rect.top, accRect.top);
985
- accRect.right = min(rect.right, accRect.right);
986
- accRect.bottom = min(rect.bottom, accRect.bottom);
987
- accRect.left = max(rect.left, accRect.left);
988
- return accRect;
989
- }, getClientRectFromClippingAncestor(element, firstClippingAncestor, strategy));
990
- return {
991
- width: clippingRect.right - clippingRect.left,
992
- height: clippingRect.bottom - clippingRect.top,
993
- x: clippingRect.left,
994
- y: clippingRect.top
995
- };
996
- }
997
-
998
- function getDimensions(element) {
999
- const {
1000
- width,
1001
- height
1002
- } = getCssDimensions(element);
1003
- return {
1004
- width,
1005
- height
1006
- };
1007
- }
1008
-
1009
- function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
1010
- const isOffsetParentAnElement = isHTMLElement(offsetParent);
1011
- const documentElement = getDocumentElement(offsetParent);
1012
- const isFixed = strategy === 'fixed';
1013
- const rect = getBoundingClientRect(element, true, isFixed, offsetParent);
1014
- let scroll = {
1015
- scrollLeft: 0,
1016
- scrollTop: 0
1017
- };
1018
- const offsets = createCoords(0);
1019
- if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
1020
- if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {
1021
- scroll = getNodeScroll(offsetParent);
1022
- }
1023
- if (isOffsetParentAnElement) {
1024
- const offsetRect = getBoundingClientRect(offsetParent, true, isFixed, offsetParent);
1025
- offsets.x = offsetRect.x + offsetParent.clientLeft;
1026
- offsets.y = offsetRect.y + offsetParent.clientTop;
1027
- } else if (documentElement) {
1028
- offsets.x = getWindowScrollBarX(documentElement);
1029
- }
1030
- }
1031
- const x = rect.left + scroll.scrollLeft - offsets.x;
1032
- const y = rect.top + scroll.scrollTop - offsets.y;
1033
- return {
1034
- x,
1035
- y,
1036
- width: rect.width,
1037
- height: rect.height
1038
- };
1039
- }
1040
-
1041
- function getTrueOffsetParent(element, polyfill) {
1042
- if (!isHTMLElement(element) || getComputedStyle$1(element).position === 'fixed') {
1043
- return null;
1044
- }
1045
- if (polyfill) {
1046
- return polyfill(element);
1047
- }
1048
- return element.offsetParent;
1049
- }
1050
-
1051
- // Gets the closest ancestor positioned element. Handles some edge cases,
1052
- // such as table ancestors and cross browser bugs.
1053
- function getOffsetParent(element, polyfill) {
1054
- const window = getWindow(element);
1055
- if (!isHTMLElement(element) || isTopLayer(element)) {
1056
- return window;
1057
- }
1058
- let offsetParent = getTrueOffsetParent(element, polyfill);
1059
- while (offsetParent && isTableElement(offsetParent) && getComputedStyle$1(offsetParent).position === 'static') {
1060
- offsetParent = getTrueOffsetParent(offsetParent, polyfill);
1061
- }
1062
- if (offsetParent && (getNodeName(offsetParent) === 'html' || getNodeName(offsetParent) === 'body' && getComputedStyle$1(offsetParent).position === 'static' && !isContainingBlock(offsetParent))) {
1063
- return window;
1064
- }
1065
- return offsetParent || getContainingBlock(element) || window;
1066
- }
1067
-
1068
- const getElementRects = async function (data) {
1069
- const getOffsetParentFn = this.getOffsetParent || getOffsetParent;
1070
- const getDimensionsFn = this.getDimensions;
1071
- return {
1072
- reference: getRectRelativeToOffsetParent(data.reference, await getOffsetParentFn(data.floating), data.strategy),
1073
- floating: {
1074
- x: 0,
1075
- y: 0,
1076
- ...(await getDimensionsFn(data.floating))
1077
- }
1078
- };
1079
- };
1080
-
1081
- function isRTL(element) {
1082
- return getComputedStyle$1(element).direction === 'rtl';
1083
- }
1084
-
1085
- const platform = {
1086
- convertOffsetParentRelativeRectToViewportRelativeRect,
1087
- getDocumentElement,
1088
- getClippingRect,
1089
- getOffsetParent,
1090
- getElementRects,
1091
- getClientRects,
1092
- getDimensions,
1093
- getScale,
1094
- isElement,
1095
- isRTL
1096
- };
1097
-
1098
- /**
1099
- * Optimizes the visibility of the floating element by flipping the `placement`
1100
- * in order to keep it in view when the preferred placement(s) will overflow the
1101
- * clipping boundary. Alternative to `autoPlacement`.
1102
- * @see https://floating-ui.com/docs/flip
1103
- */
1104
- const flip = flip$1;
1105
-
1106
- /**
1107
- * Computes the `x` and `y` coordinates that will place the floating element
1108
- * next to a given reference element.
1109
- */
1110
- const computePosition = (reference, floating, options) => {
1111
- // This caches the expensive `getClippingElementAncestors` function so that
1112
- // multiple lifecycle resets re-use the same result. It only lives for a
1113
- // single call. If other functions become expensive, we can add them as well.
1114
- const cache = new Map();
1115
- const mergedOptions = {
1116
- platform,
1117
- ...options
1118
- };
1119
- const platformWithCache = {
1120
- ...mergedOptions.platform,
1121
- _c: cache
1122
- };
1123
- return computePosition$1(reference, floating, {
1124
- ...mergedOptions,
1125
- platform: platformWithCache
1126
- });
1127
- };
1128
-
1129
- function t(t){return r(t)}function o(t){return t.assignedSlot?t.assignedSlot:t.parentNode instanceof ShadowRoot?t.parentNode.host:t.parentNode}function r(t){for(let e=t;e;e=o(e))if(e instanceof Element&&"none"===getComputedStyle(e).display)return null;for(let e=o(t);e;e=o(e)){if(!(e instanceof Element))continue;const t=getComputedStyle(e);if("contents"!==t.display){if("static"!==t.position||"none"!==t.filter)return e;if("BODY"===e.tagName)return e}}return null}
1130
-
1131
- export { computePosition as c, flip as f, offset as o, platform as p, t };
1132
- //# sourceMappingURL=composed-offset-position.browser.min-Tnm31e-m.js.map