@rolder/kit 3.0.0-alpha.2 → 3.0.0-alpha.21
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 +1 -0
- package/dist/ai/index.js +1 -0
- package/dist/ai/ui/conversation/FileIcon.js +26 -208
- package/dist/ai/ui/conversation/index.d.ts +2 -2
- package/dist/ai/ui/conversation/index.js +3 -2
- package/dist/ai/ui/index.d.ts +2 -0
- package/dist/ai/ui/index.js +2 -0
- package/dist/ai/ui/promptInput/File.js +7 -56
- package/dist/ai/ui/promptInput/FileIcon.js +26 -208
- package/dist/ai/ui/promptInput/Submit.js +4 -23
- package/dist/ai/ui/promptInput/index.d.ts +1 -1
- package/dist/ai/ui/promptInput/index.js +1 -0
- package/dist/app/index.d.ts +1 -0
- package/dist/app/index.js +1 -0
- package/dist/functions/index.d.ts +3 -1
- package/dist/functions/index.js +4 -1
- package/dist/index.d.ts +1 -3
- package/dist/index.js +1 -4
- package/dist/ui/AnimatedChevron.d.ts +2 -2
- package/dist/ui/AnimatedChevron.js +7 -25
- package/dist/ui/editor/Toolbar.js +4 -22
- package/dist/ui/error/index.d.ts +4 -4
- package/dist/ui/error/index.js +5 -4
- package/dist/ui/form/buttons/CancelButton.js +4 -26
- package/dist/ui/form/buttons/SubmitButton.js +4 -29
- package/dist/ui/form/fields/TextPassowrdField.js +4 -26
- package/dist/ui/form/index.d.ts +2 -2
- package/dist/ui/form/index.js +3 -3
- package/dist/ui/hoverPaper/index.d.ts +2 -2
- package/dist/ui/hoverPaper/index.js +3 -2
- package/dist/ui/scrollArea/ScrollArea.d.ts +1 -1
- package/dist/ui/scrollArea/ScrollAreaButton.d.ts +1 -1
- package/dist/ui/scrollArea/ScrollAreaButton.js +7 -28
- package/package.json +38 -34
- package/dist/functions/cookies/index.d.ts +0 -3
- package/dist/functions/cookies/index.js +0 -3
- package/dist/surreal/connection.d.ts +0 -9
- package/dist/surreal/connection.js +0 -49
- package/dist/surreal/deafaultCrud.d.ts +0 -2
- package/dist/surreal/deafaultCrud.js +0 -18
- package/dist/surreal/deserialize.d.ts +0 -17
- package/dist/surreal/deserialize.js +0 -46
- package/dist/surreal/encryption.d.ts +0 -6
- package/dist/surreal/encryption.js +0 -30
- package/dist/surreal/index.d.ts +0 -4
- package/dist/surreal/index.js +0 -5
- package/dist/ui/editor/styles.module.js +0 -7
- package/dist/ui/editor/styles_module.css +0 -16
- /package/dist/functions/{cookies/getCookie.d.ts → getCookie.d.ts} +0 -0
- /package/dist/functions/{cookies/getCookie.js → getCookie.js} +0 -0
- /package/dist/functions/{cookies/setCookie.d.ts → setCookie.d.ts} +0 -0
- /package/dist/functions/{cookies/setCookie.js → setCookie.js} +0 -0
- /package/dist/functions/{cookies/setCookies.d.ts → setCookies.d.ts} +0 -0
- /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,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 };
|
package/dist/surreal/index.d.ts
DELETED
package/dist/surreal/index.js
DELETED
|
@@ -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
|
-
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|