@adyen/bento-vue2 1.28.0 → 1.29.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/@types/components.d.ts +4 -0
- package/dist/@types/index.d.ts +364 -107
- package/dist/accordion.js +101 -3
- package/dist/accordion.js.map +1 -1
- package/dist/action-bar.js +146 -2
- package/dist/action-bar.js.map +1 -1
- package/dist/alert.js +95 -3
- package/dist/alert.js.map +1 -1
- package/dist/assets/base-modal.css +1 -1
- package/dist/assets/button.css +1 -1
- package/dist/assets/checkbox-input.css +1 -1
- package/dist/assets/dialog-page.css +1 -1
- package/dist/assets/dropdown-default-textbox.css +1 -1
- package/dist/assets/dropdown.css +1 -1
- package/dist/assets/error-message.css +1 -1
- package/dist/assets/{data-grid.css → index11.css} +1 -1
- package/dist/assets/index14.css +1 -0
- package/dist/assets/index18.css +1 -0
- package/dist/assets/index19.css +1 -0
- package/dist/assets/{secondary-nav.css → index21.css} +1 -1
- package/dist/assets/index22.css +1 -0
- package/dist/assets/{action-bar.css → index23.css} +1 -1
- package/dist/assets/{sidepanel.css → index24.css} +1 -1
- package/dist/assets/index28.css +1 -0
- package/dist/assets/{accordion-item.css → index3.css} +1 -1
- package/dist/assets/index30.css +1 -0
- package/dist/assets/index33.css +1 -0
- package/dist/assets/{modal-fullscreen.css → index36.css} +1 -1
- package/dist/assets/{menu.css → index38.css} +1 -1
- package/dist/assets/index39.css +1 -0
- package/dist/assets/{popover.css → index40.css} +1 -1
- package/dist/assets/index42.css +1 -0
- package/dist/assets/index43.css +1 -0
- package/dist/assets/index45.css +1 -0
- package/dist/assets/{dashboard-section.css → index47.css} +1 -1
- package/dist/assets/index48.css +1 -0
- package/dist/assets/{card.css → index5.css} +1 -1
- package/dist/assets/index7.css +1 -0
- package/dist/assets/listbox-option-tag.css +1 -1
- package/dist/assets/loading-button.css +1 -1
- package/dist/assets/radio-input.css +1 -1
- package/dist/assets/segmented-control.css +1 -1
- package/dist/avatar.js +75 -0
- package/dist/avatar.js.map +1 -0
- package/dist/badge.js +24 -22
- package/dist/badge.js.map +1 -1
- package/dist/button.js +94 -14
- package/dist/button.js.map +1 -1
- package/dist/card.js +114 -4
- package/dist/card.js.map +1 -1
- package/dist/checkbox.js +155 -8
- package/dist/checkbox.js.map +1 -1
- package/dist/chunks/1-generic-use.3ea646cd.js +5 -0
- package/dist/chunks/1-generic-use.3ea646cd.js.map +1 -0
- package/dist/chunks/1-generic-use.ccca5813.js +5 -0
- package/dist/chunks/1-generic-use.ccca5813.js.map +1 -0
- package/dist/chunks/2-generic-use.443db127.js +5 -0
- package/dist/chunks/2-generic-use.443db127.js.map +1 -0
- package/dist/chunks/2-generic-use.d69d7c08.js +5 -0
- package/dist/chunks/2-generic-use.d69d7c08.js.map +1 -0
- package/dist/chunks/3-generic-use.9f74667f.js +5 -0
- package/dist/chunks/3-generic-use.9f74667f.js.map +1 -0
- package/dist/chunks/3-generic-use.fe7ae2ce.js +5 -0
- package/dist/chunks/3-generic-use.fe7ae2ce.js.map +1 -0
- package/dist/chunks/4-generic-use.0356f4a1.js +5 -0
- package/dist/chunks/4-generic-use.0356f4a1.js.map +1 -0
- package/dist/chunks/4-generic-use.cd04bad0.js +5 -0
- package/dist/chunks/4-generic-use.cd04bad0.js.map +1 -0
- package/dist/chunks/_plugin-vue2_normalizer.71e2aa87.js +33 -0
- package/dist/chunks/_plugin-vue2_normalizer.71e2aa87.js.map +1 -0
- package/dist/chunks/adding-payment-methods.d570e03e.js +5 -0
- package/dist/chunks/adding-payment-methods.d570e03e.js.map +1 -0
- package/dist/chunks/adding-payment-methods.e419d6c0.js +5 -0
- package/dist/chunks/adding-payment-methods.e419d6c0.js.map +1 -0
- package/dist/chunks/adyen-giving.480913b5.js +5 -0
- package/dist/chunks/adyen-giving.480913b5.js.map +1 -0
- package/dist/chunks/adyen-giving.54ed984c.js +5 -0
- package/dist/chunks/adyen-giving.54ed984c.js.map +1 -0
- package/dist/chunks/{aria-label.CaUURpnB.js → aria-label.ac9651a5.js} +1 -1
- package/dist/chunks/{aria-label.CaUURpnB.js.map → aria-label.ac9651a5.js.map} +1 -1
- package/dist/chunks/base-button.852204dc.js +88 -0
- package/dist/chunks/{base-button.DER7_IsF.js.map → base-button.852204dc.js.map} +1 -1
- package/dist/chunks/{base-modal.C5I7bR0d.js → base-modal.00322d31.js} +46 -42
- package/dist/chunks/{base-modal.C5I7bR0d.js.map → base-modal.00322d31.js.map} +1 -1
- package/dist/chunks/{base-modal.keys.C2PQXcE2.js → base-modal.keys.b08a6bdf.js} +1 -1
- package/dist/chunks/{base-modal.keys.C2PQXcE2.js.map → base-modal.keys.b08a6bdf.js.map} +1 -1
- package/dist/chunks/{button-actions-with-menu.f3yuLK-L.js → button-actions-with-menu.bc66bc0a.js} +27 -25
- package/dist/chunks/{button-actions-with-menu.f3yuLK-L.js.map → button-actions-with-menu.bc66bc0a.js.map} +1 -1
- package/dist/chunks/{button-actions.Bg9ey0p6.js → button-actions.430d7510.js} +31 -29
- package/dist/chunks/{button-actions.Bg9ey0p6.js.map → button-actions.430d7510.js.map} +1 -1
- package/dist/chunks/{button.DhAUh5JA.js → button.9184ade9.js} +24 -22
- package/dist/chunks/{button.DhAUh5JA.js.map → button.9184ade9.js.map} +1 -1
- package/dist/chunks/{calendar.B69z8gjb.js → calendar.bea81953.js} +332 -287
- package/dist/chunks/{calendar.B69z8gjb.js.map → calendar.bea81953.js.map} +1 -1
- package/dist/chunks/{checkbox-input.DwDwI2BD.js → checkbox-input.5ab6ebe7.js} +32 -28
- package/dist/chunks/{checkbox-input.DwDwI2BD.js.map → checkbox-input.5ab6ebe7.js.map} +1 -1
- package/dist/chunks/{checkbox.Bi2RDBEZ.js → checkbox.192e921e.js} +23 -21
- package/dist/chunks/{checkbox.Bi2RDBEZ.js.map → checkbox.192e921e.js.map} +1 -1
- package/dist/chunks/checkmark-circle-fill.382e27e2.js +26 -0
- package/dist/chunks/{checkmark-circle-fill.DVl6QSwm.js.map → checkmark-circle-fill.382e27e2.js.map} +1 -1
- package/dist/chunks/{checkmark-small.BtF8b2gE.js → checkmark-small.6f444bd7.js} +9 -7
- package/dist/chunks/{checkmark-small.BtF8b2gE.js.map → checkmark-small.6f444bd7.js.map} +1 -1
- package/dist/chunks/{chevron-left.CtnrsqUy.js → chevron-left.3cd9eeee.js} +18 -14
- package/dist/chunks/{chevron-left.CtnrsqUy.js.map → chevron-left.3cd9eeee.js.map} +1 -1
- package/dist/chunks/{chevron-up.B2uWhZf7.js → chevron-up.bade9c77.js} +19 -15
- package/dist/chunks/{chevron-up.B2uWhZf7.js.map → chevron-up.bade9c77.js.map} +1 -1
- package/dist/chunks/{controls-group.cSRFiEVO.js → controls-group.6b05fbb4.js} +19 -17
- package/dist/chunks/{controls-group.cSRFiEVO.js.map → controls-group.6b05fbb4.js.map} +1 -1
- package/dist/chunks/{copy.BtFWFG3q.js → copy.d5dd2b60.js} +19 -15
- package/dist/chunks/{copy.BtFWFG3q.js.map → copy.d5dd2b60.js.map} +1 -1
- package/dist/chunks/{country.types.Br0AjxGy.js → country.types.002caff2.js} +5 -5
- package/dist/chunks/{country.types.Br0AjxGy.js.map → country.types.002caff2.js.map} +1 -1
- package/dist/chunks/cross-circle-fill-small.b0310bd6.js +26 -0
- package/dist/chunks/cross-circle-fill-small.b0310bd6.js.map +1 -0
- package/dist/chunks/{cross-circle-fill.CnYH4R_h.js → cross-circle-fill.dd300d4c.js} +10 -8
- package/dist/chunks/{cross-circle-fill.CnYH4R_h.js.map → cross-circle-fill.dd300d4c.js.map} +1 -1
- package/dist/chunks/{cross-small.BLUwtRB-.js → cross-small.3bb94ec7.js} +12 -10
- package/dist/chunks/{cross-small.BLUwtRB-.js.map → cross-small.3bb94ec7.js.map} +1 -1
- package/dist/chunks/{cross.CsUPDmaA.js → cross.f47f6b7f.js} +12 -10
- package/dist/chunks/{cross.CsUPDmaA.js.map → cross.f47f6b7f.js.map} +1 -1
- package/dist/chunks/{data-grid-template.keys.2_AkxuNT.js → data-grid-template.keys.a819a991.js} +1 -1
- package/dist/chunks/{data-grid-template.keys.2_AkxuNT.js.map → data-grid-template.keys.a819a991.js.map} +1 -1
- package/dist/chunks/{date-input.BqBdAO1E.js → date-input.9186a0bf.js} +1 -1
- package/dist/chunks/{date-input.BqBdAO1E.js.map → date-input.9186a0bf.js.map} +1 -1
- package/dist/chunks/{debounce.DUTu11PS.js → debounce.b5ef6acf.js} +1 -1
- package/dist/chunks/{debounce.DUTu11PS.js.map → debounce.b5ef6acf.js.map} +1 -1
- package/dist/chunks/{dialog-page.DAh0M4mT.js → dialog-page.c663c657.js} +24 -20
- package/dist/chunks/{dialog-page.DAh0M4mT.js.map → dialog-page.c663c657.js.map} +1 -1
- package/dist/chunks/{dropdown-default-textbox.CKOkl_Qa.js → dropdown-default-textbox.346c40ea.js} +64 -51
- package/dist/chunks/dropdown-default-textbox.346c40ea.js.map +1 -0
- package/dist/chunks/{dropdown.yhhQCKve.js → dropdown.9bee6e1d.js} +248 -230
- package/dist/chunks/dropdown.9bee6e1d.js.map +1 -0
- package/dist/chunks/error-message.af88c25f.js +111 -0
- package/dist/chunks/{error-message.BSxUoE3_.js.map → error-message.af88c25f.js.map} +1 -1
- package/dist/chunks/es6.cf6b43e9.js +9 -0
- package/dist/chunks/es6.cf6b43e9.js.map +1 -0
- package/dist/chunks/events.f14a214b.js +50 -0
- package/dist/chunks/{events.CMzGybJJ.js.map → events.f14a214b.js.map} +1 -1
- package/dist/chunks/expand.d0ccfcfe.js +26 -0
- package/dist/chunks/expand.d0ccfcfe.js.map +1 -0
- package/dist/chunks/{fixed-scroller.Bq1AgPnw.js → fixed-scroller.5e51ffb3.js} +20 -18
- package/dist/chunks/{fixed-scroller.Bq1AgPnw.js.map → fixed-scroller.5e51ffb3.js.map} +1 -1
- package/dist/chunks/{footer-actions.DqMRmlV_.js → footer-actions.b4fe4fdb.js} +13 -11
- package/dist/chunks/{footer-actions.DqMRmlV_.js.map → footer-actions.b4fe4fdb.js.map} +1 -1
- package/dist/chunks/{form-layout.types.D3EKzbE7.js → form-layout.types.a7a1438d.js} +1 -1
- package/dist/chunks/{form-layout.types.D3EKzbE7.js.map → form-layout.types.a7a1438d.js.map} +1 -1
- package/dist/chunks/{get-slot-text.Cgn-E48s.js → get-slot-text.99c3d860.js} +2 -2
- package/dist/chunks/{get-slot-text.Cgn-E48s.js.map → get-slot-text.99c3d860.js.map} +1 -1
- package/dist/chunks/{grid-layout.HvTAa4to.js → grid-layout.e0025286.js} +13 -11
- package/dist/chunks/{grid-layout.HvTAa4to.js.map → grid-layout.e0025286.js.map} +1 -1
- package/dist/chunks/{i18n.BQkEbtPM.js → i18n.eb5b985b.js} +2 -2
- package/dist/chunks/{i18n.BQkEbtPM.js.map → i18n.eb5b985b.js.map} +1 -1
- package/dist/chunks/{structured-list-item.C9NTVDvT.js → index.1c8f9245.js} +22 -18
- package/dist/chunks/index.1c8f9245.js.map +1 -0
- package/dist/chunks/{popover.B8YH92W8.js → index.40b77741.js} +37 -31
- package/dist/chunks/index.40b77741.js.map +1 -0
- package/dist/chunks/index.4afa7b19.js +32 -0
- package/dist/chunks/index.4afa7b19.js.map +1 -0
- package/dist/chunks/{index.Cl4_42j5.js → index.4c062058.js} +1 -1
- package/dist/chunks/{index.Cl4_42j5.js.map → index.4c062058.js.map} +1 -1
- package/dist/chunks/{date.DKjxxR6P.js → index.614a5138.js} +51 -44
- package/dist/chunks/index.614a5138.js.map +1 -0
- package/dist/chunks/index.6584f75e.js +183 -0
- package/dist/chunks/{index.OCPp3NST.js.map → index.6584f75e.js.map} +1 -1
- package/dist/chunks/{index.xqFSZOAb.js → index.86453263.js} +2 -2
- package/dist/chunks/{index.xqFSZOAb.js.map → index.86453263.js.map} +1 -1
- package/dist/chunks/{menu.2TwUMlA9.js → index.8a037a95.js} +94 -82
- package/dist/chunks/index.8a037a95.js.map +1 -0
- package/dist/chunks/{focus-trap.DSkLNO_i.js → index.ba69cab6.js} +37 -35
- package/dist/chunks/index.ba69cab6.js.map +1 -0
- package/dist/chunks/{popper-container.Bt02N3o1.js → index.bad400d5.js} +436 -381
- package/dist/chunks/index.bad400d5.js.map +1 -0
- package/dist/chunks/{index.Z84QE0E2.js → index.d80206ed.js} +2 -2
- package/dist/chunks/{index.Z84QE0E2.js.map → index.d80206ed.js.map} +1 -1
- package/dist/chunks/{typography.Bjtu3Gca.js → index.e29a6907.js} +32 -30
- package/dist/chunks/index.e29a6907.js.map +1 -0
- package/dist/chunks/{link.DJ1A53gF.js → index.f46e4190.js} +24 -20
- package/dist/chunks/index.f46e4190.js.map +1 -0
- package/dist/chunks/{index.B_UZQ6qF.js → index.f55fdc32.js} +243 -209
- package/dist/chunks/{index.B_UZQ6qF.js.map → index.f55fdc32.js.map} +1 -1
- package/dist/chunks/{date-range-picker.DrnklTJ-.js → index.fc70e413.js} +117 -113
- package/dist/chunks/index.fc70e413.js.map +1 -0
- package/dist/chunks/{index.B_EJflcs.js → index.fdf12170.js} +2 -2
- package/dist/chunks/{index.B_EJflcs.js.map → index.fdf12170.js.map} +1 -1
- package/dist/chunks/{info.CyeBsLgt.js → info.a549470f.js} +12 -10
- package/dist/chunks/{info.CyeBsLgt.js.map → info.a549470f.js.map} +1 -1
- package/dist/chunks/internal-error.35cbb071.js +5 -0
- package/dist/chunks/internal-error.35cbb071.js.map +1 -0
- package/dist/chunks/internal-error.9a4823ed.js +5 -0
- package/dist/chunks/internal-error.9a4823ed.js.map +1 -0
- package/dist/chunks/{keyboard-navigation.Clz1jOaA.js → keyboard-navigation.bbc3d15c.js} +2 -2
- package/dist/chunks/{keyboard-navigation.Clz1jOaA.js.map → keyboard-navigation.bbc3d15c.js.map} +1 -1
- package/dist/chunks/listbox-option-tag.bac3121a.js +46 -0
- package/dist/chunks/listbox-option-tag.bac3121a.js.map +1 -0
- package/dist/chunks/loading-button.b5dca406.js +101 -0
- package/dist/chunks/loading-button.b5dca406.js.map +1 -0
- package/dist/chunks/{modal-fullscreen.keys.CMba3hYp.js → modal-fullscreen.keys.b9f31632.js} +1 -1
- package/dist/chunks/{modal-fullscreen.keys.CMba3hYp.js.map → modal-fullscreen.keys.b9f31632.js.map} +1 -1
- package/dist/chunks/no-results-found.58856d70.js +5 -0
- package/dist/chunks/no-results-found.58856d70.js.map +1 -0
- package/dist/chunks/no-results-found.cbb12f78.js +5 -0
- package/dist/chunks/no-results-found.cbb12f78.js.map +1 -0
- package/dist/chunks/notifications-cleared.71025c22.js +5 -0
- package/dist/chunks/notifications-cleared.71025c22.js.map +1 -0
- package/dist/chunks/notifications-cleared.c4f4bed4.js +5 -0
- package/dist/chunks/notifications-cleared.c4f4bed4.js.map +1 -0
- package/dist/chunks/{on-click-outside.CcNG5w7_.js → on-click-outside.3e0c3e2a.js} +1 -1
- package/dist/chunks/{on-click-outside.CcNG5w7_.js.map → on-click-outside.3e0c3e2a.js.map} +1 -1
- package/dist/chunks/page-not-found.a500440d.js +5 -0
- package/dist/chunks/page-not-found.a500440d.js.map +1 -0
- package/dist/chunks/page-not-found.d1a84ba7.js +5 -0
- package/dist/chunks/page-not-found.d1a84ba7.js.map +1 -0
- package/dist/chunks/{payment-method.D9Qx-s4V.js → payment-method.c55dd352.js} +21 -19
- package/dist/chunks/{payment-method.D9Qx-s4V.js.map → payment-method.c55dd352.js.map} +1 -1
- package/dist/chunks/planned-maintenance.7fa5ac16.js +5 -0
- package/dist/chunks/planned-maintenance.7fa5ac16.js.map +1 -0
- package/dist/chunks/planned-maintenance.cff01aed.js +5 -0
- package/dist/chunks/planned-maintenance.cff01aed.js.map +1 -0
- package/dist/chunks/{radio-input.BQcC0INR.js → radio-input.e34c0fa8.js} +17 -15
- package/dist/chunks/{radio-input.BQcC0INR.js.map → radio-input.e34c0fa8.js.map} +1 -1
- package/dist/chunks/referrals.178ce0eb.js +5 -0
- package/dist/chunks/referrals.178ce0eb.js.map +1 -0
- package/dist/chunks/referrals.599047da.js +5 -0
- package/dist/chunks/referrals.599047da.js.map +1 -0
- package/dist/chunks/{refresh.BKI9WwKh.js → refresh.2ef3d8a9.js} +10 -8
- package/dist/chunks/{refresh.BKI9WwKh.js.map → refresh.2ef3d8a9.js.map} +1 -1
- package/dist/chunks/{resize.Bqks3WUm.js → resize.a041304d.js} +1 -1
- package/dist/chunks/{resize.Bqks3WUm.js.map → resize.a041304d.js.map} +1 -1
- package/dist/chunks/{search.CBKhp7zB.js → search.83bba8e3.js} +13 -11
- package/dist/chunks/{search.CBKhp7zB.js.map → search.83bba8e3.js.map} +1 -1
- package/dist/chunks/{segmented-control.DGjIC7Ab.js → segmented-control.9f657859.js} +31 -27
- package/dist/chunks/{segmented-control.DGjIC7Ab.js.map → segmented-control.9f657859.js.map} +1 -1
- package/dist/chunks/{sidepanel.keys.R0DKQuYx.js → sidepanel.keys.1ed8a57c.js} +1 -1
- package/dist/chunks/{sidepanel.keys.R0DKQuYx.js.map → sidepanel.keys.1ed8a57c.js.map} +1 -1
- package/dist/chunks/success.41981fe8.js +5 -0
- package/dist/chunks/success.41981fe8.js.map +1 -0
- package/dist/chunks/success.77fac78b.js +5 -0
- package/dist/chunks/success.77fac78b.js.map +1 -0
- package/dist/chunks/{summary-grid.keys.BBbFrFGF.js → summary-grid.keys.1d1028c2.js} +1 -1
- package/dist/chunks/{summary-grid.keys.BBbFrFGF.js.map → summary-grid.keys.1d1028c2.js.map} +1 -1
- package/dist/chunks/{tabs.keys.Bc2pSKRw.js → tabs.keys.358742f2.js} +1 -1
- package/dist/chunks/{tabs.keys.Bc2pSKRw.js.map → tabs.keys.358742f2.js.map} +1 -1
- package/dist/chunks/{teleport.CQKBJZU5.js → teleport.84b0f20b.js} +16 -14
- package/dist/chunks/{teleport.CQKBJZU5.js.map → teleport.84b0f20b.js.map} +1 -1
- package/dist/chunks/{tooltip.DR8rbIYw.js → tooltip.77610390.js} +32 -29
- package/dist/chunks/{tooltip.DR8rbIYw.js.map → tooltip.77610390.js.map} +1 -1
- package/dist/chunks/{unique-id.XFfoKuc2.js → unique-id.a2a2b458.js} +20 -14
- package/dist/chunks/{unique-id.XFfoKuc2.js.map → unique-id.a2a2b458.js.map} +1 -1
- package/dist/chunks/upload-files.2708eca7.js +5 -0
- package/dist/chunks/upload-files.2708eca7.js.map +1 -0
- package/dist/chunks/upload-files.b4cd9f8b.js +5 -0
- package/dist/chunks/upload-files.b4cd9f8b.js.map +1 -0
- package/dist/chunks/{use-bento-toast-controller.BifdE4ak.js → use-bento-toast-controller.5dac1f3c.js} +4 -4
- package/dist/chunks/{use-bento-toast-controller.BifdE4ak.js.map → use-bento-toast-controller.5dac1f3c.js.map} +1 -1
- package/dist/chunks/{use-cached-selected-values.CVLzxvTi.js → use-cached-selected-values.148bfd7c.js} +237 -217
- package/dist/chunks/use-cached-selected-values.148bfd7c.js.map +1 -0
- package/dist/chunks/{use-click-outside.DbjR7Lh4.js → use-click-outside.941d1600.js} +2 -2
- package/dist/chunks/{use-click-outside.DbjR7Lh4.js.map → use-click-outside.941d1600.js.map} +1 -1
- package/dist/chunks/{use-country-items.C25TI6tp.js → use-country-items.6b7985bf.js} +4 -4
- package/dist/chunks/{use-country-items.C25TI6tp.js.map → use-country-items.6b7985bf.js.map} +1 -1
- package/dist/chunks/{use-default-slot-validator.BDn0wkYP.js → use-default-slot-validator.b9bff4c6.js} +2 -2
- package/dist/chunks/{use-default-slot-validator.BDn0wkYP.js.map → use-default-slot-validator.b9bff4c6.js.map} +1 -1
- package/dist/chunks/{use-expandable-content-height.GkjjbmPy.js → use-expandable-content-height.62fc84e5.js} +1 -1
- package/dist/chunks/{use-expandable-content-height.GkjjbmPy.js.map → use-expandable-content-height.62fc84e5.js.map} +1 -1
- package/dist/chunks/{use-form-layout-loading.D3lALhtC.js → use-form-layout-loading.d03e5d48.js} +2 -2
- package/dist/chunks/{use-form-layout-loading.D3lALhtC.js.map → use-form-layout-loading.d03e5d48.js.map} +1 -1
- package/dist/chunks/use-has-slot.fbeb19ec.js +6 -0
- package/dist/chunks/{use-has-slot.C9lQZ6nz.js.map → use-has-slot.fbeb19ec.js.map} +1 -1
- package/dist/chunks/{warning-filled.CLKRzGMT.js → warning-filled.1ced4163.js} +12 -10
- package/dist/chunks/{warning-filled.CLKRzGMT.js.map → warning-filled.1ced4163.js.map} +1 -1
- package/dist/chunks/wrong-environment.c73b0bc0.js +5 -0
- package/dist/chunks/wrong-environment.c73b0bc0.js.map +1 -0
- package/dist/chunks/wrong-environment.f890a237.js +5 -0
- package/dist/chunks/wrong-environment.f890a237.js.map +1 -0
- package/dist/click-outside.js +20 -2
- package/dist/click-outside.js.map +1 -1
- package/dist/code-snippet.js +2034 -5
- package/dist/code-snippet.js.map +1 -1
- package/dist/country.js +97 -8
- package/dist/country.js.map +1 -1
- package/dist/currency.js +112 -3
- package/dist/currency.js.map +1 -1
- package/dist/dashboard-template.js +106 -3
- package/dist/dashboard-template.js.map +1 -1
- package/dist/dashed-underline.js +58 -2
- package/dist/dashed-underline.js.map +1 -1
- package/dist/data-grid-template.js +65 -2
- package/dist/data-grid-template.js.map +1 -1
- package/dist/data-grid.js +2057 -8
- package/dist/data-grid.js.map +1 -1
- package/dist/date-picker.js +197 -5
- package/dist/date-picker.js.map +1 -1
- package/dist/date-range-picker.js +2 -2
- package/dist/date.js +1 -1
- package/dist/divider.js +1 -1
- package/dist/dropdown.js +228 -12
- package/dist/dropdown.js.map +1 -1
- package/dist/empty-state.js +143 -5
- package/dist/empty-state.js.map +1 -1
- package/dist/filter-bar.js +2164 -5
- package/dist/filter-bar.js.map +1 -1
- package/dist/focus-trap.js +1 -1
- package/dist/form-layout.js +192 -5
- package/dist/form-layout.js.map +1 -1
- package/dist/header.js +246 -2
- package/dist/header.js.map +1 -1
- package/dist/image.js +81 -4
- package/dist/image.js.map +1 -1
- package/dist/index.js +279 -274
- package/dist/index.js.map +1 -1
- package/dist/info-icon.js +40 -2
- package/dist/info-icon.js.map +1 -1
- package/dist/input-field.js +224 -7
- package/dist/input-field.js.map +1 -1
- package/dist/inspector.js +64 -0
- package/dist/inspector.js.map +1 -0
- package/dist/internal.js +29 -30
- package/dist/link.js +1 -1
- package/dist/loading-indicator.js +47 -3
- package/dist/loading-indicator.js.map +1 -1
- package/dist/menu.js +1 -1
- package/dist/modal-fullscreen.js +197 -3
- package/dist/modal-fullscreen.js.map +1 -1
- package/dist/modal.js +451 -11
- package/dist/modal.js.map +1 -1
- package/dist/pagination.js +507 -2
- package/dist/pagination.js.map +1 -1
- package/dist/payment-method.js +4 -4
- package/dist/payment-method.js.map +1 -1
- package/dist/popover.js +1 -1
- package/dist/popper-container.js +1 -1
- package/dist/radio-group.js +213 -6
- package/dist/radio-group.js.map +1 -1
- package/dist/search-bar.js +101 -6
- package/dist/search-bar.js.map +1 -1
- package/dist/secondary-nav.js +115 -2
- package/dist/secondary-nav.js.map +1 -1
- package/dist/segmented-control.js +4 -4
- package/dist/segmented-control.js.map +1 -1
- package/dist/selection-card.js +248 -4
- package/dist/selection-card.js.map +1 -1
- package/dist/sidepanel.js +189 -4
- package/dist/sidepanel.js.map +1 -1
- package/dist/status.js +35 -3
- package/dist/status.js.map +1 -1
- package/dist/stepper.js +237 -5
- package/dist/stepper.js.map +1 -1
- package/dist/structured-list.js +1 -1
- package/dist/summary-grid.js +584 -9
- package/dist/summary-grid.js.map +1 -1
- package/dist/tabs.js +141 -3
- package/dist/tabs.js.map +1 -1
- package/dist/tag.js +63 -3
- package/dist/tag.js.map +1 -1
- package/dist/textarea.js +190 -2
- package/dist/textarea.js.map +1 -1
- package/dist/timeline.js +369 -7
- package/dist/timeline.js.map +1 -1
- package/dist/toast.js +168 -2
- package/dist/toast.js.map +1 -1
- package/dist/toggle.js +120 -4
- package/dist/toggle.js.map +1 -1
- package/dist/tutorial.js +340 -2
- package/dist/tutorial.js.map +1 -1
- package/dist/typography.js +1 -1
- package/dist/web-types.json +142 -9
- package/package.json +3 -3
- package/dist/assets/avatar-image.css +0 -1
- package/dist/assets/code-snippet.css +0 -1
- package/dist/assets/filter-bar.css +0 -1
- package/dist/assets/input-field.css +0 -1
- package/dist/assets/radio-group.css +0 -1
- package/dist/assets/search-bar.css +0 -1
- package/dist/assets/selection-card-group.css +0 -1
- package/dist/assets/structured-list-item.css +0 -1
- package/dist/assets/textarea.css +0 -1
- package/dist/assets/timeline-item.css +0 -1
- package/dist/assets/toggle.css +0 -1
- package/dist/assets/tutorial.css +0 -1
- package/dist/avatar-image.js +0 -7
- package/dist/avatar-image.js.map +0 -1
- package/dist/chunks/1-generic-use.CZhwP2Yc.js +0 -5
- package/dist/chunks/1-generic-use.CZhwP2Yc.js.map +0 -1
- package/dist/chunks/1-generic-use.R6x8PEGA.js +0 -5
- package/dist/chunks/1-generic-use.R6x8PEGA.js.map +0 -1
- package/dist/chunks/2-generic-use.CNKjB4B7.js +0 -5
- package/dist/chunks/2-generic-use.CNKjB4B7.js.map +0 -1
- package/dist/chunks/2-generic-use.w0fUhovx.js +0 -5
- package/dist/chunks/2-generic-use.w0fUhovx.js.map +0 -1
- package/dist/chunks/3-generic-use.BLEzR04g.js +0 -5
- package/dist/chunks/3-generic-use.BLEzR04g.js.map +0 -1
- package/dist/chunks/3-generic-use.D3NFHgI4.js +0 -5
- package/dist/chunks/3-generic-use.D3NFHgI4.js.map +0 -1
- package/dist/chunks/4-generic-use.CULEpvgj.js +0 -5
- package/dist/chunks/4-generic-use.CULEpvgj.js.map +0 -1
- package/dist/chunks/4-generic-use.D82y3n39.js +0 -5
- package/dist/chunks/4-generic-use.D82y3n39.js.map +0 -1
- package/dist/chunks/_plugin-vue2_normalizer.CeySl7Fu.js +0 -11
- package/dist/chunks/_plugin-vue2_normalizer.CeySl7Fu.js.map +0 -1
- package/dist/chunks/accordion-item.DmnrjNzw.js +0 -100
- package/dist/chunks/accordion-item.DmnrjNzw.js.map +0 -1
- package/dist/chunks/action-bar.Bebh6PHI.js +0 -147
- package/dist/chunks/action-bar.Bebh6PHI.js.map +0 -1
- package/dist/chunks/adding-payment-methods.BJZLPxtM.js +0 -5
- package/dist/chunks/adding-payment-methods.BJZLPxtM.js.map +0 -1
- package/dist/chunks/adding-payment-methods.Dle8zt43.js +0 -5
- package/dist/chunks/adding-payment-methods.Dle8zt43.js.map +0 -1
- package/dist/chunks/adyen-giving.Ffw_DlJK.js +0 -5
- package/dist/chunks/adyen-giving.Ffw_DlJK.js.map +0 -1
- package/dist/chunks/adyen-giving.LiKHj_jY.js +0 -5
- package/dist/chunks/adyen-giving.LiKHj_jY.js.map +0 -1
- package/dist/chunks/alert.CJyTM4Az.js +0 -96
- package/dist/chunks/alert.CJyTM4Az.js.map +0 -1
- package/dist/chunks/avatar-image.DhlR-7Yg.js +0 -47
- package/dist/chunks/avatar-image.DhlR-7Yg.js.map +0 -1
- package/dist/chunks/base-button.DER7_IsF.js +0 -86
- package/dist/chunks/card.70Xvba2C.js +0 -115
- package/dist/chunks/card.70Xvba2C.js.map +0 -1
- package/dist/chunks/checkbox-group.B-KdeRXC.js +0 -152
- package/dist/chunks/checkbox-group.B-KdeRXC.js.map +0 -1
- package/dist/chunks/checkmark-circle-fill.DVl6QSwm.js +0 -24
- package/dist/chunks/click-outside.DABh6NLr.js +0 -23
- package/dist/chunks/click-outside.DABh6NLr.js.map +0 -1
- package/dist/chunks/code-snippet.C4IbjAhH.js +0 -968
- package/dist/chunks/code-snippet.C4IbjAhH.js.map +0 -1
- package/dist/chunks/country.KayLT0zy.js +0 -93
- package/dist/chunks/country.KayLT0zy.js.map +0 -1
- package/dist/chunks/currency.H7n7RQiX.js +0 -113
- package/dist/chunks/currency.H7n7RQiX.js.map +0 -1
- package/dist/chunks/dashboard-section.BcH-_en7.js +0 -105
- package/dist/chunks/dashboard-section.BcH-_en7.js.map +0 -1
- package/dist/chunks/dashed-underline.ChUlcFJR.js +0 -59
- package/dist/chunks/dashed-underline.ChUlcFJR.js.map +0 -1
- package/dist/chunks/data-grid-template.DqG5bNeD.js +0 -66
- package/dist/chunks/data-grid-template.DqG5bNeD.js.map +0 -1
- package/dist/chunks/data-grid.CvHAdmvs.js +0 -2022
- package/dist/chunks/data-grid.CvHAdmvs.js.map +0 -1
- package/dist/chunks/date-picker.ByP2Wpo0.js +0 -196
- package/dist/chunks/date-picker.ByP2Wpo0.js.map +0 -1
- package/dist/chunks/date-range-picker.DrnklTJ-.js.map +0 -1
- package/dist/chunks/date.DKjxxR6P.js.map +0 -1
- package/dist/chunks/divider.BZfeYmB9.js +0 -30
- package/dist/chunks/divider.BZfeYmB9.js.map +0 -1
- package/dist/chunks/dropdown-default-textbox.CKOkl_Qa.js.map +0 -1
- package/dist/chunks/dropdown-tag.DCMKQy-E.js +0 -214
- package/dist/chunks/dropdown-tag.DCMKQy-E.js.map +0 -1
- package/dist/chunks/dropdown.yhhQCKve.js.map +0 -1
- package/dist/chunks/empty-state.BqVOj4v1.js +0 -151
- package/dist/chunks/empty-state.BqVOj4v1.js.map +0 -1
- package/dist/chunks/error-message.BSxUoE3_.js +0 -107
- package/dist/chunks/events.CMzGybJJ.js +0 -47
- package/dist/chunks/filter-bar.AhsOPMZ1.js +0 -2119
- package/dist/chunks/filter-bar.AhsOPMZ1.js.map +0 -1
- package/dist/chunks/focus-trap.DSkLNO_i.js.map +0 -1
- package/dist/chunks/form-layout-title.BzNU0B72.js +0 -187
- package/dist/chunks/form-layout-title.BzNU0B72.js.map +0 -1
- package/dist/chunks/header.DmKHCmXh.js +0 -245
- package/dist/chunks/header.DmKHCmXh.js.map +0 -1
- package/dist/chunks/image.B3uqhFjl.js +0 -82
- package/dist/chunks/image.B3uqhFjl.js.map +0 -1
- package/dist/chunks/index.OCPp3NST.js +0 -126
- package/dist/chunks/info-icon.CLguYHRt.js +0 -41
- package/dist/chunks/info-icon.CLguYHRt.js.map +0 -1
- package/dist/chunks/input-field.BnlEPPYr.js +0 -218
- package/dist/chunks/input-field.BnlEPPYr.js.map +0 -1
- package/dist/chunks/internal-error.BLZodVBE.js +0 -5
- package/dist/chunks/internal-error.BLZodVBE.js.map +0 -1
- package/dist/chunks/internal-error.BmrwJFpR.js +0 -5
- package/dist/chunks/internal-error.BmrwJFpR.js.map +0 -1
- package/dist/chunks/link.DJ1A53gF.js.map +0 -1
- package/dist/chunks/listbox-option-tag.BDjsYOE1.js +0 -75
- package/dist/chunks/listbox-option-tag.BDjsYOE1.js.map +0 -1
- package/dist/chunks/loading-button.CoF1IhEU.js +0 -97
- package/dist/chunks/loading-button.CoF1IhEU.js.map +0 -1
- package/dist/chunks/loading-indicator.DXc7I1Lm.js +0 -48
- package/dist/chunks/loading-indicator.DXc7I1Lm.js.map +0 -1
- package/dist/chunks/menu.2TwUMlA9.js.map +0 -1
- package/dist/chunks/modal-fullscreen.BB_8EMNo.js +0 -196
- package/dist/chunks/modal-fullscreen.BB_8EMNo.js.map +0 -1
- package/dist/chunks/modal.DLwvcaRx.js +0 -439
- package/dist/chunks/modal.DLwvcaRx.js.map +0 -1
- package/dist/chunks/no-results-found.Bg_ZcEid.js +0 -5
- package/dist/chunks/no-results-found.Bg_ZcEid.js.map +0 -1
- package/dist/chunks/no-results-found.BqvYsBR6.js +0 -5
- package/dist/chunks/no-results-found.BqvYsBR6.js.map +0 -1
- package/dist/chunks/notifications-cleared.BMZk37uf.js +0 -5
- package/dist/chunks/notifications-cleared.BMZk37uf.js.map +0 -1
- package/dist/chunks/notifications-cleared.C7W9ZXY7.js +0 -5
- package/dist/chunks/notifications-cleared.C7W9ZXY7.js.map +0 -1
- package/dist/chunks/page-not-found.COJLPVaU.js +0 -5
- package/dist/chunks/page-not-found.COJLPVaU.js.map +0 -1
- package/dist/chunks/page-not-found.DWW6W-PZ.js +0 -5
- package/dist/chunks/page-not-found.DWW6W-PZ.js.map +0 -1
- package/dist/chunks/pagination.BXjbVe4Z.js +0 -494
- package/dist/chunks/pagination.BXjbVe4Z.js.map +0 -1
- package/dist/chunks/payment-method.types.CJKfZQN5.js +0 -5
- package/dist/chunks/payment-method.types.CJKfZQN5.js.map +0 -1
- package/dist/chunks/planned-maintenance.C61sWB9h.js +0 -5
- package/dist/chunks/planned-maintenance.C61sWB9h.js.map +0 -1
- package/dist/chunks/planned-maintenance.jmWYTdet.js +0 -5
- package/dist/chunks/planned-maintenance.jmWYTdet.js.map +0 -1
- package/dist/chunks/popover.B8YH92W8.js.map +0 -1
- package/dist/chunks/popper-container.Bt02N3o1.js.map +0 -1
- package/dist/chunks/radio-group.CPbBFTzB.js +0 -211
- package/dist/chunks/radio-group.CPbBFTzB.js.map +0 -1
- package/dist/chunks/referrals.BvtT-kQS.js +0 -5
- package/dist/chunks/referrals.BvtT-kQS.js.map +0 -1
- package/dist/chunks/referrals.aX8WZigH.js +0 -5
- package/dist/chunks/referrals.aX8WZigH.js.map +0 -1
- package/dist/chunks/search-bar.CsAgO-t5.js +0 -89
- package/dist/chunks/search-bar.CsAgO-t5.js.map +0 -1
- package/dist/chunks/secondary-nav.CNgpPxUU.js +0 -97
- package/dist/chunks/secondary-nav.CNgpPxUU.js.map +0 -1
- package/dist/chunks/segmented-control.types.BHRLV8KU.js +0 -5
- package/dist/chunks/segmented-control.types.BHRLV8KU.js.map +0 -1
- package/dist/chunks/selection-card-group.DlOs8BkR.js +0 -247
- package/dist/chunks/selection-card-group.DlOs8BkR.js.map +0 -1
- package/dist/chunks/sidepanel.BBjm2QvZ.js +0 -187
- package/dist/chunks/sidepanel.BBjm2QvZ.js.map +0 -1
- package/dist/chunks/status.types.BhbOYpZx.js +0 -36
- package/dist/chunks/status.types.BhbOYpZx.js.map +0 -1
- package/dist/chunks/step.DY8Txb6a.js +0 -234
- package/dist/chunks/step.DY8Txb6a.js.map +0 -1
- package/dist/chunks/structured-list-item.C9NTVDvT.js.map +0 -1
- package/dist/chunks/success.DhioLvPD.js +0 -5
- package/dist/chunks/success.DhioLvPD.js.map +0 -1
- package/dist/chunks/success.nNwxJRBS.js +0 -5
- package/dist/chunks/success.nNwxJRBS.js.map +0 -1
- package/dist/chunks/summary-grid-item-custom.CJpDnoPw.js +0 -573
- package/dist/chunks/summary-grid-item-custom.CJpDnoPw.js.map +0 -1
- package/dist/chunks/tabs.CE65f3E_.js +0 -140
- package/dist/chunks/tabs.CE65f3E_.js.map +0 -1
- package/dist/chunks/tag.bhKrZHTU.js +0 -64
- package/dist/chunks/tag.bhKrZHTU.js.map +0 -1
- package/dist/chunks/textarea.CcKbtQBs.js +0 -208
- package/dist/chunks/textarea.CcKbtQBs.js.map +0 -1
- package/dist/chunks/timeline-item.ScTrUBKC.js +0 -364
- package/dist/chunks/timeline-item.ScTrUBKC.js.map +0 -1
- package/dist/chunks/toast.0EYDj8o-.js +0 -165
- package/dist/chunks/toast.0EYDj8o-.js.map +0 -1
- package/dist/chunks/toggle-button.2U-vbQhk.js +0 -83
- package/dist/chunks/toggle-button.2U-vbQhk.js.map +0 -1
- package/dist/chunks/toggle.CiOVTWlk.js +0 -121
- package/dist/chunks/toggle.CiOVTWlk.js.map +0 -1
- package/dist/chunks/tutorial.DMm12L0S.js +0 -335
- package/dist/chunks/tutorial.DMm12L0S.js.map +0 -1
- package/dist/chunks/typography.Bjtu3Gca.js.map +0 -1
- package/dist/chunks/upload-files.5wQwbfkp.js +0 -5
- package/dist/chunks/upload-files.5wQwbfkp.js.map +0 -1
- package/dist/chunks/upload-files.jTQY6y2X.js +0 -5
- package/dist/chunks/upload-files.jTQY6y2X.js.map +0 -1
- package/dist/chunks/use-cached-selected-values.CVLzxvTi.js.map +0 -1
- package/dist/chunks/use-has-slot.C9lQZ6nz.js +0 -6
- package/dist/chunks/wrong-environment.BOsyKdRI.js +0 -5
- package/dist/chunks/wrong-environment.BOsyKdRI.js.map +0 -1
- package/dist/chunks/wrong-environment.BiHTPtbJ.js +0 -5
- package/dist/chunks/wrong-environment.BiHTPtbJ.js.map +0 -1
- /package/dist/assets/{badge.css → index.css} +0 -0
- /package/dist/assets/{tabs.css → index10.css} +0 -0
- /package/dist/assets/{date-picker.css → index12.css} +0 -0
- /package/dist/assets/{empty-state.css → index13.css} +0 -0
- /package/dist/assets/{focus-trap.css → index15.css} +0 -0
- /package/dist/assets/{form-layout-title.css → index16.css} +0 -0
- /package/dist/assets/{info-icon.css → index17.css} +0 -0
- /package/dist/assets/{dashed-underline.css → index2.css} +0 -0
- /package/dist/assets/{date-range-picker.css → index20.css} +0 -0
- /package/dist/assets/{status.css → index25.css} +0 -0
- /package/dist/assets/{step.css → index26.css} +0 -0
- /package/dist/assets/{link.css → index27.css} +0 -0
- /package/dist/assets/{alert.css → index29.css} +0 -0
- /package/dist/assets/{header.css → index31.css} +0 -0
- /package/dist/assets/{loading-indicator.css → index32.css} +0 -0
- /package/dist/assets/{dropdown-tag.css → index34.css} +0 -0
- /package/dist/assets/{popper-container.css → index35.css} +0 -0
- /package/dist/assets/{summary-grid-item-custom.css → index37.css} +0 -0
- /package/dist/assets/{toggle-button.css → index4.css} +0 -0
- /package/dist/assets/{tag.css → index41.css} +0 -0
- /package/dist/assets/{toast.css → index44.css} +0 -0
- /package/dist/assets/{typography.css → index46.css} +0 -0
- /package/dist/assets/{data-grid-template.css → index49.css} +0 -0
- /package/dist/assets/{pagination.css → index50.css} +0 -0
- /package/dist/assets/{checkbox-group.css → index6.css} +0 -0
- /package/dist/assets/{country.css → index8.css} +0 -0
- /package/dist/assets/{divider.css → index9.css} +0 -0
- /package/dist/assets/{cross.css → refresh.css} +0 -0
package/dist/code-snippet.js
CHANGED
|
@@ -1,8 +1,2037 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { defineComponent as He, ref as ae, computed as re, shallowRef as Se, onMounted as Re, watch as De, watchEffect as Je } from "vue";
|
|
2
|
+
import { highlightActiveLine as Ue, keymap as Ve, EditorView as Ie, lineNumbers as We } from "@codemirror/view";
|
|
3
|
+
import { EditorSelection as Ge, Compartment as be, EditorState as Be } from "@codemirror/state";
|
|
4
|
+
import { indentWithTab as $e, history as Ke } from "@codemirror/commands";
|
|
5
|
+
import { syntaxHighlighting as Fe, HighlightStyle as qe } from "@codemirror/language";
|
|
6
|
+
import { B as Xe, a as Ye, b as Qe, c as Ze } from "./chunks/es6.cf6b43e9.js";
|
|
7
|
+
import { B as et } from "./chunks/dropdown.9bee6e1d.js";
|
|
8
|
+
import { a as tt } from "./chunks/button.9184ade9.js";
|
|
9
|
+
import { B as nt } from "./chunks/index.e29a6907.js";
|
|
10
|
+
import { BentoLoadingIndicator as rt } from "./loading-indicator.js";
|
|
11
|
+
import { u as it } from "./chunks/i18n.eb5b985b.js";
|
|
12
|
+
import { E as st } from "./chunks/expand.d0ccfcfe.js";
|
|
13
|
+
import { h as lt } from "./chunks/base-modal.00322d31.js";
|
|
14
|
+
import { C as ot } from "./chunks/copy.d5dd2b60.js";
|
|
15
|
+
import { json as at } from "@codemirror/lang-json";
|
|
16
|
+
import { xml as ut } from "@codemirror/lang-xml";
|
|
17
|
+
import { javascript as ft } from "@codemirror/lang-javascript";
|
|
18
|
+
import { java as ht } from "@codemirror/lang-java";
|
|
19
|
+
import { python as ct } from "@codemirror/lang-python";
|
|
20
|
+
import { b as dt } from "./chunks/tooltip.77610390.js";
|
|
21
|
+
import { n as pt } from "./chunks/_plugin-vue2_normalizer.71e2aa87.js";
|
|
22
|
+
import "./assets/index7.css";
|
|
23
|
+
const gt = 1024;
|
|
24
|
+
let mt = 0;
|
|
25
|
+
class _ {
|
|
26
|
+
/**
|
|
27
|
+
Create a new node prop type.
|
|
28
|
+
*/
|
|
29
|
+
constructor(e = {}) {
|
|
30
|
+
this.id = mt++, this.perNode = !!e.perNode, this.deserialize = e.deserialize || (() => {
|
|
31
|
+
throw new Error("This node type doesn't define a deserialize function");
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
This is meant to be used with
|
|
36
|
+
[`NodeSet.extend`](#common.NodeSet.extend) or
|
|
37
|
+
[`LRParser.configure`](#lr.ParserConfig.props) to compute
|
|
38
|
+
prop values for each node type in the set. Takes a [match
|
|
39
|
+
object](#common.NodeType^match) or function that returns undefined
|
|
40
|
+
if the node type doesn't get this prop, and the prop's value if
|
|
41
|
+
it does.
|
|
42
|
+
*/
|
|
43
|
+
add(e) {
|
|
44
|
+
if (this.perNode)
|
|
45
|
+
throw new RangeError("Can't add per-node props to node types");
|
|
46
|
+
return typeof e != "function" && (e = G.match(e)), (t) => {
|
|
47
|
+
let n = e(t);
|
|
48
|
+
return n === void 0 ? null : [this, n];
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
_.closedBy = new _({ deserialize: (i) => i.split(" ") });
|
|
53
|
+
_.openedBy = new _({ deserialize: (i) => i.split(" ") });
|
|
54
|
+
_.group = new _({ deserialize: (i) => i.split(" ") });
|
|
55
|
+
_.isolate = new _({ deserialize: (i) => {
|
|
56
|
+
if (i && i != "rtl" && i != "ltr" && i != "auto")
|
|
57
|
+
throw new RangeError("Invalid value for isolate: " + i);
|
|
58
|
+
return i || "auto";
|
|
59
|
+
} });
|
|
60
|
+
_.contextHash = new _({ perNode: !0 });
|
|
61
|
+
_.lookAhead = new _({ perNode: !0 });
|
|
62
|
+
_.mounted = new _({ perNode: !0 });
|
|
63
|
+
class ge {
|
|
64
|
+
constructor(e, t, n) {
|
|
65
|
+
this.tree = e, this.overlay = t, this.parser = n;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
@internal
|
|
69
|
+
*/
|
|
70
|
+
static get(e) {
|
|
71
|
+
return e && e.props && e.props[_.mounted.id];
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
const bt = /* @__PURE__ */ Object.create(null);
|
|
75
|
+
class G {
|
|
76
|
+
/**
|
|
77
|
+
@internal
|
|
78
|
+
*/
|
|
79
|
+
constructor(e, t, n, r = 0) {
|
|
80
|
+
this.name = e, this.props = t, this.id = n, this.flags = r;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
Define a node type.
|
|
84
|
+
*/
|
|
85
|
+
static define(e) {
|
|
86
|
+
let t = e.props && e.props.length ? /* @__PURE__ */ Object.create(null) : bt, n = (e.top ? 1 : 0) | (e.skipped ? 2 : 0) | (e.error ? 4 : 0) | (e.name == null ? 8 : 0), r = new G(e.name || "", t, e.id, n);
|
|
87
|
+
if (e.props) {
|
|
88
|
+
for (let s of e.props)
|
|
89
|
+
if (Array.isArray(s) || (s = s(r)), s) {
|
|
90
|
+
if (s[0].perNode)
|
|
91
|
+
throw new RangeError("Can't store a per-node prop on a node type");
|
|
92
|
+
t[s[0].id] = s[1];
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
return r;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
Retrieves a node prop for this type. Will return `undefined` if
|
|
99
|
+
the prop isn't present on this node.
|
|
100
|
+
*/
|
|
101
|
+
prop(e) {
|
|
102
|
+
return this.props[e.id];
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
True when this is the top node of a grammar.
|
|
106
|
+
*/
|
|
107
|
+
get isTop() {
|
|
108
|
+
return (this.flags & 1) > 0;
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
True when this node is produced by a skip rule.
|
|
112
|
+
*/
|
|
113
|
+
get isSkipped() {
|
|
114
|
+
return (this.flags & 2) > 0;
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
Indicates whether this is an error node.
|
|
118
|
+
*/
|
|
119
|
+
get isError() {
|
|
120
|
+
return (this.flags & 4) > 0;
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
When true, this node type doesn't correspond to a user-declared
|
|
124
|
+
named node, for example because it is used to cache repetition.
|
|
125
|
+
*/
|
|
126
|
+
get isAnonymous() {
|
|
127
|
+
return (this.flags & 8) > 0;
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
Returns true when this node's name or one of its
|
|
131
|
+
[groups](#common.NodeProp^group) matches the given string.
|
|
132
|
+
*/
|
|
133
|
+
is(e) {
|
|
134
|
+
if (typeof e == "string") {
|
|
135
|
+
if (this.name == e)
|
|
136
|
+
return !0;
|
|
137
|
+
let t = this.prop(_.group);
|
|
138
|
+
return t ? t.indexOf(e) > -1 : !1;
|
|
139
|
+
}
|
|
140
|
+
return this.id == e;
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
Create a function from node types to arbitrary values by
|
|
144
|
+
specifying an object whose property names are node or
|
|
145
|
+
[group](#common.NodeProp^group) names. Often useful with
|
|
146
|
+
[`NodeProp.add`](#common.NodeProp.add). You can put multiple
|
|
147
|
+
names, separated by spaces, in a single property name to map
|
|
148
|
+
multiple node names to a single value.
|
|
149
|
+
*/
|
|
150
|
+
static match(e) {
|
|
151
|
+
let t = /* @__PURE__ */ Object.create(null);
|
|
152
|
+
for (let n in e)
|
|
153
|
+
for (let r of n.split(" "))
|
|
154
|
+
t[r] = e[n];
|
|
155
|
+
return (n) => {
|
|
156
|
+
for (let r = n.prop(_.group), s = -1; s < (r ? r.length : 0); s++) {
|
|
157
|
+
let l = t[s < 0 ? n.name : r[s]];
|
|
158
|
+
if (l)
|
|
159
|
+
return l;
|
|
160
|
+
}
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
G.none = new G(
|
|
165
|
+
"",
|
|
166
|
+
/* @__PURE__ */ Object.create(null),
|
|
167
|
+
0,
|
|
168
|
+
8
|
|
169
|
+
/* NodeFlag.Anonymous */
|
|
170
|
+
);
|
|
171
|
+
const ue = /* @__PURE__ */ new WeakMap(), Le = /* @__PURE__ */ new WeakMap();
|
|
172
|
+
var A;
|
|
173
|
+
(function(i) {
|
|
174
|
+
i[i.ExcludeBuffers = 1] = "ExcludeBuffers", i[i.IncludeAnonymous = 2] = "IncludeAnonymous", i[i.IgnoreMounts = 4] = "IgnoreMounts", i[i.IgnoreOverlays = 8] = "IgnoreOverlays";
|
|
175
|
+
})(A || (A = {}));
|
|
176
|
+
class D {
|
|
177
|
+
/**
|
|
178
|
+
Construct a new tree. See also [`Tree.build`](#common.Tree^build).
|
|
179
|
+
*/
|
|
180
|
+
constructor(e, t, n, r, s) {
|
|
181
|
+
if (this.type = e, this.children = t, this.positions = n, this.length = r, this.props = null, s && s.length) {
|
|
182
|
+
this.props = /* @__PURE__ */ Object.create(null);
|
|
183
|
+
for (let [l, u] of s)
|
|
184
|
+
this.props[typeof l == "number" ? l : l.id] = u;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
@internal
|
|
189
|
+
*/
|
|
190
|
+
toString() {
|
|
191
|
+
let e = ge.get(this);
|
|
192
|
+
if (e && !e.overlay)
|
|
193
|
+
return e.tree.toString();
|
|
194
|
+
let t = "";
|
|
195
|
+
for (let n of this.children) {
|
|
196
|
+
let r = n.toString();
|
|
197
|
+
r && (t && (t += ","), t += r);
|
|
198
|
+
}
|
|
199
|
+
return this.type.name ? (/\W/.test(this.type.name) && !this.type.isError ? JSON.stringify(this.type.name) : this.type.name) + (t.length ? "(" + t + ")" : "") : t;
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
Get a [tree cursor](#common.TreeCursor) positioned at the top of
|
|
203
|
+
the tree. Mode can be used to [control](#common.IterMode) which
|
|
204
|
+
nodes the cursor visits.
|
|
205
|
+
*/
|
|
206
|
+
cursor(e = 0) {
|
|
207
|
+
return new ke(this.topNode, e);
|
|
208
|
+
}
|
|
209
|
+
/**
|
|
210
|
+
Get a [tree cursor](#common.TreeCursor) pointing into this tree
|
|
211
|
+
at the given position and side (see
|
|
212
|
+
[`moveTo`](#common.TreeCursor.moveTo).
|
|
213
|
+
*/
|
|
214
|
+
cursorAt(e, t = 0, n = 0) {
|
|
215
|
+
let r = ue.get(this) || this.topNode, s = new ke(r);
|
|
216
|
+
return s.moveTo(e, t), ue.set(this, s._tree), s;
|
|
217
|
+
}
|
|
218
|
+
/**
|
|
219
|
+
Get a [syntax node](#common.SyntaxNode) object for the top of the
|
|
220
|
+
tree.
|
|
221
|
+
*/
|
|
222
|
+
get topNode() {
|
|
223
|
+
return new E(this, 0, 0, null);
|
|
224
|
+
}
|
|
225
|
+
/**
|
|
226
|
+
Get the [syntax node](#common.SyntaxNode) at the given position.
|
|
227
|
+
If `side` is -1, this will move into nodes that end at the
|
|
228
|
+
position. If 1, it'll move into nodes that start at the
|
|
229
|
+
position. With 0, it'll only enter nodes that cover the position
|
|
230
|
+
from both sides.
|
|
231
|
+
|
|
232
|
+
Note that this will not enter
|
|
233
|
+
[overlays](#common.MountedTree.overlay), and you often want
|
|
234
|
+
[`resolveInner`](#common.Tree.resolveInner) instead.
|
|
235
|
+
*/
|
|
236
|
+
resolve(e, t = 0) {
|
|
237
|
+
let n = le(ue.get(this) || this.topNode, e, t, !1);
|
|
238
|
+
return ue.set(this, n), n;
|
|
239
|
+
}
|
|
240
|
+
/**
|
|
241
|
+
Like [`resolve`](#common.Tree.resolve), but will enter
|
|
242
|
+
[overlaid](#common.MountedTree.overlay) nodes, producing a syntax node
|
|
243
|
+
pointing into the innermost overlaid tree at the given position
|
|
244
|
+
(with parent links going through all parent structure, including
|
|
245
|
+
the host trees).
|
|
246
|
+
*/
|
|
247
|
+
resolveInner(e, t = 0) {
|
|
248
|
+
let n = le(Le.get(this) || this.topNode, e, t, !0);
|
|
249
|
+
return Le.set(this, n), n;
|
|
250
|
+
}
|
|
251
|
+
/**
|
|
252
|
+
In some situations, it can be useful to iterate through all
|
|
253
|
+
nodes around a position, including those in overlays that don't
|
|
254
|
+
directly cover the position. This method gives you an iterator
|
|
255
|
+
that will produce all nodes, from small to big, around the given
|
|
256
|
+
position.
|
|
257
|
+
*/
|
|
258
|
+
resolveStack(e, t = 0) {
|
|
259
|
+
return kt(this, e, t);
|
|
260
|
+
}
|
|
261
|
+
/**
|
|
262
|
+
Iterate over the tree and its children, calling `enter` for any
|
|
263
|
+
node that touches the `from`/`to` region (if given) before
|
|
264
|
+
running over such a node's children, and `leave` (if given) when
|
|
265
|
+
leaving the node. When `enter` returns `false`, that node will
|
|
266
|
+
not have its children iterated over (or `leave` called).
|
|
267
|
+
*/
|
|
268
|
+
iterate(e) {
|
|
269
|
+
let { enter: t, leave: n, from: r = 0, to: s = this.length } = e, l = e.mode || 0, u = (l & A.IncludeAnonymous) > 0;
|
|
270
|
+
for (let h = this.cursor(l | A.IncludeAnonymous); ; ) {
|
|
271
|
+
let v = !1;
|
|
272
|
+
if (h.from <= s && h.to >= r && (!u && h.type.isAnonymous || t(h) !== !1)) {
|
|
273
|
+
if (h.firstChild())
|
|
274
|
+
continue;
|
|
275
|
+
v = !0;
|
|
276
|
+
}
|
|
277
|
+
for (; v && n && (u || !h.type.isAnonymous) && n(h), !h.nextSibling(); ) {
|
|
278
|
+
if (!h.parent())
|
|
279
|
+
return;
|
|
280
|
+
v = !0;
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
/**
|
|
285
|
+
Get the value of the given [node prop](#common.NodeProp) for this
|
|
286
|
+
node. Works with both per-node and per-type props.
|
|
287
|
+
*/
|
|
288
|
+
prop(e) {
|
|
289
|
+
return e.perNode ? this.props ? this.props[e.id] : void 0 : this.type.prop(e);
|
|
290
|
+
}
|
|
291
|
+
/**
|
|
292
|
+
Returns the node's [per-node props](#common.NodeProp.perNode) in a
|
|
293
|
+
format that can be passed to the [`Tree`](#common.Tree)
|
|
294
|
+
constructor.
|
|
295
|
+
*/
|
|
296
|
+
get propValues() {
|
|
297
|
+
let e = [];
|
|
298
|
+
if (this.props)
|
|
299
|
+
for (let t in this.props)
|
|
300
|
+
e.push([+t, this.props[t]]);
|
|
301
|
+
return e;
|
|
302
|
+
}
|
|
303
|
+
/**
|
|
304
|
+
Balance the direct children of this tree, producing a copy of
|
|
305
|
+
which may have children grouped into subtrees with type
|
|
306
|
+
[`NodeType.none`](#common.NodeType^none).
|
|
307
|
+
*/
|
|
308
|
+
balance(e = {}) {
|
|
309
|
+
return this.children.length <= 8 ? this : we(G.none, this.children, this.positions, 0, this.children.length, 0, this.length, (t, n, r) => new D(this.type, t, n, r, this.propValues), e.makeTree || ((t, n, r) => new D(G.none, t, n, r)));
|
|
310
|
+
}
|
|
311
|
+
/**
|
|
312
|
+
Build a tree from a postfix-ordered buffer of node information,
|
|
313
|
+
or a cursor over such a buffer.
|
|
314
|
+
*/
|
|
315
|
+
static build(e) {
|
|
316
|
+
return _t(e);
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
D.empty = new D(G.none, [], [], 0);
|
|
320
|
+
class ve {
|
|
321
|
+
constructor(e, t) {
|
|
322
|
+
this.buffer = e, this.index = t;
|
|
323
|
+
}
|
|
324
|
+
get id() {
|
|
325
|
+
return this.buffer[this.index - 4];
|
|
326
|
+
}
|
|
327
|
+
get start() {
|
|
328
|
+
return this.buffer[this.index - 3];
|
|
329
|
+
}
|
|
330
|
+
get end() {
|
|
331
|
+
return this.buffer[this.index - 2];
|
|
332
|
+
}
|
|
333
|
+
get size() {
|
|
334
|
+
return this.buffer[this.index - 1];
|
|
335
|
+
}
|
|
336
|
+
get pos() {
|
|
337
|
+
return this.index;
|
|
338
|
+
}
|
|
339
|
+
next() {
|
|
340
|
+
this.index -= 4;
|
|
341
|
+
}
|
|
342
|
+
fork() {
|
|
343
|
+
return new ve(this.buffer, this.index);
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
class X {
|
|
347
|
+
/**
|
|
348
|
+
Create a tree buffer.
|
|
349
|
+
*/
|
|
350
|
+
constructor(e, t, n) {
|
|
351
|
+
this.buffer = e, this.length = t, this.set = n;
|
|
352
|
+
}
|
|
353
|
+
/**
|
|
354
|
+
@internal
|
|
355
|
+
*/
|
|
356
|
+
get type() {
|
|
357
|
+
return G.none;
|
|
358
|
+
}
|
|
359
|
+
/**
|
|
360
|
+
@internal
|
|
361
|
+
*/
|
|
362
|
+
toString() {
|
|
363
|
+
let e = [];
|
|
364
|
+
for (let t = 0; t < this.buffer.length; )
|
|
365
|
+
e.push(this.childString(t)), t = this.buffer[t + 3];
|
|
366
|
+
return e.join(",");
|
|
367
|
+
}
|
|
368
|
+
/**
|
|
369
|
+
@internal
|
|
370
|
+
*/
|
|
371
|
+
childString(e) {
|
|
372
|
+
let t = this.buffer[e], n = this.buffer[e + 3], r = this.set.types[t], s = r.name;
|
|
373
|
+
if (/\W/.test(s) && !r.isError && (s = JSON.stringify(s)), e += 4, n == e)
|
|
374
|
+
return s;
|
|
375
|
+
let l = [];
|
|
376
|
+
for (; e < n; )
|
|
377
|
+
l.push(this.childString(e)), e = this.buffer[e + 3];
|
|
378
|
+
return s + "(" + l.join(",") + ")";
|
|
379
|
+
}
|
|
380
|
+
/**
|
|
381
|
+
@internal
|
|
382
|
+
*/
|
|
383
|
+
findChild(e, t, n, r, s) {
|
|
384
|
+
let { buffer: l } = this, u = -1;
|
|
385
|
+
for (let h = e; h != t && !(Te(s, r, l[h + 1], l[h + 2]) && (u = h, n > 0)); h = l[h + 3])
|
|
386
|
+
;
|
|
387
|
+
return u;
|
|
388
|
+
}
|
|
389
|
+
/**
|
|
390
|
+
@internal
|
|
391
|
+
*/
|
|
392
|
+
slice(e, t, n) {
|
|
393
|
+
let r = this.buffer, s = new Uint16Array(t - e), l = 0;
|
|
394
|
+
for (let u = e, h = 0; u < t; ) {
|
|
395
|
+
s[h++] = r[u++], s[h++] = r[u++] - n;
|
|
396
|
+
let v = s[h++] = r[u++] - n;
|
|
397
|
+
s[h++] = r[u++] - e, l = Math.max(l, v);
|
|
398
|
+
}
|
|
399
|
+
return new X(s, l, this.set);
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
function Te(i, e, t, n) {
|
|
403
|
+
switch (i) {
|
|
404
|
+
case -2:
|
|
405
|
+
return t < e;
|
|
406
|
+
case -1:
|
|
407
|
+
return n >= e && t < e;
|
|
408
|
+
case 0:
|
|
409
|
+
return t < e && n > e;
|
|
410
|
+
case 1:
|
|
411
|
+
return t <= e && n > e;
|
|
412
|
+
case 2:
|
|
413
|
+
return n > e;
|
|
414
|
+
case 4:
|
|
415
|
+
return !0;
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
function le(i, e, t, n) {
|
|
419
|
+
for (var r; i.from == i.to || (t < 1 ? i.from >= e : i.from > e) || (t > -1 ? i.to <= e : i.to < e); ) {
|
|
420
|
+
let l = !n && i instanceof E && i.index < 0 ? null : i.parent;
|
|
421
|
+
if (!l)
|
|
422
|
+
return i;
|
|
423
|
+
i = l;
|
|
424
|
+
}
|
|
425
|
+
let s = n ? 0 : A.IgnoreOverlays;
|
|
426
|
+
if (n)
|
|
427
|
+
for (let l = i, u = l.parent; u; l = u, u = l.parent)
|
|
428
|
+
l instanceof E && l.index < 0 && ((r = u.enter(e, t, s)) === null || r === void 0 ? void 0 : r.from) != l.from && (i = u);
|
|
429
|
+
for (; ; ) {
|
|
430
|
+
let l = i.enter(e, t, s);
|
|
431
|
+
if (!l)
|
|
432
|
+
return i;
|
|
433
|
+
i = l;
|
|
434
|
+
}
|
|
435
|
+
}
|
|
436
|
+
class Pe {
|
|
437
|
+
cursor(e = 0) {
|
|
438
|
+
return new ke(this, e);
|
|
439
|
+
}
|
|
440
|
+
getChild(e, t = null, n = null) {
|
|
441
|
+
let r = Ee(this, e, t, n);
|
|
442
|
+
return r.length ? r[0] : null;
|
|
443
|
+
}
|
|
444
|
+
getChildren(e, t = null, n = null) {
|
|
445
|
+
return Ee(this, e, t, n);
|
|
446
|
+
}
|
|
447
|
+
resolve(e, t = 0) {
|
|
448
|
+
return le(this, e, t, !1);
|
|
449
|
+
}
|
|
450
|
+
resolveInner(e, t = 0) {
|
|
451
|
+
return le(this, e, t, !0);
|
|
452
|
+
}
|
|
453
|
+
matchContext(e) {
|
|
454
|
+
return xe(this, e);
|
|
455
|
+
}
|
|
456
|
+
enterUnfinishedNodesBefore(e) {
|
|
457
|
+
let t = this.childBefore(e), n = this;
|
|
458
|
+
for (; t; ) {
|
|
459
|
+
let r = t.lastChild;
|
|
460
|
+
if (!r || r.to != t.to)
|
|
461
|
+
break;
|
|
462
|
+
r.type.isError && r.from == r.to ? (n = t, t = r.prevSibling) : t = r;
|
|
463
|
+
}
|
|
464
|
+
return n;
|
|
465
|
+
}
|
|
466
|
+
get node() {
|
|
467
|
+
return this;
|
|
468
|
+
}
|
|
469
|
+
get next() {
|
|
470
|
+
return this.parent;
|
|
471
|
+
}
|
|
472
|
+
}
|
|
473
|
+
class E extends Pe {
|
|
474
|
+
constructor(e, t, n, r) {
|
|
475
|
+
super(), this._tree = e, this.from = t, this.index = n, this._parent = r;
|
|
476
|
+
}
|
|
477
|
+
get type() {
|
|
478
|
+
return this._tree.type;
|
|
479
|
+
}
|
|
480
|
+
get name() {
|
|
481
|
+
return this._tree.type.name;
|
|
482
|
+
}
|
|
483
|
+
get to() {
|
|
484
|
+
return this.from + this._tree.length;
|
|
485
|
+
}
|
|
486
|
+
nextChild(e, t, n, r, s = 0) {
|
|
487
|
+
for (let l = this; ; ) {
|
|
488
|
+
for (let { children: u, positions: h } = l._tree, v = t > 0 ? u.length : -1; e != v; e += t) {
|
|
489
|
+
let C = u[e], N = h[e] + l.from;
|
|
490
|
+
if (Te(r, n, N, N + C.length)) {
|
|
491
|
+
if (C instanceof X) {
|
|
492
|
+
if (s & A.ExcludeBuffers)
|
|
493
|
+
continue;
|
|
494
|
+
let S = C.findChild(0, C.buffer.length, t, n - N, r);
|
|
495
|
+
if (S > -1)
|
|
496
|
+
return new q(new yt(l, C, e, N), null, S);
|
|
497
|
+
} else if (s & A.IncludeAnonymous || !C.type.isAnonymous || Ce(C)) {
|
|
498
|
+
let S;
|
|
499
|
+
if (!(s & A.IgnoreMounts) && (S = ge.get(C)) && !S.overlay)
|
|
500
|
+
return new E(S.tree, N, e, l);
|
|
501
|
+
let z = new E(C, N, e, l);
|
|
502
|
+
return s & A.IncludeAnonymous || !z.type.isAnonymous ? z : z.nextChild(t < 0 ? C.children.length - 1 : 0, t, n, r);
|
|
503
|
+
}
|
|
504
|
+
}
|
|
505
|
+
}
|
|
506
|
+
if (s & A.IncludeAnonymous || !l.type.isAnonymous || (l.index >= 0 ? e = l.index + t : e = t < 0 ? -1 : l._parent._tree.children.length, l = l._parent, !l))
|
|
507
|
+
return null;
|
|
508
|
+
}
|
|
509
|
+
}
|
|
510
|
+
get firstChild() {
|
|
511
|
+
return this.nextChild(
|
|
512
|
+
0,
|
|
513
|
+
1,
|
|
514
|
+
0,
|
|
515
|
+
4
|
|
516
|
+
/* Side.DontCare */
|
|
517
|
+
);
|
|
518
|
+
}
|
|
519
|
+
get lastChild() {
|
|
520
|
+
return this.nextChild(
|
|
521
|
+
this._tree.children.length - 1,
|
|
522
|
+
-1,
|
|
523
|
+
0,
|
|
524
|
+
4
|
|
525
|
+
/* Side.DontCare */
|
|
526
|
+
);
|
|
527
|
+
}
|
|
528
|
+
childAfter(e) {
|
|
529
|
+
return this.nextChild(
|
|
530
|
+
0,
|
|
531
|
+
1,
|
|
532
|
+
e,
|
|
533
|
+
2
|
|
534
|
+
/* Side.After */
|
|
535
|
+
);
|
|
536
|
+
}
|
|
537
|
+
childBefore(e) {
|
|
538
|
+
return this.nextChild(
|
|
539
|
+
this._tree.children.length - 1,
|
|
540
|
+
-1,
|
|
541
|
+
e,
|
|
542
|
+
-2
|
|
543
|
+
/* Side.Before */
|
|
544
|
+
);
|
|
545
|
+
}
|
|
546
|
+
enter(e, t, n = 0) {
|
|
547
|
+
let r;
|
|
548
|
+
if (!(n & A.IgnoreOverlays) && (r = ge.get(this._tree)) && r.overlay) {
|
|
549
|
+
let s = e - this.from;
|
|
550
|
+
for (let { from: l, to: u } of r.overlay)
|
|
551
|
+
if ((t > 0 ? l <= s : l < s) && (t < 0 ? u >= s : u > s))
|
|
552
|
+
return new E(r.tree, r.overlay[0].from + this.from, -1, this);
|
|
553
|
+
}
|
|
554
|
+
return this.nextChild(0, 1, e, t, n);
|
|
555
|
+
}
|
|
556
|
+
nextSignificantParent() {
|
|
557
|
+
let e = this;
|
|
558
|
+
for (; e.type.isAnonymous && e._parent; )
|
|
559
|
+
e = e._parent;
|
|
560
|
+
return e;
|
|
561
|
+
}
|
|
562
|
+
get parent() {
|
|
563
|
+
return this._parent ? this._parent.nextSignificantParent() : null;
|
|
564
|
+
}
|
|
565
|
+
get nextSibling() {
|
|
566
|
+
return this._parent && this.index >= 0 ? this._parent.nextChild(
|
|
567
|
+
this.index + 1,
|
|
568
|
+
1,
|
|
569
|
+
0,
|
|
570
|
+
4
|
|
571
|
+
/* Side.DontCare */
|
|
572
|
+
) : null;
|
|
573
|
+
}
|
|
574
|
+
get prevSibling() {
|
|
575
|
+
return this._parent && this.index >= 0 ? this._parent.nextChild(
|
|
576
|
+
this.index - 1,
|
|
577
|
+
-1,
|
|
578
|
+
0,
|
|
579
|
+
4
|
|
580
|
+
/* Side.DontCare */
|
|
581
|
+
) : null;
|
|
582
|
+
}
|
|
583
|
+
get tree() {
|
|
584
|
+
return this._tree;
|
|
585
|
+
}
|
|
586
|
+
toTree() {
|
|
587
|
+
return this._tree;
|
|
588
|
+
}
|
|
589
|
+
/**
|
|
590
|
+
@internal
|
|
591
|
+
*/
|
|
592
|
+
toString() {
|
|
593
|
+
return this._tree.toString();
|
|
594
|
+
}
|
|
595
|
+
}
|
|
596
|
+
function Ee(i, e, t, n) {
|
|
597
|
+
let r = i.cursor(), s = [];
|
|
598
|
+
if (!r.firstChild())
|
|
599
|
+
return s;
|
|
600
|
+
if (t != null) {
|
|
601
|
+
for (let l = !1; !l; )
|
|
602
|
+
if (l = r.type.is(t), !r.nextSibling())
|
|
603
|
+
return s;
|
|
604
|
+
}
|
|
605
|
+
for (; ; ) {
|
|
606
|
+
if (n != null && r.type.is(n))
|
|
607
|
+
return s;
|
|
608
|
+
if (r.type.is(e) && s.push(r.node), !r.nextSibling())
|
|
609
|
+
return n == null ? s : [];
|
|
610
|
+
}
|
|
611
|
+
}
|
|
612
|
+
function xe(i, e, t = e.length - 1) {
|
|
613
|
+
for (let n = i.parent; t >= 0; n = n.parent) {
|
|
614
|
+
if (!n)
|
|
615
|
+
return !1;
|
|
616
|
+
if (!n.type.isAnonymous) {
|
|
617
|
+
if (e[t] && e[t] != n.name)
|
|
618
|
+
return !1;
|
|
619
|
+
t--;
|
|
620
|
+
}
|
|
621
|
+
}
|
|
622
|
+
return !0;
|
|
623
|
+
}
|
|
624
|
+
class yt {
|
|
625
|
+
constructor(e, t, n, r) {
|
|
626
|
+
this.parent = e, this.buffer = t, this.index = n, this.start = r;
|
|
627
|
+
}
|
|
628
|
+
}
|
|
629
|
+
class q extends Pe {
|
|
630
|
+
get name() {
|
|
631
|
+
return this.type.name;
|
|
632
|
+
}
|
|
633
|
+
get from() {
|
|
634
|
+
return this.context.start + this.context.buffer.buffer[this.index + 1];
|
|
635
|
+
}
|
|
636
|
+
get to() {
|
|
637
|
+
return this.context.start + this.context.buffer.buffer[this.index + 2];
|
|
638
|
+
}
|
|
639
|
+
constructor(e, t, n) {
|
|
640
|
+
super(), this.context = e, this._parent = t, this.index = n, this.type = e.buffer.set.types[e.buffer.buffer[n]];
|
|
641
|
+
}
|
|
642
|
+
child(e, t, n) {
|
|
643
|
+
let { buffer: r } = this.context, s = r.findChild(this.index + 4, r.buffer[this.index + 3], e, t - this.context.start, n);
|
|
644
|
+
return s < 0 ? null : new q(this.context, this, s);
|
|
645
|
+
}
|
|
646
|
+
get firstChild() {
|
|
647
|
+
return this.child(
|
|
648
|
+
1,
|
|
649
|
+
0,
|
|
650
|
+
4
|
|
651
|
+
/* Side.DontCare */
|
|
652
|
+
);
|
|
653
|
+
}
|
|
654
|
+
get lastChild() {
|
|
655
|
+
return this.child(
|
|
656
|
+
-1,
|
|
657
|
+
0,
|
|
658
|
+
4
|
|
659
|
+
/* Side.DontCare */
|
|
660
|
+
);
|
|
661
|
+
}
|
|
662
|
+
childAfter(e) {
|
|
663
|
+
return this.child(
|
|
664
|
+
1,
|
|
665
|
+
e,
|
|
666
|
+
2
|
|
667
|
+
/* Side.After */
|
|
668
|
+
);
|
|
669
|
+
}
|
|
670
|
+
childBefore(e) {
|
|
671
|
+
return this.child(
|
|
672
|
+
-1,
|
|
673
|
+
e,
|
|
674
|
+
-2
|
|
675
|
+
/* Side.Before */
|
|
676
|
+
);
|
|
677
|
+
}
|
|
678
|
+
enter(e, t, n = 0) {
|
|
679
|
+
if (n & A.ExcludeBuffers)
|
|
680
|
+
return null;
|
|
681
|
+
let { buffer: r } = this.context, s = r.findChild(this.index + 4, r.buffer[this.index + 3], t > 0 ? 1 : -1, e - this.context.start, t);
|
|
682
|
+
return s < 0 ? null : new q(this.context, this, s);
|
|
683
|
+
}
|
|
684
|
+
get parent() {
|
|
685
|
+
return this._parent || this.context.parent.nextSignificantParent();
|
|
686
|
+
}
|
|
687
|
+
externalSibling(e) {
|
|
688
|
+
return this._parent ? null : this.context.parent.nextChild(
|
|
689
|
+
this.context.index + e,
|
|
690
|
+
e,
|
|
691
|
+
0,
|
|
692
|
+
4
|
|
693
|
+
/* Side.DontCare */
|
|
694
|
+
);
|
|
695
|
+
}
|
|
696
|
+
get nextSibling() {
|
|
697
|
+
let { buffer: e } = this.context, t = e.buffer[this.index + 3];
|
|
698
|
+
return t < (this._parent ? e.buffer[this._parent.index + 3] : e.buffer.length) ? new q(this.context, this._parent, t) : this.externalSibling(1);
|
|
699
|
+
}
|
|
700
|
+
get prevSibling() {
|
|
701
|
+
let { buffer: e } = this.context, t = this._parent ? this._parent.index + 4 : 0;
|
|
702
|
+
return this.index == t ? this.externalSibling(-1) : new q(this.context, this._parent, e.findChild(
|
|
703
|
+
t,
|
|
704
|
+
this.index,
|
|
705
|
+
-1,
|
|
706
|
+
0,
|
|
707
|
+
4
|
|
708
|
+
/* Side.DontCare */
|
|
709
|
+
));
|
|
710
|
+
}
|
|
711
|
+
get tree() {
|
|
712
|
+
return null;
|
|
713
|
+
}
|
|
714
|
+
toTree() {
|
|
715
|
+
let e = [], t = [], { buffer: n } = this.context, r = this.index + 4, s = n.buffer[this.index + 3];
|
|
716
|
+
if (s > r) {
|
|
717
|
+
let l = n.buffer[this.index + 1];
|
|
718
|
+
e.push(n.slice(r, s, l)), t.push(0);
|
|
719
|
+
}
|
|
720
|
+
return new D(this.type, e, t, this.to - this.from);
|
|
721
|
+
}
|
|
722
|
+
/**
|
|
723
|
+
@internal
|
|
724
|
+
*/
|
|
725
|
+
toString() {
|
|
726
|
+
return this.context.buffer.childString(this.index);
|
|
727
|
+
}
|
|
728
|
+
}
|
|
729
|
+
function je(i) {
|
|
730
|
+
if (!i.length)
|
|
731
|
+
return null;
|
|
732
|
+
let e = 0, t = i[0];
|
|
733
|
+
for (let s = 1; s < i.length; s++) {
|
|
734
|
+
let l = i[s];
|
|
735
|
+
(l.from > t.from || l.to < t.to) && (t = l, e = s);
|
|
736
|
+
}
|
|
737
|
+
let n = t instanceof E && t.index < 0 ? null : t.parent, r = i.slice();
|
|
738
|
+
return n ? r[e] = n : r.splice(e, 1), new xt(r, t);
|
|
739
|
+
}
|
|
740
|
+
class xt {
|
|
741
|
+
constructor(e, t) {
|
|
742
|
+
this.heads = e, this.node = t;
|
|
743
|
+
}
|
|
744
|
+
get next() {
|
|
745
|
+
return je(this.heads);
|
|
746
|
+
}
|
|
747
|
+
}
|
|
748
|
+
function kt(i, e, t) {
|
|
749
|
+
let n = i.resolveInner(e, t), r = null;
|
|
750
|
+
for (let s = n instanceof E ? n : n.context.parent; s; s = s.parent)
|
|
751
|
+
if (s.index < 0) {
|
|
752
|
+
let l = s.parent;
|
|
753
|
+
(r || (r = [n])).push(l.resolve(e, t)), s = l;
|
|
754
|
+
} else {
|
|
755
|
+
let l = ge.get(s.tree);
|
|
756
|
+
if (l && l.overlay && l.overlay[0].from <= e && l.overlay[l.overlay.length - 1].to >= e) {
|
|
757
|
+
let u = new E(l.tree, l.overlay[0].from + s.from, -1, s);
|
|
758
|
+
(r || (r = [n])).push(le(u, e, t, !1));
|
|
759
|
+
}
|
|
760
|
+
}
|
|
761
|
+
return r ? je(r) : n;
|
|
762
|
+
}
|
|
763
|
+
class ke {
|
|
764
|
+
/**
|
|
765
|
+
Shorthand for `.type.name`.
|
|
766
|
+
*/
|
|
767
|
+
get name() {
|
|
768
|
+
return this.type.name;
|
|
769
|
+
}
|
|
770
|
+
/**
|
|
771
|
+
@internal
|
|
772
|
+
*/
|
|
773
|
+
constructor(e, t = 0) {
|
|
774
|
+
if (this.mode = t, this.buffer = null, this.stack = [], this.index = 0, this.bufferNode = null, e instanceof E)
|
|
775
|
+
this.yieldNode(e);
|
|
776
|
+
else {
|
|
777
|
+
this._tree = e.context.parent, this.buffer = e.context;
|
|
778
|
+
for (let n = e._parent; n; n = n._parent)
|
|
779
|
+
this.stack.unshift(n.index);
|
|
780
|
+
this.bufferNode = e, this.yieldBuf(e.index);
|
|
781
|
+
}
|
|
782
|
+
}
|
|
783
|
+
yieldNode(e) {
|
|
784
|
+
return e ? (this._tree = e, this.type = e.type, this.from = e.from, this.to = e.to, !0) : !1;
|
|
785
|
+
}
|
|
786
|
+
yieldBuf(e, t) {
|
|
787
|
+
this.index = e;
|
|
788
|
+
let { start: n, buffer: r } = this.buffer;
|
|
789
|
+
return this.type = t || r.set.types[r.buffer[e]], this.from = n + r.buffer[e + 1], this.to = n + r.buffer[e + 2], !0;
|
|
790
|
+
}
|
|
791
|
+
/**
|
|
792
|
+
@internal
|
|
793
|
+
*/
|
|
794
|
+
yield(e) {
|
|
795
|
+
return e ? e instanceof E ? (this.buffer = null, this.yieldNode(e)) : (this.buffer = e.context, this.yieldBuf(e.index, e.type)) : !1;
|
|
796
|
+
}
|
|
797
|
+
/**
|
|
798
|
+
@internal
|
|
799
|
+
*/
|
|
800
|
+
toString() {
|
|
801
|
+
return this.buffer ? this.buffer.buffer.childString(this.index) : this._tree.toString();
|
|
802
|
+
}
|
|
803
|
+
/**
|
|
804
|
+
@internal
|
|
805
|
+
*/
|
|
806
|
+
enterChild(e, t, n) {
|
|
807
|
+
if (!this.buffer)
|
|
808
|
+
return this.yield(this._tree.nextChild(e < 0 ? this._tree._tree.children.length - 1 : 0, e, t, n, this.mode));
|
|
809
|
+
let { buffer: r } = this.buffer, s = r.findChild(this.index + 4, r.buffer[this.index + 3], e, t - this.buffer.start, n);
|
|
810
|
+
return s < 0 ? !1 : (this.stack.push(this.index), this.yieldBuf(s));
|
|
811
|
+
}
|
|
812
|
+
/**
|
|
813
|
+
Move the cursor to this node's first child. When this returns
|
|
814
|
+
false, the node has no child, and the cursor has not been moved.
|
|
815
|
+
*/
|
|
816
|
+
firstChild() {
|
|
817
|
+
return this.enterChild(
|
|
818
|
+
1,
|
|
819
|
+
0,
|
|
820
|
+
4
|
|
821
|
+
/* Side.DontCare */
|
|
822
|
+
);
|
|
823
|
+
}
|
|
824
|
+
/**
|
|
825
|
+
Move the cursor to this node's last child.
|
|
826
|
+
*/
|
|
827
|
+
lastChild() {
|
|
828
|
+
return this.enterChild(
|
|
829
|
+
-1,
|
|
830
|
+
0,
|
|
831
|
+
4
|
|
832
|
+
/* Side.DontCare */
|
|
833
|
+
);
|
|
834
|
+
}
|
|
835
|
+
/**
|
|
836
|
+
Move the cursor to the first child that ends after `pos`.
|
|
837
|
+
*/
|
|
838
|
+
childAfter(e) {
|
|
839
|
+
return this.enterChild(
|
|
840
|
+
1,
|
|
841
|
+
e,
|
|
842
|
+
2
|
|
843
|
+
/* Side.After */
|
|
844
|
+
);
|
|
845
|
+
}
|
|
846
|
+
/**
|
|
847
|
+
Move to the last child that starts before `pos`.
|
|
848
|
+
*/
|
|
849
|
+
childBefore(e) {
|
|
850
|
+
return this.enterChild(
|
|
851
|
+
-1,
|
|
852
|
+
e,
|
|
853
|
+
-2
|
|
854
|
+
/* Side.Before */
|
|
855
|
+
);
|
|
856
|
+
}
|
|
857
|
+
/**
|
|
858
|
+
Move the cursor to the child around `pos`. If side is -1 the
|
|
859
|
+
child may end at that position, when 1 it may start there. This
|
|
860
|
+
will also enter [overlaid](#common.MountedTree.overlay)
|
|
861
|
+
[mounted](#common.NodeProp^mounted) trees unless `overlays` is
|
|
862
|
+
set to false.
|
|
863
|
+
*/
|
|
864
|
+
enter(e, t, n = this.mode) {
|
|
865
|
+
return this.buffer ? n & A.ExcludeBuffers ? !1 : this.enterChild(1, e, t) : this.yield(this._tree.enter(e, t, n));
|
|
866
|
+
}
|
|
867
|
+
/**
|
|
868
|
+
Move to the node's parent node, if this isn't the top node.
|
|
869
|
+
*/
|
|
870
|
+
parent() {
|
|
871
|
+
if (!this.buffer)
|
|
872
|
+
return this.yieldNode(this.mode & A.IncludeAnonymous ? this._tree._parent : this._tree.parent);
|
|
873
|
+
if (this.stack.length)
|
|
874
|
+
return this.yieldBuf(this.stack.pop());
|
|
875
|
+
let e = this.mode & A.IncludeAnonymous ? this.buffer.parent : this.buffer.parent.nextSignificantParent();
|
|
876
|
+
return this.buffer = null, this.yieldNode(e);
|
|
877
|
+
}
|
|
878
|
+
/**
|
|
879
|
+
@internal
|
|
880
|
+
*/
|
|
881
|
+
sibling(e) {
|
|
882
|
+
if (!this.buffer)
|
|
883
|
+
return this._tree._parent ? this.yield(this._tree.index < 0 ? null : this._tree._parent.nextChild(this._tree.index + e, e, 0, 4, this.mode)) : !1;
|
|
884
|
+
let { buffer: t } = this.buffer, n = this.stack.length - 1;
|
|
885
|
+
if (e < 0) {
|
|
886
|
+
let r = n < 0 ? 0 : this.stack[n] + 4;
|
|
887
|
+
if (this.index != r)
|
|
888
|
+
return this.yieldBuf(t.findChild(
|
|
889
|
+
r,
|
|
890
|
+
this.index,
|
|
891
|
+
-1,
|
|
892
|
+
0,
|
|
893
|
+
4
|
|
894
|
+
/* Side.DontCare */
|
|
895
|
+
));
|
|
896
|
+
} else {
|
|
897
|
+
let r = t.buffer[this.index + 3];
|
|
898
|
+
if (r < (n < 0 ? t.buffer.length : t.buffer[this.stack[n] + 3]))
|
|
899
|
+
return this.yieldBuf(r);
|
|
900
|
+
}
|
|
901
|
+
return n < 0 ? this.yield(this.buffer.parent.nextChild(this.buffer.index + e, e, 0, 4, this.mode)) : !1;
|
|
902
|
+
}
|
|
903
|
+
/**
|
|
904
|
+
Move to this node's next sibling, if any.
|
|
905
|
+
*/
|
|
906
|
+
nextSibling() {
|
|
907
|
+
return this.sibling(1);
|
|
908
|
+
}
|
|
909
|
+
/**
|
|
910
|
+
Move to this node's previous sibling, if any.
|
|
911
|
+
*/
|
|
912
|
+
prevSibling() {
|
|
913
|
+
return this.sibling(-1);
|
|
914
|
+
}
|
|
915
|
+
atLastNode(e) {
|
|
916
|
+
let t, n, { buffer: r } = this;
|
|
917
|
+
if (r) {
|
|
918
|
+
if (e > 0) {
|
|
919
|
+
if (this.index < r.buffer.buffer.length)
|
|
920
|
+
return !1;
|
|
921
|
+
} else
|
|
922
|
+
for (let s = 0; s < this.index; s++)
|
|
923
|
+
if (r.buffer.buffer[s + 3] < this.index)
|
|
924
|
+
return !1;
|
|
925
|
+
({ index: t, parent: n } = r);
|
|
926
|
+
} else
|
|
927
|
+
({ index: t, _parent: n } = this._tree);
|
|
928
|
+
for (; n; { index: t, _parent: n } = n)
|
|
929
|
+
if (t > -1)
|
|
930
|
+
for (let s = t + e, l = e < 0 ? -1 : n._tree.children.length; s != l; s += e) {
|
|
931
|
+
let u = n._tree.children[s];
|
|
932
|
+
if (this.mode & A.IncludeAnonymous || u instanceof X || !u.type.isAnonymous || Ce(u))
|
|
933
|
+
return !1;
|
|
934
|
+
}
|
|
935
|
+
return !0;
|
|
936
|
+
}
|
|
937
|
+
move(e, t) {
|
|
938
|
+
if (t && this.enterChild(
|
|
939
|
+
e,
|
|
940
|
+
0,
|
|
941
|
+
4
|
|
942
|
+
/* Side.DontCare */
|
|
943
|
+
))
|
|
944
|
+
return !0;
|
|
945
|
+
for (; ; ) {
|
|
946
|
+
if (this.sibling(e))
|
|
947
|
+
return !0;
|
|
948
|
+
if (this.atLastNode(e) || !this.parent())
|
|
949
|
+
return !1;
|
|
950
|
+
}
|
|
951
|
+
}
|
|
952
|
+
/**
|
|
953
|
+
Move to the next node in a
|
|
954
|
+
[pre-order](https://en.wikipedia.org/wiki/Tree_traversal#Pre-order,_NLR)
|
|
955
|
+
traversal, going from a node to its first child or, if the
|
|
956
|
+
current node is empty or `enter` is false, its next sibling or
|
|
957
|
+
the next sibling of the first parent node that has one.
|
|
958
|
+
*/
|
|
959
|
+
next(e = !0) {
|
|
960
|
+
return this.move(1, e);
|
|
961
|
+
}
|
|
962
|
+
/**
|
|
963
|
+
Move to the next node in a last-to-first pre-order traveral. A
|
|
964
|
+
node is followed by its last child or, if it has none, its
|
|
965
|
+
previous sibling or the previous sibling of the first parent
|
|
966
|
+
node that has one.
|
|
967
|
+
*/
|
|
968
|
+
prev(e = !0) {
|
|
969
|
+
return this.move(-1, e);
|
|
970
|
+
}
|
|
971
|
+
/**
|
|
972
|
+
Move the cursor to the innermost node that covers `pos`. If
|
|
973
|
+
`side` is -1, it will enter nodes that end at `pos`. If it is 1,
|
|
974
|
+
it will enter nodes that start at `pos`.
|
|
975
|
+
*/
|
|
976
|
+
moveTo(e, t = 0) {
|
|
977
|
+
for (; (this.from == this.to || (t < 1 ? this.from >= e : this.from > e) || (t > -1 ? this.to <= e : this.to < e)) && this.parent(); )
|
|
978
|
+
;
|
|
979
|
+
for (; this.enterChild(1, e, t); )
|
|
980
|
+
;
|
|
981
|
+
return this;
|
|
982
|
+
}
|
|
983
|
+
/**
|
|
984
|
+
Get a [syntax node](#common.SyntaxNode) at the cursor's current
|
|
985
|
+
position.
|
|
986
|
+
*/
|
|
987
|
+
get node() {
|
|
988
|
+
if (!this.buffer)
|
|
989
|
+
return this._tree;
|
|
990
|
+
let e = this.bufferNode, t = null, n = 0;
|
|
991
|
+
if (e && e.context == this.buffer)
|
|
992
|
+
e:
|
|
993
|
+
for (let r = this.index, s = this.stack.length; s >= 0; ) {
|
|
994
|
+
for (let l = e; l; l = l._parent)
|
|
995
|
+
if (l.index == r) {
|
|
996
|
+
if (r == this.index)
|
|
997
|
+
return l;
|
|
998
|
+
t = l, n = s + 1;
|
|
999
|
+
break e;
|
|
1000
|
+
}
|
|
1001
|
+
r = this.stack[--s];
|
|
1002
|
+
}
|
|
1003
|
+
for (let r = n; r < this.stack.length; r++)
|
|
1004
|
+
t = new q(this.buffer, t, this.stack[r]);
|
|
1005
|
+
return this.bufferNode = new q(this.buffer, t, this.index);
|
|
1006
|
+
}
|
|
1007
|
+
/**
|
|
1008
|
+
Get the [tree](#common.Tree) that represents the current node, if
|
|
1009
|
+
any. Will return null when the node is in a [tree
|
|
1010
|
+
buffer](#common.TreeBuffer).
|
|
1011
|
+
*/
|
|
1012
|
+
get tree() {
|
|
1013
|
+
return this.buffer ? null : this._tree._tree;
|
|
1014
|
+
}
|
|
1015
|
+
/**
|
|
1016
|
+
Iterate over the current node and all its descendants, calling
|
|
1017
|
+
`enter` when entering a node and `leave`, if given, when leaving
|
|
1018
|
+
one. When `enter` returns `false`, any children of that node are
|
|
1019
|
+
skipped, and `leave` isn't called for it.
|
|
1020
|
+
*/
|
|
1021
|
+
iterate(e, t) {
|
|
1022
|
+
for (let n = 0; ; ) {
|
|
1023
|
+
let r = !1;
|
|
1024
|
+
if (this.type.isAnonymous || e(this) !== !1) {
|
|
1025
|
+
if (this.firstChild()) {
|
|
1026
|
+
n++;
|
|
1027
|
+
continue;
|
|
1028
|
+
}
|
|
1029
|
+
this.type.isAnonymous || (r = !0);
|
|
1030
|
+
}
|
|
1031
|
+
for (; r && t && t(this), r = this.type.isAnonymous, !this.nextSibling(); ) {
|
|
1032
|
+
if (!n)
|
|
1033
|
+
return;
|
|
1034
|
+
this.parent(), n--, r = !0;
|
|
1035
|
+
}
|
|
1036
|
+
}
|
|
1037
|
+
}
|
|
1038
|
+
/**
|
|
1039
|
+
Test whether the current node matches a given context—a sequence
|
|
1040
|
+
of direct parent node names. Empty strings in the context array
|
|
1041
|
+
are treated as wildcards.
|
|
1042
|
+
*/
|
|
1043
|
+
matchContext(e) {
|
|
1044
|
+
if (!this.buffer)
|
|
1045
|
+
return xe(this.node, e);
|
|
1046
|
+
let { buffer: t } = this.buffer, { types: n } = t.set;
|
|
1047
|
+
for (let r = e.length - 1, s = this.stack.length - 1; r >= 0; s--) {
|
|
1048
|
+
if (s < 0)
|
|
1049
|
+
return xe(this.node, e, r);
|
|
1050
|
+
let l = n[t.buffer[this.stack[s]]];
|
|
1051
|
+
if (!l.isAnonymous) {
|
|
1052
|
+
if (e[r] && e[r] != l.name)
|
|
1053
|
+
return !1;
|
|
1054
|
+
r--;
|
|
1055
|
+
}
|
|
1056
|
+
}
|
|
1057
|
+
return !0;
|
|
1058
|
+
}
|
|
1059
|
+
}
|
|
1060
|
+
function Ce(i) {
|
|
1061
|
+
return i.children.some((e) => e instanceof X || !e.type.isAnonymous || Ce(e));
|
|
1062
|
+
}
|
|
1063
|
+
function _t(i) {
|
|
1064
|
+
var e;
|
|
1065
|
+
let { buffer: t, nodeSet: n, maxBufferLength: r = gt, reused: s = [], minRepeatType: l = n.types.length } = i, u = Array.isArray(t) ? new ve(t, t.length) : t, h = n.types, v = 0, C = 0;
|
|
1066
|
+
function N(g, b, f, y, p, m) {
|
|
1067
|
+
let { id: c, start: d, end: k, size: x } = u, B = C;
|
|
1068
|
+
for (; x < 0; )
|
|
1069
|
+
if (u.next(), x == -1) {
|
|
1070
|
+
let W = s[c];
|
|
1071
|
+
f.push(W), y.push(d - g);
|
|
1072
|
+
return;
|
|
1073
|
+
} else if (x == -3) {
|
|
1074
|
+
v = c;
|
|
1075
|
+
return;
|
|
1076
|
+
} else if (x == -4) {
|
|
1077
|
+
C = c;
|
|
1078
|
+
return;
|
|
1079
|
+
} else
|
|
1080
|
+
throw new RangeError(`Unrecognized record size: ${x}`);
|
|
1081
|
+
let Y = h[c], te, Q, Ne = d - g;
|
|
1082
|
+
if (k - d <= r && (Q = O(u.pos - b, p))) {
|
|
1083
|
+
let W = new Uint16Array(Q.size - Q.skip), L = u.pos - Q.size, T = W.length;
|
|
1084
|
+
for (; u.pos > L; )
|
|
1085
|
+
T = J(Q.start, W, T);
|
|
1086
|
+
te = new X(W, k - Q.start, n), Ne = Q.start - g;
|
|
1087
|
+
} else {
|
|
1088
|
+
let W = u.pos - x;
|
|
1089
|
+
u.next();
|
|
1090
|
+
let L = [], T = [], Z = c >= l ? c : -1, ne = 0, oe = k;
|
|
1091
|
+
for (; u.pos > W; )
|
|
1092
|
+
Z >= 0 && u.id == Z && u.size >= 0 ? (u.end <= oe - r && (I(L, T, d, ne, u.end, oe, Z, B), ne = L.length, oe = u.end), u.next()) : m > 2500 ? S(d, W, L, T) : N(d, W, L, T, Z, m + 1);
|
|
1093
|
+
if (Z >= 0 && ne > 0 && ne < L.length && I(L, T, d, ne, d, oe, Z, B), L.reverse(), T.reverse(), Z > -1 && ne > 0) {
|
|
1094
|
+
let Ae = z(Y);
|
|
1095
|
+
te = we(Y, L, T, 0, L.length, 0, k - d, Ae, Ae);
|
|
1096
|
+
} else
|
|
1097
|
+
te = M(Y, L, T, k - d, B - k);
|
|
1098
|
+
}
|
|
1099
|
+
f.push(te), y.push(Ne);
|
|
1100
|
+
}
|
|
1101
|
+
function S(g, b, f, y) {
|
|
1102
|
+
let p = [], m = 0, c = -1;
|
|
1103
|
+
for (; u.pos > b; ) {
|
|
1104
|
+
let { id: d, start: k, end: x, size: B } = u;
|
|
1105
|
+
if (B > 4)
|
|
1106
|
+
u.next();
|
|
1107
|
+
else {
|
|
1108
|
+
if (c > -1 && k < c)
|
|
1109
|
+
break;
|
|
1110
|
+
c < 0 && (c = x - r), p.push(d, k, x), m++, u.next();
|
|
1111
|
+
}
|
|
1112
|
+
}
|
|
1113
|
+
if (m) {
|
|
1114
|
+
let d = new Uint16Array(m * 4), k = p[p.length - 2];
|
|
1115
|
+
for (let x = p.length - 3, B = 0; x >= 0; x -= 3)
|
|
1116
|
+
d[B++] = p[x], d[B++] = p[x + 1] - k, d[B++] = p[x + 2] - k, d[B++] = B;
|
|
1117
|
+
f.push(new X(d, p[2] - k, n)), y.push(k - g);
|
|
1118
|
+
}
|
|
1119
|
+
}
|
|
1120
|
+
function z(g) {
|
|
1121
|
+
return (b, f, y) => {
|
|
1122
|
+
let p = 0, m = b.length - 1, c, d;
|
|
1123
|
+
if (m >= 0 && (c = b[m]) instanceof D) {
|
|
1124
|
+
if (!m && c.type == g && c.length == y)
|
|
1125
|
+
return c;
|
|
1126
|
+
(d = c.prop(_.lookAhead)) && (p = f[m] + c.length + d);
|
|
1127
|
+
}
|
|
1128
|
+
return M(g, b, f, y, p);
|
|
1129
|
+
};
|
|
1130
|
+
}
|
|
1131
|
+
function I(g, b, f, y, p, m, c, d) {
|
|
1132
|
+
let k = [], x = [];
|
|
1133
|
+
for (; g.length > y; )
|
|
1134
|
+
k.push(g.pop()), x.push(b.pop() + f - p);
|
|
1135
|
+
g.push(M(n.types[c], k, x, m - p, d - m)), b.push(p - f);
|
|
1136
|
+
}
|
|
1137
|
+
function M(g, b, f, y, p = 0, m) {
|
|
1138
|
+
if (v) {
|
|
1139
|
+
let c = [_.contextHash, v];
|
|
1140
|
+
m = m ? [c].concat(m) : [c];
|
|
1141
|
+
}
|
|
1142
|
+
if (p > 25) {
|
|
1143
|
+
let c = [_.lookAhead, p];
|
|
1144
|
+
m = m ? [c].concat(m) : [c];
|
|
1145
|
+
}
|
|
1146
|
+
return new D(g, b, f, y, m);
|
|
1147
|
+
}
|
|
1148
|
+
function O(g, b) {
|
|
1149
|
+
let f = u.fork(), y = 0, p = 0, m = 0, c = f.end - r, d = { size: 0, start: 0, skip: 0 };
|
|
1150
|
+
e:
|
|
1151
|
+
for (let k = f.pos - g; f.pos > k; ) {
|
|
1152
|
+
let x = f.size;
|
|
1153
|
+
if (f.id == b && x >= 0) {
|
|
1154
|
+
d.size = y, d.start = p, d.skip = m, m += 4, y += 4, f.next();
|
|
1155
|
+
continue;
|
|
1156
|
+
}
|
|
1157
|
+
let B = f.pos - x;
|
|
1158
|
+
if (x < 0 || B < k || f.start < c)
|
|
1159
|
+
break;
|
|
1160
|
+
let Y = f.id >= l ? 4 : 0, te = f.start;
|
|
1161
|
+
for (f.next(); f.pos > B; ) {
|
|
1162
|
+
if (f.size < 0)
|
|
1163
|
+
if (f.size == -3)
|
|
1164
|
+
Y += 4;
|
|
1165
|
+
else
|
|
1166
|
+
break e;
|
|
1167
|
+
else
|
|
1168
|
+
f.id >= l && (Y += 4);
|
|
1169
|
+
f.next();
|
|
1170
|
+
}
|
|
1171
|
+
p = te, y += x, m += Y;
|
|
1172
|
+
}
|
|
1173
|
+
return (b < 0 || y == g) && (d.size = y, d.start = p, d.skip = m), d.size > 4 ? d : void 0;
|
|
1174
|
+
}
|
|
1175
|
+
function J(g, b, f) {
|
|
1176
|
+
let { id: y, start: p, end: m, size: c } = u;
|
|
1177
|
+
if (u.next(), c >= 0 && y < l) {
|
|
1178
|
+
let d = f;
|
|
1179
|
+
if (c > 4) {
|
|
1180
|
+
let k = u.pos - (c - 4);
|
|
1181
|
+
for (; u.pos > k; )
|
|
1182
|
+
f = J(g, b, f);
|
|
1183
|
+
}
|
|
1184
|
+
b[--f] = d, b[--f] = m - g, b[--f] = p - g, b[--f] = y;
|
|
1185
|
+
} else
|
|
1186
|
+
c == -3 ? v = y : c == -4 && (C = y);
|
|
1187
|
+
return f;
|
|
1188
|
+
}
|
|
1189
|
+
let U = [], w = [];
|
|
1190
|
+
for (; u.pos > 0; )
|
|
1191
|
+
N(i.start || 0, i.bufferStart || 0, U, w, -1, 0);
|
|
1192
|
+
let V = (e = i.length) !== null && e !== void 0 ? e : U.length ? w[0] + U[0].length : 0;
|
|
1193
|
+
return new D(h[i.topID], U.reverse(), w.reverse(), V);
|
|
1194
|
+
}
|
|
1195
|
+
const Oe = /* @__PURE__ */ new WeakMap();
|
|
1196
|
+
function de(i, e) {
|
|
1197
|
+
if (!i.isAnonymous || e instanceof X || e.type != i)
|
|
1198
|
+
return 1;
|
|
1199
|
+
let t = Oe.get(e);
|
|
1200
|
+
if (t == null) {
|
|
1201
|
+
t = 1;
|
|
1202
|
+
for (let n of e.children) {
|
|
1203
|
+
if (n.type != i || !(n instanceof D)) {
|
|
1204
|
+
t = 1;
|
|
1205
|
+
break;
|
|
1206
|
+
}
|
|
1207
|
+
t += de(i, n);
|
|
1208
|
+
}
|
|
1209
|
+
Oe.set(e, t);
|
|
1210
|
+
}
|
|
1211
|
+
return t;
|
|
1212
|
+
}
|
|
1213
|
+
function we(i, e, t, n, r, s, l, u, h) {
|
|
1214
|
+
let v = 0;
|
|
1215
|
+
for (let I = n; I < r; I++)
|
|
1216
|
+
v += de(i, e[I]);
|
|
1217
|
+
let C = Math.ceil(
|
|
1218
|
+
v * 1.5 / 8
|
|
1219
|
+
/* Balance.BranchFactor */
|
|
1220
|
+
), N = [], S = [];
|
|
1221
|
+
function z(I, M, O, J, U) {
|
|
1222
|
+
for (let w = O; w < J; ) {
|
|
1223
|
+
let V = w, g = M[w], b = de(i, I[w]);
|
|
1224
|
+
for (w++; w < J; w++) {
|
|
1225
|
+
let f = de(i, I[w]);
|
|
1226
|
+
if (b + f >= C)
|
|
1227
|
+
break;
|
|
1228
|
+
b += f;
|
|
1229
|
+
}
|
|
1230
|
+
if (w == V + 1) {
|
|
1231
|
+
if (b > C) {
|
|
1232
|
+
let f = I[V];
|
|
1233
|
+
z(f.children, f.positions, 0, f.children.length, M[V] + U);
|
|
1234
|
+
continue;
|
|
1235
|
+
}
|
|
1236
|
+
N.push(I[V]);
|
|
1237
|
+
} else {
|
|
1238
|
+
let f = M[w - 1] + I[w - 1].length - g;
|
|
1239
|
+
N.push(we(i, I, M, V, w, g, f, null, h));
|
|
1240
|
+
}
|
|
1241
|
+
S.push(g + U - s);
|
|
1242
|
+
}
|
|
1243
|
+
}
|
|
1244
|
+
return z(e, t, n, r, 0), (u || h)(N, S, l);
|
|
1245
|
+
}
|
|
1246
|
+
new _({ perNode: !0 });
|
|
1247
|
+
let vt = 0;
|
|
1248
|
+
class R {
|
|
1249
|
+
/**
|
|
1250
|
+
@internal
|
|
1251
|
+
*/
|
|
1252
|
+
constructor(e, t, n) {
|
|
1253
|
+
this.set = e, this.base = t, this.modified = n, this.id = vt++;
|
|
1254
|
+
}
|
|
1255
|
+
/**
|
|
1256
|
+
Define a new tag. If `parent` is given, the tag is treated as a
|
|
1257
|
+
sub-tag of that parent, and
|
|
1258
|
+
[highlighters](#highlight.tagHighlighter) that don't mention
|
|
1259
|
+
this tag will try to fall back to the parent tag (or grandparent
|
|
1260
|
+
tag, etc).
|
|
1261
|
+
*/
|
|
1262
|
+
static define(e) {
|
|
1263
|
+
if (e != null && e.base)
|
|
1264
|
+
throw new Error("Can not derive from a modified tag");
|
|
1265
|
+
let t = new R([], null, []);
|
|
1266
|
+
if (t.set.push(t), e)
|
|
1267
|
+
for (let n of e.set)
|
|
1268
|
+
t.set.push(n);
|
|
1269
|
+
return t;
|
|
1270
|
+
}
|
|
1271
|
+
/**
|
|
1272
|
+
Define a tag _modifier_, which is a function that, given a tag,
|
|
1273
|
+
will return a tag that is a subtag of the original. Applying the
|
|
1274
|
+
same modifier to a twice tag will return the same value (`m1(t1)
|
|
1275
|
+
== m1(t1)`) and applying multiple modifiers will, regardless or
|
|
1276
|
+
order, produce the same tag (`m1(m2(t1)) == m2(m1(t1))`).
|
|
1277
|
+
|
|
1278
|
+
When multiple modifiers are applied to a given base tag, each
|
|
1279
|
+
smaller set of modifiers is registered as a parent, so that for
|
|
1280
|
+
example `m1(m2(m3(t1)))` is a subtype of `m1(m2(t1))`,
|
|
1281
|
+
`m1(m3(t1)`, and so on.
|
|
1282
|
+
*/
|
|
1283
|
+
static defineModifier() {
|
|
1284
|
+
let e = new me();
|
|
1285
|
+
return (t) => t.modified.indexOf(e) > -1 ? t : me.get(t.base || t, t.modified.concat(e).sort((n, r) => n.id - r.id));
|
|
1286
|
+
}
|
|
1287
|
+
}
|
|
1288
|
+
let Ct = 0;
|
|
1289
|
+
class me {
|
|
1290
|
+
constructor() {
|
|
1291
|
+
this.instances = [], this.id = Ct++;
|
|
1292
|
+
}
|
|
1293
|
+
static get(e, t) {
|
|
1294
|
+
if (!t.length)
|
|
1295
|
+
return e;
|
|
1296
|
+
let n = t[0].instances.find((u) => u.base == e && wt(t, u.modified));
|
|
1297
|
+
if (n)
|
|
1298
|
+
return n;
|
|
1299
|
+
let r = [], s = new R(r, e, t);
|
|
1300
|
+
for (let u of t)
|
|
1301
|
+
u.instances.push(s);
|
|
1302
|
+
let l = Nt(t);
|
|
1303
|
+
for (let u of e.set)
|
|
1304
|
+
if (!u.modified.length)
|
|
1305
|
+
for (let h of l)
|
|
1306
|
+
r.push(me.get(u, h));
|
|
1307
|
+
return s;
|
|
1308
|
+
}
|
|
1309
|
+
}
|
|
1310
|
+
function wt(i, e) {
|
|
1311
|
+
return i.length == e.length && i.every((t, n) => t == e[n]);
|
|
1312
|
+
}
|
|
1313
|
+
function Nt(i) {
|
|
1314
|
+
let e = [[]];
|
|
1315
|
+
for (let t = 0; t < i.length; t++)
|
|
1316
|
+
for (let n = 0, r = e.length; n < r; n++)
|
|
1317
|
+
e.push(e[n].concat(i[t]));
|
|
1318
|
+
return e.sort((t, n) => n.length - t.length);
|
|
1319
|
+
}
|
|
1320
|
+
new _();
|
|
1321
|
+
function At(i, e) {
|
|
1322
|
+
let t = /* @__PURE__ */ Object.create(null);
|
|
1323
|
+
for (let s of i)
|
|
1324
|
+
if (!Array.isArray(s.tag))
|
|
1325
|
+
t[s.tag.id] = s.class;
|
|
1326
|
+
else
|
|
1327
|
+
for (let l of s.tag)
|
|
1328
|
+
t[l.id] = s.class;
|
|
1329
|
+
let { scope: n, all: r = null } = e || {};
|
|
1330
|
+
return {
|
|
1331
|
+
style: (s) => {
|
|
1332
|
+
let l = r;
|
|
1333
|
+
for (let u of s)
|
|
1334
|
+
for (let h of u.set) {
|
|
1335
|
+
let v = t[h.id];
|
|
1336
|
+
if (v) {
|
|
1337
|
+
l = l ? l + " " + v : v;
|
|
1338
|
+
break;
|
|
1339
|
+
}
|
|
1340
|
+
}
|
|
1341
|
+
return l;
|
|
1342
|
+
},
|
|
1343
|
+
scope: n
|
|
1344
|
+
};
|
|
1345
|
+
}
|
|
1346
|
+
const a = R.define, fe = a(), $ = a(), ze = a($), Me = a($), K = a(), he = a(K), ye = a(K), H = a(), ee = a(H), P = a(), j = a(), _e = a(), ie = a(_e), ce = a(), o = {
|
|
1347
|
+
/**
|
|
1348
|
+
A comment.
|
|
1349
|
+
*/
|
|
1350
|
+
comment: fe,
|
|
1351
|
+
/**
|
|
1352
|
+
A line [comment](#highlight.tags.comment).
|
|
1353
|
+
*/
|
|
1354
|
+
lineComment: a(fe),
|
|
1355
|
+
/**
|
|
1356
|
+
A block [comment](#highlight.tags.comment).
|
|
1357
|
+
*/
|
|
1358
|
+
blockComment: a(fe),
|
|
1359
|
+
/**
|
|
1360
|
+
A documentation [comment](#highlight.tags.comment).
|
|
1361
|
+
*/
|
|
1362
|
+
docComment: a(fe),
|
|
1363
|
+
/**
|
|
1364
|
+
Any kind of identifier.
|
|
1365
|
+
*/
|
|
1366
|
+
name: $,
|
|
1367
|
+
/**
|
|
1368
|
+
The [name](#highlight.tags.name) of a variable.
|
|
1369
|
+
*/
|
|
1370
|
+
variableName: a($),
|
|
1371
|
+
/**
|
|
1372
|
+
A type [name](#highlight.tags.name).
|
|
1373
|
+
*/
|
|
1374
|
+
typeName: ze,
|
|
1375
|
+
/**
|
|
1376
|
+
A tag name (subtag of [`typeName`](#highlight.tags.typeName)).
|
|
1377
|
+
*/
|
|
1378
|
+
tagName: a(ze),
|
|
1379
|
+
/**
|
|
1380
|
+
A property or field [name](#highlight.tags.name).
|
|
1381
|
+
*/
|
|
1382
|
+
propertyName: Me,
|
|
1383
|
+
/**
|
|
1384
|
+
An attribute name (subtag of [`propertyName`](#highlight.tags.propertyName)).
|
|
1385
|
+
*/
|
|
1386
|
+
attributeName: a(Me),
|
|
1387
|
+
/**
|
|
1388
|
+
The [name](#highlight.tags.name) of a class.
|
|
1389
|
+
*/
|
|
1390
|
+
className: a($),
|
|
1391
|
+
/**
|
|
1392
|
+
A label [name](#highlight.tags.name).
|
|
1393
|
+
*/
|
|
1394
|
+
labelName: a($),
|
|
1395
|
+
/**
|
|
1396
|
+
A namespace [name](#highlight.tags.name).
|
|
1397
|
+
*/
|
|
1398
|
+
namespace: a($),
|
|
1399
|
+
/**
|
|
1400
|
+
The [name](#highlight.tags.name) of a macro.
|
|
1401
|
+
*/
|
|
1402
|
+
macroName: a($),
|
|
1403
|
+
/**
|
|
1404
|
+
A literal value.
|
|
1405
|
+
*/
|
|
1406
|
+
literal: K,
|
|
1407
|
+
/**
|
|
1408
|
+
A string [literal](#highlight.tags.literal).
|
|
1409
|
+
*/
|
|
1410
|
+
string: he,
|
|
1411
|
+
/**
|
|
1412
|
+
A documentation [string](#highlight.tags.string).
|
|
1413
|
+
*/
|
|
1414
|
+
docString: a(he),
|
|
1415
|
+
/**
|
|
1416
|
+
A character literal (subtag of [string](#highlight.tags.string)).
|
|
1417
|
+
*/
|
|
1418
|
+
character: a(he),
|
|
1419
|
+
/**
|
|
1420
|
+
An attribute value (subtag of [string](#highlight.tags.string)).
|
|
1421
|
+
*/
|
|
1422
|
+
attributeValue: a(he),
|
|
1423
|
+
/**
|
|
1424
|
+
A number [literal](#highlight.tags.literal).
|
|
1425
|
+
*/
|
|
1426
|
+
number: ye,
|
|
1427
|
+
/**
|
|
1428
|
+
An integer [number](#highlight.tags.number) literal.
|
|
1429
|
+
*/
|
|
1430
|
+
integer: a(ye),
|
|
1431
|
+
/**
|
|
1432
|
+
A floating-point [number](#highlight.tags.number) literal.
|
|
1433
|
+
*/
|
|
1434
|
+
float: a(ye),
|
|
1435
|
+
/**
|
|
1436
|
+
A boolean [literal](#highlight.tags.literal).
|
|
1437
|
+
*/
|
|
1438
|
+
bool: a(K),
|
|
1439
|
+
/**
|
|
1440
|
+
Regular expression [literal](#highlight.tags.literal).
|
|
1441
|
+
*/
|
|
1442
|
+
regexp: a(K),
|
|
1443
|
+
/**
|
|
1444
|
+
An escape [literal](#highlight.tags.literal), for example a
|
|
1445
|
+
backslash escape in a string.
|
|
1446
|
+
*/
|
|
1447
|
+
escape: a(K),
|
|
1448
|
+
/**
|
|
1449
|
+
A color [literal](#highlight.tags.literal).
|
|
1450
|
+
*/
|
|
1451
|
+
color: a(K),
|
|
1452
|
+
/**
|
|
1453
|
+
A URL [literal](#highlight.tags.literal).
|
|
1454
|
+
*/
|
|
1455
|
+
url: a(K),
|
|
1456
|
+
/**
|
|
1457
|
+
A language keyword.
|
|
1458
|
+
*/
|
|
1459
|
+
keyword: P,
|
|
1460
|
+
/**
|
|
1461
|
+
The [keyword](#highlight.tags.keyword) for the self or this
|
|
1462
|
+
object.
|
|
1463
|
+
*/
|
|
1464
|
+
self: a(P),
|
|
1465
|
+
/**
|
|
1466
|
+
The [keyword](#highlight.tags.keyword) for null.
|
|
1467
|
+
*/
|
|
1468
|
+
null: a(P),
|
|
1469
|
+
/**
|
|
1470
|
+
A [keyword](#highlight.tags.keyword) denoting some atomic value.
|
|
1471
|
+
*/
|
|
1472
|
+
atom: a(P),
|
|
1473
|
+
/**
|
|
1474
|
+
A [keyword](#highlight.tags.keyword) that represents a unit.
|
|
1475
|
+
*/
|
|
1476
|
+
unit: a(P),
|
|
1477
|
+
/**
|
|
1478
|
+
A modifier [keyword](#highlight.tags.keyword).
|
|
1479
|
+
*/
|
|
1480
|
+
modifier: a(P),
|
|
1481
|
+
/**
|
|
1482
|
+
A [keyword](#highlight.tags.keyword) that acts as an operator.
|
|
1483
|
+
*/
|
|
1484
|
+
operatorKeyword: a(P),
|
|
1485
|
+
/**
|
|
1486
|
+
A control-flow related [keyword](#highlight.tags.keyword).
|
|
1487
|
+
*/
|
|
1488
|
+
controlKeyword: a(P),
|
|
1489
|
+
/**
|
|
1490
|
+
A [keyword](#highlight.tags.keyword) that defines something.
|
|
1491
|
+
*/
|
|
1492
|
+
definitionKeyword: a(P),
|
|
1493
|
+
/**
|
|
1494
|
+
A [keyword](#highlight.tags.keyword) related to defining or
|
|
1495
|
+
interfacing with modules.
|
|
1496
|
+
*/
|
|
1497
|
+
moduleKeyword: a(P),
|
|
1498
|
+
/**
|
|
1499
|
+
An operator.
|
|
1500
|
+
*/
|
|
1501
|
+
operator: j,
|
|
1502
|
+
/**
|
|
1503
|
+
An [operator](#highlight.tags.operator) that dereferences something.
|
|
1504
|
+
*/
|
|
1505
|
+
derefOperator: a(j),
|
|
1506
|
+
/**
|
|
1507
|
+
Arithmetic-related [operator](#highlight.tags.operator).
|
|
1508
|
+
*/
|
|
1509
|
+
arithmeticOperator: a(j),
|
|
1510
|
+
/**
|
|
1511
|
+
Logical [operator](#highlight.tags.operator).
|
|
1512
|
+
*/
|
|
1513
|
+
logicOperator: a(j),
|
|
1514
|
+
/**
|
|
1515
|
+
Bit [operator](#highlight.tags.operator).
|
|
1516
|
+
*/
|
|
1517
|
+
bitwiseOperator: a(j),
|
|
1518
|
+
/**
|
|
1519
|
+
Comparison [operator](#highlight.tags.operator).
|
|
1520
|
+
*/
|
|
1521
|
+
compareOperator: a(j),
|
|
1522
|
+
/**
|
|
1523
|
+
[Operator](#highlight.tags.operator) that updates its operand.
|
|
1524
|
+
*/
|
|
1525
|
+
updateOperator: a(j),
|
|
1526
|
+
/**
|
|
1527
|
+
[Operator](#highlight.tags.operator) that defines something.
|
|
1528
|
+
*/
|
|
1529
|
+
definitionOperator: a(j),
|
|
1530
|
+
/**
|
|
1531
|
+
Type-related [operator](#highlight.tags.operator).
|
|
1532
|
+
*/
|
|
1533
|
+
typeOperator: a(j),
|
|
1534
|
+
/**
|
|
1535
|
+
Control-flow [operator](#highlight.tags.operator).
|
|
1536
|
+
*/
|
|
1537
|
+
controlOperator: a(j),
|
|
1538
|
+
/**
|
|
1539
|
+
Program or markup punctuation.
|
|
1540
|
+
*/
|
|
1541
|
+
punctuation: _e,
|
|
1542
|
+
/**
|
|
1543
|
+
[Punctuation](#highlight.tags.punctuation) that separates
|
|
1544
|
+
things.
|
|
1545
|
+
*/
|
|
1546
|
+
separator: a(_e),
|
|
1547
|
+
/**
|
|
1548
|
+
Bracket-style [punctuation](#highlight.tags.punctuation).
|
|
1549
|
+
*/
|
|
1550
|
+
bracket: ie,
|
|
1551
|
+
/**
|
|
1552
|
+
Angle [brackets](#highlight.tags.bracket) (usually `<` and `>`
|
|
1553
|
+
tokens).
|
|
1554
|
+
*/
|
|
1555
|
+
angleBracket: a(ie),
|
|
1556
|
+
/**
|
|
1557
|
+
Square [brackets](#highlight.tags.bracket) (usually `[` and `]`
|
|
1558
|
+
tokens).
|
|
1559
|
+
*/
|
|
1560
|
+
squareBracket: a(ie),
|
|
1561
|
+
/**
|
|
1562
|
+
Parentheses (usually `(` and `)` tokens). Subtag of
|
|
1563
|
+
[bracket](#highlight.tags.bracket).
|
|
1564
|
+
*/
|
|
1565
|
+
paren: a(ie),
|
|
1566
|
+
/**
|
|
1567
|
+
Braces (usually `{` and `}` tokens). Subtag of
|
|
1568
|
+
[bracket](#highlight.tags.bracket).
|
|
1569
|
+
*/
|
|
1570
|
+
brace: a(ie),
|
|
1571
|
+
/**
|
|
1572
|
+
Content, for example plain text in XML or markup documents.
|
|
1573
|
+
*/
|
|
1574
|
+
content: H,
|
|
1575
|
+
/**
|
|
1576
|
+
[Content](#highlight.tags.content) that represents a heading.
|
|
1577
|
+
*/
|
|
1578
|
+
heading: ee,
|
|
1579
|
+
/**
|
|
1580
|
+
A level 1 [heading](#highlight.tags.heading).
|
|
1581
|
+
*/
|
|
1582
|
+
heading1: a(ee),
|
|
1583
|
+
/**
|
|
1584
|
+
A level 2 [heading](#highlight.tags.heading).
|
|
1585
|
+
*/
|
|
1586
|
+
heading2: a(ee),
|
|
1587
|
+
/**
|
|
1588
|
+
A level 3 [heading](#highlight.tags.heading).
|
|
1589
|
+
*/
|
|
1590
|
+
heading3: a(ee),
|
|
1591
|
+
/**
|
|
1592
|
+
A level 4 [heading](#highlight.tags.heading).
|
|
1593
|
+
*/
|
|
1594
|
+
heading4: a(ee),
|
|
1595
|
+
/**
|
|
1596
|
+
A level 5 [heading](#highlight.tags.heading).
|
|
1597
|
+
*/
|
|
1598
|
+
heading5: a(ee),
|
|
1599
|
+
/**
|
|
1600
|
+
A level 6 [heading](#highlight.tags.heading).
|
|
1601
|
+
*/
|
|
1602
|
+
heading6: a(ee),
|
|
1603
|
+
/**
|
|
1604
|
+
A prose separator (such as a horizontal rule).
|
|
1605
|
+
*/
|
|
1606
|
+
contentSeparator: a(H),
|
|
1607
|
+
/**
|
|
1608
|
+
[Content](#highlight.tags.content) that represents a list.
|
|
1609
|
+
*/
|
|
1610
|
+
list: a(H),
|
|
1611
|
+
/**
|
|
1612
|
+
[Content](#highlight.tags.content) that represents a quote.
|
|
1613
|
+
*/
|
|
1614
|
+
quote: a(H),
|
|
1615
|
+
/**
|
|
1616
|
+
[Content](#highlight.tags.content) that is emphasized.
|
|
1617
|
+
*/
|
|
1618
|
+
emphasis: a(H),
|
|
1619
|
+
/**
|
|
1620
|
+
[Content](#highlight.tags.content) that is styled strong.
|
|
1621
|
+
*/
|
|
1622
|
+
strong: a(H),
|
|
1623
|
+
/**
|
|
1624
|
+
[Content](#highlight.tags.content) that is part of a link.
|
|
1625
|
+
*/
|
|
1626
|
+
link: a(H),
|
|
1627
|
+
/**
|
|
1628
|
+
[Content](#highlight.tags.content) that is styled as code or
|
|
1629
|
+
monospace.
|
|
1630
|
+
*/
|
|
1631
|
+
monospace: a(H),
|
|
1632
|
+
/**
|
|
1633
|
+
[Content](#highlight.tags.content) that has a strike-through
|
|
1634
|
+
style.
|
|
1635
|
+
*/
|
|
1636
|
+
strikethrough: a(H),
|
|
1637
|
+
/**
|
|
1638
|
+
Inserted text in a change-tracking format.
|
|
1639
|
+
*/
|
|
1640
|
+
inserted: a(),
|
|
1641
|
+
/**
|
|
1642
|
+
Deleted text.
|
|
1643
|
+
*/
|
|
1644
|
+
deleted: a(),
|
|
1645
|
+
/**
|
|
1646
|
+
Changed text.
|
|
1647
|
+
*/
|
|
1648
|
+
changed: a(),
|
|
1649
|
+
/**
|
|
1650
|
+
An invalid or unsyntactic element.
|
|
1651
|
+
*/
|
|
1652
|
+
invalid: a(),
|
|
1653
|
+
/**
|
|
1654
|
+
Metadata or meta-instruction.
|
|
1655
|
+
*/
|
|
1656
|
+
meta: ce,
|
|
1657
|
+
/**
|
|
1658
|
+
[Metadata](#highlight.tags.meta) that applies to the entire
|
|
1659
|
+
document.
|
|
1660
|
+
*/
|
|
1661
|
+
documentMeta: a(ce),
|
|
1662
|
+
/**
|
|
1663
|
+
[Metadata](#highlight.tags.meta) that annotates or adds
|
|
1664
|
+
attributes to a given syntactic element.
|
|
1665
|
+
*/
|
|
1666
|
+
annotation: a(ce),
|
|
1667
|
+
/**
|
|
1668
|
+
Processing instruction or preprocessor directive. Subtag of
|
|
1669
|
+
[meta](#highlight.tags.meta).
|
|
1670
|
+
*/
|
|
1671
|
+
processingInstruction: a(ce),
|
|
1672
|
+
/**
|
|
1673
|
+
[Modifier](#highlight.Tag^defineModifier) that indicates that a
|
|
1674
|
+
given element is being defined. Expected to be used with the
|
|
1675
|
+
various [name](#highlight.tags.name) tags.
|
|
1676
|
+
*/
|
|
1677
|
+
definition: R.defineModifier(),
|
|
1678
|
+
/**
|
|
1679
|
+
[Modifier](#highlight.Tag^defineModifier) that indicates that
|
|
1680
|
+
something is constant. Mostly expected to be used with
|
|
1681
|
+
[variable names](#highlight.tags.variableName).
|
|
1682
|
+
*/
|
|
1683
|
+
constant: R.defineModifier(),
|
|
1684
|
+
/**
|
|
1685
|
+
[Modifier](#highlight.Tag^defineModifier) used to indicate that
|
|
1686
|
+
a [variable](#highlight.tags.variableName) or [property
|
|
1687
|
+
name](#highlight.tags.propertyName) is being called or defined
|
|
1688
|
+
as a function.
|
|
1689
|
+
*/
|
|
1690
|
+
function: R.defineModifier(),
|
|
1691
|
+
/**
|
|
1692
|
+
[Modifier](#highlight.Tag^defineModifier) that can be applied to
|
|
1693
|
+
[names](#highlight.tags.name) to indicate that they belong to
|
|
1694
|
+
the language's standard environment.
|
|
1695
|
+
*/
|
|
1696
|
+
standard: R.defineModifier(),
|
|
1697
|
+
/**
|
|
1698
|
+
[Modifier](#highlight.Tag^defineModifier) that indicates a given
|
|
1699
|
+
[names](#highlight.tags.name) is local to some scope.
|
|
1700
|
+
*/
|
|
1701
|
+
local: R.defineModifier(),
|
|
1702
|
+
/**
|
|
1703
|
+
A generic variant [modifier](#highlight.Tag^defineModifier) that
|
|
1704
|
+
can be used to tag language-specific alternative variants of
|
|
1705
|
+
some common tag. It is recommended for themes to define special
|
|
1706
|
+
forms of at least the [string](#highlight.tags.string) and
|
|
1707
|
+
[variable name](#highlight.tags.variableName) tags, since those
|
|
1708
|
+
come up a lot.
|
|
1709
|
+
*/
|
|
1710
|
+
special: R.defineModifier()
|
|
1711
|
+
};
|
|
1712
|
+
At([
|
|
1713
|
+
{ tag: o.link, class: "tok-link" },
|
|
1714
|
+
{ tag: o.heading, class: "tok-heading" },
|
|
1715
|
+
{ tag: o.emphasis, class: "tok-emphasis" },
|
|
1716
|
+
{ tag: o.strong, class: "tok-strong" },
|
|
1717
|
+
{ tag: o.keyword, class: "tok-keyword" },
|
|
1718
|
+
{ tag: o.atom, class: "tok-atom" },
|
|
1719
|
+
{ tag: o.bool, class: "tok-bool" },
|
|
1720
|
+
{ tag: o.url, class: "tok-url" },
|
|
1721
|
+
{ tag: o.labelName, class: "tok-labelName" },
|
|
1722
|
+
{ tag: o.inserted, class: "tok-inserted" },
|
|
1723
|
+
{ tag: o.deleted, class: "tok-deleted" },
|
|
1724
|
+
{ tag: o.literal, class: "tok-literal" },
|
|
1725
|
+
{ tag: o.string, class: "tok-string" },
|
|
1726
|
+
{ tag: o.number, class: "tok-number" },
|
|
1727
|
+
{ tag: [o.regexp, o.escape, o.special(o.string)], class: "tok-string2" },
|
|
1728
|
+
{ tag: o.variableName, class: "tok-variableName" },
|
|
1729
|
+
{ tag: o.local(o.variableName), class: "tok-variableName tok-local" },
|
|
1730
|
+
{ tag: o.definition(o.variableName), class: "tok-variableName tok-definition" },
|
|
1731
|
+
{ tag: o.special(o.variableName), class: "tok-variableName2" },
|
|
1732
|
+
{ tag: o.definition(o.propertyName), class: "tok-propertyName tok-definition" },
|
|
1733
|
+
{ tag: o.typeName, class: "tok-typeName" },
|
|
1734
|
+
{ tag: o.namespace, class: "tok-namespace" },
|
|
1735
|
+
{ tag: o.className, class: "tok-className" },
|
|
1736
|
+
{ tag: o.macroName, class: "tok-macroName" },
|
|
1737
|
+
{ tag: o.propertyName, class: "tok-propertyName" },
|
|
1738
|
+
{ tag: o.operator, class: "tok-operator" },
|
|
1739
|
+
{ tag: o.comment, class: "tok-comment" },
|
|
1740
|
+
{ tag: o.meta, class: "tok-meta" },
|
|
1741
|
+
{ tag: o.invalid, class: "tok-invalid" },
|
|
1742
|
+
{ tag: o.punctuation, class: "tok-punctuation" }
|
|
1743
|
+
]);
|
|
1744
|
+
const St = {
|
|
1745
|
+
red: Xe,
|
|
1746
|
+
orange: Ye,
|
|
1747
|
+
green: Qe,
|
|
1748
|
+
blue: Ze,
|
|
1749
|
+
invalid: "#ffffff"
|
|
1750
|
+
}, It = (i) => qe.define([
|
|
1751
|
+
{
|
|
1752
|
+
tag: o.keyword,
|
|
1753
|
+
color: i.red
|
|
1754
|
+
},
|
|
1755
|
+
{
|
|
1756
|
+
tag: [o.name, o.deleted, o.character, o.propertyName, o.macroName],
|
|
1757
|
+
color: i.green
|
|
1758
|
+
},
|
|
1759
|
+
{
|
|
1760
|
+
tag: [o.function(o.variableName), o.labelName],
|
|
1761
|
+
color: i.blue
|
|
1762
|
+
},
|
|
1763
|
+
{
|
|
1764
|
+
tag: [o.color, o.constant(o.name), o.standard(o.name)],
|
|
1765
|
+
color: i.red
|
|
1766
|
+
},
|
|
1767
|
+
{
|
|
1768
|
+
tag: [o.definition(o.name), o.separator],
|
|
1769
|
+
color: i.red
|
|
1770
|
+
},
|
|
1771
|
+
{
|
|
1772
|
+
tag: [o.typeName, o.className, o.number, o.changed, o.annotation, o.modifier, o.self, o.namespace],
|
|
1773
|
+
color: i.orange
|
|
1774
|
+
},
|
|
1775
|
+
{
|
|
1776
|
+
tag: [o.operator, o.operatorKeyword, o.url, o.escape, o.regexp, o.link, o.special(o.string)],
|
|
1777
|
+
color: i.blue
|
|
1778
|
+
},
|
|
1779
|
+
{
|
|
1780
|
+
tag: [o.meta, o.comment],
|
|
1781
|
+
color: i.orange
|
|
1782
|
+
},
|
|
1783
|
+
{
|
|
1784
|
+
tag: o.strong,
|
|
1785
|
+
fontWeight: "bold"
|
|
1786
|
+
},
|
|
1787
|
+
{
|
|
1788
|
+
tag: o.emphasis,
|
|
1789
|
+
fontStyle: "italic"
|
|
1790
|
+
},
|
|
1791
|
+
{
|
|
1792
|
+
tag: o.strikethrough,
|
|
1793
|
+
textDecoration: "line-through"
|
|
1794
|
+
},
|
|
1795
|
+
{
|
|
1796
|
+
tag: o.link,
|
|
1797
|
+
color: i.orange,
|
|
1798
|
+
textDecoration: "underline"
|
|
1799
|
+
},
|
|
1800
|
+
{
|
|
1801
|
+
tag: o.heading,
|
|
1802
|
+
fontWeight: "bold",
|
|
1803
|
+
color: i.blue
|
|
1804
|
+
},
|
|
1805
|
+
{
|
|
1806
|
+
tag: [o.atom, o.bool, o.special(o.variableName)],
|
|
1807
|
+
color: i.red
|
|
1808
|
+
},
|
|
1809
|
+
{
|
|
1810
|
+
tag: [o.processingInstruction, o.string, o.inserted],
|
|
1811
|
+
color: i.blue
|
|
1812
|
+
},
|
|
1813
|
+
{
|
|
1814
|
+
tag: o.invalid,
|
|
1815
|
+
color: i.invalid
|
|
1816
|
+
}
|
|
1817
|
+
]), Bt = Fe(It(St));
|
|
1818
|
+
var pe = /* @__PURE__ */ ((i) => (i.INLINE = "inline", i.SINGLELINE = "singleline", i.MULTILINE = "multiline", i))(pe || {}), F = /* @__PURE__ */ ((i) => (i.JSON = "json", i.XML = "xml", i.JAVA = "java", i.JAVASCRIPT = "javascript", i.PYTHON = "python", i))(F || {}), se = /* @__PURE__ */ ((i) => (i.ACTION = "action", i.CHANGE = "change", i))(se || {});
|
|
1819
|
+
const Lt = {
|
|
1820
|
+
[F.JSON]: at,
|
|
1821
|
+
[F.XML]: ut,
|
|
1822
|
+
[F.JAVASCRIPT]: ft,
|
|
1823
|
+
[F.JAVA]: ht,
|
|
1824
|
+
[F.PYTHON]: ct
|
|
1825
|
+
}, Et = (i) => async () => Lt[i], Ot = (i, e) => {
|
|
1826
|
+
const t = i.doc.lineAt(e.from), n = /^\s*/.exec(t.text);
|
|
1827
|
+
return n ? n[0] : "";
|
|
1828
|
+
}, zt = {
|
|
1829
|
+
key: "Enter",
|
|
1830
|
+
run: ({ state: i, dispatch: e }) => {
|
|
1831
|
+
const t = i.changeByRange((n) => {
|
|
1832
|
+
const s = `
|
|
1833
|
+
${Ot(i, n)}`;
|
|
1834
|
+
return {
|
|
1835
|
+
changes: { from: n.from, to: n.to, insert: s },
|
|
1836
|
+
range: Ge.cursor(n.from + s.length)
|
|
1837
|
+
};
|
|
1838
|
+
});
|
|
1839
|
+
return e(i.update(t, { scrollIntoView: !0, userEvent: "input" })), !0;
|
|
1840
|
+
}
|
|
1841
|
+
}, Mt = {
|
|
1842
|
+
"en-US": {
|
|
1843
|
+
run: "Run",
|
|
1844
|
+
expand: "Expand"
|
|
1845
|
+
}
|
|
1846
|
+
}, Tt = He({
|
|
1847
|
+
i18n: { messages: Mt },
|
|
1848
|
+
name: "bento-code-snippet",
|
|
1849
|
+
components: {
|
|
1850
|
+
BentoTypography: nt,
|
|
1851
|
+
BentoButton: tt,
|
|
1852
|
+
BentoDropdown: et,
|
|
1853
|
+
Copy: ot,
|
|
1854
|
+
BaseModal: lt,
|
|
1855
|
+
BentoLoadingIndicator: rt,
|
|
1856
|
+
ExpandIcon: st
|
|
1857
|
+
},
|
|
1858
|
+
directives: { BentoTooltipDirective: dt },
|
|
1859
|
+
props: {
|
|
1860
|
+
/**
|
|
1861
|
+
* Defines the variant of code-snippet
|
|
1862
|
+
*/
|
|
1863
|
+
variant: {
|
|
1864
|
+
type: String,
|
|
1865
|
+
default: pe.MULTILINE,
|
|
1866
|
+
validator: (i) => Object.values(pe).includes(i)
|
|
1867
|
+
},
|
|
1868
|
+
/**
|
|
1869
|
+
* Language name for syntax highlighting rules
|
|
1870
|
+
*/
|
|
1871
|
+
lang: {
|
|
1872
|
+
type: String,
|
|
1873
|
+
default: F.JSON,
|
|
1874
|
+
validator: (i) => Object.values(F).includes(i)
|
|
1875
|
+
},
|
|
1876
|
+
/**
|
|
1877
|
+
* Label to show in the action-bar, describing the language
|
|
1878
|
+
*/
|
|
1879
|
+
langLabel: {
|
|
1880
|
+
type: String,
|
|
1881
|
+
default: null
|
|
1882
|
+
},
|
|
1883
|
+
/**
|
|
1884
|
+
* The code content
|
|
1885
|
+
*/
|
|
1886
|
+
content: {
|
|
1887
|
+
type: String,
|
|
1888
|
+
default: ""
|
|
1889
|
+
},
|
|
1890
|
+
/**
|
|
1891
|
+
* Allows editing of the code-snippet content by the user
|
|
1892
|
+
*/
|
|
1893
|
+
editable: {
|
|
1894
|
+
type: Boolean,
|
|
1895
|
+
default: !1
|
|
1896
|
+
},
|
|
1897
|
+
/**
|
|
1898
|
+
* Displays a button that when clicked will emit an action event
|
|
1899
|
+
* Leaves to the parent component the logic of what to do with it
|
|
1900
|
+
*/
|
|
1901
|
+
actionable: {
|
|
1902
|
+
type: Boolean,
|
|
1903
|
+
default: !1
|
|
1904
|
+
},
|
|
1905
|
+
/**
|
|
1906
|
+
* Displays a button that can expand the codeblock into a modal to easily
|
|
1907
|
+
* view large blocks of code.
|
|
1908
|
+
*/
|
|
1909
|
+
expandable: {
|
|
1910
|
+
type: Boolean,
|
|
1911
|
+
default: !1
|
|
1912
|
+
},
|
|
1913
|
+
/**
|
|
1914
|
+
* Displays a button that when clicked will emit a run event
|
|
1915
|
+
* Leaves to the parent component the logic of what to do with it
|
|
1916
|
+
*/
|
|
1917
|
+
actionableText: {
|
|
1918
|
+
type: String,
|
|
1919
|
+
default: "run"
|
|
1920
|
+
},
|
|
1921
|
+
/**
|
|
1922
|
+
* Toggles the loading indicator within the action bar
|
|
1923
|
+
*/
|
|
1924
|
+
loading: {
|
|
1925
|
+
type: Boolean,
|
|
1926
|
+
default: !1
|
|
1927
|
+
}
|
|
1928
|
+
},
|
|
1929
|
+
emits: [se.ACTION, se.CHANGE],
|
|
1930
|
+
setup(i, { emit: e }) {
|
|
1931
|
+
const { t } = it(), n = ae(null), r = [], s = () => {
|
|
1932
|
+
}, l = re(() => i.langLabel ?? i.lang.toUpperCase()), u = re(() => i.variant === pe.INLINE), h = re(() => ({
|
|
1933
|
+
"b-code-snippet--inline": u.value,
|
|
1934
|
+
"b-code-snippet--scrollable": !u.value
|
|
1935
|
+
})), v = re(() => ({
|
|
1936
|
+
"b-code-snippet__code-area-content--editable": i.editable
|
|
1937
|
+
})), C = Et(i.lang), N = Se(), S = Se(), z = new be(), I = new be(), M = new be(), O = ae(null), J = ae(0);
|
|
1938
|
+
Re(async () => {
|
|
1939
|
+
const g = await C();
|
|
1940
|
+
O.value = i.content;
|
|
1941
|
+
const b = ({ state: p }) => {
|
|
1942
|
+
O.value = p.doc.toString();
|
|
1943
|
+
}, f = [
|
|
1944
|
+
Ue(),
|
|
1945
|
+
Ve.of([$e, zt]),
|
|
1946
|
+
z.of(g()),
|
|
1947
|
+
I.of(Bt),
|
|
1948
|
+
M.of(Be.readOnly.of(!i.editable)),
|
|
1949
|
+
Ie.updateListener.of((p) => b(p))
|
|
1950
|
+
];
|
|
1951
|
+
i.variant === "multiline" && f.push([We(), Ke()]);
|
|
1952
|
+
const y = Be.create({
|
|
1953
|
+
doc: i.content,
|
|
1954
|
+
extensions: [...f]
|
|
1955
|
+
});
|
|
1956
|
+
J.value = y.doc.length, S.value = new Ie({
|
|
1957
|
+
state: y,
|
|
1958
|
+
parent: N.value
|
|
1959
|
+
});
|
|
1960
|
+
}), De(
|
|
1961
|
+
() => i.content,
|
|
1962
|
+
() => {
|
|
1963
|
+
if (i.content !== O.value) {
|
|
1964
|
+
const g = i.content.length;
|
|
1965
|
+
S.value.dispatch({
|
|
1966
|
+
changes: {
|
|
1967
|
+
from: 0,
|
|
1968
|
+
to: J.value,
|
|
1969
|
+
insert: i.content
|
|
1970
|
+
}
|
|
1971
|
+
}), J.value = g;
|
|
1972
|
+
}
|
|
1973
|
+
}
|
|
1974
|
+
);
|
|
1975
|
+
const U = re(() => t(i.actionableText)), w = () => {
|
|
1976
|
+
e(se.ACTION, O.value);
|
|
1977
|
+
};
|
|
1978
|
+
Je(() => {
|
|
1979
|
+
O.value !== null && e(se.CHANGE, O.value);
|
|
1980
|
+
});
|
|
1981
|
+
const V = ae(!1);
|
|
1982
|
+
return {
|
|
1983
|
+
// Values
|
|
1984
|
+
availableLanguages: r,
|
|
1985
|
+
codeAreaContentConditionalClasses: v,
|
|
1986
|
+
conditionalClasses: h,
|
|
1987
|
+
container: N,
|
|
1988
|
+
currentContents: O,
|
|
1989
|
+
displayedLang: l,
|
|
1990
|
+
editor: S,
|
|
1991
|
+
selectedLanguage: n,
|
|
1992
|
+
showModal: V,
|
|
1993
|
+
isInlineVariant: u,
|
|
1994
|
+
// Methods
|
|
1995
|
+
handleChangeLanguage: s,
|
|
1996
|
+
onActionClicked: w,
|
|
1997
|
+
runText: U,
|
|
1998
|
+
// Translations
|
|
1999
|
+
t
|
|
2000
|
+
};
|
|
2001
|
+
}
|
|
2002
|
+
});
|
|
2003
|
+
var Pt = function() {
|
|
2004
|
+
var e = this, t = e._self._c;
|
|
2005
|
+
return e._self._setupProxy, t("div", { staticClass: "b-code-snippet", class: e.conditionalClasses }, [e.isInlineVariant ? e._e() : t("section", { staticClass: "b-code-snippet__action-bar" }, [t("div", { staticClass: "b-code-snippet__action-bar--start" }, [e.availableLanguages.length > 0 ? t("bento-dropdown", e._b({ staticClass: "b-code-snippet__language-picker", attrs: { disabled: e.availableLanguages.length === 1, items: e.availableLanguages }, on: { input: e.handleChangeLanguage }, model: { value: e.selectedLanguage, callback: function(n) {
|
|
2006
|
+
e.selectedLanguage = n;
|
|
2007
|
+
}, expression: "selectedLanguage" } }, "bento-dropdown", e.$props, !1)) : e._e(), t("bento-typography", { attrs: { el: "span", stronger: "" } }, [e._v(" " + e._s(e.displayedLang) + " ")])], 1), t("div", { staticClass: "b-code-snippet__action-bar--end" }, [e.loading ? t("bento-loading-indicator") : e._e(), e.currentContents !== null ? t("copy", { staticClass: "b-structured-list__icon", attrs: { text: e.currentContents } }) : e._e(), e.expandable ? t("bento-button", { attrs: { variant: "tertiary", condensed: "", "aria-label": e.t("expand") }, on: { click: function(n) {
|
|
2008
|
+
e.showModal = !0;
|
|
2009
|
+
} }, scopedSlots: e._u([{ key: "iconLeft", fn: function() {
|
|
2010
|
+
return [t("expand-icon")];
|
|
2011
|
+
}, proxy: !0 }], null, !1, 3789760120) }) : e._e(), e.actionable ? t("bento-button", { attrs: { variant: "primary", tertiary: "", condensed: "" }, on: { click: e.onActionClicked }, scopedSlots: e._u([{ key: "iconLeft", fn: function() {
|
|
2012
|
+
return [t("bento-typography", { staticClass: "b-code-snippet__action-button", attrs: { el: "span" } }, [e._v(" " + e._s(e.runText) + " ")])];
|
|
2013
|
+
}, proxy: !0 }], null, !1, 4293069853) }) : e._e()], 1)]), e.content || e.editable ? t("code", { staticClass: "b-code-snippet__code-area" }, [t("div", { ref: "container", staticClass: "b-code-snippet__code-area-content", class: e.codeAreaContentConditionalClasses })]) : t("section", [e._t("empty-state", function() {
|
|
2014
|
+
return [t("div", { staticClass: "b-code-snippet__empty-state" }, [e._v("Nothing to show")])];
|
|
2015
|
+
})], 2), e.expandable ? t("base-modal", { staticClass: "b-code-snippet__modal", attrs: { "hide-close-button": !0, "custom-padding": "0px", "is-dismissible": !0, "is-open": e.showModal, size: "large" }, on: { "close-modal": function(n) {
|
|
2016
|
+
e.showModal = !1;
|
|
2017
|
+
} }, scopedSlots: e._u([{ key: "content", fn: function() {
|
|
2018
|
+
return [t("bento-code-snippet", e._b({}, "bento-code-snippet", { ...e.$props, expandable: !1 }, !1))];
|
|
2019
|
+
}, proxy: !0 }], null, !1, 3343589027) }) : e._e()], 1);
|
|
2020
|
+
}, jt = [], Ht = /* @__PURE__ */ pt(
|
|
2021
|
+
Tt,
|
|
2022
|
+
Pt,
|
|
2023
|
+
jt,
|
|
2024
|
+
!1,
|
|
2025
|
+
null,
|
|
2026
|
+
"befa6cc9",
|
|
2027
|
+
null,
|
|
2028
|
+
null
|
|
2029
|
+
);
|
|
2030
|
+
const on = Ht.exports;
|
|
2
2031
|
export {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2032
|
+
on as BentoCodeSnippet,
|
|
2033
|
+
se as BentoCodeSnippetEvent,
|
|
2034
|
+
F as BentoCodeSnippetSupportedLanguage,
|
|
2035
|
+
pe as BentoCodeSnippetVariant
|
|
7
2036
|
};
|
|
8
2037
|
//# sourceMappingURL=code-snippet.js.map
|