@rolder/kit 3.0.0-alpha.11 → 3.0.0-alpha.14
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/index.d.ts +0 -17
- package/package.json +32 -8
- package/dist/functions/getCookie.js +0 -8
- package/dist/functions/setCookie.js +0 -19
- package/dist/functions/setCookies.js +0 -13
- package/dist/hooks/useMutation.js +0 -8
- package/dist/hooks/useMutationWithInvalidate.js +0 -16
- package/dist/index.js +0 -26
- package/dist/surreal/connection.js +0 -49
- package/dist/surreal/deafaultCrud.js +0 -18
- package/dist/surreal/deserialize.js +0 -46
- package/dist/surreal/encryption.js +0 -30
- package/dist/ui/AnimatedChevron.js +0 -31
- package/dist/ui/JsonInput.js +0 -45
- package/dist/ui/RouterLink.js +0 -36
- package/dist/ui/editor/Content.js +0 -13
- package/dist/ui/editor/Provider.js +0 -80
- package/dist/ui/editor/Root.js +0 -18
- package/dist/ui/editor/Toolbar.js +0 -156
- package/dist/ui/editor/index.js +0 -11
- package/dist/ui/editor/types.js +0 -0
- package/dist/ui/error/DefaultError.js +0 -62
- package/dist/ui/error/DefaultNotFound.js +0 -37
- package/dist/ui/error/Forbidden.js +0 -32
- package/dist/ui/error/defaultErrorNotification.js +0 -8
- package/dist/ui/error/index.js +0 -5
- package/dist/ui/form/blurOnError.js +0 -11
- package/dist/ui/form/buttons/CancelButton.js +0 -44
- package/dist/ui/form/buttons/SubmitButton.js +0 -47
- package/dist/ui/form/buttons/SubscribeActionIcon.js +0 -15
- package/dist/ui/form/buttons/SubscribeButton.js +0 -16
- package/dist/ui/form/buttons/index.js +0 -4
- package/dist/ui/form/context.js +0 -26
- package/dist/ui/form/fields/JsonField.js +0 -13
- package/dist/ui/form/fields/MultiSelectField.js +0 -15
- package/dist/ui/form/fields/NumberField.js +0 -15
- package/dist/ui/form/fields/PassowrdField.js +0 -18
- package/dist/ui/form/fields/SelectField.js +0 -15
- package/dist/ui/form/fields/SwitchField.js +0 -15
- package/dist/ui/form/fields/TextField.js +0 -15
- package/dist/ui/form/fields/TextPassowrdField.js +0 -51
- package/dist/ui/form/fields/TextareaField.js +0 -15
- package/dist/ui/form/fields/index.js +0 -9
- package/dist/ui/form/fieldsSchema.js +0 -13
- package/dist/ui/form/index.js +0 -4
- package/dist/ui/hoverPaper/HoverPaper.js +0 -15
- package/dist/ui/hoverPaper/index.js +0 -3
- package/dist/ui/hoverPaper/usePaperHover.js +0 -9
- package/dist/ui/saveInput/JsonInput.js +0 -34
- package/dist/ui/saveInput/NumberInput.js +0 -27
- package/dist/ui/saveInput/SaveInput.js +0 -15
- package/dist/ui/saveInput/Select.js +0 -27
- package/dist/ui/saveInput/Switch.js +0 -30
- package/dist/ui/saveInput/TextInput.js +0 -26
- package/dist/ui/saveInput/Textarea.js +0 -26
- package/dist/ui/saveInput/index.js +0 -2
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { Textarea } from "@mantine/core";
|
|
3
|
-
import { useFieldContext } from "../context.js";
|
|
4
|
-
const TextareaField = (props)=>{
|
|
5
|
-
const field = useFieldContext();
|
|
6
|
-
return /*#__PURE__*/ jsx(Textarea, {
|
|
7
|
-
name: field.name,
|
|
8
|
-
value: field.state.value || '',
|
|
9
|
-
onChange: (e)=>field.handleChange(e.target.value),
|
|
10
|
-
onBlur: field.handleBlur,
|
|
11
|
-
error: field.state.meta.errors.map((error)=>error.message).join(', '),
|
|
12
|
-
...props
|
|
13
|
-
});
|
|
14
|
-
};
|
|
15
|
-
export { TextareaField };
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export * from "./JsonField.js";
|
|
2
|
-
export * from "./MultiSelectField.js";
|
|
3
|
-
export * from "./NumberField.js";
|
|
4
|
-
export * from "./PassowrdField.js";
|
|
5
|
-
export * from "./SelectField.js";
|
|
6
|
-
export * from "./SwitchField.js";
|
|
7
|
-
export * from "./TextareaField.js";
|
|
8
|
-
export * from "./TextField.js";
|
|
9
|
-
export * from "./TextPassowrdField.js";
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import v4 from "zod/v4";
|
|
2
|
-
const fieldsSchema = {
|
|
3
|
-
id: v4.string().min(1, 'ID не может быть пустым'),
|
|
4
|
-
str: v4.string().min(1, 'Значение не может быть пустым'),
|
|
5
|
-
strArr: v4.array(v4.string().min(1, 'Значение не может быть пустым')),
|
|
6
|
-
strMin3: v4.string().min(3, 'Должно содержать не менее 3 символов'),
|
|
7
|
-
select: v4.string().min(1, 'Выберите значение'),
|
|
8
|
-
email: v4.email('Неверный формат email'),
|
|
9
|
-
username: v4.string().min(3, 'Должен быть не менее 3 символов').max(24, 'Должен быть не более 24 символов'),
|
|
10
|
-
password: v4.string('Пароль не может быть пустым').min(8, 'Пароль должен содержать не менее 8 символов'),
|
|
11
|
-
kebab: v4.string().min(3, 'Минимум 3 символа').regex(/^[a-z0-9]+(-[a-z0-9]+)*$/, 'Должен быть в формате kebab-case (только строчные буквы, цифры и дефисы)')
|
|
12
|
-
};
|
|
13
|
-
export { fieldsSchema };
|
package/dist/ui/form/index.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { Paper } from "@mantine/core";
|
|
3
|
-
import { forwardRef } from "react";
|
|
4
|
-
const HoverPaper = /*#__PURE__*/ forwardRef(({ disabled, classNames, ...props }, ref)=>/*#__PURE__*/ jsx(Paper, {
|
|
5
|
-
ref: ref,
|
|
6
|
-
classNames: {
|
|
7
|
-
root: 'rolder-hover-paper-root',
|
|
8
|
-
...classNames
|
|
9
|
-
},
|
|
10
|
-
mod: {
|
|
11
|
-
disabled
|
|
12
|
-
},
|
|
13
|
-
...props
|
|
14
|
-
}));
|
|
15
|
-
export { HoverPaper };
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Box, Loader } from "@mantine/core";
|
|
3
|
-
import { useDebouncedCallback } from "@mantine/hooks";
|
|
4
|
-
import { useState } from "react";
|
|
5
|
-
import { JsonInput } from "../JsonInput.js";
|
|
6
|
-
const JsonInput_JsonInput = ({ initialValue, onChange, debounce = 300, ...props })=>{
|
|
7
|
-
const [value, setValue] = useState(initialValue);
|
|
8
|
-
const [loading, setLoading] = useState(false);
|
|
9
|
-
const handleSave = useDebouncedCallback(async (content)=>{
|
|
10
|
-
setLoading(true);
|
|
11
|
-
await onChange(content);
|
|
12
|
-
setLoading(false);
|
|
13
|
-
}, debounce);
|
|
14
|
-
return /*#__PURE__*/ jsxs(Box, {
|
|
15
|
-
pos: "relative",
|
|
16
|
-
children: [
|
|
17
|
-
/*#__PURE__*/ jsx(JsonInput, {
|
|
18
|
-
value: value,
|
|
19
|
-
onChange: (e)=>{
|
|
20
|
-
setValue(e);
|
|
21
|
-
handleSave(e);
|
|
22
|
-
},
|
|
23
|
-
...props
|
|
24
|
-
}),
|
|
25
|
-
loading && /*#__PURE__*/ jsx(Loader, {
|
|
26
|
-
size: "sm",
|
|
27
|
-
pos: "absolute",
|
|
28
|
-
top: 8,
|
|
29
|
-
left: 8
|
|
30
|
-
})
|
|
31
|
-
]
|
|
32
|
-
});
|
|
33
|
-
};
|
|
34
|
-
export { JsonInput_JsonInput as JsonInput };
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { Loader, NumberInput } from "@mantine/core";
|
|
3
|
-
import { useDebouncedCallback } from "@mantine/hooks";
|
|
4
|
-
import { useState } from "react";
|
|
5
|
-
const NumberInput_NumberInput = ({ initialValue, onChange, debounce = 300, ...props })=>{
|
|
6
|
-
const [value, setValue] = useState(initialValue);
|
|
7
|
-
const [loading, setLoading] = useState(false);
|
|
8
|
-
const handleSave = useDebouncedCallback(async (content)=>{
|
|
9
|
-
setLoading(true);
|
|
10
|
-
await onChange(content);
|
|
11
|
-
setLoading(false);
|
|
12
|
-
}, debounce);
|
|
13
|
-
return /*#__PURE__*/ jsx(NumberInput, {
|
|
14
|
-
value: value,
|
|
15
|
-
onChange: (v)=>{
|
|
16
|
-
setValue(v);
|
|
17
|
-
handleSave(v);
|
|
18
|
-
},
|
|
19
|
-
flex: props.w ? void 0 : 1,
|
|
20
|
-
rightSection: loading ? /*#__PURE__*/ jsx(Loader, {
|
|
21
|
-
size: "sm",
|
|
22
|
-
mr: 8
|
|
23
|
-
}) : void 0,
|
|
24
|
-
...props
|
|
25
|
-
});
|
|
26
|
-
};
|
|
27
|
-
export { NumberInput_NumberInput as NumberInput };
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { JsonInput } from "./JsonInput.js";
|
|
2
|
-
import { NumberInput } from "./NumberInput.js";
|
|
3
|
-
import { Select } from "./Select.js";
|
|
4
|
-
import { Switch } from "./Switch.js";
|
|
5
|
-
import { Textarea } from "./Textarea.js";
|
|
6
|
-
import { TextInput } from "./TextInput.js";
|
|
7
|
-
const SaveInput = Object.assign(TextInput, {
|
|
8
|
-
TextInput: TextInput,
|
|
9
|
-
NumberInput: NumberInput,
|
|
10
|
-
Textarea: Textarea,
|
|
11
|
-
Switch: Switch,
|
|
12
|
-
JsonInput: JsonInput,
|
|
13
|
-
Select: Select
|
|
14
|
-
});
|
|
15
|
-
export { SaveInput };
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { Loader, Select } from "@mantine/core";
|
|
3
|
-
import { useDebouncedCallback } from "@mantine/hooks";
|
|
4
|
-
import { useState } from "react";
|
|
5
|
-
const Select_Select = ({ initialValue, onChange, debounce = 300, ...props })=>{
|
|
6
|
-
const [value, setValue] = useState(initialValue);
|
|
7
|
-
const [loading, setLoading] = useState(false);
|
|
8
|
-
const handleSave = useDebouncedCallback(async (content)=>{
|
|
9
|
-
setLoading(true);
|
|
10
|
-
await onChange(content);
|
|
11
|
-
setLoading(false);
|
|
12
|
-
}, debounce);
|
|
13
|
-
return /*#__PURE__*/ jsx(Select, {
|
|
14
|
-
value: value,
|
|
15
|
-
onChange: (v)=>{
|
|
16
|
-
setValue(v);
|
|
17
|
-
handleSave(v);
|
|
18
|
-
},
|
|
19
|
-
flex: props.w ? void 0 : 1,
|
|
20
|
-
disabled: loading,
|
|
21
|
-
rightSection: loading ? /*#__PURE__*/ jsx(Loader, {
|
|
22
|
-
size: "sm"
|
|
23
|
-
}) : void 0,
|
|
24
|
-
...props
|
|
25
|
-
});
|
|
26
|
-
};
|
|
27
|
-
export { Select_Select as Select };
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { Box, Loader, Switch } from "@mantine/core";
|
|
3
|
-
import { useDebouncedCallback } from "@mantine/hooks";
|
|
4
|
-
import { useState } from "react";
|
|
5
|
-
const Switch_Switch = ({ initialValue, onChange, debounce = 300, w, ...props })=>{
|
|
6
|
-
const [value, setValue] = useState(initialValue);
|
|
7
|
-
const [loading, setLoading] = useState(false);
|
|
8
|
-
const handleSave = useDebouncedCallback(async (content)=>{
|
|
9
|
-
setLoading(true);
|
|
10
|
-
await onChange(content);
|
|
11
|
-
setLoading(false);
|
|
12
|
-
}, debounce);
|
|
13
|
-
return /*#__PURE__*/ jsx(Box, {
|
|
14
|
-
flex: 1,
|
|
15
|
-
w: w,
|
|
16
|
-
children: loading ? /*#__PURE__*/ jsx(Loader, {
|
|
17
|
-
size: "sm",
|
|
18
|
-
mt: 6.5,
|
|
19
|
-
ml: 8
|
|
20
|
-
}) : /*#__PURE__*/ jsx(Switch, {
|
|
21
|
-
checked: value,
|
|
22
|
-
onChange: (e)=>{
|
|
23
|
-
setValue(e.currentTarget.checked);
|
|
24
|
-
handleSave(e.currentTarget.checked);
|
|
25
|
-
},
|
|
26
|
-
...props
|
|
27
|
-
})
|
|
28
|
-
});
|
|
29
|
-
};
|
|
30
|
-
export { Switch_Switch as Switch };
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { Loader, TextInput } from "@mantine/core";
|
|
3
|
-
import { useDebouncedCallback } from "@mantine/hooks";
|
|
4
|
-
import { useState } from "react";
|
|
5
|
-
const TextInput_TextInput = ({ initialValue, onChange, debounce = 300, ...props })=>{
|
|
6
|
-
const [value, setValue] = useState(initialValue || '');
|
|
7
|
-
const [loading, setLoading] = useState(false);
|
|
8
|
-
const handleSave = useDebouncedCallback(async (content)=>{
|
|
9
|
-
setLoading(true);
|
|
10
|
-
await onChange(content);
|
|
11
|
-
setLoading(false);
|
|
12
|
-
}, debounce);
|
|
13
|
-
return /*#__PURE__*/ jsx(TextInput, {
|
|
14
|
-
value: value,
|
|
15
|
-
onChange: (e)=>{
|
|
16
|
-
setValue(e.target.value);
|
|
17
|
-
handleSave(e.target.value);
|
|
18
|
-
},
|
|
19
|
-
flex: props.w ? void 0 : 1,
|
|
20
|
-
rightSection: loading ? /*#__PURE__*/ jsx(Loader, {
|
|
21
|
-
size: "sm"
|
|
22
|
-
}) : void 0,
|
|
23
|
-
...props
|
|
24
|
-
});
|
|
25
|
-
};
|
|
26
|
-
export { TextInput_TextInput as TextInput };
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { Loader, Textarea } from "@mantine/core";
|
|
3
|
-
import { useDebouncedCallback } from "@mantine/hooks";
|
|
4
|
-
import { useState } from "react";
|
|
5
|
-
const Textarea_Textarea = ({ initialValue, onChange, debounce = 300, ...props })=>{
|
|
6
|
-
const [value, setValue] = useState(initialValue);
|
|
7
|
-
const [loading, setLoading] = useState(false);
|
|
8
|
-
const handleSave = useDebouncedCallback(async (content)=>{
|
|
9
|
-
setLoading(true);
|
|
10
|
-
await onChange(content);
|
|
11
|
-
setLoading(false);
|
|
12
|
-
}, debounce);
|
|
13
|
-
return /*#__PURE__*/ jsx(Textarea, {
|
|
14
|
-
value: value,
|
|
15
|
-
onChange: (e)=>{
|
|
16
|
-
setValue(e.target.value);
|
|
17
|
-
handleSave(e.target.value);
|
|
18
|
-
},
|
|
19
|
-
flex: props.w ? void 0 : 1,
|
|
20
|
-
rightSection: loading ? /*#__PURE__*/ jsx(Loader, {
|
|
21
|
-
size: "sm"
|
|
22
|
-
}) : void 0,
|
|
23
|
-
...props
|
|
24
|
-
});
|
|
25
|
-
};
|
|
26
|
-
export { Textarea_Textarea as Textarea };
|