@datum-cloud/datum-ui 1.6.0 → 1.7.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/dist/app-navigation/index.mjs +2 -2
- package/dist/{app-navigation--mry98XV.mjs → app-navigation-CNig4Maj.mjs} +32 -31
- package/dist/assistant/index.mjs +18 -13
- package/dist/autocomplete/index.mjs +1 -1
- package/dist/{autocomplete-G24AgvxU.mjs → autocomplete-DM6JYV4W.mjs} +1 -1
- package/dist/autosearch/index.mjs +4 -3
- package/dist/avatar-stack/index.mjs +1 -1
- package/dist/{avatar-stack-D1-BA7hA.mjs → avatar-stack-BZK6zUJr.mjs} +1 -1
- package/dist/{calendar-date-picker-C52Y05ZN.mjs → calendar-date-picker-AzvSqjeS.mjs} +6 -5
- package/dist/chart/index.mjs +1 -1
- package/dist/{chart-DeCrbcpY.mjs → chart-EgzTS28l.mjs} +6 -3
- package/dist/code-editor/index.mjs +1 -1
- package/dist/data-table/index.mjs +1 -1
- package/dist/{data-table-CfeovSJV.mjs → data-table-mByk373T.mjs} +11 -10
- package/dist/date-picker/index.mjs +3 -3
- package/dist/date-time-picker/index.mjs +1 -1
- package/dist/{date-time-picker-BbtA6JJJ.mjs → date-time-picker-D3-DeNo8.mjs} +1 -1
- package/dist/dropzone/index.mjs +1 -1
- package/dist/{dropzone-C_vA4q0u.mjs → dropzone-DrWVd7OI.mjs} +5 -3
- package/dist/empty-content/index.mjs +1 -1
- package/dist/{empty-content-BpS0PONb.mjs → empty-content-DvaelFpJ.mjs} +3 -2
- package/dist/form/adapters/rhf/index.mjs +6 -3
- package/dist/form/index.mjs +1 -1
- package/dist/form/stepper/index.mjs +23 -19
- package/dist/{form-2pTdgtYr.mjs → form-BUUNQfC9.mjs} +43 -34
- package/dist/grouped-table/index.mjs +1 -1
- package/dist/{grouped-table-CPF8Jijv.mjs → grouped-table-b2jDEPR6.mjs} +1 -1
- package/dist/index.mjs +26 -26
- package/dist/{layers-DJYz6fyE.mjs → layers-DWYdrGmC.mjs} +7 -3
- package/dist/logo/themed/index.mjs +1 -1
- package/dist/map/index.mjs +1 -1
- package/dist/more-actions/index.mjs +1 -1
- package/dist/{more-actions-G9hs0rpJ.mjs → more-actions-Bx443Ccx.mjs} +13 -12
- package/dist/multi-select/index.mjs +1 -1
- package/dist/{multi-select-DIWTdi0i.mjs → multi-select-PHaMEbY-.mjs} +1 -1
- package/dist/picker/index.mjs +1 -1
- package/dist/{picker-CRUSdzpo.mjs → picker-b5-x-EHs.mjs} +27 -22
- package/dist/rich-text-editor/index.mjs +1 -1
- package/dist/{rich-text-editor-DRIwcleW.mjs → rich-text-editor-CGuSn8xi.mjs} +1 -1
- package/dist/sidebar/index.mjs +1 -1
- package/dist/{sidebar-Df6Po0K8.mjs → sidebar-BRUNOqXi.mjs} +37 -36
- package/dist/stepper/index.mjs +1 -1
- package/dist/{stepper-DJkYcilu.mjs → stepper-dNvkipop.mjs} +2 -1
- package/dist/tag-input/index.mjs +1 -1
- package/dist/{tag-input-CSav22U5.mjs → tag-input-Ctxtcpwy.mjs} +37 -33
- package/dist/task-queue/index.mjs +1 -1
- package/dist/{task-queue-dropdown-DfdGiyfA.mjs → task-queue-dropdown-pqFd4rSf.mjs} +76 -75
- package/dist/theme/index.mjs +1 -1
- package/dist/{themes-BK5atywZ.mjs → themes-Ba2bajuF.mjs} +19 -17
- package/dist/time-picker/index.mjs +1 -1
- package/dist/{time-picker-Bgt6R1fU.mjs → time-picker-B_fN5vhO.mjs} +1 -1
- package/dist/{to-api-format-CgKtSuWO.mjs → to-api-format-43Boq7OR.mjs} +12 -8
- package/dist/tooltip/index.mjs +1 -1
- package/dist/{tooltip-BhatUaar.mjs → tooltip-C_SL1imw.mjs} +27 -23
- package/dist/{types-DrN0rei5.mjs → types-agDpVXBG.mjs} +5 -3
- package/dist/{use-option-picker-CV-9CyBV.mjs → use-option-picker-s2bUYwXC.mjs} +3 -2
- package/dist/utils/index.mjs +1 -1
- package/dist/{utils-U06Eu2KT.mjs → utils-CA4QEIJ8.mjs} +6 -2
- package/package.json +52 -52
|
@@ -4,7 +4,7 @@ import { t as Button } from "./button-CsdF61EI.mjs";
|
|
|
4
4
|
import { t as Icon } from "./icon-wrapper-DKfJlJd0.mjs";
|
|
5
5
|
import { t as Input } from "./input-j4tbmYYz.mjs";
|
|
6
6
|
import { a as SheetHeader, n as SheetContent, o as SheetTitle, r as SheetDescription, t as Sheet } from "./sheet-DXCZyMHI.mjs";
|
|
7
|
-
import { i as TooltipProvider, t as Tooltip } from "./tooltip-
|
|
7
|
+
import { i as TooltipProvider, t as Tooltip } from "./tooltip-C_SL1imw.mjs";
|
|
8
8
|
import { t as Skeleton } from "./skeleton-DFExK4GX.mjs";
|
|
9
9
|
import { cva } from "class-variance-authority";
|
|
10
10
|
import { PanelLeftCloseIcon, PanelLeftOpenIcon } from "lucide-react";
|
|
@@ -16,7 +16,7 @@ const MOBILE_BREAKPOINT = 768;
|
|
|
16
16
|
function useIsMobile() {
|
|
17
17
|
const [isMobile, setIsMobile] = React.useState(void 0);
|
|
18
18
|
React.useEffect(() => {
|
|
19
|
-
const mql = window.matchMedia(`(max-width:
|
|
19
|
+
const mql = window.matchMedia(`(max-width: 767px)`);
|
|
20
20
|
const onChange = () => {
|
|
21
21
|
setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
|
|
22
22
|
};
|
|
@@ -29,7 +29,7 @@ function useIsMobile() {
|
|
|
29
29
|
//#endregion
|
|
30
30
|
//#region src/components/base/sidebar/context.tsx
|
|
31
31
|
const SIDEBAR_COOKIE_NAME = "sidebar_state";
|
|
32
|
-
const SIDEBAR_COOKIE_MAX_AGE =
|
|
32
|
+
const SIDEBAR_COOKIE_MAX_AGE = 604800;
|
|
33
33
|
const SIDEBAR_WIDTH = "13rem";
|
|
34
34
|
const SIDEBAR_WIDTH_MOBILE = "18rem";
|
|
35
35
|
const SIDEBAR_WIDTH_ICON = "3rem";
|
|
@@ -152,40 +152,41 @@ function SidebarProvider({ defaultOpen = true, open: openProp, onOpenChange: set
|
|
|
152
152
|
return () => window.removeEventListener("keydown", handleKeyDown);
|
|
153
153
|
}, [toggleSidebar]);
|
|
154
154
|
const state = effectiveOpen ? "expanded" : "collapsed";
|
|
155
|
+
const contextValue = React.useMemo(() => ({
|
|
156
|
+
state,
|
|
157
|
+
open: effectiveOpen,
|
|
158
|
+
setOpen,
|
|
159
|
+
isMobile,
|
|
160
|
+
openMobile,
|
|
161
|
+
setOpenMobile,
|
|
162
|
+
toggleSidebar,
|
|
163
|
+
handleMouseEnter,
|
|
164
|
+
handleMouseLeave,
|
|
165
|
+
forceClose,
|
|
166
|
+
closeForNavigation,
|
|
167
|
+
hasSubLayout,
|
|
168
|
+
setHasSubLayout,
|
|
169
|
+
expandBehavior,
|
|
170
|
+
showBackdrop
|
|
171
|
+
}), [
|
|
172
|
+
state,
|
|
173
|
+
effectiveOpen,
|
|
174
|
+
setOpen,
|
|
175
|
+
isMobile,
|
|
176
|
+
openMobile,
|
|
177
|
+
setOpenMobile,
|
|
178
|
+
toggleSidebar,
|
|
179
|
+
handleMouseEnter,
|
|
180
|
+
handleMouseLeave,
|
|
181
|
+
forceClose,
|
|
182
|
+
closeForNavigation,
|
|
183
|
+
hasSubLayout,
|
|
184
|
+
setHasSubLayout,
|
|
185
|
+
expandBehavior,
|
|
186
|
+
showBackdrop
|
|
187
|
+
]);
|
|
155
188
|
return /* @__PURE__ */ jsx(SidebarContext, {
|
|
156
|
-
value:
|
|
157
|
-
state,
|
|
158
|
-
open: effectiveOpen,
|
|
159
|
-
setOpen,
|
|
160
|
-
isMobile,
|
|
161
|
-
openMobile,
|
|
162
|
-
setOpenMobile,
|
|
163
|
-
toggleSidebar,
|
|
164
|
-
handleMouseEnter,
|
|
165
|
-
handleMouseLeave,
|
|
166
|
-
forceClose,
|
|
167
|
-
closeForNavigation,
|
|
168
|
-
hasSubLayout,
|
|
169
|
-
setHasSubLayout,
|
|
170
|
-
expandBehavior,
|
|
171
|
-
showBackdrop
|
|
172
|
-
}), [
|
|
173
|
-
state,
|
|
174
|
-
effectiveOpen,
|
|
175
|
-
setOpen,
|
|
176
|
-
isMobile,
|
|
177
|
-
openMobile,
|
|
178
|
-
setOpenMobile,
|
|
179
|
-
toggleSidebar,
|
|
180
|
-
handleMouseEnter,
|
|
181
|
-
handleMouseLeave,
|
|
182
|
-
forceClose,
|
|
183
|
-
closeForNavigation,
|
|
184
|
-
hasSubLayout,
|
|
185
|
-
setHasSubLayout,
|
|
186
|
-
expandBehavior,
|
|
187
|
-
showBackdrop
|
|
188
|
-
]),
|
|
189
|
+
value: contextValue,
|
|
189
190
|
children: /* @__PURE__ */ jsx(TooltipProvider, {
|
|
190
191
|
delayDuration: 0,
|
|
191
192
|
children: /* @__PURE__ */ jsx("div", {
|
package/dist/stepper/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as defineStepper } from "../stepper-
|
|
1
|
+
import { t as defineStepper } from "../stepper-dNvkipop.mjs";
|
|
2
2
|
export { defineStepper };
|
|
@@ -175,12 +175,13 @@ function defineStepper(...steps) {
|
|
|
175
175
|
Stepper: {
|
|
176
176
|
...StepperizePrimitives,
|
|
177
177
|
Provider: ({ variant = "horizontal", labelOrientation = "horizontal", tracking = false, defaultStep, defaultData, children, className, ...props }) => {
|
|
178
|
+
const instanceId = React.useId();
|
|
178
179
|
return /* @__PURE__ */ jsx(StepperContext, {
|
|
179
180
|
value: {
|
|
180
181
|
variant,
|
|
181
182
|
labelOrientation,
|
|
182
183
|
tracking,
|
|
183
|
-
instanceId
|
|
184
|
+
instanceId
|
|
184
185
|
},
|
|
185
186
|
children: /* @__PURE__ */ jsx(StepperizeProvider, {
|
|
186
187
|
defaultStep,
|
package/dist/tag-input/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as TagsInput } from "../tag-input-
|
|
1
|
+
import { t as TagsInput } from "../tag-input-Ctxtcpwy.mjs";
|
|
2
2
|
export { TagsInput };
|
|
@@ -271,13 +271,16 @@ function useTagsInput({ value, onValueChange, maxItems, minItems, delimiters = D
|
|
|
271
271
|
const handleKeyDown = React.useCallback((e) => {
|
|
272
272
|
e.stopPropagation();
|
|
273
273
|
const moveNext = () => {
|
|
274
|
-
|
|
274
|
+
const nextIndex = activeIndex + 1 > value.length - 1 ? -1 : activeIndex + 1;
|
|
275
|
+
setActiveIndex(nextIndex);
|
|
275
276
|
};
|
|
276
277
|
const movePrev = () => {
|
|
277
|
-
|
|
278
|
+
const prevIndex = activeIndex - 1 < 0 ? value.length - 1 : activeIndex - 1;
|
|
279
|
+
setActiveIndex(prevIndex);
|
|
278
280
|
};
|
|
279
281
|
const moveCurrent = () => {
|
|
280
|
-
|
|
282
|
+
const newIndex = activeIndex - 1 <= 0 ? value.length - 1 === 0 ? -1 : 0 : activeIndex - 1;
|
|
283
|
+
setActiveIndex(newIndex);
|
|
281
284
|
};
|
|
282
285
|
const target = e.currentTarget;
|
|
283
286
|
switch (e.key) {
|
|
@@ -302,9 +305,11 @@ function useTagsInput({ value, onValueChange, maxItems, minItems, delimiters = D
|
|
|
302
305
|
}
|
|
303
306
|
}
|
|
304
307
|
break;
|
|
305
|
-
case "Escape":
|
|
306
|
-
|
|
308
|
+
case "Escape": {
|
|
309
|
+
const newIndex = activeIndex === -1 ? value.length - 1 : -1;
|
|
310
|
+
setActiveIndex(newIndex);
|
|
307
311
|
break;
|
|
312
|
+
}
|
|
308
313
|
case "Tab":
|
|
309
314
|
if (inputValue.trim() !== "") {
|
|
310
315
|
e.preventDefault();
|
|
@@ -312,13 +317,11 @@ function useTagsInput({ value, onValueChange, maxItems, minItems, delimiters = D
|
|
|
312
317
|
setInputValue("");
|
|
313
318
|
}
|
|
314
319
|
break;
|
|
315
|
-
default:
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
}
|
|
321
|
-
break;
|
|
320
|
+
default: if (delimiters.includes(e.key) && inputValue.trim() !== "") {
|
|
321
|
+
e.preventDefault();
|
|
322
|
+
addValue(inputValue);
|
|
323
|
+
setInputValue("");
|
|
324
|
+
}
|
|
322
325
|
}
|
|
323
326
|
}, [
|
|
324
327
|
activeIndex,
|
|
@@ -381,28 +384,29 @@ function TagsInput({ ref, value, onValueChange, placeholder, maxItems, minItems,
|
|
|
381
384
|
dir
|
|
382
385
|
});
|
|
383
386
|
const { inputValue, setInputValue, activeIndex, setActiveIndex, validationError, setValidationError } = input;
|
|
387
|
+
const contextValue = React.useMemo(() => ({
|
|
388
|
+
value,
|
|
389
|
+
onValueChange,
|
|
390
|
+
inputValue,
|
|
391
|
+
setInputValue,
|
|
392
|
+
activeIndex,
|
|
393
|
+
setActiveIndex,
|
|
394
|
+
validator,
|
|
395
|
+
validationError,
|
|
396
|
+
setValidationError
|
|
397
|
+
}), [
|
|
398
|
+
value,
|
|
399
|
+
onValueChange,
|
|
400
|
+
inputValue,
|
|
401
|
+
setInputValue,
|
|
402
|
+
activeIndex,
|
|
403
|
+
setActiveIndex,
|
|
404
|
+
validator,
|
|
405
|
+
validationError,
|
|
406
|
+
setValidationError
|
|
407
|
+
]);
|
|
384
408
|
return /* @__PURE__ */ jsxs(TagInputContext, {
|
|
385
|
-
value:
|
|
386
|
-
value,
|
|
387
|
-
onValueChange,
|
|
388
|
-
inputValue,
|
|
389
|
-
setInputValue,
|
|
390
|
-
activeIndex,
|
|
391
|
-
setActiveIndex,
|
|
392
|
-
validator,
|
|
393
|
-
validationError,
|
|
394
|
-
setValidationError
|
|
395
|
-
}), [
|
|
396
|
-
value,
|
|
397
|
-
onValueChange,
|
|
398
|
-
inputValue,
|
|
399
|
-
setInputValue,
|
|
400
|
-
activeIndex,
|
|
401
|
-
setActiveIndex,
|
|
402
|
-
validator,
|
|
403
|
-
validationError,
|
|
404
|
-
setValidationError
|
|
405
|
-
]),
|
|
409
|
+
value: contextValue,
|
|
406
410
|
children: [/* @__PURE__ */ jsxs("div", {
|
|
407
411
|
...props,
|
|
408
412
|
ref,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { _ as RedisTaskStorage, a as TaskPanelItem, b as createProjectMetadata, c as TaskPanelHeader, d as useCurrentScope, f as useTasksWithLabels, g as detectStorage, h as TaskQueue, i as TaskPanel, l as getContextLabel, m as TaskQueueProvider, n as TaskSummaryDialog, o as TaskPanelCounter, p as useTaskQueue, r as TaskQueueTrigger, s as TaskPanelActions, t as TaskQueueDropdown, u as matchesCurrentScope, v as LocalTaskStorage, x as createUserMetadata, y as createOrgMetadata } from "../task-queue-dropdown-
|
|
1
|
+
import { _ as RedisTaskStorage, a as TaskPanelItem, b as createProjectMetadata, c as TaskPanelHeader, d as useCurrentScope, f as useTasksWithLabels, g as detectStorage, h as TaskQueue, i as TaskPanel, l as getContextLabel, m as TaskQueueProvider, n as TaskSummaryDialog, o as TaskPanelCounter, p as useTaskQueue, r as TaskQueueTrigger, s as TaskPanelActions, t as TaskQueueDropdown, u as matchesCurrentScope, v as LocalTaskStorage, x as createUserMetadata, y as createOrgMetadata } from "../task-queue-dropdown-pqFd4rSf.mjs";
|
|
2
2
|
export { LocalTaskStorage, RedisTaskStorage, TaskPanel, TaskPanelActions, TaskPanelCounter, TaskPanelHeader, TaskPanelItem, TaskQueue, TaskQueueDropdown, TaskQueueProvider, TaskQueueTrigger, TaskSummaryDialog, createOrgMetadata, createProjectMetadata, createUserMetadata, detectStorage, getContextLabel, matchesCurrentScope, useCurrentScope, useTaskQueue, useTasksWithLabels };
|
|
@@ -5,84 +5,12 @@ import { t as Button } from "./button-A1qTjZ8U.mjs";
|
|
|
5
5
|
import { t as Icon } from "./icon-wrapper-DKfJlJd0.mjs";
|
|
6
6
|
import { t as Dialog } from "./dialog-N2pkQIc4.mjs";
|
|
7
7
|
import { t as ResponsiveDropdown } from "./responsive-dropdown-fCmduKaz.mjs";
|
|
8
|
-
import { a as TooltipTrigger, n as Tooltip, r as TooltipContent, t as Tooltip$1 } from "./tooltip-
|
|
8
|
+
import { a as TooltipTrigger, n as Tooltip, r as TooltipContent, t as Tooltip$1 } from "./tooltip-C_SL1imw.mjs";
|
|
9
9
|
import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "./table/index.mjs";
|
|
10
10
|
import { Ban, CheckCircle2, CircleAlert, CircleCheck, CornerDownRightIcon, FileIcon, ListTodo, X, XCircle } from "lucide-react";
|
|
11
11
|
import { createContext, use, useEffect, useMemo, useRef, useState, useSyncExternalStore } from "react";
|
|
12
12
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
13
13
|
import { formatDistanceToNowStrict } from "date-fns";
|
|
14
|
-
//#region src/components/features/task-queue/constants.ts
|
|
15
|
-
const TASK_QUEUE_DEFAULTS = {
|
|
16
|
-
concurrency: 3,
|
|
17
|
-
errorStrategy: "continue",
|
|
18
|
-
cancelable: true,
|
|
19
|
-
retryable: true
|
|
20
|
-
};
|
|
21
|
-
const TASK_STORAGE_KEY = "datum-task-queue";
|
|
22
|
-
//#endregion
|
|
23
|
-
//#region src/components/features/task-queue/utils/index.ts
|
|
24
|
-
/**
|
|
25
|
-
* Check if code is running in a browser environment.
|
|
26
|
-
* Used for SSR safety in storage and other browser-dependent code.
|
|
27
|
-
*/
|
|
28
|
-
function isBrowser() {
|
|
29
|
-
return typeof window !== "undefined" && typeof localStorage !== "undefined";
|
|
30
|
-
}
|
|
31
|
-
function generateTaskId() {
|
|
32
|
-
if (typeof crypto !== "undefined" && typeof crypto.randomUUID === "function") return `task_${crypto.randomUUID()}`;
|
|
33
|
-
return `task_${Date.now()}_${Math.random().toString(36).slice(2, 9)}`;
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* Extract an ID from an item using common patterns.
|
|
37
|
-
* Checks: primitives (string/number) → obj.id → obj.name → obj.key → obj.uuid
|
|
38
|
-
*/
|
|
39
|
-
function extractItemId(item) {
|
|
40
|
-
if (typeof item === "string" || typeof item === "number") return String(item);
|
|
41
|
-
if (item && typeof item === "object") {
|
|
42
|
-
const obj = item;
|
|
43
|
-
if (typeof obj.id === "string" || typeof obj.id === "number") return String(obj.id);
|
|
44
|
-
if (typeof obj.name === "string") return obj.name;
|
|
45
|
-
if (typeof obj.key === "string") return obj.key;
|
|
46
|
-
if (typeof obj.uuid === "string") return obj.uuid;
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* Create metadata for project-scoped tasks.
|
|
51
|
-
* Use this when enqueueing tasks that operate on project resources.
|
|
52
|
-
*/
|
|
53
|
-
function createProjectMetadata(project, org, extra) {
|
|
54
|
-
return {
|
|
55
|
-
scope: "project",
|
|
56
|
-
projectId: project.id,
|
|
57
|
-
projectName: project.name,
|
|
58
|
-
orgId: org.id,
|
|
59
|
-
orgName: org.name,
|
|
60
|
-
...extra
|
|
61
|
-
};
|
|
62
|
-
}
|
|
63
|
-
/**
|
|
64
|
-
* Create metadata for organization-scoped tasks.
|
|
65
|
-
* Use this when enqueueing tasks that operate on org-level resources.
|
|
66
|
-
*/
|
|
67
|
-
function createOrgMetadata(org, extra) {
|
|
68
|
-
return {
|
|
69
|
-
scope: "org",
|
|
70
|
-
orgId: org.id,
|
|
71
|
-
orgName: org.name,
|
|
72
|
-
...extra
|
|
73
|
-
};
|
|
74
|
-
}
|
|
75
|
-
/**
|
|
76
|
-
* Create metadata for user-scoped tasks.
|
|
77
|
-
* Use this when enqueueing tasks that operate on user-level resources.
|
|
78
|
-
*/
|
|
79
|
-
function createUserMetadata(extra) {
|
|
80
|
-
return {
|
|
81
|
-
scope: "user",
|
|
82
|
-
...extra
|
|
83
|
-
};
|
|
84
|
-
}
|
|
85
|
-
//#endregion
|
|
86
14
|
//#region src/components/features/task-queue/engine/executor.ts
|
|
87
15
|
/**
|
|
88
16
|
* Shallow-clone a task into an engine-local working copy.
|
|
@@ -196,6 +124,78 @@ async function executeTask(inputTask, processor, callbacks) {
|
|
|
196
124
|
};
|
|
197
125
|
}
|
|
198
126
|
//#endregion
|
|
127
|
+
//#region src/components/features/task-queue/constants.ts
|
|
128
|
+
const TASK_QUEUE_DEFAULTS = {
|
|
129
|
+
concurrency: 3,
|
|
130
|
+
errorStrategy: "continue",
|
|
131
|
+
cancelable: true,
|
|
132
|
+
retryable: true
|
|
133
|
+
};
|
|
134
|
+
const TASK_STORAGE_KEY = "datum-task-queue";
|
|
135
|
+
//#endregion
|
|
136
|
+
//#region src/components/features/task-queue/utils/index.ts
|
|
137
|
+
/**
|
|
138
|
+
* Check if code is running in a browser environment.
|
|
139
|
+
* Used for SSR safety in storage and other browser-dependent code.
|
|
140
|
+
*/
|
|
141
|
+
function isBrowser() {
|
|
142
|
+
return typeof window !== "undefined" && typeof localStorage !== "undefined";
|
|
143
|
+
}
|
|
144
|
+
function generateTaskId() {
|
|
145
|
+
if (typeof crypto !== "undefined" && typeof crypto.randomUUID === "function") return `task_${crypto.randomUUID()}`;
|
|
146
|
+
return `task_${Date.now()}_${Math.random().toString(36).slice(2, 9)}`;
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Extract an ID from an item using common patterns.
|
|
150
|
+
* Checks: primitives (string/number) → obj.id → obj.name → obj.key → obj.uuid
|
|
151
|
+
*/
|
|
152
|
+
function extractItemId(item) {
|
|
153
|
+
if (typeof item === "string" || typeof item === "number") return String(item);
|
|
154
|
+
if (item && typeof item === "object") {
|
|
155
|
+
const obj = item;
|
|
156
|
+
if (typeof obj.id === "string" || typeof obj.id === "number") return String(obj.id);
|
|
157
|
+
if (typeof obj.name === "string") return obj.name;
|
|
158
|
+
if (typeof obj.key === "string") return obj.key;
|
|
159
|
+
if (typeof obj.uuid === "string") return obj.uuid;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* Create metadata for project-scoped tasks.
|
|
164
|
+
* Use this when enqueueing tasks that operate on project resources.
|
|
165
|
+
*/
|
|
166
|
+
function createProjectMetadata(project, org, extra) {
|
|
167
|
+
return {
|
|
168
|
+
scope: "project",
|
|
169
|
+
projectId: project.id,
|
|
170
|
+
projectName: project.name,
|
|
171
|
+
orgId: org.id,
|
|
172
|
+
orgName: org.name,
|
|
173
|
+
...extra
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* Create metadata for organization-scoped tasks.
|
|
178
|
+
* Use this when enqueueing tasks that operate on org-level resources.
|
|
179
|
+
*/
|
|
180
|
+
function createOrgMetadata(org, extra) {
|
|
181
|
+
return {
|
|
182
|
+
scope: "org",
|
|
183
|
+
orgId: org.id,
|
|
184
|
+
orgName: org.name,
|
|
185
|
+
...extra
|
|
186
|
+
};
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* Create metadata for user-scoped tasks.
|
|
190
|
+
* Use this when enqueueing tasks that operate on user-level resources.
|
|
191
|
+
*/
|
|
192
|
+
function createUserMetadata(extra) {
|
|
193
|
+
return {
|
|
194
|
+
scope: "user",
|
|
195
|
+
...extra
|
|
196
|
+
};
|
|
197
|
+
}
|
|
198
|
+
//#endregion
|
|
199
199
|
//#region src/components/features/task-queue/engine/storage/serialize.ts
|
|
200
200
|
/**
|
|
201
201
|
* Strip a task down to its JSON-serializable fields before persisting.
|
|
@@ -301,7 +301,7 @@ var MemoryTaskStorage = class {
|
|
|
301
301
|
};
|
|
302
302
|
//#endregion
|
|
303
303
|
//#region src/components/features/task-queue/engine/storage/redis-storage.ts
|
|
304
|
-
const DEFAULT_TTL =
|
|
304
|
+
const DEFAULT_TTL = 604800;
|
|
305
305
|
function hasSetex(client) {
|
|
306
306
|
return "setex" in client && typeof client.setex === "function";
|
|
307
307
|
}
|
|
@@ -1026,8 +1026,9 @@ function TaskQueueProvider({ children, config }) {
|
|
|
1026
1026
|
window.addEventListener("beforeunload", handleBeforeUnload);
|
|
1027
1027
|
return () => window.removeEventListener("beforeunload", handleBeforeUnload);
|
|
1028
1028
|
}, []);
|
|
1029
|
+
const value = useMemo(() => ({ queue: queueRef.current }), []);
|
|
1029
1030
|
return /* @__PURE__ */ jsx(TaskQueueContext, {
|
|
1030
|
-
value
|
|
1031
|
+
value,
|
|
1031
1032
|
children
|
|
1032
1033
|
});
|
|
1033
1034
|
}
|
package/dist/theme/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { i as ClientOnly, n as useTheme, r as ThemeScript, t as ThemeProvider } from "../themes-
|
|
1
|
+
import { i as ClientOnly, n as useTheme, r as ThemeScript, t as ThemeProvider } from "../themes-Ba2bajuF.mjs";
|
|
2
2
|
export { ClientOnly, ThemeProvider, ThemeScript, useTheme };
|
|
@@ -132,7 +132,8 @@ function ThemeImpl({ forcedTheme, disableTransitionOnChange = false, enableSyste
|
|
|
132
132
|
}
|
|
133
133
|
}, [storageKey]);
|
|
134
134
|
const handleMediaQuery = React.useCallback((e) => {
|
|
135
|
-
|
|
135
|
+
const resolved = getSystemTheme(e);
|
|
136
|
+
setResolvedTheme(resolved);
|
|
136
137
|
if (theme === "system" && enableSystem && !forcedTheme) applyTheme("system");
|
|
137
138
|
}, [
|
|
138
139
|
applyTheme,
|
|
@@ -168,25 +169,26 @@ function ThemeImpl({ forcedTheme, disableTransitionOnChange = false, enableSyste
|
|
|
168
169
|
forcedTheme,
|
|
169
170
|
theme
|
|
170
171
|
]);
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
return {
|
|
175
|
-
theme,
|
|
176
|
-
setTheme,
|
|
177
|
-
forcedTheme,
|
|
178
|
-
resolvedTheme: effectiveTheme === "system" ? resolvedTheme : effectiveTheme,
|
|
179
|
-
themes: enableSystem ? [...themes, "system"] : themes,
|
|
180
|
-
systemTheme: enableSystem ? resolvedTheme : void 0
|
|
181
|
-
};
|
|
182
|
-
}, [
|
|
172
|
+
const providerValue = React.useMemo(() => {
|
|
173
|
+
const effectiveTheme = forcedTheme ?? theme;
|
|
174
|
+
return {
|
|
183
175
|
theme,
|
|
184
176
|
setTheme,
|
|
185
177
|
forcedTheme,
|
|
186
|
-
resolvedTheme,
|
|
187
|
-
enableSystem,
|
|
188
|
-
|
|
189
|
-
|
|
178
|
+
resolvedTheme: effectiveTheme === "system" ? resolvedTheme : effectiveTheme,
|
|
179
|
+
themes: enableSystem ? [...themes, "system"] : themes,
|
|
180
|
+
systemTheme: enableSystem ? resolvedTheme : void 0
|
|
181
|
+
};
|
|
182
|
+
}, [
|
|
183
|
+
theme,
|
|
184
|
+
setTheme,
|
|
185
|
+
forcedTheme,
|
|
186
|
+
resolvedTheme,
|
|
187
|
+
enableSystem,
|
|
188
|
+
themes
|
|
189
|
+
]);
|
|
190
|
+
return /* @__PURE__ */ jsxs(ThemeContext, {
|
|
191
|
+
value: providerValue,
|
|
190
192
|
children: [/* @__PURE__ */ jsx(ThemeScript, {
|
|
191
193
|
forcedTheme,
|
|
192
194
|
storageKey,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as TimePicker } from "../time-picker-
|
|
1
|
+
import { t as TimePicker } from "../time-picker-B_fN5vhO.mjs";
|
|
2
2
|
export { TimePicker };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as TimePicker$1 } from "./picker-
|
|
1
|
+
import { n as TimePicker$1 } from "./picker-b5-x-EHs.mjs";
|
|
2
2
|
import { t as useDeprecationWarning } from "./use-deprecation-warning-DXrGc0jX.mjs";
|
|
3
3
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
4
4
|
//#region src/components/features/time-picker/time-picker.tsx
|
|
@@ -4,7 +4,7 @@ import { Calendar } from "./calendar/index.mjs";
|
|
|
4
4
|
import { t as Input } from "./input-j4tbmYYz.mjs";
|
|
5
5
|
import { t as ResponsivePopover } from "./responsive-popover-DJZgXWIE.mjs";
|
|
6
6
|
import { i as SelectItem, l as SelectTrigger, n as SelectContent, t as Select, u as SelectValue } from "./select-DCU44UO6.mjs";
|
|
7
|
-
import { G as getTimezoneOffset, K as isoToZonedDate, U as formatTimezoneLabel, W as getBrowserTimezone, nt as startOfDayInTz, q as zonedDateToIso, r as DateTimeRangePicker, tt as endOfDayInTz } from "./picker-
|
|
7
|
+
import { G as getTimezoneOffset, K as isoToZonedDate, U as formatTimezoneLabel, W as getBrowserTimezone, nt as startOfDayInTz, q as zonedDateToIso, r as DateTimeRangePicker, tt as endOfDayInTz } from "./picker-b5-x-EHs.mjs";
|
|
8
8
|
import { t as useDeprecationWarning } from "./use-deprecation-warning-DXrGc0jX.mjs";
|
|
9
9
|
import { CalendarIcon, Globe } from "lucide-react";
|
|
10
10
|
import { useCallback, useEffect, useId, useRef, useState } from "react";
|
|
@@ -55,14 +55,16 @@ function getShortTimezoneDisplay(timezone) {
|
|
|
55
55
|
* @example utcToLocalInputString(new Date('2026-01-16T04:00:00Z'), 'Asia/Jakarta') => '2026-01-16T11:00'
|
|
56
56
|
*/
|
|
57
57
|
function utcToLocalInputString(utcDate, timezone) {
|
|
58
|
-
|
|
58
|
+
const zonedDate = toZonedTime(utcDate, timezone);
|
|
59
|
+
return format(zonedDate, "yyyy-MM-dd'T'HH:mm");
|
|
59
60
|
}
|
|
60
61
|
/**
|
|
61
62
|
* Convert a local datetime-local input string to a UTC Date
|
|
62
63
|
* @example localInputStringToUtc('2026-01-16T11:00', 'Asia/Jakarta') => Date('2026-01-16T04:00:00Z')
|
|
63
64
|
*/
|
|
64
65
|
function localInputStringToUtc(localString, timezone) {
|
|
65
|
-
|
|
66
|
+
const parsed = parse(localString, "yyyy-MM-dd'T'HH:mm", /* @__PURE__ */ new Date());
|
|
67
|
+
return fromZonedTime(parsed, timezone);
|
|
66
68
|
}
|
|
67
69
|
/**
|
|
68
70
|
* Convert a UTC ISO string to a Date for display in user's timezone
|
|
@@ -81,7 +83,8 @@ function zonedDateToUtcString(zonedDate, timezone) {
|
|
|
81
83
|
* @example formatUtcForDisplay('2026-01-16T04:00:00Z', 'Asia/Jakarta') => 'Jan 16, 2026 11:00'
|
|
82
84
|
*/
|
|
83
85
|
function formatUtcForDisplay(utcString, timezone, formatString = "MMM d, yyyy HH:mm") {
|
|
84
|
-
|
|
86
|
+
const zonedDate = utcStringToZonedDate(utcString, timezone);
|
|
87
|
+
return format(zonedDate, formatString);
|
|
85
88
|
}
|
|
86
89
|
//#endregion
|
|
87
90
|
//#region src/components/features/time-range-picker/components/absolute-range-panel.tsx
|
|
@@ -533,11 +536,12 @@ function getPresetRange(preset, timezone) {
|
|
|
533
536
|
*/
|
|
534
537
|
function TimeRangePicker({ value, onChange, onClear: _onClear, timezone, presets, disableFuture, maxDate, minDate, className, disabled, placeholder = "Select time range", align: _align, side: _side }) {
|
|
535
538
|
useDeprecationWarning("TimeRangePicker (legacy)", "DateTimeRangePicker");
|
|
539
|
+
const wrapperValue = value ? {
|
|
540
|
+
from: value.from,
|
|
541
|
+
to: value.to
|
|
542
|
+
} : null;
|
|
536
543
|
return /* @__PURE__ */ jsx(DateTimeRangePicker, {
|
|
537
|
-
value:
|
|
538
|
-
from: value.from,
|
|
539
|
-
to: value.to
|
|
540
|
-
} : null,
|
|
544
|
+
value: wrapperValue,
|
|
541
545
|
onChange: (next) => {
|
|
542
546
|
if (next === null) {
|
|
543
547
|
onChange({
|
package/dist/tooltip/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as Tooltip } from "../tooltip-
|
|
1
|
+
import { t as Tooltip } from "../tooltip-C_SL1imw.mjs";
|
|
2
2
|
export { Tooltip };
|
|
@@ -76,31 +76,35 @@ function Tooltip({ message, children, delayDuration = 200, side, align, sideOffs
|
|
|
76
76
|
}
|
|
77
77
|
}, []);
|
|
78
78
|
useEffect(() => () => clearTimers(), [clearTimers]);
|
|
79
|
+
const handleTouchStart = useCallback(() => {
|
|
80
|
+
clearTimers();
|
|
81
|
+
pressTimerRef.current = setTimeout(() => {
|
|
82
|
+
setLongPressVisible(true);
|
|
83
|
+
dismissTimerRef.current = setTimeout(() => {
|
|
84
|
+
setLongPressVisible(false);
|
|
85
|
+
}, AUTO_DISMISS_DURATION);
|
|
86
|
+
}, LONG_PRESS_DURATION);
|
|
87
|
+
}, [clearTimers]);
|
|
88
|
+
const handleTouchMove = useCallback(() => {
|
|
89
|
+
clearTimers();
|
|
90
|
+
setLongPressVisible(false);
|
|
91
|
+
}, [clearTimers]);
|
|
92
|
+
const handleTouchEnd = useCallback(() => {
|
|
93
|
+
if (pressTimerRef.current) {
|
|
94
|
+
clearTimeout(pressTimerRef.current);
|
|
95
|
+
pressTimerRef.current = null;
|
|
96
|
+
}
|
|
97
|
+
}, []);
|
|
98
|
+
const handleTouchCancel = useCallback(() => {
|
|
99
|
+
clearTimers();
|
|
100
|
+
setLongPressVisible(false);
|
|
101
|
+
}, [clearTimers]);
|
|
79
102
|
return /* @__PURE__ */ jsxs("span", {
|
|
80
103
|
className: "relative inline-flex",
|
|
81
|
-
onTouchStart:
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
dismissTimerRef.current = setTimeout(() => {
|
|
86
|
-
setLongPressVisible(false);
|
|
87
|
-
}, AUTO_DISMISS_DURATION);
|
|
88
|
-
}, LONG_PRESS_DURATION);
|
|
89
|
-
}, [clearTimers]),
|
|
90
|
-
onTouchMove: useCallback(() => {
|
|
91
|
-
clearTimers();
|
|
92
|
-
setLongPressVisible(false);
|
|
93
|
-
}, [clearTimers]),
|
|
94
|
-
onTouchEnd: useCallback(() => {
|
|
95
|
-
if (pressTimerRef.current) {
|
|
96
|
-
clearTimeout(pressTimerRef.current);
|
|
97
|
-
pressTimerRef.current = null;
|
|
98
|
-
}
|
|
99
|
-
}, []),
|
|
100
|
-
onTouchCancel: useCallback(() => {
|
|
101
|
-
clearTimers();
|
|
102
|
-
setLongPressVisible(false);
|
|
103
|
-
}, [clearTimers]),
|
|
104
|
+
onTouchStart: handleTouchStart,
|
|
105
|
+
onTouchMove: handleTouchMove,
|
|
106
|
+
onTouchEnd: handleTouchEnd,
|
|
107
|
+
onTouchCancel: handleTouchCancel,
|
|
104
108
|
children: [/* @__PURE__ */ jsxs(Tooltip$1, {
|
|
105
109
|
delayDuration,
|
|
106
110
|
open,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as cn } from "./utils-Bu32wN-x.mjs";
|
|
2
2
|
import { Tabs, TabsContent, TabsList, TabsTrigger } from "./tabs/index.mjs";
|
|
3
|
-
import { n as useTheme } from "./themes-
|
|
3
|
+
import { n as useTheme } from "./themes-Ba2bajuF.mjs";
|
|
4
4
|
import { t as toast } from "./toast-BUPlDkN3.mjs";
|
|
5
5
|
import { useEffect, useRef, useState } from "react";
|
|
6
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -178,7 +178,8 @@ function formatJson(jsonStr) {
|
|
|
178
178
|
}
|
|
179
179
|
function formatYaml(yamlStr) {
|
|
180
180
|
try {
|
|
181
|
-
|
|
181
|
+
const parsed = load(yamlStr, { schema: FAILSAFE_SCHEMA });
|
|
182
|
+
return dump(parsed, {
|
|
182
183
|
indent: 2,
|
|
183
184
|
lineWidth: -1,
|
|
184
185
|
noRefs: true
|
|
@@ -189,7 +190,8 @@ function formatYaml(yamlStr) {
|
|
|
189
190
|
}
|
|
190
191
|
function jsonToYaml(jsonStr) {
|
|
191
192
|
try {
|
|
192
|
-
|
|
193
|
+
const parsed = JSON.parse(jsonStr);
|
|
194
|
+
return dump(parsed, {
|
|
193
195
|
indent: 2,
|
|
194
196
|
lineWidth: -1,
|
|
195
197
|
noRefs: true
|
|
@@ -136,10 +136,11 @@ function useOptionPicker(args) {
|
|
|
136
136
|
const { options, multiple, value, defaultValue, onValueChange, onSearchChange, creatable = false, creatableLabel, closeOnSelect = true, onOpenChange, getOptionValue: getOptionValueProp, getOptionLabel: getOptionLabelProp } = args;
|
|
137
137
|
const getOptionValue = useMemo(() => getOptionValueProp ?? ((o) => o.value), [getOptionValueProp]);
|
|
138
138
|
const getOptionLabel = useMemo(() => getOptionLabelProp ?? ((o) => o.label), [getOptionLabelProp]);
|
|
139
|
-
const
|
|
139
|
+
const controlledSelection = useMemo(() => {
|
|
140
140
|
if (value === void 0) return void 0;
|
|
141
141
|
return Array.isArray(value) ? value : [value];
|
|
142
|
-
}, [value])
|
|
142
|
+
}, [value]);
|
|
143
|
+
const [selection, setSelection] = useControllableState(controlledSelection, defaultValue === void 0 ? [] : Array.isArray(defaultValue) ? defaultValue : [defaultValue]);
|
|
143
144
|
const selectionSet = useMemo(() => new Set(selection), [selection]);
|
|
144
145
|
const [search, setSearchState] = useState("");
|
|
145
146
|
const setSearch = useCallback((next) => {
|
package/dist/utils/index.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { t as cn } from "../utils-Bu32wN-x.mjs";
|
|
2
|
-
import { n as toUTCTimestampStartOfDay, t as toUTCTimestampEndOfDay } from "../utils-
|
|
2
|
+
import { n as toUTCTimestampStartOfDay, t as toUTCTimestampEndOfDay } from "../utils-CA4QEIJ8.mjs";
|
|
3
3
|
export { cn, toUTCTimestampEndOfDay, toUTCTimestampStartOfDay };
|