@nldd/design-system 0.30.0 → 0.31.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 +288 -15
- package/dist/cdn/autoloader.js +139 -139
- package/dist/cdn/chunks/{accordion-DgR70Lf-.js → accordion-D7VeSx-7.js} +4 -4
- package/dist/cdn/chunks/{accordion-item-BDevWF9t.js → accordion-item-DjFnuCY9.js} +6 -6
- package/dist/cdn/chunks/{activity-indicator-B-iqA8XF.js → activity-indicator-nshVcQbZ.js} +7 -7
- package/dist/cdn/chunks/{admonition-PKX7ePb3.js → admonition-BhYcjvcU.js} +6 -6
- package/dist/cdn/chunks/{avatar-Bm_cbn5X.js → avatar-Dw9XZk73.js} +8 -8
- package/dist/cdn/chunks/{avatar-group-5XxwtbbC.js → avatar-group-B0ZliBMF.js} +16 -16
- package/dist/cdn/chunks/{badge-CpxDQfHS.js → badge-2ObEfIYt.js} +7 -7
- package/dist/cdn/chunks/{banner-Ccc9LgDk.js → banner-D9d_367R.js} +9 -9
- package/dist/cdn/chunks/{bar-split-view-0yxggCZe.js → bar-split-view-Cpq5j2Yd.js} +6 -6
- package/dist/cdn/chunks/{blockquote-CmbDjlPB.js → blockquote-M372pBfW.js} +6 -6
- package/dist/cdn/chunks/{box-DQjgR2YI.js → box-bpcNQSk1.js} +4 -4
- package/dist/cdn/chunks/{breadcrumbs-C8yzb9pA.js → breadcrumbs-YBuCnLD2.js} +7 -7
- package/dist/cdn/chunks/{button-D_KfPyHS.js → button-BsJDVMS5.js} +12 -12
- package/dist/cdn/chunks/{button-bar-f-qcw_zA.js → button-bar-C7WBKVht.js} +5 -5
- package/dist/cdn/chunks/{button-group-Dq3q44jB.js → button-group-D3zUCJnu.js} +4 -4
- package/dist/cdn/chunks/{card-CDT7nkKG.js → card-BY2Fz35J.js} +5 -5
- package/dist/cdn/chunks/{cell-B7ksoCyd.js → cell-DfQcb8oJ.js} +8 -8
- package/dist/cdn/chunks/{checkbox-CUReiYVg.js → checkbox-BurSrNRq.js} +7 -7
- package/dist/cdn/chunks/{checkbox-field-CkQ8WLSq.js → checkbox-field-jcCJRers.js} +9 -9
- package/dist/cdn/chunks/{checkbox-group-BpDzGuFk.js → checkbox-group--6ifWQ_F.js} +3 -3
- package/dist/cdn/chunks/{class-map-BQWXee9F.js → class-map-pfTGN6Lt.js} +1 -1
- package/dist/cdn/chunks/{code-editor-CwLcukqn.js → code-editor-D6xQxxSm.js} +14 -14
- package/dist/cdn/chunks/{code-viewer-CvSF5fyg.js → code-viewer-CsO0Hzkz.js} +40 -40
- package/dist/cdn/chunks/{codemirror-input-CcaHTu9u.js → codemirror-input-Bu7mes2L.js} +328 -329
- package/dist/cdn/chunks/{collection-DqqkdrVS.js → collection-CLD0J381.js} +9 -9
- package/dist/cdn/chunks/{combo-box-BQ9jS1fP.js → combo-box-cC87aRbF.js} +12 -10
- package/dist/cdn/chunks/{container-BC5PiMvR.js → container-Dcd-wtk5.js} +5 -5
- package/dist/cdn/chunks/{custom-element-DGdiDiuN.js → custom-element-BPzCecdN.js} +1 -1
- package/dist/cdn/chunks/{date-field-Dmli_GlI.js → date-field-CfIXnk2K.js} +15 -13
- package/dist/cdn/chunks/{date-picker-BCHBh6vd.js → date-picker-D4W0Be1y.js} +13 -13
- package/dist/cdn/chunks/{decorate-D2snH_th.js → decorate-CNSW3HVY.js} +10 -12
- package/dist/cdn/chunks/{described-by-mixin-Doan1yj6.js → described-by-mixin-BNEosRlm.js} +2 -2
- package/dist/cdn/chunks/{description-cell-QL0CUcxH.js → description-cell-3zl0cEJE.js} +8 -8
- package/dist/cdn/chunks/{dev-checks-BQsZ10CZ.js → dev-checks-sh4nGzvD.js} +2 -2
- package/dist/cdn/chunks/{directive-helpers-BtIbEaBv.js → directive-helpers-C8_pU38P.js} +1 -1
- package/dist/cdn/chunks/{dist-CeovKDYB.js → dist-BA1lxpkp.js} +41 -42
- package/dist/cdn/chunks/{dist-Dj0pXI2B.js → dist-BMreXo8L.js} +33 -34
- package/dist/cdn/chunks/{dist-CUCs0edm.js → dist-BQhMIRwq.js} +103 -104
- package/dist/cdn/chunks/{dist-0sEOO4c9.js → dist-BwkztXx2.js} +337 -338
- package/dist/cdn/chunks/{dist-DizTxYTi.js → dist-C0eqMXKG.js} +9 -10
- package/dist/cdn/chunks/{dist-3C80SZN9.js → dist-CYoggrc-.js} +100 -101
- package/dist/cdn/chunks/{dist-QheJD595.js → dist-D8GVh7JF.js} +103 -103
- package/dist/cdn/chunks/{dist-BTUxFM2V.js → dist-DHJOmDf7.js} +1 -1
- package/dist/cdn/chunks/{dist-Dtn2rsM6.js → dist-DosCjwbX.js} +10 -11
- package/dist/cdn/chunks/{dist-CJ-hLN4o.js → dist-Du5XeaUH.js} +80 -81
- package/dist/cdn/chunks/{dist-BX-aE56q.js → dist-DwGJ42jg.js} +13 -14
- package/dist/cdn/chunks/{dist-DM49yEzE.js → dist-DzvZLbav.js} +37 -38
- package/dist/cdn/chunks/{dist-CoM5yDHD.js → dist-UPMuGK3l.js} +12 -13
- package/dist/cdn/chunks/{divider-D8o0JPE2.js → divider-ja-sWdqK.js} +2 -2
- package/dist/cdn/chunks/{document-tab-bar-BX6UhFBl.js → document-tab-bar-CzlWDPeb.js} +10 -10
- package/dist/cdn/chunks/{dropdown-afozwXVW.js → dropdown-CDnfyMTi.js} +6 -6
- package/dist/cdn/chunks/{file-field-BKhUYcHf.js → file-field-VGbq3duI.js} +16 -16
- package/dist/cdn/chunks/{floating-ui.dom-CB34tcZx.js → floating-ui.dom-DlsknQ4T.js} +3 -3
- package/dist/cdn/chunks/{form-DnZIiX9b.js → form-EDk-AXxW.js} +1 -1
- package/dist/cdn/chunks/{form-actions-Ddg9vIVq.js → form-actions-DJlOHVjC.js} +2 -2
- package/dist/cdn/chunks/{form-associated-mixin-BMQQpMlL.js → form-associated-mixin-BDrjhoXJ.js} +2 -2
- package/dist/cdn/chunks/{form-field-DDBYuAl_.js → form-field-DwfFYaIJ.js} +17 -8
- package/dist/cdn/chunks/{form-section-Co0TM35-.js → form-section-D5pvpU0g.js} +3 -3
- package/dist/cdn/chunks/{full-bleed-section-DD8ibmsa.js → full-bleed-section-B2lrxacX.js} +4 -4
- package/dist/cdn/chunks/{hero-BYrY2MZc.js → hero-8OBYFEcb.js} +5 -5
- package/dist/cdn/chunks/{icon-BzeHXcdi.js → icon-DZh6I8EN.js} +4 -4
- package/dist/cdn/chunks/{icon-button-BErQf42w.js → icon-button-Cfl9Uloz.js} +12 -12
- package/dist/cdn/chunks/{icon-cell-DGIMXKxK.js → icon-cell-BKxm4x3C.js} +8 -7
- package/dist/cdn/chunks/{identity-Cq-WnU6u.js → identity-D6mA_Ysl.js} +10 -10
- package/dist/cdn/chunks/{if-defined-CuY6t6gH.js → if-defined-Laa7Mar_.js} +1 -1
- package/dist/cdn/chunks/{image-BjjyqV0V.js → image-BNQlE_4Z.js} +10 -10
- package/dist/cdn/chunks/{inline-dialog-Bk2G7f5r.js → inline-dialog-5vpq_6bt.js} +10 -10
- package/dist/cdn/chunks/{just-in-time-education-Dxh5DNCy.js → just-in-time-education-C8uCzm2s.js} +7 -7
- package/dist/cdn/chunks/{kanban-BvmtB9D9.js → kanban-_aubAWTm.js} +7 -7
- package/dist/cdn/chunks/{kanban-column-CJ2g7pgA.js → kanban-column-CmitV46A.js} +38 -37
- package/dist/cdn/chunks/{keyboard-shortcut-BV5DFQtT.js → keyboard-shortcut-DY96tl24.js} +5 -5
- package/dist/cdn/chunks/{languages-DJjHEjGl.js → languages-B0lgBg4r.js} +3486 -1841
- package/dist/cdn/chunks/{link-BcukwT5Y.js → link-CEyAJ_y7.js} +7 -7
- package/dist/cdn/chunks/{link-group-Ci1q3uEd.js → link-group-DwnzL75g.js} +3 -3
- package/dist/cdn/chunks/{list-CFFHWUSC.js → list-D-_Z5AED.js} +11 -11
- package/dist/cdn/chunks/{list-item-Bg1NyOXd.js → list-item-BqzGOqJl.js} +7 -7
- package/dist/cdn/chunks/{list-item-segment-DJ8pk08-.js → list-item-segment-Ct876W0e.js} +5 -5
- package/dist/cdn/chunks/{menu-BEjqhn1-.js → menu-BDLqu0jO.js} +13 -13
- package/dist/cdn/chunks/{menu-bar-DkjXy-TE.js → menu-bar-DbCYdFuj.js} +7 -7
- package/dist/cdn/chunks/{menu-bar-item-3cJS29Ey.js → menu-bar-item-CFfcPjci.js} +7 -7
- package/dist/cdn/chunks/{menu-divider-CYmEimsb.js → menu-divider-DTzCjHnW.js} +4 -4
- package/dist/cdn/chunks/{menu-group-ggwAcgis.js → menu-group-rYPRHllx.js} +6 -6
- package/dist/cdn/chunks/{menu-item-BzH9H87h.js → menu-item-CjzoSHHj.js} +6 -6
- package/dist/cdn/chunks/{menu.template-PG82-P20.js → menu.template-D7dG2HRa.js} +10 -7
- package/dist/cdn/chunks/{modal-dialog-Bu7ETELf.js → modal-dialog-Cjn3EHfN.js} +5 -5
- package/dist/cdn/chunks/{multi-line-text-field-CQTKNBN7.js → multi-line-text-field-B8DstPYy.js} +9 -7
- package/dist/cdn/chunks/{navigation-split-view-elMoUjHh.js → navigation-split-view-BHM4b_Gb.js} +5 -5
- package/dist/cdn/chunks/{nl.generated-Lu29XEF3.js → nl.generated-Bu83qDco.js} +2 -2
- package/dist/cdn/chunks/{notification-DCjXGfbY.js → notification-CieKHgKd.js} +8 -8
- package/dist/cdn/chunks/{number-field-BUQUcG--.js → number-field-CVYaConf.js} +12 -10
- package/dist/cdn/chunks/{one-half-one-half-section-DiGkeUVr.js → one-half-one-half-section-aMdIJ_5N.js} +4 -4
- package/dist/cdn/chunks/{one-third-two-thirds-section-q_AP4qIJ.js → one-third-two-thirds-section-Dalek6lE.js} +4 -4
- package/dist/cdn/chunks/{one-time-code-field-BybS_l6h.js → one-time-code-field-BxkICLRG.js} +19 -14
- package/dist/cdn/chunks/{overflow-menu-Duey_XJs.js → overflow-menu-GR6uppZW.js} +1 -1
- package/dist/cdn/chunks/{page-BrIeWp1b.js → page-C18ixnPr.js} +7 -7
- package/dist/cdn/chunks/{page-footer-DPQg9Qbw.js → page-footer-CP6K-aw-.js} +6 -6
- package/dist/cdn/chunks/{page-section-mixin-B8FbeXaK.js → page-section-mixin-BLPRaUH6.js} +4 -4
- package/dist/cdn/chunks/{pagination-CfLJwflH.js → pagination-YLIq3Jcw.js} +8 -8
- package/dist/cdn/chunks/{password-field-CmoopbNF.js → password-field-CCRqiNHh.js} +12 -10
- package/dist/cdn/chunks/{popover-CPAR4N_a.js → popover-NvRaYQGL.js} +9 -9
- package/dist/cdn/chunks/{progress-bar-vKGXvxfe.js → progress-bar-DS0_RN2t.js} +9 -9
- package/dist/cdn/chunks/{progress-circle-dweisHzt.js → progress-circle-B5zlQKGK.js} +9 -9
- package/dist/cdn/chunks/{radio-button-field-DCrWiVoA.js → radio-button-field-DZ2p1w_S.js} +8 -8
- package/dist/cdn/chunks/{radio-button-DE1K49_2.js → radio-button-gY-u--Id.js} +6 -6
- package/dist/cdn/chunks/{radio-button-group-oLP_1cGy.js → radio-button-group-C0VdrjGz.js} +3 -3
- package/dist/cdn/chunks/{reflect-non-default-Bu3rpCvg.js → reflect-non-default-DUOcGZKf.js} +1 -1
- package/dist/cdn/chunks/{render-marked-BE3kBc1D.js → render-marked-SMLwIKOz.js} +1 -1
- package/dist/cdn/chunks/{reorder-handle-cell-COCN6knt.js → reorder-handle-cell-BfNGWoUb.js} +5 -5
- package/dist/cdn/chunks/{reorder-handle-mixin-CG-KhmuT.js → reorder-handle-mixin-Dy5l6J0C.js} +2 -2
- package/dist/cdn/chunks/{repeat-D69H_dsv.js → repeat-HQymq8gF.js} +2 -2
- package/dist/cdn/chunks/{rich-text-jEyIU58i.js → rich-text-BALF1UpX.js} +4 -4
- package/dist/cdn/chunks/{rolldown-runtime-CGnMp29N.js → rolldown-runtime-BMBA7GOT.js} +2 -2
- package/dist/cdn/chunks/{row-header-mixin-BejxhOCs.js → row-header-mixin-De75PIGu.js} +2 -2
- package/dist/cdn/chunks/{scroll-fade-Cae9xqXr.js → scroll-fade-Bj7GnOWo.js} +2 -2
- package/dist/cdn/chunks/{search-field-B8woxFh-.js → search-field-DP7e4bm8.js} +13 -11
- package/dist/cdn/chunks/{segmented-control-DbOi6Wk6.js → segmented-control-BXtb8I7v.js} +8 -8
- package/dist/cdn/chunks/{shadow-resets-CNmJbdJw.js → shadow-resets-CF-vkJJ8.js} +2 -2
- package/dist/cdn/chunks/{sheet-bK663_K4.js → sheet-Beykq5Xb.js} +4 -4
- package/dist/cdn/chunks/{shell-DLu1fHOH.js → shell-CTGO74H-.js} +4 -4
- package/dist/cdn/chunks/{side-by-side-split-view-vNhUmTiE.js → side-by-side-split-view-BZlxFAIM.js} +6 -6
- package/dist/cdn/chunks/{sidebar-section-CoE5F_h5.js → sidebar-section-CsODVvuK.js} +9 -9
- package/dist/cdn/chunks/{simple-section-1v7a_ZgI.js → simple-section-9pgvujZx.js} +4 -4
- package/dist/cdn/chunks/{skip-link-C6B6mMkA.js → skip-link-qdhDQoe7.js} +6 -6
- package/dist/cdn/chunks/{slider-BT-q6SP2.js → slider-CR_O2nPE.js} +10 -10
- package/dist/cdn/chunks/{spacer-DlFn3NtV.js → spacer-DbZEWOe2.js} +4 -4
- package/dist/cdn/chunks/{spacer-cell-Dy_twSDQ.js → spacer-cell-BnDgG-8g.js} +6 -6
- package/dist/cdn/chunks/{split-button-URHM5eTx.js → split-button-rY9ZZF4m.js} +8 -8
- package/dist/cdn/chunks/{split-view-divider-DeLyeDBx.js → split-view-divider-CXsR2koZ.js} +4 -4
- package/dist/cdn/chunks/{stacked-split-view-D0kiQJmL.js → stacked-split-view-CA97yLNG.js} +6 -6
- package/dist/cdn/chunks/{static-html-CAKb1-Ht.js → static-html-CfvOicw5.js} +1 -1
- package/dist/cdn/chunks/{status-bar-Bov-LrPy.js → status-bar-Cg0AkR2_.js} +14 -6
- package/dist/cdn/chunks/{step-bar-BLtsl_S_.js → step-bar-CAF54DmI.js} +7 -7
- package/dist/cdn/chunks/{step-cell-cxM7vhtH.js → step-cell-BfmEAqar.js} +6 -6
- package/dist/cdn/chunks/{stepper-DeIcLT7G.js → stepper-C2oRKeaC.js} +9 -9
- package/dist/cdn/chunks/{style-map-CQX4CmTz.js → style-map-BZRDrOiA.js} +1 -1
- package/dist/cdn/chunks/{swatch-picker-A7AU6Agu.js → swatch-picker-DW07gML2.js} +7 -7
- package/dist/cdn/chunks/{switch-D0UPsKws.js → switch-D3dbZ1J9.js} +8 -8
- package/dist/cdn/chunks/{switch-field-D63lc5C0.js → switch-field-DrP2P8J-.js} +8 -8
- package/dist/cdn/chunks/{tab-bar-CzGSRfKd.js → tab-bar-D0VfxxWN.js} +21 -17
- package/dist/cdn/chunks/tab-bar.i18n-9sChoP56.js +6 -0
- package/dist/cdn/chunks/{table-DfunY2Dn.js → table-CWQWdro8.js} +6 -6
- package/dist/cdn/chunks/{tag-DSWjjDBo.js → tag-Dc2wNx-T.js} +6 -6
- package/dist/cdn/chunks/{term-Bk9cdlCz.js → term-DUIQ5xer.js} +12 -12
- package/dist/cdn/chunks/{text-CDBiVulh.js → text-BGobv84x.js} +5 -5
- package/dist/cdn/chunks/{text-cell-DUOJAXZo.js → text-cell-CGvUJRLw.js} +11 -11
- package/dist/cdn/chunks/{text-editor-BIbYF0AB.js → text-editor-CHsINr20.js} +1308 -904
- package/dist/cdn/chunks/{text-editor.i18n-sJKiRQ4i.js → text-editor.i18n-Cl_BYDwS.js} +2 -1
- package/dist/cdn/chunks/{text-field-CAnQNcXB.js → text-field-CpSGZVmD.js} +9 -7
- package/dist/cdn/chunks/{text-wrap-COu7AY91.js → text-wrap-DHroWilR.js} +2 -2
- package/dist/cdn/chunks/{time-field-xriXgFMl.js → time-field-CJVbIp-l.js} +17 -15
- package/dist/cdn/chunks/{time-picker-D3_KbYUW.js → time-picker-S2rQpNA-.js} +9 -9
- package/dist/cdn/chunks/{title-HPn4c-s5.js → title-DrogO1fi.js} +6 -6
- package/dist/cdn/chunks/{title-cell-BXMZkbXf.js → title-cell-CX_yGWvW.js} +10 -10
- package/dist/cdn/chunks/{toggle-button-DY22KEwY.js → toggle-button-CwVn3pQ-.js} +10 -10
- package/dist/cdn/chunks/{toggle-button-group-DsjZofEG.js → toggle-button-group-BY4GlP2N.js} +3 -3
- package/dist/cdn/chunks/{token-field-CQxSARGi.js → token-field-CgE9PfeW.js} +13 -11
- package/dist/cdn/chunks/{token-DwT2i71b.js → token-vYddtNLa.js} +7 -7
- package/dist/cdn/chunks/{toolbar-CaDvhCqm.js → toolbar-Cl9XcbRF.js} +10 -10
- package/dist/cdn/chunks/{toolbar-item-BDl4ys-w.js → toolbar-item-BQKbNQGY.js} +5 -8
- package/dist/cdn/chunks/{toolbar-title-yGR8Hzhp.js → toolbar-title-Ka7Q_vfZ.js} +5 -5
- package/dist/cdn/chunks/{toolbar.styles-DlyfZkRq.js → toolbar.styles-QMkPXyiR.js} +4 -3
- package/dist/cdn/chunks/{tooltip-BDiYghAz.js → tooltip-BERJsBSV.js} +8 -8
- package/dist/cdn/chunks/{top-navigation-bar-ibsjezN_.js → top-navigation-bar-CJCQf83I.js} +19 -19
- package/dist/cdn/chunks/{top-title-bar-BKdwEZfj.js → top-title-bar-CT4gj9gn.js} +12 -9
- package/dist/cdn/chunks/{two-thirds-one-third-section-DmumCsGo.js → two-thirds-one-third-section-CQwCU61R.js} +4 -4
- package/dist/cdn/chunks/{validation-list-CXcJfvOJ.js → validation-list-3b8a8S3f.js} +5 -5
- package/dist/cdn/chunks/{visibility-mixin-C7s59UlL.js → visibility-mixin-BDaVoR0J.js} +2 -2
- package/dist/cdn/chunks/{visually-hidden-CMzKHcSc.js → visually-hidden-GgT4UkeT.js} +2 -2
- package/dist/cdn/chunks/{window-CSNx5wt1.js → window-BTU1k5p4.js} +5 -5
- package/dist/cdn/chunks/{with-translations-0oyNXfdD.js → with-translations-D3sJ-X8x.js} +3 -3
- package/dist/components/actions/menu/menu.styles.d.ts.map +1 -1
- package/dist/components/actions/menu/menu.styles.js +4 -1
- package/dist/components/actions/menu/menu.styles.js.map +1 -1
- package/dist/components/actions/toolbar/toolbar-item.d.ts.map +1 -1
- package/dist/components/actions/toolbar/toolbar-item.js +1 -7
- package/dist/components/actions/toolbar/toolbar-item.js.map +1 -1
- package/dist/components/actions/toolbar/toolbar.styles.d.ts.map +1 -1
- package/dist/components/actions/toolbar/toolbar.styles.js +1 -0
- package/dist/components/actions/toolbar/toolbar.styles.js.map +1 -1
- package/dist/components/content/identity/identity.d.ts +6 -0
- package/dist/components/content/identity/identity.d.ts.map +1 -1
- package/dist/components/content/identity/identity.js +6 -0
- package/dist/components/content/identity/identity.js.map +1 -1
- package/dist/components/content/identity/identity.styles.js +2 -2
- package/dist/components/content/rich-text/rich-text.d.ts +8 -8
- package/dist/components/content/rich-text/rich-text.js +8 -8
- package/dist/components/forms/form-field/form-field.styles.d.ts.map +1 -1
- package/dist/components/forms/form-field/form-field.styles.js +9 -0
- package/dist/components/forms/form-field/form-field.styles.js.map +1 -1
- package/dist/components/inputs/code-editor/code-editor.styles.js +2 -2
- package/dist/components/inputs/combo-box/combo-box.styles.d.ts.map +1 -1
- package/dist/components/inputs/combo-box/combo-box.styles.js +2 -0
- package/dist/components/inputs/combo-box/combo-box.styles.js.map +1 -1
- package/dist/components/inputs/date-field/date-field.styles.d.ts.map +1 -1
- package/dist/components/inputs/date-field/date-field.styles.js +2 -0
- package/dist/components/inputs/date-field/date-field.styles.js.map +1 -1
- package/dist/components/inputs/multi-line-text-field/multi-line-text-field.styles.d.ts.map +1 -1
- package/dist/components/inputs/multi-line-text-field/multi-line-text-field.styles.js +2 -0
- package/dist/components/inputs/multi-line-text-field/multi-line-text-field.styles.js.map +1 -1
- package/dist/components/inputs/number-field/number-field.styles.d.ts.map +1 -1
- package/dist/components/inputs/number-field/number-field.styles.js +2 -0
- package/dist/components/inputs/number-field/number-field.styles.js.map +1 -1
- package/dist/components/inputs/one-time-code-field/one-time-code-field.d.ts +5 -2
- 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 +10 -4
- package/dist/components/inputs/one-time-code-field/one-time-code-field.js.map +1 -1
- package/dist/components/inputs/one-time-code-field/one-time-code-field.styles.d.ts.map +1 -1
- package/dist/components/inputs/one-time-code-field/one-time-code-field.styles.js +4 -3
- package/dist/components/inputs/one-time-code-field/one-time-code-field.styles.js.map +1 -1
- package/dist/components/inputs/password-field/password-field.styles.d.ts.map +1 -1
- package/dist/components/inputs/password-field/password-field.styles.js +2 -0
- package/dist/components/inputs/password-field/password-field.styles.js.map +1 -1
- package/dist/components/inputs/search-field/search-field.styles.d.ts.map +1 -1
- package/dist/components/inputs/search-field/search-field.styles.js +2 -0
- package/dist/components/inputs/search-field/search-field.styles.js.map +1 -1
- package/dist/components/inputs/switch/switch.styles.js +1 -1
- package/dist/components/inputs/text-editor/text-editor.annotation-sentinels.d.ts +2 -1
- package/dist/components/inputs/text-editor/text-editor.annotation-sentinels.d.ts.map +1 -1
- package/dist/components/inputs/text-editor/text-editor.annotation-sentinels.js +9 -7
- package/dist/components/inputs/text-editor/text-editor.annotation-sentinels.js.map +1 -1
- package/dist/components/inputs/text-editor/text-editor.commands.d.ts +1 -0
- package/dist/components/inputs/text-editor/text-editor.commands.d.ts.map +1 -1
- package/dist/components/inputs/text-editor/text-editor.commands.js +2 -0
- package/dist/components/inputs/text-editor/text-editor.commands.js.map +1 -1
- package/dist/components/inputs/text-editor/text-editor.d.ts +12 -2
- package/dist/components/inputs/text-editor/text-editor.d.ts.map +1 -1
- package/dist/components/inputs/text-editor/text-editor.emphasis.d.ts.map +1 -1
- package/dist/components/inputs/text-editor/text-editor.emphasis.js +6 -0
- package/dist/components/inputs/text-editor/text-editor.emphasis.js.map +1 -1
- package/dist/components/inputs/text-editor/text-editor.focus.d.ts +13 -0
- package/dist/components/inputs/text-editor/text-editor.focus.d.ts.map +1 -0
- package/dist/components/inputs/text-editor/text-editor.focus.js +54 -0
- package/dist/components/inputs/text-editor/text-editor.focus.js.map +1 -0
- package/dist/components/inputs/text-editor/text-editor.hidden-syntax.d.ts +1 -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 +14 -5
- package/dist/components/inputs/text-editor/text-editor.hidden-syntax.js.map +1 -1
- package/dist/components/inputs/text-editor/text-editor.highlight.d.ts +3 -0
- package/dist/components/inputs/text-editor/text-editor.highlight.d.ts.map +1 -0
- package/dist/components/inputs/text-editor/text-editor.highlight.js +28 -0
- package/dist/components/inputs/text-editor/text-editor.highlight.js.map +1 -0
- package/dist/components/inputs/text-editor/text-editor.i18n.d.ts +1 -0
- package/dist/components/inputs/text-editor/text-editor.i18n.d.ts.map +1 -1
- package/dist/components/inputs/text-editor/text-editor.i18n.js +3 -0
- package/dist/components/inputs/text-editor/text-editor.i18n.js.map +1 -1
- package/dist/components/inputs/text-editor/text-editor.js +67 -6
- package/dist/components/inputs/text-editor/text-editor.js.map +1 -1
- package/dist/components/inputs/text-editor/text-editor.link-destination.d.ts +22 -0
- package/dist/components/inputs/text-editor/text-editor.link-destination.d.ts.map +1 -0
- package/dist/components/inputs/text-editor/text-editor.link-destination.js +134 -0
- package/dist/components/inputs/text-editor/text-editor.link-destination.js.map +1 -0
- package/dist/components/inputs/text-editor/text-editor.links.d.ts +14 -0
- package/dist/components/inputs/text-editor/text-editor.links.d.ts.map +1 -1
- package/dist/components/inputs/text-editor/text-editor.links.js +41 -12
- package/dist/components/inputs/text-editor/text-editor.links.js.map +1 -1
- package/dist/components/inputs/text-editor/text-editor.list-input.d.ts.map +1 -1
- package/dist/components/inputs/text-editor/text-editor.list-input.js +35 -1
- package/dist/components/inputs/text-editor/text-editor.list-input.js.map +1 -1
- package/dist/components/inputs/text-editor/text-editor.markdown.d.ts.map +1 -1
- package/dist/components/inputs/text-editor/text-editor.markdown.js +18 -2
- package/dist/components/inputs/text-editor/text-editor.markdown.js.map +1 -1
- package/dist/components/inputs/text-editor/text-editor.mention.d.ts.map +1 -1
- package/dist/components/inputs/text-editor/text-editor.mention.js +7 -1
- package/dist/components/inputs/text-editor/text-editor.mention.js.map +1 -1
- package/dist/components/inputs/text-editor/text-editor.mentions.d.ts +6 -2
- package/dist/components/inputs/text-editor/text-editor.mentions.d.ts.map +1 -1
- package/dist/components/inputs/text-editor/text-editor.mentions.js +6 -3
- package/dist/components/inputs/text-editor/text-editor.mentions.js.map +1 -1
- package/dist/components/inputs/text-editor/text-editor.styles.d.ts.map +1 -1
- package/dist/components/inputs/text-editor/text-editor.styles.js +116 -12
- package/dist/components/inputs/text-editor/text-editor.styles.js.map +1 -1
- package/dist/components/inputs/text-editor/text-editor.toolbar.d.ts.map +1 -1
- package/dist/components/inputs/text-editor/text-editor.toolbar.js +14 -2
- package/dist/components/inputs/text-editor/text-editor.toolbar.js.map +1 -1
- package/dist/components/inputs/text-editor/text-editor.variables.d.ts +20 -0
- package/dist/components/inputs/text-editor/text-editor.variables.d.ts.map +1 -0
- package/dist/components/inputs/text-editor/text-editor.variables.js +148 -0
- package/dist/components/inputs/text-editor/text-editor.variables.js.map +1 -0
- package/dist/components/inputs/text-field/text-field.styles.d.ts.map +1 -1
- package/dist/components/inputs/text-field/text-field.styles.js +2 -0
- package/dist/components/inputs/text-field/text-field.styles.js.map +1 -1
- package/dist/components/inputs/time-field/time-field.styles.d.ts.map +1 -1
- package/dist/components/inputs/time-field/time-field.styles.js +2 -0
- package/dist/components/inputs/time-field/time-field.styles.js.map +1 -1
- package/dist/components/inputs/token-field/token-field.styles.d.ts.map +1 -1
- package/dist/components/inputs/token-field/token-field.styles.js +2 -0
- package/dist/components/inputs/token-field/token-field.styles.js.map +1 -1
- package/dist/components/layout/split-views/bar-split-view/bar-split-view.d.ts +1 -0
- package/dist/components/layout/split-views/bar-split-view/bar-split-view.d.ts.map +1 -1
- package/dist/components/layout/split-views/bar-split-view/bar-split-view.js +1 -0
- package/dist/components/layout/split-views/bar-split-view/bar-split-view.js.map +1 -1
- package/dist/components/lists-and-tables/cells/icon-cell/icon-cell.styles.d.ts.map +1 -1
- package/dist/components/lists-and-tables/cells/icon-cell/icon-cell.styles.js +2 -1
- package/dist/components/lists-and-tables/cells/icon-cell/icon-cell.styles.js.map +1 -1
- package/dist/components/navigation/tab-bar/tab-bar.d.ts +8 -0
- package/dist/components/navigation/tab-bar/tab-bar.d.ts.map +1 -1
- package/dist/components/navigation/tab-bar/tab-bar.i18n.d.ts +1 -0
- package/dist/components/navigation/tab-bar/tab-bar.i18n.d.ts.map +1 -1
- package/dist/components/navigation/tab-bar/tab-bar.i18n.js +1 -0
- package/dist/components/navigation/tab-bar/tab-bar.i18n.js.map +1 -1
- package/dist/components/navigation/tab-bar/tab-bar.js +16 -0
- package/dist/components/navigation/tab-bar/tab-bar.js.map +1 -1
- package/dist/components/navigation/tab-bar/tab-bar.template.d.ts.map +1 -1
- package/dist/components/navigation/tab-bar/tab-bar.template.js +3 -2
- package/dist/components/navigation/tab-bar/tab-bar.template.js.map +1 -1
- package/dist/components/navigation/top-title-bar/top-title-bar.d.ts +1 -0
- 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 +6 -1
- package/dist/components/navigation/top-title-bar/top-title-bar.js.map +1 -1
- package/dist/components/status-and-feedback/status-bar/status-bar.d.ts +12 -6
- 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 +28 -7
- package/dist/components/status-and-feedback/status-bar/status-bar.js.map +1 -1
- package/dist/css/rich-text.css +5 -0
- package/dist/css/themes/donkergeel.css +5 -6
- package/dist/css/themes/geel.css +5 -6
- package/dist/css/themes.css +10 -12
- package/dist/css/variables.css +2 -6
- package/dist/nldd.min.js +1852 -1714
- 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/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 +8 -8
- package/dist/types/vue.d.ts +10 -8
- package/dist/utilities/dev-rules.generated.js +1 -1
- package/dist/utilities/dev-rules.generated.js.map +1 -1
- package/dist/utilities/reflect-non-default.d.ts +2 -1
- package/dist/utilities/reflect-non-default.d.ts.map +1 -1
- package/dist/utilities/reflect-non-default.js +3 -2
- package/dist/utilities/reflect-non-default.js.map +1 -1
- package/lint/data.generated.json +1 -1
- package/package.json +6 -6
- package/dist/cdn/chunks/style-mod-DGMhzWuk.js +0 -1583
- package/dist/cdn/chunks/tab-bar.i18n-Crsc7ShA.js +0 -3
|
@@ -1,49 +1,49 @@
|
|
|
1
|
-
import { $ as e,
|
|
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 "./tooltip-
|
|
10
|
-
import { a as
|
|
11
|
-
import "./avatar-
|
|
12
|
-
import { o as
|
|
13
|
-
import { s as
|
|
14
|
-
import { t as
|
|
15
|
-
import { t as
|
|
16
|
-
import { r as
|
|
1
|
+
import { $ as e, A as t, F as n, I as r, J as i, L as a, M as o, P as s, R as c, U as l, W as u, X as d, Y as f, a as p, ct as m, dt as h, et as g, g as _, it as v, k as y, lt as b, n as ee, nt as x, ot as te, r as ne, tt as re, z as ie } from "./languages-B0lgBg4r.js";
|
|
2
|
+
import { n as ae, r as S, s as oe } from "./custom-element-BPzCecdN.js";
|
|
3
|
+
import { t as se } from "./reflect-non-default-DUOcGZKf.js";
|
|
4
|
+
import { a as ce, c as le, d as ue, f as de, i as fe, l as pe, n as me, o as he, r as ge, s as _e, t as ve, u as ye } from "./codemirror-input-Bu7mes2L.js";
|
|
5
|
+
import { a as be, i as xe, r as Se, t as Ce } from "./dist-BwkztXx2.js";
|
|
6
|
+
import { t as we } from "./custom-element-BW8Ua4c7.js";
|
|
7
|
+
import { t as Te } from "./query-ChDzi9FQ.js";
|
|
8
|
+
import "./icon-DZh6I8EN.js";
|
|
9
|
+
import "./tooltip-BERJsBSV.js";
|
|
10
|
+
import { a as Ee, c as De, i as Oe, n as ke } from "./dist-D8GVh7JF.js";
|
|
11
|
+
import "./avatar-Dw9XZk73.js";
|
|
12
|
+
import { o as Ae, t as C } from "./decorate-CNSW3HVY.js";
|
|
13
|
+
import { s as je, t as Me } from "./shadow-resets-CF-vkJJ8.js";
|
|
14
|
+
import { t as Ne } from "./text-editor.i18n-Cl_BYDwS.js";
|
|
15
|
+
import { t as Pe } from "./with-translations-D3sJ-X8x.js";
|
|
16
|
+
import { r as Fe } from "./element-state-D-J_cHEV.js";
|
|
17
17
|
// src/components/inputs/text-editor/text-editor.labels.ts
|
|
18
|
-
var
|
|
18
|
+
var w = m.define();
|
|
19
19
|
// src/components/inputs/text-editor/text-editor.syntax.ts
|
|
20
20
|
function T(e, t, n, r) {
|
|
21
|
-
for (let i =
|
|
21
|
+
for (let i = y(e).resolveInner(t, n); i; i = i.parent) if (r(i)) return i;
|
|
22
22
|
return null;
|
|
23
23
|
}
|
|
24
|
-
var
|
|
25
|
-
function
|
|
26
|
-
return
|
|
24
|
+
var Ie = /* @__PURE__ */ new Set(["FencedCode", "CodeBlock"]), Le = /* @__PURE__ */ new Set([...Ie, "InlineCode"]);
|
|
25
|
+
function Re(e, t) {
|
|
26
|
+
return D(e, t, 1, Ie) !== null;
|
|
27
27
|
}
|
|
28
|
-
function
|
|
29
|
-
return
|
|
28
|
+
function ze(e, t) {
|
|
29
|
+
return D(e, t, 1, Le) !== null;
|
|
30
30
|
}
|
|
31
|
-
function
|
|
31
|
+
function Be(e, t, n, r) {
|
|
32
32
|
for (let i = t; i <= n;) {
|
|
33
33
|
let t = e.doc.lineAt(i);
|
|
34
34
|
r(t.from), i = t.to + 1;
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
|
-
function
|
|
38
|
-
return
|
|
37
|
+
function E(e, t) {
|
|
38
|
+
return y(e) !== y(t);
|
|
39
39
|
}
|
|
40
|
-
function
|
|
41
|
-
return
|
|
40
|
+
function Ve(e, t) {
|
|
41
|
+
return D(e, t, 1, "HorizontalRule") !== null;
|
|
42
42
|
}
|
|
43
|
-
function
|
|
43
|
+
function D(e, t, n, r) {
|
|
44
44
|
return T(e, t, n, typeof r == "string" ? (e) => e.name === r : (e) => r.has(e.name));
|
|
45
45
|
}
|
|
46
|
-
function
|
|
46
|
+
function He(e) {
|
|
47
47
|
let t = [];
|
|
48
48
|
for (let n = e.firstChild; n; n = n.nextSibling) n.name === "LinkMark" && t.push(n);
|
|
49
49
|
if (t.length < 2) return null;
|
|
@@ -54,35 +54,35 @@ function ze(e) {
|
|
|
54
54
|
} : null;
|
|
55
55
|
}
|
|
56
56
|
// src/components/inputs/text-editor/text-editor.mention.ts
|
|
57
|
-
var
|
|
58
|
-
function
|
|
59
|
-
return `[@${e.text.replace(/[[\]\\]/g, (e) => "\\" + e)}](${
|
|
57
|
+
var Ue = "user:";
|
|
58
|
+
function We(e) {
|
|
59
|
+
return `[@${e.text.replace(/[[\]\\]/g, (e) => "\\" + e)}](${Ue}${encodeURIComponent(e.id).replace(/[()<>]/g, (e) => "%" + e.charCodeAt(0).toString(16).toUpperCase())})`;
|
|
60
60
|
}
|
|
61
|
-
function
|
|
62
|
-
return `${
|
|
61
|
+
function Ge(e) {
|
|
62
|
+
return `${We(e)} `;
|
|
63
63
|
}
|
|
64
|
-
function
|
|
64
|
+
function Ke(e) {
|
|
65
65
|
return e.replace(/\\([[\]\\])/g, "$1");
|
|
66
66
|
}
|
|
67
|
-
function
|
|
67
|
+
function qe(e) {
|
|
68
68
|
try {
|
|
69
69
|
return decodeURIComponent(e);
|
|
70
70
|
} catch {
|
|
71
71
|
return e;
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
|
-
var
|
|
75
|
-
function
|
|
76
|
-
return e.startsWith(
|
|
74
|
+
var Je = RegExp(`\\[(@[^\\]]*)\\]\\(${Ue}[^)]*\\)`, "g");
|
|
75
|
+
function Ye(e) {
|
|
76
|
+
return e.startsWith(Ue);
|
|
77
77
|
}
|
|
78
|
-
function
|
|
78
|
+
function O(e, t) {
|
|
79
79
|
let n = t.getChild("URL");
|
|
80
|
-
return n !== null &&
|
|
80
|
+
return n !== null && Ye(e.sliceDoc(n.from, n.to));
|
|
81
81
|
}
|
|
82
|
-
function
|
|
82
|
+
function Xe(e, t, n) {
|
|
83
83
|
return e.from === e.to || e.from > t || e.to < n ? "none" : e.from === t && e.to === n ? "alone" : "within";
|
|
84
84
|
}
|
|
85
|
-
var
|
|
85
|
+
var Ze = class extends r {
|
|
86
86
|
constructor(e, t, n) {
|
|
87
87
|
super(), this.label = e, this.id = t, this.selected = n;
|
|
88
88
|
}
|
|
@@ -95,69 +95,71 @@ var Je = class extends t {
|
|
|
95
95
|
let t = document.createElement("nldd-icon");
|
|
96
96
|
t.className = "cm-md-mention-token-icon", t.setAttribute("icon", "at"), t.setAttribute("aria-hidden", "true");
|
|
97
97
|
let n = document.createElement("span");
|
|
98
|
-
|
|
98
|
+
n.className = "cm-md-mention-token-name", n.dataset.label = this.label, n.setAttribute("aria-hidden", "true");
|
|
99
|
+
let r = document.createElement("span");
|
|
100
|
+
return r.className = "cm-md-token-spoken", r.textContent = `@${this.label}`, e.append(r, t, n), e;
|
|
99
101
|
}
|
|
100
102
|
};
|
|
101
|
-
function
|
|
102
|
-
let
|
|
103
|
-
return
|
|
104
|
-
if (
|
|
105
|
-
if (
|
|
106
|
-
let
|
|
107
|
-
if (!
|
|
108
|
-
let
|
|
109
|
-
if (!
|
|
110
|
-
let
|
|
111
|
-
|
|
112
|
-
} }),
|
|
113
|
-
}
|
|
114
|
-
function
|
|
103
|
+
function Qe(e) {
|
|
104
|
+
let n = [], r = e.selection.main;
|
|
105
|
+
return y(e).iterate({ enter: (i) => {
|
|
106
|
+
if (Le.has(i.name)) return !1;
|
|
107
|
+
if (i.name !== "Link") return;
|
|
108
|
+
let a = i.node, o = a.getChild("URL");
|
|
109
|
+
if (!o || !O(e, a)) return;
|
|
110
|
+
let s = He(a);
|
|
111
|
+
if (!s) return;
|
|
112
|
+
let c = Ke(e.sliceDoc(s.from, s.to).replace(/^@/, "")), l = qe(e.sliceDoc(o.from, o.to).slice(5)), u = Xe(r, a.from, a.to);
|
|
113
|
+
n.push(t.replace({ widget: new Ze(c, l, u) }).range(a.from, a.to));
|
|
114
|
+
} }), t.set(n, !0);
|
|
115
|
+
}
|
|
116
|
+
function $e(e, t, n) {
|
|
115
117
|
let r = !1;
|
|
116
118
|
return e.between(0, 1e9, (e, i) => {
|
|
117
|
-
if (
|
|
119
|
+
if (Xe(t, e, i) !== Xe(n, e, i)) return r = !0, !1;
|
|
118
120
|
}), r;
|
|
119
121
|
}
|
|
120
|
-
var
|
|
121
|
-
create: (e) =>
|
|
122
|
-
update: (e, t) => t.docChanged ||
|
|
123
|
-
provide: (e) =>
|
|
124
|
-
}),
|
|
125
|
-
function
|
|
126
|
-
return T(e, t, n, (t) => t.name === "Link" &&
|
|
122
|
+
var et = b.define({
|
|
123
|
+
create: (e) => Qe(e),
|
|
124
|
+
update: (e, t) => t.docChanged || E(t.startState, t.state) ? Qe(t.state) : t.startState.selection.eq(t.state.selection) ? e : $e(e, t.startState.selection.main, t.state.selection.main) ? Qe(t.state) : e,
|
|
125
|
+
provide: (e) => o.decorations.from(e)
|
|
126
|
+
}), tt = o.atomicRanges.of((e) => e.state.field(et, !1) ?? t.none), nt = [v.highest(et), tt];
|
|
127
|
+
function rt(e, t, n) {
|
|
128
|
+
return T(e, t, n, (t) => t.name === "Link" && O(e, t));
|
|
127
129
|
}
|
|
128
|
-
function
|
|
129
|
-
let n =
|
|
130
|
+
function it(e, t) {
|
|
131
|
+
let n = rt(e, t, 1);
|
|
130
132
|
return n ? {
|
|
131
133
|
from: n.from,
|
|
132
134
|
to: n.to
|
|
133
135
|
} : null;
|
|
134
136
|
}
|
|
135
|
-
function
|
|
136
|
-
let n =
|
|
137
|
+
function at(e, t) {
|
|
138
|
+
let n = rt(e, t, -1);
|
|
137
139
|
return n && n.to === t ? {
|
|
138
140
|
from: n.from,
|
|
139
141
|
to: n.to
|
|
140
142
|
} : null;
|
|
141
143
|
}
|
|
142
|
-
function
|
|
143
|
-
let n =
|
|
144
|
+
function ot(e, t) {
|
|
145
|
+
let n = rt(e, t, 1);
|
|
144
146
|
return n && n.from === t ? {
|
|
145
147
|
from: n.from,
|
|
146
148
|
to: n.to
|
|
147
149
|
} : null;
|
|
148
150
|
}
|
|
149
|
-
function
|
|
151
|
+
function st(e, t) {
|
|
150
152
|
let n = e.state.selection.main;
|
|
151
153
|
if (!n.empty) return !1;
|
|
152
|
-
let r = t < 0 ?
|
|
154
|
+
let r = t < 0 ? at(e.state, n.head) : ot(e.state, n.head);
|
|
153
155
|
return r ? (e.dispatch({ selection: {
|
|
154
156
|
anchor: r.from,
|
|
155
157
|
head: r.to
|
|
156
158
|
} }), !0) : !1;
|
|
157
159
|
}
|
|
158
160
|
// src/components/inputs/text-editor/text-editor.caret.ts
|
|
159
|
-
function
|
|
160
|
-
let t =
|
|
161
|
+
function ct(e) {
|
|
162
|
+
let t = o.findFromDOM(e);
|
|
161
163
|
if (!t) return null;
|
|
162
164
|
let n = t.posAtDOM(e);
|
|
163
165
|
if (n <= t.state.doc.lineAt(n).from) return null;
|
|
@@ -171,11 +173,43 @@ function at(e) {
|
|
|
171
173
|
return null;
|
|
172
174
|
}
|
|
173
175
|
}
|
|
176
|
+
// src/components/inputs/text-editor/text-editor.focus.ts
|
|
177
|
+
var k = m.define(), lt = b.define({
|
|
178
|
+
create: () => !1,
|
|
179
|
+
update(e, t) {
|
|
180
|
+
for (let e of t.effects) if (e.is(k)) return e.value;
|
|
181
|
+
return e;
|
|
182
|
+
}
|
|
183
|
+
}), ut = n.fromClass(class {
|
|
184
|
+
constructor(e) {
|
|
185
|
+
this.view = e, this.pending = !1, this.destroyed = !1;
|
|
186
|
+
}
|
|
187
|
+
update(e) {
|
|
188
|
+
this.pending || e.view.hasFocus === ft(e.state) || (this.pending = !0, queueMicrotask(() => {
|
|
189
|
+
this.pending = !1;
|
|
190
|
+
let { view: e } = this;
|
|
191
|
+
!this.destroyed && e.hasFocus !== ft(e.state) && e.dispatch({ effects: k.of(e.hasFocus) });
|
|
192
|
+
}));
|
|
193
|
+
}
|
|
194
|
+
destroy() {
|
|
195
|
+
this.destroyed = !0;
|
|
196
|
+
}
|
|
197
|
+
}), dt = [
|
|
198
|
+
lt,
|
|
199
|
+
o.focusChangeEffect.of((e, t) => k.of(t)),
|
|
200
|
+
ut
|
|
201
|
+
];
|
|
202
|
+
function ft(e) {
|
|
203
|
+
return e.field(lt, !1) ?? !0;
|
|
204
|
+
}
|
|
205
|
+
function pt(e) {
|
|
206
|
+
return e.effects.some((e) => e.is(k));
|
|
207
|
+
}
|
|
174
208
|
// src/components/inputs/text-editor/text-editor.tasks.ts
|
|
175
|
-
var
|
|
209
|
+
var mt = x.define({ combine: (e) => e[0] ?? {
|
|
176
210
|
open: () => "Taak, open",
|
|
177
211
|
done: () => "Taak, afgerond"
|
|
178
|
-
} }),
|
|
212
|
+
} }), ht = class extends r {
|
|
179
213
|
constructor(e, t) {
|
|
180
214
|
super(), this.checked = e, this.label = t;
|
|
181
215
|
}
|
|
@@ -194,13 +228,13 @@ var ot = x.define({ combine: (e) => e[0] ?? {
|
|
|
194
228
|
return !1;
|
|
195
229
|
}
|
|
196
230
|
};
|
|
197
|
-
function
|
|
198
|
-
let
|
|
199
|
-
return
|
|
231
|
+
function gt(e, n) {
|
|
232
|
+
let r = e.facet(mt);
|
|
233
|
+
return t.replace({ widget: new ht(n, n ? r.done() : r.open()) });
|
|
200
234
|
}
|
|
201
|
-
function
|
|
235
|
+
function _t(e) {
|
|
202
236
|
let t = [];
|
|
203
|
-
return
|
|
237
|
+
return y(e).iterate({ enter: (n) => {
|
|
204
238
|
if (n.name === "FencedCode" || n.name === "CodeBlock") return !1;
|
|
205
239
|
if (n.name === "TaskMarker") return t.push({
|
|
206
240
|
from: n.from,
|
|
@@ -209,8 +243,8 @@ function lt(e) {
|
|
|
209
243
|
}), !1;
|
|
210
244
|
} }), t;
|
|
211
245
|
}
|
|
212
|
-
function
|
|
213
|
-
let r =
|
|
246
|
+
function vt(e, t, n) {
|
|
247
|
+
let r = _t(e).filter((e) => e.from <= n && e.to >= t);
|
|
214
248
|
if (r.length === 0) return null;
|
|
215
249
|
let i = r.some((e) => !e.checked);
|
|
216
250
|
return r.map((e) => ({
|
|
@@ -219,56 +253,57 @@ function ut(e, t, n) {
|
|
|
219
253
|
insert: i ? "x" : " "
|
|
220
254
|
}));
|
|
221
255
|
}
|
|
222
|
-
function
|
|
256
|
+
function yt(e) {
|
|
223
257
|
let { state: t } = e;
|
|
224
258
|
if (t.readOnly) return !1;
|
|
225
259
|
let n = t.selection.ranges.flatMap((e) => {
|
|
226
260
|
let n = t.doc.lineAt(e.from).from, r = t.doc.lineAt(e.to).to;
|
|
227
|
-
return
|
|
261
|
+
return vt(t, n, r) ?? [];
|
|
228
262
|
});
|
|
229
263
|
return n.length !== 0 && (e.dispatch({
|
|
230
264
|
changes: n,
|
|
231
265
|
userEvent: "input.task"
|
|
232
266
|
}), !0);
|
|
233
267
|
}
|
|
234
|
-
var
|
|
268
|
+
var bt = o.domEventHandlers({ mousedown(e, t) {
|
|
235
269
|
let n = e.target, r = n?.closest?.(".cm-md-task-box") ?? n?.closest?.(".cm-md-listprefix")?.querySelector(":scope > .cm-md-task-box");
|
|
236
270
|
if (!r || e.button !== 0) return !1;
|
|
237
271
|
if (e.preventDefault(), t.state.readOnly) return !0;
|
|
238
|
-
let i = t.posAtDOM(r), a =
|
|
272
|
+
let i = t.posAtDOM(r), a = vt(t.state, i, i);
|
|
239
273
|
return a && t.dispatch({
|
|
240
274
|
changes: a,
|
|
241
275
|
userEvent: "input.task"
|
|
242
276
|
}), !0;
|
|
243
277
|
} });
|
|
244
|
-
function
|
|
278
|
+
function xt(e) {
|
|
245
279
|
return [
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
280
|
+
mt.of(e),
|
|
281
|
+
bt,
|
|
282
|
+
v.high(l.of([{
|
|
249
283
|
key: "Mod-Enter",
|
|
250
|
-
run:
|
|
284
|
+
run: yt
|
|
251
285
|
}]))
|
|
252
286
|
];
|
|
253
287
|
}
|
|
254
288
|
// src/components/inputs/text-editor/text-editor.hidden-syntax.ts
|
|
255
|
-
var
|
|
289
|
+
var St = {
|
|
256
290
|
EmphasisMark: ["Emphasis", "StrongEmphasis"],
|
|
257
291
|
StrikethroughMark: ["Strikethrough"],
|
|
292
|
+
HighlightMark: ["Highlight"],
|
|
258
293
|
CodeMark: ["InlineCode"]
|
|
259
|
-
},
|
|
260
|
-
function
|
|
261
|
-
return
|
|
262
|
-
}
|
|
263
|
-
var
|
|
264
|
-
function
|
|
265
|
-
let
|
|
266
|
-
return
|
|
294
|
+
}, A = t.replace({}), Ct = t.mark({ class: "cm-md-bullet" }), wt = /^(\s*)[-*+]\s+\[[ xX]\](\s+)/, Tt = 2.5, Et = {};
|
|
295
|
+
function Dt(e) {
|
|
296
|
+
return Et[e] ?? (Et[e] = t.line({ attributes: { style: `text-indent:calc(${e} * var(--_text-editor-marker-advance) * -1) !important;padding-left:calc(${e} * var(--_text-editor-marker-advance)) !important` } }));
|
|
297
|
+
}
|
|
298
|
+
var Ot = t.mark({ class: "cm-md-ordinal" }), kt = {};
|
|
299
|
+
function At(e) {
|
|
300
|
+
let n = e.join(",");
|
|
301
|
+
return kt[n] ?? (kt[n] = t.line({
|
|
267
302
|
class: "cm-md-quote-line",
|
|
268
303
|
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
304
|
}));
|
|
270
305
|
}
|
|
271
|
-
var
|
|
306
|
+
var jt = t.mark({ class: "cm-md-quote-mark-hidden" }), Mt = t.mark({ class: "cm-md-quote-gap" }), Nt = t.mark({ class: "cm-md-code-bare" }), Pt = t.mark({ class: "cm-md-highlight-bare" }), Ft = class extends r {
|
|
272
307
|
toDOM() {
|
|
273
308
|
let e = document.createElement("span");
|
|
274
309
|
return e.className = "cm-md-rule", e.setAttribute("aria-hidden", "true"), e;
|
|
@@ -279,31 +314,31 @@ var Ct = v.mark({ class: "cm-md-quote-mark-hidden" }), wt = v.mark({ class: "cm-
|
|
|
279
314
|
ignoreEvent() {
|
|
280
315
|
return !1;
|
|
281
316
|
}
|
|
282
|
-
},
|
|
283
|
-
function
|
|
317
|
+
}, It = t.replace({ widget: new Ft() });
|
|
318
|
+
function Lt(e) {
|
|
284
319
|
let t = e;
|
|
285
320
|
for (let n = e.parent; n; n = n.parent) n.name === "Blockquote" && (t = n);
|
|
286
321
|
return t;
|
|
287
322
|
}
|
|
288
|
-
var
|
|
289
|
-
function
|
|
290
|
-
var
|
|
291
|
-
return
|
|
323
|
+
var Rt = 2, zt = {};
|
|
324
|
+
function Bt(e, n) {
|
|
325
|
+
var r;
|
|
326
|
+
return zt[r = `${e},${n}`] ?? (zt[r] = t.line({ attributes: { style: `text-indent:calc(${e} * var(--_text-editor-marker-advance) * -1) !important;padding-left:calc(${e + n} * var(--_text-editor-marker-advance)) !important` } }));
|
|
292
327
|
}
|
|
293
|
-
function
|
|
328
|
+
function Vt(e, t) {
|
|
294
329
|
let n = /* @__PURE__ */ new Map();
|
|
295
|
-
return
|
|
330
|
+
return y(e).iterate({
|
|
296
331
|
from: t.from,
|
|
297
332
|
to: t.to,
|
|
298
333
|
enter: (t) => {
|
|
299
|
-
t.name === "Blockquote" &&
|
|
334
|
+
t.name === "Blockquote" && Be(e, t.from, t.to, (e) => n.set(e, (n.get(e) ?? 0) + 1));
|
|
300
335
|
}
|
|
301
336
|
}), n;
|
|
302
337
|
}
|
|
303
|
-
function
|
|
338
|
+
function Ht(e, t) {
|
|
304
339
|
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
340
|
}
|
|
306
|
-
function
|
|
341
|
+
function Ut(e, t) {
|
|
307
342
|
let n = [];
|
|
308
343
|
for (let r of t) {
|
|
309
344
|
let t = /^[ ]*/.exec(e.slice(r + 1))[0].length;
|
|
@@ -311,9 +346,9 @@ function Pt(e, t) {
|
|
|
311
346
|
}
|
|
312
347
|
return n;
|
|
313
348
|
}
|
|
314
|
-
function
|
|
349
|
+
function Wt(e, t) {
|
|
315
350
|
let n = /* @__PURE__ */ new Map();
|
|
316
|
-
return
|
|
351
|
+
return y(e).iterate({
|
|
317
352
|
from: t.from,
|
|
318
353
|
to: t.to,
|
|
319
354
|
enter: (t) => {
|
|
@@ -323,101 +358,107 @@ function Ft(e, t) {
|
|
|
323
358
|
}
|
|
324
359
|
}), n;
|
|
325
360
|
}
|
|
326
|
-
function
|
|
327
|
-
return !e.readOnly && e.facet(
|
|
361
|
+
function Gt(e) {
|
|
362
|
+
return !e.readOnly && e.facet(o.editable) && ft(e);
|
|
328
363
|
}
|
|
329
|
-
function
|
|
330
|
-
return
|
|
364
|
+
function Kt(e, t, n) {
|
|
365
|
+
return Gt(e) && e.selection.ranges.some((e) => e.from <= n && e.to >= t);
|
|
331
366
|
}
|
|
332
|
-
var
|
|
367
|
+
var qt = t.replace({ block: !0 }), Jt = t.replace({}), Yt = t.mark({ class: "cm-md-code-language" }), Xt = /* @__PURE__ */ new Set([
|
|
333
368
|
"Document",
|
|
334
369
|
"Blockquote",
|
|
335
370
|
"BulletList",
|
|
336
371
|
"OrderedList",
|
|
337
372
|
"ListItem"
|
|
338
373
|
]);
|
|
339
|
-
function
|
|
340
|
-
let
|
|
341
|
-
return
|
|
342
|
-
if (
|
|
343
|
-
if (
|
|
344
|
-
let r =
|
|
345
|
-
if (e.doc.lineAt(
|
|
346
|
-
let a =
|
|
347
|
-
for (let [e,
|
|
374
|
+
function Zt(e) {
|
|
375
|
+
let n = [];
|
|
376
|
+
return y(e).iterate({ enter: (t) => {
|
|
377
|
+
if (t.name !== "FencedCode") return Xt.has(t.name);
|
|
378
|
+
if (Kt(e, t.from, t.to)) return !1;
|
|
379
|
+
let r = t.node.getChildren("CodeMark").map((t) => e.doc.lineAt(t.from)), i = e.doc.lineAt(t.from).number;
|
|
380
|
+
if (e.doc.lineAt(t.to).number - i + 1 <= r.length) return !1;
|
|
381
|
+
let a = t.node.getChild("CodeInfo"), o = t.node.getChild("CodeMark");
|
|
382
|
+
for (let [e, t] of r.entries()) e === 0 ? (n.push(Jt.range(o.from, a ? a.from : o.to)), a && n.push(Yt.range(a.from, a.to))) : n.push(qt.range(t.from, t.to));
|
|
348
383
|
return !1;
|
|
349
|
-
} }),
|
|
384
|
+
} }), t.set(n, !0);
|
|
350
385
|
}
|
|
351
|
-
function
|
|
386
|
+
function Qt(e) {
|
|
352
387
|
let t = [];
|
|
353
|
-
for (let n of e.selection.ranges)
|
|
388
|
+
for (let n of e.selection.ranges) y(e).iterate({
|
|
354
389
|
from: n.from,
|
|
355
390
|
to: n.to,
|
|
356
|
-
enter: (e) => (e.name === "FencedCode" && t.push(e.from), e.name !== "FencedCode" &&
|
|
391
|
+
enter: (e) => (e.name === "FencedCode" && t.push(e.from), e.name !== "FencedCode" && Xt.has(e.name))
|
|
357
392
|
});
|
|
358
393
|
return t.join(",");
|
|
359
394
|
}
|
|
360
|
-
var
|
|
361
|
-
create:
|
|
362
|
-
update: (e, t) => t.docChanged || t.reconfigured ||
|
|
363
|
-
provide: (e) =>
|
|
395
|
+
var $t = b.define({
|
|
396
|
+
create: Zt,
|
|
397
|
+
update: (e, t) => t.docChanged || t.reconfigured || pt(t) || E(t.startState, t.state) || t.selection && Qt(t.startState) !== Qt(t.state) ? Zt(t.state) : e,
|
|
398
|
+
provide: (e) => o.decorations.from(e)
|
|
364
399
|
});
|
|
365
|
-
function
|
|
366
|
-
let { state:
|
|
367
|
-
for (let { from:
|
|
368
|
-
from:
|
|
400
|
+
function en(e) {
|
|
401
|
+
let { state: n } = e, r = (e, t) => Kt(n, e, t), i = [];
|
|
402
|
+
for (let { from: t, to: a } of e.visibleRanges) y(n).iterate({
|
|
403
|
+
from: t,
|
|
369
404
|
to: a,
|
|
370
405
|
enter: (e) => {
|
|
371
|
-
let
|
|
372
|
-
if (e.name === "HorizontalRule") return
|
|
406
|
+
let t = e.node.parent;
|
|
407
|
+
if (e.name === "HorizontalRule") return r(e.from, e.to) || i.push(It.range(e.from, e.to)), !1;
|
|
373
408
|
if (e.name === "Blockquote") {
|
|
374
|
-
let
|
|
375
|
-
if (
|
|
376
|
-
let a =
|
|
377
|
-
|
|
409
|
+
let t = Lt(e.node);
|
|
410
|
+
if (t !== e.node || r(t.from, t.to)) return;
|
|
411
|
+
let a = Wt(n, t), o = Vt(n, t), s = Ht(n, t), c = [0];
|
|
412
|
+
Be(n, t.from, t.to, (e) => {
|
|
378
413
|
if (e > s) return;
|
|
379
|
-
let
|
|
380
|
-
for (let [t, n] of l)
|
|
381
|
-
let d =
|
|
382
|
-
for (let t of d)
|
|
383
|
-
let f =
|
|
384
|
-
for (; h.length < p;) h.push(h.length ? h[h.length - 1] +
|
|
385
|
-
let g = f.length ? (p - f.length) *
|
|
386
|
-
g > 0 ?
|
|
414
|
+
let t = n.doc.lineAt(e), r = a.get(e) ?? [], l = Ut(t.text, r), u = l.reduce((e, [t, n]) => e + n - t, 0);
|
|
415
|
+
for (let [t, n] of l) i.push(A.range(e + t, e + n));
|
|
416
|
+
let d = r.filter((e) => /[^ \t]/.test(t.text.charAt(e + 1)));
|
|
417
|
+
for (let t of d) i.push(Mt.range(e + t, e + t + 1));
|
|
418
|
+
let f = r.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 = Sr(t.text) - u + d.length, h = (f.length ? f : c).slice(0, p);
|
|
419
|
+
for (; h.length < p;) h.push(h.length ? h[h.length - 1] + Rt : 0);
|
|
420
|
+
let g = f.length ? (p - f.length) * Rt : h[h.length - 1] + Rt;
|
|
421
|
+
g > 0 ? i.push(Bt(m, g).range(e)) : (u || d.length) && i.push(Dt(m).range(e)), i.push(At(h).range(e)), c = h;
|
|
387
422
|
});
|
|
388
|
-
} else if (
|
|
423
|
+
} else if (t) {
|
|
389
424
|
if (e.name === "QuoteMark") {
|
|
390
|
-
let
|
|
391
|
-
|
|
392
|
-
} else if (e.name === "ListMark" && /^[-*+]$/.test(
|
|
393
|
-
let
|
|
394
|
-
if (
|
|
395
|
-
let a =
|
|
425
|
+
let t = Lt(e.node), a = n.sliceDoc(e.to, e.to + 1) === " " ? e.to + 1 : e.to;
|
|
426
|
+
r(t.from, t.to) || i.push(jt.range(e.from, a));
|
|
427
|
+
} else if (e.name === "ListMark" && /^[-*+]$/.test(n.sliceDoc(e.from, e.to)) && /^[ \t]/.test(n.sliceDoc(e.to, e.to + 1))) {
|
|
428
|
+
let t = n.doc.lineAt(e.from);
|
|
429
|
+
if (r(t.from, t.to)) return;
|
|
430
|
+
let a = wt.exec(t.text), o = a && e.node.parent?.getChild("Task")?.getChild("TaskMarker");
|
|
396
431
|
if (a && o) {
|
|
397
|
-
|
|
432
|
+
i.push(Dt(a[1].length + Tt + a[2].length).range(t.from), A.range(e.from, o.from), gt(n, /x/i.test(n.sliceDoc(o.from, o.to))).range(o.from, o.to));
|
|
398
433
|
return;
|
|
399
434
|
}
|
|
400
|
-
|
|
401
|
-
} else if (e.name === "ListMark" && /^\d+[.)]$/.test(
|
|
402
|
-
else if (e.name === "HeaderMark" &&
|
|
403
|
-
let a =
|
|
404
|
-
|
|
435
|
+
i.push(Ct.range(e.from, e.to));
|
|
436
|
+
} else if (e.name === "ListMark" && /^\d+[.)]$/.test(n.sliceDoc(e.from, e.to))) i.push(Ot.range(e.from, e.to));
|
|
437
|
+
else if (e.name === "HeaderMark" && t.name.startsWith("ATXHeading")) {
|
|
438
|
+
let a = n.sliceDoc(e.to, e.to + 1) === " " ? e.to + 1 : e.to;
|
|
439
|
+
r(t.from, t.to) || i.push(A.range(e.from, a));
|
|
405
440
|
} else if (e.name === "Link") {
|
|
406
|
-
let
|
|
407
|
-
if (!
|
|
408
|
-
|
|
409
|
-
} else if (
|
|
410
|
-
|
|
411
|
-
|
|
441
|
+
let t = e.node.getChild("URL"), a = e.node.getChildren("LinkMark");
|
|
442
|
+
if (!t || a.length < 2 || O(n, e.node)) return;
|
|
443
|
+
r(e.from, e.to) || i.push(A.range(a[0].from, a[0].to), A.range(a[1].from, e.to));
|
|
444
|
+
} else if (St[e.name]?.includes(t.name) && !r(t.from, t.to)) {
|
|
445
|
+
if (i.push(A.range(e.from, e.to)), e.name === "CodeMark" && e.from === t.from) {
|
|
446
|
+
let n = t.lastChild;
|
|
447
|
+
n && n.from > e.to && i.push(Nt.range(e.to, n.from));
|
|
448
|
+
}
|
|
449
|
+
if (e.name === "HighlightMark" && e.from === t.from) {
|
|
450
|
+
let n = t.lastChild;
|
|
451
|
+
n && n.name === "HighlightMark" && n.from > e.to && i.push(Pt.range(e.to, n.from));
|
|
452
|
+
}
|
|
412
453
|
}
|
|
413
454
|
}
|
|
414
455
|
}
|
|
415
456
|
});
|
|
416
|
-
return
|
|
457
|
+
return t.set(i, !0);
|
|
417
458
|
}
|
|
418
|
-
var
|
|
459
|
+
var tn = 3, nn = class {
|
|
419
460
|
constructor(e) {
|
|
420
|
-
this.view = e, this.layerObserver = new MutationObserver(() => this.mendSelection()), this.observing = !1, this.checked = "", this.mends = 0, this.decorations =
|
|
461
|
+
this.view = e, this.layerObserver = new MutationObserver(() => this.mendSelection()), this.observing = !1, this.checked = "", this.mends = 0, this.decorations = en(e), queueMicrotask(() => this.observeLayer());
|
|
421
462
|
}
|
|
422
463
|
observeLayer() {
|
|
423
464
|
if (this.observing) return;
|
|
@@ -429,11 +470,11 @@ var Kt = 3, qt = class {
|
|
|
429
470
|
}), this.observing = !0);
|
|
430
471
|
}
|
|
431
472
|
update(e) {
|
|
432
|
-
this.observeLayer(), (e.docChanged || e.selectionSet || e.viewportChanged ||
|
|
473
|
+
this.observeLayer(), (e.docChanged || e.selectionSet || e.viewportChanged || e.transactions.some(pt) || E(e.startState, e.state) || e.transactions.some((e) => e.reconfigured)) && (this.decorations = en(e.view));
|
|
433
474
|
}
|
|
434
475
|
mendSelection() {
|
|
435
476
|
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 >=
|
|
477
|
+
if (i !== this.checked && (this.checked = i, this.mends = 0), r || this.mends >= tn) return;
|
|
437
478
|
let a = e.dom.querySelector(".cm-selectionLayer"), o = a ? [...a.querySelectorAll(".cm-selectionBackground")] : [];
|
|
438
479
|
if (o.length < 2) return;
|
|
439
480
|
let s = e.coordsAtPos(t, 1), c = e.coordsAtPos(n, -1);
|
|
@@ -446,11 +487,11 @@ var Kt = 3, qt = class {
|
|
|
446
487
|
this.layerObserver.disconnect();
|
|
447
488
|
}
|
|
448
489
|
};
|
|
449
|
-
function
|
|
450
|
-
return [
|
|
490
|
+
function rn() {
|
|
491
|
+
return [v.highest(n.fromClass(nn, { decorations: (e) => e.decorations })), $t];
|
|
451
492
|
}
|
|
452
493
|
// src/components/inputs/text-editor/text-editor.links.ts
|
|
453
|
-
var
|
|
494
|
+
var j = x.define({ combine: (e) => e.some(Boolean) }), an = class extends r {
|
|
454
495
|
constructor(e, t, n) {
|
|
455
496
|
super(), this.href = e, this.tooltip = n, this.ariaLabel = t(e);
|
|
456
497
|
}
|
|
@@ -471,7 +512,7 @@ var M = x.define({ combine: (e) => e.some(Boolean) }), Yt = class extends t {
|
|
|
471
512
|
return !0;
|
|
472
513
|
}
|
|
473
514
|
coordsAt(e, t, n) {
|
|
474
|
-
let r = e.getBoundingClientRect(), i =
|
|
515
|
+
let r = e.getBoundingClientRect(), i = ct(e) ?? {
|
|
475
516
|
top: r.top,
|
|
476
517
|
bottom: r.bottom
|
|
477
518
|
}, a = getComputedStyle(e), o = n < 0 ? r.left - parseFloat(a.marginLeft) : r.right + parseFloat(a.marginRight);
|
|
@@ -483,90 +524,96 @@ var M = x.define({ combine: (e) => e.some(Boolean) }), Yt = class extends t {
|
|
|
483
524
|
};
|
|
484
525
|
}
|
|
485
526
|
};
|
|
486
|
-
function
|
|
527
|
+
function on(e) {
|
|
487
528
|
return e.replace(/^\[|\]$/g, "").trim().replace(/\s+/g, " ").toLowerCase();
|
|
488
529
|
}
|
|
489
|
-
function
|
|
530
|
+
function sn(e) {
|
|
490
531
|
let t = /* @__PURE__ */ new Map();
|
|
491
|
-
return
|
|
532
|
+
return y(e).iterate({ enter: (n) => {
|
|
492
533
|
if (n.name !== "LinkReference") return;
|
|
493
534
|
let r = null, i = null;
|
|
494
|
-
for (let t = n.node.firstChild; t; t = t.nextSibling) t.name === "LinkLabel" ? r =
|
|
535
|
+
for (let t = n.node.firstChild; t; t = t.nextSibling) t.name === "LinkLabel" ? r = on(e.sliceDoc(t.from, t.to)) : t.name === "URL" && (i = e.sliceDoc(t.from, t.to));
|
|
495
536
|
r && i && !t.has(r) && t.set(r, i);
|
|
496
537
|
} }), t;
|
|
497
538
|
}
|
|
498
|
-
|
|
539
|
+
var cn = /^(?:localhost|[^\s/?#:@]+\.[^\s/?#:@]+):\d+(?:[/?#]|$)/i, ln = /^[a-z][a-z0-9+.-]*:/i, un = /^[^\s@/?#:]+@[^\s@/?#:]+(?:\?\S*)?$/;
|
|
540
|
+
function dn(e) {
|
|
541
|
+
let t = e.trim();
|
|
542
|
+
return !t || /^(?:[/#?.]|\{\{)/.test(t) ? e : cn.test(t) ? `https://${t}` : ln.test(t) ? e : un.test(t) ? `mailto:${t}` : !/^www\.[^\s@:/?#]/i.test(t) && !/^[^/?#@:\s]*\.(?:\p{L}{2,}|xn--[a-z0-9-]+)(?:[/?#]|$)/iu.test(t) ? e : `https://${t}`;
|
|
543
|
+
}
|
|
544
|
+
function fn(e) {
|
|
499
545
|
let t = e.replace(/[\u0000-\u0020\u007f-\u009f]/g, "");
|
|
500
546
|
return !/^[a-z][a-z0-9+.-]*:/i.test(t) || /^(?:https?|mailto|tel):/i.test(t);
|
|
501
547
|
}
|
|
502
|
-
function
|
|
548
|
+
function pn(e, t, n) {
|
|
503
549
|
let r = null;
|
|
504
550
|
for (let n = t.firstChild; n; n = n.nextSibling) {
|
|
505
551
|
if (n.name === "URL") {
|
|
506
|
-
let t = e.sliceDoc(n.from, n.to);
|
|
507
|
-
return t && !
|
|
552
|
+
let t = dn(e.sliceDoc(n.from, n.to));
|
|
553
|
+
return t && !Ye(t) && fn(t) ? t : null;
|
|
508
554
|
}
|
|
509
|
-
n.name === "LinkLabel" && (r =
|
|
555
|
+
n.name === "LinkLabel" && (r = on(e.sliceDoc(n.from, n.to)));
|
|
510
556
|
}
|
|
511
557
|
if (r) {
|
|
512
|
-
let e = n().get(r);
|
|
513
|
-
return
|
|
558
|
+
let e = n().get(r), t = e && dn(e);
|
|
559
|
+
return t && !Ye(t) && fn(t) ? t : null;
|
|
514
560
|
}
|
|
515
561
|
return null;
|
|
516
562
|
}
|
|
517
|
-
function
|
|
563
|
+
function mn(e) {
|
|
518
564
|
for (let t = e.parent; t; t = t.parent) if (t.name === "Link" || t.name === "LinkReference" || t.name === "Image") return !0;
|
|
519
565
|
return !1;
|
|
520
566
|
}
|
|
521
|
-
function
|
|
567
|
+
function hn(e, t) {
|
|
522
568
|
let n = e.sliceDoc(t.from, t.to);
|
|
523
|
-
if (!n ||
|
|
524
|
-
let r = n;
|
|
525
|
-
return
|
|
569
|
+
if (!n || Ye(n)) return null;
|
|
570
|
+
let r = dn(n);
|
|
571
|
+
return fn(r) ? r : null;
|
|
526
572
|
}
|
|
527
|
-
function
|
|
528
|
-
let
|
|
529
|
-
widget: new
|
|
573
|
+
function gn(e, n) {
|
|
574
|
+
let r = new te(), i = y(e.state), a = null, o = () => a ?? (a = sn(e.state)), s = e.state.facet(j), c = (e, i, a = !1) => r.add(e, e, t.widget({
|
|
575
|
+
widget: new an(i, n, a),
|
|
530
576
|
side: -1
|
|
531
577
|
}));
|
|
532
|
-
for (let { from: t, to: n } of e.visibleRanges)
|
|
578
|
+
for (let { from: t, to: n } of e.visibleRanges) i.iterate({
|
|
533
579
|
from: t,
|
|
534
580
|
to: n,
|
|
535
581
|
enter: (t) => {
|
|
536
582
|
if (t.name === "Link") {
|
|
537
|
-
let n =
|
|
538
|
-
n && c(t.to, n,
|
|
539
|
-
} else if (t.name === "URL" && !
|
|
540
|
-
let n =
|
|
583
|
+
let n = pn(e.state, t.node, o);
|
|
584
|
+
n && c(t.to, n, s && !Kt(e.state, t.from, t.to));
|
|
585
|
+
} else if (t.name === "URL" && !mn(t.node)) {
|
|
586
|
+
let n = hn(e.state, t.node);
|
|
541
587
|
n && c(t.to, n);
|
|
542
588
|
}
|
|
543
589
|
}
|
|
544
590
|
});
|
|
545
|
-
return
|
|
591
|
+
return r.finish();
|
|
546
592
|
}
|
|
547
|
-
function
|
|
548
|
-
return
|
|
593
|
+
function _n(e) {
|
|
594
|
+
return n.fromClass(class {
|
|
549
595
|
constructor(t) {
|
|
550
|
-
this.decorations =
|
|
596
|
+
this.decorations = gn(t, e);
|
|
551
597
|
}
|
|
552
598
|
update(t) {
|
|
553
|
-
(t.docChanged || t.viewportChanged ||
|
|
599
|
+
(t.docChanged || t.viewportChanged || E(t.startState, t.state) || t.transactions.some((e) => e.effects.some((e) => e.is(w))) || t.startState.facet(j) !== t.state.facet(j) || (t.selectionSet || t.focusChanged) && t.state.facet(j)) && (this.decorations = gn(t.view, e));
|
|
554
600
|
}
|
|
555
601
|
}, { decorations: (e) => e.decorations });
|
|
556
602
|
}
|
|
557
|
-
function
|
|
603
|
+
function vn(e, t) {
|
|
558
604
|
let n = null;
|
|
559
|
-
return T(e, t, -1, (r) => r.to === t ? r.name === "Link" ?
|
|
605
|
+
return T(e, t, -1, (r) => r.to === t ? r.name === "Link" ? pn(e, r, () => n ?? (n = sn(e))) !== null : r.name === "URL" && !mn(r) && hn(e, r) !== null : !1) !== null;
|
|
560
606
|
}
|
|
561
|
-
function
|
|
562
|
-
return T(e, t, -1, (n) => n.name === "URL" && n.to === t && !
|
|
607
|
+
function yn(e, t) {
|
|
608
|
+
return T(e, t, -1, (n) => n.name === "URL" && n.to === t && !mn(n) && hn(e, n) !== null) !== null;
|
|
563
609
|
}
|
|
564
610
|
// src/components/inputs/text-editor/text-editor.emphasis.ts
|
|
565
|
-
var
|
|
611
|
+
var bn = /* @__PURE__ */ new Map([
|
|
566
612
|
["StrongEmphasis", "**"],
|
|
567
613
|
["Emphasis", "*"],
|
|
568
|
-
["Strikethrough", "~~"]
|
|
569
|
-
|
|
614
|
+
["Strikethrough", "~~"],
|
|
615
|
+
["Highlight", "=="]
|
|
616
|
+
]), xn = /* @__PURE__ */ new Set([
|
|
570
617
|
"Paragraph",
|
|
571
618
|
"ATXHeading1",
|
|
572
619
|
"ATXHeading2",
|
|
@@ -577,21 +624,21 @@ var sn = /* @__PURE__ */ new Map([
|
|
|
577
624
|
"SetextHeading1",
|
|
578
625
|
"SetextHeading2",
|
|
579
626
|
"TableCell"
|
|
580
|
-
]),
|
|
627
|
+
]), Sn = /^\s*(?:\n\s*(?:(?:[-*+]|\d+[.)]|>|\[[ xX]\])\s*)*)*$/, Cn = m.define({ map: (e, t) => ({
|
|
581
628
|
...e,
|
|
582
629
|
from: t.mapPos(e.from, 1),
|
|
583
630
|
to: t.mapPos(e.to, -1)
|
|
584
631
|
}) });
|
|
585
|
-
function
|
|
586
|
-
return T(e, t, n, (e) =>
|
|
632
|
+
function wn(e, t, n) {
|
|
633
|
+
return T(e, t, n, (e) => bn.has(e.name));
|
|
587
634
|
}
|
|
588
|
-
function
|
|
589
|
-
return
|
|
635
|
+
function Tn(e, t) {
|
|
636
|
+
return D(e, t, 1, xn);
|
|
590
637
|
}
|
|
591
|
-
function
|
|
592
|
-
let { from: t, to: n } = e.selection.main, r =
|
|
638
|
+
function En(e) {
|
|
639
|
+
let { from: t, to: n } = e.selection.main, r = wn(e, t, -1), i = r && wn(e, n, 1);
|
|
593
640
|
if (!r || !i || r.from !== i.from || r.to !== i.to) return null;
|
|
594
|
-
let a =
|
|
641
|
+
let a = bn.get(r.name).length;
|
|
595
642
|
return {
|
|
596
643
|
from: r.from,
|
|
597
644
|
to: r.to,
|
|
@@ -600,49 +647,50 @@ function pn(e) {
|
|
|
600
647
|
live: !0
|
|
601
648
|
};
|
|
602
649
|
}
|
|
603
|
-
function
|
|
650
|
+
function Dn(e, t) {
|
|
604
651
|
let n = t.marker.length, { from: r, to: i } = e.selection.main;
|
|
605
652
|
if (r < t.from + n || i > t.to - n) return !1;
|
|
606
653
|
let a = e.sliceDoc(t.from, t.to);
|
|
607
654
|
if (a.length < 2 * n || !a.startsWith(t.marker) || !a.endsWith(t.marker)) return !1;
|
|
608
|
-
let o =
|
|
655
|
+
let o = Tn(e, t.from);
|
|
609
656
|
if (!o || o.to < t.to) return !1;
|
|
610
|
-
let s =
|
|
657
|
+
let s = wn(e, t.from, 1);
|
|
611
658
|
return !(s && s.name === t.name && s.from === t.from);
|
|
612
659
|
}
|
|
613
|
-
function
|
|
660
|
+
function On(e, t) {
|
|
614
661
|
return {
|
|
615
662
|
...e,
|
|
616
663
|
from: t.changes.mapPos(e.from, 1),
|
|
617
664
|
to: t.changes.mapPos(e.to, -1)
|
|
618
665
|
};
|
|
619
666
|
}
|
|
620
|
-
var
|
|
621
|
-
create: (e) =>
|
|
667
|
+
var M = b.define({
|
|
668
|
+
create: (e) => En(e),
|
|
622
669
|
update(e, t) {
|
|
670
|
+
if (e && !e.live && !t.docChanged && !t.selection) return e;
|
|
623
671
|
if (e) {
|
|
624
|
-
let n =
|
|
672
|
+
let n = On({
|
|
625
673
|
...e,
|
|
626
674
|
live: !1
|
|
627
675
|
}, t);
|
|
628
|
-
if (
|
|
676
|
+
if (Dn(t.state, n)) return n;
|
|
629
677
|
}
|
|
630
|
-
let n =
|
|
678
|
+
let n = En(t.state);
|
|
631
679
|
if (n) return n;
|
|
632
|
-
let r = t.effects.find((e) => e.is(
|
|
680
|
+
let r = t.effects.find((e) => e.is(Cn));
|
|
633
681
|
return r ? {
|
|
634
682
|
...r.value,
|
|
635
683
|
live: !1
|
|
636
684
|
} : null;
|
|
637
685
|
}
|
|
638
686
|
});
|
|
639
|
-
function
|
|
687
|
+
function kn(e, t) {
|
|
640
688
|
let n = t.marker.length, r = e.sliceDoc(t.from, t.to);
|
|
641
689
|
if (r.length < 2 * n || !r.startsWith(t.marker) || !r.endsWith(t.marker)) return null;
|
|
642
|
-
let i = r.slice(n, r.length - n), a = /^\s*/.exec(i)[0].length, o =
|
|
690
|
+
let i = r.slice(n, r.length - n), a = /^\s*/.exec(i)[0].length, o = Tn(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;
|
|
643
691
|
if (c <= t.from + n + a) return null;
|
|
644
692
|
let l = t.to - n - c;
|
|
645
|
-
return !a && !l || !
|
|
693
|
+
return !a && !l || !Sn.test(e.sliceDoc(c, t.to - n)) ? null : {
|
|
646
694
|
from: t.from,
|
|
647
695
|
to: t.to,
|
|
648
696
|
len: n,
|
|
@@ -650,7 +698,7 @@ function gn(e, t) {
|
|
|
650
698
|
trail: l
|
|
651
699
|
};
|
|
652
700
|
}
|
|
653
|
-
function
|
|
701
|
+
function An(e, t) {
|
|
654
702
|
let n = [];
|
|
655
703
|
return t.lead && n.push({
|
|
656
704
|
from: t.from,
|
|
@@ -666,7 +714,7 @@ function _n(e, t) {
|
|
|
666
714
|
insert: e.sliceDoc(t.to - t.len - t.trail, t.to - t.len)
|
|
667
715
|
}), n;
|
|
668
716
|
}
|
|
669
|
-
function
|
|
717
|
+
function jn(e, t, n) {
|
|
670
718
|
let r = t.from + t.len + t.lead, i = t.to - t.len - t.trail;
|
|
671
719
|
if (t.lead) {
|
|
672
720
|
if (e > t.from && e < t.from + t.len) return e + t.lead;
|
|
@@ -678,35 +726,35 @@ function vn(e, t, n) {
|
|
|
678
726
|
}
|
|
679
727
|
return e;
|
|
680
728
|
}
|
|
681
|
-
function
|
|
682
|
-
let
|
|
683
|
-
if (!
|
|
684
|
-
let
|
|
729
|
+
function Mn(e, t, n) {
|
|
730
|
+
let r = kn(e, t);
|
|
731
|
+
if (!r) return null;
|
|
732
|
+
let i = e.selection;
|
|
685
733
|
return {
|
|
686
|
-
changes:
|
|
687
|
-
selection:
|
|
734
|
+
changes: An(e, r),
|
|
735
|
+
selection: g.create(i.ranges.map((e) => g.range(jn(e.anchor, r, n), jn(e.head, r, n))), i.mainIndex),
|
|
688
736
|
userEvent: "input.emphasis"
|
|
689
737
|
};
|
|
690
738
|
}
|
|
691
|
-
function
|
|
692
|
-
let n =
|
|
693
|
-
return n ?
|
|
739
|
+
function Nn(e, t) {
|
|
740
|
+
let n = kn(e, t);
|
|
741
|
+
return n ? An(e, n) : [];
|
|
694
742
|
}
|
|
695
|
-
function
|
|
696
|
-
let t = e.state.field(
|
|
743
|
+
function Pn(e) {
|
|
744
|
+
let t = e.state.field(M, !1);
|
|
697
745
|
if (!t || t.live || e.state.readOnly) return;
|
|
698
|
-
let n =
|
|
746
|
+
let n = Mn(e.state, t, !0);
|
|
699
747
|
n && e.dispatch(n);
|
|
700
748
|
}
|
|
701
|
-
var
|
|
749
|
+
var Fn = [M, n.fromClass(class {
|
|
702
750
|
constructor(e) {
|
|
703
751
|
this.view = e, this.pending = null, this.destroyed = !1;
|
|
704
752
|
}
|
|
705
753
|
update(e) {
|
|
706
|
-
this.pending && (this.pending =
|
|
707
|
-
let t = e.startState.field(
|
|
754
|
+
this.pending && (this.pending = On(this.pending, e));
|
|
755
|
+
let t = e.startState.field(M);
|
|
708
756
|
if (!t) return;
|
|
709
|
-
let n =
|
|
757
|
+
let n = On(t, e), r = e.state.field(M);
|
|
710
758
|
r && r.name === n.name && r.from === n.from && r.to === n.to || (this.pending = n, queueMicrotask(() => this.flush()));
|
|
711
759
|
}
|
|
712
760
|
flush() {
|
|
@@ -722,28 +770,132 @@ var Sn = [N, c.fromClass(class {
|
|
|
722
770
|
});
|
|
723
771
|
return;
|
|
724
772
|
}
|
|
725
|
-
let t =
|
|
773
|
+
let t = Mn(this.view.state, e, !1);
|
|
726
774
|
t && this.view.dispatch(t);
|
|
727
775
|
}
|
|
728
776
|
destroy() {
|
|
729
777
|
this.destroyed = !0;
|
|
730
778
|
}
|
|
731
|
-
})],
|
|
779
|
+
})], In = /* @__PURE__ */ new Set(["Link", "LinkReference"]), Ln = 1e3;
|
|
780
|
+
function Rn(e) {
|
|
781
|
+
return e.name === "URL" && !!e.parent && In.has(e.parent.name);
|
|
782
|
+
}
|
|
783
|
+
function zn(e) {
|
|
784
|
+
let { main: t } = e.selection;
|
|
785
|
+
if (!t.empty) return null;
|
|
786
|
+
let n = T(e, t.head, -1, Rn);
|
|
787
|
+
return !n || t.head < n.from || t.head > n.to ? null : {
|
|
788
|
+
from: n.from,
|
|
789
|
+
to: n.to
|
|
790
|
+
};
|
|
791
|
+
}
|
|
792
|
+
function Bn(e, t) {
|
|
793
|
+
return {
|
|
794
|
+
from: t.mapPos(e.from, 1),
|
|
795
|
+
to: t.mapPos(e.to, -1)
|
|
796
|
+
};
|
|
797
|
+
}
|
|
798
|
+
function Vn(e) {
|
|
799
|
+
return e.transactions.some((e) => e.docChanged && [
|
|
800
|
+
"input.type",
|
|
801
|
+
"input.complete",
|
|
802
|
+
"input.paste",
|
|
803
|
+
"input.drop",
|
|
804
|
+
"delete"
|
|
805
|
+
].some((t) => e.isUserEvent(t)));
|
|
806
|
+
}
|
|
807
|
+
function Hn(e) {
|
|
808
|
+
let t = [], n = 0;
|
|
809
|
+
e.changes.iterChangedRanges((e, t, r, i) => {
|
|
810
|
+
n = Math.max(n, i);
|
|
811
|
+
});
|
|
812
|
+
let r = Un(e.state, n);
|
|
813
|
+
return e.changes.iterChangedRanges((e, n, i, a) => {
|
|
814
|
+
r.iterate({
|
|
815
|
+
from: Math.max(0, i - 1),
|
|
816
|
+
to: a,
|
|
817
|
+
enter: (e) => {
|
|
818
|
+
Rn(e.node) && e.from <= a && e.to >= i && t.push({
|
|
819
|
+
from: e.from,
|
|
820
|
+
to: e.to
|
|
821
|
+
});
|
|
822
|
+
}
|
|
823
|
+
});
|
|
824
|
+
}), t;
|
|
825
|
+
}
|
|
826
|
+
function Un(e, t) {
|
|
827
|
+
return _(e, t, Ln) ?? y(e);
|
|
828
|
+
}
|
|
829
|
+
function Wn(e, t) {
|
|
830
|
+
let { state: n } = e;
|
|
831
|
+
if (n.readOnly || !t.length) return;
|
|
832
|
+
let r = Un(n, n.doc.lineAt(Math.max(...t)).to), i = t.flatMap((e) => {
|
|
833
|
+
let t = r.resolveInner(e, 1);
|
|
834
|
+
for (; t && !(Rn(t) && t.from === e);) t = t.parent;
|
|
835
|
+
if (!t) return [];
|
|
836
|
+
let i = n.sliceDoc(t.from, t.to), a = dn(i);
|
|
837
|
+
return a === i || !a.endsWith(i) ? [] : [{
|
|
838
|
+
from: e,
|
|
839
|
+
insert: a.slice(0, a.length - i.length)
|
|
840
|
+
}];
|
|
841
|
+
});
|
|
842
|
+
i.length && e.dispatch({
|
|
843
|
+
changes: i,
|
|
844
|
+
userEvent: "input.link"
|
|
845
|
+
});
|
|
846
|
+
}
|
|
847
|
+
var Gn = class {
|
|
848
|
+
constructor(e) {
|
|
849
|
+
this.view = e, this.editing = null, this.pending = [], this.destroyed = !1;
|
|
850
|
+
}
|
|
851
|
+
update(e) {
|
|
852
|
+
let t = this.editing && e.docChanged ? Bn(this.editing, e.changes) : this.editing, n = zn(e.state), r = Vn(e) ? Hn(e).map((e) => e.from) : [], i = r.filter((e) => e !== n?.from), a = n && (t?.from === n.from || r.includes(n.from));
|
|
853
|
+
this.editing = a ? n : null, t && t.from !== this.editing?.from && i.push(t.from);
|
|
854
|
+
let o = this.pending.length > 0;
|
|
855
|
+
o && e.docChanged && (this.pending = this.pending.map((t) => e.changes.mapPos(t, 1))), this.pending = [.../* @__PURE__ */ new Set([...this.pending, ...i])], this.pending.length && !o && queueMicrotask(() => {
|
|
856
|
+
let { pending: e } = this;
|
|
857
|
+
this.pending = [], this.destroyed || Wn(this.view, e);
|
|
858
|
+
});
|
|
859
|
+
}
|
|
860
|
+
destroy() {
|
|
861
|
+
this.destroyed = !0;
|
|
862
|
+
}
|
|
863
|
+
}, Kn = n.fromClass(Gn);
|
|
864
|
+
function qn(e) {
|
|
865
|
+
let t = e.plugin(Kn), n = t?.editing;
|
|
866
|
+
t && n && (t.editing = null, Wn(e, [n.from]));
|
|
867
|
+
}
|
|
868
|
+
// src/components/inputs/text-editor/text-editor.highlight.ts
|
|
869
|
+
var Jn = /[\p{S}\p{P}]/u, N = 61, Yn = {
|
|
870
|
+
resolve: "Highlight",
|
|
871
|
+
mark: "HighlightMark"
|
|
872
|
+
}, Xn = {
|
|
873
|
+
defineNodes: ["Highlight", "HighlightMark"],
|
|
874
|
+
parseInline: [{
|
|
875
|
+
name: "Highlight",
|
|
876
|
+
parse(e, t, n) {
|
|
877
|
+
if (t !== N || e.char(n + 1) !== N || e.char(n + 2) === N || e.char(n - 1) === N) return -1;
|
|
878
|
+
let r = e.slice(n - 1, n), i = e.slice(n + 2, n + 3), a = /\s|^$/.test(r), o = /\s|^$/.test(i), s = Jn.test(r), c = Jn.test(i);
|
|
879
|
+
return e.addDelimiter(Yn, n, n + 2, !o && (!c || a || s), !a && (!s || o || c));
|
|
880
|
+
},
|
|
881
|
+
after: "Emphasis"
|
|
882
|
+
}]
|
|
883
|
+
}, Zn = v.high(l.of([{
|
|
732
884
|
key: "Enter",
|
|
733
|
-
run:
|
|
885
|
+
run: Se({ nonTightLists: !1 })
|
|
734
886
|
}, {
|
|
735
887
|
key: "Backspace",
|
|
736
|
-
run:
|
|
737
|
-
}])),
|
|
738
|
-
function
|
|
739
|
-
let n = [], r =
|
|
888
|
+
run: Ce
|
|
889
|
+
}])), P = /^( *)([-*+]|\d{1,9}[.)])( +|$)/, Qn = /^( *)([-*+]|\d{1,9}[.)]) ( *)([-*+]|\d{1,9}[.)]) $/, $n = /^( +)([-*+]|\d{1,9}[.)]) $/, er = /^((?:> ?)*> )> $/, tr = (e) => /\d/.test(e);
|
|
890
|
+
function F(e, t) {
|
|
891
|
+
let n = [], r = 1e400, i = 0;
|
|
740
892
|
for (let a = t - 1; a >= 1 && a > t - 500; a--) {
|
|
741
893
|
let t = e.doc.line(a).text;
|
|
742
894
|
if (t.trim() === "") {
|
|
743
895
|
if (++i >= 2) break;
|
|
744
896
|
continue;
|
|
745
897
|
}
|
|
746
|
-
let o =
|
|
898
|
+
let o = P.exec(t);
|
|
747
899
|
if (!o) {
|
|
748
900
|
if (/^\S/.test(t) && i > 0) break;
|
|
749
901
|
i = 0;
|
|
@@ -758,30 +910,51 @@ function P(e, t) {
|
|
|
758
910
|
}
|
|
759
911
|
return n;
|
|
760
912
|
}
|
|
761
|
-
function
|
|
913
|
+
function nr(e, t) {
|
|
762
914
|
return e.length === 0 ? 0 : t > e[0].markerCol ? e[0].contentCol : e.find((e) => e.markerCol <= t)?.markerCol ?? 0;
|
|
763
915
|
}
|
|
764
|
-
function
|
|
765
|
-
let r =
|
|
916
|
+
function rr(e, t, n) {
|
|
917
|
+
let r = er.exec(n);
|
|
766
918
|
if (r) return r[1];
|
|
767
|
-
let i =
|
|
919
|
+
let i = Qn.exec(n);
|
|
768
920
|
if (i) {
|
|
769
|
-
let [, n, r, a, o] = i, s =
|
|
770
|
-
return a === "" ?
|
|
921
|
+
let [, n, r, a, o] = i, s = F(e, t), c = `${" ".repeat(s.length ? s[0].contentCol : n.length + r.length + 1)}${o} `;
|
|
922
|
+
return a === "" ? tr(r) === tr(o) ? tr(o) && parseInt(o, 10) === 1 && parseInt(r, 10) !== 1 ? c : `${n}${r} ` : `${n}${o} ` : c;
|
|
771
923
|
}
|
|
772
|
-
let a =
|
|
924
|
+
let a = $n.exec(n);
|
|
773
925
|
if (a) {
|
|
774
|
-
let [, n, r] = a, i =
|
|
926
|
+
let [, n, r] = a, i = nr(F(e, t), n.length);
|
|
775
927
|
return i === n.length ? null : `${" ".repeat(i)}${r} `;
|
|
776
928
|
}
|
|
777
929
|
return null;
|
|
778
930
|
}
|
|
779
|
-
|
|
931
|
+
function ir(e, t, n, r) {
|
|
932
|
+
let i = P.exec(n);
|
|
933
|
+
if (!i || i[3] === "" || r > i[1].length) return null;
|
|
934
|
+
let a = F(e, t);
|
|
935
|
+
if (a.length === 0) return null;
|
|
936
|
+
let o = i[1].length, s = [...a.map((e) => e.markerCol), a[0].contentCol].filter((e) => e > o);
|
|
937
|
+
return s.length ? Math.min(...s) : o;
|
|
938
|
+
}
|
|
939
|
+
var ar = o.inputHandler.of((e, t, n, r) => {
|
|
780
940
|
if (r !== " " || t !== n || e.state.readOnly) return !1;
|
|
781
941
|
let i = e.state.doc.lineAt(t);
|
|
782
|
-
if (
|
|
783
|
-
let a = i.text
|
|
784
|
-
|
|
942
|
+
if (Re(e.state, i.from)) return !1;
|
|
943
|
+
let a = ir(e.state, i.number, i.text, t - i.from);
|
|
944
|
+
if (a !== null) {
|
|
945
|
+
let t = P.exec(i.text)[1].length;
|
|
946
|
+
return a > t && e.dispatch({
|
|
947
|
+
changes: {
|
|
948
|
+
from: i.from,
|
|
949
|
+
to: i.from + t,
|
|
950
|
+
insert: " ".repeat(a)
|
|
951
|
+
},
|
|
952
|
+
selection: { anchor: i.from + a },
|
|
953
|
+
userEvent: "input.type"
|
|
954
|
+
}), !0;
|
|
955
|
+
}
|
|
956
|
+
let o = i.text.slice(0, t - i.from) + " ", s = rr(e.state, i.number, o);
|
|
957
|
+
return s === null || s === o ? !1 : (e.dispatch({
|
|
785
958
|
changes: {
|
|
786
959
|
from: t,
|
|
787
960
|
insert: " "
|
|
@@ -791,14 +964,14 @@ var jn = _.inputHandler.of((e, t, n, r) => {
|
|
|
791
964
|
}), e.dispatch({
|
|
792
965
|
changes: {
|
|
793
966
|
from: i.from,
|
|
794
|
-
to: i.from +
|
|
795
|
-
insert:
|
|
967
|
+
to: i.from + o.length,
|
|
968
|
+
insert: s
|
|
796
969
|
},
|
|
797
|
-
selection: { anchor: i.from +
|
|
970
|
+
selection: { anchor: i.from + s.length },
|
|
798
971
|
userEvent: "input.complete",
|
|
799
|
-
annotations:
|
|
972
|
+
annotations: le.of("before")
|
|
800
973
|
}), !0);
|
|
801
|
-
}),
|
|
974
|
+
}), or = {
|
|
802
975
|
ATXHeading1: "cm-md-h1",
|
|
803
976
|
ATXHeading2: "cm-md-h2",
|
|
804
977
|
ATXHeading3: "cm-md-h3",
|
|
@@ -808,128 +981,137 @@ var jn = _.inputHandler.of((e, t, n, r) => {
|
|
|
808
981
|
StrongEmphasis: "cm-md-strong",
|
|
809
982
|
Emphasis: "cm-md-emphasis",
|
|
810
983
|
Strikethrough: "cm-md-strike",
|
|
984
|
+
Highlight: "cm-md-highlight",
|
|
811
985
|
InlineCode: "cm-md-code",
|
|
812
986
|
URL: "cm-md-url",
|
|
813
987
|
Blockquote: "cm-md-quote"
|
|
814
|
-
},
|
|
988
|
+
}, sr = /* @__PURE__ */ new Set([
|
|
815
989
|
"HeaderMark",
|
|
816
990
|
"EmphasisMark",
|
|
817
991
|
"StrikethroughMark",
|
|
992
|
+
"HighlightMark",
|
|
818
993
|
"CodeMark",
|
|
819
994
|
"QuoteMark",
|
|
820
995
|
"ListMark",
|
|
821
996
|
"LinkMark"
|
|
822
|
-
]),
|
|
823
|
-
function
|
|
824
|
-
return
|
|
997
|
+
]), cr = t.mark({ class: "cm-md-mark" }), lr = t.line({ class: "cm-md-quote-row" }), ur = {};
|
|
998
|
+
function I(e) {
|
|
999
|
+
return ur[e] ?? (ur[e] = t.mark({
|
|
825
1000
|
class: e,
|
|
826
1001
|
inclusiveEnd: !0
|
|
827
1002
|
}));
|
|
828
1003
|
}
|
|
829
|
-
var
|
|
830
|
-
function
|
|
1004
|
+
var dr = t.line({ class: "cm-md-codeblock" }), fr = t.line({ class: "cm-md-codeblock-first" }), pr = t.line({ class: "cm-md-codeblock-last" }), mr = t.line({ class: "cm-md-codeblock-line-selected" });
|
|
1005
|
+
function hr(e, t, n, r) {
|
|
831
1006
|
if (t.length === 0) return;
|
|
832
1007
|
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;
|
|
833
1008
|
t.forEach((i, a) => {
|
|
834
1009
|
let s = e.doc.line(i);
|
|
835
|
-
if (r.push(
|
|
1010
|
+
if (r.push(dr.range(s.from)), a === 0 && r.push(fr.range(s.from)), a === t.length - 1 && r.push(pr.range(s.from)), o) r.push(mr.range(s.from));
|
|
836
1011
|
else if (!n.empty) {
|
|
837
1012
|
let e = Math.max(s.from, n.from), t = Math.min(s.to, n.to);
|
|
838
|
-
t > e && r.push(
|
|
1013
|
+
t > e && r.push(I("cm-md-codeblock-selected").range(e, t));
|
|
839
1014
|
}
|
|
840
1015
|
});
|
|
841
1016
|
}
|
|
842
|
-
function
|
|
1017
|
+
function gr(e, t, n, r, i) {
|
|
843
1018
|
let a = e.doc.lineAt(t).number, o = e.doc.lineAt(Math.max(t, n - 1)).number, s = [];
|
|
844
1019
|
for (let e = a; e <= o; e++) s.push(e);
|
|
845
|
-
|
|
1020
|
+
hr(e, s, r, i);
|
|
846
1021
|
}
|
|
847
|
-
function
|
|
1022
|
+
function _r(e, t, n, r) {
|
|
848
1023
|
let i = /* @__PURE__ */ new Set();
|
|
849
1024
|
for (let n = t.firstChild; n; n = n.nextSibling) n.name === "CodeMark" && i.add(e.doc.lineAt(n.from).number);
|
|
850
1025
|
let a = e.doc.lineAt(t.from).number, o = e.doc.lineAt(Math.max(t.from, t.to - 1)).number, s = [];
|
|
851
1026
|
for (let e = a; e <= o; e++) i.has(e) || s.push(e);
|
|
852
|
-
|
|
1027
|
+
hr(e, s, n, r);
|
|
853
1028
|
}
|
|
854
|
-
function
|
|
855
|
-
|
|
1029
|
+
function vr(e, t, n) {
|
|
1030
|
+
O(e, t) || n.push(I("cm-md-link").range(t.from, t.to));
|
|
856
1031
|
}
|
|
857
|
-
function
|
|
858
|
-
let
|
|
859
|
-
for (let { from:
|
|
860
|
-
from:
|
|
1032
|
+
function yr(e) {
|
|
1033
|
+
let n = [], r = e.state.selection.main;
|
|
1034
|
+
for (let { from: t, to: i } of e.visibleRanges) y(e.state).iterate({
|
|
1035
|
+
from: t,
|
|
861
1036
|
to: i,
|
|
862
|
-
enter: (
|
|
863
|
-
if (
|
|
864
|
-
if (
|
|
865
|
-
|
|
1037
|
+
enter: (t) => {
|
|
1038
|
+
if (t.from >= t.to) return;
|
|
1039
|
+
if (t.name === "Link") {
|
|
1040
|
+
vr(e.state, t.node, n);
|
|
866
1041
|
return;
|
|
867
1042
|
}
|
|
868
|
-
if (
|
|
869
|
-
|
|
1043
|
+
if (t.name === "FencedCode") {
|
|
1044
|
+
_r(e.state, t.node, r, n);
|
|
870
1045
|
return;
|
|
871
1046
|
}
|
|
872
|
-
if (
|
|
873
|
-
|
|
1047
|
+
if (t.name === "CodeBlock") {
|
|
1048
|
+
gr(e.state, t.from, t.to, r, n);
|
|
874
1049
|
return;
|
|
875
1050
|
}
|
|
876
|
-
if (
|
|
877
|
-
|
|
1051
|
+
if (t.name === "URL" && !mn(t.node)) {
|
|
1052
|
+
n.push(I("cm-md-autolink").range(t.from, t.to));
|
|
878
1053
|
return;
|
|
879
1054
|
}
|
|
880
|
-
|
|
881
|
-
let i =
|
|
1055
|
+
t.name === "Blockquote" && t.node.parent?.name !== "Blockquote" && Be(e.state, t.from, t.to, (e) => n.push(lr.range(e)));
|
|
1056
|
+
let i = or[t.name];
|
|
882
1057
|
if (i) {
|
|
883
|
-
if (i === "cm-md-code" && !
|
|
884
|
-
else
|
|
885
|
-
|
|
886
|
-
|
|
1058
|
+
if (i === "cm-md-code" && !r.empty && r.from <= t.from && r.to >= t.to) n.push(I("cm-md-code cm-md-code-selected").range(t.from, t.to));
|
|
1059
|
+
else {
|
|
1060
|
+
if (n.push(I(i).range(t.from, t.to)), !r.empty && i === "cm-md-highlight") {
|
|
1061
|
+
let e = Math.max(t.from, r.from), i = Math.min(t.to, r.to), a = (e === t.from ? " cm-md-highlight-selected-start" : "") + (i === t.to ? " cm-md-highlight-selected-end" : "");
|
|
1062
|
+
i > e && n.push(I(`cm-md-highlight-selected${a}`).range(e, i));
|
|
1063
|
+
}
|
|
1064
|
+
if (!r.empty && i === "cm-md-code") {
|
|
1065
|
+
let e = Math.max(t.from, r.from), i = Math.min(t.to, r.to), a = (e === t.from ? " cm-md-code-selected-start" : "") + (i === t.to ? " cm-md-code-selected-end" : "");
|
|
1066
|
+
i > e && n.push(I(`cm-md-code-selected${a}`).range(e, i));
|
|
1067
|
+
}
|
|
887
1068
|
}
|
|
888
|
-
} else
|
|
1069
|
+
} else sr.has(t.name) && n.push(cr.range(t.from, t.to));
|
|
889
1070
|
}
|
|
890
1071
|
});
|
|
891
|
-
let
|
|
892
|
-
if (
|
|
893
|
-
let e =
|
|
894
|
-
|
|
1072
|
+
let i = e.state.field(M, !1);
|
|
1073
|
+
if (i && !i.live) {
|
|
1074
|
+
let e = i.marker.length;
|
|
1075
|
+
n.push(I(or[i.name]).range(i.from, i.to)), n.push(cr.range(i.from, i.from + e), cr.range(i.to - e, i.to));
|
|
895
1076
|
}
|
|
896
|
-
return
|
|
1077
|
+
return t.set(n, !0);
|
|
897
1078
|
}
|
|
898
|
-
var
|
|
1079
|
+
var br = n.fromClass(class {
|
|
899
1080
|
constructor(e) {
|
|
900
|
-
this.decorations =
|
|
1081
|
+
this.decorations = yr(e);
|
|
901
1082
|
}
|
|
902
1083
|
update(e) {
|
|
903
|
-
(e.docChanged || e.viewportChanged || e.selectionSet ||
|
|
1084
|
+
(e.docChanged || e.viewportChanged || e.selectionSet || E(e.startState, e.state)) && (this.decorations = yr(e.view));
|
|
904
1085
|
}
|
|
905
|
-
}, { decorations: (e) => e.decorations }),
|
|
906
|
-
function
|
|
907
|
-
return
|
|
1086
|
+
}, { decorations: (e) => e.decorations }), xr = /^((?:[ \t]*(?:[-*+][ \t]+(?:\[[ xX]\][ \t]+)?|\d+[.)][ \t]+|>[ \t]?))+)/;
|
|
1087
|
+
function Sr(e) {
|
|
1088
|
+
return xr.exec(e)?.[1].length ?? 0;
|
|
908
1089
|
}
|
|
909
|
-
var
|
|
910
|
-
function
|
|
911
|
-
return
|
|
1090
|
+
var Cr = t.mark({ class: "cm-md-listprefix" }), wr = {};
|
|
1091
|
+
function Tr(e) {
|
|
1092
|
+
return wr[e] ?? (wr[e] = t.line({ attributes: { style: `text-indent:calc(${e} * var(--_text-editor-marker-advance) * -1);padding-left:calc(${e} * var(--_text-editor-marker-advance))` } }));
|
|
912
1093
|
}
|
|
913
|
-
function
|
|
914
|
-
let
|
|
915
|
-
for (let
|
|
916
|
-
let i =
|
|
917
|
-
if (a && a[1].length && !
|
|
1094
|
+
function Er(e) {
|
|
1095
|
+
let n = [], r = 0;
|
|
1096
|
+
for (let t = e.doc.iterLines(); !t.next().done;) {
|
|
1097
|
+
let i = t.value, a = xr.exec(i);
|
|
1098
|
+
if (a && a[1].length && !Re(e, r) && !Ve(e, r)) {
|
|
918
1099
|
let e = a[1].length;
|
|
919
|
-
|
|
1100
|
+
n.push(Tr(e).range(r)), n.push(Cr.range(r, r + e));
|
|
920
1101
|
}
|
|
921
|
-
|
|
1102
|
+
r += i.length + 1;
|
|
922
1103
|
}
|
|
923
|
-
return
|
|
1104
|
+
return t.set(n, !0);
|
|
924
1105
|
}
|
|
925
|
-
var
|
|
926
|
-
create: (e) =>
|
|
927
|
-
update: (e, t) => t.docChanged ||
|
|
928
|
-
provide: (e) =>
|
|
929
|
-
}),
|
|
930
|
-
|
|
1106
|
+
var Dr = b.define({
|
|
1107
|
+
create: (e) => Er(e),
|
|
1108
|
+
update: (e, t) => t.docChanged || E(t.startState, t.state) ? Er(t.state) : e,
|
|
1109
|
+
provide: (e) => o.decorations.from(e)
|
|
1110
|
+
}), Or = [
|
|
1111
|
+
xe({
|
|
931
1112
|
extensions: [
|
|
932
|
-
|
|
1113
|
+
be,
|
|
1114
|
+
Xn,
|
|
933
1115
|
{ remove: ["IndentedCode"] },
|
|
934
1116
|
{ parseBlock: [{
|
|
935
1117
|
name: "IndentedText",
|
|
@@ -944,31 +1126,33 @@ var $n = h.define({
|
|
|
944
1126
|
codeLanguages: ee,
|
|
945
1127
|
addKeymap: !1
|
|
946
1128
|
}),
|
|
947
|
-
|
|
948
|
-
|
|
1129
|
+
dt,
|
|
1130
|
+
Zn,
|
|
1131
|
+
ar,
|
|
1132
|
+
br,
|
|
1133
|
+
Fn,
|
|
949
1134
|
Kn,
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
function rr(e, t) {
|
|
1135
|
+
Dr,
|
|
1136
|
+
nt
|
|
1137
|
+
], kr = "[\\p{L}\\p{M}\\p{N}_.+-]*", Ar = /* @__PURE__ */ new Map();
|
|
1138
|
+
function jr(e, t) {
|
|
955
1139
|
if (e.length !== 1 || /[\s\p{L}\p{N}_]/u.test(e)) return null;
|
|
956
1140
|
let n = `${e}\u0000${t}`;
|
|
957
|
-
if (
|
|
1141
|
+
if (Ar.has(n)) return Ar.get(n);
|
|
958
1142
|
let r;
|
|
959
1143
|
try {
|
|
960
1144
|
let n = [
|
|
961
1145
|
"*",
|
|
962
1146
|
"_",
|
|
963
1147
|
"~"
|
|
964
|
-
].filter((t) => t !== e).join(""), i = e.replace(/[\\^$.*+?()[\]{}|/]/g, "\\$&");
|
|
965
|
-
r = RegExp(`((?:^|[\\s\\p{Ps}\\p{Pi}"'])[${n}]*)(${
|
|
1148
|
+
].filter((t) => t !== e).join(""), i = e === "=" ? "" : "|==", a = e.replace(/[\\^$.*+?()[\]{}|/]/g, "\\$&");
|
|
1149
|
+
r = RegExp(`((?:^|[\\s\\p{Ps}\\p{Pi}"'])(?:[${n}]${i})*)(${a})(${t})$`, "u");
|
|
966
1150
|
} catch {
|
|
967
|
-
r = t === "[\\p{L}\\p{M}\\p{N}_.+-]*" ? null :
|
|
1151
|
+
r = t === "[\\p{L}\\p{M}\\p{N}_.+-]*" ? null : jr(e, kr);
|
|
968
1152
|
}
|
|
969
|
-
return
|
|
1153
|
+
return Ar.set(n, r), r;
|
|
970
1154
|
}
|
|
971
|
-
function
|
|
1155
|
+
function Mr(e) {
|
|
972
1156
|
return e.some(({ query: e }) => {
|
|
973
1157
|
if (e === void 0) return !1;
|
|
974
1158
|
try {
|
|
@@ -978,7 +1162,7 @@ function ir(e) {
|
|
|
978
1162
|
}
|
|
979
1163
|
});
|
|
980
1164
|
}
|
|
981
|
-
function
|
|
1165
|
+
function Nr(e) {
|
|
982
1166
|
let t = /* @__PURE__ */ new Map();
|
|
983
1167
|
for (let n of e) {
|
|
984
1168
|
let { trigger: e, query: r } = typeof n == "string" ? {
|
|
@@ -987,27 +1171,27 @@ function ar(e) {
|
|
|
987
1171
|
} : n;
|
|
988
1172
|
(!t.has(e) || t.get(e) === void 0 && r !== void 0) && t.set(e, r);
|
|
989
1173
|
}
|
|
990
|
-
return Array.from(t, ([e, t]) =>
|
|
1174
|
+
return Array.from(t, ([e, t]) => jr(e, t ?? "[\\p{L}\\p{M}\\p{N}_.+-]*")).filter((e) => e !== null);
|
|
991
1175
|
}
|
|
992
|
-
function
|
|
1176
|
+
function Pr(e, t, n) {
|
|
993
1177
|
let r = e.doc.lineAt(t), i = e.sliceDoc(r.from, t), a = null;
|
|
994
|
-
for (let e of
|
|
1178
|
+
for (let e of Nr(n)) {
|
|
995
1179
|
let t = e.exec(i);
|
|
996
1180
|
t && (!a || t.index + t[1].length > a.index + a[1].length) && (a = t);
|
|
997
1181
|
}
|
|
998
1182
|
if (!a) return null;
|
|
999
1183
|
let o = r.from + a.index + a[1].length;
|
|
1000
|
-
return
|
|
1184
|
+
return ze(e, o) ? null : {
|
|
1001
1185
|
from: o,
|
|
1002
1186
|
to: t,
|
|
1003
1187
|
query: a[3],
|
|
1004
1188
|
trigger: a[2]
|
|
1005
1189
|
};
|
|
1006
1190
|
}
|
|
1007
|
-
function
|
|
1191
|
+
function Fr(e) {
|
|
1008
1192
|
return (t) => `${e}${t.text} `;
|
|
1009
1193
|
}
|
|
1010
|
-
function
|
|
1194
|
+
function Ir(e) {
|
|
1011
1195
|
let { candidate: t } = e;
|
|
1012
1196
|
if (t.avatar) {
|
|
1013
1197
|
let e = document.createElement("nldd-avatar");
|
|
@@ -1023,19 +1207,19 @@ function cr(e) {
|
|
|
1023
1207
|
}
|
|
1024
1208
|
return null;
|
|
1025
1209
|
}
|
|
1026
|
-
function
|
|
1210
|
+
function Lr(e) {
|
|
1027
1211
|
return e.candidate.avatar ? "cm-nldd-row-avatar" : "";
|
|
1028
1212
|
}
|
|
1029
|
-
var
|
|
1030
|
-
function
|
|
1213
|
+
var L = m.define();
|
|
1214
|
+
function Rr(e, t, n) {
|
|
1031
1215
|
return async (r) => {
|
|
1032
|
-
let i = e(), a =
|
|
1216
|
+
let i = e(), a = Pr(r.state, r.pos, i);
|
|
1033
1217
|
if (!a) return null;
|
|
1034
1218
|
let o = i.filter((e) => e.trigger === a.trigger), s = await Promise.all(o.map((e) => e.source(a.query))), c = [];
|
|
1035
1219
|
s.forEach((e, n) => {
|
|
1036
|
-
let r = o[n], i = r.insert ??
|
|
1220
|
+
let r = o[n], i = r.insert ?? Fr(a.trigger);
|
|
1037
1221
|
for (let n of e ?? []) c.push({
|
|
1038
|
-
label: `${a.trigger}${n.text}`,
|
|
1222
|
+
label: `${r.showTrigger === !1 ? "" : a.trigger}${n.text}`,
|
|
1039
1223
|
detail: n.supportingText,
|
|
1040
1224
|
candidate: n,
|
|
1041
1225
|
apply: (e, o, s, c) => {
|
|
@@ -1058,13 +1242,13 @@ function ur(e, t, n) {
|
|
|
1058
1242
|
}
|
|
1059
1243
|
});
|
|
1060
1244
|
});
|
|
1061
|
-
let l = c.length ? null :
|
|
1245
|
+
let l = c.length ? null : zr(o, a.query, n), u = r.view;
|
|
1062
1246
|
if (u && !r.aborted && u.state.doc === r.state.doc) {
|
|
1063
|
-
let e = u.state.field(
|
|
1247
|
+
let e = u.state.field(R, !1), t = l === null ? null : {
|
|
1064
1248
|
from: a.from,
|
|
1065
1249
|
text: l
|
|
1066
1250
|
};
|
|
1067
|
-
(e?.text !== t?.text || e?.from !== t?.from) && u.dispatch({ effects:
|
|
1251
|
+
(e?.text !== t?.text || e?.from !== t?.from) && u.dispatch({ effects: L.of(t) });
|
|
1068
1252
|
}
|
|
1069
1253
|
return c.length ? {
|
|
1070
1254
|
from: a.from,
|
|
@@ -1073,17 +1257,17 @@ function ur(e, t, n) {
|
|
|
1073
1257
|
} : null;
|
|
1074
1258
|
};
|
|
1075
1259
|
}
|
|
1076
|
-
function
|
|
1260
|
+
function zr(e, t, n) {
|
|
1077
1261
|
for (let n of e) {
|
|
1078
1262
|
let e = n.emptyText?.(t);
|
|
1079
1263
|
if (e !== void 0) return e || null;
|
|
1080
1264
|
}
|
|
1081
1265
|
return n(t);
|
|
1082
1266
|
}
|
|
1083
|
-
var
|
|
1267
|
+
var R = b.define({
|
|
1084
1268
|
create: () => null,
|
|
1085
1269
|
update(e, t) {
|
|
1086
|
-
for (let e of t.effects) if (e.is(
|
|
1270
|
+
for (let e of t.effects) if (e.is(L)) return e.value;
|
|
1087
1271
|
if (!e) return null;
|
|
1088
1272
|
if (t.docChanged && (e = {
|
|
1089
1273
|
...e,
|
|
@@ -1094,7 +1278,7 @@ var L = h.define({
|
|
|
1094
1278
|
}
|
|
1095
1279
|
return e;
|
|
1096
1280
|
},
|
|
1097
|
-
provide: (e) =>
|
|
1281
|
+
provide: (e) => i.from(e, (e) => e && {
|
|
1098
1282
|
pos: e.from,
|
|
1099
1283
|
above: !1,
|
|
1100
1284
|
create: () => {
|
|
@@ -1102,34 +1286,34 @@ var L = h.define({
|
|
|
1102
1286
|
return t.className = "cm-nldd-typeahead-empty", t.textContent = e.text, { dom: t };
|
|
1103
1287
|
}
|
|
1104
1288
|
})
|
|
1105
|
-
}),
|
|
1106
|
-
|
|
1289
|
+
}), Br = [
|
|
1290
|
+
v.high(l.of([{
|
|
1107
1291
|
key: "Escape",
|
|
1108
|
-
run: (e) => e.state.field(
|
|
1292
|
+
run: (e) => e.state.field(R, !1) ? (e.dispatch({ effects: L.of(null) }), !0) : !1
|
|
1109
1293
|
}])),
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1294
|
+
o.focusChangeEffect.of((e, t) => !t && e.field(R, !1) ? L.of(null) : null),
|
|
1295
|
+
o.updateListener.of((e) => {
|
|
1296
|
+
Oe(e.state) === "active" && e.state.field(R, !1) && queueMicrotask(() => e.view.dispatch({ effects: L.of(null) }));
|
|
1113
1297
|
})
|
|
1114
1298
|
];
|
|
1115
|
-
function
|
|
1116
|
-
return
|
|
1299
|
+
function Vr(e) {
|
|
1300
|
+
return n.fromClass(class {
|
|
1117
1301
|
constructor(e) {
|
|
1118
1302
|
this.status = document.createElement("div"), this.status.className = "cm-nldd-typeahead-status", this.status.setAttribute("role", "status"), e.dom.append(this.status);
|
|
1119
1303
|
}
|
|
1120
1304
|
update(t) {
|
|
1121
|
-
let n =
|
|
1305
|
+
let n = Oe(t.state);
|
|
1122
1306
|
if (n === "pending") return;
|
|
1123
|
-
let r = t.state.field(
|
|
1124
|
-
r ? i = r.text : n === "active" && (i = e(
|
|
1307
|
+
let r = t.state.field(R, !1), i = "";
|
|
1308
|
+
r ? i = r.text : n === "active" && (i = e(Ee(t.state).length)), this.status.textContent !== i && (this.status.textContent = i);
|
|
1125
1309
|
}
|
|
1126
1310
|
destroy() {
|
|
1127
1311
|
this.status.remove();
|
|
1128
1312
|
}
|
|
1129
1313
|
});
|
|
1130
1314
|
}
|
|
1131
|
-
var
|
|
1132
|
-
function
|
|
1315
|
+
var Hr = 16;
|
|
1316
|
+
function Ur() {
|
|
1133
1317
|
let e = document.createElement("div");
|
|
1134
1318
|
e.setAttribute("popover", "manual"), e.className = "cm-nldd-popups";
|
|
1135
1319
|
let t = () => {
|
|
@@ -1137,7 +1321,7 @@ function mr() {
|
|
|
1137
1321
|
if (t !== e.matches(":popover-open")) try {
|
|
1138
1322
|
t ? e.showPopover() : e.hidePopover();
|
|
1139
1323
|
} catch {}
|
|
1140
|
-
},
|
|
1324
|
+
}, r = n.define((n) => {
|
|
1141
1325
|
n.dom.appendChild(e);
|
|
1142
1326
|
let r = new MutationObserver(t);
|
|
1143
1327
|
return r.observe(e, {
|
|
@@ -1147,99 +1331,193 @@ function mr() {
|
|
|
1147
1331
|
r.disconnect(), e.remove();
|
|
1148
1332
|
} };
|
|
1149
1333
|
});
|
|
1150
|
-
return [
|
|
1334
|
+
return [f({
|
|
1151
1335
|
parent: e,
|
|
1152
1336
|
tooltipSpace: () => ({
|
|
1153
|
-
left:
|
|
1154
|
-
top:
|
|
1155
|
-
right: window.innerWidth -
|
|
1156
|
-
bottom: window.innerHeight -
|
|
1337
|
+
left: Hr,
|
|
1338
|
+
top: Hr,
|
|
1339
|
+
right: window.innerWidth - Hr,
|
|
1340
|
+
bottom: window.innerHeight - Hr
|
|
1157
1341
|
})
|
|
1158
|
-
}),
|
|
1342
|
+
}), r];
|
|
1159
1343
|
}
|
|
1160
|
-
function
|
|
1161
|
-
let i =
|
|
1162
|
-
t.docChanged &&
|
|
1344
|
+
function Wr(e, t, n = () => null, r = (e) => String(e)) {
|
|
1345
|
+
let i = o.updateListener.of((t) => {
|
|
1346
|
+
t.docChanged && Oe(t.state) === null && t.transactions.some((e) => e.isUserEvent("delete")) && Pr(t.state, t.state.selection.main.head, e()) && De(t.view);
|
|
1163
1347
|
});
|
|
1164
1348
|
return [
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
override: [
|
|
1349
|
+
Ur(),
|
|
1350
|
+
ke({
|
|
1351
|
+
override: [Rr(e, t, n)],
|
|
1168
1352
|
icons: !1,
|
|
1169
1353
|
addToOptions: [{
|
|
1170
1354
|
position: 20,
|
|
1171
|
-
render:
|
|
1355
|
+
render: Ir
|
|
1172
1356
|
}],
|
|
1173
|
-
optionClass:
|
|
1357
|
+
optionClass: Lr
|
|
1174
1358
|
}),
|
|
1175
1359
|
i,
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1360
|
+
R,
|
|
1361
|
+
Br,
|
|
1362
|
+
Vr(r)
|
|
1363
|
+
];
|
|
1364
|
+
}
|
|
1365
|
+
// src/components/inputs/text-editor/text-editor.variables.ts
|
|
1366
|
+
var Gr = /\{\{\s*([\p{L}\p{N}_.-]+)\s*\}\}/gu, Kr = m.define(), qr = b.define({
|
|
1367
|
+
create: () => /* @__PURE__ */ new Map(),
|
|
1368
|
+
update(e, t) {
|
|
1369
|
+
for (let e of t.effects) if (e.is(Kr)) return new Map(e.value.map((e) => [e.key, e]));
|
|
1370
|
+
return e;
|
|
1371
|
+
}
|
|
1372
|
+
}), Jr = class extends r {
|
|
1373
|
+
constructor(e, t, n, r) {
|
|
1374
|
+
super(), this.label = e, this.text = t, this.empty = n, this.selected = r;
|
|
1375
|
+
}
|
|
1376
|
+
eq(e) {
|
|
1377
|
+
return e.label === this.label && e.text === this.text && e.empty === this.empty && e.selected === this.selected;
|
|
1378
|
+
}
|
|
1379
|
+
toDOM() {
|
|
1380
|
+
let e = document.createElement("span");
|
|
1381
|
+
e.className = "cm-md-variable-token", e.setAttribute("spellcheck", "false"), this.empty && e.setAttribute("data-empty", ""), this.selected && e.setAttribute("data-selected", "");
|
|
1382
|
+
let t = document.createElement("span");
|
|
1383
|
+
t.className = "cm-md-variable-token-text", t.dataset.text = this.text, t.setAttribute("aria-hidden", "true");
|
|
1384
|
+
let n = document.createElement("span");
|
|
1385
|
+
if (n.className = "cm-md-token-spoken", n.textContent = this.empty ? this.text : `${this.text} (${this.label})`, e.append(n), this.empty) return e.append(t), e;
|
|
1386
|
+
let r = document.createElement("nldd-tooltip");
|
|
1387
|
+
return r.setAttribute("text", this.label), r.append(t), e.append(r), e;
|
|
1388
|
+
}
|
|
1389
|
+
ignoreEvent() {
|
|
1390
|
+
return !1;
|
|
1391
|
+
}
|
|
1392
|
+
};
|
|
1393
|
+
function Yr(e) {
|
|
1394
|
+
let t = e.field(qr);
|
|
1395
|
+
if (!t.size) return [];
|
|
1396
|
+
let n = [];
|
|
1397
|
+
for (let r of e.doc.toString().matchAll(Gr)) {
|
|
1398
|
+
let i = r.index;
|
|
1399
|
+
t.has(r[1]) && !D(e, i, 1, Le) && n.push({
|
|
1400
|
+
from: i,
|
|
1401
|
+
to: i + r[0].length,
|
|
1402
|
+
key: r[1]
|
|
1403
|
+
});
|
|
1404
|
+
}
|
|
1405
|
+
return n;
|
|
1406
|
+
}
|
|
1407
|
+
function Xr(e, t) {
|
|
1408
|
+
return e.selection.ranges.some((e) => !e.empty && e.from <= t.from && e.to >= t.to);
|
|
1409
|
+
}
|
|
1410
|
+
function Zr(e, n, r) {
|
|
1411
|
+
let i = e.field(qr), a = [], o = [];
|
|
1412
|
+
for (let s of n) {
|
|
1413
|
+
let n = Xr(e, s);
|
|
1414
|
+
n && o.push(s.from);
|
|
1415
|
+
let c = i.get(s.key), l = c.value === void 0 || c.value === "", u = l ? r(c.label) : c.value;
|
|
1416
|
+
a.push(t.replace({ widget: new Jr(c.label, u, l, n) }).range(s.from, s.to));
|
|
1417
|
+
}
|
|
1418
|
+
return {
|
|
1419
|
+
matches: n,
|
|
1420
|
+
look: o.join(" "),
|
|
1421
|
+
tokens: t.set(a)
|
|
1422
|
+
};
|
|
1423
|
+
}
|
|
1424
|
+
function Qr(e, t) {
|
|
1425
|
+
return (n) => {
|
|
1426
|
+
let { main: r } = n.state.selection;
|
|
1427
|
+
if (!r.empty || n.state.readOnly) return !1;
|
|
1428
|
+
let i = n.state.field(e).matches.find((e) => (t < 0 ? e.to : e.from) === r.head);
|
|
1429
|
+
return i ? (n.dispatch({ selection: {
|
|
1430
|
+
anchor: i.from,
|
|
1431
|
+
head: i.to
|
|
1432
|
+
} }), !0) : !1;
|
|
1433
|
+
};
|
|
1434
|
+
}
|
|
1435
|
+
function $r(e) {
|
|
1436
|
+
let n = b.define({
|
|
1437
|
+
create: (t) => Zr(t, Yr(t), e),
|
|
1438
|
+
update: (t, n) => {
|
|
1439
|
+
if (n.docChanged || E(n.startState, n.state) || n.effects.some((e) => e.is(Kr) || e.is(w))) return Zr(n.state, Yr(n.state), e);
|
|
1440
|
+
if (!n.selection) return t;
|
|
1441
|
+
let r = Zr(n.state, t.matches, e);
|
|
1442
|
+
return r.look === t.look ? t : r;
|
|
1443
|
+
},
|
|
1444
|
+
provide: (e) => o.decorations.from(e, (e) => e.tokens)
|
|
1445
|
+
});
|
|
1446
|
+
return [
|
|
1447
|
+
qr,
|
|
1448
|
+
v.highest(n),
|
|
1449
|
+
v.high(l.of([{
|
|
1450
|
+
key: "Backspace",
|
|
1451
|
+
run: Qr(n, -1)
|
|
1452
|
+
}, {
|
|
1453
|
+
key: "Delete",
|
|
1454
|
+
run: Qr(n, 1)
|
|
1455
|
+
}])),
|
|
1456
|
+
o.atomicRanges.of((e) => e.state.field(n, !1)?.tokens ?? t.none)
|
|
1179
1457
|
];
|
|
1180
1458
|
}
|
|
1181
1459
|
// src/components/inputs/text-editor/text-editor.spellcheck.ts
|
|
1182
|
-
var
|
|
1460
|
+
var ei = x.define(), ti = /* @__PURE__ */ new Set([
|
|
1183
1461
|
"InlineCode",
|
|
1184
1462
|
"FencedCode",
|
|
1185
1463
|
"CodeBlock",
|
|
1186
1464
|
"URL",
|
|
1187
1465
|
"Autolink"
|
|
1188
1466
|
]);
|
|
1189
|
-
function
|
|
1190
|
-
return e.name === "Link" &&
|
|
1467
|
+
function ni(e, t) {
|
|
1468
|
+
return e.name === "Link" && O(t, e.node);
|
|
1191
1469
|
}
|
|
1192
|
-
var
|
|
1193
|
-
function
|
|
1194
|
-
let t = e.state.facet(
|
|
1470
|
+
var ri = ei.of((e, t) => ti.has(e.name) || ni(e, t)), ii = t.mark({ attributes: { spellcheck: "false" } });
|
|
1471
|
+
function ai(e) {
|
|
1472
|
+
let t = e.state.facet(ei), n = new te(), r = y(e.state), i = -1;
|
|
1195
1473
|
for (let { from: a, to: o } of e.visibleRanges) r.iterate({
|
|
1196
1474
|
from: a,
|
|
1197
1475
|
to: o,
|
|
1198
1476
|
enter: (r) => {
|
|
1199
|
-
if (t.some((t) => t(r, e.state))) return r.to > r.from && r.from >= i && (n.add(r.from, r.to,
|
|
1477
|
+
if (t.some((t) => t(r, e.state))) return r.to > r.from && r.from >= i && (n.add(r.from, r.to, ii), i = r.to), !1;
|
|
1200
1478
|
}
|
|
1201
1479
|
});
|
|
1202
1480
|
return n.finish();
|
|
1203
1481
|
}
|
|
1204
|
-
var
|
|
1482
|
+
var oi = n.fromClass(class {
|
|
1205
1483
|
constructor(e) {
|
|
1206
|
-
this.decorations =
|
|
1484
|
+
this.decorations = ai(e);
|
|
1207
1485
|
}
|
|
1208
1486
|
update(e) {
|
|
1209
|
-
(e.docChanged || e.viewportChanged ||
|
|
1487
|
+
(e.docChanged || e.viewportChanged || E(e.startState, e.state)) && (this.decorations = ai(e.view));
|
|
1210
1488
|
}
|
|
1211
|
-
}, { decorations: (e) => e.decorations }),
|
|
1489
|
+
}, { decorations: (e) => e.decorations }), si = x.define({ combine: (e) => e.some(Boolean) }), ci = /* @__PURE__ */ new WeakMap(), li = o.domEventObservers({ keydown(e, t) {
|
|
1212
1490
|
let n = e.isTrusted && !e.isComposing && !e.shiftKey && !e.altKey && !e.ctrlKey && !e.metaKey;
|
|
1213
|
-
|
|
1491
|
+
ci.set(t, n && (e.key === "Backspace" || e.key === "Delete") ? e.key : null);
|
|
1214
1492
|
} });
|
|
1215
|
-
function
|
|
1493
|
+
function ui(e, t) {
|
|
1216
1494
|
let { node: n, offset: r } = e.domAtPos(t);
|
|
1217
1495
|
return n.nodeType === Node.TEXT_NODE ? {
|
|
1218
1496
|
node: n,
|
|
1219
1497
|
offset: r
|
|
1220
1498
|
} : null;
|
|
1221
1499
|
}
|
|
1222
|
-
function
|
|
1223
|
-
if (!e.state.facet(
|
|
1500
|
+
function di(e, t) {
|
|
1501
|
+
if (!e.state.facet(si) || ci.get(e) !== t) return !1;
|
|
1224
1502
|
let { selection: n, doc: r } = e.state;
|
|
1225
1503
|
if (n.ranges.length > 1) return !1;
|
|
1226
1504
|
let { from: i, to: a, empty: o } = n.main, s = r.lineAt(i);
|
|
1227
1505
|
if (!/\S/.test(e.state.sliceDoc(s.from, i)) && !(t === "Delete" && o)) return !1;
|
|
1228
|
-
let c =
|
|
1506
|
+
let c = ui(e, i);
|
|
1229
1507
|
if (!c) return !1;
|
|
1230
1508
|
if (!o) {
|
|
1231
|
-
let t =
|
|
1509
|
+
let t = ui(e, a);
|
|
1232
1510
|
return t !== null && t.node === c.node && c.offset >= 1;
|
|
1233
1511
|
}
|
|
1234
1512
|
return t === "Backspace" ? c.offset >= 2 : c.offset >= 1 && c.offset <= c.node.length - 2;
|
|
1235
1513
|
}
|
|
1236
|
-
function
|
|
1514
|
+
function fi() {
|
|
1237
1515
|
return [
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1516
|
+
o.contentAttributes.of({ spellcheck: "true" }),
|
|
1517
|
+
ri,
|
|
1518
|
+
v.highest(oi),
|
|
1519
|
+
si.of(!0),
|
|
1520
|
+
li
|
|
1243
1521
|
];
|
|
1244
1522
|
}
|
|
1245
1523
|
function z(e) {
|
|
@@ -1250,20 +1528,20 @@ function B(e) {
|
|
|
1250
1528
|
for (let n = e.indexOf(""); n !== -1; n = e.indexOf("", n + 1)) t.push(n);
|
|
1251
1529
|
return t;
|
|
1252
1530
|
}
|
|
1253
|
-
function
|
|
1531
|
+
function pi(e, t) {
|
|
1254
1532
|
let n = e.indexOf(""), r = 0;
|
|
1255
1533
|
for (; n !== -1 && n < t;) r++, n = e.indexOf("", n + 1);
|
|
1256
1534
|
return r;
|
|
1257
1535
|
}
|
|
1258
1536
|
function V(e, t) {
|
|
1259
|
-
return t -
|
|
1537
|
+
return t - pi(e, t);
|
|
1260
1538
|
}
|
|
1261
1539
|
function H(e, t) {
|
|
1262
1540
|
let n = t;
|
|
1263
1541
|
for (let t of e) t <= n && n++;
|
|
1264
1542
|
return n;
|
|
1265
1543
|
}
|
|
1266
|
-
function
|
|
1544
|
+
function mi(e, t, n = vi) {
|
|
1267
1545
|
let r = [];
|
|
1268
1546
|
for (let i of e) i.to <= i.from || (n(t, i.from, "start") && r.push({
|
|
1269
1547
|
pos: i.from,
|
|
@@ -1274,13 +1552,13 @@ function Ar(e, t, n = Pr) {
|
|
|
1274
1552
|
}));
|
|
1275
1553
|
return r;
|
|
1276
1554
|
}
|
|
1277
|
-
function
|
|
1555
|
+
function hi(e) {
|
|
1278
1556
|
let t = /* @__PURE__ */ new Map();
|
|
1279
1557
|
for (let n of e) t.set(n.pos, (t.get(n.pos) ?? 0) + 1);
|
|
1280
1558
|
return t;
|
|
1281
1559
|
}
|
|
1282
|
-
function
|
|
1283
|
-
let r =
|
|
1560
|
+
function gi(e, t, n = vi) {
|
|
1561
|
+
let r = hi(mi(t, t.length ? z(e) : "", n)), i = [], a = 0, o = 0;
|
|
1284
1562
|
for (;;) {
|
|
1285
1563
|
let t = 0;
|
|
1286
1564
|
for (; a + t < e.length && e[a + t] === "";) t++;
|
|
@@ -1296,37 +1574,39 @@ function Mr(e, t, n = Pr) {
|
|
|
1296
1574
|
a++, o++;
|
|
1297
1575
|
}
|
|
1298
1576
|
}
|
|
1299
|
-
var
|
|
1300
|
-
function
|
|
1301
|
-
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(
|
|
1302
|
-
|
|
1577
|
+
var _i = /^(\s*)(#{1,6}\s|[-*+]\s|\d+[.)]\s|>|`{3,}|~{3,})/;
|
|
1578
|
+
function vi(e, t, n) {
|
|
1579
|
+
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(_i);
|
|
1580
|
+
if (o && t < r + o[0].length) return !1;
|
|
1581
|
+
let s = a.replace(/(`+)(?!`)(.*?[^`])\1(?!`)/g, (e) => " ".repeat(e.length)).slice(0, t - r);
|
|
1582
|
+
return (s.match(/~~/g) ?? []).length % 2 == 0 && (s.match(/(?<!=)==(?!=)/g) ?? []).length % 2 == 0;
|
|
1303
1583
|
}
|
|
1304
1584
|
// src/components/inputs/text-editor/text-editor.annotations.ts
|
|
1305
|
-
var
|
|
1306
|
-
function
|
|
1585
|
+
var yi = m.define(), bi = m.define(), xi = m.define(), Si = m.define();
|
|
1586
|
+
function Ci(e) {
|
|
1307
1587
|
return e.field(U, !1) ?? [];
|
|
1308
1588
|
}
|
|
1309
|
-
function
|
|
1589
|
+
function wi(e, t) {
|
|
1310
1590
|
return e.map((e) => ({
|
|
1311
1591
|
id: e.id,
|
|
1312
1592
|
from: Math.max(0, Math.min(e.start, t)),
|
|
1313
1593
|
to: Math.max(0, Math.min(e.end, t))
|
|
1314
1594
|
})).filter((e) => e.to > e.from);
|
|
1315
1595
|
}
|
|
1316
|
-
function
|
|
1596
|
+
function Ti(e, t) {
|
|
1317
1597
|
return {
|
|
1318
1598
|
from: H(t, e.from),
|
|
1319
1599
|
to: H(t, e.to - 1) + 1
|
|
1320
1600
|
};
|
|
1321
1601
|
}
|
|
1322
|
-
var U =
|
|
1602
|
+
var U = b.define({
|
|
1323
1603
|
create: () => [],
|
|
1324
1604
|
update: (e, t) => {
|
|
1325
|
-
let n = t.effects.find((e) => e.is(
|
|
1605
|
+
let n = t.effects.find((e) => e.is(bi));
|
|
1326
1606
|
return n ? n.value : e;
|
|
1327
1607
|
}
|
|
1328
1608
|
});
|
|
1329
|
-
function
|
|
1609
|
+
function Ei(e) {
|
|
1330
1610
|
let t = [];
|
|
1331
1611
|
for (let n of e.toSorted((e, t) => e.from - t.from || e.to - t.to)) {
|
|
1332
1612
|
let e = t[t.length - 1];
|
|
@@ -1338,13 +1618,13 @@ function Hr(e) {
|
|
|
1338
1618
|
}
|
|
1339
1619
|
return t;
|
|
1340
1620
|
}
|
|
1341
|
-
var
|
|
1342
|
-
function
|
|
1343
|
-
return e.length >
|
|
1621
|
+
var Di = 40;
|
|
1622
|
+
function Oi(e) {
|
|
1623
|
+
return e.length > Di ? `${e.slice(0, Di)}…` : e;
|
|
1344
1624
|
}
|
|
1345
|
-
var
|
|
1625
|
+
var ki = class extends r {
|
|
1346
1626
|
constructor(e, t, n) {
|
|
1347
|
-
super(), this.ids = e, this.quote = t, this.ariaLabel = n(e.length,
|
|
1627
|
+
super(), this.ids = e, this.quote = t, this.ariaLabel = n(e.length, Oi(t));
|
|
1348
1628
|
}
|
|
1349
1629
|
eq(e) {
|
|
1350
1630
|
return e.quote === this.quote && e.ids.length === this.ids.length && e.ids.every((e, t) => e === this.ids[t]) && e.ariaLabel === this.ariaLabel;
|
|
@@ -1354,7 +1634,7 @@ var Gr = class extends t {
|
|
|
1354
1634
|
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;
|
|
1355
1635
|
}
|
|
1356
1636
|
coordsAt(e, t, n) {
|
|
1357
|
-
let r = e.getBoundingClientRect(), i = getComputedStyle(e), a =
|
|
1637
|
+
let r = e.getBoundingClientRect(), i = getComputedStyle(e), a = ct(e) ?? {
|
|
1358
1638
|
top: r.top,
|
|
1359
1639
|
bottom: r.bottom
|
|
1360
1640
|
}, 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);
|
|
@@ -1365,13 +1645,13 @@ var Gr = class extends t {
|
|
|
1365
1645
|
bottom: a.bottom
|
|
1366
1646
|
};
|
|
1367
1647
|
}
|
|
1368
|
-
},
|
|
1648
|
+
}, Ai = t.mark({
|
|
1369
1649
|
class: "cm-annotation",
|
|
1370
1650
|
inclusiveEnd: !0
|
|
1371
|
-
}),
|
|
1651
|
+
}), ji = t.mark({
|
|
1372
1652
|
class: "cm-annotation is-selected",
|
|
1373
1653
|
inclusiveEnd: !0
|
|
1374
|
-
}),
|
|
1654
|
+
}), Mi = t.mark({ class: "is-selected" }), Ni = class e extends r {
|
|
1375
1655
|
eq(t) {
|
|
1376
1656
|
return t instanceof e;
|
|
1377
1657
|
}
|
|
@@ -1383,7 +1663,7 @@ var Gr = class extends t {
|
|
|
1383
1663
|
let r = e.nextElementSibling;
|
|
1384
1664
|
for (; r instanceof HTMLElement && r.classList.contains("cm-widgetBuffer");) r = r.nextElementSibling;
|
|
1385
1665
|
if (!(r instanceof HTMLElement) || !r.classList.contains("cm-annotation")) return null;
|
|
1386
|
-
let i = parseFloat(getComputedStyle(r).paddingInlineStart || "0"), a = r.getClientRects()[0] ?? r.getBoundingClientRect(), o =
|
|
1666
|
+
let i = parseFloat(getComputedStyle(r).paddingInlineStart || "0"), a = r.getClientRects()[0] ?? r.getBoundingClientRect(), o = ct(e) ?? {
|
|
1387
1667
|
top: a.top,
|
|
1388
1668
|
bottom: a.bottom
|
|
1389
1669
|
}, s = t <= 0 ? a.left : a.left + i;
|
|
@@ -1394,11 +1674,11 @@ var Gr = class extends t {
|
|
|
1394
1674
|
bottom: o.bottom
|
|
1395
1675
|
};
|
|
1396
1676
|
}
|
|
1397
|
-
},
|
|
1677
|
+
}, Pi = t.replace({ widget: new Ni() }), Fi = t.mark({}), Ii = t.mark({
|
|
1398
1678
|
class: "cm-annotation-tail",
|
|
1399
1679
|
inclusiveEnd: !0
|
|
1400
1680
|
});
|
|
1401
|
-
function
|
|
1681
|
+
function Li(e, t, n) {
|
|
1402
1682
|
let r = H(n, e.from), i = H(n, e.to - 1) + 1;
|
|
1403
1683
|
return {
|
|
1404
1684
|
docFrom: r,
|
|
@@ -1407,63 +1687,63 @@ function $r(e, t, n) {
|
|
|
1407
1687
|
endSent: i < t.length && t[i] === "" ? i : null
|
|
1408
1688
|
};
|
|
1409
1689
|
}
|
|
1410
|
-
var
|
|
1411
|
-
deco:
|
|
1412
|
-
atomic:
|
|
1690
|
+
var Ri = {
|
|
1691
|
+
deco: t.none,
|
|
1692
|
+
atomic: t.none
|
|
1413
1693
|
};
|
|
1414
|
-
function
|
|
1415
|
-
if (!e.field(U).length) return
|
|
1416
|
-
let
|
|
1694
|
+
function zi(e, n) {
|
|
1695
|
+
if (!e.field(U).length) return Ri;
|
|
1696
|
+
let r = e.doc.toString(), i = e.selection.main, a = B(r), o = r.length - a.length, s = z(r), c = e.field(U).map((e) => ({
|
|
1417
1697
|
id: e.id,
|
|
1418
|
-
from: Math.min(e.from,
|
|
1419
|
-
to: Math.min(e.to,
|
|
1420
|
-
})).filter((e) => e.to > e.from),
|
|
1421
|
-
for (let e of
|
|
1698
|
+
from: Math.min(e.from, o),
|
|
1699
|
+
to: Math.min(e.to, o)
|
|
1700
|
+
})).filter((e) => e.to > e.from), l = [], u = [];
|
|
1701
|
+
for (let e of Ei(c)) {
|
|
1422
1702
|
if (e.to <= e.from) continue;
|
|
1423
|
-
let { docFrom:
|
|
1424
|
-
if (
|
|
1425
|
-
let e = Math.max(
|
|
1426
|
-
t > e &&
|
|
1703
|
+
let { docFrom: o, textTo: c, startSent: d, endSent: f } = Li(e, r, a), p = s.slice(e.from, e.to), m = f === null ? c : c + 1, h = !i.empty && i.from <= o && i.to >= m;
|
|
1704
|
+
if (l.push((h ? ji : Ai).range(o, m)), !h && !i.empty) {
|
|
1705
|
+
let e = Math.max(o, i.from), t = Math.min(m, i.to);
|
|
1706
|
+
t > e && l.push(Mi.range(e, t));
|
|
1427
1707
|
}
|
|
1428
|
-
let
|
|
1429
|
-
|
|
1430
|
-
widget: new
|
|
1708
|
+
let g = f === null ? c : f + 1, _ = r.slice(o, c).match(/\S+$/);
|
|
1709
|
+
_ && l.push(Ii.range(o + (_.index ?? 0), g)), f === null ? l.push(t.widget({
|
|
1710
|
+
widget: new ki(e.ids, p, n),
|
|
1431
1711
|
side: -1
|
|
1432
|
-
}).range(
|
|
1712
|
+
}).range(c)) : (l.push(t.replace({ widget: new ki(e.ids, p, n) }).range(f, f + 1)), u.push(Fi.range(f, f + 1))), d !== null && (l.push(Pi.range(d, d + 1)), u.push(Fi.range(d, d + 1)));
|
|
1433
1713
|
}
|
|
1434
1714
|
return {
|
|
1435
|
-
deco:
|
|
1436
|
-
atomic:
|
|
1715
|
+
deco: t.set(l, !0),
|
|
1716
|
+
atomic: t.set(u, !0)
|
|
1437
1717
|
};
|
|
1438
1718
|
}
|
|
1439
|
-
function
|
|
1440
|
-
return
|
|
1441
|
-
create: (t) =>
|
|
1442
|
-
update: (t, n) => t ===
|
|
1443
|
-
provide: (e) =>
|
|
1719
|
+
function Bi(e) {
|
|
1720
|
+
return b.define({
|
|
1721
|
+
create: (t) => zi(t, e),
|
|
1722
|
+
update: (t, n) => t === Ri && !n.state.field(U).length ? t : n.docChanged || !n.startState.selection.eq(n.state.selection) || n.effects.some((e) => e.is(yi) || e.is(w)) ? zi(n.state, e) : t,
|
|
1723
|
+
provide: (e) => o.decorations.from(e, (e) => e.deco)
|
|
1444
1724
|
});
|
|
1445
1725
|
}
|
|
1446
|
-
var
|
|
1447
|
-
let t = e.effects.find((e) => e.is(
|
|
1448
|
-
if (!e.docChanged && !t || !(t || e.effects.some((e) => e.is(
|
|
1726
|
+
var Vi = re.transactionFilter.of((e) => {
|
|
1727
|
+
let t = e.effects.find((e) => e.is(yi));
|
|
1728
|
+
if (!e.docChanged && !t || !(t || e.effects.some((e) => e.is(Si) || e.is(xi))) && !(e.startState.field(U, !1) ?? []).length) return e;
|
|
1449
1729
|
let n = e.newDoc.toString(), r = z(n).length, i;
|
|
1450
|
-
if (t) i =
|
|
1730
|
+
if (t) i = wi(t.value, r);
|
|
1451
1731
|
else {
|
|
1452
|
-
let t = B(e.startState.doc.toString()), a = e.effects.find((e) => e.is(
|
|
1732
|
+
let t = B(e.startState.doc.toString()), a = e.effects.find((e) => e.is(xi))?.value;
|
|
1453
1733
|
i = (e.startState.field(U, !1) ?? []).map((r) => {
|
|
1454
1734
|
if (a && r.from >= a.from && r.to <= a.to) return {
|
|
1455
1735
|
id: r.id,
|
|
1456
1736
|
from: a.insertAt + (r.from - a.from),
|
|
1457
1737
|
to: a.insertAt + (r.to - a.from)
|
|
1458
1738
|
};
|
|
1459
|
-
let i =
|
|
1739
|
+
let i = Ti(r, t), o = e.changes.mapPos(i.from, -1), s = e.changes.mapPos(i.to, 1);
|
|
1460
1740
|
return {
|
|
1461
1741
|
id: r.id,
|
|
1462
1742
|
from: V(n, o),
|
|
1463
1743
|
to: V(n, s)
|
|
1464
1744
|
};
|
|
1465
1745
|
}).filter((e) => e.to > e.from);
|
|
1466
|
-
let o = e.effects.find((e) => e.is(
|
|
1746
|
+
let o = e.effects.find((e) => e.is(Si))?.value;
|
|
1467
1747
|
o && (i = i.concat(o.anns.map((e) => ({
|
|
1468
1748
|
id: e.id,
|
|
1469
1749
|
from: Math.max(0, Math.min(o.at + e.from, r)),
|
|
@@ -1471,62 +1751,62 @@ var ri = g.transactionFilter.of((e) => {
|
|
|
1471
1751
|
})).filter((e) => e.to > e.from)));
|
|
1472
1752
|
}
|
|
1473
1753
|
return [e, {
|
|
1474
|
-
changes:
|
|
1475
|
-
effects: [
|
|
1754
|
+
changes: gi(n, Ei(i)),
|
|
1755
|
+
effects: [bi.of(i)],
|
|
1476
1756
|
sequential: !0
|
|
1477
1757
|
}];
|
|
1478
|
-
}),
|
|
1479
|
-
if (!e.effects.some((e) => e.is(
|
|
1758
|
+
}), Hi = _e.of((e) => {
|
|
1759
|
+
if (!e.effects.some((e) => e.is(bi))) return [];
|
|
1480
1760
|
let t = e.startState.field(U, !1) ?? [];
|
|
1481
|
-
return [
|
|
1482
|
-
}),
|
|
1483
|
-
function
|
|
1484
|
-
let t =
|
|
1761
|
+
return [bi.of(t)];
|
|
1762
|
+
}), Ui = [o.clipboardOutputFilter.of((e) => z(e)), o.clipboardInputFilter.of((e) => z(e))];
|
|
1763
|
+
function Wi(e) {
|
|
1764
|
+
let t = Bi(e), n = o.atomicRanges.of((e) => e.state.field(t).atomic);
|
|
1485
1765
|
return [
|
|
1486
1766
|
U,
|
|
1487
|
-
|
|
1767
|
+
v.highest(t),
|
|
1488
1768
|
n,
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1769
|
+
Vi,
|
|
1770
|
+
Hi,
|
|
1771
|
+
Ui
|
|
1492
1772
|
];
|
|
1493
1773
|
}
|
|
1494
1774
|
// src/components/inputs/text-editor/text-editor.paste.ts
|
|
1495
|
-
var
|
|
1496
|
-
function
|
|
1775
|
+
var Gi = /^([ \t]*)(?:[•◦▪‣·]|o(?=\t))[ \t]+/, Ki = /^([ \t]*)([-*+]|\d{1,9}[.)])\t+/, qi = /^( *)([-*+]|\d{1,9}[.)]) $/;
|
|
1776
|
+
function Ji(e) {
|
|
1497
1777
|
let t = /^[ \t]*/.exec(e)[0], n = 0;
|
|
1498
1778
|
for (let e of t) n = e === " " ? n + 4 - n % 4 : n + 1;
|
|
1499
1779
|
return " ".repeat(n) + e.slice(t.length);
|
|
1500
1780
|
}
|
|
1501
|
-
var
|
|
1502
|
-
function
|
|
1503
|
-
let { from: n, to: r } = e.selection.main, i = e.doc.lineAt(n), a =
|
|
1781
|
+
var Yi = (e) => /^ */.exec(e)[0].length;
|
|
1782
|
+
function Xi(e, t) {
|
|
1783
|
+
let { from: n, to: r } = e.selection.main, i = e.doc.lineAt(n), a = D(e, n, 1, Ie) ?? D(e, i.from, 1, Ie);
|
|
1504
1784
|
if (a && a.from < n) return null;
|
|
1505
|
-
let o = i.text.slice(0, n - i.from), s =
|
|
1785
|
+
let o = i.text.slice(0, n - i.from), s = qi.exec(o), c = !s && o.trim() !== "";
|
|
1506
1786
|
if (c && (n !== i.to || e.doc.lineAt(r).to !== r)) return null;
|
|
1507
|
-
let l = t.split("\n").map((e) =>
|
|
1787
|
+
let l = t.split("\n").map((e) => Ji(e.replace(Gi, "$1- ").replace(Ki, "$1$2 "))), u = l.filter((e) => e.trim() !== "");
|
|
1508
1788
|
if (u.length === 0) return null;
|
|
1509
|
-
let d = Math.min(...u.map(
|
|
1789
|
+
let d = Math.min(...u.map(Yi));
|
|
1510
1790
|
l = l.map((e) => e.trim() === "" ? "" : e.slice(d));
|
|
1511
|
-
let f = l.find((e) => e.trim() !== ""), p =
|
|
1791
|
+
let f = l.find((e) => e.trim() !== ""), p = P.test(f) && /\S/.test(f.replace(P, ""));
|
|
1512
1792
|
if (c && (!p || u.length < 2)) return null;
|
|
1513
1793
|
let m = 0, h = n;
|
|
1514
1794
|
if (c) {
|
|
1515
|
-
let t =
|
|
1795
|
+
let t = F(e, i.number + 1);
|
|
1516
1796
|
return t.length && (m = d > 0 ? t[0].contentCol : t[0].markerCol), {
|
|
1517
1797
|
from: n,
|
|
1518
1798
|
to: r,
|
|
1519
|
-
insert: "\n" +
|
|
1799
|
+
insert: "\n" + Zi(l, m).join("\n")
|
|
1520
1800
|
};
|
|
1521
1801
|
}
|
|
1522
1802
|
if (p) {
|
|
1523
|
-
let t =
|
|
1803
|
+
let t = F(e, i.number);
|
|
1524
1804
|
if (s) {
|
|
1525
1805
|
h = i.from;
|
|
1526
1806
|
let e = s[1].length;
|
|
1527
1807
|
m = d > 0 ? t.length ? t[0].contentCol : e + s[2].length + 1 : e;
|
|
1528
1808
|
} else h = i.from, t.length && (m = d > 0 || o.length > 0 ? t[0].contentCol : t[0].markerCol);
|
|
1529
|
-
l =
|
|
1809
|
+
l = Zi(l, m);
|
|
1530
1810
|
} else if ((s || d === 0) && l.join("\n") === t) return null;
|
|
1531
1811
|
let g = l.join("\n");
|
|
1532
1812
|
return g === e.sliceDoc(h, n) + t ? null : {
|
|
@@ -1535,11 +1815,11 @@ function fi(e, t) {
|
|
|
1535
1815
|
insert: g
|
|
1536
1816
|
};
|
|
1537
1817
|
}
|
|
1538
|
-
function
|
|
1818
|
+
function Zi(e, t) {
|
|
1539
1819
|
let n = [];
|
|
1540
1820
|
return e.map((e) => {
|
|
1541
1821
|
if (e.trim() === "") return "";
|
|
1542
|
-
let r =
|
|
1822
|
+
let r = Yi(e), i = P.exec(e);
|
|
1543
1823
|
if (i) {
|
|
1544
1824
|
for (; n.length && n[n.length - 1].orig >= r;) n.pop();
|
|
1545
1825
|
let a = n.length ? n[n.length - 1].content : t;
|
|
@@ -1553,13 +1833,13 @@ function pi(e, t) {
|
|
|
1553
1833
|
});
|
|
1554
1834
|
}
|
|
1555
1835
|
// src/components/inputs/text-editor/text-editor.clipboard.ts
|
|
1556
|
-
var
|
|
1836
|
+
var Qi = class {
|
|
1557
1837
|
constructor() {
|
|
1558
1838
|
this.cut = null;
|
|
1559
1839
|
}
|
|
1560
1840
|
annotationsInSelection(e) {
|
|
1561
1841
|
let { from: t, to: n } = e.state.selection.main, r = e.state.doc.toString(), i = V(r, t), a = V(r, n);
|
|
1562
|
-
return
|
|
1842
|
+
return Ci(e.state).filter((e) => e.from >= i && e.to <= a).map((e) => ({
|
|
1563
1843
|
id: e.id,
|
|
1564
1844
|
from: e.from - i,
|
|
1565
1845
|
to: e.to - i
|
|
@@ -1582,12 +1862,12 @@ var mi = class {
|
|
|
1582
1862
|
paste(e, t, n = !1) {
|
|
1583
1863
|
let r = z(t).replace(/\r\n?/g, "\n");
|
|
1584
1864
|
if (!r || e.state.readOnly) return;
|
|
1585
|
-
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 = V(e.state.doc.toString(), e.state.selection.main.from), s = a || n ? null :
|
|
1865
|
+
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 = V(e.state.doc.toString(), e.state.selection.main.from), s = a || n ? null : Xi(e.state, r), c = e.state.selection.main.to, l = {
|
|
1586
1866
|
...e.state.replaceSelection(r),
|
|
1587
1867
|
userEvent: "input.paste"
|
|
1588
1868
|
}, u = e.state.update(a ? {
|
|
1589
1869
|
...l,
|
|
1590
|
-
effects:
|
|
1870
|
+
effects: Si.of({
|
|
1591
1871
|
at: o,
|
|
1592
1872
|
anns: i.anns
|
|
1593
1873
|
})
|
|
@@ -1602,27 +1882,27 @@ var mi = class {
|
|
|
1602
1882
|
},
|
|
1603
1883
|
selection: { anchor: d + s.insert.length },
|
|
1604
1884
|
userEvent: "input.complete",
|
|
1605
|
-
annotations:
|
|
1885
|
+
annotations: le.of("before")
|
|
1606
1886
|
});
|
|
1607
1887
|
}
|
|
1608
|
-
},
|
|
1609
|
-
function
|
|
1610
|
-
|
|
1888
|
+
}, $i = 200, ea = /* @__PURE__ */ new WeakSet();
|
|
1889
|
+
function ta(e) {
|
|
1890
|
+
ea.has(e) || e.hasFocus || e.dispatch({ selection: { anchor: e.state.doc.length } });
|
|
1611
1891
|
}
|
|
1612
|
-
function
|
|
1892
|
+
function na() {
|
|
1613
1893
|
let e = 0, t = 0, n = () => (t = Date.now(), !1);
|
|
1614
1894
|
return [
|
|
1615
|
-
|
|
1616
|
-
e.transactions.some((e) => e.selection) &&
|
|
1895
|
+
o.updateListener.of((e) => {
|
|
1896
|
+
e.transactions.some((e) => e.selection) && ea.add(e.view);
|
|
1617
1897
|
}),
|
|
1618
|
-
|
|
1619
|
-
focus: (t, n) => (
|
|
1898
|
+
o.domEventHandlers({
|
|
1899
|
+
focus: (t, n) => (ea.add(n), e = Date.now(), !1),
|
|
1620
1900
|
keydown: n,
|
|
1621
1901
|
pointerdown: n,
|
|
1622
1902
|
touchstart: n
|
|
1623
1903
|
}),
|
|
1624
|
-
|
|
1625
|
-
if (n.docChanged || !n.selection || !n.isUserEvent("select") || n.isUserEvent("select.pointer") || Date.now() - e >
|
|
1904
|
+
re.transactionFilter.of((n) => {
|
|
1905
|
+
if (n.docChanged || !n.selection || !n.isUserEvent("select") || n.isUserEvent("select.pointer") || Date.now() - e > $i || t >= e) return n;
|
|
1626
1906
|
let r = n.startState.selection.main, i = n.selection.main;
|
|
1627
1907
|
if (r.from === 0 || i.from !== 0) return n;
|
|
1628
1908
|
let a = i.anchor === 0 ? i.head : i.anchor;
|
|
@@ -1634,12 +1914,13 @@ function vi() {
|
|
|
1634
1914
|
];
|
|
1635
1915
|
}
|
|
1636
1916
|
// src/components/inputs/text-editor/text-editor.commands.ts
|
|
1637
|
-
var
|
|
1917
|
+
var ra = {
|
|
1638
1918
|
bold: !1,
|
|
1639
1919
|
italic: !1,
|
|
1640
1920
|
inlineCode: !1,
|
|
1641
1921
|
codeBlock: !1,
|
|
1642
1922
|
strikethrough: !1,
|
|
1923
|
+
highlight: !1,
|
|
1643
1924
|
link: !1,
|
|
1644
1925
|
bulletList: !1,
|
|
1645
1926
|
orderedList: !1,
|
|
@@ -1648,67 +1929,67 @@ var yi = {
|
|
|
1648
1929
|
heading: 0
|
|
1649
1930
|
};
|
|
1650
1931
|
function W(e, t, n, r = 1) {
|
|
1651
|
-
return
|
|
1932
|
+
return D(e.state, t, r, n);
|
|
1652
1933
|
}
|
|
1653
|
-
function
|
|
1934
|
+
function ia(e, t, n) {
|
|
1654
1935
|
let r = W(e, t, n, -1), i = W(e, t, n, 1);
|
|
1655
1936
|
return r && i && r.from === i.from && r.to === i.to ? i : null;
|
|
1656
1937
|
}
|
|
1657
|
-
function G(t, n
|
|
1658
|
-
if (
|
|
1659
|
-
|
|
1660
|
-
let { state:
|
|
1661
|
-
|
|
1662
|
-
let
|
|
1663
|
-
if (!
|
|
1664
|
-
let
|
|
1665
|
-
if (
|
|
1666
|
-
let
|
|
1667
|
-
if (
|
|
1668
|
-
let
|
|
1669
|
-
from:
|
|
1670
|
-
to:
|
|
1671
|
-
name:
|
|
1672
|
-
marker:
|
|
1938
|
+
function G(e, t, n) {
|
|
1939
|
+
if (e.state.readOnly) return;
|
|
1940
|
+
ta(e);
|
|
1941
|
+
let { state: r } = e, i = t.length, a = r.field(M, !1);
|
|
1942
|
+
e.dispatch(r.changeByRange((o) => {
|
|
1943
|
+
let s = r.sliceDoc(o.from, o.to), c = /^\s*/.exec(s)[0].length;
|
|
1944
|
+
if (!o.empty && c === s.length) return { range: o };
|
|
1945
|
+
let l = o.from + c, u = o.to - /\s*$/.exec(s)[0].length, d = W(e, l, n) ?? (a && a.name === n && l >= a.from && u <= a.to ? a : null);
|
|
1946
|
+
if (d) {
|
|
1947
|
+
let e = r.sliceDoc(d.from + i, d.to - i);
|
|
1948
|
+
if (o.empty && l === d.to - i && e.trim()) {
|
|
1949
|
+
let e = {
|
|
1950
|
+
from: d.from,
|
|
1951
|
+
to: d.to,
|
|
1952
|
+
name: n,
|
|
1953
|
+
marker: r.sliceDoc(d.from, d.from + i),
|
|
1673
1954
|
live: !1
|
|
1674
|
-
},
|
|
1675
|
-
for (; /[ \t]/.test(
|
|
1955
|
+
}, t = bn.has(n) ? Nn(r, e) : [], a = d.to;
|
|
1956
|
+
for (; /[ \t]/.test(r.sliceDoc(a, a + 1));) a++;
|
|
1676
1957
|
return {
|
|
1677
|
-
changes:
|
|
1678
|
-
range:
|
|
1958
|
+
changes: t,
|
|
1959
|
+
range: g.cursor(a)
|
|
1679
1960
|
};
|
|
1680
1961
|
}
|
|
1681
|
-
let
|
|
1682
|
-
from:
|
|
1683
|
-
to:
|
|
1962
|
+
let t = r.changes([{
|
|
1963
|
+
from: d.from,
|
|
1964
|
+
to: d.from + i
|
|
1684
1965
|
}, {
|
|
1685
|
-
from:
|
|
1686
|
-
to:
|
|
1966
|
+
from: d.to - i,
|
|
1967
|
+
to: d.to
|
|
1687
1968
|
}]);
|
|
1688
1969
|
return {
|
|
1689
|
-
changes:
|
|
1690
|
-
range:
|
|
1970
|
+
changes: t,
|
|
1971
|
+
range: g.range(t.mapPos(o.anchor), t.mapPos(o.head))
|
|
1691
1972
|
};
|
|
1692
1973
|
}
|
|
1693
1974
|
return {
|
|
1694
1975
|
changes: [{
|
|
1695
|
-
from:
|
|
1696
|
-
insert:
|
|
1976
|
+
from: l,
|
|
1977
|
+
insert: t
|
|
1697
1978
|
}, {
|
|
1698
|
-
from: d,
|
|
1699
|
-
insert: n
|
|
1700
|
-
}],
|
|
1701
|
-
range: e.range(u + a, d + a),
|
|
1702
|
-
effects: s.empty && s === i.selection.main && sn.has(r) ? un.of({
|
|
1703
1979
|
from: u,
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1980
|
+
insert: t
|
|
1981
|
+
}],
|
|
1982
|
+
range: g.range(l + i, u + i),
|
|
1983
|
+
effects: o.empty && o === r.selection.main && bn.has(n) ? Cn.of({
|
|
1984
|
+
from: l,
|
|
1985
|
+
to: l + 2 * i,
|
|
1986
|
+
name: n,
|
|
1987
|
+
marker: t
|
|
1707
1988
|
}) : void 0
|
|
1708
1989
|
};
|
|
1709
|
-
})),
|
|
1990
|
+
})), e.focus();
|
|
1710
1991
|
}
|
|
1711
|
-
function
|
|
1992
|
+
function aa(e, t) {
|
|
1712
1993
|
let n = e.text;
|
|
1713
1994
|
if (t === n) return null;
|
|
1714
1995
|
let r = 0;
|
|
@@ -1721,7 +2002,7 @@ function xi(e, t) {
|
|
|
1721
2002
|
insert: t.slice(r, t.length - i)
|
|
1722
2003
|
};
|
|
1723
2004
|
}
|
|
1724
|
-
function
|
|
2005
|
+
function oa(e, t) {
|
|
1725
2006
|
if (t.length) {
|
|
1726
2007
|
let { state: n } = e, r = n.changes(t), i = n.selection.main;
|
|
1727
2008
|
e.dispatch({
|
|
@@ -1746,54 +2027,54 @@ function q(e, t) {
|
|
|
1746
2027
|
if (e.state.readOnly) return;
|
|
1747
2028
|
let { state: n } = e, { first: r, last: i } = K(e), a = [];
|
|
1748
2029
|
for (let e = r; e <= i; e++) {
|
|
1749
|
-
let r = n.doc.line(e), i =
|
|
2030
|
+
let r = n.doc.line(e), i = aa(r, t(r.text));
|
|
1750
2031
|
i && a.push(i);
|
|
1751
2032
|
}
|
|
1752
|
-
|
|
2033
|
+
oa(e, a);
|
|
1753
2034
|
}
|
|
1754
|
-
function
|
|
2035
|
+
function sa(e, t) {
|
|
1755
2036
|
let { first: n, last: r } = K(e);
|
|
1756
2037
|
for (let i = n; i <= r; i++) if (!t(e.state.doc.line(i).text)) return !1;
|
|
1757
2038
|
return !0;
|
|
1758
2039
|
}
|
|
1759
|
-
function
|
|
2040
|
+
function ca(e, t) {
|
|
1760
2041
|
q(e, (e) => {
|
|
1761
2042
|
let n = e.match(/^(#{1,6})\s+/), r = n ? n[1].length : 0, i = n ? e.slice(n[0].length) : e;
|
|
1762
2043
|
return t === 0 || r === t ? i : `${"#".repeat(t)} ${i}`;
|
|
1763
2044
|
});
|
|
1764
2045
|
}
|
|
1765
|
-
function
|
|
2046
|
+
function la(e, t) {
|
|
1766
2047
|
q(e, (e) => {
|
|
1767
2048
|
let n = e.replace(/^#{1,6}\s+/, "");
|
|
1768
2049
|
return t === 0 ? n : `${"#".repeat(t)} ${n}`;
|
|
1769
2050
|
});
|
|
1770
2051
|
}
|
|
1771
|
-
function
|
|
1772
|
-
let t = /^(\s*)[-*+]\s+/, { loneBlank: n } = K(e), r = !n &&
|
|
2052
|
+
function ua(e) {
|
|
2053
|
+
let t = /^(\s*)[-*+]\s+/, { loneBlank: n } = K(e), r = !n && sa(e, (e) => t.test(e) || e.trim() === "");
|
|
1773
2054
|
q(e, (e) => e.trim() === "" && !n ? e : r ? e.replace(t, "$1") : t.test(e) ? e : e.replace(/^(\s*)/, "$1- "));
|
|
1774
2055
|
}
|
|
1775
|
-
var
|
|
1776
|
-
function
|
|
1777
|
-
let { loneBlank: t } = K(e), n = !t &&
|
|
1778
|
-
q(e, (e) => e.trim() === "" && !t ? e : n ? e.replace(
|
|
2056
|
+
var da = /^(\s*)[-*+]\s+\[[ xX]\]\s+/;
|
|
2057
|
+
function fa(e) {
|
|
2058
|
+
let { loneBlank: t } = K(e), n = !t && sa(e, (e) => da.test(e) || e.trim() === "");
|
|
2059
|
+
q(e, (e) => e.trim() === "" && !t ? e : n ? e.replace(da, "$1- ") : da.test(e) ? e : e.replace(J, "$1").replace(/^(\s*)/, "$1- [ ] "));
|
|
1779
2060
|
}
|
|
1780
|
-
var J = /^(\s*)(?:[-*+]|\d+[.)])(?:\s+|$)/,
|
|
1781
|
-
function
|
|
2061
|
+
var J = /^(\s*)(?:[-*+]|\d+[.)])(?:\s+|$)/, pa = /^(\s*)\[[ xX]\]\s+/;
|
|
2062
|
+
function ma(e, t) {
|
|
1782
2063
|
if (e.state.readOnly) return;
|
|
1783
2064
|
let { state: n } = e, { first: r, last: i, loneBlank: a } = K(e), o = [], s = 0;
|
|
1784
2065
|
for (let e = r; e <= i; e++) {
|
|
1785
|
-
let r = n.doc.line(e), i = r.text.replace(J, t === "none" ? "" : "$1"), c = i !== r.text, l = c ? i.replace(
|
|
2066
|
+
let r = n.doc.line(e), i = r.text.replace(J, t === "none" ? "" : "$1"), c = i !== r.text, l = c ? i.replace(pa, t === "none" ? "" : "$1") : i, u = l;
|
|
1786
2067
|
if (t !== "none" && (l.trim() !== "" || c || a)) {
|
|
1787
2068
|
s += 1;
|
|
1788
2069
|
let e = t === "bullet" ? "- " : t === "task" ? "- [ ] " : `${s}. `;
|
|
1789
2070
|
u = l.replace(/^(\s*)/, `$1${e}`);
|
|
1790
2071
|
}
|
|
1791
|
-
let d =
|
|
2072
|
+
let d = aa(r, u);
|
|
1792
2073
|
d && o.push(d);
|
|
1793
2074
|
}
|
|
1794
|
-
|
|
2075
|
+
oa(e, o);
|
|
1795
2076
|
}
|
|
1796
|
-
function
|
|
2077
|
+
function ha(e, t, n) {
|
|
1797
2078
|
for (let r = t - 1; r >= 1; r--) {
|
|
1798
2079
|
let t = e.doc.line(r).text;
|
|
1799
2080
|
if (t.trim() === "") continue;
|
|
@@ -1803,13 +2084,13 @@ function ji(e, t, n) {
|
|
|
1803
2084
|
}
|
|
1804
2085
|
return null;
|
|
1805
2086
|
}
|
|
1806
|
-
function
|
|
2087
|
+
function ga(e) {
|
|
1807
2088
|
if (e.state.readOnly) return;
|
|
1808
2089
|
let { state: t } = e, { from: n, to: r } = t.selection.main, i = t.doc.lineAt(n).number, a = t.doc.lineAt(r).number, o = [];
|
|
1809
2090
|
for (let e = i; e <= a; e++) {
|
|
1810
2091
|
let n = t.doc.line(e), r = n.text.match(J);
|
|
1811
2092
|
if (!r) continue;
|
|
1812
|
-
let i = r[1].length, a =
|
|
2093
|
+
let i = r[1].length, a = ha(t, e, (e) => e <= i)?.[0].length ?? -1;
|
|
1813
2094
|
a > i && o.push({
|
|
1814
2095
|
from: n.from,
|
|
1815
2096
|
insert: " ".repeat(a - i)
|
|
@@ -1817,7 +2098,7 @@ function Mi(e) {
|
|
|
1817
2098
|
}
|
|
1818
2099
|
o.length && e.dispatch({ changes: o }), e.focus();
|
|
1819
2100
|
}
|
|
1820
|
-
function
|
|
2101
|
+
function _a(e) {
|
|
1821
2102
|
if (e.state.readOnly) return;
|
|
1822
2103
|
let { state: t } = e, { from: n, to: r } = t.selection.main, i = t.doc.lineAt(n).number, a = t.doc.lineAt(r).number, o = [];
|
|
1823
2104
|
for (let e = i; e <= a; e++) {
|
|
@@ -1825,7 +2106,7 @@ function Ni(e) {
|
|
|
1825
2106
|
if (!r) continue;
|
|
1826
2107
|
let i = r[1].length;
|
|
1827
2108
|
if (i === 0) continue;
|
|
1828
|
-
let a =
|
|
2109
|
+
let a = ha(t, e, (e) => e < i)?.[1].length ?? 0;
|
|
1829
2110
|
o.push({
|
|
1830
2111
|
from: n.from,
|
|
1831
2112
|
to: n.from + (i - a)
|
|
@@ -1833,23 +2114,23 @@ function Ni(e) {
|
|
|
1833
2114
|
}
|
|
1834
2115
|
o.length && e.dispatch({ changes: o }), e.focus();
|
|
1835
2116
|
}
|
|
1836
|
-
function
|
|
2117
|
+
function va(e) {
|
|
1837
2118
|
let { state: t } = e, n = t.doc.lineAt(t.selection.main.head), r = n.text.match(J);
|
|
1838
2119
|
if (!r) return !1;
|
|
1839
|
-
let i = r[1].length, a =
|
|
2120
|
+
let i = r[1].length, a = ha(t, n.number, (e) => e <= i);
|
|
1840
2121
|
return a !== null && a[0].length > i;
|
|
1841
2122
|
}
|
|
1842
|
-
function
|
|
2123
|
+
function ya(e) {
|
|
1843
2124
|
let t = e.state.doc.lineAt(e.state.selection.main.head).text.match(J);
|
|
1844
2125
|
return !!t && t[1].length > 0;
|
|
1845
2126
|
}
|
|
1846
|
-
function
|
|
2127
|
+
function ba(e) {
|
|
1847
2128
|
if (e.state.readOnly) return !0;
|
|
1848
2129
|
let { state: t } = e, n = t.selection.main;
|
|
1849
2130
|
if (!n.empty) return !1;
|
|
1850
2131
|
let r = t.doc.lineAt(n.head), i = r.text.match(/^(\s*)(?:\d+[.)]|[-*+])\s/);
|
|
1851
|
-
if (!i || n.head !== r.from + i[0].length ||
|
|
1852
|
-
let a = i[1].length, o = a > 0 ?
|
|
2132
|
+
if (!i || n.head !== r.from + i[0].length || Re(t, r.from)) return !1;
|
|
2133
|
+
let a = i[1].length, o = a > 0 ? F(t, r.number).find((e) => e.markerCol < a) : void 0;
|
|
1853
2134
|
if (o) {
|
|
1854
2135
|
let t = r.from + a, i = " ".repeat(o.markerCol);
|
|
1855
2136
|
return e.dispatch({
|
|
@@ -1871,40 +2152,40 @@ function Ii(e) {
|
|
|
1871
2152
|
userEvent: "delete.backward"
|
|
1872
2153
|
}), !0;
|
|
1873
2154
|
}
|
|
1874
|
-
function
|
|
1875
|
-
let t = /^(\s*)>\s?/, n =
|
|
2155
|
+
function xa(e) {
|
|
2156
|
+
let t = /^(\s*)>\s?/, n = sa(e, (e) => t.test(e) || e.trim() === "");
|
|
1876
2157
|
q(e, (e) => e.trim() === "" ? e : n ? e.replace(t, "$1") : t.test(e) ? e : e.replace(/^(\s*)/, "$1> "));
|
|
1877
2158
|
}
|
|
1878
|
-
function
|
|
2159
|
+
function Sa(e, t) {
|
|
1879
2160
|
let n = W(e, t, "Link");
|
|
1880
|
-
return n && !
|
|
2161
|
+
return n && !O(e.state, n) ? n : null;
|
|
1881
2162
|
}
|
|
1882
|
-
function
|
|
1883
|
-
if (
|
|
1884
|
-
let
|
|
1885
|
-
if (
|
|
1886
|
-
let
|
|
1887
|
-
|
|
2163
|
+
function Ca(e, t = "") {
|
|
2164
|
+
if (e.state.readOnly) return;
|
|
2165
|
+
let n = Sa(e, e.state.selection.main.head);
|
|
2166
|
+
if (n) {
|
|
2167
|
+
let t = e.state.sliceDoc(n.from, n.to).replace(/^\[(.*)\]\([^)]*\)$/, "$1");
|
|
2168
|
+
e.dispatch({
|
|
1888
2169
|
changes: {
|
|
1889
|
-
from:
|
|
1890
|
-
to:
|
|
1891
|
-
insert:
|
|
2170
|
+
from: n.from,
|
|
2171
|
+
to: n.to,
|
|
2172
|
+
insert: t
|
|
1892
2173
|
},
|
|
1893
|
-
selection:
|
|
1894
|
-
}),
|
|
1895
|
-
} else
|
|
1896
|
-
let
|
|
1897
|
-
return
|
|
2174
|
+
selection: g.range(n.from, n.from + t.length)
|
|
2175
|
+
}), e.focus();
|
|
2176
|
+
} else e.dispatch(e.state.changeByRange((n) => {
|
|
2177
|
+
let r = e.state.sliceDoc(n.from, n.to), i = `[${r}](${t})`, a;
|
|
2178
|
+
return a = r ? t ? n.from + i.length : n.from + 1 + r.length + 2 : n.from + 1, {
|
|
1898
2179
|
changes: {
|
|
1899
|
-
from:
|
|
1900
|
-
to:
|
|
1901
|
-
insert:
|
|
2180
|
+
from: n.from,
|
|
2181
|
+
to: n.to,
|
|
2182
|
+
insert: i
|
|
1902
2183
|
},
|
|
1903
|
-
range:
|
|
2184
|
+
range: g.cursor(a)
|
|
1904
2185
|
};
|
|
1905
|
-
})),
|
|
2186
|
+
})), e.focus();
|
|
1906
2187
|
}
|
|
1907
|
-
function
|
|
2188
|
+
function wa(e) {
|
|
1908
2189
|
if (e.state.readOnly) return;
|
|
1909
2190
|
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;
|
|
1910
2191
|
o?.text.trim().startsWith("```") && s?.text.trim().startsWith("```") && o && s ? e.dispatch({ changes: [{
|
|
@@ -1921,27 +2202,28 @@ function Bi(e) {
|
|
|
1921
2202
|
insert: "\n```"
|
|
1922
2203
|
}] }), e.focus();
|
|
1923
2204
|
}
|
|
1924
|
-
function
|
|
1925
|
-
let { state: t } = e, n = t.selection.main.head, r = t.field(
|
|
2205
|
+
function Ta(e) {
|
|
2206
|
+
let { state: t } = e, n = t.selection.main.head, r = t.field(M, !1), i = (t) => ia(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 = Re(t, o);
|
|
1926
2207
|
return {
|
|
1927
2208
|
bold: i("StrongEmphasis"),
|
|
1928
2209
|
italic: i("Emphasis"),
|
|
1929
2210
|
inlineCode: i("InlineCode"),
|
|
1930
2211
|
codeBlock: c,
|
|
1931
2212
|
strikethrough: i("Strikethrough"),
|
|
1932
|
-
|
|
1933
|
-
|
|
2213
|
+
highlight: i("Highlight"),
|
|
2214
|
+
link: Sa(e, n) !== null,
|
|
2215
|
+
bulletList: !c && /^\s*[-*+]\s/.test(a) && !Ve(t, o),
|
|
1934
2216
|
orderedList: !c && /^\s*\d+[.)]\s/.test(a),
|
|
1935
|
-
taskList: !c &&
|
|
2217
|
+
taskList: !c && da.test(a),
|
|
1936
2218
|
quote: W(e, o, "Blockquote") !== null,
|
|
1937
2219
|
heading: c || !s ? 0 : s[1].length
|
|
1938
2220
|
};
|
|
1939
2221
|
}
|
|
1940
2222
|
// src/components/inputs/text-editor/text-editor.keymap.ts
|
|
1941
|
-
var
|
|
2223
|
+
var Ea = [v.highest(l.of([{
|
|
1942
2224
|
key: "Backspace",
|
|
1943
|
-
run:
|
|
1944
|
-
}])),
|
|
2225
|
+
run: ba
|
|
2226
|
+
}])), l.of([
|
|
1945
2227
|
{
|
|
1946
2228
|
key: "Mod-b",
|
|
1947
2229
|
run: (e) => (G(e, "**", "StrongEmphasis"), !0)
|
|
@@ -1956,37 +2238,37 @@ var Hi = [y.highest(n.of([{
|
|
|
1956
2238
|
},
|
|
1957
2239
|
{
|
|
1958
2240
|
key: "Mod-k",
|
|
1959
|
-
run: (e) => (
|
|
2241
|
+
run: (e) => (Ca(e), !0)
|
|
1960
2242
|
},
|
|
1961
2243
|
{
|
|
1962
2244
|
key: "Backspace",
|
|
1963
|
-
run: (e) =>
|
|
2245
|
+
run: (e) => st(e, -1)
|
|
1964
2246
|
},
|
|
1965
2247
|
{
|
|
1966
2248
|
key: "Delete",
|
|
1967
|
-
run: (e) =>
|
|
2249
|
+
run: (e) => st(e, 1)
|
|
1968
2250
|
},
|
|
1969
2251
|
{
|
|
1970
2252
|
key: "Mod-]",
|
|
1971
|
-
run: (e) => (
|
|
2253
|
+
run: (e) => (ga(e), !0)
|
|
1972
2254
|
},
|
|
1973
2255
|
{
|
|
1974
2256
|
key: "Mod-[",
|
|
1975
|
-
run: (e) => (
|
|
2257
|
+
run: (e) => (_a(e), !0)
|
|
1976
2258
|
},
|
|
1977
2259
|
{
|
|
1978
2260
|
key: "Backspace",
|
|
1979
|
-
run: (e) => !
|
|
1980
|
-
shift:
|
|
2261
|
+
run: (e) => !di(e, "Backspace") && ge(e),
|
|
2262
|
+
shift: ge
|
|
1981
2263
|
},
|
|
1982
2264
|
{
|
|
1983
2265
|
key: "Delete",
|
|
1984
|
-
run: (e) => !
|
|
2266
|
+
run: (e) => !di(e, "Delete") && fe(e)
|
|
1985
2267
|
},
|
|
1986
|
-
...
|
|
1987
|
-
...
|
|
1988
|
-
])],
|
|
1989
|
-
function
|
|
2268
|
+
...me.filter((e) => e.key !== "Backspace" && e.key !== "Delete"),
|
|
2269
|
+
...he
|
|
2270
|
+
])], Da = /^(\s*)(\d+)[.)](?=\s|$)/, Oa = /^(?:[ ]{0,3}>[ ]?)*/, ka = /^\s*(?:```|~~~)/, Aa = /^\s*[-*+]\s+\S/, ja = /^\s*(?:#{1,6}(?:\s|$)|[-*+](?:\s|$)|(?:(?:-[ \t]*){3,}|(?:\*[ \t]*){3,}|(?:_[ \t]*){3,})$)/, Ma = 1e3;
|
|
2271
|
+
function Na(e) {
|
|
1990
2272
|
let t = [], n = [], r = (e) => {
|
|
1991
2273
|
let t = 0;
|
|
1992
2274
|
for (; t < n.length && e >= n[t].content;) t++;
|
|
@@ -1994,53 +2276,53 @@ function Yi(e) {
|
|
|
1994
2276
|
}, i = 0, a = !1, o = 0, s = -1;
|
|
1995
2277
|
for (let c of e.split("\n")) {
|
|
1996
2278
|
let e = i;
|
|
1997
|
-
if (i += c.length + 1,
|
|
2279
|
+
if (i += c.length + 1, ka.test(c)) {
|
|
1998
2280
|
a = !a, n.length = 0, o = 0, s = -1;
|
|
1999
2281
|
continue;
|
|
2000
2282
|
}
|
|
2001
2283
|
if (a) continue;
|
|
2002
|
-
let l =
|
|
2284
|
+
let l = Oa.exec(c)[0], u = c.slice(l.length), d = (l.match(/>/g) ?? []).length, f = Da.exec(u);
|
|
2003
2285
|
if (f) {
|
|
2004
|
-
let e = d *
|
|
2005
|
-
e - Math.max(t > 0 ? n[t - 1].content : 0, d *
|
|
2286
|
+
let e = d * Ma + f[1].length, t = r(e);
|
|
2287
|
+
e - Math.max(t > 0 ? n[t - 1].content : 0, d * Ma) >= 4 && (f = null);
|
|
2006
2288
|
}
|
|
2007
2289
|
if (!f) {
|
|
2008
2290
|
if (u.trim() === "") {
|
|
2009
2291
|
++o >= 2 && (n.length = 0), s = -1;
|
|
2010
2292
|
continue;
|
|
2011
2293
|
}
|
|
2012
|
-
if (o = 0, s >= d && n.length && !
|
|
2013
|
-
s =
|
|
2294
|
+
if (o = 0, s >= d && n.length && !ja.test(u)) continue;
|
|
2295
|
+
s = Aa.test(u) ? d : -1, n.length = r(d * Ma + /^\s*/.exec(u)[0].length);
|
|
2014
2296
|
continue;
|
|
2015
2297
|
}
|
|
2016
2298
|
o = 0, s = u.slice(f[0].length).trim() === "" ? -1 : d;
|
|
2017
|
-
let p = f[1].length, m = d *
|
|
2299
|
+
let p = f[1].length, m = d * Ma + 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), y;
|
|
2018
2300
|
if (v < n.length) {
|
|
2019
2301
|
n.length = v + 1;
|
|
2020
2302
|
let e = n[v];
|
|
2021
|
-
|
|
2022
|
-
} else
|
|
2303
|
+
y = e.next, e.next += 1, e.indent = m, e.content = _;
|
|
2304
|
+
} else y = 1, n.push({
|
|
2023
2305
|
indent: m,
|
|
2024
2306
|
content: _,
|
|
2025
2307
|
next: 2
|
|
2026
2308
|
});
|
|
2027
|
-
let
|
|
2028
|
-
if (
|
|
2309
|
+
let b = String(y);
|
|
2310
|
+
if (b !== h) {
|
|
2029
2311
|
let n = e + l.length + p;
|
|
2030
2312
|
t.push({
|
|
2031
2313
|
from: n,
|
|
2032
2314
|
to: n + h.length,
|
|
2033
|
-
insert:
|
|
2315
|
+
insert: b
|
|
2034
2316
|
});
|
|
2035
2317
|
}
|
|
2036
2318
|
}
|
|
2037
2319
|
return t;
|
|
2038
2320
|
}
|
|
2039
|
-
function
|
|
2040
|
-
let t =
|
|
2041
|
-
return n.trim() === "" ? "blank" :
|
|
2321
|
+
function Pa(e) {
|
|
2322
|
+
let t = Oa.exec(e)[0], n = e.slice(t.length);
|
|
2323
|
+
return n.trim() === "" ? "blank" : Da.test(n) ? "ordered" : ja.test(n) || ka.test(n) ? "block" : `plain${(t.match(/>/g) ?? []).length}`;
|
|
2042
2324
|
}
|
|
2043
|
-
function
|
|
2325
|
+
function Fa(e) {
|
|
2044
2326
|
let t = !1;
|
|
2045
2327
|
return e.changes.iterChanges((n, r, i, a, o) => {
|
|
2046
2328
|
if (t) return;
|
|
@@ -2049,27 +2331,27 @@ function Zi(e) {
|
|
|
2049
2331
|
t = !0;
|
|
2050
2332
|
return;
|
|
2051
2333
|
}
|
|
2052
|
-
let c = (e) =>
|
|
2053
|
-
(c(l) || c(u) || c(e.newDoc.lineAt(a).text) ||
|
|
2334
|
+
let c = (e) => Pa(e) === "ordered", l = s.lineAt(n).text, u = e.newDoc.lineAt(i).text;
|
|
2335
|
+
(c(l) || c(u) || c(e.newDoc.lineAt(a).text) || Pa(l) !== Pa(u)) && (t = !0);
|
|
2054
2336
|
}), t;
|
|
2055
2337
|
}
|
|
2056
|
-
var
|
|
2057
|
-
if (e.annotation(
|
|
2058
|
-
let t =
|
|
2338
|
+
var Ia = re.transactionFilter.of((e) => {
|
|
2339
|
+
if (e.annotation(h.remote) || !e.docChanged || !Fa(e)) return e;
|
|
2340
|
+
let t = Na(e.newDoc.toString());
|
|
2059
2341
|
return t.length === 0 ? e : [e, {
|
|
2060
2342
|
changes: t,
|
|
2061
2343
|
sequential: !0
|
|
2062
2344
|
}];
|
|
2063
|
-
}),
|
|
2345
|
+
}), La = m.define(), Ra = b.define({
|
|
2064
2346
|
create: () => null,
|
|
2065
2347
|
update(e, t) {
|
|
2066
|
-
for (let e of t.effects) if (e.is(
|
|
2348
|
+
for (let e of t.effects) if (e.is(La)) return e.value;
|
|
2067
2349
|
return e === null ? null : t.changes.mapPos(e);
|
|
2068
2350
|
}
|
|
2069
|
-
}),
|
|
2351
|
+
}), za = class {
|
|
2070
2352
|
constructor(e) {
|
|
2071
2353
|
this.view = e, this.cursor = null, this.readPos = () => {
|
|
2072
|
-
let e = this.view.state.field(
|
|
2354
|
+
let e = this.view.state.field(Ra);
|
|
2073
2355
|
if (e === null) return null;
|
|
2074
2356
|
let t = this.view.coordsAtPos(e, 1);
|
|
2075
2357
|
if (!t) return null;
|
|
@@ -2084,8 +2366,8 @@ var Qi = g.transactionFilter.of((e) => {
|
|
|
2084
2366
|
};
|
|
2085
2367
|
}
|
|
2086
2368
|
update(e) {
|
|
2087
|
-
let t = e.state.field(
|
|
2088
|
-
t === null ? this.remove() : (e.startState.field(
|
|
2369
|
+
let t = e.state.field(Ra);
|
|
2370
|
+
t === null ? this.remove() : (e.startState.field(Ra) !== t || e.docChanged || e.geometryChanged) && this.view.requestMeasure({
|
|
2089
2371
|
read: this.readPos,
|
|
2090
2372
|
write: this.drawCursor
|
|
2091
2373
|
});
|
|
@@ -2096,7 +2378,7 @@ var Qi = g.transactionFilter.of((e) => {
|
|
|
2096
2378
|
destroy() {
|
|
2097
2379
|
this.remove();
|
|
2098
2380
|
}
|
|
2099
|
-
},
|
|
2381
|
+
}, Ba = n.fromClass(za), Va = class {
|
|
2100
2382
|
constructor(e) {
|
|
2101
2383
|
this.view = e, this.state = null, this.ghost = null, this.onMove = (e) => {
|
|
2102
2384
|
let t = this.state;
|
|
@@ -2110,11 +2392,11 @@ var Qi = g.transactionFilter.of((e) => {
|
|
|
2110
2392
|
x: e.clientX,
|
|
2111
2393
|
y: e.clientY
|
|
2112
2394
|
}) : null, r = n === null || n >= t.from && n <= t.to ? null : n;
|
|
2113
|
-
this.view.dispatch({ effects:
|
|
2395
|
+
this.view.dispatch({ effects: La.of(r) });
|
|
2114
2396
|
}, this.onUp = (e) => {
|
|
2115
2397
|
this.removeListeners(), this.view.scrollDOM.style.cursor = "", this.clearGhost();
|
|
2116
2398
|
let t = this.state;
|
|
2117
|
-
if (this.state = null, this.view.dispatch({ effects:
|
|
2399
|
+
if (this.state = null, this.view.dispatch({ effects: La.of(null) }), !t) return;
|
|
2118
2400
|
let n = this.view.posAtCoords({
|
|
2119
2401
|
x: e.clientX,
|
|
2120
2402
|
y: e.clientY
|
|
@@ -2135,7 +2417,7 @@ var Qi = g.transactionFilter.of((e) => {
|
|
|
2135
2417
|
anchor: i,
|
|
2136
2418
|
head: i + r.length
|
|
2137
2419
|
},
|
|
2138
|
-
effects:
|
|
2420
|
+
effects: xi.of({
|
|
2139
2421
|
from: a,
|
|
2140
2422
|
to: o,
|
|
2141
2423
|
insertAt: c
|
|
@@ -2185,7 +2467,7 @@ var Qi = g.transactionFilter.of((e) => {
|
|
|
2185
2467
|
}
|
|
2186
2468
|
showGhost(e, t) {
|
|
2187
2469
|
let n = document.createElement("div");
|
|
2188
|
-
n.className = "cm-drag-ghost", n.textContent = z(this.view.state.sliceDoc(e, t)).replace(
|
|
2470
|
+
n.className = "cm-drag-ghost", n.textContent = z(this.view.state.sliceDoc(e, t)).replace(Je, "$1"), this.view.dom.appendChild(n), this.ghost = n;
|
|
2189
2471
|
}
|
|
2190
2472
|
moveGhost(e, t) {
|
|
2191
2473
|
this.ghost && (this.ghost.style.left = `${e + 12}px`, this.ghost.style.top = `${t + 12}px`);
|
|
@@ -2196,87 +2478,87 @@ var Qi = g.transactionFilter.of((e) => {
|
|
|
2196
2478
|
destroy() {
|
|
2197
2479
|
this.removeListeners(), this.clearGhost();
|
|
2198
2480
|
}
|
|
2199
|
-
},
|
|
2481
|
+
}, Ha = n.fromClass(Va, { eventHandlers: { mousedown(e) {
|
|
2200
2482
|
return this.start(e);
|
|
2201
|
-
} } }),
|
|
2202
|
-
|
|
2203
|
-
|
|
2204
|
-
|
|
2205
|
-
],
|
|
2206
|
-
function
|
|
2483
|
+
} } }), Ua = [
|
|
2484
|
+
Ra,
|
|
2485
|
+
Ba,
|
|
2486
|
+
Ha
|
|
2487
|
+
], Wa = 2, Ga = /* @__PURE__ */ new WeakMap(), Ka = d.define(), qa = /* @__PURE__ */ new WeakMap();
|
|
2488
|
+
function Ja(e, t) {
|
|
2207
2489
|
let n = e.coordsAtPos(t, -1), r = e.coordsAtPos(t, 1);
|
|
2208
2490
|
return n && r ? {
|
|
2209
2491
|
before: n,
|
|
2210
2492
|
after: r
|
|
2211
2493
|
} : null;
|
|
2212
2494
|
}
|
|
2213
|
-
var
|
|
2214
|
-
function
|
|
2215
|
-
return Math.abs(e.before.top - e.after.top) <
|
|
2495
|
+
var Ya = 8;
|
|
2496
|
+
function Xa(e) {
|
|
2497
|
+
return Math.abs(e.before.top - e.after.top) < Ya;
|
|
2216
2498
|
}
|
|
2217
|
-
function
|
|
2218
|
-
let r =
|
|
2219
|
-
if (r &&
|
|
2220
|
-
let i =
|
|
2499
|
+
function Za(e, t, n) {
|
|
2500
|
+
let r = Ja(e, t);
|
|
2501
|
+
if (r && Xa(r) && Math.abs(r.before.left - r.after.left) <= Wa) return 1;
|
|
2502
|
+
let i = Ga.get(e);
|
|
2221
2503
|
if (i && i.head === t) {
|
|
2222
2504
|
if (i.side !== "pointer") return i.side;
|
|
2223
|
-
let t =
|
|
2505
|
+
let t = qa.get(e);
|
|
2224
2506
|
if (t && r) return Math.abs(t.x - r.before.left) <= Math.abs(t.x - r.after.left) ? -1 : 1;
|
|
2225
2507
|
}
|
|
2226
2508
|
return n && n < 0 ? -1 : 1;
|
|
2227
2509
|
}
|
|
2228
|
-
var
|
|
2510
|
+
var Qa = o.domEventHandlers({
|
|
2229
2511
|
mousedown(e, t) {
|
|
2230
|
-
return
|
|
2512
|
+
return qa.set(t, {
|
|
2231
2513
|
x: e.clientX,
|
|
2232
2514
|
y: e.clientY
|
|
2233
2515
|
}), !1;
|
|
2234
2516
|
},
|
|
2235
2517
|
mousemove(e, t) {
|
|
2236
|
-
return e.buttons &&
|
|
2518
|
+
return e.buttons && qa.set(t, {
|
|
2237
2519
|
x: e.clientX,
|
|
2238
2520
|
y: e.clientY
|
|
2239
2521
|
}), !1;
|
|
2240
2522
|
},
|
|
2241
2523
|
touchstart(e, t) {
|
|
2242
2524
|
let n = e.touches[0];
|
|
2243
|
-
return n &&
|
|
2525
|
+
return n && qa.set(t, {
|
|
2244
2526
|
x: n.clientX,
|
|
2245
2527
|
y: n.clientY
|
|
2246
2528
|
}), !1;
|
|
2247
2529
|
}
|
|
2248
2530
|
});
|
|
2249
|
-
function
|
|
2250
|
-
return (
|
|
2251
|
-
let { main:
|
|
2252
|
-
return !
|
|
2253
|
-
selection:
|
|
2254
|
-
annotations:
|
|
2531
|
+
function $a(e) {
|
|
2532
|
+
return (t) => {
|
|
2533
|
+
let { main: n } = t.state.selection;
|
|
2534
|
+
return !n.empty || !vn(t.state, n.head) || !Ja(t, n.head) || Za(t, n.head, n.assoc) === e ? !1 : (t.dispatch({
|
|
2535
|
+
selection: g.cursor(n.head, e),
|
|
2536
|
+
annotations: Ka.of(e),
|
|
2255
2537
|
userEvent: "select"
|
|
2256
2538
|
}), !0);
|
|
2257
2539
|
};
|
|
2258
2540
|
}
|
|
2259
|
-
var
|
|
2541
|
+
var eo = v.high(l.of([
|
|
2260
2542
|
{
|
|
2261
2543
|
key: "ArrowLeft",
|
|
2262
|
-
run:
|
|
2544
|
+
run: $a(-1)
|
|
2263
2545
|
},
|
|
2264
2546
|
{
|
|
2265
2547
|
key: "ArrowRight",
|
|
2266
|
-
run:
|
|
2548
|
+
run: $a(1)
|
|
2267
2549
|
},
|
|
2268
2550
|
{
|
|
2269
2551
|
key: "Backspace",
|
|
2270
|
-
run:
|
|
2552
|
+
run: $a(-1)
|
|
2271
2553
|
},
|
|
2272
2554
|
{
|
|
2273
2555
|
key: "Delete",
|
|
2274
|
-
run:
|
|
2556
|
+
run: $a(1)
|
|
2275
2557
|
}
|
|
2276
|
-
])),
|
|
2277
|
-
if (t !== n || !r || e.composing ||
|
|
2558
|
+
])), to = /^[\s<?!.,:*_~)]/, no = o.inputHandler.of((e, t, n, r) => {
|
|
2559
|
+
if (t !== n || !r || e.composing || to.test(r)) return !1;
|
|
2278
2560
|
let { main: i } = e.state.selection;
|
|
2279
|
-
return !i.empty || i.head !== t || !
|
|
2561
|
+
return !i.empty || i.head !== t || !yn(e.state, t) || !Ja(e, t) || Za(e, t, i.assoc) !== 1 ? !1 : (e.dispatch({
|
|
2280
2562
|
changes: {
|
|
2281
2563
|
from: t,
|
|
2282
2564
|
insert: ` ${r}`
|
|
@@ -2285,27 +2567,27 @@ var ga = y.high(n.of([
|
|
|
2285
2567
|
userEvent: "input.type",
|
|
2286
2568
|
scrollIntoView: !0
|
|
2287
2569
|
}), !0);
|
|
2288
|
-
}),
|
|
2289
|
-
|
|
2570
|
+
}), ro = [
|
|
2571
|
+
u({
|
|
2290
2572
|
above: !0,
|
|
2291
2573
|
class: "cm-nldd-cursorLayer",
|
|
2292
|
-
markers(
|
|
2293
|
-
let { state:
|
|
2294
|
-
for (let
|
|
2295
|
-
if (!
|
|
2296
|
-
let
|
|
2297
|
-
|
|
2574
|
+
markers(e) {
|
|
2575
|
+
let { state: t } = e, n = ie(t), r = [];
|
|
2576
|
+
for (let i of t.selection.ranges) {
|
|
2577
|
+
if (!i.empty && !n.drawRangeCursor) continue;
|
|
2578
|
+
let a = i === t.selection.main ? "cm-cursor cm-cursor-primary" : "cm-cursor cm-cursor-secondary", o = g.cursor(i.head, Za(e, i.head, i.assoc));
|
|
2579
|
+
r.push(...s.forRange(e, a, o));
|
|
2298
2580
|
}
|
|
2299
|
-
return
|
|
2581
|
+
return r;
|
|
2300
2582
|
},
|
|
2301
2583
|
update(e, t) {
|
|
2302
2584
|
if (e.docChanged || e.selectionSet) {
|
|
2303
|
-
let { view: t } = e, n = e.state.selection.main.head, r =
|
|
2585
|
+
let { view: t } = e, n = e.state.selection.main.head, r = Ga.get(t), i = r ? {
|
|
2304
2586
|
...r,
|
|
2305
2587
|
head: e.changes.mapPos(r.head)
|
|
2306
2588
|
} : null, a = e.startState.selection.main.head;
|
|
2307
2589
|
for (let t of e.transactions) {
|
|
2308
|
-
let r = t.annotation(
|
|
2590
|
+
let r = t.annotation(Ka);
|
|
2309
2591
|
if (r) i = {
|
|
2310
2592
|
head: n,
|
|
2311
2593
|
side: r
|
|
@@ -2315,34 +2597,34 @@ var ga = y.high(n.of([
|
|
|
2315
2597
|
side: "pointer"
|
|
2316
2598
|
};
|
|
2317
2599
|
else if (t.isUserEvent("input") || t.isUserEvent("delete.backward")) {
|
|
2318
|
-
let r = t.isUserEvent("input") &&
|
|
2600
|
+
let r = t.isUserEvent("input") && yn(e.state, n);
|
|
2319
2601
|
i = {
|
|
2320
2602
|
head: n,
|
|
2321
|
-
side:
|
|
2603
|
+
side: vn(e.state, n) && !vn(e.startState, a) && !r ? 1 : -1
|
|
2322
2604
|
};
|
|
2323
2605
|
} else t.isUserEvent("delete.forward") ? i = {
|
|
2324
2606
|
head: n,
|
|
2325
2607
|
side: 1
|
|
2326
2608
|
} : t.selection && (i = null);
|
|
2327
2609
|
}
|
|
2328
|
-
i ?
|
|
2610
|
+
i ? Ga.set(t, i) : Ga.delete(t);
|
|
2329
2611
|
}
|
|
2330
2612
|
return e.transactions.some((e) => e.selection) && (t.style.animationName = t.style.animationName === "cm-blink" ? "cm-blink2" : "cm-blink"), e.docChanged || e.selectionSet;
|
|
2331
2613
|
},
|
|
2332
2614
|
mount(e, t) {
|
|
2333
|
-
e.style.animationDuration = `${
|
|
2615
|
+
e.style.animationDuration = `${ie(t.state).cursorBlinkRate}ms`;
|
|
2334
2616
|
}
|
|
2335
2617
|
}),
|
|
2336
|
-
|
|
2337
|
-
|
|
2338
|
-
|
|
2618
|
+
Qa,
|
|
2619
|
+
eo,
|
|
2620
|
+
no
|
|
2339
2621
|
];
|
|
2340
2622
|
// src/components/inputs/text-editor/text-editor.selection.ts
|
|
2341
|
-
function
|
|
2623
|
+
function io(e) {
|
|
2342
2624
|
let t = e.dom.querySelector(".cm-selectionLayer");
|
|
2343
2625
|
if (!t) return;
|
|
2344
2626
|
let n = e.defaultLineHeight, r = e.contentDOM, i = r.getBoundingClientRect().right - (parseFloat(getComputedStyle(r).paddingRight) || 0);
|
|
2345
|
-
|
|
2627
|
+
ao([...t.querySelectorAll(".cm-selectionBackground")].map((t) => {
|
|
2346
2628
|
let r = t.getBoundingClientRect();
|
|
2347
2629
|
if (r.height >= n * 1.25) return {
|
|
2348
2630
|
piece: t,
|
|
@@ -2371,17 +2653,17 @@ function ba(e) {
|
|
|
2371
2653
|
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;
|
|
2372
2654
|
}), n);
|
|
2373
2655
|
}
|
|
2374
|
-
function
|
|
2656
|
+
function ao(e, t) {
|
|
2375
2657
|
let n = e.toSorted((e, t) => e.top - t.top);
|
|
2376
2658
|
for (let e = 1; e < n.length; e++) {
|
|
2377
2659
|
let r = n[e - 1], i = n[e].top - (r.top + r.height);
|
|
2378
2660
|
i > .25 && i < t / 2 && (r.piece.style.height = `${r.height + i}px`);
|
|
2379
2661
|
}
|
|
2380
2662
|
}
|
|
2381
|
-
var
|
|
2663
|
+
var oo = class {
|
|
2382
2664
|
constructor(e) {
|
|
2383
2665
|
this.view = e, this.observer = new MutationObserver(() => {
|
|
2384
|
-
|
|
2666
|
+
io(this.view), this.observer.takeRecords();
|
|
2385
2667
|
}), this.observing = !1, queueMicrotask(() => this.observe());
|
|
2386
2668
|
}
|
|
2387
2669
|
update() {
|
|
@@ -2399,18 +2681,17 @@ var Sa = class {
|
|
|
2399
2681
|
destroy() {
|
|
2400
2682
|
this.observer.disconnect();
|
|
2401
2683
|
}
|
|
2402
|
-
},
|
|
2684
|
+
}, so = n.fromClass(oo), co = oe`
|
|
2403
2685
|
|
|
2404
2686
|
|
|
2405
2687
|
/* # Host */
|
|
2406
2688
|
|
|
2407
2689
|
:host {
|
|
2408
|
-
--_text-editor-caret-width: var(--
|
|
2409
|
-
--_text-editor-caret-color: var(--
|
|
2690
|
+
--_text-editor-caret-width: var(--semantics-input-fields-caret-width);
|
|
2691
|
+
--_text-editor-caret-color: var(--semantics-input-fields-caret-color);
|
|
2410
2692
|
--_text-editor-drop-cursor-color: var(--components-text-editor-drop-cursor-color);
|
|
2411
2693
|
--_text-editor-drag-ghost-background-color: var(--components-text-editor-drag-ghost-background-color);
|
|
2412
|
-
--_text-editor-
|
|
2413
|
-
--_text-editor-caret-ring-color: var(--semantics-surfaces-base-background-color);
|
|
2694
|
+
--_text-editor-drop-cursor-ring-color: var(--semantics-surfaces-base-background-color);
|
|
2414
2695
|
--_text-editor-corner-radius: var(--primitives-corner-radius-lg);
|
|
2415
2696
|
--_text-editor-background-color: var(--semantics-input-fields-background-color);
|
|
2416
2697
|
--_text-editor-toolbar-background-color: var(--_text-editor-background-color);
|
|
@@ -2426,6 +2707,11 @@ var Sa = class {
|
|
|
2426
2707
|
--_text-editor-padding-block: var(--semantics-controls-md-inline-padding);
|
|
2427
2708
|
--_text-editor-padding-inline: var(--semantics-controls-md-inline-padding);
|
|
2428
2709
|
--_text-editor-content-color: var(--semantics-content-color);
|
|
2710
|
+
--_text-editor-highlight-background-color: var(--semantics-content-mark-background-color);
|
|
2711
|
+
--_text-editor-highlight-color: var(--semantics-content-mark-color);
|
|
2712
|
+
--_text-editor-highlight-bare-inline-padding: var(--primitives-space-2);
|
|
2713
|
+
--_text-editor-highlight-is-selected-background-color: light-dark(var(--primitives-color-mark-200), var(--primitives-color-mark-400));
|
|
2714
|
+
--_text-editor-highlight-is-selected-color: var(--primitives-color-neutral-950);
|
|
2429
2715
|
--_text-editor-mark-color: var(--semantics-content-secondary-color);
|
|
2430
2716
|
--_text-editor-link-color: var(--semantics-links-color);
|
|
2431
2717
|
--_text-editor-strong-font-weight: var(--primitives-font-weight-body-bold);
|
|
@@ -2513,6 +2799,11 @@ var Sa = class {
|
|
|
2513
2799
|
--_text-editor-mention-token-content-color: var(--semantics-mentions-content-color);
|
|
2514
2800
|
--_text-editor-mention-token-is-selected-background-color: var(--semantics-mentions-is-selected-background-color);
|
|
2515
2801
|
--_text-editor-mention-token-is-selected-content-color: var(--semantics-mentions-is-selected-content-color);
|
|
2802
|
+
--_text-editor-variable-token-background-color: var(--semantics-surfaces-tinted-background-color);
|
|
2803
|
+
--_text-editor-variable-token-highlight-border-color: var(--semantics-surfaces-tinted-highlight-border-color);
|
|
2804
|
+
--_text-editor-variable-token-content-color: var(--semantics-content-color);
|
|
2805
|
+
--_text-editor-variable-token-empty-content-color: var(--semantics-content-secondary-color);
|
|
2806
|
+
--_text-editor-variable-token-is-selected-background-color: var(--_text-editor-code-token-is-selected-background-color);
|
|
2516
2807
|
--_text-editor-rows: 6;
|
|
2517
2808
|
--_text-editor-popup-corner-radius: var(--semantics-overlays-corner-radius);
|
|
2518
2809
|
--_text-editor-popup-background-color: var(--semantics-surfaces-base-background-color);
|
|
@@ -2520,6 +2811,7 @@ var Sa = class {
|
|
|
2520
2811
|
--_text-editor-popup-font-family: var(--primitives-font-family-body);
|
|
2521
2812
|
--_text-editor-popup-font-size: var(--primitives-font-size-100);
|
|
2522
2813
|
--_text-editor-popup-min-width: var(--primitives-area-280);
|
|
2814
|
+
--_text-editor-popup-max-width: var(--primitives-area-400);
|
|
2523
2815
|
--_text-editor-popup-max-height: 14em;
|
|
2524
2816
|
--_text-editor-popup-padding: var(--primitives-space-8);
|
|
2525
2817
|
--_text-editor-popup-row-min-height: var(--semantics-controls-sm-min-size);
|
|
@@ -2542,7 +2834,7 @@ var Sa = class {
|
|
|
2542
2834
|
--_text-editor-popup-message-padding-inline: var(--primitives-space-16);
|
|
2543
2835
|
--_text-editor-popup-message-color: var(--semantics-content-secondary-color);
|
|
2544
2836
|
|
|
2545
|
-
${
|
|
2837
|
+
${Me}
|
|
2546
2838
|
display: flex;
|
|
2547
2839
|
isolation: isolate;
|
|
2548
2840
|
min-height: 0;
|
|
@@ -2585,9 +2877,9 @@ var Sa = class {
|
|
|
2585
2877
|
--_text-editor-toolbar-padding: 0px;
|
|
2586
2878
|
--_text-editor-stuck-gap: var(--_text-editor-toolbar-gap);
|
|
2587
2879
|
--_text-editor-padding-block: 0px;
|
|
2588
|
-
/* Room for the caret's own ink at the first and last position of a line
|
|
2589
|
-
|
|
2590
|
-
--_text-editor-padding-inline:
|
|
2880
|
+
/* Room for the caret's own ink at the first and last position of a line.
|
|
2881
|
+
Without it the edge carets are clipped. */
|
|
2882
|
+
--_text-editor-padding-inline: var(--_text-editor-caret-width);
|
|
2591
2883
|
}
|
|
2592
2884
|
|
|
2593
2885
|
|
|
@@ -2728,10 +3020,6 @@ var Sa = class {
|
|
|
2728
3020
|
/* CodeMirror centers its own 1.2px caret with a -0.6px margin. Ours is wider,
|
|
2729
3021
|
so recenter it on the insertion point from its own width. */
|
|
2730
3022
|
margin-left: calc(var(--_text-editor-caret-width) / -2);
|
|
2731
|
-
/* A thin surface-colored ring, like the drop cursor, so the caret stays legible
|
|
2732
|
-
even over a tinted token (annotation, inline code) where the accent alone can
|
|
2733
|
-
blend in. Blinks with the caret (opacity covers the shadow too). */
|
|
2734
|
-
box-shadow: 0 0 0 var(--_text-editor-caret-ring-width) var(--_text-editor-caret-ring-color);
|
|
2735
3023
|
}
|
|
2736
3024
|
|
|
2737
3025
|
:host .cm-scroller {
|
|
@@ -2790,6 +3078,47 @@ var Sa = class {
|
|
|
2790
3078
|
text-decoration: line-through;
|
|
2791
3079
|
}
|
|
2792
3080
|
|
|
3081
|
+
.cm-md-highlight {
|
|
3082
|
+
padding-block: var(--_text-editor-token-block-padding-fit);
|
|
3083
|
+
background-color: var(--_text-editor-highlight-background-color);
|
|
3084
|
+
--context-content-color: var(--_text-editor-highlight-color);
|
|
3085
|
+
color: var(--_text-editor-highlight-color);
|
|
3086
|
+
border-radius: var(--_text-editor-token-corner-radius);
|
|
3087
|
+
-webkit-box-decoration-break: clone;
|
|
3088
|
+
box-decoration-break: clone;
|
|
3089
|
+
}
|
|
3090
|
+
|
|
3091
|
+
.cm-md-highlight-bare {
|
|
3092
|
+
padding-inline: var(--_text-editor-highlight-bare-inline-padding);
|
|
3093
|
+
}
|
|
3094
|
+
|
|
3095
|
+
.cm-md-highlight-selected {
|
|
3096
|
+
padding-block: var(--_text-editor-token-block-padding-fit);
|
|
3097
|
+
background-color: var(--_text-editor-highlight-is-selected-background-color);
|
|
3098
|
+
--context-content-color: var(--_text-editor-highlight-is-selected-color);
|
|
3099
|
+
color: var(--_text-editor-highlight-is-selected-color);
|
|
3100
|
+
}
|
|
3101
|
+
|
|
3102
|
+
.cm-md-highlight-selected .cm-md-highlight {
|
|
3103
|
+
background-color: transparent;
|
|
3104
|
+
}
|
|
3105
|
+
|
|
3106
|
+
.cm-md-highlight-selected-start {
|
|
3107
|
+
border-start-start-radius: var(--_text-editor-token-corner-radius);
|
|
3108
|
+
border-end-start-radius: var(--_text-editor-token-corner-radius);
|
|
3109
|
+
}
|
|
3110
|
+
|
|
3111
|
+
.cm-md-highlight-selected-end {
|
|
3112
|
+
border-start-end-radius: var(--_text-editor-token-corner-radius);
|
|
3113
|
+
border-end-end-radius: var(--_text-editor-token-corner-radius);
|
|
3114
|
+
}
|
|
3115
|
+
|
|
3116
|
+
:host .cm-md-highlight-selected ::selection,
|
|
3117
|
+
:host .cm-md-highlight-selected::selection {
|
|
3118
|
+
--context-content-color: var(--_text-editor-highlight-is-selected-color);
|
|
3119
|
+
color: var(--_text-editor-highlight-is-selected-color);
|
|
3120
|
+
}
|
|
3121
|
+
|
|
2793
3122
|
/* The selected run is darkened with a decoration (see cm-md-code-selected
|
|
2794
3123
|
below), since drawSelection hides the native selection. */
|
|
2795
3124
|
.cm-md-code {
|
|
@@ -2963,6 +3292,46 @@ var Sa = class {
|
|
|
2963
3292
|
background-color: var(--_text-editor-mention-token-is-selected-background-color);
|
|
2964
3293
|
}
|
|
2965
3294
|
|
|
3295
|
+
.cm-md-variable-token {
|
|
3296
|
+
position: relative;
|
|
3297
|
+
padding-block: var(--_text-editor-token-block-padding-fit);
|
|
3298
|
+
padding-inline: var(--_text-editor-token-inline-padding);
|
|
3299
|
+
box-shadow: inset 0 0 0 var(--_text-editor-token-highlight-border-width) var(--_text-editor-variable-token-highlight-border-color);
|
|
3300
|
+
--context-content-color: var(--_text-editor-variable-token-content-color);
|
|
3301
|
+
color: var(--_text-editor-variable-token-content-color);
|
|
3302
|
+
background-color: var(--_text-editor-variable-token-background-color);
|
|
3303
|
+
border-radius: var(--_text-editor-token-corner-radius);
|
|
3304
|
+
white-space: nowrap;
|
|
3305
|
+
cursor: text;
|
|
3306
|
+
-webkit-box-decoration-break: clone;
|
|
3307
|
+
box-decoration-break: clone;
|
|
3308
|
+
text-indent: 0;
|
|
3309
|
+
}
|
|
3310
|
+
|
|
3311
|
+
.cm-md-variable-token[data-empty] {
|
|
3312
|
+
--context-content-color: var(--_text-editor-variable-token-empty-content-color);
|
|
3313
|
+
color: var(--_text-editor-variable-token-empty-content-color);
|
|
3314
|
+
}
|
|
3315
|
+
|
|
3316
|
+
.cm-md-variable-token-text::after {
|
|
3317
|
+
content: attr(data-text);
|
|
3318
|
+
}
|
|
3319
|
+
|
|
3320
|
+
.cm-md-token-spoken {
|
|
3321
|
+
position: absolute;
|
|
3322
|
+
margin: -1px;
|
|
3323
|
+
width: 1px;
|
|
3324
|
+
height: 1px;
|
|
3325
|
+
overflow: hidden;
|
|
3326
|
+
white-space: nowrap;
|
|
3327
|
+
clip-path: inset(50%);
|
|
3328
|
+
}
|
|
3329
|
+
|
|
3330
|
+
.cm-md-variable-token[data-selected] {
|
|
3331
|
+
box-shadow: none;
|
|
3332
|
+
background-color: var(--_text-editor-variable-token-is-selected-background-color);
|
|
3333
|
+
}
|
|
3334
|
+
|
|
2966
3335
|
/* A native selection over a mention keeps its text light on the filled accent.
|
|
2967
3336
|
:host bumps specificity so it wins over .cm-content ::selection wherever it sits. */
|
|
2968
3337
|
:host .cm-md-mention-token ::selection {
|
|
@@ -3081,7 +3450,7 @@ var Sa = class {
|
|
|
3081
3450
|
}
|
|
3082
3451
|
|
|
3083
3452
|
.cm-md-task-box-label {
|
|
3084
|
-
${
|
|
3453
|
+
${je}
|
|
3085
3454
|
}
|
|
3086
3455
|
|
|
3087
3456
|
/* The opening line of a code block is its head: the language on the left,
|
|
@@ -3131,7 +3500,7 @@ var Sa = class {
|
|
|
3131
3500
|
}
|
|
3132
3501
|
|
|
3133
3502
|
.cm-md-code-copy-status {
|
|
3134
|
-
${
|
|
3503
|
+
${je}
|
|
3135
3504
|
}
|
|
3136
3505
|
|
|
3137
3506
|
.cm-md-code-language {
|
|
@@ -3214,6 +3583,7 @@ var Sa = class {
|
|
|
3214
3583
|
margin: 0;
|
|
3215
3584
|
padding: var(--_text-editor-popup-padding);
|
|
3216
3585
|
min-width: var(--_text-editor-popup-min-width);
|
|
3586
|
+
max-width: var(--_text-editor-popup-max-width);
|
|
3217
3587
|
max-height: var(--_text-editor-popup-max-height);
|
|
3218
3588
|
font-family: var(--_text-editor-popup-font-family);
|
|
3219
3589
|
font-size: var(--_text-editor-popup-font-size);
|
|
@@ -3236,6 +3606,22 @@ var Sa = class {
|
|
|
3236
3606
|
flex: none;
|
|
3237
3607
|
}
|
|
3238
3608
|
|
|
3609
|
+
/* A long supporting text gives way first: the text is what you choose. */
|
|
3610
|
+
:host .cm-tooltip.cm-tooltip-autocomplete > ul > li > :is(.cm-completionLabel, .cm-completionDetail) {
|
|
3611
|
+
overflow: hidden;
|
|
3612
|
+
min-width: 0;
|
|
3613
|
+
white-space: nowrap;
|
|
3614
|
+
text-overflow: ellipsis;
|
|
3615
|
+
}
|
|
3616
|
+
|
|
3617
|
+
:host .cm-tooltip.cm-tooltip-autocomplete > ul > li > .cm-completionLabel {
|
|
3618
|
+
flex: 0 1 auto;
|
|
3619
|
+
}
|
|
3620
|
+
|
|
3621
|
+
:host .cm-tooltip.cm-tooltip-autocomplete > ul > li > .cm-completionDetail {
|
|
3622
|
+
flex: 0 10000 auto;
|
|
3623
|
+
}
|
|
3624
|
+
|
|
3239
3625
|
:host .cm-nldd-symbol {
|
|
3240
3626
|
display: inline-flex;
|
|
3241
3627
|
inline-size: var(--_text-editor-popup-symbol-size);
|
|
@@ -3294,7 +3680,7 @@ var Sa = class {
|
|
|
3294
3680
|
}
|
|
3295
3681
|
|
|
3296
3682
|
:host .cm-nldd-typeahead-status {
|
|
3297
|
-
${
|
|
3683
|
+
${je}
|
|
3298
3684
|
}
|
|
3299
3685
|
|
|
3300
3686
|
:host .cm-tooltip.cm-nldd-typeahead-empty {
|
|
@@ -3443,7 +3829,7 @@ var Sa = class {
|
|
|
3443
3829
|
width: var(--primitives-border-width-regular);
|
|
3444
3830
|
border-radius: var(--primitives-border-width-thin);
|
|
3445
3831
|
background-color: var(--_text-editor-drop-cursor-color);
|
|
3446
|
-
box-shadow: 0 0 0 var(--primitives-border-width-thin) var(--_text-editor-
|
|
3832
|
+
box-shadow: 0 0 0 var(--primitives-border-width-thin) var(--_text-editor-drop-cursor-ring-color);
|
|
3447
3833
|
pointer-events: none;
|
|
3448
3834
|
z-index: 4;
|
|
3449
3835
|
}
|
|
@@ -3515,21 +3901,21 @@ var Sa = class {
|
|
|
3515
3901
|
}
|
|
3516
3902
|
`;
|
|
3517
3903
|
// src/components/inputs/text-editor/text-editor.template.ts
|
|
3518
|
-
function
|
|
3519
|
-
return
|
|
3904
|
+
function lo(e) {
|
|
3905
|
+
return Ae`<div class="text-editor"><slot name="toolbar" ?hidden=${!e._hasSlottedToolbar}></slot></div>`;
|
|
3520
3906
|
}
|
|
3521
3907
|
// src/components/inputs/text-editor/text-editor.code-copy.ts
|
|
3522
|
-
var
|
|
3908
|
+
var uo = x.define({ combine: (e) => e[0] ?? {
|
|
3523
3909
|
copy: () => "Kopieer",
|
|
3524
3910
|
success: () => "Gekopieerd",
|
|
3525
3911
|
failure: () => "Kopiëren mislukt"
|
|
3526
|
-
} }),
|
|
3527
|
-
function
|
|
3912
|
+
} }), fo = 300, po = 2e3;
|
|
3913
|
+
function mo() {
|
|
3528
3914
|
return typeof window < "u" && window.isSecureContext && typeof navigator.clipboard?.writeText == "function";
|
|
3529
3915
|
}
|
|
3530
|
-
function
|
|
3916
|
+
function ho(e, t) {
|
|
3531
3917
|
let n = "";
|
|
3532
|
-
return
|
|
3918
|
+
return y(e).iterate({
|
|
3533
3919
|
from: t,
|
|
3534
3920
|
to: t,
|
|
3535
3921
|
enter: (r) => {
|
|
@@ -3544,7 +3930,7 @@ function Y(e, t, n) {
|
|
|
3544
3930
|
let r = n === "success" ? t.success() : n === "failure" ? t.failure() : t.copy();
|
|
3545
3931
|
e.querySelector(".cm-md-code-copy-text").textContent = r, e.nextElementSibling.textContent = n === "idle" ? "" : r;
|
|
3546
3932
|
}
|
|
3547
|
-
var X = /* @__PURE__ */ new WeakMap(),
|
|
3933
|
+
var X = /* @__PURE__ */ new WeakMap(), go = class extends r {
|
|
3548
3934
|
constructor(e, t, n) {
|
|
3549
3935
|
super(), this.lineFrom = e, this.focusable = t, this.label = n;
|
|
3550
3936
|
}
|
|
@@ -3552,7 +3938,7 @@ var X = /* @__PURE__ */ new WeakMap(), ja = class extends t {
|
|
|
3552
3938
|
return e.lineFrom === this.lineFrom && e.focusable === this.focusable && e.label === this.label;
|
|
3553
3939
|
}
|
|
3554
3940
|
toDOM(e) {
|
|
3555
|
-
let t = () => e.state.facet(
|
|
3941
|
+
let t = () => e.state.facet(uo), n = document.createElement("button");
|
|
3556
3942
|
n.type = "button", n.className = "cm-md-code-copy", this.focusable || (n.tabIndex = -1);
|
|
3557
3943
|
let r = document.createElement("nldd-icon");
|
|
3558
3944
|
r.setAttribute("aria-hidden", "true"), r.className = "cm-md-code-copy-icon";
|
|
@@ -3574,13 +3960,13 @@ var X = /* @__PURE__ */ new WeakMap(), ja = class extends t {
|
|
|
3574
3960
|
}), n.addEventListener("click", async () => {
|
|
3575
3961
|
clearTimeout(X.get(o));
|
|
3576
3962
|
try {
|
|
3577
|
-
await navigator.clipboard.writeText(
|
|
3963
|
+
await navigator.clipboard.writeText(ho(e.state, e.state.doc.lineAt(e.posAtDOM(n)).from)), Y(n, t(), "success");
|
|
3578
3964
|
} catch {
|
|
3579
3965
|
Y(n, t(), "failure");
|
|
3580
3966
|
}
|
|
3581
|
-
s && s !== "mouse" && c(
|
|
3967
|
+
s && s !== "mouse" && c(po);
|
|
3582
3968
|
}), n.addEventListener("pointerenter", () => clearTimeout(X.get(o))), n.addEventListener("pointerleave", () => {
|
|
3583
|
-
n.dataset.state === "idle" || n.matches(":focus") || c(
|
|
3969
|
+
n.dataset.state === "idle" || n.matches(":focus") || c(fo);
|
|
3584
3970
|
}), n.addEventListener("blur", l), o;
|
|
3585
3971
|
}
|
|
3586
3972
|
destroy(e) {
|
|
@@ -3590,72 +3976,74 @@ var X = /* @__PURE__ */ new WeakMap(), ja = class extends t {
|
|
|
3590
3976
|
return !0;
|
|
3591
3977
|
}
|
|
3592
3978
|
};
|
|
3593
|
-
function
|
|
3594
|
-
if (!
|
|
3595
|
-
let
|
|
3596
|
-
return
|
|
3597
|
-
if (
|
|
3598
|
-
let
|
|
3599
|
-
return
|
|
3600
|
-
widget: new
|
|
3979
|
+
function _o(e) {
|
|
3980
|
+
if (!mo()) return t.none;
|
|
3981
|
+
let n = [], r = e.readOnly, i = e.facet(uo).copy();
|
|
3982
|
+
return y(e).iterate({ enter: (a) => {
|
|
3983
|
+
if (a.name !== "FencedCode") return;
|
|
3984
|
+
let o = e.doc.lineAt(a.from);
|
|
3985
|
+
return n.push(vo.range(o.from), t.widget({
|
|
3986
|
+
widget: new go(o.from, r, i),
|
|
3601
3987
|
side: 1
|
|
3602
|
-
}).range(
|
|
3603
|
-
} }),
|
|
3988
|
+
}).range(o.to)), !1;
|
|
3989
|
+
} }), t.set(n, !0);
|
|
3604
3990
|
}
|
|
3605
|
-
var
|
|
3606
|
-
function
|
|
3607
|
-
let n = t.state.facet(
|
|
3991
|
+
var vo = t.line({ class: "cm-md-code-head" });
|
|
3992
|
+
function yo(e, t) {
|
|
3993
|
+
let n = t.state.facet(uo);
|
|
3608
3994
|
for (let e of t.dom.querySelectorAll(".cm-md-code-copy:not([data-state=\"idle\"])")) clearTimeout(X.get(e.parentElement)), Y(e, n, "idle");
|
|
3609
3995
|
return !1;
|
|
3610
3996
|
}
|
|
3611
|
-
var
|
|
3612
|
-
mousedown:
|
|
3613
|
-
keydown:
|
|
3997
|
+
var bo = o.domEventHandlers({
|
|
3998
|
+
mousedown: yo,
|
|
3999
|
+
keydown: yo
|
|
3614
4000
|
});
|
|
3615
|
-
function
|
|
3616
|
-
let t =
|
|
3617
|
-
create:
|
|
3618
|
-
update: (e, t) => t.docChanged || t.reconfigured ||
|
|
3619
|
-
provide: (e) =>
|
|
4001
|
+
function xo(e) {
|
|
4002
|
+
let t = b.define({
|
|
4003
|
+
create: _o,
|
|
4004
|
+
update: (e, t) => t.docChanged || t.reconfigured || E(t.startState, t.state) ? _o(t.state) : e,
|
|
4005
|
+
provide: (e) => o.decorations.from(e)
|
|
3620
4006
|
});
|
|
3621
4007
|
return [
|
|
3622
|
-
|
|
4008
|
+
uo.of(e),
|
|
3623
4009
|
t,
|
|
3624
|
-
|
|
4010
|
+
bo
|
|
3625
4011
|
];
|
|
3626
4012
|
}
|
|
3627
4013
|
// src/components/inputs/text-editor/text-editor.toolbar.ts
|
|
3628
|
-
var Z = "text-editor-command",
|
|
3629
|
-
function
|
|
4014
|
+
var Z = "text-editor-command", So = "text-editor-for";
|
|
4015
|
+
function Co(e) {
|
|
3630
4016
|
let t = e.indexOf(":");
|
|
3631
4017
|
if (t < 0) return [e.trim(), void 0];
|
|
3632
4018
|
let n = e.slice(t + 1).trim();
|
|
3633
4019
|
return [e.slice(0, t).trim(), /^\d+$/.test(n) ? Number(n) : n];
|
|
3634
4020
|
}
|
|
3635
|
-
function
|
|
4021
|
+
function wo(e) {
|
|
3636
4022
|
let { active: t } = e;
|
|
3637
4023
|
return t.taskList ? "task" : t.orderedList ? "ordered" : t.bulletList ? "bullet" : "none";
|
|
3638
4024
|
}
|
|
3639
|
-
var
|
|
4025
|
+
var To = /* @__PURE__ */ new Set([
|
|
3640
4026
|
"bold",
|
|
3641
4027
|
"italic",
|
|
3642
4028
|
"inlineCode",
|
|
3643
4029
|
"strikethrough",
|
|
4030
|
+
"highlight",
|
|
3644
4031
|
"link",
|
|
3645
4032
|
"quote",
|
|
3646
4033
|
"codeBlock",
|
|
3647
4034
|
"taskList"
|
|
3648
4035
|
]);
|
|
3649
|
-
function
|
|
4036
|
+
function Eo(e, t, n) {
|
|
3650
4037
|
let { active: r } = n;
|
|
3651
|
-
return
|
|
4038
|
+
return To.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 && wo(n) === (t ?? "none");
|
|
3652
4039
|
}
|
|
3653
|
-
var
|
|
4040
|
+
var Do = /* @__PURE__ */ new Set([
|
|
3654
4041
|
"bold",
|
|
3655
4042
|
"italic",
|
|
3656
4043
|
"strikethrough",
|
|
4044
|
+
"highlight",
|
|
3657
4045
|
"link"
|
|
3658
|
-
]),
|
|
4046
|
+
]), Oo = /* @__PURE__ */ new Set([
|
|
3659
4047
|
"inlineCode",
|
|
3660
4048
|
"quote",
|
|
3661
4049
|
"bulletList",
|
|
@@ -3663,12 +4051,12 @@ var Ha = /* @__PURE__ */ new Set([
|
|
|
3663
4051
|
"setList",
|
|
3664
4052
|
"heading"
|
|
3665
4053
|
]);
|
|
3666
|
-
function
|
|
4054
|
+
function ko(e, t, n) {
|
|
3667
4055
|
if (t.disabled) return !1;
|
|
3668
4056
|
if (t.readonly) return e === "copy";
|
|
3669
4057
|
let { active: r } = n;
|
|
3670
|
-
if (
|
|
3671
|
-
if (
|
|
4058
|
+
if (Do.has(e)) return !r.inlineCode && !r.codeBlock;
|
|
4059
|
+
if (Oo.has(e)) return !r.codeBlock;
|
|
3672
4060
|
switch (e) {
|
|
3673
4061
|
case "undo": return n.canUndo;
|
|
3674
4062
|
case "redo": return n.canRedo;
|
|
@@ -3679,72 +4067,72 @@ function Wa(e, t, n) {
|
|
|
3679
4067
|
default: return !0;
|
|
3680
4068
|
}
|
|
3681
4069
|
}
|
|
3682
|
-
var
|
|
3683
|
-
function*
|
|
4070
|
+
var Ao = (e) => e.tagName.toLowerCase();
|
|
4071
|
+
function* jo(e) {
|
|
3684
4072
|
let t = e;
|
|
3685
4073
|
for (; t;) t instanceof Element && (yield t), t = t.parentNode ?? (t instanceof ShadowRoot ? t.host : null);
|
|
3686
4074
|
}
|
|
3687
|
-
function
|
|
4075
|
+
function Mo(e) {
|
|
3688
4076
|
let t = e.getRootNode();
|
|
3689
|
-
return t instanceof ShadowRoot &&
|
|
4077
|
+
return t instanceof ShadowRoot && Ao(t.host) === "nldd-toolbar";
|
|
3690
4078
|
}
|
|
3691
|
-
var Q = /* @__PURE__ */ new Set(),
|
|
3692
|
-
function
|
|
4079
|
+
var Q = /* @__PURE__ */ new Set(), No = /* @__PURE__ */ new WeakMap();
|
|
4080
|
+
function Po(e) {
|
|
3693
4081
|
for (let t of Q) if (t.target.id === e) return t;
|
|
3694
4082
|
}
|
|
3695
|
-
function
|
|
4083
|
+
function Fo(e) {
|
|
3696
4084
|
for (let t of e.composedPath()) if (t instanceof Element) {
|
|
3697
|
-
if (
|
|
3698
|
-
if (t.hasAttribute(Z)) return
|
|
4085
|
+
if (Ao(t) === "nldd-text-editor") return null;
|
|
4086
|
+
if (t.hasAttribute(Z)) return Mo(t) ? null : t;
|
|
3699
4087
|
}
|
|
3700
4088
|
return null;
|
|
3701
4089
|
}
|
|
3702
|
-
function
|
|
3703
|
-
for (let t of
|
|
3704
|
-
let e = t.getAttribute(
|
|
3705
|
-
if (e !== null) return e === "" ? void 0 :
|
|
3706
|
-
let n =
|
|
4090
|
+
function Io(e) {
|
|
4091
|
+
for (let t of jo(e)) {
|
|
4092
|
+
let e = t.getAttribute(So);
|
|
4093
|
+
if (e !== null) return e === "" ? void 0 : Po(e);
|
|
4094
|
+
let n = No.get(t);
|
|
3707
4095
|
if (n) return n;
|
|
3708
4096
|
}
|
|
3709
4097
|
}
|
|
3710
|
-
function
|
|
4098
|
+
function Lo(e) {
|
|
3711
4099
|
return (t) => {
|
|
3712
|
-
let n =
|
|
3713
|
-
(n &&
|
|
4100
|
+
let n = Fo(t);
|
|
4101
|
+
(n && Io(n))?.handle(e, t, n);
|
|
3714
4102
|
};
|
|
3715
4103
|
}
|
|
3716
|
-
var
|
|
4104
|
+
var Ro = [
|
|
3717
4105
|
"click",
|
|
3718
4106
|
"change",
|
|
3719
4107
|
"select",
|
|
3720
4108
|
"pointerdown",
|
|
3721
4109
|
"keydown"
|
|
3722
|
-
].map((e) => [e,
|
|
4110
|
+
].map((e) => [e, Lo(e)]), zo = /* @__PURE__ */ new Set(["pointerdown", "keydown"]), Bo = class {
|
|
3723
4111
|
constructor(e, t) {
|
|
3724
4112
|
this.target = e, this.focusText = t, this._listBeforePress = null;
|
|
3725
4113
|
}
|
|
3726
4114
|
connect() {
|
|
3727
|
-
if (Q.size === 0) for (let [e, t] of
|
|
3728
|
-
Q.add(this),
|
|
4115
|
+
if (Q.size === 0) for (let [e, t] of Ro) document.addEventListener(e, t, zo.has(e));
|
|
4116
|
+
Q.add(this), No.set(this.target, this);
|
|
3729
4117
|
}
|
|
3730
4118
|
disconnect() {
|
|
3731
|
-
if (Q.delete(this),
|
|
4119
|
+
if (Q.delete(this), No.delete(this.target), Q.size === 0) for (let [e, t] of Ro) document.removeEventListener(e, t, zo.has(e));
|
|
3732
4120
|
}
|
|
3733
4121
|
controls() {
|
|
3734
|
-
let e = [...this.target.querySelectorAll(`[${Z}]`)], t = this.target.id, n = t &&
|
|
3735
|
-
return [...e, ...n].filter((e) =>
|
|
4122
|
+
let e = [...this.target.querySelectorAll(`[${Z}]`)], t = this.target.id, n = t && Po(t) === this ? [...document.querySelectorAll(`[${So}="${CSS.escape(t)}"]`)].flatMap((e) => [...e.hasAttribute(Z) ? [e] : [], ...e.querySelectorAll(`[${Z}]`)]) : [];
|
|
4123
|
+
return [...e, ...n].filter((e) => Io(e) === this);
|
|
3736
4124
|
}
|
|
3737
4125
|
_run(e) {
|
|
3738
|
-
let [t, n] =
|
|
4126
|
+
let [t, n] = Co(e);
|
|
3739
4127
|
t === "setHeading" && this.target.getState().active.codeBlock && this.target.runCommand("codeBlock"), this.target.runCommand(t, n), queueMicrotask(this.focusText);
|
|
3740
4128
|
}
|
|
3741
4129
|
handle(e, t, n) {
|
|
3742
|
-
let r =
|
|
4130
|
+
let r = Ao(n), [i] = Co(n.getAttribute(Z));
|
|
3743
4131
|
switch (e) {
|
|
3744
4132
|
case "pointerdown":
|
|
3745
4133
|
case "keydown":
|
|
3746
4134
|
if (e === "keydown" && !["Enter", " "].includes(t.key)) return;
|
|
3747
|
-
this._listBeforePress = r === "nldd-segmented-control" ?
|
|
4135
|
+
this._listBeforePress = r === "nldd-segmented-control" ? wo(this.target.getState()) : null;
|
|
3748
4136
|
return;
|
|
3749
4137
|
case "click":
|
|
3750
4138
|
if (r === "nldd-menu-item") return;
|
|
@@ -3763,19 +4151,24 @@ var $a = [
|
|
|
3763
4151
|
}
|
|
3764
4152
|
case "select": {
|
|
3765
4153
|
if (r !== "nldd-menu-item") return;
|
|
3766
|
-
let e = n.getAttribute(Z), [, t] =
|
|
3767
|
-
if (n.getAttribute("type") === "radio" &&
|
|
4154
|
+
let e = n.getAttribute(Z), [, t] = Co(e);
|
|
4155
|
+
if (n.getAttribute("type") === "radio" && Eo(i, t, this.target.getState())) return;
|
|
3768
4156
|
this._run(e);
|
|
3769
4157
|
}
|
|
3770
4158
|
}
|
|
3771
4159
|
}
|
|
3772
4160
|
reflect(e = this.target.getState()) {
|
|
3773
4161
|
for (let t of this.controls()) {
|
|
3774
|
-
let [n, r] =
|
|
3775
|
-
t.toggleAttribute("disabled", !
|
|
4162
|
+
let [n, r] = Co(t.getAttribute(Z)), i = Ao(t);
|
|
4163
|
+
t.toggleAttribute("disabled", !ko(n, this.target, e)), i === "nldd-segmented-control" ? n === "setList" && (t.value = wo(e)) : (i === "nldd-toggle-button" || i === "nldd-menu-item" || i === "nldd-segmented-control-item") && t.toggleAttribute("selected", Eo(n, r, e));
|
|
4164
|
+
}
|
|
4165
|
+
for (let e of new Set(this.controls().map((e) => e.closest("nldd-segmented-control[type=\"checkbox\"]")))) {
|
|
4166
|
+
if (!e) continue;
|
|
4167
|
+
let t = e, n = [...e.querySelectorAll("nldd-segmented-control-item[selected]")].map((e) => e.value);
|
|
4168
|
+
(n.length !== t.values.length || n.some((e, n) => e !== t.values[n])) && (t.values = n);
|
|
3776
4169
|
}
|
|
3777
4170
|
}
|
|
3778
|
-
},
|
|
4171
|
+
}, Vo = class {
|
|
3779
4172
|
constructor(e, t) {
|
|
3780
4173
|
this.host = e, this.container = t, this._frame = 0, this._listening = !1, this._gap = 0, this._schedule = () => {
|
|
3781
4174
|
this._frame || (this._frame = requestAnimationFrame(() => {
|
|
@@ -3802,26 +4195,26 @@ var $a = [
|
|
|
3802
4195
|
let t = e.getBoundingClientRect().top - this.container().getBoundingClientRect().top, n = e.classList.contains("is-stuck") ? this._gap : 0;
|
|
3803
4196
|
e.classList.toggle("is-stuck", t > n + .5);
|
|
3804
4197
|
}
|
|
3805
|
-
},
|
|
3806
|
-
constructor(...
|
|
3807
|
-
super(...
|
|
4198
|
+
}, Ho = class extends Pe(ve, Ne) {
|
|
4199
|
+
constructor(...t) {
|
|
4200
|
+
super(...t), this.resize = "auto", this.embedded = !1, this.wrap = !0, this.syntax = "hidden", this.annotatable = !1, this.noSpellcheck = !1, this.typeaheads = [], this._mentionTypeahead = ((e) => ({
|
|
3808
4201
|
trigger: "@",
|
|
3809
4202
|
source: (t) => e.mentionSource?.(t) ?? [],
|
|
3810
|
-
insert:
|
|
4203
|
+
insert: Ge,
|
|
3811
4204
|
get query() {
|
|
3812
4205
|
return e.mentionQuery;
|
|
3813
4206
|
},
|
|
3814
4207
|
get emptyText() {
|
|
3815
4208
|
return e.mentionEmptyText;
|
|
3816
4209
|
}
|
|
3817
|
-
}))(this), this.annotations = [], this.rowsProperty = "--_text-editor-rows", this._wrapCompartment = new
|
|
4210
|
+
}))(this), this.annotations = [], this.variables = [], this.rowsProperty = "--_text-editor-rows", this._wrapCompartment = new e(), this._spellcheckCompartment = new e(), this._historyCompartment = new e(), this._syntaxCompartment = new e(), this._toolbar = new Bo(this, () => this.view?.focus()), this._stuck = new Vo(this, () => this._container ?? null), this._hasSlottedToolbar = !1, this._labels = null, this._clipboard = new Qi(), this._plainPaste = null, this._lastState = null, this._onMentionPointerDown = (e) => {
|
|
3818
4211
|
let t = e.target?.closest?.(".cm-md-mention-token");
|
|
3819
4212
|
if (!t || !this.view || this.view.state.readOnly) return;
|
|
3820
|
-
let n =
|
|
4213
|
+
let n = it(this.view.state, this.view.posAtDOM(t));
|
|
3821
4214
|
n && (e.preventDefault(), e.stopPropagation(), this.view.dispatch({ selection: {
|
|
3822
4215
|
anchor: n.from,
|
|
3823
4216
|
head: n.to
|
|
3824
|
-
} }), this.view.focus(), e.button !== 0 || e.shiftKey || e.altKey || e.metaKey || e.ctrlKey || this.view.plugin(
|
|
4217
|
+
} }), this.view.focus(), e.button !== 0 || e.shiftKey || e.altKey || e.metaKey || e.ctrlKey || this.view.plugin(Ha)?.startFor(e, n.from, n.to));
|
|
3825
4218
|
}, this._onAnnotationBadgeClick = (e) => {
|
|
3826
4219
|
let t = e.target?.closest?.(".cm-annotation-badge");
|
|
3827
4220
|
if (!t) return;
|
|
@@ -3860,46 +4253,48 @@ var $a = [
|
|
|
3860
4253
|
"components.text-editor.annotation-plural-lowercase",
|
|
3861
4254
|
"components.text-editor.task-open-label",
|
|
3862
4255
|
"components.text-editor.task-done-label",
|
|
3863
|
-
"components.text-editor.copy-code-action"
|
|
4256
|
+
"components.text-editor.copy-code-action",
|
|
4257
|
+
"components.text-editor.variable-empty-text"
|
|
3864
4258
|
].map((e) => this._t(e)).join("\n");
|
|
3865
4259
|
}
|
|
3866
4260
|
buildExtensions() {
|
|
3867
4261
|
return [
|
|
3868
4262
|
ne,
|
|
3869
|
-
|
|
3870
|
-
|
|
3871
|
-
|
|
3872
|
-
|
|
4263
|
+
Or,
|
|
4264
|
+
Wr(() => 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 })),
|
|
4265
|
+
v.low(Ia),
|
|
4266
|
+
Wi((e, t) => this._t("components.text-editor.annotation-count-label", {
|
|
3873
4267
|
count: e,
|
|
3874
4268
|
noun: this._t(e === 1 ? "components.text-editor.annotation-singular-lowercase" : "components.text-editor.annotation-plural-lowercase"),
|
|
3875
4269
|
quote: t
|
|
3876
4270
|
})),
|
|
3877
|
-
|
|
3878
|
-
|
|
4271
|
+
v.highest(_n((e) => this._t("components.text-editor.open-in-new-tab-label", { url: e }))),
|
|
4272
|
+
$r((e) => this._t("components.text-editor.variable-empty-text", { label: e })),
|
|
4273
|
+
xo({
|
|
3879
4274
|
copy: () => this._t("components.text-editor.copy-code-action"),
|
|
3880
4275
|
success: () => this._t("components.text-editor.code-copy-success-text"),
|
|
3881
4276
|
failure: () => this._t("components.text-editor.code-copy-failure-text")
|
|
3882
4277
|
}),
|
|
3883
|
-
|
|
4278
|
+
xt({
|
|
3884
4279
|
open: () => this._t("components.text-editor.task-open-label"),
|
|
3885
4280
|
done: () => this._t("components.text-editor.task-done-label")
|
|
3886
4281
|
}),
|
|
3887
|
-
this._historyCompartment.of(
|
|
3888
|
-
r(),
|
|
3889
|
-
Ca,
|
|
3890
|
-
ya,
|
|
3891
|
-
vi(),
|
|
4282
|
+
this._historyCompartment.of(ce()),
|
|
3892
4283
|
a(),
|
|
3893
|
-
|
|
3894
|
-
|
|
4284
|
+
so,
|
|
4285
|
+
ro,
|
|
4286
|
+
na(),
|
|
4287
|
+
c(),
|
|
4288
|
+
Ua,
|
|
4289
|
+
Ea,
|
|
3895
4290
|
...this.inputExtensions(),
|
|
3896
|
-
this._wrapCompartment.of(this.wrap ?
|
|
3897
|
-
this._spellcheckCompartment.of(this.noSpellcheck ? [] :
|
|
3898
|
-
this._syntaxCompartment.of(this.syntax === "hidden" ? [
|
|
3899
|
-
|
|
4291
|
+
this._wrapCompartment.of(this.wrap ? o.lineWrapping : []),
|
|
4292
|
+
this._spellcheckCompartment.of(this.noSpellcheck ? [] : fi()),
|
|
4293
|
+
this._syntaxCompartment.of(this.syntax === "hidden" ? [rn(), j.of(!0)] : []),
|
|
4294
|
+
o.updateListener.of((e) => {
|
|
3900
4295
|
(e.docChanged || e.selectionSet) && this._emitState();
|
|
3901
4296
|
}),
|
|
3902
|
-
|
|
4297
|
+
o.domEventHandlers({
|
|
3903
4298
|
mousedown: (e, t) => {
|
|
3904
4299
|
if (e.detail < 3) return !1;
|
|
3905
4300
|
let n = t.posAtCoords({
|
|
@@ -3951,20 +4346,23 @@ var $a = [
|
|
|
3951
4346
|
return z(e);
|
|
3952
4347
|
}
|
|
3953
4348
|
beforeChangeCheck(e) {
|
|
3954
|
-
|
|
4349
|
+
Pn(e), qn(e);
|
|
3955
4350
|
}
|
|
3956
4351
|
onEditorMounted() {
|
|
3957
|
-
super.onEditorMounted(), this.view?.contentDOM.addEventListener("pointerdown", this._onMentionPointerDown, !0), this.view?.contentDOM.addEventListener("click", this._onAnnotationBadgeClick), this._syncAnnotations(), this._emitState();
|
|
4352
|
+
super.onEditorMounted(), this.view?.contentDOM.addEventListener("pointerdown", this._onMentionPointerDown, !0), this.view?.contentDOM.addEventListener("click", this._onAnnotationBadgeClick), this._syncAnnotations(), this._syncVariables(), this._emitState();
|
|
3958
4353
|
}
|
|
3959
4354
|
updated(e) {
|
|
3960
|
-
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") &&
|
|
4355
|
+
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") && Fe(this, "invalid-typeahead-query", Mr(this.typeaheads)), !this.view) return;
|
|
3961
4356
|
let t = this._labelSignature();
|
|
3962
|
-
t !== this._labels && (this._labels !== null && this.view.dispatch({ effects:
|
|
4357
|
+
t !== this._labels && (this._labels !== null && this.view.dispatch({ effects: w.of(null) }), this._labels = t), e.has("wrap") && this.reconfigure(this._wrapCompartment, this.wrap ? o.lineWrapping : []), e.has("syntax") && this.reconfigure(this._syntaxCompartment, this.syntax === "hidden" ? [rn(), j.of(!0)] : []), e.has("noSpellcheck") && (this.reconfigure(this._spellcheckCompartment, this.noSpellcheck ? [] : fi()), this._redrawForSpellcheck()), (e.has("annotations") || e.has("annotatable")) && this._syncAnnotations(), e.has("variables") && this._syncVariables();
|
|
4358
|
+
}
|
|
4359
|
+
_syncVariables() {
|
|
4360
|
+
this.view?.dispatch({ effects: Kr.of(this.variables) });
|
|
3963
4361
|
}
|
|
3964
4362
|
_syncAnnotations() {
|
|
3965
4363
|
this.view?.dispatch({
|
|
3966
|
-
effects:
|
|
3967
|
-
annotations:
|
|
4364
|
+
effects: yi.of(this.annotatable ? this.annotations : []),
|
|
4365
|
+
annotations: h.addToHistory.of(!1)
|
|
3968
4366
|
});
|
|
3969
4367
|
}
|
|
3970
4368
|
toggleBold() {
|
|
@@ -3979,45 +4377,48 @@ var $a = [
|
|
|
3979
4377
|
toggleStrikethrough() {
|
|
3980
4378
|
this.view && G(this.view, "~~", "Strikethrough");
|
|
3981
4379
|
}
|
|
4380
|
+
toggleHighlight() {
|
|
4381
|
+
this.view && G(this.view, "==", "Highlight");
|
|
4382
|
+
}
|
|
3982
4383
|
toggleHeading(e) {
|
|
3983
|
-
this.view &&
|
|
4384
|
+
this.view && ca(this.view, e);
|
|
3984
4385
|
}
|
|
3985
4386
|
setHeading(e) {
|
|
3986
|
-
this.view &&
|
|
4387
|
+
this.view && la(this.view, e);
|
|
3987
4388
|
}
|
|
3988
4389
|
toggleBulletList() {
|
|
3989
|
-
this.view &&
|
|
4390
|
+
this.view && ua(this.view);
|
|
3990
4391
|
}
|
|
3991
4392
|
toggleTaskList() {
|
|
3992
|
-
this.view &&
|
|
4393
|
+
this.view && fa(this.view);
|
|
3993
4394
|
}
|
|
3994
4395
|
setList(e) {
|
|
3995
|
-
this.view &&
|
|
4396
|
+
this.view && ma(this.view, e);
|
|
3996
4397
|
}
|
|
3997
4398
|
toggleQuote() {
|
|
3998
|
-
this.view &&
|
|
4399
|
+
this.view && xa(this.view);
|
|
3999
4400
|
}
|
|
4000
4401
|
toggleLink(e = "") {
|
|
4001
|
-
this.view &&
|
|
4402
|
+
this.view && Ca(this.view, e);
|
|
4002
4403
|
}
|
|
4003
4404
|
toggleCodeBlock() {
|
|
4004
|
-
this.view &&
|
|
4405
|
+
this.view && wa(this.view);
|
|
4005
4406
|
}
|
|
4006
4407
|
indent() {
|
|
4007
|
-
this.view &&
|
|
4408
|
+
this.view && ga(this.view);
|
|
4008
4409
|
}
|
|
4009
4410
|
outdent() {
|
|
4010
|
-
this.view &&
|
|
4411
|
+
this.view && _a(this.view);
|
|
4011
4412
|
}
|
|
4012
4413
|
undo() {
|
|
4013
|
-
this.view && (
|
|
4414
|
+
this.view && (ue(this.view), this.view.focus());
|
|
4014
4415
|
}
|
|
4015
4416
|
redo() {
|
|
4016
|
-
this.view && (
|
|
4417
|
+
this.view && (pe(this.view), this.view.focus());
|
|
4017
4418
|
}
|
|
4018
4419
|
clearHistory() {
|
|
4019
4420
|
let e = this.view;
|
|
4020
|
-
e && (e.dispatch({ effects: this._historyCompartment.reconfigure([]) }), e.dispatch({ effects: this._historyCompartment.reconfigure(
|
|
4421
|
+
e && (e.dispatch({ effects: this._historyCompartment.reconfigure([]) }), e.dispatch({ effects: this._historyCompartment.reconfigure(ce()) }), this._emitState());
|
|
4021
4422
|
}
|
|
4022
4423
|
async copy() {
|
|
4023
4424
|
if (!this.view || this.view.state.selection.main.empty) return;
|
|
@@ -4069,7 +4470,7 @@ var $a = [
|
|
|
4069
4470
|
});
|
|
4070
4471
|
t.dispatch({
|
|
4071
4472
|
changes: a,
|
|
4072
|
-
annotations: [
|
|
4473
|
+
annotations: [h.remote.of(!0), h.addToHistory.of(!1)]
|
|
4073
4474
|
});
|
|
4074
4475
|
}
|
|
4075
4476
|
setDoc(e) {
|
|
@@ -4104,6 +4505,9 @@ var $a = [
|
|
|
4104
4505
|
case "strikethrough":
|
|
4105
4506
|
this.toggleStrikethrough();
|
|
4106
4507
|
break;
|
|
4508
|
+
case "highlight":
|
|
4509
|
+
this.toggleHighlight();
|
|
4510
|
+
break;
|
|
4107
4511
|
case "bulletList":
|
|
4108
4512
|
this.toggleBulletList();
|
|
4109
4513
|
break;
|
|
@@ -4149,17 +4553,17 @@ var $a = [
|
|
|
4149
4553
|
case "paste":
|
|
4150
4554
|
this.paste();
|
|
4151
4555
|
break;
|
|
4152
|
-
default:
|
|
4556
|
+
default: Fe(this, "unknown-command", !0);
|
|
4153
4557
|
}
|
|
4154
4558
|
}
|
|
4155
4559
|
getState() {
|
|
4156
4560
|
return {
|
|
4157
|
-
active: this.view ?
|
|
4561
|
+
active: this.view ? Ta(this.view) : { ...ra },
|
|
4158
4562
|
empty: !this.view || this.view.state.selection.main.empty,
|
|
4159
|
-
canIndent: this.view ?
|
|
4160
|
-
canOutdent: this.view ?
|
|
4161
|
-
canUndo: this.view ?
|
|
4162
|
-
canRedo: this.view ?
|
|
4563
|
+
canIndent: this.view ? va(this.view) : !1,
|
|
4564
|
+
canOutdent: this.view ? ya(this.view) : !1,
|
|
4565
|
+
canUndo: this.view ? de(this.view.state) > 0 : !1,
|
|
4566
|
+
canRedo: this.view ? ye(this.view.state) > 0 : !1
|
|
4163
4567
|
};
|
|
4164
4568
|
}
|
|
4165
4569
|
getSelection() {
|
|
@@ -4184,7 +4588,7 @@ var $a = [
|
|
|
4184
4588
|
let e = this.view;
|
|
4185
4589
|
if (!e) return [];
|
|
4186
4590
|
let t = z(e.state.doc.toString());
|
|
4187
|
-
return
|
|
4591
|
+
return Ci(e.state).map((e) => ({
|
|
4188
4592
|
id: e.id,
|
|
4189
4593
|
start: e.from,
|
|
4190
4594
|
end: e.to,
|
|
@@ -4211,7 +4615,7 @@ var $a = [
|
|
|
4211
4615
|
id: t,
|
|
4212
4616
|
text: r,
|
|
4213
4617
|
from: n,
|
|
4214
|
-
to: n +
|
|
4618
|
+
to: n + We(e.candidate).length
|
|
4215
4619
|
});
|
|
4216
4620
|
} else this.dispatchEvent(new CustomEvent("typeahead", {
|
|
4217
4621
|
detail: {
|
|
@@ -4232,27 +4636,27 @@ var $a = [
|
|
|
4232
4636
|
}));
|
|
4233
4637
|
}
|
|
4234
4638
|
render() {
|
|
4235
|
-
return
|
|
4639
|
+
return lo(this);
|
|
4236
4640
|
}
|
|
4237
|
-
}, $ = (
|
|
4238
|
-
|
|
4641
|
+
}, $ = (Ho.styles = co, Ho);
|
|
4642
|
+
C([S({
|
|
4239
4643
|
reflect: !0,
|
|
4240
|
-
converter:
|
|
4241
|
-
})], $.prototype, "resize", void 0),
|
|
4644
|
+
converter: se("auto")
|
|
4645
|
+
})], $.prototype, "resize", void 0), C([S({
|
|
4242
4646
|
type: Boolean,
|
|
4243
4647
|
reflect: !0
|
|
4244
|
-
})], $.prototype, "embedded", void 0),
|
|
4648
|
+
})], $.prototype, "embedded", void 0), C([S({
|
|
4245
4649
|
type: Boolean,
|
|
4246
4650
|
reflect: !0
|
|
4247
|
-
})], $.prototype, "wrap", void 0),
|
|
4651
|
+
})], $.prototype, "wrap", void 0), C([S({
|
|
4248
4652
|
reflect: !0,
|
|
4249
|
-
converter:
|
|
4250
|
-
})], $.prototype, "syntax", void 0),
|
|
4653
|
+
converter: se("hidden")
|
|
4654
|
+
})], $.prototype, "syntax", void 0), C([S({
|
|
4251
4655
|
type: Boolean,
|
|
4252
4656
|
reflect: !0
|
|
4253
|
-
})], $.prototype, "annotatable", void 0),
|
|
4657
|
+
})], $.prototype, "annotatable", void 0), C([S({
|
|
4254
4658
|
type: Boolean,
|
|
4255
4659
|
reflect: !0,
|
|
4256
4660
|
attribute: "no-spellcheck"
|
|
4257
|
-
})], $.prototype, "noSpellcheck", void 0),
|
|
4258
|
-
export {
|
|
4661
|
+
})], $.prototype, "noSpellcheck", 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([S({ attribute: !1 })], $.prototype, "variables", void 0), C([Te(".text-editor")], $.prototype, "_container", void 0), C([ae()], $.prototype, "_hasSlottedToolbar", void 0), $ = C([we("nldd-text-editor")], $);
|
|
4662
|
+
export { kr as DEFAULT_TYPEAHEAD_QUERY, $ as NLDDTextEditor };
|