cortex-react-components 3.0.8 → 3.0.9
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/{chunk-4HFMA57F.mjs → chunk-27NWC2OO.mjs} +4 -4
- package/dist/{chunk-44F47U5Y.mjs → chunk-34R3E2JB.mjs} +1 -1
- package/dist/{chunk-HLEMFDTD.mjs → chunk-3R2LCGLI.mjs} +1 -1
- package/dist/{chunk-2ZSH4X75.mjs → chunk-4DNX5IYR.mjs} +1 -1
- package/dist/{chunk-HABWABS7.mjs → chunk-4O6ESJYG.mjs} +32 -11
- package/dist/{chunk-B3UYSM32.mjs → chunk-5DYPBHBP.mjs} +4 -4
- package/dist/{chunk-PJZ5PWKP.mjs → chunk-5OGDBGXG.mjs} +1 -1
- package/dist/{chunk-KIZUBPPQ.mjs → chunk-6GO5N6ZP.mjs} +1 -1
- package/dist/{chunk-5Q43DAAS.mjs → chunk-6VQJSQRU.mjs} +8 -8
- package/dist/{chunk-QPPQNK6O.mjs → chunk-6VQLA4YU.mjs} +2 -2
- package/dist/{chunk-GXTF5CHJ.mjs → chunk-7D3SYOXW.mjs} +7 -4
- package/dist/{chunk-F563CDDJ.mjs → chunk-AQPLEBKG.mjs} +2 -2
- package/dist/{chunk-SNNQIUJH.mjs → chunk-BVCARDFK.mjs} +3 -3
- package/dist/{chunk-HGDLIXPQ.mjs → chunk-DGV5AVAW.mjs} +1 -1
- package/dist/{chunk-GV3CMMKT.mjs → chunk-FECAR2TE.mjs} +1 -1
- package/dist/{chunk-5KOAYGTO.mjs → chunk-G5N5MCLS.mjs} +5 -5
- package/dist/{chunk-SHHLY2QV.mjs → chunk-G7GPQ6BO.mjs} +1 -1
- package/dist/{chunk-354MPNDV.mjs → chunk-ICVTRW5Y.mjs} +1 -1
- package/dist/{chunk-4BRK5CBG.mjs → chunk-IFEQNYUB.mjs} +2 -2
- package/dist/{chunk-LCRSPNPB.mjs → chunk-LELKTN52.mjs} +18 -14
- package/dist/{chunk-VEIZROGM.mjs → chunk-M6ELOAGS.mjs} +1 -1
- package/dist/{chunk-YI6FLZOK.mjs → chunk-M7LM5P64.mjs} +1 -1
- package/dist/{chunk-EUAQNPRU.mjs → chunk-NHDPHK6D.mjs} +2 -2
- package/dist/{chunk-L34WYFSB.mjs → chunk-NKHYDT5B.mjs} +1 -1
- package/dist/{chunk-X6PPZZ2E.mjs → chunk-OYHXC3AT.mjs} +8 -8
- package/dist/{chunk-7ZMZT7I6.mjs → chunk-P7BPG7W7.mjs} +1 -1
- package/dist/{chunk-EGZL4DVZ.mjs → chunk-PAXCURFR.mjs} +1 -1
- package/dist/chunk-PIQUYPOZ.mjs +41 -0
- package/dist/{chunk-COHYOWMB.mjs → chunk-PVI4R7FJ.mjs} +1 -1
- package/dist/{chunk-HJLIEMLX.mjs → chunk-QC2AXU6I.mjs} +2 -2
- package/dist/{chunk-PE7KJR4A.mjs → chunk-RC6YHGVV.mjs} +1 -1
- package/dist/{chunk-USE5WY4U.mjs → chunk-S4FUSOSS.mjs} +1 -1
- package/dist/{chunk-TZDVVQBQ.mjs → chunk-SRK3Y7FA.mjs} +1 -1
- package/dist/{chunk-2S3O5TYH.mjs → chunk-UBEWNGCN.mjs} +1 -1
- package/dist/{chunk-X2KTMYOD.mjs → chunk-UJI3Y73K.mjs} +2 -2
- package/dist/{chunk-HXPXJ26M.mjs → chunk-VF2QBVAI.mjs} +1 -1
- package/dist/{chunk-4YRR74Y4.mjs → chunk-VMYEV3FG.mjs} +1 -1
- package/dist/{chunk-IXQESSPI.mjs → chunk-WA3OQB7X.mjs} +1 -1
- package/dist/{chunk-Z6MYLHDW.mjs → chunk-YFOEG4PP.mjs} +1 -1
- package/dist/{chunk-YJIB2FYD.mjs → chunk-YMXGTNMY.mjs} +2 -2
- package/dist/{chunk-QRC3VJEY.mjs → chunk-ZXU5T3GV.mjs} +1 -1
- package/dist/{chunk-TMVCGF2B.mjs → chunk-ZZ5EM2M4.mjs} +1 -1
- package/dist/components/Blocks/Banner.mjs +5 -5
- package/dist/components/Blocks/CallToAction.mjs +5 -5
- package/dist/components/Blocks/CollapsibleArea.mjs +6 -6
- package/dist/components/Blocks/Content.mjs +6 -6
- package/dist/components/Blocks/FeaturesBlock.mjs +5 -5
- package/dist/components/Blocks/ImageBlock.mjs +3 -3
- package/dist/components/Blocks/MediaBlock.mjs +3 -3
- package/dist/components/Blocks/RelatedPosts.mjs +7 -7
- package/dist/components/Blocks/RenderBlocks.mjs +8 -8
- package/dist/components/Blocks/ReusableContentBlock.mjs +8 -8
- package/dist/components/Blocks/index.mjs +15 -15
- package/dist/components/CRM/index.mjs +3 -3
- package/dist/components/Cards/ContentCard.mjs +5 -5
- package/dist/components/Cards/FeatureCard.mjs +5 -5
- package/dist/components/Cards/index.mjs +5 -5
- package/dist/components/Chat/ChatInterface.mjs +8 -8
- package/dist/components/Chat/CopilotInterface.mjs +9 -9
- package/dist/components/Chat/PartTypes/MessageHandler.mjs +6 -6
- package/dist/components/Chat/PartTypes/index.mjs +4 -4
- package/dist/components/Chat/demo-long-messages.mjs +9 -9
- package/dist/components/Chat/demo-tests.mjs +9 -9
- package/dist/components/Chat/demo.mjs +9 -9
- package/dist/components/Chat/example-usage.mjs +9 -9
- package/dist/components/Chat/example-with-vercel-ai.mjs +9 -9
- package/dist/components/Chat/index.mjs +13 -13
- package/dist/components/DigitalColleagues/AppSidebarLeft.mjs +3 -3
- package/dist/components/DigitalColleagues/MainPage.mjs +4 -4
- package/dist/components/DigitalColleagues/Pages/dashboardpage.mjs +4 -4
- package/dist/components/DigitalColleagues/Views/index.mjs +11 -11
- package/dist/components/DigitalColleagues/index.mjs +14 -14
- package/dist/components/Foundary/AppSidebarLeft.mjs +3 -3
- package/dist/components/Foundary/Knowledge/add-knowledge-modal.mjs +4 -4
- package/dist/components/Foundary/Knowledge/add-team-context.mjs +4 -4
- package/dist/components/Foundary/MainPage.mjs +4 -4
- package/dist/components/Foundary/Pages/dashboardpage.mjs +4 -4
- package/dist/components/Foundary/Views/KnowledgeView.mjs +4 -4
- package/dist/components/Foundary/Views/index.mjs +11 -11
- package/dist/components/Foundary/file-edit.mjs +4 -4
- package/dist/components/Foundary/index.mjs +14 -14
- package/dist/components/HeaderFooter/SectionHeading.mjs +6 -6
- package/dist/components/Heros/HighImpact/index.mjs +6 -6
- package/dist/components/Heros/LowImpact/index.mjs +6 -6
- package/dist/components/Heros/MediumImpact/index.mjs +6 -6
- package/dist/components/Heros/PostHero/index.mjs +4 -4
- package/dist/components/Heros/RenderHero.mjs +9 -9
- package/dist/components/Heros/index.mjs +13 -13
- package/dist/components/Holidays/CalendarView.d.ts +2 -1
- package/dist/components/Holidays/CalendarView.js +18 -14
- package/dist/components/Holidays/CalendarView.mjs +1 -1
- package/dist/components/Holidays/HolidayGrid.js +5 -3
- package/dist/components/Holidays/HolidayGrid.mjs +2 -2
- package/dist/components/Holidays/HolidayTracker.d.ts +2 -1
- package/dist/components/Holidays/HolidayTracker.js +65 -35
- package/dist/components/Holidays/HolidayTracker.mjs +5 -5
- package/dist/components/Holidays/RequestLeave.js +40 -17
- package/dist/components/Holidays/RequestLeave.mjs +2 -2
- package/dist/components/Holidays/index.js +65 -35
- package/dist/components/Holidays/index.mjs +5 -5
- package/dist/components/Layouts/OutputHeaderFooter.mjs +8 -8
- package/dist/components/Layouts/Print.mjs +12 -12
- package/dist/components/Layouts/SlideShow.mjs +14 -14
- package/dist/components/Layouts/index.mjs +15 -15
- package/dist/components/Menus/SidebarLeft.mjs +3 -3
- package/dist/components/Menus/SidebarLeftMulti.mjs +3 -3
- package/dist/components/Menus/SidebarRight.mjs +3 -3
- package/dist/components/Menus/index.mjs +8 -8
- package/dist/components/Payload/CollectionArchive/index.mjs +4 -4
- package/dist/components/Payload/Media/index.mjs +2 -2
- package/dist/components/Payload/PayloadCard/index.mjs +3 -3
- package/dist/components/Payload/RichText/index.mjs +5 -5
- package/dist/components/Payload/RichText/serialize.mjs +5 -5
- package/dist/components/Payload/index.mjs +7 -7
- package/dist/components/Projects/EpicsView.mjs +2 -2
- package/dist/components/Projects/FileView.mjs +4 -4
- package/dist/components/Projects/KanbanBoardView.mjs +7 -7
- package/dist/components/Projects/ProjectPage.mjs +9 -9
- package/dist/components/Projects/ProjectView.mjs +9 -9
- package/dist/components/Projects/TaskDetailsModal.mjs +4 -4
- package/dist/components/Projects/file-list.mjs +4 -4
- package/dist/components/Projects/index.mjs +8 -8
- package/dist/components/dc-temp/index.mjs +4 -4
- package/dist/components/index.js +97 -67
- package/dist/components/index.mjs +73 -73
- package/dist/components/ui/index.mjs +12 -12
- package/dist/components/ui/sidebar.mjs +2 -2
- package/dist/decorators/Intranet.mjs +51 -51
- package/dist/index.js +97 -67
- package/dist/index.mjs +85 -85
- package/dist/metafile-cjs.json +1 -1
- package/dist/metafile-esm.json +1 -1
- package/dist/pages/Blog.mjs +10 -10
- package/dist/pages/Documentation.mjs +4 -4
- package/dist/pages/IndexPage.mjs +14 -14
- package/dist/pages/Intranet.mjs +4 -4
- package/dist/pages/LandingPage.mjs +62 -62
- package/dist/pages/Page.mjs +12 -12
- package/dist/pages/Publish.mjs +52 -52
- package/dist/pages/Website.mjs +12 -12
- package/dist/sections/AboutSection.mjs +7 -7
- package/dist/sections/BlogDetail.mjs +6 -6
- package/dist/sections/BlogList.mjs +7 -7
- package/dist/sections/BlogListSection.mjs +7 -7
- package/dist/sections/ContactSection.mjs +7 -7
- package/dist/sections/PageSections.mjs +62 -62
- package/dist/sections/PricingSection.mjs +7 -7
- package/dist/sections/ServiceDetail.mjs +6 -6
- package/dist/sections/ServiceDetailSection.mjs +6 -6
- package/dist/sections/ServiceSection.mjs +52 -52
- package/dist/sections/index.mjs +62 -62
- package/dist/utils/DaysUtil.js +9 -7
- package/dist/utils/DaysUtil.mjs +1 -1
- package/package.json +1 -1
- package/dist/chunk-I4UOIVSC.mjs +0 -39
- package/dist/{chunk-25OSLP2V.mjs → chunk-6TVRFATY.mjs} +3 -3
- package/dist/{chunk-D5KV6INF.mjs → chunk-AEFGMCK3.mjs} +3 -3
- package/dist/{chunk-MFXCOX3L.mjs → chunk-CT6KAYGR.mjs} +3 -3
- package/dist/{chunk-M5XPU4JK.mjs → chunk-L666B5DN.mjs} +6 -6
- package/dist/{chunk-2YHN7ZCJ.mjs → chunk-NKRBXAPF.mjs} +3 -3
- package/dist/{chunk-DWGG6JKH.mjs → chunk-ZFWHFUZP.mjs} +3 -3
package/dist/index.js
CHANGED
|
@@ -10669,7 +10669,6 @@ function ApproveLeave({ leaveRequests, onApprove, onReject }) {
|
|
|
10669
10669
|
|
|
10670
10670
|
// src/components/Holidays/RequestLeave.tsx
|
|
10671
10671
|
var import_react31 = require("react");
|
|
10672
|
-
var import_date_fns = require("date-fns");
|
|
10673
10672
|
var import_lucide_react20 = require("lucide-react");
|
|
10674
10673
|
var import_navigation7 = require("next/navigation");
|
|
10675
10674
|
var import_sonner3 = require("sonner");
|
|
@@ -10714,14 +10713,16 @@ var bankHolidays = [
|
|
|
10714
10713
|
|
|
10715
10714
|
// src/utils/DaysUtil.ts
|
|
10716
10715
|
var isDayOff = (date) => {
|
|
10717
|
-
const isSunday = date.
|
|
10718
|
-
const isSaturday = date.
|
|
10719
|
-
const isBankHoliday = bankHolidays.some(
|
|
10716
|
+
const isSunday = date.getUTCDay() === 0;
|
|
10717
|
+
const isSaturday = date.getUTCDay() === 6;
|
|
10718
|
+
const isBankHoliday = bankHolidays.some(
|
|
10719
|
+
(h) => h.getFullYear() === date.getUTCFullYear() && h.getMonth() === date.getUTCMonth() && h.getDate() === date.getUTCDate()
|
|
10720
|
+
);
|
|
10720
10721
|
return isSunday || isSaturday || isBankHoliday;
|
|
10721
10722
|
};
|
|
10722
10723
|
var getTotalDaysBetween = (startDate, endDate, isHalfDay = false) => {
|
|
10723
|
-
|
|
10724
|
-
const end = new Date(endDate);
|
|
10724
|
+
let start = new Date(Date.UTC(startDate.getUTCFullYear(), startDate.getUTCMonth(), startDate.getUTCDate()));
|
|
10725
|
+
const end = new Date(Date.UTC(endDate.getUTCFullYear(), endDate.getUTCMonth(), endDate.getUTCDate()));
|
|
10725
10726
|
let count2 = 0;
|
|
10726
10727
|
if (isHalfDay && !isDayOff(start)) {
|
|
10727
10728
|
return 0.5;
|
|
@@ -10730,7 +10731,7 @@ var getTotalDaysBetween = (startDate, endDate, isHalfDay = false) => {
|
|
|
10730
10731
|
if (!isDayOff(start)) {
|
|
10731
10732
|
count2++;
|
|
10732
10733
|
}
|
|
10733
|
-
start
|
|
10734
|
+
start = new Date(start.getTime() + 24 * 60 * 60 * 1e3);
|
|
10734
10735
|
}
|
|
10735
10736
|
return count2;
|
|
10736
10737
|
};
|
|
@@ -10738,7 +10739,7 @@ var getIsMultipleDays = (startDate, endDate) => {
|
|
|
10738
10739
|
if (!startDate || !endDate) {
|
|
10739
10740
|
return false;
|
|
10740
10741
|
}
|
|
10741
|
-
const isMultipleDays = startDate.
|
|
10742
|
+
const isMultipleDays = startDate.getUTCFullYear() !== endDate.getUTCFullYear() || startDate.getUTCMonth() !== endDate.getUTCMonth() || startDate.getUTCDate() !== endDate.getUTCDate();
|
|
10742
10743
|
return isMultipleDays;
|
|
10743
10744
|
};
|
|
10744
10745
|
|
|
@@ -10759,11 +10760,26 @@ var ButtonGroup = ({ options, value, onChange, disabled = [] }) => {
|
|
|
10759
10760
|
)) });
|
|
10760
10761
|
};
|
|
10761
10762
|
function RequestLeave({ remainingDays, submitLeaveRequest }) {
|
|
10762
|
-
const
|
|
10763
|
-
|
|
10763
|
+
const setToMidnightUTC = (date) => {
|
|
10764
|
+
return new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate(), 0, 0, 0, 0));
|
|
10765
|
+
};
|
|
10766
|
+
const formatDateUTC = (date) => {
|
|
10767
|
+
const months = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
|
|
10768
|
+
const day = date.getUTCDate();
|
|
10769
|
+
const month = months[date.getUTCMonth()];
|
|
10770
|
+
const year = date.getUTCFullYear();
|
|
10771
|
+
const suffix = day === 1 || day === 21 || day === 31 ? "st" : day === 2 || day === 22 ? "nd" : day === 3 || day === 23 ? "rd" : "th";
|
|
10772
|
+
return `${month} ${day}${suffix}, ${year}`;
|
|
10773
|
+
};
|
|
10774
|
+
const [startDate, setStartDate] = (0, import_react31.useState)(void 0);
|
|
10775
|
+
const [endDate, setEndDate] = (0, import_react31.useState)(void 0);
|
|
10776
|
+
(0, import_react31.useEffect)(() => {
|
|
10777
|
+
if (startDate === void 0) setStartDate(setToMidnightUTC(/* @__PURE__ */ new Date()));
|
|
10778
|
+
if (endDate === void 0) setEndDate(setToMidnightUTC(/* @__PURE__ */ new Date()));
|
|
10779
|
+
}, []);
|
|
10764
10780
|
const [leaveType, setLeaveType] = (0, import_react31.useState)("Full Day");
|
|
10765
10781
|
const [isMultipleDays, setIsMultipleDays] = (0, import_react31.useState)(false);
|
|
10766
|
-
const [totalDays, setTotalDays] = (0, import_react31.useState)(
|
|
10782
|
+
const [totalDays, setTotalDays] = (0, import_react31.useState)(0);
|
|
10767
10783
|
const router = (0, import_navigation7.useRouter)();
|
|
10768
10784
|
(0, import_react31.useEffect)(() => {
|
|
10769
10785
|
const isMultipleDays2 = getIsMultipleDays(startDate, endDate);
|
|
@@ -10832,7 +10848,7 @@ function RequestLeave({ remainingDays, submitLeaveRequest }) {
|
|
|
10832
10848
|
),
|
|
10833
10849
|
children: [
|
|
10834
10850
|
/* @__PURE__ */ (0, import_jsx_runtime110.jsx)(import_lucide_react20.CalendarIcon, { className: "mr-2 h-4 w-4" }),
|
|
10835
|
-
startDate ? (
|
|
10851
|
+
startDate ? formatDateUTC(startDate) : /* @__PURE__ */ (0, import_jsx_runtime110.jsx)("span", { children: "Pick a date" })
|
|
10836
10852
|
]
|
|
10837
10853
|
}
|
|
10838
10854
|
) }),
|
|
@@ -10842,9 +10858,12 @@ function RequestLeave({ remainingDays, submitLeaveRequest }) {
|
|
|
10842
10858
|
mode: "single",
|
|
10843
10859
|
selected: startDate,
|
|
10844
10860
|
onSelect: (date) => {
|
|
10845
|
-
|
|
10846
|
-
|
|
10847
|
-
|
|
10861
|
+
if (date) {
|
|
10862
|
+
const dateMidnight = setToMidnightUTC(date);
|
|
10863
|
+
setStartDate(dateMidnight);
|
|
10864
|
+
if (!endDate || date > endDate) {
|
|
10865
|
+
setEndDate(dateMidnight);
|
|
10866
|
+
}
|
|
10848
10867
|
}
|
|
10849
10868
|
},
|
|
10850
10869
|
initialFocus: true
|
|
@@ -10865,7 +10884,7 @@ function RequestLeave({ remainingDays, submitLeaveRequest }) {
|
|
|
10865
10884
|
),
|
|
10866
10885
|
children: [
|
|
10867
10886
|
/* @__PURE__ */ (0, import_jsx_runtime110.jsx)(import_lucide_react20.CalendarIcon, { className: "mr-2 h-4 w-4" }),
|
|
10868
|
-
endDate ? (
|
|
10887
|
+
endDate ? formatDateUTC(endDate) : /* @__PURE__ */ (0, import_jsx_runtime110.jsx)("span", { children: "Pick a date" })
|
|
10869
10888
|
]
|
|
10870
10889
|
}
|
|
10871
10890
|
) }),
|
|
@@ -10874,7 +10893,11 @@ function RequestLeave({ remainingDays, submitLeaveRequest }) {
|
|
|
10874
10893
|
{
|
|
10875
10894
|
mode: "single",
|
|
10876
10895
|
selected: endDate,
|
|
10877
|
-
onSelect:
|
|
10896
|
+
onSelect: (date) => {
|
|
10897
|
+
if (date) {
|
|
10898
|
+
setEndDate(setToMidnightUTC(date));
|
|
10899
|
+
}
|
|
10900
|
+
},
|
|
10878
10901
|
disabled: (date) => startDate ? date < startDate : false,
|
|
10879
10902
|
initialFocus: true
|
|
10880
10903
|
}
|
|
@@ -11093,38 +11116,42 @@ function HolidayGrid({
|
|
|
11093
11116
|
var import_react32 = require("react");
|
|
11094
11117
|
var import_lucide_react22 = require("lucide-react");
|
|
11095
11118
|
var import_jsx_runtime112 = require("react/jsx-runtime");
|
|
11096
|
-
function CalendarView({ currentDate, setCurrentDate, holidays }) {
|
|
11119
|
+
function CalendarView({ currentDate, setCurrentDate, holidays, today }) {
|
|
11097
11120
|
const [selectedDay, setSelectedDay] = (0, import_react32.useState)(null);
|
|
11098
|
-
const
|
|
11121
|
+
const isSameUtcDay = (a, b) => a.getUTCFullYear() === b.getUTCFullYear() && a.getUTCMonth() === b.getUTCMonth() && a.getUTCDate() === b.getUTCDate();
|
|
11122
|
+
const firstDayOfMonth = (new Date(Date.UTC(currentDate.getUTCFullYear(), currentDate.getUTCMonth(), 1)).getUTCDay() + 6) % 7;
|
|
11099
11123
|
const days = Array.from({ length: 42 }, (_, i) => {
|
|
11100
11124
|
const day = new Date(
|
|
11101
|
-
|
|
11102
|
-
|
|
11103
|
-
|
|
11104
|
-
|
|
11125
|
+
Date.UTC(
|
|
11126
|
+
currentDate.getUTCFullYear(),
|
|
11127
|
+
currentDate.getUTCMonth(),
|
|
11128
|
+
i - firstDayOfMonth + 1
|
|
11129
|
+
)
|
|
11105
11130
|
);
|
|
11106
11131
|
const filteredHolidays = holidays.filter(
|
|
11107
11132
|
(h) => TimeUtil.toUtcMidnight(new Date(h.startDate)) <= day && TimeUtil.toUtcEndOfDay(new Date(h.endDate)) >= day
|
|
11108
11133
|
);
|
|
11109
11134
|
return {
|
|
11110
11135
|
date: day,
|
|
11111
|
-
isCurrentMonth: day.
|
|
11112
|
-
isToday: day
|
|
11136
|
+
isCurrentMonth: day.getUTCMonth() === currentDate.getUTCMonth(),
|
|
11137
|
+
isToday: isSameUtcDay(day, today),
|
|
11113
11138
|
holidays: filteredHolidays
|
|
11114
11139
|
};
|
|
11115
11140
|
});
|
|
11116
11141
|
const prevMonth = () => {
|
|
11117
|
-
setCurrentDate(new Date(currentDate.
|
|
11142
|
+
setCurrentDate(new Date(Date.UTC(currentDate.getUTCFullYear(), currentDate.getUTCMonth() - 1, 1)));
|
|
11118
11143
|
};
|
|
11119
11144
|
const nextMonth = () => {
|
|
11120
|
-
setCurrentDate(new Date(currentDate.
|
|
11145
|
+
setCurrentDate(new Date(Date.UTC(currentDate.getUTCFullYear(), currentDate.getUTCMonth() + 1, 1)));
|
|
11121
11146
|
};
|
|
11122
11147
|
const setToday = () => {
|
|
11123
|
-
setCurrentDate(/* @__PURE__ */ new Date());
|
|
11148
|
+
setCurrentDate(TimeUtil.toUtcMidnight(/* @__PURE__ */ new Date()));
|
|
11124
11149
|
};
|
|
11150
|
+
const months = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
|
|
11151
|
+
const monthYearDisplay = `${months[currentDate.getUTCMonth()]} ${currentDate.getUTCFullYear()}`;
|
|
11125
11152
|
return /* @__PURE__ */ (0, import_jsx_runtime112.jsxs)("div", { className: "lg:flex lg:h-full lg:flex-col", children: [
|
|
11126
11153
|
/* @__PURE__ */ (0, import_jsx_runtime112.jsxs)("header", { className: "flex items-center justify-between border-b border-gray-200 px-6 py-4 lg:flex-none", children: [
|
|
11127
|
-
/* @__PURE__ */ (0, import_jsx_runtime112.jsx)("h1", { className: "text-base font-semibold text-foreground", children: /* @__PURE__ */ (0, import_jsx_runtime112.jsx)("time", { dateTime: currentDate.toISOString(), children:
|
|
11154
|
+
/* @__PURE__ */ (0, import_jsx_runtime112.jsx)("h1", { className: "text-base font-semibold text-foreground", children: /* @__PURE__ */ (0, import_jsx_runtime112.jsx)("time", { dateTime: currentDate.toISOString(), children: monthYearDisplay }) }),
|
|
11128
11155
|
/* @__PURE__ */ (0, import_jsx_runtime112.jsx)("div", { className: "flex items-center", children: /* @__PURE__ */ (0, import_jsx_runtime112.jsxs)("div", { className: "relative flex items-center rounded-md gap-1 md:items-stretch", children: [
|
|
11129
11156
|
/* @__PURE__ */ (0, import_jsx_runtime112.jsxs)(
|
|
11130
11157
|
Button,
|
|
@@ -11211,7 +11238,7 @@ function CalendarView({ currentDate, setCurrentDate, holidays }) {
|
|
|
11211
11238
|
"flex h-6 w-6 items-center justify-center rounded-full",
|
|
11212
11239
|
day.isToday && "bg-indigo-600 font-semibold text-white"
|
|
11213
11240
|
),
|
|
11214
|
-
children: day.date.
|
|
11241
|
+
children: day.date.getUTCDate()
|
|
11215
11242
|
}
|
|
11216
11243
|
),
|
|
11217
11244
|
day.holidays.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime112.jsx)("ol", { className: "mt-2 space-y-1 overflow-visible", children: day.holidays.map((holiday) => /* @__PURE__ */ (0, import_jsx_runtime112.jsx)("li", { className: "overflow-visible", children: /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(
|
|
@@ -11248,7 +11275,7 @@ function CalendarView({ currentDate, setCurrentDate, holidays }) {
|
|
|
11248
11275
|
day.date === selectedDay && day.isToday && "flex h-6 w-6 items-center justify-center rounded-full bg-indigo-600",
|
|
11249
11276
|
day.date === selectedDay && !day.isToday && "flex h-6 w-6 items-center justify-center rounded-full bg-gray-900"
|
|
11250
11277
|
),
|
|
11251
|
-
children: day.date.
|
|
11278
|
+
children: day.date.getUTCDate()
|
|
11252
11279
|
}
|
|
11253
11280
|
),
|
|
11254
11281
|
/* @__PURE__ */ (0, import_jsx_runtime112.jsxs)("span", { className: "sr-only", children: [
|
|
@@ -11276,7 +11303,7 @@ var import_react33 = require("react");
|
|
|
11276
11303
|
var import_lucide_react23 = require("lucide-react");
|
|
11277
11304
|
var import_lucide_react24 = require("lucide-react");
|
|
11278
11305
|
var import_navigation8 = require("next/navigation");
|
|
11279
|
-
var
|
|
11306
|
+
var import_date_fns = require("date-fns");
|
|
11280
11307
|
var import_jsx_runtime113 = require("react/jsx-runtime");
|
|
11281
11308
|
function classNames2(...classes) {
|
|
11282
11309
|
return classes.filter(Boolean).join(" ");
|
|
@@ -11285,6 +11312,7 @@ function HolidayTracker({
|
|
|
11285
11312
|
holidays,
|
|
11286
11313
|
currentUser,
|
|
11287
11314
|
currentDate,
|
|
11315
|
+
today,
|
|
11288
11316
|
leaveApprovals,
|
|
11289
11317
|
employees,
|
|
11290
11318
|
submitLeaveRequest,
|
|
@@ -11294,9 +11322,10 @@ function HolidayTracker({
|
|
|
11294
11322
|
const [currentTab, setCurrentTab] = (0, import_react33.useState)("Calendar View");
|
|
11295
11323
|
const router = (0, import_navigation8.useRouter)();
|
|
11296
11324
|
const isLoading = false;
|
|
11297
|
-
const parsedCurrentDate = TimeUtil.toUtcMidnight((0,
|
|
11325
|
+
const parsedCurrentDate = TimeUtil.toUtcMidnight((0, import_date_fns.parseISO)(currentDate));
|
|
11326
|
+
const parsedToday = TimeUtil.toUtcMidnight((0, import_date_fns.parseISO)(today));
|
|
11298
11327
|
const setCurrentDate = async (date) => {
|
|
11299
|
-
const formattedDate = (0,
|
|
11328
|
+
const formattedDate = (0, import_date_fns.format)(date, "dd-MM-yyyy");
|
|
11300
11329
|
const url = new URL(window.location.href);
|
|
11301
11330
|
url.searchParams.set("date", formattedDate);
|
|
11302
11331
|
router.push(url.toString());
|
|
@@ -11376,7 +11405,8 @@ function HolidayTracker({
|
|
|
11376
11405
|
{
|
|
11377
11406
|
currentDate: parsedCurrentDate,
|
|
11378
11407
|
setCurrentDate,
|
|
11379
|
-
holidays
|
|
11408
|
+
holidays,
|
|
11409
|
+
today: parsedToday
|
|
11380
11410
|
}
|
|
11381
11411
|
),
|
|
11382
11412
|
currentTab === "Request Leave" && /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
|
|
@@ -12295,7 +12325,7 @@ function CRMCogeBoard({
|
|
|
12295
12325
|
|
|
12296
12326
|
// src/components/Chat/Components/ChatCardTask.tsx
|
|
12297
12327
|
var import_lucide_react28 = require("lucide-react");
|
|
12298
|
-
var
|
|
12328
|
+
var import_date_fns2 = require("date-fns");
|
|
12299
12329
|
|
|
12300
12330
|
// src/components/Chat/hooks/useTask.ts
|
|
12301
12331
|
var import_react39 = require("react");
|
|
@@ -12402,7 +12432,7 @@ function ChatCardTask({
|
|
|
12402
12432
|
try {
|
|
12403
12433
|
const date = new Date(taskData?.dateLogged || "");
|
|
12404
12434
|
if (!isNaN(date.getTime())) {
|
|
12405
|
-
formattedDate = (0,
|
|
12435
|
+
formattedDate = (0, import_date_fns2.formatDistanceToNow)(date, { addSuffix: true });
|
|
12406
12436
|
}
|
|
12407
12437
|
} catch (e) {
|
|
12408
12438
|
}
|
|
@@ -12902,7 +12932,7 @@ function getAllCapabilities() {
|
|
|
12902
12932
|
|
|
12903
12933
|
// src/components/Chat/Components/ChatCardArtefact.tsx
|
|
12904
12934
|
var import_lucide_react29 = require("lucide-react");
|
|
12905
|
-
var
|
|
12935
|
+
var import_date_fns3 = require("date-fns");
|
|
12906
12936
|
var import_jsx_runtime122 = require("react/jsx-runtime");
|
|
12907
12937
|
function ChatCardArtefact({
|
|
12908
12938
|
artefact,
|
|
@@ -12923,7 +12953,7 @@ function ChatCardArtefact({
|
|
|
12923
12953
|
try {
|
|
12924
12954
|
const date = new Date(taskData.dateLogged);
|
|
12925
12955
|
if (!isNaN(date.getTime())) {
|
|
12926
|
-
formattedDate = (0,
|
|
12956
|
+
formattedDate = (0, import_date_fns3.formatDistanceToNow)(date, { addSuffix: true });
|
|
12927
12957
|
}
|
|
12928
12958
|
} catch (e) {
|
|
12929
12959
|
}
|
|
@@ -20480,8 +20510,8 @@ function ToolbarPlugin() {
|
|
|
20480
20510
|
blockNode = curr;
|
|
20481
20511
|
}
|
|
20482
20512
|
if (blockNode) {
|
|
20483
|
-
const
|
|
20484
|
-
setAlignment(
|
|
20513
|
+
const format3 = blockNode.getFormatType();
|
|
20514
|
+
setAlignment(format3 || "left");
|
|
20485
20515
|
}
|
|
20486
20516
|
const tag = anchorNode.getTopLevelElement()?.__tag;
|
|
20487
20517
|
setBlockType(tag || "p");
|
|
@@ -21410,7 +21440,7 @@ var markdownToLexical = (markdown) => {
|
|
|
21410
21440
|
var convertFileTypeToKnowledgeDocument = async (file) => {
|
|
21411
21441
|
let content = "";
|
|
21412
21442
|
let richTextContent = void 0;
|
|
21413
|
-
let
|
|
21443
|
+
let format3 = "text";
|
|
21414
21444
|
if (file.url) {
|
|
21415
21445
|
try {
|
|
21416
21446
|
let url = file.url;
|
|
@@ -21431,18 +21461,18 @@ var convertFileTypeToKnowledgeDocument = async (file) => {
|
|
|
21431
21461
|
console.warn("No URL provided for file:", file.name);
|
|
21432
21462
|
}
|
|
21433
21463
|
if (file.mimeType === "text/markdown") {
|
|
21434
|
-
|
|
21464
|
+
format3 = "richText";
|
|
21435
21465
|
richTextContent = markdownToLexical(content);
|
|
21436
21466
|
} else if (file.mimeType?.startsWith("text/")) {
|
|
21437
|
-
|
|
21467
|
+
format3 = "text";
|
|
21438
21468
|
}
|
|
21439
21469
|
return {
|
|
21440
21470
|
id: file.id.toString(),
|
|
21441
21471
|
title: file.name,
|
|
21442
21472
|
description: void 0,
|
|
21443
|
-
content:
|
|
21444
|
-
richTextContent:
|
|
21445
|
-
format:
|
|
21473
|
+
content: format3 === "richText" ? void 0 : content,
|
|
21474
|
+
richTextContent: format3 === "richText" ? richTextContent : void 0,
|
|
21475
|
+
format: format3,
|
|
21446
21476
|
metadata: {},
|
|
21447
21477
|
createdAt: typeof file.createdAt === "string" ? new Date(file.createdAt) : file.createdAt,
|
|
21448
21478
|
updatedAt: /* @__PURE__ */ new Date()
|
|
@@ -21492,8 +21522,8 @@ function FileEdit({ document: document2, onCancel, onSave, onFileUpdate }) {
|
|
|
21492
21522
|
setRichTextContent(document2.richTextContent);
|
|
21493
21523
|
}
|
|
21494
21524
|
}, [document2]);
|
|
21495
|
-
const formatIcon = (
|
|
21496
|
-
switch (
|
|
21525
|
+
const formatIcon = (format3) => {
|
|
21526
|
+
switch (format3) {
|
|
21497
21527
|
case "markdown":
|
|
21498
21528
|
case "mdx":
|
|
21499
21529
|
return /* @__PURE__ */ (0, import_jsx_runtime186.jsx)(import_lucide_react68.FileText, { className: "h-6 w-6 text-primary" });
|
|
@@ -21505,8 +21535,8 @@ function FileEdit({ document: document2, onCancel, onSave, onFileUpdate }) {
|
|
|
21505
21535
|
return /* @__PURE__ */ (0, import_jsx_runtime186.jsx)(import_lucide_react68.File, { className: "h-6 w-6 text-muted-foreground" });
|
|
21506
21536
|
}
|
|
21507
21537
|
};
|
|
21508
|
-
const formatBadgeColor = (
|
|
21509
|
-
switch (
|
|
21538
|
+
const formatBadgeColor = (format3) => {
|
|
21539
|
+
switch (format3) {
|
|
21510
21540
|
case "markdown":
|
|
21511
21541
|
return "bg-primary/10 text-primary border-primary/20";
|
|
21512
21542
|
case "mdx":
|
|
@@ -23750,8 +23780,8 @@ function DocumentEdit({
|
|
|
23750
23780
|
(0, import_react95.useEffect)(() => {
|
|
23751
23781
|
setEditedDocument(document2);
|
|
23752
23782
|
}, [document2]);
|
|
23753
|
-
const formatIcon = (
|
|
23754
|
-
switch (
|
|
23783
|
+
const formatIcon = (format3) => {
|
|
23784
|
+
switch (format3) {
|
|
23755
23785
|
case "markdown":
|
|
23756
23786
|
case "mdx":
|
|
23757
23787
|
return /* @__PURE__ */ (0, import_jsx_runtime193.jsx)(import_lucide_react76.FileText, { className: "h-6 w-6 text-primary" });
|
|
@@ -23763,8 +23793,8 @@ function DocumentEdit({
|
|
|
23763
23793
|
return /* @__PURE__ */ (0, import_jsx_runtime193.jsx)(import_lucide_react76.File, { className: "h-6 w-6 text-muted-foreground" });
|
|
23764
23794
|
}
|
|
23765
23795
|
};
|
|
23766
|
-
const formatBadgeColor = (
|
|
23767
|
-
switch (
|
|
23796
|
+
const formatBadgeColor = (format3) => {
|
|
23797
|
+
switch (format3) {
|
|
23768
23798
|
case "markdown":
|
|
23769
23799
|
return "bg-primary/10 text-primary border-primary/20";
|
|
23770
23800
|
case "mdx":
|
|
@@ -24088,8 +24118,8 @@ function DocumentPreview({
|
|
|
24088
24118
|
(0, import_react97.useEffect)(() => {
|
|
24089
24119
|
setDocument(initialDocument);
|
|
24090
24120
|
}, [initialDocument]);
|
|
24091
|
-
const formatIcon = (
|
|
24092
|
-
switch (
|
|
24121
|
+
const formatIcon = (format3) => {
|
|
24122
|
+
switch (format3) {
|
|
24093
24123
|
case "markdown":
|
|
24094
24124
|
case "mdx":
|
|
24095
24125
|
return /* @__PURE__ */ (0, import_jsx_runtime194.jsx)(import_lucide_react77.FileText, { className: "h-6 w-6 text-primary" });
|
|
@@ -24101,8 +24131,8 @@ function DocumentPreview({
|
|
|
24101
24131
|
return /* @__PURE__ */ (0, import_jsx_runtime194.jsx)(import_lucide_react77.File, { className: "h-6 w-6 text-muted-foreground" });
|
|
24102
24132
|
}
|
|
24103
24133
|
};
|
|
24104
|
-
const formatBadgeColor = (
|
|
24105
|
-
switch (
|
|
24134
|
+
const formatBadgeColor = (format3) => {
|
|
24135
|
+
switch (format3) {
|
|
24106
24136
|
case "markdown":
|
|
24107
24137
|
return "bg-primary/10 text-primary border-primary/20";
|
|
24108
24138
|
case "mdx":
|
|
@@ -24115,15 +24145,15 @@ function DocumentPreview({
|
|
|
24115
24145
|
return "bg-muted text-muted-foreground border-border";
|
|
24116
24146
|
}
|
|
24117
24147
|
};
|
|
24118
|
-
const renderContent = (content,
|
|
24148
|
+
const renderContent = (content, format3) => {
|
|
24119
24149
|
const defaultRenderers = {
|
|
24120
24150
|
markdown: defaultMarkdownRenderer,
|
|
24121
24151
|
mdx: defaultMDXRenderer,
|
|
24122
24152
|
// richText: defaultRichTextRenderer,
|
|
24123
24153
|
text: defaultTextRenderer
|
|
24124
24154
|
};
|
|
24125
|
-
const renderer = renderers?.[
|
|
24126
|
-
if (
|
|
24155
|
+
const renderer = renderers?.[format3] || defaultRenderers[format3];
|
|
24156
|
+
if (format3 === "richText" && typeof content === "object") {
|
|
24127
24157
|
return defaultRichTextRenderer(content);
|
|
24128
24158
|
}
|
|
24129
24159
|
if (renderer) {
|
|
@@ -24290,8 +24320,8 @@ function MenuItem({
|
|
|
24290
24320
|
const [isExpanded, setIsExpanded] = (0, import_react99.useState)(level === 0);
|
|
24291
24321
|
const hasChildren = children && Object.keys(children).length > 0;
|
|
24292
24322
|
const totalDocuments = documents.length + (children ? Object.values(children).reduce((acc, child) => acc + child.documents.length, 0) : 0);
|
|
24293
|
-
const formatDocumentIcon = (
|
|
24294
|
-
switch (
|
|
24323
|
+
const formatDocumentIcon = (format3) => {
|
|
24324
|
+
switch (format3) {
|
|
24295
24325
|
case "markdown":
|
|
24296
24326
|
case "mdx":
|
|
24297
24327
|
return /* @__PURE__ */ (0, import_jsx_runtime195.jsx)(import_lucide_react78.FileText, { className: "h-3.5 w-3.5 text-muted-foreground" });
|
|
@@ -27758,7 +27788,7 @@ var import_lucide_react91 = require("lucide-react");
|
|
|
27758
27788
|
// src/components/Projects/AddSprintModal.tsx
|
|
27759
27789
|
var import_react115 = require("react");
|
|
27760
27790
|
var import_lucide_react90 = require("lucide-react");
|
|
27761
|
-
var
|
|
27791
|
+
var import_date_fns4 = require("date-fns");
|
|
27762
27792
|
var import_jsx_runtime212 = require("react/jsx-runtime");
|
|
27763
27793
|
var AddSprintModal = ({ isOpen, onClose, onAddSprint }) => {
|
|
27764
27794
|
const [formData, setFormData] = (0, import_react115.useState)({
|
|
@@ -27845,7 +27875,7 @@ var AddSprintModal = ({ isOpen, onClose, onAddSprint }) => {
|
|
|
27845
27875
|
),
|
|
27846
27876
|
children: [
|
|
27847
27877
|
/* @__PURE__ */ (0, import_jsx_runtime212.jsx)(import_lucide_react90.CalendarIcon, { className: "mr-2 h-4 w-4" }),
|
|
27848
|
-
formData.startDate ? (0,
|
|
27878
|
+
formData.startDate ? (0, import_date_fns4.format)(formData.startDate, "PPP") : "Pick a date"
|
|
27849
27879
|
]
|
|
27850
27880
|
}
|
|
27851
27881
|
) }),
|
|
@@ -27873,7 +27903,7 @@ var AddSprintModal = ({ isOpen, onClose, onAddSprint }) => {
|
|
|
27873
27903
|
),
|
|
27874
27904
|
children: [
|
|
27875
27905
|
/* @__PURE__ */ (0, import_jsx_runtime212.jsx)(import_lucide_react90.CalendarIcon, { className: "mr-2 h-4 w-4" }),
|
|
27876
|
-
formData.endDate ? (0,
|
|
27906
|
+
formData.endDate ? (0, import_date_fns4.format)(formData.endDate, "PPP") : "Pick a date"
|
|
27877
27907
|
]
|
|
27878
27908
|
}
|
|
27879
27909
|
) }),
|