@datum-cloud/datum-ui 1.1.0 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/code-editor/index.mjs +1 -1
- package/dist/components/features/grouped-table/components/grouped-toolbar.d.ts.map +1 -1
- package/dist/components/features/grouped-table/grouped-table.d.ts.map +1 -1
- package/dist/components/features/grouped-table/types.d.ts +18 -1
- package/dist/components/features/grouped-table/types.d.ts.map +1 -1
- package/dist/components/features/stepper/stepper.d.ts +5 -3
- package/dist/components/features/stepper/stepper.d.ts.map +1 -1
- package/dist/form/stepper/index.mjs +31 -27
- package/dist/grouped-table/index.mjs +34 -21
- package/dist/index.mjs +3 -3
- package/dist/stepper/index.mjs +1 -1
- package/dist/{stepper-CkN6jcwU.mjs → stepper-DV9FH5Cy.mjs} +10 -10
- package/dist/task-queue/index.mjs +1 -1
- package/dist/{types-CMn5DR7E.mjs → types-B7jxIH5I.mjs} +5 -7
- package/package.json +49 -48
- package/dist/{task-queue-dropdown-CPiwzDqY.mjs → task-queue-dropdown-BRP0lLzA.mjs} +72 -72
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as formatJson, c as isValidYaml, d as CodeEditor, i as CodeEditorTabs, l as jsonToYaml, n as jsonSchema, o as formatYaml, r as yamlSchema, s as isValidJson, t as createCodeEditorSchema, u as yamlToJson } from "../types-
|
|
1
|
+
import { a as formatJson, c as isValidYaml, d as CodeEditor, i as CodeEditorTabs, l as jsonToYaml, n as jsonSchema, o as formatYaml, r as yamlSchema, s as isValidJson, t as createCodeEditorSchema, u as yamlToJson } from "../types-B7jxIH5I.mjs";
|
|
2
2
|
export { CodeEditor, CodeEditorTabs, createCodeEditorSchema, formatJson, formatYaml, isValidJson, isValidYaml, jsonSchema, jsonToYaml, yamlSchema, yamlToJson };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"grouped-toolbar.d.ts","sourceRoot":"","sources":["../../../../../src/components/features/grouped-table/components/grouped-toolbar.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"grouped-toolbar.d.ts","sourceRoot":"","sources":["../../../../../src/components/features/grouped-table/components/grouped-toolbar.tsx"],"names":[],"mappings":"AAMA,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,MAAM,CAAA;IACd,cAAc,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IACvC,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED,wBAAgB,cAAc,CAAC,EAC7B,MAAM,EACN,cAAc,EACd,WAAyB,EACzB,UAAgC,EAChC,SAAS,GACV,EAAE,mBAAmB,+BA0BrB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"grouped-table.d.ts","sourceRoot":"","sources":["../../../../src/components/features/grouped-table/grouped-table.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"grouped-table.d.ts","sourceRoot":"","sources":["../../../../src/components/features/grouped-table/grouped-table.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;AAoDhD,wBAAgB,YAAY,CAAC,KAAK,EAAE,KAAK,EAAE,iBAAiB,CAAC,KAAK,CAAC,+BAyLlE"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ColumnDef, RowSelectionState, SortingState } from '@tanstack/react-table';
|
|
1
|
+
import type { Cell, ColumnDef, Row, RowSelectionState, SortingState } from '@tanstack/react-table';
|
|
2
2
|
import type { ReactNode } from 'react';
|
|
3
3
|
import type { SelectionColumnOptions } from '../data-table/types';
|
|
4
4
|
import type { ActionItem } from '../more-actions/types';
|
|
@@ -52,6 +52,23 @@ export interface GroupedTableProps<TData> {
|
|
|
52
52
|
isLoading?: boolean;
|
|
53
53
|
/** Rendered when there are no groups, every group is empty, or search clears everything. */
|
|
54
54
|
empty?: ReactNode;
|
|
55
|
+
/** Root wrapper. */
|
|
55
56
|
className?: string;
|
|
57
|
+
/** Search toolbar wrapper (when `enableSearch`). */
|
|
58
|
+
toolbarClassName?: string;
|
|
59
|
+
/** Every `<table>` element (shared header + each group body). */
|
|
60
|
+
tableClassName?: string;
|
|
61
|
+
/** The column-header `<tr>`. */
|
|
62
|
+
headerRowClassName?: string;
|
|
63
|
+
/** Each column-header `<th>`. */
|
|
64
|
+
headerCellClassName?: string;
|
|
65
|
+
/** Each group's collapsible header band; receives the group for per-group styling. */
|
|
66
|
+
groupHeaderClassName?: string | ((group: GroupedTableGroup<TData>) => string);
|
|
67
|
+
/** Each group's `<tbody>`. */
|
|
68
|
+
bodyClassName?: string;
|
|
69
|
+
/** Each data `<tr>`; receives the row for per-row styling. */
|
|
70
|
+
rowClassName?: string | ((row: Row<TData>) => string);
|
|
71
|
+
/** Each data `<td>`; receives the cell for per-cell styling. */
|
|
72
|
+
cellClassName?: string | ((cell: Cell<TData, unknown>) => string);
|
|
56
73
|
}
|
|
57
74
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/features/grouped-table/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/features/grouped-table/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AAClG,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACtC,OAAO,KAAK,EAAE,sBAAsB,EAAE,MA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C,IAAI,EAAE,IAAI,CAAC,KAAK,EAAE,OAAO,CAAC,KAAK,MAAM,CAAC,CAAA;CAClE"}
|
|
@@ -9,9 +9,11 @@ declare namespace Stepper {
|
|
|
9
9
|
labelOrientation?: StepperLabelOrientation;
|
|
10
10
|
tracking?: boolean;
|
|
11
11
|
}
|
|
12
|
-
|
|
12
|
+
interface DefineProps<Steps extends Stepperize.Step[]> {
|
|
13
|
+
steps: Steps;
|
|
14
|
+
useStepper: (options?: Stepperize.UseStepperOptions<Steps>) => Stepperize.Stepper<Steps>;
|
|
13
15
|
Stepper: {
|
|
14
|
-
Provider: (props: Omit<Stepperize.
|
|
16
|
+
Provider: (props: Omit<Stepperize.ProviderProps<Steps>, 'children'> & Omit<React.ComponentProps<'div'>, 'children'> & Stepper.ConfigProps & {
|
|
15
17
|
children: React.ReactNode | ((props: {
|
|
16
18
|
methods: Stepperize.Stepper<Steps>;
|
|
17
19
|
}) => React.ReactNode);
|
|
@@ -27,7 +29,7 @@ declare namespace Stepper {
|
|
|
27
29
|
Panel: (props: AsChildProps<'div'>) => React.ReactElement;
|
|
28
30
|
Controls: (props: AsChildProps<'div'>) => React.ReactElement;
|
|
29
31
|
};
|
|
30
|
-
}
|
|
32
|
+
}
|
|
31
33
|
interface CircleStepIndicatorProps {
|
|
32
34
|
currentStep: number;
|
|
33
35
|
totalSteps: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stepper.d.ts","sourceRoot":"","sources":["../../../../src/components/features/stepper/stepper.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,UAAU,MAAM,mBAAmB,CAAA;AAE/C,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AA0C9B,iBAAS,aAAa,CAAC,KAAK,CAAC,KAAK,SAAS,UAAU,CAAC,IAAI,EAAE,EAAE,GAAG,KAAK,EAAE,KAAK,GAAG,OAAO,CAAC,WAAW,CAAC,KAAK,CAAC,
|
|
1
|
+
{"version":3,"file":"stepper.d.ts","source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import { n as useFormContext, t as FormProvider } from "../../form-context-DzB2a-dw.mjs";
|
|
4
4
|
import { n as useAdapter } from "../../adapter-context-h0jCVqGO.mjs";
|
|
5
|
-
import { t as defineStepper } from "../../stepper-
|
|
5
|
+
import { t as defineStepper } from "../../stepper-DV9FH5Cy.mjs";
|
|
6
6
|
import { CheckIcon } from "lucide-react";
|
|
7
7
|
import * as React from "react";
|
|
8
8
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -65,7 +65,7 @@ function FormStepper({ steps, children, onComplete, onStepChange, initialStep, c
|
|
|
65
65
|
return index >= 0 ? steps[index].id : void 0;
|
|
66
66
|
}, [initialStep, steps]);
|
|
67
67
|
const { Stepper } = stepperDef;
|
|
68
|
-
const providerProps = initialStepIndex ? {
|
|
68
|
+
const providerProps = initialStepIndex ? { defaultStep: initialStepIndex } : {};
|
|
69
69
|
return /* @__PURE__ */ jsx(Stepper.Provider, {
|
|
70
70
|
...providerProps,
|
|
71
71
|
children: /* @__PURE__ */ jsx(FormStepperContent, {
|
|
@@ -89,21 +89,21 @@ function FormStepperContent({ steps, stepperDef, children, onComplete, onStepCha
|
|
|
89
89
|
return /* @__PURE__ */ jsx(StepForm, {
|
|
90
90
|
steps,
|
|
91
91
|
stepper,
|
|
92
|
-
currentStepConfig: React.useMemo(() => steps.find((s) => s.id === stepper.
|
|
92
|
+
currentStepConfig: React.useMemo(() => steps.find((s) => s.id === stepper.current.id) ?? steps[0], [steps, stepper.current.id]),
|
|
93
93
|
storedValues: React.useMemo(() => {
|
|
94
|
-
const
|
|
94
|
+
const allData = steps.reduce((acc, step) => ({
|
|
95
95
|
...acc,
|
|
96
|
-
...stepper.
|
|
96
|
+
...stepper.data.get(step.id) || {}
|
|
97
97
|
}), {});
|
|
98
98
|
return {
|
|
99
99
|
...defaultValues,
|
|
100
|
-
...
|
|
100
|
+
...allData
|
|
101
101
|
};
|
|
102
102
|
}, [
|
|
103
103
|
steps,
|
|
104
104
|
stepper,
|
|
105
105
|
defaultValues,
|
|
106
|
-
stepper.
|
|
106
|
+
stepper.current.id
|
|
107
107
|
]),
|
|
108
108
|
onComplete,
|
|
109
109
|
onStepChange,
|
|
@@ -112,7 +112,7 @@ function FormStepperContent({ steps, stepperDef, children, onComplete, onStepCha
|
|
|
112
112
|
formComponent,
|
|
113
113
|
mode,
|
|
114
114
|
children
|
|
115
|
-
}, stepper.
|
|
115
|
+
}, stepper.current.id);
|
|
116
116
|
}
|
|
117
117
|
function StepForm({ steps, stepper, currentStepConfig, storedValues, children, onComplete, onStepChange, className, id, formComponent: FormComp = "form", mode }) {
|
|
118
118
|
const adapter = useAdapter();
|
|
@@ -120,18 +120,18 @@ function StepForm({ steps, stepper, currentStepConfig, storedValues, children, o
|
|
|
120
120
|
const [isSubmitted, setIsSubmitted] = React.useState(false);
|
|
121
121
|
const [submitCount, setSubmitCount] = React.useState(0);
|
|
122
122
|
const formRef = React.useRef(null);
|
|
123
|
-
const currentIndex = stepper.
|
|
123
|
+
const currentIndex = stepper.index;
|
|
124
124
|
const handleStepSubmit = React.useCallback(async (data) => {
|
|
125
125
|
setIsSubmitted(true);
|
|
126
126
|
setSubmitCount((prev) => prev + 1);
|
|
127
|
-
stepper.
|
|
128
|
-
if (stepper.
|
|
127
|
+
stepper.data.set(data);
|
|
128
|
+
if (stepper.isLast) {
|
|
129
129
|
setIsSubmitting(true);
|
|
130
130
|
try {
|
|
131
131
|
await onComplete({
|
|
132
132
|
...steps.reduce((acc, step) => ({
|
|
133
133
|
...acc,
|
|
134
|
-
...stepper.
|
|
134
|
+
...stepper.data.get(step.id) || {}
|
|
135
135
|
}), {}),
|
|
136
136
|
...data
|
|
137
137
|
});
|
|
@@ -139,15 +139,16 @@ function StepForm({ steps, stepper, currentStepConfig, storedValues, children, o
|
|
|
139
139
|
setIsSubmitting(false);
|
|
140
140
|
}
|
|
141
141
|
} else {
|
|
142
|
-
const nextStepId =
|
|
142
|
+
const nextStepId = steps[currentIndex + 1]?.id;
|
|
143
143
|
if (nextStepId) {
|
|
144
|
-
stepper.
|
|
144
|
+
stepper.goTo(nextStepId);
|
|
145
145
|
onStepChange?.(nextStepId, "next");
|
|
146
146
|
}
|
|
147
147
|
}
|
|
148
148
|
}, [
|
|
149
149
|
stepper,
|
|
150
150
|
steps,
|
|
151
|
+
currentIndex,
|
|
151
152
|
onComplete,
|
|
152
153
|
onStepChange
|
|
153
154
|
]);
|
|
@@ -164,35 +165,38 @@ function StepForm({ steps, stepper, currentStepConfig, storedValues, children, o
|
|
|
164
165
|
}, []);
|
|
165
166
|
const prev = React.useCallback(() => {
|
|
166
167
|
const currentValues = instance.getValues();
|
|
167
|
-
if (Object.keys(currentValues).length > 0) stepper.
|
|
168
|
-
const prevStepId =
|
|
168
|
+
if (Object.keys(currentValues).length > 0) stepper.data.set(currentValues);
|
|
169
|
+
const prevStepId = steps[currentIndex - 1]?.id;
|
|
169
170
|
if (prevStepId) {
|
|
170
|
-
stepper.
|
|
171
|
+
stepper.goTo(prevStepId);
|
|
171
172
|
onStepChange?.(prevStepId, "prev");
|
|
172
173
|
}
|
|
173
174
|
}, [
|
|
174
175
|
instance,
|
|
175
176
|
stepper,
|
|
177
|
+
steps,
|
|
178
|
+
currentIndex,
|
|
176
179
|
onStepChange
|
|
177
180
|
]);
|
|
178
181
|
const goTo = React.useCallback((stepId) => {
|
|
179
|
-
if (
|
|
182
|
+
if (steps.findIndex((s) => s.id === stepId) < currentIndex) {
|
|
180
183
|
const currentValues = instance.getValues();
|
|
181
|
-
if (Object.keys(currentValues).length > 0) stepper.
|
|
182
|
-
stepper.
|
|
184
|
+
if (Object.keys(currentValues).length > 0) stepper.data.set(currentValues);
|
|
185
|
+
stepper.goTo(stepId);
|
|
183
186
|
onStepChange?.(stepId, "prev");
|
|
184
187
|
}
|
|
185
188
|
}, [
|
|
186
189
|
instance,
|
|
187
190
|
stepper,
|
|
191
|
+
steps,
|
|
188
192
|
currentIndex,
|
|
189
193
|
onStepChange
|
|
190
194
|
]);
|
|
191
|
-
const getStepData = React.useCallback((stepId) => stepper.
|
|
195
|
+
const getStepData = React.useCallback((stepId) => stepper.data.get(stepId), [stepper]);
|
|
192
196
|
const getAllStepData = React.useCallback(() => {
|
|
193
197
|
return steps.reduce((acc, step) => ({
|
|
194
198
|
...acc,
|
|
195
|
-
...stepper.
|
|
199
|
+
...stepper.data.get(step.id) || {}
|
|
196
200
|
}), {});
|
|
197
201
|
}, [steps, stepper]);
|
|
198
202
|
const stepperContextValue = React.useMemo(() => ({
|
|
@@ -202,11 +206,11 @@ function StepForm({ steps, stepper, currentStepConfig, storedValues, children, o
|
|
|
202
206
|
next,
|
|
203
207
|
prev,
|
|
204
208
|
goTo,
|
|
205
|
-
isFirst: stepper.
|
|
206
|
-
isLast: stepper.
|
|
209
|
+
isFirst: stepper.isFirst,
|
|
210
|
+
isLast: stepper.isLast,
|
|
207
211
|
getStepData,
|
|
208
212
|
getAllStepData,
|
|
209
|
-
utils: { getIndex: (stepId) =>
|
|
213
|
+
utils: { getIndex: (stepId) => steps.findIndex((s) => s.id === stepId) }
|
|
210
214
|
}), [
|
|
211
215
|
steps,
|
|
212
216
|
currentStepConfig,
|
|
@@ -250,8 +254,8 @@ function StepForm({ steps, stepper, currentStepConfig, storedValues, children, o
|
|
|
250
254
|
next,
|
|
251
255
|
prev,
|
|
252
256
|
goTo,
|
|
253
|
-
isFirst: stepper.
|
|
254
|
-
isLast: stepper.
|
|
257
|
+
isFirst: stepper.isFirst,
|
|
258
|
+
isLast: stepper.isLast,
|
|
255
259
|
getStepData,
|
|
256
260
|
getAllStepData
|
|
257
261
|
};
|
|
@@ -44,14 +44,13 @@ function GroupedToolbar({ search, onSearchChange, placeholder = "Search...", deb
|
|
|
44
44
|
onSearchChange
|
|
45
45
|
]);
|
|
46
46
|
return /* @__PURE__ */ jsx("div", {
|
|
47
|
-
className: "pb-3",
|
|
47
|
+
className: cn("pb-3", className),
|
|
48
48
|
"data-slot": "gt-toolbar",
|
|
49
49
|
children: /* @__PURE__ */ jsx(Input, {
|
|
50
50
|
placeholder,
|
|
51
51
|
value,
|
|
52
52
|
onChange: (e) => setValue(e.target.value),
|
|
53
53
|
"aria-label": placeholder,
|
|
54
|
-
className,
|
|
55
54
|
"data-slot": "gt-search"
|
|
56
55
|
})
|
|
57
56
|
});
|
|
@@ -210,8 +209,12 @@ function trackMinWidth(resolvedColumns) {
|
|
|
210
209
|
function renderColGroup(resolvedColumns) {
|
|
211
210
|
return /* @__PURE__ */ jsx("colgroup", { children: resolvedColumns.map((col, i) => /* @__PURE__ */ jsx("col", { style: { width: columnWidth(col) } }, `col-${i}`)) });
|
|
212
211
|
}
|
|
212
|
+
/** Resolve a static or per-item className override (mirrors data-table). */
|
|
213
|
+
function resolveClassName(value, item) {
|
|
214
|
+
return typeof value === "function" ? value(item) : value;
|
|
215
|
+
}
|
|
213
216
|
function GroupedTable(props) {
|
|
214
|
-
const { columns, groups, defaultExpanded, expanded, onExpandedChange, getRowId, enableRowSelection, rowSelection: rowSelectionProp, onRowSelectionChange, rowActions, rowActionsSheetTitle, enableSorting, sorting: sortingProp, onSortingChange, enableSearch, searchPlaceholder, searchableColumns, searchFn, search: searchProp, onSearchChange, searchDebounceMs, isLoading, empty, className } = props;
|
|
217
|
+
const { columns, groups, defaultExpanded, expanded, onExpandedChange, getRowId, enableRowSelection, rowSelection: rowSelectionProp, onRowSelectionChange, rowActions, rowActionsSheetTitle, enableSorting, sorting: sortingProp, onSortingChange, enableSearch, searchPlaceholder, searchableColumns, searchFn, search: searchProp, onSearchChange, searchDebounceMs, isLoading, empty, className, toolbarClassName, tableClassName, headerRowClassName, headerCellClassName, groupHeaderClassName, bodyClassName, rowClassName, cellClassName } = props;
|
|
215
218
|
const [sorting, setSorting] = useControllableState(sortingProp, [], onSortingChange);
|
|
216
219
|
const [rowSelection, setRowSelection] = useControllableState(rowSelectionProp, {}, onRowSelectionChange);
|
|
217
220
|
const [search, setSearch] = useControllableState(searchProp, "", onSearchChange);
|
|
@@ -266,6 +269,7 @@ function GroupedTable(props) {
|
|
|
266
269
|
filteredRows
|
|
267
270
|
]);
|
|
268
271
|
const slices = useMemo(() => groups.map((g) => ({
|
|
272
|
+
group: g,
|
|
269
273
|
id: g.id,
|
|
270
274
|
title: g.title,
|
|
271
275
|
meta: g.meta,
|
|
@@ -282,7 +286,8 @@ function GroupedTable(props) {
|
|
|
282
286
|
search,
|
|
283
287
|
onSearchChange: setSearch,
|
|
284
288
|
placeholder: searchPlaceholder,
|
|
285
|
-
debounceMs: searchDebounceMs
|
|
289
|
+
debounceMs: searchDebounceMs,
|
|
290
|
+
className: toolbarClassName
|
|
286
291
|
}), /* @__PURE__ */ jsx("div", {
|
|
287
292
|
className: cn("w-full rounded-md border", scrollable ? "overflow-x-auto" : "overflow-hidden"),
|
|
288
293
|
children: scrollable ? /* @__PURE__ */ jsx("div", {
|
|
@@ -294,42 +299,50 @@ function GroupedTable(props) {
|
|
|
294
299
|
if (isLoading) return renderShell(/* @__PURE__ */ jsx(GroupedSkeleton, { columns: resolvedColumns.length }), false);
|
|
295
300
|
if (flatData.length === 0 || isSearching && visibleSlices.length === 0) return renderShell(empty ?? null, false);
|
|
296
301
|
return renderShell(/* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsxs("table", {
|
|
297
|
-
className: "w-full table-fixed text-sm",
|
|
298
|
-
children: [renderColGroup(resolvedColumns), /* @__PURE__ */ jsx(TableHeader, { children: headerGroups.map((hg) => /* @__PURE__ */ jsx(TableRow, {
|
|
299
|
-
|
|
300
|
-
children: header
|
|
301
|
-
|
|
302
|
-
|
|
302
|
+
className: cn("w-full table-fixed text-sm", tableClassName),
|
|
303
|
+
children: [renderColGroup(resolvedColumns), /* @__PURE__ */ jsx(TableHeader, { children: headerGroups.map((hg) => /* @__PURE__ */ jsx(TableRow, {
|
|
304
|
+
className: headerRowClassName,
|
|
305
|
+
children: hg.headers.map((header) => /* @__PURE__ */ jsx(TableHead, {
|
|
306
|
+
scope: "col",
|
|
307
|
+
className: headerCellClassName,
|
|
308
|
+
children: header.isPlaceholder ? null : flexRender(header.column.columnDef.header, header.getContext())
|
|
309
|
+
}, header.id))
|
|
310
|
+
}, hg.id)) })]
|
|
311
|
+
}), visibleSlices.map((slice) => {
|
|
303
312
|
const open = isSearching ? true : isOpen(slice.id);
|
|
304
313
|
return /* @__PURE__ */ jsxs(Collapsible, {
|
|
305
314
|
open,
|
|
306
315
|
onOpenChange: () => toggle(slice.id),
|
|
307
316
|
children: [/* @__PURE__ */ jsxs(CollapsibleTrigger, {
|
|
308
|
-
className: cn("flex w-full items-center gap-2 bg-muted/40 px-
|
|
317
|
+
className: cn("flex h-10 w-full items-center gap-2 border-b bg-muted/40 px-2 text-left align-middle text-sm font-medium text-muted-foreground transition-colors hover:bg-muted/60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring", resolveClassName(groupHeaderClassName, slice.group)),
|
|
309
318
|
children: [
|
|
310
319
|
/* @__PURE__ */ jsx(Icon, {
|
|
311
320
|
icon: ChevronRight,
|
|
312
321
|
"aria-hidden": true,
|
|
313
|
-
className: cn("size-4 shrink-0
|
|
322
|
+
className: cn("size-4 shrink-0 transition-transform", open && "rotate-90")
|
|
314
323
|
}),
|
|
315
324
|
/* @__PURE__ */ jsx("span", { children: slice.title }),
|
|
316
325
|
slice.meta != null && /* @__PURE__ */ jsx("span", {
|
|
317
|
-
className: "ml-auto flex items-center gap-2 font-medium
|
|
326
|
+
className: "ml-auto flex items-center gap-2 font-medium",
|
|
318
327
|
children: slice.meta
|
|
319
328
|
})
|
|
320
329
|
]
|
|
321
330
|
}), /* @__PURE__ */ jsx(CollapsibleContent, {
|
|
322
331
|
className: "overflow-hidden data-[state=closed]:animate-collapsible-up data-[state=open]:animate-collapsible-down",
|
|
323
332
|
children: /* @__PURE__ */ jsxs("table", {
|
|
324
|
-
className: "w-full table-fixed
|
|
333
|
+
className: cn("w-full table-fixed text-sm", tableClassName),
|
|
325
334
|
"aria-label": typeof slice.title === "string" ? slice.title : void 0,
|
|
326
|
-
children: [renderColGroup(resolvedColumns), /* @__PURE__ */ jsx(TableBody, {
|
|
327
|
-
|
|
328
|
-
children:
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
335
|
+
children: [renderColGroup(resolvedColumns), /* @__PURE__ */ jsx(TableBody, {
|
|
336
|
+
className: bodyClassName,
|
|
337
|
+
children: slice.rows.map((row) => /* @__PURE__ */ jsx(TableRow, {
|
|
338
|
+
"data-state": row.getIsSelected() ? "selected" : void 0,
|
|
339
|
+
className: resolveClassName(rowClassName, row),
|
|
340
|
+
children: row.getVisibleCells().map((cell) => /* @__PURE__ */ jsx(TableCell, {
|
|
341
|
+
className: resolveClassName(cellClassName, cell),
|
|
342
|
+
children: flexRender(cell.column.columnDef.cell, cell.getContext())
|
|
343
|
+
}, cell.id))
|
|
344
|
+
}, row.id))
|
|
345
|
+
})]
|
|
333
346
|
})
|
|
334
347
|
})]
|
|
335
348
|
}, slice.id);
|
package/dist/index.mjs
CHANGED
|
@@ -48,7 +48,7 @@ import { t as Autocomplete } from "./autocomplete-Bg187x6x.mjs";
|
|
|
48
48
|
import { n as avatarStackVariants, t as AvatarStack } from "./avatar-stack-dsUoEFWs.mjs";
|
|
49
49
|
import { t as CalendarDatePicker } from "./calendar-date-picker-DAVXW7Jg.mjs";
|
|
50
50
|
import { i as ClientOnly, n as useTheme, r as ThemeScript, t as ThemeProvider } from "./themes-CAmRnjUM.mjs";
|
|
51
|
-
import { a as formatJson, c as isValidYaml, d as CodeEditor, i as CodeEditorTabs, l as jsonToYaml, n as jsonSchema, o as formatYaml, r as yamlSchema, s as isValidJson, t as createCodeEditorSchema, u as yamlToJson } from "./types-
|
|
51
|
+
import { a as formatJson, c as isValidYaml, d as CodeEditor, i as CodeEditorTabs, l as jsonToYaml, n as jsonSchema, o as formatYaml, r as yamlSchema, s as isValidJson, t as createCodeEditorSchema, u as yamlToJson } from "./types-B7jxIH5I.mjs";
|
|
52
52
|
import { t as toast } from "./toast-qSJgeN-g.mjs";
|
|
53
53
|
import { n as Toaster, t as useToast } from "./toast-0C5jhuto.mjs";
|
|
54
54
|
import { i as FileInputButton, n as DropzoneContent, r as DropzoneEmptyState, t as Dropzone } from "./dropzone-ZJhq4Ec9.mjs";
|
|
@@ -67,9 +67,9 @@ import { t as MultiSelect } from "./multi-select-C9ocz07C.mjs";
|
|
|
67
67
|
import { configureProgress, startProgress, stopProgress } from "./nprogress/index.mjs";
|
|
68
68
|
import { t as PageTitle } from "./page-title-Wj1lF0BP.mjs";
|
|
69
69
|
import { n as useRichTextEditor, r as RichTextContent, t as RichTextEditor } from "./rich-text-editor-B3i5csUE.mjs";
|
|
70
|
-
import { t as defineStepper } from "./stepper-
|
|
70
|
+
import { t as defineStepper } from "./stepper-DV9FH5Cy.mjs";
|
|
71
71
|
import { t as TagsInput } from "./tag-input-DZJUc1hL.mjs";
|
|
72
|
-
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-
|
|
72
|
+
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-BRP0lLzA.mjs";
|
|
73
73
|
import { C as utcToLocalInputString, S as utcStringToZonedDate, _ as getBrowserTimezone, a as TimeRangePicker, b as getTimezoneOffset, c as getPresetByKey, d as TimezoneSelector, f as QuickRangesPanel, g as formatUtcForDisplay, h as formatTimezoneLabel, i as formatTimeRangeDisplay, l as getPresetByShortcut, m as createTimezoneOption, n as formatDateForInput, o as DEFAULT_PRESETS, p as CustomRangePanel, r as formatSingleTimeDisplay, s as getDefaultPreset, t as toApiTimeRange, u as getPresetRange, v as getDefaultTimezoneOptions, w as zonedDateToUtcString, x as localInputStringToUtc, y as getShortTimezoneDisplay } from "./to-api-format-tidT5mxa.mjs";
|
|
74
74
|
import { t as useDebounce } from "./hooks-CwZ6hyI1.mjs";
|
|
75
75
|
import { n as toUTCTimestampStartOfDay, t as toUTCTimestampEndOfDay } from "./utils-BAytYO8b.mjs";
|
package/dist/stepper/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as defineStepper } from "../stepper-
|
|
1
|
+
import { t as defineStepper } from "../stepper-DV9FH5Cy.mjs";
|
|
2
2
|
export { defineStepper };
|
|
@@ -29,7 +29,7 @@ const classForSeparator = cva([
|
|
|
29
29
|
labelOrientation: { vertical: "absolute left-[calc(50%+30px)] right-[calc(-50%+20px)] top-5 block shrink-0" }
|
|
30
30
|
} });
|
|
31
31
|
function defineStepper(...steps) {
|
|
32
|
-
const {
|
|
32
|
+
const { Provider: StepperizeProvider, useStepper, steps: stepList, Stepper: StepperizePrimitives } = Stepperize.defineStepper(steps);
|
|
33
33
|
const StepperContainer = ({ children, className, ...props }) => {
|
|
34
34
|
const methods = useStepper();
|
|
35
35
|
return /* @__PURE__ */ jsx("div", {
|
|
@@ -44,16 +44,16 @@ function defineStepper(...steps) {
|
|
|
44
44
|
useStepper,
|
|
45
45
|
Stepper: {
|
|
46
46
|
...StepperizePrimitives,
|
|
47
|
-
Provider: ({ variant = "horizontal", labelOrientation = "horizontal", tracking = false, children, className, ...props }) => {
|
|
47
|
+
Provider: ({ variant = "horizontal", labelOrientation = "horizontal", tracking = false, defaultStep, defaultData, children, className, ...props }) => {
|
|
48
48
|
return /* @__PURE__ */ jsx(StepperContext, {
|
|
49
49
|
value: {
|
|
50
50
|
variant,
|
|
51
51
|
labelOrientation,
|
|
52
52
|
tracking
|
|
53
53
|
},
|
|
54
|
-
children: /* @__PURE__ */ jsx(
|
|
55
|
-
|
|
56
|
-
|
|
54
|
+
children: /* @__PURE__ */ jsx(StepperizeProvider, {
|
|
55
|
+
defaultStep,
|
|
56
|
+
defaultData,
|
|
57
57
|
children: /* @__PURE__ */ jsx(StepperContainer, {
|
|
58
58
|
className,
|
|
59
59
|
...props,
|
|
@@ -80,11 +80,11 @@ function defineStepper(...steps) {
|
|
|
80
80
|
const { variant, labelOrientation } = useStepperProvider();
|
|
81
81
|
const stepper = useStepper();
|
|
82
82
|
const steps = stepList;
|
|
83
|
-
const stepIndex =
|
|
83
|
+
const stepIndex = steps.findIndex((s) => s.id === props.of);
|
|
84
84
|
const step = steps[stepIndex];
|
|
85
|
-
const currentIndex = stepper.
|
|
86
|
-
const isLast =
|
|
87
|
-
const isActive = stepper.
|
|
85
|
+
const currentIndex = stepper.index;
|
|
86
|
+
const isLast = stepIndex === steps.length - 1;
|
|
87
|
+
const isActive = stepper.current.id === props.of;
|
|
88
88
|
const dataState = getStepState(currentIndex, stepIndex);
|
|
89
89
|
const childMap = useStepChildren(children);
|
|
90
90
|
const title = childMap.get("title");
|
|
@@ -131,7 +131,7 @@ function defineStepper(...steps) {
|
|
|
131
131
|
"aria-posinset": stepIndex + 1,
|
|
132
132
|
"aria-setsize": steps.length,
|
|
133
133
|
"aria-selected": isActive,
|
|
134
|
-
onKeyDown: (e) => onStepKeyDown(e,
|
|
134
|
+
onKeyDown: (e) => onStepKeyDown(e, steps[stepIndex + 1], steps[stepIndex - 1]),
|
|
135
135
|
...props,
|
|
136
136
|
children: icon ?? stepIndex + 1
|
|
137
137
|
}),
|
|
@@ -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-BRP0lLzA.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,7 +5,7 @@ import { t as toast } from "./toast-qSJgeN-g.mjs";
|
|
|
5
5
|
import { useEffect, useRef, useState } from "react";
|
|
6
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
7
|
import Editor from "@monaco-editor/react";
|
|
8
|
-
import
|
|
8
|
+
import { FAILSAFE_SCHEMA, dump, load } from "js-yaml";
|
|
9
9
|
import { z } from "zod";
|
|
10
10
|
//#region src/components/features/code-editor/code-editor.tsx
|
|
11
11
|
/**
|
|
@@ -135,7 +135,7 @@ function isValidJson(jsonStr) {
|
|
|
135
135
|
}
|
|
136
136
|
function isValidYaml(yamlStr) {
|
|
137
137
|
try {
|
|
138
|
-
|
|
138
|
+
load(yamlStr, { schema: FAILSAFE_SCHEMA });
|
|
139
139
|
return true;
|
|
140
140
|
} catch {
|
|
141
141
|
return false;
|
|
@@ -151,8 +151,7 @@ function formatJson(jsonStr) {
|
|
|
151
151
|
}
|
|
152
152
|
function formatYaml(yamlStr) {
|
|
153
153
|
try {
|
|
154
|
-
|
|
155
|
-
return yaml.dump(parsed, {
|
|
154
|
+
return dump(load(yamlStr, { schema: FAILSAFE_SCHEMA }), {
|
|
156
155
|
indent: 2,
|
|
157
156
|
lineWidth: -1,
|
|
158
157
|
noRefs: true
|
|
@@ -163,8 +162,7 @@ function formatYaml(yamlStr) {
|
|
|
163
162
|
}
|
|
164
163
|
function jsonToYaml(jsonStr) {
|
|
165
164
|
try {
|
|
166
|
-
|
|
167
|
-
return yaml.dump(parsed, {
|
|
165
|
+
return dump(JSON.parse(jsonStr), {
|
|
168
166
|
indent: 2,
|
|
169
167
|
lineWidth: -1,
|
|
170
168
|
noRefs: true
|
|
@@ -175,7 +173,7 @@ function jsonToYaml(jsonStr) {
|
|
|
175
173
|
}
|
|
176
174
|
function yamlToJson(yamlStr) {
|
|
177
175
|
try {
|
|
178
|
-
const parsed =
|
|
176
|
+
const parsed = load(yamlStr, { schema: FAILSAFE_SCHEMA });
|
|
179
177
|
return JSON.stringify(parsed, null, 2);
|
|
180
178
|
} catch (error) {
|
|
181
179
|
throw new Error(`Invalid YAML format: ${error instanceof Error ? error.message : String(error)}`);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@datum-cloud/datum-ui",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.3.0",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
7
7
|
"url": "https://github.com/datum-cloud/datum-ui"
|
|
@@ -420,7 +420,7 @@
|
|
|
420
420
|
"@tiptap/starter-kit": ">=3",
|
|
421
421
|
"date-fns": ">=4.1.0",
|
|
422
422
|
"date-fns-tz": ">=3",
|
|
423
|
-
"js-yaml": "
|
|
423
|
+
"js-yaml": ">=4.2.0",
|
|
424
424
|
"leaflet": ">=1.9",
|
|
425
425
|
"leaflet-draw": ">=1",
|
|
426
426
|
"leaflet.fullscreen": ">=5",
|
|
@@ -430,16 +430,16 @@
|
|
|
430
430
|
"motion": ">=11",
|
|
431
431
|
"nprogress": ">=0.2",
|
|
432
432
|
"nuqs": ">=2",
|
|
433
|
-
"react": ">=19",
|
|
434
|
-
"react-day-picker": ">=9",
|
|
435
|
-
"react-dom": ">=19",
|
|
436
|
-
"react-dropzone": ">=14",
|
|
437
|
-
"react-hook-form": ">=7.
|
|
433
|
+
"react": ">=19.2.7",
|
|
434
|
+
"react-day-picker": ">=9.14.0",
|
|
435
|
+
"react-dom": ">=19.2.7",
|
|
436
|
+
"react-dropzone": ">=14.4.1",
|
|
437
|
+
"react-hook-form": ">=7.80.0",
|
|
438
438
|
"react-leaflet": ">=5",
|
|
439
439
|
"react-leaflet-markercluster": ">=5.0.0-rc.0",
|
|
440
|
-
"react-number-format": ">=5",
|
|
440
|
+
"react-number-format": ">=5.4.5",
|
|
441
441
|
"recharts": ">=2",
|
|
442
|
-
"sonner": ">=2",
|
|
442
|
+
"sonner": ">=2.0.7",
|
|
443
443
|
"zod": ">=4"
|
|
444
444
|
},
|
|
445
445
|
"peerDependenciesMeta": {
|
|
@@ -509,7 +509,9 @@
|
|
|
509
509
|
"leaflet.markercluster": {
|
|
510
510
|
"optional": true
|
|
511
511
|
},
|
|
512
|
-
"lucide-react": {
|
|
512
|
+
"lucide-react": {
|
|
513
|
+
"optional": false
|
|
514
|
+
},
|
|
513
515
|
"monaco-editor": {
|
|
514
516
|
"optional": true
|
|
515
517
|
},
|
|
@@ -552,66 +554,65 @@
|
|
|
552
554
|
},
|
|
553
555
|
"dependencies": {
|
|
554
556
|
"@dnd-kit/utilities": "^3.2.2",
|
|
555
|
-
"@radix-ui/react-avatar": "^1.
|
|
556
|
-
"@radix-ui/react-checkbox": "^1.3.
|
|
557
|
-
"@radix-ui/react-collapsible": "^1.1.
|
|
558
|
-
"@radix-ui/react-dialog": "^1.1.
|
|
559
|
-
"@radix-ui/react-dropdown-menu": "^2.1.
|
|
560
|
-
"@radix-ui/react-hover-card": "^1.1.
|
|
561
|
-
"@radix-ui/react-label": "^2.1.
|
|
562
|
-
"@radix-ui/react-popover": "^1.1.
|
|
563
|
-
"@radix-ui/react-radio-group": "^1.
|
|
564
|
-
"@radix-ui/react-select": "^2.
|
|
565
|
-
"@radix-ui/react-separator": "^1.1.
|
|
566
|
-
"@radix-ui/react-slot": "^1.
|
|
567
|
-
"@radix-ui/react-switch": "^1.
|
|
568
|
-
"@radix-ui/react-tabs": "^1.1.
|
|
569
|
-
"@radix-ui/react-tooltip": "^1.2.
|
|
570
|
-
"@radix-ui/react-visually-hidden": "^1.2.
|
|
557
|
+
"@radix-ui/react-avatar": "^1.2.0",
|
|
558
|
+
"@radix-ui/react-checkbox": "^1.3.5",
|
|
559
|
+
"@radix-ui/react-collapsible": "^1.1.14",
|
|
560
|
+
"@radix-ui/react-dialog": "^1.1.17",
|
|
561
|
+
"@radix-ui/react-dropdown-menu": "^2.1.18",
|
|
562
|
+
"@radix-ui/react-hover-card": "^1.1.17",
|
|
563
|
+
"@radix-ui/react-label": "^2.1.10",
|
|
564
|
+
"@radix-ui/react-popover": "^1.1.17",
|
|
565
|
+
"@radix-ui/react-radio-group": "^1.4.1",
|
|
566
|
+
"@radix-ui/react-select": "^2.3.1",
|
|
567
|
+
"@radix-ui/react-separator": "^1.1.10",
|
|
568
|
+
"@radix-ui/react-slot": "^1.3.0",
|
|
569
|
+
"@radix-ui/react-switch": "^1.3.1",
|
|
570
|
+
"@radix-ui/react-tabs": "^1.1.15",
|
|
571
|
+
"@radix-ui/react-tooltip": "^1.2.10",
|
|
572
|
+
"@radix-ui/react-visually-hidden": "^1.2.6",
|
|
571
573
|
"class-variance-authority": "^0.7.1",
|
|
572
574
|
"clsx": "^2.1.1",
|
|
573
575
|
"cmdk": "^1.1.1",
|
|
574
|
-
"isomorphic-dompurify": "^3.
|
|
576
|
+
"isomorphic-dompurify": "^3.18.0",
|
|
575
577
|
"tailwind-merge": "^3.6.0",
|
|
576
578
|
"tw-animate-css": "^1.4.0"
|
|
577
579
|
},
|
|
578
580
|
"devDependencies": {
|
|
579
|
-
"@conform-to/react": "^1.19.
|
|
580
|
-
"@conform-to/zod": "^1.19.
|
|
581
|
+
"@conform-to/react": "^1.19.4",
|
|
582
|
+
"@conform-to/zod": "^1.19.4",
|
|
581
583
|
"@dnd-kit/core": "^6.3.1",
|
|
582
584
|
"@dnd-kit/sortable": "^10.0.0",
|
|
583
585
|
"@hookform/resolvers": "^5.4.0",
|
|
584
586
|
"@monaco-editor/react": "^4.7.0",
|
|
585
|
-
"@stepperize/react": "^
|
|
587
|
+
"@stepperize/react": "^7.0.0",
|
|
586
588
|
"@tanstack/react-table": "^8.21.3",
|
|
587
|
-
"@tanstack/react-virtual": "^3.14.
|
|
589
|
+
"@tanstack/react-virtual": "^3.14.3",
|
|
588
590
|
"@testing-library/jest-dom": "^6.9.1",
|
|
589
591
|
"@testing-library/react": "^16.3.2",
|
|
590
592
|
"@testing-library/user-event": "^14.6.1",
|
|
591
|
-
"@tiptap/extension-character-count": "^3.
|
|
592
|
-
"@tiptap/extension-link": "^3.
|
|
593
|
-
"@tiptap/extension-placeholder": "^3.
|
|
594
|
-
"@tiptap/extension-underline": "^3.
|
|
595
|
-
"@tiptap/react": "^3.
|
|
596
|
-
"@tiptap/starter-kit": "^3.
|
|
597
|
-
"@types/js-yaml": "^4.0.9",
|
|
593
|
+
"@tiptap/extension-character-count": "^3.27.1",
|
|
594
|
+
"@tiptap/extension-link": "^3.27.1",
|
|
595
|
+
"@tiptap/extension-placeholder": "^3.27.1",
|
|
596
|
+
"@tiptap/extension-underline": "^3.27.1",
|
|
597
|
+
"@tiptap/react": "^3.27.1",
|
|
598
|
+
"@tiptap/starter-kit": "^3.27.1",
|
|
598
599
|
"@types/leaflet": "^1.9.21",
|
|
599
600
|
"@types/leaflet-draw": "^1.0.13",
|
|
600
601
|
"@types/leaflet.fullscreen": "^5.2.0",
|
|
601
602
|
"@types/leaflet.markercluster": "^1.5.6",
|
|
602
603
|
"@types/nprogress": "^0.2.3",
|
|
603
|
-
"@types/react": "^19.2.
|
|
604
|
+
"@types/react": "^19.2.17",
|
|
604
605
|
"@types/react-dom": "^19.2.3",
|
|
605
606
|
"date-fns": "^4.4.0",
|
|
606
607
|
"date-fns-tz": "^3.2.0",
|
|
607
|
-
"eslint": "^10.
|
|
608
|
-
"js-yaml": "^
|
|
608
|
+
"eslint": "^10.5.0",
|
|
609
|
+
"js-yaml": "^5.0.0",
|
|
609
610
|
"jsdom": "^29.1.1",
|
|
610
611
|
"leaflet": "^1.9.4",
|
|
611
612
|
"leaflet-draw": "^1.0.4",
|
|
612
613
|
"leaflet.fullscreen": "^5.3.1",
|
|
613
614
|
"leaflet.markercluster": "^1.5.3",
|
|
614
|
-
"lucide-react": "^1.
|
|
615
|
+
"lucide-react": "^1.21.0",
|
|
615
616
|
"monaco-editor": "^0.55.1",
|
|
616
617
|
"motion": "^12.40.0",
|
|
617
618
|
"nprogress": "^0.2.0",
|
|
@@ -620,18 +621,18 @@
|
|
|
620
621
|
"react-day-picker": "^10.0.1",
|
|
621
622
|
"react-dom": "^19.2.7",
|
|
622
623
|
"react-dropzone": "^15.0.0",
|
|
623
|
-
"react-hook-form": "^7.
|
|
624
|
+
"react-hook-form": "^7.80.0",
|
|
624
625
|
"react-leaflet": "^5.0.0",
|
|
625
626
|
"react-leaflet-markercluster": "5.0.0-rc.0",
|
|
626
627
|
"react-number-format": "^5.4.5",
|
|
627
628
|
"sonner": "^2.0.7",
|
|
628
|
-
"tailwindcss": "^4.3.
|
|
629
|
-
"tsdown": "^0.22.
|
|
629
|
+
"tailwindcss": "^4.3.1",
|
|
630
|
+
"tsdown": "^0.22.3",
|
|
630
631
|
"typescript": "^6.0.3",
|
|
631
|
-
"vitest": "^4.1.
|
|
632
|
+
"vitest": "^4.1.9",
|
|
632
633
|
"zod": "^4.4.3",
|
|
633
|
-
"@repo/
|
|
634
|
-
"@repo/
|
|
634
|
+
"@repo/config": "0.0.0",
|
|
635
|
+
"@repo/shadcn": "0.0.0"
|
|
635
636
|
},
|
|
636
637
|
"publishConfig": {
|
|
637
638
|
"access": "public"
|
|
@@ -11,6 +11,78 @@ import { Ban, CheckCircle2, CircleAlert, CircleCheck, CornerDownRightIcon, FileI
|
|
|
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
|
|
14
86
|
//#region src/components/features/task-queue/engine/executor.ts
|
|
15
87
|
function createTaskContext(task, callbacks) {
|
|
16
88
|
let cancelled = false;
|
|
@@ -110,78 +182,6 @@ async function executeTask(task, callbacks) {
|
|
|
110
182
|
};
|
|
111
183
|
}
|
|
112
184
|
//#endregion
|
|
113
|
-
//#region src/components/features/task-queue/constants.ts
|
|
114
|
-
const TASK_QUEUE_DEFAULTS = {
|
|
115
|
-
concurrency: 3,
|
|
116
|
-
errorStrategy: "continue",
|
|
117
|
-
cancelable: true,
|
|
118
|
-
retryable: true
|
|
119
|
-
};
|
|
120
|
-
const TASK_STORAGE_KEY = "datum-task-queue";
|
|
121
|
-
//#endregion
|
|
122
|
-
//#region src/components/features/task-queue/utils/index.ts
|
|
123
|
-
/**
|
|
124
|
-
* Check if code is running in a browser environment.
|
|
125
|
-
* Used for SSR safety in storage and other browser-dependent code.
|
|
126
|
-
*/
|
|
127
|
-
function isBrowser() {
|
|
128
|
-
return typeof window !== "undefined" && typeof localStorage !== "undefined";
|
|
129
|
-
}
|
|
130
|
-
function generateTaskId() {
|
|
131
|
-
if (typeof crypto !== "undefined" && typeof crypto.randomUUID === "function") return `task_${crypto.randomUUID()}`;
|
|
132
|
-
return `task_${Date.now()}_${Math.random().toString(36).slice(2, 9)}`;
|
|
133
|
-
}
|
|
134
|
-
/**
|
|
135
|
-
* Extract an ID from an item using common patterns.
|
|
136
|
-
* Checks: primitives (string/number) → obj.id → obj.name → obj.key → obj.uuid
|
|
137
|
-
*/
|
|
138
|
-
function extractItemId(item) {
|
|
139
|
-
if (typeof item === "string" || typeof item === "number") return String(item);
|
|
140
|
-
if (item && typeof item === "object") {
|
|
141
|
-
const obj = item;
|
|
142
|
-
if (typeof obj.id === "string" || typeof obj.id === "number") return String(obj.id);
|
|
143
|
-
if (typeof obj.name === "string") return obj.name;
|
|
144
|
-
if (typeof obj.key === "string") return obj.key;
|
|
145
|
-
if (typeof obj.uuid === "string") return obj.uuid;
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
/**
|
|
149
|
-
* Create metadata for project-scoped tasks.
|
|
150
|
-
* Use this when enqueueing tasks that operate on project resources.
|
|
151
|
-
*/
|
|
152
|
-
function createProjectMetadata(project, org, extra) {
|
|
153
|
-
return {
|
|
154
|
-
scope: "project",
|
|
155
|
-
projectId: project.id,
|
|
156
|
-
projectName: project.name,
|
|
157
|
-
orgId: org.id,
|
|
158
|
-
orgName: org.name,
|
|
159
|
-
...extra
|
|
160
|
-
};
|
|
161
|
-
}
|
|
162
|
-
/**
|
|
163
|
-
* Create metadata for organization-scoped tasks.
|
|
164
|
-
* Use this when enqueueing tasks that operate on org-level resources.
|
|
165
|
-
*/
|
|
166
|
-
function createOrgMetadata(org, extra) {
|
|
167
|
-
return {
|
|
168
|
-
scope: "org",
|
|
169
|
-
orgId: org.id,
|
|
170
|
-
orgName: org.name,
|
|
171
|
-
...extra
|
|
172
|
-
};
|
|
173
|
-
}
|
|
174
|
-
/**
|
|
175
|
-
* Create metadata for user-scoped tasks.
|
|
176
|
-
* Use this when enqueueing tasks that operate on user-level resources.
|
|
177
|
-
*/
|
|
178
|
-
function createUserMetadata(extra) {
|
|
179
|
-
return {
|
|
180
|
-
scope: "user",
|
|
181
|
-
...extra
|
|
182
|
-
};
|
|
183
|
-
}
|
|
184
|
-
//#endregion
|
|
185
185
|
//#region src/components/features/task-queue/engine/storage/local-storage.ts
|
|
186
186
|
var LocalTaskStorage = class {
|
|
187
187
|
key;
|