@leavepulse/ui 0.44.0 → 0.45.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/README.md +49 -3
- package/dist/assets/{LpCommandPalette-DCP5g2ik.css → LpCommandPalette-nGNnzXqQ.css} +21 -21
- package/dist/assets/{LpRollingText-CR1mb0Vt.css → LpRollingText-BGnE6q9j.css} +3 -0
- package/dist/assets/{LpShortcutsDialog-ChUyU7oV.css → LpShortcutsDialog-CqYX3yy6.css} +28 -7
- package/dist/assets/{LpTable-DDQNdf86.css → LpTable-CPwWxTJS.css} +49 -9
- package/dist/chunks/{ContextMenuItems-CrfeNPWT.js → ContextMenuItems-BtKU7074.js} +2 -1
- package/dist/chunks/{LayoutCanvas-D-jPOAvg.js → LayoutCanvas-BkaGXTjx.js} +1 -1
- package/dist/chunks/{LayoutNode-D8Xy9N-o.js → LayoutNode-B3_9E1Xa.js} +9 -5
- package/dist/chunks/{LpActionBar-BbwCF6l5.js → LpActionBar-CnfFVIwC.js} +3 -3
- package/dist/chunks/{LpAddressInput-BrOqkZqg.js → LpAddressInput-BwX8uo4_.js} +7 -7
- package/dist/chunks/{LpAlert-DkOIjsbq.js → LpAlert-B6ilrM7T.js} +1 -1
- package/dist/chunks/{LpAppShell-BUKPcHco.js → LpAppShell-C53_RaGF.js} +4 -4
- package/dist/chunks/{LpAutocomplete-DxV3Y9h4.js → LpAutocomplete-C8IgSMsi.js} +2 -1
- package/dist/chunks/{LpAvatar-ClBbEYZN.js → LpAvatar-C1XStdOo.js} +3 -3
- package/dist/chunks/{LpBreadcrumbs-B8IJgFIc.js → LpBreadcrumbs-CQJd73Gm.js} +1 -1
- package/dist/chunks/{LpButton-kqJBHIIb.js → LpButton-CKSwC6Mu.js} +1 -1
- package/dist/chunks/{LpCalendar-B7Ko5RdR.js → LpCalendar-DrA2McTU.js} +1 -1
- package/dist/chunks/{LpCard-CpRByR0q.js → LpCard-C2IvucmX.js} +1 -1
- package/dist/chunks/{LpCheckbox-DpqchzH4.js → LpCheckbox-Bkj13CbW.js} +1 -1
- package/dist/chunks/{LpCodeBlock-DeHJPq7p.js → LpCodeBlock-ca7ANFyW.js} +1 -1
- package/dist/chunks/{LpColorPicker-Bhf1qxhB.js → LpColorPicker-zz4VGkG4.js} +46 -20
- package/dist/chunks/{LpConfirmDialog-CIUOSnWo.js → LpConfirmDialog-DCw5jR1t.js} +3 -3
- package/dist/chunks/{LpConfirmHost-CDm0Wtpv.js → LpConfirmHost-CbywMpMP.js} +1 -1
- package/dist/chunks/{LpContextMenu-DQw5dGfG.js → LpContextMenu-BqkAYa9X.js} +2 -1
- package/dist/chunks/{LpDatePicker-Drirx1AK.js → LpDatePicker-DuusgT69.js} +13 -9
- package/dist/chunks/LpDateRangePicker-DHeuznfC.js +208 -0
- package/dist/chunks/{LpDisclosure-ChQYmjlR.js → LpDisclosure-Cc23-JOT.js} +1 -1
- package/dist/chunks/{LpDrawer-bScx-KMO.js → LpDrawer-Dt4aB4Fr.js} +2 -2
- package/dist/chunks/{LpDropdownMenu-DJpoqRCb.js → LpDropdownMenu-DdJGQzPn.js} +2 -1
- package/dist/chunks/{LpEmptyState-Dsdqz1Wj.js → LpEmptyState-BJbZXC8D.js} +1 -1
- package/dist/chunks/LpFieldNotice-wtieLUTj.js +64 -0
- package/dist/chunks/{LpFileTree-CSI_5SK2.js → LpFileTree-CNurOvkV.js} +3 -3
- package/dist/chunks/{LpFileTreeNode-B4MiSQX2.js → LpFileTreeNode-D_qRRdsH.js} +3 -3
- package/dist/chunks/{LpFormField-CIk5qosh.js → LpFormField-CtVYj6tO.js} +29 -15
- package/dist/chunks/{LpIcon-CCnX5_2j.js → LpIcon-DYtaid0K.js} +20 -6
- package/dist/chunks/{LpInput-C0e8y8_d.js → LpInput-D-YGQbEv.js} +39 -16
- package/dist/chunks/{LpLightbox-Mr0W_6HK.js → LpLightbox-DSDahF23.js} +1 -1
- package/dist/chunks/{LpLogViewer-YBOaFnc_.js → LpLogViewer-KypbgOyo.js} +252 -58
- package/dist/chunks/{LpMapPicker-NUzS9e37.js → LpMapPicker-Cc84LaM3.js} +1 -1
- package/dist/chunks/{LpMediaGallery-DfJmMW0I.js → LpMediaGallery-YKr-cQPN.js} +2 -2
- package/dist/chunks/{LpModal-DPwGKBPv.js → LpModal-DMMDQHAu.js} +3 -3
- package/dist/chunks/{LpModalNav-DPg5H9f3.js → LpModalNav-BVPDyIup.js} +4 -4
- package/dist/chunks/{LpNotificationBell-t5yn-siX.js → LpNotificationBell-CCwyJP5C.js} +26 -14
- package/dist/chunks/{LpNumberField-DWnQKktS.js → LpNumberField-B77O-z28.js} +1 -1
- package/dist/chunks/{LpPagination-DFngX7Xo.js → LpPagination-BcDlo3r_.js} +1 -1
- package/dist/chunks/{LpPasswordInput-CWVDuBJ5.js → LpPasswordInput-eKzQhbQP.js} +2 -2
- package/dist/chunks/{LpPhoneInput-CD-ZTeSd.js → LpPhoneInput-BCbrrhgE.js} +126 -23
- package/dist/chunks/{LpPie-BLco31Nx.js → LpPie-BEJ2SfI6.js} +9 -10
- package/dist/chunks/{LpPopover-p_e_shN3.js → LpPopover-DCKeqiVn.js} +1 -0
- package/dist/chunks/LpRangeCalendar-DZuaRV0W.js +331 -0
- package/dist/chunks/{LpRollingText-CM5gkSeF.js → LpRollingText-DB7upf-5.js} +1 -1
- package/dist/chunks/{LpScrollArea-D8xyKXcF.js → LpScrollArea-Bry1fdOM.js} +14 -2
- package/dist/chunks/{LpSection-aM6J_u51.js → LpSection-tKEH0jYf.js} +1 -1
- package/dist/chunks/{LpSegmented-Dejd7cIx.js → LpSegmented-C09EEam2.js} +1 -1
- package/dist/chunks/{LpSelect-DrRD9I7L.js → LpSelect-DNIL6MB9.js} +20 -23
- package/dist/chunks/{LpSidebar-BgwUNWpJ.js → LpSidebar-CQNB0-yU.js} +3 -3
- package/dist/chunks/{LpSidebarNav-Bqxz8aWT.js → LpSidebarNav-kx-LdqNU.js} +3 -3
- package/dist/chunks/{LpStat-dXtyrdX9.js → LpStat-B-7udBRP.js} +1 -1
- package/dist/chunks/{LpStepper-Bk-XaQYU.js → LpStepper-C7XiVKZj.js} +34 -19
- package/dist/chunks/{LpSwitch-B1aLKulj.js → LpSwitch-OrcOJX9m.js} +1 -1
- package/dist/chunks/LpTableFilter-BV8PpLM9.js +158 -0
- package/dist/chunks/{LpTabs-_qMVaZJ6.js → LpTabs-29iW1XOx.js} +1 -1
- package/dist/chunks/LpTagsInput-D1SuqbhB.js +300 -0
- package/dist/chunks/{LpTextarea-yP8hGedR.js → LpTextarea-uuScWo6-.js} +1 -1
- package/dist/chunks/{LpThemeProvider-Wjm7Tuit.js → LpThemeProvider-Be4r2TQX.js} +1 -1
- package/dist/chunks/{LpThemeSwitcher-CKLc10KZ.js → LpThemeSwitcher-B4aVPbNC.js} +19 -22
- package/dist/chunks/{LpTimeField-C5HRgS5H.js → LpTimeField-Cqe7fXnh.js} +1 -1
- package/dist/chunks/{LpToaster--oT6lfhL.js → LpToaster-DpJvoCOh.js} +37 -3
- package/dist/chunks/{LpTooltip-CBdzeKNf.js → LpTooltip-CXVKcOXT.js} +3 -2
- package/dist/chunks/{LpTopologyCanvas-DocsLal3.js → LpTopologyCanvas-6ozNrQKh.js} +2 -1
- package/dist/chunks/{LpUptimeBar-DLtxOMRy.js → LpUptimeBar-ugcv25xj.js} +2 -2
- package/dist/chunks/icons-CkA0njzm.js +43 -0
- package/dist/chunks/{useTheme-C8JHUlPM.js → useTheme-DJm1JSsY.js} +47 -50
- package/dist/component-names.d.ts +1 -1
- package/dist/components/ContextMenuItems.vue.js +1 -1
- package/dist/components/LayoutCanvas.vue.js +1 -1
- package/dist/components/LayoutNode.vue.js +1 -1
- package/dist/components/LpActionBar.vue.js +1 -1
- package/dist/components/LpAddressInput.vue.js +1 -1
- package/dist/components/LpAlert.vue.js +1 -1
- package/dist/components/LpAppShell.vue.js +1 -1
- package/dist/components/LpAutocomplete.vue.js +1 -1
- package/dist/components/LpAvatar.vue.js +1 -1
- package/dist/components/LpBreadcrumbs.vue.js +1 -1
- package/dist/components/LpButton.vue.d.ts +2 -2
- package/dist/components/LpButton.vue.js +1 -1
- package/dist/components/LpCalendar.vue.js +1 -1
- package/dist/components/LpCard.vue.js +1 -1
- package/dist/components/LpChart.vue.d.ts +16 -1
- package/dist/components/LpChart.vue.js +63 -5
- package/dist/components/LpCheckbox.vue.js +1 -1
- package/dist/components/LpCodeBlock.vue.js +1 -1
- package/dist/components/LpColorPicker.vue.d.ts +2 -2
- package/dist/components/LpColorPicker.vue.js +1 -1
- package/dist/components/LpCommandPalette.vue.d.ts +6 -0
- package/dist/components/LpCommandPalette.vue.js +61 -10
- package/dist/components/LpConfirmDialog.vue.js +1 -1
- package/dist/components/LpConfirmHost.vue.js +1 -1
- package/dist/components/LpContextMenu.vue.js +1 -1
- package/dist/components/LpDatePicker.vue.js +1 -1
- package/dist/components/LpDateRangePicker.vue.d.ts +60 -0
- package/dist/components/LpDateRangePicker.vue.js +4 -0
- package/dist/components/LpDisclosure.vue.js +1 -1
- package/dist/components/LpDrawer.vue.js +1 -1
- package/dist/components/LpDropdownMenu.vue.js +1 -1
- package/dist/components/LpDropzone.vue.js +1 -1
- package/dist/components/LpEmptyState.vue.js +1 -1
- package/dist/components/LpFieldNotice.vue.d.ts +8 -0
- package/dist/components/LpFieldNotice.vue.js +4 -0
- package/dist/components/LpFileTree.vue.js +1 -1
- package/dist/components/LpFileTreeNode.vue.js +1 -1
- package/dist/components/LpFormField.vue.d.ts +4 -1
- package/dist/components/LpFormField.vue.js +1 -1
- package/dist/components/LpIcon.vue.d.ts +0 -1
- package/dist/components/LpIcon.vue.js +1 -1
- package/dist/components/LpImageEditor.vue.js +2 -2
- package/dist/components/LpInput.vue.d.ts +19 -0
- package/dist/components/LpInput.vue.js +1 -1
- package/dist/components/LpLightbox.vue.js +1 -1
- package/dist/components/LpLogViewer.vue.d.ts +52 -1
- package/dist/components/LpLogViewer.vue.js +1 -1
- package/dist/components/LpMapPicker.vue.js +1 -1
- package/dist/components/LpMediaGallery.vue.js +1 -1
- package/dist/components/LpModal.vue.js +1 -1
- package/dist/components/LpModalNav.vue.js +1 -1
- package/dist/components/LpNotificationBell.vue.js +1 -1
- package/dist/components/LpNumberField.vue.js +1 -1
- package/dist/components/LpPagination.vue.js +1 -1
- package/dist/components/LpPasswordInput.vue.js +1 -1
- package/dist/components/LpPhoneInput.vue.d.ts +13 -0
- package/dist/components/LpPhoneInput.vue.js +1 -1
- package/dist/components/LpPie.vue.js +1 -1
- package/dist/components/LpPopover.vue.js +1 -1
- package/dist/components/LpProgress.vue.d.ts +1 -1
- package/dist/components/LpRangeCalendar.vue.d.ts +51 -0
- package/dist/components/LpRangeCalendar.vue.js +4 -0
- package/dist/components/LpRollingText.vue.d.ts +1 -1
- package/dist/components/LpRollingText.vue.js +1 -1
- package/dist/components/LpScrollArea.vue.d.ts +2 -2
- package/dist/components/LpScrollArea.vue.js +1 -1
- package/dist/components/LpSection.vue.js +1 -1
- package/dist/components/LpSegmented.vue.js +1 -1
- package/dist/components/LpSelect.vue.js +1 -1
- package/dist/components/LpShortcutsDialog.vue.d.ts +6 -0
- package/dist/components/LpShortcutsDialog.vue.js +56 -14
- package/dist/components/LpSidebar.vue.js +1 -1
- package/dist/components/LpSidebarNav.vue.js +1 -1
- package/dist/components/LpStat.vue.js +1 -1
- package/dist/components/LpStepper.vue.js +1 -1
- package/dist/components/LpSwitch.vue.js +1 -1
- package/dist/components/LpTable.vue.d.ts +84 -2
- package/dist/components/LpTable.vue.js +481 -107
- package/dist/components/LpTableFilter.vue.d.ts +31 -0
- package/dist/components/LpTableFilter.vue.js +4 -0
- package/dist/components/LpTabs.vue.js +1 -1
- package/dist/components/LpTagsInput.vue.d.ts +77 -0
- package/dist/components/LpTagsInput.vue.js +4 -0
- package/dist/components/LpTextarea.vue.js +1 -1
- package/dist/components/LpThemeProvider.vue.js +1 -1
- package/dist/components/LpThemeSwitcher.vue.d.ts +2 -2
- package/dist/components/LpThemeSwitcher.vue.js +1 -1
- package/dist/components/LpTimeField.vue.js +1 -1
- package/dist/components/LpToaster.vue.js +1 -1
- package/dist/components/LpTooltip.vue.js +1 -1
- package/dist/components/LpTopologyCanvas.vue.js +1 -1
- package/dist/components/LpUptimeBar.vue.js +1 -1
- package/dist/components/chart.js +3 -2
- package/dist/components/commandSearch.js +3 -0
- package/dist/components/dateRange.d.ts +43 -0
- package/dist/components/dateRange.js +76 -0
- package/dist/components/exportData.d.ts +58 -0
- package/dist/components/exportData.js +165 -0
- package/dist/components/logSearch.d.ts +18 -0
- package/dist/components/logSearch.js +36 -0
- package/dist/components/phone.d.ts +41 -0
- package/dist/components/phone.js +80 -0
- package/dist/components/tableFilter.d.ts +36 -0
- package/dist/components/tableFilter.js +84 -0
- package/dist/components/tags.d.ts +20 -0
- package/dist/components/tags.js +37 -0
- package/dist/composables/useField.d.ts +4 -0
- package/dist/composables/useFieldNotice.d.ts +17 -0
- package/dist/composables/useFieldNotice.js +28 -0
- package/dist/composables/useForm.d.ts +53 -0
- package/dist/composables/useForm.js +207 -0
- package/dist/composables/useHotkeys.d.ts +65 -5
- package/dist/composables/useHotkeys.js +170 -9
- package/dist/composables/useInputMask.d.ts +59 -0
- package/dist/composables/useInputMask.js +170 -0
- package/dist/composables/usePaintSelect.d.ts +22 -0
- package/dist/composables/usePaintSelect.js +169 -0
- package/dist/composables/useShift.js +7 -2
- package/dist/icons-all.d.ts +1 -0
- package/dist/icons-all.js +3 -0
- package/dist/icons.d.ts +14 -1
- package/dist/index.d.ts +29 -3
- package/dist/index.js +195 -138
- package/dist/kit-icons.d.ts +2 -0
- package/dist/theme/backdrop.d.ts +12 -0
- package/dist/theme/presets.d.ts +0 -2
- package/package.json +13 -4
- package/src/component-names.ts +4 -0
- package/src/components/ContextMenuItems.vue +1 -1
- package/src/components/LayoutNode.vue +11 -2
- package/src/components/LpActionBar.vue +1 -1
- package/src/components/LpAutocomplete.vue +1 -0
- package/src/components/LpAvatar.vue +2 -2
- package/src/components/LpButton.vue +1 -1
- package/src/components/LpChart.vue +80 -1
- package/src/components/LpColorPicker.vue +34 -1
- package/src/components/LpCommandPalette.vue +81 -7
- package/src/components/LpContextMenu.vue +1 -1
- package/src/components/LpDatePicker.vue +8 -3
- package/src/components/LpDateRangePicker.vue +224 -0
- package/src/components/LpDropdownMenu.vue +1 -0
- package/src/components/LpFieldNotice.vue +65 -0
- package/src/components/LpFormField.vue +33 -4
- package/src/components/LpIcon.vue +22 -4
- package/src/components/LpInput.vue +46 -6
- package/src/components/LpLogViewer.vue +225 -22
- package/src/components/LpModal.vue +1 -1
- package/src/components/LpNotificationBell.vue +15 -7
- package/src/components/LpPhoneInput.vue +179 -20
- package/src/components/LpPie.vue +8 -5
- package/src/components/LpPopover.vue +1 -0
- package/src/components/LpRangeCalendar.vue +365 -0
- package/src/components/LpRollingText.vue +3 -0
- package/src/components/LpScrollArea.vue +22 -2
- package/src/components/LpSelect.vue +0 -0
- package/src/components/LpShortcutsDialog.vue +77 -8
- package/src/components/LpStepper.vue +23 -10
- package/src/components/LpSwitch.vue +1 -1
- package/src/components/LpTable.vue +584 -65
- package/src/components/LpTableFilter.vue +175 -0
- package/src/components/LpTagsInput.vue +364 -0
- package/src/components/LpThemeSwitcher.vue +19 -23
- package/src/components/LpToaster.vue +49 -1
- package/src/components/LpTooltip.vue +9 -2
- package/src/components/LpTopologyCanvas.vue +7 -1
- package/src/components/chart.ts +5 -3
- package/src/components/commandSearch.ts +6 -0
- package/src/components/dateRange.ts +134 -0
- package/src/components/exportData.ts +228 -0
- package/src/components/logSearch.ts +46 -0
- package/src/components/phone.ts +140 -0
- package/src/components/tableFilter.ts +122 -0
- package/src/components/tags.ts +62 -0
- package/src/composables/useField.ts +4 -0
- package/src/composables/useFieldNotice.ts +59 -0
- package/src/composables/useForm.ts +314 -0
- package/src/composables/useHotkeys.ts +269 -13
- package/src/composables/useInputMask.ts +254 -0
- package/src/composables/usePaintSelect.ts +243 -0
- package/src/composables/useShift.ts +13 -2
- package/src/iconSubset.d.mts +10 -0
- package/src/iconSubset.mjs +51 -0
- package/src/icons-all.ts +10 -0
- package/src/icons.ts +59 -8
- package/src/index.ts +37 -3
- package/src/kit-icons.ts +5 -0
- package/src/nuxt.ts +30 -2
- package/src/runtime/theme.plugin.ts +2 -2
- package/src/theme/backdrop.ts +69 -0
- package/src/theme/presets.ts +6 -64
- package/src/tokens/tokens.css +46 -0
|
@@ -13,6 +13,45 @@ function detectBackdropFilter(root = document.documentElement) {
|
|
|
13
13
|
root.toggleAttribute(NO_BACKDROP_ATTR, !usable);
|
|
14
14
|
return usable;
|
|
15
15
|
}
|
|
16
|
+
const GLASS_BACKDROP_ATTR = "data-lp-glass-backdrop";
|
|
17
|
+
let tracking = 0;
|
|
18
|
+
let observer;
|
|
19
|
+
function trackPanels() {
|
|
20
|
+
const panels = document.querySelectorAll(".lp-glass-overlay");
|
|
21
|
+
for (const panel of panels) {
|
|
22
|
+
const rect = panel.getBoundingClientRect();
|
|
23
|
+
const x = `${Math.round(rect.left)}px`;
|
|
24
|
+
const y = `${Math.round(rect.top)}px`;
|
|
25
|
+
if (panel.style.getPropertyValue("--lp-gx") !== x) panel.style.setProperty("--lp-gx", x);
|
|
26
|
+
if (panel.style.getPropertyValue("--lp-gy") !== y) panel.style.setProperty("--lp-gy", y);
|
|
27
|
+
}
|
|
28
|
+
tracking = panels.length ? requestAnimationFrame(trackPanels) : 0;
|
|
29
|
+
}
|
|
30
|
+
function startTracking() {
|
|
31
|
+
if (!tracking && document.querySelector(".lp-glass-overlay")) tracking = requestAnimationFrame(trackPanels);
|
|
32
|
+
}
|
|
33
|
+
function setGlassBackdrop(background, options = {}) {
|
|
34
|
+
if (typeof document === "undefined") return;
|
|
35
|
+
const root = options.root ?? document.documentElement;
|
|
36
|
+
if (!background) {
|
|
37
|
+
root.removeAttribute(GLASS_BACKDROP_ATTR);
|
|
38
|
+
root.style.removeProperty("--lp-glass-backdrop");
|
|
39
|
+
root.style.removeProperty("--lp-glass-backdrop-filter");
|
|
40
|
+
observer?.disconnect();
|
|
41
|
+
observer = void 0;
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
root.setAttribute(GLASS_BACKDROP_ATTR, "");
|
|
45
|
+
root.style.setProperty("--lp-glass-backdrop", background);
|
|
46
|
+
if (options.filter) root.style.setProperty("--lp-glass-backdrop-filter", options.filter);
|
|
47
|
+
else root.style.removeProperty("--lp-glass-backdrop-filter");
|
|
48
|
+
if (!root.hasAttribute(NO_BACKDROP_ATTR) || typeof MutationObserver === "undefined") return;
|
|
49
|
+
if (!observer) {
|
|
50
|
+
observer = new MutationObserver(startTracking);
|
|
51
|
+
observer.observe(document.body, { childList: true, subtree: true });
|
|
52
|
+
}
|
|
53
|
+
startTracking();
|
|
54
|
+
}
|
|
16
55
|
const sharedShape = { radiusControl: 8, radiusCard: 14, radiusPill: 9999 };
|
|
17
56
|
const sharedDensity = { spacingUnit: 4, controlSm: 32, controlMd: 38, controlLg: 44 };
|
|
18
57
|
const interFont = {
|
|
@@ -20,7 +59,7 @@ const interFont = {
|
|
|
20
59
|
mono: '"JetBrains Mono", "SF Mono", ui-monospace, monospace'
|
|
21
60
|
};
|
|
22
61
|
const dark = {
|
|
23
|
-
name: "
|
|
62
|
+
name: "Dark",
|
|
24
63
|
mode: "dark",
|
|
25
64
|
colors: {
|
|
26
65
|
surface: "#080b0d",
|
|
@@ -117,49 +156,6 @@ const lime = {
|
|
|
117
156
|
mono: '"IBM Plex Mono", "JetBrains Mono", ui-monospace, monospace'
|
|
118
157
|
}
|
|
119
158
|
};
|
|
120
|
-
const glassSurface = {
|
|
121
|
-
borderWidth: "1px",
|
|
122
|
-
panelBlur: "10px",
|
|
123
|
-
panelSaturate: "120%",
|
|
124
|
-
panelOverlay: "linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.01))",
|
|
125
|
-
panelShadow: "0 20px 60px rgba(0, 0, 0, 0.35)",
|
|
126
|
-
panelInset: "inset 0 1px 0 rgba(255, 255, 255, 0.08)"
|
|
127
|
-
};
|
|
128
|
-
const leavepulse = {
|
|
129
|
-
name: "Dark",
|
|
130
|
-
mode: "dark",
|
|
131
|
-
colors: {
|
|
132
|
-
surface: "#020618",
|
|
133
|
-
surfaceRaised: "#0b1222",
|
|
134
|
-
surfaceSoft: "rgba(11, 18, 34, 0.7)",
|
|
135
|
-
ink: "#f3f6ff",
|
|
136
|
-
inkInverse: "#0b1222",
|
|
137
|
-
muted: "#94a3bf",
|
|
138
|
-
mutedStrong: "#cad5e2",
|
|
139
|
-
brand: "#00bcff",
|
|
140
|
-
brandHover: "#19c3ff",
|
|
141
|
-
brandSoft: "rgba(0, 188, 255, 0.2)",
|
|
142
|
-
action: "#44c2ad",
|
|
143
|
-
actionHover: "#56d3be",
|
|
144
|
-
actionSoft: "rgba(68, 194, 173, 0.14)",
|
|
145
|
-
accent: "#d36a2c",
|
|
146
|
-
accentHover: "#da824e",
|
|
147
|
-
accentSoft: "rgba(211, 106, 44, 0.14)",
|
|
148
|
-
danger: "#f87171",
|
|
149
|
-
dangerHover: "#fca5a5",
|
|
150
|
-
dangerSoft: "rgba(248, 113, 113, 0.14)",
|
|
151
|
-
line: "#1c2740",
|
|
152
|
-
lineStrong: "rgba(255, 255, 255, 0.15)",
|
|
153
|
-
ring: "rgba(0, 188, 255, 0.35)"
|
|
154
|
-
},
|
|
155
|
-
shape: { ...sharedShape, radiusControl: 12 },
|
|
156
|
-
density: { ...sharedDensity },
|
|
157
|
-
font: {
|
|
158
|
-
sans: '"Inter", "IBM Plex Sans", "Segoe UI", sans-serif',
|
|
159
|
-
mono: '"JetBrains Mono", "SF Mono", ui-monospace, monospace'
|
|
160
|
-
},
|
|
161
|
-
surface: glassSurface
|
|
162
|
-
};
|
|
163
159
|
const rose = {
|
|
164
160
|
name: "Rose",
|
|
165
161
|
mode: "dark",
|
|
@@ -284,7 +280,7 @@ const nord = {
|
|
|
284
280
|
density: { ...sharedDensity },
|
|
285
281
|
font: { ...interFont }
|
|
286
282
|
};
|
|
287
|
-
const presets = { dark, light, lime,
|
|
283
|
+
const presets = { dark, light, lime, rose, amber, violet, nord };
|
|
288
284
|
const COLOR_VARS = {
|
|
289
285
|
surface: "--color-surface",
|
|
290
286
|
surfaceRaised: "--color-surface-raised",
|
|
@@ -601,6 +597,7 @@ function useTheme() {
|
|
|
601
597
|
}
|
|
602
598
|
export {
|
|
603
599
|
DEFAULT_SURFACE as D,
|
|
600
|
+
GLASS_BACKDROP_ATTR as G,
|
|
604
601
|
NO_BACKDROP_ATTR as N,
|
|
605
602
|
THEME_COOKIE as T,
|
|
606
603
|
parseTheme as a,
|
|
@@ -612,12 +609,12 @@ export {
|
|
|
612
609
|
dark as g,
|
|
613
610
|
detectBackdropFilter as h,
|
|
614
611
|
isBrokenBackdropEngine as i,
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
612
|
+
lime as j,
|
|
613
|
+
normalizeTheme as k,
|
|
614
|
+
light as l,
|
|
615
|
+
prefersDarkScheme as m,
|
|
619
616
|
nord as n,
|
|
620
|
-
|
|
617
|
+
setGlassBackdrop as o,
|
|
621
618
|
presets as p,
|
|
622
619
|
themeFromCookie as q,
|
|
623
620
|
rose as r,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const COMPONENT_NAMES: readonly ["LayoutCanvas", "LpActionBar", "LpAddressInput", "LpAlert", "LpAppShell", "LpAutocomplete", "LpAvatar", "LpBadge", "LpBreadcrumbs", "LpButton", "LpCalendar", "LpCard", "LpChart", "LpCheckbox", "LpCodeBlock", "LpColorPicker", "LpCommandPalette", "LpConfirmDialog", "LpConfirmHost", "LpContextMenu", "LpDatePicker", "LpDisclosure", "LpDivider", "LpDrawer", "LpDropdownMenu", "LpDropzone", "LpEmptyState", "LpFileTree", "LpFormField", "LpIcon", "LpImageEditor", "LpInfraNode", "LpInput", "LpLightbox", "LpLink", "LpLogViewer", "LpMapPicker", "LpMediaGallery", "LpModal", "LpModalNav", "LpNotificationBell", "LpNumberField", "LpNumberFlow", "LpOtpInput", "LpPagination", "LpPasswordInput", "LpPhoneInput", "LpPie", "LpPopover", "LpProgress", "LpRadio", "LpRadioGroup", "LpRollingText", "LpScrollArea", "LpSection", "LpSegmented", "LpSelect", "LpServiceNode", "LpShift", "LpShortcutsDialog", "LpSidebar", "LpSkeleton", "LpSlider", "LpSparkline", "LpStat", "LpStepper", "LpSwitch", "LpTable", "LpTableOfContents", "LpTabs", "LpTextarea", "LpThemeProvider", "LpThemeSwitcher", "LpTilt", "LpTimeField", "LpToaster", "LpTooltip", "LpTooltipProvider", "LpTopologyCanvas", "LpUptimeBar"];
|
|
1
|
+
export declare const COMPONENT_NAMES: readonly ["LayoutCanvas", "LpActionBar", "LpAddressInput", "LpAlert", "LpAppShell", "LpAutocomplete", "LpAvatar", "LpBadge", "LpBreadcrumbs", "LpButton", "LpCalendar", "LpCard", "LpChart", "LpCheckbox", "LpCodeBlock", "LpColorPicker", "LpCommandPalette", "LpConfirmDialog", "LpConfirmHost", "LpContextMenu", "LpDatePicker", "LpDateRangePicker", "LpDisclosure", "LpDivider", "LpDrawer", "LpDropdownMenu", "LpDropzone", "LpEmptyState", "LpFieldNotice", "LpFileTree", "LpFormField", "LpIcon", "LpImageEditor", "LpInfraNode", "LpInput", "LpLightbox", "LpLink", "LpLogViewer", "LpMapPicker", "LpMediaGallery", "LpModal", "LpModalNav", "LpNotificationBell", "LpNumberField", "LpNumberFlow", "LpOtpInput", "LpPagination", "LpPasswordInput", "LpPhoneInput", "LpPie", "LpPopover", "LpProgress", "LpRadio", "LpRadioGroup", "LpRangeCalendar", "LpRollingText", "LpScrollArea", "LpSection", "LpSegmented", "LpSelect", "LpServiceNode", "LpShift", "LpShortcutsDialog", "LpSidebar", "LpSkeleton", "LpSlider", "LpSparkline", "LpStat", "LpStepper", "LpSwitch", "LpTable", "LpTableOfContents", "LpTabs", "LpTagsInput", "LpTextarea", "LpThemeProvider", "LpThemeSwitcher", "LpTilt", "LpTimeField", "LpToaster", "LpTooltip", "LpTooltipProvider", "LpTopologyCanvas", "LpUptimeBar"];
|
|
@@ -3,7 +3,7 @@ import { type LinkTarget } from "./link";
|
|
|
3
3
|
declare const _default: typeof __VLS_export;
|
|
4
4
|
export default _default;
|
|
5
5
|
declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
|
|
6
|
-
variant?: "ghost" | "action" | "muted" | "outline" | "
|
|
6
|
+
variant?: "ghost" | "action" | "muted" | "outline" | "danger" | "solid" | "light" | "soft" | undefined;
|
|
7
7
|
size?: "md" | "sm" | "lg" | "xs" | undefined;
|
|
8
8
|
block?: boolean;
|
|
9
9
|
square?: boolean;
|
|
@@ -21,7 +21,7 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
|
|
|
21
21
|
type?: "button" | "submit" | "reset";
|
|
22
22
|
disabled?: boolean;
|
|
23
23
|
}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{
|
|
24
|
-
variant?: "ghost" | "action" | "muted" | "outline" | "
|
|
24
|
+
variant?: "ghost" | "action" | "muted" | "outline" | "danger" | "solid" | "light" | "soft" | undefined;
|
|
25
25
|
size?: "md" | "sm" | "lg" | "xs" | undefined;
|
|
26
26
|
block?: boolean;
|
|
27
27
|
square?: boolean;
|
|
@@ -1,11 +1,20 @@
|
|
|
1
1
|
import { type ChartMarker, type ChartSeries, type ChartThreshold } from "./chart";
|
|
2
2
|
import { type ContextMenuItemDef } from "./LpContextMenu.vue";
|
|
3
|
+
import { type CsvOptions } from "./exportData";
|
|
3
4
|
export interface ChartText {
|
|
4
5
|
[key: string]: string;
|
|
5
6
|
empty: string;
|
|
6
7
|
rightAxis: string;
|
|
7
8
|
/** Prefix of the keyboard readout, before the point's label. */
|
|
8
9
|
point: string;
|
|
10
|
+
/** Header of the label column in a CSV export. */
|
|
11
|
+
xColumn: string;
|
|
12
|
+
}
|
|
13
|
+
export interface ChartExportOptions {
|
|
14
|
+
/** File name without extension. Defaults to the title. */
|
|
15
|
+
filename?: string;
|
|
16
|
+
/** Return the data without offering a download. */
|
|
17
|
+
download?: boolean;
|
|
9
18
|
}
|
|
10
19
|
/** What was under the pointer when a point was clicked or right-clicked. */
|
|
11
20
|
export interface ChartPointEvent {
|
|
@@ -74,7 +83,13 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
|
|
|
74
83
|
* caller supplies the items.
|
|
75
84
|
*/
|
|
76
85
|
menuItems?: (point: ChartPointEvent) => ContextMenuItemDef[];
|
|
77
|
-
}, {
|
|
86
|
+
}, {
|
|
87
|
+
exportCsv: (options?: ChartExportOptions & CsvOptions) => string;
|
|
88
|
+
exportPng: (options?: ChartExportOptions & {
|
|
89
|
+
scale?: number;
|
|
90
|
+
background?: string;
|
|
91
|
+
}) => Promise<Blob | null>;
|
|
92
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
78
93
|
pointClick: (payload: ChartPointEvent) => any;
|
|
79
94
|
pointContextMenu: (payload: ChartPointEvent) => any;
|
|
80
95
|
}, string, import("vue").PublicProps, Readonly<{
|
|
@@ -5,10 +5,11 @@ import { prefersReducedMotion, easeTravel } from "../composables/easing.js";
|
|
|
5
5
|
import { usePillTransition } from "../composables/usePillTransition.js";
|
|
6
6
|
import { useReveal } from "../composables/useReveal.js";
|
|
7
7
|
import { normalise, pointCount, resolveLabels, extent, axisTicks, plotHeight, plotWidth, xAt, yAt, areaPath, linePath, barPath, markerIndex, chartSummary, niceScale, nearestIndex, formatTick } from "./chart.js";
|
|
8
|
-
import { _ as _sfc_main$1 } from "../chunks/LpContextMenu-
|
|
9
|
-
import { _ as _sfc_main$2 } from "../chunks/LpIcon-
|
|
8
|
+
import { _ as _sfc_main$1 } from "../chunks/LpContextMenu-BqkAYa9X.js";
|
|
9
|
+
import { _ as _sfc_main$2 } from "../chunks/LpIcon-DYtaid0K.js";
|
|
10
10
|
import { _ as _sfc_main$3 } from "../chunks/LpShift-DXNsauQZ.js";
|
|
11
11
|
import { useMergedAttrs } from "../composables/useMergedClass.js";
|
|
12
|
+
import { toCsv, downloadFile, fileStem, svgToPng, backgroundOf, resolveCssColor } from "./exportData.js";
|
|
12
13
|
import { _ as _export_sfc } from "../chunks/_plugin-vue_export-helper-1tPrXgE0.js";
|
|
13
14
|
import '../assets/LpChart-CzgCGaAA.css';const _hoisted_1 = {
|
|
14
15
|
key: 0,
|
|
@@ -111,11 +112,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
111
112
|
menuItems: {}
|
|
112
113
|
},
|
|
113
114
|
emits: ["pointClick", "pointContextMenu"],
|
|
114
|
-
setup(__props, { emit: __emit }) {
|
|
115
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
115
116
|
const props = __props;
|
|
116
117
|
const strings = useLabels(
|
|
117
118
|
"chart",
|
|
118
|
-
{ empty: "No data", rightAxis: "Measured on the right axis", point: "Point" },
|
|
119
|
+
{ empty: "No data", rightAxis: "Measured on the right axis", point: "Point", xColumn: "Label" },
|
|
119
120
|
() => props.text
|
|
120
121
|
);
|
|
121
122
|
const emit = __emit;
|
|
@@ -658,6 +659,61 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
658
659
|
const readout = computed(
|
|
659
660
|
() => keyboard.value && active.value >= 0 ? `${labels.value[active.value] ?? `${strings.value.point} ${active.value + 1}`}: ${tooltipRows.value.map((r) => `${r.name} ${r.text}`).join(", ")}` : ""
|
|
660
661
|
);
|
|
662
|
+
const svgEl = ref(null);
|
|
663
|
+
function exportCsv(options = {}) {
|
|
664
|
+
const rows = labels.value.map((label, i) => ({ label, i }));
|
|
665
|
+
const csv = toCsv(rows, [
|
|
666
|
+
{ key: "label", label: strings.value.xColumn },
|
|
667
|
+
...allSeries.value.map((s) => ({ key: s.id, label: s.name, value: (r) => s.values[r.i] }))
|
|
668
|
+
], options);
|
|
669
|
+
if (options.download !== false) {
|
|
670
|
+
downloadFile(`${fileStem(options.filename ?? props.title, "chart")}.csv`, csv, "text/csv;charset=utf-8");
|
|
671
|
+
}
|
|
672
|
+
return csv;
|
|
673
|
+
}
|
|
674
|
+
async function exportPng(options = {}) {
|
|
675
|
+
const svg = svgEl.value;
|
|
676
|
+
if (!svg || typeof document === "undefined") return null;
|
|
677
|
+
const style = getComputedStyle(root.value ?? svg);
|
|
678
|
+
const font = style.fontFamily;
|
|
679
|
+
const ink = style.getPropertyValue("--color-ink").trim() || style.color;
|
|
680
|
+
const muted = style.getPropertyValue("--color-muted-strong").trim() || style.color;
|
|
681
|
+
const legend = props.showLegend && allSeries.value.length > 1 ? visible.value : [];
|
|
682
|
+
const blob = await svgToPng(svg, {
|
|
683
|
+
scale: options.scale,
|
|
684
|
+
padding: 16,
|
|
685
|
+
background: options.background ?? backgroundOf(root.value),
|
|
686
|
+
header: (ctx) => {
|
|
687
|
+
let y = 0;
|
|
688
|
+
if (props.title) {
|
|
689
|
+
ctx.font = `500 14px ${font}`;
|
|
690
|
+
ctx.fillStyle = ink;
|
|
691
|
+
ctx.textBaseline = "top";
|
|
692
|
+
ctx.fillText(props.title, 0, y);
|
|
693
|
+
y += 22;
|
|
694
|
+
}
|
|
695
|
+
if (legend.length) {
|
|
696
|
+
ctx.font = `12px ${font}`;
|
|
697
|
+
ctx.textBaseline = "middle";
|
|
698
|
+
let x = 0;
|
|
699
|
+
for (const s of legend) {
|
|
700
|
+
ctx.fillStyle = resolveCssColor(s.color, root.value ?? svg);
|
|
701
|
+
ctx.beginPath();
|
|
702
|
+
ctx.arc(x + 4, y + 8, 4, 0, Math.PI * 2);
|
|
703
|
+
ctx.fill();
|
|
704
|
+
ctx.fillStyle = muted;
|
|
705
|
+
ctx.fillText(s.name, x + 14, y + 8);
|
|
706
|
+
x += 14 + ctx.measureText(s.name).width + 16;
|
|
707
|
+
}
|
|
708
|
+
y += 24;
|
|
709
|
+
}
|
|
710
|
+
return y ? y + 8 : 0;
|
|
711
|
+
}
|
|
712
|
+
});
|
|
713
|
+
if (options.download !== false) downloadFile(`${fileStem(options.filename ?? props.title, "chart")}.png`, blob);
|
|
714
|
+
return blob;
|
|
715
|
+
}
|
|
716
|
+
__expose({ exportCsv, exportPng });
|
|
661
717
|
const { class: rootClass, attrs: rest } = useMergedAttrs(
|
|
662
718
|
"flex w-full flex-col gap-3"
|
|
663
719
|
);
|
|
@@ -719,6 +775,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
719
775
|
createElementVNode("span", _hoisted_11, toDisplayString(__props.emptyLabel ?? unref(strings).empty), 1)
|
|
720
776
|
])) : width.value > 0 ? (openBlock(), createElementBlock("svg", {
|
|
721
777
|
key: 1,
|
|
778
|
+
ref_key: "svgEl",
|
|
779
|
+
ref: svgEl,
|
|
722
780
|
width: width.value,
|
|
723
781
|
height: __props.height,
|
|
724
782
|
class: "overflow-visible touch-none select-none",
|
|
@@ -1038,7 +1096,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
1038
1096
|
};
|
|
1039
1097
|
}
|
|
1040
1098
|
});
|
|
1041
|
-
const LpChart = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
1099
|
+
const LpChart = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-1c25e280"]]);
|
|
1042
1100
|
export {
|
|
1043
1101
|
LpChart as default
|
|
1044
1102
|
};
|
|
@@ -81,7 +81,7 @@ type __VLS_Props = {
|
|
|
81
81
|
*/
|
|
82
82
|
copyToast?: string | false;
|
|
83
83
|
};
|
|
84
|
-
declare var
|
|
84
|
+
declare var __VLS_61: {
|
|
85
85
|
color: string;
|
|
86
86
|
hsv: {
|
|
87
87
|
h: number;
|
|
@@ -91,7 +91,7 @@ declare var __VLS_56: {
|
|
|
91
91
|
};
|
|
92
92
|
};
|
|
93
93
|
type __VLS_Slots = {} & {
|
|
94
|
-
default?: (props: typeof
|
|
94
|
+
default?: (props: typeof __VLS_61) => any;
|
|
95
95
|
};
|
|
96
96
|
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {
|
|
97
97
|
open: import("vue").Ref<boolean, boolean>;
|
|
@@ -129,6 +129,12 @@ type __VLS_Props = {
|
|
|
129
129
|
* so a stored history never resurrects a command that has gone away.
|
|
130
130
|
*/
|
|
131
131
|
recent?: string[];
|
|
132
|
+
/**
|
|
133
|
+
* Let the palette keep the history itself, in localStorage under this key:
|
|
134
|
+
* every top-level command run is remembered, newest first. Ignored while
|
|
135
|
+
* `recent` is bound, which stays the way to store it somewhere else.
|
|
136
|
+
*/
|
|
137
|
+
recentKey?: string;
|
|
132
138
|
/** How many recent commands to surface. */
|
|
133
139
|
recentLimit?: number;
|
|
134
140
|
/** Headings the palette adds itself. */
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { defineComponent, ref, useId, computed, shallowRef,
|
|
1
|
+
import { defineComponent, ref, useId, computed, shallowRef, watch, useSlots, nextTick, onBeforeUnmount, openBlock, createBlock, unref, withCtx, createVNode, normalizeStyle, normalizeClass, withModifiers, createTextVNode, toDisplayString, createElementVNode, createElementBlock, Fragment, renderList, createCommentVNode, withDirectives, withKeys, vModelText, resolveDynamicComponent, Transition, renderSlot } from "vue";
|
|
2
2
|
import { DialogRoot, DialogPortal, DialogOverlay, DialogContent, DialogTitle, DialogDescription } from "reka-ui";
|
|
3
|
-
import { _ as _sfc_main$1 } from "../chunks/LpIcon-
|
|
4
|
-
import { _ as _sfc_main$2 } from "../chunks/LpScrollArea-
|
|
3
|
+
import { _ as _sfc_main$1 } from "../chunks/LpIcon-DYtaid0K.js";
|
|
4
|
+
import { _ as _sfc_main$2 } from "../chunks/LpScrollArea-Bry1fdOM.js";
|
|
5
5
|
import { useAsyncTask } from "../composables/useAsyncTask.js";
|
|
6
6
|
import { useGlass } from "../composables/useGlass.js";
|
|
7
7
|
import { useClipboard } from "../composables/useClipboard.js";
|
|
@@ -10,7 +10,7 @@ import { useModalLayer } from "./modalDepth.js";
|
|
|
10
10
|
import { useLabels } from "../composables/useLpConfig.js";
|
|
11
11
|
import { parseCommandQuery, rankCommandItems } from "./commandSearch.js";
|
|
12
12
|
import { _ as _export_sfc } from "../chunks/_plugin-vue_export-helper-1tPrXgE0.js";
|
|
13
|
-
import '../assets/LpCommandPalette-
|
|
13
|
+
import '../assets/LpCommandPalette-nGNnzXqQ.css';const _hoisted_1 = { class: "flex shrink-0 items-center gap-2.5 border-b border-line px-4" };
|
|
14
14
|
const _hoisted_2 = ["title", "onClick"];
|
|
15
15
|
const _hoisted_3 = ["aria-activedescendant", "placeholder", "onKeydown"];
|
|
16
16
|
const _hoisted_4 = { class: "shrink-0 rounded border border-line px-1.5 py-0.5 text-[10px] text-muted" };
|
|
@@ -56,7 +56,7 @@ const _hoisted_19 = {
|
|
|
56
56
|
key: 0,
|
|
57
57
|
class: "rounded-xs bg-brand/25 text-ink"
|
|
58
58
|
};
|
|
59
|
-
const _hoisted_20 = { class: "flex shrink-0 items-center gap-4 border-t border-line px-4 py-2.5 text-[11px] text-muted" };
|
|
59
|
+
const _hoisted_20 = { class: "flex shrink-0 items-center gap-4 border-t border-line px-4 py-2.5 text-[11px] text-muted [@media(hover:none)_and_(pointer:coarse)]:hidden" };
|
|
60
60
|
const _hoisted_21 = { class: "flex items-center gap-1" };
|
|
61
61
|
const _hoisted_22 = { class: "flex items-center gap-1" };
|
|
62
62
|
const _hoisted_23 = {
|
|
@@ -69,6 +69,7 @@ const _hoisted_24 = {
|
|
|
69
69
|
};
|
|
70
70
|
const _hoisted_25 = { class: "ml-auto flex items-center gap-1" };
|
|
71
71
|
const _hoisted_26 = { class: "rounded border border-line px-1 text-[10px]" };
|
|
72
|
+
const RECENT_KEEP = 20;
|
|
72
73
|
const STAGGER_MS = 45;
|
|
73
74
|
const STAGGER_MAX = 10;
|
|
74
75
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
@@ -83,6 +84,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
83
84
|
debounce: { default: 250 },
|
|
84
85
|
minChars: { default: 1 },
|
|
85
86
|
recent: {},
|
|
87
|
+
recentKey: {},
|
|
86
88
|
recentLimit: { default: 5 },
|
|
87
89
|
recentLabel: { default: "Recent" },
|
|
88
90
|
resultsLabel: { default: "Results" },
|
|
@@ -165,6 +167,23 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
165
167
|
event.stopPropagation();
|
|
166
168
|
enter({ id: `${c.id}:actions`, label: c.label, icon: c.icon, children: actions });
|
|
167
169
|
}
|
|
170
|
+
watch(
|
|
171
|
+
() => props.commands,
|
|
172
|
+
(commands) => {
|
|
173
|
+
if (!trail.value.length) return;
|
|
174
|
+
let level = commands;
|
|
175
|
+
const next = [];
|
|
176
|
+
for (const step of trail.value) {
|
|
177
|
+
const fresh = level.find((c) => c.id === step.id);
|
|
178
|
+
if (!fresh) return;
|
|
179
|
+
next.push(fresh);
|
|
180
|
+
level = Array.isArray(fresh.children) ? fresh.children : [];
|
|
181
|
+
}
|
|
182
|
+
trail.value = next;
|
|
183
|
+
const last = next[next.length - 1];
|
|
184
|
+
if (last && Array.isArray(last.children)) modeItems.value = last.children;
|
|
185
|
+
}
|
|
186
|
+
);
|
|
168
187
|
function enter(c) {
|
|
169
188
|
trailState.value = [...trailState.value, { query: query.value, selectedId: selectedId.value }];
|
|
170
189
|
trail.value = [...trail.value, c];
|
|
@@ -241,11 +260,35 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
241
260
|
const seen = new Set(ranked.value.map((c) => c.id));
|
|
242
261
|
return found.value.filter((c) => !seen.has(c.id)).map((c) => c.group ? c : { ...c, group: props.resultsLabel });
|
|
243
262
|
});
|
|
263
|
+
const ownRecent = ref([]);
|
|
264
|
+
watch(
|
|
265
|
+
() => props.recentKey,
|
|
266
|
+
(key) => {
|
|
267
|
+
if (!key || typeof localStorage === "undefined") return;
|
|
268
|
+
try {
|
|
269
|
+
const stored = JSON.parse(localStorage.getItem(key) ?? "[]");
|
|
270
|
+
ownRecent.value = Array.isArray(stored) ? stored.filter((v) => typeof v === "string") : [];
|
|
271
|
+
} catch {
|
|
272
|
+
ownRecent.value = [];
|
|
273
|
+
}
|
|
274
|
+
},
|
|
275
|
+
{ immediate: true }
|
|
276
|
+
);
|
|
277
|
+
function remember(id) {
|
|
278
|
+
const key = props.recentKey;
|
|
279
|
+
if (!key || props.recent) return;
|
|
280
|
+
ownRecent.value = [id, ...ownRecent.value.filter((v) => v !== id)].slice(0, RECENT_KEEP);
|
|
281
|
+
try {
|
|
282
|
+
localStorage.setItem(key, JSON.stringify(ownRecent.value));
|
|
283
|
+
} catch {
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
const recentIds = computed(() => props.recent ?? (props.recentKey ? ownRecent.value : []));
|
|
244
287
|
const recentItems = computed(() => {
|
|
245
|
-
if (mode.value || query.value.trim() || !
|
|
288
|
+
if (mode.value || query.value.trim() || !recentIds.value.length) return [];
|
|
246
289
|
const byId = new Map(props.commands.map((c) => [c.id, c]));
|
|
247
290
|
const out = [];
|
|
248
|
-
for (const id of
|
|
291
|
+
for (const id of recentIds.value) {
|
|
249
292
|
const c = byId.get(id);
|
|
250
293
|
if (c && !c.disabled && !out.includes(c)) out.push(c);
|
|
251
294
|
if (out.length >= props.recentLimit) break;
|
|
@@ -295,6 +338,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
295
338
|
const paragraphs = computed(
|
|
296
339
|
() => (active.value?.preview ?? active.value?.excerpt ?? "").split(/\n{2,}/).map((part) => part.trim()).filter(Boolean)
|
|
297
340
|
);
|
|
341
|
+
const paneDescription = computed(() => {
|
|
342
|
+
const description = active.value?.description?.trim();
|
|
343
|
+
if (!description) return void 0;
|
|
344
|
+
const body = paragraphs.value.join(" ");
|
|
345
|
+
return body.startsWith(description) ? void 0 : description;
|
|
346
|
+
});
|
|
298
347
|
watch(
|
|
299
348
|
() => active.value?.id,
|
|
300
349
|
async () => {
|
|
@@ -435,9 +484,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
435
484
|
return;
|
|
436
485
|
}
|
|
437
486
|
emit("run", c.id, c);
|
|
487
|
+
if (!mode.value) remember(c.id);
|
|
438
488
|
if (c.keepOpen) {
|
|
439
489
|
query.value = "";
|
|
440
|
-
select(0);
|
|
490
|
+
if (mode.value) void nextTick(() => select(Math.max(0, flat.value.findIndex((x) => x.id === c.id))));
|
|
491
|
+
else select(0);
|
|
441
492
|
inputRef.value?.focus();
|
|
442
493
|
return;
|
|
443
494
|
}
|
|
@@ -730,7 +781,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
730
781
|
}, null, 8, ["name"])) : createCommentVNode("", true),
|
|
731
782
|
createElementVNode("h3", _hoisted_17, toDisplayString(active.value.label), 1)
|
|
732
783
|
]),
|
|
733
|
-
|
|
784
|
+
paneDescription.value ? (openBlock(), createElementBlock("p", _hoisted_18, toDisplayString(paneDescription.value), 1)) : createCommentVNode("", true),
|
|
734
785
|
(openBlock(true), createElementBlock(Fragment, null, renderList(paragraphs.value, (para, i) => {
|
|
735
786
|
return openBlock(), createElementBlock("p", {
|
|
736
787
|
key: i,
|
|
@@ -793,7 +844,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
793
844
|
};
|
|
794
845
|
}
|
|
795
846
|
});
|
|
796
|
-
const LpCommandPalette = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
847
|
+
const LpCommandPalette = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-2da506c1"]]);
|
|
797
848
|
export {
|
|
798
849
|
LpCommandPalette as default
|
|
799
850
|
};
|