@astryx-vue/core 0.33.3 → 0.34.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AlertDialog/index.js +1 -1
- package/dist/{AlertDialog-BwH9WU-t.js → AlertDialog-CdrF01J0.js} +5 -5
- package/dist/AppShell/index.js +1 -1
- package/dist/{AppShell-BwzRYOky.js → AppShell-4hWTPKSD.js} +5 -5
- package/dist/AvatarGroup/index.d.ts +1 -1
- package/dist/AvatarGroup/index.js +1 -1
- package/dist/{AvatarGroup-C0V--ipx.js → AvatarGroup-CACtdvXz.js} +1 -1
- package/dist/Banner/index.d.ts +1 -1
- package/dist/Banner/index.js +1 -1
- package/dist/{Banner-Ds5KIeES.js → Banner-CAyN5-NO.js} +1 -1
- package/dist/Breadcrumbs/index.js +2 -2
- package/dist/{Breadcrumbs-DWAYp-JJ.js → Breadcrumbs-BQnrbWXt.js} +1 -1
- package/dist/Button/index.js +1 -1
- package/dist/{Button-X-Q_ghg8.js → Button-CrZtv_4j.js} +2 -2
- package/dist/ButtonGroup/index.d.ts +1 -1
- package/dist/ButtonGroup/index.js +1 -1
- package/dist/{ButtonGroup-DsYdUmF1.js → ButtonGroup-Jgx-IWPz.js} +2 -2
- package/dist/Calendar/index.d.ts +1 -1
- package/dist/Carousel/index.d.ts +1 -1
- package/dist/Carousel/index.js +1 -1
- package/dist/{Carousel-D8uVV1J_.js → Carousel-BdhtUtf-.js} +1 -1
- package/dist/Chat/index.d.ts +1 -1
- package/dist/Chat/index.js +1 -1
- package/dist/{Chat-Dy-icS2C.js → Chat-DT712Yft.js} +1 -1
- package/dist/CheckboxInput/index.d.ts +1 -1
- package/dist/CheckboxInput/index.js +1 -1
- package/dist/{CheckboxInput-CiUtutIS.js → CheckboxInput-D8N6yvK5.js} +79 -74
- package/dist/CheckboxList/index.d.ts +1 -1
- package/dist/CheckboxList/index.js +1 -1
- package/dist/{CheckboxListItem-B6sV7-Og.js → CheckboxListItem--iUp9-KO.js} +4 -4
- package/dist/ClickableCard/index.d.ts +1 -1
- package/dist/ClickableCard/index.js +1 -1
- package/dist/{ClickableCard-DDk_RtHd.js → ClickableCard-B_upAn7L.js} +1 -1
- package/dist/Code/index.d.ts +3 -2
- package/dist/Code/index.js +3 -2
- package/dist/Code/languages/dockerfile/index.d.ts +5 -0
- package/dist/Code/languages/dockerfile/index.js +47 -0
- package/dist/Code/languages/graphql/index.d.ts +5 -0
- package/dist/Code/languages/graphql/index.js +24 -0
- package/dist/Code/languages/java/index.d.ts +5 -0
- package/dist/Code/languages/java/index.js +17 -0
- package/dist/Code/languages/lua/index.d.ts +5 -0
- package/dist/Code/languages/lua/index.js +14 -0
- package/dist/Code/languages/objective-c/index.d.ts +5 -0
- package/dist/Code/languages/objective-c/index.js +29 -0
- package/dist/Code/languages/powershell/index.d.ts +5 -0
- package/dist/Code/languages/powershell/index.js +36 -0
- package/dist/Code/languages/ruby/index.d.ts +5 -0
- package/dist/Code/languages/ruby/index.js +21 -0
- package/dist/Code/languages/thrift/index.d.ts +5 -0
- package/dist/Code/languages/thrift/index.js +15 -0
- package/dist/Code/languages/toml/index.d.ts +5 -0
- package/dist/Code/languages/toml/index.js +55 -0
- package/dist/{CodeBlock-r2-MlpBB.js → CodeBlock-BkqcfoZ1.js} +309 -96
- package/dist/Collapsible/index.js +1 -1
- package/dist/{Collapsible-0XI3tKgj.js → Collapsible-BKt7UCeF.js} +3 -3
- package/dist/CommandPalette/index.js +1 -1
- package/dist/{CommandPalette-BYR0Lxxd.js → CommandPalette-CvOeE6i-.js} +2 -2
- package/dist/ComplexSelector/index.d.ts +1 -1
- package/dist/ComplexSelector/index.js +1 -1
- package/dist/{ComplexSelector-CIXrqCoX.js → ComplexSelector-CVEfoN0k.js} +2 -2
- package/dist/ContextMenu/index.d.ts +1 -1
- package/dist/ContextMenu/index.js +2 -2
- package/dist/{ContextMenu-CfVyaP5v.js → ContextMenu-ZqWtb5Si.js} +3 -3
- package/dist/DateInput/index.d.ts +1 -1
- package/dist/DateInput/index.js +1 -1
- package/dist/{DateInput-DRzZ8dY7.js → DateInput-7FFzOvcu.js} +2 -2
- package/dist/DateRangeInput/index.d.ts +1 -1
- package/dist/DateRangeInput/index.js +1 -1
- package/dist/{DateRangeInput-DL2aOQXJ.js → DateRangeInput-C0ICAvm7.js} +3 -3
- package/dist/DateTimeInput/index.d.ts +1 -1
- package/dist/DateTimeInput/index.js +1 -1
- package/dist/{DateTimeInput-KWkpamG4.js → DateTimeInput-CaX09wfm.js} +4 -4
- package/dist/Dialog/index.js +3 -3
- package/dist/{Dialog-BM5VEE8z.js → Dialog-B1xC9xMC.js} +1 -1
- package/dist/{Dialog-CJzq1gms.js → Dialog-BmdNX3NC.js} +1 -1
- package/dist/{DialogHeader-Do4EOX2f.js → DialogHeader-DLaiYrvF.js} +2 -2
- package/dist/Drawer/index.d.ts +1 -1
- package/dist/Drawer/index.js +1 -1
- package/dist/{Drawer-DuQ620WO.js → Drawer-BpuER-VT.js} +2 -2
- package/dist/DropdownMenu/index.js +2 -2
- package/dist/{DropdownMenu-CbENfJOq.js → DropdownMenu-K8JPIcSk.js} +6 -6
- package/dist/Field/index.js +3 -3
- package/dist/{Field-B1fsgAqp.js → Field-CjC4qc2q.js} +1 -1
- package/dist/{FieldInfoTip-CntJCcnM.js → FieldInfoTip-Cu4LNidQ.js} +1 -1
- package/dist/{FieldLabel-D56uJrRE.js → FieldLabel-BFBAGrFY.js} +1 -1
- package/dist/FileInput/index.js +1 -1
- package/dist/{FileInput-EjlruVVX.js → FileInput-DFsbOoe-.js} +3 -3
- package/dist/IconButton/index.js +1 -1
- package/dist/{IconButton-CXg9qTRM.js → IconButton-BPjZPGRy.js} +1 -1
- package/dist/InfoTip/index.d.ts +1 -1
- package/dist/InfoTip/index.js +1 -1
- package/dist/{InfoTip-jFet-iAx.js → InfoTip-DqDgJRtp.js} +1 -1
- package/dist/{InputClearButton-DBTrsrSH.js → InputClearButton-BZzOtoH7.js} +1 -1
- package/dist/InputGroup/index.js +1 -1
- package/dist/{InputGroup-D7UBxktR.js → InputGroup-BN6v-b9L.js} +1 -1
- package/dist/InternationalizationProvider/index.d.ts +1 -1
- package/dist/InternationalizationProvider/index.js +1 -1
- package/dist/{InternationalizationProvider-BGtwZDY0.js → InternationalizationProvider-DzNfleAX.js} +1 -1
- package/dist/{Item-DbalBZXc.js → Item-BzjepDWA.js} +2 -2
- package/dist/Layout/index.js +2 -2
- package/dist/{Layout-BEJwZon4.js → Layout-SJoCw8NC.js} +1 -1
- package/dist/{LayoutPanel-BgJdL0KV.js → LayoutPanel-DZN4RxX6.js} +1 -1
- package/dist/Lightbox/index.js +1 -1
- package/dist/{Lightbox-DJXB22k0.js → Lightbox-K2cAUZRG.js} +1 -1
- package/dist/Link/index.d.ts +1 -1
- package/dist/Link/index.js +1 -1
- package/dist/{Link-eXwB0Hjg.js → Link-v-K2lhCh.js} +1 -1
- package/dist/List/index.d.ts +1 -1
- package/dist/List/index.js +2 -2
- package/dist/{ListItem-C5B8uYyn.js → ListItem-BTcwwpFb.js} +3 -3
- package/dist/Markdown/index.d.ts +1 -1
- package/dist/Markdown/index.js +2 -2
- package/dist/Markdown/parser/index.js +1 -1
- package/dist/{Markdown-COub2yng.js → Markdown-B4WsMYzN.js} +80 -5
- package/dist/MetadataList/index.d.ts +1 -1
- package/dist/MobileNav/index.js +1 -1
- package/dist/{MobileNavToggle-DI5yDKfp.js → MobileNavToggle-AgT6hzTg.js} +1 -1
- package/dist/MoreMenu/index.d.ts +1 -1
- package/dist/MoreMenu/index.js +1 -1
- package/dist/{MoreMenu-C7gie2PE.js → MoreMenu-BF9qhsxq.js} +5 -5
- package/dist/MultiSelector/index.d.ts +1 -1
- package/dist/MultiSelector/index.js +1 -1
- package/dist/{MultiSelector-CnGUU8P3.js → MultiSelector-CDMoxGKV.js} +4 -4
- package/dist/NavItem/index.d.ts +1 -1
- package/dist/NavItem/index.js +1 -1
- package/dist/{NavItem-Cciu9aok.js → NavItem-DUnSwKRl.js} +1 -1
- package/dist/NavMenu/index.js +2 -2
- package/dist/{NavMenu--iyy_m84.js → NavMenu-DAnQr1S5.js} +1 -1
- package/dist/{NavMenuItem-BmAm-Cv8.js → NavMenuItem-CrTUxgBP.js} +2 -2
- package/dist/NumberInput/index.d.ts +1 -1
- package/dist/NumberInput/index.js +1 -1
- package/dist/{NumberInput-CD9sHbON.js → NumberInput-DQ7FMUTd.js} +3 -3
- package/dist/Outline/index.js +1 -1
- package/dist/{Outline-vieAJS2J.js → Outline-CSHJqtg4.js} +2 -2
- package/dist/OverflowList/index.d.ts +1 -1
- package/dist/OverflowList/index.js +1 -1
- package/dist/{OverflowList-YLVHypB3.js → OverflowList-CK6sgmY3.js} +1 -1
- package/dist/Overlay/index.d.ts +1 -1
- package/dist/Pagination/index.d.ts +1 -1
- package/dist/Pagination/index.js +1 -1
- package/dist/{Pagination-Bnkp4oAA.js → Pagination-B-337WLy.js} +2 -2
- package/dist/{PanGestureRecognizer-CzIWpazn.js → PanGestureRecognizer-yYMpXB93.js} +1 -1
- package/dist/Popover/index.js +1 -1
- package/dist/{Popover-CYJ1z_7L.js → Popover-DVrWAYg2.js} +4 -4
- package/dist/PowerSearch/index.d.ts +1 -1
- package/dist/PowerSearch/index.js +1 -1
- package/dist/{PowerSearch-DEpXEmgs.js → PowerSearch-sWyeh9Az.js} +19 -19
- package/dist/{PressTracker-L5-Ark_9.js → PressTracker-CjfG1d8n.js} +2 -2
- package/dist/ProgressBar/index.d.ts +1 -1
- package/dist/Radio/index.d.ts +1 -1
- package/dist/Radio/index.js +1 -1
- package/dist/{RadioGroup-BdO-xZv0.js → RadioGroup-BloTgj7H.js} +8 -5
- package/dist/RadioList/index.d.ts +1 -1
- package/dist/RadioList/index.js +1 -1
- package/dist/{RadioListItem-DzGPuWTt.js → RadioListItem-BERujpW8.js} +1 -1
- package/dist/Resizable/index.js +1 -1
- package/dist/{ResizeHandle-Dcel1HkU.js → ResizeHandle-J9-dAMuo.js} +1 -1
- package/dist/ScrollableArea/index.d.ts +1 -1
- package/dist/SegmentedControl/index.js +1 -1
- package/dist/SegmentedControl-BzvLJL8T.js +1465 -0
- package/dist/SelectableCard/index.d.ts +1 -1
- package/dist/SelectableCard/index.js +1 -1
- package/dist/{SelectableCard-BZTF6qw-.js → SelectableCard-IAv2X4dq.js} +1 -1
- package/dist/Selector/index.d.ts +1 -1
- package/dist/Selector/index.js +1 -1
- package/dist/{Selector-SkwSbf4j.js → Selector-CsEWOfWV.js} +2 -2
- package/dist/SideNav/index.d.ts +1 -1
- package/dist/SideNav/index.js +2 -2
- package/dist/{SideNav-BxJfJU95.js → SideNav-CVAi462m.js} +6 -6
- package/dist/Slider/index.js +1 -1
- package/dist/{Slider-ORmi7QJ7.js → Slider-D0omHlRI.js} +6 -5
- package/dist/Stepper/index.d.ts +1 -1
- package/dist/Stepper/index.js +1 -1
- package/dist/{Stepper-C4-wtxn4.js → Stepper-CetoMTog.js} +1 -1
- package/dist/Switch/index.d.ts +1 -1
- package/dist/Switch/index.js +1 -1
- package/dist/{Switch-Cw1UKVjQ.js → Switch-DTwurKmh.js} +11 -82
- package/dist/TabList/index.js +1 -1
- package/dist/{TabList-DNDe2ipJ.js → TabList-BJTT4nm6.js} +2 -2
- package/dist/Table/index.d.ts +1 -1
- package/dist/Table/index.js +1 -1
- package/dist/{Table-CqppyRk8.js → Table-CUqi9BXT.js} +13 -13
- package/dist/TextArea/index.d.ts +1 -1
- package/dist/TextArea/index.js +1 -1
- package/dist/{TextArea-I3ghDb9r.js → TextArea-BKwmXPGQ.js} +4 -4
- package/dist/TextInput/index.d.ts +1 -1
- package/dist/TextInput/index.js +1 -1
- package/dist/{TextInput-Xz_ibpOl.js → TextInput-CRXs8cDs.js} +4 -4
- package/dist/Thumbnail/index.js +1 -1
- package/dist/{Thumbnail-bS62Tr_f.js → Thumbnail-GUwgnwZb.js} +2 -2
- package/dist/{TimeField-Bsb8n22d.js → TimeField-Bn_ziTCi.js} +1 -1
- package/dist/TimeInput/index.d.ts +1 -1
- package/dist/TimeInput/index.js +1 -1
- package/dist/{TimeInput-D40_6GrX.js → TimeInput-BKkwmN1V.js} +2 -2
- package/dist/Timestamp/index.d.ts +1 -1
- package/dist/Timestamp/index.js +1 -1
- package/dist/{Timestamp-Bt9ZR975.js → Timestamp-Dlz2SvSe.js} +1 -1
- package/dist/Toast/index.js +1 -1
- package/dist/{Toast-BQxfIeVU.js → Toast-BSnsRCyB.js} +3 -3
- package/dist/ToggleButton/index.d.ts +1 -1
- package/dist/ToggleButton/index.js +1 -1
- package/dist/{ToggleButton-IFhFMpQh.js → ToggleButton-DE79lIQq.js} +3 -3
- package/dist/Token/index.js +1 -1
- package/dist/{Token-CpmqfG4i.js → Token-BdClMOG9.js} +1 -1
- package/dist/Tokenizer/index.d.ts +1 -1
- package/dist/Tokenizer/index.js +1 -1
- package/dist/{Tokenizer-Dvr7ICpS.js → Tokenizer-BitI30VU.js} +7 -7
- package/dist/Toolbar/index.d.ts +1 -1
- package/dist/TopNav/index.d.ts +1 -1
- package/dist/TopNav/index.js +1 -1
- package/dist/{TopNav-Cw_dcKpf.js → TopNav-BUjEldSq.js} +3 -3
- package/dist/TreeList/index.d.ts +1 -1
- package/dist/TreeList/index.js +1 -1
- package/dist/{TreeList-CBfKKbUQ.js → TreeList-BVJ3V-xI.js} +4 -4
- package/dist/Typeahead/index.js +1 -1
- package/dist/{Typeahead-D9-WjsCU.js → Typeahead-C54ao2ye.js} +3 -3
- package/dist/{accessibleName-Cw9s1690.js → accessibleName-19W3jhkD.js} +2 -2
- package/dist/{assertOptions-V_jJxpn9.js → assertOptions-Byu4Yqfg.js} +1 -1
- package/dist/boxHold-0ChMpiin.js +170 -0
- package/dist/browserClickWait-DIj9tkLa.js +77 -0
- package/dist/{coarsePointer-DGnAPIcU.js → coarsePointer-BWNSUIY8.js} +2 -32
- package/dist/code-block-DCVrTLMZ.js +19 -0
- package/dist/composables/index.js +6 -6
- package/dist/{composables-BJoAw6XA.js → composables-CF2weN-L.js} +3 -2
- package/dist/{context-WDet15_N.js → context-C1MPE6J5.js} +1 -1
- package/dist/{geometry-CoQRz-F1.js → geometry-BnZ6uDX_.js} +6 -131
- package/dist/grammar-4Pn2745Q.d.ts +58 -0
- package/dist/grammar-Dz71GleT.js +144 -0
- package/dist/{holdEntranceInput-BsusS3bM.js → holdEntranceInput-C8B_DYYs.js} +1 -1
- package/dist/{index-CQi9WGWE.d.ts → index-AgTJRqUY.d.ts} +2 -2
- package/dist/{index-BuubzuE8.d.ts → index-BDZCJ9ri.d.ts} +2 -2
- package/dist/{index-CTv55aOa.d.ts → index-BRr_eg_u.d.ts} +1 -1
- package/dist/{index-ChqMaV6N.d.ts → index-BZDl_iLU.d.ts} +61 -13
- package/dist/{index-ZKBj_1nu.d.ts → index-BfFpUr1B.d.ts} +1 -1
- package/dist/{index-CKnr0JlT.d.ts → index-C4S65SAW.d.ts} +1 -1
- package/dist/{index-CY0KtUSC.d.ts → index-CArlEl1O.d.ts} +515 -119
- package/dist/{index-COgrQZIL.d.ts → index-CdvmnNMH.d.ts} +1 -1
- package/dist/{index-DuxRUPMc.d.ts → index-D1C2Nt3F.d.ts} +3 -3
- package/dist/{index-BVx-HFp8.d.ts → index-D9t_l8pJ.d.ts} +1 -1
- package/dist/{index-D1JOMiI5.d.ts → index-DHsYyqMP.d.ts} +4 -4
- package/dist/{index-utZGF4GR.d.ts → index-NOXYEdOI.d.ts} +1 -1
- package/dist/{index-BqQlY3fL.d.ts → index-QC9FDUDA.d.ts} +2 -2
- package/dist/{index-BI1QLuYB.d.ts → index-ZXrvTM3A.d.ts} +3 -3
- package/dist/{index-Pad9p8CU.d.ts → index-a6o69uPN.d.ts} +1 -1
- package/dist/{index-GyRgg1-v.d.ts → index-uLDBzCDo.d.ts} +5 -5
- package/dist/index.d.ts +19 -19
- package/dist/index.js +90 -88
- package/dist/{landing-Qk_FHR-s.js → landing-BW6qLvC8.js} +1 -1
- package/dist/{loadCatalog-BODWYaNy.d.ts → loadCatalog-C_Cy_8WN.d.ts} +2 -0
- package/dist/{loadCatalog-DMOOMWtw.js → loadCatalog-VlWGFIMU.js} +6 -17
- package/dist/locale/index.d.ts +2 -2
- package/dist/locale/index.js +3 -2
- package/dist/{locale-C8X7gJlc.js → locale-U0KLmREA.js} +1 -1
- package/dist/{presentationHold-CZsVmjlY.js → presentationHold-ZKixVLcz.js} +1 -1
- package/dist/pressClaim-DvdlIn4w.js +24 -0
- package/dist/{pressFeedback-9ogipvI4.js → pressFeedback-B3cqaMGl.js} +45 -5
- package/dist/{publicParser-C8RBKNLA.js → publicParser-Dbu2LRTf.js} +2 -2
- package/dist/{reportChange-BUTgduu-.js → reportChange-DwOfucSf.js} +1 -1
- package/dist/{resizableChannel-_j_AW2B6.js → resizableChannel-BnwrR5tr.js} +2 -2
- package/dist/selectionLock-BrUpRS0E.js +130 -0
- package/dist/{themeTiming-ClYaZxGf.js → themeTiming-BJziEh4O.js} +1 -1
- package/dist/touchQueries-xy5IeZfe.js +32 -0
- package/dist/{useActionGroupTracking-ByLJoM-8.js → useActionGroupTracking-D0IwimcQ.js} +2 -2
- package/dist/{useAnimatedLayout-IcX0UfS4.js → useAnimatedLayout-CRAuCwTZ.js} +1 -1
- package/dist/{useHeldPresentation-DJEthuMT.js → useHeldPresentation-CaIKTwUh.js} +1 -1
- package/dist/{useInputStatusIcon-D0q4S1Ye.js → useInputStatusIcon-C2AkJiAT.js} +1 -1
- package/dist/{useMenuEntranceHold-B7f9ShX2.js → useMenuEntranceHold-C-kHicUN.js} +1 -1
- package/dist/{useMenuPress-cBIQyTsN.js → useMenuPress-B5h9PBx_.js} +3 -1
- package/dist/{usePressFeedback-Dx-a3i82.js → usePressFeedback-iyoKakPX.js} +1 -1
- package/dist/{useResizable-JvgYydox.js → useResizable-I0APFcMz.js} +1 -1
- package/dist/{useTouchHitArea-BGkvMAyp.js → useTouchHitArea-MvzPCmJg.js} +1 -1
- package/package.json +37 -1
- package/reset.css +14 -0
- package/styles/code.css +85 -8
- package/styles/markdown.css +6 -5
- package/styles/progress-bar.css +25 -26
- package/styles/segmented-control.css +20 -11
- package/dist/SegmentedControl-BURyE9XU.js +0 -416
- package/dist/index-C9ZssPUV.d.ts +0 -380
|
@@ -199,6 +199,26 @@ const PRESSED_ATTRIBUTE = "data-astryx-press";
|
|
|
199
199
|
/** 手指离开后多久内的滚动还可能是那根手指甩出去的惯性。iOS 的惯性滚动会持续一两秒。 */
|
|
200
200
|
const PRESS_GESTURE_MEMORY_MS = UIKIT_PRESS.momentumMemory.value;
|
|
201
201
|
let live = null;
|
|
202
|
+
/**
|
|
203
|
+
* 手指或笔落在控件框上的这次接触(utils/boxHold.ts):记着它的指针、它开始的那次按压
|
|
204
|
+
* (刹车时没有)和框按住的收尾。刹车的接触也算,被滚动取消的也算,各自在自己的抬起或取消时结束。
|
|
205
|
+
* 只有抬起时按压还活着,才算「停着抬起」。
|
|
206
|
+
*/
|
|
207
|
+
let contact = null;
|
|
208
|
+
/** 结束这次框上的接触,并且只告诉框按住一次。 */
|
|
209
|
+
function endContact(isStillLift) {
|
|
210
|
+
const ended = contact;
|
|
211
|
+
contact = null;
|
|
212
|
+
ended?.end(isStillLift);
|
|
213
|
+
}
|
|
214
|
+
let boxHold = null;
|
|
215
|
+
/**
|
|
216
|
+
* 装上框按住。只有用到框组件(复选框、单选)的页面才加载它,
|
|
217
|
+
* 只有按钮和链接的页面不带这段代码。
|
|
218
|
+
*/
|
|
219
|
+
function installBoxHold(hold) {
|
|
220
|
+
boxHold = hold;
|
|
221
|
+
}
|
|
202
222
|
/** 有几个调用方装着控制器。大于 0 时监听才在。 */
|
|
203
223
|
let holders = 0;
|
|
204
224
|
/** 上一次「被手指带动」的滚动发生在什么时候、在哪个滚动容器里。只记手指带动的,程序滚动不算。 */
|
|
@@ -320,6 +340,7 @@ function finish() {
|
|
|
320
340
|
}
|
|
321
341
|
function onPointerDown(event) {
|
|
322
342
|
if (event.pointerType === "mouse") return;
|
|
343
|
+
endContact(false);
|
|
323
344
|
if (live != null) {
|
|
324
345
|
const fingerIsUp = live.gesture.phase === "fading" || live.gesture.phase === "flash";
|
|
325
346
|
finish();
|
|
@@ -329,13 +350,21 @@ function onPointerDown(event) {
|
|
|
329
350
|
const braking = element != null && scrollerIsBraking(element);
|
|
330
351
|
lastTouchAt = Date.now();
|
|
331
352
|
lastTouchTarget = event.target instanceof Node ? event.target : null;
|
|
332
|
-
if (element == null
|
|
333
|
-
|
|
353
|
+
if (element == null) return;
|
|
354
|
+
const end = boxHold?.start(element, event.target) ?? null;
|
|
355
|
+
const pressed = braking ? null : {
|
|
334
356
|
element,
|
|
335
357
|
gesture: idlePressGesture(),
|
|
336
358
|
pointerId: event.pointerId,
|
|
337
359
|
timer: null
|
|
338
360
|
};
|
|
361
|
+
if (end != null) contact = {
|
|
362
|
+
pointerId: event.pointerId,
|
|
363
|
+
live: pressed,
|
|
364
|
+
end
|
|
365
|
+
};
|
|
366
|
+
if (pressed == null) return;
|
|
367
|
+
live = pressed;
|
|
339
368
|
apply(pressGestureStep(live.gesture, {
|
|
340
369
|
kind: "down",
|
|
341
370
|
x: event.clientX,
|
|
@@ -358,12 +387,18 @@ function onPointerUp(event) {
|
|
|
358
387
|
if (event.pointerType === "mouse") return;
|
|
359
388
|
lastTouchAt = Date.now();
|
|
360
389
|
if (event.target instanceof Node) lastTouchTarget = event.target;
|
|
390
|
+
if (contact != null && contact.pointerId === event.pointerId) {
|
|
391
|
+
const pressed = contact.live;
|
|
392
|
+
endContact(pressed != null && live === pressed && pressed.gesture.phase !== "dead");
|
|
393
|
+
}
|
|
361
394
|
if (isOtherPointer(event)) return;
|
|
362
395
|
apply(pressGestureStep(live.gesture, { kind: "up" }));
|
|
363
396
|
releaseIfDead();
|
|
364
397
|
}
|
|
365
398
|
/** 滚动接管了手势,或者平台拿走了它。iOS 上 pointercancel 比第一个 scroll 事件还早到。 */
|
|
366
|
-
function onCancel() {
|
|
399
|
+
function onCancel(event) {
|
|
400
|
+
const pointerId = event?.pointerId;
|
|
401
|
+
if (pointerId != null && contact?.pointerId === pointerId) endContact(false);
|
|
367
402
|
if (live == null) return;
|
|
368
403
|
apply(pressGestureStep(live.gesture, { kind: "cancel" }));
|
|
369
404
|
releaseIfDead();
|
|
@@ -380,7 +415,10 @@ function onScroll(event) {
|
|
|
380
415
|
}
|
|
381
416
|
/** 兜底:页面被切到后台时,不留下亮着的元素。 */
|
|
382
417
|
function onVisibilityChange() {
|
|
383
|
-
if (document.visibilityState === "hidden")
|
|
418
|
+
if (document.visibilityState === "hidden") {
|
|
419
|
+
endContact(false);
|
|
420
|
+
finish();
|
|
421
|
+
}
|
|
384
422
|
}
|
|
385
423
|
/** 控制器在共用输入流(utils/inputStream.ts)上的订阅,全都被动,只在有人持有时存在。 */
|
|
386
424
|
let unsubscribers = [];
|
|
@@ -397,6 +435,8 @@ function addListeners() {
|
|
|
397
435
|
];
|
|
398
436
|
}
|
|
399
437
|
function removeListeners() {
|
|
438
|
+
endContact(false);
|
|
439
|
+
boxHold?.endWaits();
|
|
400
440
|
for (const unsubscribe of unsubscribers) unsubscribe();
|
|
401
441
|
unsubscribers = [];
|
|
402
442
|
}
|
|
@@ -427,4 +467,4 @@ function installPressFeedback() {
|
|
|
427
467
|
};
|
|
428
468
|
}
|
|
429
469
|
//#endregion
|
|
430
|
-
export {
|
|
470
|
+
export { PRESSABLE_ATTRIBUTE as a, PRESS_GROUP_ITEM_ATTRIBUTE as c, isInsideScrollView as d, parseTouchAction as f, msSinceInput as h, pressFadeMs as i, isTrackedByGroup as l, clockOf as m, installBoxHold as n, PRESS_ACTION_ATTRIBUTE as o, rootOverflow as p, installPressFeedback as r, PRESS_CONTAINER_ATTRIBUTE as s, PRESSED_ATTRIBUTE as t, SCROLLABLE_OVERFLOW as u };
|
|
@@ -308,7 +308,7 @@ function comparableUrl(normalized) {
|
|
|
308
308
|
return normalized.toLowerCase().replace(/^([a-z][a-z\d+.-]*:) +/, "$1");
|
|
309
309
|
}
|
|
310
310
|
function isBlockedNavigation(url) {
|
|
311
|
-
return url.startsWith("javascript:") || url.startsWith("vbscript:") || url.startsWith("data:
|
|
311
|
+
return url.startsWith("javascript:") || url.startsWith("vbscript:") || url.startsWith("data:");
|
|
312
312
|
}
|
|
313
313
|
/**
|
|
314
314
|
* The parser's own rule: an unsafe destination is read as text, never as a
|
|
@@ -319,7 +319,7 @@ function isSafeMarkdownParserUrl(url) {
|
|
|
319
319
|
}
|
|
320
320
|
/**
|
|
321
321
|
* Navigation target with control characters removed.
|
|
322
|
-
* `javascript:`, `vbscript:`, and
|
|
322
|
+
* `javascript:`, `vbscript:`, and every `data:` URL are dropped.
|
|
323
323
|
*/
|
|
324
324
|
function sanitizeMarkdownLinkUrl(url) {
|
|
325
325
|
const normalized = normalizeUrl(url);
|
|
@@ -3,7 +3,7 @@ import { d as toSpring } from "./roles-DWH31Bn3.js";
|
|
|
3
3
|
import { c as solveSpring, i as reducedMotionCrossFade, n as sampleCount, s as settlingDuration, t as linearEasing } from "./linearEasing-VHwy6xl_.js";
|
|
4
4
|
import { r as themeReducesMotion } from "./reducedMotionMark-CYSyfURo.js";
|
|
5
5
|
import { a as registerPresentedOffset, c as writePresentedResolve, n as clearPresentedResolve, t as batchPresented } from "./presentation-twEOzzJq.js";
|
|
6
|
-
import {
|
|
6
|
+
import { i as readThemeTokenText, n as readThemeTiming } from "./themeTiming-BJziEh4O.js";
|
|
7
7
|
//#region src/motion/layout/glides.ts
|
|
8
8
|
/**
|
|
9
9
|
* @file glides.ts
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { o as sharedWeakMap } from "./sharedRealm-DBtNH73I.js";
|
|
2
2
|
import { t as resolveMotion } from "./resolveMotion-DftkGFw6.js";
|
|
3
3
|
import { o as springs } from "./springs-DjAn_oV5.js";
|
|
4
|
-
import { C as safeAnimate, D as scaleOf, E as intersects, O as visibleRect, _ as layoutMotion, a as placeOf, b as springGlide, c as areaOf, d as extentOf, f as isRtl, g as glideNextChange, h as changeStartIn, i as nextInFlow, k as glideOf, l as createAnimatedLayout, m as pxClip, n as rideNeighbour, p as previousInFlow, t as reportLayoutChange, x as beginChange, y as sampleOver } from "./reportChange-
|
|
5
|
-
import { n as landLayoutGlide } from "./landing-
|
|
4
|
+
import { C as safeAnimate, D as scaleOf, E as intersects, O as visibleRect, _ as layoutMotion, a as placeOf, b as springGlide, c as areaOf, d as extentOf, f as isRtl, g as glideNextChange, h as changeStartIn, i as nextInFlow, k as glideOf, l as createAnimatedLayout, m as pxClip, n as rideNeighbour, p as previousInFlow, t as reportLayoutChange, x as beginChange, y as sampleOver } from "./reportChange-DwOfucSf.js";
|
|
5
|
+
import { n as landLayoutGlide } from "./landing-BW6qLvC8.js";
|
|
6
6
|
//#region src/motion/layout/edgeReport.ts
|
|
7
7
|
const resizeReveals = sharedWeakMap("motion/animated-layout/resize-reveals", 1);
|
|
8
8
|
/** The inline properties a size hold sets, by axis. */
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { c as containsAlongFlatTree, g as isNode, m as isElement, o as sharedWeakMap } from "./sharedRealm-DBtNH73I.js";
|
|
2
|
+
import { n as isIosWebKit } from "./touchQueries-xy5IeZfe.js";
|
|
3
|
+
//#region src/utils/selectionLock.ts
|
|
4
|
+
/**
|
|
5
|
+
* @file selectionLock.ts
|
|
6
|
+
* @input The elements a held touch contact presses, and the touch's target
|
|
7
|
+
* @output lockSelection and locksSelectionFor give a held finger's lock;
|
|
8
|
+
* lockStyles and isTextEntry are shared with a claimed drag's hold
|
|
9
|
+
* (dragSelection.ts)
|
|
10
|
+
* @position Recognizers whose hold does something bring lockSelection; the
|
|
11
|
+
* gesture host reads locksSelectionFor, and its drag hold is
|
|
12
|
+
* dragSelection.ts
|
|
13
|
+
*/
|
|
14
|
+
/** What a held finger must not start on a control or a cell. */
|
|
15
|
+
const SELECTION_LOCK = [
|
|
16
|
+
"-webkit-touch-callout",
|
|
17
|
+
"-webkit-user-select",
|
|
18
|
+
"user-select"
|
|
19
|
+
];
|
|
20
|
+
/** Inputs whose text a held finger edits: it places the caret there. */
|
|
21
|
+
const TEXT_ENTRY_TYPES = /* @__PURE__ */ new Set([
|
|
22
|
+
"text",
|
|
23
|
+
"search",
|
|
24
|
+
"email",
|
|
25
|
+
"url",
|
|
26
|
+
"tel",
|
|
27
|
+
"password",
|
|
28
|
+
"number"
|
|
29
|
+
]);
|
|
30
|
+
/**
|
|
31
|
+
* Whether a contact of this pointer kind takes the lock: a finger or a pen,
|
|
32
|
+
* under any primary pointer, a laptop's touchscreen and a desktop pen tablet
|
|
33
|
+
* included, since a pen's hold acts as a finger's.
|
|
34
|
+
*/
|
|
35
|
+
function locksSelectionFor(pointerType) {
|
|
36
|
+
return pointerType !== "mouse";
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Locked elements, how many contacts hold each, and what to restore. Every
|
|
40
|
+
* copy of Core counts here, so the first lock's saved styles come back only
|
|
41
|
+
* after the last release in any copy.
|
|
42
|
+
*/
|
|
43
|
+
const locks = sharedWeakMap("utils/selection-lock/locks", 1);
|
|
44
|
+
/**
|
|
45
|
+
* Refuse a selection and the touch callout on `elements` (and on a non-text
|
|
46
|
+
* input target inside one of them) until the returned function runs, while
|
|
47
|
+
* any holder holds. Idempotent release.
|
|
48
|
+
*/
|
|
49
|
+
function lockSelection(elements, target) {
|
|
50
|
+
const set = new Set(elements);
|
|
51
|
+
if (isSelectableControl(target) && [...set].some((element) => containsAlongFlatTree(element, target))) set.add(target);
|
|
52
|
+
if (!isIosWebKit()) {
|
|
53
|
+
const refuse = (event) => {
|
|
54
|
+
if (!isTextEntry(event.target)) event.preventDefault();
|
|
55
|
+
};
|
|
56
|
+
for (const element of set) element.addEventListener("selectstart", refuse);
|
|
57
|
+
let isRefusing = true;
|
|
58
|
+
return () => {
|
|
59
|
+
if (isRefusing) {
|
|
60
|
+
isRefusing = false;
|
|
61
|
+
for (const element of set) element.removeEventListener("selectstart", refuse);
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
return lockStyles(set);
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* The selection-lock styles on `set`, refcounted per element; idempotent
|
|
69
|
+
* release.
|
|
70
|
+
*/
|
|
71
|
+
function lockStyles(set) {
|
|
72
|
+
const locked = [];
|
|
73
|
+
for (const element of set) {
|
|
74
|
+
const style = styleOf(element);
|
|
75
|
+
if (style == null) continue;
|
|
76
|
+
locked.push(element);
|
|
77
|
+
const lock = locks.get(element);
|
|
78
|
+
if (lock != null) {
|
|
79
|
+
lock.count += 1;
|
|
80
|
+
continue;
|
|
81
|
+
}
|
|
82
|
+
locks.set(element, {
|
|
83
|
+
count: 1,
|
|
84
|
+
saved: SELECTION_LOCK.map((name) => ({
|
|
85
|
+
name,
|
|
86
|
+
value: style.getPropertyValue(name),
|
|
87
|
+
priority: style.getPropertyPriority(name)
|
|
88
|
+
}))
|
|
89
|
+
});
|
|
90
|
+
for (const name of SELECTION_LOCK) style.setProperty(name, "none");
|
|
91
|
+
}
|
|
92
|
+
let isReleased = false;
|
|
93
|
+
return () => {
|
|
94
|
+
if (isReleased) return;
|
|
95
|
+
isReleased = true;
|
|
96
|
+
for (const element of locked) {
|
|
97
|
+
const lock = locks.get(element);
|
|
98
|
+
if (lock == null || --lock.count > 0) continue;
|
|
99
|
+
locks.delete(element);
|
|
100
|
+
const style = styleOf(element);
|
|
101
|
+
for (const { name, value, priority } of lock.saved) if (value === "") style?.removeProperty(name);
|
|
102
|
+
else style?.setProperty(name, value, priority);
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* A form control WebKit's own stylesheet makes selectable, which no
|
|
108
|
+
* ancestor's lock reaches: every input that is not a text field.
|
|
109
|
+
*/
|
|
110
|
+
function isSelectableControl(node) {
|
|
111
|
+
return isElement(node) && node.localName === "input" && !TEXT_ENTRY_TYPES.has(node.type);
|
|
112
|
+
}
|
|
113
|
+
/** Text a held finger edits: it places the caret there. */
|
|
114
|
+
function isTextEntry(node) {
|
|
115
|
+
const element = isElement(node) ? node : isNode(node) ? node.parentElement : null;
|
|
116
|
+
if (element == null) return false;
|
|
117
|
+
if (element.localName === "textarea") return true;
|
|
118
|
+
if (element.localName === "input") return TEXT_ENTRY_TYPES.has(element.type);
|
|
119
|
+
return element.isContentEditable;
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* An element's inline style, when it has one (HTML and SVG elements). It is
|
|
123
|
+
* checked as an object, so another window's style passes too.
|
|
124
|
+
*/
|
|
125
|
+
function styleOf(element) {
|
|
126
|
+
const style = element.style;
|
|
127
|
+
return typeof style === "object" && style !== null ? style : null;
|
|
128
|
+
}
|
|
129
|
+
//#endregion
|
|
130
|
+
export { locksSelectionFor as i, lockSelection as n, lockStyles as r, isTextEntry as t };
|
|
@@ -174,4 +174,4 @@ function readThemeTimingOrInstant(element, tokens) {
|
|
|
174
174
|
return (element == null ? null : readThemeTiming(element, tokens)) ?? easedProgress(0, (x) => x);
|
|
175
175
|
}
|
|
176
176
|
//#endregion
|
|
177
|
-
export {
|
|
177
|
+
export { readThemeTokenText as i, readThemeTiming as n, readThemeTimingOrInstant as r, easedProgress as t };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
//#region src/utils/touchQueries.ts
|
|
2
|
+
/**
|
|
3
|
+
* @file touchQueries.ts
|
|
4
|
+
* @input Nothing: plain strings
|
|
5
|
+
* @output TOUCH_QUERY, the media query for a coarse primary pointer; and
|
|
6
|
+
* IOS_SUPPORTS_QUERY with isIosWebKit, the iOS WebKit engine check
|
|
7
|
+
* @position The dependency-free half of touchPresentation.ts, for code that
|
|
8
|
+
* must load without React or the theme: the motion foundation, which
|
|
9
|
+
* Node-side specs and browser proofs load without a StyleX compile.
|
|
10
|
+
* touchPresentation.ts re-exports it beside the hook and the parts that
|
|
11
|
+
* read the theme.
|
|
12
|
+
*/
|
|
13
|
+
/** The primary pointer is coarse: touch behaviours. */
|
|
14
|
+
const TOUCH_QUERY = "(pointer: coarse)";
|
|
15
|
+
/**
|
|
16
|
+
* The engine is WebKit on iOS or iPadOS: the only one that implements
|
|
17
|
+
* `-webkit-touch-callout`. For a style iOS WebKit requires, never a
|
|
18
|
+
* behaviour; isIosWebKit reads it for an engine workaround a record names.
|
|
19
|
+
*/
|
|
20
|
+
const IOS_SUPPORTS_QUERY = "(-webkit-touch-callout: none)";
|
|
21
|
+
/**
|
|
22
|
+
* Whether `view`'s engine is iOS WebKit, by IOS_SUPPORTS_QUERY. Only for an
|
|
23
|
+
* engine workaround a record names (`spec:AST-013` FR6): the selection
|
|
24
|
+
* lock's inline style, and the gesture host's presented hit testing. The
|
|
25
|
+
* keyboard's rise and its scroll back from the blur read it too. False where
|
|
26
|
+
* `CSS.supports` is missing (jsdom has `CSS.escape` only).
|
|
27
|
+
*/
|
|
28
|
+
function isIosWebKit(view = globalThis) {
|
|
29
|
+
return view?.CSS?.supports?.(IOS_SUPPORTS_QUERY) === true;
|
|
30
|
+
}
|
|
31
|
+
//#endregion
|
|
32
|
+
export { isIosWebKit as n, TOUCH_QUERY as t };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { c as
|
|
2
|
-
import { i as createActionGroupTracker, o as resolveGroupTouch, r as GROUP_PRESS_POINTERS } from "./useTouchHitArea-
|
|
1
|
+
import { c as PRESS_GROUP_ITEM_ATTRIBUTE, d as isInsideScrollView, h as msSinceInput, l as isTrackedByGroup } from "./pressFeedback-B3cqaMGl.js";
|
|
2
|
+
import { i as createActionGroupTracker, o as resolveGroupTouch, r as GROUP_PRESS_POINTERS } from "./useTouchHitArea-MvzPCmJg.js";
|
|
3
3
|
import { i as PRESS_SLOP_PX, n as PRESS_ONSET_MS } from "./pressGesture-B3Efxs_z.js";
|
|
4
4
|
import { getCurrentScope, onScopeDispose, toValue, watch } from "vue";
|
|
5
5
|
//#region src/composables/internal/useActionGroupTracking.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as useAdaptivePresentation, n as usePresentationHold } from "./presentationHold-
|
|
1
|
+
import { i as useAdaptivePresentation, n as usePresentationHold } from "./presentationHold-ZKixVLcz.js";
|
|
2
2
|
import { computed, toValue, watch } from "vue";
|
|
3
3
|
//#region src/layer/useHeldPresentation.ts
|
|
4
4
|
function useHeldPresentation(presentation, isOpen) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as _sfc_main } from "./FieldIcon-BU1ZWAuo.js";
|
|
2
|
-
import { t as _sfc_main$1 } from "./FieldInfoTip-
|
|
2
|
+
import { t as _sfc_main$1 } from "./FieldInfoTip-Cu4LNidQ.js";
|
|
3
3
|
import { computed, toValue } from "vue";
|
|
4
4
|
//#region src/composables/useInputStatusIcon.ts
|
|
5
5
|
/**
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { h as msSinceInput } from "./pressFeedback-B3cqaMGl.js";
|
|
2
2
|
import { i as withoutClickGuard, r as disarmEveryClickGuard, t as armClickGuard } from "./clickGuard-CxqcfBCJ.js";
|
|
3
3
|
import { s as currentGesture } from "./layerDepth-SGFJ5L6X.js";
|
|
4
4
|
import { t as focusForLastInput } from "./focusReturn-DfZS7TCp.js";
|
|
5
|
+
import { t as claimPress } from "./pressClaim-DvdlIn4w.js";
|
|
5
6
|
import { r as isInputShield } from "./inputHoldState-BYi5FKZl.js";
|
|
6
7
|
import { getCurrentScope, onScopeDispose, toValue } from "vue";
|
|
7
8
|
//#region src/composables/useLongPress.ts
|
|
@@ -51,6 +52,7 @@ function useLongPress(options) {
|
|
|
51
52
|
timer = null;
|
|
52
53
|
deadline = null;
|
|
53
54
|
if (from == null) return;
|
|
55
|
+
claimPress();
|
|
54
56
|
options.onLongPress({
|
|
55
57
|
x: from.x,
|
|
56
58
|
y: from.y
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as
|
|
1
|
+
import { a as PRESSABLE_ATTRIBUTE, o as PRESS_ACTION_ATTRIBUTE, r as installPressFeedback, s as PRESS_CONTAINER_ATTRIBUTE } from "./pressFeedback-B3cqaMGl.js";
|
|
2
2
|
import { getCurrentInstance, getCurrentScope, onMounted, onScopeDispose } from "vue";
|
|
3
3
|
import "../styles/pressable.css";
|
|
4
4
|
//#region src/composables/usePressFeedback.ts
|
|
@@ -4,7 +4,7 @@ import { t as resolveMotion } from "./resolveMotion-DftkGFw6.js";
|
|
|
4
4
|
import { o as springs } from "./springs-DjAn_oV5.js";
|
|
5
5
|
import { t as isApplePlatform } from "./isApplePlatform-B1ju6F5B.js";
|
|
6
6
|
import { t as project } from "./projection-qPcLQcwK.js";
|
|
7
|
-
import { c as createRegionPaneSlot, f as registerPropsRegion, h as slideNextOnRelease, i as registerResizableChannel, l as edgeAxis, m as slideMotionsOf, o as resizeHandleBeside, p as shownSizeReader, s as createPaneReveal, u as isScriptMotion } from "./resizableChannel-
|
|
7
|
+
import { c as createRegionPaneSlot, f as registerPropsRegion, h as slideNextOnRelease, i as registerResizableChannel, l as edgeAxis, m as slideMotionsOf, o as resizeHandleBeside, p as shownSizeReader, s as createPaneReveal, u as isScriptMotion } from "./resizableChannel-BnwrR5tr.js";
|
|
8
8
|
import { i as rubberBandSlope, r as rubberBandInverse, t as rubberBand } from "./rubberBand-DDd5ElTe.js";
|
|
9
9
|
import { computed, onBeforeUnmount, onMounted, onScopeDispose, reactive, ref, toValue, watch } from "vue";
|
|
10
10
|
//#region src/composables/useHotkeys.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as
|
|
1
|
+
import { c as PRESS_GROUP_ITEM_ATTRIBUTE, i as pressFadeMs, l as isTrackedByGroup, t as PRESSED_ATTRIBUTE } from "./pressFeedback-B3cqaMGl.js";
|
|
2
2
|
import { t as armClickGuard } from "./clickGuard-CxqcfBCJ.js";
|
|
3
3
|
import { toValue, watch } from "vue";
|
|
4
4
|
import "../styles/touch-hit-area.css";
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@astryx-vue/core",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.34.0",
|
|
5
5
|
"description": "Vue 3 components for the unofficial astryx-vue port of Astryx. Not affiliated with Meta.",
|
|
6
6
|
"author": "ShenQingchuan",
|
|
7
7
|
"license": "MIT",
|
|
@@ -336,6 +336,42 @@
|
|
|
336
336
|
"types": "./dist/Code/index.d.ts",
|
|
337
337
|
"import": "./dist/Code/index.js"
|
|
338
338
|
},
|
|
339
|
+
"./Code/languages/dockerfile": {
|
|
340
|
+
"types": "./dist/Code/languages/dockerfile/index.d.ts",
|
|
341
|
+
"import": "./dist/Code/languages/dockerfile/index.js"
|
|
342
|
+
},
|
|
343
|
+
"./Code/languages/graphql": {
|
|
344
|
+
"types": "./dist/Code/languages/graphql/index.d.ts",
|
|
345
|
+
"import": "./dist/Code/languages/graphql/index.js"
|
|
346
|
+
},
|
|
347
|
+
"./Code/languages/java": {
|
|
348
|
+
"types": "./dist/Code/languages/java/index.d.ts",
|
|
349
|
+
"import": "./dist/Code/languages/java/index.js"
|
|
350
|
+
},
|
|
351
|
+
"./Code/languages/lua": {
|
|
352
|
+
"types": "./dist/Code/languages/lua/index.d.ts",
|
|
353
|
+
"import": "./dist/Code/languages/lua/index.js"
|
|
354
|
+
},
|
|
355
|
+
"./Code/languages/objective-c": {
|
|
356
|
+
"types": "./dist/Code/languages/objective-c/index.d.ts",
|
|
357
|
+
"import": "./dist/Code/languages/objective-c/index.js"
|
|
358
|
+
},
|
|
359
|
+
"./Code/languages/powershell": {
|
|
360
|
+
"types": "./dist/Code/languages/powershell/index.d.ts",
|
|
361
|
+
"import": "./dist/Code/languages/powershell/index.js"
|
|
362
|
+
},
|
|
363
|
+
"./Code/languages/ruby": {
|
|
364
|
+
"types": "./dist/Code/languages/ruby/index.d.ts",
|
|
365
|
+
"import": "./dist/Code/languages/ruby/index.js"
|
|
366
|
+
},
|
|
367
|
+
"./Code/languages/thrift": {
|
|
368
|
+
"types": "./dist/Code/languages/thrift/index.d.ts",
|
|
369
|
+
"import": "./dist/Code/languages/thrift/index.js"
|
|
370
|
+
},
|
|
371
|
+
"./Code/languages/toml": {
|
|
372
|
+
"types": "./dist/Code/languages/toml/index.d.ts",
|
|
373
|
+
"import": "./dist/Code/languages/toml/index.js"
|
|
374
|
+
},
|
|
339
375
|
"./DropdownMenu": {
|
|
340
376
|
"types": "./dist/DropdownMenu/index.d.ts",
|
|
341
377
|
"import": "./dist/DropdownMenu/index.js"
|
package/reset.css
CHANGED
|
@@ -60,8 +60,14 @@
|
|
|
60
60
|
*
|
|
61
61
|
* color-scheme: light dark 声明页面同时支持浅色和深色,
|
|
62
62
|
* 让 CSS 的 light-dark() 能正确取值。
|
|
63
|
+
*
|
|
64
|
+
* html 取 --astryx-font-family-body,body 继承它:库会往 body 里直接放不在 Theme
|
|
65
|
+
* 包装元素里的文字(比如图表用来量标签宽度的 span),这些文字就拿到页面根上的主题字体,
|
|
66
|
+
* 不会退回浏览器默认的衬线体。没有任何样式表定义这个变量时,声明无效,html 保持浏览器默认字体;
|
|
67
|
+
* 应用自己写在 html 或 body 上的字体优先。
|
|
63
68
|
*/
|
|
64
69
|
:where(html) {
|
|
70
|
+
font-family: var(--astryx-font-family-body);
|
|
65
71
|
line-height: 1.5;
|
|
66
72
|
-webkit-text-size-adjust: 100%;
|
|
67
73
|
tab-size: 4;
|
|
@@ -239,6 +245,14 @@
|
|
|
239
245
|
color: var(--astryx-color-text-secondary, light-dark(#474747, #a8a8a8));
|
|
240
246
|
}
|
|
241
247
|
|
|
248
|
+
/*
|
|
249
|
+
* Chromium 把带 `list` 的输入框的下拉标记画成一个字形,按输入框继承来的行高排版,
|
|
250
|
+
* 行高大于 1 时标记就落在输入框中线以下。设成单行高,标记回到中间。
|
|
251
|
+
*/
|
|
252
|
+
:where([list])::-webkit-calendar-picker-indicator {
|
|
253
|
+
line-height: 1;
|
|
254
|
+
}
|
|
255
|
+
|
|
242
256
|
/*
|
|
243
257
|
* 去掉搜索框在 Chrome 和 Safari 里自带的内边距和清除按钮。
|
|
244
258
|
*/
|
package/styles/code.css
CHANGED
|
@@ -30,6 +30,8 @@
|
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
.astryx-code-block {
|
|
33
|
+
/* 页面在这里的方向。代码视口固定从左到右,让代码按写下的样子滚动和换行;行号栏、分隔线和 diff 符号读这个变量,跟着页面镜像。 */
|
|
34
|
+
--_codeblock-direction: ltr;
|
|
33
35
|
position: relative;
|
|
34
36
|
display: flex;
|
|
35
37
|
flex-direction: column;
|
|
@@ -44,6 +46,20 @@
|
|
|
44
46
|
white-space: normal;
|
|
45
47
|
}
|
|
46
48
|
|
|
49
|
+
.astryx-code-block:dir(rtl) {
|
|
50
|
+
--_codeblock-direction: rtl;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/*
|
|
54
|
+
* 没有标题栏时,复制按钮和调用方的控件排在代码右边自己的一列里,不盖住代码:
|
|
55
|
+
* 滚动、换行、RTL 下都没有哪一行从按钮底下穿过。
|
|
56
|
+
*/
|
|
57
|
+
.astryx-code-block[data-corner] {
|
|
58
|
+
display: grid;
|
|
59
|
+
grid-template-columns: minmax(0, 1fr) auto;
|
|
60
|
+
grid-template-rows: minmax(0, 1fr);
|
|
61
|
+
}
|
|
62
|
+
|
|
47
63
|
.astryx-code-block[data-container='card'] {
|
|
48
64
|
border: var(--astryx-border-width, 1px) solid var(--astryx-code-block-border, #00000014);
|
|
49
65
|
border-radius: var(--astryx-radius-element, 0.625rem);
|
|
@@ -77,6 +93,31 @@
|
|
|
77
93
|
border-bottom: var(--astryx-border-width, 1px) solid var(--astryx-code-block-border, #00000014);
|
|
78
94
|
}
|
|
79
95
|
|
|
96
|
+
/* 标题栏右边的控件:调用方的内容在前,复制按钮在后。 */
|
|
97
|
+
.astryx-code-block__controls {
|
|
98
|
+
display: flex;
|
|
99
|
+
flex-shrink: 0;
|
|
100
|
+
align-items: center;
|
|
101
|
+
gap: var(--astryx-spacing-1, 4px);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/*
|
|
105
|
+
* 角落的控件簇和第一行代码等高(上下内边距加一个行盒),控件在里面居中,
|
|
106
|
+
* 所以任何高度的控件都落在第一行上;代码块变高时控件原地不动。
|
|
107
|
+
*/
|
|
108
|
+
.astryx-code-block__corner {
|
|
109
|
+
display: flex;
|
|
110
|
+
align-items: center;
|
|
111
|
+
align-self: start;
|
|
112
|
+
gap: var(--astryx-spacing-1, 4px);
|
|
113
|
+
margin-inline: var(--astryx-spacing-2, 8px);
|
|
114
|
+
block-size: calc(2 * var(--astryx-spacing-3, 12px) + var(--astryx-text-code-size, 0.875rem) * var(--astryx-text-code-leading, 1.4286));
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.astryx-code-block__corner[data-size='sm'] {
|
|
118
|
+
block-size: calc(2 * var(--astryx-spacing-3, 12px) + var(--astryx-text-supporting-size, 0.75rem) * var(--astryx-text-code-leading, 1.4286));
|
|
119
|
+
}
|
|
120
|
+
|
|
80
121
|
.astryx-code-block__title-control {
|
|
81
122
|
display: flex;
|
|
82
123
|
align-items: center;
|
|
@@ -110,8 +151,11 @@
|
|
|
110
151
|
font-size: var(--astryx-text-supporting-size, 0.75rem);
|
|
111
152
|
font-weight: var(--astryx-font-weight-medium, 500);
|
|
112
153
|
line-height: var(--astryx-text-supporting-leading, 1.6667);
|
|
113
|
-
/*
|
|
114
|
-
|
|
154
|
+
/* 根元素是 pre,标题会继承 pre 的 white-space 而不换行,长标题就会压到右边的控件底下;这里让它自己换行。 */
|
|
155
|
+
min-width: 0;
|
|
156
|
+
overflow-wrap: anywhere;
|
|
157
|
+
--_astryx-text-overflow-wrap: anywhere;
|
|
158
|
+
white-space: pre-wrap;
|
|
115
159
|
}
|
|
116
160
|
|
|
117
161
|
/*
|
|
@@ -131,6 +175,11 @@
|
|
|
131
175
|
animation: astryx-code-block-chevron-reveal var(--astryx-duration-medium-max, 400ms) var(--astryx-ease-standard, cubic-bezier(0.24, 1, 0.4, 1));
|
|
132
176
|
}
|
|
133
177
|
|
|
178
|
+
/* 折叠时的箭头指向行末方向,RTL 下镜像。镜像放在这个盒子上,图标自己的旋转动画不受影响。 */
|
|
179
|
+
.astryx-code-block__chevron:dir(rtl) {
|
|
180
|
+
transform: scaleX(-1);
|
|
181
|
+
}
|
|
182
|
+
|
|
134
183
|
.astryx-code-block__chevron-icon {
|
|
135
184
|
transition: transform var(--astryx-duration-fast-max, 165ms) var(--astryx-ease-standard, cubic-bezier(0.24, 1, 0.4, 1));
|
|
136
185
|
}
|
|
@@ -186,6 +235,36 @@
|
|
|
186
235
|
outline-offset: calc(-1 * var(--astryx-focus-outline-width, 2px));
|
|
187
236
|
}
|
|
188
237
|
|
|
238
|
+
/*
|
|
239
|
+
* 手机、平板的滚动条只在滚动时出现,横向藏着内容的那一侧边缘淡出,提示还能滑。
|
|
240
|
+
* 鼠标和触控板看不到淡出;键盘焦点环画在视口里面,所以获得焦点时也不淡出。
|
|
241
|
+
*/
|
|
242
|
+
.astryx-code-block__scroll[data-scrollable-inline='true'] {
|
|
243
|
+
--_scroll-fade-start: 0px;
|
|
244
|
+
--_scroll-fade-end: 0px;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
.astryx-code-block__scroll[data-scrollable-inline='true']:not([data-scroll-inline-start='true']) {
|
|
248
|
+
--_scroll-fade-start: var(--_scroll-fade-length, var(--astryx-spacing-8, 32px));
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
.astryx-code-block__scroll[data-scrollable-inline='true']:not([data-scroll-inline-end='true']) {
|
|
252
|
+
--_scroll-fade-end: var(--_scroll-fade-length, var(--astryx-spacing-8, 32px));
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
@media (pointer: coarse) {
|
|
256
|
+
.astryx-code-block__scroll[data-scrollable-inline='true']:not(:focus-visible) {
|
|
257
|
+
mask-image: linear-gradient(to right, transparent 0, black var(--_scroll-fade-start), black calc(100% - var(--_scroll-fade-end)), transparent 100%);
|
|
258
|
+
scroll-padding-inline: var(--_scroll-fade-start) var(--_scroll-fade-end);
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
@media (forced-colors: active) {
|
|
263
|
+
.astryx-code-block__scroll {
|
|
264
|
+
mask-image: none;
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
|
|
189
268
|
.astryx-code-block__wrap {
|
|
190
269
|
display: flex;
|
|
191
270
|
min-width: fit-content;
|
|
@@ -201,6 +280,8 @@
|
|
|
201
280
|
margin: 0;
|
|
202
281
|
padding-block: var(--astryx-spacing-3, 12px);
|
|
203
282
|
padding-inline: var(--astryx-spacing-4, 16px);
|
|
283
|
+
/* 每行按页面方向排行号栏;每行的代码自己带 dir="auto"。 */
|
|
284
|
+
direction: var(--_codeblock-direction, ltr);
|
|
204
285
|
color: var(--astryx-code-syntax-variable, #111111);
|
|
205
286
|
font-family: var(--astryx-font-family-code, monospace);
|
|
206
287
|
font-size: var(--astryx-text-code-size, 0.875rem);
|
|
@@ -267,7 +348,9 @@
|
|
|
267
348
|
}
|
|
268
349
|
|
|
269
350
|
/* Keeps the tokens of one line in a single grid cell when numbers are on. */
|
|
351
|
+
/* 做成块,让每行靠自己方向的起始边对齐,不受外面一行方向的影响。 */
|
|
270
352
|
.astryx-code-block__line-content {
|
|
353
|
+
display: block;
|
|
271
354
|
min-width: 0;
|
|
272
355
|
}
|
|
273
356
|
|
|
@@ -348,12 +431,6 @@
|
|
|
348
431
|
--astryx-button-ghost-foreground: var(--astryx-code-syntax-comment, #525252);
|
|
349
432
|
}
|
|
350
433
|
|
|
351
|
-
.astryx-code-block .astryx-code-block-copy-button--floating {
|
|
352
|
-
position: absolute;
|
|
353
|
-
top: var(--astryx-spacing-2, 8px);
|
|
354
|
-
inset-inline-end: var(--astryx-spacing-2, 8px);
|
|
355
|
-
}
|
|
356
|
-
|
|
357
434
|
.astryx-token-keyword,
|
|
358
435
|
.astryx-code-block code::highlight(astryx-keyword) {
|
|
359
436
|
color: var(--astryx-code-syntax-keyword, #6b187c);
|