@nldd/design-system 0.20.0 → 0.21.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/custom-elements.json +361 -10
- package/dist/cdn/autoloader.js +181 -0
- package/dist/cdn/chunks/activity-indicator-JglZJ8dh.js +356 -0
- package/dist/cdn/chunks/activity-indicator.i18n-D7mCy6d2.js +3 -0
- package/dist/cdn/chunks/avatar-ASqePVhU.js +308 -0
- package/dist/cdn/chunks/avatar-group-GinEMPm9.js +338 -0
- package/dist/cdn/chunks/avatar-group.i18n-BYw_9wt_.js +7 -0
- package/dist/cdn/chunks/avatar.i18n-CMwQjBkS.js +7 -0
- package/dist/cdn/chunks/badge-Cc2Nufoc.js +323 -0
- package/dist/cdn/chunks/badge.i18n-DqW7hLQj.js +3 -0
- package/dist/cdn/chunks/banner-BLVKM07M.js +325 -0
- package/dist/cdn/chunks/banner.i18n-BOCM9rGN.js +3 -0
- package/dist/cdn/chunks/bar-split-view-Clbg-p9H.js +259 -0
- package/dist/cdn/chunks/base-CfuoYRhN.js +3 -0
- package/dist/cdn/chunks/blockquote-BoOqbGdm.js +189 -0
- package/dist/cdn/chunks/box-WkhyjQVy.js +88 -0
- package/dist/cdn/chunks/breadcrumbs-D9YxZzRj.js +162 -0
- package/dist/cdn/chunks/breadcrumbs.i18n-zmO8jaTO.js +3 -0
- package/dist/cdn/chunks/breakpoints-Cwor8TRP.js +15 -0
- package/dist/cdn/chunks/button-DO90Lo6q.js +863 -0
- package/dist/cdn/chunks/button-bar-Bxgdbyh3.js +225 -0
- package/dist/cdn/chunks/button-group-BYGPPLmZ.js +205 -0
- package/dist/{components/button.i18n-DiDGynnq.js → cdn/chunks/button.i18n-BGFt7Z9u.js} +2 -2
- package/dist/cdn/chunks/card-BP0jfOkS.js +262 -0
- package/dist/cdn/chunks/card.i18n-CpafLm3i.js +8 -0
- package/dist/cdn/chunks/carried-context-DlMSujiJ.js +37 -0
- package/dist/cdn/chunks/cell-BRD2ilQh.js +144 -0
- package/dist/cdn/chunks/checkbox-Cazx8CQn.js +296 -0
- package/dist/cdn/chunks/checkbox-field-DDZ-B6vH.js +157 -0
- package/dist/cdn/chunks/class-map-CXSdNjt8.js +26 -0
- package/dist/cdn/chunks/code-editor-D6Q55oaY.js +286 -0
- package/dist/cdn/chunks/code-viewer-DspLH2T1.js +766 -0
- package/dist/cdn/chunks/code-viewer.i18n-BHfSDRbK.js +13 -0
- package/dist/cdn/chunks/codemirror-input-Db65x22n.js +1232 -0
- package/dist/cdn/chunks/collection-NVtkvDls.js +396 -0
- package/dist/cdn/chunks/collection.i18n-DqWPGnZO.js +8 -0
- package/dist/cdn/chunks/combo-box-OywRKaWj.js +512 -0
- package/dist/cdn/chunks/combo-box.i18n-BorzYnJ2.js +6 -0
- package/dist/cdn/chunks/container-rrbwk0z4.js +602 -0
- package/dist/cdn/chunks/custom-element-BW8Ua4c7.js +7 -0
- package/dist/cdn/chunks/custom-element-q6NzoL5b.js +301 -0
- package/dist/cdn/chunks/custom-font-size-D7KNr84p.js +57 -0
- package/dist/cdn/chunks/date-field-vmZLo80s.js +662 -0
- package/dist/cdn/chunks/date-field.i18n-BTzc0E9a.js +15 -0
- package/dist/cdn/chunks/date-picker-CXDzSBoL.js +993 -0
- package/dist/cdn/chunks/date-picker.i18n-Dsc_M5QK.js +82 -0
- package/dist/cdn/chunks/decorate-TduJMFD_.js +280 -0
- package/dist/cdn/chunks/defer-focus-F73ud2D9.js +9 -0
- package/dist/cdn/chunks/described-by-mixin-daRE7orX.js +32 -0
- package/dist/cdn/chunks/description-cell-CQwOj_rN.js +166 -0
- package/dist/cdn/chunks/dev-checks-zW_W-hnh.js +2695 -0
- package/dist/cdn/chunks/directive-CwRgozUW.js +27 -0
- package/dist/cdn/chunks/dismiss-from-title-bar-C6mP7sWP.js +5 -0
- package/dist/cdn/chunks/dist-3C80SZN9.js +849 -0
- package/dist/cdn/chunks/dist-A7_1pHX0.js +379 -0
- package/dist/cdn/chunks/dist-BEfLdOvy.js +1346 -0
- package/dist/cdn/chunks/dist-BTUxFM2V.js +268 -0
- package/dist/cdn/chunks/dist-CP3G1pSK.js +1037 -0
- package/dist/cdn/chunks/dist-C_dGY6zR.js +468 -0
- package/dist/{components/dist-B9YBOGFW.js → cdn/chunks/dist-ChmCRv39.js} +109 -153
- package/dist/{components/dist-CJm4tkNC.js → cdn/chunks/dist-D2qap2OY.js} +23 -31
- package/dist/cdn/chunks/dist-DPUBF0MZ.js +1593 -0
- package/dist/{components/dist-4g23YHP0.js → cdn/chunks/dist-DrTzvgE7.js} +291 -404
- package/dist/cdn/chunks/dist-EM4MWLQq.js +385 -0
- package/dist/cdn/chunks/dist-EgIBI-FG.js +293 -0
- package/dist/{components/dist-Bf823YyL.js → cdn/chunks/dist-Rm6FvrSR.js} +272 -551
- package/dist/cdn/chunks/divider-CCNbnplA.js +53 -0
- package/dist/cdn/chunks/document-tab-bar-A2DFWrP9.js +973 -0
- package/dist/cdn/chunks/document-tab-bar.i18n-DKrA9TnB.js +9 -0
- package/dist/cdn/chunks/drag-handle-cell-CbzDYebG.js +206 -0
- package/dist/cdn/chunks/drag-handle-cell.i18n-CKUrbm2q.js +3 -0
- package/dist/cdn/chunks/dropdown-DZTZtkm5.js +350 -0
- package/dist/cdn/chunks/element-state-B-44fVqq.js +20 -0
- package/dist/cdn/chunks/file-field-DQ52qq5L.js +1484 -0
- package/dist/cdn/chunks/file-field.i18n-pDM7Utud.js +40 -0
- package/dist/cdn/chunks/floating-ui.dom-B8J1rV2c.js +753 -0
- package/dist/cdn/chunks/focus-target-DSLGcCWq.js +24 -0
- package/dist/cdn/chunks/form-actions-C_7hINq-.js +90 -0
- package/dist/cdn/chunks/form-associated-mixin--GIbl98p.js +62 -0
- package/dist/cdn/chunks/form-field--4nWJ_DK.js +364 -0
- package/dist/cdn/chunks/form-hXLgy_tY.js +84 -0
- package/dist/cdn/chunks/form-section-By-D4un0.js +64 -0
- package/dist/cdn/chunks/full-bleed-section-Dg4sIJG1.js +161 -0
- package/dist/cdn/chunks/gherkin-eseYvsxh.js +29 -0
- package/dist/cdn/chunks/hero-CQQMNCT_.js +761 -0
- package/dist/{components/icon-_Eox7ZfO.js → cdn/chunks/icon-BORlalt0.js} +298 -308
- package/dist/cdn/chunks/icon-button-rKiIHs7A.js +632 -0
- package/dist/{components/icon-button.i18n-1_N-wN6x.js → cdn/chunks/icon-button.i18n-DpZOfIS4.js} +2 -4
- package/dist/cdn/chunks/icon-cell-rk4NQid2.js +156 -0
- package/dist/cdn/chunks/identity-BLXecYsZ.js +187 -0
- package/dist/cdn/chunks/if-defined-CaKKERku.js +4 -0
- package/dist/cdn/chunks/image-DZMW6JgL.js +659 -0
- package/dist/cdn/chunks/image.i18n-ONcm1h7o.js +3 -0
- package/dist/cdn/chunks/implicit-submission-Csbcor_E.js +27 -0
- package/dist/cdn/chunks/inline-dialog-WlqtPBPJ.js +259 -0
- package/dist/cdn/chunks/input-modality-XE0B7yCn.js +42 -0
- package/dist/cdn/chunks/just-in-time-education-DRcb5g7x.js +611 -0
- package/dist/cdn/chunks/just-in-time-education.i18n-CW_dsaxf.js +6 -0
- package/dist/cdn/chunks/kanban-Ca_mfqsA.js +400 -0
- package/dist/cdn/chunks/kanban-column-fgIMc7pw.js +375 -0
- package/dist/cdn/chunks/kanban.i18n-CWqc3e0B.js +11 -0
- package/dist/cdn/chunks/keyboard-shortcut-EknnW7Ub.js +267 -0
- package/dist/cdn/chunks/languages-yKikVFv_.js +8893 -0
- package/dist/cdn/chunks/link-FBSAJ3UC.js +229 -0
- package/dist/cdn/chunks/link-group-90qVfKa0.js +111 -0
- package/dist/cdn/chunks/link-hint-KFhgr5Ng.js +24 -0
- package/dist/cdn/chunks/link-rel-DvrTEfVT.js +8 -0
- package/dist/cdn/chunks/link.i18n-DJPobGmu.js +8 -0
- package/dist/cdn/chunks/list-CaWl3q0Z.js +880 -0
- package/dist/cdn/chunks/list-item-Cagnf6eG.js +802 -0
- package/dist/cdn/chunks/list-item-segment-BRzBF1y_.js +315 -0
- package/dist/cdn/chunks/list-item-segment.i18n-DHnrQL4V.js +8 -0
- package/dist/{components/list-item.i18n-89uqlBMK.js → cdn/chunks/list-item.i18n-Br6J5Ev9.js} +2 -2
- package/dist/cdn/chunks/list-items-Du0RCWsY.js +6 -0
- package/dist/{components/list.i18n-CKqbhFQ_.js → cdn/chunks/list.i18n-C40ltgdI.js} +2 -2
- package/dist/cdn/chunks/loading-tags-DtUr-DR7.js +3 -0
- package/dist/cdn/chunks/menu-BtxzRedh.js +719 -0
- package/dist/cdn/chunks/menu-bar-BU3Hjk1b.js +253 -0
- package/dist/cdn/chunks/menu-bar-item-C7LQ0NI_.js +365 -0
- package/dist/cdn/chunks/menu-bar.i18n-BoMu4Eoz.js +3 -0
- package/dist/cdn/chunks/menu-divider-CLLRgMll.js +15 -0
- package/dist/cdn/chunks/menu-group-BL24ChpR.js +23 -0
- package/dist/cdn/chunks/menu-item-CooKfrFa.js +140 -0
- package/dist/cdn/chunks/menu.i18n-C6uYJsG3.js +10 -0
- package/dist/cdn/chunks/menu.template-C6rbfI-u.js +642 -0
- package/dist/cdn/chunks/modal-dialog-BrUMP4Jm.js +240 -0
- package/dist/cdn/chunks/multi-line-text-field-D7hXhyOn.js +318 -0
- package/dist/cdn/chunks/navigation-split-view-B2ZQhxEb.js +621 -0
- package/dist/cdn/chunks/nl.generated-D6T41jG3.js +112 -0
- package/dist/cdn/chunks/notification-DSGP14d1.js +492 -0
- package/dist/cdn/chunks/notification.i18n-BKUSLN5c.js +6 -0
- package/dist/cdn/chunks/number-field-B8op14Y_.js +301 -0
- package/dist/cdn/chunks/number-field.i18n-BS0bINWY.js +7 -0
- package/dist/cdn/chunks/one-half-one-half-section-ZYmHYf4Q.js +213 -0
- package/dist/cdn/chunks/one-third-two-thirds-section-Ds10K6AS.js +213 -0
- package/dist/cdn/chunks/one-time-code-field-Cgy_tTS4.js +693 -0
- package/dist/cdn/chunks/open-when-rendered-CW_2_WUZ.js +20 -0
- package/dist/cdn/chunks/owned-attribute-x9OCTy_4.js +6 -0
- package/dist/cdn/chunks/owner-form-Cq8tT7ac.js +7 -0
- package/dist/cdn/chunks/page-CBf_Decp.js +431 -0
- package/dist/cdn/chunks/page-footer-CSv1dU7M.js +396 -0
- package/dist/cdn/chunks/page-footer.i18n-pbdr4lN3.js +3 -0
- package/dist/cdn/chunks/page-section-mixin-Dp6X8GKd.js +132 -0
- package/dist/cdn/chunks/pagination-CMUcFB53.js +485 -0
- package/dist/cdn/chunks/pagination.i18n-QQMx14CQ.js +9 -0
- package/dist/cdn/chunks/password-field-C76Vm3rm.js +368 -0
- package/dist/cdn/chunks/password-field.i18n-CzdBn-1b.js +8 -0
- package/dist/cdn/chunks/popover-CGbeEv_-.js +334 -0
- package/dist/cdn/chunks/popover-target-B25dxnmt.js +10 -0
- package/dist/cdn/chunks/popover.i18n-DmFBHUvB.js +3 -0
- package/dist/cdn/chunks/popup-anchor-controller-VZw0bXf2.js +30 -0
- package/dist/cdn/chunks/progress-bar-BLiHaRUS.js +674 -0
- package/dist/cdn/chunks/progress-bar.i18n-Cr5miGTx.js +8 -0
- package/dist/cdn/chunks/progress-circle-CjkovRbL.js +667 -0
- package/dist/cdn/chunks/progress-circle.i18n-CRrXuY4V.js +8 -0
- package/dist/cdn/chunks/query-ChDzi9FQ.js +28 -0
- package/dist/cdn/chunks/radio-button-GHyO-GQB.js +338 -0
- package/dist/cdn/chunks/radio-button-field-C-Z6Lnd4.js +192 -0
- package/dist/cdn/chunks/radio-button-group-ChTqBCnQ.js +118 -0
- package/dist/cdn/chunks/radio-position-CXWYAjaz.js +10 -0
- package/dist/cdn/chunks/reflect-non-default-Bu3rpCvg.js +9 -0
- package/dist/cdn/chunks/render-marked-DX_5ISZE.js +37 -0
- package/dist/cdn/chunks/repeat-Ch_5OsXE.js +76 -0
- package/dist/cdn/chunks/return-focus-BzZWhXhc.js +57 -0
- package/dist/cdn/chunks/rich-text-CQ2uwMSp.js +47 -0
- package/dist/cdn/chunks/rich-text.i18n-BlJ68YuU.js +3 -0
- package/dist/cdn/chunks/row-header-mixin-CgqvREoV.js +16 -0
- package/dist/cdn/chunks/sanitize-url-CBuGmY0W.js +7 -0
- package/dist/cdn/chunks/scroll-mode-controller-COUD1-3P.js +42 -0
- package/dist/cdn/chunks/search-field-BGNfERhn.js +396 -0
- package/dist/cdn/chunks/search-field.i18n-B_Oc7hc-.js +6 -0
- package/dist/cdn/chunks/segmented-control-BYAG4VRp.js +671 -0
- package/dist/cdn/chunks/shadow-resets-6SToDsPu.js +12 -0
- package/dist/cdn/chunks/sheet-CqN7ViYV.js +340 -0
- package/dist/cdn/chunks/shell-C9rds_D9.js +146 -0
- package/dist/cdn/chunks/shell-DmJOYhyF.js +108 -0
- package/dist/cdn/chunks/side-by-side-split-view-C5oX4c6Z.js +166 -0
- package/dist/cdn/chunks/sidebar-section-CFPBdETU.js +353 -0
- package/dist/cdn/chunks/sidebar-section.i18n-BuGfRMpD.js +6 -0
- package/dist/cdn/chunks/simple-section-qrCqXeBa.js +192 -0
- package/dist/cdn/chunks/skip-link-DWh4W6-J.js +161 -0
- package/dist/cdn/chunks/skip-link.i18n--PbEdAmJ.js +3 -0
- package/dist/cdn/chunks/slider--hODfOwh.js +772 -0
- package/dist/cdn/chunks/slider.i18n-DVw0c8AG.js +6 -0
- package/dist/cdn/chunks/slot-content-BLuPqVXw.js +13 -0
- package/dist/cdn/chunks/spacer-CFzq_JCh.js +237 -0
- package/dist/cdn/chunks/spacer-cell-DuVOgIj8.js +68 -0
- package/dist/cdn/chunks/spacing-scale-SufIjHeN.js +28 -0
- package/dist/cdn/chunks/split-button-DH19p8So.js +268 -0
- package/dist/cdn/chunks/split-button.i18n-DtClSMga.js +3 -0
- package/dist/cdn/chunks/split-view-divider-jzcPmnMh.js +100 -0
- package/dist/cdn/chunks/split-view-pane-BLsZz263.js +128 -0
- package/dist/cdn/chunks/stacked-split-view-CcOR8LrJ.js +157 -0
- package/dist/cdn/chunks/static-html-Cf4ccUIg.js +26 -0
- package/dist/cdn/chunks/status-bar-CINbOihq.js +284 -0
- package/dist/cdn/chunks/status-bar-change-CR9l0Gyk.js +3 -0
- package/dist/cdn/chunks/step-bar-6FvZL1Ti.js +474 -0
- package/dist/cdn/chunks/step-bar.i18n-DocExlD7.js +9 -0
- package/dist/cdn/chunks/step-cell-CejRisgS.js +287 -0
- package/dist/cdn/chunks/stepper-CY2rJWOJ.js +223 -0
- package/dist/cdn/chunks/stepper.i18n-COOAkaBl.js +7 -0
- package/dist/cdn/chunks/style-map-DsIw6lkq.js +29 -0
- package/dist/cdn/chunks/style-mod-DGMhzWuk.js +1583 -0
- package/dist/cdn/chunks/swatch-picker-BY3DBIl6.js +430 -0
- package/dist/cdn/chunks/swatch-picker.i18n-_G0nmnGe.js +22 -0
- package/dist/cdn/chunks/switch-DDSsZFwK.js +275 -0
- package/dist/cdn/chunks/switch-field-CMoM9I38.js +137 -0
- package/dist/cdn/chunks/tab-bar-CA8K1XjU.js +697 -0
- package/dist/cdn/chunks/tab-bar.i18n-Crsc7ShA.js +3 -0
- package/dist/cdn/chunks/table-DwXjCSD5.js +308 -0
- package/dist/cdn/chunks/table.i18n-Bmb_uw_w.js +3 -0
- package/dist/cdn/chunks/tag-DM3APy3B.js +306 -0
- package/dist/cdn/chunks/text-B1CatNR1.js +421 -0
- package/dist/cdn/chunks/text-cell-BkEsGI3g.js +299 -0
- package/dist/cdn/chunks/text-editor-BvTiMeNV.js +3743 -0
- package/dist/cdn/chunks/text-editor.i18n-sJKiRQ4i.js +17 -0
- package/dist/cdn/chunks/text-field-CUyh1-V8.js +398 -0
- package/dist/cdn/chunks/time-field--5K0YTcr.js +607 -0
- package/dist/cdn/chunks/time-field.i18n-CLH5vmS7.js +11 -0
- package/dist/cdn/chunks/time-picker-W0xYXLy8.js +508 -0
- package/dist/cdn/chunks/time-picker.i18n-BilOCXlS.js +7 -0
- package/dist/cdn/chunks/title-BuT7tWqN.js +437 -0
- package/dist/cdn/chunks/title-bar-label-controller-DSxdKZOg.js +24 -0
- package/dist/cdn/chunks/title-cell-8d8psUBX.js +327 -0
- package/dist/cdn/chunks/toggle-button-DNXWXZpE.js +528 -0
- package/dist/cdn/chunks/toggle-button-group-ByowJYgs.js +156 -0
- package/dist/cdn/chunks/token-CnkEB3hB.js +266 -0
- package/dist/cdn/chunks/token-field-BpyxOGmU.js +664 -0
- package/dist/cdn/chunks/token-field.i18n-BclzoR8F.js +9 -0
- package/dist/cdn/chunks/token.i18n-RGD5zAtl.js +7 -0
- package/dist/cdn/chunks/toml-w97zZfFO.js +27 -0
- package/dist/cdn/chunks/toolbar-C24LqAzK.js +408 -0
- package/dist/cdn/chunks/toolbar-item-DpPfPxCi.js +50 -0
- package/dist/cdn/chunks/toolbar-title-KBMpfL9d.js +84 -0
- package/dist/cdn/chunks/toolbar.i18n-QwS37CBC.js +8 -0
- package/dist/cdn/chunks/toolbar.styles-BQkG4gVc.js +383 -0
- package/dist/cdn/chunks/tooltip-BsAHJjci.js +325 -0
- package/dist/cdn/chunks/top-navigation-bar-C_kLPVKD.js +925 -0
- package/dist/cdn/chunks/top-navigation-bar.i18n-C-lcH1nB.js +10 -0
- package/dist/cdn/chunks/top-title-bar-iNFB2zQL.js +344 -0
- package/dist/cdn/chunks/translations-wxBSz213.js +8 -0
- package/dist/cdn/chunks/two-thirds-one-third-section-D-UANbHC.js +213 -0
- package/dist/cdn/chunks/validation-list-C5BhHZIG.js +202 -0
- package/dist/cdn/chunks/validation-list.i18n-CM6In8zD.js +12 -0
- package/dist/cdn/chunks/visibility-mixin-COAZ9pON.js +74 -0
- package/dist/cdn/chunks/visually-hidden-BPgATaH0.js +43 -0
- package/dist/cdn/chunks/window-CxV6ELE9.js +227 -0
- package/dist/cdn/chunks/window.i18n-CsEnUPAk.js +3 -0
- package/dist/cdn/chunks/with-translations-XX14GKFh.js +16 -0
- package/dist/components/actions/menu/menu-item.d.ts +6 -2
- package/dist/components/actions/menu/menu-item.d.ts.map +1 -1
- package/dist/components/actions/menu/menu-item.js +12 -1
- package/dist/components/actions/menu/menu-item.js.map +1 -1
- package/dist/components/actions/menu/menu.js +1 -1
- package/dist/components/actions/menu/menu.js.map +1 -1
- package/dist/components/actions/menu/menu.template.d.ts.map +1 -1
- package/dist/components/actions/menu/menu.template.js +2 -1
- package/dist/components/actions/menu/menu.template.js.map +1 -1
- package/dist/components/content/blockquote/blockquote.d.ts +1 -0
- package/dist/components/content/blockquote/blockquote.d.ts.map +1 -1
- package/dist/components/content/blockquote/blockquote.js +1 -0
- package/dist/components/content/blockquote/blockquote.js.map +1 -1
- package/dist/components/content/identity/identity.d.ts +1 -0
- package/dist/components/content/identity/identity.d.ts.map +1 -1
- package/dist/components/content/identity/identity.js +1 -0
- package/dist/components/content/identity/identity.js.map +1 -1
- package/dist/components/content/image/image.d.ts +1 -0
- package/dist/components/content/image/image.d.ts.map +1 -1
- package/dist/components/content/image/image.js +1 -0
- package/dist/components/content/image/image.js.map +1 -1
- package/dist/components/content/rich-text/rich-text.d.ts +1 -0
- package/dist/components/content/rich-text/rich-text.d.ts.map +1 -1
- package/dist/components/content/rich-text/rich-text.js +1 -0
- package/dist/components/content/rich-text/rich-text.js.map +1 -1
- package/dist/components/content/text/text.d.ts +1 -0
- package/dist/components/content/text/text.d.ts.map +1 -1
- package/dist/components/content/text/text.js +1 -0
- package/dist/components/content/text/text.js.map +1 -1
- package/dist/components/content/title/title.d.ts +1 -0
- package/dist/components/content/title/title.d.ts.map +1 -1
- package/dist/components/content/title/title.js +1 -0
- package/dist/components/content/title/title.js.map +1 -1
- package/dist/components/forms/form/form.d.ts.map +1 -1
- package/dist/components/forms/form/form.js +1 -0
- package/dist/components/forms/form/form.js.map +1 -1
- package/dist/components/forms/form-field/form-field.d.ts +1 -0
- package/dist/components/forms/form-field/form-field.d.ts.map +1 -1
- package/dist/components/forms/form-field/form-field.js +1 -0
- package/dist/components/forms/form-field/form-field.js.map +1 -1
- package/dist/components/inputs/date-field/date-field.d.ts +9 -4
- package/dist/components/inputs/date-field/date-field.d.ts.map +1 -1
- package/dist/components/inputs/date-field/date-field.js +20 -7
- package/dist/components/inputs/date-field/date-field.js.map +1 -1
- package/dist/components/inputs/date-field/date-field.template.d.ts.map +1 -1
- package/dist/components/inputs/date-field/date-field.template.js +1 -0
- package/dist/components/inputs/date-field/date-field.template.js.map +1 -1
- package/dist/components/inputs/dropdown/dropdown.d.ts +23 -2
- package/dist/components/inputs/dropdown/dropdown.d.ts.map +1 -1
- package/dist/components/inputs/dropdown/dropdown.js +68 -11
- package/dist/components/inputs/dropdown/dropdown.js.map +1 -1
- package/dist/components/inputs/time-field/time-field.d.ts +4 -0
- package/dist/components/inputs/time-field/time-field.d.ts.map +1 -1
- package/dist/components/inputs/time-field/time-field.js +17 -2
- package/dist/components/inputs/time-field/time-field.js.map +1 -1
- package/dist/components/inputs/time-field/time-field.template.d.ts.map +1 -1
- package/dist/components/inputs/time-field/time-field.template.js +1 -0
- package/dist/components/inputs/time-field/time-field.template.js.map +1 -1
- package/dist/components/layout/container/container.d.ts +15 -2
- package/dist/components/layout/container/container.d.ts.map +1 -1
- package/dist/components/layout/container/container.js +38 -3
- package/dist/components/layout/container/container.js.map +1 -1
- package/dist/components/layout/container/container.styles.js +1 -1
- package/dist/components/layout/container/container.template.js +1 -1
- package/dist/components/layout/container/container.template.js.map +1 -1
- package/dist/components/layout/page-sections/hero/hero.d.ts +1 -0
- package/dist/components/layout/page-sections/hero/hero.d.ts.map +1 -1
- package/dist/components/layout/page-sections/hero/hero.js +1 -0
- package/dist/components/layout/page-sections/hero/hero.js.map +1 -1
- package/dist/components/layout/popover/popover.d.ts.map +1 -1
- package/dist/components/layout/popover/popover.js +4 -2
- package/dist/components/layout/popover/popover.js.map +1 -1
- package/dist/components/lists-and-tables/list-item/list-item.d.ts +7 -0
- package/dist/components/lists-and-tables/list-item/list-item.d.ts.map +1 -1
- package/dist/components/lists-and-tables/list-item/list-item.js +13 -3
- package/dist/components/lists-and-tables/list-item/list-item.js.map +1 -1
- package/dist/components/lists-and-tables/list-item-segment/list-item-segment.d.ts +11 -1
- package/dist/components/lists-and-tables/list-item-segment/list-item-segment.d.ts.map +1 -1
- package/dist/components/lists-and-tables/list-item-segment/list-item-segment.js +19 -3
- package/dist/components/lists-and-tables/list-item-segment/list-item-segment.js.map +1 -1
- package/dist/nldd.min.js +729 -727
- package/dist/types/react.d.ts +3323 -0
- package/dist/types/vue.d.ts +11 -3
- package/dist/utilities/autoloader.d.ts +33 -0
- package/dist/utilities/autoloader.d.ts.map +1 -0
- package/dist/utilities/autoloader.generated.d.ts +3 -0
- package/dist/utilities/autoloader.generated.d.ts.map +1 -0
- package/dist/utilities/autoloader.generated.js +141 -0
- package/dist/utilities/autoloader.generated.js.map +1 -0
- package/dist/utilities/autoloader.js +94 -0
- package/dist/utilities/autoloader.js.map +1 -0
- package/dist/utilities/dev-checks.d.ts +9 -0
- package/dist/utilities/dev-checks.d.ts.map +1 -1
- package/dist/utilities/dev-checks.js +45 -3
- package/dist/utilities/dev-checks.js.map +1 -1
- package/dist/utilities/dev-rules.generated.d.ts.map +1 -1
- package/dist/utilities/dev-rules.generated.js +12 -2
- package/dist/utilities/dev-rules.generated.js.map +1 -1
- package/dist/utilities/loading-tags.d.ts +7 -0
- package/dist/utilities/loading-tags.d.ts.map +1 -0
- package/dist/utilities/loading-tags.js +7 -0
- package/dist/utilities/loading-tags.js.map +1 -0
- package/dist/utilities/owner-form.d.ts +3 -3
- package/dist/utilities/owner-form.d.ts.map +1 -1
- package/dist/utilities/owner-form.js +6 -3
- package/dist/utilities/owner-form.js.map +1 -1
- package/dist/utilities/return-focus.d.ts +14 -0
- package/dist/utilities/return-focus.d.ts.map +1 -1
- package/dist/utilities/return-focus.js +26 -8
- package/dist/utilities/return-focus.js.map +1 -1
- package/lint/data.generated.json +1 -1
- package/lint/engine.js +53 -1
- package/lint/format.js +6 -5
- package/lint/frontends.js +224 -16
- package/lint/linter.js +5 -3
- package/lint/main.js +36 -9
- package/lint/project.js +73 -4
- package/lint/rule-data.js +17 -2
- package/lint/tree.js +3 -0
- package/package.json +50 -11
- package/dist/components/breakpoints-DtL62nLI.js +0 -45
- package/dist/components/components.js +0 -68243
- package/dist/components/decorate-DD7uUxHb.js +0 -51
- package/dist/components/defer-focus-dzorHsCQ.js +0 -176
- package/dist/components/dev-checks-CLB9G43h.js +0 -2711
- package/dist/components/dist-245LaK9m.js +0 -1479
- package/dist/components/dist-BFZM0YsR.js +0 -15772
- package/dist/components/dist-BNkeFjc3.js +0 -1180
- package/dist/components/dist-CSC1dG3L.js +0 -365
- package/dist/components/dist-CeMOOqgP.js +0 -1509
- package/dist/components/dist-DFjwTlJV.js +0 -624
- package/dist/components/dist-DHhnz3Gv.js +0 -381
- package/dist/components/dist-PeUX4vPq.js +0 -2857
- package/dist/components/dist-m70B83qb.js +0 -463
- package/dist/components/element-state-BnarBv0M.js +0 -42
- package/dist/components/gherkin-DzYbEwDO.js +0 -107
- package/dist/components/icon-button-8gvQCwCW.js +0 -2305
- package/dist/components/input-modality-D_CY185R.js +0 -48
- package/dist/components/just-in-time-education.i18n-BqU1ImP4.js +0 -423
- package/dist/components/nl.generated-DzZkOgnP.js +0 -64
- package/dist/components/rolldown-runtime-D8jQpDG7.js +0 -12
- package/dist/components/shadow-resets-BwOyyZFH.js +0 -60
- package/dist/components/shell-Dh5IwHd-.js +0 -222
- package/dist/components/toml-D0Pix_8Q.js +0 -58
- package/dist/components/visibility-mixin-Dzn48SL8.js +0 -153
|
@@ -0,0 +1,1593 @@
|
|
|
1
|
+
import { r as e } from "./icon-BORlalt0.js";
|
|
2
|
+
import { d as t, g as n, i as r, l as i, m as a, n as o, o as s, p as c, u as l } from "./style-mod-DGMhzWuk.js";
|
|
3
|
+
import { $ as u, A as d, C as f, D as p, Q as m, V as h, _ as g, c as _, l as ee, nt as te, p as ne, pt as v, s as re, u as ie, v as ae, w as oe, x as se } from "./languages-yKikVFv_.js";
|
|
4
|
+
import { n as ce, r as le } from "./dist-BEfLdOvy.js";
|
|
5
|
+
import { t as ue } from "./dist-CP3G1pSK.js";
|
|
6
|
+
// node_modules/@lezer/markdown/dist/index.js
|
|
7
|
+
var de = class e {
|
|
8
|
+
static create(t, n, r, i, a) {
|
|
9
|
+
let o = i + (i << 8) + t + (n << 4) | 0;
|
|
10
|
+
return new e(t, n, r, o, a, [], []);
|
|
11
|
+
}
|
|
12
|
+
constructor(e, t, n, r, a, o, s) {
|
|
13
|
+
this.type = e, this.value = t, this.from = n, this.hash = r, this.end = a, this.children = o, this.positions = s, this.hashProp = [[i.contextHash, r]];
|
|
14
|
+
}
|
|
15
|
+
addChild(e, t) {
|
|
16
|
+
e.prop(i.contextHash) != this.hash && (e = new a(e.type, e.children, e.positions, e.length, this.hashProp)), this.children.push(e), this.positions.push(t);
|
|
17
|
+
}
|
|
18
|
+
toTree(e, n = this.end) {
|
|
19
|
+
let r = this.children.length - 1;
|
|
20
|
+
return r >= 0 && (n = Math.max(n, this.positions[r] + this.children[r].length + this.from)), new a(e.types[this.type], this.children, this.positions, n - this.from).balance({ makeTree: (e, n, r) => new a(t.none, e, n, r, this.hashProp) });
|
|
21
|
+
}
|
|
22
|
+
}, y;
|
|
23
|
+
(function(e) {
|
|
24
|
+
e[e.Document = 1] = "Document", e[e.CodeBlock = 2] = "CodeBlock", e[e.FencedCode = 3] = "FencedCode", e[e.Blockquote = 4] = "Blockquote", e[e.HorizontalRule = 5] = "HorizontalRule", e[e.BulletList = 6] = "BulletList", e[e.OrderedList = 7] = "OrderedList", e[e.ListItem = 8] = "ListItem", e[e.ATXHeading1 = 9] = "ATXHeading1", e[e.ATXHeading2 = 10] = "ATXHeading2", e[e.ATXHeading3 = 11] = "ATXHeading3", e[e.ATXHeading4 = 12] = "ATXHeading4", e[e.ATXHeading5 = 13] = "ATXHeading5", e[e.ATXHeading6 = 14] = "ATXHeading6", e[e.SetextHeading1 = 15] = "SetextHeading1", e[e.SetextHeading2 = 16] = "SetextHeading2", e[e.HTMLBlock = 17] = "HTMLBlock", e[e.LinkReference = 18] = "LinkReference", e[e.Paragraph = 19] = "Paragraph", e[e.CommentBlock = 20] = "CommentBlock", e[e.ProcessingInstructionBlock = 21] = "ProcessingInstructionBlock", e[e.Escape = 22] = "Escape", e[e.Entity = 23] = "Entity", e[e.HardBreak = 24] = "HardBreak", e[e.Emphasis = 25] = "Emphasis", e[e.StrongEmphasis = 26] = "StrongEmphasis", e[e.Link = 27] = "Link", e[e.Image = 28] = "Image", e[e.InlineCode = 29] = "InlineCode", e[e.HTMLTag = 30] = "HTMLTag", e[e.Comment = 31] = "Comment", e[e.ProcessingInstruction = 32] = "ProcessingInstruction", e[e.Autolink = 33] = "Autolink", e[e.HeaderMark = 34] = "HeaderMark", e[e.QuoteMark = 35] = "QuoteMark", e[e.ListMark = 36] = "ListMark", e[e.LinkMark = 37] = "LinkMark", e[e.EmphasisMark = 38] = "EmphasisMark", e[e.CodeMark = 39] = "CodeMark", e[e.CodeText = 40] = "CodeText", e[e.CodeInfo = 41] = "CodeInfo", e[e.LinkTitle = 42] = "LinkTitle", e[e.LinkLabel = 43] = "LinkLabel", e[e.URL = 44] = "URL";
|
|
25
|
+
})(y || (y = {}));
|
|
26
|
+
var fe = class {
|
|
27
|
+
constructor(e, t) {
|
|
28
|
+
this.start = e, this.content = t, this.marks = [], this.parsers = [];
|
|
29
|
+
}
|
|
30
|
+
}, pe = class {
|
|
31
|
+
constructor() {
|
|
32
|
+
this.text = "", this.baseIndent = 0, this.basePos = 0, this.depth = 0, this.markers = [], this.pos = 0, this.indent = 0, this.next = -1;
|
|
33
|
+
}
|
|
34
|
+
forward() {
|
|
35
|
+
this.basePos > this.pos && this.forwardInner();
|
|
36
|
+
}
|
|
37
|
+
forwardInner() {
|
|
38
|
+
let e = this.skipSpace(this.basePos);
|
|
39
|
+
this.indent = this.countIndent(e, this.pos, this.indent), this.pos = e, this.next = e == this.text.length ? -1 : this.text.charCodeAt(e);
|
|
40
|
+
}
|
|
41
|
+
skipSpace(e) {
|
|
42
|
+
return x(this.text, e);
|
|
43
|
+
}
|
|
44
|
+
reset(e) {
|
|
45
|
+
for (this.text = e, this.baseIndent = this.basePos = this.pos = this.indent = 0, this.forwardInner(), this.depth = 1; this.markers.length;) this.markers.pop();
|
|
46
|
+
}
|
|
47
|
+
moveBase(e) {
|
|
48
|
+
this.basePos = e, this.baseIndent = this.countIndent(e, this.pos, this.indent);
|
|
49
|
+
}
|
|
50
|
+
moveBaseColumn(e) {
|
|
51
|
+
this.baseIndent = e, this.basePos = this.findColumn(e);
|
|
52
|
+
}
|
|
53
|
+
addMarker(e) {
|
|
54
|
+
this.markers.push(e);
|
|
55
|
+
}
|
|
56
|
+
countIndent(e, t = 0, n = 0) {
|
|
57
|
+
for (let r = t; r < e; r++) n += this.text.charCodeAt(r) == 9 ? 4 - n % 4 : 1;
|
|
58
|
+
return n;
|
|
59
|
+
}
|
|
60
|
+
findColumn(e) {
|
|
61
|
+
let t = 0;
|
|
62
|
+
for (let n = 0; t < this.text.length && n < e; t++) n += this.text.charCodeAt(t) == 9 ? 4 - n % 4 : 1;
|
|
63
|
+
return t;
|
|
64
|
+
}
|
|
65
|
+
scrub() {
|
|
66
|
+
if (!this.baseIndent) return this.text;
|
|
67
|
+
let e = "";
|
|
68
|
+
for (let t = 0; t < this.basePos; t++) e += " ";
|
|
69
|
+
return e + this.text.slice(this.basePos);
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
function me(e, t, n) {
|
|
73
|
+
if (n.pos == n.text.length || e != t.block && n.indent >= t.stack[n.depth + 1].value + n.baseIndent) return !0;
|
|
74
|
+
if (n.indent >= n.baseIndent + 4) return !1;
|
|
75
|
+
let r = (e.type == y.OrderedList ? E : T)(n, t, !1);
|
|
76
|
+
return r > 0 && (e.type != y.BulletList || C(n, t, !1) < 0) && n.text.charCodeAt(n.pos + r - 1) == e.value;
|
|
77
|
+
}
|
|
78
|
+
var he = {
|
|
79
|
+
[y.Blockquote](e, t, n) {
|
|
80
|
+
return n.next == 62 && (n.markers.push(R(y.QuoteMark, t.lineStart + n.pos, t.lineStart + n.pos + 1)), n.moveBase(n.pos + (b(n.text.charCodeAt(n.pos + 1)) ? 2 : 1)), e.end = t.lineStart + n.text.length, !0);
|
|
81
|
+
},
|
|
82
|
+
[y.ListItem](e, t, n) {
|
|
83
|
+
return n.indent < n.baseIndent + e.value && n.next > -1 ? !1 : (n.moveBaseColumn(n.baseIndent + e.value), !0);
|
|
84
|
+
},
|
|
85
|
+
[y.OrderedList]: me,
|
|
86
|
+
[y.BulletList]: me,
|
|
87
|
+
[y.Document]() {
|
|
88
|
+
return !0;
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
function b(e) {
|
|
92
|
+
return e == 32 || e == 9 || e == 10 || e == 13;
|
|
93
|
+
}
|
|
94
|
+
function x(e, t = 0) {
|
|
95
|
+
for (; t < e.length && b(e.charCodeAt(t));) t++;
|
|
96
|
+
return t;
|
|
97
|
+
}
|
|
98
|
+
function ge(e, t, n) {
|
|
99
|
+
for (; t > n && b(e.charCodeAt(t - 1));) t--;
|
|
100
|
+
return t;
|
|
101
|
+
}
|
|
102
|
+
function S(e) {
|
|
103
|
+
if (e.next != 96 && e.next != 126) return -1;
|
|
104
|
+
let t = e.pos + 1;
|
|
105
|
+
for (; t < e.text.length && e.text.charCodeAt(t) == e.next;) t++;
|
|
106
|
+
if (t < e.pos + 3) return -1;
|
|
107
|
+
if (e.next == 96) {
|
|
108
|
+
for (let n = t; n < e.text.length; n++) if (e.text.charCodeAt(n) == 96) return -1;
|
|
109
|
+
}
|
|
110
|
+
return t;
|
|
111
|
+
}
|
|
112
|
+
function _e(e) {
|
|
113
|
+
return e.next == 62 ? e.text.charCodeAt(e.pos + 1) == 32 ? 2 : 1 : -1;
|
|
114
|
+
}
|
|
115
|
+
function C(e, t, n) {
|
|
116
|
+
if (e.next != 42 && e.next != 45 && e.next != 95) return -1;
|
|
117
|
+
let r = 1;
|
|
118
|
+
for (let t = e.pos + 1; t < e.text.length; t++) {
|
|
119
|
+
let n = e.text.charCodeAt(t);
|
|
120
|
+
if (n == e.next) r++;
|
|
121
|
+
else if (!b(n)) return -1;
|
|
122
|
+
}
|
|
123
|
+
return n && e.next == 45 && ye(e) > -1 && e.depth == t.stack.length && t.parser.leafBlockParsers.indexOf(Te.SetextHeading) > -1 || r < 3 ? -1 : 1;
|
|
124
|
+
}
|
|
125
|
+
function w(e, t) {
|
|
126
|
+
for (let n = e.stack.length - 1; n >= 0; n--) if (e.stack[n].type == t) return !0;
|
|
127
|
+
return !1;
|
|
128
|
+
}
|
|
129
|
+
function T(e, t, n) {
|
|
130
|
+
return (e.next == 45 || e.next == 43 || e.next == 42) && (e.pos == e.text.length - 1 || b(e.text.charCodeAt(e.pos + 1))) && (!n || w(t, y.BulletList) || e.skipSpace(e.pos + 2) < e.text.length) ? 1 : -1;
|
|
131
|
+
}
|
|
132
|
+
function E(e, t, n) {
|
|
133
|
+
let r = e.pos, i = e.next;
|
|
134
|
+
for (; i >= 48 && i <= 57;) {
|
|
135
|
+
if (r++, r == e.text.length) return -1;
|
|
136
|
+
i = e.text.charCodeAt(r);
|
|
137
|
+
}
|
|
138
|
+
return r == e.pos || r > e.pos + 9 || i != 46 && i != 41 || r < e.text.length - 1 && !b(e.text.charCodeAt(r + 1)) || n && !w(t, y.OrderedList) && (e.skipSpace(r + 1) == e.text.length || r > e.pos + 1 || e.next != 49) ? -1 : r + 1 - e.pos;
|
|
139
|
+
}
|
|
140
|
+
function ve(e) {
|
|
141
|
+
if (e.next != 35) return -1;
|
|
142
|
+
let t = e.pos + 1;
|
|
143
|
+
for (; t < e.text.length && e.text.charCodeAt(t) == 35;) t++;
|
|
144
|
+
if (t < e.text.length && e.text.charCodeAt(t) != 32) return -1;
|
|
145
|
+
let n = t - e.pos;
|
|
146
|
+
return n > 6 ? -1 : n;
|
|
147
|
+
}
|
|
148
|
+
function ye(e) {
|
|
149
|
+
if (e.next != 45 && e.next != 61 || e.indent >= e.baseIndent + 4) return -1;
|
|
150
|
+
let t = e.pos + 1;
|
|
151
|
+
for (; t < e.text.length && e.text.charCodeAt(t) == e.next;) t++;
|
|
152
|
+
let n = t;
|
|
153
|
+
for (; t < e.text.length && b(e.text.charCodeAt(t));) t++;
|
|
154
|
+
return t == e.text.length ? n : -1;
|
|
155
|
+
}
|
|
156
|
+
var D = /^[ \t]*$/, be = /-->/, xe = /\?>/, O = [
|
|
157
|
+
[/^<(?:script|pre|style)(?:\s|>|$)/i, /<\/(?:script|pre|style)>/i],
|
|
158
|
+
[/^\s*<!--/, be],
|
|
159
|
+
[/^\s*<\?/, xe],
|
|
160
|
+
[/^\s*<![A-Z]/, />/],
|
|
161
|
+
[/^\s*<!\[CDATA\[/, /\]\]>/],
|
|
162
|
+
[/^\s*<\/?(?:address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h1|h2|h3|h4|h5|h6|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul)(?:\s|\/?>|$)/i, D],
|
|
163
|
+
[/^\s*(?:<\/[a-z][\w-]*\s*>|<[a-z][\w-]*(\s+[a-z:_][\w-.]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*>)\s*$/i, D]
|
|
164
|
+
];
|
|
165
|
+
function Se(e, t, n) {
|
|
166
|
+
if (e.next != 60) return -1;
|
|
167
|
+
let r = e.text.slice(e.pos);
|
|
168
|
+
for (let e = 0, t = O.length - +!!n; e < t; e++) if (O[e][0].test(r)) return e;
|
|
169
|
+
return -1;
|
|
170
|
+
}
|
|
171
|
+
function k(e, t) {
|
|
172
|
+
let n = e.countIndent(t, e.pos, e.indent), r = e.skipSpace(t), i = e.countIndent(r, t, n);
|
|
173
|
+
return i >= n + 5 || r == e.text.length ? n + 1 : i;
|
|
174
|
+
}
|
|
175
|
+
function A(e, t, n) {
|
|
176
|
+
let r = e.length - 1;
|
|
177
|
+
r >= 0 && e[r].to == t && e[r].type == y.CodeText ? e[r].to = n : e.push(R(y.CodeText, t, n));
|
|
178
|
+
}
|
|
179
|
+
var j = {
|
|
180
|
+
LinkReference: void 0,
|
|
181
|
+
IndentedCode(e, t) {
|
|
182
|
+
let n = t.baseIndent + 4;
|
|
183
|
+
if (t.indent < n) return !1;
|
|
184
|
+
let r = t.findColumn(n), i = e.lineStart + r, a = e.lineStart + t.text.length, o = [], s = [];
|
|
185
|
+
for (A(o, i, a); e.nextLine() && t.depth >= e.stack.length;) if (t.pos == t.text.length) {
|
|
186
|
+
A(s, e.lineStart - 1, e.lineStart);
|
|
187
|
+
for (let e of t.markers) s.push(e);
|
|
188
|
+
} else if (t.indent < n) break;
|
|
189
|
+
else {
|
|
190
|
+
if (s.length) {
|
|
191
|
+
for (let e of s) e.type == y.CodeText ? A(o, e.from, e.to) : o.push(e);
|
|
192
|
+
s = [];
|
|
193
|
+
}
|
|
194
|
+
A(o, e.lineStart - 1, e.lineStart);
|
|
195
|
+
for (let e of t.markers) o.push(e);
|
|
196
|
+
a = e.lineStart + t.text.length;
|
|
197
|
+
let n = e.lineStart + t.findColumn(t.baseIndent + 4);
|
|
198
|
+
n < a && A(o, n, a);
|
|
199
|
+
}
|
|
200
|
+
return s.length && (s = s.filter((e) => e.type != y.CodeText), s.length && (t.markers = s.concat(t.markers))), e.addNode(e.buffer.writeElements(o, -i).finish(y.CodeBlock, a - i), i), !0;
|
|
201
|
+
},
|
|
202
|
+
FencedCode(e, t) {
|
|
203
|
+
let n = S(t);
|
|
204
|
+
if (n < 0) return !1;
|
|
205
|
+
let r = e.lineStart + t.pos, i = t.next, a = n - t.pos, o = t.skipSpace(n), s = ge(t.text, t.text.length, o), c = [R(y.CodeMark, r, r + a)];
|
|
206
|
+
o < s && c.push(R(y.CodeInfo, e.lineStart + o, e.lineStart + s));
|
|
207
|
+
for (let n = !0, r = !0, o = !1; e.nextLine() && t.depth >= e.stack.length; n = !1) {
|
|
208
|
+
let s = t.pos;
|
|
209
|
+
if (t.indent - t.baseIndent < 4) for (; s < t.text.length && t.text.charCodeAt(s) == i;) s++;
|
|
210
|
+
if (s - t.pos >= a && t.skipSpace(s) == t.text.length) {
|
|
211
|
+
for (let e of t.markers) c.push(e);
|
|
212
|
+
r && o && A(c, e.lineStart - 1, e.lineStart), c.push(R(y.CodeMark, e.lineStart + t.pos, e.lineStart + s)), e.nextLine();
|
|
213
|
+
break;
|
|
214
|
+
}
|
|
215
|
+
{
|
|
216
|
+
o = !0, n || (A(c, e.lineStart - 1, e.lineStart), r = !1);
|
|
217
|
+
for (let e of t.markers) c.push(e);
|
|
218
|
+
let i = e.lineStart + t.basePos, a = e.lineStart + t.text.length;
|
|
219
|
+
i < a && (A(c, i, a), r = !1);
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
return e.addNode(e.buffer.writeElements(c, -r).finish(y.FencedCode, e.prevLineEnd() - r), r), !0;
|
|
223
|
+
},
|
|
224
|
+
Blockquote(e, t) {
|
|
225
|
+
let n = _e(t);
|
|
226
|
+
return n < 0 ? !1 : (e.startContext(y.Blockquote, t.pos), e.addNode(y.QuoteMark, e.lineStart + t.pos, e.lineStart + t.pos + 1), t.moveBase(t.pos + n), null);
|
|
227
|
+
},
|
|
228
|
+
HorizontalRule(e, t) {
|
|
229
|
+
if (C(t, e, !1) < 0) return !1;
|
|
230
|
+
let n = e.lineStart + t.pos;
|
|
231
|
+
return e.nextLine(), e.addNode(y.HorizontalRule, n), !0;
|
|
232
|
+
},
|
|
233
|
+
BulletList(e, t) {
|
|
234
|
+
let n = T(t, e, !1);
|
|
235
|
+
if (n < 0) return !1;
|
|
236
|
+
e.block.type != y.BulletList && e.startContext(y.BulletList, t.basePos, t.next);
|
|
237
|
+
let r = k(t, t.pos + 1);
|
|
238
|
+
return e.startContext(y.ListItem, t.basePos, r - t.baseIndent), e.addNode(y.ListMark, e.lineStart + t.pos, e.lineStart + t.pos + n), t.moveBaseColumn(r), null;
|
|
239
|
+
},
|
|
240
|
+
OrderedList(e, t) {
|
|
241
|
+
let n = E(t, e, !1);
|
|
242
|
+
if (n < 0) return !1;
|
|
243
|
+
e.block.type != y.OrderedList && e.startContext(y.OrderedList, t.basePos, t.text.charCodeAt(t.pos + n - 1));
|
|
244
|
+
let r = k(t, t.pos + n);
|
|
245
|
+
return e.startContext(y.ListItem, t.basePos, r - t.baseIndent), e.addNode(y.ListMark, e.lineStart + t.pos, e.lineStart + t.pos + n), t.moveBaseColumn(r), null;
|
|
246
|
+
},
|
|
247
|
+
ATXHeading(e, t) {
|
|
248
|
+
let n = ve(t);
|
|
249
|
+
if (n < 0) return !1;
|
|
250
|
+
let r = t.pos, i = e.lineStart + r, a = ge(t.text, t.text.length, r), o = a;
|
|
251
|
+
for (; o > r && t.text.charCodeAt(o - 1) == t.next;) o--;
|
|
252
|
+
o != a && o != r && b(t.text.charCodeAt(o - 1)) || (o = t.text.length);
|
|
253
|
+
let s = e.buffer.write(y.HeaderMark, 0, n).writeElements(e.parser.parseInline(t.text.slice(r + n + 1, o), i + n + 1), -i);
|
|
254
|
+
o < t.text.length && s.write(y.HeaderMark, o - r, a - r);
|
|
255
|
+
let c = s.finish(y.ATXHeading1 - 1 + n, t.text.length - r);
|
|
256
|
+
return e.nextLine(), e.addNode(c, i), !0;
|
|
257
|
+
},
|
|
258
|
+
HTMLBlock(e, t) {
|
|
259
|
+
let n = Se(t, e, !1);
|
|
260
|
+
if (n < 0) return !1;
|
|
261
|
+
let r = e.lineStart + t.pos, i = O[n][1], a = [], o = i != D;
|
|
262
|
+
for (; !i.test(t.text) && e.nextLine();) {
|
|
263
|
+
if (t.depth < e.stack.length) {
|
|
264
|
+
o = !1;
|
|
265
|
+
break;
|
|
266
|
+
}
|
|
267
|
+
for (let e of t.markers) a.push(e);
|
|
268
|
+
}
|
|
269
|
+
o && e.nextLine();
|
|
270
|
+
let s = i == be ? y.CommentBlock : i == xe ? y.ProcessingInstructionBlock : y.HTMLBlock, c = e.prevLineEnd();
|
|
271
|
+
return e.addNode(e.buffer.writeElements(a, -r).finish(s, c - r), r), !0;
|
|
272
|
+
},
|
|
273
|
+
SetextHeading: void 0
|
|
274
|
+
}, Ce = class {
|
|
275
|
+
constructor(e) {
|
|
276
|
+
this.stage = 0, this.elts = [], this.pos = 0, this.start = e.start, this.advance(e.content);
|
|
277
|
+
}
|
|
278
|
+
nextLine(e, t, n) {
|
|
279
|
+
if (this.stage == -1) return !1;
|
|
280
|
+
let r = n.content + "\n" + t.scrub(), i = this.advance(r);
|
|
281
|
+
return i > -1 && i < r.length && this.complete(e, n, i);
|
|
282
|
+
}
|
|
283
|
+
finish(e, t) {
|
|
284
|
+
return (this.stage == 2 || this.stage == 3) && x(t.content, this.pos) == t.content.length && this.complete(e, t, t.content.length);
|
|
285
|
+
}
|
|
286
|
+
complete(e, t, n) {
|
|
287
|
+
return e.addLeafElement(t, R(y.LinkReference, this.start, this.start + n, this.elts)), !0;
|
|
288
|
+
}
|
|
289
|
+
nextStage(e) {
|
|
290
|
+
return e ? (this.pos = e.to - this.start, this.elts.push(e), this.stage++, !0) : (e === !1 && (this.stage = -1), !1);
|
|
291
|
+
}
|
|
292
|
+
advance(e) {
|
|
293
|
+
for (;;) if (this.stage == -1) return -1;
|
|
294
|
+
else if (this.stage == 0) {
|
|
295
|
+
if (!this.nextStage(Be(e, this.pos, this.start, !0))) return -1;
|
|
296
|
+
if (e.charCodeAt(this.pos) != 58) return this.stage = -1;
|
|
297
|
+
this.elts.push(R(y.LinkMark, this.pos + this.start, this.pos + this.start + 1)), this.pos++;
|
|
298
|
+
} else if (this.stage == 1) {
|
|
299
|
+
if (!this.nextStage(Re(e, x(e, this.pos), this.start))) return -1;
|
|
300
|
+
} else if (this.stage == 2) {
|
|
301
|
+
let t = x(e, this.pos), n = 0;
|
|
302
|
+
if (t > this.pos) {
|
|
303
|
+
let r = ze(e, t, this.start);
|
|
304
|
+
if (r) {
|
|
305
|
+
let t = M(e, r.to - this.start);
|
|
306
|
+
t > 0 && (this.nextStage(r), n = t);
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
return n || (n = M(e, this.pos)), n > 0 && n < e.length ? n : -1;
|
|
310
|
+
} else return M(e, this.pos);
|
|
311
|
+
}
|
|
312
|
+
};
|
|
313
|
+
function M(e, t) {
|
|
314
|
+
for (; t < e.length; t++) {
|
|
315
|
+
let n = e.charCodeAt(t);
|
|
316
|
+
if (n == 10) break;
|
|
317
|
+
if (!b(n)) return -1;
|
|
318
|
+
}
|
|
319
|
+
return t;
|
|
320
|
+
}
|
|
321
|
+
var we = class {
|
|
322
|
+
nextLine(e, t, n) {
|
|
323
|
+
let r = t.depth < e.stack.length ? -1 : ye(t), i = t.next;
|
|
324
|
+
if (r < 0) return !1;
|
|
325
|
+
let a = R(y.HeaderMark, e.lineStart + t.pos, e.lineStart + r);
|
|
326
|
+
return e.nextLine(), e.addLeafElement(n, R(i == 61 ? y.SetextHeading1 : y.SetextHeading2, n.start, e.prevLineEnd(), [...e.parser.parseInline(n.content, n.start), a])), !0;
|
|
327
|
+
}
|
|
328
|
+
finish() {
|
|
329
|
+
return !1;
|
|
330
|
+
}
|
|
331
|
+
}, Te = {
|
|
332
|
+
LinkReference(e, t) {
|
|
333
|
+
return t.content.charCodeAt(0) == 91 ? new Ce(t) : null;
|
|
334
|
+
},
|
|
335
|
+
SetextHeading() {
|
|
336
|
+
return new we();
|
|
337
|
+
}
|
|
338
|
+
}, Ee = [
|
|
339
|
+
(e, t) => ve(t) >= 0,
|
|
340
|
+
(e, t) => S(t) >= 0,
|
|
341
|
+
(e, t) => _e(t) >= 0,
|
|
342
|
+
(e, t) => T(t, e, !0) >= 0,
|
|
343
|
+
(e, t) => E(t, e, !0) >= 0,
|
|
344
|
+
(e, t) => C(t, e, !0) >= 0,
|
|
345
|
+
(e, t) => Se(t, e, !0) >= 0
|
|
346
|
+
], De = {
|
|
347
|
+
text: "",
|
|
348
|
+
end: 0
|
|
349
|
+
}, Oe = class {
|
|
350
|
+
constructor(e, t, n, r) {
|
|
351
|
+
this.parser = e, this.input = t, this.ranges = r, this.line = new pe(), this.atEnd = !1, this.reusePlaceholders = /* @__PURE__ */ new Map(), this.stoppedAt = null, this.rangeI = 0, this.to = r[r.length - 1].to, this.lineStart = this.absoluteLineStart = this.absoluteLineEnd = r[0].from, this.block = de.create(y.Document, 0, this.lineStart, 0, 0), this.stack = [this.block], this.fragments = n.length ? new He(n, t) : null, this.readLine();
|
|
352
|
+
}
|
|
353
|
+
get parsedPos() {
|
|
354
|
+
return this.absoluteLineStart;
|
|
355
|
+
}
|
|
356
|
+
advance() {
|
|
357
|
+
if (this.stoppedAt != null && this.absoluteLineStart > this.stoppedAt) return this.finish();
|
|
358
|
+
let { line: e } = this;
|
|
359
|
+
for (;;) {
|
|
360
|
+
for (let t = 0;;) {
|
|
361
|
+
let n = e.depth < this.stack.length ? this.stack[this.stack.length - 1] : null;
|
|
362
|
+
for (; t < e.markers.length && (!n || e.markers[t].from < n.end);) {
|
|
363
|
+
let n = e.markers[t++];
|
|
364
|
+
this.addNode(n.type, n.from, n.to);
|
|
365
|
+
}
|
|
366
|
+
if (!n) break;
|
|
367
|
+
this.finishContext();
|
|
368
|
+
}
|
|
369
|
+
if (e.pos < e.text.length) break;
|
|
370
|
+
if (!this.nextLine()) return this.finish();
|
|
371
|
+
}
|
|
372
|
+
if (this.fragments && this.reuseFragment(e.basePos)) return null;
|
|
373
|
+
start: for (;;) {
|
|
374
|
+
for (let t of this.parser.blockParsers) if (t) {
|
|
375
|
+
let n = t(this, e);
|
|
376
|
+
if (n != 0) {
|
|
377
|
+
if (n == 1) return null;
|
|
378
|
+
e.forward();
|
|
379
|
+
continue start;
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
break;
|
|
383
|
+
}
|
|
384
|
+
if (e.pos == e.text.length) return this.nextLine() ? null : this.finish();
|
|
385
|
+
let t = new fe(this.lineStart + e.pos, e.text.slice(e.pos));
|
|
386
|
+
for (let e of this.parser.leafBlockParsers) if (e) {
|
|
387
|
+
let n = e(this, t);
|
|
388
|
+
n && t.parsers.push(n);
|
|
389
|
+
}
|
|
390
|
+
lines: for (; this.nextLine() && e.pos != e.text.length;) {
|
|
391
|
+
if (e.indent < e.baseIndent + 4) {
|
|
392
|
+
for (let n of this.parser.endLeafBlock) if (n(this, e, t)) break lines;
|
|
393
|
+
}
|
|
394
|
+
for (let n of t.parsers) if (n.nextLine(this, e, t)) return null;
|
|
395
|
+
t.content += "\n" + e.scrub();
|
|
396
|
+
for (let n of e.markers) t.marks.push(n);
|
|
397
|
+
}
|
|
398
|
+
return this.finishLeaf(t), null;
|
|
399
|
+
}
|
|
400
|
+
stopAt(e) {
|
|
401
|
+
if (this.stoppedAt != null && this.stoppedAt < e) throw RangeError("Can't move stoppedAt forward");
|
|
402
|
+
this.stoppedAt = e;
|
|
403
|
+
}
|
|
404
|
+
reuseFragment(e) {
|
|
405
|
+
if (!this.fragments.moveTo(this.absoluteLineStart + e, this.absoluteLineStart) || !this.fragments.matches(this.block.hash)) return !1;
|
|
406
|
+
let t = this.fragments.takeNodes(this);
|
|
407
|
+
return t ? (this.absoluteLineStart += t, this.lineStart = Ue(this.absoluteLineStart, this.ranges), this.moveRangeI(), this.absoluteLineStart < this.to ? (this.lineStart++, this.absoluteLineStart++, this.readLine()) : (this.atEnd = !0, this.readLine()), !0) : !1;
|
|
408
|
+
}
|
|
409
|
+
get depth() {
|
|
410
|
+
return this.stack.length;
|
|
411
|
+
}
|
|
412
|
+
parentType(e = this.depth - 1) {
|
|
413
|
+
return this.parser.nodeSet.types[this.stack[e].type];
|
|
414
|
+
}
|
|
415
|
+
nextLine() {
|
|
416
|
+
return this.lineStart += this.line.text.length, this.absoluteLineEnd >= this.to ? (this.absoluteLineStart = this.absoluteLineEnd, this.atEnd = !0, this.readLine(), !1) : (this.lineStart++, this.absoluteLineStart = this.absoluteLineEnd + 1, this.moveRangeI(), this.readLine(), !0);
|
|
417
|
+
}
|
|
418
|
+
peekLine() {
|
|
419
|
+
return this.scanLine(this.absoluteLineEnd + 1).text;
|
|
420
|
+
}
|
|
421
|
+
moveRangeI() {
|
|
422
|
+
for (; this.rangeI < this.ranges.length - 1 && this.absoluteLineStart >= this.ranges[this.rangeI].to;) this.rangeI++, this.absoluteLineStart = Math.max(this.absoluteLineStart, this.ranges[this.rangeI].from);
|
|
423
|
+
}
|
|
424
|
+
scanLine(e) {
|
|
425
|
+
let t = De;
|
|
426
|
+
if (t.end = e, e >= this.to) t.text = "";
|
|
427
|
+
else if (t.text = this.lineChunkAt(e), t.end += t.text.length, this.ranges.length > 1) {
|
|
428
|
+
let e = this.absoluteLineStart, n = this.rangeI;
|
|
429
|
+
for (; this.ranges[n].to < t.end;) {
|
|
430
|
+
n++;
|
|
431
|
+
let r = this.ranges[n].from, i = this.lineChunkAt(r);
|
|
432
|
+
t.end = r + i.length, t.text = t.text.slice(0, this.ranges[n - 1].to - e) + i, e = t.end - t.text.length;
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
return t;
|
|
436
|
+
}
|
|
437
|
+
readLine() {
|
|
438
|
+
let { line: e } = this, { text: t, end: n } = this.scanLine(this.absoluteLineStart);
|
|
439
|
+
for (this.absoluteLineEnd = n, e.reset(t); e.depth < this.stack.length; e.depth++) {
|
|
440
|
+
let t = this.stack[e.depth], n = this.parser.skipContextMarkup[t.type];
|
|
441
|
+
if (!n) throw Error("Unhandled block context " + y[t.type]);
|
|
442
|
+
let r = this.line.markers.length;
|
|
443
|
+
if (!n(t, this, e)) {
|
|
444
|
+
this.line.markers.length > r && (t.end = this.line.markers[this.line.markers.length - 1].to), e.forward();
|
|
445
|
+
break;
|
|
446
|
+
}
|
|
447
|
+
e.forward();
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
lineChunkAt(e) {
|
|
451
|
+
let t = this.input.chunk(e), n;
|
|
452
|
+
if (this.input.lineChunks) n = t == "\n" ? "" : t;
|
|
453
|
+
else {
|
|
454
|
+
let e = t.indexOf("\n");
|
|
455
|
+
n = e < 0 ? t : t.slice(0, e);
|
|
456
|
+
}
|
|
457
|
+
return e + n.length > this.to ? n.slice(0, this.to - e) : n;
|
|
458
|
+
}
|
|
459
|
+
prevLineEnd() {
|
|
460
|
+
return this.atEnd ? this.lineStart : this.lineStart - 1;
|
|
461
|
+
}
|
|
462
|
+
startContext(e, t, n = 0) {
|
|
463
|
+
this.block = de.create(e, n, this.lineStart + t, this.block.hash, this.lineStart + this.line.text.length), this.stack.push(this.block);
|
|
464
|
+
}
|
|
465
|
+
startComposite(e, t, n = 0) {
|
|
466
|
+
this.startContext(this.parser.getNodeType(e), t, n);
|
|
467
|
+
}
|
|
468
|
+
addNode(e, t, n) {
|
|
469
|
+
typeof e == "number" && (e = new a(this.parser.nodeSet.types[e], I, I, (n ?? this.prevLineEnd()) - t)), this.block.addChild(e, t - this.block.from);
|
|
470
|
+
}
|
|
471
|
+
addElement(e) {
|
|
472
|
+
this.block.addChild(e.toTree(this.parser.nodeSet), e.from - this.block.from);
|
|
473
|
+
}
|
|
474
|
+
addLeafElement(e, t) {
|
|
475
|
+
this.addNode(this.buffer.writeElements(G(t.children, e.marks), -t.from).finish(t.type, t.to - t.from), t.from);
|
|
476
|
+
}
|
|
477
|
+
finishContext() {
|
|
478
|
+
let e = this.stack.pop(), t = this.stack[this.stack.length - 1];
|
|
479
|
+
t.addChild(e.toTree(this.parser.nodeSet), e.from - t.from), this.block = t;
|
|
480
|
+
}
|
|
481
|
+
finish() {
|
|
482
|
+
for (; this.stack.length > 1;) this.finishContext();
|
|
483
|
+
return this.addGaps(this.block.toTree(this.parser.nodeSet, this.lineStart));
|
|
484
|
+
}
|
|
485
|
+
addGaps(e) {
|
|
486
|
+
return this.ranges.length > 1 ? ke(this.ranges, 0, e.topNode, this.ranges[0].from, this.reusePlaceholders) : e;
|
|
487
|
+
}
|
|
488
|
+
finishLeaf(e) {
|
|
489
|
+
for (let t of e.parsers) if (t.finish(this, e)) return;
|
|
490
|
+
let t = G(this.parser.parseInline(e.content, e.start), e.marks);
|
|
491
|
+
this.addNode(this.buffer.writeElements(t, -e.start).finish(y.Paragraph, e.content.length), e.start);
|
|
492
|
+
}
|
|
493
|
+
elt(e, t, n, r) {
|
|
494
|
+
return typeof e == "string" ? R(this.parser.getNodeType(e), t, n, r) : new Ne(e, t);
|
|
495
|
+
}
|
|
496
|
+
get buffer() {
|
|
497
|
+
return new Me(this.parser.nodeSet);
|
|
498
|
+
}
|
|
499
|
+
};
|
|
500
|
+
function ke(e, t, n, r, i) {
|
|
501
|
+
let o = e[t].to, s = [], c = [], l = n.from + r;
|
|
502
|
+
function u(n, i) {
|
|
503
|
+
for (; i ? n >= o : n > o;) {
|
|
504
|
+
let i = e[t + 1].from - o;
|
|
505
|
+
r += i, n += i, t++, o = e[t].to;
|
|
506
|
+
}
|
|
507
|
+
}
|
|
508
|
+
for (let a = n.firstChild; a; a = a.nextSibling) {
|
|
509
|
+
u(a.from + r, !0);
|
|
510
|
+
let n = a.from + r, d, f = i.get(a.tree);
|
|
511
|
+
f ? d = f : a.to + r > o ? (d = ke(e, t, a, r, i), u(a.to + r, !1)) : d = a.toTree(), s.push(d), c.push(n - l);
|
|
512
|
+
}
|
|
513
|
+
return u(n.to + r, !1), new a(n.type, s, c, n.to + r - l, n.tree ? n.tree.propValues : void 0);
|
|
514
|
+
}
|
|
515
|
+
var Ae = class e extends c {
|
|
516
|
+
constructor(e, t, n, r, i, a, o, s, c) {
|
|
517
|
+
super(), this.nodeSet = e, this.blockParsers = t, this.leafBlockParsers = n, this.blockNames = r, this.endLeafBlock = i, this.skipContextMarkup = a, this.inlineParsers = o, this.inlineNames = s, this.wrappers = c, this.nodeTypes = Object.create(null);
|
|
518
|
+
for (let t of e.types) this.nodeTypes[t.name] = t.id;
|
|
519
|
+
}
|
|
520
|
+
createParse(e, t, n) {
|
|
521
|
+
let r = new Oe(this, e, t, n);
|
|
522
|
+
for (let i of this.wrappers) r = i(r, e, t, n);
|
|
523
|
+
return r;
|
|
524
|
+
}
|
|
525
|
+
configure(n) {
|
|
526
|
+
let a = P(n);
|
|
527
|
+
if (!a) return this;
|
|
528
|
+
let { nodeSet: s, skipContextMarkup: c } = this, u = this.blockParsers.slice(), d = this.leafBlockParsers.slice(), f = this.blockNames.slice(), p = this.inlineParsers.slice(), m = this.inlineNames.slice(), h = this.endLeafBlock.slice(), g = this.wrappers;
|
|
529
|
+
if (N(a.defineNodes)) {
|
|
530
|
+
c = Object.assign({}, c);
|
|
531
|
+
let e = s.types.slice(), n;
|
|
532
|
+
for (let r of a.defineNodes) {
|
|
533
|
+
let { name: a, block: s, composite: l, style: u } = typeof r == "string" ? { name: r } : r;
|
|
534
|
+
if (e.some((e) => e.name == a)) continue;
|
|
535
|
+
l && (c[e.length] = (e, t, n) => l(t, n, e.value));
|
|
536
|
+
let d = e.length, f = l ? ["Block", "BlockContext"] : s ? d >= y.ATXHeading1 && d <= y.SetextHeading2 ? [
|
|
537
|
+
"Block",
|
|
538
|
+
"LeafBlock",
|
|
539
|
+
"Heading"
|
|
540
|
+
] : ["Block", "LeafBlock"] : void 0;
|
|
541
|
+
e.push(t.define({
|
|
542
|
+
id: d,
|
|
543
|
+
name: a,
|
|
544
|
+
props: f && [[i.group, f]]
|
|
545
|
+
})), u && (n || (n = {}), Array.isArray(u) || u instanceof o ? n[a] = u : Object.assign(n, u));
|
|
546
|
+
}
|
|
547
|
+
s = new l(e), n && (s = s.extend(r(n)));
|
|
548
|
+
}
|
|
549
|
+
if (N(a.props) && (s = s.extend(...a.props)), N(a.remove)) for (let e of a.remove) {
|
|
550
|
+
let t = this.blockNames.indexOf(e), n = this.inlineNames.indexOf(e);
|
|
551
|
+
t > -1 && (u[t] = d[t] = void 0), n > -1 && (p[n] = void 0);
|
|
552
|
+
}
|
|
553
|
+
if (N(a.parseBlock)) for (let e of a.parseBlock) {
|
|
554
|
+
let t = f.indexOf(e.name);
|
|
555
|
+
if (t > -1) u[t] = e.parse, d[t] = e.leaf;
|
|
556
|
+
else {
|
|
557
|
+
let t = e.before ? F(f, e.before) : e.after ? F(f, e.after) + 1 : f.length - 1;
|
|
558
|
+
u.splice(t, 0, e.parse), d.splice(t, 0, e.leaf), f.splice(t, 0, e.name);
|
|
559
|
+
}
|
|
560
|
+
e.endLeaf && h.push(e.endLeaf);
|
|
561
|
+
}
|
|
562
|
+
if (N(a.parseInline)) for (let e of a.parseInline) {
|
|
563
|
+
let t = m.indexOf(e.name);
|
|
564
|
+
if (t > -1) p[t] = e.parse;
|
|
565
|
+
else {
|
|
566
|
+
let t = e.before ? F(m, e.before) : e.after ? F(m, e.after) + 1 : m.length - 1;
|
|
567
|
+
p.splice(t, 0, e.parse), m.splice(t, 0, e.name);
|
|
568
|
+
}
|
|
569
|
+
}
|
|
570
|
+
return a.wrap && (g = g.concat(a.wrap)), new e(s, u, d, f, h, c, p, m, g);
|
|
571
|
+
}
|
|
572
|
+
getNodeType(e) {
|
|
573
|
+
let t = this.nodeTypes[e];
|
|
574
|
+
if (t == null) throw RangeError(`Unknown node type '${e}'`);
|
|
575
|
+
return t;
|
|
576
|
+
}
|
|
577
|
+
parseInline(e, t) {
|
|
578
|
+
let n = new W(this, e, t);
|
|
579
|
+
outer: for (let e = t; e < n.end;) {
|
|
580
|
+
let t = n.char(e);
|
|
581
|
+
for (let r of this.inlineParsers) if (r) {
|
|
582
|
+
let i = r(n, t, e);
|
|
583
|
+
if (i >= 0) {
|
|
584
|
+
e = i;
|
|
585
|
+
continue outer;
|
|
586
|
+
}
|
|
587
|
+
}
|
|
588
|
+
e++;
|
|
589
|
+
}
|
|
590
|
+
return n.resolveMarkers(0);
|
|
591
|
+
}
|
|
592
|
+
};
|
|
593
|
+
function N(e) {
|
|
594
|
+
return e != null && e.length > 0;
|
|
595
|
+
}
|
|
596
|
+
function P(e) {
|
|
597
|
+
if (!Array.isArray(e)) return e;
|
|
598
|
+
if (e.length == 0) return null;
|
|
599
|
+
let t = P(e[0]);
|
|
600
|
+
if (e.length == 1) return t;
|
|
601
|
+
let n = P(e.slice(1));
|
|
602
|
+
if (!n || !t) return t || n;
|
|
603
|
+
let r = (e, t) => (e || I).concat(t || I), i = t.wrap, a = n.wrap;
|
|
604
|
+
return {
|
|
605
|
+
props: r(t.props, n.props),
|
|
606
|
+
defineNodes: r(t.defineNodes, n.defineNodes),
|
|
607
|
+
parseBlock: r(t.parseBlock, n.parseBlock),
|
|
608
|
+
parseInline: r(t.parseInline, n.parseInline),
|
|
609
|
+
remove: r(t.remove, n.remove),
|
|
610
|
+
wrap: i ? a ? (e, t, n, r) => i(a(e, t, n, r), t, n, r) : i : a
|
|
611
|
+
};
|
|
612
|
+
}
|
|
613
|
+
function F(e, t) {
|
|
614
|
+
let n = e.indexOf(t);
|
|
615
|
+
if (n < 0) throw RangeError(`Position specified relative to unknown parser ${t}`);
|
|
616
|
+
return n;
|
|
617
|
+
}
|
|
618
|
+
var je = [t.none];
|
|
619
|
+
for (let e = 1, n; n = y[e]; e++) je[e] = t.define({
|
|
620
|
+
id: e,
|
|
621
|
+
name: n,
|
|
622
|
+
props: e >= y.Escape ? [] : [[i.group, e in he ? ["Block", "BlockContext"] : ["Block", "LeafBlock"]]],
|
|
623
|
+
top: n == "Document"
|
|
624
|
+
});
|
|
625
|
+
var I = [], Me = class {
|
|
626
|
+
constructor(e) {
|
|
627
|
+
this.nodeSet = e, this.content = [], this.nodes = [];
|
|
628
|
+
}
|
|
629
|
+
write(e, t, n, r = 0) {
|
|
630
|
+
return this.content.push(e, t, n, 4 + r * 4), this;
|
|
631
|
+
}
|
|
632
|
+
writeElements(e, t = 0) {
|
|
633
|
+
for (let n of e) n.writeTo(this, t);
|
|
634
|
+
return this;
|
|
635
|
+
}
|
|
636
|
+
finish(e, t) {
|
|
637
|
+
return a.build({
|
|
638
|
+
buffer: this.content,
|
|
639
|
+
nodeSet: this.nodeSet,
|
|
640
|
+
reused: this.nodes,
|
|
641
|
+
topID: e,
|
|
642
|
+
length: t
|
|
643
|
+
});
|
|
644
|
+
}
|
|
645
|
+
}, L = class {
|
|
646
|
+
constructor(e, t, n, r = I) {
|
|
647
|
+
this.type = e, this.from = t, this.to = n, this.children = r;
|
|
648
|
+
}
|
|
649
|
+
writeTo(e, t) {
|
|
650
|
+
let n = e.content.length;
|
|
651
|
+
e.writeElements(this.children, t), e.content.push(this.type, this.from + t, this.to + t, e.content.length + 4 - n);
|
|
652
|
+
}
|
|
653
|
+
toTree(e) {
|
|
654
|
+
return new Me(e).writeElements(this.children, -this.from).finish(this.type, this.to - this.from);
|
|
655
|
+
}
|
|
656
|
+
}, Ne = class {
|
|
657
|
+
constructor(e, t) {
|
|
658
|
+
this.tree = e, this.from = t;
|
|
659
|
+
}
|
|
660
|
+
get to() {
|
|
661
|
+
return this.from + this.tree.length;
|
|
662
|
+
}
|
|
663
|
+
get type() {
|
|
664
|
+
return this.tree.type.id;
|
|
665
|
+
}
|
|
666
|
+
get children() {
|
|
667
|
+
return I;
|
|
668
|
+
}
|
|
669
|
+
writeTo(e, t) {
|
|
670
|
+
e.nodes.push(this.tree), e.content.push(e.nodes.length - 1, this.from + t, this.to + t, -1);
|
|
671
|
+
}
|
|
672
|
+
toTree() {
|
|
673
|
+
return this.tree;
|
|
674
|
+
}
|
|
675
|
+
};
|
|
676
|
+
function R(e, t, n, r) {
|
|
677
|
+
return new L(e, t, n, r);
|
|
678
|
+
}
|
|
679
|
+
var Pe = {
|
|
680
|
+
resolve: "Emphasis",
|
|
681
|
+
mark: "EmphasisMark"
|
|
682
|
+
}, Fe = {
|
|
683
|
+
resolve: "Emphasis",
|
|
684
|
+
mark: "EmphasisMark"
|
|
685
|
+
}, z = {}, B = {}, V = class {
|
|
686
|
+
constructor(e, t, n, r) {
|
|
687
|
+
this.type = e, this.from = t, this.to = n, this.side = r;
|
|
688
|
+
}
|
|
689
|
+
}, Ie = "!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~", H = /[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\u2010-\u2027]/;
|
|
690
|
+
try {
|
|
691
|
+
H = /* @__PURE__ */ RegExp("[\\p{S}|\\p{P}]", "u");
|
|
692
|
+
} catch {}
|
|
693
|
+
var U = {
|
|
694
|
+
Escape(e, t, n) {
|
|
695
|
+
if (t != 92 || n == e.end - 1) return -1;
|
|
696
|
+
let r = e.char(n + 1);
|
|
697
|
+
for (let t = 0; t < 32; t++) if (Ie.charCodeAt(t) == r) return e.append(R(y.Escape, n, n + 2));
|
|
698
|
+
return -1;
|
|
699
|
+
},
|
|
700
|
+
Entity(e, t, n) {
|
|
701
|
+
if (t != 38) return -1;
|
|
702
|
+
let r = /^(?:#\d+|#x[a-f\d]+|\w+);/i.exec(e.slice(n + 1, n + 31));
|
|
703
|
+
return r ? e.append(R(y.Entity, n, n + 1 + r[0].length)) : -1;
|
|
704
|
+
},
|
|
705
|
+
InlineCode(e, t, n) {
|
|
706
|
+
if (t != 96 || n && e.char(n - 1) == 96) return -1;
|
|
707
|
+
let r = n + 1;
|
|
708
|
+
for (; r < e.end && e.char(r) == 96;) r++;
|
|
709
|
+
let i = r - n, a = 0;
|
|
710
|
+
for (; r < e.end; r++) if (e.char(r) == 96) {
|
|
711
|
+
if (a++, a == i && e.char(r + 1) != 96) return e.append(R(y.InlineCode, n, r + 1, [R(y.CodeMark, n, n + i), R(y.CodeMark, r + 1 - i, r + 1)]));
|
|
712
|
+
} else a = 0;
|
|
713
|
+
return -1;
|
|
714
|
+
},
|
|
715
|
+
HTMLTag(e, t, n) {
|
|
716
|
+
if (t != 60 || n == e.end - 1) return -1;
|
|
717
|
+
let r = e.slice(n + 1, e.end), i = /^(?:[a-z][-\w+.]+:[^\s>]+|[a-z\d.!#$%&'*+/=?^_`{|}~-]+@[a-z\d](?:[a-z\d-]{0,61}[a-z\d])?(?:\.[a-z\d](?:[a-z\d-]{0,61}[a-z\d])?)*)>/i.exec(r);
|
|
718
|
+
if (i) return e.append(R(y.Autolink, n, n + 1 + i[0].length, [
|
|
719
|
+
R(y.LinkMark, n, n + 1),
|
|
720
|
+
R(y.URL, n + 1, n + i[0].length),
|
|
721
|
+
R(y.LinkMark, n + i[0].length, n + 1 + i[0].length)
|
|
722
|
+
]));
|
|
723
|
+
let a = /^!--[^>](?:-[^-]|[^-])*?-->/i.exec(r);
|
|
724
|
+
if (a) return e.append(R(y.Comment, n, n + 1 + a[0].length));
|
|
725
|
+
let o = /^\?[^]*?\?>/.exec(r);
|
|
726
|
+
if (o) return e.append(R(y.ProcessingInstruction, n, n + 1 + o[0].length));
|
|
727
|
+
let s = /^(?:![A-Z][^]*?>|!\[CDATA\[[^]*?\]\]>|\/\s*[a-zA-Z][\w-]*\s*>|\s*[a-zA-Z][\w-]*(\s+[a-zA-Z:_][\w-.:]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*(\/\s*)?>)/.exec(r);
|
|
728
|
+
return s ? e.append(R(y.HTMLTag, n, n + 1 + s[0].length)) : -1;
|
|
729
|
+
},
|
|
730
|
+
Emphasis(e, t, n) {
|
|
731
|
+
if (t != 95 && t != 42) return -1;
|
|
732
|
+
let r = n + 1;
|
|
733
|
+
for (; e.char(r) == t;) r++;
|
|
734
|
+
let i = e.slice(n - 1, n), a = e.slice(r, r + 1), o = H.test(i), s = H.test(a), c = /\s|^$/.test(i), l = /\s|^$/.test(a), u = !l && (!s || c || o), d = !c && (!o || l || s), f = u && (t == 42 || !d || o), p = d && (t == 42 || !u || s);
|
|
735
|
+
return e.append(new V(t == 95 ? Pe : Fe, n, r, !!f | (p ? 2 : 0)));
|
|
736
|
+
},
|
|
737
|
+
HardBreak(e, t, n) {
|
|
738
|
+
if (t == 92 && e.char(n + 1) == 10) return e.append(R(y.HardBreak, n, n + 2));
|
|
739
|
+
if (t == 32) {
|
|
740
|
+
let t = n + 1;
|
|
741
|
+
for (; e.char(t) == 32;) t++;
|
|
742
|
+
if (e.char(t) == 10 && t >= n + 2) return e.append(R(y.HardBreak, n, t + 1));
|
|
743
|
+
}
|
|
744
|
+
return -1;
|
|
745
|
+
},
|
|
746
|
+
Link(e, t, n) {
|
|
747
|
+
return t == 91 ? e.append(new V(z, n, n + 1, 1)) : -1;
|
|
748
|
+
},
|
|
749
|
+
Image(e, t, n) {
|
|
750
|
+
return t == 33 && e.char(n + 1) == 91 ? e.append(new V(B, n, n + 2, 1)) : -1;
|
|
751
|
+
},
|
|
752
|
+
LinkEnd(e, t, n) {
|
|
753
|
+
if (t != 93) return -1;
|
|
754
|
+
for (let t = e.parts.length - 1; t >= 0; t--) {
|
|
755
|
+
let r = e.parts[t];
|
|
756
|
+
if (r instanceof V && (r.type == z || r.type == B)) {
|
|
757
|
+
if (!r.side || e.skipSpace(r.to) == n && !/[(\[]/.test(e.slice(n + 1, n + 2))) return e.parts[t] = null, -1;
|
|
758
|
+
let i = e.takeContent(t), a = e.parts[t] = Le(e, i, r.type == z ? y.Link : y.Image, r.from, n + 1);
|
|
759
|
+
if (r.type == z) for (let n = 0; n < t; n++) {
|
|
760
|
+
let t = e.parts[n];
|
|
761
|
+
t instanceof V && t.type == z && (t.side = 0);
|
|
762
|
+
}
|
|
763
|
+
return a.to;
|
|
764
|
+
}
|
|
765
|
+
}
|
|
766
|
+
return -1;
|
|
767
|
+
}
|
|
768
|
+
};
|
|
769
|
+
function Le(e, t, n, r, i) {
|
|
770
|
+
let { text: a } = e, o = e.char(i), s = i;
|
|
771
|
+
if (t.unshift(R(y.LinkMark, r, r + (n == y.Image ? 2 : 1))), t.push(R(y.LinkMark, i - 1, i)), o == 40) {
|
|
772
|
+
let n = e.skipSpace(i + 1), r = Re(a, n - e.offset, e.offset), o;
|
|
773
|
+
r && (n = e.skipSpace(r.to), n != r.to && (o = ze(a, n - e.offset, e.offset), o && (n = e.skipSpace(o.to)))), e.char(n) == 41 && (t.push(R(y.LinkMark, i, i + 1)), s = n + 1, r && t.push(r), o && t.push(o), t.push(R(y.LinkMark, n, s)));
|
|
774
|
+
} else if (o == 91) {
|
|
775
|
+
let n = Be(a, i - e.offset, e.offset, !1);
|
|
776
|
+
n && (t.push(n), s = n.to);
|
|
777
|
+
}
|
|
778
|
+
return R(n, r, s, t);
|
|
779
|
+
}
|
|
780
|
+
function Re(e, t, n) {
|
|
781
|
+
if (e.charCodeAt(t) == 60) {
|
|
782
|
+
for (let r = t + 1; r < e.length; r++) {
|
|
783
|
+
let i = e.charCodeAt(r);
|
|
784
|
+
if (i == 62) return R(y.URL, t + n, r + 1 + n);
|
|
785
|
+
if (i == 60 || i == 10) return !1;
|
|
786
|
+
}
|
|
787
|
+
return null;
|
|
788
|
+
}
|
|
789
|
+
{
|
|
790
|
+
let r = 0, i = t;
|
|
791
|
+
for (let t = !1; i < e.length; i++) {
|
|
792
|
+
let n = e.charCodeAt(i);
|
|
793
|
+
if (b(n)) break;
|
|
794
|
+
if (t) t = !1;
|
|
795
|
+
else if (n == 40) r++;
|
|
796
|
+
else if (n == 41) {
|
|
797
|
+
if (!r) break;
|
|
798
|
+
r--;
|
|
799
|
+
} else n == 92 && (t = !0);
|
|
800
|
+
}
|
|
801
|
+
return i > t ? R(y.URL, t + n, i + n) : i == e.length && null;
|
|
802
|
+
}
|
|
803
|
+
}
|
|
804
|
+
function ze(e, t, n) {
|
|
805
|
+
let r = e.charCodeAt(t);
|
|
806
|
+
if (r != 39 && r != 34 && r != 40) return !1;
|
|
807
|
+
let i = r == 40 ? 41 : r;
|
|
808
|
+
for (let r = t + 1, a = !1; r < e.length; r++) {
|
|
809
|
+
let o = e.charCodeAt(r);
|
|
810
|
+
if (a) a = !1;
|
|
811
|
+
else if (o == i) return R(y.LinkTitle, t + n, r + 1 + n);
|
|
812
|
+
else o == 92 && (a = !0);
|
|
813
|
+
}
|
|
814
|
+
return null;
|
|
815
|
+
}
|
|
816
|
+
function Be(e, t, n, r) {
|
|
817
|
+
for (let i = !1, a = t + 1, o = Math.min(e.length, a + 999); a < o; a++) {
|
|
818
|
+
let o = e.charCodeAt(a);
|
|
819
|
+
if (i) i = !1;
|
|
820
|
+
else if (o == 93) return !r && R(y.LinkLabel, t + n, a + 1 + n);
|
|
821
|
+
else {
|
|
822
|
+
if (r && !b(o) && (r = !1), o == 91) return !1;
|
|
823
|
+
o == 92 && (i = !0);
|
|
824
|
+
}
|
|
825
|
+
}
|
|
826
|
+
return null;
|
|
827
|
+
}
|
|
828
|
+
var W = class {
|
|
829
|
+
constructor(e, t, n) {
|
|
830
|
+
this.parser = e, this.text = t, this.offset = n, this.parts = [];
|
|
831
|
+
}
|
|
832
|
+
char(e) {
|
|
833
|
+
return e >= this.end ? -1 : this.text.charCodeAt(e - this.offset);
|
|
834
|
+
}
|
|
835
|
+
get end() {
|
|
836
|
+
return this.offset + this.text.length;
|
|
837
|
+
}
|
|
838
|
+
slice(e, t) {
|
|
839
|
+
return this.text.slice(e - this.offset, t - this.offset);
|
|
840
|
+
}
|
|
841
|
+
append(e) {
|
|
842
|
+
return this.parts.push(e), e.to;
|
|
843
|
+
}
|
|
844
|
+
addDelimiter(e, t, n, r, i) {
|
|
845
|
+
return this.append(new V(e, t, n, !!r | (i ? 2 : 0)));
|
|
846
|
+
}
|
|
847
|
+
get hasOpenLink() {
|
|
848
|
+
for (let e = this.parts.length - 1; e >= 0; e--) {
|
|
849
|
+
let t = this.parts[e];
|
|
850
|
+
if (t instanceof V && (t.type == z || t.type == B)) return !0;
|
|
851
|
+
}
|
|
852
|
+
return !1;
|
|
853
|
+
}
|
|
854
|
+
addElement(e) {
|
|
855
|
+
return this.append(e);
|
|
856
|
+
}
|
|
857
|
+
resolveMarkers(e) {
|
|
858
|
+
for (let t = e; t < this.parts.length; t++) {
|
|
859
|
+
let n = this.parts[t];
|
|
860
|
+
if (!(n instanceof V && n.type.resolve && n.side & 2)) continue;
|
|
861
|
+
let r = n.type == Pe || n.type == Fe, i = n.to - n.from, a, o = t - 1;
|
|
862
|
+
for (; o >= e; o--) {
|
|
863
|
+
let e = this.parts[o];
|
|
864
|
+
if (e instanceof V && e.side & 1 && e.type == n.type && !(r && (n.side & 1 || e.side & 2) && (e.to - e.from + i) % 3 == 0 && ((e.to - e.from) % 3 || i % 3))) {
|
|
865
|
+
a = e;
|
|
866
|
+
break;
|
|
867
|
+
}
|
|
868
|
+
}
|
|
869
|
+
if (!a) continue;
|
|
870
|
+
let s = n.type.resolve, c = [], l = a.from, u = n.to;
|
|
871
|
+
if (r) {
|
|
872
|
+
let e = Math.min(2, a.to - a.from, i);
|
|
873
|
+
l = a.to - e, u = n.from + e, s = e == 1 ? "Emphasis" : "StrongEmphasis";
|
|
874
|
+
}
|
|
875
|
+
a.type.mark && c.push(this.elt(a.type.mark, l, a.to));
|
|
876
|
+
for (let e = o + 1; e < t; e++) this.parts[e] instanceof L && c.push(this.parts[e]), this.parts[e] = null;
|
|
877
|
+
n.type.mark && c.push(this.elt(n.type.mark, n.from, u));
|
|
878
|
+
let d = this.elt(s, l, u, c);
|
|
879
|
+
this.parts[o] = r && a.from != l ? new V(a.type, a.from, l, a.side) : null, (this.parts[t] = r && n.to != u ? new V(n.type, u, n.to, n.side) : null) ? this.parts.splice(t, 0, d) : this.parts[t] = d;
|
|
880
|
+
}
|
|
881
|
+
let t = [];
|
|
882
|
+
for (let n = e; n < this.parts.length; n++) {
|
|
883
|
+
let e = this.parts[n];
|
|
884
|
+
e instanceof L && t.push(e);
|
|
885
|
+
}
|
|
886
|
+
return t;
|
|
887
|
+
}
|
|
888
|
+
findOpeningDelimiter(e) {
|
|
889
|
+
for (let t = this.parts.length - 1; t >= 0; t--) {
|
|
890
|
+
let n = this.parts[t];
|
|
891
|
+
if (n instanceof V && n.type == e && n.side & 1) return t;
|
|
892
|
+
}
|
|
893
|
+
return null;
|
|
894
|
+
}
|
|
895
|
+
takeContent(e) {
|
|
896
|
+
let t = this.resolveMarkers(e);
|
|
897
|
+
return this.parts.length = e, t;
|
|
898
|
+
}
|
|
899
|
+
getDelimiterAt(e) {
|
|
900
|
+
let t = this.parts[e];
|
|
901
|
+
return t instanceof V ? t : null;
|
|
902
|
+
}
|
|
903
|
+
skipSpace(e) {
|
|
904
|
+
return x(this.text, e - this.offset) + this.offset;
|
|
905
|
+
}
|
|
906
|
+
elt(e, t, n, r) {
|
|
907
|
+
return typeof e == "string" ? R(this.parser.getNodeType(e), t, n, r) : new Ne(e, t);
|
|
908
|
+
}
|
|
909
|
+
};
|
|
910
|
+
W.linkStart = z, W.imageStart = B;
|
|
911
|
+
function G(e, t) {
|
|
912
|
+
if (!t.length) return e;
|
|
913
|
+
if (!e.length) return t;
|
|
914
|
+
let n = e.slice(), r = 0;
|
|
915
|
+
for (let e of t) {
|
|
916
|
+
for (; r < n.length && n[r].to < e.to;) r++;
|
|
917
|
+
if (r < n.length && n[r].from < e.from) {
|
|
918
|
+
let t = n[r];
|
|
919
|
+
t instanceof L && (n[r] = new L(t.type, t.from, t.to, G(t.children, [e])));
|
|
920
|
+
} else n.splice(r++, 0, e);
|
|
921
|
+
}
|
|
922
|
+
return n;
|
|
923
|
+
}
|
|
924
|
+
var Ve = [
|
|
925
|
+
y.CodeBlock,
|
|
926
|
+
y.ListItem,
|
|
927
|
+
y.OrderedList,
|
|
928
|
+
y.BulletList
|
|
929
|
+
], He = class {
|
|
930
|
+
constructor(e, t) {
|
|
931
|
+
this.fragments = e, this.input = t, this.i = 0, this.fragment = null, this.fragmentEnd = -1, this.cursor = null, e.length && (this.fragment = e[this.i++]);
|
|
932
|
+
}
|
|
933
|
+
nextFragment() {
|
|
934
|
+
this.fragment = this.i < this.fragments.length ? this.fragments[this.i++] : null, this.cursor = null, this.fragmentEnd = -1;
|
|
935
|
+
}
|
|
936
|
+
moveTo(e, t) {
|
|
937
|
+
for (; this.fragment && this.fragment.to <= e;) this.nextFragment();
|
|
938
|
+
if (!this.fragment || this.fragment.from > (e ? e - 1 : 0)) return !1;
|
|
939
|
+
if (this.fragmentEnd < 0) {
|
|
940
|
+
let e = this.fragment.to;
|
|
941
|
+
for (; e > 0 && this.input.read(e - 1, e) != "\n";) e--;
|
|
942
|
+
this.fragmentEnd = e ? e - 1 : 0;
|
|
943
|
+
}
|
|
944
|
+
let n = this.cursor;
|
|
945
|
+
n || (n = this.cursor = this.fragment.tree.cursor(), n.firstChild());
|
|
946
|
+
let r = e + this.fragment.offset;
|
|
947
|
+
for (; n.to <= r;) if (!n.parent()) return !1;
|
|
948
|
+
for (;;) {
|
|
949
|
+
if (n.from >= r) return this.fragment.from <= t;
|
|
950
|
+
if (!n.childAfter(r)) return !1;
|
|
951
|
+
}
|
|
952
|
+
}
|
|
953
|
+
matches(e) {
|
|
954
|
+
let t = this.cursor.tree;
|
|
955
|
+
return t && t.prop(i.contextHash) == e;
|
|
956
|
+
}
|
|
957
|
+
takeNodes(e) {
|
|
958
|
+
let t = this.cursor, n = this.fragment.offset, r = this.fragmentEnd - +!!this.fragment.openEnd, i = e.absoluteLineStart, o = i, s = e.block.children.length, c = o, l = s;
|
|
959
|
+
for (;;) {
|
|
960
|
+
if (t.to - n > r) {
|
|
961
|
+
if (t.type.isAnonymous && t.firstChild()) continue;
|
|
962
|
+
break;
|
|
963
|
+
}
|
|
964
|
+
let i = Ue(t.from - n, e.ranges);
|
|
965
|
+
if (t.to - n <= e.ranges[e.rangeI].to) e.addNode(t.tree, i);
|
|
966
|
+
else {
|
|
967
|
+
let n = new a(e.parser.nodeSet.types[y.Paragraph], [], [], 0, e.block.hashProp);
|
|
968
|
+
e.reusePlaceholders.set(n, t.tree), e.addNode(n, i);
|
|
969
|
+
}
|
|
970
|
+
if (t.type.is("Block") && (Ve.indexOf(t.type.id) < 0 ? (o = t.to - n, s = e.block.children.length) : (o = c, s = l), c = t.to - n, l = e.block.children.length), !t.nextSibling()) break;
|
|
971
|
+
}
|
|
972
|
+
for (; e.block.children.length > s;) e.block.children.pop(), e.block.positions.pop();
|
|
973
|
+
return o - i;
|
|
974
|
+
}
|
|
975
|
+
};
|
|
976
|
+
function Ue(e, t) {
|
|
977
|
+
let n = e;
|
|
978
|
+
for (let r = 1; r < t.length; r++) {
|
|
979
|
+
let i = t[r - 1].to, a = t[r].from;
|
|
980
|
+
i < e && (n -= a - i);
|
|
981
|
+
}
|
|
982
|
+
return n;
|
|
983
|
+
}
|
|
984
|
+
var We = r({
|
|
985
|
+
"Blockquote/...": s.quote,
|
|
986
|
+
HorizontalRule: s.contentSeparator,
|
|
987
|
+
"ATXHeading1/... SetextHeading1/...": s.heading1,
|
|
988
|
+
"ATXHeading2/... SetextHeading2/...": s.heading2,
|
|
989
|
+
"ATXHeading3/...": s.heading3,
|
|
990
|
+
"ATXHeading4/...": s.heading4,
|
|
991
|
+
"ATXHeading5/...": s.heading5,
|
|
992
|
+
"ATXHeading6/...": s.heading6,
|
|
993
|
+
"Comment CommentBlock": s.comment,
|
|
994
|
+
Escape: s.escape,
|
|
995
|
+
Entity: s.character,
|
|
996
|
+
"Emphasis/...": s.emphasis,
|
|
997
|
+
"StrongEmphasis/...": s.strong,
|
|
998
|
+
"Link/... Image/...": s.link,
|
|
999
|
+
"OrderedList/... BulletList/...": s.list,
|
|
1000
|
+
"BlockQuote/...": s.quote,
|
|
1001
|
+
"InlineCode CodeText": s.monospace,
|
|
1002
|
+
"URL Autolink": s.url,
|
|
1003
|
+
"HeaderMark HardBreak QuoteMark ListMark LinkMark EmphasisMark CodeMark": s.processingInstruction,
|
|
1004
|
+
"CodeInfo LinkLabel": s.labelName,
|
|
1005
|
+
LinkTitle: s.string,
|
|
1006
|
+
Paragraph: s.content
|
|
1007
|
+
}), Ge = new Ae(new l(je).extend(We), Object.keys(j).map((e) => j[e]), Object.keys(j).map((e) => Te[e]), Object.keys(j), Ee, he, Object.keys(U).map((e) => U[e]), Object.keys(U), []);
|
|
1008
|
+
function Ke(e, t, n) {
|
|
1009
|
+
let r = [];
|
|
1010
|
+
for (let i = e.firstChild, a = t;; i = i.nextSibling) {
|
|
1011
|
+
let e = i ? i.from : n;
|
|
1012
|
+
if (e > a && r.push({
|
|
1013
|
+
from: a,
|
|
1014
|
+
to: e
|
|
1015
|
+
}), !i) break;
|
|
1016
|
+
a = i.to;
|
|
1017
|
+
}
|
|
1018
|
+
return r;
|
|
1019
|
+
}
|
|
1020
|
+
function qe(e) {
|
|
1021
|
+
let { codeParser: t, htmlParser: r } = e;
|
|
1022
|
+
return { wrap: n((e, n) => {
|
|
1023
|
+
let i = e.type.id;
|
|
1024
|
+
if (t && (i == y.CodeBlock || i == y.FencedCode)) {
|
|
1025
|
+
let r = "";
|
|
1026
|
+
if (i == y.FencedCode) {
|
|
1027
|
+
let t = e.node.getChild(y.CodeInfo);
|
|
1028
|
+
t && (r = n.read(t.from, t.to));
|
|
1029
|
+
}
|
|
1030
|
+
let a = t(r);
|
|
1031
|
+
if (a) return {
|
|
1032
|
+
parser: a,
|
|
1033
|
+
overlay: (e) => e.type.id == y.CodeText,
|
|
1034
|
+
bracketed: i == y.FencedCode
|
|
1035
|
+
};
|
|
1036
|
+
} else if (r && (i == y.HTMLBlock || i == y.HTMLTag || i == y.CommentBlock)) return {
|
|
1037
|
+
parser: r,
|
|
1038
|
+
overlay: Ke(e.node, e.from, e.to)
|
|
1039
|
+
};
|
|
1040
|
+
return null;
|
|
1041
|
+
}) };
|
|
1042
|
+
}
|
|
1043
|
+
var Je = {
|
|
1044
|
+
resolve: "Strikethrough",
|
|
1045
|
+
mark: "StrikethroughMark"
|
|
1046
|
+
}, Ye = {
|
|
1047
|
+
defineNodes: [{
|
|
1048
|
+
name: "Strikethrough",
|
|
1049
|
+
style: { "Strikethrough/...": s.strikethrough }
|
|
1050
|
+
}, {
|
|
1051
|
+
name: "StrikethroughMark",
|
|
1052
|
+
style: s.processingInstruction
|
|
1053
|
+
}],
|
|
1054
|
+
parseInline: [{
|
|
1055
|
+
name: "Strikethrough",
|
|
1056
|
+
parse(e, t, n) {
|
|
1057
|
+
if (t != 126 || e.char(n + 1) != 126 || e.char(n + 2) == 126) return -1;
|
|
1058
|
+
let r = e.slice(n - 1, n), i = e.slice(n + 2, n + 3), a = /\s|^$/.test(r), o = /\s|^$/.test(i), s = H.test(r), c = H.test(i);
|
|
1059
|
+
return e.addDelimiter(Je, n, n + 2, !o && (!c || a || s), !a && (!s || o || c));
|
|
1060
|
+
},
|
|
1061
|
+
after: "Emphasis"
|
|
1062
|
+
}]
|
|
1063
|
+
};
|
|
1064
|
+
function K(e, t, n = 0, r, i = 0) {
|
|
1065
|
+
let a = 0, o = !0, s = -1, c = -1, l = !1, u = () => {
|
|
1066
|
+
r.push(e.elt("TableCell", i + s, i + c, e.parser.parseInline(t.slice(s, c), i + s)));
|
|
1067
|
+
};
|
|
1068
|
+
for (let d = n; d < t.length; d++) {
|
|
1069
|
+
let n = t.charCodeAt(d);
|
|
1070
|
+
n == 124 && !l ? ((!o || s > -1) && a++, o = !1, r && (s > -1 && u(), r.push(e.elt("TableDelimiter", d + i, d + i + 1))), s = c = -1) : (l || n != 32 && n != 9) && (s < 0 && (s = d), c = d + 1), l = !l && n == 92;
|
|
1071
|
+
}
|
|
1072
|
+
return s > -1 && (a++, r && u()), a;
|
|
1073
|
+
}
|
|
1074
|
+
function Xe(e, t) {
|
|
1075
|
+
for (let n = t; n < e.length; n++) {
|
|
1076
|
+
let t = e.charCodeAt(n);
|
|
1077
|
+
if (t == 124) return !0;
|
|
1078
|
+
t == 92 && n++;
|
|
1079
|
+
}
|
|
1080
|
+
return !1;
|
|
1081
|
+
}
|
|
1082
|
+
var Ze = /^[>\s]*\|?(\s*:?-+:?\s*\|)+(\s*:?-+:?\s*)?$/, Qe = class {
|
|
1083
|
+
constructor() {
|
|
1084
|
+
this.rows = null;
|
|
1085
|
+
}
|
|
1086
|
+
nextLine(e, t, n) {
|
|
1087
|
+
if (this.rows == null) {
|
|
1088
|
+
this.rows = !1;
|
|
1089
|
+
let r;
|
|
1090
|
+
if ((t.next == 45 || t.next == 58 || t.next == 124) && Ze.test(r = t.text.slice(t.pos))) {
|
|
1091
|
+
let i = [];
|
|
1092
|
+
K(e, n.content, 0, i, n.start) == K(e, r, 0) && (this.rows = [e.elt("TableHeader", n.start, n.start + n.content.length, i), e.elt("TableDelimiter", e.lineStart + t.pos, e.lineStart + t.text.length)]);
|
|
1093
|
+
}
|
|
1094
|
+
} else if (this.rows) {
|
|
1095
|
+
let n = [];
|
|
1096
|
+
K(e, t.text, t.pos, n, e.lineStart), this.rows.push(e.elt("TableRow", e.lineStart + t.pos, e.lineStart + t.text.length, n));
|
|
1097
|
+
}
|
|
1098
|
+
return !1;
|
|
1099
|
+
}
|
|
1100
|
+
finish(e, t) {
|
|
1101
|
+
return this.rows ? (e.addLeafElement(t, e.elt("Table", t.start, t.start + t.content.length, this.rows)), !0) : !1;
|
|
1102
|
+
}
|
|
1103
|
+
}, $e = {
|
|
1104
|
+
defineNodes: [
|
|
1105
|
+
{
|
|
1106
|
+
name: "Table",
|
|
1107
|
+
block: !0
|
|
1108
|
+
},
|
|
1109
|
+
{
|
|
1110
|
+
name: "TableHeader",
|
|
1111
|
+
style: { "TableHeader/...": s.heading }
|
|
1112
|
+
},
|
|
1113
|
+
"TableRow",
|
|
1114
|
+
{
|
|
1115
|
+
name: "TableCell",
|
|
1116
|
+
style: s.content
|
|
1117
|
+
},
|
|
1118
|
+
{
|
|
1119
|
+
name: "TableDelimiter",
|
|
1120
|
+
style: s.processingInstruction
|
|
1121
|
+
}
|
|
1122
|
+
],
|
|
1123
|
+
parseBlock: [{
|
|
1124
|
+
name: "Table",
|
|
1125
|
+
leaf(e, t) {
|
|
1126
|
+
return Xe(t.content, 0) ? new Qe() : null;
|
|
1127
|
+
},
|
|
1128
|
+
endLeaf(e, t, n) {
|
|
1129
|
+
if (n.parsers.some((e) => e instanceof Qe) || !Xe(t.text, t.basePos)) return !1;
|
|
1130
|
+
let r = e.peekLine();
|
|
1131
|
+
return Ze.test(r) && K(e, t.text, t.basePos) == K(e, r, t.basePos);
|
|
1132
|
+
},
|
|
1133
|
+
before: "SetextHeading"
|
|
1134
|
+
}]
|
|
1135
|
+
}, et = class {
|
|
1136
|
+
nextLine() {
|
|
1137
|
+
return !1;
|
|
1138
|
+
}
|
|
1139
|
+
finish(e, t) {
|
|
1140
|
+
return e.addLeafElement(t, e.elt("Task", t.start, t.start + t.content.length, [e.elt("TaskMarker", t.start, t.start + 3), ...e.parser.parseInline(t.content.slice(3), t.start + 3)])), !0;
|
|
1141
|
+
}
|
|
1142
|
+
}, tt = {
|
|
1143
|
+
defineNodes: [{
|
|
1144
|
+
name: "Task",
|
|
1145
|
+
block: !0,
|
|
1146
|
+
style: s.list
|
|
1147
|
+
}, {
|
|
1148
|
+
name: "TaskMarker",
|
|
1149
|
+
style: s.atom
|
|
1150
|
+
}],
|
|
1151
|
+
parseBlock: [{
|
|
1152
|
+
name: "TaskList",
|
|
1153
|
+
leaf(e, t) {
|
|
1154
|
+
return /^\[[ xX]\][ \t]/.test(t.content) && e.parentType().name == "ListItem" ? new et() : null;
|
|
1155
|
+
},
|
|
1156
|
+
after: "SetextHeading"
|
|
1157
|
+
}]
|
|
1158
|
+
}, nt = /(www\.)|(https?:\/\/)|([\w.+-]{1,100}@)|(mailto:|xmpp:)/gy, rt = /[\w-]+(\.[\w-]+)+(:\d+)?(\/[^\s<]*)?/gy, it = /[\w-]+\.[\w-]+($|[/:])/, at = /[\w.+-]+@[\w-]+(\.[\w.-]+)+/gy, ot = /\/[a-zA-Z\d@.]+/gy;
|
|
1159
|
+
function st(e, t, n, r) {
|
|
1160
|
+
let i = 0;
|
|
1161
|
+
for (let a = t; a < n; a++) e[a] == r && i++;
|
|
1162
|
+
return i;
|
|
1163
|
+
}
|
|
1164
|
+
function ct(e, t) {
|
|
1165
|
+
rt.lastIndex = t;
|
|
1166
|
+
let n = rt.exec(e);
|
|
1167
|
+
if (!n || it.exec(n[0])[0].indexOf("_") > -1) return -1;
|
|
1168
|
+
let r = t + n[0].length;
|
|
1169
|
+
for (;;) {
|
|
1170
|
+
let n = e[r - 1], i;
|
|
1171
|
+
if (/[?!.,:*_~]/.test(n) || n == ")" && st(e, t, r, ")") > st(e, t, r, "(")) r--;
|
|
1172
|
+
else if (n == ";" && (i = /&(?:#\d+|#x[a-f\d]+|\w+);$/.exec(e.slice(t, r)))) r = t + i.index;
|
|
1173
|
+
else break;
|
|
1174
|
+
}
|
|
1175
|
+
return r;
|
|
1176
|
+
}
|
|
1177
|
+
function lt(e, t) {
|
|
1178
|
+
at.lastIndex = t;
|
|
1179
|
+
let n = at.exec(e);
|
|
1180
|
+
if (!n) return -1;
|
|
1181
|
+
let r = n[0][n[0].length - 1];
|
|
1182
|
+
return r == "_" || r == "-" ? -1 : t + n[0].length - +(r == ".");
|
|
1183
|
+
}
|
|
1184
|
+
var ut = [
|
|
1185
|
+
$e,
|
|
1186
|
+
tt,
|
|
1187
|
+
Ye,
|
|
1188
|
+
{ parseInline: [{
|
|
1189
|
+
name: "Autolink",
|
|
1190
|
+
parse(e, t, n) {
|
|
1191
|
+
let r = n - e.offset;
|
|
1192
|
+
if (r && /\w/.test(e.text[r - 1])) return -1;
|
|
1193
|
+
nt.lastIndex = r;
|
|
1194
|
+
let i = nt.exec(e.text), a = -1;
|
|
1195
|
+
return !i || (i[1] || i[2] ? (a = ct(e.text, r + i[0].length), a > -1 && e.hasOpenLink && (a = r + /([^\[\]]|\[[^\]]*\])*/.exec(e.text.slice(r, a))[0].length)) : i[3] ? a = lt(e.text, r) : (a = lt(e.text, r + i[0].length), a > -1 && i[0] == "xmpp:" && (ot.lastIndex = a, i = ot.exec(e.text), i && (a = i.index + i[0].length))), a < 0) ? -1 : (e.addElement(e.elt("URL", n, a + e.offset)), a + e.offset);
|
|
1196
|
+
}
|
|
1197
|
+
}] }
|
|
1198
|
+
];
|
|
1199
|
+
function dt(e, t, n) {
|
|
1200
|
+
return (r, i, a) => {
|
|
1201
|
+
if (i != e || r.char(a + 1) == e) return -1;
|
|
1202
|
+
let o = [r.elt(n, a, a + 1)];
|
|
1203
|
+
for (let i = a + 1; i < r.end; i++) {
|
|
1204
|
+
let s = r.char(i);
|
|
1205
|
+
if (s == e) return r.addElement(r.elt(t, a, i + 1, o.concat(r.elt(n, i, i + 1))));
|
|
1206
|
+
if (s == 92 && o.push(r.elt("Escape", i, i++ + 2)), b(s)) break;
|
|
1207
|
+
}
|
|
1208
|
+
return -1;
|
|
1209
|
+
};
|
|
1210
|
+
}
|
|
1211
|
+
var ft = {
|
|
1212
|
+
defineNodes: [{
|
|
1213
|
+
name: "Superscript",
|
|
1214
|
+
style: s.special(s.content)
|
|
1215
|
+
}, {
|
|
1216
|
+
name: "SuperscriptMark",
|
|
1217
|
+
style: s.processingInstruction
|
|
1218
|
+
}],
|
|
1219
|
+
parseInline: [{
|
|
1220
|
+
name: "Superscript",
|
|
1221
|
+
parse: dt(94, "Superscript", "SuperscriptMark")
|
|
1222
|
+
}]
|
|
1223
|
+
}, pt = {
|
|
1224
|
+
defineNodes: [{
|
|
1225
|
+
name: "Subscript",
|
|
1226
|
+
style: s.special(s.content)
|
|
1227
|
+
}, {
|
|
1228
|
+
name: "SubscriptMark",
|
|
1229
|
+
style: s.processingInstruction
|
|
1230
|
+
}],
|
|
1231
|
+
parseInline: [{
|
|
1232
|
+
name: "Subscript",
|
|
1233
|
+
parse: dt(126, "Subscript", "SubscriptMark")
|
|
1234
|
+
}]
|
|
1235
|
+
}, mt = {
|
|
1236
|
+
defineNodes: [{
|
|
1237
|
+
name: "Emoji",
|
|
1238
|
+
style: s.character
|
|
1239
|
+
}],
|
|
1240
|
+
parseInline: [{
|
|
1241
|
+
name: "Emoji",
|
|
1242
|
+
parse(e, t, n) {
|
|
1243
|
+
let r;
|
|
1244
|
+
return t != 58 || !(r = /^[a-zA-Z_0-9]+:/.exec(e.slice(n + 1, e.end))) ? -1 : e.addElement(e.elt("Emoji", n, n + 1 + r[0].length));
|
|
1245
|
+
}
|
|
1246
|
+
}]
|
|
1247
|
+
}, ht = /* @__PURE__ */ e({
|
|
1248
|
+
commonmarkLanguage: () => St,
|
|
1249
|
+
deleteMarkupBackward: () => Mt,
|
|
1250
|
+
insertNewlineContinueMarkup: () => Dt,
|
|
1251
|
+
insertNewlineContinueMarkupCommand: () => Et,
|
|
1252
|
+
markdown: () => Ft,
|
|
1253
|
+
markdownKeymap: () => Nt,
|
|
1254
|
+
markdownLanguage: () => Y,
|
|
1255
|
+
pasteURLAsLink: () => zt
|
|
1256
|
+
}), gt = /*@__PURE__*/ ne({ commentTokens: { block: {
|
|
1257
|
+
open: "<!--",
|
|
1258
|
+
close: "-->"
|
|
1259
|
+
} } }), _t = /*@__PURE__*/ new i(), vt = /*@__PURE__*/ Ge.configure({ props: [
|
|
1260
|
+
/*@__PURE__*/ g.add((e) => !e.is("Block") || e.is("Document") || q(e) != null || yt(e) ? void 0 : (e, t) => ({
|
|
1261
|
+
from: t.doc.lineAt(e.from).to,
|
|
1262
|
+
to: e.to
|
|
1263
|
+
})),
|
|
1264
|
+
/*@__PURE__*/ _t.add(q),
|
|
1265
|
+
/*@__PURE__*/ se.add({ Document: () => null }),
|
|
1266
|
+
/*@__PURE__*/ oe.add({ Document: gt })
|
|
1267
|
+
] });
|
|
1268
|
+
function q(e) {
|
|
1269
|
+
let t = /^(?:ATX|Setext)Heading(\d)$/.exec(e.name);
|
|
1270
|
+
return t ? +t[1] : void 0;
|
|
1271
|
+
}
|
|
1272
|
+
function yt(e) {
|
|
1273
|
+
return e.name == "OrderedList" || e.name == "BulletList";
|
|
1274
|
+
}
|
|
1275
|
+
function bt(e, t) {
|
|
1276
|
+
let n = e;
|
|
1277
|
+
for (;;) {
|
|
1278
|
+
let e = n.nextSibling, r;
|
|
1279
|
+
if (!e || (r = q(e.type)) != null && r <= t) break;
|
|
1280
|
+
n = e;
|
|
1281
|
+
}
|
|
1282
|
+
return n.to;
|
|
1283
|
+
}
|
|
1284
|
+
var xt = /*@__PURE__*/ ae.of((e, t, n) => {
|
|
1285
|
+
for (let r = p(e).resolveInner(n, -1); r && !(r.from < t); r = r.parent) {
|
|
1286
|
+
let e = r.type.prop(_t);
|
|
1287
|
+
if (e == null) continue;
|
|
1288
|
+
let t = bt(r, e);
|
|
1289
|
+
if (t > n) return {
|
|
1290
|
+
from: n,
|
|
1291
|
+
to: t
|
|
1292
|
+
};
|
|
1293
|
+
}
|
|
1294
|
+
return null;
|
|
1295
|
+
});
|
|
1296
|
+
function J(e) {
|
|
1297
|
+
return new re(gt, e, [], "markdown");
|
|
1298
|
+
}
|
|
1299
|
+
var St = /*@__PURE__*/ J(vt), Y = /*@__PURE__*/ J(/* @__PURE__ */ vt.configure([
|
|
1300
|
+
ut,
|
|
1301
|
+
pt,
|
|
1302
|
+
ft,
|
|
1303
|
+
mt,
|
|
1304
|
+
{ props: [/*@__PURE__*/ g.add({ Table: (e, t) => ({
|
|
1305
|
+
from: t.doc.lineAt(e.from).to,
|
|
1306
|
+
to: e.to
|
|
1307
|
+
}) })] }
|
|
1308
|
+
]));
|
|
1309
|
+
function Ct(e, t) {
|
|
1310
|
+
return (n) => {
|
|
1311
|
+
if (n && e) {
|
|
1312
|
+
let t = null;
|
|
1313
|
+
if (n = /\S*/.exec(n)[0], t = typeof e == "function" ? e(n) : _.matchLanguageName(e, n, !0), t instanceof _) return t.support ? t.support.language.parser : ie.getSkippingParser(t.load());
|
|
1314
|
+
if (t) return t.parser;
|
|
1315
|
+
}
|
|
1316
|
+
return t ? t.parser : null;
|
|
1317
|
+
};
|
|
1318
|
+
}
|
|
1319
|
+
var X = class {
|
|
1320
|
+
constructor(e, t, n, r, i, a, o) {
|
|
1321
|
+
this.node = e, this.from = t, this.to = n, this.spaceBefore = r, this.spaceAfter = i, this.type = a, this.item = o;
|
|
1322
|
+
}
|
|
1323
|
+
blank(e, t = !0) {
|
|
1324
|
+
let n = this.spaceBefore + (this.node.name == "Blockquote" ? ">" : "");
|
|
1325
|
+
if (e != null) {
|
|
1326
|
+
for (; n.length < e;) n += " ";
|
|
1327
|
+
return n;
|
|
1328
|
+
}
|
|
1329
|
+
for (let e = this.to - this.from - n.length - this.spaceAfter.length; e > 0; e--) n += " ";
|
|
1330
|
+
return n + (t ? this.spaceAfter : "");
|
|
1331
|
+
}
|
|
1332
|
+
marker(e, t) {
|
|
1333
|
+
let n = this.node.name == "OrderedList" ? String(+Tt(this.item, e)[2] + t) : "";
|
|
1334
|
+
return this.spaceBefore + n + this.type + this.spaceAfter;
|
|
1335
|
+
}
|
|
1336
|
+
};
|
|
1337
|
+
function wt(e, t) {
|
|
1338
|
+
let n = [], r = [];
|
|
1339
|
+
for (let t = e; t; t = t.parent) {
|
|
1340
|
+
if (t.name == "FencedCode") return r;
|
|
1341
|
+
(t.name == "ListItem" || t.name == "Blockquote") && n.push(t);
|
|
1342
|
+
}
|
|
1343
|
+
for (let e = n.length - 1; e >= 0; e--) {
|
|
1344
|
+
let i = n[e], a, o = t.lineAt(i.from), s = i.from - o.from;
|
|
1345
|
+
if (i.name == "Blockquote" && (a = /^ *>( ?)/.exec(o.text.slice(s)))) r.push(new X(i, s, s + a[0].length, "", a[1], ">", null));
|
|
1346
|
+
else if (i.name == "ListItem" && i.parent.name == "OrderedList" && (a = /^( *)\d+([.)])( *)/.exec(o.text.slice(s)))) {
|
|
1347
|
+
let e = a[3], t = a[0].length;
|
|
1348
|
+
e.length >= 4 && (e = e.slice(0, e.length - 4), t -= 4), r.push(new X(i.parent, s, s + t, a[1], e, a[2], i));
|
|
1349
|
+
} else if (i.name == "ListItem" && i.parent.name == "BulletList" && (a = /^( *)([-+*])( {1,4}\[[ xX]\])?( +)/.exec(o.text.slice(s)))) {
|
|
1350
|
+
let e = a[4], t = a[0].length;
|
|
1351
|
+
e.length > 4 && (e = e.slice(0, e.length - 4), t -= 4);
|
|
1352
|
+
let n = a[2];
|
|
1353
|
+
a[3] && (n += a[3].replace(/[xX]/, " ")), r.push(new X(i.parent, s, s + t, a[1], e, n, i));
|
|
1354
|
+
}
|
|
1355
|
+
}
|
|
1356
|
+
return r;
|
|
1357
|
+
}
|
|
1358
|
+
function Tt(e, t) {
|
|
1359
|
+
return /^(\s*)(\d+)(?=[.)])/.exec(t.sliceString(e.from, e.from + 10));
|
|
1360
|
+
}
|
|
1361
|
+
function Z(e, t, n, r = 0) {
|
|
1362
|
+
for (let i = -1, a = e;;) {
|
|
1363
|
+
if (a.name == "ListItem") {
|
|
1364
|
+
let e = Tt(a, t), o = +e[2];
|
|
1365
|
+
if (i >= 0) {
|
|
1366
|
+
if (o != i + 1) return;
|
|
1367
|
+
n.push({
|
|
1368
|
+
from: a.from + e[1].length,
|
|
1369
|
+
to: a.from + e[0].length,
|
|
1370
|
+
insert: String(i + 2 + r)
|
|
1371
|
+
});
|
|
1372
|
+
}
|
|
1373
|
+
i = o;
|
|
1374
|
+
}
|
|
1375
|
+
let e = a.nextSibling;
|
|
1376
|
+
if (!e) break;
|
|
1377
|
+
a = e;
|
|
1378
|
+
}
|
|
1379
|
+
}
|
|
1380
|
+
function Q(e, t) {
|
|
1381
|
+
let n = /^[ \t]*/.exec(e)[0].length;
|
|
1382
|
+
if (!n || t.facet(f) != " ") return e;
|
|
1383
|
+
let r = v(e, 4, n), i = "";
|
|
1384
|
+
for (let e = r; e > 0;) e >= 4 ? (i += " ", e -= 4) : (i += " ", e--);
|
|
1385
|
+
return i + e.slice(n);
|
|
1386
|
+
}
|
|
1387
|
+
var Et = (e = {}) => ({ state: t, dispatch: n }) => {
|
|
1388
|
+
let r = p(t), { doc: i } = t, a = null, o = t.changeByRange((n) => {
|
|
1389
|
+
if (!n.empty || !Y.isActiveAt(t, n.from, -1) && !Y.isActiveAt(t, n.from, 1)) return a = { range: n };
|
|
1390
|
+
let o = n.from, s = i.lineAt(o), c = wt(r.resolveInner(o, -1), i);
|
|
1391
|
+
for (; c.length && c[c.length - 1].from > o - s.from;) c.pop();
|
|
1392
|
+
if (!c.length) return a = { range: n };
|
|
1393
|
+
let l = c[c.length - 1];
|
|
1394
|
+
if (l.to - l.spaceAfter.length > o - s.from) return a = { range: n };
|
|
1395
|
+
let u = o >= l.to - l.spaceAfter.length && !/\S/.test(s.text.slice(l.to));
|
|
1396
|
+
if (l.item && u) {
|
|
1397
|
+
if (l.item.from < s.from && !/^[\s>]*$/.test(s.text.slice(0, l.to))) return a = { range: n };
|
|
1398
|
+
let r = l.node.firstChild, u = l.node.getChild("ListItem", "ListItem");
|
|
1399
|
+
if (r.to >= o || u && u.to < o || s.from > 0 && !/[^\s>]/.test(i.lineAt(s.from - 1).text) || e.nonTightLists === !1) {
|
|
1400
|
+
let e = c.length > 1 ? c[c.length - 2] : null, t, n = "";
|
|
1401
|
+
e && e.item ? (t = s.from + e.from, n = e.marker(i, 1)) : t = s.from + (e ? e.to : 0);
|
|
1402
|
+
let r = [{
|
|
1403
|
+
from: t,
|
|
1404
|
+
to: o,
|
|
1405
|
+
insert: n
|
|
1406
|
+
}];
|
|
1407
|
+
return l.node.name == "OrderedList" && Z(l.item, i, r, -2), e && e.node.name == "OrderedList" && Z(e.item, i, r), {
|
|
1408
|
+
range: m.cursor(t + n.length),
|
|
1409
|
+
changes: r
|
|
1410
|
+
};
|
|
1411
|
+
}
|
|
1412
|
+
{
|
|
1413
|
+
let e = At(c, t, s);
|
|
1414
|
+
return {
|
|
1415
|
+
range: m.cursor(o + e.length + 1),
|
|
1416
|
+
changes: {
|
|
1417
|
+
from: s.from,
|
|
1418
|
+
insert: e + t.lineBreak
|
|
1419
|
+
}
|
|
1420
|
+
};
|
|
1421
|
+
}
|
|
1422
|
+
}
|
|
1423
|
+
if (l.node.name == "Blockquote" && u && s.from) {
|
|
1424
|
+
let e = i.lineAt(s.from - 1), r = />\s*$/.exec(e.text);
|
|
1425
|
+
if (r && r.index == l.from) {
|
|
1426
|
+
let i = t.changes([{
|
|
1427
|
+
from: e.from + r.index,
|
|
1428
|
+
to: e.to
|
|
1429
|
+
}, {
|
|
1430
|
+
from: s.from + l.from,
|
|
1431
|
+
to: s.to
|
|
1432
|
+
}]);
|
|
1433
|
+
return {
|
|
1434
|
+
range: n.map(i),
|
|
1435
|
+
changes: i
|
|
1436
|
+
};
|
|
1437
|
+
}
|
|
1438
|
+
}
|
|
1439
|
+
let d = [];
|
|
1440
|
+
l.node.name == "OrderedList" && Z(l.item, i, d);
|
|
1441
|
+
let f = l.item && l.item.from < s.from, p = "";
|
|
1442
|
+
if (!f || /^[\s\d.)\-+*>]*/.exec(s.text)[0].length >= l.to) for (let e = 0, t = c.length - 1; e <= t; e++) p += e == t && !f ? c[e].marker(i, 1) : c[e].blank(e < t ? v(s.text, 4, c[e + 1].from) - p.length : null);
|
|
1443
|
+
let h = o;
|
|
1444
|
+
for (; h > s.from && /\s/.test(s.text.charAt(h - s.from - 1));) h--;
|
|
1445
|
+
return p = Q(p, t), kt(l.node, t.doc) && (p = At(c, t, s) + t.lineBreak + p), d.push({
|
|
1446
|
+
from: h,
|
|
1447
|
+
to: o,
|
|
1448
|
+
insert: t.lineBreak + p
|
|
1449
|
+
}), {
|
|
1450
|
+
range: m.cursor(h + p.length + 1),
|
|
1451
|
+
changes: d
|
|
1452
|
+
};
|
|
1453
|
+
});
|
|
1454
|
+
return !a && (n(t.update(o, {
|
|
1455
|
+
scrollIntoView: !0,
|
|
1456
|
+
userEvent: "input"
|
|
1457
|
+
})), !0);
|
|
1458
|
+
}, Dt = /*@__PURE__*/ Et();
|
|
1459
|
+
function Ot(e) {
|
|
1460
|
+
return e.name == "QuoteMark" || e.name == "ListMark";
|
|
1461
|
+
}
|
|
1462
|
+
function kt(e, t) {
|
|
1463
|
+
if (e.name != "OrderedList" && e.name != "BulletList") return !1;
|
|
1464
|
+
let n = e.firstChild, r = e.getChild("ListItem", "ListItem");
|
|
1465
|
+
if (!r) return !1;
|
|
1466
|
+
let i = t.lineAt(n.to), a = t.lineAt(r.from), o = /^[\s>]*$/.test(i.text);
|
|
1467
|
+
return i.number + +!o < a.number;
|
|
1468
|
+
}
|
|
1469
|
+
function At(e, t, n) {
|
|
1470
|
+
let r = "";
|
|
1471
|
+
for (let t = 0, i = e.length - 2; t <= i; t++) r += e[t].blank(t < i ? v(n.text, 4, e[t + 1].from) - r.length : null, t < i);
|
|
1472
|
+
return Q(r, t);
|
|
1473
|
+
}
|
|
1474
|
+
function jt(e, t) {
|
|
1475
|
+
let n = e.resolveInner(t, -1), r = t;
|
|
1476
|
+
Ot(n) && (r = n.from, n = n.parent);
|
|
1477
|
+
for (let e; e = n.childBefore(r);) if (Ot(e)) r = e.from;
|
|
1478
|
+
else if (e.name == "OrderedList" || e.name == "BulletList") n = e.lastChild, r = n.to;
|
|
1479
|
+
else break;
|
|
1480
|
+
return n;
|
|
1481
|
+
}
|
|
1482
|
+
var Mt = ({ state: e, dispatch: t }) => {
|
|
1483
|
+
let n = p(e), r = null, i = e.changeByRange((t) => {
|
|
1484
|
+
let i = t.from, { doc: a } = e;
|
|
1485
|
+
if (t.empty && Y.isActiveAt(e, t.from)) {
|
|
1486
|
+
let t = a.lineAt(i), r = wt(jt(n, i), a);
|
|
1487
|
+
if (r.length) {
|
|
1488
|
+
let n = r[r.length - 1], a = n.to - n.spaceAfter.length + +!!n.spaceAfter;
|
|
1489
|
+
if (i - t.from > a && !/\S/.test(t.text.slice(a, i - t.from))) return {
|
|
1490
|
+
range: m.cursor(t.from + a),
|
|
1491
|
+
changes: {
|
|
1492
|
+
from: t.from + a,
|
|
1493
|
+
to: i
|
|
1494
|
+
}
|
|
1495
|
+
};
|
|
1496
|
+
if (i - t.from == a && (n.item && t.from <= n.item.from || /^[\s>]*$/.test(t.text.slice(0, n.to)))) {
|
|
1497
|
+
let r = t.from + n.from;
|
|
1498
|
+
if (n.item && n.node.from < n.item.from && /\S/.test(t.text.slice(n.from, n.to))) {
|
|
1499
|
+
let i = n.blank(v(t.text, 4, n.to) - v(t.text, 4, n.from));
|
|
1500
|
+
return r == t.from && (i = Q(i, e)), {
|
|
1501
|
+
range: m.cursor(r + i.length),
|
|
1502
|
+
changes: {
|
|
1503
|
+
from: r,
|
|
1504
|
+
to: t.from + n.to,
|
|
1505
|
+
insert: i
|
|
1506
|
+
}
|
|
1507
|
+
};
|
|
1508
|
+
}
|
|
1509
|
+
if (r < i) return {
|
|
1510
|
+
range: m.cursor(r),
|
|
1511
|
+
changes: {
|
|
1512
|
+
from: r,
|
|
1513
|
+
to: i
|
|
1514
|
+
}
|
|
1515
|
+
};
|
|
1516
|
+
}
|
|
1517
|
+
}
|
|
1518
|
+
}
|
|
1519
|
+
return r = { range: t };
|
|
1520
|
+
});
|
|
1521
|
+
return !r && (t(e.update(i, {
|
|
1522
|
+
scrollIntoView: !0,
|
|
1523
|
+
userEvent: "delete"
|
|
1524
|
+
})), !0);
|
|
1525
|
+
}, Nt = [{
|
|
1526
|
+
key: "Enter",
|
|
1527
|
+
run: Dt
|
|
1528
|
+
}, {
|
|
1529
|
+
key: "Backspace",
|
|
1530
|
+
run: Mt
|
|
1531
|
+
}], Pt = /*@__PURE__*/ ce({ matchClosingTags: !1 });
|
|
1532
|
+
function Ft(e = {}) {
|
|
1533
|
+
let { codeLanguages: t, defaultCodeLanguage: n, addKeymap: r = !0, base: { parser: i } = St, completeHTMLTags: a = !0, pasteURLAsLink: o = !0, htmlTagLanguage: s = Pt } = e;
|
|
1534
|
+
if (!(i instanceof Ae)) throw RangeError("Base parser provided to `markdown` should be a Markdown parser");
|
|
1535
|
+
let c = e.extensions ? [e.extensions] : [], l = [s.support, xt], u;
|
|
1536
|
+
o && l.push(zt), n instanceof ee ? (l.push(n.support), u = n.language) : n && (u = n);
|
|
1537
|
+
let d = t || u ? Ct(t, u) : void 0;
|
|
1538
|
+
c.push(qe({
|
|
1539
|
+
codeParser: d,
|
|
1540
|
+
htmlParser: s.language.parser
|
|
1541
|
+
})), r && l.push(te.high(h.of(Nt)));
|
|
1542
|
+
let f = J(i.configure(c));
|
|
1543
|
+
return a && l.push(f.data.of({ autocomplete: It })), new ee(f, l);
|
|
1544
|
+
}
|
|
1545
|
+
function It(e) {
|
|
1546
|
+
let { state: t, pos: n } = e, r = /<[:\-\.\w\u00b7-\uffff]*$/.exec(t.sliceDoc(n - 25, n));
|
|
1547
|
+
if (!r) return null;
|
|
1548
|
+
let i = p(t).resolveInner(n, -1);
|
|
1549
|
+
for (; i && !i.type.isTop;) {
|
|
1550
|
+
if (i.name == "CodeBlock" || i.name == "FencedCode" || i.name == "ProcessingInstructionBlock" || i.name == "CommentBlock" || i.name == "Link" || i.name == "Image") return null;
|
|
1551
|
+
i = i.parent;
|
|
1552
|
+
}
|
|
1553
|
+
return {
|
|
1554
|
+
from: n - r[0].length,
|
|
1555
|
+
to: n,
|
|
1556
|
+
options: Lt(),
|
|
1557
|
+
validFor: /^<[:\-\.\w\u00b7-\uffff]*$/
|
|
1558
|
+
};
|
|
1559
|
+
}
|
|
1560
|
+
var $ = null;
|
|
1561
|
+
function Lt() {
|
|
1562
|
+
if ($) return $;
|
|
1563
|
+
let e = le(new ue(u.create({ extensions: Pt }), 0, !0));
|
|
1564
|
+
return $ = e ? e.options : [];
|
|
1565
|
+
}
|
|
1566
|
+
var Rt = /code|horizontalrule|html|link|comment|processing|escape|entity|image|mark|url/i, zt = /*@__PURE__*/ d.domEventHandlers({ paste: (e, t) => {
|
|
1567
|
+
let { main: n } = t.state.selection;
|
|
1568
|
+
if (n.empty) return !1;
|
|
1569
|
+
let r = e.clipboardData?.getData("text/plain");
|
|
1570
|
+
if (!r || !/^(https?:\/\/|mailto:|xmpp:|www\.)/.test(r) || (/^www\./.test(r) && (r = "https://" + r), !Y.isActiveAt(t.state, n.from, 1))) return !1;
|
|
1571
|
+
let i = p(t.state), a = !1;
|
|
1572
|
+
return i.iterate({
|
|
1573
|
+
from: n.from,
|
|
1574
|
+
to: n.to,
|
|
1575
|
+
enter: (e) => {
|
|
1576
|
+
(e.from > n.from || Rt.test(e.name)) && (a = !0);
|
|
1577
|
+
},
|
|
1578
|
+
leave: (e) => {
|
|
1579
|
+
e.to < n.to && (a = !0);
|
|
1580
|
+
}
|
|
1581
|
+
}), !a && (t.dispatch({
|
|
1582
|
+
changes: [{
|
|
1583
|
+
from: n.from,
|
|
1584
|
+
insert: "["
|
|
1585
|
+
}, {
|
|
1586
|
+
from: n.to,
|
|
1587
|
+
insert: `](${r})`
|
|
1588
|
+
}],
|
|
1589
|
+
userEvent: "input.paste",
|
|
1590
|
+
scrollIntoView: !0
|
|
1591
|
+
}), !0);
|
|
1592
|
+
} });
|
|
1593
|
+
export { Ft as n, ut as r, ht as t };
|