@leavepulse/ui 0.43.3 → 0.43.4
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/assets/{LpCommandPalette-DH7sPcKP.css → LpCommandPalette-B-0Est4Z.css} +21 -21
- package/dist/components/LpCommandPalette.vue.d.ts +0 -7
- package/dist/components/LpCommandPalette.vue.js +4 -8
- package/dist/components/commandSearch.d.ts +0 -1
- package/dist/components/commandSearch.js +1 -17
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -2
- package/package.json +1 -1
- package/src/components/LpCommandPalette.vue +2 -12
- package/src/components/commandSearch.ts +0 -17
- package/src/index.ts +1 -1
|
@@ -5,81 +5,81 @@
|
|
|
5
5
|
* pane from its right edge as it grows. Animating the columns themselves made
|
|
6
6
|
* every line of the list and the pane re-wrap on every frame.
|
|
7
7
|
*/
|
|
8
|
-
.lp-cmd-dialog[data-v-
|
|
8
|
+
.lp-cmd-dialog[data-v-89a89377] {
|
|
9
9
|
--lp-cmd-list: min(92vw, 40rem);
|
|
10
10
|
--lp-cmd-pane: max(0px, min(26rem, 96vw - var(--lp-cmd-list)));
|
|
11
11
|
width: var(--lp-cmd-list);
|
|
12
12
|
}
|
|
13
|
-
.lp-cmd-split[data-v-
|
|
13
|
+
.lp-cmd-split[data-v-89a89377] {
|
|
14
14
|
transition:
|
|
15
15
|
width 300ms var(--ease-emphasized, ease),
|
|
16
16
|
min-height 300ms var(--ease-emphasized, ease);
|
|
17
17
|
}
|
|
18
18
|
@media (min-width: 768px) {
|
|
19
|
-
.lp-cmd-split .lp-cmd-list[data-v-
|
|
19
|
+
.lp-cmd-split .lp-cmd-list[data-v-89a89377] {
|
|
20
20
|
flex: 0 0 auto;
|
|
21
21
|
/* the dialog's 1px border on each side */
|
|
22
22
|
width: calc(var(--lp-cmd-list) - 2px);
|
|
23
23
|
}
|
|
24
|
-
.lp-cmd-dialog[data-pane="open"][data-v-
|
|
24
|
+
.lp-cmd-dialog[data-pane="open"][data-v-89a89377] {
|
|
25
25
|
width: calc(var(--lp-cmd-list) + var(--lp-cmd-pane));
|
|
26
26
|
min-height: min(76vh, 36rem);
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
|
-
.lp-cmd-pane[data-v-
|
|
29
|
+
.lp-cmd-pane[data-v-89a89377] {
|
|
30
30
|
width: var(--lp-cmd-pane);
|
|
31
31
|
}
|
|
32
32
|
/*
|
|
33
33
|
* The pane rides in from the right edge while the dialog opens up to it, and
|
|
34
34
|
* leaves the same way, for as long as the dialog takes to close over it.
|
|
35
35
|
*/
|
|
36
|
-
.lp-cmd-pane-enter-active[data-v-
|
|
37
|
-
.lp-cmd-pane-leave-active[data-v-
|
|
36
|
+
.lp-cmd-pane-enter-active[data-v-89a89377],
|
|
37
|
+
.lp-cmd-pane-leave-active[data-v-89a89377] {
|
|
38
38
|
transition:
|
|
39
39
|
transform 300ms var(--ease-emphasized, ease),
|
|
40
40
|
opacity 300ms ease;
|
|
41
41
|
}
|
|
42
|
-
.lp-cmd-pane-enter-from[data-v-
|
|
43
|
-
.lp-cmd-pane-leave-to[data-v-
|
|
42
|
+
.lp-cmd-pane-enter-from[data-v-89a89377],
|
|
43
|
+
.lp-cmd-pane-leave-to[data-v-89a89377] {
|
|
44
44
|
opacity: 0;
|
|
45
45
|
transform: translateX(40%);
|
|
46
46
|
}
|
|
47
|
-
.lp-cmd-para[data-v-
|
|
48
|
-
animation: lp-cmd-para-in-
|
|
47
|
+
.lp-cmd-para[data-v-89a89377] {
|
|
48
|
+
animation: lp-cmd-para-in-89a89377 260ms ease-out both;
|
|
49
49
|
}
|
|
50
|
-
@keyframes lp-cmd-para-in-
|
|
50
|
+
@keyframes lp-cmd-para-in-89a89377 {
|
|
51
51
|
from {
|
|
52
52
|
opacity: 0;
|
|
53
53
|
transform: translateY(4px);
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
56
|
@media (prefers-reduced-motion: reduce) {
|
|
57
|
-
.lp-cmd-split[data-v-
|
|
58
|
-
.lp-cmd-pane-enter-active[data-v-
|
|
59
|
-
.lp-cmd-pane-leave-active[data-v-
|
|
57
|
+
.lp-cmd-split[data-v-89a89377],
|
|
58
|
+
.lp-cmd-pane-enter-active[data-v-89a89377],
|
|
59
|
+
.lp-cmd-pane-leave-active[data-v-89a89377] {
|
|
60
60
|
transition: none;
|
|
61
61
|
}
|
|
62
|
-
.lp-cmd-para[data-v-
|
|
62
|
+
.lp-cmd-para[data-v-89a89377] {
|
|
63
63
|
animation: none;
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
|
-
.lp-cmd-excerpt[data-v-
|
|
66
|
+
.lp-cmd-excerpt[data-v-89a89377] {
|
|
67
67
|
display: -webkit-box;
|
|
68
68
|
-webkit-box-orient: vertical;
|
|
69
69
|
overflow: hidden;
|
|
70
70
|
}
|
|
71
71
|
/* Each result eases in; honours reduced motion. */
|
|
72
|
-
.lp-cmd-item[data-v-
|
|
73
|
-
animation: lp-cmd-in-
|
|
72
|
+
.lp-cmd-item[data-v-89a89377] {
|
|
73
|
+
animation: lp-cmd-in-89a89377 140ms ease-out both;
|
|
74
74
|
}
|
|
75
|
-
@keyframes lp-cmd-in-
|
|
75
|
+
@keyframes lp-cmd-in-89a89377 {
|
|
76
76
|
from {
|
|
77
77
|
opacity: 0;
|
|
78
78
|
transform: translateY(3px);
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
81
|
@media (prefers-reduced-motion: reduce) {
|
|
82
|
-
.lp-cmd-item[data-v-
|
|
82
|
+
.lp-cmd-item[data-v-89a89377] {
|
|
83
83
|
animation: none;
|
|
84
84
|
}
|
|
85
85
|
}
|
|
@@ -139,12 +139,6 @@ type __VLS_Props = {
|
|
|
139
139
|
* other group off the screen. 0 shows everything.
|
|
140
140
|
*/
|
|
141
141
|
groupLimit?: number;
|
|
142
|
-
/**
|
|
143
|
-
* When the query matches nothing, retry it as if typed in the other
|
|
144
|
-
* keyboard layout (QWERTY ↔ Cyrillic). Off for an app whose commands are
|
|
145
|
-
* meant to be typed in one layout only.
|
|
146
|
-
*/
|
|
147
|
-
layoutFallback?: boolean;
|
|
148
142
|
/**
|
|
149
143
|
* A pane beside the list showing the highlighted result in full — its
|
|
150
144
|
* `preview` text, or the `preview` slot. For palettes that search
|
|
@@ -193,7 +187,6 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {},
|
|
|
193
187
|
resultsLabel: string;
|
|
194
188
|
excerptLines: number;
|
|
195
189
|
groupLimit: number;
|
|
196
|
-
layoutFallback: boolean;
|
|
197
190
|
previewPane: boolean;
|
|
198
191
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
199
192
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
@@ -7,9 +7,9 @@ import { useGlass } from "../composables/useGlass.js";
|
|
|
7
7
|
import { useClipboard } from "../composables/useClipboard.js";
|
|
8
8
|
import { useHotkeys } from "../composables/useHotkeys.js";
|
|
9
9
|
import { useModalLayer } from "./modalDepth.js";
|
|
10
|
-
import { parseCommandQuery, rankCommandItems
|
|
10
|
+
import { parseCommandQuery, rankCommandItems } from "./commandSearch.js";
|
|
11
11
|
import { _ as _export_sfc } from "../chunks/_plugin-vue_export-helper-1tPrXgE0.js";
|
|
12
|
-
import '../assets/LpCommandPalette-
|
|
12
|
+
import '../assets/LpCommandPalette-B-0Est4Z.css';const _hoisted_1 = { class: "flex shrink-0 items-center gap-2.5 border-b border-line px-4" };
|
|
13
13
|
const _hoisted_2 = ["title", "onClick"];
|
|
14
14
|
const _hoisted_3 = ["aria-activedescendant", "placeholder", "onKeydown"];
|
|
15
15
|
const _hoisted_4 = {
|
|
@@ -86,7 +86,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
86
86
|
labels: {},
|
|
87
87
|
excerptLines: { default: 4 },
|
|
88
88
|
groupLimit: { default: 0 },
|
|
89
|
-
layoutFallback: { type: Boolean, default: true },
|
|
90
89
|
previewPane: { type: Boolean, default: false },
|
|
91
90
|
glass: { type: Boolean, default: void 0 }
|
|
92
91
|
},
|
|
@@ -227,10 +226,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
227
226
|
const filtered = query.value.trim() ? source.value : source.value.filter((c) => !c.hidden);
|
|
228
227
|
if (!terms.include.length && !terms.exclude.length && !terms.groups.length) return { items: filtered, terms: [] };
|
|
229
228
|
const items = rankCommandItems(filtered, terms);
|
|
230
|
-
|
|
231
|
-
const swapped = swapCommandTerms(terms);
|
|
232
|
-
const other = rankCommandItems(filtered, swapped);
|
|
233
|
-
return other.length ? { items: other, terms: swapped.include } : { items, terms: terms.include };
|
|
229
|
+
return { items, terms: terms.include };
|
|
234
230
|
});
|
|
235
231
|
const ranked = computed(() => local.value.items);
|
|
236
232
|
const fetched = computed(() => {
|
|
@@ -783,7 +779,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
783
779
|
};
|
|
784
780
|
}
|
|
785
781
|
});
|
|
786
|
-
const LpCommandPalette = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
782
|
+
const LpCommandPalette = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-89a89377"]]);
|
|
787
783
|
export {
|
|
788
784
|
LpCommandPalette as default
|
|
789
785
|
};
|
|
@@ -10,5 +10,4 @@ export interface CommandSearchTerms {
|
|
|
10
10
|
groups: string[];
|
|
11
11
|
}
|
|
12
12
|
export declare function parseCommandQuery(value: string): CommandSearchTerms;
|
|
13
|
-
export declare function swapCommandTerms(terms: CommandSearchTerms): CommandSearchTerms;
|
|
14
13
|
export declare function rankCommandItems<T extends SearchableCommand>(items: T[], terms: CommandSearchTerms): T[];
|
|
@@ -1,11 +1,4 @@
|
|
|
1
1
|
const QUERY_TOKEN = /(-?)(?:(in):)?(?:"([^"]*)"|(\S+))/giu;
|
|
2
|
-
const LATIN = "qwertyuiop[]asdfghjkl;'zxcvbnm,.`";
|
|
3
|
-
const CYRILLIC = "йцукенгшщзхъфывапролджэячсмитьбюё";
|
|
4
|
-
const SWAP = /* @__PURE__ */ new Map();
|
|
5
|
-
for (let i = 0; i < LATIN.length; i++) {
|
|
6
|
-
SWAP.set(LATIN[i], CYRILLIC[i]);
|
|
7
|
-
SWAP.set(CYRILLIC[i], LATIN[i]);
|
|
8
|
-
}
|
|
9
2
|
function parseCommandQuery(value) {
|
|
10
3
|
const out = { include: [], exclude: [], groups: [] };
|
|
11
4
|
QUERY_TOKEN.lastIndex = 0;
|
|
@@ -18,14 +11,6 @@ function parseCommandQuery(value) {
|
|
|
18
11
|
}
|
|
19
12
|
return out;
|
|
20
13
|
}
|
|
21
|
-
function swapCommandTerms(terms) {
|
|
22
|
-
const swap = (term) => [...term].map((ch) => SWAP.get(ch) ?? ch).join("");
|
|
23
|
-
return {
|
|
24
|
-
include: terms.include.map(swap),
|
|
25
|
-
exclude: terms.exclude.map(swap),
|
|
26
|
-
groups: terms.groups.map(swap)
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
14
|
function matches(command, term) {
|
|
30
15
|
return command.label.toLowerCase().includes(term) || (command.keywords ?? []).some((keyword) => keyword.toLowerCase().includes(term)) || (command.description?.toLowerCase().includes(term) ?? false);
|
|
31
16
|
}
|
|
@@ -61,6 +46,5 @@ function rankCommandItems(items, terms) {
|
|
|
61
46
|
}
|
|
62
47
|
export {
|
|
63
48
|
parseCommandQuery,
|
|
64
|
-
rankCommandItems
|
|
65
|
-
swapCommandTerms
|
|
49
|
+
rankCommandItems
|
|
66
50
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -29,7 +29,7 @@ export { clampHsv, DEFAULT_SWATCHES, formatColor, hsvToHsl, hsvToRgb, isLight, n
|
|
|
29
29
|
export type { ColorFormat, Hsv, Rgb } from "./components/color";
|
|
30
30
|
export { default as LpCommandPalette } from "./components/LpCommandPalette.vue";
|
|
31
31
|
export type { Command, PaletteLabels } from "./components/LpCommandPalette.vue";
|
|
32
|
-
export { parseCommandQuery, rankCommandItems
|
|
32
|
+
export { parseCommandQuery, rankCommandItems } from "./components/commandSearch";
|
|
33
33
|
export type { CommandSearchTerms, SearchableCommand } from "./components/commandSearch";
|
|
34
34
|
export { default as LpConfirmDialog } from "./components/LpConfirmDialog.vue";
|
|
35
35
|
export { default as LpContextMenu } from "./components/LpContextMenu.vue";
|
package/dist/index.js
CHANGED
|
@@ -19,7 +19,7 @@ import { _ as _15 } from "./chunks/LpCodeBlock-Bo0B4TFR.js";
|
|
|
19
19
|
import { _ as _16 } from "./chunks/LpColorPicker-BlXea7LM.js";
|
|
20
20
|
import { DEFAULT_SWATCHES, clampHsv, formatColor, hsvToHsl, hsvToRgb, isLight, normalizeHue, opaqueCss, parseColor, parseHex, rgbToHex, rgbToHsv } from "./components/color.js";
|
|
21
21
|
import { default as default3 } from "./components/LpCommandPalette.vue.js";
|
|
22
|
-
import { parseCommandQuery, rankCommandItems
|
|
22
|
+
import { parseCommandQuery, rankCommandItems } from "./components/commandSearch.js";
|
|
23
23
|
import { _ as _17 } from "./chunks/LpConfirmDialog-Q-bxff8z.js";
|
|
24
24
|
import { _ as _18 } from "./chunks/LpContextMenu-CwW1QXe_.js";
|
|
25
25
|
import { _ as _19 } from "./chunks/LpDatePicker-CwOToxGq.js";
|
|
@@ -295,7 +295,6 @@ export {
|
|
|
295
295
|
sortNodes,
|
|
296
296
|
subtreeIds,
|
|
297
297
|
subtreeSize,
|
|
298
|
-
swapCommandTerms,
|
|
299
298
|
t as themeFromCookie,
|
|
300
299
|
k as themeToCssRule,
|
|
301
300
|
m as themeToCssVars,
|
package/package.json
CHANGED
|
@@ -44,7 +44,7 @@ import { useGlass } from "../composables/useGlass"
|
|
|
44
44
|
import { useClipboard } from "../composables/useClipboard"
|
|
45
45
|
import { useHotkeys } from "../composables/useHotkeys"
|
|
46
46
|
import { useModalLayer } from "./modalDepth"
|
|
47
|
-
import { parseCommandQuery, rankCommandItems
|
|
47
|
+
import { parseCommandQuery, rankCommandItems } from "./commandSearch"
|
|
48
48
|
|
|
49
49
|
export interface Command {
|
|
50
50
|
id: string
|
|
@@ -190,12 +190,6 @@ const props = withDefaults(
|
|
|
190
190
|
* other group off the screen. 0 shows everything.
|
|
191
191
|
*/
|
|
192
192
|
groupLimit?: number
|
|
193
|
-
/**
|
|
194
|
-
* When the query matches nothing, retry it as if typed in the other
|
|
195
|
-
* keyboard layout (QWERTY ↔ Cyrillic). Off for an app whose commands are
|
|
196
|
-
* meant to be typed in one layout only.
|
|
197
|
-
*/
|
|
198
|
-
layoutFallback?: boolean
|
|
199
193
|
/**
|
|
200
194
|
* A pane beside the list showing the highlighted result in full — its
|
|
201
195
|
* `preview` text, or the `preview` slot. For palettes that search
|
|
@@ -229,7 +223,6 @@ const props = withDefaults(
|
|
|
229
223
|
resultsLabel: "Results",
|
|
230
224
|
excerptLines: 4,
|
|
231
225
|
groupLimit: 0,
|
|
232
|
-
layoutFallback: true,
|
|
233
226
|
previewPane: false,
|
|
234
227
|
glass: undefined,
|
|
235
228
|
},
|
|
@@ -469,10 +462,7 @@ const local = computed<{ items: Command[]; terms: string[] }>(() => {
|
|
|
469
462
|
// typed). With a query, hidden commands rank like any other.
|
|
470
463
|
if (!terms.include.length && !terms.exclude.length && !terms.groups.length) return { items: filtered, terms: [] }
|
|
471
464
|
const items = rankCommandItems(filtered, terms)
|
|
472
|
-
|
|
473
|
-
const swapped = swapCommandTerms(terms)
|
|
474
|
-
const other = rankCommandItems(filtered, swapped)
|
|
475
|
-
return other.length ? { items: other, terms: swapped.include } : { items, terms: terms.include }
|
|
465
|
+
return { items, terms: terms.include }
|
|
476
466
|
})
|
|
477
467
|
|
|
478
468
|
const ranked = computed<Command[]>(() => local.value.items)
|
|
@@ -12,14 +12,6 @@ export interface CommandSearchTerms {
|
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
const QUERY_TOKEN = /(-?)(?:(in):)?(?:"([^"]*)"|(\S+))/giu
|
|
15
|
-
const LATIN = "qwertyuiop[]asdfghjkl;'zxcvbnm,.`"
|
|
16
|
-
const CYRILLIC = "\u0439\u0446\u0443\u043A\u0435\u043D\u0433\u0448\u0449\u0437\u0445\u044A\u0444\u044B\u0432\u0430\u043F\u0440\u043E\u043B\u0434\u0436\u044D\u044F\u0447\u0441\u043C\u0438\u0442\u044C\u0431\u044E\u0451"
|
|
17
|
-
const SWAP = new Map<string, string>()
|
|
18
|
-
|
|
19
|
-
for (let i = 0; i < LATIN.length; i++) {
|
|
20
|
-
SWAP.set(LATIN[i]!, CYRILLIC[i]!)
|
|
21
|
-
SWAP.set(CYRILLIC[i]!, LATIN[i]!)
|
|
22
|
-
}
|
|
23
15
|
|
|
24
16
|
export function parseCommandQuery(value: string): CommandSearchTerms {
|
|
25
17
|
const out: CommandSearchTerms = { include: [], exclude: [], groups: [] }
|
|
@@ -34,15 +26,6 @@ export function parseCommandQuery(value: string): CommandSearchTerms {
|
|
|
34
26
|
return out
|
|
35
27
|
}
|
|
36
28
|
|
|
37
|
-
export function swapCommandTerms(terms: CommandSearchTerms): CommandSearchTerms {
|
|
38
|
-
const swap = (term: string) => [...term].map((ch) => SWAP.get(ch) ?? ch).join("")
|
|
39
|
-
return {
|
|
40
|
-
include: terms.include.map(swap),
|
|
41
|
-
exclude: terms.exclude.map(swap),
|
|
42
|
-
groups: terms.groups.map(swap),
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
|
|
46
29
|
function matches(command: SearchableCommand, term: string): boolean {
|
|
47
30
|
return (
|
|
48
31
|
command.label.toLowerCase().includes(term)
|
package/src/index.ts
CHANGED
|
@@ -65,7 +65,7 @@ export {
|
|
|
65
65
|
export type { ColorFormat, Hsv, Rgb } from "./components/color"
|
|
66
66
|
export { default as LpCommandPalette } from "./components/LpCommandPalette.vue"
|
|
67
67
|
export type { Command, PaletteLabels } from "./components/LpCommandPalette.vue"
|
|
68
|
-
export { parseCommandQuery, rankCommandItems
|
|
68
|
+
export { parseCommandQuery, rankCommandItems } from "./components/commandSearch"
|
|
69
69
|
export type { CommandSearchTerms, SearchableCommand } from "./components/commandSearch"
|
|
70
70
|
export { default as LpConfirmDialog } from "./components/LpConfirmDialog.vue"
|
|
71
71
|
export { default as LpContextMenu } from "./components/LpContextMenu.vue"
|