@rolder/kit 3.0.0-alpha.2 → 3.0.0-alpha.20

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.
Files changed (54) hide show
  1. package/dist/ai/index.d.ts +1 -0
  2. package/dist/ai/index.js +1 -0
  3. package/dist/ai/ui/conversation/FileIcon.js +26 -208
  4. package/dist/ai/ui/conversation/index.d.ts +2 -2
  5. package/dist/ai/ui/conversation/index.js +3 -2
  6. package/dist/ai/ui/index.d.ts +2 -0
  7. package/dist/ai/ui/index.js +2 -0
  8. package/dist/ai/ui/promptInput/File.js +7 -56
  9. package/dist/ai/ui/promptInput/FileIcon.js +26 -208
  10. package/dist/ai/ui/promptInput/Submit.js +4 -23
  11. package/dist/ai/ui/promptInput/index.d.ts +1 -1
  12. package/dist/ai/ui/promptInput/index.js +1 -0
  13. package/dist/app/index.d.ts +1 -0
  14. package/dist/app/index.js +1 -0
  15. package/dist/functions/index.d.ts +3 -1
  16. package/dist/functions/index.js +4 -1
  17. package/dist/index.d.ts +1 -3
  18. package/dist/index.js +1 -4
  19. package/dist/ui/AnimatedChevron.d.ts +2 -2
  20. package/dist/ui/AnimatedChevron.js +7 -25
  21. package/dist/ui/editor/Toolbar.js +4 -22
  22. package/dist/ui/error/index.d.ts +4 -4
  23. package/dist/ui/error/index.js +5 -4
  24. package/dist/ui/form/buttons/CancelButton.js +4 -26
  25. package/dist/ui/form/buttons/SubmitButton.js +4 -29
  26. package/dist/ui/form/fields/TextPassowrdField.js +4 -26
  27. package/dist/ui/form/index.d.ts +2 -2
  28. package/dist/ui/form/index.js +3 -3
  29. package/dist/ui/hoverPaper/index.d.ts +2 -2
  30. package/dist/ui/hoverPaper/index.js +3 -2
  31. package/dist/ui/scrollArea/ScrollArea.d.ts +1 -1
  32. package/dist/ui/scrollArea/ScrollAreaButton.d.ts +1 -1
  33. package/dist/ui/scrollArea/ScrollAreaButton.js +7 -28
  34. package/package.json +39 -33
  35. package/dist/functions/cookies/index.d.ts +0 -3
  36. package/dist/functions/cookies/index.js +0 -3
  37. package/dist/surreal/connection.d.ts +0 -9
  38. package/dist/surreal/connection.js +0 -49
  39. package/dist/surreal/deafaultCrud.d.ts +0 -2
  40. package/dist/surreal/deafaultCrud.js +0 -18
  41. package/dist/surreal/deserialize.d.ts +0 -17
  42. package/dist/surreal/deserialize.js +0 -46
  43. package/dist/surreal/encryption.d.ts +0 -6
  44. package/dist/surreal/encryption.js +0 -30
  45. package/dist/surreal/index.d.ts +0 -4
  46. package/dist/surreal/index.js +0 -5
  47. package/dist/ui/editor/styles.module.js +0 -7
  48. package/dist/ui/editor/styles_module.css +0 -16
  49. /package/dist/functions/{cookies/getCookie.d.ts → getCookie.d.ts} +0 -0
  50. /package/dist/functions/{cookies/getCookie.js → getCookie.js} +0 -0
  51. /package/dist/functions/{cookies/setCookie.d.ts → setCookie.d.ts} +0 -0
  52. /package/dist/functions/{cookies/setCookie.js → setCookie.js} +0 -0
  53. /package/dist/functions/{cookies/setCookies.d.ts → setCookies.d.ts} +0 -0
  54. /package/dist/functions/{cookies/setCookies.js → setCookies.js} +0 -0
@@ -1,4 +1,4 @@
1
- export type { Accept, PromptInputProps } from './types';
1
+ export * from './types';
2
2
  export declare const PromptInput: {
3
3
  Root: ({ className, onSubmit, submiting, uploading, accept, ...props }: import("@mantine/core").PaperProps & import("./types").PromptInputProps) => import("react/jsx-runtime").JSX.Element;
4
4
  Textarea: (props: import("@mantine/core").TextareaProps) => import("react/jsx-runtime").JSX.Element;
@@ -3,6 +3,7 @@ import { Footer } from "./Footer.js";
3
3
  import { Root } from "./Root.js";
4
4
  import { Submit } from "./Submit.js";
5
5
  import { Textarea } from "./Textarea.js";
6
+ export * from "./types.js";
6
7
  const PromptInput = {
7
8
  Root: Root,
8
9
  Textarea: Textarea,
@@ -1,3 +1,4 @@
1
+ export * from './AppDefaults';
1
2
  export * from './DefaultApp';
2
3
  export * from './defaultRequestMiddlewares';
3
4
  export * from './defaultTheme';
package/dist/app/index.js CHANGED
@@ -1,3 +1,4 @@
1
+ export * from "./AppDefaults.js";
1
2
  export * from "./DefaultApp.js";
2
3
  export * from "./defaultRequestMiddlewares.js";
3
4
  export * from "./defaultTheme.js";
@@ -1 +1,3 @@
1
- export * from './cookies';
1
+ export { getCookie } from './getCookie';
2
+ export { setCookie } from './setCookie';
3
+ export { setCookies } from './setCookies';
@@ -1 +1,4 @@
1
- export * from "./cookies/index.js";
1
+ import { getCookie } from "./getCookie.js";
2
+ import { setCookie } from "./setCookie.js";
3
+ import { setCookies } from "./setCookies.js";
4
+ export { getCookie, setCookie, setCookies };
package/dist/index.d.ts CHANGED
@@ -1,7 +1,5 @@
1
- export { Conversation, type ConversationProps, useChatMessage, } from './ai/ui/conversation';
2
- export { type Accept, PromptInput, type PromptInputProps, } from './ai/ui/promptInput';
1
+ export * from './ai';
3
2
  export * from './app';
4
3
  export * from './functions';
5
4
  export * from './hooks';
6
- export * from './surreal';
7
5
  export * from './ui';
package/dist/index.js CHANGED
@@ -1,8 +1,5 @@
1
- import { Conversation, useChatMessage } from "./ai/ui/conversation/index.js";
2
- import { PromptInput } from "./ai/ui/promptInput/index.js";
1
+ export * from "./ai/index.js";
3
2
  export * from "./app/index.js";
4
3
  export * from "./functions/index.js";
5
4
  export * from "./hooks/index.js";
6
- export * from "./surreal/index.js";
7
5
  export * from "./ui/index.js";
8
- export { Conversation, PromptInput, useChatMessage };
@@ -1,5 +1,5 @@
1
- import type { SVGProps } from 'react';
2
- interface Props extends SVGProps<SVGSVGElement> {
1
+ import { type IconProps } from '@tabler/icons-react';
2
+ interface Props extends IconProps {
3
3
  expanded?: boolean;
4
4
  }
5
5
  export declare const AnimatedChevron: ({ expanded, style, ...props }: Props) => import("react/jsx-runtime").JSX.Element;
@@ -1,31 +1,13 @@
1
- import { jsx, jsxs } from "react/jsx-runtime";
2
- const AnimatedChevron = ({ expanded, style, ...props })=>/*#__PURE__*/ jsxs("svg", {
3
- xmlns: "http://www.w3.org/2000/svg",
4
- width: "24",
5
- height: "24",
6
- viewBox: "0 0 24 24",
7
- fill: "none",
8
- stroke: "currentColor",
9
- strokeWidth: "1.5",
10
- strokeLinecap: "round",
11
- strokeLinejoin: "round",
12
- role: "img",
13
- "aria-label": "Chevron",
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { IconChevronDown } from "@tabler/icons-react";
3
+ const AnimatedChevron = ({ expanded, style, ...props })=>/*#__PURE__*/ jsx(IconChevronDown, {
4
+ strokeWidth: 1.5,
5
+ "data-expanded": expanded,
14
6
  style: {
15
7
  transition: 'transform 0.2s ease-in-out',
16
- transform: expanded ? 'rotate(-180deg)' : 'rotate(0deg)',
8
+ transform: expanded ? 'rotate(180deg)' : 'rotate(0deg)',
17
9
  ...style
18
10
  },
19
- ...props,
20
- children: [
21
- /*#__PURE__*/ jsx("path", {
22
- stroke: "none",
23
- d: "M0 0h24v24H0z",
24
- fill: "none"
25
- }),
26
- /*#__PURE__*/ jsx("path", {
27
- d: "M6 9l6 6l6 -6"
28
- })
29
- ]
11
+ ...props
30
12
  });
31
13
  export { AnimatedChevron };
@@ -1,6 +1,7 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import { Loader } from "@mantine/core";
3
3
  import { RichTextEditor } from "@mantine/tiptap";
4
+ import { IconCheck } from "@tabler/icons-react";
4
5
  import { useEditor } from "./Provider.js";
5
6
  const Toolbar = ({ saving, children })=>{
6
7
  const { editor, disabledToolbar } = useEditor();
@@ -124,28 +125,9 @@ const Toolbar = ({ saving, children })=>{
124
125
  },
125
126
  children: saving ? /*#__PURE__*/ jsx(Loader, {
126
127
  size: 14
127
- }) : /*#__PURE__*/ jsxs("svg", {
128
- xmlns: "http://www.w3.org/2000/svg",
129
- width: "16",
130
- height: "16",
131
- viewBox: "0 0 16 16",
132
- fill: "none",
133
- stroke: "currentColor",
134
- strokeWidth: "1.5",
135
- strokeLinecap: "round",
136
- strokeLinejoin: "round",
137
- role: "img",
138
- "aria-label": "Saved",
139
- children: [
140
- /*#__PURE__*/ jsx("path", {
141
- stroke: "none",
142
- d: "M0 0h24v24H0z",
143
- fill: "none"
144
- }),
145
- /*#__PURE__*/ jsx("path", {
146
- d: "M5 12l5 5l10 -10"
147
- })
148
- ]
128
+ }) : /*#__PURE__*/ jsx(IconCheck, {
129
+ stroke: 1.5,
130
+ size: 16
149
131
  })
150
132
  })
151
133
  ]
@@ -1,4 +1,4 @@
1
- export * from './DefaultError';
2
- export * from './DefaultNotFound';
3
- export * from './defaultErrorNotification';
4
- export * from './Forbidden';
1
+ export { DefaultError } from './DefaultError';
2
+ export { DefaultNotFound } from './DefaultNotFound';
3
+ export { defaultErrorNotification } from './defaultErrorNotification';
4
+ export { Forbidden } from './Forbidden';
@@ -1,4 +1,5 @@
1
- export * from "./DefaultError.js";
2
- export * from "./DefaultNotFound.js";
3
- export * from "./defaultErrorNotification.js";
4
- export * from "./Forbidden.js";
1
+ import { DefaultError } from "./DefaultError.js";
2
+ import { DefaultNotFound } from "./DefaultNotFound.js";
3
+ import { defaultErrorNotification } from "./defaultErrorNotification.js";
4
+ import { Forbidden } from "./Forbidden.js";
5
+ export { DefaultError, DefaultNotFound, Forbidden, defaultErrorNotification };
@@ -1,5 +1,6 @@
1
- import { jsx, jsxs } from "react/jsx-runtime";
1
+ import { jsx } from "react/jsx-runtime";
2
2
  import { Button } from "@mantine/core";
3
+ import { IconCancel } from "@tabler/icons-react";
3
4
  import { useFormContext } from "../context.js";
4
5
  const CancelButton = (props)=>{
5
6
  const form = useFormContext();
@@ -9,31 +10,8 @@ const CancelButton = (props)=>{
9
10
  type: "reset",
10
11
  size: "xs",
11
12
  variant: "light",
12
- leftSection: /*#__PURE__*/ jsxs("svg", {
13
- xmlns: "http://www.w3.org/2000/svg",
14
- width: "16",
15
- height: "16",
16
- viewBox: "0 0 16 16",
17
- fill: "none",
18
- stroke: "currentColor",
19
- strokeWidth: "2",
20
- strokeLinecap: "round",
21
- strokeLinejoin: "round",
22
- role: "img",
23
- "aria-label": "Cancel",
24
- children: [
25
- /*#__PURE__*/ jsx("path", {
26
- stroke: "none",
27
- d: "M0 0h24v24H0z",
28
- fill: "none"
29
- }),
30
- /*#__PURE__*/ jsx("path", {
31
- d: "M3 12a9 9 0 1 0 18 0a9 9 0 1 0 -18 0"
32
- }),
33
- /*#__PURE__*/ jsx("path", {
34
- d: "M18.364 5.636l-12.728 12.728"
35
- })
36
- ]
13
+ leftSection: /*#__PURE__*/ jsx(IconCancel, {
14
+ size: 16
37
15
  }),
38
16
  disabled: isSubmitting,
39
17
  ...props,
@@ -1,5 +1,6 @@
1
- import { jsx, jsxs } from "react/jsx-runtime";
1
+ import { jsx } from "react/jsx-runtime";
2
2
  import { Button } from "@mantine/core";
3
+ import { IconDeviceFloppy } from "@tabler/icons-react";
3
4
  import { useFormContext } from "../context.js";
4
5
  const SubmitButton = (props)=>{
5
6
  const form = useFormContext();
@@ -8,34 +9,8 @@ const SubmitButton = (props)=>{
8
9
  children: (state)=>/*#__PURE__*/ jsx(Button, {
9
10
  type: "submit",
10
11
  size: "xs",
11
- leftSection: /*#__PURE__*/ jsxs("svg", {
12
- xmlns: "http://www.w3.org/2000/svg",
13
- width: "20",
14
- height: "20",
15
- viewBox: "0 0 20 20",
16
- fill: "none",
17
- stroke: "currentColor",
18
- strokeWidth: "2",
19
- strokeLinecap: "round",
20
- strokeLinejoin: "round",
21
- role: "img",
22
- "aria-label": "Submit",
23
- children: [
24
- /*#__PURE__*/ jsx("path", {
25
- stroke: "none",
26
- d: "M0 0h24v24H0z",
27
- fill: "none"
28
- }),
29
- /*#__PURE__*/ jsx("path", {
30
- d: "M6 4h10l4 4v10a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2v-12a2 2 0 0 1 2 -2"
31
- }),
32
- /*#__PURE__*/ jsx("path", {
33
- d: "M10 14a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"
34
- }),
35
- /*#__PURE__*/ jsx("path", {
36
- d: "M14 4l0 4l-6 0l0 -4"
37
- })
38
- ]
12
+ leftSection: /*#__PURE__*/ jsx(IconDeviceFloppy, {
13
+ size: 20
39
14
  }),
40
15
  loading: state.isSubmitting,
41
16
  disabled: !state.isDirty,
@@ -1,5 +1,6 @@
1
- import { jsx, jsxs } from "react/jsx-runtime";
1
+ import { jsx } from "react/jsx-runtime";
2
2
  import { ActionIcon, TextInput } from "@mantine/core";
3
+ import { IconRefresh } from "@tabler/icons-react";
3
4
  import omgopass from "omgopass";
4
5
  import { useFieldContext } from "../context.js";
5
6
  const TextPassowrdField = (props)=>{
@@ -13,31 +14,8 @@ const TextPassowrdField = (props)=>{
13
14
  minSyllableLength: 2,
14
15
  maxSyllableLength: 2
15
16
  })),
16
- children: /*#__PURE__*/ jsxs("svg", {
17
- xmlns: "http://www.w3.org/2000/svg",
18
- width: "16",
19
- height: "16",
20
- viewBox: "0 0 16 16",
21
- fill: "none",
22
- stroke: "currentColor",
23
- "stroke-width": "2",
24
- "stroke-linecap": "round",
25
- "stroke-linejoin": "round",
26
- role: "img",
27
- "aria-label": "Refresh",
28
- children: [
29
- /*#__PURE__*/ jsx("path", {
30
- stroke: "none",
31
- d: "M0 0h24v24H0z",
32
- fill: "none"
33
- }),
34
- /*#__PURE__*/ jsx("path", {
35
- d: "M20 11a8.1 8.1 0 0 0 -15.5 -2m-.5 -4v4h4"
36
- }),
37
- /*#__PURE__*/ jsx("path", {
38
- d: "M4 13a8.1 8.1 0 0 0 15.5 2m.5 4v-4h-4"
39
- })
40
- ]
17
+ children: /*#__PURE__*/ jsx(IconRefresh, {
18
+ size: 16
41
19
  })
42
20
  }),
43
21
  name: field.name,
@@ -1,3 +1,3 @@
1
- export * from './blurOnError';
1
+ export { blurOnError } from './blurOnError';
2
2
  export { useAppForm, useFieldContext, withForm } from './context';
3
- export * from './fieldsSchema';
3
+ export { fieldsSchema } from './fieldsSchema';
@@ -1,4 +1,4 @@
1
+ import { blurOnError } from "./blurOnError.js";
1
2
  import { useAppForm, useFieldContext, withForm } from "./context.js";
2
- export * from "./blurOnError.js";
3
- export * from "./fieldsSchema.js";
4
- export { useAppForm, useFieldContext, withForm };
3
+ import { fieldsSchema } from "./fieldsSchema.js";
4
+ export { blurOnError, fieldsSchema, useAppForm, useFieldContext, withForm };
@@ -1,2 +1,2 @@
1
- export * from './HoverPaper';
2
- export * from './usePaperHover';
1
+ export { HoverPaper } from './HoverPaper';
2
+ export { usePaperHover } from './usePaperHover';
@@ -1,2 +1,3 @@
1
- export * from "./HoverPaper.js";
2
- export * from "./usePaperHover.js";
1
+ import { HoverPaper } from "./HoverPaper.js";
2
+ import { usePaperHover } from "./usePaperHover.js";
3
+ export { HoverPaper, usePaperHover };
@@ -55,7 +55,7 @@ export declare const ScrollArea: {
55
55
  displayName: string;
56
56
  } & {
57
57
  ScrollButton: {
58
- ({ className }: import("./types").ScrollButtonProps): import("react/jsx-runtime").JSX.Element | null;
58
+ ({ className, upIcon, downIcon, }: import("./types").ScrollButtonProps): import("react/jsx-runtime").JSX.Element | null;
59
59
  displayName: string;
60
60
  };
61
61
  Provider: import("react").Provider<ScrollAreaContextValue | null>;
@@ -1,5 +1,5 @@
1
1
  import type { ScrollButtonProps } from './types';
2
2
  export declare const ScrollAreaButton: {
3
- ({ className }: ScrollButtonProps): import("react/jsx-runtime").JSX.Element | null;
3
+ ({ className, upIcon, downIcon, }: ScrollButtonProps): import("react/jsx-runtime").JSX.Element | null;
4
4
  displayName: string;
5
5
  };
@@ -1,36 +1,15 @@
1
- import { jsx, jsxs } from "react/jsx-runtime";
1
+ import { jsx } from "react/jsx-runtime";
2
2
  import { ActionIcon } from "@mantine/core";
3
+ import { IconChevronDown, IconChevronUp } from "@tabler/icons-react";
3
4
  import { useScrollArea } from "./context.js";
4
- const ScrollAreaButton = ({ className })=>{
5
+ const ScrollAreaButton = ({ className, upIcon, downIcon })=>{
5
6
  const { hasScrollableContent, isAboveCenter, scrollToTop, scrollToBottom } = useScrollArea();
6
7
  if (!hasScrollableContent) return null;
7
8
  const isScrollingDown = isAboveCenter;
8
- const icon = /*#__PURE__*/ jsxs("svg", {
9
- xmlns: "http://www.w3.org/2000/svg",
10
- width: "24",
11
- height: "24",
12
- viewBox: "0 0 24 24",
13
- fill: "none",
14
- stroke: "currentColor",
15
- strokeWidth: "1.5",
16
- strokeLinecap: "round",
17
- strokeLinejoin: "round",
18
- role: "img",
19
- "aria-label": "Chevron",
20
- style: {
21
- transition: 'transform 0.2s ease-in-out',
22
- transform: isScrollingDown ? 'rotate(-180deg)' : 'rotate(0deg)'
23
- },
24
- children: [
25
- /*#__PURE__*/ jsx("path", {
26
- stroke: "none",
27
- d: "M0 0h24v24H0z",
28
- fill: "none"
29
- }),
30
- /*#__PURE__*/ jsx("path", {
31
- d: "M6 9l6 6l6 -6"
32
- })
33
- ]
9
+ const icon = isScrollingDown ? downIcon ?? /*#__PURE__*/ jsx(IconChevronDown, {
10
+ strokeWidth: 1.5
11
+ }) : upIcon ?? /*#__PURE__*/ jsx(IconChevronUp, {
12
+ strokeWidth: 1.5
34
13
  });
35
14
  const handleClick = ()=>{
36
15
  if (isScrollingDown) scrollToBottom();
package/package.json CHANGED
@@ -1,13 +1,17 @@
1
1
  {
2
2
  "name": "@rolder/kit",
3
- "version": "3.0.0-alpha.2",
3
+ "version": "3.0.0-alpha.20",
4
4
  "type": "module",
5
+ "main": "./dist/index.js",
6
+ "module": "./dist/index.js",
7
+ "types": "./dist/index.d.ts",
5
8
  "exports": {
6
9
  ".": {
7
10
  "types": "./dist/index.d.ts",
8
11
  "import": "./dist/index.js"
9
12
  }
10
13
  },
14
+ "sideEffects": false,
11
15
  "files": [
12
16
  "dist"
13
17
  ],
@@ -25,43 +29,45 @@
25
29
  "@types/omgopass": "^3.2.3",
26
30
  "@types/react": "^19.2.8",
27
31
  "react": "^19.2.3",
28
- "typescript": "^5.9.3",
29
- "@tabler/icons": "^3.36.1"
32
+ "typescript": "^5.9.3"
30
33
  },
31
34
  "peerDependencies": {
32
- "react": ">=16.9.0",
33
- "react-dom": ">=16.9.0",
34
- "clsx": "^2.1.1",
35
- "@tiptap/extension-highlight": "^3.15.3",
36
- "@tiptap/extension-placeholder": "^3.15.3",
37
- "@tiptap/extension-table": "^3.15.3",
38
- "@tiptap/extension-task-item": "^3.15.3",
39
- "@tiptap/extension-task-list": "^3.15.3",
40
- "@tiptap/extension-text-align": "^3.15.3",
41
- "@tiptap/starter-kit": "^3.15.3",
42
- "@codemirror/lang-json": "^6.0.2",
43
- "@codemirror/lint": "^6.9.2",
44
- "@uiw/codemirror-theme-vscode": "^4.25.4",
45
- "@uiw/react-codemirror": "^4.25.4",
46
- "@mantine/core": "^8.3.11",
47
- "@mantine/hooks": "^8.3.11",
48
- "@mantine/tiptap": "^8.3.11",
49
- "@mantine/notifications": "^8.3.11",
50
- "@tanstack/react-router": "1.147.3",
51
- "@tanstack/react-form": "1.27.7",
52
- "@tanstack/react-start": "^1.149.1",
53
- "@tanstack/react-query": "^5.90.16",
54
- "@tanstack/react-router-ssr-query": "^1.147.3",
55
- "zod": "^4.3.5",
56
- "js-cookie": "^3.0.5",
57
- "nanostores": "^1.1.0",
35
+ "react": "^19.x",
36
+ "react-dom": "^19.x",
37
+ "clsx": "^2.x",
38
+ "@tiptap/extension-highlight": "^3.x",
39
+ "@tiptap/extension-placeholder": "^3.x",
40
+ "@tiptap/extension-table": "^3.x",
41
+ "@tiptap/extension-task-item": "^3.x",
42
+ "@tiptap/extension-task-list": "^3.x",
43
+ "@tiptap/extension-text-align": "^3.x",
44
+ "@tiptap/starter-kit": "^3.x",
45
+ "@codemirror/lang-json": "^6.x",
46
+ "@codemirror/lint": "^6.x",
47
+ "@uiw/codemirror-theme-vscode": "^4.x",
48
+ "@uiw/react-codemirror": "^4.x",
49
+ "@mantine/core": "^8.x",
50
+ "@mantine/hooks": "^8.x",
51
+ "@mantine/tiptap": "^8.x",
52
+ "@mantine/notifications": "^8.x",
53
+ "@tanstack/react-router": "^1.x",
54
+ "@tanstack/react-form": "^1.x",
55
+ "@tanstack/react-start": "^1.x",
56
+ "@tanstack/react-query": "^5.x",
57
+ "@tanstack/react-router-ssr-query": "^1.x",
58
+ "zod": "^4.x",
59
+ "js-cookie": "^3.x",
60
+ "nanostores": "^1.x",
58
61
  "surrealdb": "^2.0.0-alpha.16",
59
- "omgopass": "^3.2.1",
60
- "ai": "^6.0.31",
61
- "streamdown": "^2.0.1"
62
+ "omgopass": "^3.x",
63
+ "ai": "^6.x",
64
+ "streamdown": "^2.x"
62
65
  },
63
66
  "trustedDependencies": [
64
67
  "core-js",
65
68
  "esbuild"
66
- ]
69
+ ],
70
+ "dependencies": {
71
+ "@tabler/icons-react": "^3.36.1"
72
+ }
67
73
  }
@@ -1,3 +0,0 @@
1
- export * from './getCookie';
2
- export * from './setCookie';
3
- export * from './setCookies';
@@ -1,3 +0,0 @@
1
- export * from "./getCookie.js";
2
- export * from "./setCookie.js";
3
- export * from "./setCookies.js";
@@ -1,9 +0,0 @@
1
- import { type CodecOptions, Surreal } from 'surrealdb';
2
- export declare const getDB: (params?: {
3
- url?: string;
4
- namespace?: string;
5
- database?: string;
6
- username?: string;
7
- password?: string;
8
- codecOptions?: CodecOptions;
9
- } | undefined) => Promise<Surreal>;
@@ -1,49 +0,0 @@
1
- import { createServerOnlyFn } from "@tanstack/react-start";
2
- import { getCookie } from "@tanstack/react-start/server";
3
- import { DateTime, Surreal } from "surrealdb";
4
- let db = null;
5
- const getDB = createServerOnlyFn(async (params = {})=>{
6
- if (db?.isConnected) return db;
7
- const locale = getCookie('locale') || 'ru-RU';
8
- const timeZone = getCookie('tz') || 'UTC';
9
- const instance = new Surreal({
10
- codecOptions: params.codecOptions || {
11
- valueDecodeVisitor (value) {
12
- if (value instanceof DateTime) return new Date(value.toDate()).toLocaleDateString(locale, {
13
- hour: 'numeric',
14
- minute: 'numeric',
15
- timeZone
16
- });
17
- return value;
18
- }
19
- }
20
- });
21
- try {
22
- const url = params.url || process.env.SURREALDB_URL;
23
- if (!url) throw new Error('Missing required SurrealDB URL');
24
- const namespace = params.namespace || process.env.SURREALDB_NAMESPACE;
25
- if (!namespace) throw new Error('Missing required SurrealDB namespace');
26
- const database = params.database || process.env.SURREALDB_DATABASE;
27
- if (!database) throw new Error('Missing required SurrealDB database');
28
- const username = params.username || process.env.SURREALDB_USERNAME;
29
- const password = params.password || process.env.SURREALDB_PASSWORD;
30
- if (username && password) await instance.connect(url, {
31
- authentication: {
32
- username,
33
- password
34
- }
35
- });
36
- else await instance.connect(url);
37
- await instance.use({
38
- namespace,
39
- database
40
- });
41
- db = instance;
42
- return instance;
43
- } catch (error) {
44
- console.error('Failed to connect to SurrealDB:', error);
45
- db = null;
46
- throw error;
47
- }
48
- });
49
- export { getDB };
@@ -1,2 +0,0 @@
1
- export declare const surrealDeleteFn: import("@tanstack/start-client-core").RequiredFetcher<undefined, (data: string) => string, Promise<void>>;
2
- export declare const surrealUnsubscribeFn: import("@tanstack/start-client-core").RequiredFetcher<undefined, (data: string) => string, Promise<void>>;
@@ -1,18 +0,0 @@
1
- import { createServerFn } from "@tanstack/react-start";
2
- import { getDB } from "./connection.js";
3
- import { deserialize } from "./deserialize.js";
4
- const surrealDeleteFn = createServerFn({
5
- method: 'POST'
6
- }).inputValidator((data)=>data).handler(async ({ data })=>{
7
- const db = await getDB();
8
- const id = deserialize(data);
9
- await db.delete(id);
10
- });
11
- const surrealUnsubscribeFn = createServerFn({
12
- method: 'POST'
13
- }).inputValidator((data)=>data).handler(async ({ data })=>{
14
- const db = await getDB();
15
- const live = await db.liveOf(data);
16
- await live.kill();
17
- });
18
- export { surrealDeleteFn, surrealUnsubscribeFn };
@@ -1,17 +0,0 @@
1
- import { RecordId } from 'surrealdb';
2
- /**
3
- * Type that converts specified string paths to RecordId, others stay as their original types
4
- */
5
- type DeserializeResult<T, IdPaths extends string = never> = T extends string ? RecordId<string> : T extends (infer U)[] ? U extends object ? {
6
- [K in keyof U]: K extends IdPaths ? RecordId<string> : U[K];
7
- }[] : DeserializeResult<U, IdPaths>[] : T extends object ? T extends Date ? T : {
8
- [K in keyof T]: K extends IdPaths ? RecordId<string> : T[K];
9
- } : T;
10
- /**
11
- * Deserializes DTO back to SurrealDB Record recursively based on specified ID paths
12
- */
13
- export declare function deserialize<T, K extends keyof T & string>(dto: T[], idPaths: K[]): DeserializeResult<T, K>[];
14
- export declare function deserialize<T, K extends keyof T & string>(dto: T, idPaths: K[]): DeserializeResult<T, K>;
15
- export declare function deserialize<T>(dto: T[]): DeserializeResult<T>[];
16
- export declare function deserialize<T>(dto: T): DeserializeResult<T>;
17
- export {};