@rolder/kit 3.0.0-alpha.8 → 3.0.0-alpha.81
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/Empty.d.ts +1 -0
- package/dist/ai/ui/chat/Empty.js +21 -0
- package/dist/ai/ui/chat/File.d.ts +3 -0
- package/dist/ai/ui/chat/File.js +43 -0
- package/dist/ai/ui/chat/FileIcon.d.ts +3 -0
- package/dist/ai/ui/chat/FileIcon.js +43 -0
- package/dist/ai/ui/chat/Loader.d.ts +2 -0
- package/dist/ai/ui/chat/Loader.js +13 -0
- package/dist/ai/ui/chat/Message.d.ts +3 -0
- package/dist/ai/ui/chat/Message.js +23 -0
- package/dist/ai/ui/chat/Messages.d.ts +2 -0
- package/dist/ai/ui/chat/Messages.js +27 -0
- package/dist/ai/ui/chat/Root.d.ts +49 -0
- package/dist/ai/ui/chat/Root.js +18 -0
- package/dist/ai/ui/chat/chatInput/File.d.ts +2 -0
- package/dist/ai/ui/chat/chatInput/File.js +71 -0
- package/dist/ai/ui/chat/chatInput/FileIcon.d.ts +3 -0
- package/dist/ai/ui/chat/chatInput/FileIcon.js +43 -0
- package/dist/ai/ui/chat/chatInput/Footer.d.ts +2 -0
- package/dist/ai/ui/chat/chatInput/Footer.js +8 -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.d.ts +2 -0
- package/dist/ai/ui/chat/chatInput/Submit.js +23 -0
- package/dist/ai/ui/chat/chatInput/Textarea.d.ts +2 -0
- package/dist/ai/ui/chat/chatInput/Textarea.js +34 -0
- package/dist/ai/ui/chat/chatInput/index.d.ts +7 -0
- package/dist/ai/ui/chat/chatInput/index.js +13 -0
- 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 +13 -0
- package/dist/ai/ui/chat/index.js +15 -0
- package/dist/ai/ui/chat/store/index.d.ts +5 -0
- package/dist/ai/ui/chat/store/index.js +5 -0
- package/dist/ai/ui/chat/store/messageIds.d.ts +8 -0
- package/dist/ai/ui/chat/store/messageIds.js +41 -0
- package/dist/ai/ui/chat/store/messagesMap.d.ts +5 -0
- package/dist/ai/ui/chat/store/messagesMap.js +15 -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 +17 -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/convertFileUIPartBlobToDataURL.d.ts +5 -0
- package/dist/ai/utils/convertFileUIPartBlobToDataURL.js +21 -0
- package/dist/ai/utils/index.d.ts +2 -0
- package/dist/ai/utils/index.js +2 -0
- package/dist/ai/utils/parseAiMessagePart.d.ts +2 -0
- package/dist/ai/utils/parseAiMessagePart.js +12 -0
- package/dist/app/AppDefaults.d.ts +3 -0
- package/dist/app/AppDefaults.js +27 -0
- package/dist/app/DefaultApp.d.ts +6 -0
- package/dist/app/DefaultApp.js +43 -0
- package/dist/app/cookieColorSchemeManager.d.ts +6 -0
- package/dist/app/cookieColorSchemeManager.js +46 -0
- package/dist/app/defaultRequestMiddlewares.d.ts +4 -0
- package/dist/app/defaultRequestMiddlewares.js +24 -0
- package/dist/app/defaultTheme.d.ts +141 -0
- package/dist/app/defaultTheme.js +24 -0
- package/dist/app/index.d.ts +4 -0
- package/dist/app/index.js +4 -0
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/index.js +2 -0
- package/dist/hooks/useMutation.d.ts +4 -0
- package/dist/hooks/useMutation.js +8 -0
- package/dist/hooks/useMutationWithInvalidate.d.ts +4 -0
- package/dist/hooks/useMutationWithInvalidate.js +16 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +5 -0
- package/{src → dist}/styles.css +14 -29
- package/dist/tanstackFunctions/cookie/getCookie.d.ts +3 -0
- package/dist/tanstackFunctions/cookie/getCookie.js +8 -0
- package/dist/tanstackFunctions/cookie/index.d.ts +3 -0
- package/dist/tanstackFunctions/cookie/index.js +4 -0
- package/dist/tanstackFunctions/cookie/setCookie.d.ts +10 -0
- package/dist/tanstackFunctions/cookie/setCookie.js +19 -0
- package/dist/tanstackFunctions/cookie/setCookies.d.ts +14 -0
- package/dist/tanstackFunctions/cookie/setCookies.js +13 -0
- package/dist/tanstackFunctions/index.d.ts +3 -0
- package/dist/tanstackFunctions/index.js +3 -0
- package/dist/tanstackFunctions/s3/getS3Client.d.ts +2 -0
- package/dist/tanstackFunctions/s3/getS3Client.js +18 -0
- package/dist/tanstackFunctions/s3/getSignedFileUrlFn.d.ts +4 -0
- package/dist/tanstackFunctions/s3/getSignedFileUrlFn.js +21 -0
- package/dist/tanstackFunctions/s3/index.d.ts +2 -0
- package/dist/tanstackFunctions/s3/index.js +2 -0
- package/dist/tanstackFunctions/s3/uploadRequest.d.ts +3 -0
- package/dist/tanstackFunctions/s3/uploadRequest.js +21 -0
- package/dist/tanstackFunctions/surreal/connection.d.ts +9 -0
- package/dist/tanstackFunctions/surreal/connection.js +49 -0
- package/dist/tanstackFunctions/surreal/deafaultCrud.d.ts +2 -0
- package/dist/tanstackFunctions/surreal/deafaultCrud.js +18 -0
- package/dist/tanstackFunctions/surreal/deserialize.d.ts +17 -0
- package/dist/tanstackFunctions/surreal/deserialize.js +46 -0
- package/dist/tanstackFunctions/surreal/encryption.d.ts +6 -0
- package/dist/tanstackFunctions/surreal/encryption.js +30 -0
- package/dist/tanstackFunctions/surreal/index.d.ts +4 -0
- package/dist/tanstackFunctions/surreal/index.js +4 -0
- package/dist/ui/AnimatedChevron.d.ts +6 -0
- package/dist/ui/AnimatedChevron.js +13 -0
- package/dist/ui/JsonInput.d.ts +2 -0
- package/dist/ui/JsonInput.js +45 -0
- package/dist/ui/RouterLink.d.ts +16 -0
- package/dist/ui/RouterLink.js +36 -0
- package/dist/ui/editor/Content.d.ts +3 -0
- package/dist/ui/editor/Content.js +13 -0
- package/dist/ui/editor/Root.d.ts +8 -0
- package/dist/ui/editor/Root.js +55 -0
- package/dist/ui/editor/Toolbar.d.ts +5 -0
- package/dist/ui/editor/Toolbar.js +138 -0
- package/dist/ui/editor/index.d.ts +11 -0
- package/dist/ui/editor/index.js +10 -0
- package/dist/ui/editor/store.d.ts +6 -0
- package/dist/ui/editor/store.js +10 -0
- package/dist/ui/error/DefaultError.d.ts +2 -0
- package/dist/ui/error/DefaultError.js +62 -0
- package/dist/ui/error/DefaultNotFound.d.ts +1 -0
- package/dist/ui/error/DefaultNotFound.js +37 -0
- package/dist/ui/error/Forbidden.d.ts +1 -0
- package/dist/ui/error/Forbidden.js +32 -0
- package/dist/ui/error/defaultErrorNotification.d.ts +1 -0
- package/dist/ui/error/defaultErrorNotification.js +8 -0
- package/dist/ui/error/index.js +5 -0
- package/dist/ui/form/blurOnError.d.ts +4 -0
- package/dist/ui/form/blurOnError.js +11 -0
- package/dist/ui/form/buttons/CancelButton.d.ts +5 -0
- package/dist/ui/form/buttons/CancelButton.js +22 -0
- package/dist/ui/form/buttons/SubmitButton.d.ts +5 -0
- package/dist/ui/form/buttons/SubmitButton.js +22 -0
- package/dist/ui/form/buttons/SubscribeActionIcon.d.ts +4 -0
- package/dist/ui/form/buttons/SubscribeActionIcon.js +15 -0
- package/dist/ui/form/buttons/SubscribeButton.d.ts +5 -0
- package/dist/ui/form/buttons/SubscribeButton.js +16 -0
- package/dist/ui/form/buttons/index.js +4 -0
- package/dist/ui/form/context.d.ts +83 -0
- package/dist/ui/form/context.js +26 -0
- package/dist/ui/form/fields/JsonField.d.ts +2 -0
- package/dist/ui/form/fields/JsonField.js +13 -0
- package/dist/ui/form/fields/MultiSelectField.d.ts +2 -0
- package/dist/ui/form/fields/MultiSelectField.js +15 -0
- package/dist/ui/form/fields/NumberField.d.ts +2 -0
- package/dist/ui/form/fields/NumberField.js +15 -0
- package/dist/ui/form/fields/PassowrdField.d.ts +2 -0
- package/dist/ui/form/fields/PassowrdField.js +18 -0
- package/dist/ui/form/fields/SelectField.d.ts +2 -0
- package/dist/ui/form/fields/SelectField.js +15 -0
- package/dist/ui/form/fields/SwitchField.d.ts +2 -0
- package/dist/ui/form/fields/SwitchField.js +15 -0
- package/dist/ui/form/fields/TextField.d.ts +2 -0
- package/dist/ui/form/fields/TextField.js +15 -0
- package/dist/ui/form/fields/TextPassowrdField.d.ts +2 -0
- package/dist/ui/form/fields/TextPassowrdField.js +29 -0
- package/dist/ui/form/fields/TextareaField.d.ts +2 -0
- package/dist/ui/form/fields/TextareaField.js +15 -0
- package/dist/ui/form/fields/index.js +9 -0
- package/dist/ui/form/fieldsSchema.d.ts +12 -0
- package/dist/ui/form/fieldsSchema.js +13 -0
- package/dist/ui/form/index.js +4 -0
- package/dist/ui/hoverPaper/HoverPaper.d.ts +6 -0
- package/dist/ui/hoverPaper/HoverPaper.js +15 -0
- package/dist/ui/hoverPaper/index.js +3 -0
- package/dist/ui/hoverPaper/usePaperHover.d.ts +4 -0
- package/dist/ui/hoverPaper/usePaperHover.js +9 -0
- package/dist/ui/index.d.ts +9 -0
- package/dist/ui/index.js +9 -0
- package/dist/ui/saveInput/JsonInput.d.ts +6 -0
- package/dist/ui/saveInput/JsonInput.js +34 -0
- package/dist/ui/saveInput/NumberInput.d.ts +6 -0
- package/dist/ui/saveInput/NumberInput.js +27 -0
- package/dist/ui/saveInput/SaveInput.d.ts +36 -0
- package/dist/ui/saveInput/SaveInput.js +15 -0
- package/dist/ui/saveInput/Select.d.ts +6 -0
- package/dist/ui/saveInput/Select.js +27 -0
- package/dist/ui/saveInput/Switch.d.ts +6 -0
- package/dist/ui/saveInput/Switch.js +30 -0
- package/dist/ui/saveInput/TextInput.d.ts +6 -0
- package/dist/ui/saveInput/TextInput.js +26 -0
- package/dist/ui/saveInput/Textarea.d.ts +6 -0
- package/dist/ui/saveInput/Textarea.js +26 -0
- package/dist/ui/saveInput/index.js +2 -0
- package/dist/ui/scrollArea/Root.d.ts +7 -0
- package/dist/ui/scrollArea/Root.js +42 -0
- package/dist/ui/scrollArea/ScrollButton.d.ts +10 -0
- package/dist/ui/scrollArea/ScrollButton.js +30 -0
- package/dist/ui/scrollArea/index.d.ts +6 -0
- package/dist/ui/scrollArea/index.js +7 -0
- 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/package.json +40 -28
- package/rslib.config.ts +0 -21
- package/src/ai/ui/conversation/ConversationContext.ts +0 -21
- package/src/ai/ui/conversation/ConversationProvider.tsx +0 -21
- package/src/ai/ui/conversation/Empty.tsx +0 -15
- package/src/ai/ui/conversation/File.tsx +0 -40
- package/src/ai/ui/conversation/FileIcon.tsx +0 -143
- package/src/ai/ui/conversation/Loader.tsx +0 -8
- package/src/ai/ui/conversation/Message.tsx +0 -34
- package/src/ai/ui/conversation/Root.tsx +0 -24
- package/src/ai/ui/conversation/index.ts +0 -16
- package/src/ai/ui/conversation/types.ts +0 -8
- package/src/ai/ui/conversation/useChatMessage.ts +0 -13
- package/src/ai/ui/promptInput/File.tsx +0 -98
- package/src/ai/ui/promptInput/FileIcon.tsx +0 -149
- package/src/ai/ui/promptInput/Footer.tsx +0 -5
- package/src/ai/ui/promptInput/PromptInputContext.ts +0 -24
- package/src/ai/ui/promptInput/PromptInputProvider.tsx +0 -54
- package/src/ai/ui/promptInput/Root.tsx +0 -29
- package/src/ai/ui/promptInput/Submit.tsx +0 -39
- package/src/ai/ui/promptInput/Textarea.tsx +0 -39
- package/src/ai/ui/promptInput/index.ts +0 -15
- package/src/ai/ui/promptInput/types.ts +0 -9
- package/src/ai/utils/convertFileUIPartBlobToDataURL.ts +0 -29
- package/src/ai/utils/parseAiMessagePart.ts +0 -19
- package/src/app/AppDefaults.tsx +0 -21
- package/src/app/DefaultApp.tsx +0 -50
- package/src/app/cookieColorSchemeManager.ts +0 -70
- package/src/app/defaultRequestMiddlewares.ts +0 -22
- package/src/app/defaultTheme.ts +0 -22
- package/src/functions/getCookie.ts +0 -36
- package/src/functions/setCookie.ts +0 -29
- package/src/functions/setCookies.ts +0 -24
- package/src/hooks/useMutation.ts +0 -14
- package/src/hooks/useMutationWithInvalidate.ts +0 -23
- package/src/index.ts +0 -66
- package/src/surreal/connection.ts +0 -72
- package/src/surreal/deafaultCrud.ts +0 -25
- package/src/surreal/deserialize.ts +0 -144
- package/src/surreal/encryption.ts +0 -51
- package/src/ui/AnimatedChevron.tsx +0 -32
- package/src/ui/JsonInput.tsx +0 -52
- package/src/ui/RouterLink.tsx +0 -78
- package/src/ui/editor/Content.tsx +0 -11
- package/src/ui/editor/Provider.tsx +0 -96
- package/src/ui/editor/Root.tsx +0 -25
- package/src/ui/editor/Toolbar.tsx +0 -92
- package/src/ui/editor/index.ts +0 -13
- package/src/ui/editor/types.ts +0 -7
- package/src/ui/error/DefaultError.tsx +0 -60
- package/src/ui/error/DefaultNotFound.tsx +0 -19
- package/src/ui/error/Forbidden.tsx +0 -18
- package/src/ui/error/defaultErrorNotification.ts +0 -9
- package/src/ui/form/blurOnError.ts +0 -21
- package/src/ui/form/buttons/CancelButton.tsx +0 -42
- package/src/ui/form/buttons/SubmitButton.tsx +0 -43
- package/src/ui/form/buttons/SubscribeActionIcon.tsx +0 -18
- package/src/ui/form/buttons/SubscribeButton.tsx +0 -17
- package/src/ui/form/context.ts +0 -45
- package/src/ui/form/fields/JsonField.tsx +0 -16
- package/src/ui/form/fields/MultiSelectField.tsx +0 -17
- package/src/ui/form/fields/NumberField.tsx +0 -17
- package/src/ui/form/fields/PassowrdField.tsx +0 -20
- package/src/ui/form/fields/SelectField.tsx +0 -17
- package/src/ui/form/fields/SwitchField.tsx +0 -17
- package/src/ui/form/fields/TextField.tsx +0 -17
- package/src/ui/form/fields/TextPassowrdField.tsx +0 -51
- package/src/ui/form/fields/TextareaField.tsx +0 -17
- package/src/ui/form/fieldsSchema.ts +0 -24
- package/src/ui/hoverPaper/HoverPaper.tsx +0 -17
- package/src/ui/hoverPaper/usePaperHover.ts +0 -9
- package/src/ui/saveInput/JsonInput.tsx +0 -40
- package/src/ui/saveInput/NumberInput.tsx +0 -40
- package/src/ui/saveInput/SaveInput.tsx +0 -15
- package/src/ui/saveInput/Select.tsx +0 -41
- package/src/ui/saveInput/Switch.tsx +0 -46
- package/src/ui/saveInput/TextInput.tsx +0 -40
- package/src/ui/saveInput/Textarea.tsx +0 -40
- package/src/ui/scrollArea/ARCH.md +0 -204
- package/src/ui/scrollArea/README.md +0 -369
- package/src/ui/scrollArea/ScrollArea.tsx +0 -93
- package/src/ui/scrollArea/ScrollAreaButton.tsx +0 -56
- package/src/ui/scrollArea/ScrollAreaContent.tsx +0 -36
- package/src/ui/scrollArea/context.tsx +0 -43
- package/src/ui/scrollArea/index.ts +0 -10
- package/src/ui/scrollArea/types.ts +0 -77
- package/src/ui/scrollArea/useScrollArea.ts +0 -227
- package/tsconfig.json +0 -14
- /package/{src/ui/error/index.ts → dist/ui/error/index.d.ts} +0 -0
- /package/{src/ui/form/buttons/index.ts → dist/ui/form/buttons/index.d.ts} +0 -0
- /package/{src/ui/form/fields/index.ts → dist/ui/form/fields/index.d.ts} +0 -0
- /package/{src/ui/form/index.ts → dist/ui/form/index.d.ts} +0 -0
- /package/{src/ui/hoverPaper/index.ts → dist/ui/hoverPaper/index.d.ts} +0 -0
- /package/{src/ui/saveInput/index.ts → dist/ui/saveInput/index.d.ts} +0 -0
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { RecordId } from "surrealdb";
|
|
2
|
+
const extractTableName = (str)=>{
|
|
3
|
+
const match = str.match(/^([^:]+):/);
|
|
4
|
+
return match ? match[1] : null;
|
|
5
|
+
};
|
|
6
|
+
const isRecordIdFormat = (str)=>/^[^:]+:.+$/.test(str);
|
|
7
|
+
function deserialize(dto, idPaths) {
|
|
8
|
+
if (Array.isArray(dto)) return dto.map((item)=>convertStringsToRecordIds(item, idPaths || []));
|
|
9
|
+
return convertStringsToRecordIds(dto, idPaths || []);
|
|
10
|
+
}
|
|
11
|
+
const convertStringsToRecordIds = (obj, idPaths, currentPath = '')=>{
|
|
12
|
+
if (null == obj) return obj;
|
|
13
|
+
if (Array.isArray(obj)) {
|
|
14
|
+
if (idPaths.includes(currentPath)) return obj.map((item)=>{
|
|
15
|
+
if ('string' == typeof item && isRecordIdFormat(item)) {
|
|
16
|
+
const tableName = extractTableName(item);
|
|
17
|
+
if (tableName) return new RecordId(tableName, item.split(':')[1]);
|
|
18
|
+
}
|
|
19
|
+
return item;
|
|
20
|
+
});
|
|
21
|
+
return obj.map((item, index)=>convertStringsToRecordIds(item, idPaths, `${currentPath}[${index}]`));
|
|
22
|
+
}
|
|
23
|
+
if ('object' == typeof obj && !(obj instanceof Date)) {
|
|
24
|
+
const result = {};
|
|
25
|
+
for (const [key, value] of Object.entries(obj)){
|
|
26
|
+
const fieldPath = currentPath ? `${currentPath}.${key}` : key;
|
|
27
|
+
if ('string' == typeof value) {
|
|
28
|
+
const shouldConvert = idPaths.includes(fieldPath) && isRecordIdFormat(value);
|
|
29
|
+
if (shouldConvert) {
|
|
30
|
+
const tableName = extractTableName(value);
|
|
31
|
+
if (tableName) result[key] = new RecordId(tableName, value.split(':')[1]);
|
|
32
|
+
else result[key] = value;
|
|
33
|
+
} else result[key] = value;
|
|
34
|
+
} else result[key] = convertStringsToRecordIds(value, idPaths, fieldPath);
|
|
35
|
+
}
|
|
36
|
+
return result;
|
|
37
|
+
}
|
|
38
|
+
if ('string' == typeof obj) {
|
|
39
|
+
if (0 === idPaths.length && isRecordIdFormat(obj)) {
|
|
40
|
+
const tableName = extractTableName(obj);
|
|
41
|
+
if (tableName) return new RecordId(tableName, obj.split(':')[1]);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
return obj;
|
|
45
|
+
};
|
|
46
|
+
export { deserialize };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { createCipheriv, createDecipheriv, randomBytes } from "node:crypto";
|
|
2
|
+
import { createServerOnlyFn } from "@tanstack/react-start";
|
|
3
|
+
const encryptionFn = createServerOnlyFn((secretHash)=>{
|
|
4
|
+
class Encryption {
|
|
5
|
+
key;
|
|
6
|
+
constructor(secretHash){
|
|
7
|
+
this.key = Buffer.from(secretHash, 'hex');
|
|
8
|
+
}
|
|
9
|
+
encrypt(text) {
|
|
10
|
+
const algorithm = 'aes-256-cbc';
|
|
11
|
+
const iv = randomBytes(16);
|
|
12
|
+
const cipher = createCipheriv(algorithm, this.key, iv);
|
|
13
|
+
let encrypted = cipher.update(text, 'utf8', 'hex');
|
|
14
|
+
encrypted += cipher.final('hex');
|
|
15
|
+
return `${iv.toString('hex')}:${encrypted}`;
|
|
16
|
+
}
|
|
17
|
+
decrypt(encryptedText) {
|
|
18
|
+
const algorithm = 'aes-256-cbc';
|
|
19
|
+
const parts = encryptedText.split(':');
|
|
20
|
+
const iv = Buffer.from(parts[0], 'hex');
|
|
21
|
+
const encrypted = parts[1];
|
|
22
|
+
const decipher = createDecipheriv(algorithm, this.key, iv);
|
|
23
|
+
let decrypted = decipher.update(encrypted, 'hex', 'utf8');
|
|
24
|
+
decrypted += decipher.final('utf8');
|
|
25
|
+
return decrypted;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
return new Encryption(secretHash);
|
|
29
|
+
});
|
|
30
|
+
export { encryptionFn };
|
|
@@ -0,0 +1,13 @@
|
|
|
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,
|
|
6
|
+
style: {
|
|
7
|
+
transition: 'transform 0.2s ease-in-out',
|
|
8
|
+
transform: expanded ? 'rotate(180deg)' : 'rotate(0deg)',
|
|
9
|
+
...style
|
|
10
|
+
},
|
|
11
|
+
...props
|
|
12
|
+
});
|
|
13
|
+
export { AnimatedChevron };
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { indentSelection } from "@codemirror/commands";
|
|
3
|
+
import { json, jsonParseLinter } from "@codemirror/lang-json";
|
|
4
|
+
import { linter } from "@codemirror/lint";
|
|
5
|
+
import { keymap } from "@codemirror/view";
|
|
6
|
+
import { vscodeDark, vscodeLight } from "@uiw/codemirror-theme-vscode";
|
|
7
|
+
import react_codemirror from "@uiw/react-codemirror";
|
|
8
|
+
import { getCookie } from "../tanstackFunctions/index.js";
|
|
9
|
+
const formatJson = (view)=>{
|
|
10
|
+
try {
|
|
11
|
+
const text = view.state.doc.toString();
|
|
12
|
+
const parsed = JSON.parse(text);
|
|
13
|
+
const formatted = JSON.stringify(parsed, null, 2);
|
|
14
|
+
view.dispatch({
|
|
15
|
+
changes: {
|
|
16
|
+
from: 0,
|
|
17
|
+
to: view.state.doc.length,
|
|
18
|
+
insert: formatted
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
return true;
|
|
22
|
+
} catch (_) {
|
|
23
|
+
return indentSelection(view);
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
const extensions = [
|
|
27
|
+
json(),
|
|
28
|
+
linter(jsonParseLinter()),
|
|
29
|
+
keymap.of([
|
|
30
|
+
{
|
|
31
|
+
key: 'Mod-Shift-f',
|
|
32
|
+
run: formatJson
|
|
33
|
+
}
|
|
34
|
+
])
|
|
35
|
+
];
|
|
36
|
+
const JsonInput = (props)=>{
|
|
37
|
+
const colorScheme = getCookie('colorScheme');
|
|
38
|
+
return /*#__PURE__*/ jsx(react_codemirror, {
|
|
39
|
+
height: "280px",
|
|
40
|
+
theme: 'light' === colorScheme ? vscodeLight : vscodeDark,
|
|
41
|
+
extensions: extensions,
|
|
42
|
+
...props
|
|
43
|
+
});
|
|
44
|
+
};
|
|
45
|
+
export { JsonInput };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type ActionIconProps, type AnchorProps, type ButtonProps, type UnstyledButtonProps } from '@mantine/core';
|
|
2
|
+
import { type LinkComponent } from '@tanstack/react-router';
|
|
3
|
+
interface MantineAnchorProps extends Omit<AnchorProps, 'href'> {
|
|
4
|
+
}
|
|
5
|
+
interface MantineButtonProps extends Omit<ButtonProps, 'href'> {
|
|
6
|
+
}
|
|
7
|
+
interface MantineActionIconProps extends Omit<ActionIconProps, 'href'> {
|
|
8
|
+
}
|
|
9
|
+
interface MantineUnstyledButtonProps extends Omit<UnstyledButtonProps, 'href'> {
|
|
10
|
+
}
|
|
11
|
+
export declare const RouterLink: LinkComponent<import("react").ForwardRefExoticComponent<MantineAnchorProps & import("react").RefAttributes<HTMLAnchorElement>>> & {
|
|
12
|
+
Button: LinkComponent<import("react").ForwardRefExoticComponent<MantineButtonProps & import("react").RefAttributes<HTMLButtonElement>>>;
|
|
13
|
+
ActionIcon: LinkComponent<import("react").ForwardRefExoticComponent<MantineActionIconProps & import("react").RefAttributes<HTMLButtonElement>>>;
|
|
14
|
+
UnstyledButton: LinkComponent<import("react").ForwardRefExoticComponent<MantineUnstyledButtonProps & import("react").RefAttributes<HTMLButtonElement>>>;
|
|
15
|
+
};
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { ActionIcon, Anchor, Button, UnstyledButton } from "@mantine/core";
|
|
3
|
+
import { createLink } from "@tanstack/react-router";
|
|
4
|
+
import { forwardRef } from "react";
|
|
5
|
+
const MantineLinkComponent = /*#__PURE__*/ forwardRef(({ classNames, ...props }, ref)=>/*#__PURE__*/ jsx(Anchor, {
|
|
6
|
+
ref: ref,
|
|
7
|
+
classNames: {
|
|
8
|
+
root: 'rolder-router-link-root',
|
|
9
|
+
...classNames
|
|
10
|
+
},
|
|
11
|
+
c: "inherit",
|
|
12
|
+
underline: "never",
|
|
13
|
+
...props
|
|
14
|
+
}));
|
|
15
|
+
const MantineButtonComponent = /*#__PURE__*/ forwardRef((props, ref)=>/*#__PURE__*/ jsx(Button, {
|
|
16
|
+
ref: ref,
|
|
17
|
+
...props
|
|
18
|
+
}));
|
|
19
|
+
const MantineActionIconComponent = /*#__PURE__*/ forwardRef((props, ref)=>/*#__PURE__*/ jsx(ActionIcon, {
|
|
20
|
+
ref: ref,
|
|
21
|
+
...props
|
|
22
|
+
}));
|
|
23
|
+
const MantineUnstyledButtonComponent = /*#__PURE__*/ forwardRef((props, ref)=>/*#__PURE__*/ jsx(UnstyledButton, {
|
|
24
|
+
ref: ref,
|
|
25
|
+
...props
|
|
26
|
+
}));
|
|
27
|
+
const RouterLinkBase = createLink(MantineLinkComponent);
|
|
28
|
+
const RouterLinkButton = createLink(MantineButtonComponent);
|
|
29
|
+
const RouterLinkActionIcon = createLink(MantineActionIconComponent);
|
|
30
|
+
const RouterLinkUnstyledButton = createLink(MantineUnstyledButtonComponent);
|
|
31
|
+
const RouterLink = Object.assign(RouterLinkBase, {
|
|
32
|
+
Button: RouterLinkButton,
|
|
33
|
+
ActionIcon: RouterLinkActionIcon,
|
|
34
|
+
UnstyledButton: RouterLinkUnstyledButton
|
|
35
|
+
});
|
|
36
|
+
export { RouterLink };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { RichTextEditor } from "@mantine/tiptap";
|
|
3
|
+
import { ScrollArea } from "../scrollArea/index.js";
|
|
4
|
+
const Content = ({ height })=>/*#__PURE__*/ jsxs(ScrollArea.Root, {
|
|
5
|
+
height: height,
|
|
6
|
+
autoScroll: true,
|
|
7
|
+
radius: "md",
|
|
8
|
+
children: [
|
|
9
|
+
/*#__PURE__*/ jsx(RichTextEditor.Content, {}),
|
|
10
|
+
/*#__PURE__*/ jsx(ScrollArea.ScrollButton, {})
|
|
11
|
+
]
|
|
12
|
+
});
|
|
13
|
+
export { Content };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type RichTextEditorProps } from '@mantine/tiptap';
|
|
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: ({ children, classNames, content, editable, disabledToolbar, onUpdate, editor: customEditor, ...props }: EditorProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
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 { useEffect } from "react";
|
|
12
|
+
import { setDisabledToolbar } from "./store.js";
|
|
13
|
+
const Root = ({ children, classNames, content, editable = true, disabledToolbar, onUpdate, editor: customEditor, ...props })=>{
|
|
14
|
+
useEffect(()=>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
|
+
});
|
|
43
|
+
return /*#__PURE__*/ jsx(RichTextEditor, {
|
|
44
|
+
editor: customEditor || editor,
|
|
45
|
+
classNames: {
|
|
46
|
+
root: 'rolder-editor-root',
|
|
47
|
+
content: 'rolder-editor-content',
|
|
48
|
+
toolbar: 'rolder-editor-toolbar',
|
|
49
|
+
...classNames
|
|
50
|
+
},
|
|
51
|
+
...props,
|
|
52
|
+
children: children
|
|
53
|
+
});
|
|
54
|
+
};
|
|
55
|
+
export { Root };
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Loader } from "@mantine/core";
|
|
3
|
+
import { RichTextEditor } from "@mantine/tiptap";
|
|
4
|
+
import { IconCheck } from "@tabler/icons-react";
|
|
5
|
+
import { getDisabledToolbar, useEditor } from "./store.js";
|
|
6
|
+
const Toolbar = ({ saving, children })=>{
|
|
7
|
+
const editor = useEditor();
|
|
8
|
+
return getDisabledToolbar() ? null : /*#__PURE__*/ jsxs(RichTextEditor.Toolbar, {
|
|
9
|
+
sticky: true,
|
|
10
|
+
children: [
|
|
11
|
+
/*#__PURE__*/ jsxs(RichTextEditor.ControlsGroup, {
|
|
12
|
+
children: [
|
|
13
|
+
/*#__PURE__*/ jsx(RichTextEditor.Bold, {
|
|
14
|
+
disabled: !editor?.isEditable
|
|
15
|
+
}),
|
|
16
|
+
/*#__PURE__*/ jsx(RichTextEditor.Italic, {
|
|
17
|
+
disabled: !editor?.isEditable
|
|
18
|
+
}),
|
|
19
|
+
/*#__PURE__*/ jsx(RichTextEditor.Underline, {
|
|
20
|
+
disabled: !editor?.isEditable
|
|
21
|
+
}),
|
|
22
|
+
/*#__PURE__*/ jsx(RichTextEditor.Strikethrough, {
|
|
23
|
+
disabled: !editor?.isEditable
|
|
24
|
+
}),
|
|
25
|
+
/*#__PURE__*/ jsx(RichTextEditor.ClearFormatting, {
|
|
26
|
+
disabled: !editor?.isEditable
|
|
27
|
+
}),
|
|
28
|
+
/*#__PURE__*/ jsx(RichTextEditor.Highlight, {
|
|
29
|
+
disabled: !editor?.isEditable
|
|
30
|
+
}),
|
|
31
|
+
/*#__PURE__*/ jsx(RichTextEditor.Code, {
|
|
32
|
+
disabled: !editor?.isEditable
|
|
33
|
+
})
|
|
34
|
+
]
|
|
35
|
+
}),
|
|
36
|
+
/*#__PURE__*/ jsxs(RichTextEditor.ControlsGroup, {
|
|
37
|
+
children: [
|
|
38
|
+
/*#__PURE__*/ jsx(RichTextEditor.H1, {
|
|
39
|
+
disabled: !editor?.isEditable
|
|
40
|
+
}),
|
|
41
|
+
/*#__PURE__*/ jsx(RichTextEditor.H2, {
|
|
42
|
+
disabled: !editor?.isEditable
|
|
43
|
+
}),
|
|
44
|
+
/*#__PURE__*/ jsx(RichTextEditor.H3, {
|
|
45
|
+
disabled: !editor?.isEditable
|
|
46
|
+
}),
|
|
47
|
+
/*#__PURE__*/ jsx(RichTextEditor.H4, {
|
|
48
|
+
disabled: !editor?.isEditable
|
|
49
|
+
})
|
|
50
|
+
]
|
|
51
|
+
}),
|
|
52
|
+
/*#__PURE__*/ jsxs(RichTextEditor.ControlsGroup, {
|
|
53
|
+
children: [
|
|
54
|
+
/*#__PURE__*/ jsx(RichTextEditor.Blockquote, {
|
|
55
|
+
disabled: !editor?.isEditable
|
|
56
|
+
}),
|
|
57
|
+
/*#__PURE__*/ jsx(RichTextEditor.Hr, {
|
|
58
|
+
disabled: !editor?.isEditable
|
|
59
|
+
}),
|
|
60
|
+
/*#__PURE__*/ jsx(RichTextEditor.BulletList, {
|
|
61
|
+
disabled: !editor?.isEditable
|
|
62
|
+
}),
|
|
63
|
+
/*#__PURE__*/ jsx(RichTextEditor.OrderedList, {
|
|
64
|
+
disabled: !editor?.isEditable
|
|
65
|
+
})
|
|
66
|
+
]
|
|
67
|
+
}),
|
|
68
|
+
/*#__PURE__*/ jsxs(RichTextEditor.ControlsGroup, {
|
|
69
|
+
children: [
|
|
70
|
+
/*#__PURE__*/ jsx(RichTextEditor.TaskList, {
|
|
71
|
+
disabled: !editor?.isEditable
|
|
72
|
+
}),
|
|
73
|
+
/*#__PURE__*/ jsx(RichTextEditor.TaskListLift, {
|
|
74
|
+
disabled: !editor?.isEditable
|
|
75
|
+
}),
|
|
76
|
+
/*#__PURE__*/ jsx(RichTextEditor.TaskListSink, {
|
|
77
|
+
disabled: !editor?.isEditable
|
|
78
|
+
})
|
|
79
|
+
]
|
|
80
|
+
}),
|
|
81
|
+
/*#__PURE__*/ jsxs(RichTextEditor.ControlsGroup, {
|
|
82
|
+
children: [
|
|
83
|
+
/*#__PURE__*/ jsx(RichTextEditor.Link, {
|
|
84
|
+
disabled: !editor?.isEditable
|
|
85
|
+
}),
|
|
86
|
+
/*#__PURE__*/ jsx(RichTextEditor.Unlink, {
|
|
87
|
+
disabled: !editor?.isEditable
|
|
88
|
+
})
|
|
89
|
+
]
|
|
90
|
+
}),
|
|
91
|
+
/*#__PURE__*/ jsxs(RichTextEditor.ControlsGroup, {
|
|
92
|
+
children: [
|
|
93
|
+
/*#__PURE__*/ jsx(RichTextEditor.AlignLeft, {
|
|
94
|
+
disabled: !editor?.isEditable
|
|
95
|
+
}),
|
|
96
|
+
/*#__PURE__*/ jsx(RichTextEditor.AlignCenter, {
|
|
97
|
+
disabled: !editor?.isEditable
|
|
98
|
+
}),
|
|
99
|
+
/*#__PURE__*/ jsx(RichTextEditor.AlignJustify, {
|
|
100
|
+
disabled: !editor?.isEditable
|
|
101
|
+
}),
|
|
102
|
+
/*#__PURE__*/ jsx(RichTextEditor.AlignRight, {
|
|
103
|
+
disabled: !editor?.isEditable
|
|
104
|
+
})
|
|
105
|
+
]
|
|
106
|
+
}),
|
|
107
|
+
/*#__PURE__*/ jsxs(RichTextEditor.ControlsGroup, {
|
|
108
|
+
children: [
|
|
109
|
+
/*#__PURE__*/ jsx(RichTextEditor.Undo, {
|
|
110
|
+
disabled: !editor?.isEditable
|
|
111
|
+
}),
|
|
112
|
+
/*#__PURE__*/ jsx(RichTextEditor.Redo, {
|
|
113
|
+
disabled: !editor?.isEditable
|
|
114
|
+
})
|
|
115
|
+
]
|
|
116
|
+
}),
|
|
117
|
+
/*#__PURE__*/ jsxs(RichTextEditor.ControlsGroup, {
|
|
118
|
+
ml: "auto",
|
|
119
|
+
children: [
|
|
120
|
+
children,
|
|
121
|
+
/*#__PURE__*/ jsx(RichTextEditor.Control, {
|
|
122
|
+
ml: "10px",
|
|
123
|
+
style: {
|
|
124
|
+
cursor: 'default'
|
|
125
|
+
},
|
|
126
|
+
children: saving ? /*#__PURE__*/ jsx(Loader, {
|
|
127
|
+
size: 14
|
|
128
|
+
}) : /*#__PURE__*/ jsx(IconCheck, {
|
|
129
|
+
stroke: 1.5,
|
|
130
|
+
size: 16
|
|
131
|
+
})
|
|
132
|
+
})
|
|
133
|
+
]
|
|
134
|
+
})
|
|
135
|
+
]
|
|
136
|
+
});
|
|
137
|
+
};
|
|
138
|
+
export { Toolbar };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const Editor: {
|
|
2
|
+
Root: ({ children, classNames, content, editable, disabledToolbar, onUpdate, editor: customEditor, ...props }: import("./Root").EditorProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
Content: ({ height }: {
|
|
4
|
+
height: string;
|
|
5
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
Toolbar: ({ saving, children, }: {
|
|
7
|
+
saving?: boolean;
|
|
8
|
+
children?: import("react").ReactNode;
|
|
9
|
+
}) => import("react/jsx-runtime").JSX.Element | null;
|
|
10
|
+
};
|
|
11
|
+
export * from './store';
|
|
@@ -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 };
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Button, Group, Stack, Title } from "@mantine/core";
|
|
3
|
+
import { rootRouteId, useMatch, useRouter } from "@tanstack/react-router";
|
|
4
|
+
import { RouterLink } from "../RouterLink.js";
|
|
5
|
+
const DefaultError = ({ error })=>{
|
|
6
|
+
const router = useRouter();
|
|
7
|
+
const isRoot = useMatch({
|
|
8
|
+
strict: false,
|
|
9
|
+
select: (state)=>state.id === rootRouteId
|
|
10
|
+
});
|
|
11
|
+
return /*#__PURE__*/ jsxs(Stack, {
|
|
12
|
+
align: "center",
|
|
13
|
+
justify: "center",
|
|
14
|
+
gap: 0,
|
|
15
|
+
ta: "center",
|
|
16
|
+
h: "100vh",
|
|
17
|
+
children: [
|
|
18
|
+
/*#__PURE__*/ jsx(Title, {
|
|
19
|
+
textWrap: "balance",
|
|
20
|
+
size: 65,
|
|
21
|
+
children: "Произошла ошибка!"
|
|
22
|
+
}),
|
|
23
|
+
error.message && /*#__PURE__*/ jsx(Title, {
|
|
24
|
+
order: 3,
|
|
25
|
+
ml: 4,
|
|
26
|
+
textWrap: "balance",
|
|
27
|
+
c: "var(--mantine-color-error)",
|
|
28
|
+
children: error.message
|
|
29
|
+
}),
|
|
30
|
+
/*#__PURE__*/ jsxs(Group, {
|
|
31
|
+
children: [
|
|
32
|
+
/*#__PURE__*/ jsx(Button, {
|
|
33
|
+
mt: "xl",
|
|
34
|
+
size: "lg",
|
|
35
|
+
variant: "light",
|
|
36
|
+
onClick: ()=>{
|
|
37
|
+
router.invalidate();
|
|
38
|
+
},
|
|
39
|
+
children: "Попробовать еще раз"
|
|
40
|
+
}),
|
|
41
|
+
isRoot ? /*#__PURE__*/ jsx(RouterLink.Button, {
|
|
42
|
+
to: "/",
|
|
43
|
+
mt: "xl",
|
|
44
|
+
size: "lg",
|
|
45
|
+
radius: "md",
|
|
46
|
+
children: "На главную"
|
|
47
|
+
}) : /*#__PURE__*/ jsx(Button, {
|
|
48
|
+
mt: "xl",
|
|
49
|
+
radius: "md",
|
|
50
|
+
size: "lg",
|
|
51
|
+
onClick: (e)=>{
|
|
52
|
+
e.preventDefault();
|
|
53
|
+
router.history.back();
|
|
54
|
+
},
|
|
55
|
+
children: "Назад"
|
|
56
|
+
})
|
|
57
|
+
]
|
|
58
|
+
})
|
|
59
|
+
]
|
|
60
|
+
});
|
|
61
|
+
};
|
|
62
|
+
export { DefaultError };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const DefaultNotFound: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Stack, Text, Title } from "@mantine/core";
|
|
3
|
+
import { RouterLink } from "../RouterLink.js";
|
|
4
|
+
const DefaultNotFound = ()=>/*#__PURE__*/ jsxs(Stack, {
|
|
5
|
+
align: "center",
|
|
6
|
+
justify: "center",
|
|
7
|
+
gap: 0,
|
|
8
|
+
ta: "center",
|
|
9
|
+
h: "100vh",
|
|
10
|
+
children: [
|
|
11
|
+
/*#__PURE__*/ jsx(Text, {
|
|
12
|
+
c: "dimmed",
|
|
13
|
+
fw: "bold",
|
|
14
|
+
children: "404"
|
|
15
|
+
}),
|
|
16
|
+
/*#__PURE__*/ jsx(Title, {
|
|
17
|
+
textWrap: "balance",
|
|
18
|
+
size: 65,
|
|
19
|
+
children: "Страница не найдена"
|
|
20
|
+
}),
|
|
21
|
+
/*#__PURE__*/ jsx(Title, {
|
|
22
|
+
order: 3,
|
|
23
|
+
ml: 4,
|
|
24
|
+
textWrap: "balance",
|
|
25
|
+
c: "dimmed",
|
|
26
|
+
children: "Извините, но здесь нет страницы. Возможно она перемещена."
|
|
27
|
+
}),
|
|
28
|
+
/*#__PURE__*/ jsx(RouterLink.Button, {
|
|
29
|
+
to: "/",
|
|
30
|
+
mt: "xl",
|
|
31
|
+
size: "lg",
|
|
32
|
+
radius: "md",
|
|
33
|
+
children: "На главную"
|
|
34
|
+
})
|
|
35
|
+
]
|
|
36
|
+
});
|
|
37
|
+
export { DefaultNotFound };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const Forbidden: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Stack, Title } from "@mantine/core";
|
|
3
|
+
import { RouterLink } from "../RouterLink.js";
|
|
4
|
+
const Forbidden = ()=>/*#__PURE__*/ jsxs(Stack, {
|
|
5
|
+
align: "center",
|
|
6
|
+
justify: "center",
|
|
7
|
+
gap: 0,
|
|
8
|
+
ta: "center",
|
|
9
|
+
h: "100vh",
|
|
10
|
+
children: [
|
|
11
|
+
/*#__PURE__*/ jsx(Title, {
|
|
12
|
+
textWrap: "balance",
|
|
13
|
+
size: 65,
|
|
14
|
+
children: "Доступ запрещен!"
|
|
15
|
+
}),
|
|
16
|
+
/*#__PURE__*/ jsx(Title, {
|
|
17
|
+
order: 3,
|
|
18
|
+
ml: 4,
|
|
19
|
+
textWrap: "balance",
|
|
20
|
+
c: "var(--mantine-color-error)",
|
|
21
|
+
children: "У вас нет доступа к этой странице"
|
|
22
|
+
}),
|
|
23
|
+
/*#__PURE__*/ jsx(RouterLink.Button, {
|
|
24
|
+
to: "/",
|
|
25
|
+
mt: "xl",
|
|
26
|
+
size: "lg",
|
|
27
|
+
radius: "md",
|
|
28
|
+
children: "На главную"
|
|
29
|
+
})
|
|
30
|
+
]
|
|
31
|
+
});
|
|
32
|
+
export { Forbidden };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const defaultErrorNotification: (error: Error) => string;
|