@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,46 +0,0 @@
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 };
@@ -1,6 +0,0 @@
1
- type EncryptionInstance = {
2
- encrypt(text: string): string;
3
- decrypt(encryptedText: string): string;
4
- };
5
- export declare const encryptionFn: (secretHash: string) => EncryptionInstance;
6
- export {};
@@ -1,30 +0,0 @@
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 };
@@ -1,4 +0,0 @@
1
- export { getDB } from './connection';
2
- export * from './deafaultCrud';
3
- export { deserialize } from './deserialize';
4
- export { encryptionFn } from './encryption';
@@ -1,5 +0,0 @@
1
- import { getDB } from "./connection.js";
2
- import { deserialize } from "./deserialize.js";
3
- import { encryptionFn } from "./encryption.js";
4
- export * from "./deafaultCrud.js";
5
- export { deserialize, encryptionFn, getDB };
@@ -1,7 +0,0 @@
1
- import "./styles_module.css";
2
- const styles_module = {
3
- root: "root-OYYJgs",
4
- content: "content-b5nnhz",
5
- toolbar: "toolbar-RksEGD"
6
- };
7
- export { styles_module as default };
@@ -1,16 +0,0 @@
1
- .root-OYYJgs {
2
- --editor-border-color: light-dark(var(--mantine-color-gray-3), var(--mantine-color-dark-4));
3
- border: rem(1px) solid var(--editor-border-color);
4
- border-radius: var(--mantine-radius-md);
5
- }
6
-
7
- .content-b5nnhz {
8
- border-radius: var(--mantine-radius-md);
9
- }
10
-
11
- .toolbar-RksEGD {
12
- border-color: var(--editor-border-color);
13
- border-top-left-radius: var(--mantine-radius-md);
14
- border-top-right-radius: var(--mantine-radius-md);
15
- }
16
-