@medialane/ui 0.130.1 → 0.131.0
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/components/drop-item-list.cjs +118 -0
- package/dist/components/drop-item-list.cjs.map +1 -0
- package/dist/components/drop-item-list.d.cts +19 -0
- package/dist/components/drop-item-list.d.ts +19 -0
- package/dist/components/drop-item-list.js +84 -0
- package/dist/components/drop-item-list.js.map +1 -0
- package/dist/components/sheet.d.cts +1 -1
- package/dist/components/sheet.d.ts +1 -1
- package/dist/data/drop-create-schema.cjs +85 -0
- package/dist/data/drop-create-schema.cjs.map +1 -0
- package/dist/data/drop-create-schema.d.cts +111 -0
- package/dist/data/drop-create-schema.d.ts +111 -0
- package/dist/data/drop-create-schema.js +51 -0
- package/dist/data/drop-create-schema.js.map +1 -0
- package/dist/index.cjs +13 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -1
- package/dist/utils/launchpad-defaults.cjs +85 -0
- package/dist/utils/launchpad-defaults.cjs.map +1 -0
- package/dist/utils/launchpad-defaults.d.cts +13 -0
- package/dist/utils/launchpad-defaults.d.ts +13 -0
- package/dist/utils/launchpad-defaults.js +59 -0
- package/dist/utils/launchpad-defaults.js.map +1 -0
- package/package.json +5 -3
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
declare function getDefaultDropSchedule(now?: Date): {
|
|
2
|
+
startDate: string;
|
|
3
|
+
startTime: string;
|
|
4
|
+
endDate: string;
|
|
5
|
+
endTime: string;
|
|
6
|
+
};
|
|
7
|
+
declare function getDefaultClaimWindow(daysFromNow?: number, now?: Date): {
|
|
8
|
+
claimEndDate: string;
|
|
9
|
+
claimEndTime: string;
|
|
10
|
+
};
|
|
11
|
+
declare function suggestLaunchpadSymbol(name: string, maxLength?: number): string;
|
|
12
|
+
|
|
13
|
+
export { getDefaultClaimWindow, getDefaultDropSchedule, suggestLaunchpadSymbol };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
declare function getDefaultDropSchedule(now?: Date): {
|
|
2
|
+
startDate: string;
|
|
3
|
+
startTime: string;
|
|
4
|
+
endDate: string;
|
|
5
|
+
endTime: string;
|
|
6
|
+
};
|
|
7
|
+
declare function getDefaultClaimWindow(daysFromNow?: number, now?: Date): {
|
|
8
|
+
claimEndDate: string;
|
|
9
|
+
claimEndTime: string;
|
|
10
|
+
};
|
|
11
|
+
declare function suggestLaunchpadSymbol(name: string, maxLength?: number): string;
|
|
12
|
+
|
|
13
|
+
export { getDefaultClaimWindow, getDefaultDropSchedule, suggestLaunchpadSymbol };
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
function formatDateForInput(date) {
|
|
3
|
+
const year = date.getFullYear();
|
|
4
|
+
const month = String(date.getMonth() + 1).padStart(2, "0");
|
|
5
|
+
const day = String(date.getDate()).padStart(2, "0");
|
|
6
|
+
return `${year}-${month}-${day}`;
|
|
7
|
+
}
|
|
8
|
+
function formatTimeForInput(date) {
|
|
9
|
+
const hours = String(date.getHours()).padStart(2, "0");
|
|
10
|
+
const minutes = String(date.getMinutes()).padStart(2, "0");
|
|
11
|
+
return `${hours}:${minutes}`;
|
|
12
|
+
}
|
|
13
|
+
function roundUpToQuarterHour(date) {
|
|
14
|
+
const rounded = new Date(date);
|
|
15
|
+
rounded.setSeconds(0, 0);
|
|
16
|
+
const minutes = rounded.getMinutes();
|
|
17
|
+
const delta = (15 - minutes % 15) % 15 || 15;
|
|
18
|
+
rounded.setMinutes(minutes + delta);
|
|
19
|
+
return rounded;
|
|
20
|
+
}
|
|
21
|
+
function getDefaultDropSchedule(now = /* @__PURE__ */ new Date()) {
|
|
22
|
+
const start = roundUpToQuarterHour(now);
|
|
23
|
+
const end = new Date(start);
|
|
24
|
+
end.setDate(end.getDate() + 7);
|
|
25
|
+
end.setHours(23, 59, 0, 0);
|
|
26
|
+
return {
|
|
27
|
+
startDate: formatDateForInput(start),
|
|
28
|
+
startTime: formatTimeForInput(start),
|
|
29
|
+
endDate: formatDateForInput(end),
|
|
30
|
+
endTime: formatTimeForInput(end)
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
function getDefaultClaimWindow(daysFromNow = 30, now = /* @__PURE__ */ new Date()) {
|
|
34
|
+
const end = new Date(now);
|
|
35
|
+
end.setDate(end.getDate() + daysFromNow);
|
|
36
|
+
end.setHours(23, 59, 0, 0);
|
|
37
|
+
return {
|
|
38
|
+
claimEndDate: formatDateForInput(end),
|
|
39
|
+
claimEndTime: formatTimeForInput(end)
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
function suggestLaunchpadSymbol(name, maxLength = 10) {
|
|
43
|
+
const cleaned = name.toUpperCase().replace(/[^A-Z0-9 ]+/g, " ").trim();
|
|
44
|
+
if (!cleaned) return "";
|
|
45
|
+
const words = cleaned.split(/\s+/).filter(Boolean);
|
|
46
|
+
const initials = words.filter((word) => /[A-Z0-9]/.test(word)).map((word) => word[0]).join("");
|
|
47
|
+
const digits = words.join("").replace(/[^0-9]/g, "");
|
|
48
|
+
let candidate = `${initials}${digits}`.slice(0, maxLength);
|
|
49
|
+
if (candidate.length < 3) {
|
|
50
|
+
candidate = words.join("").replace(/\s+/g, "").slice(0, maxLength);
|
|
51
|
+
}
|
|
52
|
+
return candidate.slice(0, maxLength);
|
|
53
|
+
}
|
|
54
|
+
export {
|
|
55
|
+
getDefaultClaimWindow,
|
|
56
|
+
getDefaultDropSchedule,
|
|
57
|
+
suggestLaunchpadSymbol
|
|
58
|
+
};
|
|
59
|
+
//# sourceMappingURL=launchpad-defaults.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/utils/launchpad-defaults.ts"],"sourcesContent":["\"use client\";\n\nfunction formatDateForInput(date: Date): string {\n const year = date.getFullYear();\n const month = String(date.getMonth() + 1).padStart(2, \"0\");\n const day = String(date.getDate()).padStart(2, \"0\");\n return `${year}-${month}-${day}`;\n}\n\nfunction formatTimeForInput(date: Date): string {\n const hours = String(date.getHours()).padStart(2, \"0\");\n const minutes = String(date.getMinutes()).padStart(2, \"0\");\n return `${hours}:${minutes}`;\n}\n\nfunction roundUpToQuarterHour(date: Date): Date {\n const rounded = new Date(date);\n rounded.setSeconds(0, 0);\n const minutes = rounded.getMinutes();\n const delta = (15 - (minutes % 15)) % 15 || 15;\n rounded.setMinutes(minutes + delta);\n return rounded;\n}\n\nexport function getDefaultDropSchedule(now = new Date()) {\n const start = roundUpToQuarterHour(now);\n const end = new Date(start);\n end.setDate(end.getDate() + 7);\n end.setHours(23, 59, 0, 0);\n\n return {\n startDate: formatDateForInput(start),\n startTime: formatTimeForInput(start),\n endDate: formatDateForInput(end),\n endTime: formatTimeForInput(end),\n };\n}\n\nexport function getDefaultClaimWindow(daysFromNow = 30, now = new Date()) {\n const end = new Date(now);\n end.setDate(end.getDate() + daysFromNow);\n end.setHours(23, 59, 0, 0);\n\n return {\n claimEndDate: formatDateForInput(end),\n claimEndTime: formatTimeForInput(end),\n };\n}\n\nexport function suggestLaunchpadSymbol(name: string, maxLength = 10): string {\n const cleaned = name.toUpperCase().replace(/[^A-Z0-9 ]+/g, \" \").trim();\n if (!cleaned) return \"\";\n\n const words = cleaned.split(/\\s+/).filter(Boolean);\n const initials = words\n .filter((word) => /[A-Z0-9]/.test(word))\n .map((word) => word[0])\n .join(\"\");\n const digits = words.join(\"\").replace(/[^0-9]/g, \"\");\n\n let candidate = `${initials}${digits}`.slice(0, maxLength);\n if (candidate.length < 3) {\n candidate = words.join(\"\").replace(/\\s+/g, \"\").slice(0, maxLength);\n }\n\n return candidate.slice(0, maxLength);\n}\n"],"mappings":";AAEA,SAAS,mBAAmB,MAAoB;AAC9C,QAAM,OAAO,KAAK,YAAY;AAC9B,QAAM,QAAQ,OAAO,KAAK,SAAS,IAAI,CAAC,EAAE,SAAS,GAAG,GAAG;AACzD,QAAM,MAAM,OAAO,KAAK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,QAAQ,gBAAgB,GAAG,EAAE,KAAK;AACrE,MAAI,CAAC,QAAS,QAAO;AAErB,QAAM,QAAQ,QAAQ,MAAM,KAAK,EAAE,OAAO,OAAO;AACjD,QAAM,WAAW,MACd,OAAO,CAAC,SAAS,WAAW,KAAK,IAAI,CAAC,EACtC,IAAI,CAAC,SAAS,KAAK,CAAC,CAAC,EACrB,KAAK,EAAE;AACV,QAAM,SAAS,MAAM,KAAK,EAAE,EAAE,QAAQ,WAAW,EAAE;AAEnD,MAAI,YAAY,GAAG,QAAQ,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS;AACzD,MAAI,UAAU,SAAS,GAAG;AACxB,gBAAY,MAAM,KAAK,EAAE,EAAE,QAAQ,QAAQ,EAAE,EAAE,MAAM,GAAG,SAAS;AAAA,EACnE;AAEA,SAAO,UAAU,MAAM,GAAG,SAAS;AACrC;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@medialane/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.131.0",
|
|
4
4
|
"description": "Shared UI components for Medialane apps",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -75,7 +75,8 @@
|
|
|
75
75
|
"recharts": ">=2.0.0",
|
|
76
76
|
"sonner": ">=1.0.0",
|
|
77
77
|
"swr": ">=2.0.0",
|
|
78
|
-
"tailwind-merge": ">=2.0.0"
|
|
78
|
+
"tailwind-merge": ">=2.0.0",
|
|
79
|
+
"zod": "^3.25.0"
|
|
79
80
|
},
|
|
80
81
|
"devDependencies": {
|
|
81
82
|
"@medialane/sdk": "0.85.5",
|
|
@@ -111,6 +112,7 @@
|
|
|
111
112
|
"tailwindcss": "^3.0.0",
|
|
112
113
|
"tsup": "^8.0.0",
|
|
113
114
|
"typescript": "^5.6.0",
|
|
114
|
-
"vite": "^8.2.1"
|
|
115
|
+
"vite": "^8.2.1",
|
|
116
|
+
"zod": "^3.25.76"
|
|
115
117
|
}
|
|
116
118
|
}
|