@nldd/design-system 0.27.0 → 0.28.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/custom-elements.json +5666 -5882
- package/dist/cdn/autoloader.js +140 -141
- package/dist/cdn/chunks/{accordion-DBM4AcGb.js → accordion-BcmquOub.js} +4 -4
- package/dist/cdn/chunks/{accordion-item-D90CmJyl.js → accordion-item-XIX9-01D.js} +4 -4
- package/dist/cdn/chunks/{activity-indicator-B6m9h0oa.js → activity-indicator-DXZ_IqAa.js} +14 -14
- package/dist/cdn/chunks/{admonition-B-YTkCjn.js → admonition-DIcSNzcO.js} +4 -4
- package/dist/cdn/chunks/{avatar-CfBP9UZZ.js → avatar-DG0uG2Eu.js} +23 -23
- package/dist/cdn/chunks/{avatar-group-DW_xMwb_.js → avatar-group-DYOrOs6f.js} +16 -15
- package/dist/cdn/chunks/{badge-DnAuIhp1.js → badge-DfxWgcGT.js} +9 -9
- package/dist/cdn/chunks/{banner-CRk2ARtC.js → banner-Bg2LBBIY.js} +11 -11
- package/dist/cdn/chunks/{bar-split-view-DDgOYs7Z.js → bar-split-view-C0WvMmEi.js} +11 -6
- package/dist/cdn/chunks/{blockquote-DlfhBScg.js → blockquote-Ck5AQfWo.js} +7 -7
- package/dist/cdn/chunks/{box-DdU13yI4.js → box-BAZsRjBx.js} +3 -3
- package/dist/cdn/chunks/{breadcrumbs-CqkR_6XN.js → breadcrumbs-8X_HdTjk.js} +12 -12
- package/dist/cdn/chunks/{button-bar-BKkap9nk.js → button-bar-DyO3sMIB.js} +8 -8
- package/dist/cdn/chunks/{button-group-D-YTmErV.js → button-group-BfH8ZDe-.js} +8 -8
- package/dist/cdn/chunks/{button-muXGJHlo.js → button-rQihZDPs.js} +75 -79
- package/dist/cdn/chunks/{card-Dvqz83fC.js → card-Gwu3NVqY.js} +21 -11
- package/dist/cdn/chunks/{cell-C0O8tZbX.js → cell-Dbf536SX.js} +6 -6
- package/dist/cdn/chunks/{checkbox-CNWROiHV.js → checkbox-BI4FMRr3.js} +21 -21
- package/dist/cdn/chunks/{checkbox-field-DCYpRJfz.js → checkbox-field-CC00Cz23.js} +15 -15
- package/dist/cdn/chunks/{checkbox-group-DxWAYp_b.js → checkbox-group-B32_gJY6.js} +12 -12
- package/dist/cdn/chunks/{class-map-D720ceWJ.js → class-map-DfeulNZ_.js} +1 -1
- package/dist/cdn/chunks/{code-editor-DlnTXkHx.js → code-editor-BZ-dPqXq.js} +13 -13
- package/dist/cdn/chunks/{code-viewer-DyJzo36-.js → code-viewer-Bz7wk-Zj.js} +17 -17
- package/dist/cdn/chunks/{codemirror-input-DPSOMYZ4.js → codemirror-input-CBuhqk5Y.js} +5 -5
- package/dist/cdn/chunks/{collection-i7H8zkQ8.js → collection-CB6_y2t8.js} +13 -13
- package/dist/cdn/chunks/{combo-box-CpNl_us0.js → combo-box-BqY6lvfT.js} +42 -42
- package/dist/cdn/chunks/{container-YWW7mHNa.js → container-D4G6IZic.js} +9 -9
- package/dist/cdn/chunks/{custom-element-D8yf5dqU.js → custom-element-zgCtSWGH.js} +1 -1
- package/dist/cdn/chunks/{custom-font-size-D7KNr84p.js → custom-font-size-D-U1Z_wx.js} +1 -1
- package/dist/cdn/chunks/{date-field-DzhUp4Rk.js → date-field-BBoAp1Qn.js} +35 -35
- package/dist/cdn/chunks/{date-picker-CGvsvK3g.js → date-picker-DJIaeQzM.js} +23 -23
- package/dist/cdn/chunks/{decorate-1aEyfetK.js → decorate-CXvSUV9i.js} +1 -1
- package/dist/cdn/chunks/{described-by-mixin-DffYoaxu.js → described-by-mixin-Bl8QgshZ.js} +3 -3
- package/dist/cdn/chunks/{description-cell-DEw6xc2o.js → description-cell-CCq3LiDa.js} +6 -6
- package/dist/cdn/chunks/{dev-checks-CTopJcdE.js → dev-checks-DG6-EY8p.js} +238 -225
- package/dist/cdn/chunks/{directive-helpers-BQml5ahH.js → directive-helpers-DuLEIDjM.js} +1 -1
- package/dist/cdn/chunks/{dist-DevfJ4Mu.js → dist-B0EhnbLL.js} +2 -2
- package/dist/cdn/chunks/{dist-DAf6EMuK.js → dist-B7T6GKkq.js} +2 -2
- package/dist/cdn/chunks/{dist-BYbLHkMP.js → dist-BFj2d0kQ.js} +1 -1
- package/dist/cdn/chunks/{dist-B5t9fS8q.js → dist-BPqRc_Nn.js} +2 -2
- package/dist/cdn/chunks/{dist-B87Ag4L-.js → dist-BT1-y5Tb.js} +1 -1
- package/dist/cdn/chunks/{dist-BKnqQxdv.js → dist-C8OAxmvo.js} +1 -1
- package/dist/cdn/chunks/{dist-C8ZY_QIK.js → dist-CMreNjZ0.js} +1 -1
- package/dist/cdn/chunks/{dist-qHSPGfTO.js → dist-CyDG2Stm.js} +1 -1
- package/dist/cdn/chunks/{dist-D59Ae7dj.js → dist-DuZZX8oT.js} +1 -1
- package/dist/cdn/chunks/{dist-CIX4JLW1.js → dist-Mx6eY_XI.js} +3 -3
- package/dist/cdn/chunks/{dist-Cr8NctvS.js → dist-QIVpZOok.js} +3 -3
- package/dist/cdn/chunks/{divider-44rkHLYj.js → divider-CtNxoBXu.js} +2 -2
- package/dist/cdn/chunks/{document-tab-bar-CcSKzhEy.js → document-tab-bar-C0RWhx9m.js} +23 -23
- package/dist/cdn/chunks/{dropdown-CJPjI-p1.js → dropdown-Bc0en6CR.js} +19 -19
- package/dist/cdn/chunks/{element-state-B-44fVqq.js → element-state-D-J_cHEV.js} +9 -3
- package/dist/cdn/chunks/{field-button-controller-yvICuXoE.js → field-button-controller-DKej3aXU.js} +1 -1
- package/dist/cdn/chunks/{file-field-B4HQKpkI.js → file-field-ab-WShTI.js} +29 -29
- package/dist/cdn/chunks/{form-obggZEpt.js → form-DUkQXtMT.js} +9 -6
- package/dist/cdn/chunks/{form-actions-HaBfh6vm.js → form-actions-DAA4feSG.js} +21 -17
- package/dist/cdn/chunks/{form-associated-mixin-BByNH679.js → form-associated-mixin-D9E51k93.js} +3 -3
- package/dist/cdn/chunks/{form-field-CwYXsuvv.js → form-field-DlLMimbj.js} +72 -63
- package/dist/cdn/chunks/form-field.i18n-B-UZduXL.js +3 -0
- package/dist/cdn/chunks/{form-section-B2UZx_-z.js → form-section-BvBuApsD.js} +1 -1
- package/dist/cdn/chunks/{full-bleed-section-BSnWghWY.js → full-bleed-section-CTaKn0tf.js} +3 -3
- package/dist/cdn/chunks/{hero-CzbuEAUM.js → hero-Dd5p9i9u.js} +23 -23
- package/dist/cdn/chunks/{icon-CkCT7sPE.js → icon-D4fRZxV2.js} +9 -9
- package/dist/cdn/chunks/{icon-button-BBGwCfYp.js → icon-button-DOaYzHj0.js} +64 -68
- package/dist/cdn/chunks/{icon-cell-DcHnXV-8.js → icon-cell-CywVVCYz.js} +9 -9
- package/dist/cdn/chunks/{identity-C0fujsxK.js → identity-DKFLeTaG.js} +6 -6
- package/dist/cdn/chunks/{if-defined-CL4nn-Q-.js → if-defined-DmACWFoP.js} +1 -1
- package/dist/cdn/chunks/{image-BgtqLXfM.js → image-DSXL5nMx.js} +21 -21
- package/dist/cdn/chunks/{inline-dialog-BYRIWhkm.js → inline-dialog-_TYBWEal.js} +14 -14
- package/dist/cdn/chunks/{interest-invoker-CfOJaqZQ.js → interest-invoker-CxvYA5Qy.js} +1 -1
- package/dist/cdn/chunks/{just-in-time-education-DwH3ubhZ.js → just-in-time-education-CXJOozIu.js} +17 -17
- package/dist/cdn/chunks/{kanban-BIZUoBj-.js → kanban-DNLzjjc_.js} +10 -10
- package/dist/cdn/chunks/{kanban-column-CtjCIgaR.js → kanban-column-eo2SYTGR.js} +4 -4
- package/dist/cdn/chunks/{keyboard-shortcut-BHylGMNu.js → keyboard-shortcut-DZ-mqzxk.js} +13 -13
- package/dist/cdn/chunks/{languages-DghCYmiz.js → languages-DOvFU6aa.js} +12 -12
- package/dist/cdn/chunks/{link-S53veJpD.js → link-C2Tm_F2F.js} +16 -16
- package/dist/cdn/chunks/{link-group-B2_vdANe.js → link-group-BKeEUdjA.js} +6 -6
- package/dist/cdn/chunks/{link-hint-KFhgr5Ng.js → link-hint-x3C1uwSo.js} +1 -1
- package/dist/cdn/chunks/{list-C8hY4uGW.js → list-DXBgXtok.js} +18 -18
- package/dist/cdn/chunks/{list-item-CK1Rli4F.js → list-item-CBIk8V1o.js} +85 -88
- package/dist/cdn/chunks/{list-item-segment-KyrcOFDA.js → list-item-segment-BJAJO78S.js} +16 -16
- package/dist/cdn/chunks/{menu-m67vk1Z4.js → menu-NHTlulPo.js} +38 -29
- package/dist/cdn/chunks/{menu-bar-BRoqy5zp.js → menu-bar-BplgndmQ.js} +34 -34
- package/dist/cdn/chunks/{menu-bar-item-DKW198ZW.js → menu-bar-item-1ymZKx5B.js} +44 -43
- package/dist/cdn/chunks/{menu-divider-DDPBPK-o.js → menu-divider-A_WVVPRj.js} +3 -3
- package/dist/cdn/chunks/{menu-group-uZXsE-uu.js → menu-group-BxdR9cIB.js} +4 -4
- package/dist/cdn/chunks/{menu-item-BOvb4QLd.js → menu-item-CfSzAmYP.js} +21 -21
- package/dist/cdn/chunks/{menu.template-v6VnRUNJ.js → menu.template-BQg9CFZU.js} +6 -6
- package/dist/cdn/chunks/{modal-dialog-BNq0r-1L.js → modal-dialog-CRoItKeC.js} +4 -4
- package/dist/cdn/chunks/{multi-line-text-field-Bfq47I3P.js → multi-line-text-field-Dyyhaixb.js} +36 -36
- package/dist/cdn/chunks/{navigation-split-view-BiPoxCLL.js → navigation-split-view-C40LLsnq.js} +65 -57
- package/dist/cdn/chunks/nl.generated-B194RR-y.js +118 -0
- package/dist/cdn/chunks/{notification-DjZXBv4J.js → notification-DCJBxwgA.js} +10 -10
- package/dist/cdn/chunks/{number-field-tqoQLrgZ.js → number-field-DsZcWhVJ.js} +23 -23
- package/dist/cdn/chunks/{one-half-one-half-section-CyIm21PD.js → one-half-one-half-section-C7iwuCox.js} +3 -3
- package/dist/cdn/chunks/{one-third-two-thirds-section-CpnK0vzB.js → one-third-two-thirds-section-viwFsAKX.js} +3 -3
- package/dist/cdn/chunks/{one-time-code-field-6sMEfzoY.js → one-time-code-field-BK1dcrkM.js} +25 -25
- package/dist/cdn/chunks/{overflow-menu-IfYEX8tm.js → overflow-menu-b9-YGrjH.js} +1 -1
- package/dist/cdn/chunks/{owner-form-Cq8tT7ac.js → owner-form-Bl_p0Ca4.js} +1 -1
- package/dist/cdn/chunks/{page-w4XAfBWD.js → page-DtZ9Ef4H.js} +54 -53
- package/dist/cdn/chunks/{page-footer-ET6j1N2Z.js → page-footer-DnBD0aG2.js} +10 -10
- package/dist/cdn/chunks/{page-section-mixin-D9JL2q9A.js → page-section-mixin-BhtKGjf2.js} +3 -3
- package/dist/cdn/chunks/{pagination-D7QFUu8x.js → pagination-Bw6rA75o.js} +16 -16
- package/dist/cdn/chunks/{password-field-Ck5wx6pg.js → password-field-DvEggyk3.js} +33 -33
- package/dist/cdn/chunks/{popover-DOmi5m85.js → popover-BS_tKHY-.js} +18 -18
- package/dist/cdn/chunks/{progress-bar-BDNcB06i.js → progress-bar-DjbR_gfZ.js} +30 -30
- package/dist/cdn/chunks/{progress-circle-BAMztpb3.js → progress-circle-Cz9PLyQK.js} +27 -27
- package/dist/cdn/chunks/{radio-button-DAps6n0Q.js → radio-button-D8mtS3no.js} +50 -53
- package/dist/cdn/chunks/{radio-button-field-BbPk0nM_.js → radio-button-field-BW0hpqWv.js} +14 -14
- package/dist/cdn/chunks/{radio-button-group-lxzwku00.js → radio-button-group-9q5EIa2C.js} +12 -12
- package/dist/cdn/chunks/{render-marked-ClMFyNu0.js → render-marked-Ux8zPP_h.js} +1 -1
- package/dist/cdn/chunks/{reorder-handle-cell-Cap2u2zx.js → reorder-handle-cell-Du9jl_rB.js} +4 -4
- package/dist/cdn/chunks/{reorder-handle-mixin-CnRKPVqU.js → reorder-handle-mixin-Bk1J-pVX.js} +2 -2
- package/dist/cdn/chunks/{repeat-CIyCvHHQ.js → repeat-DxDrgDAx.js} +2 -2
- package/dist/cdn/chunks/{rich-text-CblFmHY-.js → rich-text--3YgH9Ad.js} +7 -7
- package/dist/cdn/chunks/{row-header-mixin-C8z9StDU.js → row-header-mixin-DcfVBdj0.js} +2 -2
- package/dist/cdn/chunks/{scroll-fade-C_L9CJrR.js → scroll-fade-BqyBYmMY.js} +2 -2
- package/dist/cdn/chunks/scroll-mode-controller-CuCRKyLT.js +55 -0
- package/dist/cdn/chunks/{search-field-JeUPcBjZ.js → search-field-DvqETt9_.js} +21 -21
- package/dist/cdn/chunks/{segmented-control-DtycvVyp.js → segmented-control-Bc0JEwuo.js} +86 -91
- package/dist/cdn/chunks/{shadow-resets-DgR56wQK.js → shadow-resets-BerORb5_.js} +2 -2
- package/dist/cdn/chunks/{sheet-XtRs26hN.js → sheet-O_29ylNf.js} +4 -4
- package/dist/cdn/chunks/{shell-CCaEEGna.js → shell-wlMaUZMA.js} +4 -4
- package/dist/cdn/chunks/{side-by-side-split-view-mhXD4Lde.js → side-by-side-split-view-CLd3Nale.js} +7 -5
- package/dist/cdn/chunks/{sidebar-section-Cwd4LSE6.js → sidebar-section-CM5FBrQy.js} +16 -16
- package/dist/cdn/chunks/{simple-section-BuiaCGks.js → simple-section-CnYSz59b.js} +3 -3
- package/dist/cdn/chunks/{skip-link-nTlmioFt.js → skip-link-BSWXUiUo.js} +5 -5
- package/dist/cdn/chunks/{slider-C0rNQEIY.js → slider-Cz9TWQ1q.js} +30 -24
- package/dist/cdn/chunks/{slotted-block-xNpJoXLz.js → slotted-block-MzAN2mbY.js} +1 -1
- package/dist/cdn/chunks/{spacer-CeSO9CP1.js → spacer-Di1FKF1H.js} +2 -2
- package/dist/cdn/chunks/{spacer-cell-NhlxEdhA.js → spacer-cell-DxLzLJCd.js} +4 -4
- package/dist/cdn/chunks/{split-button-BR-ccA6_.js → split-button-D8g_ndEY.js} +26 -26
- package/dist/cdn/chunks/{split-view-divider-HcIV0yli.js → split-view-divider-BRYFJldk.js} +2 -2
- package/dist/cdn/chunks/{stacked-split-view-j77p3uE2.js → stacked-split-view-BKKmNsjn.js} +7 -5
- package/dist/cdn/chunks/{static-html-CGoLwgpW.js → static-html-BuLHPpfA.js} +1 -1
- package/dist/cdn/chunks/{status-bar-ByJ21hV2.js → status-bar-CHZ0l8TZ.js} +8 -8
- package/dist/cdn/chunks/{step-bar-CRxF0S42.js → step-bar-C1MPbS7g.js} +15 -16
- package/dist/cdn/chunks/{step-bar.i18n-DocExlD7.js → step-bar.i18n-DipTJYgp.js} +2 -1
- package/dist/cdn/chunks/{step-cell-C-gOxNA6.js → step-cell-27LEuImu.js} +14 -14
- package/dist/cdn/chunks/{stepper-Dmljb7Qc.js → stepper-CFnmm4Jc.js} +19 -19
- package/dist/cdn/chunks/{style-map-CK811FGv.js → style-map-CT-UKis2.js} +1 -1
- package/dist/cdn/chunks/{swatch-picker-DtAgTXLo.js → swatch-picker-qcDRmYxS.js} +49 -44
- package/dist/cdn/chunks/{switch-Bqion92b.js → switch-DF_LNJMR.js} +20 -20
- package/dist/cdn/chunks/{switch-field-CWobTcEn.js → switch-field-BKIKn9wq.js} +13 -13
- package/dist/cdn/chunks/{tab-bar-DPtRjP8Z.js → tab-bar-VVZNYCSU.js} +27 -27
- package/dist/cdn/chunks/{table-C4CFiDgr.js → table-DfKFKaDW.js} +11 -11
- package/dist/cdn/chunks/{tag-Bo23A60g.js → tag-CJQEzBXC.js} +5 -5
- package/dist/cdn/chunks/{term-DPMEWR-t.js → term-D3QB0GN-.js} +16 -16
- package/dist/cdn/chunks/{text-CuiMvMZQ.js → text-GAY_Be6G.js} +11 -11
- package/dist/cdn/chunks/{text-cell-E3yc99xw.js → text-cell-D9qxQeCY.js} +13 -13
- package/dist/cdn/chunks/{text-editor-BVmHiq_b.js → text-editor-C1-K1z1w.js} +975 -970
- package/dist/cdn/chunks/{text-field-DOv1aI_F.js → text-field-Bq_41L1a.js} +34 -34
- package/dist/cdn/chunks/{time-field-BhlLk6tt.js → time-field-Bqny9JeT.js} +35 -35
- package/dist/cdn/chunks/{time-picker-A4-HeVas.js → time-picker-DMaxOCDt.js} +12 -12
- package/dist/cdn/chunks/{title-EMt-SYKV.js → title-Dxhkfehz.js} +6 -6
- package/dist/cdn/chunks/{title-cell--EE-L_8a.js → title-cell-BDvpoBrO.js} +11 -11
- package/dist/cdn/chunks/{toggle-button-BLwpxmQs.js → toggle-button-CcIX98G1.js} +35 -35
- package/dist/cdn/chunks/{toggle-button-group-scdxolJt.js → toggle-button-group-Dyqjqg2D.js} +13 -13
- package/dist/cdn/chunks/{token-DVgXuCRO.js → token-BBS6BXwU.js} +11 -11
- package/dist/cdn/chunks/{token-field-CICQXLlO.js → token-field-CO6N6wZW.js} +26 -26
- package/dist/cdn/chunks/{toolbar-Des2gaH2.js → toolbar--slFc4EX.js} +32 -23
- package/dist/cdn/chunks/toolbar-item-j9QbC5s5.js +77 -0
- package/dist/cdn/chunks/{toolbar-title-PoOf794l.js → toolbar-title-D_BBNlB2.js} +36 -22
- package/dist/cdn/chunks/{toolbar.styles-DzreUGTp.js → toolbar.styles-CKxRmIg-.js} +19 -17
- package/dist/cdn/chunks/{tooltip-CMCT2iiD.js → tooltip-bqAbXl2W.js} +33 -25
- package/dist/cdn/chunks/{top-navigation-bar-BfMGgTIy.js → top-navigation-bar-D26UoOIz.js} +28 -28
- package/dist/cdn/chunks/{top-title-bar-CvvldlNt.js → top-title-bar-DtXWxtJF.js} +12 -12
- package/dist/cdn/chunks/{translations-C5JpcNNC.js → translations-DsTLnxKh.js} +1 -1
- package/dist/cdn/chunks/{two-thirds-one-third-section-BTkeIiHm.js → two-thirds-one-third-section-D1R62yzp.js} +3 -3
- package/dist/cdn/chunks/{validation-list-BasB3ZaT.js → validation-list-DlJ18Ojt.js} +35 -42
- package/dist/cdn/chunks/{visibility-mixin-BxhcJG-x.js → visibility-mixin-Bkc9mSOZ.js} +2 -2
- package/dist/cdn/chunks/{visually-hidden-ByHY8pKl.js → visually-hidden-CNq15vm2.js} +2 -2
- package/dist/cdn/chunks/{window-B5blEfMR.js → window-B3gyQQvV.js} +11 -11
- package/dist/cdn/chunks/{with-translations-QDhHJYMT.js → with-translations-BJzVHQmV.js} +3 -3
- package/dist/components/actions/button/button.d.ts +45 -44
- package/dist/components/actions/button/button.d.ts.map +1 -1
- package/dist/components/actions/button/button.js +90 -87
- package/dist/components/actions/button/button.js.map +1 -1
- package/dist/components/actions/button/button.styles.js +2 -2
- package/dist/components/actions/button-bar/button-bar.d.ts +2 -2
- package/dist/components/actions/button-bar/button-bar.d.ts.map +1 -1
- package/dist/components/actions/button-bar/button-bar.js +6 -6
- package/dist/components/actions/button-bar/button-bar.js.map +1 -1
- package/dist/components/actions/button-group/button-group.d.ts +2 -2
- package/dist/components/actions/button-group/button-group.d.ts.map +1 -1
- package/dist/components/actions/button-group/button-group.js +5 -5
- package/dist/components/actions/button-group/button-group.js.map +1 -1
- package/dist/components/actions/icon-button/icon-button.d.ts +50 -49
- package/dist/components/actions/icon-button/icon-button.d.ts.map +1 -1
- package/dist/components/actions/icon-button/icon-button.js +91 -88
- package/dist/components/actions/icon-button/icon-button.js.map +1 -1
- package/dist/components/actions/icon-button/icon-button.styles.js +2 -2
- package/dist/components/actions/menu/menu-item.d.ts +16 -16
- package/dist/components/actions/menu/menu-item.d.ts.map +1 -1
- package/dist/components/actions/menu/menu-item.js +33 -33
- package/dist/components/actions/menu/menu-item.js.map +1 -1
- package/dist/components/actions/menu/menu.d.ts +32 -23
- package/dist/components/actions/menu/menu.d.ts.map +1 -1
- package/dist/components/actions/menu/menu.js +65 -41
- package/dist/components/actions/menu/menu.js.map +1 -1
- package/dist/components/actions/split-button/split-button.d.ts +22 -22
- package/dist/components/actions/split-button/split-button.d.ts.map +1 -1
- package/dist/components/actions/split-button/split-button.js +40 -40
- package/dist/components/actions/split-button/split-button.js.map +1 -1
- package/dist/components/actions/split-button/split-button.template.js +2 -2
- package/dist/components/actions/split-button/split-button.template.js.map +1 -1
- package/dist/components/actions/toolbar/toolbar-item.d.ts +23 -11
- package/dist/components/actions/toolbar/toolbar-item.d.ts.map +1 -1
- package/dist/components/actions/toolbar/toolbar-item.js +33 -22
- package/dist/components/actions/toolbar/toolbar-item.js.map +1 -1
- package/dist/components/actions/toolbar/toolbar-title.d.ts +10 -3
- package/dist/components/actions/toolbar/toolbar-title.d.ts.map +1 -1
- package/dist/components/actions/toolbar/toolbar-title.js +18 -9
- package/dist/components/actions/toolbar/toolbar-title.js.map +1 -1
- package/dist/components/actions/toolbar/toolbar.d.ts +2 -2
- package/dist/components/actions/toolbar/toolbar.d.ts.map +1 -1
- package/dist/components/actions/toolbar/toolbar.js +23 -21
- package/dist/components/actions/toolbar/toolbar.js.map +1 -1
- package/dist/components/actions/toolbar/toolbar.styles.d.ts.map +1 -1
- package/dist/components/actions/toolbar/toolbar.styles.js +16 -14
- package/dist/components/actions/toolbar/toolbar.styles.js.map +1 -1
- package/dist/components/content/avatar/avatar.d.ts +18 -18
- package/dist/components/content/avatar/avatar.d.ts.map +1 -1
- package/dist/components/content/avatar/avatar.js +32 -32
- package/dist/components/content/avatar/avatar.js.map +1 -1
- package/dist/components/content/avatar-group/avatar-group.styles.d.ts.map +1 -1
- package/dist/components/content/avatar-group/avatar-group.styles.js +1 -0
- package/dist/components/content/avatar-group/avatar-group.styles.js.map +1 -1
- package/dist/components/content/blockquote/blockquote.d.ts +2 -2
- package/dist/components/content/blockquote/blockquote.d.ts.map +1 -1
- package/dist/components/content/blockquote/blockquote.js +5 -5
- package/dist/components/content/blockquote/blockquote.js.map +1 -1
- package/dist/components/content/code-viewer/code-viewer.d.ts +3 -3
- package/dist/components/content/code-viewer/code-viewer.d.ts.map +1 -1
- package/dist/components/content/code-viewer/code-viewer.js +11 -11
- package/dist/components/content/code-viewer/code-viewer.js.map +1 -1
- package/dist/components/content/icon/icon.d.ts +4 -4
- package/dist/components/content/icon/icon.d.ts.map +1 -1
- package/dist/components/content/icon/icon.js +10 -10
- package/dist/components/content/icon/icon.js.map +1 -1
- package/dist/components/content/image/image.d.ts +27 -30
- package/dist/components/content/image/image.d.ts.map +1 -1
- package/dist/components/content/image/image.js +44 -47
- package/dist/components/content/image/image.js.map +1 -1
- package/dist/components/content/keyboard-shortcut/keyboard-shortcut.d.ts +15 -15
- package/dist/components/content/keyboard-shortcut/keyboard-shortcut.d.ts.map +1 -1
- package/dist/components/content/keyboard-shortcut/keyboard-shortcut.js +24 -24
- package/dist/components/content/keyboard-shortcut/keyboard-shortcut.js.map +1 -1
- package/dist/components/content/rich-text/rich-text.d.ts +2 -2
- package/dist/components/content/rich-text/rich-text.d.ts.map +1 -1
- package/dist/components/content/rich-text/rich-text.js +5 -5
- package/dist/components/content/rich-text/rich-text.js.map +1 -1
- package/dist/components/content/term/term.d.ts +2 -2
- package/dist/components/content/term/term.d.ts.map +1 -1
- package/dist/components/content/term/term.js +5 -5
- package/dist/components/content/term/term.js.map +1 -1
- package/dist/components/content/text/text.d.ts +3 -3
- package/dist/components/content/text/text.d.ts.map +1 -1
- package/dist/components/content/text/text.js +8 -8
- package/dist/components/content/text/text.js.map +1 -1
- package/dist/components/content/token/token.d.ts +4 -4
- package/dist/components/content/token/token.d.ts.map +1 -1
- package/dist/components/content/token/token.js +10 -10
- package/dist/components/content/token/token.js.map +1 -1
- package/dist/components/content/tooltip/tooltip.d.ts +6 -9
- package/dist/components/content/tooltip/tooltip.d.ts.map +1 -1
- package/dist/components/content/tooltip/tooltip.js +34 -16
- package/dist/components/content/tooltip/tooltip.js.map +1 -1
- package/dist/components/content/tooltip/tooltip.styles.d.ts.map +1 -1
- package/dist/components/content/tooltip/tooltip.styles.js +1 -0
- package/dist/components/content/tooltip/tooltip.styles.js.map +1 -1
- package/dist/components/forms/form/form.d.ts +3 -17
- package/dist/components/forms/form/form.d.ts.map +1 -1
- package/dist/components/forms/form/form.js +12 -24
- package/dist/components/forms/form/form.js.map +1 -1
- package/dist/components/forms/form-actions/form-actions.d.ts +10 -10
- package/dist/components/forms/form-actions/form-actions.d.ts.map +1 -1
- package/dist/components/forms/form-actions/form-actions.js +18 -10
- package/dist/components/forms/form-actions/form-actions.js.map +1 -1
- package/dist/components/forms/form-actions/form-actions.styles.js +4 -4
- package/dist/components/forms/form-field/form-field.d.ts +20 -8
- package/dist/components/forms/form-field/form-field.d.ts.map +1 -1
- package/dist/components/forms/form-field/form-field.i18n.d.ts +5 -0
- package/dist/components/forms/form-field/form-field.i18n.d.ts.map +1 -0
- package/dist/components/forms/form-field/form-field.i18n.js +4 -0
- package/dist/components/forms/form-field/form-field.i18n.js.map +1 -0
- package/dist/components/forms/form-field/form-field.js +46 -18
- package/dist/components/forms/form-field/form-field.js.map +1 -1
- package/dist/components/forms/form-field/form-field.styles.js +12 -12
- package/dist/components/forms/form-field/form-field.template.js +1 -1
- package/dist/components/forms/form-field/form-field.template.js.map +1 -1
- package/dist/components/forms/validation-list/validation-list.d.ts +23 -12
- package/dist/components/forms/validation-list/validation-list.d.ts.map +1 -1
- package/dist/components/forms/validation-list/validation-list.js +45 -30
- package/dist/components/forms/validation-list/validation-list.js.map +1 -1
- package/dist/components/forms/validation-list/validation-list.styles.js +2 -2
- package/dist/components/index.d.ts +0 -1
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +0 -1
- package/dist/components/index.js.map +1 -1
- package/dist/components/inputs/checkbox/checkbox.d.ts +16 -16
- package/dist/components/inputs/checkbox/checkbox.d.ts.map +1 -1
- package/dist/components/inputs/checkbox/checkbox.js +29 -29
- package/dist/components/inputs/checkbox/checkbox.js.map +1 -1
- package/dist/components/inputs/checkbox-field/checkbox-field.d.ts +20 -20
- package/dist/components/inputs/checkbox-field/checkbox-field.d.ts.map +1 -1
- package/dist/components/inputs/checkbox-field/checkbox-field.js +28 -28
- package/dist/components/inputs/checkbox-field/checkbox-field.js.map +1 -1
- package/dist/components/inputs/checkbox-group/checkbox-group.d.ts +9 -9
- package/dist/components/inputs/checkbox-group/checkbox-group.d.ts.map +1 -1
- package/dist/components/inputs/checkbox-group/checkbox-group.js +18 -18
- package/dist/components/inputs/checkbox-group/checkbox-group.js.map +1 -1
- package/dist/components/inputs/code-editor/code-editor.d.ts +13 -13
- package/dist/components/inputs/code-editor/code-editor.d.ts.map +1 -1
- package/dist/components/inputs/code-editor/code-editor.js +8 -8
- package/dist/components/inputs/code-editor/code-editor.js.map +1 -1
- package/dist/components/inputs/combo-box/combo-box.d.ts +34 -34
- package/dist/components/inputs/combo-box/combo-box.d.ts.map +1 -1
- package/dist/components/inputs/combo-box/combo-box.js +66 -66
- package/dist/components/inputs/combo-box/combo-box.js.map +1 -1
- package/dist/components/inputs/date-field/date-field.d.ts +24 -24
- package/dist/components/inputs/date-field/date-field.d.ts.map +1 -1
- package/dist/components/inputs/date-field/date-field.js +50 -50
- package/dist/components/inputs/date-field/date-field.js.map +1 -1
- package/dist/components/inputs/date-picker/date-picker.d.ts +21 -21
- package/dist/components/inputs/date-picker/date-picker.d.ts.map +1 -1
- package/dist/components/inputs/date-picker/date-picker.js +38 -39
- package/dist/components/inputs/date-picker/date-picker.js.map +1 -1
- package/dist/components/inputs/dropdown/dropdown.d.ts +9 -9
- package/dist/components/inputs/dropdown/dropdown.d.ts.map +1 -1
- package/dist/components/inputs/dropdown/dropdown.js +20 -20
- package/dist/components/inputs/dropdown/dropdown.js.map +1 -1
- package/dist/components/inputs/file-field/file-field.d.ts +13 -13
- package/dist/components/inputs/file-field/file-field.d.ts.map +1 -1
- package/dist/components/inputs/file-field/file-field.js +24 -24
- package/dist/components/inputs/file-field/file-field.js.map +1 -1
- package/dist/components/inputs/multi-line-text-field/multi-line-text-field.d.ts +28 -28
- package/dist/components/inputs/multi-line-text-field/multi-line-text-field.d.ts.map +1 -1
- package/dist/components/inputs/multi-line-text-field/multi-line-text-field.js +51 -51
- package/dist/components/inputs/multi-line-text-field/multi-line-text-field.js.map +1 -1
- package/dist/components/inputs/number-field/number-field.d.ts +19 -19
- package/dist/components/inputs/number-field/number-field.d.ts.map +1 -1
- package/dist/components/inputs/number-field/number-field.js +39 -39
- package/dist/components/inputs/number-field/number-field.js.map +1 -1
- package/dist/components/inputs/one-time-code-field/one-time-code-field.d.ts +12 -12
- package/dist/components/inputs/one-time-code-field/one-time-code-field.d.ts.map +1 -1
- package/dist/components/inputs/one-time-code-field/one-time-code-field.js +27 -27
- package/dist/components/inputs/one-time-code-field/one-time-code-field.js.map +1 -1
- package/dist/components/inputs/password-field/password-field.d.ts +26 -26
- package/dist/components/inputs/password-field/password-field.d.ts.map +1 -1
- package/dist/components/inputs/password-field/password-field.js +51 -51
- package/dist/components/inputs/password-field/password-field.js.map +1 -1
- package/dist/components/inputs/radio-button/radio-button.d.ts +20 -20
- package/dist/components/inputs/radio-button/radio-button.d.ts.map +1 -1
- package/dist/components/inputs/radio-button/radio-button.js +37 -34
- package/dist/components/inputs/radio-button/radio-button.js.map +1 -1
- package/dist/components/inputs/radio-button/radio-button.styles.js +1 -1
- package/dist/components/inputs/radio-button-field/radio-button-field.d.ts +14 -14
- package/dist/components/inputs/radio-button-field/radio-button-field.d.ts.map +1 -1
- package/dist/components/inputs/radio-button-field/radio-button-field.js +25 -25
- package/dist/components/inputs/radio-button-field/radio-button-field.js.map +1 -1
- package/dist/components/inputs/radio-button-field/radio-button-field.template.js +1 -1
- package/dist/components/inputs/radio-button-field/radio-button-field.template.js.map +1 -1
- package/dist/components/inputs/radio-button-group/radio-button-group.d.ts +9 -9
- package/dist/components/inputs/radio-button-group/radio-button-group.d.ts.map +1 -1
- package/dist/components/inputs/radio-button-group/radio-button-group.js +18 -18
- package/dist/components/inputs/radio-button-group/radio-button-group.js.map +1 -1
- package/dist/components/inputs/search-field/search-field.d.ts +8 -8
- package/dist/components/inputs/search-field/search-field.d.ts.map +1 -1
- package/dist/components/inputs/search-field/search-field.js +19 -19
- package/dist/components/inputs/search-field/search-field.js.map +1 -1
- package/dist/components/inputs/segmented-control/segmented-control.d.ts +56 -60
- package/dist/components/inputs/segmented-control/segmented-control.d.ts.map +1 -1
- package/dist/components/inputs/segmented-control/segmented-control.js +110 -102
- package/dist/components/inputs/segmented-control/segmented-control.js.map +1 -1
- package/dist/components/inputs/segmented-control/segmented-control.styles.js +11 -11
- package/dist/components/inputs/slider/slider.d.ts +6 -6
- package/dist/components/inputs/slider/slider.d.ts.map +1 -1
- package/dist/components/inputs/slider/slider.js +33 -21
- package/dist/components/inputs/slider/slider.js.map +1 -1
- package/dist/components/inputs/stepper/stepper.d.ts +12 -12
- package/dist/components/inputs/stepper/stepper.d.ts.map +1 -1
- package/dist/components/inputs/stepper/stepper.js +24 -24
- package/dist/components/inputs/stepper/stepper.js.map +1 -1
- package/dist/components/inputs/stepper/stepper.template.js +2 -2
- package/dist/components/inputs/stepper/stepper.template.js.map +1 -1
- package/dist/components/inputs/swatch-picker/swatch-picker.d.ts +10 -9
- package/dist/components/inputs/swatch-picker/swatch-picker.d.ts.map +1 -1
- package/dist/components/inputs/swatch-picker/swatch-picker.js +27 -20
- package/dist/components/inputs/swatch-picker/swatch-picker.js.map +1 -1
- package/dist/components/inputs/swatch-picker/swatch-picker.styles.js +2 -2
- package/dist/components/inputs/switch/switch.d.ts +15 -15
- package/dist/components/inputs/switch/switch.d.ts.map +1 -1
- package/dist/components/inputs/switch/switch.js +27 -27
- package/dist/components/inputs/switch/switch.js.map +1 -1
- package/dist/components/inputs/switch-field/switch-field.d.ts +13 -13
- package/dist/components/inputs/switch-field/switch-field.d.ts.map +1 -1
- package/dist/components/inputs/switch-field/switch-field.js +22 -22
- package/dist/components/inputs/switch-field/switch-field.js.map +1 -1
- package/dist/components/inputs/text-editor/text-editor.d.ts +11 -11
- package/dist/components/inputs/text-editor/text-editor.d.ts.map +1 -1
- package/dist/components/inputs/text-editor/text-editor.hidden-syntax.d.ts +4 -1
- package/dist/components/inputs/text-editor/text-editor.hidden-syntax.d.ts.map +1 -1
- package/dist/components/inputs/text-editor/text-editor.hidden-syntax.js +3 -1
- package/dist/components/inputs/text-editor/text-editor.hidden-syntax.js.map +1 -1
- package/dist/components/inputs/text-editor/text-editor.js +39 -39
- package/dist/components/inputs/text-editor/text-editor.js.map +1 -1
- package/dist/components/inputs/text-editor/text-editor.links.d.ts +6 -1
- package/dist/components/inputs/text-editor/text-editor.links.d.ts.map +1 -1
- package/dist/components/inputs/text-editor/text-editor.links.js +24 -7
- package/dist/components/inputs/text-editor/text-editor.links.js.map +1 -1
- package/dist/components/inputs/text-field/text-field.d.ts +28 -28
- package/dist/components/inputs/text-field/text-field.d.ts.map +1 -1
- package/dist/components/inputs/text-field/text-field.js +50 -50
- package/dist/components/inputs/text-field/text-field.js.map +1 -1
- package/dist/components/inputs/time-field/time-field.d.ts +24 -24
- package/dist/components/inputs/time-field/time-field.d.ts.map +1 -1
- package/dist/components/inputs/time-field/time-field.js +51 -51
- package/dist/components/inputs/time-field/time-field.js.map +1 -1
- package/dist/components/inputs/time-picker/time-picker.d.ts +21 -20
- package/dist/components/inputs/time-picker/time-picker.d.ts.map +1 -1
- package/dist/components/inputs/time-picker/time-picker.js +38 -34
- package/dist/components/inputs/time-picker/time-picker.js.map +1 -1
- package/dist/components/inputs/toggle-button/toggle-button.d.ts +28 -28
- package/dist/components/inputs/toggle-button/toggle-button.d.ts.map +1 -1
- package/dist/components/inputs/toggle-button/toggle-button.js +51 -51
- package/dist/components/inputs/toggle-button/toggle-button.js.map +1 -1
- package/dist/components/inputs/toggle-button-group/toggle-button-group.d.ts +23 -23
- package/dist/components/inputs/toggle-button-group/toggle-button-group.d.ts.map +1 -1
- package/dist/components/inputs/toggle-button-group/toggle-button-group.js +34 -34
- package/dist/components/inputs/toggle-button-group/toggle-button-group.js.map +1 -1
- package/dist/components/inputs/token-field/token-field.d.ts +20 -20
- package/dist/components/inputs/token-field/token-field.d.ts.map +1 -1
- package/dist/components/inputs/token-field/token-field.js +46 -47
- package/dist/components/inputs/token-field/token-field.js.map +1 -1
- package/dist/components/layout/box/box.d.ts +1 -1
- package/dist/components/layout/box/box.js +1 -1
- package/dist/components/layout/card/card.d.ts +9 -9
- package/dist/components/layout/card/card.d.ts.map +1 -1
- package/dist/components/layout/card/card.js +14 -14
- package/dist/components/layout/card/card.js.map +1 -1
- package/dist/components/layout/card/card.styles.d.ts.map +1 -1
- package/dist/components/layout/card/card.styles.js +11 -1
- package/dist/components/layout/card/card.styles.js.map +1 -1
- package/dist/components/layout/collection/collection.d.ts +2 -2
- package/dist/components/layout/collection/collection.d.ts.map +1 -1
- package/dist/components/layout/collection/collection.js +5 -5
- package/dist/components/layout/collection/collection.js.map +1 -1
- package/dist/components/layout/collection/collection.template.js +2 -2
- package/dist/components/layout/container/container.d.ts +5 -3
- package/dist/components/layout/container/container.d.ts.map +1 -1
- package/dist/components/layout/container/container.js +14 -8
- package/dist/components/layout/container/container.js.map +1 -1
- package/dist/components/layout/kanban/kanban.d.ts +2 -2
- package/dist/components/layout/kanban/kanban.d.ts.map +1 -1
- package/dist/components/layout/kanban/kanban.js +5 -5
- package/dist/components/layout/kanban/kanban.js.map +1 -1
- package/dist/components/layout/page/page.d.ts +11 -3
- package/dist/components/layout/page/page.d.ts.map +1 -1
- package/dist/components/layout/page/page.js +34 -16
- package/dist/components/layout/page/page.js.map +1 -1
- package/dist/components/layout/page/page.styles.d.ts.map +1 -1
- package/dist/components/layout/page/page.styles.js +3 -2
- package/dist/components/layout/page/page.styles.js.map +1 -1
- package/dist/components/layout/page-footer/page-footer.d.ts +1 -1
- package/dist/components/layout/page-footer/page-footer.d.ts.map +1 -1
- package/dist/components/layout/page-footer/page-footer.js +4 -4
- package/dist/components/layout/page-footer/page-footer.js.map +1 -1
- package/dist/components/layout/page-sections/hero/hero.d.ts +16 -16
- package/dist/components/layout/page-sections/hero/hero.d.ts.map +1 -1
- package/dist/components/layout/page-sections/hero/hero.js +28 -28
- package/dist/components/layout/page-sections/hero/hero.js.map +1 -1
- package/dist/components/layout/page-sections/sidebar-section/sidebar-section.d.ts +7 -7
- package/dist/components/layout/page-sections/sidebar-section/sidebar-section.d.ts.map +1 -1
- package/dist/components/layout/page-sections/sidebar-section/sidebar-section.js +16 -16
- package/dist/components/layout/page-sections/sidebar-section/sidebar-section.js.map +1 -1
- package/dist/components/layout/popover/popover.d.ts +9 -9
- package/dist/components/layout/popover/popover.d.ts.map +1 -1
- package/dist/components/layout/popover/popover.js +22 -22
- package/dist/components/layout/popover/popover.js.map +1 -1
- package/dist/components/layout/sheet/sheet.d.ts +1 -1
- package/dist/components/layout/sheet/sheet.js +1 -1
- package/dist/components/layout/shell/shell.d.ts +2 -0
- package/dist/components/layout/shell/shell.d.ts.map +1 -1
- package/dist/components/layout/shell/shell.js +2 -0
- package/dist/components/layout/shell/shell.js.map +1 -1
- package/dist/components/layout/split-views/bar-split-view/bar-split-view.styles.d.ts.map +1 -1
- package/dist/components/layout/split-views/bar-split-view/bar-split-view.styles.js +5 -0
- package/dist/components/layout/split-views/bar-split-view/bar-split-view.styles.js.map +1 -1
- package/dist/components/layout/split-views/navigation-split-view/navigation-split-view.d.ts +13 -5
- package/dist/components/layout/split-views/navigation-split-view/navigation-split-view.d.ts.map +1 -1
- package/dist/components/layout/split-views/navigation-split-view/navigation-split-view.js +27 -46
- package/dist/components/layout/split-views/navigation-split-view/navigation-split-view.js.map +1 -1
- package/dist/components/layout/split-views/navigation-split-view/navigation-split-view.styles.d.ts.map +1 -1
- package/dist/components/layout/split-views/navigation-split-view/navigation-split-view.styles.js +6 -0
- package/dist/components/layout/split-views/navigation-split-view/navigation-split-view.styles.js.map +1 -1
- package/dist/components/layout/split-views/navigation-split-view/navigation-split-view.template.d.ts.map +1 -1
- package/dist/components/layout/split-views/navigation-split-view/navigation-split-view.template.js +3 -2
- package/dist/components/layout/split-views/navigation-split-view/navigation-split-view.template.js.map +1 -1
- package/dist/components/layout/split-views/side-by-side-split-view/side-by-side-split-view.styles.d.ts.map +1 -1
- package/dist/components/layout/split-views/side-by-side-split-view/side-by-side-split-view.styles.js +2 -0
- package/dist/components/layout/split-views/side-by-side-split-view/side-by-side-split-view.styles.js.map +1 -1
- package/dist/components/layout/split-views/stacked-split-view/stacked-split-view.styles.d.ts.map +1 -1
- package/dist/components/layout/split-views/stacked-split-view/stacked-split-view.styles.js +2 -0
- package/dist/components/layout/split-views/stacked-split-view/stacked-split-view.styles.js.map +1 -1
- package/dist/components/layout/window/window.d.ts +5 -5
- package/dist/components/layout/window/window.d.ts.map +1 -1
- package/dist/components/layout/window/window.js +10 -10
- package/dist/components/layout/window/window.js.map +1 -1
- package/dist/components/lists-and-tables/cells/icon-cell/icon-cell.d.ts +2 -2
- package/dist/components/lists-and-tables/cells/icon-cell/icon-cell.d.ts.map +1 -1
- package/dist/components/lists-and-tables/cells/icon-cell/icon-cell.js +5 -5
- package/dist/components/lists-and-tables/cells/icon-cell/icon-cell.js.map +1 -1
- package/dist/components/lists-and-tables/cells/step-cell/step-cell.d.ts +11 -11
- package/dist/components/lists-and-tables/cells/step-cell/step-cell.d.ts.map +1 -1
- package/dist/components/lists-and-tables/cells/step-cell/step-cell.js +17 -17
- package/dist/components/lists-and-tables/cells/step-cell/step-cell.js.map +1 -1
- package/dist/components/lists-and-tables/cells/text-cell/text-cell.d.ts +2 -2
- package/dist/components/lists-and-tables/cells/text-cell/text-cell.d.ts.map +1 -1
- package/dist/components/lists-and-tables/cells/text-cell/text-cell.js +5 -5
- package/dist/components/lists-and-tables/cells/text-cell/text-cell.js.map +1 -1
- package/dist/components/lists-and-tables/cells/title-cell/title-cell.d.ts +2 -2
- package/dist/components/lists-and-tables/cells/title-cell/title-cell.d.ts.map +1 -1
- package/dist/components/lists-and-tables/cells/title-cell/title-cell.js +7 -4
- package/dist/components/lists-and-tables/cells/title-cell/title-cell.js.map +1 -1
- package/dist/components/lists-and-tables/list/list.d.ts +6 -6
- package/dist/components/lists-and-tables/list/list.d.ts.map +1 -1
- package/dist/components/lists-and-tables/list/list.js +13 -18
- package/dist/components/lists-and-tables/list/list.js.map +1 -1
- package/dist/components/lists-and-tables/list-item/list-item.d.ts +31 -29
- package/dist/components/lists-and-tables/list-item/list-item.d.ts.map +1 -1
- package/dist/components/lists-and-tables/list-item/list-item.js +35 -30
- package/dist/components/lists-and-tables/list-item/list-item.js.map +1 -1
- package/dist/components/lists-and-tables/list-item/list-item.styles.js +2 -2
- package/dist/components/lists-and-tables/list-item-segment/list-item-segment.d.ts +25 -25
- package/dist/components/lists-and-tables/list-item-segment/list-item-segment.d.ts.map +1 -1
- package/dist/components/lists-and-tables/list-item-segment/list-item-segment.js +44 -44
- package/dist/components/lists-and-tables/list-item-segment/list-item-segment.js.map +1 -1
- package/dist/components/lists-and-tables/table/table.d.ts +7 -3
- package/dist/components/lists-and-tables/table/table.d.ts.map +1 -1
- package/dist/components/lists-and-tables/table/table.js +10 -6
- package/dist/components/lists-and-tables/table/table.js.map +1 -1
- package/dist/components/navigation/breadcrumbs/breadcrumbs.d.ts +4 -4
- package/dist/components/navigation/breadcrumbs/breadcrumbs.d.ts.map +1 -1
- package/dist/components/navigation/breadcrumbs/breadcrumbs.js +7 -7
- package/dist/components/navigation/breadcrumbs/breadcrumbs.js.map +1 -1
- package/dist/components/navigation/document-tab-bar/document-tab-bar.d.ts +6 -6
- package/dist/components/navigation/document-tab-bar/document-tab-bar.d.ts.map +1 -1
- package/dist/components/navigation/document-tab-bar/document-tab-bar.js +15 -15
- package/dist/components/navigation/document-tab-bar/document-tab-bar.js.map +1 -1
- package/dist/components/navigation/link/link.d.ts +13 -13
- package/dist/components/navigation/link/link.d.ts.map +1 -1
- package/dist/components/navigation/link/link.js +29 -29
- package/dist/components/navigation/link/link.js.map +1 -1
- package/dist/components/navigation/link-group/link-group.d.ts +2 -2
- package/dist/components/navigation/link-group/link-group.d.ts.map +1 -1
- package/dist/components/navigation/link-group/link-group.js +5 -5
- package/dist/components/navigation/link-group/link-group.js.map +1 -1
- package/dist/components/navigation/menu-bar/menu-bar.d.ts +5 -5
- package/dist/components/navigation/menu-bar/menu-bar.d.ts.map +1 -1
- package/dist/components/navigation/menu-bar/menu-bar.js +12 -10
- package/dist/components/navigation/menu-bar/menu-bar.js.map +1 -1
- package/dist/components/navigation/menu-bar-item/menu-bar-item.d.ts +21 -18
- package/dist/components/navigation/menu-bar-item/menu-bar-item.d.ts.map +1 -1
- package/dist/components/navigation/menu-bar-item/menu-bar-item.js +43 -35
- package/dist/components/navigation/menu-bar-item/menu-bar-item.js.map +1 -1
- package/dist/components/navigation/menu-bar-item/menu-bar-item.styles.js +3 -3
- package/dist/components/navigation/pagination/pagination.d.ts +5 -5
- package/dist/components/navigation/pagination/pagination.d.ts.map +1 -1
- package/dist/components/navigation/pagination/pagination.js +11 -11
- package/dist/components/navigation/pagination/pagination.js.map +1 -1
- package/dist/components/navigation/pagination/pagination.template.js +2 -2
- package/dist/components/navigation/pagination/pagination.template.js.map +1 -1
- package/dist/components/navigation/tab-bar/tab-bar.d.ts +16 -16
- package/dist/components/navigation/tab-bar/tab-bar.d.ts.map +1 -1
- package/dist/components/navigation/tab-bar/tab-bar.js +33 -30
- package/dist/components/navigation/tab-bar/tab-bar.js.map +1 -1
- package/dist/components/navigation/tab-bar/tab-bar.template.js +1 -1
- package/dist/components/navigation/tab-bar/tab-bar.template.js.map +1 -1
- package/dist/components/navigation/top-navigation-bar/top-navigation-bar.d.ts +4 -4
- package/dist/components/navigation/top-navigation-bar/top-navigation-bar.d.ts.map +1 -1
- package/dist/components/navigation/top-navigation-bar/top-navigation-bar.js +12 -12
- package/dist/components/navigation/top-navigation-bar/top-navigation-bar.js.map +1 -1
- package/dist/components/navigation/top-title-bar/top-title-bar.d.ts +2 -2
- package/dist/components/navigation/top-title-bar/top-title-bar.d.ts.map +1 -1
- package/dist/components/navigation/top-title-bar/top-title-bar.js +5 -5
- package/dist/components/navigation/top-title-bar/top-title-bar.js.map +1 -1
- package/dist/components/status-and-feedback/activity-indicator/activity-indicator.d.ts +9 -9
- package/dist/components/status-and-feedback/activity-indicator/activity-indicator.d.ts.map +1 -1
- package/dist/components/status-and-feedback/activity-indicator/activity-indicator.js +15 -15
- package/dist/components/status-and-feedback/activity-indicator/activity-indicator.js.map +1 -1
- package/dist/components/status-and-feedback/badge/badge.d.ts +2 -2
- package/dist/components/status-and-feedback/badge/badge.d.ts.map +1 -1
- package/dist/components/status-and-feedback/badge/badge.js +5 -5
- package/dist/components/status-and-feedback/badge/badge.js.map +1 -1
- package/dist/components/status-and-feedback/banner/banner.d.ts +2 -2
- package/dist/components/status-and-feedback/banner/banner.d.ts.map +1 -1
- package/dist/components/status-and-feedback/banner/banner.js +5 -5
- package/dist/components/status-and-feedback/banner/banner.js.map +1 -1
- package/dist/components/status-and-feedback/inline-dialog/inline-dialog.d.ts +6 -6
- package/dist/components/status-and-feedback/inline-dialog/inline-dialog.d.ts.map +1 -1
- package/dist/components/status-and-feedback/inline-dialog/inline-dialog.js +13 -13
- package/dist/components/status-and-feedback/inline-dialog/inline-dialog.js.map +1 -1
- package/dist/components/status-and-feedback/just-in-time-education/just-in-time-education.d.ts +8 -8
- package/dist/components/status-and-feedback/just-in-time-education/just-in-time-education.d.ts.map +1 -1
- package/dist/components/status-and-feedback/just-in-time-education/just-in-time-education.js +17 -17
- package/dist/components/status-and-feedback/just-in-time-education/just-in-time-education.js.map +1 -1
- package/dist/components/status-and-feedback/notification/notification.d.ts +2 -2
- package/dist/components/status-and-feedback/notification/notification.d.ts.map +1 -1
- package/dist/components/status-and-feedback/notification/notification.js +5 -5
- package/dist/components/status-and-feedback/notification/notification.js.map +1 -1
- package/dist/components/status-and-feedback/progress-bar/progress-bar.d.ts +12 -12
- package/dist/components/status-and-feedback/progress-bar/progress-bar.d.ts.map +1 -1
- package/dist/components/status-and-feedback/progress-bar/progress-bar.js +28 -28
- package/dist/components/status-and-feedback/progress-bar/progress-bar.js.map +1 -1
- package/dist/components/status-and-feedback/progress-circle/progress-circle.d.ts +10 -10
- package/dist/components/status-and-feedback/progress-circle/progress-circle.d.ts.map +1 -1
- package/dist/components/status-and-feedback/progress-circle/progress-circle.js +24 -24
- package/dist/components/status-and-feedback/progress-circle/progress-circle.js.map +1 -1
- package/dist/components/status-and-feedback/status-bar/status-bar.d.ts +2 -2
- package/dist/components/status-and-feedback/status-bar/status-bar.d.ts.map +1 -1
- package/dist/components/status-and-feedback/status-bar/status-bar.js +5 -5
- package/dist/components/status-and-feedback/status-bar/status-bar.js.map +1 -1
- package/dist/components/status-and-feedback/step-bar/step-bar.d.ts +12 -6
- package/dist/components/status-and-feedback/step-bar/step-bar.d.ts.map +1 -1
- package/dist/components/status-and-feedback/step-bar/step-bar.i18n.d.ts +1 -0
- package/dist/components/status-and-feedback/step-bar/step-bar.i18n.d.ts.map +1 -1
- package/dist/components/status-and-feedback/step-bar/step-bar.i18n.js +1 -0
- package/dist/components/status-and-feedback/step-bar/step-bar.i18n.js.map +1 -1
- package/dist/components/status-and-feedback/step-bar/step-bar.js +15 -12
- package/dist/components/status-and-feedback/step-bar/step-bar.js.map +1 -1
- package/dist/components/status-and-feedback/step-bar/step-bar.template.d.ts.map +1 -1
- package/dist/components/status-and-feedback/step-bar/step-bar.template.js +3 -1
- package/dist/components/status-and-feedback/step-bar/step-bar.template.js.map +1 -1
- package/dist/nldd.min.js +864 -927
- package/dist/translations/en-US.d.ts.map +1 -1
- package/dist/translations/en-US.js +2 -0
- package/dist/translations/en-US.js.map +1 -1
- package/dist/translations/fy.d.ts.map +1 -1
- package/dist/translations/fy.js +2 -0
- package/dist/translations/fy.js.map +1 -1
- package/dist/translations/nl.generated.d.ts +2 -0
- package/dist/translations/nl.generated.d.ts.map +1 -1
- package/dist/translations/nl.generated.js +2 -0
- package/dist/translations/nl.generated.js.map +1 -1
- package/dist/translations/pap-AW.d.ts.map +1 -1
- package/dist/translations/pap-AW.js +2 -0
- package/dist/translations/pap-AW.js.map +1 -1
- package/dist/translations/pap-CW.d.ts.map +1 -1
- package/dist/translations/pap-CW.js +2 -0
- package/dist/translations/pap-CW.js.map +1 -1
- package/dist/types/react.d.ts +748 -802
- package/dist/types/vue.d.ts +893 -971
- package/dist/utilities/autoloader.generated.d.ts.map +1 -1
- package/dist/utilities/autoloader.generated.js +0 -1
- package/dist/utilities/autoloader.generated.js.map +1 -1
- package/dist/utilities/dev-checks.d.ts +6 -0
- package/dist/utilities/dev-checks.d.ts.map +1 -1
- package/dist/utilities/dev-checks.js +42 -16
- package/dist/utilities/dev-checks.js.map +1 -1
- package/dist/utilities/dev-rules.generated.js +177 -177
- package/dist/utilities/dev-rules.generated.js.map +1 -1
- package/dist/utilities/element-state.d.ts +11 -0
- package/dist/utilities/element-state.d.ts.map +1 -1
- package/dist/utilities/element-state.js +18 -3
- package/dist/utilities/element-state.js.map +1 -1
- package/dist/utilities/scroll-mode-controller.d.ts +8 -0
- package/dist/utilities/scroll-mode-controller.d.ts.map +1 -1
- package/dist/utilities/scroll-mode-controller.js +13 -1
- package/dist/utilities/scroll-mode-controller.js.map +1 -1
- package/lint/css.js +58 -26
- package/lint/data.generated.json +1 -1
- package/lint/engine.js +29 -12
- package/lint/fix.js +146 -12
- package/lint/format.js +4 -3
- package/lint/frontends.js +153 -35
- package/lint/linter.js +178 -25
- package/lint/main.js +7 -2
- package/lint/project.js +50 -12
- package/lint/rule-compiler.js +20 -11
- package/lint/rule-data.js +8 -0
- package/lint/rule.schema.json +12 -2
- package/lint/session.js +42 -18
- package/lint/tree.js +5 -2
- package/package.json +3 -6
- package/dist/cdn/chunks/nl.generated-BDowZkhc.js +0 -116
- package/dist/cdn/chunks/scroll-mode-controller-Dl5hddJo.js +0 -52
- package/dist/cdn/chunks/split-view-pane-BgFUL3BV.js +0 -131
- package/dist/cdn/chunks/toolbar-item-CkwQ2UyY.js +0 -50
- package/dist/components/layout/split-views/split-view-pane/split-view-pane.d.ts +0 -49
- package/dist/components/layout/split-views/split-view-pane/split-view-pane.d.ts.map +0 -1
- package/dist/components/layout/split-views/split-view-pane/split-view-pane.js +0 -80
- package/dist/components/layout/split-views/split-view-pane/split-view-pane.js.map +0 -1
- package/dist/components/layout/split-views/split-view-pane/split-view-pane.styles.d.ts +0 -2
- package/dist/components/layout/split-views/split-view-pane/split-view-pane.styles.d.ts.map +0 -1
- package/dist/components/layout/split-views/split-view-pane/split-view-pane.styles.js +0 -95
- package/dist/components/layout/split-views/split-view-pane/split-view-pane.styles.js.map +0 -1
- package/dist/components/layout/split-views/split-view-pane/split-view-pane.template.d.ts +0 -4
- package/dist/components/layout/split-views/split-view-pane/split-view-pane.template.d.ts.map +0 -1
- package/dist/components/layout/split-views/split-view-pane/split-view-pane.template.js +0 -9
- package/dist/components/layout/split-views/split-view-pane/split-view-pane.template.js.map +0 -1
|
@@ -1,48 +1,49 @@
|
|
|
1
|
-
import { $ as e, F as t, H as n, I as r, J as i, L as a, N as o, O as s, P as c, Q as l, R as u, U as d, Y as f, a as p, at as m, ct as h, et as g, j as _, k as v, n as ee, q as te, r as ne, rt as y, st as b, tt as
|
|
2
|
-
import { n as
|
|
3
|
-
import { t as
|
|
4
|
-
import { a as
|
|
5
|
-
import { a as
|
|
6
|
-
import { t as
|
|
7
|
-
import { t as
|
|
8
|
-
import "./icon-
|
|
9
|
-
import
|
|
10
|
-
import "./
|
|
11
|
-
import
|
|
12
|
-
import { t as
|
|
13
|
-
import { t as
|
|
14
|
-
import { t as
|
|
15
|
-
import {
|
|
1
|
+
import { $ as e, F as t, H as n, I as r, J as i, L as a, N as o, O as s, P as c, Q as l, R as u, U as d, Y as f, a as p, at as m, ct as h, et as g, j as _, k as v, n as ee, q as te, r as ne, rt as y, st as b, tt as x, ut as re } from "./languages-DOvFU6aa.js";
|
|
2
|
+
import { n as ie, r as S, s as ae } from "./custom-element-zgCtSWGH.js";
|
|
3
|
+
import { t as oe } from "./reflect-non-default-Bu3rpCvg.js";
|
|
4
|
+
import { a as se, c as ce, d as le, f as ue, i as de, l as fe, n as pe, o as me, r as he, s as ge, t as _e, u as ve } from "./codemirror-input-CBuhqk5Y.js";
|
|
5
|
+
import { a as ye, i as be, r as xe, t as Se } from "./dist-Mx6eY_XI.js";
|
|
6
|
+
import { t as Ce } from "./custom-element-BW8Ua4c7.js";
|
|
7
|
+
import { t as we } from "./query-ChDzi9FQ.js";
|
|
8
|
+
import "./icon-D4fRZxV2.js";
|
|
9
|
+
import "./tooltip-bqAbXl2W.js";
|
|
10
|
+
import { a as Te, c as Ee, i as De, n as Oe } from "./dist-BT1-y5Tb.js";
|
|
11
|
+
import "./avatar-DG0uG2Eu.js";
|
|
12
|
+
import { o as ke, t as C } from "./decorate-CXvSUV9i.js";
|
|
13
|
+
import { t as Ae } from "./shadow-resets-BerORb5_.js";
|
|
14
|
+
import { t as je } from "./text-editor.i18n-sJKiRQ4i.js";
|
|
15
|
+
import { t as Me } from "./translations-DsTLnxKh.js";
|
|
16
|
+
import { r as Ne } from "./element-state-D-J_cHEV.js";
|
|
16
17
|
// src/components/inputs/text-editor/text-editor.labels.ts
|
|
17
|
-
var
|
|
18
|
+
var Pe = b.define();
|
|
18
19
|
// src/components/inputs/text-editor/text-editor.syntax.ts
|
|
19
|
-
function
|
|
20
|
+
function w(e, t, n, r) {
|
|
20
21
|
for (let i = s(e).resolveInner(t, n); i; i = i.parent) if (r(i)) return i;
|
|
21
22
|
return null;
|
|
22
23
|
}
|
|
23
|
-
var
|
|
24
|
-
function T(e, t) {
|
|
25
|
-
return D(e, t, 1, w) !== null;
|
|
26
|
-
}
|
|
24
|
+
var Fe = /* @__PURE__ */ new Set(["FencedCode", "CodeBlock"]), Ie = /* @__PURE__ */ new Set([...Fe, "InlineCode"]);
|
|
27
25
|
function Le(e, t) {
|
|
28
|
-
return
|
|
26
|
+
return E(e, t, 1, Fe) !== null;
|
|
29
27
|
}
|
|
30
|
-
function Re(e, t
|
|
28
|
+
function Re(e, t) {
|
|
29
|
+
return E(e, t, 1, Ie) !== null;
|
|
30
|
+
}
|
|
31
|
+
function ze(e, t, n, r) {
|
|
31
32
|
for (let i = t; i <= n;) {
|
|
32
33
|
let t = e.doc.lineAt(i);
|
|
33
34
|
r(t.from), i = t.to + 1;
|
|
34
35
|
}
|
|
35
36
|
}
|
|
36
|
-
function
|
|
37
|
+
function T(e, t) {
|
|
37
38
|
return s(e) !== s(t);
|
|
38
39
|
}
|
|
39
|
-
function
|
|
40
|
-
return
|
|
40
|
+
function Be(e, t) {
|
|
41
|
+
return E(e, t, 1, "HorizontalRule") !== null;
|
|
41
42
|
}
|
|
42
|
-
function
|
|
43
|
-
return
|
|
43
|
+
function E(e, t, n, r) {
|
|
44
|
+
return w(e, t, n, typeof r == "string" ? (e) => e.name === r : (e) => r.has(e.name));
|
|
44
45
|
}
|
|
45
|
-
function
|
|
46
|
+
function Ve(e) {
|
|
46
47
|
let t = [];
|
|
47
48
|
for (let n = e.firstChild; n; n = n.nextSibling) n.name === "LinkMark" && t.push(n);
|
|
48
49
|
if (t.length < 2) return null;
|
|
@@ -53,35 +54,35 @@ function Be(e) {
|
|
|
53
54
|
} : null;
|
|
54
55
|
}
|
|
55
56
|
// src/components/inputs/text-editor/text-editor.mention.ts
|
|
56
|
-
var
|
|
57
|
-
function He(e) {
|
|
58
|
-
return `[@${e.text.replace(/[[\]\\]/g, (e) => "\\" + e)}](${Ve}${encodeURIComponent(e.id).replace(/[()<>]/g, (e) => "%" + e.charCodeAt(0).toString(16).toUpperCase())})`;
|
|
59
|
-
}
|
|
57
|
+
var He = "user:";
|
|
60
58
|
function Ue(e) {
|
|
61
|
-
return
|
|
59
|
+
return `[@${e.text.replace(/[[\]\\]/g, (e) => "\\" + e)}](${He}${encodeURIComponent(e.id).replace(/[()<>]/g, (e) => "%" + e.charCodeAt(0).toString(16).toUpperCase())})`;
|
|
62
60
|
}
|
|
63
61
|
function We(e) {
|
|
64
|
-
return e
|
|
62
|
+
return `${Ue(e)} `;
|
|
65
63
|
}
|
|
66
64
|
function Ge(e) {
|
|
65
|
+
return e.replace(/\\([[\]\\])/g, "$1");
|
|
66
|
+
}
|
|
67
|
+
function Ke(e) {
|
|
67
68
|
try {
|
|
68
69
|
return decodeURIComponent(e);
|
|
69
70
|
} catch {
|
|
70
71
|
return e;
|
|
71
72
|
}
|
|
72
73
|
}
|
|
73
|
-
var
|
|
74
|
-
function
|
|
75
|
-
return e.startsWith(
|
|
74
|
+
var qe = RegExp(`\\[(@[^\\]]*)\\]\\(${He}[^)]*\\)`, "g");
|
|
75
|
+
function Je(e) {
|
|
76
|
+
return e.startsWith(He);
|
|
76
77
|
}
|
|
77
|
-
function
|
|
78
|
+
function D(e, t) {
|
|
78
79
|
let n = t.getChild("URL");
|
|
79
|
-
return n !== null &&
|
|
80
|
+
return n !== null && Je(e.sliceDoc(n.from, n.to));
|
|
80
81
|
}
|
|
81
|
-
function
|
|
82
|
+
function Ye(e, t, n) {
|
|
82
83
|
return e.from === e.to || e.from > t || e.to < n ? "none" : e.from === t && e.to === n ? "alone" : "within";
|
|
83
84
|
}
|
|
84
|
-
var
|
|
85
|
+
var Xe = class extends t {
|
|
85
86
|
constructor(e, t, n) {
|
|
86
87
|
super(), this.label = e, this.id = t, this.selected = n;
|
|
87
88
|
}
|
|
@@ -97,65 +98,65 @@ var Ye = class extends t {
|
|
|
97
98
|
return n.className = "cm-md-mention-token-name", n.dataset.label = this.label, e.append(t, n), e;
|
|
98
99
|
}
|
|
99
100
|
};
|
|
100
|
-
function
|
|
101
|
+
function Ze(e) {
|
|
101
102
|
let t = [], n = e.selection.main;
|
|
102
103
|
return s(e).iterate({ enter: (r) => {
|
|
103
104
|
if (Ie.has(r.name)) return !1;
|
|
104
105
|
if (r.name !== "Link") return;
|
|
105
106
|
let i = r.node, a = i.getChild("URL");
|
|
106
|
-
if (!a || !
|
|
107
|
-
let o =
|
|
107
|
+
if (!a || !D(e, i)) return;
|
|
108
|
+
let o = Ve(i);
|
|
108
109
|
if (!o) return;
|
|
109
|
-
let s =
|
|
110
|
-
t.push(v.replace({ widget: new
|
|
110
|
+
let s = Ge(e.sliceDoc(o.from, o.to).replace(/^@/, "")), c = Ke(e.sliceDoc(a.from, a.to).slice(5)), l = Ye(n, i.from, i.to);
|
|
111
|
+
t.push(v.replace({ widget: new Xe(s, c, l) }).range(i.from, i.to));
|
|
111
112
|
} }), v.set(t, !0);
|
|
112
113
|
}
|
|
113
|
-
function
|
|
114
|
+
function Qe(e, t, n) {
|
|
114
115
|
let r = !1;
|
|
115
116
|
return e.between(0, 1e9, (e, i) => {
|
|
116
|
-
if (
|
|
117
|
+
if (Ye(t, e, i) !== Ye(n, e, i)) return r = !0, !1;
|
|
117
118
|
}), r;
|
|
118
119
|
}
|
|
119
|
-
var
|
|
120
|
-
create: (e) =>
|
|
121
|
-
update: (e, t) => t.docChanged ||
|
|
120
|
+
var $e = h.define({
|
|
121
|
+
create: (e) => Ze(e),
|
|
122
|
+
update: (e, t) => t.docChanged || T(t.startState, t.state) ? Ze(t.state) : t.startState.selection.eq(t.state.selection) ? e : Qe(e, t.startState.selection.main, t.state.selection.main) ? Ze(t.state) : e,
|
|
122
123
|
provide: (e) => _.decorations.from(e)
|
|
123
|
-
}),
|
|
124
|
-
function
|
|
125
|
-
return
|
|
124
|
+
}), et = _.atomicRanges.of((e) => e.state.field($e, !1) ?? v.none), tt = [y.highest($e), et];
|
|
125
|
+
function nt(e, t, n) {
|
|
126
|
+
return w(e, t, n, (t) => t.name === "Link" && D(e, t));
|
|
126
127
|
}
|
|
127
|
-
function
|
|
128
|
-
let n =
|
|
128
|
+
function rt(e, t) {
|
|
129
|
+
let n = nt(e, t, 1);
|
|
129
130
|
return n ? {
|
|
130
131
|
from: n.from,
|
|
131
132
|
to: n.to
|
|
132
133
|
} : null;
|
|
133
134
|
}
|
|
134
|
-
function
|
|
135
|
-
let n =
|
|
135
|
+
function it(e, t) {
|
|
136
|
+
let n = nt(e, t, -1);
|
|
136
137
|
return n && n.to === t ? {
|
|
137
138
|
from: n.from,
|
|
138
139
|
to: n.to
|
|
139
140
|
} : null;
|
|
140
141
|
}
|
|
141
|
-
function
|
|
142
|
-
let n =
|
|
142
|
+
function at(e, t) {
|
|
143
|
+
let n = nt(e, t, 1);
|
|
143
144
|
return n && n.from === t ? {
|
|
144
145
|
from: n.from,
|
|
145
146
|
to: n.to
|
|
146
147
|
} : null;
|
|
147
148
|
}
|
|
148
|
-
function
|
|
149
|
+
function ot(e, t) {
|
|
149
150
|
let n = e.state.selection.main;
|
|
150
151
|
if (!n.empty) return !1;
|
|
151
|
-
let r = t < 0 ?
|
|
152
|
+
let r = t < 0 ? it(e.state, n.head) : at(e.state, n.head);
|
|
152
153
|
return r ? (e.dispatch({ selection: {
|
|
153
154
|
anchor: r.from,
|
|
154
155
|
head: r.to
|
|
155
156
|
} }), !0) : !1;
|
|
156
157
|
}
|
|
157
158
|
// src/components/inputs/text-editor/text-editor.caret.ts
|
|
158
|
-
function
|
|
159
|
+
function st(e) {
|
|
159
160
|
let t = _.findFromDOM(e);
|
|
160
161
|
if (!t) return null;
|
|
161
162
|
let n = t.posAtDOM(e);
|
|
@@ -170,25 +171,305 @@ function ot(e) {
|
|
|
170
171
|
return null;
|
|
171
172
|
}
|
|
172
173
|
}
|
|
173
|
-
// src/components/inputs/text-editor/text-editor.
|
|
174
|
-
var
|
|
174
|
+
// src/components/inputs/text-editor/text-editor.tasks.ts
|
|
175
|
+
var ct = x.define({ combine: (e) => e[0] ?? {
|
|
176
|
+
open: () => "Taak, open",
|
|
177
|
+
done: () => "Taak, afgerond"
|
|
178
|
+
} }), lt = class extends t {
|
|
175
179
|
constructor(e, t) {
|
|
176
|
-
super(), this.
|
|
180
|
+
super(), this.checked = e, this.label = t;
|
|
181
|
+
}
|
|
182
|
+
eq(e) {
|
|
183
|
+
return e.checked === this.checked && e.label === this.label;
|
|
184
|
+
}
|
|
185
|
+
toDOM() {
|
|
186
|
+
let e = document.createElement("span");
|
|
187
|
+
e.className = "cm-md-task-box", this.checked && e.setAttribute("data-checked", "");
|
|
188
|
+
let t = document.createElement("nldd-icon");
|
|
189
|
+
t.className = "cm-md-task-box-icon", t.setAttribute("icon", this.checked ? "check-mark-square" : "square"), t.setAttribute("aria-hidden", "true");
|
|
190
|
+
let n = document.createElement("span");
|
|
191
|
+
return n.className = "cm-md-task-box-label", n.textContent = this.label, e.append(t, n), e;
|
|
192
|
+
}
|
|
193
|
+
ignoreEvent() {
|
|
194
|
+
return !1;
|
|
195
|
+
}
|
|
196
|
+
};
|
|
197
|
+
function ut(e, t) {
|
|
198
|
+
let n = e.facet(ct);
|
|
199
|
+
return v.replace({ widget: new lt(t, t ? n.done() : n.open()) });
|
|
200
|
+
}
|
|
201
|
+
function dt(e) {
|
|
202
|
+
let t = [];
|
|
203
|
+
return s(e).iterate({ enter: (n) => {
|
|
204
|
+
if (n.name === "FencedCode" || n.name === "CodeBlock") return !1;
|
|
205
|
+
if (n.name === "TaskMarker") return t.push({
|
|
206
|
+
from: n.from,
|
|
207
|
+
to: n.to,
|
|
208
|
+
checked: /x/i.test(e.sliceDoc(n.from, n.to))
|
|
209
|
+
}), !1;
|
|
210
|
+
} }), t;
|
|
211
|
+
}
|
|
212
|
+
function ft(e, t, n) {
|
|
213
|
+
let r = dt(e).filter((e) => e.from <= n && e.to >= t);
|
|
214
|
+
if (r.length === 0) return null;
|
|
215
|
+
let i = r.some((e) => !e.checked);
|
|
216
|
+
return r.map((e) => ({
|
|
217
|
+
from: e.from + 1,
|
|
218
|
+
to: e.from + 2,
|
|
219
|
+
insert: i ? "x" : " "
|
|
220
|
+
}));
|
|
221
|
+
}
|
|
222
|
+
function pt(e) {
|
|
223
|
+
let { state: t } = e;
|
|
224
|
+
if (t.readOnly) return !1;
|
|
225
|
+
let n = t.selection.ranges.flatMap((e) => {
|
|
226
|
+
let n = t.doc.lineAt(e.from).from, r = t.doc.lineAt(e.to).to;
|
|
227
|
+
return ft(t, n, r) ?? [];
|
|
228
|
+
});
|
|
229
|
+
return n.length !== 0 && (e.dispatch({
|
|
230
|
+
changes: n,
|
|
231
|
+
userEvent: "input.task"
|
|
232
|
+
}), !0);
|
|
233
|
+
}
|
|
234
|
+
var mt = _.domEventHandlers({ mousedown(e, t) {
|
|
235
|
+
let n = e.target, r = n?.closest?.(".cm-md-task-box") ?? n?.closest?.(".cm-md-listprefix")?.querySelector(":scope > .cm-md-task-box");
|
|
236
|
+
if (!r || e.button !== 0) return !1;
|
|
237
|
+
if (e.preventDefault(), t.state.readOnly) return !0;
|
|
238
|
+
let i = t.posAtDOM(r), a = ft(t.state, i, i);
|
|
239
|
+
return a && t.dispatch({
|
|
240
|
+
changes: a,
|
|
241
|
+
userEvent: "input.task"
|
|
242
|
+
}), !0;
|
|
243
|
+
} });
|
|
244
|
+
function ht(e) {
|
|
245
|
+
return [
|
|
246
|
+
ct.of(e),
|
|
247
|
+
mt,
|
|
248
|
+
y.high(n.of([{
|
|
249
|
+
key: "Mod-Enter",
|
|
250
|
+
run: pt
|
|
251
|
+
}]))
|
|
252
|
+
];
|
|
253
|
+
}
|
|
254
|
+
// src/components/inputs/text-editor/text-editor.hidden-syntax.ts
|
|
255
|
+
var gt = {
|
|
256
|
+
EmphasisMark: ["Emphasis", "StrongEmphasis"],
|
|
257
|
+
StrikethroughMark: ["Strikethrough"],
|
|
258
|
+
CodeMark: ["InlineCode"]
|
|
259
|
+
}, O = v.replace({}), _t = v.mark({ class: "cm-md-bullet" }), vt = /^(\s*)[-*+]\s+\[[ xX]\](\s+)/, yt = 2.5, bt = {};
|
|
260
|
+
function xt(e) {
|
|
261
|
+
return bt[e] ?? (bt[e] = v.line({ attributes: { style: `text-indent:calc(${e} * var(--_text-editor-marker-advance) * -1) !important;padding-left:calc(${e} * var(--_text-editor-marker-advance)) !important` } }));
|
|
262
|
+
}
|
|
263
|
+
var St = v.mark({ class: "cm-md-ordinal" }), Ct = {};
|
|
264
|
+
function wt(e) {
|
|
265
|
+
let t = e.join(",");
|
|
266
|
+
return Ct[t] ?? (Ct[t] = v.line({
|
|
267
|
+
class: "cm-md-quote-line",
|
|
268
|
+
attributes: { style: `background-image:${e.map(() => "var(--_text-editor-quote-rule)").join(",")};background-position:${e.map((e) => `calc(${e} * var(--_text-editor-marker-advance)) 0`).join(",")}` }
|
|
269
|
+
}));
|
|
270
|
+
}
|
|
271
|
+
var Tt = v.mark({ class: "cm-md-quote-mark-hidden" }), Et = v.mark({ class: "cm-md-quote-gap" }), Dt = v.mark({ class: "cm-md-code-bare" }), Ot = class extends t {
|
|
272
|
+
toDOM() {
|
|
273
|
+
let e = document.createElement("span");
|
|
274
|
+
return e.className = "cm-md-rule", e.setAttribute("aria-hidden", "true"), e;
|
|
275
|
+
}
|
|
276
|
+
eq() {
|
|
277
|
+
return !0;
|
|
278
|
+
}
|
|
279
|
+
ignoreEvent() {
|
|
280
|
+
return !1;
|
|
281
|
+
}
|
|
282
|
+
}, kt = v.replace({ widget: new Ot() });
|
|
283
|
+
function At(e) {
|
|
284
|
+
let t = e;
|
|
285
|
+
for (let n = e.parent; n; n = n.parent) n.name === "Blockquote" && (t = n);
|
|
286
|
+
return t;
|
|
287
|
+
}
|
|
288
|
+
var jt = 2, Mt = {};
|
|
289
|
+
function Nt(e, t) {
|
|
290
|
+
var n;
|
|
291
|
+
return Mt[n = `${e},${t}`] ?? (Mt[n] = v.line({ attributes: { style: `text-indent:calc(${e} * var(--_text-editor-marker-advance) * -1) !important;padding-left:calc(${e + t} * var(--_text-editor-marker-advance)) !important` } }));
|
|
292
|
+
}
|
|
293
|
+
function Pt(e, t) {
|
|
294
|
+
let n = /* @__PURE__ */ new Map();
|
|
295
|
+
return s(e).iterate({
|
|
296
|
+
from: t.from,
|
|
297
|
+
to: t.to,
|
|
298
|
+
enter: (t) => {
|
|
299
|
+
t.name === "Blockquote" && ze(e, t.from, t.to, (e) => n.set(e, (n.get(e) ?? 0) + 1));
|
|
300
|
+
}
|
|
301
|
+
}), n;
|
|
302
|
+
}
|
|
303
|
+
function Ft(e, t) {
|
|
304
|
+
for (let n = e.doc.lineAt(t.to);; n = e.doc.line(n.number - 1)) if (/[^\s>]/.test(n.text) || n.from <= t.from) return n.from;
|
|
305
|
+
}
|
|
306
|
+
function It(e, t) {
|
|
307
|
+
let n = [];
|
|
308
|
+
for (let r of t) {
|
|
309
|
+
let t = /^[ ]*/.exec(e.slice(r + 1))[0].length;
|
|
310
|
+
t >= 2 && t <= 4 && n.push([r + 2, r + 1 + t]);
|
|
311
|
+
}
|
|
312
|
+
return n;
|
|
313
|
+
}
|
|
314
|
+
function Lt(e, t) {
|
|
315
|
+
let n = /* @__PURE__ */ new Map();
|
|
316
|
+
return s(e).iterate({
|
|
317
|
+
from: t.from,
|
|
318
|
+
to: t.to,
|
|
319
|
+
enter: (t) => {
|
|
320
|
+
if (t.name !== "QuoteMark") return;
|
|
321
|
+
let r = e.doc.lineAt(t.from), i = n.get(r.from) ?? [];
|
|
322
|
+
i.push(t.from - r.from), n.set(r.from, i);
|
|
323
|
+
}
|
|
324
|
+
}), n;
|
|
325
|
+
}
|
|
326
|
+
function Rt(e) {
|
|
327
|
+
return !e.readOnly && e.facet(_.editable);
|
|
328
|
+
}
|
|
329
|
+
function zt(e, t, n) {
|
|
330
|
+
return Rt(e) && e.selection.ranges.some((e) => e.from <= n && e.to >= t);
|
|
331
|
+
}
|
|
332
|
+
var Bt = v.replace({ block: !0 }), Vt = v.replace({}), Ht = v.mark({ class: "cm-md-code-language" }), Ut = /* @__PURE__ */ new Set([
|
|
333
|
+
"Document",
|
|
334
|
+
"Blockquote",
|
|
335
|
+
"BulletList",
|
|
336
|
+
"OrderedList",
|
|
337
|
+
"ListItem"
|
|
338
|
+
]);
|
|
339
|
+
function Wt(e) {
|
|
340
|
+
let t = [];
|
|
341
|
+
return s(e).iterate({ enter: (n) => {
|
|
342
|
+
if (n.name !== "FencedCode") return Ut.has(n.name);
|
|
343
|
+
if (zt(e, n.from, n.to)) return !1;
|
|
344
|
+
let r = n.node.getChildren("CodeMark").map((t) => e.doc.lineAt(t.from)), i = e.doc.lineAt(n.from).number;
|
|
345
|
+
if (e.doc.lineAt(n.to).number - i + 1 <= r.length) return !1;
|
|
346
|
+
let a = n.node.getChild("CodeInfo"), o = n.node.getChild("CodeMark");
|
|
347
|
+
for (let [e, n] of r.entries()) e === 0 ? (t.push(Vt.range(o.from, a ? a.from : o.to)), a && t.push(Ht.range(a.from, a.to))) : t.push(Bt.range(n.from, n.to));
|
|
348
|
+
return !1;
|
|
349
|
+
} }), v.set(t, !0);
|
|
350
|
+
}
|
|
351
|
+
function Gt(e) {
|
|
352
|
+
let t = [];
|
|
353
|
+
for (let n of e.selection.ranges) s(e).iterate({
|
|
354
|
+
from: n.from,
|
|
355
|
+
to: n.to,
|
|
356
|
+
enter: (e) => (e.name === "FencedCode" && t.push(e.from), e.name !== "FencedCode" && Ut.has(e.name))
|
|
357
|
+
});
|
|
358
|
+
return t.join(",");
|
|
359
|
+
}
|
|
360
|
+
var Kt = h.define({
|
|
361
|
+
create: Wt,
|
|
362
|
+
update: (e, t) => t.docChanged || t.reconfigured || T(t.startState, t.state) || t.selection && Gt(t.startState) !== Gt(t.state) ? Wt(t.state) : e,
|
|
363
|
+
provide: (e) => _.decorations.from(e)
|
|
364
|
+
});
|
|
365
|
+
function qt(e) {
|
|
366
|
+
let { state: t } = e, n = (e, n) => zt(t, e, n), r = [];
|
|
367
|
+
for (let { from: i, to: a } of e.visibleRanges) s(t).iterate({
|
|
368
|
+
from: i,
|
|
369
|
+
to: a,
|
|
370
|
+
enter: (e) => {
|
|
371
|
+
let i = e.node.parent;
|
|
372
|
+
if (e.name === "HorizontalRule") return n(e.from, e.to) || r.push(kt.range(e.from, e.to)), !1;
|
|
373
|
+
if (e.name === "Blockquote") {
|
|
374
|
+
let i = At(e.node);
|
|
375
|
+
if (i !== e.node || n(i.from, i.to)) return;
|
|
376
|
+
let a = Lt(t, i), o = Pt(t, i), s = Ft(t, i), c = [0];
|
|
377
|
+
ze(t, i.from, i.to, (e) => {
|
|
378
|
+
if (e > s) return;
|
|
379
|
+
let n = t.doc.lineAt(e), i = a.get(e) ?? [], l = It(n.text, i), u = l.reduce((e, [t, n]) => e + n - t, 0);
|
|
380
|
+
for (let [t, n] of l) r.push(O.range(e + t, e + n));
|
|
381
|
+
let d = i.filter((e) => /[^ \t]/.test(n.text.charAt(e + 1)));
|
|
382
|
+
for (let t of d) r.push(Et.range(e + t, e + t + 1));
|
|
383
|
+
let f = i.map((e) => e - l.filter(([t]) => t < e).reduce((e, [t, n]) => e + n - t, 0) + d.filter((t) => t < e).length), p = Math.max(1, o.get(e) ?? 0), m = qn(n.text) - u + d.length, h = (f.length ? f : c).slice(0, p);
|
|
384
|
+
for (; h.length < p;) h.push(h.length ? h[h.length - 1] + jt : 0);
|
|
385
|
+
let g = f.length ? (p - f.length) * jt : h[h.length - 1] + jt;
|
|
386
|
+
g > 0 ? r.push(Nt(m, g).range(e)) : (u || d.length) && r.push(xt(m).range(e)), r.push(wt(h).range(e)), c = h;
|
|
387
|
+
});
|
|
388
|
+
} else if (i) {
|
|
389
|
+
if (e.name === "QuoteMark") {
|
|
390
|
+
let i = At(e.node), a = t.sliceDoc(e.to, e.to + 1) === " " ? e.to + 1 : e.to;
|
|
391
|
+
n(i.from, i.to) || r.push(Tt.range(e.from, a));
|
|
392
|
+
} else if (e.name === "ListMark" && /^[-*+]$/.test(t.sliceDoc(e.from, e.to)) && /^[ \t]/.test(t.sliceDoc(e.to, e.to + 1))) {
|
|
393
|
+
let i = t.doc.lineAt(e.from);
|
|
394
|
+
if (n(i.from, i.to)) return;
|
|
395
|
+
let a = vt.exec(i.text), o = a && e.node.parent?.getChild("Task")?.getChild("TaskMarker");
|
|
396
|
+
if (a && o) {
|
|
397
|
+
r.push(xt(a[1].length + yt + a[2].length).range(i.from), O.range(e.from, o.from), ut(t, /x/i.test(t.sliceDoc(o.from, o.to))).range(o.from, o.to));
|
|
398
|
+
return;
|
|
399
|
+
}
|
|
400
|
+
r.push(_t.range(e.from, e.to));
|
|
401
|
+
} else if (e.name === "ListMark" && /^\d+[.)]$/.test(t.sliceDoc(e.from, e.to))) r.push(St.range(e.from, e.to));
|
|
402
|
+
else if (e.name === "HeaderMark" && i.name.startsWith("ATXHeading")) {
|
|
403
|
+
let a = t.sliceDoc(e.to, e.to + 1) === " " ? e.to + 1 : e.to;
|
|
404
|
+
n(i.from, i.to) || r.push(O.range(e.from, a));
|
|
405
|
+
} else if (e.name === "Link") {
|
|
406
|
+
let i = e.node.getChild("URL"), a = e.node.getChildren("LinkMark");
|
|
407
|
+
if (!i || a.length < 2 || D(t, e.node)) return;
|
|
408
|
+
n(e.from, e.to) || r.push(O.range(a[0].from, a[0].to), O.range(a[1].from, e.to));
|
|
409
|
+
} else if (gt[e.name]?.includes(i.name) && !n(i.from, i.to) && (r.push(O.range(e.from, e.to)), e.name === "CodeMark" && e.from === i.from)) {
|
|
410
|
+
let t = i.lastChild;
|
|
411
|
+
t && t.from > e.to && r.push(Dt.range(e.to, t.from));
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
});
|
|
416
|
+
return v.set(r, !0);
|
|
417
|
+
}
|
|
418
|
+
var Jt = 3, Yt = class {
|
|
419
|
+
constructor(e) {
|
|
420
|
+
this.view = e, this.layerObserver = new MutationObserver(() => this.mendSelection()), this.observing = !1, this.checked = "", this.mends = 0, this.decorations = qt(e), queueMicrotask(() => this.observeLayer());
|
|
421
|
+
}
|
|
422
|
+
observeLayer() {
|
|
423
|
+
if (this.observing) return;
|
|
424
|
+
let e = this.view.dom.querySelector(".cm-selectionLayer");
|
|
425
|
+
e && (this.layerObserver.observe(e, {
|
|
426
|
+
childList: !0,
|
|
427
|
+
subtree: !0,
|
|
428
|
+
attributes: !0
|
|
429
|
+
}), this.observing = !0);
|
|
430
|
+
}
|
|
431
|
+
update(e) {
|
|
432
|
+
this.observeLayer(), (e.docChanged || e.selectionSet || e.viewportChanged || T(e.startState, e.state) || e.transactions.some((e) => e.reconfigured)) && (this.decorations = qt(e.view));
|
|
433
|
+
}
|
|
434
|
+
mendSelection() {
|
|
435
|
+
let { view: e } = this, { from: t, to: n, empty: r } = e.state.selection.main, i = `${t}-${n}-${e.state.doc.length}`;
|
|
436
|
+
if (i !== this.checked && (this.checked = i, this.mends = 0), r || this.mends >= Jt) return;
|
|
437
|
+
let a = e.dom.querySelector(".cm-selectionLayer"), o = a ? [...a.querySelectorAll(".cm-selectionBackground")] : [];
|
|
438
|
+
if (o.length < 2) return;
|
|
439
|
+
let s = e.coordsAtPos(t, 1), c = e.coordsAtPos(n, -1);
|
|
440
|
+
if (!s || !c || Math.abs(s.top - c.top) > 2) return;
|
|
441
|
+
this.mends += 1;
|
|
442
|
+
let [l] = o, u = o[o.length - 1];
|
|
443
|
+
l.style.width = `${u.offsetLeft + u.offsetWidth - l.offsetLeft}px`, o.slice(1).forEach((e) => e.remove()), e.dispatch({ selection: e.state.selection });
|
|
444
|
+
}
|
|
445
|
+
destroy() {
|
|
446
|
+
this.layerObserver.disconnect();
|
|
447
|
+
}
|
|
448
|
+
};
|
|
449
|
+
function Xt() {
|
|
450
|
+
return [y.highest(c.fromClass(Yt, { decorations: (e) => e.decorations })), Kt];
|
|
451
|
+
}
|
|
452
|
+
// src/components/inputs/text-editor/text-editor.links.ts
|
|
453
|
+
var k = x.define({ combine: (e) => e.some(Boolean) }), Zt = class extends t {
|
|
454
|
+
constructor(e, t, n) {
|
|
455
|
+
super(), this.href = e, this.tooltip = n, this.ariaLabel = t(e);
|
|
177
456
|
}
|
|
178
457
|
eq(e) {
|
|
179
|
-
return e.href === this.href && e.ariaLabel === this.ariaLabel;
|
|
458
|
+
return e.href === this.href && e.ariaLabel === this.ariaLabel && e.tooltip === this.tooltip;
|
|
180
459
|
}
|
|
181
460
|
toDOM() {
|
|
182
461
|
let e = document.createElement("a");
|
|
183
462
|
e.className = "cm-link-badge", e.href = this.href, e.target = "_blank", e.rel = "noopener noreferrer", e.setAttribute("aria-label", this.ariaLabel);
|
|
184
463
|
let t = document.createElement("nldd-icon");
|
|
185
|
-
|
|
464
|
+
if (t.setAttribute("icon", "external-link"), t.setAttribute("aria-hidden", "true"), e.addEventListener("mousedown", (e) => e.preventDefault()), !this.tooltip) return e.append(t), e;
|
|
465
|
+
let n = document.createElement("nldd-tooltip");
|
|
466
|
+
return n.setAttribute("text", this.href), n.append(t), e.append(n), e;
|
|
186
467
|
}
|
|
187
468
|
ignoreEvent() {
|
|
188
469
|
return !0;
|
|
189
470
|
}
|
|
190
471
|
coordsAt(e, t, n) {
|
|
191
|
-
let r = e.getBoundingClientRect(), i =
|
|
472
|
+
let r = e.getBoundingClientRect(), i = st(e) ?? {
|
|
192
473
|
top: r.top,
|
|
193
474
|
bottom: r.bottom
|
|
194
475
|
}, a = getComputedStyle(e), o = n < 0 ? r.left - parseFloat(a.marginLeft) : r.right + parseFloat(a.marginRight);
|
|
@@ -200,50 +481,50 @@ var st = class extends t {
|
|
|
200
481
|
};
|
|
201
482
|
}
|
|
202
483
|
};
|
|
203
|
-
function
|
|
484
|
+
function Qt(e) {
|
|
204
485
|
return e.replace(/^\[|\]$/g, "").trim().replace(/\s+/g, " ").toLowerCase();
|
|
205
486
|
}
|
|
206
|
-
function
|
|
487
|
+
function $t(e) {
|
|
207
488
|
let t = /* @__PURE__ */ new Map();
|
|
208
489
|
return s(e).iterate({ enter: (n) => {
|
|
209
490
|
if (n.name !== "LinkReference") return;
|
|
210
491
|
let r = null, i = null;
|
|
211
|
-
for (let t = n.node.firstChild; t; t = t.nextSibling) t.name === "LinkLabel" ? r =
|
|
492
|
+
for (let t = n.node.firstChild; t; t = t.nextSibling) t.name === "LinkLabel" ? r = Qt(e.sliceDoc(t.from, t.to)) : t.name === "URL" && (i = e.sliceDoc(t.from, t.to));
|
|
212
493
|
r && i && !t.has(r) && t.set(r, i);
|
|
213
494
|
} }), t;
|
|
214
495
|
}
|
|
215
|
-
function
|
|
496
|
+
function en(e) {
|
|
216
497
|
let t = e.replace(/[\u0000-\u0020\u007f-\u009f]/g, "");
|
|
217
498
|
return !/^[a-z][a-z0-9+.-]*:/i.test(t) || /^(?:https?|mailto|tel):/i.test(t);
|
|
218
499
|
}
|
|
219
|
-
function
|
|
500
|
+
function tn(e, t, n) {
|
|
220
501
|
let r = null;
|
|
221
502
|
for (let n = t.firstChild; n; n = n.nextSibling) {
|
|
222
503
|
if (n.name === "URL") {
|
|
223
504
|
let t = e.sliceDoc(n.from, n.to);
|
|
224
|
-
return t && !
|
|
505
|
+
return t && !Je(t) && en(t) ? t : null;
|
|
225
506
|
}
|
|
226
|
-
n.name === "LinkLabel" && (r =
|
|
507
|
+
n.name === "LinkLabel" && (r = Qt(e.sliceDoc(n.from, n.to)));
|
|
227
508
|
}
|
|
228
509
|
if (r) {
|
|
229
510
|
let e = n().get(r);
|
|
230
|
-
return e && !
|
|
511
|
+
return e && !Je(e) && en(e) ? e : null;
|
|
231
512
|
}
|
|
232
513
|
return null;
|
|
233
514
|
}
|
|
234
|
-
function
|
|
515
|
+
function A(e) {
|
|
235
516
|
for (let t = e.parent; t; t = t.parent) if (t.name === "Link" || t.name === "LinkReference" || t.name === "Image") return !0;
|
|
236
517
|
return !1;
|
|
237
518
|
}
|
|
238
|
-
function
|
|
519
|
+
function nn(e, t) {
|
|
239
520
|
let n = e.sliceDoc(t.from, t.to);
|
|
240
|
-
if (!n ||
|
|
521
|
+
if (!n || Je(n)) return null;
|
|
241
522
|
let r = n;
|
|
242
|
-
return /^[a-z][a-z0-9+.-]*:/i.test(n) || (/^www\./i.test(n) ? r = `https://${n}` : /^[^\s@]+@[^\s@]+$/.test(n) && (r = `mailto:${n}`)),
|
|
523
|
+
return /^[a-z][a-z0-9+.-]*:/i.test(n) || (/^www\./i.test(n) ? r = `https://${n}` : /^[^\s@]+@[^\s@]+$/.test(n) && (r = `mailto:${n}`)), en(r) ? r : null;
|
|
243
524
|
}
|
|
244
|
-
function
|
|
245
|
-
let n = new m(), r = s(e.state), i = null, a = () => i ?? (i =
|
|
246
|
-
widget: new
|
|
525
|
+
function rn(e, t) {
|
|
526
|
+
let n = new m(), r = s(e.state), i = null, a = () => i ?? (i = $t(e.state)), o = e.state.facet(k), c = (e, r, i = !1) => n.add(e, e, v.widget({
|
|
527
|
+
widget: new Zt(r, t, i),
|
|
247
528
|
side: -1
|
|
248
529
|
}));
|
|
249
530
|
for (let { from: t, to: n } of e.visibleRanges) r.iterate({
|
|
@@ -251,39 +532,39 @@ function pt(e, t) {
|
|
|
251
532
|
to: n,
|
|
252
533
|
enter: (t) => {
|
|
253
534
|
if (t.name === "Link") {
|
|
254
|
-
let n =
|
|
255
|
-
n &&
|
|
256
|
-
} else if (t.name === "URL" && !
|
|
257
|
-
let n =
|
|
258
|
-
n &&
|
|
535
|
+
let n = tn(e.state, t.node, a);
|
|
536
|
+
n && c(t.to, n, o && !zt(e.state, t.from, t.to));
|
|
537
|
+
} else if (t.name === "URL" && !A(t.node)) {
|
|
538
|
+
let n = nn(e.state, t.node);
|
|
539
|
+
n && c(t.to, n);
|
|
259
540
|
}
|
|
260
541
|
}
|
|
261
542
|
});
|
|
262
543
|
return n.finish();
|
|
263
544
|
}
|
|
264
|
-
function
|
|
545
|
+
function an(e) {
|
|
265
546
|
return c.fromClass(class {
|
|
266
547
|
constructor(t) {
|
|
267
|
-
this.decorations =
|
|
548
|
+
this.decorations = rn(t, e);
|
|
268
549
|
}
|
|
269
550
|
update(t) {
|
|
270
|
-
(t.docChanged || t.viewportChanged ||
|
|
551
|
+
(t.docChanged || t.viewportChanged || T(t.startState, t.state) || t.transactions.some((e) => e.effects.some((e) => e.is(Pe))) || t.startState.facet(k) !== t.state.facet(k) || t.selectionSet && t.state.facet(k)) && (this.decorations = rn(t.view, e));
|
|
271
552
|
}
|
|
272
553
|
}, { decorations: (e) => e.decorations });
|
|
273
554
|
}
|
|
274
|
-
function
|
|
555
|
+
function on(e, t) {
|
|
275
556
|
let n = null;
|
|
276
|
-
return
|
|
557
|
+
return w(e, t, -1, (r) => r.to === t ? r.name === "Link" ? tn(e, r, () => n ?? (n = $t(e))) !== null : r.name === "URL" && !A(r) && nn(e, r) !== null : !1) !== null;
|
|
277
558
|
}
|
|
278
|
-
function
|
|
279
|
-
return
|
|
559
|
+
function sn(e, t) {
|
|
560
|
+
return w(e, t, -1, (n) => n.name === "URL" && n.to === t && !A(n) && nn(e, n) !== null) !== null;
|
|
280
561
|
}
|
|
281
562
|
// src/components/inputs/text-editor/text-editor.emphasis.ts
|
|
282
|
-
var
|
|
563
|
+
var j = /* @__PURE__ */ new Map([
|
|
283
564
|
["StrongEmphasis", "**"],
|
|
284
565
|
["Emphasis", "*"],
|
|
285
566
|
["Strikethrough", "~~"]
|
|
286
|
-
]),
|
|
567
|
+
]), cn = /* @__PURE__ */ new Set([
|
|
287
568
|
"Paragraph",
|
|
288
569
|
"ATXHeading1",
|
|
289
570
|
"ATXHeading2",
|
|
@@ -294,21 +575,21 @@ var A = /* @__PURE__ */ new Map([
|
|
|
294
575
|
"SetextHeading1",
|
|
295
576
|
"SetextHeading2",
|
|
296
577
|
"TableCell"
|
|
297
|
-
]),
|
|
578
|
+
]), ln = /^\s*(?:\n\s*(?:(?:[-*+]|\d+[.)]|>|\[[ xX]\])\s*)*)*$/, un = b.define({ map: (e, t) => ({
|
|
298
579
|
...e,
|
|
299
580
|
from: t.mapPos(e.from, 1),
|
|
300
581
|
to: t.mapPos(e.to, -1)
|
|
301
582
|
}) });
|
|
302
|
-
function
|
|
303
|
-
return
|
|
583
|
+
function dn(e, t, n) {
|
|
584
|
+
return w(e, t, n, (e) => j.has(e.name));
|
|
304
585
|
}
|
|
305
|
-
function
|
|
306
|
-
return
|
|
586
|
+
function fn(e, t) {
|
|
587
|
+
return E(e, t, 1, cn);
|
|
307
588
|
}
|
|
308
|
-
function
|
|
309
|
-
let { from: t, to: n } = e.selection.main, r =
|
|
589
|
+
function pn(e) {
|
|
590
|
+
let { from: t, to: n } = e.selection.main, r = dn(e, t, -1), i = r && dn(e, n, 1);
|
|
310
591
|
if (!r || !i || r.from !== i.from || r.to !== i.to) return null;
|
|
311
|
-
let a =
|
|
592
|
+
let a = j.get(r.name).length;
|
|
312
593
|
return {
|
|
313
594
|
from: r.from,
|
|
314
595
|
to: r.to,
|
|
@@ -317,49 +598,49 @@ function St(e) {
|
|
|
317
598
|
live: !0
|
|
318
599
|
};
|
|
319
600
|
}
|
|
320
|
-
function
|
|
601
|
+
function mn(e, t) {
|
|
321
602
|
let n = t.marker.length, { from: r, to: i } = e.selection.main;
|
|
322
603
|
if (r < t.from + n || i > t.to - n) return !1;
|
|
323
604
|
let a = e.sliceDoc(t.from, t.to);
|
|
324
605
|
if (a.length < 2 * n || !a.startsWith(t.marker) || !a.endsWith(t.marker)) return !1;
|
|
325
|
-
let o =
|
|
606
|
+
let o = fn(e, t.from);
|
|
326
607
|
if (!o || o.to < t.to) return !1;
|
|
327
|
-
let s =
|
|
608
|
+
let s = dn(e, t.from, 1);
|
|
328
609
|
return !(s && s.name === t.name && s.from === t.from);
|
|
329
610
|
}
|
|
330
|
-
function
|
|
611
|
+
function hn(e, t) {
|
|
331
612
|
return {
|
|
332
613
|
...e,
|
|
333
614
|
from: t.changes.mapPos(e.from, 1),
|
|
334
615
|
to: t.changes.mapPos(e.to, -1)
|
|
335
616
|
};
|
|
336
617
|
}
|
|
337
|
-
var
|
|
338
|
-
create: (e) =>
|
|
618
|
+
var M = h.define({
|
|
619
|
+
create: (e) => pn(e),
|
|
339
620
|
update(e, t) {
|
|
340
621
|
if (e) {
|
|
341
|
-
let n =
|
|
622
|
+
let n = hn({
|
|
342
623
|
...e,
|
|
343
624
|
live: !1
|
|
344
625
|
}, t);
|
|
345
|
-
if (
|
|
626
|
+
if (mn(t.state, n)) return n;
|
|
346
627
|
}
|
|
347
|
-
let n =
|
|
628
|
+
let n = pn(t.state);
|
|
348
629
|
if (n) return n;
|
|
349
|
-
let r = t.effects.find((e) => e.is(
|
|
630
|
+
let r = t.effects.find((e) => e.is(un));
|
|
350
631
|
return r ? {
|
|
351
632
|
...r.value,
|
|
352
633
|
live: !1
|
|
353
634
|
} : null;
|
|
354
635
|
}
|
|
355
636
|
});
|
|
356
|
-
function
|
|
637
|
+
function gn(e, t) {
|
|
357
638
|
let n = t.marker.length, r = e.sliceDoc(t.from, t.to);
|
|
358
639
|
if (r.length < 2 * n || !r.startsWith(t.marker) || !r.endsWith(t.marker)) return null;
|
|
359
|
-
let i = r.slice(n, r.length - n), a = /^\s*/.exec(i)[0].length, o =
|
|
640
|
+
let i = r.slice(n, r.length - n), a = /^\s*/.exec(i)[0].length, o = fn(e, t.from), s = e.sliceDoc(t.from + n, Math.min(t.to - n, o ? o.to : t.to - n)), c = t.from + n + s.replace(/\s+$/, "").length;
|
|
360
641
|
if (c <= t.from + n + a) return null;
|
|
361
642
|
let l = t.to - n - c;
|
|
362
|
-
return !a && !l || !
|
|
643
|
+
return !a && !l || !ln.test(e.sliceDoc(c, t.to - n)) ? null : {
|
|
363
644
|
from: t.from,
|
|
364
645
|
to: t.to,
|
|
365
646
|
len: n,
|
|
@@ -367,7 +648,7 @@ function Tt(e, t) {
|
|
|
367
648
|
trail: l
|
|
368
649
|
};
|
|
369
650
|
}
|
|
370
|
-
function
|
|
651
|
+
function _n(e, t) {
|
|
371
652
|
let n = [];
|
|
372
653
|
return t.lead && n.push({
|
|
373
654
|
from: t.from,
|
|
@@ -383,7 +664,7 @@ function Et(e, t) {
|
|
|
383
664
|
insert: e.sliceDoc(t.to - t.len - t.trail, t.to - t.len)
|
|
384
665
|
}), n;
|
|
385
666
|
}
|
|
386
|
-
function
|
|
667
|
+
function vn(e, t, n) {
|
|
387
668
|
let r = t.from + t.len + t.lead, i = t.to - t.len - t.trail;
|
|
388
669
|
if (t.lead) {
|
|
389
670
|
if (e > t.from && e < t.from + t.len) return e + t.lead;
|
|
@@ -395,35 +676,35 @@ function Dt(e, t, n) {
|
|
|
395
676
|
}
|
|
396
677
|
return e;
|
|
397
678
|
}
|
|
398
|
-
function
|
|
399
|
-
let i =
|
|
679
|
+
function yn(t, n, r) {
|
|
680
|
+
let i = gn(t, n);
|
|
400
681
|
if (!i) return null;
|
|
401
682
|
let a = t.selection;
|
|
402
683
|
return {
|
|
403
|
-
changes:
|
|
404
|
-
selection: e.create(a.ranges.map((t) => e.range(
|
|
684
|
+
changes: _n(t, i),
|
|
685
|
+
selection: e.create(a.ranges.map((t) => e.range(vn(t.anchor, i, r), vn(t.head, i, r))), a.mainIndex),
|
|
405
686
|
userEvent: "input.emphasis"
|
|
406
687
|
};
|
|
407
688
|
}
|
|
408
|
-
function
|
|
409
|
-
let n =
|
|
410
|
-
return n ?
|
|
689
|
+
function bn(e, t) {
|
|
690
|
+
let n = gn(e, t);
|
|
691
|
+
return n ? _n(e, n) : [];
|
|
411
692
|
}
|
|
412
|
-
function
|
|
413
|
-
let t = e.state.field(
|
|
693
|
+
function xn(e) {
|
|
694
|
+
let t = e.state.field(M, !1);
|
|
414
695
|
if (!t || t.live || e.state.readOnly) return;
|
|
415
|
-
let n =
|
|
696
|
+
let n = yn(e.state, t, !0);
|
|
416
697
|
n && e.dispatch(n);
|
|
417
698
|
}
|
|
418
|
-
var
|
|
699
|
+
var Sn = [M, c.fromClass(class {
|
|
419
700
|
constructor(e) {
|
|
420
701
|
this.view = e, this.pending = null, this.destroyed = !1;
|
|
421
702
|
}
|
|
422
703
|
update(e) {
|
|
423
|
-
this.pending && (this.pending =
|
|
424
|
-
let t = e.startState.field(
|
|
704
|
+
this.pending && (this.pending = hn(this.pending, e));
|
|
705
|
+
let t = e.startState.field(M);
|
|
425
706
|
if (!t) return;
|
|
426
|
-
let n =
|
|
707
|
+
let n = hn(t, e), r = e.state.field(M);
|
|
427
708
|
r && r.name === n.name && r.from === n.from && r.to === n.to || (this.pending = n, queueMicrotask(() => this.flush()));
|
|
428
709
|
}
|
|
429
710
|
flush() {
|
|
@@ -439,20 +720,20 @@ var jt = [j, c.fromClass(class {
|
|
|
439
720
|
});
|
|
440
721
|
return;
|
|
441
722
|
}
|
|
442
|
-
let t =
|
|
723
|
+
let t = yn(this.view.state, e, !1);
|
|
443
724
|
t && this.view.dispatch(t);
|
|
444
725
|
}
|
|
445
726
|
destroy() {
|
|
446
727
|
this.destroyed = !0;
|
|
447
728
|
}
|
|
448
|
-
})],
|
|
729
|
+
})], Cn = y.high(n.of([{
|
|
449
730
|
key: "Enter",
|
|
450
|
-
run:
|
|
731
|
+
run: xe({ nonTightLists: !1 })
|
|
451
732
|
}, {
|
|
452
733
|
key: "Backspace",
|
|
453
|
-
run:
|
|
454
|
-
}])),
|
|
455
|
-
function
|
|
734
|
+
run: Se
|
|
735
|
+
}])), N = /^( *)([-*+]|\d{1,9}[.)])( +|$)/, wn = /^( *)([-*+]|\d{1,9}[.)]) ( *)([-*+]|\d{1,9}[.)]) $/, Tn = /^( +)([-*+]|\d{1,9}[.)]) $/, En = /^((?:> ?)*> )> $/, Dn = (e) => /\d/.test(e);
|
|
736
|
+
function P(e, t) {
|
|
456
737
|
let n = [], r = Infinity, i = 0;
|
|
457
738
|
for (let a = t - 1; a >= 1 && a > t - 500; a--) {
|
|
458
739
|
let t = e.doc.line(a).text;
|
|
@@ -460,7 +741,7 @@ function N(e, t) {
|
|
|
460
741
|
if (++i >= 2) break;
|
|
461
742
|
continue;
|
|
462
743
|
}
|
|
463
|
-
let o =
|
|
744
|
+
let o = N.exec(t);
|
|
464
745
|
if (!o) {
|
|
465
746
|
if (/^\S/.test(t) && i > 0) break;
|
|
466
747
|
i = 0;
|
|
@@ -475,29 +756,29 @@ function N(e, t) {
|
|
|
475
756
|
}
|
|
476
757
|
return n;
|
|
477
758
|
}
|
|
478
|
-
function
|
|
759
|
+
function On(e, t) {
|
|
479
760
|
return e.length === 0 ? 0 : t > e[0].markerCol ? e[0].contentCol : e.find((e) => e.markerCol <= t)?.markerCol ?? 0;
|
|
480
761
|
}
|
|
481
|
-
function
|
|
482
|
-
let r =
|
|
762
|
+
function kn(e, t, n) {
|
|
763
|
+
let r = En.exec(n);
|
|
483
764
|
if (r) return r[1];
|
|
484
|
-
let i =
|
|
765
|
+
let i = wn.exec(n);
|
|
485
766
|
if (i) {
|
|
486
|
-
let [, n, r, a, o] = i, s =
|
|
487
|
-
return a === "" ?
|
|
767
|
+
let [, n, r, a, o] = i, s = P(e, t), c = `${" ".repeat(s.length ? s[0].contentCol : n.length + r.length + 1)}${o} `;
|
|
768
|
+
return a === "" ? Dn(r) === Dn(o) ? Dn(o) && parseInt(o, 10) === 1 && parseInt(r, 10) !== 1 ? c : `${n}${r} ` : `${n}${o} ` : c;
|
|
488
769
|
}
|
|
489
|
-
let a =
|
|
770
|
+
let a = Tn.exec(n);
|
|
490
771
|
if (a) {
|
|
491
|
-
let [, n, r] = a, i =
|
|
772
|
+
let [, n, r] = a, i = On(P(e, t), n.length);
|
|
492
773
|
return i === n.length ? null : `${" ".repeat(i)}${r} `;
|
|
493
774
|
}
|
|
494
775
|
return null;
|
|
495
776
|
}
|
|
496
|
-
var
|
|
777
|
+
var An = _.inputHandler.of((e, t, n, r) => {
|
|
497
778
|
if (r !== " " || t !== n || e.state.readOnly) return !1;
|
|
498
779
|
let i = e.state.doc.lineAt(t);
|
|
499
|
-
if (
|
|
500
|
-
let a = i.text.slice(0, t - i.from) + " ", o =
|
|
780
|
+
if (Le(e.state, i.from)) return !1;
|
|
781
|
+
let a = i.text.slice(0, t - i.from) + " ", o = kn(e.state, i.number, a);
|
|
501
782
|
return o === null || o === a ? !1 : (e.dispatch({
|
|
502
783
|
changes: {
|
|
503
784
|
from: t,
|
|
@@ -513,9 +794,9 @@ var zt = _.inputHandler.of((e, t, n, r) => {
|
|
|
513
794
|
},
|
|
514
795
|
selection: { anchor: i.from + o.length },
|
|
515
796
|
userEvent: "input.complete",
|
|
516
|
-
annotations:
|
|
797
|
+
annotations: ce.of("before")
|
|
517
798
|
}), !0);
|
|
518
|
-
}),
|
|
799
|
+
}), jn = {
|
|
519
800
|
ATXHeading1: "cm-md-h1",
|
|
520
801
|
ATXHeading2: "cm-md-h2",
|
|
521
802
|
ATXHeading3: "cm-md-h3",
|
|
@@ -528,7 +809,7 @@ var zt = _.inputHandler.of((e, t, n, r) => {
|
|
|
528
809
|
InlineCode: "cm-md-code",
|
|
529
810
|
URL: "cm-md-url",
|
|
530
811
|
Blockquote: "cm-md-quote"
|
|
531
|
-
},
|
|
812
|
+
}, Mn = /* @__PURE__ */ new Set([
|
|
532
813
|
"HeaderMark",
|
|
533
814
|
"EmphasisMark",
|
|
534
815
|
"StrikethroughMark",
|
|
@@ -536,42 +817,42 @@ var zt = _.inputHandler.of((e, t, n, r) => {
|
|
|
536
817
|
"QuoteMark",
|
|
537
818
|
"ListMark",
|
|
538
819
|
"LinkMark"
|
|
539
|
-
]),
|
|
540
|
-
function
|
|
541
|
-
return
|
|
820
|
+
]), Nn = v.mark({ class: "cm-md-mark" }), Pn = v.line({ class: "cm-md-quote-row" }), Fn = {};
|
|
821
|
+
function F(e) {
|
|
822
|
+
return Fn[e] ?? (Fn[e] = v.mark({
|
|
542
823
|
class: e,
|
|
543
824
|
inclusiveEnd: !0
|
|
544
825
|
}));
|
|
545
826
|
}
|
|
546
|
-
var
|
|
547
|
-
function
|
|
827
|
+
var In = v.line({ class: "cm-md-codeblock" }), Ln = v.line({ class: "cm-md-codeblock-first" }), Rn = v.line({ class: "cm-md-codeblock-last" }), zn = v.line({ class: "cm-md-codeblock-line-selected" });
|
|
828
|
+
function Bn(e, t, n, r) {
|
|
548
829
|
if (t.length === 0) return;
|
|
549
830
|
let i = e.doc.line(t[0]), a = e.doc.line(t[t.length - 1]), o = !n.empty && n.from <= i.from && n.to >= a.to;
|
|
550
831
|
t.forEach((i, a) => {
|
|
551
832
|
let s = e.doc.line(i);
|
|
552
|
-
if (r.push(
|
|
833
|
+
if (r.push(In.range(s.from)), a === 0 && r.push(Ln.range(s.from)), a === t.length - 1 && r.push(Rn.range(s.from)), o) r.push(zn.range(s.from));
|
|
553
834
|
else if (!n.empty) {
|
|
554
835
|
let e = Math.max(s.from, n.from), t = Math.min(s.to, n.to);
|
|
555
|
-
t > e && r.push(
|
|
836
|
+
t > e && r.push(F("cm-md-codeblock-selected").range(e, t));
|
|
556
837
|
}
|
|
557
838
|
});
|
|
558
839
|
}
|
|
559
|
-
function
|
|
840
|
+
function Vn(e, t, n, r, i) {
|
|
560
841
|
let a = e.doc.lineAt(t).number, o = e.doc.lineAt(Math.max(t, n - 1)).number, s = [];
|
|
561
842
|
for (let e = a; e <= o; e++) s.push(e);
|
|
562
|
-
|
|
843
|
+
Bn(e, s, r, i);
|
|
563
844
|
}
|
|
564
|
-
function
|
|
845
|
+
function Hn(e, t, n, r) {
|
|
565
846
|
let i = /* @__PURE__ */ new Set();
|
|
566
847
|
for (let n = t.firstChild; n; n = n.nextSibling) n.name === "CodeMark" && i.add(e.doc.lineAt(n.from).number);
|
|
567
848
|
let a = e.doc.lineAt(t.from).number, o = e.doc.lineAt(Math.max(t.from, t.to - 1)).number, s = [];
|
|
568
849
|
for (let e = a; e <= o; e++) i.has(e) || s.push(e);
|
|
569
|
-
|
|
850
|
+
Bn(e, s, n, r);
|
|
570
851
|
}
|
|
571
|
-
function
|
|
572
|
-
|
|
852
|
+
function Un(e, t, n) {
|
|
853
|
+
D(e, t) || n.push(F("cm-md-link").range(t.from, t.to));
|
|
573
854
|
}
|
|
574
|
-
function
|
|
855
|
+
function Wn(e) {
|
|
575
856
|
let t = [], n = e.state.selection.main;
|
|
576
857
|
for (let { from: r, to: i } of e.visibleRanges) s(e.state).iterate({
|
|
577
858
|
from: r,
|
|
@@ -579,74 +860,74 @@ function $t(e) {
|
|
|
579
860
|
enter: (r) => {
|
|
580
861
|
if (r.from >= r.to) return;
|
|
581
862
|
if (r.name === "Link") {
|
|
582
|
-
|
|
863
|
+
Un(e.state, r.node, t);
|
|
583
864
|
return;
|
|
584
865
|
}
|
|
585
866
|
if (r.name === "FencedCode") {
|
|
586
|
-
|
|
867
|
+
Hn(e.state, r.node, n, t);
|
|
587
868
|
return;
|
|
588
869
|
}
|
|
589
870
|
if (r.name === "CodeBlock") {
|
|
590
|
-
|
|
871
|
+
Vn(e.state, r.from, r.to, n, t);
|
|
591
872
|
return;
|
|
592
873
|
}
|
|
593
|
-
if (r.name === "URL" && !
|
|
594
|
-
t.push(
|
|
874
|
+
if (r.name === "URL" && !A(r.node)) {
|
|
875
|
+
t.push(F("cm-md-autolink").range(r.from, r.to));
|
|
595
876
|
return;
|
|
596
877
|
}
|
|
597
|
-
r.name === "Blockquote" && r.node.parent?.name !== "Blockquote" &&
|
|
598
|
-
let i =
|
|
878
|
+
r.name === "Blockquote" && r.node.parent?.name !== "Blockquote" && ze(e.state, r.from, r.to, (e) => t.push(Pn.range(e)));
|
|
879
|
+
let i = jn[r.name];
|
|
599
880
|
if (i) {
|
|
600
|
-
if (i === "cm-md-code" && !n.empty && n.from <= r.from && n.to >= r.to) t.push(
|
|
601
|
-
else if (t.push(
|
|
881
|
+
if (i === "cm-md-code" && !n.empty && n.from <= r.from && n.to >= r.to) t.push(F("cm-md-code cm-md-code-selected").range(r.from, r.to));
|
|
882
|
+
else if (t.push(F(i).range(r.from, r.to)), !n.empty && i === "cm-md-code") {
|
|
602
883
|
let e = Math.max(r.from, n.from), i = Math.min(r.to, n.to), a = (e === r.from ? " cm-md-code-selected-start" : "") + (i === r.to ? " cm-md-code-selected-end" : "");
|
|
603
|
-
i > e && t.push(
|
|
884
|
+
i > e && t.push(F(`cm-md-code-selected${a}`).range(e, i));
|
|
604
885
|
}
|
|
605
|
-
} else
|
|
886
|
+
} else Mn.has(r.name) && t.push(Nn.range(r.from, r.to));
|
|
606
887
|
}
|
|
607
888
|
});
|
|
608
|
-
let r = e.state.field(
|
|
889
|
+
let r = e.state.field(M, !1);
|
|
609
890
|
if (r && !r.live) {
|
|
610
891
|
let e = r.marker.length;
|
|
611
|
-
t.push(
|
|
892
|
+
t.push(F(jn[r.name]).range(r.from, r.to)), t.push(Nn.range(r.from, r.from + e), Nn.range(r.to - e, r.to));
|
|
612
893
|
}
|
|
613
894
|
return v.set(t, !0);
|
|
614
895
|
}
|
|
615
|
-
var
|
|
896
|
+
var Gn = c.fromClass(class {
|
|
616
897
|
constructor(e) {
|
|
617
|
-
this.decorations =
|
|
898
|
+
this.decorations = Wn(e);
|
|
618
899
|
}
|
|
619
900
|
update(e) {
|
|
620
|
-
(e.docChanged || e.viewportChanged || e.selectionSet ||
|
|
901
|
+
(e.docChanged || e.viewportChanged || e.selectionSet || T(e.startState, e.state)) && (this.decorations = Wn(e.view));
|
|
621
902
|
}
|
|
622
|
-
}, { decorations: (e) => e.decorations }),
|
|
623
|
-
function
|
|
624
|
-
return
|
|
903
|
+
}, { decorations: (e) => e.decorations }), Kn = /^((?:[ \t]*(?:[-*+][ \t]+(?:\[[ xX]\][ \t]+)?|\d+[.)][ \t]+|>[ \t]?))+)/;
|
|
904
|
+
function qn(e) {
|
|
905
|
+
return Kn.exec(e)?.[1].length ?? 0;
|
|
625
906
|
}
|
|
626
|
-
var
|
|
627
|
-
function
|
|
628
|
-
return
|
|
907
|
+
var Jn = v.mark({ class: "cm-md-listprefix" }), Yn = {};
|
|
908
|
+
function Xn(e) {
|
|
909
|
+
return Yn[e] ?? (Yn[e] = v.line({ attributes: { style: `text-indent:calc(${e} * var(--_text-editor-marker-advance) * -1);padding-left:calc(${e} * var(--_text-editor-marker-advance))` } }));
|
|
629
910
|
}
|
|
630
|
-
function
|
|
911
|
+
function Zn(e) {
|
|
631
912
|
let t = [], n = 0;
|
|
632
913
|
for (let r = e.doc.iterLines(); !r.next().done;) {
|
|
633
|
-
let i = r.value, a =
|
|
634
|
-
if (a && a[1].length && !
|
|
914
|
+
let i = r.value, a = Kn.exec(i);
|
|
915
|
+
if (a && a[1].length && !Le(e, n) && !Be(e, n)) {
|
|
635
916
|
let e = a[1].length;
|
|
636
|
-
t.push(
|
|
917
|
+
t.push(Xn(e).range(n)), t.push(Jn.range(n, n + e));
|
|
637
918
|
}
|
|
638
919
|
n += i.length + 1;
|
|
639
920
|
}
|
|
640
921
|
return v.set(t, !0);
|
|
641
922
|
}
|
|
642
|
-
var
|
|
643
|
-
create: (e) =>
|
|
644
|
-
update: (e, t) => t.docChanged ||
|
|
923
|
+
var Qn = h.define({
|
|
924
|
+
create: (e) => Zn(e),
|
|
925
|
+
update: (e, t) => t.docChanged || T(t.startState, t.state) ? Zn(t.state) : e,
|
|
645
926
|
provide: (e) => _.decorations.from(e)
|
|
646
|
-
}),
|
|
647
|
-
|
|
927
|
+
}), $n = [
|
|
928
|
+
be({
|
|
648
929
|
extensions: [
|
|
649
|
-
|
|
930
|
+
ye,
|
|
650
931
|
{ remove: ["IndentedCode"] },
|
|
651
932
|
{ parseBlock: [{
|
|
652
933
|
name: "IndentedText",
|
|
@@ -661,17 +942,17 @@ var cn = h.define({
|
|
|
661
942
|
codeLanguages: ee,
|
|
662
943
|
addKeymap: !1
|
|
663
944
|
}),
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
],
|
|
671
|
-
function
|
|
945
|
+
Cn,
|
|
946
|
+
An,
|
|
947
|
+
Gn,
|
|
948
|
+
Sn,
|
|
949
|
+
Qn,
|
|
950
|
+
tt
|
|
951
|
+
], er = "[\\p{L}\\p{M}\\p{N}_.+-]*", tr = /* @__PURE__ */ new Map();
|
|
952
|
+
function nr(e, t) {
|
|
672
953
|
if (e.length !== 1 || /[\s\p{L}\p{N}_]/u.test(e)) return null;
|
|
673
954
|
let n = `${e}\u0000${t}`;
|
|
674
|
-
if (
|
|
955
|
+
if (tr.has(n)) return tr.get(n);
|
|
675
956
|
let r;
|
|
676
957
|
try {
|
|
677
958
|
let n = [
|
|
@@ -681,11 +962,11 @@ function fn(e, t) {
|
|
|
681
962
|
].filter((t) => t !== e).join(""), i = e.replace(/[\\^$.*+?()[\]{}|/]/g, "\\$&");
|
|
682
963
|
r = RegExp(`((?:^|[\\s\\p{Ps}\\p{Pi}"'])[${n}]*)(${i})(${t})$`, "u");
|
|
683
964
|
} catch {
|
|
684
|
-
r = t === "[\\p{L}\\p{M}\\p{N}_.+-]*" ? null :
|
|
965
|
+
r = t === "[\\p{L}\\p{M}\\p{N}_.+-]*" ? null : nr(e, er);
|
|
685
966
|
}
|
|
686
|
-
return
|
|
967
|
+
return tr.set(n, r), r;
|
|
687
968
|
}
|
|
688
|
-
function
|
|
969
|
+
function rr(e) {
|
|
689
970
|
return e.some(({ query: e }) => {
|
|
690
971
|
if (e === void 0) return !1;
|
|
691
972
|
try {
|
|
@@ -695,7 +976,7 @@ function pn(e) {
|
|
|
695
976
|
}
|
|
696
977
|
});
|
|
697
978
|
}
|
|
698
|
-
function
|
|
979
|
+
function ir(e) {
|
|
699
980
|
let t = /* @__PURE__ */ new Map();
|
|
700
981
|
for (let n of e) {
|
|
701
982
|
let { trigger: e, query: r } = typeof n == "string" ? {
|
|
@@ -704,27 +985,27 @@ function mn(e) {
|
|
|
704
985
|
} : n;
|
|
705
986
|
(!t.has(e) || t.get(e) === void 0 && r !== void 0) && t.set(e, r);
|
|
706
987
|
}
|
|
707
|
-
return Array.from(t, ([e, t]) =>
|
|
988
|
+
return Array.from(t, ([e, t]) => nr(e, t ?? "[\\p{L}\\p{M}\\p{N}_.+-]*")).filter((e) => e !== null);
|
|
708
989
|
}
|
|
709
|
-
function
|
|
990
|
+
function ar(e, t, n) {
|
|
710
991
|
let r = e.doc.lineAt(t), i = e.sliceDoc(r.from, t), a = null;
|
|
711
|
-
for (let e of
|
|
992
|
+
for (let e of ir(n)) {
|
|
712
993
|
let t = e.exec(i);
|
|
713
994
|
t && (!a || t.index + t[1].length > a.index + a[1].length) && (a = t);
|
|
714
995
|
}
|
|
715
996
|
if (!a) return null;
|
|
716
997
|
let o = r.from + a.index + a[1].length;
|
|
717
|
-
return
|
|
998
|
+
return Re(e, o) ? null : {
|
|
718
999
|
from: o,
|
|
719
1000
|
to: t,
|
|
720
1001
|
query: a[3],
|
|
721
1002
|
trigger: a[2]
|
|
722
1003
|
};
|
|
723
1004
|
}
|
|
724
|
-
function
|
|
1005
|
+
function or(e) {
|
|
725
1006
|
return (t) => `${e}${t.text} `;
|
|
726
1007
|
}
|
|
727
|
-
function
|
|
1008
|
+
function sr(e) {
|
|
728
1009
|
let { candidate: t } = e;
|
|
729
1010
|
if (t.avatar) {
|
|
730
1011
|
let e = document.createElement("nldd-avatar");
|
|
@@ -740,17 +1021,17 @@ function _n(e) {
|
|
|
740
1021
|
}
|
|
741
1022
|
return null;
|
|
742
1023
|
}
|
|
743
|
-
function
|
|
1024
|
+
function cr(e) {
|
|
744
1025
|
return e.candidate.avatar ? "cm-nldd-row-avatar" : "";
|
|
745
1026
|
}
|
|
746
|
-
var
|
|
747
|
-
function
|
|
1027
|
+
var I = b.define();
|
|
1028
|
+
function lr(e, t, n) {
|
|
748
1029
|
return async (r) => {
|
|
749
|
-
let i = e(), a =
|
|
1030
|
+
let i = e(), a = ar(r.state, r.pos, i);
|
|
750
1031
|
if (!a) return null;
|
|
751
1032
|
let o = i.filter((e) => e.trigger === a.trigger), s = await Promise.all(o.map((e) => e.source(a.query))), c = [];
|
|
752
1033
|
s.forEach((e, n) => {
|
|
753
|
-
let r = o[n], i = r.insert ??
|
|
1034
|
+
let r = o[n], i = r.insert ?? or(a.trigger);
|
|
754
1035
|
for (let n of e ?? []) c.push({
|
|
755
1036
|
label: `${a.trigger}${n.text}`,
|
|
756
1037
|
detail: n.supportingText,
|
|
@@ -775,13 +1056,13 @@ function yn(e, t, n) {
|
|
|
775
1056
|
}
|
|
776
1057
|
});
|
|
777
1058
|
});
|
|
778
|
-
let l = c.length ? null :
|
|
1059
|
+
let l = c.length ? null : ur(o, a.query, n), u = r.view;
|
|
779
1060
|
if (u && !r.aborted && u.state.doc === r.state.doc) {
|
|
780
|
-
let e = u.state.field(
|
|
1061
|
+
let e = u.state.field(L, !1), t = l === null ? null : {
|
|
781
1062
|
from: a.from,
|
|
782
1063
|
text: l
|
|
783
1064
|
};
|
|
784
|
-
(e?.text !== t?.text || e?.from !== t?.from) && u.dispatch({ effects:
|
|
1065
|
+
(e?.text !== t?.text || e?.from !== t?.from) && u.dispatch({ effects: I.of(t) });
|
|
785
1066
|
}
|
|
786
1067
|
return c.length ? {
|
|
787
1068
|
from: a.from,
|
|
@@ -790,17 +1071,17 @@ function yn(e, t, n) {
|
|
|
790
1071
|
} : null;
|
|
791
1072
|
};
|
|
792
1073
|
}
|
|
793
|
-
function
|
|
1074
|
+
function ur(e, t, n) {
|
|
794
1075
|
for (let n of e) {
|
|
795
1076
|
let e = n.emptyText?.(t);
|
|
796
1077
|
if (e !== void 0) return e || null;
|
|
797
1078
|
}
|
|
798
1079
|
return n(t);
|
|
799
1080
|
}
|
|
800
|
-
var
|
|
1081
|
+
var L = h.define({
|
|
801
1082
|
create: () => null,
|
|
802
1083
|
update(e, t) {
|
|
803
|
-
for (let e of t.effects) if (e.is(
|
|
1084
|
+
for (let e of t.effects) if (e.is(I)) return e.value;
|
|
804
1085
|
if (!e) return null;
|
|
805
1086
|
if (t.docChanged && (e = {
|
|
806
1087
|
...e,
|
|
@@ -819,34 +1100,34 @@ var I = h.define({
|
|
|
819
1100
|
return t.className = "cm-nldd-typeahead-empty", t.textContent = e.text, { dom: t };
|
|
820
1101
|
}
|
|
821
1102
|
})
|
|
822
|
-
}),
|
|
1103
|
+
}), dr = [
|
|
823
1104
|
y.high(n.of([{
|
|
824
1105
|
key: "Escape",
|
|
825
|
-
run: (e) => e.state.field(
|
|
1106
|
+
run: (e) => e.state.field(L, !1) ? (e.dispatch({ effects: I.of(null) }), !0) : !1
|
|
826
1107
|
}])),
|
|
827
|
-
_.focusChangeEffect.of((e, t) => !t && e.field(
|
|
1108
|
+
_.focusChangeEffect.of((e, t) => !t && e.field(L, !1) ? I.of(null) : null),
|
|
828
1109
|
_.updateListener.of((e) => {
|
|
829
|
-
|
|
1110
|
+
De(e.state) === "active" && e.state.field(L, !1) && queueMicrotask(() => e.view.dispatch({ effects: I.of(null) }));
|
|
830
1111
|
})
|
|
831
1112
|
];
|
|
832
|
-
function
|
|
1113
|
+
function fr(e) {
|
|
833
1114
|
return c.fromClass(class {
|
|
834
1115
|
constructor(e) {
|
|
835
1116
|
this.status = document.createElement("div"), this.status.className = "cm-nldd-typeahead-status", this.status.setAttribute("role", "status"), e.dom.append(this.status);
|
|
836
1117
|
}
|
|
837
1118
|
update(t) {
|
|
838
|
-
let n =
|
|
1119
|
+
let n = De(t.state);
|
|
839
1120
|
if (n === "pending") return;
|
|
840
|
-
let r = t.state.field(
|
|
841
|
-
r ? i = r.text : n === "active" && (i = e(
|
|
1121
|
+
let r = t.state.field(L, !1), i = "";
|
|
1122
|
+
r ? i = r.text : n === "active" && (i = e(Te(t.state).length)), this.status.textContent !== i && (this.status.textContent = i);
|
|
842
1123
|
}
|
|
843
1124
|
destroy() {
|
|
844
1125
|
this.status.remove();
|
|
845
1126
|
}
|
|
846
1127
|
});
|
|
847
1128
|
}
|
|
848
|
-
var
|
|
849
|
-
function
|
|
1129
|
+
var pr = 16;
|
|
1130
|
+
function mr() {
|
|
850
1131
|
let e = document.createElement("div");
|
|
851
1132
|
e.popover = "manual", e.className = "cm-nldd-popups";
|
|
852
1133
|
let t = () => {
|
|
@@ -867,120 +1148,120 @@ function Cn() {
|
|
|
867
1148
|
return [i({
|
|
868
1149
|
parent: e,
|
|
869
1150
|
tooltipSpace: () => ({
|
|
870
|
-
left:
|
|
871
|
-
top:
|
|
872
|
-
right: window.innerWidth -
|
|
873
|
-
bottom: window.innerHeight -
|
|
1151
|
+
left: pr,
|
|
1152
|
+
top: pr,
|
|
1153
|
+
right: window.innerWidth - pr,
|
|
1154
|
+
bottom: window.innerHeight - pr
|
|
874
1155
|
})
|
|
875
1156
|
}), n];
|
|
876
1157
|
}
|
|
877
|
-
function
|
|
1158
|
+
function hr(e, t, n = () => null, r = (e) => String(e)) {
|
|
878
1159
|
let i = _.updateListener.of((t) => {
|
|
879
|
-
t.docChanged &&
|
|
1160
|
+
t.docChanged && De(t.state) === null && t.transactions.some((e) => e.isUserEvent("delete")) && ar(t.state, t.state.selection.main.head, e()) && Ee(t.view);
|
|
880
1161
|
});
|
|
881
1162
|
return [
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
override: [
|
|
1163
|
+
mr(),
|
|
1164
|
+
Oe({
|
|
1165
|
+
override: [lr(e, t, n)],
|
|
885
1166
|
icons: !1,
|
|
886
1167
|
addToOptions: [{
|
|
887
1168
|
position: 20,
|
|
888
|
-
render:
|
|
1169
|
+
render: sr
|
|
889
1170
|
}],
|
|
890
|
-
optionClass:
|
|
1171
|
+
optionClass: cr
|
|
891
1172
|
}),
|
|
892
1173
|
i,
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
1174
|
+
L,
|
|
1175
|
+
dr,
|
|
1176
|
+
fr(r)
|
|
896
1177
|
];
|
|
897
1178
|
}
|
|
898
1179
|
// src/components/inputs/text-editor/text-editor.spellcheck.ts
|
|
899
|
-
var
|
|
1180
|
+
var gr = x.define(), _r = /* @__PURE__ */ new Set([
|
|
900
1181
|
"InlineCode",
|
|
901
1182
|
"FencedCode",
|
|
902
1183
|
"CodeBlock",
|
|
903
1184
|
"URL",
|
|
904
1185
|
"Autolink"
|
|
905
1186
|
]);
|
|
906
|
-
function
|
|
907
|
-
return e.name === "Link" &&
|
|
1187
|
+
function vr(e, t) {
|
|
1188
|
+
return e.name === "Link" && D(t, e.node);
|
|
908
1189
|
}
|
|
909
|
-
var
|
|
910
|
-
function
|
|
911
|
-
let t = e.state.facet(
|
|
1190
|
+
var yr = gr.of((e, t) => _r.has(e.name) || vr(e, t)), br = v.mark({ attributes: { spellcheck: "false" } });
|
|
1191
|
+
function xr(e) {
|
|
1192
|
+
let t = e.state.facet(gr), n = new m(), r = s(e.state), i = -1;
|
|
912
1193
|
for (let { from: a, to: o } of e.visibleRanges) r.iterate({
|
|
913
1194
|
from: a,
|
|
914
1195
|
to: o,
|
|
915
1196
|
enter: (r) => {
|
|
916
|
-
if (t.some((t) => t(r, e.state))) return r.to > r.from && r.from >= i && (n.add(r.from, r.to,
|
|
1197
|
+
if (t.some((t) => t(r, e.state))) return r.to > r.from && r.from >= i && (n.add(r.from, r.to, br), i = r.to), !1;
|
|
917
1198
|
}
|
|
918
1199
|
});
|
|
919
1200
|
return n.finish();
|
|
920
1201
|
}
|
|
921
|
-
var
|
|
1202
|
+
var Sr = c.fromClass(class {
|
|
922
1203
|
constructor(e) {
|
|
923
|
-
this.decorations =
|
|
1204
|
+
this.decorations = xr(e);
|
|
924
1205
|
}
|
|
925
1206
|
update(e) {
|
|
926
|
-
(e.docChanged || e.viewportChanged ||
|
|
1207
|
+
(e.docChanged || e.viewportChanged || T(e.startState, e.state)) && (this.decorations = xr(e.view));
|
|
927
1208
|
}
|
|
928
|
-
}, { decorations: (e) => e.decorations }),
|
|
1209
|
+
}, { decorations: (e) => e.decorations }), Cr = x.define({ combine: (e) => e.some(Boolean) }), wr = /* @__PURE__ */ new WeakMap(), Tr = _.domEventObservers({ keydown(e, t) {
|
|
929
1210
|
let n = e.isTrusted && !e.isComposing && !e.shiftKey && !e.altKey && !e.ctrlKey && !e.metaKey;
|
|
930
|
-
|
|
1211
|
+
wr.set(t, n && (e.key === "Backspace" || e.key === "Delete") ? e.key : null);
|
|
931
1212
|
} });
|
|
932
|
-
function
|
|
1213
|
+
function Er(e, t) {
|
|
933
1214
|
let { node: n, offset: r } = e.domAtPos(t);
|
|
934
1215
|
return n.nodeType === Node.TEXT_NODE ? {
|
|
935
1216
|
node: n,
|
|
936
1217
|
offset: r
|
|
937
1218
|
} : null;
|
|
938
1219
|
}
|
|
939
|
-
function
|
|
940
|
-
if (!e.state.facet(
|
|
1220
|
+
function Dr(e, t) {
|
|
1221
|
+
if (!e.state.facet(Cr) || wr.get(e) !== t) return !1;
|
|
941
1222
|
let { selection: n, doc: r } = e.state;
|
|
942
1223
|
if (n.ranges.length > 1) return !1;
|
|
943
1224
|
let { from: i, to: a, empty: o } = n.main, s = r.lineAt(i);
|
|
944
1225
|
if (!/\S/.test(e.state.sliceDoc(s.from, i)) && !(t === "Delete" && o)) return !1;
|
|
945
|
-
let c =
|
|
1226
|
+
let c = Er(e, i);
|
|
946
1227
|
if (!c) return !1;
|
|
947
1228
|
if (!o) {
|
|
948
|
-
let t =
|
|
1229
|
+
let t = Er(e, a);
|
|
949
1230
|
return t !== null && t.node === c.node && c.offset >= 1;
|
|
950
1231
|
}
|
|
951
1232
|
return t === "Backspace" ? c.offset >= 2 : c.offset >= 1 && c.offset <= c.node.length - 2;
|
|
952
1233
|
}
|
|
953
|
-
function
|
|
1234
|
+
function Or() {
|
|
954
1235
|
return [
|
|
955
1236
|
_.contentAttributes.of({ spellcheck: "true" }),
|
|
956
|
-
|
|
957
|
-
y.highest(
|
|
958
|
-
|
|
959
|
-
|
|
1237
|
+
yr,
|
|
1238
|
+
y.highest(Sr),
|
|
1239
|
+
Cr.of(!0),
|
|
1240
|
+
Tr
|
|
960
1241
|
];
|
|
961
1242
|
}
|
|
962
1243
|
function R(e) {
|
|
963
1244
|
return e.includes("") ? e.split("").join("") : e;
|
|
964
1245
|
}
|
|
965
|
-
function
|
|
1246
|
+
function kr(e) {
|
|
966
1247
|
let t = [];
|
|
967
1248
|
for (let n = e.indexOf(""); n !== -1; n = e.indexOf("", n + 1)) t.push(n);
|
|
968
1249
|
return t;
|
|
969
1250
|
}
|
|
970
|
-
function
|
|
1251
|
+
function Ar(e, t) {
|
|
971
1252
|
let n = e.indexOf(""), r = 0;
|
|
972
1253
|
for (; n !== -1 && n < t;) r++, n = e.indexOf("", n + 1);
|
|
973
1254
|
return r;
|
|
974
1255
|
}
|
|
975
|
-
function
|
|
976
|
-
return t -
|
|
1256
|
+
function z(e, t) {
|
|
1257
|
+
return t - Ar(e, t);
|
|
977
1258
|
}
|
|
978
|
-
function
|
|
1259
|
+
function B(e, t) {
|
|
979
1260
|
let n = t;
|
|
980
1261
|
for (let t of e) t <= n && n++;
|
|
981
1262
|
return n;
|
|
982
1263
|
}
|
|
983
|
-
function
|
|
1264
|
+
function jr(e, t, n = Fr) {
|
|
984
1265
|
let r = [];
|
|
985
1266
|
for (let i of e) i.to <= i.from || (n(t, i.from, "start") && r.push({
|
|
986
1267
|
pos: i.from,
|
|
@@ -991,13 +1272,13 @@ function zn(e, t, n = Un) {
|
|
|
991
1272
|
}));
|
|
992
1273
|
return r;
|
|
993
1274
|
}
|
|
994
|
-
function
|
|
1275
|
+
function Mr(e) {
|
|
995
1276
|
let t = /* @__PURE__ */ new Map();
|
|
996
1277
|
for (let n of e) t.set(n.pos, (t.get(n.pos) ?? 0) + 1);
|
|
997
1278
|
return t;
|
|
998
1279
|
}
|
|
999
|
-
function
|
|
1000
|
-
let r =
|
|
1280
|
+
function Nr(e, t, n = Fr) {
|
|
1281
|
+
let r = Mr(jr(t, t.length ? R(e) : "", n)), i = [], a = 0, o = 0;
|
|
1001
1282
|
for (;;) {
|
|
1002
1283
|
let t = 0;
|
|
1003
1284
|
for (; a + t < e.length && e[a + t] === "";) t++;
|
|
@@ -1013,37 +1294,37 @@ function Vn(e, t, n = Un) {
|
|
|
1013
1294
|
a++, o++;
|
|
1014
1295
|
}
|
|
1015
1296
|
}
|
|
1016
|
-
var
|
|
1017
|
-
function
|
|
1018
|
-
let r = e.lastIndexOf("\n", t - 1) + 1, i = e.indexOf("\n", t) === -1 ? e.length : e.indexOf("\n", t), a = e.slice(r, i), o = a.match(
|
|
1297
|
+
var Pr = /^(\s*)(#{1,6}\s|[-*+]\s|\d+[.)]\s|>|`{3,}|~{3,})/;
|
|
1298
|
+
function Fr(e, t, n) {
|
|
1299
|
+
let r = e.lastIndexOf("\n", t - 1) + 1, i = e.indexOf("\n", t) === -1 ? e.length : e.indexOf("\n", t), a = e.slice(r, i), o = a.match(Pr);
|
|
1019
1300
|
return !(o && t < r + o[0].length || (a.slice(0, t - r).match(/~~/g) ?? []).length % 2 == 1);
|
|
1020
1301
|
}
|
|
1021
1302
|
// src/components/inputs/text-editor/text-editor.annotations.ts
|
|
1022
|
-
var
|
|
1023
|
-
function
|
|
1024
|
-
return e.field(
|
|
1303
|
+
var Ir = b.define(), Lr = b.define(), Rr = b.define(), zr = b.define();
|
|
1304
|
+
function Br(e) {
|
|
1305
|
+
return e.field(V, !1) ?? [];
|
|
1025
1306
|
}
|
|
1026
|
-
function
|
|
1307
|
+
function Vr(e, t) {
|
|
1027
1308
|
return e.map((e) => ({
|
|
1028
1309
|
id: e.id,
|
|
1029
1310
|
from: Math.max(0, Math.min(e.start, t)),
|
|
1030
1311
|
to: Math.max(0, Math.min(e.end, t))
|
|
1031
1312
|
})).filter((e) => e.to > e.from);
|
|
1032
1313
|
}
|
|
1033
|
-
function
|
|
1314
|
+
function Hr(e, t) {
|
|
1034
1315
|
return {
|
|
1035
|
-
from:
|
|
1036
|
-
to:
|
|
1316
|
+
from: B(t, e.from),
|
|
1317
|
+
to: B(t, e.to - 1) + 1
|
|
1037
1318
|
};
|
|
1038
1319
|
}
|
|
1039
|
-
var
|
|
1320
|
+
var V = h.define({
|
|
1040
1321
|
create: () => [],
|
|
1041
1322
|
update: (e, t) => {
|
|
1042
|
-
let n = t.effects.find((e) => e.is(
|
|
1323
|
+
let n = t.effects.find((e) => e.is(Lr));
|
|
1043
1324
|
return n ? n.value : e;
|
|
1044
1325
|
}
|
|
1045
1326
|
});
|
|
1046
|
-
function
|
|
1327
|
+
function Ur(e) {
|
|
1047
1328
|
let t = [];
|
|
1048
1329
|
for (let n of e.toSorted((e, t) => e.from - t.from || e.to - t.to)) {
|
|
1049
1330
|
let e = t[t.length - 1];
|
|
@@ -1055,13 +1336,13 @@ function Zn(e) {
|
|
|
1055
1336
|
}
|
|
1056
1337
|
return t;
|
|
1057
1338
|
}
|
|
1058
|
-
var
|
|
1059
|
-
function
|
|
1060
|
-
return e.length >
|
|
1339
|
+
var Wr = 40;
|
|
1340
|
+
function Gr(e) {
|
|
1341
|
+
return e.length > Wr ? `${e.slice(0, Wr)}…` : e;
|
|
1061
1342
|
}
|
|
1062
|
-
var
|
|
1343
|
+
var Kr = class extends t {
|
|
1063
1344
|
constructor(e, t, n) {
|
|
1064
|
-
super(), this.ids = e, this.quote = t, this.ariaLabel = n(e.length,
|
|
1345
|
+
super(), this.ids = e, this.quote = t, this.ariaLabel = n(e.length, Gr(t));
|
|
1065
1346
|
}
|
|
1066
1347
|
eq(e) {
|
|
1067
1348
|
return e.quote === this.quote && e.ids.length === this.ids.length && e.ids.every((e, t) => e === this.ids[t]) && e.ariaLabel === this.ariaLabel;
|
|
@@ -1071,7 +1352,7 @@ var er = class extends t {
|
|
|
1071
1352
|
return e.className = "cm-annotation-badge", e.type = "button", e.dataset.annotations = this.ids.join(" "), e.textContent = String(this.ids.length), e.setAttribute("aria-label", this.ariaLabel), e;
|
|
1072
1353
|
}
|
|
1073
1354
|
coordsAt(e, t, n) {
|
|
1074
|
-
let r = e.getBoundingClientRect(), i = getComputedStyle(e), a =
|
|
1355
|
+
let r = e.getBoundingClientRect(), i = getComputedStyle(e), a = st(e) ?? {
|
|
1075
1356
|
top: r.top,
|
|
1076
1357
|
bottom: r.bottom
|
|
1077
1358
|
}, o = e.closest(".cm-annotation"), s = o ? o.getClientRects() : null, c = s && s.length ? s[s.length - 1] : null, l = t <= 0 ? r.left - parseFloat(i.marginLeft) : c ? c.right : r.right + parseFloat(i.marginRight);
|
|
@@ -1082,13 +1363,13 @@ var er = class extends t {
|
|
|
1082
1363
|
bottom: a.bottom
|
|
1083
1364
|
};
|
|
1084
1365
|
}
|
|
1085
|
-
},
|
|
1366
|
+
}, qr = v.mark({
|
|
1086
1367
|
class: "cm-annotation",
|
|
1087
1368
|
inclusiveEnd: !0
|
|
1088
|
-
}),
|
|
1369
|
+
}), Jr = v.mark({
|
|
1089
1370
|
class: "cm-annotation is-selected",
|
|
1090
1371
|
inclusiveEnd: !0
|
|
1091
|
-
}),
|
|
1372
|
+
}), Yr = v.mark({ class: "is-selected" }), Xr = class e extends t {
|
|
1092
1373
|
eq(t) {
|
|
1093
1374
|
return t instanceof e;
|
|
1094
1375
|
}
|
|
@@ -1100,7 +1381,7 @@ var er = class extends t {
|
|
|
1100
1381
|
let r = e.nextElementSibling;
|
|
1101
1382
|
for (; r instanceof HTMLElement && r.classList.contains("cm-widgetBuffer");) r = r.nextElementSibling;
|
|
1102
1383
|
if (!(r instanceof HTMLElement) || !r.classList.contains("cm-annotation")) return null;
|
|
1103
|
-
let i = parseFloat(getComputedStyle(r).paddingInlineStart || "0"), a = r.getClientRects()[0] ?? r.getBoundingClientRect(), o =
|
|
1384
|
+
let i = parseFloat(getComputedStyle(r).paddingInlineStart || "0"), a = r.getClientRects()[0] ?? r.getBoundingClientRect(), o = st(e) ?? {
|
|
1104
1385
|
top: a.top,
|
|
1105
1386
|
bottom: a.bottom
|
|
1106
1387
|
}, s = t <= 0 ? a.left : a.left + i;
|
|
@@ -1111,12 +1392,12 @@ var er = class extends t {
|
|
|
1111
1392
|
bottom: o.bottom
|
|
1112
1393
|
};
|
|
1113
1394
|
}
|
|
1114
|
-
},
|
|
1395
|
+
}, Zr = v.replace({ widget: new Xr() }), Qr = v.mark({}), $r = v.mark({
|
|
1115
1396
|
class: "cm-annotation-tail",
|
|
1116
1397
|
inclusiveEnd: !0
|
|
1117
1398
|
});
|
|
1118
|
-
function
|
|
1119
|
-
let r =
|
|
1399
|
+
function ei(e, t, n) {
|
|
1400
|
+
let r = B(n, e.from), i = B(n, e.to - 1) + 1;
|
|
1120
1401
|
return {
|
|
1121
1402
|
docFrom: r,
|
|
1122
1403
|
textTo: i,
|
|
@@ -1124,63 +1405,63 @@ function cr(e, t, n) {
|
|
|
1124
1405
|
endSent: i < t.length && t[i] === "" ? i : null
|
|
1125
1406
|
};
|
|
1126
1407
|
}
|
|
1127
|
-
var
|
|
1408
|
+
var ti = {
|
|
1128
1409
|
deco: v.none,
|
|
1129
1410
|
atomic: v.none
|
|
1130
1411
|
};
|
|
1131
|
-
function
|
|
1132
|
-
if (!e.field(
|
|
1133
|
-
let n = e.doc.toString(), r = e.selection.main, i =
|
|
1412
|
+
function ni(e, t) {
|
|
1413
|
+
if (!e.field(V).length) return ti;
|
|
1414
|
+
let n = e.doc.toString(), r = e.selection.main, i = kr(n), a = n.length - i.length, o = R(n), s = e.field(V).map((e) => ({
|
|
1134
1415
|
id: e.id,
|
|
1135
1416
|
from: Math.min(e.from, a),
|
|
1136
1417
|
to: Math.min(e.to, a)
|
|
1137
1418
|
})).filter((e) => e.to > e.from), c = [], l = [];
|
|
1138
|
-
for (let e of
|
|
1419
|
+
for (let e of Ur(s)) {
|
|
1139
1420
|
if (e.to <= e.from) continue;
|
|
1140
|
-
let { docFrom: a, textTo: s, startSent: u, endSent: d } =
|
|
1141
|
-
if (c.push((m ?
|
|
1421
|
+
let { docFrom: a, textTo: s, startSent: u, endSent: d } = ei(e, n, i), f = o.slice(e.from, e.to), p = d === null ? s : s + 1, m = !r.empty && r.from <= a && r.to >= p;
|
|
1422
|
+
if (c.push((m ? Jr : qr).range(a, p)), !m && !r.empty) {
|
|
1142
1423
|
let e = Math.max(a, r.from), t = Math.min(p, r.to);
|
|
1143
|
-
t > e && c.push(
|
|
1424
|
+
t > e && c.push(Yr.range(e, t));
|
|
1144
1425
|
}
|
|
1145
1426
|
let h = d === null ? s : d + 1, g = n.slice(a, s).match(/\S+$/);
|
|
1146
|
-
g && c.push(
|
|
1147
|
-
widget: new
|
|
1427
|
+
g && c.push($r.range(a + (g.index ?? 0), h)), d === null ? c.push(v.widget({
|
|
1428
|
+
widget: new Kr(e.ids, f, t),
|
|
1148
1429
|
side: -1
|
|
1149
|
-
}).range(s)) : (c.push(v.replace({ widget: new
|
|
1430
|
+
}).range(s)) : (c.push(v.replace({ widget: new Kr(e.ids, f, t) }).range(d, d + 1)), l.push(Qr.range(d, d + 1))), u !== null && (c.push(Zr.range(u, u + 1)), l.push(Qr.range(u, u + 1)));
|
|
1150
1431
|
}
|
|
1151
1432
|
return {
|
|
1152
1433
|
deco: v.set(c, !0),
|
|
1153
1434
|
atomic: v.set(l, !0)
|
|
1154
1435
|
};
|
|
1155
1436
|
}
|
|
1156
|
-
function
|
|
1437
|
+
function ri(e) {
|
|
1157
1438
|
return h.define({
|
|
1158
|
-
create: (t) =>
|
|
1159
|
-
update: (t, n) => t ===
|
|
1439
|
+
create: (t) => ni(t, e),
|
|
1440
|
+
update: (t, n) => t === ti && !n.state.field(V).length ? t : n.docChanged || !n.startState.selection.eq(n.state.selection) || n.effects.some((e) => e.is(Ir) || e.is(Pe)) ? ni(n.state, e) : t,
|
|
1160
1441
|
provide: (e) => _.decorations.from(e, (e) => e.deco)
|
|
1161
1442
|
});
|
|
1162
1443
|
}
|
|
1163
|
-
var
|
|
1164
|
-
let t = e.effects.find((e) => e.is(
|
|
1165
|
-
if (!e.docChanged && !t || !(t || e.effects.some((e) => e.is(
|
|
1444
|
+
var ii = g.transactionFilter.of((e) => {
|
|
1445
|
+
let t = e.effects.find((e) => e.is(Ir));
|
|
1446
|
+
if (!e.docChanged && !t || !(t || e.effects.some((e) => e.is(zr) || e.is(Rr))) && !(e.startState.field(V, !1) ?? []).length) return e;
|
|
1166
1447
|
let n = e.newDoc.toString(), r = R(n).length, i;
|
|
1167
|
-
if (t) i =
|
|
1448
|
+
if (t) i = Vr(t.value, r);
|
|
1168
1449
|
else {
|
|
1169
|
-
let t =
|
|
1170
|
-
i = (e.startState.field(
|
|
1450
|
+
let t = kr(e.startState.doc.toString()), a = e.effects.find((e) => e.is(Rr))?.value;
|
|
1451
|
+
i = (e.startState.field(V, !1) ?? []).map((r) => {
|
|
1171
1452
|
if (a && r.from >= a.from && r.to <= a.to) return {
|
|
1172
1453
|
id: r.id,
|
|
1173
1454
|
from: a.insertAt + (r.from - a.from),
|
|
1174
1455
|
to: a.insertAt + (r.to - a.from)
|
|
1175
1456
|
};
|
|
1176
|
-
let i =
|
|
1457
|
+
let i = Hr(r, t), o = e.changes.mapPos(i.from, -1), s = e.changes.mapPos(i.to, 1);
|
|
1177
1458
|
return {
|
|
1178
1459
|
id: r.id,
|
|
1179
|
-
from:
|
|
1180
|
-
to:
|
|
1460
|
+
from: z(n, o),
|
|
1461
|
+
to: z(n, s)
|
|
1181
1462
|
};
|
|
1182
1463
|
}).filter((e) => e.to > e.from);
|
|
1183
|
-
let o = e.effects.find((e) => e.is(
|
|
1464
|
+
let o = e.effects.find((e) => e.is(zr))?.value;
|
|
1184
1465
|
o && (i = i.concat(o.anns.map((e) => ({
|
|
1185
1466
|
id: e.id,
|
|
1186
1467
|
from: Math.max(0, Math.min(o.at + e.from, r)),
|
|
@@ -1188,62 +1469,62 @@ var fr = g.transactionFilter.of((e) => {
|
|
|
1188
1469
|
})).filter((e) => e.to > e.from)));
|
|
1189
1470
|
}
|
|
1190
1471
|
return [e, {
|
|
1191
|
-
changes:
|
|
1192
|
-
effects: [
|
|
1472
|
+
changes: Nr(n, Ur(i)),
|
|
1473
|
+
effects: [Lr.of(i)],
|
|
1193
1474
|
sequential: !0
|
|
1194
1475
|
}];
|
|
1195
|
-
}),
|
|
1196
|
-
if (!e.effects.some((e) => e.is(
|
|
1197
|
-
let t = e.startState.field(
|
|
1198
|
-
return [
|
|
1199
|
-
}),
|
|
1200
|
-
function
|
|
1201
|
-
let t =
|
|
1476
|
+
}), ai = ge.of((e) => {
|
|
1477
|
+
if (!e.effects.some((e) => e.is(Lr))) return [];
|
|
1478
|
+
let t = e.startState.field(V, !1) ?? [];
|
|
1479
|
+
return [Lr.of(t)];
|
|
1480
|
+
}), oi = [_.clipboardOutputFilter.of((e) => R(e)), _.clipboardInputFilter.of((e) => R(e))];
|
|
1481
|
+
function si(e) {
|
|
1482
|
+
let t = ri(e), n = _.atomicRanges.of((e) => e.state.field(t).atomic);
|
|
1202
1483
|
return [
|
|
1203
|
-
|
|
1484
|
+
V,
|
|
1204
1485
|
y.highest(t),
|
|
1205
1486
|
n,
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1487
|
+
ii,
|
|
1488
|
+
ai,
|
|
1489
|
+
oi
|
|
1209
1490
|
];
|
|
1210
1491
|
}
|
|
1211
1492
|
// src/components/inputs/text-editor/text-editor.paste.ts
|
|
1212
|
-
var
|
|
1213
|
-
function
|
|
1493
|
+
var ci = /^([ \t]*)(?:[•◦▪‣·]|o(?=\t))[ \t]+/, li = /^([ \t]*)([-*+]|\d{1,9}[.)])\t+/, ui = /^( *)([-*+]|\d{1,9}[.)]) $/;
|
|
1494
|
+
function di(e) {
|
|
1214
1495
|
let t = /^[ \t]*/.exec(e)[0], n = 0;
|
|
1215
1496
|
for (let e of t) n = e === " " ? n + 4 - n % 4 : n + 1;
|
|
1216
1497
|
return " ".repeat(n) + e.slice(t.length);
|
|
1217
1498
|
}
|
|
1218
|
-
var
|
|
1219
|
-
function
|
|
1220
|
-
let { from: n, to: r } = e.selection.main, i = e.doc.lineAt(n), a =
|
|
1499
|
+
var fi = (e) => /^ */.exec(e)[0].length;
|
|
1500
|
+
function pi(e, t) {
|
|
1501
|
+
let { from: n, to: r } = e.selection.main, i = e.doc.lineAt(n), a = E(e, n, 1, Fe) ?? E(e, i.from, 1, Fe);
|
|
1221
1502
|
if (a && a.from < n) return null;
|
|
1222
|
-
let o = i.text.slice(0, n - i.from), s =
|
|
1503
|
+
let o = i.text.slice(0, n - i.from), s = ui.exec(o), c = !s && o.trim() !== "";
|
|
1223
1504
|
if (c && (n !== i.to || e.doc.lineAt(r).to !== r)) return null;
|
|
1224
|
-
let l = t.split("\n").map((e) =>
|
|
1505
|
+
let l = t.split("\n").map((e) => di(e.replace(ci, "$1- ").replace(li, "$1$2 "))), u = l.filter((e) => e.trim() !== "");
|
|
1225
1506
|
if (u.length === 0) return null;
|
|
1226
|
-
let d = Math.min(...u.map(
|
|
1507
|
+
let d = Math.min(...u.map(fi));
|
|
1227
1508
|
l = l.map((e) => e.trim() === "" ? "" : e.slice(d));
|
|
1228
|
-
let f = l.find((e) => e.trim() !== ""), p =
|
|
1509
|
+
let f = l.find((e) => e.trim() !== ""), p = N.test(f) && /\S/.test(f.replace(N, ""));
|
|
1229
1510
|
if (c && (!p || u.length < 2)) return null;
|
|
1230
1511
|
let m = 0, h = n;
|
|
1231
1512
|
if (c) {
|
|
1232
|
-
let t =
|
|
1513
|
+
let t = P(e, i.number + 1);
|
|
1233
1514
|
return t.length && (m = d > 0 ? t[0].contentCol : t[0].markerCol), {
|
|
1234
1515
|
from: n,
|
|
1235
1516
|
to: r,
|
|
1236
|
-
insert: "\n" +
|
|
1517
|
+
insert: "\n" + mi(l, m).join("\n")
|
|
1237
1518
|
};
|
|
1238
1519
|
}
|
|
1239
1520
|
if (p) {
|
|
1240
|
-
let t =
|
|
1521
|
+
let t = P(e, i.number);
|
|
1241
1522
|
if (s) {
|
|
1242
1523
|
h = i.from;
|
|
1243
1524
|
let e = s[1].length;
|
|
1244
1525
|
m = d > 0 ? t.length ? t[0].contentCol : e + s[2].length + 1 : e;
|
|
1245
1526
|
} else h = i.from, t.length && (m = d > 0 || o.length > 0 ? t[0].contentCol : t[0].markerCol);
|
|
1246
|
-
l =
|
|
1527
|
+
l = mi(l, m);
|
|
1247
1528
|
} else if ((s || d === 0) && l.join("\n") === t) return null;
|
|
1248
1529
|
let g = l.join("\n");
|
|
1249
1530
|
return g === e.sliceDoc(h, n) + t ? null : {
|
|
@@ -1252,11 +1533,11 @@ function xr(e, t) {
|
|
|
1252
1533
|
insert: g
|
|
1253
1534
|
};
|
|
1254
1535
|
}
|
|
1255
|
-
function
|
|
1536
|
+
function mi(e, t) {
|
|
1256
1537
|
let n = [];
|
|
1257
1538
|
return e.map((e) => {
|
|
1258
1539
|
if (e.trim() === "") return "";
|
|
1259
|
-
let r =
|
|
1540
|
+
let r = fi(e), i = N.exec(e);
|
|
1260
1541
|
if (i) {
|
|
1261
1542
|
for (; n.length && n[n.length - 1].orig >= r;) n.pop();
|
|
1262
1543
|
let a = n.length ? n[n.length - 1].content : t;
|
|
@@ -1270,13 +1551,13 @@ function Sr(e, t) {
|
|
|
1270
1551
|
});
|
|
1271
1552
|
}
|
|
1272
1553
|
// src/components/inputs/text-editor/text-editor.clipboard.ts
|
|
1273
|
-
var
|
|
1554
|
+
var hi = class {
|
|
1274
1555
|
constructor() {
|
|
1275
1556
|
this.cut = null;
|
|
1276
1557
|
}
|
|
1277
1558
|
annotationsInSelection(e) {
|
|
1278
|
-
let { from: t, to: n } = e.state.selection.main, r = e.state.doc.toString(), i =
|
|
1279
|
-
return
|
|
1559
|
+
let { from: t, to: n } = e.state.selection.main, r = e.state.doc.toString(), i = z(r, t), a = z(r, n);
|
|
1560
|
+
return Br(e.state).filter((e) => e.from >= i && e.to <= a).map((e) => ({
|
|
1280
1561
|
id: e.id,
|
|
1281
1562
|
from: e.from - i,
|
|
1282
1563
|
to: e.to - i
|
|
@@ -1299,12 +1580,12 @@ var Cr = class {
|
|
|
1299
1580
|
paste(e, t, n = !1) {
|
|
1300
1581
|
let r = R(t).replace(/\r\n?/g, "\n");
|
|
1301
1582
|
if (!r || e.state.readOnly) return;
|
|
1302
|
-
let i = this.cut, a = !!(i && ((e, t) => e.replace(/\r\n/g, "\n") === t.replace(/\r\n/g, "\n"))(i.text, r) && i.anns.length > 0), o =
|
|
1583
|
+
let i = this.cut, a = !!(i && ((e, t) => e.replace(/\r\n/g, "\n") === t.replace(/\r\n/g, "\n"))(i.text, r) && i.anns.length > 0), o = z(e.state.doc.toString(), e.state.selection.main.from), s = a || n ? null : pi(e.state, r), c = e.state.selection.main.to, l = {
|
|
1303
1584
|
...e.state.replaceSelection(r),
|
|
1304
1585
|
userEvent: "input.paste"
|
|
1305
1586
|
}, u = e.state.update(a ? {
|
|
1306
1587
|
...l,
|
|
1307
|
-
effects:
|
|
1588
|
+
effects: zr.of({
|
|
1308
1589
|
at: o,
|
|
1309
1590
|
anns: i.anns
|
|
1310
1591
|
})
|
|
@@ -1319,27 +1600,27 @@ var Cr = class {
|
|
|
1319
1600
|
},
|
|
1320
1601
|
selection: { anchor: d + s.insert.length },
|
|
1321
1602
|
userEvent: "input.complete",
|
|
1322
|
-
annotations:
|
|
1603
|
+
annotations: ce.of("before")
|
|
1323
1604
|
});
|
|
1324
1605
|
}
|
|
1325
|
-
},
|
|
1326
|
-
function
|
|
1327
|
-
|
|
1606
|
+
}, gi = 200, _i = /* @__PURE__ */ new WeakSet();
|
|
1607
|
+
function vi(e) {
|
|
1608
|
+
_i.has(e) || e.hasFocus || e.dispatch({ selection: { anchor: e.state.doc.length } });
|
|
1328
1609
|
}
|
|
1329
|
-
function
|
|
1610
|
+
function yi() {
|
|
1330
1611
|
let e = 0, t = 0, n = () => (t = Date.now(), !1);
|
|
1331
1612
|
return [
|
|
1332
1613
|
_.updateListener.of((e) => {
|
|
1333
|
-
e.transactions.some((e) => e.selection) &&
|
|
1614
|
+
e.transactions.some((e) => e.selection) && _i.add(e.view);
|
|
1334
1615
|
}),
|
|
1335
1616
|
_.domEventHandlers({
|
|
1336
|
-
focus: (t, n) => (
|
|
1617
|
+
focus: (t, n) => (_i.add(n), e = Date.now(), !1),
|
|
1337
1618
|
keydown: n,
|
|
1338
1619
|
pointerdown: n,
|
|
1339
1620
|
touchstart: n
|
|
1340
1621
|
}),
|
|
1341
1622
|
g.transactionFilter.of((n) => {
|
|
1342
|
-
if (n.docChanged || !n.selection || !n.isUserEvent("select") || n.isUserEvent("select.pointer") || Date.now() - e >
|
|
1623
|
+
if (n.docChanged || !n.selection || !n.isUserEvent("select") || n.isUserEvent("select.pointer") || Date.now() - e > gi || t >= e) return n;
|
|
1343
1624
|
let r = n.startState.selection.main, i = n.selection.main;
|
|
1344
1625
|
if (r.from === 0 || i.from !== 0) return n;
|
|
1345
1626
|
let a = i.anchor === 0 ? i.head : i.anchor;
|
|
@@ -1351,7 +1632,7 @@ function Dr() {
|
|
|
1351
1632
|
];
|
|
1352
1633
|
}
|
|
1353
1634
|
// src/components/inputs/text-editor/text-editor.commands.ts
|
|
1354
|
-
var
|
|
1635
|
+
var bi = {
|
|
1355
1636
|
bold: !1,
|
|
1356
1637
|
italic: !1,
|
|
1357
1638
|
inlineCode: !1,
|
|
@@ -1364,21 +1645,21 @@ var Or = {
|
|
|
1364
1645
|
quote: !1,
|
|
1365
1646
|
heading: 0
|
|
1366
1647
|
};
|
|
1367
|
-
function
|
|
1368
|
-
return
|
|
1648
|
+
function H(e, t, n, r = 1) {
|
|
1649
|
+
return E(e.state, t, r, n);
|
|
1369
1650
|
}
|
|
1370
|
-
function
|
|
1371
|
-
let r =
|
|
1651
|
+
function xi(e, t, n) {
|
|
1652
|
+
let r = H(e, t, n, -1), i = H(e, t, n, 1);
|
|
1372
1653
|
return r && i && r.from === i.from && r.to === i.to ? i : null;
|
|
1373
1654
|
}
|
|
1374
|
-
function
|
|
1655
|
+
function U(t, n, r) {
|
|
1375
1656
|
if (t.state.readOnly) return;
|
|
1376
|
-
|
|
1377
|
-
let { state: i } = t, a = n.length, o = i.field(
|
|
1657
|
+
vi(t);
|
|
1658
|
+
let { state: i } = t, a = n.length, o = i.field(M, !1);
|
|
1378
1659
|
t.dispatch(i.changeByRange((s) => {
|
|
1379
1660
|
let c = i.sliceDoc(s.from, s.to), l = /^\s*/.exec(c)[0].length;
|
|
1380
1661
|
if (!s.empty && l === c.length) return { range: s };
|
|
1381
|
-
let u = s.from + l, d = s.to - /\s*$/.exec(c)[0].length, f =
|
|
1662
|
+
let u = s.from + l, d = s.to - /\s*$/.exec(c)[0].length, f = H(t, u, r) ?? (o && o.name === r && u >= o.from && d <= o.to ? o : null);
|
|
1382
1663
|
if (f) {
|
|
1383
1664
|
let t = i.sliceDoc(f.from + a, f.to - a);
|
|
1384
1665
|
if (s.empty && u === f.to - a && t.trim()) {
|
|
@@ -1388,7 +1669,7 @@ function W(t, n, r) {
|
|
|
1388
1669
|
name: r,
|
|
1389
1670
|
marker: i.sliceDoc(f.from, f.from + a),
|
|
1390
1671
|
live: !1
|
|
1391
|
-
}, n =
|
|
1672
|
+
}, n = j.has(r) ? bn(i, t) : [], o = f.to;
|
|
1392
1673
|
for (; /[ \t]/.test(i.sliceDoc(o, o + 1));) o++;
|
|
1393
1674
|
return {
|
|
1394
1675
|
changes: n,
|
|
@@ -1416,7 +1697,7 @@ function W(t, n, r) {
|
|
|
1416
1697
|
insert: n
|
|
1417
1698
|
}],
|
|
1418
1699
|
range: e.range(u + a, d + a),
|
|
1419
|
-
effects: s.empty && s === i.selection.main &&
|
|
1700
|
+
effects: s.empty && s === i.selection.main && j.has(r) ? un.of({
|
|
1420
1701
|
from: u,
|
|
1421
1702
|
to: u + 2 * a,
|
|
1422
1703
|
name: r,
|
|
@@ -1425,7 +1706,7 @@ function W(t, n, r) {
|
|
|
1425
1706
|
};
|
|
1426
1707
|
})), t.focus();
|
|
1427
1708
|
}
|
|
1428
|
-
function
|
|
1709
|
+
function Si(e, t) {
|
|
1429
1710
|
let n = e.text;
|
|
1430
1711
|
if (t === n) return null;
|
|
1431
1712
|
let r = 0;
|
|
@@ -1438,7 +1719,7 @@ function Ar(e, t) {
|
|
|
1438
1719
|
insert: t.slice(r, t.length - i)
|
|
1439
1720
|
};
|
|
1440
1721
|
}
|
|
1441
|
-
function
|
|
1722
|
+
function Ci(e, t) {
|
|
1442
1723
|
if (t.length) {
|
|
1443
1724
|
let { state: n } = e, r = n.changes(t), i = n.selection.main;
|
|
1444
1725
|
e.dispatch({
|
|
@@ -1451,7 +1732,7 @@ function jr(e, t) {
|
|
|
1451
1732
|
}
|
|
1452
1733
|
e.focus();
|
|
1453
1734
|
}
|
|
1454
|
-
function
|
|
1735
|
+
function W(e) {
|
|
1455
1736
|
let { state: t } = e, { from: n, to: r } = t.selection.main, i = t.doc.lineAt(n).number, a = t.doc.lineAt(r).number;
|
|
1456
1737
|
return {
|
|
1457
1738
|
first: i,
|
|
@@ -1459,74 +1740,74 @@ function G(e) {
|
|
|
1459
1740
|
loneBlank: i === a && t.doc.line(i).text.trim() === ""
|
|
1460
1741
|
};
|
|
1461
1742
|
}
|
|
1462
|
-
function
|
|
1743
|
+
function G(e, t) {
|
|
1463
1744
|
if (e.state.readOnly) return;
|
|
1464
|
-
let { state: n } = e, { first: r, last: i } =
|
|
1745
|
+
let { state: n } = e, { first: r, last: i } = W(e), a = [];
|
|
1465
1746
|
for (let e = r; e <= i; e++) {
|
|
1466
|
-
let r = n.doc.line(e), i =
|
|
1747
|
+
let r = n.doc.line(e), i = Si(r, t(r.text));
|
|
1467
1748
|
i && a.push(i);
|
|
1468
1749
|
}
|
|
1469
|
-
|
|
1750
|
+
Ci(e, a);
|
|
1470
1751
|
}
|
|
1471
|
-
function
|
|
1472
|
-
let { first: n, last: r } =
|
|
1752
|
+
function wi(e, t) {
|
|
1753
|
+
let { first: n, last: r } = W(e);
|
|
1473
1754
|
for (let i = n; i <= r; i++) if (!t(e.state.doc.line(i).text)) return !1;
|
|
1474
1755
|
return !0;
|
|
1475
1756
|
}
|
|
1476
|
-
function
|
|
1477
|
-
|
|
1757
|
+
function Ti(e, t) {
|
|
1758
|
+
G(e, (e) => {
|
|
1478
1759
|
let n = e.match(/^(#{1,6})\s+/), r = n ? n[1].length : 0, i = n ? e.slice(n[0].length) : e;
|
|
1479
1760
|
return t === 0 || r === t ? i : `${"#".repeat(t)} ${i}`;
|
|
1480
1761
|
});
|
|
1481
1762
|
}
|
|
1482
|
-
function
|
|
1483
|
-
|
|
1763
|
+
function Ei(e, t) {
|
|
1764
|
+
G(e, (e) => {
|
|
1484
1765
|
let n = e.replace(/^#{1,6}\s+/, "");
|
|
1485
1766
|
return t === 0 ? n : `${"#".repeat(t)} ${n}`;
|
|
1486
1767
|
});
|
|
1487
1768
|
}
|
|
1488
|
-
function
|
|
1489
|
-
let t = /^(\s*)[-*+]\s+/, { loneBlank: n } =
|
|
1490
|
-
|
|
1769
|
+
function Di(e) {
|
|
1770
|
+
let t = /^(\s*)[-*+]\s+/, { loneBlank: n } = W(e), r = !n && wi(e, (e) => t.test(e) || e.trim() === "");
|
|
1771
|
+
G(e, (e) => e.trim() === "" && !n ? e : r ? e.replace(t, "$1") : t.test(e) ? e : e.replace(/^(\s*)/, "$1- "));
|
|
1491
1772
|
}
|
|
1492
|
-
var
|
|
1493
|
-
function
|
|
1494
|
-
let { loneBlank: t } =
|
|
1495
|
-
|
|
1773
|
+
var Oi = /^(\s*)[-*+]\s+\[[ xX]\]\s+/;
|
|
1774
|
+
function ki(e) {
|
|
1775
|
+
let { loneBlank: t } = W(e), n = !t && wi(e, (e) => Oi.test(e) || e.trim() === "");
|
|
1776
|
+
G(e, (e) => e.trim() === "" && !t ? e : n ? e.replace(Oi, "$1- ") : Oi.test(e) ? e : e.replace(K, "$1").replace(/^(\s*)/, "$1- [ ] "));
|
|
1496
1777
|
}
|
|
1497
|
-
var
|
|
1498
|
-
function
|
|
1778
|
+
var K = /^(\s*)(?:[-*+]|\d+[.)])(?:\s+|$)/, Ai = /^(\s*)\[[ xX]\]\s+/;
|
|
1779
|
+
function ji(e, t) {
|
|
1499
1780
|
if (e.state.readOnly) return;
|
|
1500
|
-
let { state: n } = e, { first: r, last: i, loneBlank: a } =
|
|
1781
|
+
let { state: n } = e, { first: r, last: i, loneBlank: a } = W(e), o = [], s = 0;
|
|
1501
1782
|
for (let e = r; e <= i; e++) {
|
|
1502
|
-
let r = n.doc.line(e), i = r.text.replace(
|
|
1783
|
+
let r = n.doc.line(e), i = r.text.replace(K, t === "none" ? "" : "$1"), c = i !== r.text, l = c ? i.replace(Ai, t === "none" ? "" : "$1") : i, u = l;
|
|
1503
1784
|
if (t !== "none" && (l.trim() !== "" || c || a)) {
|
|
1504
1785
|
s += 1;
|
|
1505
1786
|
let e = t === "bullet" ? "- " : t === "task" ? "- [ ] " : `${s}. `;
|
|
1506
1787
|
u = l.replace(/^(\s*)/, `$1${e}`);
|
|
1507
1788
|
}
|
|
1508
|
-
let d =
|
|
1789
|
+
let d = Si(r, u);
|
|
1509
1790
|
d && o.push(d);
|
|
1510
1791
|
}
|
|
1511
|
-
|
|
1792
|
+
Ci(e, o);
|
|
1512
1793
|
}
|
|
1513
|
-
function
|
|
1794
|
+
function Mi(e, t, n) {
|
|
1514
1795
|
for (let r = t - 1; r >= 1; r--) {
|
|
1515
1796
|
let t = e.doc.line(r).text;
|
|
1516
1797
|
if (t.trim() === "") continue;
|
|
1517
|
-
let i = t.match(
|
|
1798
|
+
let i = t.match(K);
|
|
1518
1799
|
if (!i) return null;
|
|
1519
1800
|
if (n(i[1].length)) return i;
|
|
1520
1801
|
}
|
|
1521
1802
|
return null;
|
|
1522
1803
|
}
|
|
1523
|
-
function
|
|
1804
|
+
function Ni(e) {
|
|
1524
1805
|
if (e.state.readOnly) return;
|
|
1525
1806
|
let { state: t } = e, { from: n, to: r } = t.selection.main, i = t.doc.lineAt(n).number, a = t.doc.lineAt(r).number, o = [];
|
|
1526
1807
|
for (let e = i; e <= a; e++) {
|
|
1527
|
-
let n = t.doc.line(e), r = n.text.match(
|
|
1808
|
+
let n = t.doc.line(e), r = n.text.match(K);
|
|
1528
1809
|
if (!r) continue;
|
|
1529
|
-
let i = r[1].length, a =
|
|
1810
|
+
let i = r[1].length, a = Mi(t, e, (e) => e <= i)?.[0].length ?? -1;
|
|
1530
1811
|
a > i && o.push({
|
|
1531
1812
|
from: n.from,
|
|
1532
1813
|
insert: " ".repeat(a - i)
|
|
@@ -1534,15 +1815,15 @@ function Vr(e) {
|
|
|
1534
1815
|
}
|
|
1535
1816
|
o.length && e.dispatch({ changes: o }), e.focus();
|
|
1536
1817
|
}
|
|
1537
|
-
function
|
|
1818
|
+
function Pi(e) {
|
|
1538
1819
|
if (e.state.readOnly) return;
|
|
1539
1820
|
let { state: t } = e, { from: n, to: r } = t.selection.main, i = t.doc.lineAt(n).number, a = t.doc.lineAt(r).number, o = [];
|
|
1540
1821
|
for (let e = i; e <= a; e++) {
|
|
1541
|
-
let n = t.doc.line(e), r = n.text.match(
|
|
1822
|
+
let n = t.doc.line(e), r = n.text.match(K);
|
|
1542
1823
|
if (!r) continue;
|
|
1543
1824
|
let i = r[1].length;
|
|
1544
1825
|
if (i === 0) continue;
|
|
1545
|
-
let a =
|
|
1826
|
+
let a = Mi(t, e, (e) => e < i)?.[1].length ?? 0;
|
|
1546
1827
|
o.push({
|
|
1547
1828
|
from: n.from,
|
|
1548
1829
|
to: n.from + (i - a)
|
|
@@ -1550,23 +1831,23 @@ function Hr(e) {
|
|
|
1550
1831
|
}
|
|
1551
1832
|
o.length && e.dispatch({ changes: o }), e.focus();
|
|
1552
1833
|
}
|
|
1553
|
-
function
|
|
1554
|
-
let { state: t } = e, n = t.doc.lineAt(t.selection.main.head), r = n.text.match(
|
|
1834
|
+
function Fi(e) {
|
|
1835
|
+
let { state: t } = e, n = t.doc.lineAt(t.selection.main.head), r = n.text.match(K);
|
|
1555
1836
|
if (!r) return !1;
|
|
1556
|
-
let i = r[1].length, a =
|
|
1837
|
+
let i = r[1].length, a = Mi(t, n.number, (e) => e <= i);
|
|
1557
1838
|
return a !== null && a[0].length > i;
|
|
1558
1839
|
}
|
|
1559
|
-
function
|
|
1560
|
-
let t = e.state.doc.lineAt(e.state.selection.main.head).text.match(
|
|
1840
|
+
function Ii(e) {
|
|
1841
|
+
let t = e.state.doc.lineAt(e.state.selection.main.head).text.match(K);
|
|
1561
1842
|
return !!t && t[1].length > 0;
|
|
1562
1843
|
}
|
|
1563
|
-
function
|
|
1844
|
+
function Li(e) {
|
|
1564
1845
|
if (e.state.readOnly) return !0;
|
|
1565
1846
|
let { state: t } = e, n = t.selection.main;
|
|
1566
1847
|
if (!n.empty) return !1;
|
|
1567
1848
|
let r = t.doc.lineAt(n.head), i = r.text.match(/^(\s*)(?:\d+[.)]|[-*+])\s/);
|
|
1568
|
-
if (!i || n.head !== r.from + i[0].length ||
|
|
1569
|
-
let a = i[1].length, o = a > 0 ?
|
|
1849
|
+
if (!i || n.head !== r.from + i[0].length || Le(t, r.from)) return !1;
|
|
1850
|
+
let a = i[1].length, o = a > 0 ? P(t, r.number).find((e) => e.markerCol < a) : void 0;
|
|
1570
1851
|
if (o) {
|
|
1571
1852
|
let t = r.from + a, i = " ".repeat(o.markerCol);
|
|
1572
1853
|
return e.dispatch({
|
|
@@ -1588,17 +1869,17 @@ function Gr(e) {
|
|
|
1588
1869
|
userEvent: "delete.backward"
|
|
1589
1870
|
}), !0;
|
|
1590
1871
|
}
|
|
1591
|
-
function
|
|
1592
|
-
let t = /^(\s*)>\s?/, n =
|
|
1593
|
-
|
|
1872
|
+
function Ri(e) {
|
|
1873
|
+
let t = /^(\s*)>\s?/, n = wi(e, (e) => t.test(e) || e.trim() === "");
|
|
1874
|
+
G(e, (e) => e.trim() === "" ? e : n ? e.replace(t, "$1") : t.test(e) ? e : e.replace(/^(\s*)/, "$1> "));
|
|
1594
1875
|
}
|
|
1595
|
-
function
|
|
1596
|
-
let n =
|
|
1597
|
-
return n && !
|
|
1876
|
+
function zi(e, t) {
|
|
1877
|
+
let n = H(e, t, "Link");
|
|
1878
|
+
return n && !D(e.state, n) ? n : null;
|
|
1598
1879
|
}
|
|
1599
|
-
function
|
|
1880
|
+
function Bi(t, n = "") {
|
|
1600
1881
|
if (t.state.readOnly) return;
|
|
1601
|
-
let r =
|
|
1882
|
+
let r = zi(t, t.state.selection.main.head);
|
|
1602
1883
|
if (r) {
|
|
1603
1884
|
let n = t.state.sliceDoc(r.from, r.to).replace(/^\[(.*)\]\([^)]*\)$/, "$1");
|
|
1604
1885
|
t.dispatch({
|
|
@@ -1621,7 +1902,7 @@ function Jr(t, n = "") {
|
|
|
1621
1902
|
};
|
|
1622
1903
|
})), t.focus();
|
|
1623
1904
|
}
|
|
1624
|
-
function
|
|
1905
|
+
function Vi(e) {
|
|
1625
1906
|
if (e.state.readOnly) return;
|
|
1626
1907
|
let { state: t } = e, { from: n, to: r } = t.selection.main, i = t.doc.lineAt(n), a = t.doc.lineAt(r), o = i.number > 1 ? t.doc.line(i.number - 1) : null, s = a.number < t.doc.lines ? t.doc.line(a.number + 1) : null;
|
|
1627
1908
|
o?.text.trim().startsWith("```") && s?.text.trim().startsWith("```") && o && s ? e.dispatch({ changes: [{
|
|
@@ -1638,72 +1919,72 @@ function Yr(e) {
|
|
|
1638
1919
|
insert: "\n```"
|
|
1639
1920
|
}] }), e.focus();
|
|
1640
1921
|
}
|
|
1641
|
-
function
|
|
1642
|
-
let { state: t } = e, n = t.selection.main.head, r = t.field(
|
|
1922
|
+
function Hi(e) {
|
|
1923
|
+
let { state: t } = e, n = t.selection.main.head, r = t.field(M, !1), i = (t) => xi(e, n, t) !== null || r?.name === t, a = t.doc.lineAt(n).text, o = t.doc.lineAt(n).from, s = a.match(/^(#{1,6})\s/), c = Le(t, o);
|
|
1643
1924
|
return {
|
|
1644
1925
|
bold: i("StrongEmphasis"),
|
|
1645
1926
|
italic: i("Emphasis"),
|
|
1646
1927
|
inlineCode: i("InlineCode"),
|
|
1647
1928
|
codeBlock: c,
|
|
1648
1929
|
strikethrough: i("Strikethrough"),
|
|
1649
|
-
link:
|
|
1650
|
-
bulletList: !c && /^\s*[-*+]\s/.test(a) && !
|
|
1930
|
+
link: zi(e, n) !== null,
|
|
1931
|
+
bulletList: !c && /^\s*[-*+]\s/.test(a) && !Be(t, o),
|
|
1651
1932
|
orderedList: !c && /^\s*\d+[.)]\s/.test(a),
|
|
1652
|
-
taskList: !c &&
|
|
1653
|
-
quote:
|
|
1933
|
+
taskList: !c && Oi.test(a),
|
|
1934
|
+
quote: H(e, o, "Blockquote") !== null,
|
|
1654
1935
|
heading: c || !s ? 0 : s[1].length
|
|
1655
1936
|
};
|
|
1656
1937
|
}
|
|
1657
1938
|
// src/components/inputs/text-editor/text-editor.keymap.ts
|
|
1658
|
-
var
|
|
1939
|
+
var Ui = [y.highest(n.of([{
|
|
1659
1940
|
key: "Backspace",
|
|
1660
|
-
run:
|
|
1941
|
+
run: Li
|
|
1661
1942
|
}])), n.of([
|
|
1662
1943
|
{
|
|
1663
1944
|
key: "Mod-b",
|
|
1664
|
-
run: (e) => (
|
|
1945
|
+
run: (e) => (U(e, "**", "StrongEmphasis"), !0)
|
|
1665
1946
|
},
|
|
1666
1947
|
{
|
|
1667
1948
|
key: "Mod-i",
|
|
1668
|
-
run: (e) => (
|
|
1949
|
+
run: (e) => (U(e, "*", "Emphasis"), !0)
|
|
1669
1950
|
},
|
|
1670
1951
|
{
|
|
1671
1952
|
key: "Mod-e",
|
|
1672
|
-
run: (e) => (
|
|
1953
|
+
run: (e) => (U(e, "`", "InlineCode"), !0)
|
|
1673
1954
|
},
|
|
1674
1955
|
{
|
|
1675
1956
|
key: "Mod-k",
|
|
1676
|
-
run: (e) => (
|
|
1957
|
+
run: (e) => (Bi(e), !0)
|
|
1677
1958
|
},
|
|
1678
1959
|
{
|
|
1679
1960
|
key: "Backspace",
|
|
1680
|
-
run: (e) =>
|
|
1961
|
+
run: (e) => ot(e, -1)
|
|
1681
1962
|
},
|
|
1682
1963
|
{
|
|
1683
1964
|
key: "Delete",
|
|
1684
|
-
run: (e) =>
|
|
1965
|
+
run: (e) => ot(e, 1)
|
|
1685
1966
|
},
|
|
1686
1967
|
{
|
|
1687
1968
|
key: "Mod-]",
|
|
1688
|
-
run: (e) => (
|
|
1969
|
+
run: (e) => (Ni(e), !0)
|
|
1689
1970
|
},
|
|
1690
1971
|
{
|
|
1691
1972
|
key: "Mod-[",
|
|
1692
|
-
run: (e) => (
|
|
1973
|
+
run: (e) => (Pi(e), !0)
|
|
1693
1974
|
},
|
|
1694
1975
|
{
|
|
1695
1976
|
key: "Backspace",
|
|
1696
|
-
run: (e) => !
|
|
1697
|
-
shift:
|
|
1977
|
+
run: (e) => !Dr(e, "Backspace") && he(e),
|
|
1978
|
+
shift: he
|
|
1698
1979
|
},
|
|
1699
1980
|
{
|
|
1700
1981
|
key: "Delete",
|
|
1701
|
-
run: (e) => !
|
|
1982
|
+
run: (e) => !Dr(e, "Delete") && de(e)
|
|
1702
1983
|
},
|
|
1703
|
-
...
|
|
1704
|
-
...
|
|
1705
|
-
])],
|
|
1706
|
-
function
|
|
1984
|
+
...pe.filter((e) => e.key !== "Backspace" && e.key !== "Delete"),
|
|
1985
|
+
...me
|
|
1986
|
+
])], Wi = /^(\s*)(\d+)[.)](?=\s|$)/, Gi = /^(?:[ ]{0,3}>[ ]?)*/, Ki = /^\s*(?:```|~~~)/, qi = /^\s*[-*+]\s+\S/, Ji = /^\s*(?:#{1,6}(?:\s|$)|[-*+](?:\s|$)|(?:(?:-[ \t]*){3,}|(?:\*[ \t]*){3,}|(?:_[ \t]*){3,})$)/, Yi = 1e3;
|
|
1987
|
+
function Xi(e) {
|
|
1707
1988
|
let t = [], n = [], r = (e) => {
|
|
1708
1989
|
let t = 0;
|
|
1709
1990
|
for (; t < n.length && e >= n[t].content;) t++;
|
|
@@ -1711,27 +1992,27 @@ function ii(e) {
|
|
|
1711
1992
|
}, i = 0, a = !1, o = 0, s = -1;
|
|
1712
1993
|
for (let c of e.split("\n")) {
|
|
1713
1994
|
let e = i;
|
|
1714
|
-
if (i += c.length + 1,
|
|
1995
|
+
if (i += c.length + 1, Ki.test(c)) {
|
|
1715
1996
|
a = !a, n.length = 0, o = 0, s = -1;
|
|
1716
1997
|
continue;
|
|
1717
1998
|
}
|
|
1718
1999
|
if (a) continue;
|
|
1719
|
-
let l =
|
|
2000
|
+
let l = Gi.exec(c)[0], u = c.slice(l.length), d = (l.match(/>/g) ?? []).length, f = Wi.exec(u);
|
|
1720
2001
|
if (f) {
|
|
1721
|
-
let e = d *
|
|
1722
|
-
e - Math.max(t > 0 ? n[t - 1].content : 0, d *
|
|
2002
|
+
let e = d * Yi + f[1].length, t = r(e);
|
|
2003
|
+
e - Math.max(t > 0 ? n[t - 1].content : 0, d * Yi) >= 4 && (f = null);
|
|
1723
2004
|
}
|
|
1724
2005
|
if (!f) {
|
|
1725
2006
|
if (u.trim() === "") {
|
|
1726
2007
|
++o >= 2 && (n.length = 0), s = -1;
|
|
1727
2008
|
continue;
|
|
1728
2009
|
}
|
|
1729
|
-
if (o = 0, s >= d && n.length && !
|
|
1730
|
-
s =
|
|
2010
|
+
if (o = 0, s >= d && n.length && !Ji.test(u)) continue;
|
|
2011
|
+
s = qi.test(u) ? d : -1, n.length = r(d * Yi + /^\s*/.exec(u)[0].length);
|
|
1731
2012
|
continue;
|
|
1732
2013
|
}
|
|
1733
2014
|
o = 0, s = u.slice(f[0].length).trim() === "" ? -1 : d;
|
|
1734
|
-
let p = f[1].length, m = d *
|
|
2015
|
+
let p = f[1].length, m = d * Yi + p, h = f[2], g = /^ */.exec(u.slice(f[0].length))[0].length, _ = m + f[0].length - p + (g >= 1 && g <= 4 ? g : 1), v = r(m), ee;
|
|
1735
2016
|
if (v < n.length) {
|
|
1736
2017
|
n.length = v + 1;
|
|
1737
2018
|
let e = n[v];
|
|
@@ -1753,11 +2034,11 @@ function ii(e) {
|
|
|
1753
2034
|
}
|
|
1754
2035
|
return t;
|
|
1755
2036
|
}
|
|
1756
|
-
function
|
|
1757
|
-
let t =
|
|
1758
|
-
return n.trim() === "" ? "blank" :
|
|
2037
|
+
function Zi(e) {
|
|
2038
|
+
let t = Gi.exec(e)[0], n = e.slice(t.length);
|
|
2039
|
+
return n.trim() === "" ? "blank" : Wi.test(n) ? "ordered" : Ji.test(n) || Ki.test(n) ? "block" : `plain${(t.match(/>/g) ?? []).length}`;
|
|
1759
2040
|
}
|
|
1760
|
-
function
|
|
2041
|
+
function Qi(e) {
|
|
1761
2042
|
let t = !1;
|
|
1762
2043
|
return e.changes.iterChanges((n, r, i, a, o) => {
|
|
1763
2044
|
if (t) return;
|
|
@@ -1766,27 +2047,27 @@ function oi(e) {
|
|
|
1766
2047
|
t = !0;
|
|
1767
2048
|
return;
|
|
1768
2049
|
}
|
|
1769
|
-
let c = (e) =>
|
|
1770
|
-
(c(l) || c(u) || c(e.newDoc.lineAt(a).text) ||
|
|
2050
|
+
let c = (e) => Zi(e) === "ordered", l = s.lineAt(n).text, u = e.newDoc.lineAt(i).text;
|
|
2051
|
+
(c(l) || c(u) || c(e.newDoc.lineAt(a).text) || Zi(l) !== Zi(u)) && (t = !0);
|
|
1771
2052
|
}), t;
|
|
1772
2053
|
}
|
|
1773
|
-
var
|
|
1774
|
-
if (e.annotation(
|
|
1775
|
-
let t =
|
|
2054
|
+
var $i = g.transactionFilter.of((e) => {
|
|
2055
|
+
if (e.annotation(re.remote) || !e.docChanged || !Qi(e)) return e;
|
|
2056
|
+
let t = Xi(e.newDoc.toString());
|
|
1776
2057
|
return t.length === 0 ? e : [e, {
|
|
1777
2058
|
changes: t,
|
|
1778
2059
|
sequential: !0
|
|
1779
2060
|
}];
|
|
1780
|
-
}),
|
|
2061
|
+
}), ea = b.define(), q = h.define({
|
|
1781
2062
|
create: () => null,
|
|
1782
2063
|
update(e, t) {
|
|
1783
|
-
for (let e of t.effects) if (e.is(
|
|
2064
|
+
for (let e of t.effects) if (e.is(ea)) return e.value;
|
|
1784
2065
|
return e === null ? null : t.changes.mapPos(e);
|
|
1785
2066
|
}
|
|
1786
|
-
}),
|
|
2067
|
+
}), ta = class {
|
|
1787
2068
|
constructor(e) {
|
|
1788
2069
|
this.view = e, this.cursor = null, this.readPos = () => {
|
|
1789
|
-
let e = this.view.state.field(
|
|
2070
|
+
let e = this.view.state.field(q);
|
|
1790
2071
|
if (e === null) return null;
|
|
1791
2072
|
let t = this.view.coordsAtPos(e, 1);
|
|
1792
2073
|
if (!t) return null;
|
|
@@ -1801,8 +2082,8 @@ var si = g.transactionFilter.of((e) => {
|
|
|
1801
2082
|
};
|
|
1802
2083
|
}
|
|
1803
2084
|
update(e) {
|
|
1804
|
-
let t = e.state.field(
|
|
1805
|
-
t === null ? this.remove() : (e.startState.field(
|
|
2085
|
+
let t = e.state.field(q);
|
|
2086
|
+
t === null ? this.remove() : (e.startState.field(q) !== t || e.docChanged || e.geometryChanged) && this.view.requestMeasure({
|
|
1806
2087
|
read: this.readPos,
|
|
1807
2088
|
write: this.drawCursor
|
|
1808
2089
|
});
|
|
@@ -1813,7 +2094,7 @@ var si = g.transactionFilter.of((e) => {
|
|
|
1813
2094
|
destroy() {
|
|
1814
2095
|
this.remove();
|
|
1815
2096
|
}
|
|
1816
|
-
},
|
|
2097
|
+
}, na = c.fromClass(ta), ra = class {
|
|
1817
2098
|
constructor(e) {
|
|
1818
2099
|
this.view = e, this.state = null, this.ghost = null, this.onMove = (e) => {
|
|
1819
2100
|
let t = this.state;
|
|
@@ -1827,11 +2108,11 @@ var si = g.transactionFilter.of((e) => {
|
|
|
1827
2108
|
x: e.clientX,
|
|
1828
2109
|
y: e.clientY
|
|
1829
2110
|
}) : null, r = n === null || n >= t.from && n <= t.to ? null : n;
|
|
1830
|
-
this.view.dispatch({ effects:
|
|
2111
|
+
this.view.dispatch({ effects: ea.of(r) });
|
|
1831
2112
|
}, this.onUp = (e) => {
|
|
1832
2113
|
this.removeListeners(), this.view.scrollDOM.style.cursor = "", this.clearGhost();
|
|
1833
2114
|
let t = this.state;
|
|
1834
|
-
if (this.state = null, this.view.dispatch({ effects:
|
|
2115
|
+
if (this.state = null, this.view.dispatch({ effects: ea.of(null) }), !t) return;
|
|
1835
2116
|
let n = this.view.posAtCoords({
|
|
1836
2117
|
x: e.clientX,
|
|
1837
2118
|
y: e.clientY
|
|
@@ -1839,7 +2120,7 @@ var si = g.transactionFilter.of((e) => {
|
|
|
1839
2120
|
if (!t.dragging) !t.isMention && n !== null && this.view.dispatch({ selection: { anchor: n } }), this.view.focus();
|
|
1840
2121
|
else {
|
|
1841
2122
|
if (this.isInside(e.clientX, e.clientY) && n !== null && (n < t.from || n > t.to)) {
|
|
1842
|
-
let e = this.view.state.doc.toString(), r = R(this.view.state.sliceDoc(t.from, t.to)), i = n > t.to ? n - (t.to - t.from) : n, a =
|
|
2123
|
+
let e = this.view.state.doc.toString(), r = R(this.view.state.sliceDoc(t.from, t.to)), i = n > t.to ? n - (t.to - t.from) : n, a = z(e, t.from), o = z(e, t.to), s = z(e, n), c = s > o ? s - (o - a) : s;
|
|
1843
2124
|
this.view.dispatch({
|
|
1844
2125
|
changes: [{
|
|
1845
2126
|
from: t.from,
|
|
@@ -1852,7 +2133,7 @@ var si = g.transactionFilter.of((e) => {
|
|
|
1852
2133
|
anchor: i,
|
|
1853
2134
|
head: i + r.length
|
|
1854
2135
|
},
|
|
1855
|
-
effects:
|
|
2136
|
+
effects: Rr.of({
|
|
1856
2137
|
from: a,
|
|
1857
2138
|
to: o,
|
|
1858
2139
|
insertAt: c
|
|
@@ -1902,7 +2183,7 @@ var si = g.transactionFilter.of((e) => {
|
|
|
1902
2183
|
}
|
|
1903
2184
|
showGhost(e, t) {
|
|
1904
2185
|
let n = document.createElement("div");
|
|
1905
|
-
n.className = "cm-drag-ghost", n.textContent = R(this.view.state.sliceDoc(e, t)).replace(
|
|
2186
|
+
n.className = "cm-drag-ghost", n.textContent = R(this.view.state.sliceDoc(e, t)).replace(qe, "$1"), this.view.dom.appendChild(n), this.ghost = n;
|
|
1906
2187
|
}
|
|
1907
2188
|
moveGhost(e, t) {
|
|
1908
2189
|
this.ghost && (this.ghost.style.left = `${e + 12}px`, this.ghost.style.top = `${t + 12}px`);
|
|
@@ -1913,87 +2194,87 @@ var si = g.transactionFilter.of((e) => {
|
|
|
1913
2194
|
destroy() {
|
|
1914
2195
|
this.removeListeners(), this.clearGhost();
|
|
1915
2196
|
}
|
|
1916
|
-
},
|
|
2197
|
+
}, ia = c.fromClass(ra, { eventHandlers: { mousedown(e) {
|
|
1917
2198
|
return this.start(e);
|
|
1918
|
-
} } }),
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
],
|
|
1923
|
-
function
|
|
2199
|
+
} } }), aa = [
|
|
2200
|
+
q,
|
|
2201
|
+
na,
|
|
2202
|
+
ia
|
|
2203
|
+
], oa = 2, sa = /* @__PURE__ */ new WeakMap(), ca = f.define(), la = /* @__PURE__ */ new WeakMap();
|
|
2204
|
+
function ua(e, t) {
|
|
1924
2205
|
let n = e.coordsAtPos(t, -1), r = e.coordsAtPos(t, 1);
|
|
1925
2206
|
return n && r ? {
|
|
1926
2207
|
before: n,
|
|
1927
2208
|
after: r
|
|
1928
2209
|
} : null;
|
|
1929
2210
|
}
|
|
1930
|
-
var
|
|
1931
|
-
function
|
|
1932
|
-
return Math.abs(e.before.top - e.after.top) <
|
|
2211
|
+
var da = 8;
|
|
2212
|
+
function fa(e) {
|
|
2213
|
+
return Math.abs(e.before.top - e.after.top) < da;
|
|
1933
2214
|
}
|
|
1934
|
-
function
|
|
1935
|
-
let r =
|
|
1936
|
-
if (r &&
|
|
1937
|
-
let i =
|
|
2215
|
+
function pa(e, t, n) {
|
|
2216
|
+
let r = ua(e, t);
|
|
2217
|
+
if (r && fa(r) && Math.abs(r.before.left - r.after.left) <= oa) return 1;
|
|
2218
|
+
let i = sa.get(e);
|
|
1938
2219
|
if (i && i.head === t) {
|
|
1939
2220
|
if (i.side !== "pointer") return i.side;
|
|
1940
|
-
let t =
|
|
2221
|
+
let t = la.get(e);
|
|
1941
2222
|
if (t && r) return Math.abs(t.x - r.before.left) <= Math.abs(t.x - r.after.left) ? -1 : 1;
|
|
1942
2223
|
}
|
|
1943
2224
|
return n && n < 0 ? -1 : 1;
|
|
1944
2225
|
}
|
|
1945
|
-
var
|
|
2226
|
+
var ma = _.domEventHandlers({
|
|
1946
2227
|
mousedown(e, t) {
|
|
1947
|
-
return
|
|
2228
|
+
return la.set(t, {
|
|
1948
2229
|
x: e.clientX,
|
|
1949
2230
|
y: e.clientY
|
|
1950
2231
|
}), !1;
|
|
1951
2232
|
},
|
|
1952
2233
|
mousemove(e, t) {
|
|
1953
|
-
return e.buttons &&
|
|
2234
|
+
return e.buttons && la.set(t, {
|
|
1954
2235
|
x: e.clientX,
|
|
1955
2236
|
y: e.clientY
|
|
1956
2237
|
}), !1;
|
|
1957
2238
|
},
|
|
1958
2239
|
touchstart(e, t) {
|
|
1959
2240
|
let n = e.touches[0];
|
|
1960
|
-
return n &&
|
|
2241
|
+
return n && la.set(t, {
|
|
1961
2242
|
x: n.clientX,
|
|
1962
2243
|
y: n.clientY
|
|
1963
2244
|
}), !1;
|
|
1964
2245
|
}
|
|
1965
2246
|
});
|
|
1966
|
-
function
|
|
2247
|
+
function ha(t) {
|
|
1967
2248
|
return (n) => {
|
|
1968
2249
|
let { main: r } = n.state.selection;
|
|
1969
|
-
return !r.empty || !
|
|
2250
|
+
return !r.empty || !on(n.state, r.head) || !ua(n, r.head) || pa(n, r.head, r.assoc) === t ? !1 : (n.dispatch({
|
|
1970
2251
|
selection: e.cursor(r.head, t),
|
|
1971
|
-
annotations:
|
|
2252
|
+
annotations: ca.of(t),
|
|
1972
2253
|
userEvent: "select"
|
|
1973
2254
|
}), !0);
|
|
1974
2255
|
};
|
|
1975
2256
|
}
|
|
1976
|
-
var
|
|
2257
|
+
var ga = y.high(n.of([
|
|
1977
2258
|
{
|
|
1978
2259
|
key: "ArrowLeft",
|
|
1979
|
-
run:
|
|
2260
|
+
run: ha(-1)
|
|
1980
2261
|
},
|
|
1981
2262
|
{
|
|
1982
2263
|
key: "ArrowRight",
|
|
1983
|
-
run:
|
|
2264
|
+
run: ha(1)
|
|
1984
2265
|
},
|
|
1985
2266
|
{
|
|
1986
2267
|
key: "Backspace",
|
|
1987
|
-
run:
|
|
2268
|
+
run: ha(-1)
|
|
1988
2269
|
},
|
|
1989
2270
|
{
|
|
1990
2271
|
key: "Delete",
|
|
1991
|
-
run:
|
|
2272
|
+
run: ha(1)
|
|
1992
2273
|
}
|
|
1993
|
-
])),
|
|
1994
|
-
if (t !== n || !r || e.composing ||
|
|
2274
|
+
])), _a = /^[\s<?!.,:*_~)]/, va = _.inputHandler.of((e, t, n, r) => {
|
|
2275
|
+
if (t !== n || !r || e.composing || _a.test(r)) return !1;
|
|
1995
2276
|
let { main: i } = e.state.selection;
|
|
1996
|
-
return !i.empty || i.head !== t || !
|
|
2277
|
+
return !i.empty || i.head !== t || !sn(e.state, t) || !ua(e, t) || pa(e, t, i.assoc) !== 1 ? !1 : (e.dispatch({
|
|
1997
2278
|
changes: {
|
|
1998
2279
|
from: t,
|
|
1999
2280
|
insert: ` ${r}`
|
|
@@ -2002,7 +2283,7 @@ var Ti = y.high(n.of([
|
|
|
2002
2283
|
userEvent: "input.type",
|
|
2003
2284
|
scrollIntoView: !0
|
|
2004
2285
|
}), !0);
|
|
2005
|
-
}),
|
|
2286
|
+
}), ya = [
|
|
2006
2287
|
d({
|
|
2007
2288
|
above: !0,
|
|
2008
2289
|
class: "cm-nldd-cursorLayer",
|
|
@@ -2010,19 +2291,19 @@ var Ti = y.high(n.of([
|
|
|
2010
2291
|
let { state: n } = t, r = u(n), i = [];
|
|
2011
2292
|
for (let a of n.selection.ranges) {
|
|
2012
2293
|
if (!a.empty && !r.drawRangeCursor) continue;
|
|
2013
|
-
let s = a === n.selection.main ? "cm-cursor cm-cursor-primary" : "cm-cursor cm-cursor-secondary", c = e.cursor(a.head,
|
|
2294
|
+
let s = a === n.selection.main ? "cm-cursor cm-cursor-primary" : "cm-cursor cm-cursor-secondary", c = e.cursor(a.head, pa(t, a.head, a.assoc));
|
|
2014
2295
|
i.push(...o.forRange(t, s, c));
|
|
2015
2296
|
}
|
|
2016
2297
|
return i;
|
|
2017
2298
|
},
|
|
2018
2299
|
update(e, t) {
|
|
2019
2300
|
if (e.docChanged || e.selectionSet) {
|
|
2020
|
-
let { view: t } = e, n = e.state.selection.main.head, r =
|
|
2301
|
+
let { view: t } = e, n = e.state.selection.main.head, r = sa.get(t), i = r ? {
|
|
2021
2302
|
...r,
|
|
2022
2303
|
head: e.changes.mapPos(r.head)
|
|
2023
2304
|
} : null, a = e.startState.selection.main.head;
|
|
2024
2305
|
for (let t of e.transactions) {
|
|
2025
|
-
let r = t.annotation(
|
|
2306
|
+
let r = t.annotation(ca);
|
|
2026
2307
|
if (r) i = {
|
|
2027
2308
|
head: n,
|
|
2028
2309
|
side: r
|
|
@@ -2032,17 +2313,17 @@ var Ti = y.high(n.of([
|
|
|
2032
2313
|
side: "pointer"
|
|
2033
2314
|
};
|
|
2034
2315
|
else if (t.isUserEvent("input") || t.isUserEvent("delete.backward")) {
|
|
2035
|
-
let r = t.isUserEvent("input") &&
|
|
2316
|
+
let r = t.isUserEvent("input") && sn(e.state, n);
|
|
2036
2317
|
i = {
|
|
2037
2318
|
head: n,
|
|
2038
|
-
side:
|
|
2319
|
+
side: on(e.state, n) && !on(e.startState, a) && !r ? 1 : -1
|
|
2039
2320
|
};
|
|
2040
2321
|
} else t.isUserEvent("delete.forward") ? i = {
|
|
2041
2322
|
head: n,
|
|
2042
2323
|
side: 1
|
|
2043
2324
|
} : t.selection && (i = null);
|
|
2044
2325
|
}
|
|
2045
|
-
i ?
|
|
2326
|
+
i ? sa.set(t, i) : sa.delete(t);
|
|
2046
2327
|
}
|
|
2047
2328
|
return e.transactions.some((e) => e.selection) && (t.style.animationName = t.style.animationName === "cm-blink" ? "cm-blink2" : "cm-blink"), e.docChanged || e.selectionSet;
|
|
2048
2329
|
},
|
|
@@ -2050,292 +2331,16 @@ var Ti = y.high(n.of([
|
|
|
2050
2331
|
e.style.animationDuration = `${u(t.state).cursorBlinkRate}ms`;
|
|
2051
2332
|
}
|
|
2052
2333
|
}),
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
]
|
|
2057
|
-
open: () => "Taak, open",
|
|
2058
|
-
done: () => "Taak, afgerond"
|
|
2059
|
-
} }), Ai = class extends t {
|
|
2060
|
-
constructor(e, t) {
|
|
2061
|
-
super(), this.checked = e, this.label = t;
|
|
2062
|
-
}
|
|
2063
|
-
eq(e) {
|
|
2064
|
-
return e.checked === this.checked && e.label === this.label;
|
|
2065
|
-
}
|
|
2066
|
-
toDOM() {
|
|
2067
|
-
let e = document.createElement("span");
|
|
2068
|
-
e.className = "cm-md-task-box", this.checked && e.setAttribute("data-checked", "");
|
|
2069
|
-
let t = document.createElement("nldd-icon");
|
|
2070
|
-
t.className = "cm-md-task-box-icon", t.setAttribute("icon", this.checked ? "check-mark-square" : "square"), t.setAttribute("aria-hidden", "true");
|
|
2071
|
-
let n = document.createElement("span");
|
|
2072
|
-
return n.className = "cm-md-task-box-label", n.textContent = this.label, e.append(t, n), e;
|
|
2073
|
-
}
|
|
2074
|
-
ignoreEvent() {
|
|
2075
|
-
return !1;
|
|
2076
|
-
}
|
|
2077
|
-
};
|
|
2078
|
-
function ji(e, t) {
|
|
2079
|
-
let n = e.facet(ki);
|
|
2080
|
-
return v.replace({ widget: new Ai(t, t ? n.done() : n.open()) });
|
|
2081
|
-
}
|
|
2082
|
-
function Mi(e) {
|
|
2083
|
-
let t = [];
|
|
2084
|
-
return s(e).iterate({ enter: (n) => {
|
|
2085
|
-
if (n.name === "FencedCode" || n.name === "CodeBlock") return !1;
|
|
2086
|
-
if (n.name === "TaskMarker") return t.push({
|
|
2087
|
-
from: n.from,
|
|
2088
|
-
to: n.to,
|
|
2089
|
-
checked: /x/i.test(e.sliceDoc(n.from, n.to))
|
|
2090
|
-
}), !1;
|
|
2091
|
-
} }), t;
|
|
2092
|
-
}
|
|
2093
|
-
function Ni(e, t, n) {
|
|
2094
|
-
let r = Mi(e).filter((e) => e.from <= n && e.to >= t);
|
|
2095
|
-
if (r.length === 0) return null;
|
|
2096
|
-
let i = r.some((e) => !e.checked);
|
|
2097
|
-
return r.map((e) => ({
|
|
2098
|
-
from: e.from + 1,
|
|
2099
|
-
to: e.from + 2,
|
|
2100
|
-
insert: i ? "x" : " "
|
|
2101
|
-
}));
|
|
2102
|
-
}
|
|
2103
|
-
function Pi(e) {
|
|
2104
|
-
let { state: t } = e;
|
|
2105
|
-
if (t.readOnly) return !1;
|
|
2106
|
-
let n = t.selection.ranges.flatMap((e) => {
|
|
2107
|
-
let n = t.doc.lineAt(e.from).from, r = t.doc.lineAt(e.to).to;
|
|
2108
|
-
return Ni(t, n, r) ?? [];
|
|
2109
|
-
});
|
|
2110
|
-
return n.length !== 0 && (e.dispatch({
|
|
2111
|
-
changes: n,
|
|
2112
|
-
userEvent: "input.task"
|
|
2113
|
-
}), !0);
|
|
2114
|
-
}
|
|
2115
|
-
var Fi = _.domEventHandlers({ mousedown(e, t) {
|
|
2116
|
-
let n = e.target, r = n?.closest?.(".cm-md-task-box") ?? n?.closest?.(".cm-md-listprefix")?.querySelector(":scope > .cm-md-task-box");
|
|
2117
|
-
if (!r || e.button !== 0) return !1;
|
|
2118
|
-
if (e.preventDefault(), t.state.readOnly) return !0;
|
|
2119
|
-
let i = t.posAtDOM(r), a = Ni(t.state, i, i);
|
|
2120
|
-
return a && t.dispatch({
|
|
2121
|
-
changes: a,
|
|
2122
|
-
userEvent: "input.task"
|
|
2123
|
-
}), !0;
|
|
2124
|
-
} });
|
|
2125
|
-
function Ii(e) {
|
|
2126
|
-
return [
|
|
2127
|
-
ki.of(e),
|
|
2128
|
-
Fi,
|
|
2129
|
-
y.high(n.of([{
|
|
2130
|
-
key: "Mod-Enter",
|
|
2131
|
-
run: Pi
|
|
2132
|
-
}]))
|
|
2133
|
-
];
|
|
2134
|
-
}
|
|
2135
|
-
// src/components/inputs/text-editor/text-editor.hidden-syntax.ts
|
|
2136
|
-
var Li = {
|
|
2137
|
-
EmphasisMark: ["Emphasis", "StrongEmphasis"],
|
|
2138
|
-
StrikethroughMark: ["Strikethrough"],
|
|
2139
|
-
CodeMark: ["InlineCode"]
|
|
2140
|
-
}, J = v.replace({}), Ri = v.mark({ class: "cm-md-bullet" }), zi = /^(\s*)[-*+]\s+\[[ xX]\](\s+)/, Bi = 2.5, Vi = {};
|
|
2141
|
-
function Hi(e) {
|
|
2142
|
-
return Vi[e] ?? (Vi[e] = v.line({ attributes: { style: `text-indent:calc(${e} * var(--_text-editor-marker-advance) * -1) !important;padding-left:calc(${e} * var(--_text-editor-marker-advance)) !important` } }));
|
|
2143
|
-
}
|
|
2144
|
-
var Ui = v.mark({ class: "cm-md-ordinal" }), Wi = {};
|
|
2145
|
-
function Gi(e) {
|
|
2146
|
-
let t = e.join(",");
|
|
2147
|
-
return Wi[t] ?? (Wi[t] = v.line({
|
|
2148
|
-
class: "cm-md-quote-line",
|
|
2149
|
-
attributes: { style: `background-image:${e.map(() => "var(--_text-editor-quote-rule)").join(",")};background-position:${e.map((e) => `calc(${e} * var(--_text-editor-marker-advance)) 0`).join(",")}` }
|
|
2150
|
-
}));
|
|
2151
|
-
}
|
|
2152
|
-
var Ki = v.mark({ class: "cm-md-quote-mark-hidden" }), qi = v.mark({ class: "cm-md-quote-gap" }), Ji = v.mark({ class: "cm-md-code-bare" }), Yi = class extends t {
|
|
2153
|
-
toDOM() {
|
|
2154
|
-
let e = document.createElement("span");
|
|
2155
|
-
return e.className = "cm-md-rule", e.setAttribute("aria-hidden", "true"), e;
|
|
2156
|
-
}
|
|
2157
|
-
eq() {
|
|
2158
|
-
return !0;
|
|
2159
|
-
}
|
|
2160
|
-
ignoreEvent() {
|
|
2161
|
-
return !1;
|
|
2162
|
-
}
|
|
2163
|
-
}, Xi = v.replace({ widget: new Yi() });
|
|
2164
|
-
function Zi(e) {
|
|
2165
|
-
let t = e;
|
|
2166
|
-
for (let n = e.parent; n; n = n.parent) n.name === "Blockquote" && (t = n);
|
|
2167
|
-
return t;
|
|
2168
|
-
}
|
|
2169
|
-
var Qi = 2, $i = {};
|
|
2170
|
-
function ea(e, t) {
|
|
2171
|
-
var n;
|
|
2172
|
-
return $i[n = `${e},${t}`] ?? ($i[n] = v.line({ attributes: { style: `text-indent:calc(${e} * var(--_text-editor-marker-advance) * -1) !important;padding-left:calc(${e + t} * var(--_text-editor-marker-advance)) !important` } }));
|
|
2173
|
-
}
|
|
2174
|
-
function ta(e, t) {
|
|
2175
|
-
let n = /* @__PURE__ */ new Map();
|
|
2176
|
-
return s(e).iterate({
|
|
2177
|
-
from: t.from,
|
|
2178
|
-
to: t.to,
|
|
2179
|
-
enter: (t) => {
|
|
2180
|
-
t.name === "Blockquote" && Re(e, t.from, t.to, (e) => n.set(e, (n.get(e) ?? 0) + 1));
|
|
2181
|
-
}
|
|
2182
|
-
}), n;
|
|
2183
|
-
}
|
|
2184
|
-
function na(e, t) {
|
|
2185
|
-
for (let n = e.doc.lineAt(t.to);; n = e.doc.line(n.number - 1)) if (/[^\s>]/.test(n.text) || n.from <= t.from) return n.from;
|
|
2186
|
-
}
|
|
2187
|
-
function ra(e, t) {
|
|
2188
|
-
let n = [];
|
|
2189
|
-
for (let r of t) {
|
|
2190
|
-
let t = /^[ ]*/.exec(e.slice(r + 1))[0].length;
|
|
2191
|
-
t >= 2 && t <= 4 && n.push([r + 2, r + 1 + t]);
|
|
2192
|
-
}
|
|
2193
|
-
return n;
|
|
2194
|
-
}
|
|
2195
|
-
function ia(e, t) {
|
|
2196
|
-
let n = /* @__PURE__ */ new Map();
|
|
2197
|
-
return s(e).iterate({
|
|
2198
|
-
from: t.from,
|
|
2199
|
-
to: t.to,
|
|
2200
|
-
enter: (t) => {
|
|
2201
|
-
if (t.name !== "QuoteMark") return;
|
|
2202
|
-
let r = e.doc.lineAt(t.from), i = n.get(r.from) ?? [];
|
|
2203
|
-
i.push(t.from - r.from), n.set(r.from, i);
|
|
2204
|
-
}
|
|
2205
|
-
}), n;
|
|
2206
|
-
}
|
|
2207
|
-
function aa(e) {
|
|
2208
|
-
return !e.readOnly && e.facet(_.editable);
|
|
2209
|
-
}
|
|
2210
|
-
function oa(e, t, n) {
|
|
2211
|
-
return aa(e) && e.selection.ranges.some((e) => e.from <= n && e.to >= t);
|
|
2212
|
-
}
|
|
2213
|
-
var sa = v.replace({ block: !0 }), ca = v.replace({}), la = v.mark({ class: "cm-md-code-language" }), ua = /* @__PURE__ */ new Set([
|
|
2214
|
-
"Document",
|
|
2215
|
-
"Blockquote",
|
|
2216
|
-
"BulletList",
|
|
2217
|
-
"OrderedList",
|
|
2218
|
-
"ListItem"
|
|
2219
|
-
]);
|
|
2220
|
-
function da(e) {
|
|
2221
|
-
let t = [];
|
|
2222
|
-
return s(e).iterate({ enter: (n) => {
|
|
2223
|
-
if (n.name !== "FencedCode") return ua.has(n.name);
|
|
2224
|
-
if (oa(e, n.from, n.to)) return !1;
|
|
2225
|
-
let r = n.node.getChildren("CodeMark").map((t) => e.doc.lineAt(t.from)), i = e.doc.lineAt(n.from).number;
|
|
2226
|
-
if (e.doc.lineAt(n.to).number - i + 1 <= r.length) return !1;
|
|
2227
|
-
let a = n.node.getChild("CodeInfo"), o = n.node.getChild("CodeMark");
|
|
2228
|
-
for (let [e, n] of r.entries()) e === 0 ? (t.push(ca.range(o.from, a ? a.from : o.to)), a && t.push(la.range(a.from, a.to))) : t.push(sa.range(n.from, n.to));
|
|
2229
|
-
return !1;
|
|
2230
|
-
} }), v.set(t, !0);
|
|
2231
|
-
}
|
|
2232
|
-
function fa(e) {
|
|
2233
|
-
let t = [];
|
|
2234
|
-
for (let n of e.selection.ranges) s(e).iterate({
|
|
2235
|
-
from: n.from,
|
|
2236
|
-
to: n.to,
|
|
2237
|
-
enter: (e) => (e.name === "FencedCode" && t.push(e.from), e.name !== "FencedCode" && ua.has(e.name))
|
|
2238
|
-
});
|
|
2239
|
-
return t.join(",");
|
|
2240
|
-
}
|
|
2241
|
-
var pa = h.define({
|
|
2242
|
-
create: da,
|
|
2243
|
-
update: (e, t) => t.docChanged || t.reconfigured || E(t.startState, t.state) || t.selection && fa(t.startState) !== fa(t.state) ? da(t.state) : e,
|
|
2244
|
-
provide: (e) => _.decorations.from(e)
|
|
2245
|
-
});
|
|
2246
|
-
function ma(e) {
|
|
2247
|
-
let { state: t } = e, n = (e, n) => oa(t, e, n), r = [];
|
|
2248
|
-
for (let { from: i, to: a } of e.visibleRanges) s(t).iterate({
|
|
2249
|
-
from: i,
|
|
2250
|
-
to: a,
|
|
2251
|
-
enter: (e) => {
|
|
2252
|
-
let i = e.node.parent;
|
|
2253
|
-
if (e.name === "HorizontalRule") return n(e.from, e.to) || r.push(Xi.range(e.from, e.to)), !1;
|
|
2254
|
-
if (e.name === "Blockquote") {
|
|
2255
|
-
let i = Zi(e.node);
|
|
2256
|
-
if (i !== e.node || n(i.from, i.to)) return;
|
|
2257
|
-
let a = ia(t, i), o = ta(t, i), s = na(t, i), c = [0];
|
|
2258
|
-
Re(t, i.from, i.to, (e) => {
|
|
2259
|
-
if (e > s) return;
|
|
2260
|
-
let n = t.doc.lineAt(e), i = a.get(e) ?? [], l = ra(n.text, i), u = l.reduce((e, [t, n]) => e + n - t, 0);
|
|
2261
|
-
for (let [t, n] of l) r.push(J.range(e + t, e + n));
|
|
2262
|
-
let d = i.filter((e) => /[^ \t]/.test(n.text.charAt(e + 1)));
|
|
2263
|
-
for (let t of d) r.push(qi.range(e + t, e + t + 1));
|
|
2264
|
-
let f = i.map((e) => e - l.filter(([t]) => t < e).reduce((e, [t, n]) => e + n - t, 0) + d.filter((t) => t < e).length), p = Math.max(1, o.get(e) ?? 0), m = nn(n.text) - u + d.length, h = (f.length ? f : c).slice(0, p);
|
|
2265
|
-
for (; h.length < p;) h.push(h.length ? h[h.length - 1] + Qi : 0);
|
|
2266
|
-
let g = f.length ? (p - f.length) * Qi : h[h.length - 1] + Qi;
|
|
2267
|
-
g > 0 ? r.push(ea(m, g).range(e)) : (u || d.length) && r.push(Hi(m).range(e)), r.push(Gi(h).range(e)), c = h;
|
|
2268
|
-
});
|
|
2269
|
-
} else if (i) {
|
|
2270
|
-
if (e.name === "QuoteMark") {
|
|
2271
|
-
let i = Zi(e.node), a = t.sliceDoc(e.to, e.to + 1) === " " ? e.to + 1 : e.to;
|
|
2272
|
-
n(i.from, i.to) || r.push(Ki.range(e.from, a));
|
|
2273
|
-
} else if (e.name === "ListMark" && /^[-*+]$/.test(t.sliceDoc(e.from, e.to)) && /^[ \t]/.test(t.sliceDoc(e.to, e.to + 1))) {
|
|
2274
|
-
let i = t.doc.lineAt(e.from);
|
|
2275
|
-
if (n(i.from, i.to)) return;
|
|
2276
|
-
let a = zi.exec(i.text), o = a && e.node.parent?.getChild("Task")?.getChild("TaskMarker");
|
|
2277
|
-
if (a && o) {
|
|
2278
|
-
r.push(Hi(a[1].length + Bi + a[2].length).range(i.from), J.range(e.from, o.from), ji(t, /x/i.test(t.sliceDoc(o.from, o.to))).range(o.from, o.to));
|
|
2279
|
-
return;
|
|
2280
|
-
}
|
|
2281
|
-
r.push(Ri.range(e.from, e.to));
|
|
2282
|
-
} else if (e.name === "ListMark" && /^\d+[.)]$/.test(t.sliceDoc(e.from, e.to))) r.push(Ui.range(e.from, e.to));
|
|
2283
|
-
else if (e.name === "HeaderMark" && i.name.startsWith("ATXHeading")) {
|
|
2284
|
-
let a = t.sliceDoc(e.to, e.to + 1) === " " ? e.to + 1 : e.to;
|
|
2285
|
-
n(i.from, i.to) || r.push(J.range(e.from, a));
|
|
2286
|
-
} else if (e.name === "Link") {
|
|
2287
|
-
let i = e.node.getChild("URL"), a = e.node.getChildren("LinkMark");
|
|
2288
|
-
if (!i || a.length < 2 || O(t, e.node)) return;
|
|
2289
|
-
n(e.from, e.to) || r.push(J.range(a[0].from, a[0].to), J.range(a[1].from, e.to));
|
|
2290
|
-
} else if (Li[e.name]?.includes(i.name) && !n(i.from, i.to) && (r.push(J.range(e.from, e.to)), e.name === "CodeMark" && e.from === i.from)) {
|
|
2291
|
-
let t = i.lastChild;
|
|
2292
|
-
t && t.from > e.to && r.push(Ji.range(e.to, t.from));
|
|
2293
|
-
}
|
|
2294
|
-
}
|
|
2295
|
-
}
|
|
2296
|
-
});
|
|
2297
|
-
return v.set(r, !0);
|
|
2298
|
-
}
|
|
2299
|
-
var ha = 3, ga = class {
|
|
2300
|
-
constructor(e) {
|
|
2301
|
-
this.view = e, this.layerObserver = new MutationObserver(() => this.mendSelection()), this.observing = !1, this.checked = "", this.mends = 0, this.decorations = ma(e), queueMicrotask(() => this.observeLayer());
|
|
2302
|
-
}
|
|
2303
|
-
observeLayer() {
|
|
2304
|
-
if (this.observing) return;
|
|
2305
|
-
let e = this.view.dom.querySelector(".cm-selectionLayer");
|
|
2306
|
-
e && (this.layerObserver.observe(e, {
|
|
2307
|
-
childList: !0,
|
|
2308
|
-
subtree: !0,
|
|
2309
|
-
attributes: !0
|
|
2310
|
-
}), this.observing = !0);
|
|
2311
|
-
}
|
|
2312
|
-
update(e) {
|
|
2313
|
-
this.observeLayer(), (e.docChanged || e.selectionSet || e.viewportChanged || E(e.startState, e.state) || e.transactions.some((e) => e.reconfigured)) && (this.decorations = ma(e.view));
|
|
2314
|
-
}
|
|
2315
|
-
mendSelection() {
|
|
2316
|
-
let { view: e } = this, { from: t, to: n, empty: r } = e.state.selection.main, i = `${t}-${n}-${e.state.doc.length}`;
|
|
2317
|
-
if (i !== this.checked && (this.checked = i, this.mends = 0), r || this.mends >= ha) return;
|
|
2318
|
-
let a = e.dom.querySelector(".cm-selectionLayer"), o = a ? [...a.querySelectorAll(".cm-selectionBackground")] : [];
|
|
2319
|
-
if (o.length < 2) return;
|
|
2320
|
-
let s = e.coordsAtPos(t, 1), c = e.coordsAtPos(n, -1);
|
|
2321
|
-
if (!s || !c || Math.abs(s.top - c.top) > 2) return;
|
|
2322
|
-
this.mends += 1;
|
|
2323
|
-
let [l] = o, u = o[o.length - 1];
|
|
2324
|
-
l.style.width = `${u.offsetLeft + u.offsetWidth - l.offsetLeft}px`, o.slice(1).forEach((e) => e.remove()), e.dispatch({ selection: e.state.selection });
|
|
2325
|
-
}
|
|
2326
|
-
destroy() {
|
|
2327
|
-
this.layerObserver.disconnect();
|
|
2328
|
-
}
|
|
2329
|
-
};
|
|
2330
|
-
function _a() {
|
|
2331
|
-
return [y.highest(c.fromClass(ga, { decorations: (e) => e.decorations })), pa];
|
|
2332
|
-
}
|
|
2334
|
+
ma,
|
|
2335
|
+
ga,
|
|
2336
|
+
va
|
|
2337
|
+
];
|
|
2333
2338
|
// src/components/inputs/text-editor/text-editor.selection.ts
|
|
2334
|
-
function
|
|
2339
|
+
function ba(e) {
|
|
2335
2340
|
let t = e.dom.querySelector(".cm-selectionLayer");
|
|
2336
2341
|
if (!t) return;
|
|
2337
2342
|
let n = e.defaultLineHeight, r = e.contentDOM, i = r.getBoundingClientRect().right - (parseFloat(getComputedStyle(r).paddingRight) || 0);
|
|
2338
|
-
|
|
2343
|
+
xa([...t.querySelectorAll(".cm-selectionBackground")].map((t) => {
|
|
2339
2344
|
let r = t.getBoundingClientRect();
|
|
2340
2345
|
if (r.height >= n * 1.25) return {
|
|
2341
2346
|
piece: t,
|
|
@@ -2364,17 +2369,17 @@ function va(e) {
|
|
|
2364
2369
|
return Math.abs(c - s) > .25 && (e.style.top = `${c}px`, o.top = t.top + (c - s)), Math.abs(t.height - n) > .25 && (e.style.height = `${n}px`, o.height = n), o;
|
|
2365
2370
|
}), n);
|
|
2366
2371
|
}
|
|
2367
|
-
function
|
|
2372
|
+
function xa(e, t) {
|
|
2368
2373
|
let n = e.toSorted((e, t) => e.top - t.top);
|
|
2369
2374
|
for (let e = 1; e < n.length; e++) {
|
|
2370
2375
|
let r = n[e - 1], i = n[e].top - (r.top + r.height);
|
|
2371
2376
|
i > .25 && i < t / 2 && (r.piece.style.height = `${r.height + i}px`);
|
|
2372
2377
|
}
|
|
2373
2378
|
}
|
|
2374
|
-
var
|
|
2379
|
+
var Sa = class {
|
|
2375
2380
|
constructor(e) {
|
|
2376
2381
|
this.view = e, this.observer = new MutationObserver(() => {
|
|
2377
|
-
|
|
2382
|
+
ba(this.view), this.observer.takeRecords();
|
|
2378
2383
|
}), this.observing = !1, queueMicrotask(() => this.observe());
|
|
2379
2384
|
}
|
|
2380
2385
|
update() {
|
|
@@ -2392,7 +2397,7 @@ var ba = class {
|
|
|
2392
2397
|
destroy() {
|
|
2393
2398
|
this.observer.disconnect();
|
|
2394
2399
|
}
|
|
2395
|
-
},
|
|
2400
|
+
}, Ca = c.fromClass(Sa), wa = ae`
|
|
2396
2401
|
|
|
2397
2402
|
|
|
2398
2403
|
/* # Host */
|
|
@@ -2535,7 +2540,7 @@ var ba = class {
|
|
|
2535
2540
|
--_text-editor-popup-message-padding-inline: var(--primitives-space-16);
|
|
2536
2541
|
--_text-editor-popup-message-color: var(--semantics-content-secondary-color);
|
|
2537
2542
|
|
|
2538
|
-
${
|
|
2543
|
+
${Ae}
|
|
2539
2544
|
display: flex;
|
|
2540
2545
|
min-height: 0;
|
|
2541
2546
|
flex-direction: column;
|
|
@@ -3511,19 +3516,19 @@ var ba = class {
|
|
|
3511
3516
|
}
|
|
3512
3517
|
`;
|
|
3513
3518
|
// src/components/inputs/text-editor/text-editor.template.ts
|
|
3514
|
-
function
|
|
3515
|
-
return
|
|
3519
|
+
function Ta(e) {
|
|
3520
|
+
return ke`<div class="text-editor"><slot name="toolbar" ?hidden=${!e._hasSlottedToolbar}></slot></div>`;
|
|
3516
3521
|
}
|
|
3517
3522
|
// src/components/inputs/text-editor/text-editor.code-copy.ts
|
|
3518
|
-
var
|
|
3523
|
+
var Ea = x.define({ combine: (e) => e[0] ?? {
|
|
3519
3524
|
copy: () => "Kopieer",
|
|
3520
3525
|
success: () => "Gekopieerd",
|
|
3521
3526
|
failure: () => "Kopiëren mislukt"
|
|
3522
|
-
} }),
|
|
3523
|
-
function
|
|
3527
|
+
} }), Da = 300, Oa = 2e3;
|
|
3528
|
+
function ka() {
|
|
3524
3529
|
return typeof window < "u" && window.isSecureContext && typeof navigator.clipboard?.writeText == "function";
|
|
3525
3530
|
}
|
|
3526
|
-
function
|
|
3531
|
+
function Aa(e, t) {
|
|
3527
3532
|
let n = "";
|
|
3528
3533
|
return s(e).iterate({
|
|
3529
3534
|
from: t,
|
|
@@ -3535,12 +3540,12 @@ function Oa(e, t) {
|
|
|
3535
3540
|
}
|
|
3536
3541
|
}), n;
|
|
3537
3542
|
}
|
|
3538
|
-
function
|
|
3543
|
+
function J(e, t, n) {
|
|
3539
3544
|
e.dataset.state = n, e.querySelector("nldd-icon").setAttribute("icon", n === "success" ? "check-mark" : "copy");
|
|
3540
3545
|
let r = n === "success" ? t.success() : n === "failure" ? t.failure() : t.copy();
|
|
3541
3546
|
e.querySelector(".cm-md-code-copy-text").textContent = r, e.nextElementSibling.textContent = n === "idle" ? "" : r;
|
|
3542
3547
|
}
|
|
3543
|
-
var
|
|
3548
|
+
var Y = /* @__PURE__ */ new WeakMap(), ja = class extends t {
|
|
3544
3549
|
constructor(e, t, n) {
|
|
3545
3550
|
super(), this.lineFrom = e, this.focusable = t, this.label = n;
|
|
3546
3551
|
}
|
|
@@ -3548,7 +3553,7 @@ var X = /* @__PURE__ */ new WeakMap(), ka = class extends t {
|
|
|
3548
3553
|
return e.lineFrom === this.lineFrom && e.focusable === this.focusable && e.label === this.label;
|
|
3549
3554
|
}
|
|
3550
3555
|
toDOM(e) {
|
|
3551
|
-
let t = () => e.state.facet(
|
|
3556
|
+
let t = () => e.state.facet(Ea), n = document.createElement("button");
|
|
3552
3557
|
n.type = "button", n.className = "cm-md-code-copy", this.focusable || (n.tabIndex = -1);
|
|
3553
3558
|
let r = document.createElement("nldd-icon");
|
|
3554
3559
|
r.setAttribute("aria-hidden", "true"), r.className = "cm-md-code-copy-icon";
|
|
@@ -3557,82 +3562,82 @@ var X = /* @__PURE__ */ new WeakMap(), ka = class extends t {
|
|
|
3557
3562
|
let a = document.createElement("span");
|
|
3558
3563
|
a.className = "cm-md-code-copy-status", a.setAttribute("role", "status"), n.append(r, i);
|
|
3559
3564
|
let o = document.createElement("span");
|
|
3560
|
-
o.className = "cm-md-code-copy-wrap", o.append(n, a),
|
|
3565
|
+
o.className = "cm-md-code-copy-wrap", o.append(n, a), J(n, t(), "idle"), n.addEventListener("mousedown", (e) => e.preventDefault());
|
|
3561
3566
|
let s = "", c = (e) => {
|
|
3562
|
-
clearTimeout(
|
|
3567
|
+
clearTimeout(Y.get(o)), Y.set(o, setTimeout(() => J(n, t(), "idle"), e));
|
|
3563
3568
|
}, l = () => {
|
|
3564
|
-
clearTimeout(
|
|
3569
|
+
clearTimeout(Y.get(o)), n.dataset.state !== "idle" && J(n, t(), "idle");
|
|
3565
3570
|
};
|
|
3566
3571
|
return n.addEventListener("pointerdown", (e) => {
|
|
3567
3572
|
s = e.pointerType;
|
|
3568
3573
|
}), n.addEventListener("keydown", (e) => {
|
|
3569
3574
|
s = "", e.key === "Escape" && l();
|
|
3570
3575
|
}), n.addEventListener("click", async () => {
|
|
3571
|
-
clearTimeout(
|
|
3576
|
+
clearTimeout(Y.get(o));
|
|
3572
3577
|
try {
|
|
3573
|
-
await navigator.clipboard.writeText(
|
|
3578
|
+
await navigator.clipboard.writeText(Aa(e.state, e.state.doc.lineAt(e.posAtDOM(n)).from)), J(n, t(), "success");
|
|
3574
3579
|
} catch {
|
|
3575
|
-
|
|
3580
|
+
J(n, t(), "failure");
|
|
3576
3581
|
}
|
|
3577
|
-
s && s !== "mouse" && c(
|
|
3578
|
-
}), n.addEventListener("pointerenter", () => clearTimeout(
|
|
3579
|
-
n.dataset.state === "idle" || n.matches(":focus") || c(
|
|
3582
|
+
s && s !== "mouse" && c(Oa);
|
|
3583
|
+
}), n.addEventListener("pointerenter", () => clearTimeout(Y.get(o))), n.addEventListener("pointerleave", () => {
|
|
3584
|
+
n.dataset.state === "idle" || n.matches(":focus") || c(Da);
|
|
3580
3585
|
}), n.addEventListener("blur", l), o;
|
|
3581
3586
|
}
|
|
3582
3587
|
destroy(e) {
|
|
3583
|
-
clearTimeout(
|
|
3588
|
+
clearTimeout(Y.get(e));
|
|
3584
3589
|
}
|
|
3585
3590
|
ignoreEvent() {
|
|
3586
3591
|
return !0;
|
|
3587
3592
|
}
|
|
3588
3593
|
};
|
|
3589
|
-
function
|
|
3590
|
-
if (!
|
|
3591
|
-
let t = [], n = e.readOnly, r = e.facet(
|
|
3594
|
+
function Ma(e) {
|
|
3595
|
+
if (!ka()) return v.none;
|
|
3596
|
+
let t = [], n = e.readOnly, r = e.facet(Ea).copy();
|
|
3592
3597
|
return s(e).iterate({ enter: (i) => {
|
|
3593
3598
|
if (i.name !== "FencedCode") return;
|
|
3594
3599
|
let a = e.doc.lineAt(i.from);
|
|
3595
|
-
return t.push(
|
|
3596
|
-
widget: new
|
|
3600
|
+
return t.push(Na.range(a.from), v.widget({
|
|
3601
|
+
widget: new ja(a.from, n, r),
|
|
3597
3602
|
side: 1
|
|
3598
3603
|
}).range(a.to)), !1;
|
|
3599
3604
|
} }), v.set(t, !0);
|
|
3600
3605
|
}
|
|
3601
|
-
var
|
|
3602
|
-
function
|
|
3603
|
-
let n = t.state.facet(
|
|
3604
|
-
for (let e of t.dom.querySelectorAll(".cm-md-code-copy:not([data-state=\"idle\"])")) clearTimeout(
|
|
3606
|
+
var Na = v.line({ class: "cm-md-code-head" });
|
|
3607
|
+
function Pa(e, t) {
|
|
3608
|
+
let n = t.state.facet(Ea);
|
|
3609
|
+
for (let e of t.dom.querySelectorAll(".cm-md-code-copy:not([data-state=\"idle\"])")) clearTimeout(Y.get(e.parentElement)), J(e, n, "idle");
|
|
3605
3610
|
return !1;
|
|
3606
3611
|
}
|
|
3607
|
-
var
|
|
3608
|
-
mousedown:
|
|
3609
|
-
keydown:
|
|
3612
|
+
var Fa = _.domEventHandlers({
|
|
3613
|
+
mousedown: Pa,
|
|
3614
|
+
keydown: Pa
|
|
3610
3615
|
});
|
|
3611
|
-
function
|
|
3616
|
+
function Ia(e) {
|
|
3612
3617
|
let t = h.define({
|
|
3613
|
-
create:
|
|
3614
|
-
update: (e, t) => t.docChanged || t.reconfigured ||
|
|
3618
|
+
create: Ma,
|
|
3619
|
+
update: (e, t) => t.docChanged || t.reconfigured || T(t.startState, t.state) ? Ma(t.state) : e,
|
|
3615
3620
|
provide: (e) => _.decorations.from(e)
|
|
3616
3621
|
});
|
|
3617
3622
|
return [
|
|
3618
|
-
|
|
3623
|
+
Ea.of(e),
|
|
3619
3624
|
t,
|
|
3620
|
-
|
|
3625
|
+
Fa
|
|
3621
3626
|
];
|
|
3622
3627
|
}
|
|
3623
3628
|
// src/components/inputs/text-editor/text-editor.toolbar.ts
|
|
3624
|
-
var
|
|
3625
|
-
function
|
|
3629
|
+
var X = "text-editor-command", La = "text-editor-for";
|
|
3630
|
+
function Ra(e) {
|
|
3626
3631
|
let t = e.indexOf(":");
|
|
3627
3632
|
if (t < 0) return [e.trim(), void 0];
|
|
3628
3633
|
let n = e.slice(t + 1).trim();
|
|
3629
3634
|
return [e.slice(0, t).trim(), /^\d+$/.test(n) ? Number(n) : n];
|
|
3630
3635
|
}
|
|
3631
|
-
function
|
|
3636
|
+
function za(e) {
|
|
3632
3637
|
let { active: t } = e;
|
|
3633
3638
|
return t.taskList ? "task" : t.orderedList ? "ordered" : t.bulletList ? "bullet" : "none";
|
|
3634
3639
|
}
|
|
3635
|
-
var
|
|
3640
|
+
var Ba = /* @__PURE__ */ new Set([
|
|
3636
3641
|
"bold",
|
|
3637
3642
|
"italic",
|
|
3638
3643
|
"inlineCode",
|
|
@@ -3642,16 +3647,16 @@ var Ra = /* @__PURE__ */ new Set([
|
|
|
3642
3647
|
"codeBlock",
|
|
3643
3648
|
"taskList"
|
|
3644
3649
|
]);
|
|
3645
|
-
function
|
|
3650
|
+
function Va(e, t, n) {
|
|
3646
3651
|
let { active: r } = n;
|
|
3647
|
-
return
|
|
3652
|
+
return Ba.has(e) ? !!r[e] : e === "bulletList" ? r.bulletList && !r.taskList : e === "heading" ? r.heading === (typeof t == "number" ? t : 1) : e === "setHeading" ? !r.codeBlock && r.heading === (typeof t == "number" ? t : 0) : e === "setList" && !r.codeBlock && za(n) === (t ?? "none");
|
|
3648
3653
|
}
|
|
3649
|
-
var
|
|
3654
|
+
var Ha = /* @__PURE__ */ new Set([
|
|
3650
3655
|
"bold",
|
|
3651
3656
|
"italic",
|
|
3652
3657
|
"strikethrough",
|
|
3653
3658
|
"link"
|
|
3654
|
-
]),
|
|
3659
|
+
]), Ua = /* @__PURE__ */ new Set([
|
|
3655
3660
|
"inlineCode",
|
|
3656
3661
|
"quote",
|
|
3657
3662
|
"bulletList",
|
|
@@ -3659,12 +3664,12 @@ var Ba = /* @__PURE__ */ new Set([
|
|
|
3659
3664
|
"setList",
|
|
3660
3665
|
"heading"
|
|
3661
3666
|
]);
|
|
3662
|
-
function
|
|
3667
|
+
function Wa(e, t, n) {
|
|
3663
3668
|
if (t.disabled) return !1;
|
|
3664
3669
|
if (t.readonly) return e === "copy";
|
|
3665
3670
|
let { active: r } = n;
|
|
3666
|
-
if (
|
|
3667
|
-
if (
|
|
3671
|
+
if (Ha.has(e)) return !r.inlineCode && !r.codeBlock;
|
|
3672
|
+
if (Ua.has(e)) return !r.codeBlock;
|
|
3668
3673
|
switch (e) {
|
|
3669
3674
|
case "undo": return n.canUndo;
|
|
3670
3675
|
case "redo": return n.canRedo;
|
|
@@ -3675,72 +3680,72 @@ function Ha(e, t, n) {
|
|
|
3675
3680
|
default: return !0;
|
|
3676
3681
|
}
|
|
3677
3682
|
}
|
|
3678
|
-
var
|
|
3679
|
-
function*
|
|
3683
|
+
var Z = (e) => e.tagName.toLowerCase();
|
|
3684
|
+
function* Ga(e) {
|
|
3680
3685
|
let t = e;
|
|
3681
3686
|
for (; t;) t instanceof Element && (yield t), t = t.parentNode ?? (t instanceof ShadowRoot ? t.host : null);
|
|
3682
3687
|
}
|
|
3683
|
-
function
|
|
3688
|
+
function Ka(e) {
|
|
3684
3689
|
let t = e.getRootNode();
|
|
3685
|
-
return t instanceof ShadowRoot &&
|
|
3690
|
+
return t instanceof ShadowRoot && Z(t.host) === "nldd-toolbar";
|
|
3686
3691
|
}
|
|
3687
|
-
var Q = /* @__PURE__ */ new Set(),
|
|
3688
|
-
function
|
|
3692
|
+
var Q = /* @__PURE__ */ new Set(), qa = /* @__PURE__ */ new WeakMap();
|
|
3693
|
+
function Ja(e) {
|
|
3689
3694
|
for (let t of Q) if (t.target.id === e) return t;
|
|
3690
3695
|
}
|
|
3691
|
-
function
|
|
3696
|
+
function Ya(e) {
|
|
3692
3697
|
for (let t of e.composedPath()) if (t instanceof Element) {
|
|
3693
|
-
if (
|
|
3694
|
-
if (t.hasAttribute(
|
|
3698
|
+
if (Z(t) === "nldd-text-editor") return null;
|
|
3699
|
+
if (t.hasAttribute(X)) return Ka(t) ? null : t;
|
|
3695
3700
|
}
|
|
3696
3701
|
return null;
|
|
3697
3702
|
}
|
|
3698
|
-
function
|
|
3699
|
-
for (let t of
|
|
3700
|
-
let e = t.getAttribute(
|
|
3701
|
-
if (e !== null) return e === "" ? void 0 :
|
|
3702
|
-
let n =
|
|
3703
|
+
function Xa(e) {
|
|
3704
|
+
for (let t of Ga(e)) {
|
|
3705
|
+
let e = t.getAttribute(La);
|
|
3706
|
+
if (e !== null) return e === "" ? void 0 : Ja(e);
|
|
3707
|
+
let n = qa.get(t);
|
|
3703
3708
|
if (n) return n;
|
|
3704
3709
|
}
|
|
3705
3710
|
}
|
|
3706
|
-
function
|
|
3711
|
+
function Za(e) {
|
|
3707
3712
|
return (t) => {
|
|
3708
|
-
let n =
|
|
3709
|
-
(n &&
|
|
3713
|
+
let n = Ya(t);
|
|
3714
|
+
(n && Xa(n))?.handle(e, t, n);
|
|
3710
3715
|
};
|
|
3711
3716
|
}
|
|
3712
|
-
var
|
|
3717
|
+
var Qa = [
|
|
3713
3718
|
"click",
|
|
3714
3719
|
"change",
|
|
3715
3720
|
"select",
|
|
3716
3721
|
"pointerdown",
|
|
3717
3722
|
"keydown"
|
|
3718
|
-
].map((e) => [e,
|
|
3723
|
+
].map((e) => [e, Za(e)]), $a = /* @__PURE__ */ new Set(["pointerdown", "keydown"]), eo = class {
|
|
3719
3724
|
constructor(e, t) {
|
|
3720
3725
|
this.target = e, this.focusText = t, this._listBeforePress = null;
|
|
3721
3726
|
}
|
|
3722
3727
|
connect() {
|
|
3723
|
-
if (Q.size === 0) for (let [e, t] of
|
|
3724
|
-
Q.add(this),
|
|
3728
|
+
if (Q.size === 0) for (let [e, t] of Qa) document.addEventListener(e, t, $a.has(e));
|
|
3729
|
+
Q.add(this), qa.set(this.target, this);
|
|
3725
3730
|
}
|
|
3726
3731
|
disconnect() {
|
|
3727
|
-
if (Q.delete(this),
|
|
3732
|
+
if (Q.delete(this), qa.delete(this.target), Q.size === 0) for (let [e, t] of Qa) document.removeEventListener(e, t, $a.has(e));
|
|
3728
3733
|
}
|
|
3729
3734
|
controls() {
|
|
3730
|
-
let e = [...this.target.querySelectorAll(`[${
|
|
3731
|
-
return [...e, ...n].filter((e) =>
|
|
3735
|
+
let e = [...this.target.querySelectorAll(`[${X}]`)], t = this.target.id, n = t && Ja(t) === this ? [...document.querySelectorAll(`[${La}="${CSS.escape(t)}"]`)].flatMap((e) => [...e.hasAttribute(X) ? [e] : [], ...e.querySelectorAll(`[${X}]`)]) : [];
|
|
3736
|
+
return [...e, ...n].filter((e) => Xa(e) === this);
|
|
3732
3737
|
}
|
|
3733
3738
|
_run(e) {
|
|
3734
|
-
let [t, n] =
|
|
3739
|
+
let [t, n] = Ra(e);
|
|
3735
3740
|
t === "setHeading" && this.target.getState().active.codeBlock && this.target.runCommand("codeBlock"), this.target.runCommand(t, n), queueMicrotask(this.focusText);
|
|
3736
3741
|
}
|
|
3737
3742
|
handle(e, t, n) {
|
|
3738
|
-
let r =
|
|
3743
|
+
let r = Z(n), [i] = Ra(n.getAttribute(X));
|
|
3739
3744
|
switch (e) {
|
|
3740
3745
|
case "pointerdown":
|
|
3741
3746
|
case "keydown":
|
|
3742
3747
|
if (e === "keydown" && !["Enter", " "].includes(t.key)) return;
|
|
3743
|
-
this._listBeforePress = r === "nldd-segmented-control" ?
|
|
3748
|
+
this._listBeforePress = r === "nldd-segmented-control" ? za(this.target.getState()) : null;
|
|
3744
3749
|
return;
|
|
3745
3750
|
case "click":
|
|
3746
3751
|
if (r === "nldd-menu-item") return;
|
|
@@ -3749,7 +3754,7 @@ var Za = [
|
|
|
3749
3754
|
i === "setList" && e?.value && e.value !== "none" && e.value === this._listBeforePress && this._run("setList:none"), this._listBeforePress = null;
|
|
3750
3755
|
return;
|
|
3751
3756
|
}
|
|
3752
|
-
this._run(n.getAttribute(
|
|
3757
|
+
this._run(n.getAttribute(X));
|
|
3753
3758
|
return;
|
|
3754
3759
|
case "change": {
|
|
3755
3760
|
if (r !== "nldd-segmented-control") return;
|
|
@@ -3759,19 +3764,19 @@ var Za = [
|
|
|
3759
3764
|
}
|
|
3760
3765
|
case "select": {
|
|
3761
3766
|
if (r !== "nldd-menu-item") return;
|
|
3762
|
-
let e = n.getAttribute(
|
|
3763
|
-
if (n.getAttribute("type") === "radio" &&
|
|
3767
|
+
let e = n.getAttribute(X), [, t] = Ra(e);
|
|
3768
|
+
if (n.getAttribute("type") === "radio" && Va(i, t, this.target.getState())) return;
|
|
3764
3769
|
this._run(e);
|
|
3765
3770
|
}
|
|
3766
3771
|
}
|
|
3767
3772
|
}
|
|
3768
3773
|
reflect(e = this.target.getState()) {
|
|
3769
3774
|
for (let t of this.controls()) {
|
|
3770
|
-
let [n, r] =
|
|
3771
|
-
t.toggleAttribute("disabled", !
|
|
3775
|
+
let [n, r] = Ra(t.getAttribute(X)), i = Z(t);
|
|
3776
|
+
t.toggleAttribute("disabled", !Wa(n, this.target, e)), i === "nldd-segmented-control" ? n === "setList" && (t.value = za(e)) : (i === "nldd-toggle-button" || i === "nldd-menu-item" || i === "nldd-segmented-control-item") && t.toggleAttribute("selected", Va(n, r, e));
|
|
3772
3777
|
}
|
|
3773
3778
|
}
|
|
3774
|
-
},
|
|
3779
|
+
}, to = class {
|
|
3775
3780
|
constructor(e, t) {
|
|
3776
3781
|
this.host = e, this.container = t, this._frame = 0, this._listening = !1, this._gap = 0, this._schedule = () => {
|
|
3777
3782
|
this._frame || (this._frame = requestAnimationFrame(() => {
|
|
@@ -3798,26 +3803,26 @@ var Za = [
|
|
|
3798
3803
|
let t = e.getBoundingClientRect().top - this.container().getBoundingClientRect().top, n = e.classList.contains("is-stuck") ? this._gap : 0;
|
|
3799
3804
|
e.classList.toggle("is-stuck", t > n + .5);
|
|
3800
3805
|
}
|
|
3801
|
-
},
|
|
3806
|
+
}, no = class extends _e {
|
|
3802
3807
|
constructor(...e) {
|
|
3803
|
-
super(...e), this.
|
|
3808
|
+
super(...e), this.resize = "auto", this.embedded = !1, this.wrap = !0, this.syntax = "hidden", this.annotatable = !1, this.noSpellcheck = !1, this.translations = {}, this.typeaheads = [], this._mentionTypeahead = ((e) => ({
|
|
3804
3809
|
trigger: "@",
|
|
3805
3810
|
source: (t) => e.mentionSource?.(t) ?? [],
|
|
3806
|
-
insert:
|
|
3811
|
+
insert: We,
|
|
3807
3812
|
get query() {
|
|
3808
3813
|
return e.mentionQuery;
|
|
3809
3814
|
},
|
|
3810
3815
|
get emptyText() {
|
|
3811
3816
|
return e.mentionEmptyText;
|
|
3812
3817
|
}
|
|
3813
|
-
}))(this), this.
|
|
3818
|
+
}))(this), this.annotations = [], this.rowsProperty = "--_text-editor-rows", this._wrapCompartment = new l(), this._spellcheckCompartment = new l(), this._historyCompartment = new l(), this._syntaxCompartment = new l(), this._toolbar = new eo(this, () => this.view?.focus()), this._stuck = new to(this, () => this._container ?? null), this._hasSlottedToolbar = !1, this._labels = null, this._clipboard = new hi(), this._plainPaste = null, this._lastState = null, this._onMentionPointerDown = (e) => {
|
|
3814
3819
|
let t = e.target?.closest?.(".cm-md-mention-token");
|
|
3815
3820
|
if (!t || !this.view || this.view.state.readOnly) return;
|
|
3816
|
-
let n =
|
|
3821
|
+
let n = rt(this.view.state, this.view.posAtDOM(t));
|
|
3817
3822
|
n && (e.preventDefault(), e.stopPropagation(), this.view.dispatch({ selection: {
|
|
3818
3823
|
anchor: n.from,
|
|
3819
3824
|
head: n.to
|
|
3820
|
-
} }), this.view.focus(), e.button !== 0 || e.shiftKey || e.altKey || e.metaKey || e.ctrlKey || this.view.plugin(
|
|
3825
|
+
} }), this.view.focus(), e.button !== 0 || e.shiftKey || e.altKey || e.metaKey || e.ctrlKey || this.view.plugin(ia)?.startFor(e, n.from, n.to));
|
|
3821
3826
|
}, this._onAnnotationBadgeClick = (e) => {
|
|
3822
3827
|
let t = e.target?.closest?.(".cm-annotation-badge");
|
|
3823
3828
|
if (!t) return;
|
|
@@ -3849,7 +3854,7 @@ var Za = [
|
|
|
3849
3854
|
});
|
|
3850
3855
|
}
|
|
3851
3856
|
_t(e, t) {
|
|
3852
|
-
return
|
|
3857
|
+
return Me(this.translations, je, e, t);
|
|
3853
3858
|
}
|
|
3854
3859
|
_labelSignature() {
|
|
3855
3860
|
return [
|
|
@@ -3865,36 +3870,36 @@ var Za = [
|
|
|
3865
3870
|
buildExtensions() {
|
|
3866
3871
|
return [
|
|
3867
3872
|
ne,
|
|
3868
|
-
|
|
3869
|
-
|
|
3870
|
-
y.low(
|
|
3871
|
-
|
|
3873
|
+
$n,
|
|
3874
|
+
hr(() => this._typeaheadLists(), (e) => this._onTypeaheadChosen(e), (e) => this._t(e ? "components.text-editor.typeahead-no-results-text" : "components.text-editor.typeahead-start-typing-text"), (e) => e === 1 ? this._t("components.text-editor.typeahead-one-result-text") : this._t("components.text-editor.typeahead-results-text", { count: e })),
|
|
3875
|
+
y.low($i),
|
|
3876
|
+
si((e, t) => this._t("components.text-editor.annotation-count-label", {
|
|
3872
3877
|
count: e,
|
|
3873
3878
|
noun: this._t(e === 1 ? "components.text-editor.annotation-singular-lowercase" : "components.text-editor.annotation-plural-lowercase"),
|
|
3874
3879
|
quote: t
|
|
3875
3880
|
})),
|
|
3876
|
-
y.highest(
|
|
3877
|
-
|
|
3881
|
+
y.highest(an((e) => this._t("components.text-editor.open-in-new-tab-label", { url: e }))),
|
|
3882
|
+
Ia({
|
|
3878
3883
|
copy: () => this._t("components.text-editor.copy-code-action"),
|
|
3879
3884
|
success: () => this._t("components.text-editor.code-copy-success-text"),
|
|
3880
3885
|
failure: () => this._t("components.text-editor.code-copy-failure-text")
|
|
3881
3886
|
}),
|
|
3882
|
-
|
|
3887
|
+
ht({
|
|
3883
3888
|
open: () => this._t("components.text-editor.task-open-label"),
|
|
3884
3889
|
done: () => this._t("components.text-editor.task-done-label")
|
|
3885
3890
|
}),
|
|
3886
|
-
this._historyCompartment.of(
|
|
3891
|
+
this._historyCompartment.of(se()),
|
|
3887
3892
|
r(),
|
|
3888
|
-
|
|
3889
|
-
|
|
3890
|
-
|
|
3893
|
+
Ca,
|
|
3894
|
+
ya,
|
|
3895
|
+
yi(),
|
|
3891
3896
|
a(),
|
|
3892
|
-
|
|
3893
|
-
|
|
3897
|
+
aa,
|
|
3898
|
+
Ui,
|
|
3894
3899
|
...this.inputExtensions(),
|
|
3895
3900
|
this._wrapCompartment.of(this.wrap ? _.lineWrapping : []),
|
|
3896
|
-
this._spellcheckCompartment.of(this.noSpellcheck ? [] :
|
|
3897
|
-
this._syntaxCompartment.of(this.syntax === "hidden" ?
|
|
3901
|
+
this._spellcheckCompartment.of(this.noSpellcheck ? [] : Or()),
|
|
3902
|
+
this._syntaxCompartment.of(this.syntax === "hidden" ? [Xt(), k.of(!0)] : []),
|
|
3898
3903
|
_.updateListener.of((e) => {
|
|
3899
3904
|
(e.docChanged || e.selectionSet) && this._emitState();
|
|
3900
3905
|
}),
|
|
@@ -3950,73 +3955,73 @@ var Za = [
|
|
|
3950
3955
|
return R(e);
|
|
3951
3956
|
}
|
|
3952
3957
|
beforeChangeCheck(e) {
|
|
3953
|
-
|
|
3958
|
+
xn(e);
|
|
3954
3959
|
}
|
|
3955
3960
|
onEditorMounted() {
|
|
3956
3961
|
super.onEditorMounted(), this.view?.contentDOM.addEventListener("pointerdown", this._onMentionPointerDown, !0), this.view?.contentDOM.addEventListener("click", this._onAnnotationBadgeClick), this._syncAnnotations(), this._emitState();
|
|
3957
3962
|
}
|
|
3958
3963
|
updated(e) {
|
|
3959
|
-
if (super.updated(e), (e.has("disabled") || e.has("readonly")) && this._toolbar.reflect(), (e.has("embedded") || e.has("_hasSlottedToolbar")) && this.hasUpdated && this._stuck.update(), import.meta.env?.DEV && e.has("typeaheads") &&
|
|
3964
|
+
if (super.updated(e), (e.has("disabled") || e.has("readonly")) && this._toolbar.reflect(), (e.has("embedded") || e.has("_hasSlottedToolbar")) && this.hasUpdated && this._stuck.update(), import.meta.env?.DEV && e.has("typeaheads") && Ne(this, "invalid-typeahead-query", rr(this.typeaheads)), !this.view) return;
|
|
3960
3965
|
let t = this._labelSignature();
|
|
3961
|
-
t !== this._labels && (this._labels !== null && this.view.dispatch({ effects:
|
|
3966
|
+
t !== this._labels && (this._labels !== null && this.view.dispatch({ effects: Pe.of(null) }), this._labels = t), e.has("wrap") && this.reconfigure(this._wrapCompartment, this.wrap ? _.lineWrapping : []), e.has("syntax") && this.reconfigure(this._syntaxCompartment, this.syntax === "hidden" ? [Xt(), k.of(!0)] : []), e.has("noSpellcheck") && (this.reconfigure(this._spellcheckCompartment, this.noSpellcheck ? [] : Or()), this._redrawForSpellcheck()), (e.has("annotations") || e.has("annotatable")) && this._syncAnnotations();
|
|
3962
3967
|
}
|
|
3963
3968
|
_syncAnnotations() {
|
|
3964
3969
|
this.view?.dispatch({
|
|
3965
|
-
effects:
|
|
3966
|
-
annotations:
|
|
3970
|
+
effects: Ir.of(this.annotatable ? this.annotations : []),
|
|
3971
|
+
annotations: re.addToHistory.of(!1)
|
|
3967
3972
|
});
|
|
3968
3973
|
}
|
|
3969
3974
|
toggleBold() {
|
|
3970
|
-
this.view &&
|
|
3975
|
+
this.view && U(this.view, "**", "StrongEmphasis");
|
|
3971
3976
|
}
|
|
3972
3977
|
toggleItalic() {
|
|
3973
|
-
this.view &&
|
|
3978
|
+
this.view && U(this.view, "*", "Emphasis");
|
|
3974
3979
|
}
|
|
3975
3980
|
toggleInlineCode() {
|
|
3976
|
-
this.view &&
|
|
3981
|
+
this.view && U(this.view, "`", "InlineCode");
|
|
3977
3982
|
}
|
|
3978
3983
|
toggleStrikethrough() {
|
|
3979
|
-
this.view &&
|
|
3984
|
+
this.view && U(this.view, "~~", "Strikethrough");
|
|
3980
3985
|
}
|
|
3981
3986
|
toggleHeading(e) {
|
|
3982
|
-
this.view &&
|
|
3987
|
+
this.view && Ti(this.view, e);
|
|
3983
3988
|
}
|
|
3984
3989
|
setHeading(e) {
|
|
3985
|
-
this.view &&
|
|
3990
|
+
this.view && Ei(this.view, e);
|
|
3986
3991
|
}
|
|
3987
3992
|
toggleBulletList() {
|
|
3988
|
-
this.view &&
|
|
3993
|
+
this.view && Di(this.view);
|
|
3989
3994
|
}
|
|
3990
3995
|
toggleTaskList() {
|
|
3991
|
-
this.view &&
|
|
3996
|
+
this.view && ki(this.view);
|
|
3992
3997
|
}
|
|
3993
3998
|
setList(e) {
|
|
3994
|
-
this.view &&
|
|
3999
|
+
this.view && ji(this.view, e);
|
|
3995
4000
|
}
|
|
3996
4001
|
toggleQuote() {
|
|
3997
|
-
this.view &&
|
|
4002
|
+
this.view && Ri(this.view);
|
|
3998
4003
|
}
|
|
3999
4004
|
toggleLink(e = "") {
|
|
4000
|
-
this.view &&
|
|
4005
|
+
this.view && Bi(this.view, e);
|
|
4001
4006
|
}
|
|
4002
4007
|
toggleCodeBlock() {
|
|
4003
|
-
this.view &&
|
|
4008
|
+
this.view && Vi(this.view);
|
|
4004
4009
|
}
|
|
4005
4010
|
indent() {
|
|
4006
|
-
this.view &&
|
|
4011
|
+
this.view && Ni(this.view);
|
|
4007
4012
|
}
|
|
4008
4013
|
outdent() {
|
|
4009
|
-
this.view &&
|
|
4014
|
+
this.view && Pi(this.view);
|
|
4010
4015
|
}
|
|
4011
4016
|
undo() {
|
|
4012
|
-
this.view && (
|
|
4017
|
+
this.view && (le(this.view), this.view.focus());
|
|
4013
4018
|
}
|
|
4014
4019
|
redo() {
|
|
4015
|
-
this.view && (
|
|
4020
|
+
this.view && (fe(this.view), this.view.focus());
|
|
4016
4021
|
}
|
|
4017
4022
|
clearHistory() {
|
|
4018
4023
|
let e = this.view;
|
|
4019
|
-
e && (e.dispatch({ effects: this._historyCompartment.reconfigure([]) }), e.dispatch({ effects: this._historyCompartment.reconfigure(
|
|
4024
|
+
e && (e.dispatch({ effects: this._historyCompartment.reconfigure([]) }), e.dispatch({ effects: this._historyCompartment.reconfigure(se()) }), this._emitState());
|
|
4020
4025
|
}
|
|
4021
4026
|
async copy() {
|
|
4022
4027
|
if (!this.view || this.view.state.selection.main.empty) return;
|
|
@@ -4057,8 +4062,8 @@ var Za = [
|
|
|
4057
4062
|
applyChanges(e) {
|
|
4058
4063
|
let t = this.view;
|
|
4059
4064
|
if (!t || e.length === 0) return;
|
|
4060
|
-
let n = t.state.doc.toString(), r =
|
|
4061
|
-
let t = Math.max(0, Math.min(e.from, i)), a = Math.max(t, Math.min(e.to ?? t, i)), o =
|
|
4065
|
+
let n = t.state.doc.toString(), r = kr(n), i = n.length - r.length, a = e.toSorted((e, t) => e.from - t.from).map((e) => {
|
|
4066
|
+
let t = Math.max(0, Math.min(e.from, i)), a = Math.max(t, Math.min(e.to ?? t, i)), o = B(r, t), s = t === a ? o : B(r, a);
|
|
4062
4067
|
for (; s > o && n[s - 1] === "";) s--;
|
|
4063
4068
|
return {
|
|
4064
4069
|
from: o,
|
|
@@ -4068,7 +4073,7 @@ var Za = [
|
|
|
4068
4073
|
});
|
|
4069
4074
|
t.dispatch({
|
|
4070
4075
|
changes: a,
|
|
4071
|
-
annotations: [
|
|
4076
|
+
annotations: [re.remote.of(!0), re.addToHistory.of(!1)]
|
|
4072
4077
|
});
|
|
4073
4078
|
}
|
|
4074
4079
|
setDoc(e) {
|
|
@@ -4077,7 +4082,7 @@ var Za = [
|
|
|
4077
4082
|
}
|
|
4078
4083
|
replaceRange(e, t, n) {
|
|
4079
4084
|
if (!this.view || this.view.state.readOnly) return;
|
|
4080
|
-
let r = this.view.state.doc.toString(), i =
|
|
4085
|
+
let r = this.view.state.doc.toString(), i = kr(r), a = r.length - i.length, o = Math.max(0, Math.min(e, a)), s = Math.max(o, Math.min(t, a)), c = R(n), l = B(i, o), u = B(i, s);
|
|
4081
4086
|
this.view.dispatch({
|
|
4082
4087
|
changes: {
|
|
4083
4088
|
from: l,
|
|
@@ -4148,17 +4153,17 @@ var Za = [
|
|
|
4148
4153
|
case "paste":
|
|
4149
4154
|
this.paste();
|
|
4150
4155
|
break;
|
|
4151
|
-
default:
|
|
4156
|
+
default: Ne(this, "unknown-command", !0);
|
|
4152
4157
|
}
|
|
4153
4158
|
}
|
|
4154
4159
|
getState() {
|
|
4155
4160
|
return {
|
|
4156
|
-
active: this.view ?
|
|
4161
|
+
active: this.view ? Hi(this.view) : { ...bi },
|
|
4157
4162
|
empty: !this.view || this.view.state.selection.main.empty,
|
|
4158
|
-
canIndent: this.view ?
|
|
4159
|
-
canOutdent: this.view ?
|
|
4160
|
-
canUndo: this.view ?
|
|
4161
|
-
canRedo: this.view ?
|
|
4163
|
+
canIndent: this.view ? Fi(this.view) : !1,
|
|
4164
|
+
canOutdent: this.view ? Ii(this.view) : !1,
|
|
4165
|
+
canUndo: this.view ? ue(this.view.state) > 0 : !1,
|
|
4166
|
+
canRedo: this.view ? ve(this.view.state) > 0 : !1
|
|
4162
4167
|
};
|
|
4163
4168
|
}
|
|
4164
4169
|
getSelection() {
|
|
@@ -4170,7 +4175,7 @@ var Za = [
|
|
|
4170
4175
|
empty: !0,
|
|
4171
4176
|
rect: null
|
|
4172
4177
|
};
|
|
4173
|
-
let t = e.state.doc.toString(), n = e.state.selection.main, r =
|
|
4178
|
+
let t = e.state.doc.toString(), n = e.state.selection.main, r = z(t, n.from), i = z(t, n.to), a = e.coordsAtPos(n.from), o = e.coordsAtPos(n.to), s = a && o ? new DOMRect(Math.min(a.left, o.left), Math.min(a.top, o.top), Math.max(a.right, o.right) - Math.min(a.left, o.left), Math.max(a.bottom, o.bottom) - Math.min(a.top, o.top)) : null;
|
|
4174
4179
|
return {
|
|
4175
4180
|
start: r,
|
|
4176
4181
|
end: i,
|
|
@@ -4183,7 +4188,7 @@ var Za = [
|
|
|
4183
4188
|
let e = this.view;
|
|
4184
4189
|
if (!e) return [];
|
|
4185
4190
|
let t = R(e.state.doc.toString());
|
|
4186
|
-
return
|
|
4191
|
+
return Br(e.state).map((e) => ({
|
|
4187
4192
|
id: e.id,
|
|
4188
4193
|
start: e.from,
|
|
4189
4194
|
end: e.to,
|
|
@@ -4203,21 +4208,21 @@ var Za = [
|
|
|
4203
4208
|
}
|
|
4204
4209
|
_onTypeaheadChosen(e) {
|
|
4205
4210
|
if (!this.view) return;
|
|
4206
|
-
let t = this.view.state.doc.toString(), n =
|
|
4211
|
+
let t = this.view.state.doc.toString(), n = z(t, e.from);
|
|
4207
4212
|
if (e.typeahead === this._mentionTypeahead) {
|
|
4208
4213
|
let { id: t, text: r } = e.candidate;
|
|
4209
4214
|
this._emitMention({
|
|
4210
4215
|
id: t,
|
|
4211
4216
|
text: r,
|
|
4212
4217
|
from: n,
|
|
4213
|
-
to: n +
|
|
4218
|
+
to: n + Ue(e.candidate).length
|
|
4214
4219
|
});
|
|
4215
4220
|
} else this.dispatchEvent(new CustomEvent("typeahead", {
|
|
4216
4221
|
detail: {
|
|
4217
4222
|
trigger: e.trigger,
|
|
4218
4223
|
candidate: e.candidate,
|
|
4219
4224
|
from: n,
|
|
4220
|
-
to:
|
|
4225
|
+
to: z(t, e.to)
|
|
4221
4226
|
},
|
|
4222
4227
|
bubbles: !0,
|
|
4223
4228
|
composed: !0
|
|
@@ -4231,27 +4236,27 @@ var Za = [
|
|
|
4231
4236
|
}));
|
|
4232
4237
|
}
|
|
4233
4238
|
render() {
|
|
4234
|
-
return
|
|
4239
|
+
return Ta(this);
|
|
4235
4240
|
}
|
|
4236
|
-
}, $ = (
|
|
4237
|
-
|
|
4238
|
-
type: Boolean,
|
|
4241
|
+
}, $ = (no.styles = wa, no);
|
|
4242
|
+
C([S({
|
|
4239
4243
|
reflect: !0,
|
|
4240
|
-
|
|
4241
|
-
})], $.prototype, "
|
|
4244
|
+
converter: oe("auto")
|
|
4245
|
+
})], $.prototype, "resize", void 0), C([S({
|
|
4242
4246
|
type: Boolean,
|
|
4243
4247
|
reflect: !0
|
|
4244
|
-
})], $.prototype, "
|
|
4245
|
-
reflect: !0,
|
|
4246
|
-
converter: se("auto")
|
|
4247
|
-
})], $.prototype, "resize", void 0), S([x({
|
|
4248
|
+
})], $.prototype, "embedded", void 0), C([S({
|
|
4248
4249
|
type: Boolean,
|
|
4249
4250
|
reflect: !0
|
|
4250
|
-
})], $.prototype, "
|
|
4251
|
+
})], $.prototype, "wrap", void 0), C([S({
|
|
4251
4252
|
reflect: !0,
|
|
4252
|
-
converter:
|
|
4253
|
-
})], $.prototype, "syntax", void 0),
|
|
4253
|
+
converter: oe("hidden")
|
|
4254
|
+
})], $.prototype, "syntax", void 0), C([S({
|
|
4254
4255
|
type: Boolean,
|
|
4255
4256
|
reflect: !0
|
|
4256
|
-
})], $.prototype, "annotatable", void 0),
|
|
4257
|
-
|
|
4257
|
+
})], $.prototype, "annotatable", void 0), C([S({
|
|
4258
|
+
type: Boolean,
|
|
4259
|
+
reflect: !0,
|
|
4260
|
+
attribute: "no-spellcheck"
|
|
4261
|
+
})], $.prototype, "noSpellcheck", void 0), C([S({ type: Object })], $.prototype, "translations", void 0), C([S({ attribute: !1 })], $.prototype, "mentionSource", void 0), C([S({ attribute: !1 })], $.prototype, "mentionQuery", void 0), C([S({ attribute: !1 })], $.prototype, "mentionEmptyText", void 0), C([S({ attribute: !1 })], $.prototype, "typeaheads", void 0), C([S({ attribute: !1 })], $.prototype, "annotations", void 0), C([we(".text-editor")], $.prototype, "_container", void 0), C([ie()], $.prototype, "_hasSlottedToolbar", void 0), $ = C([Ce("nldd-text-editor")], $);
|
|
4262
|
+
export { er as DEFAULT_TYPEAHEAD_QUERY, $ as NLDDTextEditor };
|