@vitnode/core 1.2.0-canary.59 → 1.2.0-canary.60
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/src/api/middlewares/global.middleware.d.ts.map +1 -1
- package/dist/src/api/middlewares/global.middleware.js +5 -16
- package/dist/src/api/models/email.d.ts.map +1 -1
- package/dist/src/api/models/email.js +3 -4
- package/dist/src/api/models/session-admin.d.ts.map +1 -1
- package/dist/src/api/models/session-admin.js +12 -3
- package/dist/src/api/models/session.d.ts.map +1 -1
- package/dist/src/api/models/session.js +12 -3
- package/dist/src/api/modules/cron/helpers/process-cron-jobs.d.ts.map +1 -1
- package/dist/src/api/modules/cron/helpers/process-cron-jobs.js +10 -6
- package/dist/src/api/modules/cron/routes/cron.route.d.ts.map +1 -1
- package/dist/src/api/modules/cron/routes/cron.route.js +7 -1
- package/dist/src/components/form/auto-form.js +1 -1
- package/dist/src/components/form/fields/checkbox.js +1 -1
- package/dist/src/components/form/fields/radio-group.js +1 -1
- package/dist/src/components/switchers/themes/theme-switcher.js +2 -2
- package/dist/src/components/table/content.js +1 -1
- package/dist/src/components/ui/accordion.js +2 -2
- package/dist/src/components/ui/alert-dialog.js +1 -1
- package/dist/src/components/ui/card.js +3 -3
- package/dist/src/components/ui/checkbox.js +1 -1
- package/dist/src/components/ui/command.js +4 -4
- package/dist/src/components/ui/context-menu.js +6 -6
- package/dist/src/components/ui/dialog.js +3 -3
- package/dist/src/components/ui/dropdown-menu.js +6 -6
- package/dist/src/components/ui/editor.js +1 -1
- package/dist/src/components/ui/hover-card.js +1 -1
- package/dist/src/components/ui/input-otp.js +2 -2
- package/dist/src/components/ui/input.js +1 -1
- package/dist/src/components/ui/label.js +1 -1
- package/dist/src/components/ui/menubar.js +8 -8
- package/dist/src/components/ui/navigation-menu.js +3 -3
- package/dist/src/components/ui/popover.js +1 -1
- package/dist/src/components/ui/radio-group.js +2 -2
- package/dist/src/components/ui/scroll-area.js +2 -2
- package/dist/src/components/ui/select.js +3 -3
- package/dist/src/components/ui/separator.js +1 -1
- package/dist/src/components/ui/sheet.js +1 -1
- package/dist/src/components/ui/sidebar.js +11 -11
- package/dist/src/components/ui/slider.js +3 -3
- package/dist/src/components/ui/switch.js +1 -1
- package/dist/src/components/ui/table.js +1 -1
- package/dist/src/components/ui/tabs.js +1 -1
- package/dist/src/components/ui/textarea.js +1 -1
- package/dist/src/components/ui/toggle-group.js +1 -1
- package/dist/src/components/ui/tooltip.js +1 -1
- package/dist/src/emails/reset-password.js +1 -1
- package/dist/src/emails/ui/card.js +1 -1
- package/dist/src/lib/navigation.d.ts +15 -13
- package/dist/src/lib/navigation.d.ts.map +1 -1
- package/dist/src/views/auth/sign-in/form/use-form.d.ts.map +1 -1
- package/dist/src/views/auth/sign-in/form/use-form.js +1 -1
- package/dist/src/views/auth/sign-in/sign-in-view.js +1 -1
- package/dist/src/views/auth/sign-up/sign-up-view.js +1 -1
- package/dist/src/vitnode.config.d.ts.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +39 -39
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"global.middleware.d.ts","sourceRoot":"","sources":["../../../../src/api/middlewares/global.middleware.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAI/C,OAAO,KAAK,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAExE,OAAO,EAAc,KAAK,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAKzE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAElD,OAAO,EAEL,KAAK,oBAAoB,EAC1B,MAAM,0BAA0B,CAAC;AAElC,OAAO,QAAQ,MAAM,CAAC;IAEpB,UAAU,kBAAmB,SAAQ,mBAAmB;KAAG;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K,OAAO,CAAC;YAAE,OAAO,EAAE,MAAM,CAAA;SAAE,CAAC,CAAC;QAC/D,OAAO,EAAE;YAAE,EAAE,EAAE,MAAM,CAAA;SAAE,EAAE,CAAC;KAC3B,CAAC;IACF,EAAE,EAAE,IAAI,CAAC,gBAAgB,EAAE,YAAY,CAAC,CAAC,YAAY,CAAC,CAAC;IACvD,KAAK,EAAE;QACL,IAAI,EAAE,CAAC,IAAI,EAAE,kBAAkB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;KACnD,CAAC;IACF,SAAS,EAAE,MAAM,CAAC;IAClB,GAAG,EAAE,oBAAoB,CAAC;IAC1B,MAAM,EAAE;QACN,EAAE,EAAE,MAAM,CAAC;KACZ,CAAC;IACF,IAAI,EAAE,IAAI,GAAG;QACX,WAAW,EAAE,MAAM,CAAC;QACpB,QAAQ,EAAE,IAAI,GAAG,IAAI,CAAC;QACtB,SAAS,EAAE,IAAI,CAAC;QAChB,KAAK,EAAE,MAAM,CAAC;QACd,aAAa,EAAE,OAAO,CAAC;QACvB,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,EAAE,MAAM,CAAC;QACb,QAAQ,EAAE,MAAM,CAAC;QACjB,UAAU,EAAE,OAAO,CAAC;QACpB,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;CACH;AAED,eAAO,MAAM,gBAAgB,GAAI,mFAQ9B,IAAI,CACL,gBAAgB,EACd,eAAe,GACf,SAAS,GACT,YAAY,GACZ,OAAO,GACP,gBAAgB,GAChB,SAAS,CACZ,GACC,IAAI,CAAC,aAAa,EAAE,UAAU,CAAC,MAmCjB,GAAG,OAAO,EAAE,MAAM,IAAI,
|
|
1
|
+
{"version":3,"file":"global.middleware.d.ts","sourceRoot":"","sources":["../../../../src/api/middlewares/global.middleware.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAI/C,OAAO,KAAK,EAAE,gBAAgB,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,GACT,YAAY,GACZ,OAAO,GACP,gBAAgB,GAChB,SAAS,CACZ,GACC,IAAI,CAAC,aAAa,EAAE,UAAU,CAAC,MAmCjB,GAAG,OAAO,EAAE,MAAM,IAAI,kBA+CrC,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAAI,UAAU,MAAM,MACjC,GAAG,OAAO,EAAE,MAAM,IAAI,kBAMrC,CAAC;AAEF,eAAO,MAAM,qBAAqB,SAClB,GAAG,OAAO,EAAE,MAAM,IAAI,kBASrC,CAAC"}
|
|
@@ -36,23 +36,12 @@ export const globalMiddleware = ({ authorization, metadata, email, dbProvider, c
|
|
|
36
36
|
];
|
|
37
37
|
return async (c, next)=>{
|
|
38
38
|
let ipAddress;
|
|
39
|
-
// Try
|
|
39
|
+
// Optimize: Try both header methods in a single loop
|
|
40
40
|
for (const key of ipHeaderKeys){
|
|
41
|
-
|
|
42
|
-
if (
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
// If not found, try raw headers (for edge runtimes, etc.)
|
|
48
|
-
if (!ipAddress) {
|
|
49
|
-
for (const key of ipHeaderKeys){
|
|
50
|
-
const value = c.req.raw.headers.get(key);
|
|
51
|
-
if (value) {
|
|
52
|
-
ipAddress = value;
|
|
53
|
-
break;
|
|
54
|
-
}
|
|
55
|
-
}
|
|
41
|
+
ipAddress = c.req.header(key);
|
|
42
|
+
if (ipAddress) break;
|
|
43
|
+
ipAddress = c.req.raw.headers.get(key) ?? undefined;
|
|
44
|
+
if (ipAddress) break;
|
|
56
45
|
}
|
|
57
46
|
// Fallback to localhost if nothing found
|
|
58
47
|
c.set("ipAddress", ipAddress ?? "127.0.0.1");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"email.d.ts","sourceRoot":"","sources":["../../../../src/api/models/email.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,kBAAkB,EAAE,MAAM,MAAM,CAAC;AACxD,OAAO,KAA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K,OAAO,CAAC,IAAI,CAAC,CAAC;CACrB;AAED,MAAM,MAAM,kBAAkB,GAAG;IAC/B,OAAO,EAAE,CACP,KAAK,EAAE,IAAI,CAAC,yBAAyB,EAAE,UAAU,CAAC,GAChD,IAAI,CAAC,kBAAkB,EAAE,MAAM,CAAC,KAC/B,KAAK,CAAC,SAAS,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,EACH,CAAC,CAAC,KAAK,EAAE,IAAI,CAAC,yBAAyB,EAAE,MAAM,CAAC,KAAK,MAAM,CAAC,GAC5D,MAAM,CAAC;CAEZ,GAAG,CAAC,2BAA2B,GAAG,0BAA0B,CAAC,CAAC;AAE/D,qBAAa,UAAU;gBACT,CAAC,EAAE,OAAO;IAItB,SAAS,CAAC,QAAQ,CAAC,CAAC,EAAE,OAAO,CAAC;IAExB,IAAI,CAAC,EACT,IAAI,EACJ,OAAO,EACP,OAAO,EACP,EAAE,EACF,IAAI,EACJ,OAAO,EACP,MAAM,EAAE,cAAc,GACvB,EAAE,kBAAkB;CAkFtB"}
|
|
@@ -29,10 +29,9 @@ export class EmailModel {
|
|
|
29
29
|
}
|
|
30
30
|
});
|
|
31
31
|
const allMessages = await Promise.all(messagesPromises);
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
}), {});
|
|
32
|
+
// Optimize: Use Object.assign instead of reduce with spread operator
|
|
33
|
+
// to avoid creating intermediate objects on each iteration
|
|
34
|
+
const messages = Object.assign({}, ...allMessages);
|
|
36
35
|
const htmlContent = html ?? content({
|
|
37
36
|
i18n: {
|
|
38
37
|
locale,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session-admin.d.ts","sourceRoot":"","sources":["../../../../src/api/models/session-admin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAYpC,qBAAa,iBAAiB;gBAChB,CAAC,EAAE,OAAO;IAGtB,SAAS,CAAC,QAAQ,CAAC,CAAC,EAAE,OAAO,CAAC;YAEhB,SAAS;
|
|
1
|
+
{"version":3,"file":"session-admin.d.ts","sourceRoot":"","sources":["../../../../src/api/models/session-admin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAYpC,qBAAa,iBAAiB;gBAChB,CAAC,EAAE,OAAO;IAGtB,SAAS,CAAC,QAAQ,CAAC,CAAC,EAAE,OAAO,CAAC;YAEhB,SAAS;IAejB,kBAAkB,CAAC,MAAM,EAAE,MAAM;IAmBjC,qBAAqB,CAAC,MAAM,EAAE,MAAM;;;IA2CpC,aAAa;IAoBb,OAAO;;;;;;;;;;;;;CAiDd"}
|
|
@@ -14,8 +14,13 @@ export class SessionAdminModel {
|
|
|
14
14
|
const encoder = new TextEncoder();
|
|
15
15
|
const data = encoder.encode(token);
|
|
16
16
|
const hashBuffer = await crypto.subtle.digest("SHA-256", data);
|
|
17
|
-
const
|
|
18
|
-
|
|
17
|
+
const bytes = new Uint8Array(hashBuffer);
|
|
18
|
+
// Optimize: Use direct iteration instead of Array.from + map
|
|
19
|
+
let result = "";
|
|
20
|
+
for (const byte of bytes){
|
|
21
|
+
result += byte.toString(16).padStart(2, "0");
|
|
22
|
+
}
|
|
23
|
+
return result;
|
|
19
24
|
}
|
|
20
25
|
async checkIfUserIsAdmin(userId) {
|
|
21
26
|
const user = await new UserModel().getUserById({
|
|
@@ -35,7 +40,11 @@ export class SessionAdminModel {
|
|
|
35
40
|
}
|
|
36
41
|
const randomBytes = new Uint8Array(64);
|
|
37
42
|
crypto.getRandomValues(randomBytes);
|
|
38
|
-
|
|
43
|
+
// Optimize: Use direct iteration instead of Array.from + map
|
|
44
|
+
let token = "";
|
|
45
|
+
for (const byte of randomBytes){
|
|
46
|
+
token += byte.toString(16).padStart(2, "0");
|
|
47
|
+
}
|
|
39
48
|
const hashedToken = await this.hashToken(token);
|
|
40
49
|
const device = await new DeviceModel(this.c).getDeviceId();
|
|
41
50
|
await this.c.get("db").insert(core_admin_sessions).values({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../../../src/api/models/session.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAWpC,qBAAa,YAAY;gBACX,CAAC,EAAE,OAAO;IAGtB,SAAS,CAAC,QAAQ,CAAC,CAAC,EAAE,OAAO,CAAC;YAEhB,SAAS;
|
|
1
|
+
{"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../../../src/api/models/session.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAWpC,qBAAa,YAAY;gBACX,CAAC,EAAE,OAAO;IAGtB,SAAS,CAAC,QAAQ,CAAC,CAAC,EAAE,OAAO,CAAC;YAEhB,SAAS;IAejB,qBAAqB,CAAC,MAAM,EAAE,MAAM;;;IA0CpC,aAAa;IA8Bb,OAAO;;;;;;;;;;;;;CA0Cd"}
|
|
@@ -13,14 +13,23 @@ export class SessionModel {
|
|
|
13
13
|
const encoder = new TextEncoder();
|
|
14
14
|
const data = encoder.encode(token);
|
|
15
15
|
const hashBuffer = await crypto.subtle.digest("SHA-256", data);
|
|
16
|
-
const
|
|
17
|
-
|
|
16
|
+
const bytes = new Uint8Array(hashBuffer);
|
|
17
|
+
// Optimize: Use direct iteration instead of Array.from + map
|
|
18
|
+
let result = "";
|
|
19
|
+
for (const byte of bytes){
|
|
20
|
+
result += byte.toString(16).padStart(2, "0");
|
|
21
|
+
}
|
|
22
|
+
return result;
|
|
18
23
|
}
|
|
19
24
|
async createSessionByUserId(userId) {
|
|
20
25
|
// Generate secure random bytes using Web Crypto API
|
|
21
26
|
const randomBytes = new Uint8Array(64);
|
|
22
27
|
crypto.getRandomValues(randomBytes);
|
|
23
|
-
|
|
28
|
+
// Optimize: Use direct iteration instead of Array.from + map
|
|
29
|
+
let token = "";
|
|
30
|
+
for (const byte of randomBytes){
|
|
31
|
+
token += byte.toString(16).padStart(2, "0");
|
|
32
|
+
}
|
|
24
33
|
const device = await new DeviceModel(this.c).getDeviceId();
|
|
25
34
|
const hashedToken = await this.hashToken(token);
|
|
26
35
|
await this.c.get("db").insert(core_sessions).values({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"process-cron-jobs.d.ts","sourceRoot":"","sources":["../../../../../../src/api/modules/cron/helpers/process-cron-jobs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,
|
|
1
|
+
{"version":3,"file":"process-cron-jobs.d.ts","sourceRoot":"","sources":["../../../../../../src/api/modules/cron/helpers/process-cron-jobs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAKvD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAKpD,UAAU,aAAa;IACrB,SAAS,EAAE,IAAI,CAAC;IAChB,WAAW,EAAE,IAAI,GAAG,MAAM,CAAC;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,IAAI,GAAG,IAAI,CAAC;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,IAAI,GAAG,IAAI,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAiBD,wBAAsB,uBAAuB,CAC3C,EAAE,EAAE,UAAU,CAAC,OAAO,OAAO,CAAC,EAC9B,UAAU,EAAE,aAAa,EAAE,EAC3B,eAAe,EAAE,aAAa,EAAE,iBAqBjC;AAED,wBAAgB,eAAe,CAC7B,QAAQ,EAAE,aAAa,EAAE,EACzB,UAAU,EAAE,aAAa,EAAE;;;;iBAKhB;YAAE,WAAW,CAAC,EAAE,OAAO,CAAC;YAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;SAAE;qBACzC,aAAa;aACrB,aAAa;;EAsCrB;AAED,wBAAsB,cAAc,CAClC,EAAE,EAAE,UAAU,CAAC,OAAO,OAAO,CAAC,EAC9B,YAAY,EAAE;IACZ,OAAO,EAAE;QAAE,WAAW,CAAC,EAAE,OAAO,CAAC;QAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;KAAE,CAAC;IACvD,WAAW,EAAE,aAAa,CAAC;IAC3B,GAAG,EAAE,aAAa,CAAC;CACpB,EAAE,iBAyBJ"}
|
|
@@ -2,9 +2,6 @@ import { eq, inArray } from "drizzle-orm";
|
|
|
2
2
|
import { validate } from "node-cron";
|
|
3
3
|
import { core_cron } from "../../../../database/cron.js";
|
|
4
4
|
import { shouldCronJobRun } from "../../../../lib/api/should-cron-job-run.js";
|
|
5
|
-
function findExistingJob(job, cronFromDb) {
|
|
6
|
-
return cronFromDb.find((dbJob)=>dbJob.name === job.name && dbJob.pluginId === job.pluginId && dbJob.module === job.module);
|
|
7
|
-
}
|
|
8
5
|
function getJobChanges(job, existingJob) {
|
|
9
6
|
const changes = {};
|
|
10
7
|
if (existingJob.description !== job.description) {
|
|
@@ -17,8 +14,9 @@ function getJobChanges(job, existingJob) {
|
|
|
17
14
|
}
|
|
18
15
|
export async function cleanupOutdatedCronJobs(db, cronFromDb, currentCronJobs) {
|
|
19
16
|
if (cronFromDb.length === 0) return;
|
|
20
|
-
|
|
21
|
-
const
|
|
17
|
+
// Optimize: Use Set for O(1) lookup instead of Array.includes O(n)
|
|
18
|
+
const currentCronIdentifiers = new Set(currentCronJobs.map((job)=>`${job.pluginId}:${job.module}:${job.name}`));
|
|
19
|
+
const cronJobsToDelete = cronFromDb.filter((dbCron)=>!currentCronIdentifiers.has(`${dbCron.pluginId}:${dbCron.module}:${dbCron.name}`)).map((dbCron)=>dbCron.id);
|
|
22
20
|
if (cronJobsToDelete.length > 0) {
|
|
23
21
|
await db.delete(core_cron).where(inArray(core_cron.id, cronJobsToDelete));
|
|
24
22
|
}
|
|
@@ -27,13 +25,19 @@ export function processCronJobs(cronJobs, cronFromDb) {
|
|
|
27
25
|
const newJobs = [];
|
|
28
26
|
const jobsToExecute = [];
|
|
29
27
|
const jobsToUpdate = [];
|
|
28
|
+
// Optimize: Create a Map for O(1) lookup instead of O(n) find operations
|
|
29
|
+
const cronFromDbMap = new Map(cronFromDb.map((dbJob)=>[
|
|
30
|
+
`${dbJob.pluginId}:${dbJob.module}:${dbJob.name}`,
|
|
31
|
+
dbJob
|
|
32
|
+
]));
|
|
30
33
|
for (const job of cronJobs){
|
|
31
34
|
if (!validate(job.schedule)) {
|
|
32
35
|
// eslint-disable-next-line no-console
|
|
33
36
|
console.warn(`\x1b[34m[VitNode]\x1b[0m \x1b[33mInvalid cron schedule for job "${job.pluginId}:${job.module}:${job.name}"\x1b[0m: ${job.schedule}`);
|
|
34
37
|
continue;
|
|
35
38
|
}
|
|
36
|
-
const
|
|
39
|
+
const jobKey = `${job.pluginId}:${job.module}:${job.name}`;
|
|
40
|
+
const existingJob = cronFromDbMap.get(jobKey);
|
|
37
41
|
if (existingJob) {
|
|
38
42
|
const changes = getJobChanges(job, existingJob);
|
|
39
43
|
if (Object.keys(changes).length > 0) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cron.route.d.ts","sourceRoot":"","sources":["../../../../../../src/api/modules/cron/routes/cron.route.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAcxB,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"cron.route.d.ts","sourceRoot":"","sources":["../../../../../../src/api/modules/cron/routes/cron.route.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAcxB,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;EAgHvB,CAAC"}
|
|
@@ -60,10 +60,16 @@ export const runCronRoute = buildRoute({
|
|
|
60
60
|
await c.get("log").error(`Error updating cron jobs: ${error}`);
|
|
61
61
|
}
|
|
62
62
|
if (jobsToExecute.length > 0) {
|
|
63
|
+
// Optimize: Create a Map for O(1) lookup instead of O(n) find operations
|
|
64
|
+
const cronFromDbMap = new Map(cronFromDb.map((dbJob)=>[
|
|
65
|
+
`${dbJob.pluginId}:${dbJob.module}:${dbJob.name}`,
|
|
66
|
+
dbJob
|
|
67
|
+
]));
|
|
63
68
|
const executionPromises = jobsToExecute.map(async (job)=>{
|
|
64
69
|
try {
|
|
65
70
|
await job.handler(c);
|
|
66
|
-
const
|
|
71
|
+
const jobKey = `${job.pluginId}:${job.module}:${job.name}`;
|
|
72
|
+
const dbJob = cronFromDbMap.get(jobKey);
|
|
67
73
|
if (dbJob) {
|
|
68
74
|
await db.update(core_cron).set({
|
|
69
75
|
lastRun: now,
|
|
@@ -51,7 +51,7 @@ export function AutoForm({ formSchema, mode, onSubmit: onSubmitProp, captcha, fi
|
|
|
51
51
|
return /*#__PURE__*/ _jsxs("div", {
|
|
52
52
|
children: [
|
|
53
53
|
item.label && /*#__PURE__*/ _jsx("span", {
|
|
54
|
-
className: "text-xl font-semibold
|
|
54
|
+
className: "text-xl leading-none font-semibold tracking-tight",
|
|
55
55
|
children: item.label
|
|
56
56
|
}),
|
|
57
57
|
item.description && /*#__PURE__*/ _jsx("div", {
|
|
@@ -5,7 +5,7 @@ import { AutoFormDesc } from "../common/desc.js";
|
|
|
5
5
|
import { AutoFormLabel } from "../common/label.js";
|
|
6
6
|
export const AutoFormCheckbox = ({ label, labelRight, description, otherProps: { isOptional }, field, ...props })=>{
|
|
7
7
|
return /*#__PURE__*/ _jsxs(FormItem, {
|
|
8
|
-
className: "flex flex-row items-start space-
|
|
8
|
+
className: "flex flex-row items-start space-y-0 space-x-3 rounded-md border p-4",
|
|
9
9
|
children: [
|
|
10
10
|
/*#__PURE__*/ _jsx(FormControl, {
|
|
11
11
|
children: /*#__PURE__*/ _jsx(Checkbox, {
|
|
@@ -26,7 +26,7 @@ export const AutoFormRadioGroup = ({ label, labelRight, field, description, othe
|
|
|
26
26
|
onValueChange: field.onChange,
|
|
27
27
|
...props,
|
|
28
28
|
children: values.map(({ value, label })=>/*#__PURE__*/ _jsxs(FormItem, {
|
|
29
|
-
className: "flex items-center space-
|
|
29
|
+
className: "flex items-center space-y-0 space-x-3",
|
|
30
30
|
children: [
|
|
31
31
|
/*#__PURE__*/ _jsx(FormControl, {
|
|
32
32
|
children: /*#__PURE__*/ _jsx(RadioGroupItem, {
|
|
@@ -18,10 +18,10 @@ export const ThemeSwitcher = ()=>{
|
|
|
18
18
|
variant: "ghost",
|
|
19
19
|
children: [
|
|
20
20
|
/*#__PURE__*/ _jsx(Sun, {
|
|
21
|
-
className: "size-[1.2rem] rotate-0
|
|
21
|
+
className: "size-[1.2rem] scale-100 rotate-0 transition-all dark:scale-0 dark:-rotate-90"
|
|
22
22
|
}),
|
|
23
23
|
/*#__PURE__*/ _jsx(Moon, {
|
|
24
|
-
className: "absolute size-[1.2rem] rotate-90
|
|
24
|
+
className: "absolute size-[1.2rem] scale-0 rotate-90 transition-all dark:scale-100 dark:rotate-0"
|
|
25
25
|
})
|
|
26
26
|
]
|
|
27
27
|
});
|
|
@@ -44,7 +44,7 @@ export function ContentDataTable({ columns, edges, pageInfo, order, customNotFou
|
|
|
44
44
|
})
|
|
45
45
|
}, row.id)) : /*#__PURE__*/ _jsx(TableRow, {
|
|
46
46
|
children: /*#__PURE__*/ _jsx(TableCell, {
|
|
47
|
-
className: "mx-auto max-w-sm
|
|
47
|
+
className: "mx-auto max-w-sm p-4 text-center whitespace-normal sm:px-10 sm:py-12",
|
|
48
48
|
colSpan: columns.length,
|
|
49
49
|
children: customNotFoundComponent ?? /*#__PURE__*/ _jsxs("div", {
|
|
50
50
|
className: "flex flex-col items-center justify-center gap-6",
|
|
@@ -20,7 +20,7 @@ function AccordionTrigger({ className, children, ...props }) {
|
|
|
20
20
|
return /*#__PURE__*/ _jsx(AccordionPrimitive.Header, {
|
|
21
21
|
className: "flex",
|
|
22
22
|
children: /*#__PURE__*/ _jsxs(AccordionPrimitive.Trigger, {
|
|
23
|
-
className: cn("focus-visible:border-ring focus-visible:ring-ring/50 flex flex-1 items-start justify-between gap-4 rounded-md py-4 text-left text-sm font-medium outline-none
|
|
23
|
+
className: cn("focus-visible:border-ring focus-visible:ring-ring/50 flex flex-1 items-start justify-between gap-4 rounded-md py-4 text-left text-sm font-medium transition-all outline-none hover:underline focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 [&[data-state=open]>svg]:rotate-180", className),
|
|
24
24
|
"data-slot": "accordion-trigger",
|
|
25
25
|
...props,
|
|
26
26
|
children: [
|
|
@@ -38,7 +38,7 @@ function AccordionContent({ className, children, ...props }) {
|
|
|
38
38
|
"data-slot": "accordion-content",
|
|
39
39
|
...props,
|
|
40
40
|
children: /*#__PURE__*/ _jsx("div", {
|
|
41
|
-
className: cn("pb-4
|
|
41
|
+
className: cn("pt-0 pb-4", className),
|
|
42
42
|
children: children
|
|
43
43
|
})
|
|
44
44
|
});
|
|
@@ -56,7 +56,7 @@ function AlertDialogContent({ className, ...props }) {
|
|
|
56
56
|
children: [
|
|
57
57
|
/*#__PURE__*/ _jsx(AlertDialogOverlay, {}),
|
|
58
58
|
/*#__PURE__*/ _jsx(AlertDialogPrimitive.Content, {
|
|
59
|
-
className: cn("dark:bg-background bg-card data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed
|
|
59
|
+
className: cn("dark:bg-background bg-card data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg", className),
|
|
60
60
|
"data-slot": "alert-dialog-content",
|
|
61
61
|
...props
|
|
62
62
|
})
|
|
@@ -9,14 +9,14 @@ function Card({ className, ...props }) {
|
|
|
9
9
|
}
|
|
10
10
|
function CardHeader({ className, ...props }) {
|
|
11
11
|
return /*#__PURE__*/ _jsx("div", {
|
|
12
|
-
className: cn("@container/card-header has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6
|
|
12
|
+
className: cn("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6", className),
|
|
13
13
|
"data-slot": "card-header",
|
|
14
14
|
...props
|
|
15
15
|
});
|
|
16
16
|
}
|
|
17
17
|
function CardTitle({ className, ...props }) {
|
|
18
18
|
return /*#__PURE__*/ _jsx("div", {
|
|
19
|
-
className: cn("text-xl font-semibold
|
|
19
|
+
className: cn("text-xl leading-none font-semibold", className),
|
|
20
20
|
"data-slot": "card-title",
|
|
21
21
|
...props
|
|
22
22
|
});
|
|
@@ -44,7 +44,7 @@ function CardContent({ className, ...props }) {
|
|
|
44
44
|
}
|
|
45
45
|
function CardFooter({ className, ...props }) {
|
|
46
46
|
return /*#__PURE__*/ _jsx("div", {
|
|
47
|
-
className: cn("[.border-t]:pt-6
|
|
47
|
+
className: cn("flex items-center px-6 [.border-t]:pt-6", className),
|
|
48
48
|
"data-slot": "card-footer",
|
|
49
49
|
...props
|
|
50
50
|
});
|
|
@@ -5,7 +5,7 @@ import { Checkbox as CheckboxPrimitive } from "radix-ui";
|
|
|
5
5
|
import { cn } from "../../lib/utils.js";
|
|
6
6
|
function Checkbox({ className, ...props }) {
|
|
7
7
|
return /*#__PURE__*/ _jsx(CheckboxPrimitive.Root, {
|
|
8
|
-
className: cn("border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive
|
|
8
|
+
className: cn("border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive peer size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50", className),
|
|
9
9
|
"data-slot": "checkbox",
|
|
10
10
|
...props,
|
|
11
11
|
children: /*#__PURE__*/ _jsx(CheckboxPrimitive.Indicator, {
|
|
@@ -30,7 +30,7 @@ function CommandDialog({ title = "Command Palette", description = "Search for a
|
|
|
30
30
|
className: cn("overflow-hidden p-0", className),
|
|
31
31
|
showCloseButton: showCloseButton,
|
|
32
32
|
children: /*#__PURE__*/ _jsx(Command, {
|
|
33
|
-
className: "[&_[cmdk-group-heading]]:text-muted-foreground **:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-
|
|
33
|
+
className: "[&_[cmdk-group-heading]]:text-muted-foreground **:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5",
|
|
34
34
|
children: children
|
|
35
35
|
})
|
|
36
36
|
})
|
|
@@ -46,7 +46,7 @@ function CommandInput({ className, ...props }) {
|
|
|
46
46
|
className: "size-4 shrink-0 opacity-50"
|
|
47
47
|
}),
|
|
48
48
|
/*#__PURE__*/ _jsx(CommandPrimitive.Input, {
|
|
49
|
-
className: cn("placeholder:text-muted-foreground
|
|
49
|
+
className: cn("placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50", className),
|
|
50
50
|
"data-slot": "command-input",
|
|
51
51
|
...props
|
|
52
52
|
})
|
|
@@ -55,7 +55,7 @@ function CommandInput({ className, ...props }) {
|
|
|
55
55
|
}
|
|
56
56
|
function CommandList({ className, ...props }) {
|
|
57
57
|
return /*#__PURE__*/ _jsx(CommandPrimitive.List, {
|
|
58
|
-
className: cn("max-h-[300px] scroll-py-1 overflow-
|
|
58
|
+
className: cn("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto", className),
|
|
59
59
|
"data-slot": "command-list",
|
|
60
60
|
...props
|
|
61
61
|
});
|
|
@@ -83,7 +83,7 @@ function CommandSeparator({ className, ...props }) {
|
|
|
83
83
|
}
|
|
84
84
|
function CommandItem({ className, ...props }) {
|
|
85
85
|
return /*#__PURE__*/ _jsx(CommandPrimitive.Item, {
|
|
86
|
-
className: cn("data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground
|
|
86
|
+
className: cn("data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0", className),
|
|
87
87
|
"data-slot": "command-item",
|
|
88
88
|
...props
|
|
89
89
|
});
|
|
@@ -41,7 +41,7 @@ function ContextMenuRadioGroup({ ...props }) {
|
|
|
41
41
|
}
|
|
42
42
|
function ContextMenuSubTrigger({ className, inset, children, ...props }) {
|
|
43
43
|
return /*#__PURE__*/ _jsxs(ContextMenuPrimitive.SubTrigger, {
|
|
44
|
-
className: cn("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground
|
|
44
|
+
className: cn("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0", className),
|
|
45
45
|
"data-inset": inset,
|
|
46
46
|
"data-slot": "context-menu-sub-trigger",
|
|
47
47
|
...props,
|
|
@@ -55,7 +55,7 @@ function ContextMenuSubTrigger({ className, inset, children, ...props }) {
|
|
|
55
55
|
}
|
|
56
56
|
function ContextMenuSubContent({ className, ...props }) {
|
|
57
57
|
return /*#__PURE__*/ _jsx(ContextMenuPrimitive.SubContent, {
|
|
58
|
-
className: cn("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-(--radix-context-menu-content-transform-origin)
|
|
58
|
+
className: cn("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-context-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg", className),
|
|
59
59
|
"data-slot": "context-menu-sub-content",
|
|
60
60
|
...props
|
|
61
61
|
});
|
|
@@ -63,7 +63,7 @@ function ContextMenuSubContent({ className, ...props }) {
|
|
|
63
63
|
function ContextMenuContent({ className, ...props }) {
|
|
64
64
|
return /*#__PURE__*/ _jsx(ContextMenuPrimitive.Portal, {
|
|
65
65
|
children: /*#__PURE__*/ _jsx(ContextMenuPrimitive.Content, {
|
|
66
|
-
className: cn("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 max-h-(--radix-context-menu-content-available-height) origin-(--radix-context-menu-content-transform-origin)
|
|
66
|
+
className: cn("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-context-menu-content-available-height) min-w-[8rem] origin-(--radix-context-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md", className),
|
|
67
67
|
"data-slot": "context-menu-content",
|
|
68
68
|
...props
|
|
69
69
|
})
|
|
@@ -71,7 +71,7 @@ function ContextMenuContent({ className, ...props }) {
|
|
|
71
71
|
}
|
|
72
72
|
function ContextMenuItem({ className, inset, variant = "default", ...props }) {
|
|
73
73
|
return /*#__PURE__*/ _jsx(ContextMenuPrimitive.Item, {
|
|
74
|
-
className: cn("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground
|
|
74
|
+
className: cn("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0", className),
|
|
75
75
|
"data-inset": inset,
|
|
76
76
|
"data-slot": "context-menu-item",
|
|
77
77
|
"data-variant": variant,
|
|
@@ -81,7 +81,7 @@ function ContextMenuItem({ className, inset, variant = "default", ...props }) {
|
|
|
81
81
|
function ContextMenuCheckboxItem({ className, children, checked, ...props }) {
|
|
82
82
|
return /*#__PURE__*/ _jsxs(ContextMenuPrimitive.CheckboxItem, {
|
|
83
83
|
checked: checked,
|
|
84
|
-
className: cn("focus:bg-accent focus:text-accent-foreground
|
|
84
|
+
className: cn("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0", className),
|
|
85
85
|
"data-slot": "context-menu-checkbox-item",
|
|
86
86
|
...props,
|
|
87
87
|
children: [
|
|
@@ -99,7 +99,7 @@ function ContextMenuCheckboxItem({ className, children, checked, ...props }) {
|
|
|
99
99
|
}
|
|
100
100
|
function ContextMenuRadioItem({ className, children, ...props }) {
|
|
101
101
|
return /*#__PURE__*/ _jsxs(ContextMenuPrimitive.RadioItem, {
|
|
102
|
-
className: cn("focus:bg-accent focus:text-accent-foreground
|
|
102
|
+
className: cn("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0", className),
|
|
103
103
|
"data-slot": "context-menu-radio-item",
|
|
104
104
|
...props,
|
|
105
105
|
children: [
|
|
@@ -122,7 +122,7 @@ function DialogContent({ className, children, showCloseButton = true, ...props }
|
|
|
122
122
|
children: [
|
|
123
123
|
/*#__PURE__*/ _jsx(DialogOverlay, {}),
|
|
124
124
|
/*#__PURE__*/ _jsxs(DialogPrimitive.Content, {
|
|
125
|
-
className: cn("dark:bg-background bg-card data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed
|
|
125
|
+
className: cn("dark:bg-background bg-card data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg", "max-h-[calc(100vh_-_2rem)] overflow-y-scroll sm:max-h-[calc(100vh_-_5rem)]", className),
|
|
126
126
|
"data-slot": "dialog-content",
|
|
127
127
|
onInteractOutside: (e)=>{
|
|
128
128
|
// Prevent dismissing the dialog when clicking on a toast
|
|
@@ -136,7 +136,7 @@ function DialogContent({ className, children, showCloseButton = true, ...props }
|
|
|
136
136
|
children: [
|
|
137
137
|
children,
|
|
138
138
|
showCloseButton && /*#__PURE__*/ _jsxs(DialogPrimitive.Close, {
|
|
139
|
-
className: "ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground
|
|
139
|
+
className: "ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
|
|
140
140
|
"data-slot": "dialog-close",
|
|
141
141
|
onClick: (e)=>{
|
|
142
142
|
if (isDirty) {
|
|
@@ -174,7 +174,7 @@ function DialogFooter({ className, ...props }) {
|
|
|
174
174
|
}
|
|
175
175
|
function DialogTitle({ className, ...props }) {
|
|
176
176
|
return /*#__PURE__*/ _jsx(DialogPrimitive.Title, {
|
|
177
|
-
className: cn("text-lg font-semibold
|
|
177
|
+
className: cn("text-lg leading-none font-semibold", className),
|
|
178
178
|
"data-slot": "dialog-title",
|
|
179
179
|
...props
|
|
180
180
|
});
|
|
@@ -24,7 +24,7 @@ function DropdownMenuTrigger({ ...props }) {
|
|
|
24
24
|
function DropdownMenuContent({ className, sideOffset = 4, ...props }) {
|
|
25
25
|
return /*#__PURE__*/ _jsx(DropdownMenuPrimitive.Portal, {
|
|
26
26
|
children: /*#__PURE__*/ _jsx(DropdownMenuPrimitive.Content, {
|
|
27
|
-
className: cn("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 max-h-(--radix-dropdown-menu-content-available-height) origin-(--radix-dropdown-menu-content-transform-origin)
|
|
27
|
+
className: cn("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md", className),
|
|
28
28
|
"data-slot": "dropdown-menu-content",
|
|
29
29
|
sideOffset: sideOffset,
|
|
30
30
|
...props
|
|
@@ -39,7 +39,7 @@ function DropdownMenuGroup({ ...props }) {
|
|
|
39
39
|
}
|
|
40
40
|
function DropdownMenuItem({ className, inset, variant = "default", ...props }) {
|
|
41
41
|
return /*#__PURE__*/ _jsx(DropdownMenuPrimitive.Item, {
|
|
42
|
-
className: cn("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground
|
|
42
|
+
className: cn("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0", className),
|
|
43
43
|
"data-inset": inset,
|
|
44
44
|
"data-slot": "dropdown-menu-item",
|
|
45
45
|
"data-variant": variant,
|
|
@@ -49,7 +49,7 @@ function DropdownMenuItem({ className, inset, variant = "default", ...props }) {
|
|
|
49
49
|
function DropdownMenuCheckboxItem({ className, children, checked, ...props }) {
|
|
50
50
|
return /*#__PURE__*/ _jsxs(DropdownMenuPrimitive.CheckboxItem, {
|
|
51
51
|
checked: checked,
|
|
52
|
-
className: cn("focus:bg-accent focus:text-accent-foreground
|
|
52
|
+
className: cn("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0", className),
|
|
53
53
|
"data-slot": "dropdown-menu-checkbox-item",
|
|
54
54
|
...props,
|
|
55
55
|
children: [
|
|
@@ -73,7 +73,7 @@ function DropdownMenuRadioGroup({ ...props }) {
|
|
|
73
73
|
}
|
|
74
74
|
function DropdownMenuRadioItem({ className, children, ...props }) {
|
|
75
75
|
return /*#__PURE__*/ _jsxs(DropdownMenuPrimitive.RadioItem, {
|
|
76
|
-
className: cn("focus:bg-accent focus:text-accent-foreground
|
|
76
|
+
className: cn("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0", className),
|
|
77
77
|
"data-slot": "dropdown-menu-radio-item",
|
|
78
78
|
...props,
|
|
79
79
|
children: [
|
|
@@ -119,7 +119,7 @@ function DropdownMenuSub({ ...props }) {
|
|
|
119
119
|
}
|
|
120
120
|
function DropdownMenuSubTrigger({ className, inset, children, ...props }) {
|
|
121
121
|
return /*#__PURE__*/ _jsxs(DropdownMenuPrimitive.SubTrigger, {
|
|
122
|
-
className: cn("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground
|
|
122
|
+
className: cn("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8", className),
|
|
123
123
|
"data-inset": inset,
|
|
124
124
|
"data-slot": "dropdown-menu-sub-trigger",
|
|
125
125
|
...props,
|
|
@@ -133,7 +133,7 @@ function DropdownMenuSubTrigger({ className, inset, children, ...props }) {
|
|
|
133
133
|
}
|
|
134
134
|
function DropdownMenuSubContent({ className, ...props }) {
|
|
135
135
|
return /*#__PURE__*/ _jsx(DropdownMenuPrimitive.SubContent, {
|
|
136
|
-
className: cn("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-(--radix-dropdown-menu-content-transform-origin)
|
|
136
|
+
className: cn("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg", className),
|
|
137
137
|
"data-slot": "dropdown-menu-sub-content",
|
|
138
138
|
...props
|
|
139
139
|
});
|
|
@@ -18,7 +18,7 @@ export const Editor = ({ className, disableScroll, value = "" })=>{
|
|
|
18
18
|
});
|
|
19
19
|
if (!editor) return /*#__PURE__*/ _jsx(Loader, {});
|
|
20
20
|
return /*#__PURE__*/ _jsxs("div", {
|
|
21
|
-
className: cn("bg-card
|
|
21
|
+
className: cn("bg-card relative w-full rounded-md border shadow-xs", {
|
|
22
22
|
"max-h-[20rem] overflow-hidden overflow-y-scroll": !disableScroll,
|
|
23
23
|
className
|
|
24
24
|
}),
|
|
@@ -19,7 +19,7 @@ function HoverCardContent({ className, align = "center", sideOffset = 4, ...prop
|
|
|
19
19
|
"data-slot": "hover-card-portal",
|
|
20
20
|
children: /*#__PURE__*/ _jsx(HoverCardPrimitive.Content, {
|
|
21
21
|
align: align,
|
|
22
|
-
className: cn("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-(--radix-hover-card-content-transform-origin)
|
|
22
|
+
className: cn("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-64 origin-(--radix-hover-card-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden", className),
|
|
23
23
|
"data-slot": "hover-card-content",
|
|
24
24
|
sideOffset: sideOffset,
|
|
25
25
|
...props
|
|
@@ -7,7 +7,7 @@ import { cn } from "../../lib/utils.js";
|
|
|
7
7
|
function InputOTP({ className, containerClassName, ...props }) {
|
|
8
8
|
return /*#__PURE__*/ _jsx(OTPInput, {
|
|
9
9
|
className: cn("disabled:cursor-not-allowed", className),
|
|
10
|
-
containerClassName: cn("
|
|
10
|
+
containerClassName: cn("flex items-center gap-2 has-disabled:opacity-50", containerClassName),
|
|
11
11
|
"data-slot": "input-otp",
|
|
12
12
|
...props
|
|
13
13
|
});
|
|
@@ -23,7 +23,7 @@ function InputOTPSlot({ index, className, ...props }) {
|
|
|
23
23
|
const inputOTPContext = React.use(OTPInputContext);
|
|
24
24
|
const { char, hasFakeCaret, isActive } = inputOTPContext?.slots[index] ?? {};
|
|
25
25
|
return /*#__PURE__*/ _jsxs("div", {
|
|
26
|
-
className: cn("data-[active=true]:border-ring data-[active=true]:ring-ring/50 data-[active=true]:aria-invalid:ring-destructive/20 dark:data-[active=true]:aria-invalid:ring-destructive/40 aria-invalid:border-destructive data-[active=true]:aria-invalid:border-destructive dark:bg-input/30 border-input
|
|
26
|
+
className: cn("data-[active=true]:border-ring data-[active=true]:ring-ring/50 data-[active=true]:aria-invalid:ring-destructive/20 dark:data-[active=true]:aria-invalid:ring-destructive/40 aria-invalid:border-destructive data-[active=true]:aria-invalid:border-destructive dark:bg-input/30 border-input relative flex h-9 w-9 items-center justify-center border-y border-r text-sm shadow-xs transition-all outline-none first:rounded-l-md first:border-l last:rounded-r-md data-[active=true]:z-10 data-[active=true]:ring-[3px]", className),
|
|
27
27
|
"data-active": isActive,
|
|
28
28
|
"data-slot": "input-otp-slot",
|
|
29
29
|
...props,
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { cn } from "../../lib/utils.js";
|
|
3
3
|
function Input({ className, type, ...props }) {
|
|
4
4
|
return /*#__PURE__*/ _jsx("input", {
|
|
5
|
-
className: cn("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input
|
|
5
|
+
className: cn("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm", "focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]", "aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive", className),
|
|
6
6
|
"data-slot": "input",
|
|
7
7
|
type: type,
|
|
8
8
|
...props
|
|
@@ -4,7 +4,7 @@ import { Label as LabelPrimitive } from "radix-ui";
|
|
|
4
4
|
import { cn } from "../../lib/utils.js";
|
|
5
5
|
function Label({ className, ...props }) {
|
|
6
6
|
return /*#__PURE__*/ _jsx(LabelPrimitive.Root, {
|
|
7
|
-
className: cn("flex
|
|
7
|
+
className: cn("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50", className),
|
|
8
8
|
"data-slot": "label",
|
|
9
9
|
...props
|
|
10
10
|
});
|