Skip to content

Commit

Permalink
Rebuilt library to use react functions and support offline calendars
Browse files Browse the repository at this point in the history
  • Loading branch information
theLAZYmd authored and theLAZYmd committed Apr 1, 2021
1 parent 00f82a3 commit 35e2176
Show file tree
Hide file tree
Showing 54 changed files with 19,461 additions and 961 deletions.
66 changes: 66 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
{
"env": {
"browser": false,
"es6": true,
"node": true
},
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:react/recommended"
],
"globals": {
"Atomics": "readonly",
"SharedArrayBuffer": "readonly"
},
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaFeatures": {
"jsx": true
},
"ecmaVersion": 2018,
"sourceType": "module"
},
"plugins": [
"react",
"@typescript-eslint"
],
"rules": {
"linebreak-style": [
"warn",
"unix"
],
"no-control-regex": "off",
"no-throw-literal": "off",
"react/react-in-jsx-scope": "off",
"react/no-unescaped-entities": "off",
"no-unused-vars": "off",
"prefer-const": "off",
"react/no-string-refs": "off",
"react/prop-types": "off",
"quotes": [
"warn",
"single"
],
"semi": [
"warn",
"always"
]
},
"settings": {
"propWrapperFunctions": [
// The names of any function used to wrap propTypes, e.g. `forbidExtraProps`. If this isn't set, any propTypes wrapped in a function will be skipped.
"forbidExtraProps"
],
"react": {
"createClass": "createReactClass", // Regex for Component Factory to use,
// default to "createReactClass"
"pragma": "React", // Pragma to use, default to "React"
"version": "detect", // React version. "detect" automatically picks the version you have installed.
// You can also use `16.0`, `16.3`, etc, if you want to override the detected value.
// default to latest and warns if missing
// It will default to "detect" in the future
"flowVersion": "0.53" // Flow version
}
}
}
40 changes: 20 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ The settings config should be of the following format:
{

// Register for an API key
"APIkey": "",
"APIkey": "",

/**
* Calendar IDs should be an object of key-value pairs.
Expand All @@ -72,42 +72,42 @@ The settings config should be of the following format:
* Make your calendar publically visible in Access Permissions
* The value fields of this object should be html colours
*/
"calendarIDs": {
[calendarID: string]: [colour: string]
"calendarIDs": {
[calendarID: string]: [colour: string]

// If you want your locations to be rendered as a link to a map. Leave blank for none. Use Google Maps (below) as default
},
"mapsLink": "https://www.google.com/maps/search/",
},
"mapsLink": "https://www.google.com/maps/search/",

/**
* The renderer takes the first line of a location
* in the Google Calendar entry and renders it
* Use this to 'adjust' any locations
*/
"locationReplacers": {
"Christ Church Cathedral": "Christ Church"
},
"locationReplacers": {
"Christ Church Cathedral": "Christ Church"
},

// When should the calendar start date be? (a Sunday)
"start": "6 October 2019",
"start": "6 October 2019",

// When should the calendar finish date be?
"finish": "8 December 2019",
"finish": "8 December 2019",

// What should the calendar title be?
"title": "MT'19",
"title": "MT'19",

// How should the days of the week be displayed on the top row?
// (Must start with a Sunday)
"days": [
"SUN",
"MON",
"TUES",
"WED",
"THURS",
"FRI",
"SAT"
]
"days": [
"SUN",
"MON",
"TUES",
"WED",
"THURS",
"FRI",
"SAT"
]
}
```

Expand Down
27 changes: 27 additions & 0 deletions lib/Event.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { GoogleEvent, GoogleLocation } from './interfaces';
export declare class CalendarEvent {
link: string;
title: string;
status: string;
start: Date;
created: Date;
end: Date;
calendarName: string;
color: string;
rawLocation: GoogleLocation | string;
locationReplacers: {
[key: string]: string;
};
rawDescription: string;
map: string;
constructor(event: GoogleEvent, calendarName: string, color: string, { locationReplacers, mapsLink }: {
locationReplacers: {
[key: string]: string;
};
mapsLink: string;
});
get location(): string;
get facebookEvent(): string;
get description(): string;
}
//# sourceMappingURL=Event.d.ts.map
1 change: 1 addition & 0 deletions lib/Event.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 23 additions & 0 deletions lib/Frame.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { CalendarEvent } from './Event';
export interface CalendarFrameProps {
events: {
[timestamp: number]: CalendarEvent[];
};
colorStatuses?: {
[color: string]: boolean;
};
start: Date;
title?: string;
weeks?: number;
dayLabels?: string[];
noHighlightToday?: boolean;
classNames?: {
table?: string;
firstColumn?: string;
cell?: string;
event?: string;
};
startIndex?: number | string;
}
export declare function CalendarFrame(props: CalendarFrameProps): JSX.Element;
//# sourceMappingURL=Frame.d.ts.map
1 change: 1 addition & 0 deletions lib/Frame.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

83 changes: 83 additions & 0 deletions lib/Frame.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions lib/Frame.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions lib/Key.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
export interface CalendarKeyProps {
classNames?: {
[key: string]: string;
};
colorNames: {
[color: string]: string;
};
updateColorStatuses: (color: string) => void;
colorStatuses: {
[color: string]: boolean;
};
}
export declare function CalendarKey(props: CalendarKeyProps): JSX.Element;
//# sourceMappingURL=Key.d.ts.map
1 change: 1 addition & 0 deletions lib/Key.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 29 additions & 0 deletions lib/Key.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions lib/Key.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions lib/contexts.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import React, { Context } from 'react';
import { ReactNode } from 'react';
import { CalendarSettings } from './interfaces';
declare type ContextValue<T> = [Context<T>, T];
export default function Contexts({ values, children }: {
values: ContextValue<any>[];
children?: ReactNode;
}): React.ReactElement<any, string | React.JSXElementConstructor<any>>;
export declare const LinkComponentContext: React.Context<React.Component<{}, {}, any> | null>;
export declare const CalendarSettingsContext: React.Context<CalendarSettings>;
export {};
//# sourceMappingURL=contexts.d.ts.map
Loading

0 comments on commit 35e2176

Please sign in to comment.