@ebarooni/capacitor-calendar 0.3.1 → 0.5.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/README.md +168 -28
- package/android/build.gradle +1 -1
- package/android/src/main/java/dev/barooni/capacitor/calendar/CapacitorCalendar.kt +35 -0
- package/android/src/main/java/dev/barooni/capacitor/calendar/CapacitorCalendarPlugin.kt +40 -0
- package/dist/docs.json +1100 -48
- package/dist/esm/definitions.d.ts +149 -62
- package/dist/esm/definitions.js +1 -31
- package/dist/esm/definitions.js.map +1 -1
- package/dist/esm/index.d.ts +10 -1
- package/dist/esm/index.js +5 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/schemas/enums/calendar-chooser-display-style.d.ts +15 -0
- package/dist/esm/schemas/enums/calendar-chooser-display-style.js +17 -0
- package/dist/esm/schemas/enums/calendar-chooser-display-style.js.map +1 -0
- package/dist/esm/schemas/enums/calendar-chooser-selection-style.d.ts +15 -0
- package/dist/esm/schemas/enums/calendar-chooser-selection-style.js +17 -0
- package/dist/esm/schemas/enums/calendar-chooser-selection-style.js.map +1 -0
- package/dist/esm/schemas/enums/plugin-permission.d.ts +22 -0
- package/dist/esm/schemas/enums/plugin-permission.js +24 -0
- package/dist/esm/schemas/enums/plugin-permission.js.map +1 -0
- package/dist/esm/schemas/enums/reminder-recurrence-frequency.d.ts +6 -0
- package/dist/esm/schemas/enums/reminder-recurrence-frequency.js +8 -0
- package/dist/esm/schemas/enums/reminder-recurrence-frequency.js.map +1 -0
- package/dist/esm/schemas/interfaces/calendar.d.ts +12 -0
- package/dist/esm/schemas/interfaces/calendar.js +2 -0
- package/dist/esm/schemas/interfaces/calendar.js.map +1 -0
- package/dist/esm/schemas/interfaces/plugin-permissions-map.d.ts +4 -0
- package/dist/esm/schemas/interfaces/plugin-permissions-map.js +2 -0
- package/dist/esm/schemas/interfaces/plugin-permissions-map.js.map +1 -0
- package/dist/esm/schemas/interfaces/reminder-recurrence-rule.d.ts +36 -0
- package/dist/esm/schemas/interfaces/reminder-recurrence-rule.js +2 -0
- package/dist/esm/schemas/interfaces/reminder-recurrence-rule.js.map +1 -0
- package/dist/esm/schemas/interfaces/reminders-list.d.ts +3 -0
- package/dist/esm/schemas/interfaces/reminders-list.js +2 -0
- package/dist/esm/schemas/interfaces/reminders-list.js.map +1 -0
- package/dist/esm/web.d.ts +41 -5
- package/dist/esm/web.js +12 -0
- package/dist/esm/web.js.map +1 -1
- package/dist/plugin.cjs.js +58 -14
- package/dist/plugin.cjs.js.map +1 -1
- package/dist/plugin.js +58 -14
- package/dist/plugin.js.map +1 -1
- package/ios/Plugin/CapacitorCalendar.swift +33 -0
- package/ios/Plugin/CapacitorCalendarPlugin.m +4 -0
- package/ios/Plugin/CapacitorCalendarPlugin.swift +131 -22
- package/ios/Plugin/CapacitorReminders.swift +177 -0
- package/package.json +10 -5
- package/ios/Plugin/Calendar.swift +0 -14
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reminder-recurrence-rule.js","sourceRoot":"","sources":["../../../../src/schemas/interfaces/reminder-recurrence-rule.ts"],"names":[],"mappings":"","sourcesContent":["import {ReminderRecurrenceFrequency} from \"../enums/reminder-recurrence-frequency\";\n\nexport interface ReminderRecurrenceRule {\n /**\n * How frequent should the reminder repeat.\n *\n * @example\n * // if frequency is set to weekly, the reminder will repeat on a weekly basis.\n * const rules: ReminderRecurrenceRule = {\n * frequency: ReminderRecurrenceFrequency.WEEKLY,\n * interval: 1,\n * }\n */\n frequency: ReminderRecurrenceFrequency;\n\n /**\n * The interval should be a number greater than 0. For values lower than 1 the method will throw an error.\n *\n * @example\n * // if interval is set to 2 and frequency is set to daily, the reminder will repeat every 2 days.\n * const rules: ReminderRecurrenceRule = {\n * frequency: ReminderRecurrenceFrequency.DAILY,\n * interval: 2,\n * }\n */\n interval: number;\n\n /**\n * When provided, the reminder will stop repeating at the given time.\n *\n * @example\n * const rules: ReminderRecurrenceRule = {\n * frequency: ReminderRecurrenceFrequency.MONTHLY,\n * interval: 10,\n * end: Date.now()\n * }\n */\n end?: number;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reminders-list.js","sourceRoot":"","sources":["../../../../src/schemas/interfaces/reminders-list.ts"],"names":[],"mappings":"","sourcesContent":["import {Calendar} from './calendar';\n\nexport interface RemindersList extends Calendar { }\n"]}
|
package/dist/esm/web.d.ts
CHANGED
|
@@ -1,18 +1,23 @@
|
|
|
1
1
|
import { PermissionState, WebPlugin } from '@capacitor/core';
|
|
2
|
-
import { CapacitorCalendarPlugin
|
|
2
|
+
import { CapacitorCalendarPlugin } from './definitions';
|
|
3
|
+
import { PluginPermission } from './schemas/enums/plugin-permission';
|
|
4
|
+
import { ReminderRecurrenceRule } from "./schemas/interfaces/reminder-recurrence-rule";
|
|
5
|
+
import type { Calendar } from "./schemas/interfaces/calendar";
|
|
6
|
+
import type { RemindersList } from "./schemas/interfaces/reminders-list";
|
|
7
|
+
import type { PluginPermissionsMap } from './schemas/interfaces/plugin-permissions-map';
|
|
3
8
|
export declare class CapacitorCalendarWeb extends WebPlugin implements CapacitorCalendarPlugin {
|
|
4
9
|
checkPermission(_options: {
|
|
5
|
-
alias:
|
|
10
|
+
alias: PluginPermission;
|
|
6
11
|
}): Promise<{
|
|
7
12
|
result: PermissionState;
|
|
8
13
|
}>;
|
|
9
|
-
checkAllPermissions(): Promise<
|
|
14
|
+
checkAllPermissions(): Promise<PluginPermissionsMap>;
|
|
10
15
|
requestPermission(_options: {
|
|
11
|
-
alias:
|
|
16
|
+
alias: PluginPermission;
|
|
12
17
|
}): Promise<{
|
|
13
18
|
result: PermissionState;
|
|
14
19
|
}>;
|
|
15
|
-
requestAllPermissions(): Promise<
|
|
20
|
+
requestAllPermissions(): Promise<PluginPermissionsMap>;
|
|
16
21
|
createEventWithPrompt(): Promise<{
|
|
17
22
|
eventCreated: boolean;
|
|
18
23
|
}>;
|
|
@@ -25,4 +30,35 @@ export declare class CapacitorCalendarWeb extends WebPlugin implements Capacitor
|
|
|
25
30
|
getDefaultCalendar(): Promise<{
|
|
26
31
|
result: Calendar;
|
|
27
32
|
}>;
|
|
33
|
+
createEvent(_options: {
|
|
34
|
+
title: string;
|
|
35
|
+
calendarId?: string;
|
|
36
|
+
location?: string;
|
|
37
|
+
startDate?: Date;
|
|
38
|
+
endDate?: Date;
|
|
39
|
+
isAllDay?: boolean;
|
|
40
|
+
}): Promise<{
|
|
41
|
+
eventCreated: boolean;
|
|
42
|
+
}>;
|
|
43
|
+
createReminder(_options: {
|
|
44
|
+
title: string;
|
|
45
|
+
listId?: string;
|
|
46
|
+
priority?: number;
|
|
47
|
+
isCompleted?: boolean;
|
|
48
|
+
startDate?: number;
|
|
49
|
+
dueDate?: number;
|
|
50
|
+
completionDate?: number;
|
|
51
|
+
notes?: string;
|
|
52
|
+
url?: string;
|
|
53
|
+
location?: string;
|
|
54
|
+
recurrence?: ReminderRecurrenceRule;
|
|
55
|
+
}): Promise<{
|
|
56
|
+
reminderCreated: boolean;
|
|
57
|
+
}>;
|
|
58
|
+
getDefaultRemindersList(): Promise<{
|
|
59
|
+
result: RemindersList;
|
|
60
|
+
}>;
|
|
61
|
+
getRemindersLists(): Promise<{
|
|
62
|
+
result: RemindersList[];
|
|
63
|
+
}>;
|
|
28
64
|
}
|
package/dist/esm/web.js
CHANGED
|
@@ -24,5 +24,17 @@ export class CapacitorCalendarWeb extends WebPlugin {
|
|
|
24
24
|
getDefaultCalendar() {
|
|
25
25
|
throw this.unimplemented(`${this.getDefaultCalendar.name} is not implemented on the web`);
|
|
26
26
|
}
|
|
27
|
+
createEvent(_options) {
|
|
28
|
+
throw this.unimplemented(`${this.createEvent.name} is not implemented on the web`);
|
|
29
|
+
}
|
|
30
|
+
createReminder(_options) {
|
|
31
|
+
throw this.unimplemented(`${this.createReminder.name} is not implemented on the web`);
|
|
32
|
+
}
|
|
33
|
+
getDefaultRemindersList() {
|
|
34
|
+
throw this.unimplemented(`${this.createReminder.name} is not implemented on the web`);
|
|
35
|
+
}
|
|
36
|
+
getRemindersLists() {
|
|
37
|
+
throw this.unimplemented(`${this.createReminder.name} is not implemented on the web`);
|
|
38
|
+
}
|
|
27
39
|
}
|
|
28
40
|
//# sourceMappingURL=web.js.map
|
package/dist/esm/web.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,SAAS,EAAC,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,SAAS,EAAC,MAAM,iBAAiB,CAAC;AAQ3D,MAAM,OAAO,oBACT,SAAQ,SAAS;IAGV,eAAe,CAAC,QAAqC;QACxD,MAAM,IAAI,CAAC,aAAa,CAAC,GAAG,IAAI,CAAC,eAAe,CAAC,IAAI,gCAAgC,CAAC,CAAA;IAC1F,CAAC;IAEM,mBAAmB;QACtB,MAAM,IAAI,CAAC,aAAa,CAAC,GAAG,IAAI,CAAC,mBAAmB,CAAC,IAAI,gCAAgC,CAAC,CAAC;IAC/F,CAAC;IAEM,iBAAiB,CAAC,QAAqC;QAC1D,MAAM,IAAI,CAAC,aAAa,CAAC,GAAG,IAAI,CAAC,iBAAiB,CAAC,IAAI,gCAAgC,CAAC,CAAC;IAC7F,CAAC;IAEM,qBAAqB;QACxB,MAAM,IAAI,CAAC,aAAa,CAAC,GAAG,IAAI,CAAC,qBAAqB,CAAC,IAAI,gCAAgC,CAAC,CAAC;IACjG,CAAC;IAEM,qBAAqB;QACxB,MAAM,IAAI,CAAC,aAAa,CAAC,GAAG,IAAI,CAAC,qBAAqB,CAAC,IAAI,gCAAgC,CAAC,CAAC;IACjG,CAAC;IAEM,yBAAyB;QAC5B,MAAM,IAAI,CAAC,aAAa,CAAC,GAAG,IAAI,CAAC,qBAAqB,CAAC,IAAI,gCAAgC,CAAC,CAAC;IACjG,CAAC;IAEM,aAAa;QAChB,MAAM,IAAI,CAAC,aAAa,CAAC,GAAG,IAAI,CAAC,aAAa,CAAC,IAAI,gCAAgC,CAAC,CAAC;IACzF,CAAC;IAEM,kBAAkB;QACrB,MAAM,IAAI,CAAC,aAAa,CAAC,GAAG,IAAI,CAAC,kBAAkB,CAAC,IAAI,gCAAgC,CAAC,CAAC;IAC9F,CAAC;IAEM,WAAW,CAAC,QAAyH;QAGxI,MAAM,IAAI,CAAC,aAAa,CAAC,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,gCAAgC,CAAC,CAAC;IACvF,CAAC;IAEM,cAAc,CAAC,QAYrB;QACG,MAAM,IAAI,CAAC,aAAa,CAAC,GAAG,IAAI,CAAC,cAAc,CAAC,IAAI,gCAAgC,CAAC,CAAC;IAC1F,CAAC;IAEM,uBAAuB;QAC1B,MAAM,IAAI,CAAC,aAAa,CAAC,GAAG,IAAI,CAAC,cAAc,CAAC,IAAI,gCAAgC,CAAC,CAAC;IAC1F,CAAC;IAEM,iBAAiB;QACpB,MAAM,IAAI,CAAC,aAAa,CAAC,GAAG,IAAI,CAAC,cAAc,CAAC,IAAI,gCAAgC,CAAC,CAAC;IAC1F,CAAC;CACJ","sourcesContent":["import {PermissionState, WebPlugin} from '@capacitor/core';\nimport {CapacitorCalendarPlugin} from './definitions';\nimport {PluginPermission} from './schemas/enums/plugin-permission';\nimport {ReminderRecurrenceRule} from \"./schemas/interfaces/reminder-recurrence-rule\";\nimport type {Calendar} from \"./schemas/interfaces/calendar\";\nimport type {RemindersList} from \"./schemas/interfaces/reminders-list\";\nimport type {PluginPermissionsMap} from './schemas/interfaces/plugin-permissions-map';\n\nexport class CapacitorCalendarWeb\n extends WebPlugin\n implements CapacitorCalendarPlugin\n{\n public checkPermission(_options: { alias: PluginPermission }): Promise<{ result: PermissionState }> {\n throw this.unimplemented(`${this.checkPermission.name} is not implemented on the web`)\n }\n\n public checkAllPermissions(): Promise<PluginPermissionsMap> {\n throw this.unimplemented(`${this.checkAllPermissions.name} is not implemented on the web`);\n }\n\n public requestPermission(_options: { alias: PluginPermission }): Promise<{ result: PermissionState }> {\n throw this.unimplemented(`${this.requestPermission.name} is not implemented on the web`);\n }\n\n public requestAllPermissions(): Promise<PluginPermissionsMap> {\n throw this.unimplemented(`${this.requestAllPermissions.name} is not implemented on the web`);\n }\n\n public createEventWithPrompt(): Promise<{ eventCreated: boolean}> {\n throw this.unimplemented(`${this.createEventWithPrompt.name} is not implemented on the web`);\n }\n\n public selectCalendarsWithPrompt(): Promise<{ result: Calendar[] }> {\n throw this.unimplemented(`${this.createEventWithPrompt.name} is not implemented on the web`);\n }\n\n public listCalendars(): Promise<{ result: Calendar[] }> {\n throw this.unimplemented(`${this.listCalendars.name} is not implemented on the web`);\n }\n\n public getDefaultCalendar(): Promise<{ result: Calendar }> {\n throw this.unimplemented(`${this.getDefaultCalendar.name} is not implemented on the web`);\n }\n\n public createEvent(_options: { title: string; calendarId?: string, location?: string; startDate?: Date; endDate?: Date, isAllDay?: boolean }): Promise<{\n eventCreated: boolean\n }> {\n throw this.unimplemented(`${this.createEvent.name} is not implemented on the web`);\n }\n\n public createReminder(_options: {\n title: string,\n listId?: string,\n priority?: number,\n isCompleted?: boolean,\n startDate?: number,\n dueDate?: number,\n completionDate?: number,\n notes?: string,\n url?: string,\n location?: string,\n recurrence?: ReminderRecurrenceRule,\n }): Promise<{ reminderCreated: boolean }> {\n throw this.unimplemented(`${this.createReminder.name} is not implemented on the web`);\n }\n\n public getDefaultRemindersList(): Promise<{ result: RemindersList }> {\n throw this.unimplemented(`${this.createReminder.name} is not implemented on the web`);\n }\n\n public getRemindersLists(): Promise<{ result: RemindersList[] }> {\n throw this.unimplemented(`${this.createReminder.name} is not implemented on the web`);\n }\n}\n"]}
|
package/dist/plugin.cjs.js
CHANGED
|
@@ -1,13 +1,28 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
3
|
var core = require('@capacitor/core');
|
|
6
4
|
|
|
5
|
+
/**
|
|
6
|
+
* Enum representing the display styles for the calendar chooser.
|
|
7
|
+
* @enum
|
|
8
|
+
* @platform iOS
|
|
9
|
+
*/
|
|
10
|
+
exports.CalendarChooserDisplayStyle = void 0;
|
|
11
|
+
(function (CalendarChooserDisplayStyle) {
|
|
12
|
+
/**
|
|
13
|
+
* Display all calendars available for selection.
|
|
14
|
+
*/
|
|
15
|
+
CalendarChooserDisplayStyle[CalendarChooserDisplayStyle["ALL_CALENDARS"] = 0] = "ALL_CALENDARS";
|
|
16
|
+
/**
|
|
17
|
+
* Display only writable calendars available for selection.
|
|
18
|
+
*/
|
|
19
|
+
CalendarChooserDisplayStyle[CalendarChooserDisplayStyle["WRITABLE_CALENDARS_ONLY"] = 1] = "WRITABLE_CALENDARS_ONLY";
|
|
20
|
+
})(exports.CalendarChooserDisplayStyle || (exports.CalendarChooserDisplayStyle = {}));
|
|
21
|
+
|
|
7
22
|
/**
|
|
8
23
|
* Enum representing the selection style for the calendar chooser.
|
|
9
|
-
* @readonly
|
|
10
24
|
* @enum
|
|
25
|
+
* @platform iOS
|
|
11
26
|
*/
|
|
12
27
|
exports.CalendarChooserSelectionStyle = void 0;
|
|
13
28
|
(function (CalendarChooserSelectionStyle) {
|
|
@@ -20,21 +35,38 @@ exports.CalendarChooserSelectionStyle = void 0;
|
|
|
20
35
|
*/
|
|
21
36
|
CalendarChooserSelectionStyle[CalendarChooserSelectionStyle["MULTIPLE"] = 1] = "MULTIPLE";
|
|
22
37
|
})(exports.CalendarChooserSelectionStyle || (exports.CalendarChooserSelectionStyle = {}));
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
*/
|
|
27
|
-
exports.CalendarChooserDisplayStyle = void 0;
|
|
28
|
-
(function (CalendarChooserDisplayStyle) {
|
|
38
|
+
|
|
39
|
+
exports.PluginPermission = void 0;
|
|
40
|
+
(function (PluginPermission) {
|
|
29
41
|
/**
|
|
30
|
-
*
|
|
42
|
+
* Represents the permission state for reading calendar.
|
|
43
|
+
* @platform iOS, Android
|
|
31
44
|
*/
|
|
32
|
-
|
|
45
|
+
PluginPermission["READ_CALENDAR"] = "readCalendar";
|
|
33
46
|
/**
|
|
34
|
-
*
|
|
47
|
+
* Represents the permission state for writing calendar.
|
|
48
|
+
* @platform iOS, Android
|
|
35
49
|
*/
|
|
36
|
-
|
|
37
|
-
|
|
50
|
+
PluginPermission["WRITE_CALENDAR"] = "writeCalendar";
|
|
51
|
+
/**
|
|
52
|
+
* Represents the permission state for reading reminders.
|
|
53
|
+
* @platform iOS
|
|
54
|
+
*/
|
|
55
|
+
PluginPermission["READ_REMINDERS"] = "readReminders";
|
|
56
|
+
/**
|
|
57
|
+
* Represents the permission state for writing reminders.
|
|
58
|
+
* @platform iOS
|
|
59
|
+
*/
|
|
60
|
+
PluginPermission["WRITE_REMINDERS"] = "writeReminders";
|
|
61
|
+
})(exports.PluginPermission || (exports.PluginPermission = {}));
|
|
62
|
+
|
|
63
|
+
exports.ReminderRecurrenceFrequency = void 0;
|
|
64
|
+
(function (ReminderRecurrenceFrequency) {
|
|
65
|
+
ReminderRecurrenceFrequency[ReminderRecurrenceFrequency["DAILY"] = 0] = "DAILY";
|
|
66
|
+
ReminderRecurrenceFrequency[ReminderRecurrenceFrequency["WEEKLY"] = 1] = "WEEKLY";
|
|
67
|
+
ReminderRecurrenceFrequency[ReminderRecurrenceFrequency["MONTHLY"] = 2] = "MONTHLY";
|
|
68
|
+
ReminderRecurrenceFrequency[ReminderRecurrenceFrequency["YEARLY"] = 3] = "YEARLY";
|
|
69
|
+
})(exports.ReminderRecurrenceFrequency || (exports.ReminderRecurrenceFrequency = {}));
|
|
38
70
|
|
|
39
71
|
const CapacitorCalendar = core.registerPlugin('CapacitorCalendar', {
|
|
40
72
|
web: () => Promise.resolve().then(function () { return web; }).then(m => new m.CapacitorCalendarWeb()),
|
|
@@ -65,6 +97,18 @@ class CapacitorCalendarWeb extends core.WebPlugin {
|
|
|
65
97
|
getDefaultCalendar() {
|
|
66
98
|
throw this.unimplemented(`${this.getDefaultCalendar.name} is not implemented on the web`);
|
|
67
99
|
}
|
|
100
|
+
createEvent(_options) {
|
|
101
|
+
throw this.unimplemented(`${this.createEvent.name} is not implemented on the web`);
|
|
102
|
+
}
|
|
103
|
+
createReminder(_options) {
|
|
104
|
+
throw this.unimplemented(`${this.createReminder.name} is not implemented on the web`);
|
|
105
|
+
}
|
|
106
|
+
getDefaultRemindersList() {
|
|
107
|
+
throw this.unimplemented(`${this.createReminder.name} is not implemented on the web`);
|
|
108
|
+
}
|
|
109
|
+
getRemindersLists() {
|
|
110
|
+
throw this.unimplemented(`${this.createReminder.name} is not implemented on the web`);
|
|
111
|
+
}
|
|
68
112
|
}
|
|
69
113
|
|
|
70
114
|
var web = /*#__PURE__*/Object.freeze({
|
package/dist/plugin.cjs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.cjs.js","sources":["esm/
|
|
1
|
+
{"version":3,"file":"plugin.cjs.js","sources":["esm/schemas/enums/calendar-chooser-display-style.js","esm/schemas/enums/calendar-chooser-selection-style.js","esm/schemas/enums/plugin-permission.js","esm/schemas/enums/reminder-recurrence-frequency.js","esm/index.js","esm/web.js"],"sourcesContent":["/**\n * Enum representing the display styles for the calendar chooser.\n * @enum\n * @platform iOS\n */\nexport var CalendarChooserDisplayStyle;\n(function (CalendarChooserDisplayStyle) {\n /**\n * Display all calendars available for selection.\n */\n CalendarChooserDisplayStyle[CalendarChooserDisplayStyle[\"ALL_CALENDARS\"] = 0] = \"ALL_CALENDARS\";\n /**\n * Display only writable calendars available for selection.\n */\n CalendarChooserDisplayStyle[CalendarChooserDisplayStyle[\"WRITABLE_CALENDARS_ONLY\"] = 1] = \"WRITABLE_CALENDARS_ONLY\";\n})(CalendarChooserDisplayStyle || (CalendarChooserDisplayStyle = {}));\n//# sourceMappingURL=calendar-chooser-display-style.js.map","/**\n * Enum representing the selection style for the calendar chooser.\n * @enum\n * @platform iOS\n */\nexport var CalendarChooserSelectionStyle;\n(function (CalendarChooserSelectionStyle) {\n /**\n * Allows only a single selection in the calendar chooser.\n */\n CalendarChooserSelectionStyle[CalendarChooserSelectionStyle[\"SINGLE\"] = 0] = \"SINGLE\";\n /**\n * Allows multiple selections in the calendar chooser.\n */\n CalendarChooserSelectionStyle[CalendarChooserSelectionStyle[\"MULTIPLE\"] = 1] = \"MULTIPLE\";\n})(CalendarChooserSelectionStyle || (CalendarChooserSelectionStyle = {}));\n//# sourceMappingURL=calendar-chooser-selection-style.js.map","export var PluginPermission;\n(function (PluginPermission) {\n /**\n * Represents the permission state for reading calendar.\n * @platform iOS, Android\n */\n PluginPermission[\"READ_CALENDAR\"] = \"readCalendar\";\n /**\n * Represents the permission state for writing calendar.\n * @platform iOS, Android\n */\n PluginPermission[\"WRITE_CALENDAR\"] = \"writeCalendar\";\n /**\n * Represents the permission state for reading reminders.\n * @platform iOS\n */\n PluginPermission[\"READ_REMINDERS\"] = \"readReminders\";\n /**\n * Represents the permission state for writing reminders.\n * @platform iOS\n */\n PluginPermission[\"WRITE_REMINDERS\"] = \"writeReminders\";\n})(PluginPermission || (PluginPermission = {}));\n//# sourceMappingURL=plugin-permission.js.map","export var ReminderRecurrenceFrequency;\n(function (ReminderRecurrenceFrequency) {\n ReminderRecurrenceFrequency[ReminderRecurrenceFrequency[\"DAILY\"] = 0] = \"DAILY\";\n ReminderRecurrenceFrequency[ReminderRecurrenceFrequency[\"WEEKLY\"] = 1] = \"WEEKLY\";\n ReminderRecurrenceFrequency[ReminderRecurrenceFrequency[\"MONTHLY\"] = 2] = \"MONTHLY\";\n ReminderRecurrenceFrequency[ReminderRecurrenceFrequency[\"YEARLY\"] = 3] = \"YEARLY\";\n})(ReminderRecurrenceFrequency || (ReminderRecurrenceFrequency = {}));\n//# sourceMappingURL=reminder-recurrence-frequency.js.map","import { registerPlugin } from '@capacitor/core';\nimport { CalendarChooserDisplayStyle } from './schemas/enums/calendar-chooser-display-style';\nimport { CalendarChooserSelectionStyle } from './schemas/enums/calendar-chooser-selection-style';\nimport { PluginPermission } from './schemas/enums/plugin-permission';\nimport { ReminderRecurrenceFrequency } from './schemas/enums/reminder-recurrence-frequency';\nconst CapacitorCalendar = registerPlugin('CapacitorCalendar', {\n web: () => import('./web').then(m => new m.CapacitorCalendarWeb()),\n});\nexport * from './definitions';\nexport { CalendarChooserSelectionStyle, CalendarChooserDisplayStyle, PluginPermission, ReminderRecurrenceFrequency, CapacitorCalendar, };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class CapacitorCalendarWeb extends WebPlugin {\n checkPermission(_options) {\n throw this.unimplemented(`${this.checkPermission.name} is not implemented on the web`);\n }\n checkAllPermissions() {\n throw this.unimplemented(`${this.checkAllPermissions.name} is not implemented on the web`);\n }\n requestPermission(_options) {\n throw this.unimplemented(`${this.requestPermission.name} is not implemented on the web`);\n }\n requestAllPermissions() {\n throw this.unimplemented(`${this.requestAllPermissions.name} is not implemented on the web`);\n }\n createEventWithPrompt() {\n throw this.unimplemented(`${this.createEventWithPrompt.name} is not implemented on the web`);\n }\n selectCalendarsWithPrompt() {\n throw this.unimplemented(`${this.createEventWithPrompt.name} is not implemented on the web`);\n }\n listCalendars() {\n throw this.unimplemented(`${this.listCalendars.name} is not implemented on the web`);\n }\n getDefaultCalendar() {\n throw this.unimplemented(`${this.getDefaultCalendar.name} is not implemented on the web`);\n }\n createEvent(_options) {\n throw this.unimplemented(`${this.createEvent.name} is not implemented on the web`);\n }\n createReminder(_options) {\n throw this.unimplemented(`${this.createReminder.name} is not implemented on the web`);\n }\n getDefaultRemindersList() {\n throw this.unimplemented(`${this.createReminder.name} is not implemented on the web`);\n }\n getRemindersLists() {\n throw this.unimplemented(`${this.createReminder.name} is not implemented on the web`);\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["CalendarChooserDisplayStyle","CalendarChooserSelectionSty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AAG;AACxB,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,CAAC,EAAE,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,8BAA8B,CAAC,CAAC,CAAC;AAC9F,KAAK;AACL;;;;;;;;;"}
|
package/dist/plugin.js
CHANGED
|
@@ -1,10 +1,27 @@
|
|
|
1
1
|
var capacitorCapacitorCalendar = (function (exports, core) {
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* Enum representing the display styles for the calendar chooser.
|
|
6
|
+
* @enum
|
|
7
|
+
* @platform iOS
|
|
8
|
+
*/
|
|
9
|
+
exports.CalendarChooserDisplayStyle = void 0;
|
|
10
|
+
(function (CalendarChooserDisplayStyle) {
|
|
11
|
+
/**
|
|
12
|
+
* Display all calendars available for selection.
|
|
13
|
+
*/
|
|
14
|
+
CalendarChooserDisplayStyle[CalendarChooserDisplayStyle["ALL_CALENDARS"] = 0] = "ALL_CALENDARS";
|
|
15
|
+
/**
|
|
16
|
+
* Display only writable calendars available for selection.
|
|
17
|
+
*/
|
|
18
|
+
CalendarChooserDisplayStyle[CalendarChooserDisplayStyle["WRITABLE_CALENDARS_ONLY"] = 1] = "WRITABLE_CALENDARS_ONLY";
|
|
19
|
+
})(exports.CalendarChooserDisplayStyle || (exports.CalendarChooserDisplayStyle = {}));
|
|
20
|
+
|
|
4
21
|
/**
|
|
5
22
|
* Enum representing the selection style for the calendar chooser.
|
|
6
|
-
* @readonly
|
|
7
23
|
* @enum
|
|
24
|
+
* @platform iOS
|
|
8
25
|
*/
|
|
9
26
|
exports.CalendarChooserSelectionStyle = void 0;
|
|
10
27
|
(function (CalendarChooserSelectionStyle) {
|
|
@@ -17,21 +34,38 @@ var capacitorCapacitorCalendar = (function (exports, core) {
|
|
|
17
34
|
*/
|
|
18
35
|
CalendarChooserSelectionStyle[CalendarChooserSelectionStyle["MULTIPLE"] = 1] = "MULTIPLE";
|
|
19
36
|
})(exports.CalendarChooserSelectionStyle || (exports.CalendarChooserSelectionStyle = {}));
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
*/
|
|
24
|
-
exports.CalendarChooserDisplayStyle = void 0;
|
|
25
|
-
(function (CalendarChooserDisplayStyle) {
|
|
37
|
+
|
|
38
|
+
exports.PluginPermission = void 0;
|
|
39
|
+
(function (PluginPermission) {
|
|
26
40
|
/**
|
|
27
|
-
*
|
|
41
|
+
* Represents the permission state for reading calendar.
|
|
42
|
+
* @platform iOS, Android
|
|
28
43
|
*/
|
|
29
|
-
|
|
44
|
+
PluginPermission["READ_CALENDAR"] = "readCalendar";
|
|
30
45
|
/**
|
|
31
|
-
*
|
|
46
|
+
* Represents the permission state for writing calendar.
|
|
47
|
+
* @platform iOS, Android
|
|
32
48
|
*/
|
|
33
|
-
|
|
34
|
-
|
|
49
|
+
PluginPermission["WRITE_CALENDAR"] = "writeCalendar";
|
|
50
|
+
/**
|
|
51
|
+
* Represents the permission state for reading reminders.
|
|
52
|
+
* @platform iOS
|
|
53
|
+
*/
|
|
54
|
+
PluginPermission["READ_REMINDERS"] = "readReminders";
|
|
55
|
+
/**
|
|
56
|
+
* Represents the permission state for writing reminders.
|
|
57
|
+
* @platform iOS
|
|
58
|
+
*/
|
|
59
|
+
PluginPermission["WRITE_REMINDERS"] = "writeReminders";
|
|
60
|
+
})(exports.PluginPermission || (exports.PluginPermission = {}));
|
|
61
|
+
|
|
62
|
+
exports.ReminderRecurrenceFrequency = void 0;
|
|
63
|
+
(function (ReminderRecurrenceFrequency) {
|
|
64
|
+
ReminderRecurrenceFrequency[ReminderRecurrenceFrequency["DAILY"] = 0] = "DAILY";
|
|
65
|
+
ReminderRecurrenceFrequency[ReminderRecurrenceFrequency["WEEKLY"] = 1] = "WEEKLY";
|
|
66
|
+
ReminderRecurrenceFrequency[ReminderRecurrenceFrequency["MONTHLY"] = 2] = "MONTHLY";
|
|
67
|
+
ReminderRecurrenceFrequency[ReminderRecurrenceFrequency["YEARLY"] = 3] = "YEARLY";
|
|
68
|
+
})(exports.ReminderRecurrenceFrequency || (exports.ReminderRecurrenceFrequency = {}));
|
|
35
69
|
|
|
36
70
|
const CapacitorCalendar = core.registerPlugin('CapacitorCalendar', {
|
|
37
71
|
web: () => Promise.resolve().then(function () { return web; }).then(m => new m.CapacitorCalendarWeb()),
|
|
@@ -62,6 +96,18 @@ var capacitorCapacitorCalendar = (function (exports, core) {
|
|
|
62
96
|
getDefaultCalendar() {
|
|
63
97
|
throw this.unimplemented(`${this.getDefaultCalendar.name} is not implemented on the web`);
|
|
64
98
|
}
|
|
99
|
+
createEvent(_options) {
|
|
100
|
+
throw this.unimplemented(`${this.createEvent.name} is not implemented on the web`);
|
|
101
|
+
}
|
|
102
|
+
createReminder(_options) {
|
|
103
|
+
throw this.unimplemented(`${this.createReminder.name} is not implemented on the web`);
|
|
104
|
+
}
|
|
105
|
+
getDefaultRemindersList() {
|
|
106
|
+
throw this.unimplemented(`${this.createReminder.name} is not implemented on the web`);
|
|
107
|
+
}
|
|
108
|
+
getRemindersLists() {
|
|
109
|
+
throw this.unimplemented(`${this.createReminder.name} is not implemented on the web`);
|
|
110
|
+
}
|
|
65
111
|
}
|
|
66
112
|
|
|
67
113
|
var web = /*#__PURE__*/Object.freeze({
|
|
@@ -71,8 +117,6 @@ var capacitorCapacitorCalendar = (function (exports, core) {
|
|
|
71
117
|
|
|
72
118
|
exports.CapacitorCalendar = CapacitorCalendar;
|
|
73
119
|
|
|
74
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
75
|
-
|
|
76
120
|
return exports;
|
|
77
121
|
|
|
78
122
|
})({}, capacitorExports);
|
package/dist/plugin.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.js","sources":["esm/
|
|
1
|
+
{"version":3,"file":"plugin.js","sources":["esm/schemas/enums/calendar-chooser-display-style.js","esm/schemas/enums/calendar-chooser-selection-style.js","esm/schemas/enums/plugin-permission.js","esm/schemas/enums/reminder-recurrence-frequency.js","esm/index.js","esm/web.js"],"sourcesContent":["/**\n * Enum representing the display styles for the calendar chooser.\n * @enum\n * @platform iOS\n */\nexport var CalendarChooserDisplayStyle;\n(function (CalendarChooserDisplayStyle) {\n /**\n * Display all calendars available for selection.\n */\n CalendarChooserDisplayStyle[CalendarChooserDisplayStyle[\"ALL_CALENDARS\"] = 0] = \"ALL_CALENDARS\";\n /**\n * Display only writable calendars available for selection.\n */\n CalendarChooserDisplayStyle[CalendarChooserDisplayStyle[\"WRITABLE_CALENDARS_ONLY\"] = 1] = \"WRITABLE_CALENDARS_ONLY\";\n})(CalendarChooserDisplayStyle || (CalendarChooserDisplayStyle = {}));\n//# sourceMappingURL=calendar-chooser-display-style.js.map","/**\n * Enum representing the selection style for the calendar chooser.\n * @enum\n * @platform iOS\n */\nexport var CalendarChooserSelectionStyle;\n(function (CalendarChooserSelectionStyle) {\n /**\n * Allows only a single selection in the calendar chooser.\n */\n CalendarChooserSelectionStyle[CalendarChooserSelectionStyle[\"SINGLE\"] = 0] = \"SINGLE\";\n /**\n * Allows multiple selections in the calendar chooser.\n */\n CalendarChooserSelectionStyle[CalendarChooserSelectionStyle[\"MULTIPLE\"] = 1] = \"MULTIPLE\";\n})(CalendarChooserSelectionStyle || (CalendarChooserSelectionStyle = {}));\n//# sourceMappingURL=calendar-chooser-selection-style.js.map","export var PluginPermission;\n(function (PluginPermission) {\n /**\n * Represents the permission state for reading calendar.\n * @platform iOS, Android\n */\n PluginPermission[\"READ_CALENDAR\"] = \"readCalendar\";\n /**\n * Represents the permission state for writing calendar.\n * @platform iOS, Android\n */\n PluginPermission[\"WRITE_CALENDAR\"] = \"writeCalendar\";\n /**\n * Represents the permission state for reading reminders.\n * @platform iOS\n */\n PluginPermission[\"READ_REMINDERS\"] = \"readReminders\";\n /**\n * Represents the permission state for writing reminders.\n * @platform iOS\n */\n PluginPermission[\"WRITE_REMINDERS\"] = \"writeReminders\";\n})(PluginPermission || (PluginPermission = {}));\n//# sourceMappingURL=plugin-permission.js.map","export var ReminderRecurrenceFrequency;\n(function (ReminderRecurrenceFrequency) {\n ReminderRecurrenceFrequency[ReminderRecurrenceFrequency[\"DAILY\"] = 0] = \"DAILY\";\n ReminderRecurrenceFrequency[ReminderRecurrenceFrequency[\"WEEKLY\"] = 1] = \"WEEKLY\";\n ReminderRecurrenceFrequency[ReminderRecurrenceFrequency[\"MONTHLY\"] = 2] = \"MONTHLY\";\n ReminderRecurrenceFrequency[ReminderRecurrenceFrequency[\"YEARLY\"] = 3] = \"YEARLY\";\n})(ReminderRecurrenceFrequency || (ReminderRecurrenceFrequency = {}));\n//# sourceMappingURL=reminder-recurrence-frequency.js.map","import { registerPlugin } from '@capacitor/core';\nimport { CalendarChooserDisplayStyle } from './schemas/enums/calendar-chooser-display-style';\nimport { CalendarChooserSelectionStyle } from './schemas/enums/calendar-chooser-selection-style';\nimport { PluginPermission } from './schemas/enums/plugin-permission';\nimport { ReminderRecurrenceFrequency } from './schemas/enums/reminder-recurrence-frequency';\nconst CapacitorCalendar = registerPlugin('CapacitorCalendar', {\n web: () => import('./web').then(m => new m.CapacitorCalendarWeb()),\n});\nexport * from './definitions';\nexport { CalendarChooserSelectionStyle, CalendarChooserDisplayStyle, PluginPermission, ReminderRecurrenceFrequency, CapacitorCalendar, };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class CapacitorCalendarWeb extends WebPlugin {\n checkPermission(_options) {\n throw this.unimplemented(`${this.checkPermission.name} is not implemented on the web`);\n }\n checkAllPermissions() {\n throw this.unimplemented(`${this.checkAllPermissions.name} is not implemented on the web`);\n }\n requestPermission(_options) {\n throw this.unimplemented(`${this.requestPermission.name} is not implemented on the web`);\n }\n requestAllPermissions() {\n throw this.unimplemented(`${this.requestAllPermissions.name} is not implemented on the web`);\n }\n createEventWithPrompt() {\n throw this.unimplemented(`${this.createEventWithPrompt.name} is not implemented on the web`);\n }\n selectCalendarsWithPrompt() {\n throw this.unimplemented(`${this.createEventWithPrompt.name} is not implemented on the web`);\n }\n listCalendars() {\n throw this.unimplemented(`${this.listCalendars.name} is not implemented on the web`);\n }\n getDefaultCalendar() {\n throw this.unimplemented(`${this.getDefaultCalendar.name} is not implemented on the web`);\n }\n createEvent(_options) {\n throw this.unimplemented(`${this.createEvent.name} is not implemented on the web`);\n }\n createReminder(_options) {\n throw this.unimplemented(`${this.createReminder.name} is not implemented on the web`);\n }\n getDefaultRemindersList() {\n throw this.unimplemented(`${this.createReminder.name} is not implemented on the web`);\n }\n getRemindersLists() {\n throw this.unimplemented(`${this.createReminder.name} is not implemented on the web`);\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["CalendarChooserDisplayStyle","CalendarChooserSelectionStyle","PluginPermission","ReminderRecurrenceFrequency","registerPlugin","WebPlugin"],"mappings":";;;IAAA;IACA;IACA;IACA;IACA;AACWA,iDAA4B;IACvC,CAAC,UAAU,2BAA2B,EAAE;IACxC;IACA;IACA;IACA,IAAI,2BAA2B,CAAC,2BAA2B,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC,GAAG,eAAe,CAAC;IACpG;IACA;IACA;IACA,IAAI,2BAA2B,CAAC,2BAA2B,CAAC,yBAAyB,CAAC,GAAG,CAAC,CAAC,GAAG,yBAAyB,CAAC;IACxH,CAAC,EAAEA,mCAA2B,KAAKA,mCAA2B,GAAG,EAAE,CAAC,CAAC;;ICfrE;IACA;IACA;IACA;IACA;AACWC,mDAA8B;IACzC,CAAC,UAAU,6BAA6B,EAAE;IAC1C;IACA;IACA;IACA,IAAI,6BAA6B,CAAC,6BAA6B,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,GAAG,QAAQ,CAAC;IAC1F;IACA;IACA;IACA,IAAI,6BAA6B,CAAC,6BAA6B,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,GAAG,UAAU,CAAC;IAC9F,CAAC,EAAEA,qCAA6B,KAAKA,qCAA6B,GAAG,EAAE,CAAC,CAAC;;ACf9DC,sCAAiB;IAC5B,CAAC,UAAU,gB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EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,8BAA8B,CAAC,CAAC,CAAC;IAC3F,KAAK;IACL,IAAI,cAAc,CAAC,QAAQ,EAAE;IAC7B,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,CAAC,EAAE,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,8BAA8B,CAAC,CAAC,CAAC;IAC9F,KAAK;IACL,IAAI,uBAAuB,GAAG;IAC9B,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,CAAC,EAAE,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,8BAA8B,CAAC,CAAC,CAAC;IAC9F,KAAK;IACL,IAAI,iBAAiB,GAAG;IACxB,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,CAAC,EAAE,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,8BAA8B,CAAC,CAAC,CAAC;IAC9F,KAAK;IACL;;;;;;;;;;;;;;;"}
|
|
@@ -73,6 +73,39 @@ public class CapacitorCalendar: NSObject, EKEventEditViewDelegate, EKCalendarCho
|
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
75
|
|
|
76
|
+
public func createEvent(title: String, calendarId: String?, location: String?, startDate: Date?, endDate: Date?, isAllDay: Bool?) throws -> Void {
|
|
77
|
+
let fallbackStartDate = Date()
|
|
78
|
+
let newEvent = EKEvent(eventStore: eventStore)
|
|
79
|
+
if let calendarId = calendarId, let calendar = eventStore.calendar(withIdentifier: calendarId) {
|
|
80
|
+
newEvent.calendar = calendar
|
|
81
|
+
} else {
|
|
82
|
+
newEvent.calendar = eventStore.defaultCalendarForNewEvents
|
|
83
|
+
}
|
|
84
|
+
newEvent.title = title
|
|
85
|
+
if let location = location {
|
|
86
|
+
newEvent.location = location
|
|
87
|
+
}
|
|
88
|
+
if let startDate = startDate {
|
|
89
|
+
newEvent.startDate = startDate
|
|
90
|
+
} else {
|
|
91
|
+
newEvent.startDate = fallbackStartDate
|
|
92
|
+
}
|
|
93
|
+
if let endDate = endDate {
|
|
94
|
+
newEvent.endDate = endDate
|
|
95
|
+
} else {
|
|
96
|
+
newEvent.endDate = fallbackStartDate.addingTimeInterval(3600)
|
|
97
|
+
}
|
|
98
|
+
if let isAllDay = isAllDay {
|
|
99
|
+
newEvent.isAllDay = isAllDay
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
do {
|
|
103
|
+
try eventStore.save(newEvent, span: .thisEvent)
|
|
104
|
+
} catch {
|
|
105
|
+
throw CapacitorCalendarPluginError.unknownActionEventCreationPrompt
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
76
109
|
public func checkAllPermissions() async throws -> [String: String] {
|
|
77
110
|
return try await withCheckedThrowingContinuation { continuation in
|
|
78
111
|
var permissionsState: [String: String]
|
|
@@ -12,4 +12,8 @@ CAP_PLUGIN(CapacitorCalendarPlugin, "CapacitorCalendar",
|
|
|
12
12
|
CAP_PLUGIN_METHOD(selectCalendarsWithPrompt, CAPPluginReturnPromise);
|
|
13
13
|
CAP_PLUGIN_METHOD(listCalendars, CAPPluginReturnPromise);
|
|
14
14
|
CAP_PLUGIN_METHOD(getDefaultCalendar, CAPPluginReturnPromise);
|
|
15
|
+
CAP_PLUGIN_METHOD(createEvent, CAPPluginReturnPromise);
|
|
16
|
+
CAP_PLUGIN_METHOD(getDefaultRemindersList, CAPPluginReturnPromise);
|
|
17
|
+
CAP_PLUGIN_METHOD(getRemindersLists, CAPPluginReturnPromise);
|
|
18
|
+
CAP_PLUGIN_METHOD(createReminder, CAPPluginReturnPromise);
|
|
15
19
|
)
|