@jackuait/blok 0.10.11 → 0.11.0
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/{_basePickBy--UeZi0iS.mjs → _basePickBy-6gOwWeg0.mjs} +2 -2
- package/dist/chunks/{_baseUniq-C977U_l-.mjs → _baseUniq-BcOWmEX6.mjs} +2 -2
- package/dist/chunks/{arc-Woh6y3jm.mjs → arc-kVpio4JL.mjs} +2 -2
- package/dist/chunks/architecture-YZFGNWBL-BFcrDSEW.mjs +3 -0
- package/dist/chunks/{architectureDiagram-Q4EWVU46-GTqLmLqg.mjs → architectureDiagram-Q4EWVU46-CN6p4Aji.mjs} +19 -19
- package/dist/chunks/{blockDiagram-DXYQGD6D-CML01I1L.mjs → blockDiagram-DXYQGD6D-BvZWa5Rv.mjs} +12 -12
- package/dist/chunks/{blok-CX_pZ_qq.mjs → blok-CUidffof.mjs} +1745 -1686
- package/dist/chunks/{c4Diagram-AHTNJAMY-C29OuYjO.mjs → c4Diagram-AHTNJAMY-Cmc2PsEs.mjs} +5 -5
- package/dist/chunks/{channel-Zp_OyvEW.mjs → channel-BTWFNzkv.mjs} +1 -1
- package/dist/chunks/{chunk-2KRD3SAO-mVfUZfox.mjs → chunk-2KRD3SAO-DWLzBIZw.mjs} +1 -1
- package/dist/chunks/{chunk-336JU56O-mJNxs0cr.mjs → chunk-336JU56O-DbaX7hyp.mjs} +7 -7
- package/dist/chunks/{chunk-426QAEUC-TajZlyP-.mjs → chunk-426QAEUC-pmH9mm_X.mjs} +2 -2
- package/dist/chunks/{chunk-4BX2VUAB-CsopMMb6.mjs → chunk-4BX2VUAB-B1LZI9QZ.mjs} +1 -1
- package/dist/chunks/{chunk-4TB4RGXK-DC963IrJ.mjs → chunk-4TB4RGXK-BC8qRYSD.mjs} +8 -8
- package/dist/chunks/{chunk-55IACEB6-yyL3mncJ.mjs → chunk-55IACEB6-CaLO8kWA.mjs} +1 -1
- package/dist/chunks/{chunk-5FUZZQ4R-Dr4NE8rh.mjs → chunk-5FUZZQ4R-DAWdfx4J.mjs} +7 -7
- package/dist/chunks/{chunk-5PVQY5BW-BP7ENjg7.mjs → chunk-5PVQY5BW-7Voh8aPS.mjs} +4 -4
- package/dist/chunks/{chunk-67CJDMHE-Dbl-PjEf.mjs → chunk-67CJDMHE-DSEGOn_f.mjs} +1 -1
- package/dist/chunks/{chunk-7N4EOEYR-p-g3cKuX.mjs → chunk-7N4EOEYR-CnSg1Hfu.mjs} +1 -1
- package/dist/chunks/{chunk-AA7GKIK3-Dt0Kr5Va.mjs → chunk-AA7GKIK3-BmatWFnp.mjs} +1 -1
- package/dist/chunks/{chunk-BSJP7CBP-DGU2WHwh.mjs → chunk-BSJP7CBP-BtFfqv7R.mjs} +1 -1
- package/dist/chunks/{chunk-CIAEETIT-BQ4crY5r.mjs → chunk-CIAEETIT-nVgPUEW1.mjs} +1 -1
- package/dist/chunks/{chunk-EDXVE4YY-B9_aGwkV.mjs → chunk-EDXVE4YY-e7599cf4.mjs} +2 -2
- package/dist/chunks/{chunk-ENJZ2VHE-23pY8ft5.mjs → chunk-ENJZ2VHE-DaMNdqfV.mjs} +10 -10
- package/dist/chunks/{chunk-FMBD7UC4-D_RQlBGX.mjs → chunk-FMBD7UC4-xT5c0WSd.mjs} +1 -1
- package/dist/chunks/{chunk-FOC6F5B3-CJfr-iwx.mjs → chunk-FOC6F5B3-AxSG6qaj.mjs} +1 -1
- package/dist/chunks/{chunk-ICPOFSXX-BOvOTlG6.mjs → chunk-ICPOFSXX-DbL0YBQf.mjs} +2 -2
- package/dist/chunks/{chunk-K5T4RW27-CHSI0vpp.mjs → chunk-K5T4RW27-CYdwJMQV.mjs} +5 -5
- package/dist/chunks/{chunk-KGLVRYIC-ngXT4XVA.mjs → chunk-KGLVRYIC-BwOmLwqF.mjs} +1 -1
- package/dist/chunks/{chunk-LIHQZDEY-CnP7bym1.mjs → chunk-LIHQZDEY-Csx8-523.mjs} +1 -1
- package/dist/chunks/{chunk-ORNJ4GCN-BPaghT45.mjs → chunk-ORNJ4GCN-CCDHRflI.mjs} +1 -1
- package/dist/chunks/{chunk-OYMX7WX6-CKjTvqTg.mjs → chunk-OYMX7WX6-BAoDgMPF.mjs} +6 -6
- package/dist/chunks/{chunk-QZHKN3VN-uW1N2UWF.mjs → chunk-QZHKN3VN-D1myzhE_.mjs} +1 -1
- package/dist/chunks/{chunk-U2HBQHQK-DiQOEtQH.mjs → chunk-U2HBQHQK-BXyrI_xP.mjs} +3 -3
- package/dist/chunks/{chunk-X2U36JSP-Cznp5Jm-.mjs → chunk-X2U36JSP-CXhWYelJ.mjs} +2 -2
- package/dist/chunks/{chunk-XPW4576I-W5t_agZI.mjs → chunk-XPW4576I-DOztVf6t.mjs} +1 -1
- package/dist/chunks/{chunk-YZCP3GAM-BV02tG_z.mjs → chunk-YZCP3GAM-DrkjtME-.mjs} +3 -3
- package/dist/chunks/{chunk-ZZ45TVLE-D28EyJ6R.mjs → chunk-ZZ45TVLE-CSFFLvxb.mjs} +3 -3
- package/dist/chunks/classDiagram-6PBFFD2Q-Ci3S9iu3.mjs +30 -0
- package/dist/chunks/classDiagram-v2-HSJHXN6E-BkaFKbgJ.mjs +30 -0
- package/dist/chunks/{clone-CUNvBGto.mjs → clone-WSLD7bVs.mjs} +1 -1
- package/dist/chunks/{constants-lxerM-Xa.mjs → constants-C4TrPxXY.mjs} +14 -12
- package/dist/chunks/{core-B7mxBIHA.mjs → core-D2KrVz4a.mjs} +1 -1
- package/dist/chunks/{cose-bilkent-S5V4N54A-D-Xgf_Xn.mjs → cose-bilkent-S5V4N54A-BXBidSxC.mjs} +2 -2
- package/dist/chunks/{cpp-DaTV1RSp.mjs → cpp-DnMQuZPn.mjs} +2 -2
- package/dist/chunks/{dagre-dysBn-m8.mjs → dagre-C7z2UZ4M.mjs} +6 -6
- package/dist/chunks/{dagre-KV5264BT-BB3SAlfA.mjs → dagre-KV5264BT-Ct6qUqKI.mjs} +15 -15
- package/dist/chunks/{diagram-5BDNPKRD-B1410bPG.mjs → diagram-5BDNPKRD-B9hNG7ht.mjs} +18 -18
- package/dist/chunks/{diagram-G4DWMVQ6-CdhBBETB.mjs → diagram-G4DWMVQ6-9_YOaVXe.mjs} +21 -21
- package/dist/chunks/{diagram-MMDJMWI5-B3HWfHe1.mjs → diagram-MMDJMWI5-DmStUoNk.mjs} +17 -17
- package/dist/chunks/{diagram-TYMM5635-D0JzRYCN.mjs → diagram-TYMM5635-DmrkkW85.mjs} +17 -17
- package/dist/chunks/{erDiagram-SMLLAGMA-DfIG0QBk.mjs → erDiagram-SMLLAGMA-5vkZ5DwJ.mjs} +14 -14
- package/dist/chunks/{flowDiagram-DWJPFMVM-BOL8JsQX.mjs → flowDiagram-DWJPFMVM-CGTiQBd7.mjs} +17 -17
- package/dist/chunks/{ganttDiagram-T4ZO3ILL-CiUr_YRw.mjs → ganttDiagram-T4ZO3ILL-BNtXyM0I.mjs} +7 -7
- package/dist/chunks/gitGraph-7Q5UKJZL-DxMmuJIv.mjs +3 -0
- package/dist/chunks/{gitGraphDiagram-UUTBAWPF-CtNkTTWO.mjs → gitGraphDiagram-UUTBAWPF-CmQR-xZp.mjs} +17 -17
- package/dist/chunks/{graphlib-BXNPwKuI.mjs → graphlib-BfwqhpXp.mjs} +3 -3
- package/dist/chunks/{graphql-DNumR9m-.mjs → graphql-4Htarzhp.mjs} +2 -2
- package/dist/chunks/{html-CanPsi1Y.mjs → html-DW39yhuS.mjs} +2 -2
- package/dist/chunks/{i18next-loader-453gJdot.mjs → i18next-loader-CyDs2NKf.mjs} +2 -2
- package/dist/chunks/info-OMHHGYJF-ChWZqC0a.mjs +3 -0
- package/dist/chunks/{infoDiagram-42DDH7IO-CD7nVBvi.mjs → infoDiagram-42DDH7IO-BbV_tozh.mjs} +14 -14
- package/dist/chunks/{isEmpty-D8B0aRsG.mjs → isEmpty-jlCmuYeg.mjs} +1 -1
- package/dist/chunks/{ishikawaDiagram-UXIWVN3A-BOaC9qJs.mjs → ishikawaDiagram-UXIWVN3A-DJBG3b-A.mjs} +6 -6
- package/dist/chunks/{journeyDiagram-VCZTEJTY-DKf55ZdJ.mjs → journeyDiagram-VCZTEJTY-BdMsFn3r.mjs} +6 -6
- package/dist/chunks/{kanban-definition-6JOO6SKY-D2CrAXqB.mjs → kanban-definition-6JOO6SKY-ncNaxcxH.mjs} +11 -11
- package/dist/chunks/{latex-DY1HNB4U.mjs → latex-BeVX0E4Z.mjs} +1 -1
- package/dist/chunks/{line-CuvDsrkE.mjs → line-CWJNfvdn.mjs} +3 -3
- package/dist/chunks/{linear-JRIqMpGQ.mjs → linear-BU4OjSPS.mjs} +3 -3
- package/dist/chunks/{lua-COOfzihE.mjs → lua-CPnWrc7C.mjs} +1 -1
- package/dist/chunks/{mdast-util-math-D56mMxhB.mjs → mdast-util-math-D42zbZda.mjs} +1 -1
- package/dist/chunks/{mermaid-parser.core-BhpZC2lA.mjs → mermaid-parser.core-DBhkcRo7.mjs} +10 -10
- package/dist/chunks/{mermaid.core-C40gcVfv.mjs → mermaid.core-uSzF9nF1.mjs} +45 -45
- package/dist/chunks/{micromark-extension-math-D-s54WWf.mjs → micromark-extension-math-x3wvkKaN.mjs} +2 -2
- package/dist/chunks/{mindmap-definition-QFDTVHPH-C-0fwUUS.mjs → mindmap-definition-QFDTVHPH-BfOyKFtC.mjs} +13 -13
- package/dist/chunks/notifier-B-wErJJB.mjs +73 -0
- package/dist/chunks/{ordinal-fyJMP-lj.mjs → ordinal-CN3SDQau.mjs} +1 -1
- package/dist/chunks/packet-4T2RLAQJ-7DW35MGl.mjs +3 -0
- package/dist/chunks/{php-DA-SOiqC.mjs → php-Dejkjxb5.mjs} +6 -6
- package/dist/chunks/pie-ZZUOXDRM-Dtuq0w2k.mjs +3 -0
- package/dist/chunks/{pieDiagram-DEJITSTG-BPyqheXv.mjs → pieDiagram-DEJITSTG-B1sjciNi.mjs} +21 -21
- package/dist/chunks/{quadrantDiagram-34T5L4WZ-kOZ1zIXB.mjs → quadrantDiagram-34T5L4WZ-CV838wf-.mjs} +4 -4
- package/dist/chunks/radar-PYXPWWZC-Bz4lwSbg.mjs +3 -0
- package/dist/chunks/{requirementDiagram-MS252O5E-C8Zkq6Lq.mjs → requirementDiagram-MS252O5E-CA3LUAVZ.mjs} +13 -13
- package/dist/chunks/{ruby-HDUjp8gK.mjs → ruby-Z7wCYjey.mjs} +11 -11
- package/dist/chunks/{sankeyDiagram-XADWPNL6-B0FhkAL9.mjs → sankeyDiagram-XADWPNL6-Cw8wB2YO.mjs} +3 -3
- package/dist/chunks/{sequenceDiagram-FGHM5R23-Dv2H5Lbc.mjs → sequenceDiagram-FGHM5R23-pm0MaeXC.mjs} +7 -7
- package/dist/chunks/{stateDiagram-FHFEXIEX-D1vcO7H_.mjs → stateDiagram-FHFEXIEX-CMcsvm0M.mjs} +17 -17
- package/dist/chunks/stateDiagram-v2-QKLJ7IA2-C4nZGNBm.mjs +28 -0
- package/dist/chunks/{timeline-definition-GMOUNBTQ-DJmJ0TPa.mjs → timeline-definition-GMOUNBTQ-DwHKPj3j.mjs} +6 -6
- package/dist/chunks/{tools-CMNxZqJC.mjs → tools-CmNY86rS.mjs} +196 -139
- package/dist/chunks/treeView-SZITEDCU-DPG9FJ6Q.mjs +3 -0
- package/dist/chunks/treemap-W4RFUUIX-N4tZJR1-.mjs +3 -0
- package/dist/chunks/types-BNvlbr9u.mjs +4 -0
- package/dist/chunks/{vennDiagram-DHZGUBPP-Dx1rMP24.mjs → vennDiagram-DHZGUBPP-Gfy0QWtB.mjs} +6 -6
- package/dist/chunks/wardley-RL74JXVD-C7Hzc5y2.mjs +3 -0
- package/dist/chunks/{wardleyDiagram-NUSXRM2D-Dnm6lvMn.mjs → wardleyDiagram-NUSXRM2D-ChZiL3a0.mjs} +15 -15
- package/dist/chunks/{xml-Dq1lpp8G.mjs → xml-C1PUeKuL.mjs} +1 -1
- package/dist/chunks/{xychartDiagram-5P7HB3ND-C9wFc2e9.mjs → xychartDiagram-5P7HB3ND-t_dhLiOA.mjs} +11 -11
- package/dist/full.mjs +3 -3
- package/dist/markdown.mjs +4 -4
- package/dist/react.mjs +2 -2
- package/dist/tools.mjs +2 -2
- package/package.json +1 -1
- package/src/blok.ts +5 -0
- package/src/components/modules/api/blocks.ts +43 -4
- package/src/components/modules/api/notifier.ts +24 -11
- package/src/components/modules/blockEvents/composers/keyboardNavigation.ts +29 -6
- package/src/components/modules/blockManager/blockManager.ts +12 -2
- package/src/components/modules/blockManager/operations.ts +189 -9
- package/src/components/modules/caret.ts +57 -0
- package/src/components/modules/drag/operations/DragOperations.ts +10 -3
- package/src/components/modules/renderer.ts +7 -0
- package/src/components/ui/toolbox.ts +30 -25
- package/src/components/utils/notifier/draw.ts +43 -143
- package/src/components/utils/notifier/index.ts +76 -37
- package/src/components/utils/notifier/types.ts +3 -0
- package/src/components/utils/notifier.ts +17 -4
- package/src/components/utils/popover/popover-desktop.ts +23 -2
- package/src/styles/main.css +24 -0
- package/src/tools/callout/index.ts +48 -6
- package/src/tools/callout/types.ts +8 -1
- package/src/tools/table/index.ts +59 -7
- package/src/tools/table/table-cell-blocks.ts +90 -3
- package/types/api/blocks.d.ts +2 -1
- package/types/configs/blok-config.d.ts +15 -0
- package/types/configs/notifier.d.ts +11 -0
- package/dist/chunks/architecture-YZFGNWBL-aVO23UKm.mjs +0 -3
- package/dist/chunks/classDiagram-6PBFFD2Q-DXsClapu.mjs +0 -30
- package/dist/chunks/classDiagram-v2-HSJHXN6E-B6TlQ_PM.mjs +0 -30
- package/dist/chunks/gitGraph-7Q5UKJZL-B3aq166w.mjs +0 -3
- package/dist/chunks/info-OMHHGYJF-SX91-Wub.mjs +0 -3
- package/dist/chunks/notifier-PpnFhM0m.mjs +0 -96
- package/dist/chunks/packet-4T2RLAQJ-suhU85JN.mjs +0 -3
- package/dist/chunks/pie-ZZUOXDRM-DF5e16CP.mjs +0 -3
- package/dist/chunks/radar-PYXPWWZC-DgzodpRv.mjs +0 -3
- package/dist/chunks/stateDiagram-v2-QKLJ7IA2-AoHzFiaI.mjs +0 -28
- package/dist/chunks/treeView-SZITEDCU-C1mc9PWf.mjs +0 -3
- package/dist/chunks/treemap-W4RFUUIX-ClV9Slyp.mjs +0 -3
- package/dist/chunks/wardley-RL74JXVD-Dj7t7jHR.mjs +0 -3
- /package/dist/chunks/{am-Bbd7cTHS.mjs → am-JTszxMum.mjs} +0 -0
- /package/dist/chunks/{ar-Bo71sCQE.mjs → ar-CME8m7Ug.mjs} +0 -0
- /package/dist/chunks/{array-DbiMs_0t.mjs → array-B4E6ednJ.mjs} +0 -0
- /package/dist/chunks/{az-BnNrO_xK.mjs → az-CU1BXEnK.mjs} +0 -0
- /package/dist/chunks/{bg-CMd2n-OG.mjs → bg-C1QKbOOv.mjs} +0 -0
- /package/dist/chunks/{bn-B3lorfXA.mjs → bn-DbDE4DPn.mjs} +0 -0
- /package/dist/chunks/{bs-_zM8QBsA.mjs → bs-5jPxlF97.mjs} +0 -0
- /package/dist/chunks/{c-DmKJe6GM.mjs → c-CQrSye6K.mjs} +0 -0
- /package/dist/chunks/{ccount-C9Y7nqDe.mjs → ccount-B7is2MU0.mjs} +0 -0
- /package/dist/chunks/{cs-nodpmLBf.mjs → cs-BEZB2qcc.mjs} +0 -0
- /package/dist/chunks/{csharp-Drv96dbi.mjs → csharp-ByiKf6DR.mjs} +0 -0
- /package/dist/chunks/{css-82tNAoU6.mjs → css-BqsWMbBt.mjs} +0 -0
- /package/dist/chunks/{cytoscape.esm-DSb9a7HE.mjs → cytoscape.esm-CWkCAUzT.mjs} +0 -0
- /package/dist/chunks/{da-DwzgQcXQ.mjs → da-DXZ2uOgL.mjs} +0 -0
- /package/dist/chunks/{dart-DE9j8McI.mjs → dart-aYsezAEv.mjs} +0 -0
- /package/dist/chunks/{de-BvWPiNt6.mjs → de-D4FxC1Yq.mjs} +0 -0
- /package/dist/chunks/{default-qigT1Xpq.mjs → default-DPWNu2LM.mjs} +0 -0
- /package/dist/chunks/{defaultLocale-yTyMJ3IT.mjs → defaultLocale-BYV2aVaI.mjs} +0 -0
- /package/dist/chunks/{dist-X14EnMrO.mjs → dist-CKM-fjTE.mjs} +0 -0
- /package/dist/chunks/{dockerfile-D9DFksUy.mjs → dockerfile-1GBIWF66.mjs} +0 -0
- /package/dist/chunks/{el-B_D7wUrZ.mjs → el-DwIVDdku.mjs} +0 -0
- /package/dist/chunks/{engine-javascript-Bmmg8uL9.mjs → engine-javascript-CYa8VRAu.mjs} +0 -0
- /package/dist/chunks/{es-Bn_ZFyW9.mjs → es-DlO4MePt.mjs} +0 -0
- /package/dist/chunks/{et-CUcULjoh.mjs → et-BBSbb8pL.mjs} +0 -0
- /package/dist/chunks/{fa-BRhCTsOy.mjs → fa-DsJou-pw.mjs} +0 -0
- /package/dist/chunks/{fi-BEvyU9n6.mjs → fi-CsMgo7Wk.mjs} +0 -0
- /package/dist/chunks/{fil-Dlp1_W2B.mjs → fil-Dlw8sEta.mjs} +0 -0
- /package/dist/chunks/{fr-DJBeOAx1.mjs → fr-DeapG5NH.mjs} +0 -0
- /package/dist/chunks/{go-jyWjtO8q.mjs → go-4mRqLTld.mjs} +0 -0
- /package/dist/chunks/{gu-0hWvx16l.mjs → gu-klAnA_ns.mjs} +0 -0
- /package/dist/chunks/{he-CYe88qXp.mjs → he-9TdyXc1J.mjs} +0 -0
- /package/dist/chunks/{hi-DuLkkPWn.mjs → hi-DVOss_Zp.mjs} +0 -0
- /package/dist/chunks/{hr-BwCB1IMW.mjs → hr-CXo-QFLf.mjs} +0 -0
- /package/dist/chunks/{hu-C2dLyTeX.mjs → hu-B6uKq-NU.mjs} +0 -0
- /package/dist/chunks/{hy-DXKoDpv9.mjs → hy-B7CWqbUW.mjs} +0 -0
- /package/dist/chunks/{i18next-CLUkHqmV.mjs → i18next-BFvS_Rnh.mjs} +0 -0
- /package/dist/chunks/{id-D4chLuW_.mjs → id-C5d2QGEQ.mjs} +0 -0
- /package/dist/chunks/{init-BlLeEogJ.mjs → init-C3Dyaaly.mjs} +0 -0
- /package/dist/chunks/{isArrayLikeObject-DzUNFfIK.mjs → isArrayLikeObject-B-1mfvNK.mjs} +0 -0
- /package/dist/chunks/{it-Hto3G26t.mjs → it-BgPXC2_F.mjs} +0 -0
- /package/dist/chunks/{ja-UxHm_PPZ.mjs → ja-CQ7ujOz3.mjs} +0 -0
- /package/dist/chunks/{java-Dhv78FEb.mjs → java-DD_iwrM-.mjs} +0 -0
- /package/dist/chunks/{javascript-DilE9EuZ.mjs → javascript-CJBlE5PB.mjs} +0 -0
- /package/dist/chunks/{json-LUtHrtDA.mjs → json-yRGZVu2_.mjs} +0 -0
- /package/dist/chunks/{ka-BnjXwPUq.mjs → ka-DAPmSm_-.mjs} +0 -0
- /package/dist/chunks/{katex-B8jUB5Cv.mjs → katex-Bbz34ZLq.mjs} +0 -0
- /package/dist/chunks/{km-exgzZBIE.mjs → km-BJ9H-RbD.mjs} +0 -0
- /package/dist/chunks/{kn-DjjUg8aO.mjs → kn-CthdB8vH.mjs} +0 -0
- /package/dist/chunks/{ko-Cu0YUSV6.mjs → ko-DbEA41LU.mjs} +0 -0
- /package/dist/chunks/{kotlin-DFLPXbOQ.mjs → kotlin-BmkhKZGf.mjs} +0 -0
- /package/dist/chunks/{ku-D-IxJ0fx.mjs → ku-B_j9qSrv.mjs} +0 -0
- /package/dist/chunks/{lightweight-i18n-DSjG0iTr.mjs → lightweight-i18n-Bb_VS9v5.mjs} +0 -0
- /package/dist/chunks/{lo-BcwjJBcv.mjs → lo-DSklR1Zs.mjs} +0 -0
- /package/dist/chunks/{lt-Bt05MFPC.mjs → lt-C9aVbfRt.mjs} +0 -0
- /package/dist/chunks/{lv-B01TmEFW.mjs → lv-DLwMSEc0.mjs} +0 -0
- /package/dist/chunks/{markdown-C6pnqcPd.mjs → markdown-DSiOSAsn.mjs} +0 -0
- /package/dist/chunks/{mermaid-BKA834jS.mjs → mermaid-C2y_3PIg.mjs} +0 -0
- /package/dist/chunks/{messages-Bq7fo8X0.mjs → messages--c74ihtM.mjs} +0 -0
- /package/dist/chunks/{messages-zcqQ8x232.mjs → messages-041mNyU42.mjs} +0 -0
- /package/dist/chunks/{messages-v26RM5PC.mjs → messages-44SP7ajI.mjs} +0 -0
- /package/dist/chunks/{messages-x_eMclsl2.mjs → messages-7NvouWKA2.mjs} +0 -0
- /package/dist/chunks/{messages-9Nx7kteY2.mjs → messages-AnuHiDPc2.mjs} +0 -0
- /package/dist/chunks/{messages-CIre8L_r.mjs → messages-B1V7UT9I.mjs} +0 -0
- /package/dist/chunks/{messages-B9mzGzZ_.mjs → messages-B2Q9NH4D.mjs} +0 -0
- /package/dist/chunks/{messages-CWm_2RvD2.mjs → messages-B6j77WNV2.mjs} +0 -0
- /package/dist/chunks/{messages-DtssWM8x2.mjs → messages-BEV0lzGv2.mjs} +0 -0
- /package/dist/chunks/{messages-CRH0RWBs.mjs → messages-BG749_88.mjs} +0 -0
- /package/dist/chunks/{messages-x6y6csd52.mjs → messages-BGpGj8nJ2.mjs} +0 -0
- /package/dist/chunks/{messages-D3fu2FHB2.mjs → messages-BNYDShPm2.mjs} +0 -0
- /package/dist/chunks/{messages-CF0SW1zy.mjs → messages-BW--wNis.mjs} +0 -0
- /package/dist/chunks/{messages-Dobxrshu2.mjs → messages-B_Mqw9Dl2.mjs} +0 -0
- /package/dist/chunks/{messages-BmC2yhsC2.mjs → messages-BbYwT3FH2.mjs} +0 -0
- /package/dist/chunks/{messages-BkaUIuz-2.mjs → messages-Bda8jwos2.mjs} +0 -0
- /package/dist/chunks/{messages-C7E8C3-S.mjs → messages-BdpFAZGZ.mjs} +0 -0
- /package/dist/chunks/{messages-rNLuCrAb.mjs → messages-BmNLNUz_.mjs} +0 -0
- /package/dist/chunks/{messages-DPcc6xp-.mjs → messages-BnGtg6t4.mjs} +0 -0
- /package/dist/chunks/{messages-C9UIaF6N.mjs → messages-BnXkEkD_.mjs} +0 -0
- /package/dist/chunks/{messages-Bi629xgG.mjs → messages-BwtU06Ax.mjs} +0 -0
- /package/dist/chunks/{messages-D6_I0L06.mjs → messages-ByRcwLIO.mjs} +0 -0
- /package/dist/chunks/{messages-C9QhLDA2.mjs → messages-CHBH3EQG.mjs} +0 -0
- /package/dist/chunks/{messages-BJTwY1tq.mjs → messages-CIYU5iEj.mjs} +0 -0
- /package/dist/chunks/{messages-BSXBVdsp.mjs → messages-CJGOmFxi.mjs} +0 -0
- /package/dist/chunks/{messages-DmvWmURo.mjs → messages-CP7Ncgaf.mjs} +0 -0
- /package/dist/chunks/{messages-BK6AwU6C.mjs → messages-CP8YKa4F.mjs} +0 -0
- /package/dist/chunks/{messages-BUQTXTew2.mjs → messages-CUxaqK8t2.mjs} +0 -0
- /package/dist/chunks/{messages-CY76MvbX2.mjs → messages-CXDk_Rlr2.mjs} +0 -0
- /package/dist/chunks/{messages-CMMq-u7e.mjs → messages-CYZxR91M.mjs} +0 -0
- /package/dist/chunks/{messages-BSyO1EWC.mjs → messages-Cjm7Nj1C.mjs} +0 -0
- /package/dist/chunks/{messages-CAX3qQi0.mjs → messages-CjzZ6nxv.mjs} +0 -0
- /package/dist/chunks/{messages-x0kzc2oy.mjs → messages-CpVtcYqo.mjs} +0 -0
- /package/dist/chunks/{messages-mo5OrbVj2.mjs → messages-CumomgDd2.mjs} +0 -0
- /package/dist/chunks/{messages-E1tsNNG5.mjs → messages-CvCb4dCy.mjs} +0 -0
- /package/dist/chunks/{messages-Bo7Cbk_O.mjs → messages-D3DNj1jh.mjs} +0 -0
- /package/dist/chunks/{messages-PFfYbqlm.mjs → messages-D7d2U-tx.mjs} +0 -0
- /package/dist/chunks/{messages-DIVQmVS92.mjs → messages-DFWhnXF12.mjs} +0 -0
- /package/dist/chunks/{messages-nAdoEqRi.mjs → messages-DJr1x1i2.mjs} +0 -0
- /package/dist/chunks/{messages-DsMIxm6I2.mjs → messages-DN7PU5Un2.mjs} +0 -0
- /package/dist/chunks/{messages-DhoZXmg_.mjs → messages-DVh_Bwwq.mjs} +0 -0
- /package/dist/chunks/{messages-BsqBho4T.mjs → messages-DVwHxslb.mjs} +0 -0
- /package/dist/chunks/{messages-BPxMr5HC.mjs → messages-DZ1Pfnl0.mjs} +0 -0
- /package/dist/chunks/{messages--G2XLc8E.mjs → messages-Do3QV7QW.mjs} +0 -0
- /package/dist/chunks/{messages-Bhn5V9FQ2.mjs → messages-Drxwphbg2.mjs} +0 -0
- /package/dist/chunks/{messages-bIzBNzdr2.mjs → messages-DtloGH1v2.mjs} +0 -0
- /package/dist/chunks/{messages-DHzT8CZv.mjs → messages-Du0zg7UM.mjs} +0 -0
- /package/dist/chunks/{messages-z5pham9o.mjs → messages-DuA_D23n.mjs} +0 -0
- /package/dist/chunks/{messages-BS9zk4mI2.mjs → messages-DwKRw3jP2.mjs} +0 -0
- /package/dist/chunks/{messages-dGYum7sj2.mjs → messages-DzAYvMm72.mjs} +0 -0
- /package/dist/chunks/{messages-kKXlI5xZ.mjs → messages-Dzmge-lj.mjs} +0 -0
- /package/dist/chunks/{messages-CpLq4ZZg.mjs → messages-ETNAE7WV.mjs} +0 -0
- /package/dist/chunks/{messages-CrpOkt8c2.mjs → messages-F4r6ruTX2.mjs} +0 -0
- /package/dist/chunks/{messages-BCfsOOlp.mjs → messages-FNQdT9Da.mjs} +0 -0
- /package/dist/chunks/{messages-DiQkvwE32.mjs → messages-FYGyC6zk2.mjs} +0 -0
- /package/dist/chunks/{messages-B29Wm2zT.mjs → messages-ZS1Ro8ZB.mjs} +0 -0
- /package/dist/chunks/{messages-CJ8IkF1P.mjs → messages-dyhHlgE9.mjs} +0 -0
- /package/dist/chunks/{messages-DfLcy0CY.mjs → messages-fAEKtYXO.mjs} +0 -0
- /package/dist/chunks/{messages-DJYT0upW.mjs → messages-hhptyJO3.mjs} +0 -0
- /package/dist/chunks/{messages-3kHDtQLN.mjs → messages-hk4dinYI.mjs} +0 -0
- /package/dist/chunks/{messages-BimpUMRx.mjs → messages-knSLxvI6.mjs} +0 -0
- /package/dist/chunks/{messages-4Y8dL_1j2.mjs → messages-lORohDgW2.mjs} +0 -0
- /package/dist/chunks/{messages-Dass0QsQ.mjs → messages-mvnz8DvU.mjs} +0 -0
- /package/dist/chunks/{messages-DcUYfD6m.mjs → messages-pHWKsrcZ.mjs} +0 -0
- /package/dist/chunks/{messages-CR5irc8q.mjs → messages-q2McAyOz.mjs} +0 -0
- /package/dist/chunks/{messages-CEJtxBxU.mjs → messages-r62SI44r.mjs} +0 -0
- /package/dist/chunks/{messages-CKP6aUXN2.mjs → messages-uFdMhLbJ.mjs} +0 -0
- /package/dist/chunks/{micromark-factory-space-y4SDWQKm.mjs → micromark-factory-space-C6wz33de.mjs} +0 -0
- /package/dist/chunks/{mk-DlZNyDhn.mjs → mk-D96bSjMK.mjs} +0 -0
- /package/dist/chunks/{ml-CizMIOxl.mjs → ml-D1Ek94RG.mjs} +0 -0
- /package/dist/chunks/{mn-B_pDvxok.mjs → mn-CyNCFOYP.mjs} +0 -0
- /package/dist/chunks/{mr-D8D_7YmW.mjs → mr-CaA3xXVf.mjs} +0 -0
- /package/dist/chunks/{ms-CM93I8ec.mjs → ms-IZU-A3Qk.mjs} +0 -0
- /package/dist/chunks/{my-BGnGdDAV.mjs → my-C-AQLGIp.mjs} +0 -0
- /package/dist/chunks/{native-D0cfLXsM.mjs → native-CarRLbbJ.mjs} +0 -0
- /package/dist/chunks/{ne-C6ZmmqhH.mjs → ne-LaymXAjm.mjs} +0 -0
- /package/dist/chunks/{nl-UGFOU80W.mjs → nl-Dm1eVwTA.mjs} +0 -0
- /package/dist/chunks/{no-as-DKhC4.mjs → no-B2WicGhz.mjs} +0 -0
- /package/dist/chunks/{one-light-Di_o5Kb7.mjs → one-light-bqnXiA0I.mjs} +0 -0
- /package/dist/chunks/{pa-DiOAveAI.mjs → pa-ry61xHq9.mjs} +0 -0
- /package/dist/chunks/{path-7pA19U_d.mjs → path-Crax6eds.mjs} +0 -0
- /package/dist/chunks/{pl-DXk8ye3B.mjs → pl-DzCnx7eR.mjs} +0 -0
- /package/dist/chunks/{ps-CuxilZ3F.mjs → ps-DKXG6JHY.mjs} +0 -0
- /package/dist/chunks/{pt-DsT6E77q.mjs → pt-e09B0rEd.mjs} +0 -0
- /package/dist/chunks/{python-DYiHKGPV.mjs → python-tdu-oDWx.mjs} +0 -0
- /package/dist/chunks/{r-BZ4pC-Uz.mjs → r-D8fCyoTl.mjs} +0 -0
- /package/dist/chunks/{ro-CcAQOL-B.mjs → ro-HNnYR5pB.mjs} +0 -0
- /package/dist/chunks/{rough.esm-BPA_YwbP.mjs → rough.esm-CChKUjNP.mjs} +0 -0
- /package/dist/chunks/{ru-hD41D0Fd.mjs → ru-D_jTWgK8.mjs} +0 -0
- /package/dist/chunks/{rust-Db_HEGL5.mjs → rust-D5IQAarB.mjs} +0 -0
- /package/dist/chunks/{scala-B1kK21mu.mjs → scala-CbcMYkuq.mjs} +0 -0
- /package/dist/chunks/{sd-Biu7f00A.mjs → sd-B7bgXBin.mjs} +0 -0
- /package/dist/chunks/{shellscript-BBh7AxMC.mjs → shellscript-CZefq5l_.mjs} +0 -0
- /package/dist/chunks/{si-Bhto6prC.mjs → si-aQCsTBIp.mjs} +0 -0
- /package/dist/chunks/{sk-Ce7J4sHX.mjs → sk-Bjrct9rr.mjs} +0 -0
- /package/dist/chunks/{sl-Fz7idR9w.mjs → sl-DvS57kCB.mjs} +0 -0
- /package/dist/chunks/{sq-CnLb3bAQ.mjs → sq-BexoWiW2.mjs} +0 -0
- /package/dist/chunks/{sql-DHkazX4B.mjs → sql-C4ibVEDs.mjs} +0 -0
- /package/dist/chunks/{sr-Bc5JbF-b.mjs → sr-CXir4bLq.mjs} +0 -0
- /package/dist/chunks/{src-B3rrEIze.mjs → src-yreeH1hr.mjs} +0 -0
- /package/dist/chunks/{sv-B86P2LyK.mjs → sv-B_Owhjrs.mjs} +0 -0
- /package/dist/chunks/{sw-CnQXriTg.mjs → sw-B4p84FCO.mjs} +0 -0
- /package/dist/chunks/{swift-DZdprfb-.mjs → swift-Drpgj9J0.mjs} +0 -0
- /package/dist/chunks/{ta-CG4BbxjE.mjs → ta-BU_-jQ33.mjs} +0 -0
- /package/dist/chunks/{te-CkE35V1X.mjs → te-5FGke4TK.mjs} +0 -0
- /package/dist/chunks/{th-BCtkHu3E.mjs → th-DFyekAQ3.mjs} +0 -0
- /package/dist/chunks/{tr-D5Cexvko.mjs → tr-C7Zj3lX4.mjs} +0 -0
- /package/dist/chunks/{typescript-DhtGMhWX.mjs → typescript-Bnpf4OG6.mjs} +0 -0
- /package/dist/chunks/{ug-Bt9xMT4p.mjs → ug-DJwD0iui.mjs} +0 -0
- /package/dist/chunks/{uk-D1g7UV0v.mjs → uk-hkOj8kWN.mjs} +0 -0
- /package/dist/chunks/{ur-B69faQh_.mjs → ur-Cy5A8nFG.mjs} +0 -0
- /package/dist/chunks/{vi--gW42cZG.mjs → vi-CEt0cTzQ.mjs} +0 -0
- /package/dist/chunks/{vitesse-dark-B5oAIYZ5.mjs → vitesse-dark-dflHsflb.mjs} +0 -0
- /package/dist/chunks/{yaml-T4MCc8o4.mjs → yaml-CecI9urB.mjs} +0 -0
- /package/dist/chunks/{zh-DgQ6P8Lu.mjs → zh-BwQjLCGO.mjs} +0 -0
|
@@ -66,16 +66,34 @@ export class CalloutTool implements BlockTool {
|
|
|
66
66
|
private _dom: CalloutDOMRefs | null = null;
|
|
67
67
|
private _emojiPicker: EmojiPicker | null = null;
|
|
68
68
|
private _colorPicker: ColorPickerHandle | null = null;
|
|
69
|
+
private readonly _customEmojiPicker: ((onSelect: (emoji: string) => void) => void) | undefined;
|
|
69
70
|
private blockId?: string;
|
|
70
|
-
|
|
71
|
-
|
|
71
|
+
/**
|
|
72
|
+
* Text captured from a source block during conversion (paragraph -> callout).
|
|
73
|
+
* Callout stores its rich content inside child blocks rather than in `data`,
|
|
74
|
+
* so the first-time `rendered()` hook seeds a child paragraph with this
|
|
75
|
+
* text — preserving the original content across the conversion.
|
|
76
|
+
*/
|
|
77
|
+
private _pendingChildText: string | null = null;
|
|
78
|
+
|
|
79
|
+
constructor({ data, api, readOnly, block, config }: BlockToolConstructorOptions<CalloutData, CalloutConfig>) {
|
|
72
80
|
this.api = api;
|
|
73
81
|
this.readOnly = readOnly;
|
|
82
|
+
|
|
83
|
+
const importedText = typeof (data as Record<string, unknown>).__importedText === 'string'
|
|
84
|
+
? (data as Record<string, unknown>).__importedText as string
|
|
85
|
+
: null;
|
|
86
|
+
|
|
87
|
+
if (importedText !== null && importedText.length > 0) {
|
|
88
|
+
this._pendingChildText = importedText;
|
|
89
|
+
}
|
|
90
|
+
|
|
74
91
|
this._data = this.normalizeData(data);
|
|
75
92
|
|
|
76
93
|
if (block) {
|
|
77
94
|
this.blockId = block.id;
|
|
78
95
|
}
|
|
96
|
+
this._customEmojiPicker = config?.emojiPicker;
|
|
79
97
|
}
|
|
80
98
|
|
|
81
99
|
private normalizeData(data: Partial<CalloutData>): CalloutData {
|
|
@@ -156,13 +174,23 @@ export class CalloutTool implements BlockTool {
|
|
|
156
174
|
const blockIndex = this.api.blocks.getBlockIndex(this.blockId);
|
|
157
175
|
|
|
158
176
|
if (blockIndex !== undefined) {
|
|
159
|
-
|
|
177
|
+
// If conversion handed us source text to preserve, seed the first
|
|
178
|
+
// child paragraph with it (single-shot — cleared immediately).
|
|
179
|
+
const seedText = this._pendingChildText;
|
|
180
|
+
|
|
181
|
+
this._pendingChildText = null;
|
|
182
|
+
|
|
183
|
+
const childData = seedText !== null && seedText.length > 0
|
|
184
|
+
? { text: seedText }
|
|
185
|
+
: undefined;
|
|
186
|
+
|
|
187
|
+
const newBlock = this.api.blocks.insertInsideParent(this.blockId, blockIndex + 1, childData);
|
|
160
188
|
|
|
161
189
|
// Manually append the new child's holder — insertInsideParent places it in the
|
|
162
190
|
// flat block list but doesn't know about our childContainer DOM.
|
|
163
191
|
this._dom.childContainer.appendChild(newBlock.holder);
|
|
164
192
|
|
|
165
|
-
this.api.caret.setToBlock(newBlock.id, 'start');
|
|
193
|
+
this.api.caret.setToBlock(newBlock.id, seedText !== null ? 'end' : 'start');
|
|
166
194
|
}
|
|
167
195
|
}
|
|
168
196
|
}
|
|
@@ -352,6 +380,11 @@ export class CalloutTool implements BlockTool {
|
|
|
352
380
|
return;
|
|
353
381
|
}
|
|
354
382
|
|
|
383
|
+
if (this._customEmojiPicker !== undefined) {
|
|
384
|
+
this._customEmojiPicker((emoji: string) => this.setEmoji(emoji));
|
|
385
|
+
return;
|
|
386
|
+
}
|
|
387
|
+
|
|
355
388
|
if (this._emojiPicker === null) {
|
|
356
389
|
this._emojiPicker = new EmojiPicker({
|
|
357
390
|
onSelect: (native: string) => this.setEmoji(native),
|
|
@@ -392,11 +425,20 @@ export class CalloutTool implements BlockTool {
|
|
|
392
425
|
|
|
393
426
|
public static get conversionConfig(): ConversionConfig<CalloutData> {
|
|
394
427
|
return {
|
|
395
|
-
|
|
428
|
+
/**
|
|
429
|
+
* Callout stores its text inside child blocks, not in its own `data`.
|
|
430
|
+
* On import we capture the source block's text through a transient
|
|
431
|
+
* `__importedText` field that the callout constructor reads and the
|
|
432
|
+
* `rendered()` hook uses to seed the first child paragraph with the
|
|
433
|
+
* original content — preserving the text across paragraph -> callout
|
|
434
|
+
* conversion.
|
|
435
|
+
*/
|
|
436
|
+
import: (stringToImport: string): CalloutData => ({
|
|
396
437
|
emoji: DEFAULT_EMOJI,
|
|
397
438
|
textColor: null,
|
|
398
439
|
backgroundColor: null,
|
|
399
|
-
|
|
440
|
+
__importedText: stringToImport,
|
|
441
|
+
} as CalloutData),
|
|
400
442
|
};
|
|
401
443
|
}
|
|
402
444
|
|
|
@@ -8,4 +8,11 @@ export interface CalloutData extends BlockToolData {
|
|
|
8
8
|
backgroundColor: string | null;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
export interface CalloutConfig {
|
|
11
|
+
export interface CalloutConfig {
|
|
12
|
+
/**
|
|
13
|
+
* Custom emoji picker handler.
|
|
14
|
+
* When provided, replaces the built-in emoji picker.
|
|
15
|
+
* Call `onSelect` with the chosen emoji character, or "" to clear.
|
|
16
|
+
*/
|
|
17
|
+
emojiPicker?: (onSelect: (emoji: string) => void) => void;
|
|
18
|
+
}
|
package/src/tools/table/index.ts
CHANGED
|
@@ -675,9 +675,10 @@ export class Table implements BlockTool {
|
|
|
675
675
|
// (blocks deleted but matrix not updated); persisting them causes DOM
|
|
676
676
|
// node stealing and data loss on subsequent renders.
|
|
677
677
|
const tableId = this.blockId ?? '';
|
|
678
|
+
const gridEl = this.gridElement;
|
|
678
679
|
|
|
679
|
-
data.content = data.content.map(row =>
|
|
680
|
-
row.map(cell => {
|
|
680
|
+
data.content = data.content.map((row, rowIndex) =>
|
|
681
|
+
row.map((cell, colIndex) => {
|
|
681
682
|
if (!isCellWithBlocks(cell)) {
|
|
682
683
|
return cell;
|
|
683
684
|
}
|
|
@@ -688,6 +689,35 @@ export class Table implements BlockTool {
|
|
|
688
689
|
return block != null && (block.parentId ?? '') === tableId;
|
|
689
690
|
});
|
|
690
691
|
|
|
692
|
+
// Recover from a stale model snapshot: if the model says this cell is
|
|
693
|
+
// empty but the live DOM still has child blocks parented to the table
|
|
694
|
+
// here, harvest their ids from the DOM. Without this guard, a
|
|
695
|
+
// mid-render snapshot can persist empty cells to Yjs and become an
|
|
696
|
+
// attractor state that later undo presses revert to — see
|
|
697
|
+
// table-undo-redo-orphans regression.
|
|
698
|
+
if (filtered.length === 0 && gridEl) {
|
|
699
|
+
const cellEl = gridEl.querySelector<HTMLElement>(
|
|
700
|
+
`[${CELL_ROW_ATTR}="${rowIndex}"][${CELL_COL_ATTR}="${colIndex}"]`
|
|
701
|
+
);
|
|
702
|
+
const container = cellEl?.querySelector<HTMLElement>(`[${CELL_BLOCKS_ATTR}]`);
|
|
703
|
+
const harvested = container
|
|
704
|
+
? Array.from(container.querySelectorAll<HTMLElement>('[data-blok-id]'))
|
|
705
|
+
.map(el => el.getAttribute('data-blok-id') ?? '')
|
|
706
|
+
.filter(id => {
|
|
707
|
+
if (!id) {
|
|
708
|
+
return false;
|
|
709
|
+
}
|
|
710
|
+
const block = this.api.blocks.getById?.(id);
|
|
711
|
+
|
|
712
|
+
return block != null && (block.parentId ?? '') === tableId;
|
|
713
|
+
})
|
|
714
|
+
: [];
|
|
715
|
+
|
|
716
|
+
if (harvested.length > 0) {
|
|
717
|
+
return { ...cell, blocks: harvested };
|
|
718
|
+
}
|
|
719
|
+
}
|
|
720
|
+
|
|
691
721
|
return { ...cell, blocks: filtered };
|
|
692
722
|
})
|
|
693
723
|
);
|
|
@@ -772,6 +802,8 @@ export class Table implements BlockTool {
|
|
|
772
802
|
return;
|
|
773
803
|
}
|
|
774
804
|
|
|
805
|
+
const isSyncReplay = this.api.blocks.isSyncingFromYjs;
|
|
806
|
+
|
|
775
807
|
this.runStructuralOp(() => {
|
|
776
808
|
const setDataContent = this.cellBlocks?.initializeCells(this.initialContent ?? []) ?? this.initialContent ?? [];
|
|
777
809
|
|
|
@@ -782,9 +814,14 @@ export class Table implements BlockTool {
|
|
|
782
814
|
return;
|
|
783
815
|
}
|
|
784
816
|
|
|
785
|
-
// When
|
|
786
|
-
// but
|
|
787
|
-
// with empty
|
|
817
|
+
// When an undo replay reverts content to empty, the DOM grid has its
|
|
818
|
+
// default dimensions but the model has zero rows. Reflect the grid
|
|
819
|
+
// shape in the model with empty cells so subsequent operations have
|
|
820
|
+
// valid bounds. Do NOT call populateNewCells here — fabricating new
|
|
821
|
+
// paragraph blocks during a Yjs replay creates orphans that survive
|
|
822
|
+
// the next undo cycle (regression: table-undo-redo-orphans).
|
|
823
|
+
// If Yjs actually contains child blocks for those cells they will
|
|
824
|
+
// arrive via separate block-add events.
|
|
788
825
|
if (this.api.blocks.isSyncingFromYjs && setDataContent.length === 0 && gridEl) {
|
|
789
826
|
const emptyGridContent = Array.from(gridEl.querySelectorAll(`[${ROW_ATTR}]`), (row) => {
|
|
790
827
|
const cellCount = row.querySelectorAll(`[${CELL_ATTR}]`).length;
|
|
@@ -796,8 +833,6 @@ export class Table implements BlockTool {
|
|
|
796
833
|
...this.model.snapshot(),
|
|
797
834
|
content: emptyGridContent,
|
|
798
835
|
});
|
|
799
|
-
|
|
800
|
-
populateNewCells(gridEl, this.cellBlocks);
|
|
801
836
|
} else {
|
|
802
837
|
this.model.replaceAll({
|
|
803
838
|
...this.model.snapshot(),
|
|
@@ -825,6 +860,23 @@ export class Table implements BlockTool {
|
|
|
825
860
|
const snapSet = this.model.snapshot();
|
|
826
861
|
applyCellColors(gridEl, snapSet.content);
|
|
827
862
|
applyCellPlacements(gridEl, snapSet.content);
|
|
863
|
+
|
|
864
|
+
if (isSyncReplay) {
|
|
865
|
+
// Catch blocks already restored by sibling Yjs ops in this same replay
|
|
866
|
+
// batch — they may be sitting at the top level waiting to be reattached
|
|
867
|
+
// to their original cell. Without this, multi-cell undo restoration
|
|
868
|
+
// leaves cell content as orphan top-level blocks.
|
|
869
|
+
this.cellBlocks?.reclaimReferencedBlocks();
|
|
870
|
+
// Yjs sometimes restores sibling blocks AFTER this sync transaction
|
|
871
|
+
// commits. Schedule a second pass on the next microtask so blocks that
|
|
872
|
+
// arrive late are still attached to their cells.
|
|
873
|
+
void Promise.resolve().then(() => {
|
|
874
|
+
if (currentGeneration !== this.setDataGeneration) {
|
|
875
|
+
return;
|
|
876
|
+
}
|
|
877
|
+
this.cellBlocks?.reclaimReferencedBlocks();
|
|
878
|
+
});
|
|
879
|
+
}
|
|
828
880
|
}
|
|
829
881
|
|
|
830
882
|
public onPaste(event: HTMLPasteEvent): void {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { API } from '../../../types';
|
|
2
2
|
import { DATA_ATTR } from '../../components/constants/data-attributes';
|
|
3
3
|
|
|
4
|
-
import { CELL_ATTR, ROW_ATTR, CELL_COL_ATTR } from './table-core';
|
|
4
|
+
import { CELL_ATTR, ROW_ATTR, CELL_ROW_ATTR, CELL_COL_ATTR } from './table-core';
|
|
5
5
|
import type { TableModel } from './table-model';
|
|
6
6
|
import type { LegacyCellContent, CellContent } from './types';
|
|
7
7
|
import { isCellWithBlocks } from './types';
|
|
@@ -353,7 +353,9 @@ export class TableCellBlocks {
|
|
|
353
353
|
* - Cells that already have block references get those blocks mounted.
|
|
354
354
|
* - If referenced blocks are missing from BlockManager, a fallback paragraph is created.
|
|
355
355
|
*/
|
|
356
|
-
public initializeCells(
|
|
356
|
+
public initializeCells(
|
|
357
|
+
content: LegacyCellContent[][]
|
|
358
|
+
): CellContent[][] {
|
|
357
359
|
const rowElements = this.gridElement.querySelectorAll(`[${ROW_ATTR}]`);
|
|
358
360
|
const normalizedContent: CellContent[][] = [];
|
|
359
361
|
|
|
@@ -437,6 +439,63 @@ export class TableCellBlocks {
|
|
|
437
439
|
return normalizedContent;
|
|
438
440
|
}
|
|
439
441
|
|
|
442
|
+
/**
|
|
443
|
+
* After a setData/render rebuild, reclaim any blocks the model references
|
|
444
|
+
* whose holders are not yet mounted in their model cell. This catches blocks
|
|
445
|
+
* that were restored via separate Yjs ops in a different transaction order
|
|
446
|
+
* — without it the restored block would float at the top level as an orphan
|
|
447
|
+
* (regression: table-undo-redo-orphans, multi-cell undo restoration).
|
|
448
|
+
*/
|
|
449
|
+
public reclaimReferencedBlocks(): void {
|
|
450
|
+
const snapshot = this.model.snapshot();
|
|
451
|
+
|
|
452
|
+
snapshot.content.forEach((row, rowIndex) => {
|
|
453
|
+
row.forEach((cellContent, colIndex) => {
|
|
454
|
+
if (!isCellWithBlocks(cellContent) || cellContent.blocks.length === 0) {
|
|
455
|
+
return;
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
const cell = this.gridElement.querySelector<HTMLElement>(
|
|
459
|
+
`[${CELL_ROW_ATTR}="${rowIndex}"][${CELL_COL_ATTR}="${colIndex}"]`
|
|
460
|
+
);
|
|
461
|
+
|
|
462
|
+
if (!cell) {
|
|
463
|
+
return;
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
const container = cell.querySelector<HTMLElement>(`[${CELL_BLOCKS_ATTR}]`);
|
|
467
|
+
|
|
468
|
+
if (!container) {
|
|
469
|
+
return;
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
for (const blockId of cellContent.blocks) {
|
|
473
|
+
const getIndex = this.api.blocks.getBlockIndex;
|
|
474
|
+
const getByIndex = this.api.blocks.getBlockByIndex;
|
|
475
|
+
|
|
476
|
+
if (typeof getIndex !== 'function' || typeof getByIndex !== 'function') {
|
|
477
|
+
return;
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
const index = getIndex(blockId);
|
|
481
|
+
|
|
482
|
+
if (index === undefined) {
|
|
483
|
+
continue;
|
|
484
|
+
}
|
|
485
|
+
const block = getByIndex(index);
|
|
486
|
+
|
|
487
|
+
if (!block) {
|
|
488
|
+
continue;
|
|
489
|
+
}
|
|
490
|
+
if (container.contains(block.holder)) {
|
|
491
|
+
continue;
|
|
492
|
+
}
|
|
493
|
+
this.claimBlockForCell(cell, blockId);
|
|
494
|
+
}
|
|
495
|
+
});
|
|
496
|
+
});
|
|
497
|
+
}
|
|
498
|
+
|
|
440
499
|
/**
|
|
441
500
|
* Remove placeholder attributes from contenteditable elements inside a cell container.
|
|
442
501
|
* Blocks in table cells should feel like plain table fields, not standalone paragraphs.
|
|
@@ -635,7 +694,14 @@ export class TableCellBlocks {
|
|
|
635
694
|
* When a block is removed, ensure no cell is left empty.
|
|
636
695
|
*/
|
|
637
696
|
private handleBlockMutation = (data: unknown): void => {
|
|
638
|
-
|
|
697
|
+
// While a structural op (setData / paste / row-col change) is rebuilding
|
|
698
|
+
// the table, defer events so they don't operate on stale DOM. EXCEPT for
|
|
699
|
+
// Yjs replay: an undo/redo that restores a previously-owned cell block
|
|
700
|
+
// fires block-added DURING the table's own setData, and discarding it
|
|
701
|
+
// would leave the restored block as a top-level orphan
|
|
702
|
+
// (regression: table-undo-redo-orphans). Process those immediately —
|
|
703
|
+
// recordedCellPos lookup below will route the block back to its cell.
|
|
704
|
+
if (this.isStructuralOpActive() && !this.api.blocks.isSyncingFromYjs) {
|
|
639
705
|
this.deferredEvents.push(data);
|
|
640
706
|
|
|
641
707
|
return;
|
|
@@ -674,6 +740,27 @@ export class TableCellBlocks {
|
|
|
674
740
|
return;
|
|
675
741
|
}
|
|
676
742
|
|
|
743
|
+
// Yjs undo replay: a block this table previously owned is being restored.
|
|
744
|
+
// The model's contentGrid still references its id from a prior render but
|
|
745
|
+
// the DOM is empty (we deliberately did not fabricate a replacement, see
|
|
746
|
+
// table-undo-redo-orphans regression). Reattach it to the recorded cell
|
|
747
|
+
// before falling through to adjacency-based heuristics, otherwise the
|
|
748
|
+
// restored block lands as a top-level orphan.
|
|
749
|
+
const recordedCellPos = this.model.findCellForBlock(detail.target.id);
|
|
750
|
+
|
|
751
|
+
if (recordedCellPos) {
|
|
752
|
+
const cellEl = this.gridElement.querySelector<HTMLElement>(
|
|
753
|
+
`[${CELL_ROW_ATTR}="${recordedCellPos.row}"][${CELL_COL_ATTR}="${recordedCellPos.col}"]`
|
|
754
|
+
);
|
|
755
|
+
|
|
756
|
+
if (cellEl) {
|
|
757
|
+
this.claimBlockForCell(cellEl, detail.target.id);
|
|
758
|
+
this.cellsPendingCheck.delete(cellEl);
|
|
759
|
+
|
|
760
|
+
return;
|
|
761
|
+
}
|
|
762
|
+
}
|
|
763
|
+
|
|
677
764
|
const blockIndex = detail.index;
|
|
678
765
|
|
|
679
766
|
if (blockIndex === undefined) {
|
package/types/api/blocks.d.ts
CHANGED
|
@@ -189,9 +189,10 @@ export interface Blocks {
|
|
|
189
189
|
*
|
|
190
190
|
* @param parentId - id of the parent block
|
|
191
191
|
* @param insertIndex - flat block index where the new block should appear
|
|
192
|
+
* @param childData - optional data override for the child block (default: empty paragraph)
|
|
192
193
|
* @returns BlockAPI for the newly created child block
|
|
193
194
|
*/
|
|
194
|
-
insertInsideParent(parentId: string, insertIndex: number): BlockAPI;
|
|
195
|
+
insertInsideParent(parentId: string, insertIndex: number, childData?: BlockToolData): BlockAPI;
|
|
195
196
|
|
|
196
197
|
/**
|
|
197
198
|
* Execute a function within a transaction.
|
|
@@ -5,6 +5,7 @@ import {SanitizerConfig} from './sanitizer-config';
|
|
|
5
5
|
import {I18nConfig} from './i18n-config';
|
|
6
6
|
import { BlockMutationEvent } from '../events/block';
|
|
7
7
|
import type { UserInfo } from './user-info';
|
|
8
|
+
import type { NotifierPosition, NotifierOptions, ConfirmNotifierOptions, PromptNotifierOptions } from './notifier';
|
|
8
9
|
|
|
9
10
|
/**
|
|
10
11
|
* Data model format for input/output
|
|
@@ -220,4 +221,18 @@ export interface BlokConfig {
|
|
|
220
221
|
* Return null/undefined for unknown users — Blok will fall back to showing only the date.
|
|
221
222
|
*/
|
|
222
223
|
resolveUser?: (id: string) => UserInfo | Promise<UserInfo | null> | null;
|
|
224
|
+
|
|
225
|
+
/**
|
|
226
|
+
* Position of the notification (toast) container on screen.
|
|
227
|
+
* @default 'bottom-center' — see DEFAULT_NOTIFIER_POSITION
|
|
228
|
+
*/
|
|
229
|
+
notifierPosition?: NotifierPosition;
|
|
230
|
+
|
|
231
|
+
/**
|
|
232
|
+
* Custom notifier handler.
|
|
233
|
+
* When provided, Blok calls this function instead of showing the built-in DOM notification.
|
|
234
|
+
* Your implementation receives the same options object that the built-in notifier accepts.
|
|
235
|
+
* @param options - notification options (message, style, type, time, etc.)
|
|
236
|
+
*/
|
|
237
|
+
notifier?: (options: NotifierOptions | ConfirmNotifierOptions | PromptNotifierOptions) => void;
|
|
223
238
|
}
|
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Position of the notification container on screen.
|
|
3
|
+
* - 'bottom-left' (default)
|
|
4
|
+
* - 'bottom-right'
|
|
5
|
+
* - 'bottom-center'
|
|
6
|
+
* - 'top-left'
|
|
7
|
+
* - 'top-right'
|
|
8
|
+
* - 'top-center'
|
|
9
|
+
*/
|
|
10
|
+
export type NotifierPosition = 'bottom-left' | 'bottom-right' | 'bottom-center' | 'top-left' | 'top-right' | 'top-center';
|
|
11
|
+
|
|
1
12
|
/**
|
|
2
13
|
* Base options interface for notifications
|
|
3
14
|
*/
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import "./chunk-5PVQY5BW-BP7ENjg7.mjs";
|
|
2
|
-
import { h as e } from "./src-B3rrEIze.mjs";
|
|
3
|
-
import "./chunk-ICPOFSXX-BOvOTlG6.mjs";
|
|
4
|
-
import "./dist-X14EnMrO.mjs";
|
|
5
|
-
import "./chunk-U2HBQHQK-DiQOEtQH.mjs";
|
|
6
|
-
import "./chunk-FMBD7UC4-D_RQlBGX.mjs";
|
|
7
|
-
import "./chunk-BSJP7CBP-DGU2WHwh.mjs";
|
|
8
|
-
import "./chunk-ZZ45TVLE-D28EyJ6R.mjs";
|
|
9
|
-
import "./chunk-YZCP3GAM-BV02tG_z.mjs";
|
|
10
|
-
import "./chunk-55IACEB6-yyL3mncJ.mjs";
|
|
11
|
-
import "./chunk-EDXVE4YY-B9_aGwkV.mjs";
|
|
12
|
-
import "./chunk-X2U36JSP-Cznp5Jm-.mjs";
|
|
13
|
-
import "./chunk-5FUZZQ4R-Dr4NE8rh.mjs";
|
|
14
|
-
import "./chunk-ENJZ2VHE-23pY8ft5.mjs";
|
|
15
|
-
import "./chunk-336JU56O-mJNxs0cr.mjs";
|
|
16
|
-
import { i as t, n, r, t as i } from "./chunk-4TB4RGXK-DC963IrJ.mjs";
|
|
17
|
-
//#region node_modules/mermaid/dist/chunks/mermaid.core/classDiagram-6PBFFD2Q.mjs
|
|
18
|
-
var a = {
|
|
19
|
-
parser: n,
|
|
20
|
-
get db() {
|
|
21
|
-
return new i();
|
|
22
|
-
},
|
|
23
|
-
renderer: r,
|
|
24
|
-
styles: t,
|
|
25
|
-
init: /* @__PURE__ */ e((e) => {
|
|
26
|
-
e.class || (e.class = {}), e.class.arrowMarkerAbsolute = e.arrowMarkerAbsolute;
|
|
27
|
-
}, "init")
|
|
28
|
-
};
|
|
29
|
-
//#endregion
|
|
30
|
-
export { a as diagram };
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import "./chunk-5PVQY5BW-BP7ENjg7.mjs";
|
|
2
|
-
import { h as e } from "./src-B3rrEIze.mjs";
|
|
3
|
-
import "./chunk-ICPOFSXX-BOvOTlG6.mjs";
|
|
4
|
-
import "./dist-X14EnMrO.mjs";
|
|
5
|
-
import "./chunk-U2HBQHQK-DiQOEtQH.mjs";
|
|
6
|
-
import "./chunk-FMBD7UC4-D_RQlBGX.mjs";
|
|
7
|
-
import "./chunk-BSJP7CBP-DGU2WHwh.mjs";
|
|
8
|
-
import "./chunk-ZZ45TVLE-D28EyJ6R.mjs";
|
|
9
|
-
import "./chunk-YZCP3GAM-BV02tG_z.mjs";
|
|
10
|
-
import "./chunk-55IACEB6-yyL3mncJ.mjs";
|
|
11
|
-
import "./chunk-EDXVE4YY-B9_aGwkV.mjs";
|
|
12
|
-
import "./chunk-X2U36JSP-Cznp5Jm-.mjs";
|
|
13
|
-
import "./chunk-5FUZZQ4R-Dr4NE8rh.mjs";
|
|
14
|
-
import "./chunk-ENJZ2VHE-23pY8ft5.mjs";
|
|
15
|
-
import "./chunk-336JU56O-mJNxs0cr.mjs";
|
|
16
|
-
import { i as t, n, r, t as i } from "./chunk-4TB4RGXK-DC963IrJ.mjs";
|
|
17
|
-
//#region node_modules/mermaid/dist/chunks/mermaid.core/classDiagram-v2-HSJHXN6E.mjs
|
|
18
|
-
var a = {
|
|
19
|
-
parser: n,
|
|
20
|
-
get db() {
|
|
21
|
-
return new i();
|
|
22
|
-
},
|
|
23
|
-
renderer: r,
|
|
24
|
-
styles: t,
|
|
25
|
-
init: /* @__PURE__ */ e((e) => {
|
|
26
|
-
e.class || (e.class = {}), e.class.arrowMarkerAbsolute = e.arrowMarkerAbsolute;
|
|
27
|
-
}, "init")
|
|
28
|
-
};
|
|
29
|
-
//#endregion
|
|
30
|
-
export { a as diagram };
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
import { n as e, t } from "./tw-CqxBf-1Y.mjs";
|
|
2
|
-
//#region src/components/utils/notifier/draw.ts
|
|
3
|
-
var n = {
|
|
4
|
-
success: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><circle cx=\"8\" cy=\"8\" r=\"6.25\"/><path d=\"M5.5 8.25l1.75 1.75 3.25-3.5\"/></svg>",
|
|
5
|
-
error: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><circle cx=\"8\" cy=\"8\" r=\"6.25\"/><path d=\"M8 5.25v3\"/><circle cx=\"8\" cy=\"10.75\" r=\"0.5\" fill=\"currentColor\" stroke=\"none\"/></svg>",
|
|
6
|
-
default: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><circle cx=\"8\" cy=\"8\" r=\"6.25\"/><path d=\"M8 7.25v3.25\"/><circle cx=\"8\" cy=\"5.25\" r=\"0.5\" fill=\"currentColor\" stroke=\"none\"/></svg>"
|
|
7
|
-
}, r = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"10\" height=\"10\" viewBox=\"0 0 10 10\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\"><path d=\"M2 2l6 6M8 2l-6 6\"/></svg>", i = {
|
|
8
|
-
wrapper: t("fixed z-2 bottom-5 left-5", "font-[-apple-system,BlinkMacSystemFont,\"Segoe_UI\",\"Roboto\",\"Oxygen\",\"Ubuntu\",\"Cantarell\",\"Fira_Sans\",\"Droid_Sans\",\"Helvetica_Neue\",sans-serif]"),
|
|
9
|
-
notification: t("relative flex items-start gap-2.5 w-[230px] mt-[15px] py-[13px] px-4", "bg-white shadow-notify rounded-[6px]", "text-sm leading-[1.4em] wrap-break-word overflow-hidden", "before:content-[\"\"] before:absolute before:block before:top-0 before:left-0", "before:w-[3px] before:h-[calc(100%-6px)] before:m-[3px] before:rounded-[5px] before:bg-transparent"),
|
|
10
|
-
icon: "shrink-0 mt-px",
|
|
11
|
-
iconSuccess: "text-[#34c992]",
|
|
12
|
-
iconError: "text-[#fb5d5d]",
|
|
13
|
-
iconDefault: "text-[#9ca3af]",
|
|
14
|
-
messageWrapper: "flex-1 min-w-0",
|
|
15
|
-
crossBtn: t("absolute top-[7px] right-[7px] flex items-center justify-center", "w-6 h-6 rounded opacity-40 cursor-pointer", "transition-opacity duration-150", "hover:opacity-100"),
|
|
16
|
-
btnsWrapper: "flex flex-row flex-nowrap mt-[5px]",
|
|
17
|
-
btn: "border-none rounded-[3px] text-[13px] py-[5px] px-2.5 cursor-pointer outline-hidden last:ml-2.5",
|
|
18
|
-
okBtn: "bg-[#34c992] shadow-[0_1px_1px_0_rgba(18,49,35,0.05)] text-white hover:bg-[#2db583]",
|
|
19
|
-
cancelBtn: "bg-[#f2f5f7] shadow-[0_2px_1px_0_rgba(16,19,29,0)] text-[#656b7c] hover:bg-[#e9ecee]",
|
|
20
|
-
input: t("max-w-[130px] py-[5px] px-2.5 bg-[#f7f7f7] border-0 rounded-[3px]", "text-[13px] text-[#656b7c] outline-hidden", "placeholder:text-[#656b7c] focus:placeholder:text-[rgba(101,107,124,0.3)]"),
|
|
21
|
-
successNotification: t("bg-[#fafffe]!", "before:bg-[#41ffb1]!"),
|
|
22
|
-
errorNotification: t("bg-[#fffbfb]!", "before:bg-[#fb5d5d]!"),
|
|
23
|
-
progressBar: t("absolute bottom-0 left-0 h-[2px] rounded-b-[6px]", "animate-notify-progress"),
|
|
24
|
-
progressDefault: "bg-[#d1d5db]",
|
|
25
|
-
progressSuccess: "bg-[#41ffb1]",
|
|
26
|
-
progressError: "bg-[#fb5d5d]"
|
|
27
|
-
}, a = (e) => {
|
|
28
|
-
var r;
|
|
29
|
-
let a = document.createElement("span"), o = e === "success" || e === "error" ? e : "default";
|
|
30
|
-
a.innerHTML = n[o], a.setAttribute("data-blok-testid", "notification-icon"), a.setAttribute("data-blok-style", o);
|
|
31
|
-
let s = (r = {
|
|
32
|
-
success: i.iconSuccess,
|
|
33
|
-
error: i.iconError,
|
|
34
|
-
default: i.iconDefault
|
|
35
|
-
}[o]) == null ? i.iconDefault : r;
|
|
36
|
-
return a.className = t(i.icon, s), a;
|
|
37
|
-
}, o = () => {
|
|
38
|
-
let e = document.createElement("div");
|
|
39
|
-
return e.className = i.crossBtn, e.setAttribute("data-blok-testid", "notification-cross"), e.innerHTML = r, e;
|
|
40
|
-
}, s = (e, n) => {
|
|
41
|
-
var r;
|
|
42
|
-
let a = document.createElement("div"), o = (r = {
|
|
43
|
-
success: i.progressSuccess,
|
|
44
|
-
error: i.progressError
|
|
45
|
-
}[e == null ? "" : e]) == null ? i.progressDefault : r;
|
|
46
|
-
return a.className = t(i.progressBar, o), a.setAttribute("data-blok-testid", "notification-progress"), a.style.animationDuration = `${n == null ? 8e3 : n}ms`, a;
|
|
47
|
-
}, c = (t) => {
|
|
48
|
-
let n = document.createElement("DIV"), r = t.style;
|
|
49
|
-
n.className = e(i.notification, r === "success" ? i.successNotification : r === "error" ? i.errorNotification : ""), r ? n.setAttribute("data-blok-testid", `notification-${r}`) : n.setAttribute("data-blok-testid", "notification");
|
|
50
|
-
let s = a(r);
|
|
51
|
-
n.appendChild(s);
|
|
52
|
-
let c = document.createElement("div");
|
|
53
|
-
c.className = i.messageWrapper, c.setAttribute("data-blok-testid", "notification-message"), c.innerHTML = t.message, n.appendChild(c);
|
|
54
|
-
let l = o();
|
|
55
|
-
return l.addEventListener("click", () => n.remove()), n.appendChild(l), n;
|
|
56
|
-
}, l = (e) => {
|
|
57
|
-
let n = c(e), r = n.querySelector("[data-blok-testid=\"notification-message\"]"), a = document.createElement("div"), o = document.createElement("button"), s = document.createElement("button"), l = n.querySelector("[data-blok-testid=\"notification-cross\"]"), u = e.cancelHandler, d = e.okHandler;
|
|
58
|
-
return a.className = i.btnsWrapper, a.setAttribute("data-blok-testid", "notification-buttons-wrapper"), o.innerHTML = e.okText || "Confirm", s.innerHTML = e.cancelText || "Cancel", o.className = t(i.btn, i.okBtn), s.className = t(i.btn, i.cancelBtn), o.setAttribute("data-blok-testid", "notification-confirm-button"), s.setAttribute("data-blok-testid", "notification-cancel-button"), u && typeof u == "function" && s.addEventListener("click", u), u && typeof u == "function" && l && l.addEventListener("click", u), d && typeof d == "function" && o.addEventListener("click", d), o.addEventListener("click", () => n.remove()), s.addEventListener("click", () => n.remove()), a.appendChild(o), a.appendChild(s), r ? r.appendChild(a) : n.appendChild(a), n;
|
|
59
|
-
}, u = (e) => {
|
|
60
|
-
let n = c(e), r = n.querySelector("[data-blok-testid=\"notification-message\"]"), a = document.createElement("div"), o = document.createElement("button"), s = document.createElement("input"), l = n.querySelector("[data-blok-testid=\"notification-cross\"]"), u = e.cancelHandler, d = e.okHandler;
|
|
61
|
-
return a.className = i.btnsWrapper, o.innerHTML = e.okText || "Ok", o.className = t(i.btn, i.okBtn), s.className = i.input, s.setAttribute("data-blok-testid", "notification-input"), e.placeholder && s.setAttribute("placeholder", e.placeholder), e.default && (s.value = e.default), e.inputType && (s.type = e.inputType), u && typeof u == "function" && l && l.addEventListener("click", u), d && typeof d == "function" && o.addEventListener("click", () => {
|
|
62
|
-
d(s.value);
|
|
63
|
-
}), o.addEventListener("click", () => n.remove()), a.appendChild(s), a.appendChild(o), r ? r.appendChild(a) : n.appendChild(a), n;
|
|
64
|
-
}, d = () => {
|
|
65
|
-
let e = document.createElement("DIV");
|
|
66
|
-
return e.className = i.wrapper, e.setAttribute("data-blok-testid", "notifier-container"), e;
|
|
67
|
-
}, f = 8e3, p = (e) => {
|
|
68
|
-
e.classList.add("animate-notify-slide-out"), e.addEventListener("animationend", () => {
|
|
69
|
-
e.remove();
|
|
70
|
-
}, { once: !0 });
|
|
71
|
-
}, m = () => {
|
|
72
|
-
let e = document.querySelector("[data-blok-testid=\"notifier-container\"]");
|
|
73
|
-
if (e) return e;
|
|
74
|
-
let t = d();
|
|
75
|
-
return document.body.appendChild(t), t;
|
|
76
|
-
}, h = (e) => {
|
|
77
|
-
if (!e.message) return;
|
|
78
|
-
let t = m(), n = e.time || f, r = (() => {
|
|
79
|
-
let t = e.type;
|
|
80
|
-
if (t === "confirm") return l(e);
|
|
81
|
-
if (t === "prompt") return u(e);
|
|
82
|
-
let r = c(e), i = s(e.style, n);
|
|
83
|
-
r.appendChild(i);
|
|
84
|
-
let a = r.querySelector("[data-blok-testid=\"notification-cross\"]");
|
|
85
|
-
if (a) {
|
|
86
|
-
let e = a.cloneNode(!0);
|
|
87
|
-
a.replaceWith(e), e.addEventListener("click", () => p(r));
|
|
88
|
-
}
|
|
89
|
-
return window.setTimeout(() => {
|
|
90
|
-
p(r);
|
|
91
|
-
}, n), r;
|
|
92
|
-
})();
|
|
93
|
-
t && r && (t.appendChild(r), r.className = `${r.className} animate-notify-slide-in`, r.setAttribute("data-blok-bounce-in", "true"));
|
|
94
|
-
}, g = { show: h };
|
|
95
|
-
//#endregion
|
|
96
|
-
export { g as Notifier, h as show };
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import "./chunk-5PVQY5BW-BP7ENjg7.mjs";
|
|
2
|
-
import { h as e } from "./src-B3rrEIze.mjs";
|
|
3
|
-
import "./chunk-ICPOFSXX-BOvOTlG6.mjs";
|
|
4
|
-
import "./dist-X14EnMrO.mjs";
|
|
5
|
-
import "./chunk-U2HBQHQK-DiQOEtQH.mjs";
|
|
6
|
-
import "./chunk-BSJP7CBP-DGU2WHwh.mjs";
|
|
7
|
-
import "./chunk-ZZ45TVLE-D28EyJ6R.mjs";
|
|
8
|
-
import "./chunk-55IACEB6-yyL3mncJ.mjs";
|
|
9
|
-
import "./chunk-EDXVE4YY-B9_aGwkV.mjs";
|
|
10
|
-
import "./chunk-X2U36JSP-Cznp5Jm-.mjs";
|
|
11
|
-
import "./chunk-5FUZZQ4R-Dr4NE8rh.mjs";
|
|
12
|
-
import "./chunk-ENJZ2VHE-23pY8ft5.mjs";
|
|
13
|
-
import "./chunk-336JU56O-mJNxs0cr.mjs";
|
|
14
|
-
import { i as t, n, r, t as i } from "./chunk-OYMX7WX6-CKjTvqTg.mjs";
|
|
15
|
-
//#region node_modules/mermaid/dist/chunks/mermaid.core/stateDiagram-v2-QKLJ7IA2.mjs
|
|
16
|
-
var a = {
|
|
17
|
-
parser: n,
|
|
18
|
-
get db() {
|
|
19
|
-
return new i(2);
|
|
20
|
-
},
|
|
21
|
-
renderer: r,
|
|
22
|
-
styles: t,
|
|
23
|
-
init: /* @__PURE__ */ e((e) => {
|
|
24
|
-
e.state || (e.state = {}), e.state.arrowMarkerAbsolute = e.arrowMarkerAbsolute;
|
|
25
|
-
}, "init")
|
|
26
|
-
};
|
|
27
|
-
//#endregion
|
|
28
|
-
export { a as diagram };
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|