blessing-ui 0.1.0 → 0.3.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/CHANGELOG.md +69 -0
- package/README.md +139 -105
- package/dist/blessing-ui.css +97 -1
- package/dist/components/BlessAnnotator.css +1 -0
- package/dist/components/BlessAnnotator.js +6 -0
- package/dist/components/BlessAnnotator.vue.d.ts +71 -0
- package/dist/components/BlessAnnotator.vue_vue_type_script_setup_true_lang.js +264 -0
- package/dist/components/BlessAttachment.vue.d.ts +4 -1
- package/dist/components/BlessAttachment.vue_vue_type_script_setup_true_lang.js +3 -2
- package/dist/components/BlessCalendar.vue.d.ts +4 -0
- package/dist/components/BlessCalendar.vue_vue_type_script_setup_true_lang.js +65 -60
- package/dist/components/BlessCarousel.vue.d.ts +3 -0
- package/dist/components/BlessCarousel.vue_vue_type_script_setup_true_lang.js +10 -9
- package/dist/components/BlessCoachmark.css +1 -0
- package/dist/components/BlessCoachmark.js +6 -0
- package/dist/components/BlessCoachmark.vue.d.ts +40 -0
- package/dist/components/BlessCoachmark.vue_vue_type_script_setup_true_lang.js +74 -0
- package/dist/components/BlessCodeBlock.css +1 -0
- package/dist/components/BlessCodeBlock.js +6 -0
- package/dist/components/BlessCodeBlock.vue.d.ts +72 -0
- package/dist/components/BlessCodeBlock.vue_vue_type_script_setup_true_lang.js +140 -0
- package/dist/components/BlessCombobox.vue.d.ts +2 -0
- package/dist/components/BlessCombobox.vue_vue_type_script_setup_true_lang.js +3 -2
- package/dist/components/BlessCommand.css +1 -1
- package/dist/components/BlessCommand.vue.d.ts +26 -0
- package/dist/components/BlessCommand.vue_vue_type_script_setup_true_lang.js +137 -70
- package/dist/components/BlessConfetti.css +1 -0
- package/dist/components/BlessConfetti.js +6 -0
- package/dist/components/BlessConfetti.vue.d.ts +40 -0
- package/dist/components/BlessConfetti.vue_vue_type_script_setup_true_lang.js +77 -0
- package/dist/components/BlessCountUp.css +1 -0
- package/dist/components/BlessCountUp.js +6 -0
- package/dist/components/BlessCountUp.vue.d.ts +18 -0
- package/dist/components/BlessCountUp.vue_vue_type_script_setup_true_lang.js +49 -0
- package/dist/components/BlessCropper.css +1 -0
- package/dist/components/BlessCropper.js +6 -0
- package/dist/components/BlessCropper.vue.d.ts +70 -0
- package/dist/components/BlessCropper.vue_vue_type_script_setup_true_lang.js +220 -0
- package/dist/components/BlessDataTable.vue.d.ts +6 -0
- package/dist/components/BlessDataTable.vue_vue_type_script_setup_true_lang.js +56 -42
- package/dist/components/BlessDataView.vue.d.ts +7 -0
- package/dist/components/BlessDataView.vue_vue_type_script_setup_true_lang.js +38 -31
- package/dist/components/BlessDatePicker.vue.d.ts +3 -0
- package/dist/components/BlessDatePicker.vue_vue_type_script_setup_true_lang.js +46 -45
- package/dist/components/BlessDiff.css +1 -0
- package/dist/components/BlessDiff.js +6 -0
- package/dist/components/BlessDiff.vue.d.ts +22 -0
- package/dist/components/BlessDiff.vue_vue_type_script_setup_true_lang.js +148 -0
- package/dist/components/BlessDock.css +1 -0
- package/dist/components/BlessDock.js +6 -0
- package/dist/components/BlessDock.vue.d.ts +55 -0
- package/dist/components/BlessDock.vue_vue_type_script_setup_true_lang.js +100 -0
- package/dist/components/BlessEditor.vue.d.ts +2 -0
- package/dist/components/BlessEditor.vue_vue_type_script_setup_true_lang.js +23 -22
- package/dist/components/BlessFileInput.vue.d.ts +2 -0
- package/dist/components/BlessFileInput.vue_vue_type_script_setup_true_lang.js +3 -2
- package/dist/components/BlessFormula.css +1 -0
- package/dist/components/BlessFormula.js +6 -0
- package/dist/components/BlessFormula.vue.d.ts +53 -0
- package/dist/components/BlessFormula.vue_vue_type_script_setup_true_lang.js +111 -0
- package/dist/components/BlessGantt.css +1 -0
- package/dist/components/BlessGantt.js +6 -0
- package/dist/components/BlessGantt.vue.d.ts +81 -0
- package/dist/components/BlessGantt.vue_vue_type_script_setup_true_lang.js +276 -0
- package/dist/components/BlessGauge.css +1 -0
- package/dist/components/BlessGauge.js +6 -0
- package/dist/components/BlessGauge.vue.d.ts +36 -0
- package/dist/components/BlessGauge.vue_vue_type_script_setup_true_lang.js +100 -0
- package/dist/components/BlessHeatmapCalendar.css +1 -0
- package/dist/components/BlessHeatmapCalendar.js +6 -0
- package/dist/components/BlessHeatmapCalendar.vue.d.ts +38 -0
- package/dist/components/BlessHeatmapCalendar.vue_vue_type_script_setup_true_lang.js +146 -0
- package/dist/components/BlessHotspots.css +1 -0
- package/dist/components/BlessHotspots.js +6 -0
- package/dist/components/BlessHotspots.vue.d.ts +49 -0
- package/dist/components/BlessHotspots.vue_vue_type_script_setup_true_lang.js +127 -0
- package/dist/components/BlessInfiniteCanvas.css +1 -0
- package/dist/components/BlessInfiniteCanvas.js +6 -0
- package/dist/components/BlessInfiniteCanvas.vue.d.ts +91 -0
- package/dist/components/BlessInfiniteCanvas.vue_vue_type_script_setup_true_lang.js +232 -0
- package/dist/components/BlessInputNumber.vue.d.ts +5 -0
- package/dist/components/BlessInputNumber.vue_vue_type_script_setup_true_lang.js +39 -34
- package/dist/components/BlessKanban.css +1 -0
- package/dist/components/BlessKanban.js +6 -0
- package/dist/components/BlessKanban.vue.d.ts +67 -0
- package/dist/components/BlessKanban.vue_vue_type_script_setup_true_lang.js +195 -0
- package/dist/components/BlessLoadingBar.vue.d.ts +2 -0
- package/dist/components/BlessLoadingBar.vue_vue_type_script_setup_true_lang.js +8 -3
- package/dist/components/BlessLoupe.css +1 -0
- package/dist/components/BlessLoupe.js +6 -0
- package/dist/components/BlessLoupe.vue.d.ts +16 -0
- package/dist/components/BlessLoupe.vue_vue_type_script_setup_true_lang.js +93 -0
- package/dist/components/BlessMarquee.css +1 -0
- package/dist/components/BlessMarquee.js +6 -0
- package/dist/components/BlessMarquee.vue.d.ts +44 -0
- package/dist/components/BlessMarquee.vue_vue_type_script_setup_true_lang.js +69 -0
- package/dist/components/BlessMasonry.css +1 -0
- package/dist/components/BlessMasonry.js +6 -0
- package/dist/components/BlessMasonry.vue.d.ts +33 -0
- package/dist/components/BlessMasonry.vue_vue_type_script_setup_true_lang.js +79 -0
- package/dist/components/BlessMention.css +1 -0
- package/dist/components/BlessMention.js +6 -0
- package/dist/components/BlessMention.vue.d.ts +32 -0
- package/dist/components/BlessMention.vue_vue_type_script_setup_true_lang.js +116 -0
- package/dist/components/BlessNodeGraph.css +1 -0
- package/dist/components/BlessNodeGraph.js +6 -0
- package/dist/components/BlessNodeGraph.vue.d.ts +110 -0
- package/dist/components/BlessNodeGraph.vue_vue_type_script_setup_true_lang.js +321 -0
- package/dist/components/BlessOnboardingChecklist.css +1 -0
- package/dist/components/BlessOnboardingChecklist.js +6 -0
- package/dist/components/BlessOnboardingChecklist.vue.d.ts +72 -0
- package/dist/components/BlessOnboardingChecklist.vue_vue_type_script_setup_true_lang.js +157 -0
- package/dist/components/BlessOrderList.vue.d.ts +5 -0
- package/dist/components/BlessOrderList.vue_vue_type_script_setup_true_lang.js +62 -56
- package/dist/components/BlessPagination.vue.d.ts +2 -0
- package/dist/components/BlessPagination.vue_vue_type_script_setup_true_lang.js +2 -1
- package/dist/components/BlessPickList.vue.d.ts +5 -0
- package/dist/components/BlessPickList.vue_vue_type_script_setup_true_lang.js +55 -49
- package/dist/components/BlessRadialMenu.css +1 -0
- package/dist/components/BlessRadialMenu.js +6 -0
- package/dist/components/BlessRadialMenu.vue.d.ts +45 -0
- package/dist/components/BlessRadialMenu.vue_vue_type_script_setup_true_lang.js +146 -0
- package/dist/components/BlessRangeCalendar.css +1 -0
- package/dist/components/BlessRangeCalendar.js +6 -0
- package/dist/components/BlessRangeCalendar.vue.d.ts +51 -0
- package/dist/components/BlessRangeCalendar.vue_vue_type_script_setup_true_lang.js +217 -0
- package/dist/components/BlessScheduler.css +1 -0
- package/dist/components/BlessScheduler.js +6 -0
- package/dist/components/BlessScheduler.vue.d.ts +95 -0
- package/dist/components/BlessScheduler.vue_vue_type_script_setup_true_lang.js +347 -0
- package/dist/components/BlessShortcutRecorder.css +1 -0
- package/dist/components/BlessShortcutRecorder.js +6 -0
- package/dist/components/BlessShortcutRecorder.vue.d.ts +39 -0
- package/dist/components/BlessShortcutRecorder.vue_vue_type_script_setup_true_lang.js +126 -0
- package/dist/components/BlessSignaturePad.vue.d.ts +1 -1
- package/dist/components/BlessSliderCaptcha.css +1 -0
- package/dist/components/BlessSliderCaptcha.js +6 -0
- package/dist/components/BlessSliderCaptcha.vue.d.ts +38 -0
- package/dist/components/BlessSliderCaptcha.vue_vue_type_script_setup_true_lang.js +146 -0
- package/dist/components/BlessSortable.css +1 -0
- package/dist/components/BlessSortable.js +6 -0
- package/dist/components/BlessSortable.vue.d.ts +51 -0
- package/dist/components/BlessSortable.vue_vue_type_script_setup_true_lang.js +135 -0
- package/dist/components/BlessSparkline.css +1 -0
- package/dist/components/BlessSparkline.js +6 -0
- package/dist/components/BlessSparkline.vue.d.ts +28 -0
- package/dist/components/BlessSparkline.vue_vue_type_script_setup_true_lang.js +107 -0
- package/dist/components/BlessSplitView.css +1 -0
- package/dist/components/BlessSplitView.js +6 -0
- package/dist/components/BlessSplitView.vue.d.ts +61 -0
- package/dist/components/BlessSplitView.vue_vue_type_script_setup_true_lang.js +92 -0
- package/dist/components/BlessSteps.vue.d.ts +2 -0
- package/dist/components/BlessSteps.vue_vue_type_script_setup_true_lang.js +3 -2
- package/dist/components/BlessSwipeDeck.css +1 -0
- package/dist/components/BlessSwipeDeck.js +6 -0
- package/dist/components/BlessSwipeDeck.vue.d.ts +46 -0
- package/dist/components/BlessSwipeDeck.vue_vue_type_script_setup_true_lang.js +200 -0
- package/dist/components/BlessTimer.css +1 -0
- package/dist/components/BlessTimer.js +6 -0
- package/dist/components/BlessTimer.vue.d.ts +74 -0
- package/dist/components/BlessTimer.vue_vue_type_script_setup_true_lang.js +139 -0
- package/dist/components/BlessTour.vue.d.ts +1 -0
- package/dist/components/BlessTour.vue_vue_type_script_setup_true_lang.js +48 -42
- package/dist/components/BlessTreemap.css +1 -0
- package/dist/components/BlessTreemap.js +6 -0
- package/dist/components/BlessTreemap.vue.d.ts +46 -0
- package/dist/components/BlessTreemap.vue_vue_type_script_setup_true_lang.js +137 -0
- package/dist/components/BlessUploader.vue.d.ts +11 -0
- package/dist/components/BlessUploader.vue_vue_type_script_setup_true_lang.js +80 -69
- package/dist/composables/annotate.d.ts +35 -0
- package/dist/composables/annotate.js +33 -0
- package/dist/composables/canvasView.d.ts +21 -0
- package/dist/composables/canvasView.js +23 -0
- package/dist/composables/confetti.d.ts +32 -0
- package/dist/composables/confetti.js +23 -0
- package/dist/composables/cropBox.d.ts +22 -0
- package/dist/composables/cropBox.js +39 -0
- package/dist/composables/dayBlocks.d.ts +11 -0
- package/dist/composables/dayBlocks.js +26 -0
- package/dist/composables/diffLines.d.ts +10 -0
- package/dist/composables/diffLines.js +55 -0
- package/dist/composables/formula.d.ts +28 -0
- package/dist/composables/formula.js +161 -0
- package/dist/composables/graph.d.ts +19 -0
- package/dist/composables/graph.js +16 -0
- package/dist/composables/radial.d.ts +15 -0
- package/dist/composables/radial.js +22 -0
- package/dist/composables/schedule.d.ts +27 -0
- package/dist/composables/schedule.js +54 -0
- package/dist/composables/shortcut.d.ts +12 -0
- package/dist/composables/shortcut.js +35 -0
- package/dist/composables/treemap.d.ts +23 -0
- package/dist/composables/treemap.js +77 -0
- package/dist/composables/useAutoScroll.d.ts +15 -0
- package/dist/composables/useAutoScroll.js +32 -0
- package/dist/composables/useSortable.d.ts +58 -0
- package/dist/composables/useSortable.js +107 -0
- package/dist/index.d.ts +62 -1
- package/dist/index.js +93 -53
- package/package.json +22 -18
|
@@ -0,0 +1,347 @@
|
|
|
1
|
+
import e from "./BlessButton.js";
|
|
2
|
+
import { addDays as t, fromISO as n, isoToday as r, toISO as i } from "../composables/date.js";
|
|
3
|
+
import { fmtTime as ee, layoutDay as te, moveEvent as a, nextEventId as ne, resizeEvent as o, snapTo as s, weekOf as re } from "../composables/schedule.js";
|
|
4
|
+
import { Fragment as c, computed as l, createBlock as ie, createCommentVNode as u, createElementBlock as d, createElementVNode as f, createTextVNode as p, createVNode as m, defineComponent as h, mergeModels as g, nextTick as _, normalizeClass as v, normalizeStyle as y, onMounted as ae, openBlock as b, ref as x, renderList as S, toDisplayString as C, unref as w, useId as oe, useModel as T, withCtx as E } from "vue";
|
|
5
|
+
//#region src/components/BlessScheduler.vue?vue&type=script&setup=true&lang.ts
|
|
6
|
+
var se = ["aria-label"], ce = { class: "bless-sched__bar" }, le = {
|
|
7
|
+
class: "bless-sched__title",
|
|
8
|
+
"aria-live": "polite"
|
|
9
|
+
}, ue = {
|
|
10
|
+
key: 0,
|
|
11
|
+
class: "bless-sched__scroll"
|
|
12
|
+
}, de = { class: "bless-sched__body" }, fe = ["aria-label", "onPointerdown"], pe = [
|
|
13
|
+
"data-event",
|
|
14
|
+
"aria-pressed",
|
|
15
|
+
"aria-label",
|
|
16
|
+
"tabindex",
|
|
17
|
+
"onPointerdown",
|
|
18
|
+
"onKeydown",
|
|
19
|
+
"onFocus"
|
|
20
|
+
], me = { class: "bless-sched__etitle" }, he = { class: "bless-sched__etime" }, ge = ["onPointerdown"], _e = {
|
|
21
|
+
key: 1,
|
|
22
|
+
class: "bless-sched__edit"
|
|
23
|
+
}, ve = { class: "bless-sched__field" }, ye = ["value"], be = { class: "bless-sched__when" }, xe = {
|
|
24
|
+
class: "bless-sched__live",
|
|
25
|
+
"aria-live": "polite"
|
|
26
|
+
}, D = /*@__PURE__*/ h({
|
|
27
|
+
name: "BlessScheduler",
|
|
28
|
+
__name: "BlessScheduler",
|
|
29
|
+
props: /*@__PURE__*/ g({
|
|
30
|
+
view: { default: "week" },
|
|
31
|
+
weekStart: { default: 1 },
|
|
32
|
+
dayStart: { default: 7 },
|
|
33
|
+
dayEnd: { default: 20 },
|
|
34
|
+
snap: { default: 15 },
|
|
35
|
+
hourHeight: { default: 48 },
|
|
36
|
+
locale: { default: "en" },
|
|
37
|
+
editable: {
|
|
38
|
+
type: Boolean,
|
|
39
|
+
default: !0
|
|
40
|
+
},
|
|
41
|
+
label: { default: "Schedule" },
|
|
42
|
+
labels: {}
|
|
43
|
+
}, {
|
|
44
|
+
modelValue: { default: () => [] },
|
|
45
|
+
modelModifiers: {},
|
|
46
|
+
date: { default: null },
|
|
47
|
+
dateModifiers: {},
|
|
48
|
+
selected: { default: null },
|
|
49
|
+
selectedModifiers: {}
|
|
50
|
+
}),
|
|
51
|
+
emits: /*@__PURE__*/ g([
|
|
52
|
+
"create",
|
|
53
|
+
"change",
|
|
54
|
+
"remove"
|
|
55
|
+
], [
|
|
56
|
+
"update:modelValue",
|
|
57
|
+
"update:date",
|
|
58
|
+
"update:selected"
|
|
59
|
+
]),
|
|
60
|
+
setup(h, { emit: g }) {
|
|
61
|
+
let D = h, O = T(h, "modelValue"), k = T(h, "date"), A = T(h, "selected"), j = g, M = l(() => ({
|
|
62
|
+
prev: "Previous",
|
|
63
|
+
next: "Next",
|
|
64
|
+
today: "Today",
|
|
65
|
+
add: "Add event",
|
|
66
|
+
remove: "Remove",
|
|
67
|
+
title: "Title",
|
|
68
|
+
newEvent: "New event",
|
|
69
|
+
eventName: (e, t, n, r) => `${e}, ${t}, ${n} to ${r}`,
|
|
70
|
+
moved: (e, t, n, r) => `${e}: ${t}, ${n} to ${r}`,
|
|
71
|
+
added: (e) => `${e} added`,
|
|
72
|
+
removed: (e) => `${e} removed`,
|
|
73
|
+
hint: "Arrow keys move the event, Alt with up or down changes its length, Delete removes it.",
|
|
74
|
+
...D.labels
|
|
75
|
+
})), N = `${oe()}-hint`, P = x(""), F = x(), I = x(), L = l(() => k.value ?? O.value[0]?.date ?? null), R = x("");
|
|
76
|
+
ae(() => {
|
|
77
|
+
R.value = r(), L.value || (k.value = R.value);
|
|
78
|
+
});
|
|
79
|
+
let z = l(() => D.dayStart * 60), B = l(() => D.dayEnd * 60), V = (e) => (e - z.value) / 60 * D.hourHeight, H = l(() => (D.dayEnd - D.dayStart) * D.hourHeight), Se = l(() => Array.from({ length: D.dayEnd - D.dayStart }, (e, t) => D.dayStart + t)), U = l(() => {
|
|
80
|
+
if (!L.value) return [];
|
|
81
|
+
if (D.view === "day") return [L.value];
|
|
82
|
+
let e = n(re(L.value, D.weekStart));
|
|
83
|
+
return Array.from({ length: 7 }, (n, r) => i(t(e, r)));
|
|
84
|
+
}), Ce = l(() => new Intl.DateTimeFormat(D.locale, {
|
|
85
|
+
weekday: "short",
|
|
86
|
+
day: "numeric"
|
|
87
|
+
})), we = l(() => new Intl.DateTimeFormat(D.locale, {
|
|
88
|
+
weekday: "long",
|
|
89
|
+
day: "numeric",
|
|
90
|
+
month: "long"
|
|
91
|
+
})), W = l(() => new Intl.DateTimeFormat(D.locale, {
|
|
92
|
+
day: "numeric",
|
|
93
|
+
month: "short",
|
|
94
|
+
year: "numeric"
|
|
95
|
+
})), Te = l(() => {
|
|
96
|
+
let e = U.value;
|
|
97
|
+
return e.length ? e.length === 1 ? W.value.format(n(e[0])) : `${W.value.format(n(e[0]))} – ${W.value.format(n(e.at(-1)))}` : "";
|
|
98
|
+
}), G = (e) => ee(e, D.locale), K = (e) => we.value.format(n(e)), Ee = (e) => O.value.filter((t) => t.date === e), De = l(() => new Map(U.value.map((e) => [e, te(Ee(e))]))), Oe = (e) => M.value.eventName(e.title, K(e.date), G(e.start), G(e.end)), q = l(() => O.value.find((e) => e.id === A.value)), J = (e) => {
|
|
99
|
+
O.value = O.value.map((t) => t.id === e.id ? e : t), j("change", e);
|
|
100
|
+
}, ke = (e) => P.value = M.value.moved(e.title, K(e.date), G(e.start), G(e.end));
|
|
101
|
+
function Ae(e) {
|
|
102
|
+
let t = {
|
|
103
|
+
id: ne(O.value),
|
|
104
|
+
title: M.value.newEvent,
|
|
105
|
+
...e
|
|
106
|
+
};
|
|
107
|
+
O.value = [...O.value, t], A.value = t.id, j("create", t), P.value = M.value.added(t.title), _(() => F.value?.select());
|
|
108
|
+
}
|
|
109
|
+
function je() {
|
|
110
|
+
let e = U.value[0];
|
|
111
|
+
if (!e) return;
|
|
112
|
+
let t = Math.min(z.value + 60, B.value - 60);
|
|
113
|
+
Ae({
|
|
114
|
+
date: e,
|
|
115
|
+
start: t,
|
|
116
|
+
end: Math.min(t + 60, B.value)
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
function Me(e) {
|
|
120
|
+
let t = O.value.indexOf(e), n = O.value.filter((t) => t !== e);
|
|
121
|
+
O.value = n, j("remove", e), P.value = M.value.removed(e.title), A.value = n[Math.min(t, n.length - 1)]?.id ?? null, _(() => A.value ? Ne(A.value) : I.value?.focus());
|
|
122
|
+
}
|
|
123
|
+
let Ne = (e) => I.value?.querySelector(`[data-event="${CSS.escape(e)}"]`)?.focus(), Pe = (e) => {
|
|
124
|
+
let t = I.value.getBoundingClientRect();
|
|
125
|
+
return Math.min(B.value, Math.max(z.value, s(z.value + (e - t.top) / D.hourHeight * 60, D.snap)));
|
|
126
|
+
}, Y = (e) => {
|
|
127
|
+
let t = I.value.getBoundingClientRect(), n = U.value.length;
|
|
128
|
+
return Math.min(n - 1, Math.max(0, Math.floor((e - t.left) / (t.width || 1) * n)));
|
|
129
|
+
}, X = null, Z = x(null);
|
|
130
|
+
function Fe(e, t) {
|
|
131
|
+
if (t.button || !D.editable || t.target !== t.currentTarget) return;
|
|
132
|
+
A.value = null, t.currentTarget.setPointerCapture?.(t.pointerId);
|
|
133
|
+
let n = Pe(t.clientY);
|
|
134
|
+
X = {
|
|
135
|
+
kind: "make",
|
|
136
|
+
date: e,
|
|
137
|
+
a: n
|
|
138
|
+
}, Z.value = {
|
|
139
|
+
date: e,
|
|
140
|
+
start: n,
|
|
141
|
+
end: n
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
function Ie(e, t, n) {
|
|
145
|
+
t.button || (t.stopPropagation(), A.value = e.id, D.editable && (t.currentTarget.setPointerCapture?.(t.pointerId), X = n === "move" ? {
|
|
146
|
+
kind: n,
|
|
147
|
+
e,
|
|
148
|
+
y: t.clientY,
|
|
149
|
+
col: Y(t.clientX)
|
|
150
|
+
} : {
|
|
151
|
+
kind: n,
|
|
152
|
+
e,
|
|
153
|
+
y: t.clientY
|
|
154
|
+
}));
|
|
155
|
+
}
|
|
156
|
+
function Le(e) {
|
|
157
|
+
let t = X;
|
|
158
|
+
if (t) {
|
|
159
|
+
if (t.kind === "make") {
|
|
160
|
+
let n = Pe(e.clientY);
|
|
161
|
+
Z.value = {
|
|
162
|
+
date: t.date,
|
|
163
|
+
start: Math.min(t.a, n),
|
|
164
|
+
end: Math.max(t.a, n)
|
|
165
|
+
};
|
|
166
|
+
} else if (t.kind === "move") {
|
|
167
|
+
let n = s((e.clientY - t.y) / D.hourHeight * 60, D.snap);
|
|
168
|
+
J(a(t.e, n, Y(e.clientX) - t.col, z.value, B.value));
|
|
169
|
+
} else {
|
|
170
|
+
let n = s((e.clientY - t.y) / D.hourHeight * 60, D.snap);
|
|
171
|
+
J(o(t.e, n, D.snap, B.value));
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
function Re() {
|
|
176
|
+
let e = X, t = Z.value;
|
|
177
|
+
if (X = null, Z.value = null, e?.kind === "make" && t && t.end - t.start >= D.snap) Ae(t);
|
|
178
|
+
else if (e && e.kind !== "make") {
|
|
179
|
+
let t = O.value.find((t) => t.id === e.e.id);
|
|
180
|
+
t && ke(t);
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
function ze(e, t) {
|
|
184
|
+
if (t.target.closest("input")) return;
|
|
185
|
+
let n = {
|
|
186
|
+
ArrowUp: [-1, 0],
|
|
187
|
+
ArrowDown: [1, 0],
|
|
188
|
+
ArrowLeft: [0, -1],
|
|
189
|
+
ArrowRight: [0, 1]
|
|
190
|
+
}[t.key];
|
|
191
|
+
if (n && D.editable) {
|
|
192
|
+
t.preventDefault();
|
|
193
|
+
let r;
|
|
194
|
+
r = t.altKey ? o(e, n[0] * D.snap, D.snap, B.value) : a(e, n[0] * D.snap, D.view === "week" ? n[1] : 0, z.value, B.value), U.value.includes(r.date) || (r = {
|
|
195
|
+
...r,
|
|
196
|
+
date: e.date
|
|
197
|
+
}), J(r), ke(r), r.date !== e.date && _(() => Ne(e.id));
|
|
198
|
+
} else (t.key === "Delete" || t.key === "Backspace") && D.editable ? (t.preventDefault(), Me(e)) : (t.key === "Enter" || t.key === " ") && (t.preventDefault(), A.value = e.id, _(() => F.value?.focus()));
|
|
199
|
+
}
|
|
200
|
+
let Be = (e) => {
|
|
201
|
+
L.value && (k.value = i(t(n(L.value), e * (D.view === "week" ? 7 : 1))));
|
|
202
|
+
}, Ve = l(() => A.value ?? O.value.find((e) => U.value.includes(e.date))?.id), Q = (e) => ({
|
|
203
|
+
top: `${V(e.start)}px`,
|
|
204
|
+
height: `${V(e.end) - V(e.start)}px`
|
|
205
|
+
}), $ = (e, t) => De.value.get(e)?.get(t) ?? {
|
|
206
|
+
lane: 0,
|
|
207
|
+
lanes: 1
|
|
208
|
+
};
|
|
209
|
+
return (t, i) => (b(), d("div", {
|
|
210
|
+
class: "bless-sched",
|
|
211
|
+
role: "group",
|
|
212
|
+
"aria-label": h.label
|
|
213
|
+
}, [
|
|
214
|
+
f("div", ce, [
|
|
215
|
+
m(e, {
|
|
216
|
+
size: "sm",
|
|
217
|
+
variant: "outline",
|
|
218
|
+
"aria-label": M.value.prev,
|
|
219
|
+
onClick: i[0] ||= (e) => Be(-1)
|
|
220
|
+
}, {
|
|
221
|
+
default: E(() => [...i[5] ||= [p("‹", -1)]]),
|
|
222
|
+
_: 1
|
|
223
|
+
}, 8, ["aria-label"]),
|
|
224
|
+
m(e, {
|
|
225
|
+
size: "sm",
|
|
226
|
+
variant: "outline",
|
|
227
|
+
onClick: i[1] ||= (e) => k.value = w(r)()
|
|
228
|
+
}, {
|
|
229
|
+
default: E(() => [p(C(M.value.today), 1)]),
|
|
230
|
+
_: 1
|
|
231
|
+
}),
|
|
232
|
+
m(e, {
|
|
233
|
+
size: "sm",
|
|
234
|
+
variant: "outline",
|
|
235
|
+
"aria-label": M.value.next,
|
|
236
|
+
onClick: i[2] ||= (e) => Be(1)
|
|
237
|
+
}, {
|
|
238
|
+
default: E(() => [...i[6] ||= [p("›", -1)]]),
|
|
239
|
+
_: 1
|
|
240
|
+
}, 8, ["aria-label"]),
|
|
241
|
+
f("strong", le, C(Te.value), 1),
|
|
242
|
+
h.editable ? (b(), ie(e, {
|
|
243
|
+
key: 0,
|
|
244
|
+
size: "sm",
|
|
245
|
+
class: "bless-sched__add",
|
|
246
|
+
onClick: je
|
|
247
|
+
}, {
|
|
248
|
+
default: E(() => [p(C(M.value.add), 1)]),
|
|
249
|
+
_: 1
|
|
250
|
+
})) : u("", !0)
|
|
251
|
+
]),
|
|
252
|
+
U.value.length ? (b(), d("div", ue, [f("div", {
|
|
253
|
+
class: "bless-sched__head",
|
|
254
|
+
style: y({ "--_n": U.value.length })
|
|
255
|
+
}, [i[7] ||= f("span", { class: "bless-sched__corner" }, null, -1), (b(!0), d(c, null, S(U.value, (e) => (b(), d("span", {
|
|
256
|
+
key: e,
|
|
257
|
+
class: v(["bless-sched__day", { "bless-sched__day--today": e === R.value }])
|
|
258
|
+
}, C(Ce.value.format(w(n)(e))), 3))), 128))], 4), f("div", de, [f("div", {
|
|
259
|
+
class: "bless-sched__gutter",
|
|
260
|
+
"aria-hidden": "true",
|
|
261
|
+
style: y({ height: `${H.value}px` })
|
|
262
|
+
}, [(b(!0), d(c, null, S(Se.value, (e) => (b(), d("span", {
|
|
263
|
+
key: e,
|
|
264
|
+
class: "bless-sched__hour",
|
|
265
|
+
style: y({ top: `${V(e * 60)}px` })
|
|
266
|
+
}, C(G(e * 60)), 5))), 128))], 4), f("div", {
|
|
267
|
+
ref_key: "cols",
|
|
268
|
+
ref: I,
|
|
269
|
+
class: "bless-sched__cols",
|
|
270
|
+
style: y({
|
|
271
|
+
height: `${H.value}px`,
|
|
272
|
+
"--_n": U.value.length,
|
|
273
|
+
"--_h": `${h.hourHeight}px`
|
|
274
|
+
}),
|
|
275
|
+
tabindex: "-1",
|
|
276
|
+
"aria-describedby": N,
|
|
277
|
+
onPointermove: Le,
|
|
278
|
+
onPointerup: Re,
|
|
279
|
+
onPointercancel: Re
|
|
280
|
+
}, [(b(!0), d(c, null, S(U.value, (e) => (b(), d("div", {
|
|
281
|
+
key: e,
|
|
282
|
+
class: "bless-sched__col",
|
|
283
|
+
role: "group",
|
|
284
|
+
"aria-label": K(e),
|
|
285
|
+
onPointerdown: (t) => Fe(e, t)
|
|
286
|
+
}, [(b(!0), d(c, null, S(Ee(e), (t) => (b(), d("div", {
|
|
287
|
+
key: t.id,
|
|
288
|
+
class: v(["bless-sched__event", { "bless-sched__event--sel": A.value === t.id }]),
|
|
289
|
+
style: y({
|
|
290
|
+
...Q(t),
|
|
291
|
+
left: `calc(${$(e, t.id).lane / $(e, t.id).lanes * 100}% + 1px)`,
|
|
292
|
+
width: `calc(${100 / $(e, t.id).lanes}% - 3px)`
|
|
293
|
+
}),
|
|
294
|
+
"data-event": t.id,
|
|
295
|
+
role: "button",
|
|
296
|
+
"aria-pressed": A.value === t.id,
|
|
297
|
+
"aria-label": Oe(t),
|
|
298
|
+
tabindex: Ve.value === t.id ? 0 : -1,
|
|
299
|
+
onPointerdown: (e) => Ie(t, e, "move"),
|
|
300
|
+
onKeydown: (e) => ze(t, e),
|
|
301
|
+
onFocus: (e) => A.value = t.id
|
|
302
|
+
}, [
|
|
303
|
+
f("span", me, C(t.title), 1),
|
|
304
|
+
f("span", he, C(G(t.start)) + "–" + C(G(t.end)), 1),
|
|
305
|
+
h.editable ? (b(), d("span", {
|
|
306
|
+
key: 0,
|
|
307
|
+
class: "bless-sched__foot",
|
|
308
|
+
"aria-hidden": "true",
|
|
309
|
+
onPointerdown: (e) => Ie(t, e, "size")
|
|
310
|
+
}, null, 40, ge)) : u("", !0)
|
|
311
|
+
], 46, pe))), 128)), Z.value && Z.value.date === e ? (b(), d("div", {
|
|
312
|
+
key: 0,
|
|
313
|
+
class: "bless-sched__event bless-sched__event--draft",
|
|
314
|
+
style: y(Q(Z.value))
|
|
315
|
+
}, null, 4)) : u("", !0)], 40, fe))), 128))], 36)])])) : u("", !0),
|
|
316
|
+
q.value && h.editable ? (b(), d("div", _e, [
|
|
317
|
+
f("label", ve, [f("span", null, C(M.value.title), 1), f("input", {
|
|
318
|
+
ref_key: "titleInput",
|
|
319
|
+
ref: F,
|
|
320
|
+
class: "bless-sched__input",
|
|
321
|
+
type: "text",
|
|
322
|
+
value: q.value.title,
|
|
323
|
+
onInput: i[3] ||= (e) => J({
|
|
324
|
+
...q.value,
|
|
325
|
+
title: e.target.value
|
|
326
|
+
})
|
|
327
|
+
}, null, 40, ye)]),
|
|
328
|
+
f("span", be, C(K(q.value.date)) + ", " + C(G(q.value.start)) + "–" + C(G(q.value.end)), 1),
|
|
329
|
+
m(e, {
|
|
330
|
+
size: "sm",
|
|
331
|
+
variant: "outline",
|
|
332
|
+
onClick: i[4] ||= (e) => Me(q.value)
|
|
333
|
+
}, {
|
|
334
|
+
default: E(() => [p(C(M.value.remove), 1)]),
|
|
335
|
+
_: 1
|
|
336
|
+
})
|
|
337
|
+
])) : u("", !0),
|
|
338
|
+
f("span", {
|
|
339
|
+
id: N,
|
|
340
|
+
hidden: ""
|
|
341
|
+
}, C(M.value.hint), 1),
|
|
342
|
+
f("span", xe, C(P.value), 1)
|
|
343
|
+
], 8, se));
|
|
344
|
+
}
|
|
345
|
+
});
|
|
346
|
+
//#endregion
|
|
347
|
+
export { D as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.bless-shortcut{gap:var(--bless-space-1);font-family:var(--bless-font-sans);font-size:var(--bless-text-sm);flex-direction:column;display:inline-flex;position:relative}.bless-shortcut__btn{min-width:160px;min-height:36px;padding:var(--bless-space-1) var(--bless-space-3);border:var(--bless-border-width) solid var(--bless-color-border);background:var(--bless-color-bg);color:var(--bless-color-text);font:inherit;cursor:pointer;align-items:center;display:inline-flex}.bless-shortcut__btn:focus-visible{outline:2px solid var(--bless-color-accent);outline-offset:2px}.bless-shortcut--rec .bless-shortcut__btn{border-color:var(--bless-color-accent)}.bless-shortcut--bad .bless-shortcut__btn{border-color:var(--bless-color-danger-text)}.bless-shortcut__btn:disabled{opacity:.5;cursor:not-allowed}.bless-shortcut__hint{color:var(--bless-color-text-muted)}.bless-shortcut__error{color:var(--bless-color-danger-text);font-size:var(--bless-text-xs);margin:0}.bless-shortcut__live{clip-path:inset(50%);width:1px;height:1px;position:absolute;overflow:hidden}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
/** combos already taken, as a list or `{ "Ctrl+K": "Open search" }` to say by what */
|
|
3
|
+
taken?: string[] | Record<string, string>;
|
|
4
|
+
/** accept a bare key such as `G`; off asks for Ctrl, Alt or Meta, or a function key */
|
|
5
|
+
allowBare?: boolean;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
label?: string;
|
|
8
|
+
placeholder?: string;
|
|
9
|
+
/** button wording and the messages said while recording or on a refusal */
|
|
10
|
+
labels?: Partial<{
|
|
11
|
+
button: (label: string, combo: string) => string;
|
|
12
|
+
pressKeys: string;
|
|
13
|
+
recording: string;
|
|
14
|
+
set: (combo: string) => string;
|
|
15
|
+
needsModifier: (combo: string) => string;
|
|
16
|
+
usedBy: (combo: string, by: string) => string;
|
|
17
|
+
taken: (combo: string) => string;
|
|
18
|
+
}>;
|
|
19
|
+
};
|
|
20
|
+
declare function start(): void;
|
|
21
|
+
type __VLS_ModelProps = {
|
|
22
|
+
modelValue?: string;
|
|
23
|
+
};
|
|
24
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
25
|
+
declare const __VLS_export: import('vue').DefineComponent<__VLS_PublicProps, {
|
|
26
|
+
start: typeof start;
|
|
27
|
+
focus: () => void | undefined;
|
|
28
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
29
|
+
"update:modelValue": (value: string) => any;
|
|
30
|
+
conflict: (combo: string, by: string | undefined) => any;
|
|
31
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
32
|
+
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
33
|
+
onConflict?: ((combo: string, by: string | undefined) => any) | undefined;
|
|
34
|
+
}>, {
|
|
35
|
+
label: string;
|
|
36
|
+
placeholder: string;
|
|
37
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
38
|
+
declare const _default: typeof __VLS_export;
|
|
39
|
+
export default _default;
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import e from "./BlessKbd.js";
|
|
2
|
+
import { isModifierKey as t, shortcutFromEvent as n, splitShortcut as r } from "../composables/shortcut.js";
|
|
3
|
+
import { computed as i, createBlock as a, createCommentVNode as o, createElementBlock as s, createElementVNode as c, defineComponent as l, mergeModels as u, normalizeClass as d, openBlock as f, ref as p, toDisplayString as m, unref as h, useId as g, useModel as _ } from "vue";
|
|
4
|
+
//#region src/components/BlessShortcutRecorder.vue?vue&type=script&setup=true&lang.ts
|
|
5
|
+
var v = [
|
|
6
|
+
"id",
|
|
7
|
+
"disabled",
|
|
8
|
+
"aria-label",
|
|
9
|
+
"aria-describedby",
|
|
10
|
+
"aria-invalid"
|
|
11
|
+
], y = {
|
|
12
|
+
key: 0,
|
|
13
|
+
class: "bless-shortcut__hint"
|
|
14
|
+
}, b = {
|
|
15
|
+
key: 2,
|
|
16
|
+
class: "bless-shortcut__hint"
|
|
17
|
+
}, x = ["id"], S = {
|
|
18
|
+
class: "bless-shortcut__live",
|
|
19
|
+
"aria-live": "polite"
|
|
20
|
+
}, C = /*@__PURE__*/ l({
|
|
21
|
+
name: "BlessShortcutRecorder",
|
|
22
|
+
__name: "BlessShortcutRecorder",
|
|
23
|
+
props: /*@__PURE__*/ u({
|
|
24
|
+
taken: {},
|
|
25
|
+
allowBare: { type: Boolean },
|
|
26
|
+
disabled: { type: Boolean },
|
|
27
|
+
label: { default: "Shortcut" },
|
|
28
|
+
placeholder: { default: "Not set" },
|
|
29
|
+
labels: {}
|
|
30
|
+
}, {
|
|
31
|
+
modelValue: { default: "" },
|
|
32
|
+
modelModifiers: {}
|
|
33
|
+
}),
|
|
34
|
+
emits: /*@__PURE__*/ u(["conflict"], ["update:modelValue"]),
|
|
35
|
+
setup(l, { expose: u, emit: C }) {
|
|
36
|
+
let w = l, T = i(() => ({
|
|
37
|
+
button: (e, t) => `${e}: ${t || "not set"}. Press Enter to change.`,
|
|
38
|
+
pressKeys: "Press keys…",
|
|
39
|
+
recording: "Recording. Press the keys you want. Escape cancels, Backspace clears.",
|
|
40
|
+
set: (e) => `Set to ${e}`,
|
|
41
|
+
needsModifier: (e) => `Add Ctrl, Alt or Meta to ${e}`,
|
|
42
|
+
usedBy: (e, t) => `${e} is already used by ${t}`,
|
|
43
|
+
taken: (e) => `${e} is already taken`,
|
|
44
|
+
...w.labels
|
|
45
|
+
})), E = _(l, "modelValue"), D = C, O = g(), k = p(!1), A = p(""), j = p(""), M = p(""), N = p(), P = (e) => Array.isArray(w.taken) ? w.taken.includes(e) ? "" : void 0 : w.taken?.[e], F = i(() => k.value ? A.value : E.value), I = i(() => F.value ? r(F.value) : []);
|
|
46
|
+
function L() {
|
|
47
|
+
w.disabled || (k.value = !0, A.value = "", j.value = "", M.value = T.value.recording);
|
|
48
|
+
}
|
|
49
|
+
function R(e = "") {
|
|
50
|
+
k.value = !1, A.value = "", M.value = e;
|
|
51
|
+
}
|
|
52
|
+
let z = (e) => !w.allowBare && !/^(Ctrl|Alt|Meta)\+/.test(e.replace(/Shift\+/, "")) && !/^F\d{1,2}$/.test(e.split("+").at(-1));
|
|
53
|
+
function B(e) {
|
|
54
|
+
if (!k.value) {
|
|
55
|
+
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), L());
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
if (e.preventDefault(), e.stopPropagation(), t(e)) {
|
|
59
|
+
A.value = [
|
|
60
|
+
e.ctrlKey && "Ctrl",
|
|
61
|
+
e.altKey && "Alt",
|
|
62
|
+
e.shiftKey && "Shift",
|
|
63
|
+
e.metaKey && "Meta"
|
|
64
|
+
].filter(Boolean).join("+");
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
let r = !e.ctrlKey && !e.altKey && !e.shiftKey && !e.metaKey;
|
|
68
|
+
if (r && e.key === "Escape") return R("Cancelled");
|
|
69
|
+
if (r && (e.key === "Backspace" || e.key === "Delete")) return E.value = "", j.value = "", R("Cleared");
|
|
70
|
+
let i = n(e);
|
|
71
|
+
if (z(i)) {
|
|
72
|
+
A.value = i, j.value = T.value.needsModifier(i), M.value = j.value;
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
let a = P(i);
|
|
76
|
+
if (a !== void 0 && i !== E.value) {
|
|
77
|
+
A.value = i, j.value = a ? T.value.usedBy(i, a) : T.value.taken(i), M.value = j.value, D("conflict", i, a || void 0);
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
E.value = i, j.value = "", R(T.value.set(i));
|
|
81
|
+
}
|
|
82
|
+
function V(e) {
|
|
83
|
+
k.value && t(e) && !j.value && (A.value = [
|
|
84
|
+
e.ctrlKey && "Ctrl",
|
|
85
|
+
e.altKey && "Alt",
|
|
86
|
+
e.shiftKey && "Shift",
|
|
87
|
+
e.metaKey && "Meta"
|
|
88
|
+
].filter(Boolean).join("+"));
|
|
89
|
+
}
|
|
90
|
+
return u({
|
|
91
|
+
start: L,
|
|
92
|
+
focus: () => N.value?.focus()
|
|
93
|
+
}), (t, n) => (f(), s("div", { class: d(["bless-shortcut", {
|
|
94
|
+
"bless-shortcut--rec": k.value,
|
|
95
|
+
"bless-shortcut--bad": !!j.value
|
|
96
|
+
}]) }, [
|
|
97
|
+
c("button", {
|
|
98
|
+
id: h(O),
|
|
99
|
+
ref_key: "btn",
|
|
100
|
+
ref: N,
|
|
101
|
+
type: "button",
|
|
102
|
+
class: "bless-shortcut__btn",
|
|
103
|
+
disabled: l.disabled,
|
|
104
|
+
"aria-label": T.value.button(l.label, E.value),
|
|
105
|
+
"aria-describedby": j.value ? `${h(O)}-err` : void 0,
|
|
106
|
+
"aria-invalid": !!j.value || void 0,
|
|
107
|
+
onClick: n[0] ||= (e) => k.value ? R() : L(),
|
|
108
|
+
onKeydown: B,
|
|
109
|
+
onKeyup: V,
|
|
110
|
+
onBlur: n[1] ||= (e) => k.value && R()
|
|
111
|
+
}, [k.value && !I.value.length ? (f(), s("span", y, m(T.value.pressKeys), 1)) : I.value.length ? (f(), a(e, {
|
|
112
|
+
key: 1,
|
|
113
|
+
keys: I.value
|
|
114
|
+
}, null, 8, ["keys"])) : (f(), s("span", b, m(l.placeholder), 1))], 40, v),
|
|
115
|
+
j.value ? (f(), s("p", {
|
|
116
|
+
key: 0,
|
|
117
|
+
id: `${h(O)}-err`,
|
|
118
|
+
class: "bless-shortcut__error",
|
|
119
|
+
role: "alert"
|
|
120
|
+
}, m(j.value), 9, x)) : o("", !0),
|
|
121
|
+
c("span", S, m(M.value), 1)
|
|
122
|
+
], 2));
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
//#endregion
|
|
126
|
+
export { C as default };
|
|
@@ -37,8 +37,8 @@ declare const __VLS_base: import('vue').DefineComponent<__VLS_PublicProps, {
|
|
|
37
37
|
type: "image/png" | "image/jpeg" | "image/webp";
|
|
38
38
|
hint: string;
|
|
39
39
|
height: number;
|
|
40
|
-
lineWidth: number;
|
|
41
40
|
clearLabel: string;
|
|
41
|
+
lineWidth: number;
|
|
42
42
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
43
43
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
44
44
|
declare const _default: typeof __VLS_export;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.bless-captcha{max-width:360px;font-family:var(--bless-font-sans);font-size:var(--bless-text-sm);color:var(--bless-color-text);position:relative}.bless-captcha__stage{border:var(--bless-border-width) solid var(--bless-color-border);background-color:var(--bless-color-surface);background-image:conic-gradient(var(--bless-color-border) 25%, transparent 0 50%, var(--bless-color-border) 0 75%, transparent 0);-webkit-user-select:none;user-select:none;background-size:24px 24px;position:relative;overflow:hidden}.bless-captcha__gap{background:color-mix(in srgb, var(--bless-color-text) 55%, transparent);box-shadow:inset 0 0 0 2px var(--bless-color-bg);position:absolute}.bless-captcha__piece{background-color:var(--bless-color-surface);background-image:conic-gradient(var(--bless-color-border) 25%, transparent 0 50%, var(--bless-color-border) 0 75%, transparent 0);border:2px solid var(--bless-color-bg);outline:1px solid var(--bless-color-text);box-shadow:var(--bless-shadow-plate);transition:left var(--bless-duration-slow) var(--bless-ease-out);background-size:24px 24px;position:absolute}.bless-captcha__piece--drag{transition:none}.bless-captcha__track{height:40px;margin-top:var(--bless-space-2);background:var(--bless-color-surface);border:var(--bless-border-width) solid var(--bless-color-border);color:var(--bless-color-text-muted);justify-content:center;align-items:center;display:flex;position:relative}.bless-captcha__handle{background:var(--bless-color-text);width:44px;color:var(--bless-color-on-text);font:inherit;cursor:grab;touch-action:none;transition:left var(--bless-duration-slow) var(--bless-ease-out), translate var(--bless-duration-slow) var(--bless-ease-out);border:0;position:absolute;top:-1px;bottom:-1px}.bless-captcha__handle--drag{cursor:grabbing;transition:none}.bless-captcha__handle:focus-visible{outline:2px solid var(--bless-color-accent);outline-offset:2px}.bless-captcha--ok .bless-captcha__handle{background:var(--bless-color-accent);color:var(--bless-color-on-accent);cursor:default}.bless-captcha--fail .bless-captcha__track{border-color:var(--bless-color-danger-text)}.bless-captcha__live{clip-path:inset(50%);width:1px;height:1px;position:absolute;overflow:hidden}@media (prefers-reduced-motion:reduce){.bless-captcha__piece,.bless-captcha__handle{transition:none}}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
/** background picture; without it a checker pattern is drawn */
|
|
3
|
+
src?: string;
|
|
4
|
+
/** how close counts, as a fraction of the track (0.03 = 3%) */
|
|
5
|
+
tolerance?: number;
|
|
6
|
+
label?: string;
|
|
7
|
+
/** what is announced when the piece lands or misses */
|
|
8
|
+
labels?: Partial<{
|
|
9
|
+
verified: string;
|
|
10
|
+
failed: string;
|
|
11
|
+
}>;
|
|
12
|
+
};
|
|
13
|
+
declare function reset(): void;
|
|
14
|
+
type __VLS_ModelProps = {
|
|
15
|
+
/** true once solved; the widget then stays locked until `reset()` */
|
|
16
|
+
"verified"?: boolean;
|
|
17
|
+
};
|
|
18
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
19
|
+
declare const __VLS_export: import('vue').DefineComponent<__VLS_PublicProps, {
|
|
20
|
+
reset: typeof reset;
|
|
21
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
22
|
+
verify: (info: {
|
|
23
|
+
ms: number;
|
|
24
|
+
}) => any;
|
|
25
|
+
fail: () => any;
|
|
26
|
+
"update:verified": (value: boolean) => any;
|
|
27
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
28
|
+
onVerify?: ((info: {
|
|
29
|
+
ms: number;
|
|
30
|
+
}) => any) | undefined;
|
|
31
|
+
onFail?: (() => any) | undefined;
|
|
32
|
+
"onUpdate:verified"?: ((value: boolean) => any) | undefined;
|
|
33
|
+
}>, {
|
|
34
|
+
label: string;
|
|
35
|
+
tolerance: number;
|
|
36
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
37
|
+
declare const _default: typeof __VLS_export;
|
|
38
|
+
export default _default;
|