@astryx-vue/core 0.2.6 → 0.4.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/THIRD_PARTY_NOTICES.md +9 -0
- package/dist/AlertDialog/index.js +1 -1
- package/dist/{AlertDialog-BBhl5P1X.js → AlertDialog-C2inDZWG.js} +13 -7
- package/dist/AppShell/index.d.ts +1 -1
- package/dist/AppShell/index.js +1 -1
- package/dist/{AppShell-mrflO0Uy.js → AppShell-CumzH-8z.js} +3 -3
- package/dist/Avatar/index.d.ts +1 -1
- package/dist/Avatar/index.js +1 -1
- package/dist/{Avatar-pPZ4dI_s.js → Avatar-BW0TE8t9.js} +47 -34
- package/dist/AvatarGroup/index.d.ts +1 -1
- package/dist/AvatarGroup/index.js +1 -1
- package/dist/{AvatarGroup-B--NQSB3.js → AvatarGroup-DLC_FFR5.js} +57 -13
- package/dist/Banner/index.d.ts +1 -1
- package/dist/Banner/index.js +1 -1
- package/dist/{Banner-GbGxrqQO.js → Banner-C5VAwo4D.js} +68 -34
- package/dist/Blockquote/index.js +1 -1
- package/dist/Blockquote-DRoKdcxZ.js +27 -0
- package/dist/BottomSheet/index.d.ts +1 -1
- package/dist/BottomSheet/index.js +2 -2
- package/dist/{BottomSheet-eJ3FzTBD.js → BottomSheet-B4sc3F1S.js} +288 -140
- package/dist/{BottomSheet-DIVwbGr3.js → BottomSheet-m54uCMJN.js} +20 -4
- package/dist/Breadcrumbs/index.d.ts +2 -2
- package/dist/Breadcrumbs/index.js +2 -2
- package/dist/Breadcrumbs-CTaz7Kh4.js +223 -0
- package/dist/Button/index.d.ts +1 -1
- package/dist/Button/index.js +1 -1
- package/dist/{Button-B6Hj_O_s.js → Button-ONOoHdkg.js} +25 -15
- package/dist/ButtonGroup/index.d.ts +1 -1
- package/dist/ButtonGroup/index.js +1 -1
- package/dist/ButtonGroup-DnkSZ9a5.js +87 -0
- package/dist/{ButtonTooltip-nWWrth8j.js → ButtonTooltip-CNKOQHYR.js} +7 -4
- package/dist/Calendar/index.d.ts +1 -1
- package/dist/Calendar/index.js +1 -1
- package/dist/{Calendar-B7vIowKq.js → Calendar-BAqzzQm2.js} +5 -5
- package/dist/Card/index.d.ts +2 -2
- package/dist/Card/index.js +1 -1
- package/dist/{Card-HAjZQg2s.js → Card-B-I24X9S.js} +2 -0
- package/dist/Carousel/index.js +1 -1
- package/dist/{Carousel-DAkOa7KK.js → Carousel-DXC22UWq.js} +50 -33
- package/dist/Chat/index.d.ts +1 -1
- package/dist/Chat/index.js +1 -1
- package/dist/{Chat-DVoI6UOA.js → Chat-BdJW6IX5.js} +152 -83
- package/dist/CheckboxIndicator/index.js +1 -1
- package/dist/{CheckboxIndicator-D37cm2Rh.js → CheckboxIndicator-fH4d-JE1.js} +9 -3
- package/dist/CheckboxInput/index.d.ts +1 -1
- package/dist/CheckboxInput/index.js +1 -1
- package/dist/{CheckboxInput-BS9J6edf.js → CheckboxInput-DJHCbwgC.js} +19 -11
- package/dist/CheckboxList/index.d.ts +1 -1
- package/dist/CheckboxList/index.js +1 -1
- package/dist/{CheckboxList-CX1i_jVP.js → CheckboxList-BdZIP4_J.js} +155 -38
- package/dist/Citation/index.js +1 -1
- package/dist/{Citation-Djgwa0ko.js → Citation-DbZn2vms.js} +8 -3
- package/dist/ClickableCard/index.d.ts +1 -1
- package/dist/ClickableCard/index.js +1 -1
- package/dist/{ClickableCard-Bhds4RRe.js → ClickableCard-ChAfiw9T.js} +10 -7
- package/dist/Code/index.d.ts +1 -1
- package/dist/Code/index.js +3 -3
- package/dist/{Code-XnPuGxey.js → Code-Bg7GBdxy.js} +2 -1
- package/dist/{CodeBlock-BUM3czCS.js → CodeBlock-Caaflp7C.js} +7 -3
- package/dist/Collapsible/index.d.ts +1 -1
- package/dist/Collapsible/index.js +1 -1
- package/dist/{Collapsible-Cov3Pyq5.js → Collapsible-Bdj0WYpb.js} +13 -11
- package/dist/CommandPalette/index.d.ts +1 -1
- package/dist/CommandPalette/index.js +1 -1
- package/dist/{CommandPalette-D6wYS30d.js → CommandPalette-C_MClfAg.js} +146 -62
- package/dist/ComplexSelector/index.d.ts +1 -1
- package/dist/ComplexSelector/index.js +1 -1
- package/dist/{ComplexSelector-Bil81sfq.js → ComplexSelector-BeVQaqRf.js} +94 -22
- package/dist/ContextMenu/index.d.ts +2 -2
- package/dist/ContextMenu/index.js +2 -2
- package/dist/{ContextMenu-DdLJnxNN.js → ContextMenu-C6hPYvYz.js} +299 -179
- package/dist/DateInput/index.d.ts +1 -1
- package/dist/DateInput/index.js +1 -1
- package/dist/{DateInput-u2XKccpK.js → DateInput-BjLdmYor.js} +567 -76
- package/dist/DateRangeInput/index.d.ts +1 -1
- package/dist/DateRangeInput/index.js +1 -1
- package/dist/{DateRangeInput-u7LhH6up.js → DateRangeInput-Br3wVEfD.js} +99 -28
- package/dist/DateTimeInput/index.d.ts +1 -1
- package/dist/DateTimeInput/index.js +1 -1
- package/dist/DateTimeInput-CAZBwoRe.js +562 -0
- package/dist/Dialog/index.d.ts +1 -1
- package/dist/Dialog/index.js +2 -2
- package/dist/{Dialog-BiOSKQso.js → Dialog-Dce4Y97V.js} +28 -11
- package/dist/{Dialog-FGHfDu5M.js → Dialog-fhyxB00e.js} +32 -5
- package/dist/Divider/index.d.ts +1 -1
- package/dist/Divider/index.js +1 -1
- package/dist/{Divider-BtwnL18I.js → Divider-mOZ6vIQw.js} +5 -1
- package/dist/DropdownMenu/index.d.ts +2 -2
- package/dist/DropdownMenu/index.js +3 -3
- package/dist/{DropdownMenu-SM_BEOgM.js → DropdownMenu-BdGmQVb1.js} +85 -57
- package/dist/{DropdownMenu-BEasdJ6R.js → DropdownMenu-BzQrNV9C.js} +481 -264
- package/dist/{DropdownMenuRadioItem.vue-CXEURBcq.d.ts → DropdownMenuRadioItem.vue-Qd-8Rg4Q.d.ts} +236 -230
- package/dist/EmptyState/index.js +1 -1
- package/dist/{EmptyState-C_GH7IV5.js → EmptyState-CmOQf2SH.js} +2 -2
- package/dist/Field/index.d.ts +4 -3
- package/dist/Field/index.js +4 -3
- package/dist/{Field-D5gUEGw4.js → Field--OEsLBfE.js} +4 -3
- package/dist/{FieldInfoTip-Ds-sW_jY.js → FieldInfoTip-gxsnfkZw.js} +3 -3
- package/dist/{FieldLabel-BNeXRuGH.js → FieldLabel-jxIiWgLw.js} +12 -7
- package/dist/FieldStatus/index.d.ts +1 -1
- package/dist/FileInput/index.d.ts +1 -1
- package/dist/FileInput/index.js +1 -1
- package/dist/{FileInput-BpdiO1V8.js → FileInput-B_pUxB0Y.js} +106 -29
- package/dist/FormLayout/index.d.ts +1 -1
- package/dist/FormLayout/index.js +1 -1
- package/dist/{FormLayout-D47FjiOq.js → FormLayout-B9dUB6Ps.js} +1 -1
- package/dist/Heading/index.d.ts +1 -1
- package/dist/Heading/index.js +1 -1
- package/dist/{Heading-BnwWEWkp.js → Heading-BzBunfN7.js} +1 -1
- package/dist/HoverCard/index.js +1 -1
- package/dist/{HoverCard-ycY50pRN.js → HoverCard-BpJhT0sn.js} +35 -22
- package/dist/Icon/index.d.ts +4 -4
- package/dist/Icon/index.js +1 -1
- package/dist/{Icon-bteSId7T.js → Icon-KDnUyY7f.js} +12 -20
- package/dist/IconButton/index.js +1 -1
- package/dist/{IconButton-DDNgNl7B.js → IconButton-DI-XBbtV.js} +1 -1
- package/dist/Indicator/index.d.ts +2 -2
- package/dist/Indicator/index.js +2 -1
- package/dist/InputClearButton-CwXPan8c.js +40 -0
- package/dist/InputGroup/index.d.ts +1 -1
- package/dist/InputGroup/index.js +2 -2
- package/dist/{InputGroup-CA03Smrs.js → InputGroup-DiiocoIW.js} +2 -2
- package/dist/InternationalizationProvider/index.d.ts +1 -1
- package/dist/InternationalizationProvider/index.js +1 -1
- package/dist/{InternationalizationProvider-DJay_w3B.js → InternationalizationProvider-kBapgKAQ.js} +5 -9
- package/dist/{Item-KhFKX9St.js → Item-DWMIjN8n.js} +34 -9
- package/dist/Kbd/index.js +1 -1
- package/dist/{Kbd-BB-Dw6zE.js → Kbd-CV3LO2Ge.js} +18 -2
- package/dist/LayerContentBoundary-CvsKxwwm.js +27 -0
- package/dist/LayerProvider/index.js +1 -1
- package/dist/{LayerProvider-D9NsQFzL.js → LayerProvider-B6zpMBWC.js} +15 -3
- package/dist/Layout/index.d.ts +1 -1
- package/dist/Layout/index.js +2 -2
- package/dist/{Layout-9X6eCUoY.js → Layout-JJRCG7Mf.js} +1 -1
- package/dist/{LayoutPanel-DeOh00p5.js → LayoutPanel-zM5vjrKS.js} +15 -8
- package/dist/Lightbox/index.js +1 -1
- package/dist/{Lightbox-DTF9EdTG.js → Lightbox-D8wyPgMK.js} +8 -6
- package/dist/Link/index.d.ts +2 -2
- package/dist/Link/index.js +1 -1
- package/dist/{Link-BqHCtiyt.js → Link-DweIpOtN.js} +29 -12
- package/dist/List/index.d.ts +1 -1
- package/dist/List/index.js +2 -2
- package/dist/{ListItem-8RWT8XAG.js → ListItem-BQXMu1Tb.js} +1 -1
- package/dist/Markdown/index.d.ts +5 -2
- package/dist/Markdown/index.js +5 -2
- package/dist/Markdown/parser/index.d.ts +4 -0
- package/dist/Markdown/parser/index.js +3 -0
- package/dist/Markdown/plugin-protocol/index.d.ts +35 -0
- package/dist/Markdown/plugin-protocol/index.js +107 -0
- package/dist/Markdown/plugin-renderer/index.d.ts +31 -0
- package/dist/Markdown/plugin-renderer/index.js +42 -0
- package/dist/{Markdown-2CVyZDuB.js → Markdown-DhVfOvXk.js} +195 -484
- package/dist/MediaTheme-DlLqYhDy.js +433 -0
- package/dist/MetadataList/index.js +1 -1
- package/dist/{MetadataList-B-OelQlt.js → MetadataList-CEYceIlN.js} +15 -7
- package/dist/MobileNav/index.js +1 -1
- package/dist/{MobileNavToggle-C3dkrM98.js → MobileNavToggle-pdoJFZHx.js} +60 -19
- package/dist/MoreMenu/index.d.ts +1 -1
- package/dist/MoreMenu/index.js +1 -1
- package/dist/{MoreMenu-D1WFGqGU.js → MoreMenu-CFNqSRev.js} +87 -67
- package/dist/MultiSelector/index.d.ts +1 -1
- package/dist/MultiSelector/index.js +1 -1
- package/dist/MultiSelector-DuVatmq5.js +1456 -0
- package/dist/{NavDisclosure-C_fugrQ3.js → NavDisclosure-Bq9DTZLO.js} +29 -7
- package/dist/{NavHeadingSurface-B3yJspSN.js → NavHeadingSurface-C4v_MtkX.js} +29 -26
- package/dist/NavItem/index.d.ts +1 -1
- package/dist/NavItem/index.js +2 -2
- package/dist/{NavItem-BBIGSvDj.js → NavItem-BPb3yfgz.js} +17 -4
- package/dist/NavMenu/index.d.ts +1 -1
- package/dist/NavMenu/index.js +3 -3
- package/dist/{NavMenu-ThXguZAz.js → NavMenu-BYIDzjix.js} +42 -15
- package/dist/{NavMenuItem-BvJNsDFC.js → NavMenuItem-D3FO90GR.js} +14 -12
- package/dist/NumberInput/index.d.ts +1 -1
- package/dist/NumberInput/index.js +1 -1
- package/dist/NumberInput-B0vzOg3N.js +727 -0
- package/dist/Outline/index.d.ts +2 -2
- package/dist/Outline/index.js +2 -2
- package/dist/{Outline-755h-lMP.js → Outline-CfGv2F1o.js} +91 -6
- package/dist/OverflowList/index.d.ts +2 -2
- package/dist/OverflowList/index.js +1 -1
- package/dist/{OverflowList-NmrSMbxb.js → OverflowList-BgRLZ3dh.js} +23 -6
- package/dist/Pagination/index.d.ts +1 -1
- package/dist/Pagination/index.js +1 -1
- package/dist/{Pagination-Cc4BrjQg.js → Pagination-Bfe12018.js} +2 -2
- package/dist/PickerWheel-CSwUYfes.js +69 -0
- package/dist/Popover/index.d.ts +1 -1
- package/dist/Popover/index.js +1 -1
- package/dist/{Popover-CtoBfVlD.js → Popover-78dFjTb9.js} +28 -17
- package/dist/PowerSearch/index.d.ts +1 -1
- package/dist/PowerSearch/index.js +1 -1
- package/dist/{PowerSearch-DHoiObLn.js → PowerSearch-BoAMdFaT.js} +776 -586
- package/dist/ProgressBar/index.d.ts +1 -1
- package/dist/ProgressBar/index.js +1 -1
- package/dist/{ProgressBar-CVLzdoBK.js → ProgressBar-VP4JS7vm.js} +10 -7
- package/dist/Radio/index.d.ts +1 -1
- package/dist/Radio/index.js +1 -1
- package/dist/{RadioGroup-Bfu6JSNV.js → RadioGroup-BIipql-L.js} +94 -26
- package/dist/RadioList/index.d.ts +1 -1
- package/dist/RadioList/index.js +1 -1
- package/dist/{RadioList-xY1cwLdZ.js → RadioList-GyhgBg4j.js} +57 -8
- package/dist/Resizable/index.d.ts +1 -1
- package/dist/Resizable/index.js +1 -1
- package/dist/{ResizeHandle-q4nD_586.js → ResizeHandle-TPlUCAHD.js} +103 -50
- package/dist/ScrollableArea/index.d.ts +1 -1
- package/dist/ScrollableArea/index.js +1 -1
- package/dist/{ScrollableArea-CJiaALHm.js → ScrollableArea-0u6RWtGG.js} +14 -3
- package/dist/Scrollbars/index.d.ts +2 -0
- package/dist/Scrollbars/index.js +3 -0
- package/dist/Scrollbars-D_93hJYK.js +75 -0
- package/dist/SegmentedControl/index.js +1 -1
- package/dist/{SegmentedControl-ChHmFrrC.js → SegmentedControl-D1wWGBZo.js} +11 -5
- package/dist/SelectableCard/index.d.ts +1 -1
- package/dist/SelectableCard/index.js +1 -1
- package/dist/{SelectableCard-Bj5s_tIN.js → SelectableCard-BEqnhPaX.js} +17 -12
- package/dist/Selector/index.d.ts +1 -1
- package/dist/Selector/index.js +1 -1
- package/dist/Selector-CPISLzp7.js +1049 -0
- package/dist/SideNav/index.d.ts +1 -1
- package/dist/SideNav/index.js +1 -1
- package/dist/{SideNav-Dtv8eA2j.js → SideNav-CN2QeAtY.js} +64 -41
- package/dist/Slider/index.d.ts +1 -1
- package/dist/Slider/index.js +1 -1
- package/dist/{Slider-DWobsPgm.js → Slider-pdC0jpHu.js} +172 -46
- package/dist/Spinner/index.js +1 -1
- package/dist/Spinner-DdVUadii.js +200 -0
- package/dist/Stack/index.d.ts +1 -1
- package/dist/Stack/index.js +2 -2
- package/dist/{Stack-CjQEavuq.js → Stack-Bb_h60t3.js} +10 -3
- package/dist/{Stack-D_Bhs-3r.js → Stack-Bp-XN9J4.js} +20 -9
- package/dist/StatusDot/index.d.ts +1 -1
- package/dist/StatusDot/index.js +1 -1
- package/dist/{StatusDot-BPUhMOff.js → StatusDot-BS_ohXhd.js} +8 -4
- package/dist/Stepper/index.d.ts +1 -1
- package/dist/Stepper/index.js +1 -1
- package/dist/{Stepper-CE8dHysu.js → Stepper-CyaSRSdu.js} +101 -79
- package/dist/Switch/index.d.ts +1 -1
- package/dist/Switch/index.js +1 -1
- package/dist/{Switch-DaVPRxvN.js → Switch-Z2Vfiiic.js} +38 -22
- package/dist/TabList/index.d.ts +2 -2
- package/dist/TabList/index.js +1 -1
- package/dist/{TabList-DIkK9sgK.js → TabList-DRqP0Hrv.js} +205 -63
- package/dist/Table/index.d.ts +3 -3
- package/dist/Table/index.js +1 -1
- package/dist/{Table-hqZMmzfU.js → Table-BcrrylMX.js} +727 -448
- package/dist/Text/index.d.ts +2 -2
- package/dist/Text/index.js +1 -1
- package/dist/{Text-CV3LmscH.js → Text-CmTOgYXf.js} +1 -1
- package/dist/TextArea/index.d.ts +1 -1
- package/dist/TextArea/index.js +1 -1
- package/dist/{TextArea-Ab5Sw60T.js → TextArea-DA9CCG_J.js} +104 -50
- package/dist/TextInput/index.d.ts +1 -1
- package/dist/TextInput/index.js +1 -1
- package/dist/{TextInput-zFT1_qgI.js → TextInput-CI96einV.js} +71 -38
- package/dist/Theme/index.d.ts +3 -3
- package/dist/Theme/index.js +3 -2
- package/dist/Theme-BbDT8B_C.js +2125 -0
- package/dist/Thumbnail/index.js +1 -1
- package/dist/{Thumbnail-C3NnJUFG.js → Thumbnail-B2ZAY59J.js} +13 -10
- package/dist/{TimeField-ByiJKBRM.js → TimeField-CpAgja9D.js} +299 -40
- package/dist/TimeInput/index.d.ts +1 -1
- package/dist/TimeInput/index.js +1 -1
- package/dist/{TimeInput-S8n946tp.js → TimeInput-Bw_lHS4M.js} +78 -9
- package/dist/Timer/index.d.ts +1 -1
- package/dist/Timer/index.js +1 -1
- package/dist/{Timer-avMQk5DN.js → Timer-CH7GsEVu.js} +1 -1
- package/dist/Timestamp/index.d.ts +1 -1
- package/dist/Timestamp/index.js +1 -1
- package/dist/{Timestamp-xpQKCk0d.js → Timestamp-BFNuoTZ0.js} +5 -5
- package/dist/Toast/index.d.ts +1 -1
- package/dist/Toast/index.js +1 -1
- package/dist/Toast-DwnPjx6j.js +685 -0
- package/dist/ToggleButton/index.d.ts +1 -1
- package/dist/ToggleButton/index.js +1 -1
- package/dist/{ToggleButton-B-C-Q7XP.js → ToggleButton-cLjh9W-x.js} +5 -4
- package/dist/Token/index.d.ts +1 -1
- package/dist/Token/index.js +1 -1
- package/dist/{Token-DsntTYhQ.js → Token-BfS4vi__.js} +32 -17
- package/dist/Tokenizer/index.d.ts +1 -1
- package/dist/Tokenizer/index.js +1 -1
- package/dist/{Tokenizer-41p035dX.js → Tokenizer-Ci3E5bvP.js} +109 -23
- package/dist/Toolbar/index.d.ts +2 -2
- package/dist/Toolbar/index.js +1 -1
- package/dist/{Toolbar-BrgvvTCk.js → Toolbar-C0pMWL4S.js} +1 -1
- package/dist/Tooltip/index.d.ts +1 -1
- package/dist/Tooltip/index.js +1 -1
- package/dist/{Tooltip-C4Vaqd3G.js → Tooltip-sAM8i1eO.js} +23 -19
- package/dist/TopNav/index.d.ts +1 -1
- package/dist/TopNav/index.js +1 -1
- package/dist/{TopNav-CeSeEMX3.js → TopNav-gW59zp1o.js} +16 -15
- package/dist/TreeList/index.d.ts +1 -1
- package/dist/TreeList/index.js +1 -1
- package/dist/{TreeList-BUz-KZJd.js → TreeList-DaoI7zaH.js} +124 -41
- package/dist/Typeahead/index.d.ts +1 -1
- package/dist/Typeahead/index.js +2 -2
- package/dist/{Typeahead-k3xhFxkr.js → Typeahead-D4JjvjK4.js} +125 -26
- package/dist/{TypeaheadMenu-DBW6rHeO.js → TypeaheadMenu-BQlMrfqX.js} +141 -51
- package/dist/{announce-Cnio10Wk.js → announce-B210eJVf.js} +17 -2
- package/dist/characterReferences-BJ-jLhsR.js +65 -0
- package/dist/characters-rcDbGt71.d.ts +29 -0
- package/dist/characters-wTnzjkkR.js +58 -0
- package/dist/{colorMode-CBgdgDSn.js → colorMode-BxqfDP4P.js} +1 -4
- package/dist/composables/index.d.ts +5 -4
- package/dist/composables/index.js +23 -18
- package/dist/{composables-CbKx9C1Y.js → composables-Bc02zKAO.js} +167 -197
- package/dist/context-B6UElI5X.js +5 -0
- package/dist/{context-Cfjh8te1.js → context-Cfml4jaK.js} +5 -3
- package/dist/{context-iABt_ueM.js → context-DWfi56sq.js} +451 -122
- package/dist/context-IvbU9c3T.js +8 -0
- package/dist/context-pjBxaMSh.js +28 -0
- package/dist/fieldParts--SyRZVQG.js +44 -0
- package/dist/fieldParts-LXpQMKE8.d.ts +27 -0
- package/dist/{focus-CpficIgf.js → focus-l8jVTcqd.js} +1 -1
- package/dist/hoverIntent-DMHGb85c.js +115 -0
- package/dist/{index-Cde5JvtX.d.ts → index-B-nESNam.d.ts} +8 -7
- package/dist/{index-CsNi1I8j.d.ts → index-B08-Uxhv.d.ts} +4 -2
- package/dist/{index-Cn-sSds-.d.ts → index-B56j4eI2.d.ts} +24 -1
- package/dist/{index-BJMJ09K-.d.ts → index-BEZ4ezJk.d.ts} +1 -1
- package/dist/{index-DeQwYJbg.d.ts → index-BNaRK-s5.d.ts} +10 -1
- package/dist/{index-CQCTKjIO.d.ts → index-BO9TY87G.d.ts} +5 -4
- package/dist/{index-BJSxFVXH.d.ts → index-BQEJj72c.d.ts} +21 -8
- package/dist/{index-BXk7Wng7.d.ts → index-BULhhnGf.d.ts} +1 -1
- package/dist/{index-D97pQbua.d.ts → index-BV2D2x_u.d.ts} +1 -1
- package/dist/{index-BPYzIIYn.d.ts → index-BZKgbyN9.d.ts} +2 -2
- package/dist/index-BkUkm6Al.d.ts +11 -0
- package/dist/{index-ClNU2Th8.d.ts → index-Bn-v89Vt.d.ts} +10 -6
- package/dist/{index-Bu8NA2SD.d.ts → index-BnEhvmdR.d.ts} +16 -7
- package/dist/index-Bo-ofFyg.d.ts +166 -0
- package/dist/{index-i0tNFWfz.d.ts → index-BqhgeAT4.d.ts} +2 -0
- package/dist/{index-DWh2WC8W.d.ts → index-C4Cjz6OK.d.ts} +2 -2
- package/dist/{index-B7yhzGUT.d.ts → index-C7sam-SB.d.ts} +2 -2
- package/dist/{index-BrJzFA5X.d.ts → index-C90l2rH1.d.ts} +1 -1
- package/dist/{index-vP0EtrJJ.d.ts → index-C9gAlDt_.d.ts} +6 -3
- package/dist/{index-csA1lH_0.d.ts → index-CJ6ajsUC.d.ts} +2 -2
- package/dist/{index-CY-KvZ9B.d.ts → index-CK-Dbh0f.d.ts} +1 -1
- package/dist/index-CKUfpmFL.d.ts +375 -0
- package/dist/{index-DXpSFlPG.d.ts → index-CKgBTAzC.d.ts} +4 -4
- package/dist/{index-EFqQF2Bx.d.ts → index-CPtDjmcX.d.ts} +4 -4
- package/dist/{index-12QYAbiz.d.ts → index-CRrSHbok.d.ts} +3 -2
- package/dist/{index-DG52Bg0W.d.ts → index-CTf3SK0b.d.ts} +6 -0
- package/dist/{index-BNy3SW4S.d.ts → index-CTjkJP4x.d.ts} +32 -3
- package/dist/{index-Ca8VIE4l.d.ts → index-CVn0GBdB.d.ts} +1 -1
- package/dist/{index-YKCx03zD.d.ts → index-CdvmnNMH.d.ts} +1 -1
- package/dist/{index-BUEPz7BL.d.ts → index-CikMzeab.d.ts} +3 -3
- package/dist/{index-CdtZjkmG.d.ts → index-CpNlPLBF.d.ts} +183 -129
- package/dist/{index-N7OVZ38M.d.ts → index-Cs1xsHKi.d.ts} +28 -16
- package/dist/{index-Cyb9Du5Z.d.ts → index-CtTGt6Dv.d.ts} +1 -1
- package/dist/{index-HV6W3xCx.d.ts → index-D05JGsT3.d.ts} +5 -2
- package/dist/{index-CsTbMVDS.d.ts → index-D0_HsuC3.d.ts} +4 -4
- package/dist/{index-BgT6mH3U.d.ts → index-D7ShT2c-.d.ts} +1 -1
- package/dist/{index-CkKPMIeX.d.ts → index-D7XRtUTY.d.ts} +9 -0
- package/dist/{index-TntQsADQ.d.ts → index-DEm3kRBO.d.ts} +4 -3
- package/dist/{index-DamRHh1i.d.ts → index-DLAG3m9W.d.ts} +11 -1
- package/dist/{index-DUnDGFQE.d.ts → index-DNA2l1RN.d.ts} +1 -1
- package/dist/{index-WnUY4Kxu.d.ts → index-DRJZ-v1E.d.ts} +4 -4
- package/dist/{index-DYp2RWkM.d.ts → index-DY8Wph-A.d.ts} +3 -3
- package/dist/{index-B1WJxt-n.d.ts → index-DfC05uKG.d.ts} +17 -7
- package/dist/{index-C5e-7Obr.d.ts → index-Dj1_1t3j.d.ts} +19 -6
- package/dist/{index-jW-mP58D.d.ts → index-Dr4b_oji.d.ts} +22 -15
- package/dist/{index-uKnRGtzi.d.ts → index-Ds201-d2.d.ts} +18 -4
- package/dist/{index-DIXAzTKL.d.ts → index-DxxudRgB.d.ts} +1 -1
- package/dist/{index-DQmK3Lq_.d.ts → index-IfsSCj8J.d.ts} +19 -6
- package/dist/{index-B1eCxBCY.d.ts → index-TXcNH86P.d.ts} +1 -1
- package/dist/{index-XuAAcYiP.d.ts → index-f3d9cVtj.d.ts} +1 -1
- package/dist/index-fAZaRruV.d.ts +125 -0
- package/dist/{index-D5N9ikrS.d.ts → index-hCpxKePE.d.ts} +1 -1
- package/dist/{index-T2FOcOuI.d.ts → index-jOwU3YoR.d.ts} +400 -90
- package/dist/{index-DdGck82Y.d.ts → index-pNtfr-RW.d.ts} +2 -2
- package/dist/{index-BhpAUzUr.d.ts → index-unAZVFGz.d.ts} +2 -2
- package/dist/index.d.ts +84 -77
- package/dist/index.js +151 -134
- package/dist/inlineSize-BNe8wggI.js +66 -0
- package/dist/inputPresentation-BOyHkCDr.js +62 -0
- package/dist/interactionModality-ACpTMhak.js +44 -0
- package/dist/isApplePlatform-B1ju6F5B.js +27 -0
- package/dist/isRenderable-BnKHIqfd.js +21 -0
- package/dist/layerDepth-CNDh-IHb.js +181 -0
- package/dist/link-DuuA2eCL.js +30 -0
- package/dist/{loadCatalog-BGHKG_9N.d.ts → loadCatalog-DlLFZreI.d.ts} +281 -7
- package/dist/loadCatalog-eopw74qb.js +424 -0
- package/dist/locale/index.d.ts +2 -2
- package/dist/locale/index.js +4 -3
- package/dist/locale-CabGJlGp.js +343 -0
- package/dist/modalOutlet-CUOcrhIu.js +56 -0
- package/dist/optionAction-Cg7xQLUA.d.ts +6 -0
- package/dist/{power-search-DrDfcoL1.d.ts → power-search-gHLIYXs5.d.ts} +2 -0
- package/dist/protocol-DHxY0NI8.js +113 -0
- package/dist/protocol-RSeMzAN1.d.ts +238 -0
- package/dist/publicParser-B0MRoikr.d.ts +141 -0
- package/dist/publicParser-uHC_T0Fo.js +895 -0
- package/dist/resizableChannel-3vivrEcT.js +20 -0
- package/dist/safeUrl-CsvfcZ9m.js +54 -0
- package/dist/scopedProvide-C-Df7c15.js +30 -0
- package/dist/scrollKeyboardDelegation-D7cumnOl.js +238 -0
- package/dist/scrollLock-C3aT4-0z.js +102 -0
- package/dist/{searchResultMessage-hXXNOFJP.js → searchResultMessage-mCpJBvra.js} +5 -14
- package/dist/{semantic-CKH9XVqa.d.ts → semantic-BF_AjLvk.d.ts} +6 -3
- package/dist/slug-C65CUsf9.js +32 -0
- package/dist/syntaxContext-DmIfNNtb.js +4 -0
- package/dist/triggerVariant-BsL8jMHs.js +16 -0
- package/dist/{types-0Q_SJv_F.d.ts → types-Bb7OGivY.d.ts} +6 -1
- package/dist/{types-H4Bbbxiw.d.ts → types-BnNTzEnd.d.ts} +1 -1
- package/dist/{types-CwyibrRB.d.ts → types-C5GQ2KCK.d.ts} +23 -3
- package/dist/{types-BBWrcHMD.d.ts → types-Ckih2YJi.d.ts} +3 -2
- package/dist/{types-gKsEkk2g.d.ts → types-CsqwQkf1.d.ts} +143 -10
- package/dist/upstreamMap-xr3gvREu.js +731 -0
- package/dist/{useAnchoredListbox-DwztMNjP.js → useAnchoredListbox-DGxxKHZb.js} +2 -2
- package/dist/{useAsyncSource-xpQovjV_.d.ts → useAsyncSource-aGzrvRkI.d.ts} +3 -0
- package/dist/{useClickableContainer-DyNpnSEa.js → useClickableContainer-CdGp_Cev.js} +1 -1
- package/dist/{useClipboard-BDfbEsWd.js → useClipboard-Dk8cS810.js} +1 -1
- package/dist/useHoverLayerDismiss-kYJ_NqL4.js +27 -0
- package/dist/{useIndicator-i1NORM7W.js → useIndicator-MZmfBWid.js} +5 -23
- package/dist/{useInputContainer-CpgDe2-4.js → useInputContainer-CLcYrby4.js} +1 -1
- package/dist/{useInputStatusIcon-DBOwxV4x.js → useInputStatusIcon-DAE7PExr.js} +1 -1
- package/dist/useLayerMountTarget-BmZyeKWE.js +156 -0
- package/dist/{useListFocus-D0iOJl39.js → useListFocus-ChxLg0b4.js} +3 -2
- package/dist/{useMenuDrillIn-DzKGkTho.js → useMenuDrillIn-DhUnPvKs.js} +6 -5
- package/dist/useMenuHover-Djreu23i.js +170 -0
- package/dist/useMenuPress-8foxY8z4.js +764 -0
- package/dist/{useMergedRefs-CfHHlCsn.js → useMergedRefs-Cb6_w93m.js} +24 -4
- package/dist/{useNumberField-4-dIGVed.js → useNumberField-Dk1BE3-K.js} +3 -3
- package/dist/useOptionActionGrid-CkJcuvaU.js +97 -0
- package/dist/{usePositionedLayer-Cru9_00b.js → usePositionedLayer-B7cvG-_v.js} +43 -49
- package/dist/usePressFeedback-BJCpjEpv.js +319 -0
- package/dist/{useResizable-DDwPpPe6.d.ts → useResizable-1MHPNaRD.d.ts} +19 -1
- package/dist/{useResizable-B3ahKLoZ.js → useResizable-I3BCiLSL.js} +72 -40
- package/dist/useResolvedLabelHidden-B2rlWiaI.js +30 -0
- package/dist/{useRestoreFocus-Djw9RUIf.js → useRestoreFocus-XEKs5-gp.js} +49 -7
- package/dist/useScrollOverflow-DuMoGXmm.js +67 -0
- package/dist/useScrollableArea-BE8b3qm7.js +222 -0
- package/dist/useScrollbars-C2NJ6Qwq.js +43 -0
- package/dist/{useTimeValue-6ufHM15W.js → useTimeValue-BJd0xBhG.js} +4 -22
- package/dist/useTranslator-BmWt2BBt.js +35 -0
- package/dist/{useTypeahead-PAK8lMYz.js → useTypeahead-BvtflkRk.js} +4 -5
- package/dist/utils/index.d.ts +3 -0
- package/dist/utils/index.js +5 -0
- package/dist/{utils-D33VQDnk.js → utils-ClVseK2w.js} +29 -2
- package/dist/utils-z3Q6BGIJ.js +819 -0
- package/locales/SOURCE.json +1 -1
- package/package.json +24 -3
- package/reset.css +364 -1
- package/styles/avatar-group.css +9 -1
- package/styles/badge.css +8 -5
- package/styles/banner.css +124 -26
- package/styles/blockquote.css +1 -0
- package/styles/bordered-control.css +1 -1
- package/styles/bottom-sheet.css +74 -6
- package/styles/breadcrumbs.css +16 -2
- package/styles/button-group.css +3 -1
- package/styles/button.css +53 -11
- package/styles/card.css +1 -1
- package/styles/chat.css +16 -6
- package/styles/checkbox-input.css +10 -0
- package/styles/clickable-card.css +10 -3
- package/styles/collapsible.css +12 -5
- package/styles/command-palette.css +29 -14
- package/styles/complex-selector.css +22 -5
- package/styles/context-menu.css +3 -3
- package/styles/date-input.css +111 -1
- package/styles/dialog-header.css +4 -1
- package/styles/dialog.css +7 -0
- package/styles/dropdown-menu.css +12 -3
- package/styles/field.css +5 -0
- package/styles/form-layout.css +1 -0
- package/styles/heading.css +18 -8
- package/styles/icon.css +4 -0
- package/styles/kbd.css +1 -1
- package/styles/layer.css +72 -0
- package/styles/list.css +9 -2
- package/styles/metadata-list.css +1 -0
- package/styles/mobile-nav.css +4 -1
- package/styles/multi-selector.css +48 -1
- package/styles/nav-item.css +9 -2
- package/styles/nav-menu.css +12 -2
- package/styles/number-input.css +9 -1
- package/styles/overflow-list.css +1 -1
- package/styles/popover.css +2 -1
- package/styles/power-search.css +5 -3
- package/styles/pressable.css +63 -22
- package/styles/progress-bar.css +15 -3
- package/styles/radio.css +16 -0
- package/styles/resize-handle.css +42 -0
- package/styles/scrollbars.css +28 -0
- package/styles/segmented-control.css +12 -4
- package/styles/selector.css +53 -1
- package/styles/side-nav.css +19 -0
- package/styles/slider.css +4 -3
- package/styles/spinner.css +48 -42
- package/styles/stepper.css +58 -4
- package/styles/switch.css +26 -0
- package/styles/tab-list.css +132 -3
- package/styles/table.css +88 -10
- package/styles/text-area.css +1 -1
- package/styles/text-input.css +1 -1
- package/styles/text.css +6 -6
- package/styles/thumbnail.css +11 -3
- package/styles/time-input.css +8 -0
- package/styles/toast.css +37 -3
- package/styles/token.css +2 -2
- package/styles/tokenizer.css +1 -1
- package/styles/toolbar.css +4 -1
- package/styles/tree-list.css +1 -1
- package/styles/typeahead.css +34 -1
- package/styles.css +1 -0
- package/dist/Blockquote-DFqBv_oJ.js +0 -18
- package/dist/Breadcrumbs-DPVaziH4.js +0 -141
- package/dist/ButtonGroup-ySQWanDP.js +0 -125
- package/dist/DateTimeInput-DHp683jZ.js +0 -268
- package/dist/MultiSelector-BeV98x7X.js +0 -988
- package/dist/NumberInput-AZ9x3oja.js +0 -473
- package/dist/Selector-DuVozKNq.js +0 -675
- package/dist/Spinner-9cYUCnDy.js +0 -84
- package/dist/Theme-CtaUWo4g.js +0 -1246
- package/dist/Toast-BuqIZV5z.js +0 -322
- package/dist/context-4PuqD1Ic.js +0 -4
- package/dist/context-D5-MwxnN.js +0 -4
- package/dist/index-BH9PzQ1F.d.ts +0 -87
- package/dist/link-C4_WogdF.js +0 -18
- package/dist/loadCatalog-CXKqEB9s.js +0 -877
- package/dist/locale-DgkZEMTn.js +0 -105
- package/dist/platform-B_9W_aHW.js +0 -33
- package/dist/scrollLock-BzIvIimL.js +0 -42
- package/dist/useMenuPress-D-FRNrBW.js +0 -573
- package/dist/useScrollableArea-DDk_CluT.js +0 -172
- /package/dist/{index-lgvUFSCO.d.ts → index-CryFtTT6.d.ts} +0 -0
|
@@ -1,379 +1,23 @@
|
|
|
1
1
|
import { t as _sfc_main$1 } from "./VisuallyHidden-C7NN3VEP.js";
|
|
2
|
-
import {
|
|
3
|
-
import { t as _sfc_main$2 } from "./Heading-
|
|
4
|
-
import { t as _sfc_main$3 } from "./Blockquote-
|
|
5
|
-
import { t as _sfc_main$4 } from "./CheckboxIndicator-
|
|
6
|
-
import { t as useIndicator } from "./useIndicator-
|
|
7
|
-
import { d as _sfc_main$5, s as parseFenceLanguage, t as _sfc_main$6 } from "./CodeBlock-
|
|
8
|
-
import { t as _sfc_main$7 } from "./Link-
|
|
2
|
+
import { s as useAstryxMessages } from "./context-DWfi56sq.js";
|
|
3
|
+
import { t as _sfc_main$2 } from "./Heading-BzBunfN7.js";
|
|
4
|
+
import { t as _sfc_main$3 } from "./Blockquote-DRoKdcxZ.js";
|
|
5
|
+
import { t as _sfc_main$4 } from "./CheckboxIndicator-fH4d-JE1.js";
|
|
6
|
+
import { t as useIndicator } from "./useIndicator-MZmfBWid.js";
|
|
7
|
+
import { d as _sfc_main$5, s as parseFenceLanguage, t as _sfc_main$6 } from "./CodeBlock-Caaflp7C.js";
|
|
8
|
+
import { t as _sfc_main$7 } from "./Link-DweIpOtN.js";
|
|
9
|
+
import { i as plainText, n as uniqueSlug, t as slugify } from "./slug-C65CUsf9.js";
|
|
10
|
+
import { c as applyProtocolTransforms, d as parseMarkdownIncremental, l as createIncrementalMarkdownState, s as applyMarkdownSyntax, u as parseMarkdown } from "./publicParser-uHC_T0Fo.js";
|
|
11
|
+
import { l as isMarkdownPluginEntry, t as collectProtocolRenderers, u as isMarkdownSourceLinesPlugin } from "./protocol-DHxY0NI8.js";
|
|
9
12
|
import { Fragment, computed, defineComponent, h, ref } from "vue";
|
|
10
|
-
import { fromMarkdown } from "mdast-util-from-markdown";
|
|
11
|
-
import { gfmFromMarkdown } from "mdast-util-gfm";
|
|
12
|
-
import { gfm } from "micromark-extension-gfm";
|
|
13
13
|
import "../styles/markdown.css";
|
|
14
|
-
//#region src/Markdown/
|
|
15
|
-
function
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
return true;
|
|
20
|
-
}
|
|
21
|
-
function plainText(node) {
|
|
22
|
-
if (node.type === "text" || node.type === "inlineCode" || node.type === "code" || node.type === "html") return node.value ?? "";
|
|
23
|
-
if (node.type === "image" || node.type === "imageReference") return node.alt ?? node.label ?? "";
|
|
24
|
-
if (node.type === "footnoteReference") return node.label ?? node.identifier ?? "";
|
|
25
|
-
if (node.type === "break") return "\n";
|
|
26
|
-
return (node.children ?? []).map((child) => plainText(child)).join("");
|
|
27
|
-
}
|
|
28
|
-
//#endregion
|
|
29
|
-
//#region src/Markdown/blocks.ts
|
|
30
|
-
function splitSourceLines(source) {
|
|
31
|
-
if (source.length === 0) return [];
|
|
32
|
-
const lines = [];
|
|
33
|
-
let start = 0;
|
|
34
|
-
for (let index = 0; index < source.length; index++) {
|
|
35
|
-
if (source.charCodeAt(index) !== 10) continue;
|
|
36
|
-
const contentEnd = index > start && source.charCodeAt(index - 1) === 13 ? index - 1 : index;
|
|
37
|
-
lines.push({
|
|
38
|
-
text: source.slice(start, contentEnd),
|
|
39
|
-
start,
|
|
40
|
-
end: index + 1,
|
|
41
|
-
newline: true
|
|
42
|
-
});
|
|
43
|
-
start = index + 1;
|
|
44
|
-
}
|
|
45
|
-
if (start < source.length) lines.push({
|
|
46
|
-
text: source.slice(start),
|
|
47
|
-
start,
|
|
48
|
-
end: source.length,
|
|
49
|
-
newline: false
|
|
50
|
-
});
|
|
51
|
-
return lines;
|
|
52
|
-
}
|
|
53
|
-
function fenceOpener(text) {
|
|
54
|
-
const indent = /^ {0,3}/.exec(text);
|
|
55
|
-
const rest = text.slice(indent?.[0].length ?? 0);
|
|
56
|
-
const markerMatch = /^(`{3,}|~{3,})/.exec(rest);
|
|
57
|
-
if (markerMatch == null) return null;
|
|
58
|
-
const marker = markerMatch[1] ?? "";
|
|
59
|
-
const info = rest.slice(marker.length);
|
|
60
|
-
if (marker.startsWith("`") && info.includes("`")) return null;
|
|
61
|
-
const char = marker[0];
|
|
62
|
-
if (char == null) return null;
|
|
63
|
-
return {
|
|
64
|
-
char,
|
|
65
|
-
length: marker.length
|
|
66
|
-
};
|
|
67
|
-
}
|
|
68
|
-
function isFenceClose(text, marker) {
|
|
69
|
-
const match = /^ {0,3}([`~]+)[ \t]*$/.exec(text);
|
|
70
|
-
if (match == null) return false;
|
|
71
|
-
const closing = match[1] ?? "";
|
|
72
|
-
return closing.length >= marker.length && [...closing].every((char) => char === marker.char);
|
|
73
|
-
}
|
|
74
|
-
function isAtxHeading(text) {
|
|
75
|
-
return /^ {0,3}#{1,6}(?:[ \t]|$)/.test(text);
|
|
76
|
-
}
|
|
77
|
-
function isThematicBreak(text) {
|
|
78
|
-
return /^ {0,3}([-*_])(?:[ \t]*\1){2,}[ \t]*$/.test(text);
|
|
79
|
-
}
|
|
80
|
-
function isSetextUnderline(text) {
|
|
81
|
-
return /^ {0,3}(?:=+|-+)[ \t]*$/.test(text);
|
|
82
|
-
}
|
|
83
|
-
function isListItem(text) {
|
|
84
|
-
return /^ {0,3}(?:[-+*]|\d{1,9}[.)])[ \t]/.test(text);
|
|
85
|
-
}
|
|
86
|
-
function isBlockquote(text) {
|
|
87
|
-
return /^ {0,3}>/.test(text);
|
|
88
|
-
}
|
|
89
|
-
function isBlank(text) {
|
|
90
|
-
return /^[ \t]*$/.test(text);
|
|
91
|
-
}
|
|
92
|
-
function isIndented(text) {
|
|
93
|
-
return /^[ \t]+\S/.test(text);
|
|
94
|
-
}
|
|
95
|
-
function continuesList(text) {
|
|
96
|
-
return isListItem(text) || isIndented(text);
|
|
97
|
-
}
|
|
98
|
-
function continuesQuote(text) {
|
|
99
|
-
return isBlockquote(text) || isIndented(text);
|
|
100
|
-
}
|
|
101
|
-
function hasUnsettledParagraph(lines, index, settled) {
|
|
102
|
-
const previous = lines[index - 1];
|
|
103
|
-
if (previous == null || isBlank(previous.text) || settled > previous.start) return false;
|
|
104
|
-
if (isAtxHeading(previous.text) || isListItem(previous.text) || isBlockquote(previous.text)) return false;
|
|
105
|
-
if (isThematicBreak(previous.text) || fenceOpener(previous.text) != null) return false;
|
|
106
|
-
return true;
|
|
107
|
-
}
|
|
108
|
-
/**
|
|
109
|
-
* End index of the prefix whose blocks can no longer change if text is only
|
|
110
|
-
* appended. The last open block stays after this index and is re-parsed.
|
|
111
|
-
* The index never moves backwards as `source` grows by appending.
|
|
112
|
-
*/
|
|
113
|
-
function findSettledEnd(source) {
|
|
114
|
-
const lines = splitSourceLines(source);
|
|
115
|
-
let settled = 0;
|
|
116
|
-
let container = "top";
|
|
117
|
-
let fence = null;
|
|
118
|
-
for (let index = 0; index < lines.length; index++) {
|
|
119
|
-
const line = lines[index];
|
|
120
|
-
if (line == null || !line.newline) return settled;
|
|
121
|
-
if (fence != null) {
|
|
122
|
-
if (isFenceClose(line.text, fence)) {
|
|
123
|
-
fence = null;
|
|
124
|
-
if (container === "top") settled = line.end;
|
|
125
|
-
}
|
|
126
|
-
continue;
|
|
127
|
-
}
|
|
128
|
-
const opener = fenceOpener(line.text);
|
|
129
|
-
if (opener != null) {
|
|
130
|
-
fence = opener;
|
|
131
|
-
continue;
|
|
132
|
-
}
|
|
133
|
-
if (container === "top" && isAtxHeading(line.text)) {
|
|
134
|
-
settled = line.end;
|
|
135
|
-
continue;
|
|
136
|
-
}
|
|
137
|
-
if (container === "top" && isSetextUnderline(line.text) && hasUnsettledParagraph(lines, index, settled)) {
|
|
138
|
-
settled = line.end;
|
|
139
|
-
continue;
|
|
140
|
-
}
|
|
141
|
-
if (container === "top" && isThematicBreak(line.text)) {
|
|
142
|
-
settled = line.end;
|
|
143
|
-
continue;
|
|
144
|
-
}
|
|
145
|
-
if (isBlank(line.text)) {
|
|
146
|
-
const next = lines[index + 1];
|
|
147
|
-
if (next == null || !next.newline) return settled;
|
|
148
|
-
if (container === "list" && continuesList(next.text)) continue;
|
|
149
|
-
if (container === "quote" && continuesQuote(next.text)) continue;
|
|
150
|
-
container = "top";
|
|
151
|
-
settled = line.end;
|
|
152
|
-
continue;
|
|
153
|
-
}
|
|
154
|
-
if (container === "top" && isListItem(line.text)) {
|
|
155
|
-
container = "list";
|
|
156
|
-
continue;
|
|
157
|
-
}
|
|
158
|
-
if (container === "top" && isBlockquote(line.text)) container = "quote";
|
|
159
|
-
}
|
|
160
|
-
return settled;
|
|
161
|
-
}
|
|
162
|
-
/** True when a fenced code block has been opened and not closed. */
|
|
163
|
-
function hasOpenFence(source) {
|
|
164
|
-
const lines = splitSourceLines(source);
|
|
165
|
-
let fence = null;
|
|
166
|
-
for (const line of lines) {
|
|
167
|
-
if (!line.newline) return fence != null || fenceOpener(line.text) != null;
|
|
168
|
-
if (fence != null) {
|
|
169
|
-
if (isFenceClose(line.text, fence)) fence = null;
|
|
170
|
-
continue;
|
|
171
|
-
}
|
|
172
|
-
const opener = fenceOpener(line.text);
|
|
173
|
-
if (opener != null) fence = opener;
|
|
174
|
-
}
|
|
175
|
-
return fence != null;
|
|
176
|
-
}
|
|
177
|
-
//#endregion
|
|
178
|
-
//#region src/Markdown/trim.ts
|
|
179
|
-
function isInsideCodeSpan(line, index) {
|
|
180
|
-
let open = false;
|
|
181
|
-
for (let cursor = 0; cursor < index; cursor++) if (line[cursor] === "`") open = !open;
|
|
182
|
-
return open;
|
|
183
|
-
}
|
|
184
|
-
function trimIncompleteLink(line) {
|
|
185
|
-
const image = line.lastIndexOf("![");
|
|
186
|
-
const bracket = line.lastIndexOf("[");
|
|
187
|
-
const start = Math.max(image, bracket);
|
|
188
|
-
if (start < 0 || isInsideCodeSpan(line, start)) return line;
|
|
189
|
-
const slice = line.slice(start);
|
|
190
|
-
if (/^!?\[[^\]]*\]\([^)]*\)$/.test(slice) || /^!?\[[^\]]*\]$/.test(slice)) return line;
|
|
191
|
-
if (/^!?\[[^\]]*\]\([^)]*$/.test(slice) || /^!?\[[^\]]*$/.test(slice)) return line.slice(0, start);
|
|
192
|
-
return line;
|
|
193
|
-
}
|
|
194
|
-
function markerRuns(line, char, maxLength) {
|
|
195
|
-
const runs = [];
|
|
196
|
-
for (let index = 0; index < line.length; index++) {
|
|
197
|
-
if (line[index] !== char) continue;
|
|
198
|
-
let length = 1;
|
|
199
|
-
while (line[index + length] === char) length += 1;
|
|
200
|
-
if (length <= maxLength) runs.push({
|
|
201
|
-
start: index,
|
|
202
|
-
length
|
|
203
|
-
});
|
|
204
|
-
index += length - 1;
|
|
205
|
-
}
|
|
206
|
-
return runs;
|
|
207
|
-
}
|
|
208
|
-
/** Pair equal-length marker runs and close or drop the ones left open. */
|
|
209
|
-
function closeRuns(line, char, maxLength) {
|
|
210
|
-
const runs = markerRuns(line, char, maxLength);
|
|
211
|
-
const openByLength = /* @__PURE__ */ new Map();
|
|
212
|
-
const closed = /* @__PURE__ */ new Set();
|
|
213
|
-
runs.forEach((run, index) => {
|
|
214
|
-
const stack = openByLength.get(run.length) ?? [];
|
|
215
|
-
const opener = stack.pop();
|
|
216
|
-
if (opener == null) {
|
|
217
|
-
stack.push(index);
|
|
218
|
-
openByLength.set(run.length, stack);
|
|
219
|
-
return;
|
|
220
|
-
}
|
|
221
|
-
closed.add(opener);
|
|
222
|
-
closed.add(index);
|
|
223
|
-
openByLength.set(run.length, stack);
|
|
224
|
-
});
|
|
225
|
-
const openIndexes = runs.map((_, index) => index).filter((index) => !closed.has(index));
|
|
226
|
-
if (openIndexes.length === 0) return line;
|
|
227
|
-
let result = line;
|
|
228
|
-
for (const index of [...openIndexes].reverse()) {
|
|
229
|
-
const run = runs[index];
|
|
230
|
-
if (run == null) continue;
|
|
231
|
-
const after = result.slice(run.start + run.length);
|
|
232
|
-
if (after.trim() === "") {
|
|
233
|
-
result = result.slice(0, run.start) + result.slice(run.start + run.length);
|
|
234
|
-
continue;
|
|
235
|
-
}
|
|
236
|
-
const trailing = after.length - after.trimEnd().length;
|
|
237
|
-
const closer = char.repeat(run.length);
|
|
238
|
-
result = result.slice(0, result.length - trailing) + closer + result.slice(result.length - trailing);
|
|
239
|
-
}
|
|
240
|
-
return result;
|
|
241
|
-
}
|
|
242
|
-
function closeStrike(line) {
|
|
243
|
-
const positions = [];
|
|
244
|
-
let search = 0;
|
|
245
|
-
while (search < line.length) {
|
|
246
|
-
const found = line.indexOf("~~", search);
|
|
247
|
-
if (found === -1) break;
|
|
248
|
-
positions.push(found);
|
|
249
|
-
search = found + 2;
|
|
250
|
-
}
|
|
251
|
-
if (positions.length % 2 === 0) return line;
|
|
252
|
-
const start = positions[positions.length - 1];
|
|
253
|
-
if (start == null) return line;
|
|
254
|
-
const after = line.slice(start + 2);
|
|
255
|
-
if (after.trim() === "") return line.slice(0, start);
|
|
256
|
-
const trailing = after.length - after.trimEnd().length;
|
|
257
|
-
return `${line.slice(0, line.length - trailing)}~~${line.slice(line.length - trailing)}`;
|
|
258
|
-
}
|
|
259
|
-
/**
|
|
260
|
-
* Hide unfinished link and code markers on the last line, and close emphasis
|
|
261
|
-
* that already has text so the words can render while the stream continues.
|
|
262
|
-
* An open fence is left untouched.
|
|
263
|
-
*/
|
|
264
|
-
function trimStreamingTail(tail) {
|
|
265
|
-
if (tail === "" || hasOpenFence(tail)) return tail;
|
|
266
|
-
const lastNewline = tail.lastIndexOf("\n");
|
|
267
|
-
const head = lastNewline === -1 ? "" : tail.slice(0, lastNewline + 1);
|
|
268
|
-
let line = lastNewline === -1 ? tail : tail.slice(lastNewline + 1);
|
|
269
|
-
line = trimIncompleteLink(line);
|
|
270
|
-
line = closeRuns(line, "`", Number.POSITIVE_INFINITY);
|
|
271
|
-
line = closeRuns(line, "*", 3);
|
|
272
|
-
line = closeStrike(line);
|
|
273
|
-
return head + line;
|
|
274
|
-
}
|
|
275
|
-
//#endregion
|
|
276
|
-
//#region src/Markdown/parse.ts
|
|
277
|
-
const markdownExtensions = [gfm(), { disable: { null: ["htmlFlow", "htmlText"] } }];
|
|
278
|
-
const mdastExtensions = [gfmFromMarkdown()];
|
|
279
|
-
function isAutolinkLiteral(node, source) {
|
|
280
|
-
if (node.type !== "link" || node.title != null && node.title !== "") return false;
|
|
281
|
-
const only = node.children?.length === 1 ? node.children[0] : null;
|
|
282
|
-
if (only == null || only.type !== "text" || only.value == null) return false;
|
|
283
|
-
const start = node.position?.start?.offset;
|
|
284
|
-
const end = node.position?.end?.offset;
|
|
285
|
-
if (start == null || end == null) return false;
|
|
286
|
-
const raw = source.slice(start, end);
|
|
287
|
-
if (raw.startsWith("<") || raw.startsWith("[")) return false;
|
|
288
|
-
return raw === only.value;
|
|
289
|
-
}
|
|
290
|
-
/** Turn bare autolinks back into text. Explicit links and `<url>` stay. */
|
|
291
|
-
function stripAutolinkLiterals(node, source) {
|
|
292
|
-
if (node.children == null) return node;
|
|
293
|
-
let changed = false;
|
|
294
|
-
const children = [];
|
|
295
|
-
for (const child of node.children) {
|
|
296
|
-
if (isAutolinkLiteral(child, source)) {
|
|
297
|
-
const start = child.position?.start?.offset ?? 0;
|
|
298
|
-
const end = child.position?.end?.offset ?? start;
|
|
299
|
-
children.push({
|
|
300
|
-
type: "text",
|
|
301
|
-
value: source.slice(start, end)
|
|
302
|
-
});
|
|
303
|
-
changed = true;
|
|
304
|
-
continue;
|
|
305
|
-
}
|
|
306
|
-
const next = stripAutolinkLiterals(child, source);
|
|
307
|
-
if (next !== child) changed = true;
|
|
308
|
-
children.push(next);
|
|
309
|
-
}
|
|
310
|
-
if (!changed) return node;
|
|
311
|
-
return {
|
|
312
|
-
...node,
|
|
313
|
-
children: mergeAdjacentText(children)
|
|
314
|
-
};
|
|
315
|
-
}
|
|
316
|
-
function mergeAdjacentText(children) {
|
|
317
|
-
const merged = [];
|
|
318
|
-
for (const child of children) {
|
|
319
|
-
const previous = merged[merged.length - 1];
|
|
320
|
-
if (previous?.type === "text" && child.type === "text") {
|
|
321
|
-
merged[merged.length - 1] = {
|
|
322
|
-
type: "text",
|
|
323
|
-
value: `${previous.value ?? ""}${child.value ?? ""}`
|
|
324
|
-
};
|
|
325
|
-
continue;
|
|
326
|
-
}
|
|
327
|
-
merged.push(child);
|
|
328
|
-
}
|
|
329
|
-
return merged;
|
|
330
|
-
}
|
|
331
|
-
function parseMarkdown(source, options) {
|
|
332
|
-
const root = fromMarkdown(source, {
|
|
333
|
-
extensions: markdownExtensions,
|
|
334
|
-
mdastExtensions
|
|
335
|
-
});
|
|
336
|
-
if (options?.autolink === "gfm") return root;
|
|
337
|
-
return stripAutolinkLiterals(root, source);
|
|
338
|
-
}
|
|
339
|
-
function createIncrementalMarkdownState() {
|
|
340
|
-
return {
|
|
341
|
-
settledEnd: 0,
|
|
342
|
-
settledSource: "",
|
|
343
|
-
blocks: []
|
|
344
|
-
};
|
|
345
|
-
}
|
|
346
|
-
function resetIncrementalState(state) {
|
|
347
|
-
state.settledEnd = 0;
|
|
348
|
-
state.settledSource = "";
|
|
349
|
-
state.blocks = [];
|
|
350
|
-
}
|
|
351
|
-
/**
|
|
352
|
-
* Parse `source`, reusing the AST of every block that has already closed.
|
|
353
|
-
* Only the suffix after {@link findSettledEnd} is parsed again. When `source`
|
|
354
|
-
* is no longer an append of the previous value, the cache is dropped.
|
|
355
|
-
*/
|
|
356
|
-
function parseMarkdownIncremental(source, state, options) {
|
|
357
|
-
const settledPrefix = state.settledSource.slice(0, state.settledEnd);
|
|
358
|
-
if (settledPrefix.length > 0 && !source.startsWith(settledPrefix)) resetIncrementalState(state);
|
|
359
|
-
const end = findSettledEnd(source);
|
|
360
|
-
if (end < state.settledEnd) resetIncrementalState(state);
|
|
361
|
-
if (end > state.settledEnd) {
|
|
362
|
-
const slice = source.slice(state.settledEnd, end);
|
|
363
|
-
if (slice.trim() !== "") {
|
|
364
|
-
const children = parseMarkdown(slice, { autolink: options?.autolink }).children ?? [];
|
|
365
|
-
state.blocks = state.blocks.concat(children);
|
|
366
|
-
}
|
|
367
|
-
state.settledEnd = end;
|
|
368
|
-
}
|
|
369
|
-
state.settledSource = source;
|
|
370
|
-
const tail = source.slice(state.settledEnd);
|
|
371
|
-
const prepared = options?.trimTail === true ? trimStreamingTail(tail) : tail;
|
|
372
|
-
const tailBlocks = prepared.trim() === "" ? [] : parseMarkdown(prepared, { autolink: options?.autolink }).children ?? [];
|
|
373
|
-
return {
|
|
374
|
-
blocks: state.blocks.concat(tailBlocks),
|
|
375
|
-
settledCount: state.blocks.length
|
|
14
|
+
//#region src/Markdown/canonicalAst.ts
|
|
15
|
+
function visitMarkdownNodes(root, type, visitor) {
|
|
16
|
+
const visit = (node) => {
|
|
17
|
+
if (node.type === type) visitor(node);
|
|
18
|
+
if ("children" in node) for (const child of node.children) visit(child);
|
|
376
19
|
};
|
|
20
|
+
visit(root);
|
|
377
21
|
}
|
|
378
22
|
//#endregion
|
|
379
23
|
//#region src/Markdown/plugins.ts
|
|
@@ -491,22 +135,6 @@ function applyInlinePlugins(root, plugins) {
|
|
|
491
135
|
};
|
|
492
136
|
}
|
|
493
137
|
//#endregion
|
|
494
|
-
//#region src/Markdown/slug.ts
|
|
495
|
-
/** URL slug for a heading. Letters and numbers from any language are kept. */
|
|
496
|
-
function slugify(value) {
|
|
497
|
-
return value.trim().toLowerCase().replace(/['"]/g, "").replace(/[^\p{Letter}\p{Number}]+/gu, "-").replace(/^-+|-+$/g, "");
|
|
498
|
-
}
|
|
499
|
-
/**
|
|
500
|
-
* `setup`, then `setup-1`, then `setup-2`. An empty slug becomes `section`.
|
|
501
|
-
* One map covers a whole document.
|
|
502
|
-
*/
|
|
503
|
-
function uniqueSlug(baseSlug, counts) {
|
|
504
|
-
const slug = baseSlug === "" ? "section" : baseSlug;
|
|
505
|
-
const seen = counts.get(slug) ?? 0;
|
|
506
|
-
counts.set(slug, seen + 1);
|
|
507
|
-
return seen === 0 ? slug : `${slug}-${seen}`;
|
|
508
|
-
}
|
|
509
|
-
//#endregion
|
|
510
138
|
//#region src/Markdown/streaming.ts
|
|
511
139
|
/**
|
|
512
140
|
* Record the previous rendered length as a fade boundary.
|
|
@@ -603,51 +231,7 @@ function linkOpensInNewTab(url) {
|
|
|
603
231
|
return /^https?:/i.test(url);
|
|
604
232
|
}
|
|
605
233
|
//#endregion
|
|
606
|
-
//#region src/Markdown/
|
|
607
|
-
function measureNode(node) {
|
|
608
|
-
switch (node.type) {
|
|
609
|
-
case "text":
|
|
610
|
-
case "inlineCode":
|
|
611
|
-
case "code":
|
|
612
|
-
case "html": return node.value?.length ?? 0;
|
|
613
|
-
case "image":
|
|
614
|
-
case "imageReference": return (node.alt ?? node.label ?? "").length;
|
|
615
|
-
case "break": return 1;
|
|
616
|
-
case "footnoteReference": return (node.label ?? node.identifier ?? "").length;
|
|
617
|
-
case "definition":
|
|
618
|
-
case "thematicBreak": return 0;
|
|
619
|
-
default: return (node.children ?? []).reduce((sum, child) => sum + measureNode(child), 0);
|
|
620
|
-
}
|
|
621
|
-
}
|
|
622
|
-
function assignHeadingSlugs(nodes) {
|
|
623
|
-
const counts = /* @__PURE__ */ new Map();
|
|
624
|
-
const slugs = /* @__PURE__ */ new Map();
|
|
625
|
-
const visit = (list) => {
|
|
626
|
-
for (const node of list) {
|
|
627
|
-
if (node.type === "heading") slugs.set(node, uniqueSlug(slugify(plainText(node)), counts));
|
|
628
|
-
if (node.children != null) visit(node.children);
|
|
629
|
-
}
|
|
630
|
-
};
|
|
631
|
-
visit(nodes);
|
|
632
|
-
return slugs;
|
|
633
|
-
}
|
|
634
|
-
function collectDefinitions(nodes) {
|
|
635
|
-
const definitions = /* @__PURE__ */ new Map();
|
|
636
|
-
const visit = (list) => {
|
|
637
|
-
for (const node of list) {
|
|
638
|
-
if (node.type === "definition" && node.identifier != null && node.url != null) definitions.set(node.identifier, {
|
|
639
|
-
url: node.url,
|
|
640
|
-
title: node.title
|
|
641
|
-
});
|
|
642
|
-
if (node.children != null) visit(node.children);
|
|
643
|
-
}
|
|
644
|
-
};
|
|
645
|
-
visit(nodes);
|
|
646
|
-
return definitions;
|
|
647
|
-
}
|
|
648
|
-
function headingLevel(depth, start) {
|
|
649
|
-
return Math.min(6, Math.max(1, depth + start - 1));
|
|
650
|
-
}
|
|
234
|
+
//#region src/Markdown/renderInline.ts
|
|
651
235
|
function renderPlainText(value, key, fade) {
|
|
652
236
|
const start = fade.offset;
|
|
653
237
|
fade.offset += value.length;
|
|
@@ -749,34 +333,11 @@ function renderCitation(id, key, start, ctx) {
|
|
|
749
333
|
target: linkOpensInNewTab(href) ? "_blank" : void 0
|
|
750
334
|
}, children);
|
|
751
335
|
}
|
|
752
|
-
function extensionRenderer(node, ctx) {
|
|
753
|
-
const owner = node.plugin;
|
|
754
|
-
if (owner == null) return null;
|
|
755
|
-
const block = ctx.plugins?.find((plugin) => plugin.name === owner && plugin.render != null);
|
|
756
|
-
if (block?.render != null) return block.render;
|
|
757
|
-
return (ctx.inlinePlugins?.find((plugin) => plugin.name === owner && plugin.render != null))?.render ?? null;
|
|
758
|
-
}
|
|
759
|
-
function renderExtension(node, key, ctx) {
|
|
760
|
-
const render = extensionRenderer(node, ctx);
|
|
761
|
-
if (render != null) {
|
|
762
|
-
const rendered = render(node, { renderChildren: () => renderChildren(node.children, key, ctx) });
|
|
763
|
-
if (rendered != null) return rendered;
|
|
764
|
-
}
|
|
765
|
-
if (node.value != null && node.value !== "") return renderText(node.value, key, ctx);
|
|
766
|
-
if (node.children != null && node.children.length > 0) return h(Fragment, { key }, renderChildren(node.children, key, ctx));
|
|
767
|
-
return null;
|
|
768
|
-
}
|
|
769
336
|
function fadeClass(start, fade) {
|
|
770
337
|
if (!fade.active || fade.boundaries.length === 0) return void 0;
|
|
771
338
|
const oldest = fade.boundaries[0];
|
|
772
339
|
return oldest != null && start >= oldest ? "astryx-markdown__fade" : void 0;
|
|
773
340
|
}
|
|
774
|
-
function renderChildren(nodes, key, ctx) {
|
|
775
|
-
return (nodes ?? []).flatMap((node, index) => {
|
|
776
|
-
const rendered = renderNode(node, `${key}-${index}`, ctx);
|
|
777
|
-
return rendered == null ? [] : [rendered];
|
|
778
|
-
});
|
|
779
|
-
}
|
|
780
341
|
function renderLink(href, key, children, title, ctx) {
|
|
781
342
|
const override = ctx.components?.link;
|
|
782
343
|
if (override != null) return h(override, {
|
|
@@ -796,6 +357,124 @@ function renderLink(href, key, children, title, ctx) {
|
|
|
796
357
|
}
|
|
797
358
|
}, () => children);
|
|
798
359
|
}
|
|
360
|
+
//#endregion
|
|
361
|
+
//#region src/Markdown/renderTree.ts
|
|
362
|
+
function measureNode(node) {
|
|
363
|
+
switch (node.type) {
|
|
364
|
+
case "text":
|
|
365
|
+
case "inlineCode":
|
|
366
|
+
case "code":
|
|
367
|
+
case "html": return node.value?.length ?? 0;
|
|
368
|
+
case "image":
|
|
369
|
+
case "imageReference": return (node.alt ?? node.label ?? "").length;
|
|
370
|
+
case "break": return 1;
|
|
371
|
+
case "footnoteReference": return (node.label ?? node.identifier ?? "").length;
|
|
372
|
+
case "definition":
|
|
373
|
+
case "thematicBreak": return 0;
|
|
374
|
+
default: return (node.children ?? []).reduce((sum, child) => sum + measureNode(child), 0);
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
function assignHeadingSlugs(nodes) {
|
|
378
|
+
const counts = /* @__PURE__ */ new Map();
|
|
379
|
+
const slugs = /* @__PURE__ */ new Map();
|
|
380
|
+
const visit = (list) => {
|
|
381
|
+
for (const node of list) {
|
|
382
|
+
if (node.type === "heading") slugs.set(node, uniqueSlug(slugify(plainText(node)), counts));
|
|
383
|
+
if (node.children != null) visit(node.children);
|
|
384
|
+
}
|
|
385
|
+
};
|
|
386
|
+
visit(nodes);
|
|
387
|
+
return slugs;
|
|
388
|
+
}
|
|
389
|
+
function collectDefinitions(nodes) {
|
|
390
|
+
const definitions = /* @__PURE__ */ new Map();
|
|
391
|
+
const visit = (list) => {
|
|
392
|
+
for (const node of list) {
|
|
393
|
+
if (node.type === "definition" && node.identifier != null && node.url != null) definitions.set(node.identifier, {
|
|
394
|
+
url: node.url,
|
|
395
|
+
title: node.title
|
|
396
|
+
});
|
|
397
|
+
if (node.children != null) visit(node.children);
|
|
398
|
+
}
|
|
399
|
+
};
|
|
400
|
+
visit(nodes);
|
|
401
|
+
return definitions;
|
|
402
|
+
}
|
|
403
|
+
function slotText(nodes) {
|
|
404
|
+
if (nodes == null) return "";
|
|
405
|
+
return nodes.map((node) => {
|
|
406
|
+
if (typeof node.children === "string") return node.children;
|
|
407
|
+
return "";
|
|
408
|
+
}).join("");
|
|
409
|
+
}
|
|
410
|
+
//#endregion
|
|
411
|
+
//#region src/Markdown/render.ts
|
|
412
|
+
function headingLevel(depth, start) {
|
|
413
|
+
return Math.min(6, Math.max(1, depth + start - 1));
|
|
414
|
+
}
|
|
415
|
+
function sourceSpan(node, ctx) {
|
|
416
|
+
if (ctx.sourceLines !== true) return null;
|
|
417
|
+
const start = node.position?.start?.line;
|
|
418
|
+
if (start == null) return null;
|
|
419
|
+
return {
|
|
420
|
+
start,
|
|
421
|
+
end: node.position?.end?.line ?? start
|
|
422
|
+
};
|
|
423
|
+
}
|
|
424
|
+
function sourceLineAttrs(node, ctx) {
|
|
425
|
+
const span = sourceSpan(node, ctx);
|
|
426
|
+
if (span == null) return {};
|
|
427
|
+
return {
|
|
428
|
+
"data-source-line": String(span.start),
|
|
429
|
+
"data-source-line-end": String(span.end)
|
|
430
|
+
};
|
|
431
|
+
}
|
|
432
|
+
function sourceLineFields(node, ctx) {
|
|
433
|
+
const span = sourceSpan(node, ctx);
|
|
434
|
+
return span == null ? {} : { sourceLines: span };
|
|
435
|
+
}
|
|
436
|
+
function renderProtocol(node, ctx) {
|
|
437
|
+
if (node.plugin == null || node.name == null) return void 0;
|
|
438
|
+
const renderer = ctx.protocolRenderers?.get(`${node.plugin}\0${node.name}`);
|
|
439
|
+
if (renderer == null) return void 0;
|
|
440
|
+
const extension = node;
|
|
441
|
+
try {
|
|
442
|
+
const rendered = renderer.render({ node: extension });
|
|
443
|
+
if (typeof rendered === "string" || typeof rendered === "number") return rendered;
|
|
444
|
+
if (rendered != null && typeof rendered === "object") return rendered;
|
|
445
|
+
} catch {}
|
|
446
|
+
try {
|
|
447
|
+
return renderer.toText(extension);
|
|
448
|
+
} catch {
|
|
449
|
+
return node.source ?? node.value ?? "";
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
function extensionRenderer(node, ctx) {
|
|
453
|
+
const owner = node.plugin;
|
|
454
|
+
if (owner == null) return null;
|
|
455
|
+
const block = ctx.plugins?.find((plugin) => plugin.name === owner && plugin.render != null);
|
|
456
|
+
if (block?.render != null) return block.render;
|
|
457
|
+
return (ctx.inlinePlugins?.find((plugin) => plugin.name === owner && plugin.render != null))?.render ?? null;
|
|
458
|
+
}
|
|
459
|
+
function renderExtension(node, key, ctx) {
|
|
460
|
+
const protocol = renderProtocol(node, ctx);
|
|
461
|
+
if (protocol !== void 0) return protocol;
|
|
462
|
+
const render = extensionRenderer(node, ctx);
|
|
463
|
+
if (render != null) {
|
|
464
|
+
const rendered = render(node, { renderChildren: () => renderChildren(node.children, key, ctx) });
|
|
465
|
+
if (rendered != null) return rendered;
|
|
466
|
+
}
|
|
467
|
+
if (node.source != null && node.source !== "") return renderText(node.source, key, ctx);
|
|
468
|
+
if (node.value != null && node.value !== "") return renderText(node.value, key, ctx);
|
|
469
|
+
if (node.children != null && node.children.length > 0) return h(Fragment, { key }, renderChildren(node.children, key, ctx));
|
|
470
|
+
return null;
|
|
471
|
+
}
|
|
472
|
+
function renderChildren(nodes, key, ctx) {
|
|
473
|
+
return (nodes ?? []).flatMap((node, index) => {
|
|
474
|
+
const rendered = renderNode(node, `${key}-${index}`, ctx);
|
|
475
|
+
return rendered == null ? [] : [rendered];
|
|
476
|
+
});
|
|
477
|
+
}
|
|
799
478
|
function renderInline(node, key, ctx) {
|
|
800
479
|
switch (node.type) {
|
|
801
480
|
case "text": return renderText(node.value ?? "", key, ctx);
|
|
@@ -919,7 +598,8 @@ function renderList$1(node, key, ctx) {
|
|
|
919
598
|
if (override != null) return h(override, {
|
|
920
599
|
key,
|
|
921
600
|
ordered,
|
|
922
|
-
start
|
|
601
|
+
start,
|
|
602
|
+
...sourceLineFields(node, ctx)
|
|
923
603
|
}, () => renderedItems);
|
|
924
604
|
return h(ordered ? "ol" : "ul", {
|
|
925
605
|
key,
|
|
@@ -956,12 +636,14 @@ function renderListItem(node, key, taskList, marker, ctx) {
|
|
|
956
636
|
const body = renderItemBody(node, key, ctx);
|
|
957
637
|
if (!taskList && !isTaskItem(node)) return h("li", {
|
|
958
638
|
key,
|
|
959
|
-
class: "astryx-markdown__item"
|
|
639
|
+
class: "astryx-markdown__item",
|
|
640
|
+
...sourceLineAttrs(node, ctx)
|
|
960
641
|
}, [renderMarker(marker), h("div", { class: "astryx-markdown__item-body" }, body)]);
|
|
961
642
|
const checked = node.checked === true;
|
|
962
643
|
return h("li", {
|
|
963
644
|
key,
|
|
964
|
-
class: "astryx-markdown__task"
|
|
645
|
+
class: "astryx-markdown__task",
|
|
646
|
+
...sourceLineAttrs(node, ctx)
|
|
965
647
|
}, [h("span", { class: "astryx-markdown__task-check" }, [h(ctx.checkboxIndicator ?? _sfc_main$4, {
|
|
966
648
|
state: checked ? "checked" : "unchecked",
|
|
967
649
|
size: "sm"
|
|
@@ -982,24 +664,30 @@ function renderBlock(node, key, ctx) {
|
|
|
982
664
|
if (override != null) return h(override, {
|
|
983
665
|
key,
|
|
984
666
|
level,
|
|
985
|
-
id
|
|
667
|
+
id,
|
|
668
|
+
...sourceLineFields(node, ctx)
|
|
986
669
|
}, () => [...children, anchor]);
|
|
987
670
|
return h(_sfc_main$2, {
|
|
988
671
|
key,
|
|
989
672
|
level,
|
|
990
673
|
id,
|
|
991
674
|
class: "astryx-markdown__heading astryx-markdown__prose",
|
|
992
|
-
tabindex: -1
|
|
675
|
+
tabindex: -1,
|
|
676
|
+
...sourceLineAttrs(node, ctx)
|
|
993
677
|
}, () => [...children, anchor]);
|
|
994
678
|
}
|
|
995
679
|
case "paragraph": {
|
|
996
680
|
const children = renderChildren(node.children, key, ctx);
|
|
997
681
|
const imageOnly = (node.children ?? []).length === 1 && node.children?.[0]?.type === "image";
|
|
998
682
|
const override = ctx.components?.paragraph;
|
|
999
|
-
if (override != null) return h(override, {
|
|
683
|
+
if (override != null) return h(override, {
|
|
684
|
+
key,
|
|
685
|
+
...sourceLineFields(node, ctx)
|
|
686
|
+
}, () => children);
|
|
1000
687
|
if (ctx.inline) return h("span", {
|
|
1001
688
|
key,
|
|
1002
|
-
class: "astryx-markdown__paragraph"
|
|
689
|
+
class: "astryx-markdown__paragraph",
|
|
690
|
+
...sourceLineAttrs(node, ctx)
|
|
1003
691
|
}, children);
|
|
1004
692
|
return h("div", {
|
|
1005
693
|
key,
|
|
@@ -1008,7 +696,8 @@ function renderBlock(node, key, ctx) {
|
|
|
1008
696
|
"astryx-markdown__paragraph",
|
|
1009
697
|
"astryx-markdown__prose",
|
|
1010
698
|
imageOnly ? "astryx-markdown__paragraph--image" : null
|
|
1011
|
-
]
|
|
699
|
+
],
|
|
700
|
+
...sourceLineAttrs(node, ctx)
|
|
1012
701
|
}, children);
|
|
1013
702
|
}
|
|
1014
703
|
case "code": {
|
|
@@ -1020,27 +709,34 @@ function renderBlock(node, key, ctx) {
|
|
|
1020
709
|
if (override != null) return h(override, {
|
|
1021
710
|
key,
|
|
1022
711
|
code: value,
|
|
1023
|
-
language
|
|
712
|
+
language,
|
|
713
|
+
...sourceLineFields(node, ctx)
|
|
1024
714
|
}, () => value);
|
|
1025
715
|
const fence = parseFenceLanguage(language);
|
|
1026
716
|
return h("div", {
|
|
1027
717
|
key,
|
|
1028
|
-
class: ["astryx-markdown__code", fadeClass(start, ctx.fade)]
|
|
718
|
+
class: ["astryx-markdown__code", fadeClass(start, ctx.fade)],
|
|
719
|
+
...sourceLineAttrs(node, ctx)
|
|
1029
720
|
}, [h(_sfc_main$6, {
|
|
1030
721
|
code: value,
|
|
1031
722
|
language: fence.language,
|
|
1032
723
|
isDiff: fence.isDiff,
|
|
1033
724
|
width: "100%",
|
|
1034
|
-
isCollapsible: true
|
|
725
|
+
isCollapsible: true,
|
|
726
|
+
isWrapped: true
|
|
1035
727
|
})]);
|
|
1036
728
|
}
|
|
1037
729
|
case "blockquote": {
|
|
1038
730
|
const children = (node.children ?? []).map((child, index) => renderBlock(child, `${key}-${index}`, ctx)).filter((child) => child != null);
|
|
1039
731
|
const override = ctx.components?.blockquote;
|
|
1040
|
-
if (override != null) return h(override, {
|
|
732
|
+
if (override != null) return h(override, {
|
|
733
|
+
key,
|
|
734
|
+
...sourceLineFields(node, ctx)
|
|
735
|
+
}, () => children);
|
|
1041
736
|
return h(_sfc_main$3, {
|
|
1042
737
|
key,
|
|
1043
|
-
class: "astryx-markdown__blockquote astryx-markdown__prose"
|
|
738
|
+
class: "astryx-markdown__blockquote astryx-markdown__prose",
|
|
739
|
+
...sourceLineAttrs(node, ctx)
|
|
1044
740
|
}, () => children);
|
|
1045
741
|
}
|
|
1046
742
|
case "list": return renderList$1(node, key, ctx);
|
|
@@ -1064,18 +760,26 @@ function renderBlock(node, key, ctx) {
|
|
|
1064
760
|
}));
|
|
1065
761
|
const content = [header == null ? null : h("thead", { key: `${key}-head` }, [renderRow(header, `${key}-head-row`, "th")]), body.length === 0 ? null : h("tbody", { key: `${key}-body` }, body.map((row, index) => renderRow(row, `${key}-body-${index}`, "td")))].filter((child) => child != null);
|
|
1066
762
|
const override = ctx.components?.table;
|
|
1067
|
-
if (override != null) return h(override, {
|
|
763
|
+
if (override != null) return h(override, {
|
|
764
|
+
key,
|
|
765
|
+
...sourceLineFields(node, ctx)
|
|
766
|
+
}, () => content);
|
|
1068
767
|
return h("div", {
|
|
1069
768
|
key,
|
|
1070
|
-
class: "astryx-markdown__table-wrap"
|
|
769
|
+
class: "astryx-markdown__table-wrap",
|
|
770
|
+
...sourceLineAttrs(node, ctx)
|
|
1071
771
|
}, [h("table", { class: "astryx-markdown__table" }, content)]);
|
|
1072
772
|
}
|
|
1073
773
|
case "thematicBreak": {
|
|
1074
774
|
const override = ctx.components?.hr;
|
|
1075
|
-
if (override != null) return h(override, {
|
|
775
|
+
if (override != null) return h(override, {
|
|
776
|
+
key,
|
|
777
|
+
...sourceLineFields(node, ctx)
|
|
778
|
+
});
|
|
1076
779
|
return h("hr", {
|
|
1077
780
|
key,
|
|
1078
|
-
class: "astryx-markdown__hr"
|
|
781
|
+
class: "astryx-markdown__hr",
|
|
782
|
+
...sourceLineAttrs(node, ctx)
|
|
1079
783
|
});
|
|
1080
784
|
}
|
|
1081
785
|
case "footnoteDefinition": {
|
|
@@ -1114,15 +818,11 @@ function renderMarkdownBlocks(nodes, settledCount, ctx, cache) {
|
|
|
1114
818
|
for (const node of cache.keys()) if (!alive.has(node)) cache.delete(node);
|
|
1115
819
|
return vnodes;
|
|
1116
820
|
}
|
|
1117
|
-
function slotText(nodes) {
|
|
1118
|
-
if (nodes == null) return "";
|
|
1119
|
-
return nodes.map((node) => {
|
|
1120
|
-
if (typeof node.children === "string") return node.children;
|
|
1121
|
-
return "";
|
|
1122
|
-
}).join("");
|
|
1123
|
-
}
|
|
1124
821
|
//#endregion
|
|
1125
822
|
//#region src/Markdown/Markdown.vue
|
|
823
|
+
function isVueMarkdownPlugin(plugin) {
|
|
824
|
+
return !isMarkdownPluginEntry(plugin);
|
|
825
|
+
}
|
|
1126
826
|
function fadeSpanCount() {
|
|
1127
827
|
const fallback = 165;
|
|
1128
828
|
let duration = fallback;
|
|
@@ -1227,10 +927,19 @@ const _sfc_main = defineComponent({
|
|
|
1227
927
|
boundaries = [];
|
|
1228
928
|
previousLength = 0;
|
|
1229
929
|
} else boundaries = computeBoundaries(boundaries, previousLength, fadeSpanCount());
|
|
1230
|
-
const
|
|
930
|
+
const allPlugins = props.plugins ?? [];
|
|
931
|
+
const protocolPlugins = allPlugins.filter(isMarkdownPluginEntry);
|
|
932
|
+
const vuePlugins = allPlugins.filter(isVueMarkdownPlugin);
|
|
933
|
+
let rootNode = {
|
|
1231
934
|
type: "root",
|
|
1232
935
|
children: parsed.blocks
|
|
1233
|
-
}
|
|
936
|
+
};
|
|
937
|
+
if (protocolPlugins.length > 0) {
|
|
938
|
+
const isFinal = !props.isStreaming;
|
|
939
|
+
rootNode = applyMarkdownSyntax(rootNode, shown, protocolPlugins, isFinal);
|
|
940
|
+
rootNode = applyProtocolTransforms(rootNode, protocolPlugins, shown, isFinal);
|
|
941
|
+
}
|
|
942
|
+
const blocks = applyInlinePlugins(applyMarkdownPlugins(rootNode, vuePlugins), props.inlinePlugins).children ?? [];
|
|
1234
943
|
const ctx = {
|
|
1235
944
|
components: props.components,
|
|
1236
945
|
fade: {
|
|
@@ -1250,8 +959,10 @@ const _sfc_main = defineComponent({
|
|
|
1250
959
|
citationOrder: /* @__PURE__ */ new Map(),
|
|
1251
960
|
citationStyle: props.citationStyle ?? "label",
|
|
1252
961
|
citationLabel: messages.value.citation.label,
|
|
1253
|
-
plugins:
|
|
962
|
+
plugins: vuePlugins,
|
|
1254
963
|
inlinePlugins: props.inlinePlugins,
|
|
964
|
+
sourceLines: protocolPlugins.some(isMarkdownSourceLinesPlugin),
|
|
965
|
+
protocolRenderers: collectProtocolRenderers(protocolPlugins),
|
|
1255
966
|
checkboxIndicator: checkboxIndicator.value
|
|
1256
967
|
};
|
|
1257
968
|
const children = renderMarkdownBlocks(blocks, inline ? 0 : parsed.settledCount, ctx, cache);
|
|
@@ -1279,4 +990,4 @@ const _sfc_main = defineComponent({
|
|
|
1279
990
|
}
|
|
1280
991
|
});
|
|
1281
992
|
//#endregion
|
|
1282
|
-
export {
|
|
993
|
+
export { visitMarkdownNodes as a, defineMarkdownPlugin as i, applyInlinePlugins as n, applyMarkdownPlugins as r, _sfc_main as t };
|