@joewinke/jatui 0.2.12 → 0.2.13
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/actions/attention.js +21 -13
- package/dist/actions/collapse.js +15 -29
- package/dist/actions/floating.js +29 -37
- package/dist/actions/listNav.js +108 -137
- package/dist/actions/railNav.js +72 -89
- package/dist/actions/staggerEntrance.js +19 -23
- package/dist/actions/tooltip.js +63 -51
- package/dist/assets/sounds/error.js +1 -1
- package/dist/assets/sounds/notify.js +1 -1
- package/dist/assets/sounds/pop.js +1 -1
- package/dist/assets/sounds/send.js +1 -1
- package/dist/assets/sounds/success.js +1 -1
- package/dist/assets/sounds/toggle.js +1 -1
- package/dist/components/graph/theme.js +26 -36
- package/dist/components/markup.js +59 -62
- package/dist/components/session-nav/transcriptModel.js +49 -66
- package/dist/components/shell/shell.js +14 -15
- package/dist/components/table/flexRender.js +2 -2
- package/dist/data/emojis.js +4 -4
- package/dist/dnd/autoScroll.js +10 -12
- package/dist/dnd/createDndBoard.js +94 -185
- package/dist/dnd/draggable.js +15 -23
- package/dist/dnd/dropTarget.js +15 -29
- package/dist/dnd/types.d.ts +9 -0
- package/dist/dnd/types.js +2 -14
- package/dist/showcase/generative/intent.js +19 -21
- package/dist/showcase/generative/manifest.js +27 -80
- package/dist/showcase/scroll/scrollProgress.js +20 -22
- package/dist/showcase/scroll/scrollReveal.js +17 -20
- package/dist/stores/commandPalette.js +18 -46
- package/dist/stores/confirmDialog.js +9 -9
- package/dist/stores/inputDialog.js +9 -9
- package/dist/stores/toast.js +10 -33
- package/dist/transitions/glide.js +29 -25
- package/dist/types/booking.js +4 -4
- package/dist/types/comments.js +2 -2
- package/dist/types/messaging.js +3 -3
- package/dist/types/pipeline.js +2 -2
- package/dist/utils/currency.js +2 -4
- package/dist/utils/daisyuiColors.js +25 -27
- package/dist/utils/dateFormatters.js +44 -44
- package/dist/utils/googleMapsLoader.js +46 -100
- package/dist/utils/mentionParser.js +30 -30
- package/dist/utils/phone.js +21 -27
- package/dist/utils/phoneFormat.js +9 -9
- package/dist/utils/sound.js +27 -78
- package/dist/utils/splitText.js +15 -26
- package/dist/utils/taskUtils.js +1 -1
- package/dist/utils/themeWipe.js +27 -72
- package/dist/utils/viewTransition.js +6 -51
- package/package.json +7 -3
- package/dist/dnd/createDndBoard.test.d.ts +0 -1
- package/dist/dnd/createDndBoard.test.js +0 -261
|
@@ -1,89 +1,37 @@
|
|
|
1
|
-
|
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
11
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
12
|
-
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
13
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
14
|
-
function step(op) {
|
|
15
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
16
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
17
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
18
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
19
|
-
switch (op[0]) {
|
|
20
|
-
case 0: case 1: t = op; break;
|
|
21
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
22
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
23
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
24
|
-
default:
|
|
25
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
26
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
27
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
28
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
29
|
-
if (t[2]) _.ops.pop();
|
|
30
|
-
_.trys.pop(); continue;
|
|
31
|
-
}
|
|
32
|
-
op = body.call(thisArg, _);
|
|
33
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
34
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
var CACHE = new Map();
|
|
1
|
+
const CACHE = new Map();
|
|
38
2
|
/**
|
|
39
3
|
* Fetch and validate the asset manifest for a given assetId.
|
|
40
4
|
* Returns null if the manifest is missing or malformed.
|
|
41
5
|
* Results are memoised for the lifetime of the page.
|
|
42
6
|
*/
|
|
43
|
-
export function loadManifest(
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
case 3:
|
|
67
|
-
data = _c.sent();
|
|
68
|
-
if (!isValidManifest(data)) {
|
|
69
|
-
CACHE.set(cacheKey, null);
|
|
70
|
-
return [2 /*return*/, null];
|
|
71
|
-
}
|
|
72
|
-
CACHE.set(cacheKey, data);
|
|
73
|
-
return [2 /*return*/, data];
|
|
74
|
-
case 4:
|
|
75
|
-
_a = _c.sent();
|
|
76
|
-
CACHE.set(cacheKey, null);
|
|
77
|
-
return [2 /*return*/, null];
|
|
78
|
-
case 5: return [2 /*return*/];
|
|
79
|
-
}
|
|
80
|
-
});
|
|
81
|
-
});
|
|
7
|
+
export async function loadManifest(assetId, baseUrl = '') {
|
|
8
|
+
const cacheKey = `${baseUrl}/${assetId}`;
|
|
9
|
+
if (CACHE.has(cacheKey))
|
|
10
|
+
return CACHE.get(cacheKey) ?? null;
|
|
11
|
+
try {
|
|
12
|
+
const url = `${baseUrl}/gen/${assetId}/manifest.json`;
|
|
13
|
+
const res = await fetch(url);
|
|
14
|
+
if (!res.ok) {
|
|
15
|
+
CACHE.set(cacheKey, null);
|
|
16
|
+
return null;
|
|
17
|
+
}
|
|
18
|
+
const data = await res.json();
|
|
19
|
+
if (!isValidManifest(data)) {
|
|
20
|
+
CACHE.set(cacheKey, null);
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
CACHE.set(cacheKey, data);
|
|
24
|
+
return data;
|
|
25
|
+
}
|
|
26
|
+
catch {
|
|
27
|
+
CACHE.set(cacheKey, null);
|
|
28
|
+
return null;
|
|
29
|
+
}
|
|
82
30
|
}
|
|
83
31
|
function isValidManifest(data) {
|
|
84
32
|
if (!data || typeof data !== 'object')
|
|
85
33
|
return false;
|
|
86
|
-
|
|
34
|
+
const m = data;
|
|
87
35
|
return (typeof m.assetId === 'string' &&
|
|
88
36
|
typeof m.active === 'string' &&
|
|
89
37
|
Array.isArray(m.variants) &&
|
|
@@ -91,7 +39,6 @@ function isValidManifest(data) {
|
|
|
91
39
|
m.palette.length > 0);
|
|
92
40
|
}
|
|
93
41
|
/** Build the asset base path for a given assetId + hash. */
|
|
94
|
-
export function assetPath(assetId, hash, baseUrl) {
|
|
95
|
-
|
|
96
|
-
return "".concat(baseUrl, "/gen/").concat(assetId, "/").concat(hash);
|
|
42
|
+
export function assetPath(assetId, hash, baseUrl = '') {
|
|
43
|
+
return `${baseUrl}/gen/${assetId}/${hash}`;
|
|
97
44
|
}
|
|
@@ -10,54 +10,52 @@ import { scroll, supportsScrollTimeline } from 'motion';
|
|
|
10
10
|
* <div use:scrollProgress style="width: calc(var(--scroll-progress) * 100%)">
|
|
11
11
|
* <div use:scrollProgress={{ varName: '--depth', container: panelEl }}>
|
|
12
12
|
*/
|
|
13
|
-
export function scrollProgress(node, opts) {
|
|
14
|
-
|
|
15
|
-
var reduced = window.matchMedia('(prefers-reduced-motion: reduce)').matches;
|
|
13
|
+
export function scrollProgress(node, opts = {}) {
|
|
14
|
+
const reduced = window.matchMedia('(prefers-reduced-motion: reduce)').matches;
|
|
16
15
|
if (reduced)
|
|
17
16
|
return {};
|
|
18
|
-
|
|
17
|
+
const { varName = '--scroll-progress', container, axis = 'y' } = opts;
|
|
19
18
|
// Prefer native ScrollTimeline for compositor-thread perf when available
|
|
20
19
|
if (supportsScrollTimeline() && !container) {
|
|
21
20
|
try {
|
|
22
21
|
// @ts-ignore — ScrollTimeline is not in lib.dom yet
|
|
23
|
-
|
|
22
|
+
const timeline = new ScrollTimeline({ source: document.documentElement, axis });
|
|
24
23
|
// Animate a dummy MotionValue-style target via WAAPI
|
|
25
24
|
node.style.setProperty(varName, '0');
|
|
26
|
-
|
|
25
|
+
const anim = node.animate({ '--jatui-scroll-noop': ['0', '1'] }, {
|
|
27
26
|
// @ts-ignore
|
|
28
|
-
timeline
|
|
27
|
+
timeline,
|
|
29
28
|
fill: 'both'
|
|
30
29
|
});
|
|
31
30
|
// Mirror progress via rAF while ScrollTimeline doesn't yet expose a direct hook
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
var t = effect ? ((_a = effect.getComputedTiming().progress) !== null && _a !== void 0 ? _a : 0) : 0;
|
|
31
|
+
let rafId;
|
|
32
|
+
const tick = () => {
|
|
33
|
+
if (anim.currentTime != null) {
|
|
34
|
+
const effect = anim.effect;
|
|
35
|
+
const t = effect ? (effect.getComputedTiming().progress ?? 0) : 0;
|
|
38
36
|
node.style.setProperty(varName, String(t));
|
|
39
37
|
}
|
|
40
|
-
|
|
38
|
+
rafId = requestAnimationFrame(tick);
|
|
41
39
|
};
|
|
42
|
-
|
|
40
|
+
rafId = requestAnimationFrame(tick);
|
|
43
41
|
return {
|
|
44
|
-
destroy
|
|
45
|
-
cancelAnimationFrame(
|
|
46
|
-
|
|
42
|
+
destroy() {
|
|
43
|
+
cancelAnimationFrame(rafId);
|
|
44
|
+
anim.cancel();
|
|
47
45
|
node.style.removeProperty(varName);
|
|
48
46
|
}
|
|
49
47
|
};
|
|
50
48
|
}
|
|
51
|
-
catch
|
|
49
|
+
catch {
|
|
52
50
|
// fall through to motion scroll()
|
|
53
51
|
}
|
|
54
52
|
}
|
|
55
53
|
// Fallback: motion scroll() — JS-thread but cross-browser
|
|
56
|
-
|
|
54
|
+
const stop = scroll((progress) => {
|
|
57
55
|
node.style.setProperty(varName, String(progress));
|
|
58
|
-
}, container ? { container
|
|
56
|
+
}, container ? { container, axis } : { axis });
|
|
59
57
|
return {
|
|
60
|
-
destroy
|
|
58
|
+
destroy() {
|
|
61
59
|
stop();
|
|
62
60
|
node.style.removeProperty(varName);
|
|
63
61
|
}
|
|
@@ -11,34 +11,31 @@ import { cubicBezier } from 'motion-utils';
|
|
|
11
11
|
* <div use:scrollReveal>…</div>
|
|
12
12
|
* <ul use:scrollReveal={{ stagger: 60 }}>…</ul>
|
|
13
13
|
*/
|
|
14
|
-
export function scrollReveal(node, opts) {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
var targets = staggerMs != null ? Array.from(node.children) : [node];
|
|
14
|
+
export function scrollReveal(node, opts = {}) {
|
|
15
|
+
const { y = 16, once = true, amount = 0.15, margin = '-10px', stagger: staggerMs } = opts;
|
|
16
|
+
const reduced = window.matchMedia('(prefers-reduced-motion: reduce)').matches;
|
|
17
|
+
const targets = staggerMs != null ? Array.from(node.children) : [node];
|
|
19
18
|
if (reduced) {
|
|
20
|
-
for (
|
|
21
|
-
var t = targets_1[_i];
|
|
19
|
+
for (const t of targets) {
|
|
22
20
|
t.style.opacity = '1';
|
|
23
21
|
t.style.transform = 'none';
|
|
24
22
|
}
|
|
25
23
|
return {};
|
|
26
24
|
}
|
|
27
25
|
// Prime targets to start state
|
|
28
|
-
for (
|
|
29
|
-
var t = targets_2[_e];
|
|
26
|
+
for (const t of targets) {
|
|
30
27
|
t.style.opacity = '0';
|
|
31
|
-
t.style.transform =
|
|
28
|
+
t.style.transform = `translateY(${y}px)`;
|
|
32
29
|
}
|
|
33
|
-
|
|
34
|
-
?
|
|
30
|
+
const enterDuration = parseDuration(opts.duration != null
|
|
31
|
+
? `${opts.duration}ms`
|
|
35
32
|
: getComputedStyle(document.documentElement).getPropertyValue('--motion-enter').trim() || '200ms');
|
|
36
|
-
|
|
33
|
+
const glide = parseGlide(getComputedStyle(document.documentElement)
|
|
37
34
|
.getPropertyValue('--motion-glide')
|
|
38
35
|
.trim());
|
|
39
|
-
|
|
40
|
-
targets.forEach(
|
|
41
|
-
animateMini(t, { opacity: [0, 1], transform: [
|
|
36
|
+
const stop = inView(node, () => {
|
|
37
|
+
targets.forEach((t, i) => {
|
|
38
|
+
animateMini(t, { opacity: [0, 1], transform: [`translateY(${y}px)`, 'translateY(0px)'] }, {
|
|
42
39
|
duration: enterDuration / 1000,
|
|
43
40
|
ease: glide,
|
|
44
41
|
delay: staggerMs != null ? (i * staggerMs) / 1000 : 0
|
|
@@ -46,9 +43,9 @@ export function scrollReveal(node, opts) {
|
|
|
46
43
|
});
|
|
47
44
|
if (once)
|
|
48
45
|
stop();
|
|
49
|
-
}, { amount
|
|
46
|
+
}, { amount, margin: margin });
|
|
50
47
|
return {
|
|
51
|
-
destroy
|
|
48
|
+
destroy() {
|
|
52
49
|
stop();
|
|
53
50
|
}
|
|
54
51
|
};
|
|
@@ -61,9 +58,9 @@ function parseDuration(value) {
|
|
|
61
58
|
return 200;
|
|
62
59
|
}
|
|
63
60
|
function parseGlide(css) {
|
|
64
|
-
|
|
61
|
+
const m = css.match(/cubic-bezier\(([^)]+)\)/);
|
|
65
62
|
if (m) {
|
|
66
|
-
|
|
63
|
+
const [x1, y1, x2, y2] = m[1].split(',').map(Number);
|
|
67
64
|
return cubicBezier(x1, y1, x2, y2);
|
|
68
65
|
}
|
|
69
66
|
return cubicBezier(0.16, 1, 0.3, 1); // --motion-glide fallback
|
|
@@ -1,35 +1,23 @@
|
|
|
1
1
|
/* commandPalette.svelte.js generated by Svelte v5.53.11 */
|
|
2
2
|
import * as $ from 'svelte/internal/client';
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
if (ar || !(i in from)) {
|
|
7
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
8
|
-
|
|
9
|
-
ar[i] = from[i];
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
var RECENT_KEY = 'jatui:cmd-palette:recent';
|
|
17
|
-
var MAX_RECENT = 8;
|
|
4
|
+
const RECENT_KEY = 'jatui:cmd-palette:recent';
|
|
5
|
+
const MAX_RECENT = 8;
|
|
18
6
|
|
|
19
7
|
function createCommandPaletteStore() {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
8
|
+
let open = $.state(false);
|
|
9
|
+
let groups = $.state($.proxy([]));
|
|
10
|
+
let recentIds = $.state($.proxy([]));
|
|
23
11
|
|
|
24
12
|
// Load recent from localStorage on first access
|
|
25
13
|
function loadRecent() {
|
|
26
14
|
if (typeof localStorage === 'undefined') return;
|
|
27
15
|
|
|
28
16
|
try {
|
|
29
|
-
|
|
17
|
+
const raw = localStorage.getItem(RECENT_KEY);
|
|
30
18
|
|
|
31
19
|
$.set(recentIds, raw ? JSON.parse(raw) : [], true);
|
|
32
|
-
} catch
|
|
20
|
+
} catch {
|
|
33
21
|
$.set(recentIds, [], true);
|
|
34
22
|
}
|
|
35
23
|
}
|
|
@@ -39,19 +27,13 @@ function createCommandPaletteStore() {
|
|
|
39
27
|
|
|
40
28
|
try {
|
|
41
29
|
localStorage.setItem(RECENT_KEY, JSON.stringify(ids));
|
|
42
|
-
} catch
|
|
30
|
+
} catch {
|
|
43
31
|
// ignore storage errors
|
|
44
32
|
}
|
|
45
33
|
}
|
|
46
34
|
|
|
47
35
|
function recordRecent(id) {
|
|
48
|
-
|
|
49
|
-
[id],
|
|
50
|
-
$.safe_get(recentIds).filter(function (r) {
|
|
51
|
-
return r !== id;
|
|
52
|
-
}),
|
|
53
|
-
true
|
|
54
|
-
).slice(0, MAX_RECENT);
|
|
36
|
+
const updated = [id, ...$.get(recentIds).filter((r) => r !== id)].slice(0, MAX_RECENT);
|
|
55
37
|
|
|
56
38
|
$.set(recentIds, updated, true);
|
|
57
39
|
saveRecent(updated);
|
|
@@ -59,26 +41,24 @@ function createCommandPaletteStore() {
|
|
|
59
41
|
|
|
60
42
|
return {
|
|
61
43
|
get open() {
|
|
62
|
-
return $.
|
|
44
|
+
return $.get(open);
|
|
63
45
|
},
|
|
64
46
|
|
|
65
47
|
get groups() {
|
|
66
|
-
return $.
|
|
48
|
+
return $.get(groups);
|
|
67
49
|
},
|
|
68
50
|
|
|
69
51
|
get recentIds() {
|
|
70
|
-
return $.
|
|
52
|
+
return $.get(recentIds);
|
|
71
53
|
},
|
|
72
54
|
|
|
73
55
|
registerCommands(groupLabel, items) {
|
|
74
|
-
|
|
75
|
-
return g.label === groupLabel;
|
|
76
|
-
});
|
|
56
|
+
const existing = $.get(groups).find((g) => g.label === groupLabel);
|
|
77
57
|
|
|
78
58
|
if (existing) {
|
|
79
59
|
existing.items = items;
|
|
80
60
|
} else {
|
|
81
|
-
$.set(groups,
|
|
61
|
+
$.set(groups, [...$.get(groups), { label: groupLabel, items }], true);
|
|
82
62
|
}
|
|
83
63
|
},
|
|
84
64
|
|
|
@@ -98,19 +78,11 @@ function createCommandPaletteStore() {
|
|
|
98
78
|
},
|
|
99
79
|
|
|
100
80
|
getRecentItems() {
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
return $.safe_get(recentIds).map(function (id) {
|
|
106
|
-
return allItems.find(function (i) {
|
|
107
|
-
return i.id === id;
|
|
108
|
-
});
|
|
109
|
-
}).filter(function (i) {
|
|
110
|
-
return !!i;
|
|
111
|
-
});
|
|
81
|
+
const allItems = $.get(groups).flatMap((g) => g.items);
|
|
82
|
+
|
|
83
|
+
return $.get(recentIds).map((id) => allItems.find((i) => i.id === id)).filter((i) => !!i);
|
|
112
84
|
}
|
|
113
85
|
};
|
|
114
86
|
}
|
|
115
87
|
|
|
116
|
-
export
|
|
88
|
+
export const commandPalette = createCommandPaletteStore();
|
|
@@ -1,36 +1,36 @@
|
|
|
1
1
|
/* confirmDialog.svelte.js generated by Svelte v5.53.11 */
|
|
2
2
|
import * as $ from 'svelte/internal/client';
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
let pending = $.state(null);
|
|
5
5
|
|
|
6
6
|
export function getPending() {
|
|
7
|
-
return $.
|
|
7
|
+
return $.get(pending);
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
export function showConfirm(options) {
|
|
11
11
|
// If a dialog is already open, cancel it first.
|
|
12
|
-
if ($.
|
|
13
|
-
$.
|
|
12
|
+
if ($.get(pending)) {
|
|
13
|
+
$.get(pending).resolve(false);
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
return new Promise(
|
|
16
|
+
return new Promise((resolve) => {
|
|
17
17
|
$.set(pending, { options, resolve }, true);
|
|
18
18
|
});
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
export function confirmDialog() {
|
|
22
|
-
if (!$.
|
|
22
|
+
if (!$.get(pending)) return;
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
const p = $.get(pending);
|
|
25
25
|
|
|
26
26
|
$.set(pending, null);
|
|
27
27
|
p.resolve(true);
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
export function cancelDialog() {
|
|
31
|
-
if (!$.
|
|
31
|
+
if (!$.get(pending)) return;
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
const p = $.get(pending);
|
|
34
34
|
|
|
35
35
|
$.set(pending, null);
|
|
36
36
|
p.resolve(false);
|
|
@@ -1,36 +1,36 @@
|
|
|
1
1
|
/* inputDialog.svelte.js generated by Svelte v5.53.11 */
|
|
2
2
|
import * as $ from 'svelte/internal/client';
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
let pending = $.state(null);
|
|
5
5
|
|
|
6
6
|
export function getPendingInput() {
|
|
7
|
-
return $.
|
|
7
|
+
return $.get(pending);
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
export function showInput(options) {
|
|
11
11
|
// If a dialog is already open, cancel it first.
|
|
12
|
-
if ($.
|
|
13
|
-
$.
|
|
12
|
+
if ($.get(pending)) {
|
|
13
|
+
$.get(pending).resolve(null);
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
return new Promise(
|
|
16
|
+
return new Promise((resolve) => {
|
|
17
17
|
$.set(pending, { options, resolve }, true);
|
|
18
18
|
});
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
export function submitInput(value) {
|
|
22
|
-
if (!$.
|
|
22
|
+
if (!$.get(pending)) return;
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
const p = $.get(pending);
|
|
25
25
|
|
|
26
26
|
$.set(pending, null);
|
|
27
27
|
p.resolve(value);
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
export function cancelInput() {
|
|
31
|
-
if (!$.
|
|
31
|
+
if (!$.get(pending)) return;
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
const p = $.get(pending);
|
|
34
34
|
|
|
35
35
|
$.set(pending, null);
|
|
36
36
|
p.resolve(null);
|
package/dist/stores/toast.js
CHANGED
|
@@ -1,53 +1,30 @@
|
|
|
1
1
|
/* toast.svelte.js generated by Svelte v5.53.11 */
|
|
2
2
|
import * as $ from 'svelte/internal/client';
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
if (ar || !(i in from)) {
|
|
7
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
8
|
-
|
|
9
|
-
ar[i] = from[i];
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
var nextId = 0;
|
|
17
|
-
var toasts = $.state($.proxy([]));
|
|
4
|
+
let nextId = 0;
|
|
5
|
+
let toasts = $.state($.proxy([]));
|
|
18
6
|
|
|
19
7
|
export function getToasts() {
|
|
20
|
-
return $.
|
|
8
|
+
return $.get(toasts);
|
|
21
9
|
}
|
|
22
10
|
|
|
23
11
|
export function showToast(options) {
|
|
24
|
-
|
|
25
|
-
var id = ++nextId;
|
|
12
|
+
const id = ++nextId;
|
|
26
13
|
|
|
27
|
-
|
|
14
|
+
const toast = {
|
|
28
15
|
id,
|
|
29
|
-
type:
|
|
16
|
+
type: options.type ?? 'info',
|
|
30
17
|
message: options.message,
|
|
31
18
|
action: options.action,
|
|
32
|
-
durationMs:
|
|
19
|
+
durationMs: options.durationMs ?? 5000,
|
|
33
20
|
onUndo: options.onUndo
|
|
34
21
|
};
|
|
35
22
|
|
|
36
|
-
$.set(toasts,
|
|
23
|
+
$.set(toasts, [...$.get(toasts), toast], true);
|
|
37
24
|
|
|
38
|
-
return {
|
|
39
|
-
dismiss() {
|
|
40
|
-
return dismissToast(id);
|
|
41
|
-
}
|
|
42
|
-
};
|
|
25
|
+
return { dismiss: () => dismissToast(id) };
|
|
43
26
|
}
|
|
44
27
|
|
|
45
28
|
export function dismissToast(id) {
|
|
46
|
-
$.set(
|
|
47
|
-
toasts,
|
|
48
|
-
$.safe_get(toasts).filter(function (t) {
|
|
49
|
-
return t.id !== id;
|
|
50
|
-
}),
|
|
51
|
-
true
|
|
52
|
-
);
|
|
29
|
+
$.set(toasts, $.get(toasts).filter((t) => t.id !== id), true);
|
|
53
30
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// direction taxonomy after animista.net (Ana Travas, BSD-2-Clause site license); keyframes re-authored on jatui motion tokens
|
|
2
2
|
/** Map from direction → [dx, dy] unit vector for the entrance travel. */
|
|
3
|
-
|
|
3
|
+
const ORIGIN_VECTOR = {
|
|
4
4
|
center: [0, 0],
|
|
5
5
|
top: [0, -1],
|
|
6
6
|
tr: [1, -1],
|
|
@@ -21,38 +21,42 @@ var ORIGIN_VECTOR = {
|
|
|
21
21
|
*
|
|
22
22
|
* Reduced-motion: opacity fade only (no translate, scale, or blur).
|
|
23
23
|
*/
|
|
24
|
-
export function glide(node, params) {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
var _f = ORIGIN_VECTOR[from], ux = _f[0], uy = _f[1];
|
|
24
|
+
export function glide(node, params = {}) {
|
|
25
|
+
const { from = 'bottom', distance = 16, scale, blur = false, duration = 200, delay = 0, } = params;
|
|
26
|
+
const prefersReduced = window.matchMedia('(prefers-reduced-motion: reduce)').matches;
|
|
27
|
+
const [ux, uy] = ORIGIN_VECTOR[from];
|
|
29
28
|
// Entrance start state — element travels FROM this position TO its natural position
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
29
|
+
const tx = prefersReduced ? 0 : ux * distance;
|
|
30
|
+
const ty = prefersReduced ? 0 : uy * distance;
|
|
31
|
+
const s = (!prefersReduced && scale !== undefined) ? scale : 1;
|
|
32
|
+
const blurPx = (!prefersReduced && blur) ? 4 : 0;
|
|
34
33
|
function buildTransform(progress) {
|
|
35
34
|
// progress goes 0 → 1 on enter; Svelte reverses for exit
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
35
|
+
const invP = 1 - progress;
|
|
36
|
+
const x = tx * invP;
|
|
37
|
+
const y = ty * invP;
|
|
38
|
+
const sc = 1 - (1 - s) * invP;
|
|
39
|
+
const b = blurPx * invP;
|
|
40
|
+
let t = `translate(${x}px, ${y}px)`;
|
|
42
41
|
if (s !== 1)
|
|
43
|
-
t +=
|
|
44
|
-
|
|
45
|
-
return { transform: t, filter
|
|
42
|
+
t += ` scale(${sc})`;
|
|
43
|
+
const filter = b > 0 ? `blur(${b.toFixed(1)}px)` : '';
|
|
44
|
+
return { transform: t, filter };
|
|
46
45
|
}
|
|
47
46
|
return {
|
|
48
|
-
delay
|
|
49
|
-
duration
|
|
50
|
-
easing:
|
|
51
|
-
css
|
|
47
|
+
delay,
|
|
48
|
+
duration,
|
|
49
|
+
easing: (t) => t, // easing applied via CSS var below
|
|
50
|
+
css(t) {
|
|
52
51
|
// t: 0 = start, 1 = end (for `in:`; Svelte inverts for `out:`)
|
|
53
|
-
|
|
52
|
+
const { transform, filter } = buildTransform(t);
|
|
54
53
|
// Apply the glide easing via CSS transition so the CSS var is honored
|
|
55
|
-
return
|
|
54
|
+
return `
|
|
55
|
+
opacity: ${t};
|
|
56
|
+
transform: ${transform};
|
|
57
|
+
${filter ? `filter: ${filter};` : ''}
|
|
58
|
+
transition-timing-function: var(--motion-glide, cubic-bezier(0.16, 1, 0.3, 1));
|
|
59
|
+
`;
|
|
56
60
|
},
|
|
57
61
|
};
|
|
58
62
|
}
|
package/dist/types/booking.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Booking System Types
|
|
2
2
|
// Generic types for scheduling/booking UI components
|
|
3
3
|
// Day of week helpers
|
|
4
|
-
export
|
|
4
|
+
export const DAYS_OF_WEEK = [
|
|
5
5
|
'Sunday',
|
|
6
6
|
'Monday',
|
|
7
7
|
'Tuesday',
|
|
@@ -10,14 +10,14 @@ export var DAYS_OF_WEEK = [
|
|
|
10
10
|
'Friday',
|
|
11
11
|
'Saturday'
|
|
12
12
|
];
|
|
13
|
-
export
|
|
13
|
+
export const DAYS_SHORT = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
|
|
14
14
|
// Location type display
|
|
15
|
-
export
|
|
15
|
+
export const LOCATION_LABELS = {
|
|
16
16
|
remote: 'Video Call',
|
|
17
17
|
phone: 'Phone Call',
|
|
18
18
|
in_person: 'In Person'
|
|
19
19
|
};
|
|
20
|
-
export
|
|
20
|
+
export const LOCATION_ICONS = {
|
|
21
21
|
remote: 'video',
|
|
22
22
|
phone: 'phone',
|
|
23
23
|
in_person: 'map-pin'
|