@jackuait/blok 0.10.2 → 0.10.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/blok.mjs +2 -2
- package/dist/chunks/{blok-D-T1XZ92.mjs → blok-NcdNQ0I6.mjs} +2304 -2101
- package/dist/chunks/{constants-CaB-mlB5.mjs → constants-DtfShkXT.mjs} +414 -317
- package/dist/chunks/{i18next-loader-CDnSPae_.mjs → i18next-loader-D32EUWLr.mjs} +1 -1
- package/dist/chunks/{lightweight-i18n-DZmo8dAI.mjs → lightweight-i18n-DpkvRXEd.mjs} +19 -0
- package/dist/{messages-Ddq3Ce3E2.mjs → chunks/messages-AD17iDBx.mjs} +18 -0
- package/dist/{messages-neGD3WGq.mjs → chunks/messages-B03yUEra2.mjs} +18 -0
- package/dist/chunks/{messages-CIfUm1Oa.mjs → messages-B2dU00Z3.mjs} +18 -0
- package/dist/chunks/{messages-BKN3YVIj.mjs → messages-B8hICx3L.mjs} +18 -0
- package/dist/{messages-Dnd5YSWv.mjs → chunks/messages-BBe45sPH.mjs} +18 -0
- package/dist/{messages-C7lJg8fy2.mjs → chunks/messages-BCifzMVO2.mjs} +18 -0
- package/dist/chunks/{messages-D7dx_6k8.mjs → messages-BGmvvtg_.mjs} +18 -0
- package/dist/{messages-Q5sQeVap2.mjs → chunks/messages-BJNFCDv42.mjs} +18 -0
- package/dist/chunks/{messages-BlxwW7M6.mjs → messages-BNy4e7Xl.mjs} +18 -0
- package/dist/chunks/{messages-C15z2r5U.mjs → messages-BcHZf9o-.mjs} +18 -0
- package/dist/{messages-A96tMxeU.mjs → chunks/messages-BjyYZeBm2.mjs} +18 -0
- package/dist/{messages-BbJ7ZXY8.mjs → chunks/messages-Bop7vrhU.mjs} +18 -0
- package/dist/{messages-BiTMwiKH.mjs → chunks/messages-BouFtpfO.mjs} +18 -0
- package/dist/chunks/{messages-ElIGUi0O2.mjs → messages-Br6bE1FD2.mjs} +18 -0
- package/dist/chunks/{messages-BHMiK51R.mjs → messages-C-EBhOHE.mjs} +18 -0
- package/dist/chunks/{messages-kGmxkeFH.mjs → messages-C3X7dv3f.mjs} +18 -0
- package/dist/chunks/{messages-4Ck88DYZ2.mjs → messages-C7Pjof0d2.mjs} +18 -0
- package/dist/{messages-D0lLw9KM.mjs → chunks/messages-C7sBaZOO2.mjs} +18 -0
- package/dist/chunks/{messages-QMOmwcZb.mjs → messages-C85zv_7x.mjs} +18 -0
- package/dist/chunks/{messages-DSrdy9Nw2.mjs → messages-CCEgR9GN2.mjs} +18 -0
- package/dist/chunks/{messages-DUr9WAkD.mjs → messages-CDSyoUft.mjs} +18 -0
- package/dist/{messages-bkGniiaz.mjs → chunks/messages-CGFlOwst.mjs} +18 -0
- package/dist/chunks/{messages-DBMaLL8b2.mjs → messages-CGLTjtRv2.mjs} +18 -0
- package/dist/{messages-2ZWBTerL.mjs → chunks/messages-CGPxUESo.mjs} +18 -0
- package/dist/chunks/{messages-BfAcUavP.mjs → messages-CNaaqQVz.mjs} +18 -0
- package/dist/{messages-DBhvm8NK.mjs → chunks/messages-CPFB2_m-2.mjs} +18 -0
- package/dist/chunks/{messages-zt6zdYWh.mjs → messages-CTdSIOAc.mjs} +18 -0
- package/dist/chunks/{messages-1_6UkKLS.mjs → messages-CXVWb9js.mjs} +18 -0
- package/dist/{messages-CdEASHDp2.mjs → chunks/messages-Cfbmwdep2.mjs} +18 -0
- package/dist/chunks/{messages-DxHh0O8j2.mjs → messages-ChayV9WY2.mjs} +18 -0
- package/dist/chunks/{messages-BgM91Lxm2.mjs → messages-Ci7UXRVI2.mjs} +18 -0
- package/dist/chunks/{messages-Clku7Cf-2.mjs → messages-CpXvyGWv2.mjs} +18 -0
- package/dist/chunks/{messages-DjvaiALg2.mjs → messages-Cql2ozf_2.mjs} +18 -0
- package/dist/{messages-DODrhcop.mjs → chunks/messages-Cxy_E2IS.mjs} +18 -0
- package/dist/chunks/{messages-CZSlfnkO2.mjs → messages-D9syZVGi2.mjs} +18 -0
- package/dist/chunks/{messages-BRAoJpOu.mjs → messages-D9uWAWjW.mjs} +18 -0
- package/dist/chunks/{messages-BK8Cp2d0.mjs → messages-DRJxSTqs.mjs} +18 -0
- package/dist/{messages-C_Qn9SbQ.mjs → chunks/messages-DSbI0vJf.mjs} +18 -0
- package/dist/chunks/{messages-CD_MnBln.mjs → messages-DVvrZRyZ.mjs} +18 -0
- package/dist/{messages-BE_z-zrb.mjs → chunks/messages-DY8zPIZW.mjs} +18 -0
- package/dist/chunks/{messages-Bz0-KNEB.mjs → messages-D_kZN9rB.mjs} +18 -0
- package/dist/{messages-C1vc5584.mjs → chunks/messages-DjSuq0-y2.mjs} +18 -0
- package/dist/chunks/{messages-DPzHD51Y.mjs → messages-DkP3Jf4F.mjs} +18 -0
- package/dist/{messages-_PLyRfVw.mjs → chunks/messages-DoPdy75l.mjs} +18 -0
- package/dist/chunks/{messages-JSQjKQ8I.mjs → messages-DpydMd36.mjs} +18 -0
- package/dist/{messages-BckDk9aq2.mjs → chunks/messages-DtZ9U9g72.mjs} +18 -0
- package/dist/{messages-JNrYldAa2.mjs → chunks/messages-H6vLy8wJ.mjs} +18 -0
- package/dist/chunks/{messages-DTN1XGll.mjs → messages-HzH9_QH8.mjs} +18 -0
- package/dist/chunks/{messages-C0IFfhnp.mjs → messages-O6FOfUgF.mjs} +18 -0
- package/dist/{messages-Be_2RHZD.mjs → chunks/messages-OSP4Hj5o.mjs} +18 -0
- package/dist/chunks/{messages-DMoERagV2.mjs → messages-RiqdVwuN2.mjs} +18 -0
- package/dist/chunks/{messages-BJ-vT1SU2.mjs → messages-SP659Sal2.mjs} +18 -0
- package/dist/{messages-Che99vKP.mjs → chunks/messages-THR8q8bJ.mjs} +18 -0
- package/dist/chunks/{messages-CvANwuht2.mjs → messages-VlEyFUxF2.mjs} +18 -0
- package/dist/{messages-apA6BStA.mjs → chunks/messages-VtfKWZ2S.mjs} +18 -0
- package/dist/{messages-DpJGbx3q.mjs → chunks/messages-YbckahVx2.mjs} +18 -0
- package/dist/{messages-DYuD5-rO.mjs → chunks/messages-ZhHLC6dk.mjs} +18 -0
- package/dist/{messages-C0GSBBCo2.mjs → chunks/messages-bFEdH3lv.mjs} +18 -0
- package/dist/chunks/{messages-euM2m3wQ.mjs → messages-dpXwA3Sz.mjs} +18 -0
- package/dist/chunks/{messages-CQBo3lmL2.mjs → messages-fbL5y58u2.mjs} +18 -0
- package/dist/chunks/{messages-CxiURE2X.mjs → messages-oPV2oMxM.mjs} +18 -0
- package/dist/{messages-DM4Gjc9h.mjs → chunks/messages-oXBbHW9A.mjs} +18 -0
- package/dist/chunks/{messages-QilfinOn2.mjs → messages-vDgsEqQW2.mjs} +18 -0
- package/dist/{messages-ClGvlFcH2.mjs → chunks/messages-wYQksm10.mjs} +18 -0
- package/dist/{messages-CnuH-BZK2.mjs → chunks/messages-yGedmr61.mjs} +18 -0
- package/dist/chunks/{messages-sDdNf8O9.mjs → messages-zQOpKjl3.mjs} +18 -0
- package/dist/chunks/{messages-eFd4YYzt.mjs → messages-zWqsggJh.mjs} +18 -0
- package/dist/chunks/{tools-BFK2MvVI.mjs → tools-DMSi-3RW.mjs} +3434 -1240
- package/dist/full.mjs +10 -10
- package/dist/locales.mjs +86 -67
- package/dist/{messages-BK_LsgY4.mjs → messages-0lOPMv8u.mjs} +18 -0
- package/dist/{messages-LYJbLq_F.mjs → messages-5wuR90qS.mjs} +18 -0
- package/dist/{messages-98nQiC7t2.mjs → messages-6eX0fWGR2.mjs} +18 -0
- package/dist/{chunks/messages-DUeiPraX.mjs → messages-9L4qqCKh2.mjs} +18 -0
- package/dist/{chunks/messages-Q7-4ZJLB2.mjs → messages-B4zPxKl62.mjs} +18 -0
- package/dist/{messages-D0005ti32.mjs → messages-BCMFYqKc2.mjs} +18 -0
- package/dist/{chunks/messages-CC_noR8y.mjs → messages-BKXjO3NH.mjs} +18 -0
- package/dist/{messages-CRNogopy2.mjs → messages-BLW2GX7J2.mjs} +18 -0
- package/dist/{messages-D81w6AmW.mjs → messages-BLfK27kX.mjs} +18 -0
- package/dist/{chunks/messages-CPBN4zWc.mjs → messages-BM2kx9Td.mjs} +18 -0
- package/dist/{messages-E8NjqzWq2.mjs → messages-BORkMoil2.mjs} +18 -0
- package/dist/{messages-Dqu4aX9s.mjs → messages-BPw_x-6H.mjs} +18 -0
- package/dist/{messages-DSmxJWju2.mjs → messages-BRY51SEw2.mjs} +18 -0
- package/dist/{chunks/messages-BONyZroH.mjs → messages-BSNsrZVN.mjs} +18 -0
- package/dist/{chunks/messages-BAlZjPcl.mjs → messages-B_UKuqrH.mjs} +18 -0
- package/dist/{chunks/messages-DB_-5Xln.mjs → messages-BrYeJsSE2.mjs} +18 -0
- package/dist/{messages-Brd5R-da2.mjs → messages-BwttyHDI2.mjs} +18 -0
- package/dist/{messages-qfvXgPpu2.mjs → messages-C-8qb9sf2.mjs} +18 -0
- package/dist/{chunks/messages-BbEW9bQz.mjs → messages-C34dTwF72.mjs} +18 -0
- package/dist/{messages-BmH2cQHQ.mjs → messages-C67YUZ9-.mjs} +18 -0
- package/dist/{messages-DpwMKDV0.mjs → messages-C6yKu_PJ.mjs} +18 -0
- package/dist/{messages-Do7Xjy0n.mjs → messages-CA6J_QoC.mjs} +18 -0
- package/dist/{messages-DVL0KZE5.mjs → messages-CFUBJfnf.mjs} +18 -0
- package/dist/{chunks/messages-DVr1sqfI2.mjs → messages-CLUBh7O_.mjs} +18 -0
- package/dist/{chunks/messages-wl8YrvGG.mjs → messages-CLZoy5fQ.mjs} +18 -0
- package/dist/{messages-CisR4PNV.mjs → messages-CNGwdIEz.mjs} +18 -0
- package/dist/{messages-DopaMHC42.mjs → messages-CR4gHjd82.mjs} +18 -0
- package/dist/{messages-DK6dA0O2.mjs → messages-CVMngZNA.mjs} +18 -0
- package/dist/{messages-Xc0KUbYl.mjs → messages-Cd5CW5Tt.mjs} +18 -0
- package/dist/{chunks/messages-ChK7v1PV.mjs → messages-CrjQ2Op0.mjs} +18 -0
- package/dist/{chunks/messages-CRF7nNrO.mjs → messages-Cv1PSaNk.mjs} +18 -0
- package/dist/{messages-DOGbHYv-2.mjs → messages-CxZarWTm2.mjs} +18 -0
- package/dist/{messages-D3rwCtKn.mjs → messages-D0eT_eWA.mjs} +18 -0
- package/dist/{messages-C6ONf71u2.mjs → messages-D6RYu9JW2.mjs} +18 -0
- package/dist/{messages-DQORja0D.mjs → messages-D8U5D391.mjs} +18 -0
- package/dist/{chunks/messages-EDMC5ukV.mjs → messages-D8dO6OMN.mjs} +18 -0
- package/dist/{messages-DfFZ6Yj5.mjs → messages-DA4T9WBe.mjs} +18 -0
- package/dist/{chunks/messages-D22e9h7V2.mjs → messages-DB4UKN8D.mjs} +18 -0
- package/dist/{chunks/messages-DEBy3nuJ2.mjs → messages-DCdP2ujL.mjs} +18 -0
- package/dist/{messages-D05jqBIa2.mjs → messages-DPFuzIdF2.mjs} +18 -0
- package/dist/{chunks/messages-DrfRYiM32.mjs → messages-DQ1icG7L.mjs} +18 -0
- package/dist/{chunks/messages-a07QVz8U.mjs → messages-DT7dwzEe.mjs} +18 -0
- package/dist/{chunks/messages-CszmHAvQ.mjs → messages-DUYxMxrQ2.mjs} +18 -0
- package/dist/{chunks/messages-DtoId_bw2.mjs → messages-D_V0kHD7.mjs} +18 -0
- package/dist/{messages-BesJaI6A.mjs → messages-DfqM_XvD.mjs} +18 -0
- package/dist/{messages-CT-Kdas6.mjs → messages-Di3-WVzq.mjs} +18 -0
- package/dist/{messages-BcVB3osF.mjs → messages-Dl0bfeA-.mjs} +18 -0
- package/dist/{chunks/messages-C1S9ztpF.mjs → messages-Do3mHd9U.mjs} +18 -0
- package/dist/{chunks/messages-BeGZqQwz.mjs → messages-DqDlcEPn.mjs} +18 -0
- package/dist/{chunks/messages-CTCe595D2.mjs → messages-DwiykEgr2.mjs} +18 -0
- package/dist/{chunks/messages-8Ld7P_9j2.mjs → messages-Dx5n6MLQ2.mjs} +18 -0
- package/dist/{messages-LMaR2_bE.mjs → messages-DxEiqa-B.mjs} +18 -0
- package/dist/{chunks/messages-CxxyR4vY.mjs → messages-Dxr1BBvo.mjs} +18 -0
- package/dist/{messages-D6VIFnSW.mjs → messages-DzknMM7W.mjs} +18 -0
- package/dist/{chunks/messages-oMc7qugU2.mjs → messages-ELvF3qMl2.mjs} +18 -0
- package/dist/{messages-53w0fPZS2.mjs → messages-JVJdC0Er2.mjs} +18 -0
- package/dist/{chunks/messages-BMD37y3q2.mjs → messages-KVerxvZC.mjs} +18 -0
- package/dist/{chunks/messages-Du2BffA7.mjs → messages-OOiDDmVw.mjs} +18 -0
- package/dist/{messages-uwK7ktqk.mjs → messages-PyOr_YgV.mjs} +18 -0
- package/dist/{messages-qbKjjvgd2.mjs → messages-VrQw3tQ62.mjs} +18 -0
- package/dist/{messages-CTTmWn4Y2.mjs → messages-WsUHzXMu2.mjs} +18 -0
- package/dist/{messages-CZbcxlZt2.mjs → messages-ZHgPRUj02.mjs} +18 -0
- package/dist/{messages-DKHbt-7l2.mjs → messages-aoO_TtoE2.mjs} +18 -0
- package/dist/{chunks/messages-CW35K1pq.mjs → messages-bh8BiOee2.mjs} +18 -0
- package/dist/{messages-BrOWqNCu2.mjs → messages-gZEhkRrR2.mjs} +18 -0
- package/dist/{chunks/messages-BRoa9tGl.mjs → messages-hya8YLMj.mjs} +18 -0
- package/dist/{messages-CdduYw-q.mjs → messages-tb1FD_ge.mjs} +18 -0
- package/dist/react.mjs +2 -2
- package/dist/tools.mjs +3 -3
- package/dist/vendor.LICENSE.txt +135 -0
- package/package.json +2 -1
- package/src/blok.ts +48 -0
- package/src/components/block/index.ts +21 -2
- package/src/components/block-tunes/block-tune-copy-link.ts +82 -0
- package/src/components/i18n/locales/am/messages.json +18 -0
- package/src/components/i18n/locales/ar/messages.json +18 -0
- package/src/components/i18n/locales/az/messages.json +18 -0
- package/src/components/i18n/locales/bg/messages.json +18 -0
- package/src/components/i18n/locales/bn/messages.json +18 -0
- package/src/components/i18n/locales/bs/messages.json +18 -0
- package/src/components/i18n/locales/cs/messages.json +18 -0
- package/src/components/i18n/locales/da/messages.json +18 -0
- package/src/components/i18n/locales/de/messages.json +18 -0
- package/src/components/i18n/locales/dv/messages.json +18 -0
- package/src/components/i18n/locales/el/messages.json +18 -0
- package/src/components/i18n/locales/en/messages.json +19 -0
- package/src/components/i18n/locales/es/messages.json +18 -0
- package/src/components/i18n/locales/et/messages.json +18 -0
- package/src/components/i18n/locales/fa/messages.json +18 -0
- package/src/components/i18n/locales/fi/messages.json +18 -0
- package/src/components/i18n/locales/fil/messages.json +18 -0
- package/src/components/i18n/locales/fr/messages.json +18 -0
- package/src/components/i18n/locales/gu/messages.json +18 -0
- package/src/components/i18n/locales/he/messages.json +18 -0
- package/src/components/i18n/locales/hi/messages.json +18 -0
- package/src/components/i18n/locales/hr/messages.json +18 -0
- package/src/components/i18n/locales/hu/messages.json +18 -0
- package/src/components/i18n/locales/hy/messages.json +18 -0
- package/src/components/i18n/locales/id/messages.json +18 -0
- package/src/components/i18n/locales/it/messages.json +18 -0
- package/src/components/i18n/locales/ja/messages.json +18 -0
- package/src/components/i18n/locales/ka/messages.json +18 -0
- package/src/components/i18n/locales/km/messages.json +18 -0
- package/src/components/i18n/locales/kn/messages.json +18 -0
- package/src/components/i18n/locales/ko/messages.json +18 -0
- package/src/components/i18n/locales/ku/messages.json +18 -0
- package/src/components/i18n/locales/lo/messages.json +18 -0
- package/src/components/i18n/locales/lt/messages.json +18 -0
- package/src/components/i18n/locales/lv/messages.json +18 -0
- package/src/components/i18n/locales/mk/messages.json +18 -0
- package/src/components/i18n/locales/ml/messages.json +18 -0
- package/src/components/i18n/locales/mn/messages.json +18 -0
- package/src/components/i18n/locales/mr/messages.json +18 -0
- package/src/components/i18n/locales/ms/messages.json +18 -0
- package/src/components/i18n/locales/my/messages.json +18 -0
- package/src/components/i18n/locales/ne/messages.json +18 -0
- package/src/components/i18n/locales/nl/messages.json +18 -0
- package/src/components/i18n/locales/no/messages.json +18 -0
- package/src/components/i18n/locales/pa/messages.json +18 -0
- package/src/components/i18n/locales/pl/messages.json +18 -0
- package/src/components/i18n/locales/ps/messages.json +18 -0
- package/src/components/i18n/locales/pt/messages.json +18 -0
- package/src/components/i18n/locales/ro/messages.json +18 -0
- package/src/components/i18n/locales/ru/messages.json +18 -0
- package/src/components/i18n/locales/sd/messages.json +18 -0
- package/src/components/i18n/locales/si/messages.json +18 -0
- package/src/components/i18n/locales/sk/messages.json +18 -0
- package/src/components/i18n/locales/sl/messages.json +18 -0
- package/src/components/i18n/locales/sq/messages.json +18 -0
- package/src/components/i18n/locales/sr/messages.json +18 -0
- package/src/components/i18n/locales/sv/messages.json +18 -0
- package/src/components/i18n/locales/sw/messages.json +18 -0
- package/src/components/i18n/locales/ta/messages.json +18 -0
- package/src/components/i18n/locales/te/messages.json +18 -0
- package/src/components/i18n/locales/th/messages.json +18 -0
- package/src/components/i18n/locales/tr/messages.json +18 -0
- package/src/components/i18n/locales/ug/messages.json +18 -0
- package/src/components/i18n/locales/uk/messages.json +18 -0
- package/src/components/i18n/locales/ur/messages.json +18 -0
- package/src/components/i18n/locales/vi/messages.json +18 -0
- package/src/components/i18n/locales/yi/messages.json +18 -0
- package/src/components/i18n/locales/zh/messages.json +18 -0
- package/src/components/icons/index.ts +65 -0
- package/src/components/inline-tools/inline-tool-bold.ts +10 -0
- package/src/components/inline-tools/inline-tool-code.ts +54 -1
- package/src/components/inline-tools/inline-tool-italic.ts +54 -1
- package/src/components/inline-tools/inline-tool-strikethrough.ts +54 -1
- package/src/components/inline-tools/inline-tool-underline.ts +54 -1
- package/src/components/inline-tools/services/bold-normalization-pass.ts +29 -3
- package/src/components/inline-tools/utils/formatting-range-utils.ts +83 -0
- package/src/components/modules/api/tools.ts +19 -0
- package/src/components/modules/blockEvents/composers/keyboardNavigation.ts +5 -5
- package/src/components/modules/blockManager/blockManager.ts +22 -0
- package/src/components/modules/blockManager/event-binder.ts +12 -1
- package/src/components/modules/blockManager/factory.ts +4 -0
- package/src/components/modules/blockManager/types.ts +4 -0
- package/src/components/modules/blockManager/yjs-sync.ts +16 -2
- package/src/components/modules/paste/google-docs-preprocessor.ts +49 -3
- package/src/components/modules/paste/handlers/table-cells-handler.ts +12 -2
- package/src/components/modules/paste/index.ts +8 -4
- package/src/components/modules/paste/types.ts +2 -0
- package/src/components/modules/renderer.ts +22 -2
- package/src/components/modules/saver.ts +19 -1
- package/src/components/modules/themeManager.ts +3 -1
- package/src/components/modules/toolbar/blockSettings.ts +51 -1
- package/src/components/modules/toolbar/index.ts +95 -3
- package/src/components/modules/toolbar/inline/index.ts +0 -3
- package/src/components/modules/toolbar/plus-button.ts +37 -0
- package/src/components/modules/toolbar/settings-toggler.ts +6 -0
- package/src/components/modules/tools.ts +5 -0
- package/src/components/modules/uiControllers/controllers/keyboard.ts +85 -22
- package/src/components/modules/uiControllers/controllers/selection.ts +14 -2
- package/src/components/modules/yjs/document-store.ts +22 -0
- package/src/components/modules/yjs/index.ts +10 -0
- package/src/components/modules/yjs/serializer.ts +20 -0
- package/src/components/selection/cursor.ts +12 -2
- package/src/components/ui/toolbox.ts +31 -5
- package/src/components/utils/id-generator.ts +11 -0
- package/src/components/utils/key-icon.ts +187 -0
- package/src/components/utils/popover/components/hint/hint.ts +3 -1
- package/src/components/utils/popover/components/popover-item/popover-item-default/popover-item-default.ts +18 -5
- package/src/components/utils/popover/popover-abstract.ts +45 -0
- package/src/components/utils/popover/popover-desktop.ts +1 -0
- package/src/components/utils/popover/popover-position.ts +12 -5
- package/src/components/utils/popover/popover.const.ts +2 -0
- package/src/components/utils.ts +1 -0
- package/src/styles/main.css +1269 -0
- package/src/tools/code/index.ts +4 -0
- package/src/tools/database/database-backend-sync.ts +132 -0
- package/src/tools/database/database-board-view.ts +410 -0
- package/src/tools/database/database-card-drag.ts +306 -0
- package/src/tools/database/database-card-drawer.ts +546 -0
- package/src/tools/database/database-column-controls.ts +141 -0
- package/src/tools/database/database-column-drag.ts +262 -0
- package/src/tools/database/database-keyboard.ts +35 -0
- package/src/tools/database/database-list-row-drag.ts +245 -0
- package/src/tools/database/database-list-view.ts +333 -0
- package/src/tools/database/database-model.ts +214 -0
- package/src/tools/database/database-property-type-popover.ts +108 -0
- package/src/tools/database/database-tab-bar.ts +558 -0
- package/src/tools/database/database-view-popover.ts +129 -0
- package/src/tools/database/database-view-renderer.ts +25 -0
- package/src/tools/database/index.ts +1223 -0
- package/src/tools/database/types.ts +152 -0
- package/src/tools/database-row/index.ts +74 -0
- package/src/tools/index.ts +4 -0
- package/src/tools/table/index.ts +10 -19
- package/src/tools/table/table-cell-selection.ts +126 -7
- package/src/tools/table/table-core.ts +59 -5
- package/src/tools/table/table-model.ts +8 -0
- package/src/tools/table/table-row-col-controls.ts +40 -18
- package/types/api/tools.d.ts +18 -0
- package/types/configs/blok-config.d.ts +27 -0
- package/types/data-formats/output-data.d.ts +13 -0
- package/types/index.d.ts +17 -0
- package/types/tools/database.d.ts +152 -0
- package/types/tools-entry.d.ts +7 -4
- package/types/utils/popover/popover.d.ts +6 -0
|
@@ -0,0 +1,306 @@
|
|
|
1
|
+
const DRAG_THRESHOLD = 10;
|
|
2
|
+
|
|
3
|
+
export interface CardDragResult {
|
|
4
|
+
rowId: string;
|
|
5
|
+
toOptionId: string;
|
|
6
|
+
beforeRowId: string | null;
|
|
7
|
+
afterRowId: string | null;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export interface CardDragOptions {
|
|
11
|
+
wrapper: HTMLElement;
|
|
12
|
+
onDrop: (result: CardDragResult) => void;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Handles pointer-based drag-and-drop for kanban cards.
|
|
17
|
+
* Supports 2D movement: across columns (horizontal) and within columns (vertical).
|
|
18
|
+
*/
|
|
19
|
+
export class DatabaseCardDrag {
|
|
20
|
+
private readonly wrapper: HTMLElement;
|
|
21
|
+
private readonly onDrop: (result: CardDragResult) => void;
|
|
22
|
+
|
|
23
|
+
private isDragging = false;
|
|
24
|
+
private rowId = '';
|
|
25
|
+
private startX = 0;
|
|
26
|
+
private startY = 0;
|
|
27
|
+
private ghostEl: HTMLElement | null = null;
|
|
28
|
+
private sourceCard: HTMLElement | null = null;
|
|
29
|
+
private sourceCardHeight = 0;
|
|
30
|
+
private ghostOffsetX = 0;
|
|
31
|
+
private ghostOffsetY = 0;
|
|
32
|
+
private gapTarget: HTMLElement | null = null;
|
|
33
|
+
private gapContainer: HTMLElement | null = null;
|
|
34
|
+
|
|
35
|
+
private readonly boundPointerMove: (e: PointerEvent) => void;
|
|
36
|
+
private readonly boundPointerUp: (e: PointerEvent) => void;
|
|
37
|
+
private readonly boundPointerCancel: () => void;
|
|
38
|
+
private readonly boundKeyDown: (e: KeyboardEvent) => void;
|
|
39
|
+
|
|
40
|
+
constructor(options: CardDragOptions) {
|
|
41
|
+
this.wrapper = options.wrapper;
|
|
42
|
+
this.onDrop = options.onDrop;
|
|
43
|
+
|
|
44
|
+
this.boundPointerMove = this.handlePointerMove.bind(this);
|
|
45
|
+
this.boundPointerUp = this.handlePointerUp.bind(this);
|
|
46
|
+
this.boundPointerCancel = this.handlePointerCancel.bind(this);
|
|
47
|
+
this.boundKeyDown = this.handleKeyDown.bind(this);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Start tracking pointer after a pointerdown on a card.
|
|
52
|
+
*/
|
|
53
|
+
public beginTracking(rowId: string, startX: number, startY: number): void {
|
|
54
|
+
this.cleanup();
|
|
55
|
+
this.rowId = rowId;
|
|
56
|
+
this.startX = startX;
|
|
57
|
+
this.startY = startY;
|
|
58
|
+
this.isDragging = false;
|
|
59
|
+
this.sourceCard = this.wrapper.querySelector(`[data-row-id="${rowId}"]`);
|
|
60
|
+
|
|
61
|
+
document.addEventListener('pointermove', this.boundPointerMove);
|
|
62
|
+
document.addEventListener('pointerup', this.boundPointerUp);
|
|
63
|
+
document.addEventListener('pointercancel', this.boundPointerCancel);
|
|
64
|
+
document.addEventListener('keydown', this.boundKeyDown);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
public cleanup(): void {
|
|
68
|
+
document.removeEventListener('pointermove', this.boundPointerMove);
|
|
69
|
+
document.removeEventListener('pointerup', this.boundPointerUp);
|
|
70
|
+
document.removeEventListener('pointercancel', this.boundPointerCancel);
|
|
71
|
+
document.removeEventListener('keydown', this.boundKeyDown);
|
|
72
|
+
|
|
73
|
+
this.ghostEl?.remove();
|
|
74
|
+
this.ghostEl = null;
|
|
75
|
+
|
|
76
|
+
this.clearGap();
|
|
77
|
+
this.wrapper.removeAttribute('data-blok-database-dragging');
|
|
78
|
+
|
|
79
|
+
if (this.sourceCard) {
|
|
80
|
+
this.sourceCard.style.opacity = '';
|
|
81
|
+
this.sourceCard = null;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
this.isDragging = false;
|
|
85
|
+
this.rowId = '';
|
|
86
|
+
this.sourceCardHeight = 0;
|
|
87
|
+
this.ghostOffsetX = 0;
|
|
88
|
+
this.ghostOffsetY = 0;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
public destroy(): void {
|
|
92
|
+
this.cleanup();
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
private handlePointerMove(e: PointerEvent): void {
|
|
96
|
+
const dx = Math.abs(e.clientX - this.startX);
|
|
97
|
+
const dy = Math.abs(e.clientY - this.startY);
|
|
98
|
+
|
|
99
|
+
if (!this.isDragging && (dx > DRAG_THRESHOLD || dy > DRAG_THRESHOLD)) {
|
|
100
|
+
this.isDragging = true;
|
|
101
|
+
this.startActiveDrag(e);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
if (this.isDragging) {
|
|
105
|
+
this.updateGhostPosition(e);
|
|
106
|
+
this.updateDropIndicator(e);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
private handlePointerUp(e: PointerEvent): void {
|
|
111
|
+
if (this.isDragging) {
|
|
112
|
+
this.commitDrop(e);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
this.cleanup();
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
private handlePointerCancel(): void {
|
|
119
|
+
this.cleanup();
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
private handleKeyDown(e: KeyboardEvent): void {
|
|
123
|
+
if (e.key === 'Escape') {
|
|
124
|
+
this.cleanup();
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
private startActiveDrag(e: PointerEvent): void {
|
|
129
|
+
if (this.sourceCard) {
|
|
130
|
+
const rect = this.sourceCard.getBoundingClientRect();
|
|
131
|
+
|
|
132
|
+
this.sourceCardHeight = rect.height;
|
|
133
|
+
this.ghostOffsetX = this.startX - rect.left;
|
|
134
|
+
this.ghostOffsetY = this.startY - rect.top;
|
|
135
|
+
this.sourceCard.style.opacity = '0.4';
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
this.wrapper.setAttribute('data-blok-database-dragging', '');
|
|
139
|
+
this.createGhost(e);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
private createGhost(e: PointerEvent): void {
|
|
143
|
+
const ghost = document.createElement('div');
|
|
144
|
+
|
|
145
|
+
ghost.setAttribute('data-blok-database-ghost', '');
|
|
146
|
+
ghost.setAttribute('contenteditable', 'false');
|
|
147
|
+
|
|
148
|
+
const style = ghost.style;
|
|
149
|
+
|
|
150
|
+
style.position = 'fixed';
|
|
151
|
+
style.pointerEvents = 'none';
|
|
152
|
+
style.opacity = '0.85';
|
|
153
|
+
style.zIndex = '50';
|
|
154
|
+
style.boxShadow = '0 12px 28px rgba(0, 0, 0, 0.2), 0 4px 10px rgba(0, 0, 0, 0.1)';
|
|
155
|
+
style.borderRadius = '8px';
|
|
156
|
+
style.overflow = 'hidden';
|
|
157
|
+
style.transform = 'rotate(2deg) scale(1.02)';
|
|
158
|
+
style.transformOrigin = 'center center';
|
|
159
|
+
|
|
160
|
+
if (this.sourceCard) {
|
|
161
|
+
const clone = this.sourceCard.cloneNode(true) as HTMLElement;
|
|
162
|
+
|
|
163
|
+
clone.style.opacity = '';
|
|
164
|
+
ghost.appendChild(clone);
|
|
165
|
+
|
|
166
|
+
const rect = this.sourceCard.getBoundingClientRect();
|
|
167
|
+
|
|
168
|
+
style.left = `${e.clientX - this.ghostOffsetX}px`;
|
|
169
|
+
style.top = `${e.clientY - this.ghostOffsetY}px`;
|
|
170
|
+
style.width = `${rect.width}px`;
|
|
171
|
+
} else {
|
|
172
|
+
style.left = `${e.clientX}px`;
|
|
173
|
+
style.top = `${e.clientY}px`;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
document.body.appendChild(ghost);
|
|
177
|
+
this.ghostEl = ghost;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
private updateGhostPosition(e: PointerEvent): void {
|
|
181
|
+
if (!this.ghostEl) {
|
|
182
|
+
return;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
this.ghostEl.style.left = `${e.clientX - this.ghostOffsetX}px`;
|
|
186
|
+
this.ghostEl.style.top = `${e.clientY - this.ghostOffsetY}px`;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
private updateDropIndicator(e: PointerEvent): void {
|
|
190
|
+
const targetColumn = this.findTargetColumn(e.clientX);
|
|
191
|
+
|
|
192
|
+
if (!targetColumn) {
|
|
193
|
+
this.clearGap();
|
|
194
|
+
|
|
195
|
+
return;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
const position = this.getDropPosition(targetColumn, e.clientY);
|
|
199
|
+
const beforeEl = position.beforeEl as HTMLElement | null;
|
|
200
|
+
|
|
201
|
+
if (beforeEl) {
|
|
202
|
+
if (beforeEl === this.gapTarget) {
|
|
203
|
+
return;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
this.clearGap();
|
|
207
|
+
beforeEl.style.marginTop = `${this.sourceCardHeight}px`;
|
|
208
|
+
this.gapTarget = beforeEl;
|
|
209
|
+
} else {
|
|
210
|
+
const cardsContainer = targetColumn.querySelector<HTMLElement>(
|
|
211
|
+
'[data-blok-database-cards]'
|
|
212
|
+
);
|
|
213
|
+
|
|
214
|
+
if (!cardsContainer) {
|
|
215
|
+
this.clearGap();
|
|
216
|
+
|
|
217
|
+
return;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
if (cardsContainer === this.gapContainer) {
|
|
221
|
+
return;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
this.clearGap();
|
|
225
|
+
cardsContainer.style.paddingBottom = `${this.sourceCardHeight}px`;
|
|
226
|
+
this.gapContainer = cardsContainer;
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
private clearGap(): void {
|
|
231
|
+
if (this.gapTarget) {
|
|
232
|
+
this.gapTarget.style.marginTop = '';
|
|
233
|
+
this.gapTarget = null;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
if (this.gapContainer) {
|
|
237
|
+
this.gapContainer.style.paddingBottom = '';
|
|
238
|
+
this.gapContainer = null;
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
private findTargetColumn(clientX: number): HTMLElement | null {
|
|
243
|
+
const columns = Array.from(this.wrapper.querySelectorAll<HTMLElement>('[data-blok-database-column]'));
|
|
244
|
+
|
|
245
|
+
for (const col of columns) {
|
|
246
|
+
const rect = col.getBoundingClientRect();
|
|
247
|
+
|
|
248
|
+
if (clientX >= rect.left && clientX <= rect.right) {
|
|
249
|
+
return col;
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
return null;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
private getDropPosition(column: HTMLElement, clientY: number): { beforeEl: Element | null } {
|
|
257
|
+
const cards = Array.from(column.querySelectorAll<HTMLElement>('[data-blok-database-card]'))
|
|
258
|
+
.filter((card) => card.getAttribute('data-row-id') !== this.rowId);
|
|
259
|
+
|
|
260
|
+
for (const card of cards) {
|
|
261
|
+
const rect = card.getBoundingClientRect();
|
|
262
|
+
const midY = rect.top + rect.height / 2;
|
|
263
|
+
|
|
264
|
+
if (clientY < midY) {
|
|
265
|
+
return { beforeEl: card };
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
return { beforeEl: null };
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
private resolveAfterRowId(
|
|
273
|
+
beforeEl: Element | null,
|
|
274
|
+
cards: HTMLElement[],
|
|
275
|
+
beforeIndex: number
|
|
276
|
+
): string | null {
|
|
277
|
+
if (beforeEl) {
|
|
278
|
+
return beforeIndex > 0 ? cards[beforeIndex - 1].getAttribute('data-row-id') : null;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
return cards.length > 0 ? cards[cards.length - 1].getAttribute('data-row-id') : null;
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
private commitDrop(e: PointerEvent): void {
|
|
285
|
+
const targetColumn = this.findTargetColumn(e.clientX);
|
|
286
|
+
|
|
287
|
+
if (!targetColumn) {
|
|
288
|
+
return;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
const toOptionId = targetColumn.getAttribute('data-option-id') ?? '';
|
|
292
|
+
const position = this.getDropPosition(targetColumn, e.clientY);
|
|
293
|
+
const cards = Array.from(targetColumn.querySelectorAll<HTMLElement>('[data-blok-database-card]'))
|
|
294
|
+
.filter((card) => card.getAttribute('data-row-id') !== this.rowId);
|
|
295
|
+
|
|
296
|
+
const beforeRowId: string | null = position.beforeEl
|
|
297
|
+
? position.beforeEl.getAttribute('data-row-id')
|
|
298
|
+
: null;
|
|
299
|
+
|
|
300
|
+
const beforeIndex = position.beforeEl ? cards.indexOf(position.beforeEl as HTMLElement) : -1;
|
|
301
|
+
|
|
302
|
+
const afterRowId = this.resolveAfterRowId(position.beforeEl, cards, beforeIndex);
|
|
303
|
+
|
|
304
|
+
this.onDrop({ rowId: this.rowId, toOptionId, beforeRowId, afterRowId });
|
|
305
|
+
}
|
|
306
|
+
}
|