@rolder/kit 3.0.0-alpha.11 → 3.0.0-alpha.112
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/ai/index.d.ts +2 -0
- package/dist/ai/index.js +2 -0
- package/dist/ai/ui/chat/Root.d.ts +55 -0
- package/dist/ai/ui/chat/Root.js +18 -0
- package/dist/ai/ui/chat/chatInput/File.js +71 -0
- package/dist/ai/ui/chat/chatInput/FileIcon.js +43 -0
- package/dist/ai/ui/chat/chatInput/Root.d.ts +9 -0
- package/dist/ai/ui/chat/chatInput/Root.js +24 -0
- package/dist/ai/ui/chat/chatInput/Submit.js +23 -0
- package/dist/ai/ui/{promptInput → chat/chatInput}/Textarea.js +8 -7
- package/dist/ai/ui/{promptInput → chat/chatInput}/index.d.ts +2 -3
- package/dist/ai/ui/{promptInput → chat/chatInput}/index.js +2 -2
- package/dist/ai/ui/chat/chatInput/store/file.d.ts +8 -0
- package/dist/ai/ui/chat/chatInput/store/file.js +32 -0
- package/dist/ai/ui/chat/chatInput/store/fileErrorNotificaton.d.ts +2 -0
- package/dist/ai/ui/chat/chatInput/store/fileErrorNotificaton.js +21 -0
- package/dist/ai/ui/chat/chatInput/store/index.d.ts +2 -0
- package/dist/ai/ui/chat/chatInput/store/index.js +2 -0
- package/dist/ai/ui/chat/chatInput/store/input.d.ts +13 -0
- package/dist/ai/ui/chat/chatInput/store/input.js +81 -0
- package/dist/ai/ui/chat/chatInput/store/parseFile.d.ts +2 -0
- package/dist/ai/ui/chat/chatInput/store/parseFile.js +23 -0
- package/dist/ai/ui/chat/index.d.ts +12 -0
- package/dist/ai/ui/chat/index.js +15 -0
- package/dist/ai/ui/chat/messages/Empty.d.ts +4 -0
- package/dist/ai/ui/chat/messages/Empty.js +11 -0
- package/dist/ai/ui/chat/messages/Loader.d.ts +5 -0
- package/dist/ai/ui/chat/messages/Loader.js +12 -0
- package/dist/ai/ui/chat/messages/Message.d.ts +8 -0
- package/dist/ai/ui/chat/messages/Message.js +22 -0
- package/dist/ai/ui/chat/messages/Messages.d.ts +3 -0
- package/dist/ai/ui/chat/messages/Messages.js +40 -0
- package/dist/ai/ui/chat/messages/index.d.ts +2 -0
- package/dist/ai/ui/chat/messages/index.js +2 -0
- package/dist/ai/ui/chat/parts/File.d.ts +6 -0
- package/dist/ai/ui/{conversation → chat/parts}/File.js +10 -10
- package/dist/ai/ui/chat/parts/FileIcon.js +43 -0
- package/dist/ai/ui/chat/parts/PartPaper.d.ts +8 -0
- package/dist/ai/ui/chat/parts/PartPaper.js +14 -0
- package/dist/ai/ui/chat/parts/TextPart.d.ts +6 -0
- package/dist/ai/ui/chat/parts/TextPart.js +15 -0
- package/dist/ai/ui/chat/parts/ToolExecution.d.ts +7 -0
- package/dist/ai/ui/chat/parts/ToolExecution.js +56 -0
- package/dist/ai/ui/chat/parts/ToolPart.d.ts +10 -0
- package/dist/ai/ui/chat/parts/ToolPart.js +24 -0
- package/dist/ai/ui/chat/parts/index.d.ts +3 -0
- package/dist/ai/ui/chat/parts/index.js +3 -0
- package/dist/ai/ui/chat/store/index.d.ts +4 -0
- package/dist/ai/ui/chat/store/index.js +4 -0
- package/dist/ai/ui/chat/store/messages.d.ts +12 -0
- package/dist/ai/ui/chat/store/messages.js +40 -0
- package/dist/ai/ui/chat/store/send.d.ts +14 -0
- package/dist/ai/ui/chat/store/send.js +16 -0
- package/dist/ai/ui/chat/store/states.d.ts +11 -0
- package/dist/ai/ui/chat/store/states.js +20 -0
- package/dist/ai/ui/chat/store/useInitChat.d.ts +3 -0
- package/dist/ai/ui/chat/store/useInitChat.js +40 -0
- package/dist/ai/ui/index.d.ts +1 -0
- package/dist/ai/ui/index.js +1 -0
- package/dist/ai/utils/index.d.ts +2 -0
- package/dist/ai/utils/index.js +2 -0
- package/dist/app/AppDefaults.js +1 -1
- package/dist/app/DefaultApp.js +1 -1
- package/dist/app/cookieColorSchemeManager.js +1 -1
- package/dist/app/defaultTheme.d.ts +7 -7
- package/dist/app/index.d.ts +3 -0
- package/dist/app/index.js +3 -0
- package/dist/betterAuth/client/getAuthClient.d.ts +3050 -0
- package/dist/betterAuth/client/getAuthClient.js +18 -0
- package/dist/betterAuth/client/index.d.ts +1 -0
- package/dist/betterAuth/client/index.js +1 -0
- package/dist/betterAuth/index.d.ts +3 -0
- package/dist/betterAuth/index.js +3 -0
- package/dist/betterAuth/server/defaultAuthServerConfig.d.ts +452 -0
- package/dist/betterAuth/server/defaultAuthServerConfig.js +49 -0
- package/dist/betterAuth/server/env.d.ts +1 -0
- package/dist/betterAuth/server/env.js +8 -0
- package/dist/betterAuth/server/getDBSession.d.ts +2 -0
- package/dist/betterAuth/server/getDBSession.js +85 -0
- package/dist/betterAuth/server/getSessionToken.d.ts +1 -0
- package/dist/betterAuth/server/getSessionToken.js +14 -0
- package/dist/betterAuth/server/getSessionUser.d.ts +1 -0
- package/dist/betterAuth/server/getSessionUser.js +22 -0
- package/dist/betterAuth/server/index.d.ts +10 -0
- package/dist/betterAuth/server/index.js +11 -0
- package/dist/betterAuth/server/surrealDbAdapter/adapter.d.ts +8 -0
- package/dist/betterAuth/server/surrealDbAdapter/adapter.js +64 -0
- package/dist/betterAuth/server/surrealDbAdapter/adapter.test.d.ts +1 -0
- package/dist/betterAuth/server/surrealDbAdapter/adapter.test.js +84 -0
- package/dist/betterAuth/server/surrealDbAdapter/db/getDB.d.ts +2 -0
- package/dist/betterAuth/server/surrealDbAdapter/db/getDB.js +26 -0
- package/dist/betterAuth/server/surrealDbAdapter/db/index.d.ts +1 -0
- package/dist/betterAuth/server/surrealDbAdapter/db/index.js +1 -0
- package/dist/betterAuth/server/surrealDbAdapter/db/schema.d.ts +1 -0
- package/dist/betterAuth/server/surrealDbAdapter/db/schema.js +97 -0
- package/dist/betterAuth/server/surrealDbAdapter/index.d.ts +1 -0
- package/dist/betterAuth/server/surrealDbAdapter/index.js +1 -0
- package/dist/betterAuth/server/surrealDbAdapter/methods/count.d.ts +2 -0
- package/dist/betterAuth/server/surrealDbAdapter/methods/count.js +17 -0
- package/dist/betterAuth/server/surrealDbAdapter/methods/create.d.ts +2 -0
- package/dist/betterAuth/server/surrealDbAdapter/methods/create.js +21 -0
- package/dist/betterAuth/server/surrealDbAdapter/methods/delete.d.ts +2 -0
- package/dist/betterAuth/server/surrealDbAdapter/methods/delete.js +18 -0
- package/dist/betterAuth/server/surrealDbAdapter/methods/deleteMany.d.ts +2 -0
- package/dist/betterAuth/server/surrealDbAdapter/methods/deleteMany.js +19 -0
- package/dist/betterAuth/server/surrealDbAdapter/methods/findMany.d.ts +2 -0
- package/dist/betterAuth/server/surrealDbAdapter/methods/findMany.js +51 -0
- package/dist/betterAuth/server/surrealDbAdapter/methods/findOne.d.ts +2 -0
- package/dist/betterAuth/server/surrealDbAdapter/methods/findOne.js +42 -0
- package/dist/betterAuth/server/surrealDbAdapter/methods/index.d.ts +8 -0
- package/dist/betterAuth/server/surrealDbAdapter/methods/index.js +8 -0
- package/dist/betterAuth/server/surrealDbAdapter/methods/types.d.ts +56 -0
- package/dist/betterAuth/server/surrealDbAdapter/methods/update.d.ts +2 -0
- package/dist/betterAuth/server/surrealDbAdapter/methods/update.js +25 -0
- package/dist/betterAuth/server/surrealDbAdapter/methods/updateMany.d.ts +2 -0
- package/dist/betterAuth/server/surrealDbAdapter/methods/updateMany.js +21 -0
- package/dist/betterAuth/server/surrealDbAdapter/types.d.ts +2 -0
- package/dist/betterAuth/server/surrealDbAdapter/utils/applyJoinMappings.d.ts +2 -0
- package/dist/betterAuth/server/surrealDbAdapter/utils/applyJoinMappings.js +31 -0
- package/dist/betterAuth/server/surrealDbAdapter/utils/buildExpression.d.ts +3 -0
- package/dist/betterAuth/server/surrealDbAdapter/utils/buildExpression.js +58 -0
- package/dist/betterAuth/server/surrealDbAdapter/utils/buildJoinPlan.d.ts +9 -0
- package/dist/betterAuth/server/surrealDbAdapter/utils/buildJoinPlan.js +46 -0
- package/dist/betterAuth/server/surrealDbAdapter/utils/buildSelectFields.d.ts +1 -0
- package/dist/betterAuth/server/surrealDbAdapter/utils/buildSelectFields.js +5 -0
- package/dist/betterAuth/server/surrealDbAdapter/utils/index.d.ts +6 -0
- package/dist/betterAuth/server/surrealDbAdapter/utils/index.js +6 -0
- package/dist/betterAuth/server/surrealDbAdapter/utils/normalizeOutputRecordIds.d.ts +2 -0
- package/dist/betterAuth/server/surrealDbAdapter/utils/normalizeOutputRecordIds.js +43 -0
- package/dist/betterAuth/server/surrealDbAdapter/utils/normalizeRecordIds.d.ts +2 -0
- package/dist/betterAuth/server/surrealDbAdapter/utils/normalizeRecordIds.js +38 -0
- package/dist/betterAuth/server/surrealDbAdapter/utils/normalizeWhereValue.d.ts +2 -0
- package/dist/betterAuth/server/surrealDbAdapter/utils/normalizeWhereValue.js +33 -0
- package/dist/betterAuth/server/surrealDbAdapter/utils/types.d.ts +34 -0
- package/dist/betterAuth/server/types.d.ts +8 -0
- package/dist/betterAuth/useSessionUser.d.ts +1 -0
- package/dist/betterAuth/useSessionUser.js +8 -0
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/index.js +2 -0
- package/dist/styles.css +3 -8
- package/dist/surrealDB/deafaultCrud.d.ts +2 -0
- package/dist/{surreal → surrealDB}/deafaultCrud.js +6 -5
- package/dist/surrealDB/getDBInstance.d.ts +3 -0
- package/dist/surrealDB/getDBInstance.js +34 -0
- package/dist/surrealDB/getDBInstanceTanstack.d.ts +3 -0
- package/dist/{surreal/connection.js → surrealDB/getDBInstanceTanstack.js} +2 -2
- package/dist/surrealDB/index.d.ts +6 -0
- package/dist/surrealDB/index.js +6 -0
- package/dist/{surreal/connection.d.ts → surrealDB/types.d.ts} +3 -3
- package/dist/surrealDB/types.js +0 -0
- package/dist/tanstack/cookie/index.d.ts +3 -0
- package/dist/tanstack/cookie/index.js +4 -0
- package/dist/{functions → tanstack/cookie}/setCookie.d.ts +1 -1
- package/dist/tanstack/index.d.ts +3 -0
- package/dist/tanstack/index.js +3 -0
- package/dist/tanstack/middlewares/index.d.ts +6 -0
- package/dist/tanstack/middlewares/index.js +5 -0
- package/dist/tanstack/middlewares/locale.d.ts +4 -0
- package/dist/{app/defaultRequestMiddlewares.js → tanstack/middlewares/locale.js} +2 -5
- package/dist/tanstack/s3/getS3Client.d.ts +2 -0
- package/dist/tanstack/s3/getS3Client.js +18 -0
- package/dist/tanstack/s3/getSignedFileUrlFn.d.ts +4 -0
- package/dist/tanstack/s3/getSignedFileUrlFn.js +21 -0
- package/dist/tanstack/s3/index.d.ts +2 -0
- package/dist/tanstack/s3/index.js +2 -0
- package/dist/tanstack/s3/uploadRequest.d.ts +3 -0
- package/dist/tanstack/s3/uploadRequest.js +21 -0
- package/dist/ui/AnimatedChevron.d.ts +3 -4
- package/dist/ui/AnimatedChevron.js +6 -25
- package/dist/ui/JsonInput.d.ts +1 -1
- package/dist/ui/JsonInput.js +1 -1
- package/dist/ui/editor/Content.d.ts +2 -2
- package/dist/ui/editor/Content.js +2 -2
- package/dist/ui/editor/Root.d.ts +7 -1
- package/dist/ui/editor/Root.js +42 -5
- package/dist/ui/editor/Toolbar.d.ts +3 -2
- package/dist/ui/editor/Toolbar.js +7 -25
- package/dist/ui/editor/index.d.ts +5 -9
- package/dist/ui/editor/index.js +3 -4
- package/dist/ui/editor/store.d.ts +6 -0
- package/dist/ui/editor/store.js +10 -0
- package/dist/ui/error/DefaultError.d.ts +1 -1
- package/dist/ui/error/DefaultNotFound.d.ts +1 -1
- package/dist/ui/error/Forbidden.d.ts +1 -1
- package/dist/ui/form/buttons/CancelButton.d.ts +2 -2
- package/dist/ui/form/buttons/CancelButton.js +4 -26
- package/dist/ui/form/buttons/SubmitButton.d.ts +2 -2
- package/dist/ui/form/buttons/SubmitButton.js +4 -29
- package/dist/ui/form/buttons/SubscribeActionIcon.d.ts +2 -2
- package/dist/ui/form/buttons/SubscribeButton.d.ts +2 -2
- package/dist/ui/form/context.d.ts +55 -55
- package/dist/ui/form/context.js +3 -3
- package/dist/ui/form/fields/JsonField.d.ts +1 -1
- package/dist/ui/form/fields/MultiSelectField.d.ts +1 -1
- package/dist/ui/form/fields/NumberField.d.ts +1 -1
- package/dist/ui/form/fields/PasswordField.d.ts +2 -0
- package/dist/ui/form/fields/{PassowrdField.js → PasswordField.js} +2 -2
- package/dist/ui/form/fields/SelectField.d.ts +1 -1
- package/dist/ui/form/fields/SwitchField.d.ts +1 -1
- package/dist/ui/form/fields/TextField.d.ts +1 -1
- package/dist/ui/form/fields/TextPasswordField.d.ts +2 -0
- package/dist/ui/form/fields/TextPasswordField.js +29 -0
- package/dist/ui/form/fields/TextareaField.d.ts +1 -1
- package/dist/ui/form/fields/index.d.ts +2 -2
- package/dist/ui/form/fields/index.js +2 -2
- package/dist/ui/form/index.d.ts +0 -1
- package/dist/ui/form/index.js +1 -2
- package/dist/ui/index.d.ts +9 -0
- package/dist/ui/index.js +9 -0
- package/dist/ui/saveInput/JsonInput.d.ts +2 -2
- package/dist/ui/saveInput/NumberInput.d.ts +2 -2
- package/dist/ui/saveInput/SaveInput.d.ts +14 -14
- package/dist/ui/saveInput/Select.d.ts +2 -2
- package/dist/ui/saveInput/Switch.d.ts +2 -2
- package/dist/ui/saveInput/TextInput.d.ts +2 -2
- package/dist/ui/saveInput/Textarea.d.ts +2 -2
- package/dist/ui/scrollArea/Root.d.ts +7 -0
- package/dist/ui/scrollArea/Root.js +42 -0
- package/dist/ui/scrollArea/ScrollButton.d.ts +7 -0
- package/dist/ui/scrollArea/ScrollButton.js +30 -0
- package/dist/ui/scrollArea/index.d.ts +6 -3
- package/dist/ui/scrollArea/index.js +7 -3
- package/dist/ui/scrollArea/methods.d.ts +4 -0
- package/dist/ui/scrollArea/methods.js +32 -0
- package/dist/ui/scrollArea/store.d.ts +12 -0
- package/dist/ui/scrollArea/store.js +25 -0
- package/dist/{ui/form/fieldsSchema.d.ts → zodSchemas.d.ts} +1 -1
- package/dist/{ui/form/fieldsSchema.js → zodSchemas.js} +2 -2
- package/package.json +103 -71
- package/dist/ai/ui/conversation/ConversationContext.d.ts +0 -7
- package/dist/ai/ui/conversation/ConversationContext.js +0 -8
- package/dist/ai/ui/conversation/ConversationProvider.d.ts +0 -2
- package/dist/ai/ui/conversation/ConversationProvider.js +0 -14
- package/dist/ai/ui/conversation/Empty.d.ts +0 -1
- package/dist/ai/ui/conversation/Empty.js +0 -21
- package/dist/ai/ui/conversation/File.d.ts +0 -4
- package/dist/ai/ui/conversation/FileIcon.js +0 -225
- package/dist/ai/ui/conversation/Loader.d.ts +0 -2
- package/dist/ai/ui/conversation/Loader.js +0 -12
- package/dist/ai/ui/conversation/Message.d.ts +0 -4
- package/dist/ai/ui/conversation/Message.js +0 -25
- package/dist/ai/ui/conversation/Root.d.ts +0 -2
- package/dist/ai/ui/conversation/Root.js +0 -26
- package/dist/ai/ui/conversation/index.d.ts +0 -13
- package/dist/ai/ui/conversation/index.js +0 -14
- package/dist/ai/ui/conversation/types.d.ts +0 -7
- package/dist/ai/ui/conversation/useChatMessage.d.ts +0 -2
- package/dist/ai/ui/conversation/useChatMessage.js +0 -12
- package/dist/ai/ui/promptInput/File.js +0 -117
- package/dist/ai/ui/promptInput/FileIcon.js +0 -225
- package/dist/ai/ui/promptInput/PromptInputContext.d.ts +0 -12
- package/dist/ai/ui/promptInput/PromptInputContext.js +0 -8
- package/dist/ai/ui/promptInput/PromptInputProvider.d.ts +0 -2
- package/dist/ai/ui/promptInput/PromptInputProvider.js +0 -50
- package/dist/ai/ui/promptInput/Root.d.ts +0 -3
- package/dist/ai/ui/promptInput/Root.js +0 -17
- package/dist/ai/ui/promptInput/Submit.js +0 -40
- package/dist/ai/ui/promptInput/types.d.ts +0 -11
- package/dist/app/defaultRequestMiddlewares.d.ts +0 -4
- package/dist/index.d.ts +0 -26
- package/dist/index.js +0 -26
- package/dist/surreal/deafaultCrud.d.ts +0 -2
- package/dist/ui/editor/Provider.d.ts +0 -17
- package/dist/ui/editor/Provider.js +0 -80
- package/dist/ui/editor/types.d.ts +0 -7
- package/dist/ui/form/fields/PassowrdField.d.ts +0 -2
- package/dist/ui/form/fields/TextPassowrdField.d.ts +0 -2
- package/dist/ui/form/fields/TextPassowrdField.js +0 -51
- package/dist/ui/scrollArea/ScrollArea.d.ts +0 -62
- package/dist/ui/scrollArea/ScrollArea.js +0 -30
- package/dist/ui/scrollArea/ScrollAreaButton.d.ts +0 -5
- package/dist/ui/scrollArea/ScrollAreaButton.js +0 -51
- package/dist/ui/scrollArea/ScrollAreaContent.d.ts +0 -6
- package/dist/ui/scrollArea/ScrollAreaContent.js +0 -29
- package/dist/ui/scrollArea/context.d.ts +0 -28
- package/dist/ui/scrollArea/context.js +0 -10
- package/dist/ui/scrollArea/types.d.ts +0 -65
- package/dist/ui/scrollArea/useScrollArea.d.ts +0 -9
- package/dist/ui/scrollArea/useScrollArea.js +0 -146
- /package/dist/ai/ui/{promptInput → chat/chatInput}/File.d.ts +0 -0
- /package/dist/ai/ui/{conversation → chat/chatInput}/FileIcon.d.ts +0 -0
- /package/dist/ai/ui/{promptInput → chat/chatInput}/Footer.d.ts +0 -0
- /package/dist/ai/ui/{promptInput → chat/chatInput}/Footer.js +0 -0
- /package/dist/ai/ui/{promptInput → chat/chatInput}/Submit.d.ts +0 -0
- /package/dist/ai/ui/{promptInput → chat/chatInput}/Textarea.d.ts +0 -0
- /package/dist/ai/ui/{promptInput → chat/parts}/FileIcon.d.ts +0 -0
- /package/dist/{ai/ui/conversation → betterAuth/server/surrealDbAdapter/methods}/types.js +0 -0
- /package/dist/{ai/ui/promptInput → betterAuth/server/surrealDbAdapter}/types.js +0 -0
- /package/dist/{ui/editor → betterAuth/server/surrealDbAdapter/utils}/types.js +0 -0
- /package/dist/{ui/scrollArea → betterAuth/server}/types.js +0 -0
- /package/dist/{surreal → surrealDB}/deserialize.d.ts +0 -0
- /package/dist/{surreal → surrealDB}/deserialize.js +0 -0
- /package/dist/{surreal → surrealDB}/encryption.d.ts +0 -0
- /package/dist/{surreal → surrealDB}/encryption.js +0 -0
- /package/dist/{functions → tanstack/cookie}/getCookie.d.ts +0 -0
- /package/dist/{functions → tanstack/cookie}/getCookie.js +0 -0
- /package/dist/{functions → tanstack/cookie}/setCookie.js +0 -0
- /package/dist/{functions → tanstack/cookie}/setCookies.d.ts +0 -0
- /package/dist/{functions → tanstack/cookie}/setCookies.js +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createMiddleware } from "@tanstack/react-start";
|
|
2
2
|
import { getCookie, getRequestHeader, setCookie } from "@tanstack/react-start/server";
|
|
3
|
-
const
|
|
3
|
+
const locale_locale = createMiddleware().server(async ({ next })=>{
|
|
4
4
|
const header = getRequestHeader('accept-language');
|
|
5
5
|
const headerLocale = header?.split(',')[0] || 'ru-RU';
|
|
6
6
|
const cookieLocale = getCookie('locale');
|
|
@@ -18,7 +18,4 @@ const defaultRequestMiddlewares_locale = createMiddleware().server(async ({ next
|
|
|
18
18
|
}
|
|
19
19
|
});
|
|
20
20
|
});
|
|
21
|
-
|
|
22
|
-
defaultRequestMiddlewares_locale
|
|
23
|
-
];
|
|
24
|
-
export { defaultRequestMiddlewares };
|
|
21
|
+
export { locale_locale as locale };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { custom } from "@better-upload/server/clients";
|
|
2
|
+
const getS3Client = ()=>{
|
|
3
|
+
const host = process.env.S3_HOST;
|
|
4
|
+
if (!host) throw new Error('S3_HOST environment variable is not set');
|
|
5
|
+
const region = process.env.S3_REGION;
|
|
6
|
+
if (!region) throw new Error('S3_REGION environment variable is not set');
|
|
7
|
+
const accessKeyId = process.env.S3_ACCESS_KEY_ID;
|
|
8
|
+
if (!accessKeyId) throw new Error('S3_ACCESS_KEY_ID environment variable is not set');
|
|
9
|
+
const accessKeySecret = process.env.S3_ACCESS_KEY_SECRET;
|
|
10
|
+
if (!accessKeySecret) throw new Error('S3_ACCESS_KEY_SECRET environment variable is not set');
|
|
11
|
+
return custom({
|
|
12
|
+
host,
|
|
13
|
+
region,
|
|
14
|
+
accessKeyId,
|
|
15
|
+
secretAccessKey: accessKeySecret
|
|
16
|
+
});
|
|
17
|
+
};
|
|
18
|
+
export { getS3Client };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { presignGetObject } from "@better-upload/server/helpers";
|
|
2
|
+
import { createServerFn } from "@tanstack/react-start";
|
|
3
|
+
import v4 from "zod/v4";
|
|
4
|
+
import { getS3Client } from "./getS3Client.js";
|
|
5
|
+
const Schema = v4.object({
|
|
6
|
+
s3Key: v4.string()
|
|
7
|
+
});
|
|
8
|
+
const getSignedFileUrlFn = createServerFn({
|
|
9
|
+
method: 'POST'
|
|
10
|
+
}).inputValidator(Schema).handler(async ({ data: { s3Key } })=>{
|
|
11
|
+
const bucket = process.env.S3_BUCKET_NAME;
|
|
12
|
+
if (!bucket) throw new Error('S3_BUCKET_NAME environment variable is not set');
|
|
13
|
+
const s3 = getS3Client();
|
|
14
|
+
const url = await presignGetObject(s3, {
|
|
15
|
+
bucket,
|
|
16
|
+
key: s3Key,
|
|
17
|
+
expiresIn: 300
|
|
18
|
+
});
|
|
19
|
+
return url;
|
|
20
|
+
});
|
|
21
|
+
export { getSignedFileUrlFn };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { handleRequest, route } from "@better-upload/server";
|
|
2
|
+
import { createServerOnlyFn } from "@tanstack/react-start";
|
|
3
|
+
import { getS3Client } from "./getS3Client.js";
|
|
4
|
+
const getRouter = createServerOnlyFn(()=>{
|
|
5
|
+
const bucket = process.env.S3_BUCKET_NAME;
|
|
6
|
+
if (!bucket) throw new Error('S3_BUCKET_NAME environment variable is not set');
|
|
7
|
+
const s3 = getS3Client();
|
|
8
|
+
const router = {
|
|
9
|
+
client: s3,
|
|
10
|
+
bucketName: bucket,
|
|
11
|
+
routes: {
|
|
12
|
+
upload: route({
|
|
13
|
+
multipleFiles: false,
|
|
14
|
+
maxFileSize: 52428800
|
|
15
|
+
})
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
return router;
|
|
19
|
+
});
|
|
20
|
+
const uploadRequest = async ({ request })=>handleRequest(request, getRouter());
|
|
21
|
+
export { uploadRequest };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import type
|
|
2
|
-
interface
|
|
1
|
+
import { type IconProps } from '@tabler/icons-react';
|
|
2
|
+
export interface AnimatedChevronProps extends IconProps {
|
|
3
3
|
expanded?: boolean;
|
|
4
4
|
}
|
|
5
|
-
export declare const AnimatedChevron:
|
|
6
|
-
export {};
|
|
5
|
+
export declare const AnimatedChevron: React.FC<AnimatedChevronProps>;
|
|
@@ -1,31 +1,12 @@
|
|
|
1
|
-
import { jsx
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
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,
|
|
14
5
|
style: {
|
|
15
6
|
transition: 'transform 0.2s ease-in-out',
|
|
16
|
-
transform: expanded ? 'rotate(
|
|
7
|
+
transform: expanded ? 'rotate(180deg)' : 'rotate(0deg)',
|
|
17
8
|
...style
|
|
18
9
|
},
|
|
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
|
-
]
|
|
10
|
+
...props
|
|
30
11
|
});
|
|
31
12
|
export { AnimatedChevron };
|
package/dist/ui/JsonInput.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { type ReactCodeMirrorProps } from '@uiw/react-codemirror';
|
|
2
|
-
export declare const JsonInput:
|
|
2
|
+
export declare const JsonInput: React.FC<ReactCodeMirrorProps>;
|
package/dist/ui/JsonInput.js
CHANGED
|
@@ -5,7 +5,7 @@ import { linter } from "@codemirror/lint";
|
|
|
5
5
|
import { keymap } from "@codemirror/view";
|
|
6
6
|
import { vscodeDark, vscodeLight } from "@uiw/codemirror-theme-vscode";
|
|
7
7
|
import react_codemirror from "@uiw/react-codemirror";
|
|
8
|
-
import { getCookie } from "../
|
|
8
|
+
import { getCookie } from "../tanstack/index.js";
|
|
9
9
|
const formatJson = (view)=>{
|
|
10
10
|
try {
|
|
11
11
|
const text = view.state.doc.toString();
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export declare const Content:
|
|
1
|
+
export declare const Content: React.FC<{
|
|
2
2
|
height: string;
|
|
3
|
-
}
|
|
3
|
+
}>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { RichTextEditor } from "@mantine/tiptap";
|
|
3
3
|
import { ScrollArea } from "../scrollArea/index.js";
|
|
4
|
-
const Content = ({ height })=>/*#__PURE__*/ jsxs(ScrollArea, {
|
|
5
|
-
|
|
4
|
+
const Content = ({ height })=>/*#__PURE__*/ jsxs(ScrollArea.Root, {
|
|
5
|
+
height: height,
|
|
6
6
|
autoScroll: true,
|
|
7
7
|
radius: "md",
|
|
8
8
|
children: [
|
package/dist/ui/editor/Root.d.ts
CHANGED
|
@@ -1,2 +1,8 @@
|
|
|
1
1
|
import { type RichTextEditorProps } from '@mantine/tiptap';
|
|
2
|
-
|
|
2
|
+
import { type EditorOptions } from '@tiptap/react';
|
|
3
|
+
export interface EditorProps extends RichTextEditorProps {
|
|
4
|
+
editable?: boolean;
|
|
5
|
+
disabledToolbar?: boolean;
|
|
6
|
+
onUpdate: EditorOptions['onUpdate'];
|
|
7
|
+
}
|
|
8
|
+
export declare const Root: React.FC<EditorProps>;
|
package/dist/ui/editor/Root.js
CHANGED
|
@@ -1,10 +1,47 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { RichTextEditor } from "@mantine/tiptap";
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
import { Link, RichTextEditor, getTaskListExtension } from "@mantine/tiptap";
|
|
3
|
+
import extension_highlight from "@tiptap/extension-highlight";
|
|
4
|
+
import extension_placeholder from "@tiptap/extension-placeholder";
|
|
5
|
+
import { TableKit } from "@tiptap/extension-table";
|
|
6
|
+
import extension_task_item from "@tiptap/extension-task-item";
|
|
7
|
+
import extension_task_list from "@tiptap/extension-task-list";
|
|
8
|
+
import extension_text_align from "@tiptap/extension-text-align";
|
|
9
|
+
import { useEditor } from "@tiptap/react";
|
|
10
|
+
import starter_kit from "@tiptap/starter-kit";
|
|
11
|
+
import { useState } from "react";
|
|
12
|
+
import { setDisabledToolbar } from "./store.js";
|
|
13
|
+
const Root = ({ children, classNames, content, editable = true, disabledToolbar, onUpdate, editor: customEditor, ...props })=>{
|
|
14
|
+
useState(()=>setDisabledToolbar(disabledToolbar || false));
|
|
15
|
+
const editor = useEditor({
|
|
16
|
+
shouldRerenderOnTransaction: false,
|
|
17
|
+
immediatelyRender: false,
|
|
18
|
+
extensions: [
|
|
19
|
+
starter_kit.configure({
|
|
20
|
+
link: false
|
|
21
|
+
}),
|
|
22
|
+
extension_placeholder.configure({
|
|
23
|
+
placeholder: 'Документ пуст'
|
|
24
|
+
}),
|
|
25
|
+
Link,
|
|
26
|
+
extension_highlight,
|
|
27
|
+
extension_text_align.configure({
|
|
28
|
+
types: [
|
|
29
|
+
'heading',
|
|
30
|
+
'paragraph'
|
|
31
|
+
]
|
|
32
|
+
}),
|
|
33
|
+
getTaskListExtension(extension_task_list),
|
|
34
|
+
extension_task_item.configure({
|
|
35
|
+
nested: true
|
|
36
|
+
}),
|
|
37
|
+
TableKit
|
|
38
|
+
],
|
|
39
|
+
content,
|
|
40
|
+
onUpdate,
|
|
41
|
+
editable
|
|
42
|
+
});
|
|
6
43
|
return /*#__PURE__*/ jsx(RichTextEditor, {
|
|
7
|
-
editor: editor,
|
|
44
|
+
editor: customEditor || editor,
|
|
8
45
|
classNames: {
|
|
9
46
|
root: 'rolder-editor-root',
|
|
10
47
|
content: 'rolder-editor-content',
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
|
-
export
|
|
2
|
+
export interface ToolbarProps {
|
|
3
3
|
saving?: boolean;
|
|
4
4
|
children?: ReactNode;
|
|
5
|
-
}
|
|
5
|
+
}
|
|
6
|
+
export declare const Toolbar: React.FC<ToolbarProps>;
|
|
@@ -1,10 +1,11 @@
|
|
|
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 {
|
|
4
|
+
import { IconCheck } from "@tabler/icons-react";
|
|
5
|
+
import { getDisabledToolbar, useEditor } from "./store.js";
|
|
5
6
|
const Toolbar = ({ saving, children })=>{
|
|
6
|
-
const
|
|
7
|
-
return
|
|
7
|
+
const editor = useEditor();
|
|
8
|
+
return getDisabledToolbar() ? null : /*#__PURE__*/ jsxs(RichTextEditor.Toolbar, {
|
|
8
9
|
sticky: true,
|
|
9
10
|
children: [
|
|
10
11
|
/*#__PURE__*/ jsxs(RichTextEditor.ControlsGroup, {
|
|
@@ -124,28 +125,9 @@ const Toolbar = ({ saving, children })=>{
|
|
|
124
125
|
},
|
|
125
126
|
children: saving ? /*#__PURE__*/ jsx(Loader, {
|
|
126
127
|
size: 14
|
|
127
|
-
}) : /*#__PURE__*/
|
|
128
|
-
|
|
129
|
-
|
|
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,12 +1,8 @@
|
|
|
1
1
|
export declare const Editor: {
|
|
2
|
-
Root:
|
|
3
|
-
Content: ({
|
|
2
|
+
Root: import("react").FC<import("./Root").EditorProps>;
|
|
3
|
+
Content: import("react").FC<{
|
|
4
4
|
height: string;
|
|
5
|
-
}
|
|
6
|
-
Toolbar: (
|
|
7
|
-
saving?: boolean;
|
|
8
|
-
children?: import("react").ReactNode;
|
|
9
|
-
}) => import("react/jsx-runtime").JSX.Element | null;
|
|
10
|
-
Provider: ({ children, initialContent, initialEditable, initialDisabledToolbar, onChange, }: import("./types").EditorProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
}>;
|
|
6
|
+
Toolbar: import("react").FC<import("./Toolbar").ToolbarProps>;
|
|
11
7
|
};
|
|
12
|
-
export
|
|
8
|
+
export * from './store';
|
package/dist/ui/editor/index.js
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { Content } from "./Content.js";
|
|
2
|
-
import { Provider, useEditor } from "./Provider.js";
|
|
3
2
|
import { Root } from "./Root.js";
|
|
4
3
|
import { Toolbar } from "./Toolbar.js";
|
|
4
|
+
export * from "./store.js";
|
|
5
5
|
const Editor = {
|
|
6
6
|
Root: Root,
|
|
7
7
|
Content: Content,
|
|
8
|
-
Toolbar: Toolbar
|
|
9
|
-
Provider: Provider
|
|
8
|
+
Toolbar: Toolbar
|
|
10
9
|
};
|
|
11
|
-
export { Editor
|
|
10
|
+
export { Editor };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { Editor } from '@tiptap/react';
|
|
2
|
+
export declare const getEditor: () => Editor | null;
|
|
3
|
+
export declare const useEditor: () => Editor | null;
|
|
4
|
+
export declare const setEditor: (editor: Editor) => void;
|
|
5
|
+
export declare const getDisabledToolbar: () => boolean;
|
|
6
|
+
export declare const setDisabledToolbar: (disabled: boolean) => void;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { useStore } from "@nanostores/react";
|
|
2
|
+
import { atom } from "nanostores";
|
|
3
|
+
const $editor = atom(null);
|
|
4
|
+
const getEditor = ()=>$editor.get();
|
|
5
|
+
const useEditor = ()=>useStore($editor);
|
|
6
|
+
const setEditor = (editor)=>$editor.set(editor);
|
|
7
|
+
const $disabledToolbar = atom(false);
|
|
8
|
+
const getDisabledToolbar = ()=>$disabledToolbar.get();
|
|
9
|
+
const setDisabledToolbar = (disabled)=>$disabledToolbar.set(disabled);
|
|
10
|
+
export { getDisabledToolbar, getEditor, setDisabledToolbar, setEditor, useEditor };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { ErrorComponentProps } from '@tanstack/react-router';
|
|
2
|
-
export declare const DefaultError:
|
|
2
|
+
export declare const DefaultError: React.FC<ErrorComponentProps>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const DefaultNotFound:
|
|
1
|
+
export declare const DefaultNotFound: React.FC;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const Forbidden:
|
|
1
|
+
export declare const Forbidden: React.FC;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type ButtonProps } from '@mantine/core';
|
|
2
|
-
export declare const CancelButton:
|
|
2
|
+
export declare const CancelButton: React.FC<ButtonProps & {
|
|
3
3
|
label?: string;
|
|
4
4
|
onClick?: () => void;
|
|
5
|
-
}
|
|
5
|
+
}>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { jsx
|
|
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__*/
|
|
13
|
-
|
|
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,5 @@
|
|
|
1
1
|
import { type ButtonProps } from '@mantine/core';
|
|
2
|
-
export declare const SubmitButton:
|
|
2
|
+
export declare const SubmitButton: React.FC<ButtonProps & {
|
|
3
3
|
label?: string;
|
|
4
4
|
onClick?: () => void;
|
|
5
|
-
}
|
|
5
|
+
}>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { jsx
|
|
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__*/
|
|
12
|
-
|
|
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,4 +1,4 @@
|
|
|
1
1
|
import { type ActionIconProps } from '@mantine/core';
|
|
2
|
-
export declare const SubscribeActionIcon:
|
|
2
|
+
export declare const SubscribeActionIcon: React.FC<ActionIconProps & {
|
|
3
3
|
onClick?: () => void;
|
|
4
|
-
}
|
|
4
|
+
}>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type ButtonProps } from '@mantine/core';
|
|
2
|
-
export declare const SubscribeButton:
|
|
2
|
+
export declare const SubscribeButton: React.FC<ButtonProps & {
|
|
3
3
|
label: string;
|
|
4
4
|
onClick?: () => void;
|
|
5
|
-
}
|
|
5
|
+
}>;
|