@datum-cloud/datum-ui 1.2.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.
@@ -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-CMn5DR7E.mjs";
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 };
@@ -9,9 +9,11 @@ declare namespace Stepper {
9
9
  labelOrientation?: StepperLabelOrientation;
10
10
  tracking?: boolean;
11
11
  }
12
- type DefineProps<Steps extends Stepperize.Step[]> = Omit<Stepperize.StepperReturn<Steps>, 'Scoped'> & {
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.ScopedProps<Steps>, 'children'> & Omit<React.ComponentProps<'div'>, 'children'> & Stepper.ConfigProps & {
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,CAuNzG;AAgMD,kBAAU,OAAO,CAAC;IAChB,KAAY,cAAc,GAAG,YAAY,GAAG,UAAU,GAAG,QAAQ,CAAA;IACjE,KAAY,uBAAuB,GAAG,YAAY,GAAG,UAAU,CAAA;IAE/D,UAAiB,WAAW;QAC1B,OAAO,CAAC,EAAE,cAAc,CAAA;QACxB,gBAAgB,CAAC,EAAE,uBAAuB,CAAA;QAC1C,QAAQ,CAAC,EAAE,OAAO,CAAA;KACnB;IAED,KAAY,WAAW,CAAC,KAAK,SAAS,UAAU,CAAC,IAAI,EAAE,IAAI,IAAI,CAC7D,UAAU,CAAC,aAAa,CAAC,KAAK,CAAC,EAC/B,QAAQ,CACT,GAAG;QACF,OAAO,EAAE;YACP,QAAQ,EAAE,CACR,KAAK,EAAE,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,KAAK,CAAC,EAAE,UAAU,CAAC,GAClD,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,UAAU,CAAC,GAC7C,OAAO,CAAC,WAAW,GAAG;gBACtB,QAAQ,EACJ,KAAK,CAAC,SAAS,GACf,CAAC,CAAC,KAAK,EAAE;oBAAE,OAAO,EAAE,UAAU,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA;iBAAE,KAAK,KAAK,CAAC,SAAS,CAAC,CAAA;aACzE,KACA,KAAK,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KAAK,CAAC,KAAK,KAAK,CAAC,YAAY,CAAA;YACtE,IAAI,EAAE,CACJ,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,QAAQ,CAAC,GAAG;gBACtC,EAAE,EAAE,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC,KAAK,CAAC,CAAA;gBAC5B,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;gBACtB,OAAO,CAAC,EAAE,SAAS,GAAG,WAAW,CAAA;aAClC,KACE,KAAK,CAAC,YAAY,CAAA;YACvB,KAAK,EAAE,CAAC,KAAK,EAAE,YAAY,CAAC,IAAI,CAAC,KAAK,KAAK,CAAC,YAAY,CAAA;YACxD,WAAW,EAAE,CAAC,KAAK,EAAE,YAAY,CAAC,GAAG,CAAC,KAAK,KAAK,CAAC,YAAY,CAAA;YAC7D,KAAK,EAAE,CAAC,KAAK,EAAE,YAAY,CAAC,KAAK,CAAC,KAAK,KAAK,CAAC,YAAY,CAAA;YACzD,QAAQ,EAAE,CAAC,KAAK,EAAE,YAAY,CAAC,KAAK,CAAC,KAAK,KAAK,CAAC,YAAY,CAAA;SAC7D,CAAA;KACF;IAED,UAAiB,wBAAwB;QACvC,WAAW,EAAE,MAAM,CAAA;QACnB,UAAU,EAAE,MAAM,CAAA;QAClB,IAAI,CAAC,EAAE,MAAM,CAAA;QACb,WAAW,CAAC,EAAE,MAAM,CAAA;KACrB;CACF;AAED,KAAK,YAAY,CAAC,CAAC,SAAS,KAAK,CAAC,WAAW,IAAI,KAAK,CAAC,cAAc,CAAC,CAAC,CAAC,GAAG;IACzE,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB,CAAA;AAED,OAAO,EAAE,aAAa,EAAE,CAAA"}
@@ -2,7 +2,7 @@ import { t as cn } from "../../cn-dlASUkDY.mjs";
2
2
  import { t as Button } from "../../button-B_N7A8gv.mjs";
3
3
  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-CkN6jcwU.mjs";
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 ? { initialStep: 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.state.current.data.id) ?? steps[0], [steps, stepper.state.current.data.id]),
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 allMetadata = steps.reduce((acc, step) => ({
94
+ const allData = steps.reduce((acc, step) => ({
95
95
  ...acc,
96
- ...stepper.metadata.get(step.id) || {}
96
+ ...stepper.data.get(step.id) || {}
97
97
  }), {});
98
98
  return {
99
99
  ...defaultValues,
100
- ...allMetadata
100
+ ...allData
101
101
  };
102
102
  }, [
103
103
  steps,
104
104
  stepper,
105
105
  defaultValues,
106
- stepper.state.current.data.id
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.state.current.data.id);
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.lookup.getIndex(stepper.state.current.data.id);
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.metadata.set(stepper.state.current.data.id, data);
128
- if (stepper.state.isLast) {
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.metadata.get(step.id) || {}
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 = stepper.lookup.getNext(stepper.state.current.data.id)?.id;
142
+ const nextStepId = steps[currentIndex + 1]?.id;
143
143
  if (nextStepId) {
144
- stepper.navigation.goTo(nextStepId);
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.metadata.set(stepper.state.current.data.id, currentValues);
168
- const prevStepId = stepper.lookup.getPrev(stepper.state.current.data.id)?.id;
168
+ if (Object.keys(currentValues).length > 0) stepper.data.set(currentValues);
169
+ const prevStepId = steps[currentIndex - 1]?.id;
169
170
  if (prevStepId) {
170
- stepper.navigation.goTo(prevStepId);
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 (stepper.lookup.getIndex(stepId) < currentIndex) {
182
+ if (steps.findIndex((s) => s.id === stepId) < currentIndex) {
180
183
  const currentValues = instance.getValues();
181
- if (Object.keys(currentValues).length > 0) stepper.metadata.set(stepper.state.current.data.id, currentValues);
182
- stepper.navigation.goTo(stepId);
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.metadata.get(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.metadata.get(step.id) || {}
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.state.isFirst,
206
- isLast: stepper.state.isLast,
209
+ isFirst: stepper.isFirst,
210
+ isLast: stepper.isLast,
207
211
  getStepData,
208
212
  getAllStepData,
209
- utils: { getIndex: (stepId) => stepper.lookup.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.state.isFirst,
254
- isLast: stepper.state.isLast,
257
+ isFirst: stepper.isFirst,
258
+ isLast: stepper.isLast,
255
259
  getStepData,
256
260
  getAllStepData
257
261
  };
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-CMn5DR7E.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-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-CkN6jcwU.mjs";
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-CPiwzDqY.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-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";
@@ -1,2 +1,2 @@
1
- import { t as defineStepper } from "../stepper-CkN6jcwU.mjs";
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 { Scoped, useStepper, steps: stepList, Stepper: StepperizePrimitives } = Stepperize.defineStepper(...steps);
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(Scoped, {
55
- initialStep: props.initialStep,
56
- initialMetadata: props.initialMetadata,
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 = stepper.lookup.getIndex(props.of);
83
+ const stepIndex = steps.findIndex((s) => s.id === props.of);
84
84
  const step = steps[stepIndex];
85
- const currentIndex = stepper.lookup.getIndex(stepper.state.current.data.id);
86
- const isLast = stepper.lookup.getLast().id === props.of;
87
- const isActive = stepper.state.current.data.id === props.of;
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, stepper.lookup.getNext(props.of), stepper.lookup.getPrev(props.of)),
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-CPiwzDqY.mjs";
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 yaml from "js-yaml";
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
- yaml.load(yamlStr, { schema: yaml.FAILSAFE_SCHEMA });
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
- const parsed = yaml.load(yamlStr, { schema: yaml.FAILSAFE_SCHEMA });
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
- const parsed = JSON.parse(jsonStr);
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 = yaml.load(yamlStr, { schema: yaml.FAILSAFE_SCHEMA });
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.2.0",
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": "^4.1.1",
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.55",
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.1.11",
556
- "@radix-ui/react-checkbox": "^1.3.3",
557
- "@radix-ui/react-collapsible": "^1.1.12",
558
- "@radix-ui/react-dialog": "^1.1.15",
559
- "@radix-ui/react-dropdown-menu": "^2.1.16",
560
- "@radix-ui/react-hover-card": "^1.1.15",
561
- "@radix-ui/react-label": "^2.1.8",
562
- "@radix-ui/react-popover": "^1.1.15",
563
- "@radix-ui/react-radio-group": "^1.3.8",
564
- "@radix-ui/react-select": "^2.2.6",
565
- "@radix-ui/react-separator": "^1.1.8",
566
- "@radix-ui/react-slot": "^1.2.4",
567
- "@radix-ui/react-switch": "^1.2.6",
568
- "@radix-ui/react-tabs": "^1.1.13",
569
- "@radix-ui/react-tooltip": "^1.2.8",
570
- "@radix-ui/react-visually-hidden": "^1.2.4",
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.15.0",
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.3",
580
- "@conform-to/zod": "^1.19.3",
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": "^6.1.0",
587
+ "@stepperize/react": "^7.0.0",
586
588
  "@tanstack/react-table": "^8.21.3",
587
- "@tanstack/react-virtual": "^3.14.1",
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.24.0",
592
- "@tiptap/extension-link": "^3.24.0",
593
- "@tiptap/extension-placeholder": "^3.24.0",
594
- "@tiptap/extension-underline": "^3.24.0",
595
- "@tiptap/react": "^3.24.0",
596
- "@tiptap/starter-kit": "^3.24.0",
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.16",
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.4.1",
608
- "js-yaml": "^4.2.0",
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.17.0",
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.77.0",
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.0",
629
- "tsdown": "^0.22.1",
629
+ "tailwindcss": "^4.3.1",
630
+ "tsdown": "^0.22.3",
630
631
  "typescript": "^6.0.3",
631
- "vitest": "^4.1.8",
632
+ "vitest": "^4.1.9",
632
633
  "zod": "^4.4.3",
633
- "@repo/shadcn": "0.0.0",
634
- "@repo/config": "0.0.0"
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;