@joewinke/jatui 0.1.31 → 0.2.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/CLAUDE.md +22 -0
- package/dist/actions/attention.d.ts +24 -0
- package/dist/actions/attention.js +94 -0
- package/dist/actions/collapse.js +29 -15
- package/dist/actions/floating.d.ts +53 -0
- package/dist/actions/floating.js +158 -0
- package/dist/actions/listNav.js +137 -108
- package/dist/actions/railNav.js +89 -72
- package/dist/actions/staggerEntrance.d.ts +28 -0
- package/dist/actions/staggerEntrance.js +71 -0
- package/dist/actions/tooltip.d.ts +28 -0
- package/dist/actions/tooltip.js +186 -0
- package/dist/assets/sounds/README.md +47 -0
- package/dist/assets/sounds/error.d.ts +1 -0
- package/dist/assets/sounds/error.js +4 -0
- package/dist/assets/sounds/notify.d.ts +1 -0
- package/dist/assets/sounds/notify.js +4 -0
- package/dist/assets/sounds/pop.d.ts +1 -0
- package/dist/assets/sounds/pop.js +4 -0
- package/dist/assets/sounds/send.d.ts +1 -0
- package/dist/assets/sounds/send.js +4 -0
- package/dist/assets/sounds/success.d.ts +1 -0
- package/dist/assets/sounds/success.js +4 -0
- package/dist/assets/sounds/toggle.d.ts +1 -0
- package/dist/assets/sounds/toggle.js +4 -0
- package/dist/components/AnimatedNumber.svelte +112 -0
- package/dist/components/AnimatedNumber.svelte.d.ts +8 -0
- package/dist/components/Badge.svelte +75 -4
- package/dist/components/Badge.svelte.d.ts +6 -1
- package/dist/components/Button.svelte +196 -21
- package/dist/components/Button.svelte.d.ts +10 -1
- package/dist/components/Carousel.svelte +265 -0
- package/dist/components/Carousel.svelte.d.ts +21 -0
- package/dist/components/ChipInput.svelte +63 -3
- package/dist/components/Collapse.svelte +70 -14
- package/dist/components/Collapse.svelte.d.ts +11 -0
- package/dist/components/ColorSelector.svelte +21 -24
- package/dist/components/CommandPalette.svelte +475 -0
- package/dist/components/CommandPalette.svelte.d.ts +3 -0
- package/dist/components/ContextMenu.svelte +9 -73
- package/dist/components/CopyButton.svelte +156 -0
- package/dist/components/CopyButton.svelte.d.ts +12 -0
- package/dist/components/HoldToConfirm.svelte +183 -0
- package/dist/components/HoldToConfirm.svelte.d.ts +11 -0
- package/dist/components/KeyboardShortcutsOverlay.svelte +54 -8
- package/dist/components/KeyboardShortcutsOverlay.svelte.d.ts +3 -0
- package/dist/components/PasswordMeter.svelte +87 -0
- package/dist/components/PasswordMeter.svelte.d.ts +8 -0
- package/dist/components/PinInput.svelte +186 -0
- package/dist/components/PinInput.svelte.d.ts +13 -0
- package/dist/components/QuantityStepper.svelte +185 -0
- package/dist/components/QuantityStepper.svelte.d.ts +12 -0
- package/dist/components/Skeleton.svelte +123 -0
- package/dist/components/Skeleton.svelte.d.ts +12 -0
- package/dist/components/SpeechForm.svelte +37 -0
- package/dist/components/StatusBadge.svelte +31 -3
- package/dist/components/StatusBadge.svelte.d.ts +0 -5
- package/dist/components/Tabs.svelte +270 -0
- package/dist/components/Tabs.svelte.d.ts +15 -0
- package/dist/components/TextInput.svelte +138 -38
- package/dist/components/TextInput.svelte.d.ts +9 -1
- package/dist/components/VoicePlayer.svelte +51 -0
- package/dist/components/basic/Alert.svelte +36 -0
- package/dist/components/basic/Alert.svelte.d.ts +9 -0
- package/dist/components/basic/Breadcrumb.svelte +27 -0
- package/dist/components/basic/Breadcrumb.svelte.d.ts +11 -0
- package/dist/components/basic/ButtonGroup.svelte +15 -0
- package/dist/components/basic/ButtonGroup.svelte.d.ts +8 -0
- package/dist/components/basic/Checkbox.svelte +85 -0
- package/dist/components/basic/Checkbox.svelte.d.ts +15 -0
- package/dist/components/basic/Empty.svelte +17 -0
- package/dist/components/basic/Empty.svelte.d.ts +8 -0
- package/dist/components/basic/Kbd.svelte +16 -0
- package/dist/components/basic/Kbd.svelte.d.ts +8 -0
- package/dist/components/basic/Pagination.svelte +104 -0
- package/dist/components/basic/Pagination.svelte.d.ts +12 -0
- package/dist/components/basic/RadioGroup.svelte +71 -0
- package/dist/components/basic/RadioGroup.svelte.d.ts +18 -0
- package/dist/components/basic/Separator.svelte +19 -0
- package/dist/components/basic/Separator.svelte.d.ts +8 -0
- package/dist/components/basic/Slider.svelte +72 -0
- package/dist/components/basic/Slider.svelte.d.ts +17 -0
- package/dist/components/basic/Switch.svelte +88 -0
- package/dist/components/basic/Switch.svelte.d.ts +14 -0
- package/dist/components/basic/Toggle.svelte +43 -0
- package/dist/components/basic/Toggle.svelte.d.ts +14 -0
- package/dist/components/graph/GraphCanvas.svelte +103 -0
- package/dist/components/graph/GraphCanvas.svelte.d.ts +22 -0
- package/dist/components/graph/JatuiNode.svelte +128 -0
- package/dist/components/graph/JatuiNode.svelte.d.ts +14 -0
- package/dist/components/graph/theme.d.ts +27 -0
- package/dist/components/graph/theme.js +136 -0
- package/dist/components/markup.js +62 -59
- package/dist/components/messaging/MessageItem.svelte +92 -0
- package/dist/components/messaging/MessageItem.svelte.d.ts +5 -0
- package/dist/components/messaging/TypingIndicator.svelte +63 -0
- package/dist/components/messaging/TypingIndicator.svelte.d.ts +7 -0
- package/dist/components/pipeline/PipelineColumn.svelte +44 -3
- package/dist/components/progress/ProgressBar.svelte +189 -0
- package/dist/components/progress/ProgressBar.svelte.d.ts +17 -0
- package/dist/components/progress/ProgressRing.svelte +138 -0
- package/dist/components/progress/ProgressRing.svelte.d.ts +12 -0
- package/dist/components/progress/Steps.svelte +195 -0
- package/dist/components/progress/Steps.svelte.d.ts +14 -0
- package/dist/components/session-nav/transcriptModel.js +66 -49
- package/dist/components/shell/NavigationMenu.svelte +422 -0
- package/dist/components/shell/NavigationMenu.svelte.d.ts +43 -0
- package/dist/components/shell/Sidebar.svelte +276 -0
- package/dist/components/shell/Sidebar.svelte.d.ts +32 -0
- package/dist/components/shell/SidebarGroup.svelte +180 -0
- package/dist/components/shell/SidebarGroup.svelte.d.ts +19 -0
- package/dist/components/shell/SidebarItem.svelte +170 -0
- package/dist/components/shell/SidebarItem.svelte.d.ts +24 -0
- package/dist/components/shell/shell.d.ts +30 -0
- package/dist/components/shell/shell.js +65 -0
- package/dist/components/table/DataTable.svelte +364 -0
- package/dist/components/table/DataTable.svelte.d.ts +4 -0
- package/dist/components/table/flexRender.d.ts +31 -0
- package/dist/components/table/flexRender.js +32 -0
- package/dist/components/table/types.d.ts +28 -0
- package/dist/components/table/types.js +1 -0
- package/dist/components/toast/ToastHost.svelte +21 -0
- package/dist/components/toast/ToastHost.svelte.d.ts +3 -0
- package/dist/components/toast/ToastItem.svelte +287 -0
- package/dist/components/toast/ToastItem.svelte.d.ts +9 -0
- package/dist/data/emojis.js +4 -4
- package/dist/dnd/autoScroll.js +12 -10
- package/dist/dnd/createDndBoard.svelte.js +110 -76
- package/dist/dnd/createDndBoard.test.js +161 -85
- package/dist/dnd/draggable.js +23 -15
- package/dist/dnd/dropTarget.js +29 -15
- package/dist/dnd/index.d.ts +0 -1
- package/dist/dnd/index.js +0 -1
- package/dist/dnd/types.d.ts +0 -9
- package/dist/dnd/types.js +14 -2
- package/dist/index.d.ts +60 -6
- package/dist/index.js +73 -6
- package/dist/showcase/AnimatedBeam.svelte +183 -0
- package/dist/showcase/AnimatedBeam.svelte.d.ts +26 -0
- package/dist/showcase/AuroraDrift.svelte +74 -0
- package/dist/showcase/AuroraDrift.svelte.d.ts +9 -0
- package/dist/showcase/BentoCard.svelte +50 -0
- package/dist/showcase/BentoCard.svelte.d.ts +14 -0
- package/dist/showcase/BentoGrid.svelte +43 -0
- package/dist/showcase/BentoGrid.svelte.d.ts +12 -0
- package/dist/showcase/BorderBeam.svelte +79 -0
- package/dist/showcase/BorderBeam.svelte.d.ts +12 -0
- package/dist/showcase/ClipWipe.svelte +82 -0
- package/dist/showcase/ClipWipe.svelte.d.ts +12 -0
- package/dist/showcase/Confetti.svelte +71 -0
- package/dist/showcase/Confetti.svelte.d.ts +10 -0
- package/dist/showcase/CursorSpotlight.svelte +85 -0
- package/dist/showcase/CursorSpotlight.svelte.d.ts +9 -0
- package/dist/showcase/DeviceMock.svelte +186 -0
- package/dist/showcase/DeviceMock.svelte.d.ts +11 -0
- package/dist/showcase/Dock.svelte +123 -0
- package/dist/showcase/Dock.svelte.d.ts +17 -0
- package/dist/showcase/FlipCard.svelte +103 -0
- package/dist/showcase/FlipCard.svelte.d.ts +10 -0
- package/dist/showcase/FocusReveal.svelte +83 -0
- package/dist/showcase/FocusReveal.svelte.d.ts +11 -0
- package/dist/showcase/Globe.svelte +202 -0
- package/dist/showcase/Globe.svelte.d.ts +16 -0
- package/dist/showcase/KenBurns.svelte +105 -0
- package/dist/showcase/KenBurns.svelte.d.ts +13 -0
- package/dist/showcase/Marquee.svelte +89 -0
- package/dist/showcase/Marquee.svelte.d.ts +9 -0
- package/dist/showcase/ParallaxTilt.svelte +98 -0
- package/dist/showcase/ParallaxTilt.svelte.d.ts +10 -0
- package/dist/showcase/ScrambleText.svelte +98 -0
- package/dist/showcase/ScrambleText.svelte.d.ts +11 -0
- package/dist/showcase/ShineSweep.svelte +81 -0
- package/dist/showcase/ShineSweep.svelte.d.ts +9 -0
- package/dist/showcase/Terminal.svelte +230 -0
- package/dist/showcase/Terminal.svelte.d.ts +18 -0
- package/dist/showcase/TextSplitReveal.svelte +146 -0
- package/dist/showcase/TextSplitReveal.svelte.d.ts +13 -0
- package/dist/showcase/TextWave.svelte +55 -0
- package/dist/showcase/TextWave.svelte.d.ts +8 -0
- package/dist/showcase/TypewriterText.svelte +130 -0
- package/dist/showcase/TypewriterText.svelte.d.ts +9 -0
- package/dist/showcase/backdrop/GrainGradient.svelte +126 -0
- package/dist/showcase/backdrop/GrainGradient.svelte.d.ts +23 -0
- package/dist/showcase/backdrop/MeshGradient.svelte +104 -0
- package/dist/showcase/backdrop/MeshGradient.svelte.d.ts +20 -0
- package/dist/showcase/backdrop/Metaballs.svelte +116 -0
- package/dist/showcase/backdrop/Metaballs.svelte.d.ts +18 -0
- package/dist/showcase/backdrop/NeuroNoise.svelte +115 -0
- package/dist/showcase/backdrop/NeuroNoise.svelte.d.ts +20 -0
- package/dist/showcase/backdrop/ShowcaseBackdrop.svelte +48 -0
- package/dist/showcase/backdrop/ShowcaseBackdrop.svelte.d.ts +12 -0
- package/dist/showcase/generative/GenerativeBackdrop.svelte +234 -0
- package/dist/showcase/generative/GenerativeBackdrop.svelte.d.ts +9 -0
- package/dist/showcase/generative/intent.d.ts +7 -0
- package/dist/showcase/generative/intent.js +67 -0
- package/dist/showcase/generative/manifest.d.ts +9 -0
- package/dist/showcase/generative/manifest.js +97 -0
- package/dist/showcase/generative/types.d.ts +48 -0
- package/dist/showcase/generative/types.js +8 -0
- package/dist/showcase/index.d.ts +36 -0
- package/dist/showcase/index.js +46 -0
- package/dist/showcase/scroll/SmoothScroll.svelte +49 -0
- package/dist/showcase/scroll/SmoothScroll.svelte.d.ts +12 -0
- package/dist/showcase/scroll/scrollProgress.d.ts +24 -0
- package/dist/showcase/scroll/scrollProgress.js +65 -0
- package/dist/showcase/scroll/scrollReveal.d.ts +30 -0
- package/dist/showcase/scroll/scrollReveal.js +70 -0
- package/dist/stores/commandPalette.svelte.d.ts +24 -0
- package/dist/stores/commandPalette.svelte.js +82 -0
- package/dist/stores/confirmDialog.svelte.js +5 -5
- package/dist/stores/inputDialog.svelte.js +5 -5
- package/dist/stores/toast.svelte.d.ts +28 -0
- package/dist/stores/toast.svelte.js +33 -0
- package/dist/styles/motion.css +46 -0
- package/dist/styles/tokens.css +31 -0
- package/dist/transitions/glide.d.ts +31 -0
- package/dist/transitions/glide.js +58 -0
- 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 +4 -2
- package/dist/utils/daisyuiColors.js +27 -25
- package/dist/utils/dateFormatters.d.ts +20 -0
- package/dist/utils/dateFormatters.js +65 -44
- package/dist/utils/googleMapsLoader.js +100 -46
- package/dist/utils/mentionParser.js +30 -30
- package/dist/utils/phone.js +27 -21
- package/dist/utils/phoneFormat.js +9 -9
- package/dist/utils/sound.d.ts +6 -0
- package/dist/utils/sound.js +113 -0
- package/dist/utils/splitText.d.ts +25 -0
- package/dist/utils/splitText.js +94 -0
- package/dist/utils/taskUtils.js +1 -1
- package/dist/utils/themeWipe.d.ts +21 -0
- package/dist/utils/themeWipe.js +94 -0
- package/dist/utils/viewTransition.d.ts +23 -0
- package/dist/utils/viewTransition.js +75 -0
- package/package.json +56 -4
package/dist/types/messaging.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Messaging System Types
|
|
2
2
|
// Generic types for messaging UI components — no framework or backend dependencies
|
|
3
3
|
// ─── Emoji Data Constants ─────────────────────────────────────────────
|
|
4
|
-
export
|
|
4
|
+
export var EMOJI_CATEGORIES = [
|
|
5
5
|
{ id: 'search', name: 'Search', icon: '🔍', description: 'Search results' },
|
|
6
6
|
{
|
|
7
7
|
id: 'frequently_used',
|
|
@@ -59,7 +59,7 @@ export const EMOJI_CATEGORIES = [
|
|
|
59
59
|
description: 'Organization custom emojis'
|
|
60
60
|
}
|
|
61
61
|
];
|
|
62
|
-
export
|
|
62
|
+
export var SKIN_TONES = [
|
|
63
63
|
{ id: 'default', name: 'Default', unicode: '', preview: '👋' },
|
|
64
64
|
{ id: 'light', name: 'Light', unicode: '🏻', preview: '👋🏻' },
|
|
65
65
|
{ id: 'medium-light', name: 'Medium Light', unicode: '🏼', preview: '👋🏼' },
|
|
@@ -68,7 +68,7 @@ export const SKIN_TONES = [
|
|
|
68
68
|
{ id: 'dark', name: 'Dark', unicode: '🏿', preview: '👋🏿' }
|
|
69
69
|
];
|
|
70
70
|
// Default quick-reaction emojis (used when no user preferences available)
|
|
71
|
-
export
|
|
71
|
+
export var DEFAULT_QUICK_REACTIONS = [
|
|
72
72
|
{
|
|
73
73
|
unicode: '👍',
|
|
74
74
|
name: 'Thumbs Up',
|
package/dist/types/pipeline.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
// ─── Core Stage/Column Types ───
|
|
2
2
|
// ─── Defaults ───
|
|
3
|
-
export
|
|
3
|
+
export var DEFAULT_DRAG_CONFIG = {
|
|
4
4
|
enabled: true,
|
|
5
5
|
flipDurationMs: 200,
|
|
6
6
|
dropTargetClass: 'outline-dashed outline-2 outline-base-content/20'
|
|
7
7
|
};
|
|
8
|
-
export
|
|
8
|
+
export var DEFAULT_PIPELINE_CONFIG = {
|
|
9
9
|
views: ['kanban'],
|
|
10
10
|
defaultView: 'kanban',
|
|
11
11
|
drag: DEFAULT_DRAG_CONFIG,
|
package/dist/utils/currency.js
CHANGED
|
@@ -5,10 +5,12 @@
|
|
|
5
5
|
* Format a number as USD currency string.
|
|
6
6
|
* Override locale/currency by passing options.
|
|
7
7
|
*/
|
|
8
|
-
export function formatCurrency(amount, locale
|
|
8
|
+
export function formatCurrency(amount, locale, currency) {
|
|
9
|
+
if (locale === void 0) { locale = 'en-US'; }
|
|
10
|
+
if (currency === void 0) { currency = 'USD'; }
|
|
9
11
|
return new Intl.NumberFormat(locale, {
|
|
10
12
|
style: 'currency',
|
|
11
|
-
currency,
|
|
13
|
+
currency: currency,
|
|
12
14
|
minimumFractionDigits: 2,
|
|
13
15
|
maximumFractionDigits: 2
|
|
14
16
|
}).format(amount);
|
|
@@ -4,15 +4,15 @@
|
|
|
4
4
|
* Reads --color-* custom properties at runtime so any custom DaisyUI theme
|
|
5
5
|
* works correctly. SSR-safe: falls back to transparent/black when window is absent.
|
|
6
6
|
*/
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
var colorCache = new Map();
|
|
8
|
+
var themeObserver = null;
|
|
9
9
|
function resolveViaDOM(colorName) {
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
var el = document.documentElement;
|
|
11
|
+
var raw = getComputedStyle(el).getPropertyValue("--color-".concat(colorName)).trim();
|
|
12
12
|
if (raw)
|
|
13
13
|
return raw;
|
|
14
14
|
// DaisyUI v4 used shortened oklch channel vars (e.g. --p); try that form
|
|
15
|
-
|
|
15
|
+
var shortMap = {
|
|
16
16
|
primary: '--p',
|
|
17
17
|
'primary-content': '--pc',
|
|
18
18
|
secondary: '--s',
|
|
@@ -34,11 +34,11 @@ function resolveViaDOM(colorName) {
|
|
|
34
34
|
error: '--er',
|
|
35
35
|
'error-content': '--erc',
|
|
36
36
|
};
|
|
37
|
-
|
|
37
|
+
var shortVar = shortMap[colorName];
|
|
38
38
|
if (shortVar) {
|
|
39
|
-
|
|
39
|
+
var shortRaw = getComputedStyle(el).getPropertyValue(shortVar).trim();
|
|
40
40
|
if (shortRaw)
|
|
41
|
-
return
|
|
41
|
+
return "oklch(".concat(shortRaw, ")");
|
|
42
42
|
}
|
|
43
43
|
return 'oklch(0.5 0 0)';
|
|
44
44
|
}
|
|
@@ -52,23 +52,25 @@ export function getDaisyUIColor(colorName) {
|
|
|
52
52
|
if (colorCache.has(colorName)) {
|
|
53
53
|
return colorCache.get(colorName);
|
|
54
54
|
}
|
|
55
|
-
|
|
55
|
+
var resolved = resolveViaDOM(colorName);
|
|
56
56
|
colorCache.set(colorName, resolved);
|
|
57
57
|
return resolved;
|
|
58
58
|
}
|
|
59
59
|
/**
|
|
60
60
|
* Create a lighter version of a color using color-mix (works with hex and oklch).
|
|
61
61
|
*/
|
|
62
|
-
export function lightenColor(color, amount
|
|
63
|
-
|
|
64
|
-
|
|
62
|
+
export function lightenColor(color, amount) {
|
|
63
|
+
if (amount === void 0) { amount = 0.2; }
|
|
64
|
+
var pct = Math.round(amount * 100);
|
|
65
|
+
return "color-mix(in oklch, white ".concat(pct, "%, ").concat(color, ")");
|
|
65
66
|
}
|
|
66
67
|
/**
|
|
67
68
|
* Create a darker version of a color using color-mix.
|
|
68
69
|
*/
|
|
69
|
-
export function darkenColor(color, amount
|
|
70
|
-
|
|
71
|
-
|
|
70
|
+
export function darkenColor(color, amount) {
|
|
71
|
+
if (amount === void 0) { amount = 0.2; }
|
|
72
|
+
var pct = Math.round(amount * 100);
|
|
73
|
+
return "color-mix(in oklch, black ".concat(pct, "%, ").concat(color, ")");
|
|
72
74
|
}
|
|
73
75
|
/**
|
|
74
76
|
* Setup theme change detection.
|
|
@@ -78,9 +80,9 @@ export function watchThemeChanges(onThemeChange) {
|
|
|
78
80
|
if (themeObserver) {
|
|
79
81
|
themeObserver.disconnect();
|
|
80
82
|
}
|
|
81
|
-
themeObserver = new MutationObserver((mutations)
|
|
82
|
-
|
|
83
|
-
mutations.forEach((mutation)
|
|
83
|
+
themeObserver = new MutationObserver(function (mutations) {
|
|
84
|
+
var themeChanged = false;
|
|
85
|
+
mutations.forEach(function (mutation) {
|
|
84
86
|
if (mutation.type === 'attributes' &&
|
|
85
87
|
(mutation.attributeName === 'data-theme' ||
|
|
86
88
|
mutation.attributeName === 'class')) {
|
|
@@ -98,7 +100,7 @@ export function watchThemeChanges(onThemeChange) {
|
|
|
98
100
|
attributes: true,
|
|
99
101
|
attributeFilter: ['data-theme', 'class'],
|
|
100
102
|
});
|
|
101
|
-
return ()
|
|
103
|
+
return function () {
|
|
102
104
|
if (themeObserver) {
|
|
103
105
|
themeObserver.disconnect();
|
|
104
106
|
themeObserver = null;
|
|
@@ -112,25 +114,25 @@ export function watchThemeChanges(onThemeChange) {
|
|
|
112
114
|
export function isDarkTheme() {
|
|
113
115
|
if (typeof window === 'undefined')
|
|
114
116
|
return false;
|
|
115
|
-
|
|
116
|
-
|
|
117
|
+
var baseContent = getDaisyUIColor('base-content');
|
|
118
|
+
var base100 = getDaisyUIColor('base-100');
|
|
117
119
|
return getLuminance(baseContent) > getLuminance(base100);
|
|
118
120
|
}
|
|
119
121
|
function getLuminance(color) {
|
|
120
122
|
// Resolve via a temporary off-screen canvas pixel
|
|
121
|
-
|
|
123
|
+
var canvas = document.createElement('canvas');
|
|
122
124
|
canvas.width = 1;
|
|
123
125
|
canvas.height = 1;
|
|
124
|
-
|
|
126
|
+
var ctx = canvas.getContext('2d');
|
|
125
127
|
if (!ctx)
|
|
126
128
|
return 0.5;
|
|
127
129
|
try {
|
|
128
130
|
ctx.fillStyle = color;
|
|
129
131
|
ctx.fillRect(0, 0, 1, 1);
|
|
130
|
-
|
|
132
|
+
var _a = ctx.getImageData(0, 0, 1, 1).data, r = _a[0], g = _a[1], b = _a[2];
|
|
131
133
|
return (r * 299 + g * 587 + b * 114) / (1000 * 255);
|
|
132
134
|
}
|
|
133
|
-
catch {
|
|
135
|
+
catch (_b) {
|
|
134
136
|
return 0.5;
|
|
135
137
|
}
|
|
136
138
|
}
|
|
@@ -67,3 +67,23 @@ export declare function taskAge(dateStr: string): {
|
|
|
67
67
|
label: string;
|
|
68
68
|
color: string;
|
|
69
69
|
};
|
|
70
|
+
export type PacingLevel = 'fresh' | 'aging' | 'stale';
|
|
71
|
+
export interface PacingResult {
|
|
72
|
+
level: PacingLevel;
|
|
73
|
+
color: string;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Generic 3-state pacing color: green while fresh, amber once aging past
|
|
77
|
+
* `warnAtSeconds`, red once stale past `alertAtSeconds`. Unlike taskAge()
|
|
78
|
+
* above (a fixed day-scale gradient for task rows), this takes caller-supplied
|
|
79
|
+
* thresholds so it works at any timescale — a stalled agent turn ages in
|
|
80
|
+
* seconds, an unanswered review ages in minutes, a stale ticket ages in days.
|
|
81
|
+
*
|
|
82
|
+
* Use this for "how long has X been in state Y, should I be concerned yet"
|
|
83
|
+
* anywhere a viewer currently has to read a raw duration to judge urgency.
|
|
84
|
+
*
|
|
85
|
+
* Usage:
|
|
86
|
+
* const pacing = pacingColor(elapsedSeconds, 30, 120)
|
|
87
|
+
* // <span style="color: {pacing.color}">{elapsedSeconds}s</span>
|
|
88
|
+
*/
|
|
89
|
+
export declare function pacingColor(elapsedSeconds: number, warnAtSeconds: number, alertAtSeconds: number): PacingResult;
|
|
@@ -30,8 +30,8 @@ export function parseTimestamp(timestamp) {
|
|
|
30
30
|
return null;
|
|
31
31
|
if (timestamp instanceof Date)
|
|
32
32
|
return isNaN(timestamp.getTime()) ? null : timestamp;
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
var normalized = normalizeTimestamp(timestamp);
|
|
34
|
+
var date = new Date(normalized);
|
|
35
35
|
return isNaN(date.getTime()) ? null : date;
|
|
36
36
|
}
|
|
37
37
|
/**
|
|
@@ -41,30 +41,30 @@ export function parseTimestamp(timestamp) {
|
|
|
41
41
|
export function formatRelativeTime(dateStr) {
|
|
42
42
|
if (!dateStr)
|
|
43
43
|
return '-';
|
|
44
|
-
|
|
44
|
+
var date = parseTimestamp(dateStr);
|
|
45
45
|
if (!date)
|
|
46
46
|
return '-';
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
47
|
+
var now = new Date();
|
|
48
|
+
var diffMs = now.getTime() - date.getTime();
|
|
49
|
+
var diffMins = Math.floor(diffMs / (1000 * 60));
|
|
50
|
+
var diffHours = Math.floor(diffMs / (1000 * 60 * 60));
|
|
51
|
+
var diffDays = Math.floor(diffMs / (1000 * 60 * 60 * 24));
|
|
52
|
+
var diffWeeks = Math.floor(diffDays / 7);
|
|
53
|
+
var diffMonths = Math.floor(diffDays / 30);
|
|
54
|
+
var diffYears = Math.floor(diffDays / 365);
|
|
55
55
|
if (diffMins < 1)
|
|
56
56
|
return 'now';
|
|
57
57
|
if (diffMins < 60)
|
|
58
|
-
return
|
|
58
|
+
return "".concat(diffMins, "m");
|
|
59
59
|
if (diffHours < 24)
|
|
60
|
-
return
|
|
60
|
+
return "".concat(diffHours, "h");
|
|
61
61
|
if (diffDays < 7)
|
|
62
|
-
return
|
|
62
|
+
return "".concat(diffDays, "d");
|
|
63
63
|
if (diffWeeks < 4)
|
|
64
|
-
return
|
|
64
|
+
return "".concat(diffWeeks, "w");
|
|
65
65
|
if (diffMonths < 12)
|
|
66
|
-
return
|
|
67
|
-
return
|
|
66
|
+
return "".concat(diffMonths, "mo");
|
|
67
|
+
return "".concat(diffYears, "y");
|
|
68
68
|
}
|
|
69
69
|
/**
|
|
70
70
|
* Format full date and time for tooltips and detailed views.
|
|
@@ -72,7 +72,7 @@ export function formatRelativeTime(dateStr) {
|
|
|
72
72
|
export function formatFullDate(dateStr) {
|
|
73
73
|
if (!dateStr)
|
|
74
74
|
return '';
|
|
75
|
-
|
|
75
|
+
var date = parseTimestamp(dateStr);
|
|
76
76
|
if (!date)
|
|
77
77
|
return '';
|
|
78
78
|
return date.toLocaleString('en-US', {
|
|
@@ -89,7 +89,7 @@ export function formatFullDate(dateStr) {
|
|
|
89
89
|
export function formatShortDate(dateStr) {
|
|
90
90
|
if (!dateStr)
|
|
91
91
|
return '';
|
|
92
|
-
|
|
92
|
+
var date = parseTimestamp(dateStr);
|
|
93
93
|
if (!date)
|
|
94
94
|
return '';
|
|
95
95
|
return date.toLocaleDateString('en-US', { month: 'short', day: 'numeric' });
|
|
@@ -101,21 +101,21 @@ export function formatShortDate(dateStr) {
|
|
|
101
101
|
export function formatLastActivity(timestamp) {
|
|
102
102
|
if (!timestamp)
|
|
103
103
|
return 'Never';
|
|
104
|
-
|
|
104
|
+
var date = parseTimestamp(timestamp);
|
|
105
105
|
if (!date)
|
|
106
106
|
return 'Never';
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
107
|
+
var now = new Date();
|
|
108
|
+
var diffMs = now.getTime() - date.getTime();
|
|
109
|
+
var diffMins = Math.floor(diffMs / 60000);
|
|
110
|
+
var diffHours = Math.floor(diffMs / 3600000);
|
|
111
|
+
var diffDays = Math.floor(diffMs / 86400000);
|
|
112
112
|
if (diffMins < 1)
|
|
113
113
|
return 'Just now';
|
|
114
114
|
if (diffMins < 60)
|
|
115
|
-
return
|
|
115
|
+
return "".concat(diffMins, "m ago");
|
|
116
116
|
if (diffHours < 24)
|
|
117
|
-
return
|
|
118
|
-
return
|
|
117
|
+
return "".concat(diffHours, "h ago");
|
|
118
|
+
return "".concat(diffDays, "d ago");
|
|
119
119
|
}
|
|
120
120
|
/**
|
|
121
121
|
* Format date for display (simple locale string).
|
|
@@ -123,7 +123,7 @@ export function formatLastActivity(timestamp) {
|
|
|
123
123
|
export function formatDate(dateString) {
|
|
124
124
|
if (!dateString)
|
|
125
125
|
return 'N/A';
|
|
126
|
-
|
|
126
|
+
var date = parseTimestamp(dateString);
|
|
127
127
|
if (!date)
|
|
128
128
|
return 'N/A';
|
|
129
129
|
return date.toLocaleString();
|
|
@@ -134,7 +134,7 @@ export function formatDate(dateString) {
|
|
|
134
134
|
export function getTimeSinceMs(timestamp) {
|
|
135
135
|
if (!timestamp)
|
|
136
136
|
return Infinity;
|
|
137
|
-
|
|
137
|
+
var date = parseTimestamp(timestamp);
|
|
138
138
|
if (!date)
|
|
139
139
|
return Infinity;
|
|
140
140
|
return Date.now() - date.getTime();
|
|
@@ -158,7 +158,7 @@ export function isWithinMinutes(timestamp, minutes) {
|
|
|
158
158
|
export function formatDateTime(dateStr) {
|
|
159
159
|
if (!dateStr)
|
|
160
160
|
return '';
|
|
161
|
-
|
|
161
|
+
var date = parseTimestamp(dateStr);
|
|
162
162
|
if (!date)
|
|
163
163
|
return '';
|
|
164
164
|
return date.toLocaleString(undefined, {
|
|
@@ -178,22 +178,43 @@ export function formatDateTime(dateStr) {
|
|
|
178
178
|
* // <span style="color: {age.color}">{age.label}</span>
|
|
179
179
|
*/
|
|
180
180
|
export function taskAge(dateStr) {
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
181
|
+
var now = Date.now();
|
|
182
|
+
var created = new Date(dateStr).getTime();
|
|
183
|
+
var minutes = Math.floor((now - created) / 60000);
|
|
184
|
+
var hours = Math.floor(minutes / 60);
|
|
185
|
+
var days = Math.floor(hours / 24);
|
|
186
|
+
var weeks = Math.floor(days / 7);
|
|
187
|
+
var months = Math.floor(days / 30);
|
|
188
188
|
if (minutes < 60)
|
|
189
|
-
return { label:
|
|
189
|
+
return { label: "".concat(minutes, "m"), color: 'oklch(0.75 0.18 145)' }; // green — fresh
|
|
190
190
|
if (hours < 24)
|
|
191
|
-
return { label:
|
|
191
|
+
return { label: "".concat(hours, "h"), color: 'oklch(0.75 0.18 145)' }; // green
|
|
192
192
|
if (days < 3)
|
|
193
|
-
return { label:
|
|
193
|
+
return { label: "".concat(days, "d"), color: 'oklch(0.70 0.15 200)' }; // blue — recent
|
|
194
194
|
if (days < 7)
|
|
195
|
-
return { label:
|
|
195
|
+
return { label: "".concat(days, "d"), color: 'oklch(0.75 0.15 85)' }; // amber — aging
|
|
196
196
|
if (weeks < 4)
|
|
197
|
-
return { label:
|
|
198
|
-
return { label:
|
|
197
|
+
return { label: "".concat(weeks, "w"), color: 'oklch(0.65 0.18 50)' }; // orange — stale
|
|
198
|
+
return { label: "".concat(months, "mo"), color: 'oklch(0.65 0.20 25)' }; // red — old
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* Generic 3-state pacing color: green while fresh, amber once aging past
|
|
202
|
+
* `warnAtSeconds`, red once stale past `alertAtSeconds`. Unlike taskAge()
|
|
203
|
+
* above (a fixed day-scale gradient for task rows), this takes caller-supplied
|
|
204
|
+
* thresholds so it works at any timescale — a stalled agent turn ages in
|
|
205
|
+
* seconds, an unanswered review ages in minutes, a stale ticket ages in days.
|
|
206
|
+
*
|
|
207
|
+
* Use this for "how long has X been in state Y, should I be concerned yet"
|
|
208
|
+
* anywhere a viewer currently has to read a raw duration to judge urgency.
|
|
209
|
+
*
|
|
210
|
+
* Usage:
|
|
211
|
+
* const pacing = pacingColor(elapsedSeconds, 30, 120)
|
|
212
|
+
* // <span style="color: {pacing.color}">{elapsedSeconds}s</span>
|
|
213
|
+
*/
|
|
214
|
+
export function pacingColor(elapsedSeconds, warnAtSeconds, alertAtSeconds) {
|
|
215
|
+
if (elapsedSeconds >= alertAtSeconds)
|
|
216
|
+
return { level: 'stale', color: 'oklch(0.65 0.20 25)' }; // red
|
|
217
|
+
if (elapsedSeconds >= warnAtSeconds)
|
|
218
|
+
return { level: 'aging', color: 'oklch(0.75 0.15 85)' }; // amber
|
|
219
|
+
return { level: 'fresh', color: 'oklch(0.75 0.18 145)' }; // green
|
|
199
220
|
}
|
|
@@ -8,60 +8,114 @@
|
|
|
8
8
|
* await loadGoogleMapsAPI({ apiKey: 'YOUR_KEY', libraries: ['marker', 'geometry'] })
|
|
9
9
|
* if (isGoogleMapsLoaded()) { ... }
|
|
10
10
|
*/
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
11
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
12
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
13
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
14
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
15
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
16
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
17
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
18
|
+
});
|
|
19
|
+
};
|
|
20
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
21
|
+
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);
|
|
22
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
23
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
24
|
+
function step(op) {
|
|
25
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
26
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
27
|
+
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;
|
|
28
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
29
|
+
switch (op[0]) {
|
|
30
|
+
case 0: case 1: t = op; break;
|
|
31
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
32
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
33
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
29
34
|
default:
|
|
30
|
-
|
|
35
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
36
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
37
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
38
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
39
|
+
if (t[2]) _.ops.pop();
|
|
40
|
+
_.trys.pop(); continue;
|
|
31
41
|
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
42
|
+
op = body.call(thisArg, _);
|
|
43
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
44
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
48
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
49
|
+
if (ar || !(i in from)) {
|
|
50
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
51
|
+
ar[i] = from[i];
|
|
52
|
+
}
|
|
35
53
|
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
54
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
55
|
+
};
|
|
56
|
+
var loadPromise = null;
|
|
57
|
+
var isLoaded = false;
|
|
58
|
+
export function loadGoogleMapsAPI(options) {
|
|
59
|
+
return __awaiter(this, void 0, Promise, function () {
|
|
60
|
+
var apiKey, _a, libraries, allLibrariesAvailable, allLibraries;
|
|
61
|
+
var _b;
|
|
62
|
+
return __generator(this, function (_c) {
|
|
63
|
+
if (typeof window === 'undefined')
|
|
64
|
+
return [2 /*return*/];
|
|
65
|
+
apiKey = options.apiKey, _a = options.libraries, libraries = _a === void 0 ? [] : _a;
|
|
66
|
+
if (!apiKey) {
|
|
67
|
+
console.warn('googleMapsLoader: No API key provided');
|
|
68
|
+
return [2 /*return*/];
|
|
69
|
+
}
|
|
70
|
+
// If already loaded and all required libraries are available, return
|
|
71
|
+
if (isLoaded && ((_b = window.google) === null || _b === void 0 ? void 0 : _b.maps)) {
|
|
72
|
+
allLibrariesAvailable = libraries.every(function (lib) {
|
|
73
|
+
var _a, _b, _c, _d;
|
|
74
|
+
switch (lib) {
|
|
75
|
+
case 'places':
|
|
76
|
+
return (_b = (_a = window.google) === null || _a === void 0 ? void 0 : _a.maps) === null || _b === void 0 ? void 0 : _b.places;
|
|
77
|
+
case 'geometry':
|
|
78
|
+
return (_d = (_c = window.google) === null || _c === void 0 ? void 0 : _c.maps) === null || _d === void 0 ? void 0 : _d.geometry;
|
|
79
|
+
default:
|
|
80
|
+
return true;
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
if (allLibrariesAvailable)
|
|
84
|
+
return [2 /*return*/];
|
|
85
|
+
}
|
|
86
|
+
// If already loading, return the existing promise
|
|
87
|
+
if (loadPromise)
|
|
88
|
+
return [2 /*return*/, loadPromise];
|
|
89
|
+
allLibraries = Array.from(new Set(__spreadArray(['geometry', 'places', 'marker'], libraries, true)));
|
|
90
|
+
loadPromise = new Promise(function (resolve, reject) {
|
|
91
|
+
var script = document.createElement('script');
|
|
92
|
+
script.src = "https://maps.googleapis.com/maps/api/js?key=".concat(apiKey, "&libraries=").concat(allLibraries.join(','));
|
|
93
|
+
script.async = true;
|
|
94
|
+
script.defer = true;
|
|
95
|
+
script.onload = function () {
|
|
96
|
+
isLoaded = true;
|
|
97
|
+
loadPromise = null;
|
|
98
|
+
resolve();
|
|
99
|
+
};
|
|
100
|
+
script.onerror = function (error) {
|
|
101
|
+
loadPromise = null;
|
|
102
|
+
reject(error);
|
|
103
|
+
};
|
|
104
|
+
document.head.appendChild(script);
|
|
105
|
+
});
|
|
106
|
+
return [2 /*return*/, loadPromise];
|
|
107
|
+
});
|
|
56
108
|
});
|
|
57
|
-
return loadPromise;
|
|
58
109
|
}
|
|
59
110
|
export function isGoogleMapsLoaded() {
|
|
60
|
-
|
|
111
|
+
var _a;
|
|
112
|
+
return isLoaded && !!((_a = window.google) === null || _a === void 0 ? void 0 : _a.maps);
|
|
61
113
|
}
|
|
62
114
|
export function isPlacesLoaded() {
|
|
63
|
-
|
|
115
|
+
var _a, _b;
|
|
116
|
+
return isGoogleMapsLoaded() && !!((_b = (_a = window.google) === null || _a === void 0 ? void 0 : _a.maps) === null || _b === void 0 ? void 0 : _b.places);
|
|
64
117
|
}
|
|
65
118
|
export function isGeometryLoaded() {
|
|
66
|
-
|
|
119
|
+
var _a, _b;
|
|
120
|
+
return isGoogleMapsLoaded() && !!((_b = (_a = window.google) === null || _a === void 0 ? void 0 : _a.maps) === null || _b === void 0 ? void 0 : _b.geometry);
|
|
67
121
|
}
|