@nldd/design-system 0.20.0 → 0.21.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/custom-elements.json +361 -10
- package/dist/cdn/autoloader.js +181 -0
- package/dist/cdn/chunks/activity-indicator-JglZJ8dh.js +356 -0
- package/dist/cdn/chunks/activity-indicator.i18n-D7mCy6d2.js +3 -0
- package/dist/cdn/chunks/avatar-ASqePVhU.js +308 -0
- package/dist/cdn/chunks/avatar-group-GinEMPm9.js +338 -0
- package/dist/cdn/chunks/avatar-group.i18n-BYw_9wt_.js +7 -0
- package/dist/cdn/chunks/avatar.i18n-CMwQjBkS.js +7 -0
- package/dist/cdn/chunks/badge-Cc2Nufoc.js +323 -0
- package/dist/cdn/chunks/badge.i18n-DqW7hLQj.js +3 -0
- package/dist/cdn/chunks/banner-BLVKM07M.js +325 -0
- package/dist/cdn/chunks/banner.i18n-BOCM9rGN.js +3 -0
- package/dist/cdn/chunks/bar-split-view-Clbg-p9H.js +259 -0
- package/dist/cdn/chunks/base-CfuoYRhN.js +3 -0
- package/dist/cdn/chunks/blockquote-BoOqbGdm.js +189 -0
- package/dist/cdn/chunks/box-WkhyjQVy.js +88 -0
- package/dist/cdn/chunks/breadcrumbs-D9YxZzRj.js +162 -0
- package/dist/cdn/chunks/breadcrumbs.i18n-zmO8jaTO.js +3 -0
- package/dist/cdn/chunks/breakpoints-Cwor8TRP.js +15 -0
- package/dist/cdn/chunks/button-DO90Lo6q.js +863 -0
- package/dist/cdn/chunks/button-bar-Bxgdbyh3.js +225 -0
- package/dist/cdn/chunks/button-group-BYGPPLmZ.js +205 -0
- package/dist/{components/button.i18n-DiDGynnq.js → cdn/chunks/button.i18n-BGFt7Z9u.js} +2 -2
- package/dist/cdn/chunks/card-BP0jfOkS.js +262 -0
- package/dist/cdn/chunks/card.i18n-CpafLm3i.js +8 -0
- package/dist/cdn/chunks/carried-context-DlMSujiJ.js +37 -0
- package/dist/cdn/chunks/cell-BRD2ilQh.js +144 -0
- package/dist/cdn/chunks/checkbox-Cazx8CQn.js +296 -0
- package/dist/cdn/chunks/checkbox-field-DDZ-B6vH.js +157 -0
- package/dist/cdn/chunks/class-map-CXSdNjt8.js +26 -0
- package/dist/cdn/chunks/code-editor-D6Q55oaY.js +286 -0
- package/dist/cdn/chunks/code-viewer-DspLH2T1.js +766 -0
- package/dist/cdn/chunks/code-viewer.i18n-BHfSDRbK.js +13 -0
- package/dist/cdn/chunks/codemirror-input-Db65x22n.js +1232 -0
- package/dist/cdn/chunks/collection-NVtkvDls.js +396 -0
- package/dist/cdn/chunks/collection.i18n-DqWPGnZO.js +8 -0
- package/dist/cdn/chunks/combo-box-OywRKaWj.js +512 -0
- package/dist/cdn/chunks/combo-box.i18n-BorzYnJ2.js +6 -0
- package/dist/cdn/chunks/container-rrbwk0z4.js +602 -0
- package/dist/cdn/chunks/custom-element-BW8Ua4c7.js +7 -0
- package/dist/cdn/chunks/custom-element-q6NzoL5b.js +301 -0
- package/dist/cdn/chunks/custom-font-size-D7KNr84p.js +57 -0
- package/dist/cdn/chunks/date-field-vmZLo80s.js +662 -0
- package/dist/cdn/chunks/date-field.i18n-BTzc0E9a.js +15 -0
- package/dist/cdn/chunks/date-picker-CXDzSBoL.js +993 -0
- package/dist/cdn/chunks/date-picker.i18n-Dsc_M5QK.js +82 -0
- package/dist/cdn/chunks/decorate-TduJMFD_.js +280 -0
- package/dist/cdn/chunks/defer-focus-F73ud2D9.js +9 -0
- package/dist/cdn/chunks/described-by-mixin-daRE7orX.js +32 -0
- package/dist/cdn/chunks/description-cell-CQwOj_rN.js +166 -0
- package/dist/cdn/chunks/dev-checks-zW_W-hnh.js +2695 -0
- package/dist/cdn/chunks/directive-CwRgozUW.js +27 -0
- package/dist/cdn/chunks/dismiss-from-title-bar-C6mP7sWP.js +5 -0
- package/dist/cdn/chunks/dist-3C80SZN9.js +849 -0
- package/dist/cdn/chunks/dist-A7_1pHX0.js +379 -0
- package/dist/cdn/chunks/dist-BEfLdOvy.js +1346 -0
- package/dist/cdn/chunks/dist-BTUxFM2V.js +268 -0
- package/dist/cdn/chunks/dist-CP3G1pSK.js +1037 -0
- package/dist/cdn/chunks/dist-C_dGY6zR.js +468 -0
- package/dist/{components/dist-B9YBOGFW.js → cdn/chunks/dist-ChmCRv39.js} +109 -153
- package/dist/{components/dist-CJm4tkNC.js → cdn/chunks/dist-D2qap2OY.js} +23 -31
- package/dist/cdn/chunks/dist-DPUBF0MZ.js +1593 -0
- package/dist/{components/dist-4g23YHP0.js → cdn/chunks/dist-DrTzvgE7.js} +291 -404
- package/dist/cdn/chunks/dist-EM4MWLQq.js +385 -0
- package/dist/cdn/chunks/dist-EgIBI-FG.js +293 -0
- package/dist/{components/dist-Bf823YyL.js → cdn/chunks/dist-Rm6FvrSR.js} +272 -551
- package/dist/cdn/chunks/divider-CCNbnplA.js +53 -0
- package/dist/cdn/chunks/document-tab-bar-A2DFWrP9.js +973 -0
- package/dist/cdn/chunks/document-tab-bar.i18n-DKrA9TnB.js +9 -0
- package/dist/cdn/chunks/drag-handle-cell-CbzDYebG.js +206 -0
- package/dist/cdn/chunks/drag-handle-cell.i18n-CKUrbm2q.js +3 -0
- package/dist/cdn/chunks/dropdown-DZTZtkm5.js +350 -0
- package/dist/cdn/chunks/element-state-B-44fVqq.js +20 -0
- package/dist/cdn/chunks/file-field-DQ52qq5L.js +1484 -0
- package/dist/cdn/chunks/file-field.i18n-pDM7Utud.js +40 -0
- package/dist/cdn/chunks/floating-ui.dom-B8J1rV2c.js +753 -0
- package/dist/cdn/chunks/focus-target-DSLGcCWq.js +24 -0
- package/dist/cdn/chunks/form-actions-C_7hINq-.js +90 -0
- package/dist/cdn/chunks/form-associated-mixin--GIbl98p.js +62 -0
- package/dist/cdn/chunks/form-field--4nWJ_DK.js +364 -0
- package/dist/cdn/chunks/form-hXLgy_tY.js +84 -0
- package/dist/cdn/chunks/form-section-By-D4un0.js +64 -0
- package/dist/cdn/chunks/full-bleed-section-Dg4sIJG1.js +161 -0
- package/dist/cdn/chunks/gherkin-eseYvsxh.js +29 -0
- package/dist/cdn/chunks/hero-CQQMNCT_.js +761 -0
- package/dist/{components/icon-_Eox7ZfO.js → cdn/chunks/icon-BORlalt0.js} +298 -308
- package/dist/cdn/chunks/icon-button-rKiIHs7A.js +632 -0
- package/dist/{components/icon-button.i18n-1_N-wN6x.js → cdn/chunks/icon-button.i18n-DpZOfIS4.js} +2 -4
- package/dist/cdn/chunks/icon-cell-rk4NQid2.js +156 -0
- package/dist/cdn/chunks/identity-BLXecYsZ.js +187 -0
- package/dist/cdn/chunks/if-defined-CaKKERku.js +4 -0
- package/dist/cdn/chunks/image-DZMW6JgL.js +659 -0
- package/dist/cdn/chunks/image.i18n-ONcm1h7o.js +3 -0
- package/dist/cdn/chunks/implicit-submission-Csbcor_E.js +27 -0
- package/dist/cdn/chunks/inline-dialog-WlqtPBPJ.js +259 -0
- package/dist/cdn/chunks/input-modality-XE0B7yCn.js +42 -0
- package/dist/cdn/chunks/just-in-time-education-DRcb5g7x.js +611 -0
- package/dist/cdn/chunks/just-in-time-education.i18n-CW_dsaxf.js +6 -0
- package/dist/cdn/chunks/kanban-Ca_mfqsA.js +400 -0
- package/dist/cdn/chunks/kanban-column-fgIMc7pw.js +375 -0
- package/dist/cdn/chunks/kanban.i18n-CWqc3e0B.js +11 -0
- package/dist/cdn/chunks/keyboard-shortcut-EknnW7Ub.js +267 -0
- package/dist/cdn/chunks/languages-yKikVFv_.js +8893 -0
- package/dist/cdn/chunks/link-FBSAJ3UC.js +229 -0
- package/dist/cdn/chunks/link-group-90qVfKa0.js +111 -0
- package/dist/cdn/chunks/link-hint-KFhgr5Ng.js +24 -0
- package/dist/cdn/chunks/link-rel-DvrTEfVT.js +8 -0
- package/dist/cdn/chunks/link.i18n-DJPobGmu.js +8 -0
- package/dist/cdn/chunks/list-CaWl3q0Z.js +880 -0
- package/dist/cdn/chunks/list-item-Cagnf6eG.js +802 -0
- package/dist/cdn/chunks/list-item-segment-BRzBF1y_.js +315 -0
- package/dist/cdn/chunks/list-item-segment.i18n-DHnrQL4V.js +8 -0
- package/dist/{components/list-item.i18n-89uqlBMK.js → cdn/chunks/list-item.i18n-Br6J5Ev9.js} +2 -2
- package/dist/cdn/chunks/list-items-Du0RCWsY.js +6 -0
- package/dist/{components/list.i18n-CKqbhFQ_.js → cdn/chunks/list.i18n-C40ltgdI.js} +2 -2
- package/dist/cdn/chunks/loading-tags-DtUr-DR7.js +3 -0
- package/dist/cdn/chunks/menu-BtxzRedh.js +719 -0
- package/dist/cdn/chunks/menu-bar-BU3Hjk1b.js +253 -0
- package/dist/cdn/chunks/menu-bar-item-C7LQ0NI_.js +365 -0
- package/dist/cdn/chunks/menu-bar.i18n-BoMu4Eoz.js +3 -0
- package/dist/cdn/chunks/menu-divider-CLLRgMll.js +15 -0
- package/dist/cdn/chunks/menu-group-BL24ChpR.js +23 -0
- package/dist/cdn/chunks/menu-item-CooKfrFa.js +140 -0
- package/dist/cdn/chunks/menu.i18n-C6uYJsG3.js +10 -0
- package/dist/cdn/chunks/menu.template-C6rbfI-u.js +642 -0
- package/dist/cdn/chunks/modal-dialog-BrUMP4Jm.js +240 -0
- package/dist/cdn/chunks/multi-line-text-field-D7hXhyOn.js +318 -0
- package/dist/cdn/chunks/navigation-split-view-B2ZQhxEb.js +621 -0
- package/dist/cdn/chunks/nl.generated-D6T41jG3.js +112 -0
- package/dist/cdn/chunks/notification-DSGP14d1.js +492 -0
- package/dist/cdn/chunks/notification.i18n-BKUSLN5c.js +6 -0
- package/dist/cdn/chunks/number-field-B8op14Y_.js +301 -0
- package/dist/cdn/chunks/number-field.i18n-BS0bINWY.js +7 -0
- package/dist/cdn/chunks/one-half-one-half-section-ZYmHYf4Q.js +213 -0
- package/dist/cdn/chunks/one-third-two-thirds-section-Ds10K6AS.js +213 -0
- package/dist/cdn/chunks/one-time-code-field-Cgy_tTS4.js +693 -0
- package/dist/cdn/chunks/open-when-rendered-CW_2_WUZ.js +20 -0
- package/dist/cdn/chunks/owned-attribute-x9OCTy_4.js +6 -0
- package/dist/cdn/chunks/owner-form-Cq8tT7ac.js +7 -0
- package/dist/cdn/chunks/page-CBf_Decp.js +431 -0
- package/dist/cdn/chunks/page-footer-CSv1dU7M.js +396 -0
- package/dist/cdn/chunks/page-footer.i18n-pbdr4lN3.js +3 -0
- package/dist/cdn/chunks/page-section-mixin-Dp6X8GKd.js +132 -0
- package/dist/cdn/chunks/pagination-CMUcFB53.js +485 -0
- package/dist/cdn/chunks/pagination.i18n-QQMx14CQ.js +9 -0
- package/dist/cdn/chunks/password-field-C76Vm3rm.js +368 -0
- package/dist/cdn/chunks/password-field.i18n-CzdBn-1b.js +8 -0
- package/dist/cdn/chunks/popover-CGbeEv_-.js +334 -0
- package/dist/cdn/chunks/popover-target-B25dxnmt.js +10 -0
- package/dist/cdn/chunks/popover.i18n-DmFBHUvB.js +3 -0
- package/dist/cdn/chunks/popup-anchor-controller-VZw0bXf2.js +30 -0
- package/dist/cdn/chunks/progress-bar-BLiHaRUS.js +674 -0
- package/dist/cdn/chunks/progress-bar.i18n-Cr5miGTx.js +8 -0
- package/dist/cdn/chunks/progress-circle-CjkovRbL.js +667 -0
- package/dist/cdn/chunks/progress-circle.i18n-CRrXuY4V.js +8 -0
- package/dist/cdn/chunks/query-ChDzi9FQ.js +28 -0
- package/dist/cdn/chunks/radio-button-GHyO-GQB.js +338 -0
- package/dist/cdn/chunks/radio-button-field-C-Z6Lnd4.js +192 -0
- package/dist/cdn/chunks/radio-button-group-ChTqBCnQ.js +118 -0
- package/dist/cdn/chunks/radio-position-CXWYAjaz.js +10 -0
- package/dist/cdn/chunks/reflect-non-default-Bu3rpCvg.js +9 -0
- package/dist/cdn/chunks/render-marked-DX_5ISZE.js +37 -0
- package/dist/cdn/chunks/repeat-Ch_5OsXE.js +76 -0
- package/dist/cdn/chunks/return-focus-BzZWhXhc.js +57 -0
- package/dist/cdn/chunks/rich-text-CQ2uwMSp.js +47 -0
- package/dist/cdn/chunks/rich-text.i18n-BlJ68YuU.js +3 -0
- package/dist/cdn/chunks/row-header-mixin-CgqvREoV.js +16 -0
- package/dist/cdn/chunks/sanitize-url-CBuGmY0W.js +7 -0
- package/dist/cdn/chunks/scroll-mode-controller-COUD1-3P.js +42 -0
- package/dist/cdn/chunks/search-field-BGNfERhn.js +396 -0
- package/dist/cdn/chunks/search-field.i18n-B_Oc7hc-.js +6 -0
- package/dist/cdn/chunks/segmented-control-BYAG4VRp.js +671 -0
- package/dist/cdn/chunks/shadow-resets-6SToDsPu.js +12 -0
- package/dist/cdn/chunks/sheet-CqN7ViYV.js +340 -0
- package/dist/cdn/chunks/shell-C9rds_D9.js +146 -0
- package/dist/cdn/chunks/shell-DmJOYhyF.js +108 -0
- package/dist/cdn/chunks/side-by-side-split-view-C5oX4c6Z.js +166 -0
- package/dist/cdn/chunks/sidebar-section-CFPBdETU.js +353 -0
- package/dist/cdn/chunks/sidebar-section.i18n-BuGfRMpD.js +6 -0
- package/dist/cdn/chunks/simple-section-qrCqXeBa.js +192 -0
- package/dist/cdn/chunks/skip-link-DWh4W6-J.js +161 -0
- package/dist/cdn/chunks/skip-link.i18n--PbEdAmJ.js +3 -0
- package/dist/cdn/chunks/slider--hODfOwh.js +772 -0
- package/dist/cdn/chunks/slider.i18n-DVw0c8AG.js +6 -0
- package/dist/cdn/chunks/slot-content-BLuPqVXw.js +13 -0
- package/dist/cdn/chunks/spacer-CFzq_JCh.js +237 -0
- package/dist/cdn/chunks/spacer-cell-DuVOgIj8.js +68 -0
- package/dist/cdn/chunks/spacing-scale-SufIjHeN.js +28 -0
- package/dist/cdn/chunks/split-button-DH19p8So.js +268 -0
- package/dist/cdn/chunks/split-button.i18n-DtClSMga.js +3 -0
- package/dist/cdn/chunks/split-view-divider-jzcPmnMh.js +100 -0
- package/dist/cdn/chunks/split-view-pane-BLsZz263.js +128 -0
- package/dist/cdn/chunks/stacked-split-view-CcOR8LrJ.js +157 -0
- package/dist/cdn/chunks/static-html-Cf4ccUIg.js +26 -0
- package/dist/cdn/chunks/status-bar-CINbOihq.js +284 -0
- package/dist/cdn/chunks/status-bar-change-CR9l0Gyk.js +3 -0
- package/dist/cdn/chunks/step-bar-6FvZL1Ti.js +474 -0
- package/dist/cdn/chunks/step-bar.i18n-DocExlD7.js +9 -0
- package/dist/cdn/chunks/step-cell-CejRisgS.js +287 -0
- package/dist/cdn/chunks/stepper-CY2rJWOJ.js +223 -0
- package/dist/cdn/chunks/stepper.i18n-COOAkaBl.js +7 -0
- package/dist/cdn/chunks/style-map-DsIw6lkq.js +29 -0
- package/dist/cdn/chunks/style-mod-DGMhzWuk.js +1583 -0
- package/dist/cdn/chunks/swatch-picker-BY3DBIl6.js +430 -0
- package/dist/cdn/chunks/swatch-picker.i18n-_G0nmnGe.js +22 -0
- package/dist/cdn/chunks/switch-DDSsZFwK.js +275 -0
- package/dist/cdn/chunks/switch-field-CMoM9I38.js +137 -0
- package/dist/cdn/chunks/tab-bar-CA8K1XjU.js +697 -0
- package/dist/cdn/chunks/tab-bar.i18n-Crsc7ShA.js +3 -0
- package/dist/cdn/chunks/table-DwXjCSD5.js +308 -0
- package/dist/cdn/chunks/table.i18n-Bmb_uw_w.js +3 -0
- package/dist/cdn/chunks/tag-DM3APy3B.js +306 -0
- package/dist/cdn/chunks/text-B1CatNR1.js +421 -0
- package/dist/cdn/chunks/text-cell-BkEsGI3g.js +299 -0
- package/dist/cdn/chunks/text-editor-BvTiMeNV.js +3743 -0
- package/dist/cdn/chunks/text-editor.i18n-sJKiRQ4i.js +17 -0
- package/dist/cdn/chunks/text-field-CUyh1-V8.js +398 -0
- package/dist/cdn/chunks/time-field--5K0YTcr.js +607 -0
- package/dist/cdn/chunks/time-field.i18n-CLH5vmS7.js +11 -0
- package/dist/cdn/chunks/time-picker-W0xYXLy8.js +508 -0
- package/dist/cdn/chunks/time-picker.i18n-BilOCXlS.js +7 -0
- package/dist/cdn/chunks/title-BuT7tWqN.js +437 -0
- package/dist/cdn/chunks/title-bar-label-controller-DSxdKZOg.js +24 -0
- package/dist/cdn/chunks/title-cell-8d8psUBX.js +327 -0
- package/dist/cdn/chunks/toggle-button-DNXWXZpE.js +528 -0
- package/dist/cdn/chunks/toggle-button-group-ByowJYgs.js +156 -0
- package/dist/cdn/chunks/token-CnkEB3hB.js +266 -0
- package/dist/cdn/chunks/token-field-BpyxOGmU.js +664 -0
- package/dist/cdn/chunks/token-field.i18n-BclzoR8F.js +9 -0
- package/dist/cdn/chunks/token.i18n-RGD5zAtl.js +7 -0
- package/dist/cdn/chunks/toml-w97zZfFO.js +27 -0
- package/dist/cdn/chunks/toolbar-C24LqAzK.js +408 -0
- package/dist/cdn/chunks/toolbar-item-DpPfPxCi.js +50 -0
- package/dist/cdn/chunks/toolbar-title-KBMpfL9d.js +84 -0
- package/dist/cdn/chunks/toolbar.i18n-QwS37CBC.js +8 -0
- package/dist/cdn/chunks/toolbar.styles-BQkG4gVc.js +383 -0
- package/dist/cdn/chunks/tooltip-BsAHJjci.js +325 -0
- package/dist/cdn/chunks/top-navigation-bar-C_kLPVKD.js +925 -0
- package/dist/cdn/chunks/top-navigation-bar.i18n-C-lcH1nB.js +10 -0
- package/dist/cdn/chunks/top-title-bar-iNFB2zQL.js +344 -0
- package/dist/cdn/chunks/translations-wxBSz213.js +8 -0
- package/dist/cdn/chunks/two-thirds-one-third-section-D-UANbHC.js +213 -0
- package/dist/cdn/chunks/validation-list-C5BhHZIG.js +202 -0
- package/dist/cdn/chunks/validation-list.i18n-CM6In8zD.js +12 -0
- package/dist/cdn/chunks/visibility-mixin-COAZ9pON.js +74 -0
- package/dist/cdn/chunks/visually-hidden-BPgATaH0.js +43 -0
- package/dist/cdn/chunks/window-CxV6ELE9.js +227 -0
- package/dist/cdn/chunks/window.i18n-CsEnUPAk.js +3 -0
- package/dist/cdn/chunks/with-translations-XX14GKFh.js +16 -0
- package/dist/components/actions/menu/menu-item.d.ts +6 -2
- package/dist/components/actions/menu/menu-item.d.ts.map +1 -1
- package/dist/components/actions/menu/menu-item.js +12 -1
- package/dist/components/actions/menu/menu-item.js.map +1 -1
- package/dist/components/actions/menu/menu.js +1 -1
- package/dist/components/actions/menu/menu.js.map +1 -1
- package/dist/components/actions/menu/menu.template.d.ts.map +1 -1
- package/dist/components/actions/menu/menu.template.js +2 -1
- package/dist/components/actions/menu/menu.template.js.map +1 -1
- package/dist/components/content/blockquote/blockquote.d.ts +1 -0
- package/dist/components/content/blockquote/blockquote.d.ts.map +1 -1
- package/dist/components/content/blockquote/blockquote.js +1 -0
- package/dist/components/content/blockquote/blockquote.js.map +1 -1
- package/dist/components/content/identity/identity.d.ts +1 -0
- package/dist/components/content/identity/identity.d.ts.map +1 -1
- package/dist/components/content/identity/identity.js +1 -0
- package/dist/components/content/identity/identity.js.map +1 -1
- package/dist/components/content/image/image.d.ts +1 -0
- package/dist/components/content/image/image.d.ts.map +1 -1
- package/dist/components/content/image/image.js +1 -0
- package/dist/components/content/image/image.js.map +1 -1
- package/dist/components/content/rich-text/rich-text.d.ts +1 -0
- package/dist/components/content/rich-text/rich-text.d.ts.map +1 -1
- package/dist/components/content/rich-text/rich-text.js +1 -0
- package/dist/components/content/rich-text/rich-text.js.map +1 -1
- package/dist/components/content/text/text.d.ts +1 -0
- package/dist/components/content/text/text.d.ts.map +1 -1
- package/dist/components/content/text/text.js +1 -0
- package/dist/components/content/text/text.js.map +1 -1
- package/dist/components/content/title/title.d.ts +1 -0
- package/dist/components/content/title/title.d.ts.map +1 -1
- package/dist/components/content/title/title.js +1 -0
- package/dist/components/content/title/title.js.map +1 -1
- package/dist/components/forms/form/form.d.ts.map +1 -1
- package/dist/components/forms/form/form.js +1 -0
- package/dist/components/forms/form/form.js.map +1 -1
- package/dist/components/forms/form-field/form-field.d.ts +1 -0
- package/dist/components/forms/form-field/form-field.d.ts.map +1 -1
- package/dist/components/forms/form-field/form-field.js +1 -0
- package/dist/components/forms/form-field/form-field.js.map +1 -1
- package/dist/components/inputs/date-field/date-field.d.ts +9 -4
- package/dist/components/inputs/date-field/date-field.d.ts.map +1 -1
- package/dist/components/inputs/date-field/date-field.js +20 -7
- package/dist/components/inputs/date-field/date-field.js.map +1 -1
- package/dist/components/inputs/date-field/date-field.template.d.ts.map +1 -1
- package/dist/components/inputs/date-field/date-field.template.js +1 -0
- package/dist/components/inputs/date-field/date-field.template.js.map +1 -1
- package/dist/components/inputs/dropdown/dropdown.d.ts +23 -2
- package/dist/components/inputs/dropdown/dropdown.d.ts.map +1 -1
- package/dist/components/inputs/dropdown/dropdown.js +68 -11
- package/dist/components/inputs/dropdown/dropdown.js.map +1 -1
- package/dist/components/inputs/time-field/time-field.d.ts +4 -0
- package/dist/components/inputs/time-field/time-field.d.ts.map +1 -1
- package/dist/components/inputs/time-field/time-field.js +17 -2
- package/dist/components/inputs/time-field/time-field.js.map +1 -1
- package/dist/components/inputs/time-field/time-field.template.d.ts.map +1 -1
- package/dist/components/inputs/time-field/time-field.template.js +1 -0
- package/dist/components/inputs/time-field/time-field.template.js.map +1 -1
- package/dist/components/layout/container/container.d.ts +15 -2
- package/dist/components/layout/container/container.d.ts.map +1 -1
- package/dist/components/layout/container/container.js +38 -3
- package/dist/components/layout/container/container.js.map +1 -1
- package/dist/components/layout/container/container.styles.js +1 -1
- package/dist/components/layout/container/container.template.js +1 -1
- package/dist/components/layout/container/container.template.js.map +1 -1
- package/dist/components/layout/page-sections/hero/hero.d.ts +1 -0
- package/dist/components/layout/page-sections/hero/hero.d.ts.map +1 -1
- package/dist/components/layout/page-sections/hero/hero.js +1 -0
- package/dist/components/layout/page-sections/hero/hero.js.map +1 -1
- package/dist/components/layout/popover/popover.d.ts.map +1 -1
- package/dist/components/layout/popover/popover.js +4 -2
- package/dist/components/layout/popover/popover.js.map +1 -1
- package/dist/components/lists-and-tables/list-item/list-item.d.ts +7 -0
- package/dist/components/lists-and-tables/list-item/list-item.d.ts.map +1 -1
- package/dist/components/lists-and-tables/list-item/list-item.js +13 -3
- package/dist/components/lists-and-tables/list-item/list-item.js.map +1 -1
- package/dist/components/lists-and-tables/list-item-segment/list-item-segment.d.ts +11 -1
- package/dist/components/lists-and-tables/list-item-segment/list-item-segment.d.ts.map +1 -1
- package/dist/components/lists-and-tables/list-item-segment/list-item-segment.js +19 -3
- package/dist/components/lists-and-tables/list-item-segment/list-item-segment.js.map +1 -1
- package/dist/nldd.min.js +729 -727
- package/dist/types/react.d.ts +3323 -0
- package/dist/types/vue.d.ts +11 -3
- package/dist/utilities/autoloader.d.ts +33 -0
- package/dist/utilities/autoloader.d.ts.map +1 -0
- package/dist/utilities/autoloader.generated.d.ts +3 -0
- package/dist/utilities/autoloader.generated.d.ts.map +1 -0
- package/dist/utilities/autoloader.generated.js +141 -0
- package/dist/utilities/autoloader.generated.js.map +1 -0
- package/dist/utilities/autoloader.js +94 -0
- package/dist/utilities/autoloader.js.map +1 -0
- package/dist/utilities/dev-checks.d.ts +9 -0
- package/dist/utilities/dev-checks.d.ts.map +1 -1
- package/dist/utilities/dev-checks.js +45 -3
- package/dist/utilities/dev-checks.js.map +1 -1
- package/dist/utilities/dev-rules.generated.d.ts.map +1 -1
- package/dist/utilities/dev-rules.generated.js +12 -2
- package/dist/utilities/dev-rules.generated.js.map +1 -1
- package/dist/utilities/loading-tags.d.ts +7 -0
- package/dist/utilities/loading-tags.d.ts.map +1 -0
- package/dist/utilities/loading-tags.js +7 -0
- package/dist/utilities/loading-tags.js.map +1 -0
- package/dist/utilities/owner-form.d.ts +3 -3
- package/dist/utilities/owner-form.d.ts.map +1 -1
- package/dist/utilities/owner-form.js +6 -3
- package/dist/utilities/owner-form.js.map +1 -1
- package/dist/utilities/return-focus.d.ts +14 -0
- package/dist/utilities/return-focus.d.ts.map +1 -1
- package/dist/utilities/return-focus.js +26 -8
- package/dist/utilities/return-focus.js.map +1 -1
- package/lint/data.generated.json +1 -1
- package/lint/engine.js +53 -1
- package/lint/format.js +6 -5
- package/lint/frontends.js +224 -16
- package/lint/linter.js +5 -3
- package/lint/main.js +36 -9
- package/lint/project.js +73 -4
- package/lint/rule-data.js +17 -2
- package/lint/tree.js +3 -0
- package/package.json +50 -11
- package/dist/components/breakpoints-DtL62nLI.js +0 -45
- package/dist/components/components.js +0 -68243
- package/dist/components/decorate-DD7uUxHb.js +0 -51
- package/dist/components/defer-focus-dzorHsCQ.js +0 -176
- package/dist/components/dev-checks-CLB9G43h.js +0 -2711
- package/dist/components/dist-245LaK9m.js +0 -1479
- package/dist/components/dist-BFZM0YsR.js +0 -15772
- package/dist/components/dist-BNkeFjc3.js +0 -1180
- package/dist/components/dist-CSC1dG3L.js +0 -365
- package/dist/components/dist-CeMOOqgP.js +0 -1509
- package/dist/components/dist-DFjwTlJV.js +0 -624
- package/dist/components/dist-DHhnz3Gv.js +0 -381
- package/dist/components/dist-PeUX4vPq.js +0 -2857
- package/dist/components/dist-m70B83qb.js +0 -463
- package/dist/components/element-state-BnarBv0M.js +0 -42
- package/dist/components/gherkin-DzYbEwDO.js +0 -107
- package/dist/components/icon-button-8gvQCwCW.js +0 -2305
- package/dist/components/input-modality-D_CY185R.js +0 -48
- package/dist/components/just-in-time-education.i18n-BqU1ImP4.js +0 -423
- package/dist/components/nl.generated-DzZkOgnP.js +0 -64
- package/dist/components/rolldown-runtime-D8jQpDG7.js +0 -12
- package/dist/components/shadow-resets-BwOyyZFH.js +0 -60
- package/dist/components/shell-Dh5IwHd-.js +0 -222
- package/dist/components/toml-D0Pix_8Q.js +0 -58
- package/dist/components/visibility-mixin-Dzn48SL8.js +0 -153
|
@@ -0,0 +1,766 @@
|
|
|
1
|
+
import { $ as e, A as t, B as n, O as r, P as i, Z as a, i as o, j as s, r as c, rt as l, t as u, z as d } from "./languages-yKikVFv_.js";
|
|
2
|
+
import { i as f, n as p, t as m } from "./custom-element-q6NzoL5b.js";
|
|
3
|
+
import { o as h, r as g, t as _ } from "./decorate-TduJMFD_.js";
|
|
4
|
+
import { t as v } from "./custom-element-BW8Ua4c7.js";
|
|
5
|
+
import { t as y } from "./reflect-non-default-Bu3rpCvg.js";
|
|
6
|
+
import { r as b } from "./element-state-B-44fVqq.js";
|
|
7
|
+
import { t as x } from "./shadow-resets-6SToDsPu.js";
|
|
8
|
+
import { t as S } from "./translations-wxBSz213.js";
|
|
9
|
+
import { t as C } from "./defer-focus-F73ud2D9.js";
|
|
10
|
+
import "./icon-button-rKiIHs7A.js";
|
|
11
|
+
import "./tooltip-BsAHJjci.js";
|
|
12
|
+
import { t as w } from "./code-viewer.i18n-BHfSDRbK.js";
|
|
13
|
+
// src/components/content/code-viewer/code-viewer.styles.ts
|
|
14
|
+
var T = f`
|
|
15
|
+
:host {
|
|
16
|
+
box-sizing: border-box;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
/* # Host */
|
|
21
|
+
|
|
22
|
+
:host {
|
|
23
|
+
--_code-viewer-corner-radius: var(--semantics-surfaces-corner-radius);
|
|
24
|
+
--_code-viewer-background-color: var(--semantics-surfaces-tinted-background-color);
|
|
25
|
+
--_code-viewer-highlight-border-width: var(--semantics-surfaces-highlight-border-width);
|
|
26
|
+
--_code-viewer-highlight-border-color: var(--semantics-surfaces-tinted-highlight-border-color);
|
|
27
|
+
--_code-viewer-highlight-border-shadow: inset 0 0 0 var(--_code-viewer-highlight-border-width) var(--_code-viewer-highlight-border-color);
|
|
28
|
+
--_code-viewer-block-padding: var(--primitives-space-16);
|
|
29
|
+
--_code-viewer-inline-padding: var(--primitives-space-16);
|
|
30
|
+
--_code-viewer-content-color: var(--semantics-content-color);
|
|
31
|
+
--_code-viewer-font: var(--primitives-font-monospace-sm-regular-snug);
|
|
32
|
+
--_code-viewer-actions-button-size: var(--semantics-controls-sm-min-size);
|
|
33
|
+
/* Centers the copy button on the first line: one line of code is then
|
|
34
|
+
as high as the box needs anyway, with the button in the middle. */
|
|
35
|
+
--_code-viewer-actions-area-padding: calc((var(--_code-viewer-block-padding) * 2 + 1lh - var(--_code-viewer-actions-button-size)) / 2);
|
|
36
|
+
--_code-viewer-actions-gap: var(--primitives-space-8);
|
|
37
|
+
--_code-viewer-actions-area-size: calc(var(--_code-viewer-actions-button-size) + var(--_code-viewer-actions-area-padding) * 2);
|
|
38
|
+
--_code-viewer-actions-z-index: 1;
|
|
39
|
+
--_code-viewer-highlight-border-z-index: 1;
|
|
40
|
+
--_code-viewer-max-height: none;
|
|
41
|
+
--_code-viewer-diff-added-background-color: light-dark(var(--primitives-color-success-100), var(--primitives-color-success-200));
|
|
42
|
+
--_code-viewer-diff-added-word-background-color: light-dark(var(--primitives-color-success-250), var(--primitives-color-success-450));
|
|
43
|
+
--_code-viewer-diff-added-word-content-color: light-dark(var(--primitives-color-success-1000), var(--primitives-color-success-975));
|
|
44
|
+
--_code-viewer-diff-added-sign-color: light-dark(var(--primitives-color-success-750), var(--primitives-color-success-800));
|
|
45
|
+
--_code-viewer-diff-removed-background-color: light-dark(var(--primitives-color-critical-100), var(--primitives-color-critical-200));
|
|
46
|
+
--_code-viewer-diff-removed-word-background-color: light-dark(var(--primitives-color-critical-250), var(--primitives-color-critical-450));
|
|
47
|
+
--_code-viewer-diff-removed-word-content-color: light-dark(var(--primitives-color-critical-1000), var(--primitives-color-critical-975));
|
|
48
|
+
--_code-viewer-diff-removed-sign-color: light-dark(var(--primitives-color-critical-750), var(--primitives-color-critical-800));
|
|
49
|
+
--_code-viewer-diff-gutter-color: var(--semantics-content-secondary-color);
|
|
50
|
+
--_code-viewer-diff-row-content-color: light-dark(var(--primitives-color-neutral-950), var(--primitives-color-neutral-975));
|
|
51
|
+
--_code-viewer-diff-row-number-color: light-dark(var(--primitives-color-neutral-750), var(--primitives-color-neutral-850));
|
|
52
|
+
--_code-viewer-diff-gutter-inline-padding: var(--primitives-space-8);
|
|
53
|
+
--_code-viewer-gutter-border-width: var(--semantics-dividers-thickness);
|
|
54
|
+
--_code-viewer-gutter-border-color: var(--semantics-dividers-color);
|
|
55
|
+
|
|
56
|
+
${x}
|
|
57
|
+
display: flex;
|
|
58
|
+
max-width: 100%;
|
|
59
|
+
position: relative;
|
|
60
|
+
/* Own stacking context so the absolutely-positioned actions button
|
|
61
|
+
(z-index: var(--_code-viewer-actions-z-index)) stays scoped to the code-viewer
|
|
62
|
+
and can't paint over other layers on the page. */
|
|
63
|
+
isolation: isolate;
|
|
64
|
+
/* iOS Safari inflates text in wide scrollable blocks (text autosizing);
|
|
65
|
+
lock the size so code renders at the authored font-size on mobile. */
|
|
66
|
+
-webkit-text-size-adjust: 100%;
|
|
67
|
+
text-size-adjust: 100%;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
:host([hidden]) {
|
|
71
|
+
display: none;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
:host([appearance="box-base"]) {
|
|
75
|
+
--_code-viewer-background-color: var(--semantics-surfaces-base-background-color);
|
|
76
|
+
--_code-viewer-highlight-border-color: var(--semantics-surfaces-base-highlight-border-color);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
:host([appearance="simple"]) {
|
|
80
|
+
--_code-viewer-corner-radius: 0;
|
|
81
|
+
--_code-viewer-background-color: transparent;
|
|
82
|
+
--_code-viewer-highlight-border-color: transparent;
|
|
83
|
+
--_code-viewer-block-padding: 0;
|
|
84
|
+
--_code-viewer-inline-padding: 0;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
/* # Block — the frame; CodeMirror (read-only) mounts into __codemirror */
|
|
89
|
+
|
|
90
|
+
.code-viewer {
|
|
91
|
+
box-sizing: border-box;
|
|
92
|
+
position: relative;
|
|
93
|
+
border-radius: var(--_code-viewer-corner-radius);
|
|
94
|
+
background-color: var(--_code-viewer-background-color);
|
|
95
|
+
min-width: 0;
|
|
96
|
+
overflow: hidden;
|
|
97
|
+
flex-grow: 1;
|
|
98
|
+
flex-shrink: 1;
|
|
99
|
+
flex-basis: auto;
|
|
100
|
+
color: var(--_code-viewer-content-color);
|
|
101
|
+
font: var(--_code-viewer-font);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/* The border ring lies over the content, so the sticky gutters and the
|
|
105
|
+
colored diff rows cannot cover it. Inset, it takes no layout space. */
|
|
106
|
+
.code-viewer::after {
|
|
107
|
+
content: '';
|
|
108
|
+
position: absolute;
|
|
109
|
+
inset: 0;
|
|
110
|
+
z-index: var(--_code-viewer-highlight-border-z-index);
|
|
111
|
+
border-radius: inherit;
|
|
112
|
+
box-shadow: var(--_code-viewer-highlight-border-shadow);
|
|
113
|
+
pointer-events: none;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.code-viewer .cm-editor {
|
|
117
|
+
isolation: isolate;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/* The scroller spans the whole box, so the padding sits on the content
|
|
121
|
+
inside it. Three classes deep to beat CodeMirror's own theme. */
|
|
122
|
+
.code-viewer .cm-scroller .cm-content {
|
|
123
|
+
padding: var(--_code-viewer-block-padding) var(--_code-viewer-inline-padding);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
:host(:not([no-copy]):not([copy-unavailable])) .code-viewer {
|
|
127
|
+
min-height: var(--_code-viewer-actions-area-size);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
:host(:not([no-copy]):not([copy-unavailable])) .code-viewer .cm-scroller .cm-content {
|
|
131
|
+
padding-right: var(--_code-viewer-actions-area-size);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
:host([appearance="simple"]:not([no-copy]):not([copy-unavailable])) {
|
|
135
|
+
--_code-viewer-actions-area-padding: var(--primitives-space-0);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
:host([appearance="simple"]:not([no-copy]):not([copy-unavailable])) .code-viewer .cm-scroller .cm-content {
|
|
139
|
+
padding-right: calc(var(--_code-viewer-actions-area-size) + var(--_code-viewer-actions-gap));
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
/* The horizontally-scrollable region is CodeMirror's scroller; it gets
|
|
143
|
+
tabindex/role/aria-label from JS when content overflows. Lift the focus
|
|
144
|
+
ring onto the framed block so it reads as one element. */
|
|
145
|
+
.code-viewer:has(.cm-scroller:focus-visible) {
|
|
146
|
+
outline: var(--semantics-focus-ring-outline);
|
|
147
|
+
outline-offset: var(--semantics-focus-ring-outline-offset);
|
|
148
|
+
box-shadow: var(--semantics-focus-ring-box-shadow);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
:host([max-height]) .code-viewer {
|
|
152
|
+
display: flex;
|
|
153
|
+
max-height: var(--_code-viewer-max-height);
|
|
154
|
+
flex-direction: column;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
:host([max-height]) .code-viewer__codemirror {
|
|
158
|
+
display: flex;
|
|
159
|
+
min-height: 0;
|
|
160
|
+
flex-direction: column;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
:host([max-height]) .cm-editor {
|
|
164
|
+
min-height: 0;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
.cm-content {
|
|
168
|
+
tab-size: 2;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
/* # Diff */
|
|
172
|
+
|
|
173
|
+
:host([diff]) .code-viewer .cm-scroller .cm-content {
|
|
174
|
+
padding-inline: 0;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
:host([diff]) .cm-line {
|
|
178
|
+
padding-inline: var(--_code-viewer-diff-gutter-inline-padding) var(--_code-viewer-inline-padding);
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
:host([diff]:not([no-copy]):not([copy-unavailable])) .code-viewer .cm-scroller .cm-content {
|
|
182
|
+
padding-right: 0;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
:host([diff]:not([no-copy]):not([copy-unavailable])) .cm-line {
|
|
186
|
+
padding-right: var(--_code-viewer-actions-area-size);
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
/* The gutters stay put while the code scrolls sideways under them. The
|
|
190
|
+
divider is a gradient: an inset shadow with an offset leaves a hairline on iOS. */
|
|
191
|
+
:host .cm-gutters.cm-gutters {
|
|
192
|
+
background-color: var(--_code-viewer-background-color);
|
|
193
|
+
background-image: linear-gradient(var(--_code-viewer-gutter-border-color), var(--_code-viewer-gutter-border-color));
|
|
194
|
+
background-repeat: no-repeat;
|
|
195
|
+
background-position: right;
|
|
196
|
+
background-size: var(--_code-viewer-gutter-border-width) 100%;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
:host([diff]) .cm-gutters {
|
|
200
|
+
color: var(--_code-viewer-diff-gutter-color);
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
:host([diff]) .cm-diff-gutter .cm-gutterElement {
|
|
204
|
+
padding-inline: var(--_code-viewer-diff-gutter-inline-padding) 0;
|
|
205
|
+
text-align: right;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
:host([diff]) .cm-diff-old-gutter .cm-gutterElement {
|
|
209
|
+
padding-inline-start: var(--_code-viewer-inline-padding);
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
:host([diff]) .cm-diff-sign-gutter .cm-gutterElement {
|
|
213
|
+
padding-inline: var(--_code-viewer-diff-gutter-inline-padding);
|
|
214
|
+
text-align: center;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
/* A diff row is three steps from the tinted surface (25 to 100, 75 to 200), so
|
|
218
|
+
its text takes three steps more as well. Only on the row. */
|
|
219
|
+
:host([diff]) .cm-line:is(.cm-diff-added, .cm-diff-removed) {
|
|
220
|
+
color: var(--_code-viewer-diff-row-content-color);
|
|
221
|
+
--semantics-code-syntax-comment-color: light-dark(var(--primitives-color-neutral-750), var(--primitives-color-neutral-850));
|
|
222
|
+
--semantics-code-syntax-punctuation-color: light-dark(var(--primitives-color-neutral-950), var(--primitives-color-neutral-975));
|
|
223
|
+
--semantics-code-syntax-keyword-color: var(--primitives-color-donkergeel-800);
|
|
224
|
+
--semantics-code-syntax-string-color: var(--primitives-color-groen-800);
|
|
225
|
+
--semantics-code-syntax-number-color: var(--primitives-color-oranje-800);
|
|
226
|
+
--semantics-code-syntax-boolean-color: var(--primitives-color-oranje-800);
|
|
227
|
+
--semantics-code-syntax-null-color: var(--primitives-color-oranje-800);
|
|
228
|
+
--semantics-code-syntax-function-color: var(--primitives-color-lintblauw-800);
|
|
229
|
+
--semantics-code-syntax-class-color: var(--primitives-color-donkergeel-800);
|
|
230
|
+
--semantics-code-syntax-property-color: var(--primitives-color-lintblauw-800);
|
|
231
|
+
--semantics-code-syntax-operator-color: var(--primitives-color-groen-800);
|
|
232
|
+
--semantics-code-syntax-tag-color: var(--primitives-color-groen-800);
|
|
233
|
+
--semantics-code-syntax-attr-value-color: var(--primitives-color-mintgroen-800);
|
|
234
|
+
--semantics-code-syntax-variable-color: var(--primitives-color-lintblauw-800);
|
|
235
|
+
--semantics-code-syntax-constant-color: var(--primitives-color-oranje-800);
|
|
236
|
+
--semantics-code-syntax-regex-color: var(--primitives-color-rood-800);
|
|
237
|
+
--semantics-code-syntax-url-color: var(--primitives-color-mintgroen-800);
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
.cm-diff-added {
|
|
241
|
+
background-color: var(--_code-viewer-diff-added-background-color);
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
.cm-diff-removed {
|
|
245
|
+
background-color: var(--_code-viewer-diff-removed-background-color);
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
:is(.cm-diff-old-gutter, .cm-diff-new-gutter) .cm-gutterElement:is(.cm-diff-added, .cm-diff-removed) {
|
|
249
|
+
color: var(--_code-viewer-diff-row-number-color);
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
.cm-diff-sign-gutter :is(.cm-diff-added, .cm-diff-removed) {
|
|
253
|
+
background-repeat: no-repeat;
|
|
254
|
+
background-position: right;
|
|
255
|
+
background-size: var(--_code-viewer-gutter-border-width) 100%;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
.cm-diff-sign-gutter .cm-diff-added {
|
|
259
|
+
background-image: linear-gradient(var(--_code-viewer-diff-added-word-background-color), var(--_code-viewer-diff-added-word-background-color));
|
|
260
|
+
color: var(--_code-viewer-diff-added-sign-color);
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
.cm-diff-sign-gutter .cm-diff-removed {
|
|
264
|
+
background-image: linear-gradient(var(--_code-viewer-diff-removed-word-background-color), var(--_code-viewer-diff-removed-word-background-color));
|
|
265
|
+
color: var(--_code-viewer-diff-removed-sign-color);
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
.cm-diff-added-word {
|
|
269
|
+
border-radius: var(--primitives-corner-radius-xs);
|
|
270
|
+
background-color: var(--_code-viewer-diff-added-word-background-color);
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
.cm-diff-added-word,
|
|
274
|
+
.cm-diff-added-word * {
|
|
275
|
+
color: var(--_code-viewer-diff-added-word-content-color);
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
.cm-diff-removed-word {
|
|
279
|
+
border-radius: var(--primitives-corner-radius-xs);
|
|
280
|
+
background-color: var(--_code-viewer-diff-removed-word-background-color);
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
.cm-diff-removed-word,
|
|
284
|
+
.cm-diff-removed-word * {
|
|
285
|
+
color: var(--_code-viewer-diff-removed-word-content-color);
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
.cm-diff-hunk {
|
|
289
|
+
padding-inline: var(--_code-viewer-diff-gutter-inline-padding) var(--_code-viewer-inline-padding);
|
|
290
|
+
color: var(--_code-viewer-diff-gutter-color);
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
.cm-diff-line-label,
|
|
294
|
+
.code-viewer__diff-summary {
|
|
295
|
+
position: absolute;
|
|
296
|
+
width: 1px;
|
|
297
|
+
height: 1px;
|
|
298
|
+
overflow: hidden;
|
|
299
|
+
clip-path: inset(50%);
|
|
300
|
+
white-space: nowrap;
|
|
301
|
+
-webkit-user-select: none;
|
|
302
|
+
user-select: none;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
/* The slot is the declarative content + copy source only; CodeMirror
|
|
306
|
+
renders the visible, highlighted copy. */
|
|
307
|
+
slot {
|
|
308
|
+
display: none;
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
|
|
312
|
+
/* # Elements */
|
|
313
|
+
|
|
314
|
+
.code-viewer__actions {
|
|
315
|
+
position: absolute;
|
|
316
|
+
top: var(--_code-viewer-actions-area-padding);
|
|
317
|
+
right: var(--_code-viewer-actions-area-padding);
|
|
318
|
+
z-index: var(--_code-viewer-actions-z-index);
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
.code-viewer__live-region {
|
|
322
|
+
position: absolute;
|
|
323
|
+
width: 1px;
|
|
324
|
+
height: 1px;
|
|
325
|
+
overflow: hidden;
|
|
326
|
+
clip-path: inset(50%);
|
|
327
|
+
white-space: nowrap;
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
|
|
331
|
+
/* # High Contrast
|
|
332
|
+
forced-colors strips box-shadow, so the inset
|
|
333
|
+
border ring would disappear. Restore the frame with a real border —
|
|
334
|
+
same fallback nldd-box, nldd-banner, and nldd-list use. */
|
|
335
|
+
|
|
336
|
+
@media (forced-colors: active) {
|
|
337
|
+
:host .code-viewer {
|
|
338
|
+
border: var(--_code-viewer-highlight-border-width) solid CanvasText;
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
:host([appearance="simple"]) .code-viewer {
|
|
342
|
+
border: none;
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
`;
|
|
346
|
+
// src/components/content/code-viewer/code-viewer.template.ts
|
|
347
|
+
function E(e) {
|
|
348
|
+
let t = e._copyState, n = t === "success" ? e._t("components.code-viewer.copy-success-text") : t === "failure" ? e._t("components.code-viewer.copy-failure-text") : e._t("components.code-viewer.copy-action"), r = n, i = t === "success" ? e._t("components.code-viewer.copy-success-text") : t === "failure" ? e._t("components.code-viewer.copy-failure-text") : "", a = e._diffSummary;
|
|
349
|
+
return h`<div class="code-viewer">${a ? h`<div class="code-viewer__diff-summary">${a}</div>` : g}<div class="code-viewer__codemirror"></div><slot @slotchange=${e._onSlotChange}></slot>${e._canCopy ? h`
|
|
350
|
+
<div class="code-viewer__actions">
|
|
351
|
+
<div class="code-viewer__copy-button">
|
|
352
|
+
<nldd-tooltip
|
|
353
|
+
text=${n}
|
|
354
|
+
placement="left"
|
|
355
|
+
?open=${t !== "idle"}
|
|
356
|
+
@nldd-tooltip-dismiss=${e._onCopyDismiss}
|
|
357
|
+
>
|
|
358
|
+
<nldd-icon-button
|
|
359
|
+
icon=${t === "success" ? "check-mark" : "copy"}
|
|
360
|
+
accessible-label=${r}
|
|
361
|
+
tooltip-timing="never"
|
|
362
|
+
size="sm"
|
|
363
|
+
@click=${e._onCopyClick}
|
|
364
|
+
@focusout=${e._onCopyBlur}
|
|
365
|
+
></nldd-icon-button>
|
|
366
|
+
</nldd-tooltip>
|
|
367
|
+
</div>
|
|
368
|
+
<div class="code-viewer__live-region"
|
|
369
|
+
role="status"
|
|
370
|
+
aria-live="polite"
|
|
371
|
+
>${i}</div>
|
|
372
|
+
</div>
|
|
373
|
+
` : g}</div>`;
|
|
374
|
+
}
|
|
375
|
+
// src/components/content/code-viewer/code-viewer.diff.ts
|
|
376
|
+
var D = /^@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/, O = /^(diff |index |--- |\+\+\+ |new file|deleted file|similarity |rename |old mode|new mode)/;
|
|
377
|
+
function k(e) {
|
|
378
|
+
let t = 0;
|
|
379
|
+
for (; t < e.length && O.test(e[t]);) t++;
|
|
380
|
+
let n = e.slice(0, t);
|
|
381
|
+
return n.some((e, t) => e.startsWith("--- ") && n[t + 1]?.startsWith("+++ ")) ? e.slice(t) : e;
|
|
382
|
+
}
|
|
383
|
+
function A(e) {
|
|
384
|
+
let t = e.replace(/\r\n?/g, "\n").replace(/\n$/, "").split("\n"), n = t.some((e) => D.test(e)), r = n ? t : k(t), i = [], a = 1, o = 1, s = n ? 0 : Infinity, c = n ? 0 : Infinity, l = null, u = 0, d = 0, f = !1, p = 0;
|
|
385
|
+
for (let e of r) {
|
|
386
|
+
let t = D.exec(e);
|
|
387
|
+
if (t) {
|
|
388
|
+
a = Number(t[1]), s = t[2] === void 0 ? 1 : Number(t[2]), o = Number(t[3]), c = t[4] === void 0 ? 1 : Number(t[4]), l = e, f = !0;
|
|
389
|
+
continue;
|
|
390
|
+
}
|
|
391
|
+
if (s <= 0 && c <= 0) {
|
|
392
|
+
f && e !== "" && !e.startsWith("\\") && !O.test(e) && p++;
|
|
393
|
+
continue;
|
|
394
|
+
}
|
|
395
|
+
if (e.startsWith("\\")) continue;
|
|
396
|
+
let n = e[0], r = e.slice(1);
|
|
397
|
+
n === "+" ? (i.push({
|
|
398
|
+
kind: "added",
|
|
399
|
+
text: r,
|
|
400
|
+
oldNumber: null,
|
|
401
|
+
newNumber: o++,
|
|
402
|
+
hunk: l
|
|
403
|
+
}), c--, u++) : n === "-" ? (i.push({
|
|
404
|
+
kind: "removed",
|
|
405
|
+
text: r,
|
|
406
|
+
oldNumber: a++,
|
|
407
|
+
newNumber: null,
|
|
408
|
+
hunk: l
|
|
409
|
+
}), s--, d++) : (i.push({
|
|
410
|
+
kind: "context",
|
|
411
|
+
text: r,
|
|
412
|
+
oldNumber: a++,
|
|
413
|
+
newNumber: o++,
|
|
414
|
+
hunk: l
|
|
415
|
+
}), s--, c--), l = null;
|
|
416
|
+
}
|
|
417
|
+
return {
|
|
418
|
+
doc: i.map((e) => e.text).join("\n"),
|
|
419
|
+
lines: i,
|
|
420
|
+
added: u,
|
|
421
|
+
removed: d,
|
|
422
|
+
dropped: p
|
|
423
|
+
};
|
|
424
|
+
}
|
|
425
|
+
function j(e) {
|
|
426
|
+
let t = [], n = 0;
|
|
427
|
+
for (; n < e.length;) {
|
|
428
|
+
if (e[n].kind !== "removed") {
|
|
429
|
+
n++;
|
|
430
|
+
continue;
|
|
431
|
+
}
|
|
432
|
+
let r = n;
|
|
433
|
+
for (; n < e.length && e[n].kind === "removed" && (n === r || !e[n].hunk);) n++;
|
|
434
|
+
let i = n;
|
|
435
|
+
for (; n < e.length && e[n].kind === "added" && !e[n].hunk;) n++;
|
|
436
|
+
for (let e = 0; e < Math.min(i - r, n - i); e++) t.push([r + e, i + e]);
|
|
437
|
+
}
|
|
438
|
+
return t;
|
|
439
|
+
}
|
|
440
|
+
var M = class extends s {
|
|
441
|
+
constructor(e) {
|
|
442
|
+
super(), this.text = e;
|
|
443
|
+
}
|
|
444
|
+
eq(e) {
|
|
445
|
+
return e.text === this.text;
|
|
446
|
+
}
|
|
447
|
+
toDOM() {
|
|
448
|
+
return document.createTextNode(this.text);
|
|
449
|
+
}
|
|
450
|
+
}, N = class extends s {
|
|
451
|
+
constructor(e) {
|
|
452
|
+
super(), this.className = e, this.elementClass = e;
|
|
453
|
+
}
|
|
454
|
+
eq(e) {
|
|
455
|
+
return e.className === this.className;
|
|
456
|
+
}
|
|
457
|
+
}, P = class extends i {
|
|
458
|
+
constructor(e) {
|
|
459
|
+
super(), this.text = e;
|
|
460
|
+
}
|
|
461
|
+
eq(e) {
|
|
462
|
+
return e.text === this.text;
|
|
463
|
+
}
|
|
464
|
+
toDOM() {
|
|
465
|
+
let e = document.createElement("span");
|
|
466
|
+
return e.className = "cm-diff-line-label", e.textContent = `${this.text}: `, e;
|
|
467
|
+
}
|
|
468
|
+
}, F = class extends i {
|
|
469
|
+
constructor(e) {
|
|
470
|
+
super(), this.header = e;
|
|
471
|
+
}
|
|
472
|
+
eq(e) {
|
|
473
|
+
return e.header === this.header;
|
|
474
|
+
}
|
|
475
|
+
toDOM() {
|
|
476
|
+
let e = document.createElement("div");
|
|
477
|
+
return e.className = "cm-diff-hunk", e.setAttribute("aria-hidden", "true"), e.textContent = this.header, e;
|
|
478
|
+
}
|
|
479
|
+
}, I = {
|
|
480
|
+
added: "cm-diff-added",
|
|
481
|
+
removed: "cm-diff-removed",
|
|
482
|
+
context: "cm-diff-context"
|
|
483
|
+
}, L = {
|
|
484
|
+
added: "+",
|
|
485
|
+
removed: "−",
|
|
486
|
+
context: ""
|
|
487
|
+
};
|
|
488
|
+
function R(e) {
|
|
489
|
+
let t = [], n = 0;
|
|
490
|
+
for (let r of e) t.push(n), n += r.text.length + 1;
|
|
491
|
+
return t;
|
|
492
|
+
}
|
|
493
|
+
function z(e, i) {
|
|
494
|
+
let { lines: a } = e;
|
|
495
|
+
if (a.length === 0) return [];
|
|
496
|
+
let o = R(a), s = [], c = [];
|
|
497
|
+
a.forEach((e, t) => {
|
|
498
|
+
let n = o[t];
|
|
499
|
+
e.hunk && s.push(r.widget({
|
|
500
|
+
widget: new F(e.hunk),
|
|
501
|
+
block: !0,
|
|
502
|
+
side: -1
|
|
503
|
+
}).range(n)), s.push(r.line({ class: I[e.kind] }).range(n)), e.kind === "added" && s.push(r.widget({
|
|
504
|
+
widget: new P(i.addedLine(e.newNumber)),
|
|
505
|
+
side: -1
|
|
506
|
+
}).range(n)), e.kind === "removed" && s.push(r.widget({
|
|
507
|
+
widget: new P(i.removedLine(e.oldNumber)),
|
|
508
|
+
side: -1
|
|
509
|
+
}).range(n)), c.push(new N(I[e.kind]).range(n));
|
|
510
|
+
});
|
|
511
|
+
let u = (e, t) => a[e.state.doc.lineAt(t.from).number - 1], f = (e) => String(a.reduce((t, n) => Math.max(t, e(n) ?? 0), 0)), p = (e, t) => d({
|
|
512
|
+
class: `cm-diff-gutter cm-diff-${e}-gutter`,
|
|
513
|
+
lineMarker: (e, n) => {
|
|
514
|
+
let r = u(e, n), i = r ? t(r) : null;
|
|
515
|
+
return i === null ? null : new M(String(i));
|
|
516
|
+
},
|
|
517
|
+
initialSpacer: () => new M(f(t))
|
|
518
|
+
});
|
|
519
|
+
return [
|
|
520
|
+
t.decorations.of(r.set(s, !0)),
|
|
521
|
+
n.of(l.of(c, !0)),
|
|
522
|
+
p("old", (e) => e.oldNumber),
|
|
523
|
+
p("new", (e) => e.newNumber),
|
|
524
|
+
d({
|
|
525
|
+
class: "cm-diff-gutter cm-diff-sign-gutter",
|
|
526
|
+
lineMarker: (e, t) => {
|
|
527
|
+
let n = u(e, t);
|
|
528
|
+
return n && n.kind !== "context" ? new M(L[n.kind]) : null;
|
|
529
|
+
},
|
|
530
|
+
initialSpacer: () => new M("+")
|
|
531
|
+
})
|
|
532
|
+
];
|
|
533
|
+
}
|
|
534
|
+
var B = .5, V = r.mark({ class: "cm-diff-removed-word" }), H = r.mark({ class: "cm-diff-added-word" });
|
|
535
|
+
async function U(e) {
|
|
536
|
+
let n = j(e.lines);
|
|
537
|
+
if (n.length === 0) return [];
|
|
538
|
+
let { presentableDiff: i } = await import("./dist-BTUxFM2V.js"), a = R(e.lines), o = [];
|
|
539
|
+
for (let [t, r] of n) {
|
|
540
|
+
let n = e.lines[t].text, s = e.lines[r].text, c = i(n, s);
|
|
541
|
+
if (c.length !== 0 && !(c.reduce((e, t) => e + t.toA - t.fromA, 0) + c.reduce((e, t) => e + t.toB - t.fromB, 0) > (n.length + s.length) * B)) for (let e of c) e.toA > e.fromA && o.push(V.range(a[t] + e.fromA, a[t] + e.toA)), e.toB > e.fromB && o.push(H.range(a[r] + e.fromB, a[r] + e.toB));
|
|
542
|
+
}
|
|
543
|
+
return o.length ? t.decorations.of(r.set(o, !0)) : [];
|
|
544
|
+
}
|
|
545
|
+
// src/utilities/color-scheme-repaint.ts
|
|
546
|
+
var W = /* @__PURE__ */ new Set(), G = null;
|
|
547
|
+
function K() {
|
|
548
|
+
G || (G = new MutationObserver((e) => {
|
|
549
|
+
for (let t of e) if (t.attributeName === "data-scheme") {
|
|
550
|
+
for (let e of W) e();
|
|
551
|
+
return;
|
|
552
|
+
}
|
|
553
|
+
}), G.observe(document.documentElement, {
|
|
554
|
+
attributes: !0,
|
|
555
|
+
attributeFilter: ["data-scheme"]
|
|
556
|
+
}));
|
|
557
|
+
}
|
|
558
|
+
function q(e) {
|
|
559
|
+
return K(), W.add(e), () => {
|
|
560
|
+
W.delete(e), W.size === 0 && (G?.disconnect(), G = null);
|
|
561
|
+
};
|
|
562
|
+
}
|
|
563
|
+
function J(e) {
|
|
564
|
+
let t = e.scrollLeft, n = e.scrollTop, r = e.style.display;
|
|
565
|
+
e.style.display = "none", e.offsetHeight, e.style.display = r, e.scrollLeft = t, e.scrollTop = n;
|
|
566
|
+
}
|
|
567
|
+
// src/components/content/code-viewer/code-viewer.ts
|
|
568
|
+
var Y, X = 2e3;
|
|
569
|
+
function Z() {
|
|
570
|
+
return typeof window < "u" && window.isSecureContext === !0 && typeof navigator < "u" && typeof navigator.clipboard?.writeText == "function";
|
|
571
|
+
}
|
|
572
|
+
var Q = (Y = class extends o {
|
|
573
|
+
constructor(...e) {
|
|
574
|
+
super(...e), this.appearance = "box-tinted", this.language = "", this.diff = !1, this.noCopy = !1, this.wrap = !1, this.maxHeight = "", this._copyUnavailable = !1, this.translations = {}, this._isScrollable = !1, this._copyState = "idle", this._languageCompartment = new a(), this._wrapCompartment = new a(), this._diffCompartment = new a(), this._wordCompartment = new a(), this._languagePending = Promise.resolve(), this._wordsPending = Promise.resolve(), this._parsedDiff = null;
|
|
575
|
+
}
|
|
576
|
+
get _canCopy() {
|
|
577
|
+
return !this.noCopy && Z();
|
|
578
|
+
}
|
|
579
|
+
getEditorParent() {
|
|
580
|
+
return this.shadowRoot?.querySelector(".code-viewer__codemirror");
|
|
581
|
+
}
|
|
582
|
+
buildExtensions() {
|
|
583
|
+
return [
|
|
584
|
+
c,
|
|
585
|
+
t.editable.of(!1),
|
|
586
|
+
e.readOnly.of(!0),
|
|
587
|
+
t.contentAttributes.of({
|
|
588
|
+
role: "code",
|
|
589
|
+
"aria-multiline": null,
|
|
590
|
+
"aria-readonly": null
|
|
591
|
+
}),
|
|
592
|
+
this._wrapCompartment.of(this.wrap ? t.lineWrapping : []),
|
|
593
|
+
this._languageCompartment.of([]),
|
|
594
|
+
this._diffCompartment.of(this._parsedDiff ? this._diffExtension(this._parsedDiff) : []),
|
|
595
|
+
this._wordCompartment.of([])
|
|
596
|
+
];
|
|
597
|
+
}
|
|
598
|
+
render() {
|
|
599
|
+
return E(this);
|
|
600
|
+
}
|
|
601
|
+
focus(e) {
|
|
602
|
+
if (C(this, e)) return;
|
|
603
|
+
let t = this.view?.scrollDOM;
|
|
604
|
+
this._isScrollable && t && t.focus(e);
|
|
605
|
+
}
|
|
606
|
+
getRemountDoc() {
|
|
607
|
+
return this._parseDiff(this._getRawText()), this._parsedDiff?.doc ?? this._getRawText();
|
|
608
|
+
}
|
|
609
|
+
_parseDiff(e) {
|
|
610
|
+
this._parsedDiff = this.diff ? A(e) : null, b(this, "diff-lines-dropped", (this._parsedDiff?.dropped ?? 0) > 0);
|
|
611
|
+
}
|
|
612
|
+
connectedCallback() {
|
|
613
|
+
super.connectedCallback(), this._unsubscribeScheme = q(() => this._repaint());
|
|
614
|
+
}
|
|
615
|
+
disconnectedCallback() {
|
|
616
|
+
super.disconnectedCallback(), this._unsubscribeScheme?.(), this._unsubscribeScheme = void 0, this._resizeObserver?.disconnect(), this._resizeObserver = void 0, this._mutationObserver?.disconnect(), this._mutationObserver = void 0, this._scrollableRaf !== void 0 && (cancelAnimationFrame(this._scrollableRaf), this._scrollableRaf = void 0), clearTimeout(this._copyResetTimer), this._copyResetTimer = void 0;
|
|
617
|
+
}
|
|
618
|
+
firstUpdated() {
|
|
619
|
+
this._copyUnavailable = !this.noCopy && !Z(), this._parseDiff(this._getRawText()), this.mountEditor(this._parsedDiff?.doc ?? this._getRawText()), this.onEditorMounted();
|
|
620
|
+
}
|
|
621
|
+
_observeSlotText() {
|
|
622
|
+
this._mutationObserver?.disconnect(), this._mutationObserver = new MutationObserver(() => this._onSlotChange()), this._mutationObserver.observe(this, {
|
|
623
|
+
characterData: !0,
|
|
624
|
+
subtree: !0,
|
|
625
|
+
childList: !0
|
|
626
|
+
});
|
|
627
|
+
}
|
|
628
|
+
onEditorMounted() {
|
|
629
|
+
let e = this.view?.scrollDOM;
|
|
630
|
+
e && (this._resizeObserver?.disconnect(), this._resizeObserver = new ResizeObserver((e) => {
|
|
631
|
+
e.every((e) => e.contentRect.width === 0) || this._scheduleUpdateScrollable();
|
|
632
|
+
}), this._resizeObserver.observe(e)), this._observeSlotText(), this.language && this._applyLanguage(), this._applyWords(), this._updateScrollable();
|
|
633
|
+
}
|
|
634
|
+
updated(e) {
|
|
635
|
+
e.has("noCopy") && (this._copyUnavailable = !this.noCopy && !Z()), e.has("maxHeight") && (this.maxHeight && CSS.supports("max-height", this.maxHeight) ? this.style.setProperty("--_code-viewer-max-height", this.maxHeight) : this.style.removeProperty("--_code-viewer-max-height"), b(this, "invalid-max-height", !!this.maxHeight && !CSS.supports("max-height", this.maxHeight))), this.view && (this._isScrollable && this.view.scrollDOM.setAttribute("aria-label", this._t("components.code-viewer.region-label")), e.has("language") && this._applyLanguage(), e.has("diff") && e.get("diff") !== void 0 && this._applyContent(), e.has("translations") && e.get("translations") !== void 0 && this._parsedDiff && this.reconfigure(this._diffCompartment, this._diffExtension(this._parsedDiff)), e.has("wrap") && (this.reconfigure(this._wrapCompartment, this.wrap ? t.lineWrapping : []), this._updateScrollable()), (e.has("appearance") || e.has("maxHeight") || e.has("noCopy") || e.has("_copyUnavailable")) && this._updateScrollable());
|
|
636
|
+
}
|
|
637
|
+
_onSlotChange() {
|
|
638
|
+
this._applyContent();
|
|
639
|
+
}
|
|
640
|
+
_applyContent() {
|
|
641
|
+
let e = this.view;
|
|
642
|
+
if (!e) return;
|
|
643
|
+
let t = this._getRawText();
|
|
644
|
+
this._parseDiff(t);
|
|
645
|
+
let n = this._parsedDiff?.doc ?? t;
|
|
646
|
+
e.dispatch({
|
|
647
|
+
changes: e.state.doc.toString() === n ? void 0 : {
|
|
648
|
+
from: 0,
|
|
649
|
+
to: e.state.doc.length,
|
|
650
|
+
insert: n
|
|
651
|
+
},
|
|
652
|
+
effects: [this._diffCompartment.reconfigure(this._parsedDiff ? this._diffExtension(this._parsedDiff) : []), this._wordCompartment.reconfigure([])]
|
|
653
|
+
}), this._applyWords(), this._updateScrollable(), this.requestUpdate();
|
|
654
|
+
}
|
|
655
|
+
_diffExtension(e) {
|
|
656
|
+
return z(e, {
|
|
657
|
+
addedLine: (e) => this._t("components.code-viewer.added-line-label", { number: e }),
|
|
658
|
+
removedLine: (e) => this._t("components.code-viewer.removed-line-label", { number: e })
|
|
659
|
+
});
|
|
660
|
+
}
|
|
661
|
+
_applyWords() {
|
|
662
|
+
let e = this._parsedDiff;
|
|
663
|
+
e && (this._wordsPending = U(e).then((t) => {
|
|
664
|
+
this._parsedDiff === e && this.reconfigure(this._wordCompartment, t), b(this, "no-diff-words", !1);
|
|
665
|
+
}, () => b(this, "no-diff-words", !0)));
|
|
666
|
+
}
|
|
667
|
+
get _diffSummary() {
|
|
668
|
+
let e = this._parsedDiff;
|
|
669
|
+
if (!e) return "";
|
|
670
|
+
let t = (e) => this._t(e === 1 ? "components.code-viewer.line-singular-lowercase" : "components.code-viewer.line-plural-lowercase");
|
|
671
|
+
return this._t("components.code-viewer.diff-summary-text", {
|
|
672
|
+
added: e.added,
|
|
673
|
+
addedNoun: t(e.added),
|
|
674
|
+
removed: e.removed,
|
|
675
|
+
removedNoun: t(e.removed)
|
|
676
|
+
});
|
|
677
|
+
}
|
|
678
|
+
_t(e, t) {
|
|
679
|
+
return S(this.translations, w, e, t);
|
|
680
|
+
}
|
|
681
|
+
async getUpdateComplete() {
|
|
682
|
+
let e = await super.getUpdateComplete();
|
|
683
|
+
return await this._languagePending, await this._wordsPending, e;
|
|
684
|
+
}
|
|
685
|
+
_applyLanguage() {
|
|
686
|
+
this._languagePending = this._runLanguage();
|
|
687
|
+
}
|
|
688
|
+
async _runLanguage() {
|
|
689
|
+
let e = this.language;
|
|
690
|
+
if (!e) {
|
|
691
|
+
this.reconfigure(this._languageCompartment, []);
|
|
692
|
+
return;
|
|
693
|
+
}
|
|
694
|
+
let t = u(e);
|
|
695
|
+
if (!t) this.reconfigure(this._languageCompartment, []);
|
|
696
|
+
else try {
|
|
697
|
+
let n = await t;
|
|
698
|
+
this.language === e && (this.reconfigure(this._languageCompartment, n), this._updateScrollable());
|
|
699
|
+
} catch {
|
|
700
|
+
this.reconfigure(this._languageCompartment, []);
|
|
701
|
+
}
|
|
702
|
+
}
|
|
703
|
+
_scheduleUpdateScrollable() {
|
|
704
|
+
this._scrollableRaf === void 0 && (this._scrollableRaf = requestAnimationFrame(() => {
|
|
705
|
+
this._scrollableRaf = void 0, this._updateScrollable();
|
|
706
|
+
}));
|
|
707
|
+
}
|
|
708
|
+
_updateScrollable() {
|
|
709
|
+
let e = this.view?.scrollDOM;
|
|
710
|
+
if (!e || e.clientWidth === 0) return;
|
|
711
|
+
let t = e.scrollHeight > e.clientHeight || !this.wrap && e.scrollWidth > e.clientWidth;
|
|
712
|
+
this._isScrollable = t, t ? (e.setAttribute("tabindex", "0"), e.setAttribute("role", "region"), e.setAttribute("aria-label", this._t("components.code-viewer.region-label"))) : (e.removeAttribute("tabindex"), e.removeAttribute("role"), e.removeAttribute("aria-label"));
|
|
713
|
+
}
|
|
714
|
+
_getRawText() {
|
|
715
|
+
let e = this.shadowRoot?.querySelector("slot");
|
|
716
|
+
return e ? e.assignedNodes({ flatten: !0 }).map((e) => e.textContent ?? "").join("") : "";
|
|
717
|
+
}
|
|
718
|
+
async _onCopyClick(e) {
|
|
719
|
+
(e?.currentTarget)?.focus?.();
|
|
720
|
+
try {
|
|
721
|
+
if (!Z()) throw Error("Clipboard API unavailable");
|
|
722
|
+
await navigator.clipboard.writeText(this._getRawText()), this._copyState = "success";
|
|
723
|
+
} catch {
|
|
724
|
+
this._copyState = "failure";
|
|
725
|
+
}
|
|
726
|
+
clearTimeout(this._copyResetTimer), this._copyState !== "failure" && (this._copyResetTimer = setTimeout(() => {
|
|
727
|
+
this._copyState = "idle";
|
|
728
|
+
}, X));
|
|
729
|
+
}
|
|
730
|
+
_onCopyBlur() {
|
|
731
|
+
this._copyState === "failure" && (this._copyState = "idle");
|
|
732
|
+
}
|
|
733
|
+
_onCopyDismiss() {
|
|
734
|
+
clearTimeout(this._copyResetTimer), this._copyState = "idle";
|
|
735
|
+
}
|
|
736
|
+
_repaint() {
|
|
737
|
+
let e = this.view?.scrollDOM;
|
|
738
|
+
e && J(e);
|
|
739
|
+
}
|
|
740
|
+
}, Y.styles = T, Y);
|
|
741
|
+
_([p({
|
|
742
|
+
reflect: !0,
|
|
743
|
+
converter: y("box-tinted")
|
|
744
|
+
})], Q.prototype, "appearance", void 0), _([p({
|
|
745
|
+
reflect: !0,
|
|
746
|
+
converter: y("")
|
|
747
|
+
})], Q.prototype, "language", void 0), _([p({
|
|
748
|
+
type: Boolean,
|
|
749
|
+
reflect: !0
|
|
750
|
+
})], Q.prototype, "diff", void 0), _([p({
|
|
751
|
+
type: Boolean,
|
|
752
|
+
reflect: !0,
|
|
753
|
+
attribute: "no-copy"
|
|
754
|
+
})], Q.prototype, "noCopy", void 0), _([p({
|
|
755
|
+
type: Boolean,
|
|
756
|
+
reflect: !0
|
|
757
|
+
})], Q.prototype, "wrap", void 0), _([p({
|
|
758
|
+
reflect: !0,
|
|
759
|
+
attribute: "max-height",
|
|
760
|
+
converter: y("")
|
|
761
|
+
})], Q.prototype, "maxHeight", void 0), _([p({
|
|
762
|
+
type: Boolean,
|
|
763
|
+
reflect: !0,
|
|
764
|
+
attribute: "copy-unavailable"
|
|
765
|
+
})], Q.prototype, "_copyUnavailable", void 0), _([p({ type: Object })], Q.prototype, "translations", void 0), _([m()], Q.prototype, "_isScrollable", void 0), _([m()], Q.prototype, "_copyState", void 0), Q = _([v("nldd-code-viewer")], Q);
|
|
766
|
+
export { Q as NLDDCodeViewer };
|