@tulip-systems/core 0.9.0 → 0.10.1
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/commands.d.mts +3 -2
- package/dist/commands.mjs +2 -1
- package/dist/components/client.d.mts +2 -1
- package/dist/components/client.mjs +2 -1
- package/dist/components/editor/extensions/file-handler/extension.d.mts +1 -1
- package/dist/components/editor/extensions/image/extension.d.mts +1 -1
- package/dist/components/editor/extensions/skeleton/extension.mjs +1 -1
- package/dist/components/editor/lib/constants.d.mts +1 -1
- package/dist/components/editor/lib/extensions.d.mts +1 -1
- package/dist/components/editor/lib/helpers.d.mts +5 -1
- package/dist/components/editor/lib/helpers.mjs +8 -1
- package/dist/components/layouts/root-layout.server.d.mts +3 -2
- package/dist/components/layouts/root-layout.server.mjs +1 -3
- package/dist/components/server.d.mts +2 -2
- package/dist/components/themes/color-theme-provider.client.d.mts +27 -0
- package/dist/components/themes/color-theme-provider.client.mjs +59 -0
- package/dist/components/themes/color-theme.d.mts +29 -0
- package/dist/components/themes/color-theme.mjs +32 -0
- package/dist/components/ui/badge.d.mts +1 -1
- package/dist/components/ui/button.d.mts +1 -1
- package/dist/components/ui/item.d.mts +1 -1
- package/dist/components.d.mts +3 -2
- package/dist/components.mjs +3 -2
- package/dist/data-tables/client.d.mts +2 -1
- package/dist/data-tables/client.mjs +2 -1
- package/dist/modules/auth/handler/create-client.client.d.mts +4 -4
- package/dist/modules/commands/components/menus/context-menu.client.d.mts +6 -7
- package/dist/modules/commands/components/menus/dropdown-menu.client.d.mts +6 -7
- package/dist/modules/commands/components/menus/floating-menu.client.d.mts +6 -7
- package/dist/modules/commands/components/menus/inline-menu.client.d.mts +6 -7
- package/dist/modules/commands/components/menus/responsive-menu.client.d.mts +5 -6
- package/dist/modules/commands/components/render-command.mjs +3 -5
- package/dist/modules/commands/lib/builder.d.mts +114 -18
- package/dist/modules/commands/lib/builder.mjs +42 -7
- package/dist/modules/commands/lib/registery.d.mts +47 -14
- package/dist/modules/commands/lib/registery.mjs +76 -16
- package/dist/modules/commands/lib/utils.d.mts +11 -0
- package/dist/modules/commands/lib/utils.mjs +14 -0
- package/dist/modules/data-tables/components/footer.mjs +3 -0
- package/dist/modules/data-tables/hooks/use-context.client.d.mts +2 -2
- package/dist/modules/data-tables/lib/types.d.mts +3 -3
- package/dist/modules/data-tables/strategies/local/components.mjs +25 -0
- package/dist/modules/data-tables/strategies/local/strategy.d.mts +12 -0
- package/dist/modules/data-tables/strategies/local/strategy.mjs +31 -0
- package/dist/modules/inline/components/inputs/combobox-dropdown.client.d.mts +4 -3
- package/dist/modules/inline/components/inputs/combobox.client.d.mts +4 -3
- package/dist/modules/inline/components/inputs/date-time.client.d.mts +4 -3
- package/dist/modules/inline/components/inputs/editor.client.d.mts +4 -3
- package/dist/modules/inline/components/inputs/input.client.d.mts +7 -5
- package/dist/modules/inline/components/inputs/select.client.d.mts +4 -3
- package/dist/modules/inline/components/inputs/switch.client.d.mts +4 -3
- package/dist/modules/inline/lib/variants.d.mts +1 -1
- package/dist/modules/router/lib/query-client.d.mts +2 -1
- package/dist/modules/router/lib/query-client.mjs +2 -2
- package/dist/modules/storage/components/dropzone.client.d.mts +2 -2
- package/dist/modules/storage/lib/service.server.d.mts +21 -21
- package/dist/router.d.mts +2 -1
- package/dist/router.mjs +2 -1
- package/dist/src/components/editor/extensions/file-handler/extension.d.mts +1 -1
- package/dist/src/components/editor/extensions/image/extension.d.mts +1 -1
- package/dist/src/components/editor/extensions/skeleton/extension.mjs +1 -1
- package/dist/src/components/editor/lib/constants.d.mts +1 -1
- package/dist/src/components/editor/lib/extensions.d.mts +1 -1
- package/dist/src/components/editor/lib/helpers.d.mts +5 -1
- package/dist/src/components/editor/lib/helpers.mjs +8 -1
- package/dist/src/components/layouts/root-layout.server.d.mts +3 -2
- package/dist/src/components/layouts/root-layout.server.mjs +1 -3
- package/dist/src/components/themes/color-theme-provider.client.d.mts +27 -0
- package/dist/src/components/themes/color-theme-provider.client.mjs +59 -0
- package/dist/src/components/themes/color-theme.d.mts +29 -0
- package/dist/src/components/themes/color-theme.mjs +32 -0
- package/dist/src/components/ui/badge.d.mts +1 -1
- package/dist/src/components/ui/button-group.d.mts +1 -1
- package/dist/src/components/ui/button.d.mts +2 -2
- package/dist/src/components/ui/field.client.d.mts +1 -1
- package/dist/src/modules/commands/components/menus/context-menu.client.d.mts +6 -7
- package/dist/src/modules/commands/components/menus/dropdown-menu.client.d.mts +6 -7
- package/dist/src/modules/commands/components/menus/floating-menu.client.d.mts +6 -7
- package/dist/src/modules/commands/components/menus/inline-menu.client.d.mts +6 -7
- package/dist/src/modules/commands/components/menus/responsive-menu.client.d.mts +5 -6
- package/dist/src/modules/commands/components/render-command.mjs +3 -5
- package/dist/src/modules/commands/lib/builder.d.mts +114 -18
- package/dist/src/modules/commands/lib/builder.mjs +42 -7
- package/dist/src/modules/commands/lib/registery.d.mts +47 -14
- package/dist/src/modules/commands/lib/registery.mjs +76 -16
- package/dist/src/modules/commands/lib/utils.d.mts +11 -0
- package/dist/src/modules/commands/lib/utils.mjs +14 -0
- package/dist/src/modules/data-tables/components/footer.mjs +3 -0
- package/dist/src/modules/data-tables/hooks/use-context.client.d.mts +2 -2
- package/dist/src/modules/data-tables/lib/types.d.mts +3 -3
- package/dist/src/modules/data-tables/strategies/local/components.mjs +25 -0
- package/dist/src/modules/data-tables/strategies/local/strategy.d.mts +12 -0
- package/dist/src/modules/data-tables/strategies/local/strategy.mjs +31 -0
- package/dist/src/modules/inline/components/inputs/combobox-dropdown.client.d.mts +4 -3
- package/dist/src/modules/inline/components/inputs/combobox.client.d.mts +4 -3
- package/dist/src/modules/inline/components/inputs/date-time.client.d.mts +4 -3
- package/dist/src/modules/inline/components/inputs/editor.client.d.mts +4 -3
- package/dist/src/modules/inline/components/inputs/input.client.d.mts +7 -5
- package/dist/src/modules/inline/components/inputs/select.client.d.mts +4 -3
- package/dist/src/modules/inline/components/inputs/switch.client.d.mts +4 -3
- package/dist/src/modules/router/lib/query-client.d.mts +2 -1
- package/dist/src/modules/router/lib/query-client.mjs +2 -2
- package/package.json +1 -1
- package/src/components/editor/lib/helpers.ts +8 -0
- package/src/components/entry.client.ts +1 -1
- package/src/components/entry.ts +1 -1
- package/src/components/layouts/root-layout.server.tsx +4 -2
- package/src/components/themes/color-theme-provider.client.tsx +82 -0
- package/src/components/themes/color-theme.ts +32 -0
- package/src/modules/commands/components/menus/context-menu.client.tsx +11 -11
- package/src/modules/commands/components/menus/dropdown-menu.client.tsx +9 -10
- package/src/modules/commands/components/menus/floating-menu.client.tsx +9 -10
- package/src/modules/commands/components/menus/inline-menu.client.tsx +9 -10
- package/src/modules/commands/components/menus/responsive-menu.client.tsx +7 -8
- package/src/modules/commands/components/render-command.tsx +17 -13
- package/src/modules/commands/entry.ts +1 -0
- package/src/modules/commands/lib/builder.ts +216 -36
- package/src/modules/commands/lib/registery.ts +210 -47
- package/src/modules/commands/lib/utils.ts +10 -0
- package/src/modules/data-tables/components/footer.tsx +9 -0
- package/src/modules/data-tables/entry.client.ts +1 -0
- package/src/modules/data-tables/hooks/use-context.client.tsx +2 -2
- package/src/modules/data-tables/lib/types.ts +3 -3
- package/src/modules/data-tables/strategies/local/components.tsx +17 -0
- package/src/modules/data-tables/strategies/local/strategy.ts +33 -0
- package/src/modules/inline/components/inputs/combobox-dropdown.client.tsx +11 -5
- package/src/modules/inline/components/inputs/combobox.client.tsx +11 -5
- package/src/modules/inline/components/inputs/date-time.client.tsx +11 -5
- package/src/modules/inline/components/inputs/editor.client.tsx +11 -5
- package/src/modules/inline/components/inputs/input.client.tsx +21 -9
- package/src/modules/inline/components/inputs/select.client.tsx +11 -5
- package/src/modules/inline/components/inputs/switch.client.tsx +11 -5
- package/src/modules/router/entry.ts +1 -0
- package/src/modules/router/lib/query-client.ts +2 -2
- package/src/styles.css +317 -2
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { TableStrategy } from "../../lib/types.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/modules/data-tables/strategies/local/strategy.d.ts
|
|
4
|
+
type UseLocalStrategyInput = {
|
|
5
|
+
total?: number;
|
|
6
|
+
};
|
|
7
|
+
type LocalStrategy = typeof useLocalStrategy;
|
|
8
|
+
declare function useLocalStrategy({
|
|
9
|
+
total
|
|
10
|
+
}?: UseLocalStrategyInput): TableStrategy;
|
|
11
|
+
//#endregion
|
|
12
|
+
export { LocalStrategy, UseLocalStrategyInput, useLocalStrategy };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { tableSearchParams } from "../../lib/search-params.mjs";
|
|
4
|
+
import { handleSortingChange } from "../helpers/sorting.mjs";
|
|
5
|
+
import { useQueryStates } from "nuqs";
|
|
6
|
+
|
|
7
|
+
//#region src/modules/data-tables/strategies/local/strategy.ts
|
|
8
|
+
function useLocalStrategy({ total } = {}) {
|
|
9
|
+
const [query, setQuery] = useQueryStates(tableSearchParams);
|
|
10
|
+
const sortingState = query.sort ? [{
|
|
11
|
+
id: query.sort,
|
|
12
|
+
desc: query.order === "desc"
|
|
13
|
+
}] : [];
|
|
14
|
+
const resetCursor = () => null;
|
|
15
|
+
return {
|
|
16
|
+
name: "local",
|
|
17
|
+
rowCount: total,
|
|
18
|
+
resetCursor,
|
|
19
|
+
tableSearchParams,
|
|
20
|
+
sortingState,
|
|
21
|
+
manualSorting: true,
|
|
22
|
+
onSortingChange: handleSortingChange({
|
|
23
|
+
sortingState,
|
|
24
|
+
setQuery,
|
|
25
|
+
resetCursor
|
|
26
|
+
})
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
//#endregion
|
|
31
|
+
export { useLocalStrategy };
|
|
@@ -7,10 +7,11 @@ import { DefaultError } from "@tanstack/react-query";
|
|
|
7
7
|
|
|
8
8
|
//#region src/modules/inline/components/inputs/combobox-dropdown.client.d.ts
|
|
9
9
|
type ComboboxDropdownInlineTrigger = "commit";
|
|
10
|
-
type
|
|
10
|
+
type InlineStringSchema = z$1.ZodType<string | null, string | null> | z$1.ZodType<string, string>;
|
|
11
|
+
type InlineEditComboboxDropdownProps<TValue extends ComboboxDropdownItem, TSchema extends InlineStringSchema = z$1.ZodType<string | null, string | null>, TData = unknown, TError = DefaultError, TVariables = unknown, TOnMutateResult = unknown> = useInlineEditOptions<ComboboxDropdownInlineTrigger, TSchema, TData, TError, TVariables, TOnMutateResult> & InlineEditVariantsProps & Omit<ComboboxDropdownProps<TValue>, "onSelect"> & {
|
|
11
12
|
onSelect?: ComboboxDropdownProps<TValue>["onSelect"];
|
|
12
13
|
};
|
|
13
|
-
declare function InlineComboboxDropdown<TValue extends ComboboxDropdownItem, TData = unknown, TError = DefaultError, TVariables = unknown, TOnMutateResult = unknown>({
|
|
14
|
+
declare function InlineComboboxDropdown<TValue extends ComboboxDropdownItem, TSchema extends InlineStringSchema = z$1.ZodType<string | null, string | null>, TData = unknown, TError = DefaultError, TVariables = unknown, TOnMutateResult = unknown>({
|
|
14
15
|
selectedItem,
|
|
15
16
|
variant,
|
|
16
17
|
className,
|
|
@@ -22,6 +23,6 @@ declare function InlineComboboxDropdown<TValue extends ComboboxDropdownItem, TDa
|
|
|
22
23
|
strategy,
|
|
23
24
|
disabled,
|
|
24
25
|
...props
|
|
25
|
-
}: InlineEditComboboxDropdownProps<TValue, TData, TError, TVariables, TOnMutateResult>): react_jsx_runtime0.JSX.Element;
|
|
26
|
+
}: InlineEditComboboxDropdownProps<TValue, TSchema, TData, TError, TVariables, TOnMutateResult>): react_jsx_runtime0.JSX.Element;
|
|
26
27
|
//#endregion
|
|
27
28
|
export { InlineComboboxDropdown, InlineEditComboboxDropdownProps };
|
|
@@ -6,8 +6,9 @@ import { DefaultError } from "@tanstack/react-query";
|
|
|
6
6
|
|
|
7
7
|
//#region src/modules/inline/components/inputs/combobox.client.d.ts
|
|
8
8
|
type ComboboxInlineTrigger = "commit";
|
|
9
|
-
type
|
|
10
|
-
|
|
9
|
+
type InlineStringSchema = z$1.ZodType<string | null, string | null> | z$1.ZodType<string, string>;
|
|
10
|
+
type InlineComboboxProps<TValue, TSchema extends InlineStringSchema = z$1.ZodType<string | null, string | null>, TData = unknown, TError = DefaultError, TVariables = unknown, TOnMutateResult = unknown> = useInlineEditOptions<ComboboxInlineTrigger, TSchema, TData, TError, TVariables, TOnMutateResult> & Omit<ComboboxProps<TValue>, "value">;
|
|
11
|
+
declare function InlineCombobox<TValue, TSchema extends InlineStringSchema = z$1.ZodType<string | null, string | null>, TData = unknown, TError = DefaultError, TVariables = unknown, TOnMutateResult = unknown>({
|
|
11
12
|
initialValue,
|
|
12
13
|
variables,
|
|
13
14
|
mutation,
|
|
@@ -17,6 +18,6 @@ declare function InlineCombobox<TValue, TData = unknown, TError = DefaultError,
|
|
|
17
18
|
disabled,
|
|
18
19
|
strategy,
|
|
19
20
|
...props
|
|
20
|
-
}: InlineComboboxProps<TValue, TData, TError, TVariables, TOnMutateResult>): react_jsx_runtime0.JSX.Element;
|
|
21
|
+
}: InlineComboboxProps<TValue, TSchema, TData, TError, TVariables, TOnMutateResult>): react_jsx_runtime0.JSX.Element;
|
|
21
22
|
//#endregion
|
|
22
23
|
export { InlineCombobox, InlineComboboxProps };
|
|
@@ -8,8 +8,9 @@ import { DefaultError } from "@tanstack/react-query";
|
|
|
8
8
|
|
|
9
9
|
//#region src/modules/inline/components/inputs/date-time.client.d.ts
|
|
10
10
|
type DateTimeInlineTrigger = "change" | "blur";
|
|
11
|
-
type
|
|
12
|
-
|
|
11
|
+
type InlineDateTimeSchema = z$1.ZodType<Date | null, Date | null> | z$1.ZodType<Date, Date>;
|
|
12
|
+
type InlineDateTimeInputProps<TSchema extends InlineDateTimeSchema = z$1.ZodType<Date | null, Date | null>, TData = unknown, TError = DefaultError, TVariables = unknown, TOnMutateResult = unknown> = ComponentProps<typeof DateTimeInput> & useInlineEditOptions<DateTimeInlineTrigger, TSchema, TData, TError, TVariables, TOnMutateResult> & InlineEditVariantsProps;
|
|
13
|
+
declare function InlineDateTimeInput<TSchema extends InlineDateTimeSchema = z$1.ZodType<Date | null, Date | null>, TData = unknown, TError = DefaultError, TVariables = unknown, TOnMutateResult = unknown>({
|
|
13
14
|
initialValue,
|
|
14
15
|
variables,
|
|
15
16
|
mutation,
|
|
@@ -19,6 +20,6 @@ declare function InlineDateTimeInput<TData = unknown, TError = DefaultError, TVa
|
|
|
19
20
|
strategy,
|
|
20
21
|
disabled,
|
|
21
22
|
...props
|
|
22
|
-
}: InlineDateTimeInputProps<TData, TError, TVariables, TOnMutateResult>): react_jsx_runtime0.JSX.Element;
|
|
23
|
+
}: InlineDateTimeInputProps<TSchema, TData, TError, TVariables, TOnMutateResult>): react_jsx_runtime0.JSX.Element;
|
|
23
24
|
//#endregion
|
|
24
25
|
export { InlineDateTimeInput };
|
|
@@ -8,8 +8,9 @@ import { DefaultError } from "@tanstack/react-query";
|
|
|
8
8
|
|
|
9
9
|
//#region src/modules/inline/components/inputs/editor.client.d.ts
|
|
10
10
|
type EditorInlineTrigger = "change" | "blur";
|
|
11
|
-
type
|
|
12
|
-
|
|
11
|
+
type InlineEditorSchema = z$1.ZodType<EditorJSONContent | null, EditorJSONContent | null> | z$1.ZodType<EditorJSONContent, EditorJSONContent>;
|
|
12
|
+
type InlineEditorProps<TSchema extends InlineEditorSchema = z$1.ZodType<EditorJSONContent | null, EditorJSONContent | null>, TData = unknown, TError = DefaultError, TVariables = unknown, TOnMutateResult = unknown> = useInlineEditOptions<EditorInlineTrigger, TSchema, TData, TError, TVariables, TOnMutateResult> & InlineEditVariantsProps & Omit<EditorProps, "value" | "onUpdate" | "onBlur" | "variant">;
|
|
13
|
+
declare function InlineEditor<TSchema extends InlineEditorSchema = z$1.ZodType<EditorJSONContent | null, EditorJSONContent | null>, TData = unknown, TError = DefaultError, TVariables = unknown, TOnMutateResult = unknown>({
|
|
13
14
|
initialValue,
|
|
14
15
|
variables,
|
|
15
16
|
mutation,
|
|
@@ -20,6 +21,6 @@ declare function InlineEditor<TData = unknown, TError = DefaultError, TVariables
|
|
|
20
21
|
strategy,
|
|
21
22
|
className,
|
|
22
23
|
children
|
|
23
|
-
}: InlineEditorProps<TData, TError, TVariables, TOnMutateResult>): react_jsx_runtime0.JSX.Element;
|
|
24
|
+
}: InlineEditorProps<TSchema, TData, TError, TVariables, TOnMutateResult>): react_jsx_runtime0.JSX.Element;
|
|
24
25
|
//#endregion
|
|
25
26
|
export { InlineEditor, InlineEditorProps };
|
|
@@ -8,11 +8,13 @@ import { DefaultError } from "@tanstack/react-query";
|
|
|
8
8
|
|
|
9
9
|
//#region src/modules/inline/components/inputs/input.client.d.ts
|
|
10
10
|
type InputInlineTrigger = "change" | "blur";
|
|
11
|
+
type InlineStringSchema = z$1.ZodType<string | null, string | null> | z$1.ZodType<string, string>;
|
|
12
|
+
type InlineNumberSchema = z$1.ZodType<number | null, number | null> | z$1.ZodType<number, number>;
|
|
11
13
|
type InlineEditInputProps<TSchema extends z$1.ZodType, TData = unknown, TError = DefaultError, TVariables = unknown, TOnMutateResult = unknown> = Omit<ComponentProps<typeof Input>, "type"> & useInlineEditOptions<InputInlineTrigger, TSchema, TData, TError, TVariables, TOnMutateResult> & InlineEditVariantsProps;
|
|
12
14
|
/**
|
|
13
15
|
* The inline edit string input component.
|
|
14
16
|
*/
|
|
15
|
-
declare function InlineStringInput<TSchema extends z$1.ZodType<string | null, string | null>, TData = unknown, TError = DefaultError, TVariables = unknown, TOnMutateResult = unknown>({
|
|
17
|
+
declare function InlineStringInput<TSchema extends InlineStringSchema = z$1.ZodType<string | null, string | null>, TData = unknown, TError = DefaultError, TVariables = unknown, TOnMutateResult = unknown>({
|
|
16
18
|
initialValue,
|
|
17
19
|
variables,
|
|
18
20
|
mutation,
|
|
@@ -23,7 +25,7 @@ declare function InlineStringInput<TSchema extends z$1.ZodType<string | null, st
|
|
|
23
25
|
disabled,
|
|
24
26
|
...props
|
|
25
27
|
}: InlineEditInputProps<TSchema, TData, TError, TVariables, TOnMutateResult>): react_jsx_runtime0.JSX.Element;
|
|
26
|
-
declare function InlineNumberInput<TData = unknown, TError = DefaultError, TVariables = unknown, TOnMutateResult = unknown>({
|
|
28
|
+
declare function InlineNumberInput<TSchema extends InlineNumberSchema = z$1.ZodType<number | null, number | null>, TData = unknown, TError = DefaultError, TVariables = unknown, TOnMutateResult = unknown>({
|
|
27
29
|
initialValue,
|
|
28
30
|
variables,
|
|
29
31
|
mutation,
|
|
@@ -33,11 +35,11 @@ declare function InlineNumberInput<TData = unknown, TError = DefaultError, TVari
|
|
|
33
35
|
strategy,
|
|
34
36
|
disabled,
|
|
35
37
|
...props
|
|
36
|
-
}: InlineEditInputProps<
|
|
38
|
+
}: InlineEditInputProps<TSchema, TData, TError, TVariables, TOnMutateResult>): react_jsx_runtime0.JSX.Element;
|
|
37
39
|
/**
|
|
38
40
|
* The inline edit decimal input component.
|
|
39
41
|
*/
|
|
40
|
-
declare function InlineDecimalInput<TData = unknown, TError = DefaultError, TVariables = unknown, TOnMutateResult = unknown>({
|
|
42
|
+
declare function InlineDecimalInput<TSchema extends z$1.ZodType<string | null, string | null> | z$1.ZodType<string, string> = z$1.ZodType<string | null, string | null>, TData = unknown, TError = DefaultError, TVariables = unknown, TOnMutateResult = unknown>({
|
|
41
43
|
initialValue,
|
|
42
44
|
variables,
|
|
43
45
|
mutation,
|
|
@@ -47,6 +49,6 @@ declare function InlineDecimalInput<TData = unknown, TError = DefaultError, TVar
|
|
|
47
49
|
strategy,
|
|
48
50
|
disabled,
|
|
49
51
|
...props
|
|
50
|
-
}: InlineEditInputProps<
|
|
52
|
+
}: InlineEditInputProps<TSchema, TData, TError, TVariables, TOnMutateResult>): react_jsx_runtime0.JSX.Element;
|
|
51
53
|
//#endregion
|
|
52
54
|
export { InlineDecimalInput, InlineNumberInput, InlineStringInput };
|
|
@@ -8,8 +8,9 @@ import { DefaultError } from "@tanstack/react-query";
|
|
|
8
8
|
|
|
9
9
|
//#region src/modules/inline/components/inputs/select.client.d.ts
|
|
10
10
|
type SelectInlineTrigger = "commit";
|
|
11
|
-
type
|
|
12
|
-
|
|
11
|
+
type InlineStringSchema = z$1.ZodType<string | null, string | null> | z$1.ZodType<string, string>;
|
|
12
|
+
type InlineSelectProps<TSchema extends InlineStringSchema = z$1.ZodType<string | null, string | null>, TData = unknown, TError = DefaultError, TVariables = unknown, TOnMutateResult = unknown> = Omit<ComponentProps<typeof Select>, "value" | "defaultValue"> & useInlineEditOptions<SelectInlineTrigger, TSchema, TData, TError, TVariables, TOnMutateResult>;
|
|
13
|
+
declare function InlineSelect<TSchema extends InlineStringSchema = z$1.ZodType<string | null, string | null>, TData = unknown, TError = DefaultError, TVariables = unknown, TOnMutateResult = unknown>({
|
|
13
14
|
initialValue,
|
|
14
15
|
variables,
|
|
15
16
|
mutation,
|
|
@@ -18,7 +19,7 @@ declare function InlineSelect<TData = unknown, TError = DefaultError, TVariables
|
|
|
18
19
|
disabled,
|
|
19
20
|
onValueChange,
|
|
20
21
|
...props
|
|
21
|
-
}: InlineSelectProps<TData, TError, TVariables, TOnMutateResult>): react_jsx_runtime0.JSX.Element;
|
|
22
|
+
}: InlineSelectProps<TSchema, TData, TError, TVariables, TOnMutateResult>): react_jsx_runtime0.JSX.Element;
|
|
22
23
|
declare function InlineSelectTrigger({
|
|
23
24
|
variant,
|
|
24
25
|
className,
|
|
@@ -7,8 +7,9 @@ import { DefaultError } from "@tanstack/react-query";
|
|
|
7
7
|
|
|
8
8
|
//#region src/modules/inline/components/inputs/switch.client.d.ts
|
|
9
9
|
type SwitchInlineTrigger = "commit";
|
|
10
|
-
type
|
|
11
|
-
|
|
10
|
+
type InlineBooleanSchema = z$1.ZodType<boolean | null, boolean | null> | z$1.ZodType<boolean, boolean>;
|
|
11
|
+
type InlineSwitchProps<TSchema extends InlineBooleanSchema = z$1.ZodType<boolean | null, boolean | null>, TData = unknown, TError = DefaultError, TVariables = unknown, TOnMutateResult = unknown> = ComponentProps<typeof Switch> & useInlineEditOptions<SwitchInlineTrigger, TSchema, TData, TError, TVariables, TOnMutateResult>;
|
|
12
|
+
declare function InlineSwitch<TSchema extends InlineBooleanSchema = z$1.ZodType<boolean | null, boolean | null>, TData = unknown, TError = DefaultError, TVariables = unknown, TOnMutateResult = unknown>({
|
|
12
13
|
initialValue,
|
|
13
14
|
variables,
|
|
14
15
|
mutation,
|
|
@@ -16,6 +17,6 @@ declare function InlineSwitch<TData = unknown, TError = DefaultError, TVariables
|
|
|
16
17
|
strategy,
|
|
17
18
|
disabled,
|
|
18
19
|
...props
|
|
19
|
-
}: InlineSwitchProps<TData, TError, TVariables, TOnMutateResult>): react_jsx_runtime0.JSX.Element;
|
|
20
|
+
}: InlineSwitchProps<TSchema, TData, TError, TVariables, TOnMutateResult>): react_jsx_runtime0.JSX.Element;
|
|
20
21
|
//#endregion
|
|
21
22
|
export { InlineSwitch };
|
|
@@ -4,7 +4,7 @@ import * as class_variance_authority_types0 from "class-variance-authority/types
|
|
|
4
4
|
//#region src/modules/inline/lib/variants.d.ts
|
|
5
5
|
declare const inlineEditVariants: (props?: ({
|
|
6
6
|
variant?: "default" | "table" | null | undefined;
|
|
7
|
-
status?: "error" | "
|
|
7
|
+
status?: "error" | "idle" | "pending" | "success" | null | undefined;
|
|
8
8
|
} & class_variance_authority_types0.ClassProp) | undefined) => string;
|
|
9
9
|
type InlineEditVariantsProps = VariantProps<typeof inlineEditVariants>;
|
|
10
10
|
//#endregion
|
|
@@ -5,5 +5,6 @@ import { QueryClient } from "@tanstack/react-query";
|
|
|
5
5
|
* Create a new query client
|
|
6
6
|
*/
|
|
7
7
|
declare function createQueryClient(): QueryClient;
|
|
8
|
+
declare function getQueryClient(): QueryClient;
|
|
8
9
|
//#endregion
|
|
9
|
-
export { createQueryClient };
|
|
10
|
+
export { createQueryClient, getQueryClient };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { serializer } from "./helpers.mjs";
|
|
2
|
-
import { MutationCache, QueryClient,
|
|
2
|
+
import { MutationCache, QueryClient, environmentManager } from "@tanstack/react-query";
|
|
3
3
|
|
|
4
4
|
//#region src/modules/router/lib/query-client.ts
|
|
5
5
|
/**
|
|
@@ -41,7 +41,7 @@ function createQueryClient() {
|
|
|
41
41
|
*/
|
|
42
42
|
let browserQueryClient;
|
|
43
43
|
function getQueryClient() {
|
|
44
|
-
if (isServer) return createQueryClient();
|
|
44
|
+
if (environmentManager.isServer()) return createQueryClient();
|
|
45
45
|
if (!browserQueryClient) browserQueryClient = createQueryClient();
|
|
46
46
|
return browserQueryClient;
|
|
47
47
|
}
|
|
@@ -36,7 +36,7 @@ type DropzoneContentProps = {
|
|
|
36
36
|
declare function DropzoneContent({
|
|
37
37
|
children,
|
|
38
38
|
className
|
|
39
|
-
}: DropzoneContentProps): string | number | bigint | true |
|
|
39
|
+
}: DropzoneContentProps): string | number | bigint | true | Iterable<ReactNode> | Promise<string | number | bigint | boolean | react.ReactPortal | react.ReactElement<unknown, string | react.JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> | react_jsx_runtime0.JSX.Element | null;
|
|
40
40
|
/**
|
|
41
41
|
* DropzoneEmptyState
|
|
42
42
|
*/
|
|
@@ -47,6 +47,6 @@ type DropzoneEmptyStateProps = {
|
|
|
47
47
|
declare function DropzoneEmptyState({
|
|
48
48
|
children,
|
|
49
49
|
className
|
|
50
|
-
}: DropzoneEmptyStateProps): string | number | bigint | true |
|
|
50
|
+
}: DropzoneEmptyStateProps): string | number | bigint | true | Iterable<ReactNode> | Promise<string | number | bigint | boolean | react.ReactPortal | react.ReactElement<unknown, string | react.JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> | react_jsx_runtime0.JSX.Element | null;
|
|
51
51
|
//#endregion
|
|
52
52
|
export { Dropzone, DropzoneContent, DropzoneContentProps, DropzoneEmptyState, DropzoneEmptyStateProps, DropzoneProps };
|
|
@@ -1915,19 +1915,19 @@ declare class Storage<TSchema extends TDatabaseSchema> {
|
|
|
1915
1915
|
*/
|
|
1916
1916
|
presignUpload(props: PresignUploadInput): Promise<{
|
|
1917
1917
|
presignedUrl: string;
|
|
1918
|
+
status: "error" | "pending" | "ready";
|
|
1918
1919
|
id: string;
|
|
1920
|
+
metadata: unknown;
|
|
1921
|
+
key: string;
|
|
1922
|
+
name: string | null;
|
|
1923
|
+
size: number | null;
|
|
1919
1924
|
createdAt: Date;
|
|
1920
1925
|
updatedAt: Date;
|
|
1921
|
-
name: string | null;
|
|
1922
|
-
key: string;
|
|
1923
|
-
metadata: unknown;
|
|
1924
1926
|
provider: "s3";
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
+
uploadId: string;
|
|
1928
|
+
visibility: "private" | "public";
|
|
1927
1929
|
contentType: string | null;
|
|
1928
1930
|
bucket: string;
|
|
1929
|
-
visibility: "private" | "public";
|
|
1930
|
-
uploadId: string;
|
|
1931
1931
|
etag: string | null;
|
|
1932
1932
|
uploadedAt: Date;
|
|
1933
1933
|
deletedAt: Date | null;
|
|
@@ -2164,19 +2164,19 @@ declare class Storage<TSchema extends TDatabaseSchema> {
|
|
|
2164
2164
|
* @returns The purged asset record, or null if not found
|
|
2165
2165
|
*/
|
|
2166
2166
|
purgeAsset(input: string): Promise<{
|
|
2167
|
+
status: "error" | "pending" | "ready";
|
|
2167
2168
|
id: string;
|
|
2169
|
+
metadata: unknown;
|
|
2170
|
+
key: string;
|
|
2171
|
+
name: string | null;
|
|
2172
|
+
size: number | null;
|
|
2168
2173
|
createdAt: Date;
|
|
2169
2174
|
updatedAt: Date;
|
|
2170
|
-
name: string | null;
|
|
2171
|
-
key: string;
|
|
2172
|
-
metadata: unknown;
|
|
2173
2175
|
provider: "s3";
|
|
2174
|
-
|
|
2175
|
-
|
|
2176
|
+
uploadId: string;
|
|
2177
|
+
visibility: "private" | "public";
|
|
2176
2178
|
contentType: string | null;
|
|
2177
2179
|
bucket: string;
|
|
2178
|
-
visibility: "private" | "public";
|
|
2179
|
-
uploadId: string;
|
|
2180
2180
|
etag: string | null;
|
|
2181
2181
|
uploadedAt: Date;
|
|
2182
2182
|
deletedAt: Date | null;
|
|
@@ -2195,19 +2195,19 @@ declare class Storage<TSchema extends TDatabaseSchema> {
|
|
|
2195
2195
|
* @throws {ServerError} If provider deletion fails
|
|
2196
2196
|
*/
|
|
2197
2197
|
purgeAssets(input: string[]): Promise<{
|
|
2198
|
+
status: "error" | "pending" | "ready";
|
|
2198
2199
|
id: string;
|
|
2200
|
+
metadata: unknown;
|
|
2201
|
+
key: string;
|
|
2202
|
+
name: string | null;
|
|
2203
|
+
size: number | null;
|
|
2199
2204
|
createdAt: Date;
|
|
2200
2205
|
updatedAt: Date;
|
|
2201
|
-
name: string | null;
|
|
2202
|
-
key: string;
|
|
2203
|
-
metadata: unknown;
|
|
2204
2206
|
provider: "s3";
|
|
2205
|
-
|
|
2206
|
-
|
|
2207
|
+
uploadId: string;
|
|
2208
|
+
visibility: "private" | "public";
|
|
2207
2209
|
contentType: string | null;
|
|
2208
2210
|
bucket: string;
|
|
2209
|
-
visibility: "private" | "public";
|
|
2210
|
-
uploadId: string;
|
|
2211
2211
|
etag: string | null;
|
|
2212
2212
|
uploadedAt: Date;
|
|
2213
2213
|
deletedAt: Date | null;
|
package/dist/router.d.mts
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
+
import { createQueryClient, getQueryClient } from "./src/modules/router/lib/query-client.mjs";
|
|
1
2
|
import { BulkActionSchema, bulkActionSchema } from "./src/modules/router/lib/validators.mjs";
|
|
2
|
-
export { BulkActionSchema, bulkActionSchema };
|
|
3
|
+
export { BulkActionSchema, bulkActionSchema, createQueryClient, getQueryClient };
|
package/dist/router.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { FileHandlerOptions } from "@tiptap/extension-file-handler";
|
|
2
1
|
import "@tiptap/core";
|
|
2
|
+
import { FileHandlerOptions } from "@tiptap/extension-file-handler";
|
|
3
3
|
|
|
4
4
|
//#region src/components/editor/extensions/file-handler/extension.d.ts
|
|
5
5
|
interface FileHandlerOptions$1 extends FileHandlerOptions {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
import { SkeletonNodeRenderer } from "./renderer.mjs";
|
|
4
|
-
import { ReactNodeViewRenderer } from "@tiptap/react";
|
|
5
4
|
import { Node } from "@tiptap/core";
|
|
5
|
+
import { ReactNodeViewRenderer } from "@tiptap/react";
|
|
6
6
|
|
|
7
7
|
//#region src/components/editor/extensions/skeleton/extension.ts
|
|
8
8
|
const Skeleton = Node.create({
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { FileHandlerOptions } from "../extensions/file-handler/extension.mjs";
|
|
2
2
|
import { ImageOptions } from "../extensions/image/extension.mjs";
|
|
3
|
+
import * as _tiptap_core0 from "@tiptap/core";
|
|
3
4
|
import * as _tiptap_extension_blockquote0 from "@tiptap/extension-blockquote";
|
|
4
5
|
import * as _tiptap_extension_bold0 from "@tiptap/extension-bold";
|
|
5
6
|
import * as _tiptap_extension_hard_break0 from "@tiptap/extension-hard-break";
|
|
@@ -14,7 +15,6 @@ import * as _tiptap_extension_underline0 from "@tiptap/extension-underline";
|
|
|
14
15
|
import * as _tiptap_extension_highlight0 from "@tiptap/extension-highlight";
|
|
15
16
|
import * as _tiptap_extension_text_style0 from "@tiptap/extension-text-style";
|
|
16
17
|
import * as _tiptap_extensions0 from "@tiptap/extensions";
|
|
17
|
-
import * as _tiptap_core0 from "@tiptap/core";
|
|
18
18
|
|
|
19
19
|
//#region src/components/editor/lib/constants.d.ts
|
|
20
20
|
/**
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { FileHandlerOptions } from "../extensions/file-handler/extension.mjs";
|
|
2
2
|
import { ImageOptions } from "../extensions/image/extension.mjs";
|
|
3
3
|
import { EditorExtensions } from "./constants.mjs";
|
|
4
|
+
import "@tiptap/core";
|
|
4
5
|
import { BlockquoteOptions } from "@tiptap/extension-blockquote";
|
|
5
6
|
import { BoldOptions } from "@tiptap/extension-bold";
|
|
6
7
|
import { HardBreakOptions } from "@tiptap/extension-hard-break";
|
|
@@ -16,7 +17,6 @@ import "@tiptap/react";
|
|
|
16
17
|
import { HighlightOptions } from "@tiptap/extension-highlight";
|
|
17
18
|
import { ColorOptions, TextStyleOptions } from "@tiptap/extension-text-style";
|
|
18
19
|
import { DropcursorOptions, TrailingNodeOptions, UndoRedoOptions } from "@tiptap/extensions";
|
|
19
|
-
import "@tiptap/core";
|
|
20
20
|
|
|
21
21
|
//#region src/components/editor/lib/extensions.d.ts
|
|
22
22
|
/**
|
|
@@ -17,5 +17,9 @@ declare function convertEditorContentToHTML(content: EditorJSONContent): string;
|
|
|
17
17
|
* Convert editor content to markdown
|
|
18
18
|
*/
|
|
19
19
|
declare function convertEditorContentToMarkdown(content: EditorJSONContent): string;
|
|
20
|
+
/**
|
|
21
|
+
* Convert editor content to plain text
|
|
22
|
+
*/
|
|
23
|
+
declare function convertEditorContentToPlainText(content: EditorJSONContent): string;
|
|
20
24
|
//#endregion
|
|
21
|
-
export { convertEditorContentToHTML, convertEditorContentToMarkdown, convertHTMLToEditorContent, convertMarkdownToEditorContent };
|
|
25
|
+
export { convertEditorContentToHTML, convertEditorContentToMarkdown, convertEditorContentToPlainText, convertHTMLToEditorContent, convertMarkdownToEditorContent };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { markdownParser } from "../../../lib/utils/markdown.mjs";
|
|
2
|
+
import { generateText } from "@tiptap/core";
|
|
2
3
|
import Blockquote from "@tiptap/extension-blockquote";
|
|
3
4
|
import Bold from "@tiptap/extension-bold";
|
|
4
5
|
import Document from "@tiptap/extension-document";
|
|
@@ -63,6 +64,12 @@ function convertEditorContentToMarkdown(content) {
|
|
|
63
64
|
extensions: EXTENSIONS_FOR_GENERATION
|
|
64
65
|
});
|
|
65
66
|
}
|
|
67
|
+
/**
|
|
68
|
+
* Convert editor content to plain text
|
|
69
|
+
*/
|
|
70
|
+
function convertEditorContentToPlainText(content) {
|
|
71
|
+
return generateText(content, EXTENSIONS_FOR_GENERATION);
|
|
72
|
+
}
|
|
66
73
|
|
|
67
74
|
//#endregion
|
|
68
|
-
export { convertEditorContentToHTML, convertEditorContentToMarkdown, convertHTMLToEditorContent, convertMarkdownToEditorContent };
|
|
75
|
+
export { convertEditorContentToHTML, convertEditorContentToMarkdown, convertEditorContentToPlainText, convertHTMLToEditorContent, convertMarkdownToEditorContent };
|
|
@@ -29,8 +29,9 @@ declare const generateRootLayoutMetadata: (config: TulipConfig) => {
|
|
|
29
29
|
/**
|
|
30
30
|
* Root layout
|
|
31
31
|
*/
|
|
32
|
+
type RootLayoutProps = PropsWithChildren;
|
|
32
33
|
declare function RootLayout({
|
|
33
34
|
children
|
|
34
|
-
}:
|
|
35
|
+
}: RootLayoutProps): react_jsx_runtime0.JSX.Element;
|
|
35
36
|
//#endregion
|
|
36
|
-
export { RootLayout, generateRootLayoutMetadata };
|
|
37
|
+
export { RootLayout, RootLayoutProps, generateRootLayoutMetadata };
|
|
@@ -29,12 +29,10 @@ const generateRootLayoutMetadata = (config) => ({
|
|
|
29
29
|
}]
|
|
30
30
|
}
|
|
31
31
|
});
|
|
32
|
-
/**
|
|
33
|
-
* Root layout
|
|
34
|
-
*/
|
|
35
32
|
function RootLayout({ children }) {
|
|
36
33
|
return /* @__PURE__ */ jsx("html", {
|
|
37
34
|
lang: "nl",
|
|
35
|
+
"data-theme": "tulip",
|
|
38
36
|
children: /* @__PURE__ */ jsx("body", {
|
|
39
37
|
className: cn("bg-background font-sans antialiased", registerFonts()),
|
|
40
38
|
children
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { ColorTheme } from "./color-theme.mjs";
|
|
2
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
|
+
import { PropsWithChildren } from "react";
|
|
4
|
+
|
|
5
|
+
//#region src/components/themes/color-theme-provider.client.d.ts
|
|
6
|
+
type ColorThemeContextValue = {
|
|
7
|
+
colorTheme: ColorTheme;
|
|
8
|
+
setColorTheme: (theme: ColorTheme) => void;
|
|
9
|
+
colorThemes: readonly ColorTheme[];
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Provides the current color theme and a setter to the component tree.
|
|
13
|
+
* The server provides the initial theme, then client interactions keep local state and the cookie in sync.
|
|
14
|
+
*/
|
|
15
|
+
declare function ColorThemeProvider({
|
|
16
|
+
children,
|
|
17
|
+
theme
|
|
18
|
+
}: PropsWithChildren<{
|
|
19
|
+
theme: ColorTheme;
|
|
20
|
+
}>): react_jsx_runtime0.JSX.Element;
|
|
21
|
+
/**
|
|
22
|
+
* Returns the active color theme context for client components.
|
|
23
|
+
* It throws early when used outside the provider so incorrect usage fails loudly.
|
|
24
|
+
*/
|
|
25
|
+
declare function useColorTheme(): ColorThemeContextValue;
|
|
26
|
+
//#endregion
|
|
27
|
+
export { ColorThemeProvider, useColorTheme };
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { COLOR_THEME_STORAGE_KEY, colorThemes } from "./color-theme.mjs";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
import { createContext, use, useCallback, useEffect, useLayoutEffect, useMemo, useState } from "react";
|
|
6
|
+
|
|
7
|
+
//#region src/components/themes/color-theme-provider.client.tsx
|
|
8
|
+
const ColorThemeContext = createContext(null);
|
|
9
|
+
/**
|
|
10
|
+
* Persists the chosen theme in a cookie so the server can resolve it on the next request.
|
|
11
|
+
* Cookie failures are ignored because theme changes should still work in local React state.
|
|
12
|
+
*/
|
|
13
|
+
function setStoredColorTheme(theme) {
|
|
14
|
+
try {
|
|
15
|
+
document.cookie = `${COLOR_THEME_STORAGE_KEY}=${theme}; path=/; max-age=31536000; samesite=lax`;
|
|
16
|
+
} catch {}
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Provides the current color theme and a setter to the component tree.
|
|
20
|
+
* The server provides the initial theme, then client interactions keep local state and the cookie in sync.
|
|
21
|
+
*/
|
|
22
|
+
function ColorThemeProvider({ children, theme }) {
|
|
23
|
+
const [colorTheme, setColorThemeState] = useState(theme);
|
|
24
|
+
useEffect(() => {
|
|
25
|
+
setColorThemeState(theme);
|
|
26
|
+
}, [theme]);
|
|
27
|
+
useLayoutEffect(() => {
|
|
28
|
+
document.documentElement.dataset.theme = colorTheme;
|
|
29
|
+
}, [colorTheme]);
|
|
30
|
+
const setColorTheme = useCallback((theme) => {
|
|
31
|
+
setColorThemeState(theme);
|
|
32
|
+
setStoredColorTheme(theme);
|
|
33
|
+
}, []);
|
|
34
|
+
const value = useMemo(() => ({
|
|
35
|
+
colorTheme,
|
|
36
|
+
setColorTheme,
|
|
37
|
+
colorThemes
|
|
38
|
+
}), [colorTheme, setColorTheme]);
|
|
39
|
+
return /* @__PURE__ */ jsx(ColorThemeContext.Provider, {
|
|
40
|
+
value,
|
|
41
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
42
|
+
className: "contents",
|
|
43
|
+
"data-theme": colorTheme,
|
|
44
|
+
children
|
|
45
|
+
})
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Returns the active color theme context for client components.
|
|
50
|
+
* It throws early when used outside the provider so incorrect usage fails loudly.
|
|
51
|
+
*/
|
|
52
|
+
function useColorTheme() {
|
|
53
|
+
const context = use(ColorThemeContext);
|
|
54
|
+
if (!context) throw new Error("useColorTheme must be used within a ColorThemeProvider");
|
|
55
|
+
return context;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
//#endregion
|
|
59
|
+
export { ColorThemeProvider, useColorTheme };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import z from "zod";
|
|
2
|
+
import { ReadonlyRequestCookies } from "next/dist/server/web/spec-extension/adapters/request-cookies";
|
|
3
|
+
|
|
4
|
+
//#region src/components/themes/color-theme.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* Shared cookie key used by both server reads and client writes.
|
|
7
|
+
*/
|
|
8
|
+
declare const COLOR_THEME_STORAGE_KEY = "tulip-color-theme";
|
|
9
|
+
/**
|
|
10
|
+
* All supported color theme names.
|
|
11
|
+
*/
|
|
12
|
+
declare const colorThemes: readonly ["tulip", "rose", "iris", "sage"];
|
|
13
|
+
type ColorTheme = (typeof colorThemes)[number];
|
|
14
|
+
/**
|
|
15
|
+
* Validators
|
|
16
|
+
*/
|
|
17
|
+
declare const colorThemeSchema: z.ZodEnum<{
|
|
18
|
+
tulip: "tulip";
|
|
19
|
+
rose: "rose";
|
|
20
|
+
iris: "iris";
|
|
21
|
+
sage: "sage";
|
|
22
|
+
}>;
|
|
23
|
+
/**
|
|
24
|
+
* Resolves a validated color theme from either a raw string value or a cookie store.
|
|
25
|
+
* Invalid, missing, or unsupported values are treated as undefined.
|
|
26
|
+
*/
|
|
27
|
+
declare function getColorThemeValue(cookieStore: ReadonlyRequestCookies, fallback?: ColorTheme): ColorTheme;
|
|
28
|
+
//#endregion
|
|
29
|
+
export { COLOR_THEME_STORAGE_KEY, ColorTheme, colorThemeSchema, colorThemes, getColorThemeValue };
|