Compare commits
2 Commits
copilot/su
...
dependabot
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4c6c60362a | ||
| f8c2788d86 |
68
package.json
68
package.json
@@ -29,16 +29,16 @@
|
||||
"prepare": "husky"
|
||||
},
|
||||
"dependencies": {
|
||||
"@date-fns/tz": "^1.2.0",
|
||||
"@date-fns/tz": "^1.4.1",
|
||||
"@dnd-kit/core": "^6.3.1",
|
||||
"@dnd-kit/modifiers": "^9.0.0",
|
||||
"@dnd-kit/sortable": "^10.0.0",
|
||||
"@dnd-kit/utilities": "^3.2.2",
|
||||
"@headlessui/react": "^2.2.0",
|
||||
"@headlessui/react": "^2.2.9",
|
||||
"@octokit/rest": "^21.1.1",
|
||||
"@phosphor-icons/react": "^2.1.7",
|
||||
"@phosphor-icons/react": "^2.1.10",
|
||||
"@sentry/react": "^8.55.0",
|
||||
"@tanstack/react-query": "^5.69.0",
|
||||
"@tanstack/react-query": "^5.90.21",
|
||||
"@tsparticles/engine": "^3.9.1",
|
||||
"@tsparticles/react": "^3.0.0",
|
||||
"@tsparticles/slim": "^3.9.1",
|
||||
@@ -48,20 +48,20 @@
|
||||
"conventional-changelog": "^6.0.0",
|
||||
"date-fns": "^4.1.0",
|
||||
"highcharts": "^11.4.8",
|
||||
"highcharts-react-official": "^3.2.1",
|
||||
"highcharts-react-official": "^3.2.3",
|
||||
"html-to-image": "^1.11.13",
|
||||
"husky": "^9.1.7",
|
||||
"kc-dabr-wasm": "^0.1.2",
|
||||
"nanoid": "^5.1.2",
|
||||
"nanoid": "^5.1.6",
|
||||
"react": "^18.3.1",
|
||||
"react-dom": "^18.3.1",
|
||||
"react-loading-skeleton": "^3.5.0",
|
||||
"react-markdown": "^9.1.0",
|
||||
"react-syntax-highlighter": "^15.6.1",
|
||||
"remark-gfm": "^4.0.1",
|
||||
"sass": "^1.85.1",
|
||||
"simple-git": "^3.27.0",
|
||||
"sql.js": "1.11.0"
|
||||
"sass": "^1.97.3",
|
||||
"simple-git": "^3.31.1",
|
||||
"sql.js": "1.14.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@chromatic-com/storybook": "^2.0.2",
|
||||
@@ -69,24 +69,24 @@
|
||||
"@commitlint/config-conventional": "^19.7.1",
|
||||
"@commitlint/types": "^19.5.0",
|
||||
"@crxjs/vite-plugin": "2.0.0-beta.21",
|
||||
"@iconify-json/bi": "^1.2.2",
|
||||
"@iconify-json/ic": "^1.2.2",
|
||||
"@iconify-json/iconoir": "^1.2.7",
|
||||
"@iconify-json/material-symbols": "^1.2.14",
|
||||
"@iconify-json/ri": "^1.2.5",
|
||||
"@iconify-json/streamline": "^1.2.2",
|
||||
"@iconify-json/bi": "^1.2.7",
|
||||
"@iconify-json/ic": "^1.2.4",
|
||||
"@iconify-json/iconoir": "^1.2.10",
|
||||
"@iconify-json/material-symbols": "^1.2.55",
|
||||
"@iconify-json/ri": "^1.2.10",
|
||||
"@iconify-json/streamline": "^1.2.5",
|
||||
"@semantic-release/exec": "^6.0.3",
|
||||
"@sentry/types": "^8.55.0",
|
||||
"@storybook/addon-designs": "^8.2.0",
|
||||
"@storybook/addon-essentials": "^8.6.0",
|
||||
"@storybook/addon-essentials": "^8.6.14",
|
||||
"@storybook/addon-links": "^8.6.0",
|
||||
"@storybook/blocks": "^8.6.0",
|
||||
"@storybook/blocks": "^8.6.14",
|
||||
"@storybook/react": "^8.6.0",
|
||||
"@storybook/react-vite": "^8.6.0",
|
||||
"@storybook/test": "^8.6.0",
|
||||
"@storybook/test": "^8.6.15",
|
||||
"@svgr/core": "^8.1.0",
|
||||
"@svgr/plugin-jsx": "^8.1.0",
|
||||
"@types/chrome": "^0.0.273",
|
||||
"@types/chrome": "^0.1.36",
|
||||
"@types/conventional-changelog": "^3.1.5",
|
||||
"@types/gulp": "^4.0.17",
|
||||
"@types/gulp-zip": "^4.0.4",
|
||||
@@ -96,7 +96,7 @@
|
||||
"@types/react-dom": "^18.3.5",
|
||||
"@types/react-syntax-highlighter": "^15.5.13",
|
||||
"@types/semantic-release": "^20.0.6",
|
||||
"@types/semver": "^7.5.8",
|
||||
"@types/semver": "^7.7.1",
|
||||
"@types/sql.js": "^1.4.9",
|
||||
"@typescript-eslint/eslint-plugin": "^7.18.0",
|
||||
"@typescript-eslint/parser": "^7.18.0",
|
||||
@@ -110,10 +110,10 @@
|
||||
"@vitejs/plugin-react-swc": "^3.8.0",
|
||||
"@vitest/coverage-v8": "^2.1.9",
|
||||
"@vitest/ui": "^2.1.9",
|
||||
"chalk": "^5.4.1",
|
||||
"chalk": "^5.6.2",
|
||||
"chromatic": "^11.26.0",
|
||||
"cssnano": "^7.0.6",
|
||||
"cssnano-preset-advanced": "^7.0.6",
|
||||
"cssnano": "^7.1.2",
|
||||
"cssnano-preset-advanced": "^7.0.10",
|
||||
"dotenv": "^16.4.7",
|
||||
"es-module-lexer": "^1.6.0",
|
||||
"eslint": "^8.57.1",
|
||||
@@ -122,28 +122,28 @@
|
||||
"eslint-config-airbnb-typescript": "^18.0.0",
|
||||
"eslint-config-prettier": "^9.1.0",
|
||||
"eslint-import-resolver-typescript": "^3.8.3",
|
||||
"eslint-plugin-import": "^2.31.0",
|
||||
"eslint-plugin-import": "^2.32.0",
|
||||
"eslint-plugin-import-essentials": "^0.2.1",
|
||||
"eslint-plugin-jsdoc": "^50.6.3",
|
||||
"eslint-plugin-prettier": "^5.2.3",
|
||||
"eslint-plugin-react": "^7.37.4",
|
||||
"eslint-plugin-prettier": "^5.5.5",
|
||||
"eslint-plugin-react": "^7.37.5",
|
||||
"eslint-plugin-react-hooks": "^4.6.2",
|
||||
"eslint-plugin-react-prefer-function-component": "^3.4.0",
|
||||
"eslint-plugin-react-refresh": "^0.4.19",
|
||||
"eslint-plugin-react-refresh": "^0.5.0",
|
||||
"eslint-plugin-simple-import-sort": "^12.1.1",
|
||||
"eslint-plugin-storybook": "^0.9.0",
|
||||
"eslint-plugin-tsdoc": "^0.3.0",
|
||||
"gulp": "^5.0.0",
|
||||
"eslint-plugin-tsdoc": "^0.5.0",
|
||||
"gulp": "^5.0.1",
|
||||
"gulp-execa": "^7.0.1",
|
||||
"gulp-zip": "^6.1.0",
|
||||
"jsdom": "^28.0.0",
|
||||
"jsdom": "^28.1.0",
|
||||
"path": "^0.12.7",
|
||||
"postcss": "^8.5.3",
|
||||
"prettier": "3.6.2",
|
||||
"postcss": "^8.5.6",
|
||||
"prettier": "3.8.1",
|
||||
"react-dev-utils": "^12.0.1",
|
||||
"semantic-release": "^24.2.3",
|
||||
"storybook": "^8.6.15",
|
||||
"typescript": "^5.7.3",
|
||||
"storybook": "^8.6.0",
|
||||
"typescript": "^5.9.3",
|
||||
"unocss": "^0.63.6",
|
||||
"unocss-preset-primitives": "0.0.2-beta.1",
|
||||
"unplugin-icons": "^0.19.3",
|
||||
|
||||
3170
pnpm-lock.yaml
generated
3170
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@@ -77,7 +77,7 @@ type CourseWithId = { course: Course } & BaseItem;
|
||||
|
||||
const meta = {
|
||||
title: 'Components/Common/SortableList',
|
||||
component: SortableList<CourseWithId>,
|
||||
component: SortableList,
|
||||
parameters: {
|
||||
layout: 'centered',
|
||||
},
|
||||
@@ -85,7 +85,7 @@ const meta = {
|
||||
} satisfies Meta<typeof SortableList<CourseWithId>>;
|
||||
export default meta;
|
||||
|
||||
type Story = StoryObj<typeof meta>;
|
||||
type Story = StoryObj<Meta<typeof SortableList<CourseWithId>>>;
|
||||
|
||||
export const Default: Story = {
|
||||
args: {
|
||||
@@ -94,9 +94,7 @@ export const Default: Story = {
|
||||
course,
|
||||
})),
|
||||
onChange: () => {},
|
||||
renderItem: (item: CourseWithId) => (
|
||||
<PopupCourseBlock key={item.id} course={item.course} colors={item.course.colors} />
|
||||
),
|
||||
renderItem: ({ id, course }) => <PopupCourseBlock key={id} course={course} colors={course.colors} />,
|
||||
},
|
||||
render: args => (
|
||||
<div className='h-3xl w-3xl transform-none'>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Menu, MenuButton, MenuItem, MenuItems } from '@headlessui/react';
|
||||
import { CalendarDots, Export, FileCode, FilePng, Sidebar } from '@phosphor-icons/react';
|
||||
import { CalendarDots, Export, FileCode, FilePng, FileText, Sidebar } from '@phosphor-icons/react';
|
||||
import styles from '@views/components/calendar/CalendarHeader/CalendarHeader.module.scss';
|
||||
import { Button } from '@views/components/common/Button';
|
||||
import DialogProvider from '@views/components/common/DialogProvider/DialogProvider';
|
||||
@@ -11,7 +11,7 @@ import useSchedules from '@views/hooks/useSchedules';
|
||||
import clsx from 'clsx';
|
||||
import React from 'react';
|
||||
|
||||
import { handleExportJson, saveAsCal, saveCalAsPng } from '../utils';
|
||||
import { handleExportJson, saveAsCal, saveAsText, saveCalAsPng } from '../utils';
|
||||
|
||||
interface CalendarHeaderProps {
|
||||
sidebarOpen?: boolean;
|
||||
@@ -111,6 +111,18 @@ export default function CalendarHeader({ sidebarOpen, onSidebarToggle }: Calenda
|
||||
Save as .json
|
||||
</Button>
|
||||
</MenuItem>
|
||||
<MenuItem>
|
||||
<Button
|
||||
className='w-full flex justify-start'
|
||||
onClick={saveAsText}
|
||||
color='ut-black'
|
||||
size='small'
|
||||
variant='minimal'
|
||||
icon={FileText}
|
||||
>
|
||||
Save as .txt
|
||||
</Button>
|
||||
</MenuItem>
|
||||
{/* <MenuItem>
|
||||
<Button color='ut-black' size='small' variant='minimal' icon={FileTxt}>
|
||||
Export Unique IDs
|
||||
|
||||
@@ -245,6 +245,27 @@ export const scheduleToIcsString = (schedule: Serialized<UserSchedule>) => {
|
||||
return icsString;
|
||||
};
|
||||
|
||||
/**
|
||||
* Returns the provided schedule in a human readable/copyable text format
|
||||
* @param schedule - The schedule object
|
||||
* @returns
|
||||
*/
|
||||
export const scheduleToText = (schedule: Serialized<UserSchedule>) => {
|
||||
const lines: string[] = [];
|
||||
|
||||
lines.push(`Schedule: ${schedule.name}`);
|
||||
lines.push('');
|
||||
|
||||
for (const c of schedule.courses) {
|
||||
lines.push(c.fullName);
|
||||
lines.push(`${c.creditHours} Credit Hours`);
|
||||
lines.push(`${c.uniqueId}`);
|
||||
lines.push('');
|
||||
}
|
||||
|
||||
return lines.join('\n');
|
||||
};
|
||||
|
||||
/**
|
||||
* Saves the current schedule as a calendar file in the iCalendar format (ICS).
|
||||
* Fetches the current active schedule and converts it into an ICS string.
|
||||
@@ -262,6 +283,25 @@ export const saveAsCal = async () => {
|
||||
downloadBlob(icsString, 'CALENDAR', 'schedule.ics');
|
||||
};
|
||||
|
||||
/**
|
||||
* Save current schedule as a plain text file consisting of
|
||||
* Course Name - Course ID
|
||||
* Course Time
|
||||
* Unique Number
|
||||
* Line Break
|
||||
* Repeat
|
||||
*/
|
||||
export const saveAsText = async () => {
|
||||
const schedule = await getSchedule();
|
||||
|
||||
if (!schedule) {
|
||||
throw new Error('No schedule found');
|
||||
}
|
||||
|
||||
const scheduleText = scheduleToText(schedule);
|
||||
downloadBlob(scheduleText, 'TEXT', 'schedule.txt');
|
||||
};
|
||||
|
||||
/**
|
||||
* Saves current schedule to JSON that can be imported on other devices.
|
||||
* @param id - Provided schedule ID to download
|
||||
|
||||
Reference in New Issue
Block a user