@astryx-vue/core 0.1.0 → 0.1.3
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/README.md +1 -1
- package/dist/AppShell/index.d.ts +2 -0
- package/dist/AppShell/index.js +2 -0
- package/dist/AppShell-b0PWt9Fz.js +249 -0
- package/dist/AspectRatio/index.d.ts +2 -0
- package/dist/AspectRatio/index.js +2 -0
- package/dist/AspectRatio-Bij7e-tq.js +40 -0
- package/dist/AvatarGroup/index.d.ts +1 -1
- package/dist/Banner/index.d.ts +1 -1
- package/dist/BottomSheet/index.d.ts +1 -1
- package/dist/Button/index.d.ts +1 -1
- package/dist/ButtonGroup/index.d.ts +1 -1
- package/dist/Calendar/index.js +1 -1
- package/dist/{Calendar-DpYFXwgb.js → Calendar-CYhGDT6f.js} +2 -1
- package/dist/Chat/index.js +1 -1
- package/dist/{Chat-Bfd-YPAK.js → Chat-C1aWl5V3.js} +2 -2
- package/dist/CheckboxInput/index.d.ts +1 -1
- package/dist/CheckboxInput/index.js +1 -1
- package/dist/{CheckboxInput-C86o3XoG.js → CheckboxInput-CMsEE1_4.js} +4 -2
- package/dist/CheckboxList/index.d.ts +2 -0
- package/dist/CheckboxList/index.js +2 -0
- package/dist/CheckboxList-EsIEXjK_.js +174 -0
- package/dist/Citation/index.js +1 -1
- package/dist/{Citation-DaDd1teb.js → Citation-C1X0Rde8.js} +2 -2
- package/dist/ClickableCard/index.d.ts +2 -0
- package/dist/ClickableCard/index.js +2 -0
- package/dist/ClickableCard-Bhds4RRe.js +112 -0
- package/dist/Code/index.js +1 -1
- package/dist/{CodeBlock-CK-NWM_1.js → CodeBlock-BQdooQy2.js} +1 -1
- package/dist/Collapsible/index.d.ts +2 -2
- package/dist/Collapsible/index.js +2 -2
- package/dist/Collapsible-BS9ctCQV.js +192 -0
- package/dist/CommandPalette/index.d.ts +2 -0
- package/dist/CommandPalette/index.js +2 -0
- package/dist/CommandPalette-u5h_E05P.js +489 -0
- package/dist/ComplexSelector/index.d.ts +2 -0
- package/dist/ComplexSelector/index.js +2 -0
- package/dist/ComplexSelector-BHmGWml0.js +293 -0
- package/dist/ContextMenu/index.d.ts +1 -1
- package/dist/ContextMenu/index.js +1 -1
- package/dist/{ContextMenu-BJh99Exj.js → ContextMenu-dA-ppaRQ.js} +284 -12
- package/dist/DateInput/index.d.ts +1 -1
- package/dist/DateInput/index.js +1 -1
- package/dist/{DateInput-zJAdXByM.js → DateInput-D2ErjXYO.js} +18 -10
- package/dist/DateRangeInput/index.d.ts +2 -0
- package/dist/DateRangeInput/index.js +2 -0
- package/dist/DateRangeInput-fmQlr_A7.js +385 -0
- package/dist/DateTimeInput/index.d.ts +2 -0
- package/dist/DateTimeInput/index.js +2 -0
- package/dist/DateTimeInput-Bs1JmcIp.js +196 -0
- package/dist/Divider/index.d.ts +1 -1
- package/dist/DropdownMenu/index.d.ts +1 -1
- package/dist/DropdownMenu/index.js +1 -1
- package/dist/{DropdownMenu-C3j2zaEn.js → DropdownMenu-B0gogrvG.js} +2 -2
- package/dist/Field/index.d.ts +2 -2
- package/dist/Field/index.js +3 -4
- package/dist/{Field-VlTBsIEo.js → Field-8zRxzDHE.js} +11 -3
- package/dist/{FieldLabel-B1NRyQlS.js → FieldLabel-DmmJyX7w.js} +6 -1
- package/dist/FieldStatus/index.d.ts +2 -0
- package/dist/FieldStatus/index.js +2 -0
- package/dist/FileInput/index.d.ts +2 -0
- package/dist/FileInput/index.js +2 -0
- package/dist/FileInput-CmAfOpkA.js +238 -0
- package/dist/FormLayout/index.d.ts +2 -0
- package/dist/FormLayout/index.js +2 -0
- package/dist/FormLayout-D47FjiOq.js +40 -0
- package/dist/HoverCard/index.d.ts +1 -1
- package/dist/{Icon-B6qNgBP9.js → Icon-5MdZQ18k.js} +10 -2
- package/dist/Layout/index.d.ts +2 -0
- package/dist/Layout/index.js +3 -0
- package/dist/Layout-Bed3kP0M.js +56 -0
- package/dist/LayoutPanel-C34uOq3e.js +358 -0
- package/dist/List/index.d.ts +1 -1
- package/dist/Markdown/index.d.ts +1 -1
- package/dist/Markdown/index.js +1 -1
- package/dist/{Markdown-DyKIwAL_.js → Markdown-CwtLr3f_.js} +2 -2
- package/dist/MetadataList/index.d.ts +2 -0
- package/dist/MetadataList/index.js +2 -0
- package/dist/MetadataList-DlXQTLog.js +124 -0
- package/dist/MobileNav/index.d.ts +1 -1
- package/dist/MobileNav/index.js +1 -1
- package/dist/{MobileNavToggle-BK2iRJF-.js → MobileNavToggle-CgQamG6E.js} +19 -12
- package/dist/MoreMenu/index.d.ts +1 -1
- package/dist/MoreMenu/index.js +1 -1
- package/dist/{MoreMenu-BjUsVWWk.js → MoreMenu-BXL6Dqsu.js} +2 -2
- package/dist/MultiSelector/index.d.ts +1 -1
- package/dist/MultiSelector/index.js +1 -1
- package/dist/{MultiSelector-CKTbTj1A.js → MultiSelector-DT8ZccMI.js} +3 -3
- package/dist/NavItem/index.d.ts +1 -1
- package/dist/NavMenu/index.d.ts +1 -1
- package/dist/NumberInput/index.d.ts +1 -1
- package/dist/NumberInput/index.js +1 -1
- package/dist/{NumberInput-DU3_rw7z.js → NumberInput-DspJO6z6.js} +1 -1
- package/dist/OverflowList/index.d.ts +1 -1
- package/dist/OverflowList/index.js +1 -1
- package/dist/{OverflowList-B2T5UtiQ.js → OverflowList-zXg3g6fy.js} +1 -1
- package/dist/Overlay/index.d.ts +1 -1
- package/dist/Pagination/index.js +1 -1
- package/dist/{Pagination-qCgNwwhr.js → Pagination-DXfgMUKJ.js} +2 -2
- package/dist/Popover/index.d.ts +2 -1
- package/dist/Radio/index.d.ts +2 -2
- package/dist/Radio/index.js +2 -2
- package/dist/{Radio-BioQfwHQ.js → RadioGroup-BqjdSCfJ.js} +21 -88
- package/dist/RadioList/index.d.ts +2 -0
- package/dist/RadioList/index.js +2 -0
- package/dist/RadioList-DI8ujXcT.js +122 -0
- package/dist/Resizable/index.d.ts +2 -0
- package/dist/Resizable/index.js +2 -0
- package/dist/Resizable-BuGKvU9I.js +261 -0
- package/dist/ScrollableArea/index.d.ts +2 -0
- package/dist/ScrollableArea/index.js +2 -0
- package/dist/ScrollableArea-DQDYjnxO.js +78 -0
- package/dist/Section/index.d.ts +2 -0
- package/dist/Section/index.js +2 -0
- package/dist/Section-C48Wqfc7.js +68 -0
- package/dist/SegmentedControl/index.d.ts +1 -1
- package/dist/SelectableCard/index.d.ts +2 -0
- package/dist/SelectableCard/index.js +2 -0
- package/dist/SelectableCard-Bj5s_tIN.js +108 -0
- package/dist/Selector/index.d.ts +1 -1
- package/dist/Selector/index.js +1 -1
- package/dist/{Selector-C6sPJMtH.js → Selector-DlZpQh42.js} +1 -1
- package/dist/SideNav/index.d.ts +1 -1
- package/dist/SideNav/index.js +2 -1
- package/dist/{SideNav-D9lnn-sM.js → SideNav-Cdrigq2A.js} +49 -27
- package/dist/Slider/index.js +1 -1
- package/dist/{Slider-DTnWxtnb.js → Slider-D8h_RKcF.js} +1 -1
- package/dist/Stack/index.d.ts +1 -1
- package/dist/Stepper/index.d.ts +2 -0
- package/dist/Stepper/index.js +2 -0
- package/dist/Stepper-DxmLfh8O.js +423 -0
- package/dist/Switch/index.d.ts +1 -1
- package/dist/Switch/index.js +1 -1
- package/dist/{Switch-CNdnr5TP.js → Switch-SesQzPGZ.js} +4 -2
- package/dist/TabList/index.d.ts +2 -2
- package/dist/TabList/index.js +2 -2
- package/dist/TabList-C411uNQU.js +380 -0
- package/dist/Table/index.d.ts +3 -0
- package/dist/Table/index.js +2 -0
- package/dist/Table-7qRmlIQd.js +967 -0
- package/dist/Text/index.d.ts +1 -1
- package/dist/TextArea/index.d.ts +1 -1
- package/dist/TextArea/index.js +1 -1
- package/dist/{TextArea-BL0NuB99.js → TextArea-Cv9UVbzS.js} +5 -3
- package/dist/TextInput/index.d.ts +1 -1
- package/dist/TextInput/index.js +1 -1
- package/dist/{TextInput-B0IKC7g5.js → TextInput-BasnjVvy.js} +5 -3
- package/dist/Thumbnail/index.d.ts +2 -0
- package/dist/Thumbnail/index.js +2 -0
- package/dist/Thumbnail-BWVzLLyI.js +163 -0
- package/dist/TimeField-l3QzU6vC.js +214 -0
- package/dist/TimeInput/index.d.ts +2 -0
- package/dist/TimeInput/index.js +2 -0
- package/dist/TimeInput-OkgX-xbQ.js +121 -0
- package/dist/Timestamp/index.d.ts +2 -0
- package/dist/Timestamp/index.js +2 -0
- package/dist/Timestamp-DUoP9ari.js +465 -0
- package/dist/ToggleButton/index.d.ts +1 -1
- package/dist/Token/index.js +1 -1
- package/dist/{Token-Ctf9jekS.js → Token-C4KD0fZD.js} +1 -1
- package/dist/Tokenizer/index.d.ts +1 -1
- package/dist/Tokenizer/index.js +1 -1
- package/dist/{Tokenizer-D5MPgau0.js → Tokenizer-BA8sTMPZ.js} +3 -3
- package/dist/Toolbar/index.d.ts +1 -1
- package/dist/Tooltip/index.d.ts +1 -1
- package/dist/TopNav/index.d.ts +1 -1
- package/dist/TopNav/index.js +1 -1
- package/dist/{TopNav-CjbMCbkC.js → TopNav-CZokS7E_.js} +57 -31
- package/dist/TreeList/index.d.ts +2 -0
- package/dist/TreeList/index.js +2 -0
- package/dist/TreeList-CIbAGOMf.js +506 -0
- package/dist/Typeahead/index.d.ts +1 -1
- package/dist/Typeahead/index.js +1 -1
- package/dist/{Typeahead-BMoU3hfx.js → Typeahead-DIw-K4aa.js} +3 -3
- package/dist/composables/index.d.ts +3 -2
- package/dist/composables/index.js +8 -2
- package/dist/composables-CVfjp9h4.js +502 -0
- package/dist/context-BjNya0v8.js +19 -0
- package/dist/context-Cfjh8te1.js +29 -0
- package/dist/{locale-56lkR7OK.js → context-D6ECRdc5.js} +267 -18
- package/dist/index-1uRMrk63.d.ts +54 -0
- package/dist/{index-Dw21t7Uf.d.ts → index-2u4l3wq8.d.ts} +2 -2
- package/dist/{index-CvLlWLIZ.d.ts → index-B4OOtNP8.d.ts} +4 -4
- package/dist/{index-_1-uvr27.d.ts → index-B8MbfMwV.d.ts} +1 -1
- package/dist/{index-MPcg1Pm4.d.ts → index-BKr7yvVv.d.ts} +1 -1
- package/dist/index-Be1czg3M.d.ts +167 -0
- package/dist/{index-Dbmgcm8a.d.ts → index-BeR-1LgF.d.ts} +2 -0
- package/dist/{index-CnVbMebA.d.ts → index-Bqb_Fyju.d.ts} +3 -3
- package/dist/index-BrJzFA5X.d.ts +38 -0
- package/dist/{index-BDZCJ9ri.d.ts → index-BuubzuE8.d.ts} +2 -2
- package/dist/index-By2mSzUA.d.ts +67 -0
- package/dist/{index-HV6W3xCx.d.ts → index-Byar3h1e.d.ts} +1 -1
- package/dist/{index-BQuN_dWR.d.ts → index-BzqRns96.d.ts} +1 -1
- package/dist/{index-BkIgRYGz.d.ts → index-C5p2NeCr.d.ts} +2 -2
- package/dist/{index-Cc2HGODZ.d.ts → index-C6RecznD.d.ts} +3 -3
- package/dist/{index-BSRk8MFK.d.ts → index-C8wDPDcP.d.ts} +1 -1
- package/dist/index-CDdRQQF3.d.ts +170 -0
- package/dist/index-COqjznX0.d.ts +47 -0
- package/dist/{index-Cz9ZHVf6.d.ts → index-CT8KEpec.d.ts} +2 -2
- package/dist/{index-CxspvLBl.d.ts → index-CTolyeii.d.ts} +1 -1
- package/dist/index-CVn0GBdB.d.ts +115 -0
- package/dist/index-CX97hlld.d.ts +158 -0
- package/dist/index-C_2Z65Rp.d.ts +67 -0
- package/dist/index-CjtAH60j.d.ts +38 -0
- package/dist/index-CtlkhQ55.d.ts +36 -0
- package/dist/{index-JeZ0YTyd.d.ts → index-D-ZuubCK.d.ts} +4 -4
- package/dist/index-DA52oIdw.d.ts +171 -0
- package/dist/{index-C8NW9xre.d.ts → index-DGNqi2za.d.ts} +7 -7
- package/dist/{index-CCA4R0Mf.d.ts → index-DT9S92sh.d.ts} +31 -6
- package/dist/index-DXSs3rwa.d.ts +252 -0
- package/dist/{index-C0S2Xzoi.d.ts → index-DYChvBOM.d.ts} +135 -0
- package/dist/index-Da7Jm8Ht.d.ts +10 -0
- package/dist/{index-CaHXYQ_E.d.ts → index-Df2YvC8o.d.ts} +717 -147
- package/dist/{index-DjOdQv5B.d.ts → index-DfgHJE7H.d.ts} +1 -1
- package/dist/{index-CPhDtlv-.d.ts → index-FEy8qFSD.d.ts} +3 -3
- package/dist/{index-DBcbfStA.d.ts → index-SMh42NI8.d.ts} +182 -2
- package/dist/{index-Cdi82rTW.d.ts → index-ZJyk8RtQ.d.ts} +6 -2
- package/dist/{index-BeJqhW4l.d.ts → index-fa72tWIU.d.ts} +3 -3
- package/dist/{index-COxy6LEW.d.ts → index-gW0HW02U.d.ts} +1 -1
- package/dist/{index-BQa836Vz.d.ts → index-iBLzInje.d.ts} +6 -14
- package/dist/{index-BhYFxnjV.d.ts → index-kaKBOZSU.d.ts} +2 -2
- package/dist/index-nKlTsNfV.d.ts +42 -0
- package/dist/index-utZGF4GR.d.ts +79 -0
- package/dist/index.d.ts +76 -59
- package/dist/index.js +119 -78
- package/dist/locale/index.d.ts +1 -1
- package/dist/locale/index.js +2 -1
- package/dist/locale-Cpk_nrLA.js +18 -0
- package/dist/size-BuTzpgnR.d.ts +14 -0
- package/dist/size-xcIqExkS.js +79 -0
- package/dist/{index-Cp0NlzQv.d.ts → types-Db3Owy8Q.d.ts} +1 -36
- package/dist/types-JktRxujg.d.ts +107 -0
- package/dist/useAppShellMobile-DTsyuAJ4.js +19 -0
- package/dist/useClickableContainer-DyNpnSEa.js +112 -0
- package/dist/useFileSelection-BPtaegqK.js +58 -0
- package/dist/useMonthGrid-CmJsZTcB.js +139 -0
- package/dist/useResizable-CeESZS1v.d.ts +72 -0
- package/dist/useScrollableArea-DDk_CluT.js +172 -0
- package/dist/useTimeValue-DWk6oTAZ.js +113 -0
- package/package.json +97 -1
- package/styles/app-shell.css +151 -0
- package/styles/aspect-ratio.css +49 -0
- package/styles/bordered-control.css +87 -0
- package/styles/calendar.css +8 -2
- package/styles/card.css +5 -1
- package/styles/checkbox-list.css +15 -0
- package/styles/clickable-card.css +101 -0
- package/styles/collapsible.css +37 -0
- package/styles/command-palette.css +183 -0
- package/styles/complex-selector.css +114 -0
- package/styles/date-range-input.css +163 -0
- package/styles/date-time-input.css +40 -0
- package/styles/field.css +14 -3
- package/styles/file-input.css +87 -0
- package/styles/form-layout.css +31 -0
- package/styles/heading.css +19 -17
- package/styles/icon.css +32 -0
- package/styles/layout.css +280 -0
- package/styles/metadata-list.css +107 -0
- package/styles/number-input.css +6 -0
- package/styles/radio.css +32 -0
- package/styles/resize-handle.css +128 -0
- package/styles/scrollable-area.css +50 -0
- package/styles/section.css +60 -0
- package/styles/selector.css +10 -0
- package/styles/side-nav.css +26 -0
- package/styles/stepper.css +357 -0
- package/styles/tab-menu.css +91 -0
- package/styles/table.css +256 -0
- package/styles/text-area.css +6 -1
- package/styles/text-input.css +6 -0
- package/styles/thumbnail.css +151 -0
- package/styles/time-input.css +51 -0
- package/styles/timestamp.css +93 -0
- package/styles/tree-list.css +229 -0
- package/styles.css +23 -0
- package/dist/Collapsible-ByXCGhT8.js +0 -102
- package/dist/TabList-LV1U4ZD6.js +0 -184
- package/dist/composables-Dq9RS33w.js +0 -111
- package/dist/index-TnaIHsCS.d.ts +0 -87
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { a as useAstryxMessages } from "./
|
|
1
|
+
import { a as useAstryxMessages } from "./context-D6ECRdc5.js";
|
|
2
2
|
import { t as _sfc_main$1 } from "./Spinner-9cYUCnDy.js";
|
|
3
|
-
import { t as _sfc_main$2 } from "./Field-
|
|
4
|
-
import { t as _sfc_main$3 } from "./Token-
|
|
3
|
+
import { t as _sfc_main$2 } from "./Field-8zRxzDHE.js";
|
|
4
|
+
import { t as _sfc_main$3 } from "./Token-C4KD0fZD.js";
|
|
5
5
|
import { n as useAnchoredListbox, t as scrollOptionIntoView } from "./useAnchoredListbox-7W90Ny-9.js";
|
|
6
6
|
import { n as _sfc_main$4, t as useTypeaheadMenu } from "./useTypeaheadMenu-Ba7XpcZl.js";
|
|
7
7
|
import { Fragment, Teleport, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createSlots, createVNode, defineComponent, nextTick, normalizeClass, normalizeStyle, openBlock, ref, renderSlot, toDisplayString, unref, useId, useTemplateRef, vShow, watch, withCtx, withDirectives } from "vue";
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { n as UseClipboardReturn, r as useClipboard, t as UseClipboardOptions } from "../useClipboard-CU-kfqeJ.js";
|
|
2
|
-
import { $ as useChatNewMessages, A as useHotkeys, B as UseControllableStateOptions, C as LongPressOptions, D as UseListFocusOptions, E as ListFocusOrientation, F as UseFocusTrapOptions, G as useCombobox, H as Combobox, I as useFocusTrap, J as UseChatStreamScrollReturn, K as ChatScrollToBottomOptions, L as UseDismissOptions, M as UseGridRovingFocusOptions, N as useGridRovingFocus, O as useListFocus, P as FocusTrap, Q as UseChatNewMessagesReturn, R as useDismiss, S as LongPressHandlers, T as ListFocus, U as ComboboxOption, V as useControllableState, W as UseComboboxOptions, X as CHAT_MESSAGE_CLASS, Y as useChatStreamScroll, Z as UseChatNewMessagesOptions, _ as useOverflow, a as UseStreamingTextOptions, b as useNumberField, c as useScrollLock, d as useRestoreFocus, et as AnnounceFn, f as ComputeOverflowInput, g as computeOverflow, h as UseOverflowReturn, i as StreamingTextSpeed, j as GridRovingFocus, k as Hotkey, l as RestoreFocus, m as UseOverflowOptions, n as UseTypeaheadReturn, nt as useAnnounce, o as snapToGraphemeBoundary, p as ComputeOverflowResult, q as UseChatStreamScrollOptions, r as useTypeahead, s as useStreamingText, t as UseTypeaheadOptions, tt as AnnouncePoliteness, u as UseRestoreFocusOptions, v as NumberField, w as useLongPress, x as useMediaQuery, y as UseNumberFieldOptions, z as ControllableState } from "../index-DBcbfStA.js";
|
|
3
2
|
import { a as SearchableItem, c as useAsyncSource, i as SearchSource, n as AsyncSourceStatus, o as UseAsyncSourceOptions, r as CreateStaticSourceOptions, s as createStaticSource, t as AsyncSource } from "../useAsyncSource-xpQovjV_.js";
|
|
4
|
-
|
|
3
|
+
import { $ as useLongPress, $t as useAppShellMobile, A as UseScrollableAreaOptions, At as spanDays, B as computeOverflow, Bt as INTERACTIVE_SELECTORS, C as useScrollLock, Ct as compareISODate, D as ScrollRole, Dt as isSameRange, E as ScrollOverscroll, Et as isRangeWithinSpan, F as useRestoreFocus, Ft as ComboboxOption, G as addMonths, Gt as UseChatStreamScrollReturn, H as NumberField, Ht as useClickableContainer, I as ComputeOverflowInput, It as UseComboboxOptions, J as toISODate, Jt as UseChatNewMessagesOptions, K as buildMonthGrid, Kt as useChatStreamScroll, L as ComputeOverflowResult, Lt as useCombobox, M as useScrollableArea, Mt as UseControllableStateOptions, N as RestoreFocus, Nt as useControllableState, O as ScrollStickyContainment, Ot as orderRange, P as UseRestoreFocusOptions, Pt as Combobox, Q as LongPressOptions, Qt as appShellMobileKey, R as UseOverflowOptions, Rt as useCoarsePointer, S as useScrollOverflow, St as applyRangeClick, T as ScrollAxisState, Tt as isDayOutsideSpan, U as UseNumberFieldOptions, Ut as ChatScrollToBottomOptions, V as useOverflow, Vt as UseClickableContainerOptions, W as useNumberField, Wt as UseChatStreamScrollOptions, X as useMediaQuery, Xt as useChatNewMessages, Y as todayISODate, Yt as UseChatNewMessagesReturn, Z as LongPressHandlers, Zt as AppShellMobile, _ as UseStreamingTextOptions, _t as UseDismissOptions, a as ISOTimeString, at as useHotkeys, b as ScrollOverflowState, bt as RangeClickResult, c as TimePresentation, ct as useGridRovingFocus, d as isTimeInRange, dt as useFocusTrap, en as AnnounceFn, et as ListFocus, f as parseDisplayTime, ft as FileRejection, g as StreamingTextSpeed, gt as selectFiles, h as shiftTime, ht as formatFileSize, i as HourFormat, it as Hotkey, j as UseScrollableAreaResult, jt as ControllableState, k as ScrollableAreaState, kt as resolveWeekStart, l as formatDisplayTime, lt as FocusTrap, m as resolveTimeSurface, mt as FileSelectionResult, n as UseTypeaheadReturn, nn as useAnnounce, nt as UseListFocusOptions, o as NativePicker, ot as GridRovingFocus, p as parseISOTime, pt as FileSelectionOptions, q as parseISODate, qt as CHAT_MESSAGE_CLASS, r as useTypeahead, rt as useListFocus, s as ParsedTime, st as UseGridRovingFocusOptions, t as UseTypeaheadOptions, tn as AnnouncePoliteness, tt as ListFocusOrientation, u as formatISOTime, ut as UseFocusTrapOptions, v as snapToGraphemeBoundary, vt as useDismiss, w as ScrollAxis, wt as formatDateRange, x as UseScrollOverflowResult, xt as WeekStartsOn, y as useStreamingText, yt as ISODateRange, z as UseOverflowReturn, zt as ClickableContainerHandlers } from "../index-SMh42NI8.js";
|
|
4
|
+
import { a as ResizableRegionConfig, c as UseResizableMultiConfig, d as percent, f as useResizable, i as ResizableRegion, l as UseResizableOptions, n as ResizablePercentSize, o as ResizableSize, r as ResizableProps, s as ResizableState, t as ResizableDirection, u as UseResizableSingleOptions } from "../useResizable-CeESZS1v.js";
|
|
5
|
+
export { type AnnounceFn, type AnnouncePoliteness, type AppShellMobile, type AsyncSource, type AsyncSourceStatus, CHAT_MESSAGE_CLASS, type ChatScrollToBottomOptions, type ClickableContainerHandlers, type Combobox, type ComboboxOption, type ComputeOverflowInput, type ComputeOverflowResult, type ControllableState, type CreateStaticSourceOptions, type FileRejection, type FileSelectionOptions, type FileSelectionResult, type FocusTrap, type GridRovingFocus, type Hotkey, type HourFormat, INTERACTIVE_SELECTORS, type ISODateRange, type ISOTimeString, type ListFocus, type ListFocusOrientation, type LongPressHandlers, type LongPressOptions, type NativePicker, type NumberField, type ParsedTime, type RangeClickResult, type ResizableDirection, type ResizablePercentSize, type ResizableProps, type ResizableRegion, type ResizableRegionConfig, type ResizableSize, type ResizableState, type RestoreFocus, type ScrollAxis, type ScrollAxisState, type ScrollOverflowState, type ScrollOverscroll, type ScrollRole, type ScrollStickyContainment, type ScrollableAreaState, type SearchSource, type SearchableItem, type StreamingTextSpeed, type TimePresentation, type UseAsyncSourceOptions, type UseChatNewMessagesOptions, type UseChatNewMessagesReturn, type UseChatStreamScrollOptions, type UseChatStreamScrollReturn, type UseClickableContainerOptions, type UseClipboardOptions, type UseClipboardReturn, type UseComboboxOptions, type UseControllableStateOptions, type UseDismissOptions, type UseFocusTrapOptions, type UseGridRovingFocusOptions, type UseListFocusOptions, type UseNumberFieldOptions, type UseOverflowOptions, type UseOverflowReturn, type UseResizableMultiConfig, type UseResizableOptions, type UseResizableSingleOptions, type UseRestoreFocusOptions, type UseScrollOverflowResult, type UseScrollableAreaOptions, type UseScrollableAreaResult, type UseStreamingTextOptions, type UseTypeaheadOptions, type UseTypeaheadReturn, type WeekStartsOn, addMonths, appShellMobileKey, applyRangeClick, buildMonthGrid, compareISODate, computeOverflow, createStaticSource, formatDateRange, formatDisplayTime, formatFileSize, formatISOTime, isDayOutsideSpan, isRangeWithinSpan, isSameRange, isTimeInRange, orderRange, parseDisplayTime, parseISODate, parseISOTime, percent, resolveTimeSurface, resolveWeekStart, selectFiles, shiftTime, snapToGraphemeBoundary, spanDays, toISODate, todayISODate, useAnnounce, useAppShellMobile, useAsyncSource, useChatNewMessages, useChatStreamScroll, useClickableContainer, useClipboard, useCoarsePointer, useCombobox, useControllableState, useDismiss, useFocusTrap, useGridRovingFocus, useHotkeys, useListFocus, useLongPress, useMediaQuery, useNumberField, useOverflow, useResizable, useRestoreFocus, useScrollLock, useScrollOverflow, useScrollableArea, useStreamingText, useTypeahead };
|
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
import { t as useMediaQuery } from "../useMediaQuery-GMmgp28-.js";
|
|
2
2
|
import { t as useAnnounce } from "../announce-Cnio10Wk.js";
|
|
3
|
+
import { n as useAppShellMobile, t as appShellMobileKey } from "../useAppShellMobile-DTsyuAJ4.js";
|
|
3
4
|
import { n as useAsyncSource, t as createStaticSource } from "../useAsyncSource-Gk0VtE7_.js";
|
|
4
5
|
import { n as CHAT_MESSAGE_CLASS, r as useChatNewMessages, t as useChatStreamScroll } from "../useChatStreamScroll-oDfybEos.js";
|
|
6
|
+
import { n as useClickableContainer, t as INTERACTIVE_SELECTORS } from "../useClickableContainer-DyNpnSEa.js";
|
|
5
7
|
import { t as useClipboard } from "../useClipboard-BDfbEsWd.js";
|
|
8
|
+
import { a as parseISOTime, c as useCoarsePointer, i as parseDisplayTime, n as formatISOTime, o as resolveTimeSurface, r as isTimeInRange, s as shiftTime, t as formatDisplayTime } from "../useTimeValue-DWk6oTAZ.js";
|
|
6
9
|
import { t as useCombobox } from "../useCombobox-CTo5C-gc.js";
|
|
7
|
-
import { n as useStreamingText,
|
|
10
|
+
import { a as useResizable, i as percent, n as useStreamingText, o as useControllableState, r as useScrollOverflow, t as snapToGraphemeBoundary } from "../composables-CVfjp9h4.js";
|
|
11
|
+
import { a as todayISODate, c as formatDateRange, d as isSameRange, f as orderRange, i as toISODate, l as isDayOutsideSpan, m as spanDays, n as buildMonthGrid, o as applyRangeClick, p as resolveWeekStart, r as parseISODate, s as compareISODate, t as addMonths, u as isRangeWithinSpan } from "../useMonthGrid-CmJsZTcB.js";
|
|
8
12
|
import { t as useDismiss } from "../useDismiss-CAiHU6QD.js";
|
|
13
|
+
import { n as selectFiles, t as formatFileSize } from "../useFileSelection-BPtaegqK.js";
|
|
9
14
|
import { n as useFocusTrap, t as useRestoreFocus } from "../useRestoreFocus-BvMdXVX9.js";
|
|
10
15
|
import { t as useGridRovingFocus } from "../useGridRovingFocus-DQQAOYH5.js";
|
|
11
16
|
import { t as useHotkeys } from "../useHotkeys-dABSK1o9.js";
|
|
@@ -13,6 +18,7 @@ import { t as useListFocus } from "../useListFocus-D0iOJl39.js";
|
|
|
13
18
|
import { t as useLongPress } from "../useLongPress-Cyxwa73s.js";
|
|
14
19
|
import { t as useNumberField } from "../useNumberField-DL-Radsp.js";
|
|
15
20
|
import { n as useOverflow, t as computeOverflow } from "../useOverflow-VrwF5oek.js";
|
|
21
|
+
import { t as useScrollableArea } from "../useScrollableArea-DDk_CluT.js";
|
|
16
22
|
import { t as useScrollLock } from "../scrollLock-BzIvIimL.js";
|
|
17
23
|
import { t as useTypeahead } from "../useTypeahead-PAK8lMYz.js";
|
|
18
|
-
export { CHAT_MESSAGE_CLASS, computeOverflow, createStaticSource, snapToGraphemeBoundary, useAnnounce, useAsyncSource, useChatNewMessages, useChatStreamScroll, useClipboard, useCombobox, useControllableState, useDismiss, useFocusTrap, useGridRovingFocus, useHotkeys, useListFocus, useLongPress, useMediaQuery, useNumberField, useOverflow, useRestoreFocus, useScrollLock, useStreamingText, useTypeahead };
|
|
24
|
+
export { CHAT_MESSAGE_CLASS, INTERACTIVE_SELECTORS, addMonths, appShellMobileKey, applyRangeClick, buildMonthGrid, compareISODate, computeOverflow, createStaticSource, formatDateRange, formatDisplayTime, formatFileSize, formatISOTime, isDayOutsideSpan, isRangeWithinSpan, isSameRange, isTimeInRange, orderRange, parseDisplayTime, parseISODate, parseISOTime, percent, resolveTimeSurface, resolveWeekStart, selectFiles, shiftTime, snapToGraphemeBoundary, spanDays, toISODate, todayISODate, useAnnounce, useAppShellMobile, useAsyncSource, useChatNewMessages, useChatStreamScroll, useClickableContainer, useClipboard, useCoarsePointer, useCombobox, useControllableState, useDismiss, useFocusTrap, useGridRovingFocus, useHotkeys, useListFocus, useLongPress, useMediaQuery, useNumberField, useOverflow, useResizable, useRestoreFocus, useScrollLock, useScrollOverflow, useScrollableArea, useStreamingText, useTypeahead };
|
|
@@ -0,0 +1,502 @@
|
|
|
1
|
+
import { t as useMediaQuery } from "./useMediaQuery-GMmgp28-.js";
|
|
2
|
+
import { computed, onBeforeUnmount, onMounted, reactive, ref, toValue, watch } from "vue";
|
|
3
|
+
//#region src/composables/useControllableState.ts
|
|
4
|
+
/**
|
|
5
|
+
* 受控或自己管的 v-model。
|
|
6
|
+
*
|
|
7
|
+
* Astryx 没有同名 hook。各组件原来各自判断「外面传了值就听外面的,没传就自己记」,
|
|
8
|
+
* 这里收成一个函数,方便以后的 v-model 共用。
|
|
9
|
+
*/
|
|
10
|
+
function useControllableState(options) {
|
|
11
|
+
const { modelValue, onChange } = options;
|
|
12
|
+
const controlled = modelValue.value !== void 0;
|
|
13
|
+
const local = ref(toValue(options.defaultValue));
|
|
14
|
+
const isControlled = computed(() => controlled);
|
|
15
|
+
const value = computed(() => controlled ? modelValue.value : local.value);
|
|
16
|
+
function setValue(next) {
|
|
17
|
+
if (Object.is(value.value, next)) return;
|
|
18
|
+
if (controlled) modelValue.value = next;
|
|
19
|
+
else local.value = next;
|
|
20
|
+
onChange?.(next);
|
|
21
|
+
}
|
|
22
|
+
return {
|
|
23
|
+
isControlled,
|
|
24
|
+
setValue,
|
|
25
|
+
value
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
//#endregion
|
|
29
|
+
//#region src/composables/useResizable.ts
|
|
30
|
+
const DEFAULT_SIZE = 250;
|
|
31
|
+
const DEFAULT_MIN = 50;
|
|
32
|
+
const DEFAULT_COLLAPSED_SIZE = 40;
|
|
33
|
+
const SNAP_DISTANCE = 8;
|
|
34
|
+
const UNMEASURED_BASIS = 1200;
|
|
35
|
+
const STORAGE_PREFIX = "astryx-resizable:";
|
|
36
|
+
function percent(value, options) {
|
|
37
|
+
return {
|
|
38
|
+
type: "percent",
|
|
39
|
+
value,
|
|
40
|
+
...options
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
function readBasis(container, direction) {
|
|
44
|
+
if (container) {
|
|
45
|
+
const px = direction === "horizontal" ? container.clientWidth : container.clientHeight;
|
|
46
|
+
if (px > 0) return {
|
|
47
|
+
px,
|
|
48
|
+
measured: true
|
|
49
|
+
};
|
|
50
|
+
return {
|
|
51
|
+
px: UNMEASURED_BASIS,
|
|
52
|
+
measured: false
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
if (typeof window === "undefined") return {
|
|
56
|
+
px: UNMEASURED_BASIS,
|
|
57
|
+
measured: false
|
|
58
|
+
};
|
|
59
|
+
const px = direction === "horizontal" ? window.innerWidth : window.innerHeight;
|
|
60
|
+
return {
|
|
61
|
+
px: px > 0 ? px : UNMEASURED_BASIS,
|
|
62
|
+
measured: px > 0
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
function parseSize(value, basis, fallback) {
|
|
66
|
+
if (value == null) return fallback;
|
|
67
|
+
if (typeof value === "number") return value;
|
|
68
|
+
if (typeof value === "string") {
|
|
69
|
+
const text = value.trim();
|
|
70
|
+
if (text.endsWith("%")) return Number(text.slice(0, -1)) / 100 * basis;
|
|
71
|
+
if (text.endsWith("px")) return Number(text.slice(0, -2));
|
|
72
|
+
const asNumber = Number(text);
|
|
73
|
+
return Number.isFinite(asNumber) ? asNumber : fallback;
|
|
74
|
+
}
|
|
75
|
+
if (value.type === "pixel") return value.value;
|
|
76
|
+
const px = value.value / 100 * basis;
|
|
77
|
+
if (value.min) return Math.max(px, value.min.value);
|
|
78
|
+
if (value.max) return Math.min(px, value.max.value);
|
|
79
|
+
return px;
|
|
80
|
+
}
|
|
81
|
+
function clampSize(size, min, max, snaps) {
|
|
82
|
+
const clamped = Math.min(max, Math.max(min, size));
|
|
83
|
+
if (snaps.length === 0) return clamped;
|
|
84
|
+
let nearest = snaps[0] ?? clamped;
|
|
85
|
+
let nearestDist = Math.abs(clamped - nearest);
|
|
86
|
+
for (let index = 1; index < snaps.length; index += 1) {
|
|
87
|
+
const snap = snaps[index] ?? nearest;
|
|
88
|
+
const dist = Math.abs(clamped - snap);
|
|
89
|
+
if (dist < nearestDist) {
|
|
90
|
+
nearest = snap;
|
|
91
|
+
nearestDist = dist;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
if (nearestDist > SNAP_DISTANCE) return clamped;
|
|
95
|
+
return Math.min(max, Math.max(min, nearest));
|
|
96
|
+
}
|
|
97
|
+
function loadPersistedState(key) {
|
|
98
|
+
if (typeof window === "undefined") return null;
|
|
99
|
+
try {
|
|
100
|
+
const raw = localStorage.getItem(STORAGE_PREFIX + key);
|
|
101
|
+
if (raw == null) return null;
|
|
102
|
+
const parsed = JSON.parse(raw);
|
|
103
|
+
if (typeof parsed === "number" && Number.isFinite(parsed)) return parsed === 0 ? {
|
|
104
|
+
size: null,
|
|
105
|
+
isCollapsed: true
|
|
106
|
+
} : {
|
|
107
|
+
size: parsed,
|
|
108
|
+
isCollapsed: null
|
|
109
|
+
};
|
|
110
|
+
if (typeof parsed === "object" && parsed != null) {
|
|
111
|
+
const record = parsed;
|
|
112
|
+
const hasSize = typeof record.size === "number" && Number.isFinite(record.size) && record.size > 0;
|
|
113
|
+
if (hasSize || record.isCollapsed === true) return {
|
|
114
|
+
size: hasSize ? record.size : null,
|
|
115
|
+
isCollapsed: record.isCollapsed === true
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
} catch {
|
|
119
|
+
return null;
|
|
120
|
+
}
|
|
121
|
+
return null;
|
|
122
|
+
}
|
|
123
|
+
function useSingleRegion(options, cascade) {
|
|
124
|
+
const direction = options.direction ?? "horizontal";
|
|
125
|
+
const collapsible = options.collapsible ?? false;
|
|
126
|
+
const collapsedSize = options.collapsedSize ?? DEFAULT_COLLAPSED_SIZE;
|
|
127
|
+
const snaps = options.snaps ?? [];
|
|
128
|
+
const size = ref(DEFAULT_SIZE);
|
|
129
|
+
const expandedSize = ref(DEFAULT_SIZE);
|
|
130
|
+
const isCollapsed = ref(false);
|
|
131
|
+
const basisMeasured = ref(true);
|
|
132
|
+
const controlledCollapse = computed(() => options.isCollapsed);
|
|
133
|
+
let origin = DEFAULT_SIZE;
|
|
134
|
+
let settledDefault = false;
|
|
135
|
+
let dragging = false;
|
|
136
|
+
let dragLimits = null;
|
|
137
|
+
function currentBasis() {
|
|
138
|
+
return readBasis(options.containerRef?.value, direction);
|
|
139
|
+
}
|
|
140
|
+
function limits() {
|
|
141
|
+
const basis = currentBasis();
|
|
142
|
+
basisMeasured.value = basis.measured || options.containerRef == null;
|
|
143
|
+
return {
|
|
144
|
+
min: parseSize(options.minSize, basis.px, DEFAULT_MIN),
|
|
145
|
+
max: parseSize(options.maxSize, basis.px, Number.POSITIVE_INFINITY)
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
function applySize(next, collapsed) {
|
|
149
|
+
const { min, max } = limits();
|
|
150
|
+
if (collapsed && collapsible) {
|
|
151
|
+
isCollapsed.value = true;
|
|
152
|
+
size.value = 0;
|
|
153
|
+
return;
|
|
154
|
+
}
|
|
155
|
+
const clamped = clampSize(next, min, max, snaps);
|
|
156
|
+
isCollapsed.value = false;
|
|
157
|
+
size.value = clamped;
|
|
158
|
+
expandedSize.value = clamped;
|
|
159
|
+
}
|
|
160
|
+
function restore() {
|
|
161
|
+
const basis = currentBasis();
|
|
162
|
+
const initial = parseSize(options.defaultSize, basis.px, DEFAULT_SIZE);
|
|
163
|
+
const saved = options.autoSaveId ? loadPersistedState(options.autoSaveId) : null;
|
|
164
|
+
const collapsed = controlledCollapse.value ?? saved?.isCollapsed ?? (collapsible && options.defaultIsCollapsed === true);
|
|
165
|
+
const starting = saved?.size ?? initial;
|
|
166
|
+
if (options.containerRef != null && !basis.measured) {
|
|
167
|
+
basisMeasured.value = false;
|
|
168
|
+
applySize(starting, Boolean(collapsed));
|
|
169
|
+
return;
|
|
170
|
+
}
|
|
171
|
+
settledDefault = true;
|
|
172
|
+
basisMeasured.value = true;
|
|
173
|
+
expandedSize.value = starting;
|
|
174
|
+
applySize(starting, Boolean(collapsed));
|
|
175
|
+
}
|
|
176
|
+
restore();
|
|
177
|
+
function persist() {
|
|
178
|
+
if (!options.autoSaveId || !basisMeasured.value) return;
|
|
179
|
+
try {
|
|
180
|
+
localStorage.setItem(STORAGE_PREFIX + options.autoSaveId, JSON.stringify({
|
|
181
|
+
size: expandedSize.value,
|
|
182
|
+
isCollapsed: isCollapsed.value
|
|
183
|
+
}));
|
|
184
|
+
} catch {}
|
|
185
|
+
}
|
|
186
|
+
function setCollapsed(next) {
|
|
187
|
+
if (!collapsible && next) return;
|
|
188
|
+
if (options.isCollapsed != null) {
|
|
189
|
+
options.onCollapseChange?.(next);
|
|
190
|
+
return;
|
|
191
|
+
}
|
|
192
|
+
applySize(next ? 0 : expandedSize.value, next);
|
|
193
|
+
options.onCollapseChange?.(next);
|
|
194
|
+
persist();
|
|
195
|
+
cascade?.settle();
|
|
196
|
+
}
|
|
197
|
+
function resize(next) {
|
|
198
|
+
applySize(next, false);
|
|
199
|
+
cascade?.settle();
|
|
200
|
+
options.onSizeChange?.(size.value);
|
|
201
|
+
persist();
|
|
202
|
+
}
|
|
203
|
+
function paintDrag(next, collapsed) {
|
|
204
|
+
const bounds = dragLimits ?? limits();
|
|
205
|
+
if (collapsed && collapsible) {
|
|
206
|
+
isCollapsed.value = true;
|
|
207
|
+
size.value = 0;
|
|
208
|
+
return;
|
|
209
|
+
}
|
|
210
|
+
const clamped = clampSize(next, bounds.min, bounds.max, snaps);
|
|
211
|
+
isCollapsed.value = false;
|
|
212
|
+
size.value = clamped;
|
|
213
|
+
expandedSize.value = clamped;
|
|
214
|
+
}
|
|
215
|
+
function onResizeStart() {
|
|
216
|
+
dragging = true;
|
|
217
|
+
origin = isCollapsed.value ? 0 : size.value;
|
|
218
|
+
dragLimits = limits();
|
|
219
|
+
}
|
|
220
|
+
function onResizeMove(delta) {
|
|
221
|
+
const raw = origin + delta;
|
|
222
|
+
if (collapsible && raw < collapsedSize) {
|
|
223
|
+
if (!isCollapsed.value) {
|
|
224
|
+
paintDrag(0, true);
|
|
225
|
+
options.onCollapseChange?.(true);
|
|
226
|
+
options.onSizeChange?.(0);
|
|
227
|
+
}
|
|
228
|
+
return;
|
|
229
|
+
}
|
|
230
|
+
const wasCollapsed = isCollapsed.value;
|
|
231
|
+
paintDrag(raw, false);
|
|
232
|
+
if (wasCollapsed) options.onCollapseChange?.(false);
|
|
233
|
+
options.onSizeChange?.(size.value);
|
|
234
|
+
}
|
|
235
|
+
function onResizeEnd() {
|
|
236
|
+
dragging = false;
|
|
237
|
+
dragLimits = null;
|
|
238
|
+
persist();
|
|
239
|
+
cascade?.settle();
|
|
240
|
+
}
|
|
241
|
+
function applyDisplay(next) {
|
|
242
|
+
if (isCollapsed.value) return;
|
|
243
|
+
size.value = next;
|
|
244
|
+
}
|
|
245
|
+
const props = computed(() => {
|
|
246
|
+
const { min, max } = limits();
|
|
247
|
+
return {
|
|
248
|
+
_size: size.value,
|
|
249
|
+
_isCollapsed: isCollapsed.value,
|
|
250
|
+
_onResizeStart: onResizeStart,
|
|
251
|
+
_onResizeMove: onResizeMove,
|
|
252
|
+
_onResizeEnd: onResizeEnd,
|
|
253
|
+
_onResizeCancel: onResizeEnd,
|
|
254
|
+
_minSizePx: min,
|
|
255
|
+
_maxSizePx: max,
|
|
256
|
+
_snaps: snaps,
|
|
257
|
+
_collapsedSize: collapsedSize,
|
|
258
|
+
_collapsible: collapsible,
|
|
259
|
+
_direction: direction,
|
|
260
|
+
_isResizableProps: true
|
|
261
|
+
};
|
|
262
|
+
});
|
|
263
|
+
function measureDefault() {
|
|
264
|
+
if (settledDefault || options.containerRef == null) return;
|
|
265
|
+
const basis = currentBasis();
|
|
266
|
+
if (!basis.measured) return;
|
|
267
|
+
settledDefault = true;
|
|
268
|
+
basisMeasured.value = true;
|
|
269
|
+
if (options.autoSaveId && loadPersistedState(options.autoSaveId)) return;
|
|
270
|
+
const initial = parseSize(options.defaultSize, basis.px, size.value);
|
|
271
|
+
expandedSize.value = initial;
|
|
272
|
+
if (!isCollapsed.value) applySize(initial, false);
|
|
273
|
+
cascade?.settle();
|
|
274
|
+
}
|
|
275
|
+
let observer;
|
|
276
|
+
onMounted(() => {
|
|
277
|
+
measureDefault();
|
|
278
|
+
const element = options.containerRef?.value;
|
|
279
|
+
if (element == null || typeof ResizeObserver === "undefined") return;
|
|
280
|
+
observer = new ResizeObserver(() => measureDefault());
|
|
281
|
+
observer.observe(element);
|
|
282
|
+
});
|
|
283
|
+
onBeforeUnmount(() => observer?.disconnect());
|
|
284
|
+
watch(controlledCollapse, (next) => {
|
|
285
|
+
if (next != null) {
|
|
286
|
+
applySize(next ? 0 : expandedSize.value, next);
|
|
287
|
+
cascade?.settle();
|
|
288
|
+
}
|
|
289
|
+
});
|
|
290
|
+
cascade?.register({
|
|
291
|
+
preferred: () => expandedSize.value,
|
|
292
|
+
isCollapsed: () => isCollapsed.value,
|
|
293
|
+
min: () => limits().min,
|
|
294
|
+
isDragging: () => dragging,
|
|
295
|
+
applyDisplay
|
|
296
|
+
});
|
|
297
|
+
return reactive({
|
|
298
|
+
size,
|
|
299
|
+
isCollapsed,
|
|
300
|
+
collapse: () => setCollapsed(true),
|
|
301
|
+
expand: () => setCollapsed(false),
|
|
302
|
+
resize,
|
|
303
|
+
props
|
|
304
|
+
});
|
|
305
|
+
}
|
|
306
|
+
function useResizable(options) {
|
|
307
|
+
if ("regions" in options && options.regions != null) {
|
|
308
|
+
const direction = options.direction ?? "horizontal";
|
|
309
|
+
const entries = [];
|
|
310
|
+
let ready = false;
|
|
311
|
+
function reflow() {
|
|
312
|
+
if (!ready || entries.length === 0 || !entries.some((entry) => entry.order != null)) return;
|
|
313
|
+
if (entries.some((entry) => entry.api.isDragging())) return;
|
|
314
|
+
const element = options.containerRef?.value;
|
|
315
|
+
if (element == null) return;
|
|
316
|
+
const basis = readBasis(element, direction);
|
|
317
|
+
if (!basis.measured) return;
|
|
318
|
+
const active = entries.filter((entry) => !entry.api.isCollapsed());
|
|
319
|
+
const sizes = new Map(active.map((entry) => [entry.key, entry.api.preferred()]));
|
|
320
|
+
let overflow = active.reduce((sum, entry) => sum + entry.api.preferred(), 0) - basis.px;
|
|
321
|
+
if (overflow > 0) {
|
|
322
|
+
const order = [...active].sort((left, right) => {
|
|
323
|
+
return (left.order ?? Number.POSITIVE_INFINITY) - (right.order ?? Number.POSITIVE_INFINITY) || entries.indexOf(left) - entries.indexOf(right);
|
|
324
|
+
});
|
|
325
|
+
for (const entry of order) {
|
|
326
|
+
if (overflow <= 0) break;
|
|
327
|
+
const current = sizes.get(entry.key) ?? 0;
|
|
328
|
+
const room = Math.max(0, current - entry.api.min());
|
|
329
|
+
const take = Math.min(room, overflow);
|
|
330
|
+
sizes.set(entry.key, current - take);
|
|
331
|
+
overflow -= take;
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
for (const entry of active) {
|
|
335
|
+
const next = sizes.get(entry.key);
|
|
336
|
+
if (next != null) entry.api.applyDisplay(next);
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
const regions = {};
|
|
340
|
+
for (const key of Object.keys(options.regions)) {
|
|
341
|
+
const config = options.regions[key];
|
|
342
|
+
regions[key] = useSingleRegion({
|
|
343
|
+
...config,
|
|
344
|
+
direction,
|
|
345
|
+
containerRef: options.containerRef,
|
|
346
|
+
autoSaveId: options.autoSaveId ? `${options.autoSaveId}:${key}` : void 0
|
|
347
|
+
}, {
|
|
348
|
+
register: (api) => {
|
|
349
|
+
entries.push({
|
|
350
|
+
key,
|
|
351
|
+
order: config?.shrinkOrder,
|
|
352
|
+
api
|
|
353
|
+
});
|
|
354
|
+
},
|
|
355
|
+
settle: reflow
|
|
356
|
+
});
|
|
357
|
+
}
|
|
358
|
+
ready = true;
|
|
359
|
+
let observer;
|
|
360
|
+
onMounted(() => {
|
|
361
|
+
reflow();
|
|
362
|
+
const element = options.containerRef?.value;
|
|
363
|
+
if (element == null || typeof ResizeObserver === "undefined") return;
|
|
364
|
+
observer = new ResizeObserver(() => reflow());
|
|
365
|
+
observer.observe(element);
|
|
366
|
+
});
|
|
367
|
+
onBeforeUnmount(() => observer?.disconnect());
|
|
368
|
+
return regions;
|
|
369
|
+
}
|
|
370
|
+
return useSingleRegion(options);
|
|
371
|
+
}
|
|
372
|
+
//#endregion
|
|
373
|
+
//#region src/composables/useScrollOverflow.ts
|
|
374
|
+
/**
|
|
375
|
+
* 观察一个横向滚动容器,报告起始边和结束边有没有被挡住。
|
|
376
|
+
* 容差 1px,滚动和尺寸变化都会重新量。
|
|
377
|
+
*/
|
|
378
|
+
function useScrollOverflow() {
|
|
379
|
+
const element = ref(null);
|
|
380
|
+
const overflowStart = ref(false);
|
|
381
|
+
const overflowEnd = ref(false);
|
|
382
|
+
const hasOverflow = ref(false);
|
|
383
|
+
let observer;
|
|
384
|
+
function measure() {
|
|
385
|
+
const node = element.value;
|
|
386
|
+
if (node == null) return;
|
|
387
|
+
const tolerance = 1;
|
|
388
|
+
const maxScroll = node.scrollWidth - node.clientWidth;
|
|
389
|
+
const nextStart = Math.abs(node.scrollLeft) > tolerance;
|
|
390
|
+
const nextEnd = Math.abs(node.scrollLeft) < maxScroll - tolerance;
|
|
391
|
+
const nextHas = node.scrollWidth > node.clientWidth + tolerance;
|
|
392
|
+
overflowStart.value = nextStart;
|
|
393
|
+
overflowEnd.value = nextEnd;
|
|
394
|
+
hasOverflow.value = nextHas;
|
|
395
|
+
}
|
|
396
|
+
function scrollRef(node) {
|
|
397
|
+
element.value?.removeEventListener("scroll", measure);
|
|
398
|
+
observer?.disconnect();
|
|
399
|
+
element.value = node;
|
|
400
|
+
if (node == null) return;
|
|
401
|
+
node.addEventListener("scroll", measure, { passive: true });
|
|
402
|
+
if (typeof ResizeObserver !== "undefined") {
|
|
403
|
+
observer = new ResizeObserver(measure);
|
|
404
|
+
observer.observe(node);
|
|
405
|
+
}
|
|
406
|
+
measure();
|
|
407
|
+
}
|
|
408
|
+
onBeforeUnmount(() => {
|
|
409
|
+
element.value?.removeEventListener("scroll", measure);
|
|
410
|
+
observer?.disconnect();
|
|
411
|
+
});
|
|
412
|
+
return {
|
|
413
|
+
scrollRef,
|
|
414
|
+
overflowStart,
|
|
415
|
+
overflowEnd,
|
|
416
|
+
hasOverflow
|
|
417
|
+
};
|
|
418
|
+
}
|
|
419
|
+
//#endregion
|
|
420
|
+
//#region src/composables/useStreamingText.ts
|
|
421
|
+
const CHARS_PER_TICK = {
|
|
422
|
+
natural: 10,
|
|
423
|
+
fast: 4,
|
|
424
|
+
instant: Number.POSITIVE_INFINITY
|
|
425
|
+
};
|
|
426
|
+
const FALLBACK_DURATION_MS = 95;
|
|
427
|
+
function parseCssDuration(value) {
|
|
428
|
+
const milliseconds = /^([\d.]+)ms$/.exec(value.trim());
|
|
429
|
+
if (milliseconds?.[1] != null) return Number(milliseconds[1]);
|
|
430
|
+
const seconds = /^([\d.]+)s$/.exec(value.trim());
|
|
431
|
+
if (seconds?.[1] != null) return Number(seconds[1]) * 1e3;
|
|
432
|
+
return null;
|
|
433
|
+
}
|
|
434
|
+
function motionDuration() {
|
|
435
|
+
if (typeof document === "undefined") return FALLBACK_DURATION_MS;
|
|
436
|
+
return parseCssDuration(getComputedStyle(document.documentElement).getPropertyValue("--astryx-duration-fast-min")) ?? FALLBACK_DURATION_MS;
|
|
437
|
+
}
|
|
438
|
+
function tickInterval(speed) {
|
|
439
|
+
if (speed === "instant") return 0;
|
|
440
|
+
const duration = motionDuration();
|
|
441
|
+
const tick = speed === "fast" ? duration / 20 : duration / 10;
|
|
442
|
+
return Math.max(4, Math.round(tick));
|
|
443
|
+
}
|
|
444
|
+
const graphemeSegmenter = typeof Intl.Segmenter === "function" ? new Intl.Segmenter(void 0, { granularity: "grapheme" }) : null;
|
|
445
|
+
function isLowSurrogate(codeUnit) {
|
|
446
|
+
return codeUnit >= 56320 && codeUnit <= 57343;
|
|
447
|
+
}
|
|
448
|
+
/**
|
|
449
|
+
* Move `offset` back to the start of the grapheme it lands inside, so a slice
|
|
450
|
+
* never cuts a surrogate pair, a flag, or a ZWJ sequence in half.
|
|
451
|
+
*/
|
|
452
|
+
function snapToGraphemeBoundary(text, offset) {
|
|
453
|
+
if (offset <= 0 || offset >= text.length) return offset;
|
|
454
|
+
if (graphemeSegmenter != null) return graphemeSegmenter.segment(text).containing(offset)?.index ?? offset;
|
|
455
|
+
return isLowSurrogate(text.charCodeAt(offset)) ? offset - 1 : offset;
|
|
456
|
+
}
|
|
457
|
+
/**
|
|
458
|
+
* Smooth a burst of streamed text into a steady reveal.
|
|
459
|
+
* While `isStreaming` is false, or the user prefers reduced motion, the full
|
|
460
|
+
* source is returned. The reveal steps by UTF-16 units and then snaps back to
|
|
461
|
+
* a grapheme boundary.
|
|
462
|
+
*/
|
|
463
|
+
function useStreamingText(targetText, isStreaming = false, options) {
|
|
464
|
+
const displayedLen = ref(0);
|
|
465
|
+
const prefersReducedMotion = useMediaQuery("(prefers-reduced-motion: reduce)");
|
|
466
|
+
const target = computed(() => toValue(targetText));
|
|
467
|
+
const streaming = computed(() => toValue(isStreaming));
|
|
468
|
+
const speed = computed(() => toValue(options)?.speed ?? "natural");
|
|
469
|
+
const instant = computed(() => !streaming.value || speed.value === "instant" || prefersReducedMotion.value);
|
|
470
|
+
watch(target, (next, previous) => {
|
|
471
|
+
if (next.length === 0 && (previous?.length ?? 0) > 0) displayedLen.value = 0;
|
|
472
|
+
});
|
|
473
|
+
watch(streaming, (next) => {
|
|
474
|
+
if (!next) displayedLen.value = target.value.length;
|
|
475
|
+
});
|
|
476
|
+
watch(instant, (isInstant, _, onCleanup) => {
|
|
477
|
+
if (isInstant) return;
|
|
478
|
+
let frame = 0;
|
|
479
|
+
let lastTick = 0;
|
|
480
|
+
const tick = (now) => {
|
|
481
|
+
const interval = tickInterval(speed.value);
|
|
482
|
+
if (now - lastTick >= interval) {
|
|
483
|
+
lastTick = now;
|
|
484
|
+
const goal = target.value.length;
|
|
485
|
+
if (displayedLen.value < goal) {
|
|
486
|
+
const step = CHARS_PER_TICK[speed.value];
|
|
487
|
+
displayedLen.value = Math.min(displayedLen.value + step, goal);
|
|
488
|
+
}
|
|
489
|
+
}
|
|
490
|
+
frame = requestAnimationFrame(tick);
|
|
491
|
+
};
|
|
492
|
+
frame = requestAnimationFrame(tick);
|
|
493
|
+
onCleanup(() => cancelAnimationFrame(frame));
|
|
494
|
+
}, { immediate: true });
|
|
495
|
+
return computed(() => {
|
|
496
|
+
const text = target.value;
|
|
497
|
+
if (instant.value) return text;
|
|
498
|
+
return text.slice(0, snapToGraphemeBoundary(text, displayedLen.value));
|
|
499
|
+
});
|
|
500
|
+
}
|
|
501
|
+
//#endregion
|
|
502
|
+
export { useResizable as a, percent as i, useStreamingText as n, useControllableState as o, useScrollOverflow as r, snapToGraphemeBoundary as t };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { computed, inject, ref } from "vue";
|
|
2
|
+
//#region src/SideNav/context.ts
|
|
3
|
+
const sideNavRenderModeKey = Symbol("astryx-side-nav-render-mode");
|
|
4
|
+
const defaultRenderMode = computed(() => "default");
|
|
5
|
+
function useSideNavRenderMode() {
|
|
6
|
+
return inject(sideNavRenderModeKey, defaultRenderMode);
|
|
7
|
+
}
|
|
8
|
+
const sideNavCollapseKey = Symbol("astryx-side-nav-collapse");
|
|
9
|
+
const fallbackCollapse = {
|
|
10
|
+
isCollapsed: ref(false),
|
|
11
|
+
isCollapsible: ref(false),
|
|
12
|
+
navId: "",
|
|
13
|
+
toggle: () => {}
|
|
14
|
+
};
|
|
15
|
+
function useSideNavCollapse() {
|
|
16
|
+
return inject(sideNavCollapseKey, fallbackCollapse);
|
|
17
|
+
}
|
|
18
|
+
//#endregion
|
|
19
|
+
export { useSideNavRenderMode as i, sideNavRenderModeKey as n, useSideNavCollapse as r, sideNavCollapseKey as t };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { computed, inject } from "vue";
|
|
2
|
+
//#region src/FormLayout/context.ts
|
|
3
|
+
const formLayoutKey = Symbol("astryx-form-layout");
|
|
4
|
+
function useFormLayout() {
|
|
5
|
+
return inject(formLayoutKey, computed(() => null));
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* 没有 FormLayout 时保持原来的 aria-required。
|
|
9
|
+
* 有默认必填时,没标 optional 的字段也要报必填,但不写原生 required。
|
|
10
|
+
* 两个标记同时出现时,optional 优先。
|
|
11
|
+
*/
|
|
12
|
+
function ariaRequired(isRequired, isOptional, optionality) {
|
|
13
|
+
if (isOptional) return void 0;
|
|
14
|
+
if (optionality == null) return isRequired ? true : void 0;
|
|
15
|
+
if (optionality === "required" || isRequired) return true;
|
|
16
|
+
}
|
|
17
|
+
function useAriaRequired(props) {
|
|
18
|
+
const layout = useFormLayout();
|
|
19
|
+
return computed(() => ariaRequired(props.isRequired, props.isOptional, layout.value?.defaultOptionality));
|
|
20
|
+
}
|
|
21
|
+
function showsOptionalIndicator(isOptional, _isRequired, optionality) {
|
|
22
|
+
return Boolean(isOptional) && optionality !== "optional";
|
|
23
|
+
}
|
|
24
|
+
function showsRequiredIndicator(isRequired, isOptional, optionality) {
|
|
25
|
+
if (isOptional) return false;
|
|
26
|
+
return Boolean(isRequired) && optionality !== "required";
|
|
27
|
+
}
|
|
28
|
+
//#endregion
|
|
29
|
+
export { useFormLayout as a, useAriaRequired as i, showsOptionalIndicator as n, showsRequiredIndicator as r, formLayoutKey as t };
|