@fullcalendar/icalendar 7.0.0-beta.4 → 7.0.0-rc.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/index.cjs CHANGED
@@ -6,34 +6,18 @@ var index_cjs = require('@fullcalendar/core/index.cjs');
6
6
  var internal_cjs = require('@fullcalendar/core/internal.cjs');
7
7
  var ICAL = require('ical.js');
8
8
 
9
- function _interopNamespace(e) {
10
- if (e && e.__esModule) return e;
11
- var n = Object.create(null);
12
- if (e) {
13
- Object.keys(e).forEach(function (k) {
14
- if (k !== 'default') {
15
- var d = Object.getOwnPropertyDescriptor(e, k);
16
- Object.defineProperty(n, k, d.get ? d : {
17
- enumerable: true,
18
- get: function () { return e[k]; }
19
- });
20
- }
21
- });
22
- }
23
- n["default"] = e;
24
- return Object.freeze(n);
25
- }
9
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
26
10
 
27
- var ICAL__namespace = /*#__PURE__*/_interopNamespace(ICAL);
11
+ var ICAL__default = /*#__PURE__*/_interopDefaultLegacy(ICAL);
28
12
 
29
13
  /* eslint-disable */
30
14
  class IcalExpander {
31
15
  constructor(opts) {
32
16
  this.maxIterations = opts.maxIterations != null ? opts.maxIterations : 1000;
33
17
  this.skipInvalidDates = opts.skipInvalidDates != null ? opts.skipInvalidDates : false;
34
- this.jCalData = ICAL__namespace.parse(opts.ics);
35
- this.component = new ICAL__namespace.Component(this.jCalData);
36
- this.events = this.component.getAllSubcomponents('vevent').map(vevent => new ICAL__namespace.Event(vevent));
18
+ this.jCalData = ICAL__default["default"].parse(opts.ics);
19
+ this.component = new ICAL__default["default"].Component(this.jCalData);
20
+ this.events = this.component.getAllSubcomponents('vevent').map(vevent => new ICAL__default["default"].Event(vevent));
37
21
  if (this.skipInvalidDates) {
38
22
  this.events = this.events.filter((evt) => {
39
23
  try {
package/index.global.js CHANGED
@@ -1,39 +1,23 @@
1
1
  /*!
2
- FullCalendar iCalendar Plugin v7.0.0-beta.4
2
+ FullCalendar iCalendar Plugin v7.0.0-rc.0
3
3
  Docs & License: https://fullcalendar.io/docs/icalendar
4
4
  (c) 2024 Adam Shaw
5
5
  */
6
6
  FullCalendar.ICalendar = (function (exports, core, internal, ICAL) {
7
7
  'use strict';
8
8
 
9
- function _interopNamespace(e) {
10
- if (e && e.__esModule) return e;
11
- var n = Object.create(null);
12
- if (e) {
13
- Object.keys(e).forEach(function (k) {
14
- if (k !== 'default') {
15
- var d = Object.getOwnPropertyDescriptor(e, k);
16
- Object.defineProperty(n, k, d.get ? d : {
17
- enumerable: true,
18
- get: function () { return e[k]; }
19
- });
20
- }
21
- });
22
- }
23
- n["default"] = e;
24
- return n;
25
- }
9
+ function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
26
10
 
27
- var ICAL__namespace = /*#__PURE__*/_interopNamespace(ICAL);
11
+ var ICAL__default = /*#__PURE__*/_interopDefault(ICAL);
28
12
 
29
13
  /* eslint-disable */
30
14
  class IcalExpander {
31
15
  constructor(opts) {
32
16
  this.maxIterations = opts.maxIterations != null ? opts.maxIterations : 1000;
33
17
  this.skipInvalidDates = opts.skipInvalidDates != null ? opts.skipInvalidDates : false;
34
- this.jCalData = ICAL__namespace.parse(opts.ics);
35
- this.component = new ICAL__namespace.Component(this.jCalData);
36
- this.events = this.component.getAllSubcomponents('vevent').map(vevent => new ICAL__namespace.Event(vevent));
18
+ this.jCalData = ICAL__default["default"].parse(opts.ics);
19
+ this.component = new ICAL__default["default"].Component(this.jCalData);
20
+ this.events = this.component.getAllSubcomponents('vevent').map(vevent => new ICAL__default["default"].Event(vevent));
37
21
  if (this.skipInvalidDates) {
38
22
  this.events = this.events.filter((evt) => {
39
23
  try {
@@ -1,6 +1,6 @@
1
1
  /*!
2
- FullCalendar iCalendar Plugin v7.0.0-beta.4
2
+ FullCalendar iCalendar Plugin v7.0.0-rc.0
3
3
  Docs & License: https://fullcalendar.io/docs/icalendar
4
4
  (c) 2024 Adam Shaw
5
5
  */
6
- FullCalendar.ICalendar=function(e,t,n,r){"use strict";function a(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,t}var s=a(r);class i{constructor(e){this.maxIterations=null!=e.maxIterations?e.maxIterations:1e3,this.skipInvalidDates=null!=e.skipInvalidDates&&e.skipInvalidDates,this.jCalData=s.parse(e.ics),this.component=new s.Component(this.jCalData),this.events=this.component.getAllSubcomponents("vevent").map(e=>new s.Event(e)),this.skipInvalidDates&&(this.events=this.events.filter(e=>{try{return e.startDate.toJSDate(),e.endDate.toJSDate(),!0}catch(e){return!1}}))}between(e,t){function n(n,r){return(!e||r>=e.getTime())&&(!t||n<=t.getTime())}function r(e){const t=e.startDate.toJSDate().getTime();let n=e.endDate.toJSDate().getTime();return e.endDate.isDate&&n>t&&(n-=1),{startTime:t,endTime:n}}const a=[];this.events.forEach(e=>{e.isRecurrenceException()&&a.push(e)});const s={events:[],occurrences:[]};return this.events.filter(e=>!e.isRecurrenceException()).forEach(e=>{const i=[];if(e.component.getAllProperties("exdate").forEach(e=>{const t=e.getFirstValue();i.push(t.toJSDate().getTime())}),e.isRecurring()){const o=e.iterator();let c,l=0;do{if(l+=1,c=o.next(),c){const o=e.getOccurrenceDetails(c),{startTime:l,endTime:u}=r(o),d=-1!==i.indexOf(l),p=a.find(t=>t.uid===e.uid&&t.recurrenceId.toJSDate().getTime()===o.startDate.toJSDate().getTime());if(t&&l>t.getTime())break;n(l,u)&&(p?s.events.push(p):d||s.occurrences.push(o))}}while(c&&(!this.maxIterations||l<this.maxIterations));return}const{startTime:o,endTime:c}=r(e);n(o,c)&&s.events.push(e)}),s}before(e){return this.between(void 0,e)}after(e){return this.between(e)}all(){return this.between()}}const o={parseMeta:e=>e.url&&"ics"===e.format?{url:e.url,format:"ics"}:null,fetch(e,t,n){let r=e.eventSource.meta,{internalState:a}=r;a&&!e.isRefetch||(a=r.internalState={response:null,iCalExpanderPromise:fetch(r.url,{method:"GET"}).then(e=>e.text().then(t=>(a.response=e,new i({ics:t,skipInvalidDates:!0}))))}),a.iCalExpanderPromise.then(n=>{t({rawEvents:c(n,e.range),response:a.response})},n)}};function c(e,t){let r=n.addDays(t.start,-1),a=n.addDays(t.end,1),s=e.between(r,a),i=[];for(let e of s.events)i.push(Object.assign(Object.assign({},l(e)),{start:e.startDate.toString(),end:d(e)&&e.endDate?e.endDate.toString():null}));for(let e of s.occurrences){let t=e.item;i.push(Object.assign(Object.assign({},l(t)),{start:e.startDate.toString(),end:d(t)&&e.endDate?e.endDate.toString():null}))}return i}function l(e){return{title:e.summary,url:u(e),extendedProps:{location:e.location,organizer:e.organizer,description:e.description}}}function u(e){let t=e.component.getFirstProperty("url");return t?t.getFirstValue():""}function d(e){return Boolean(e.component.getFirstProperty("dtend"))||Boolean(e.component.getFirstProperty("duration"))}var p=t.createPlugin({name:"@fullcalendar/icalendar",eventSourceDefs:[o]});return t.globalPlugins.push(p),e.default=p,Object.defineProperty(e,"__esModule",{value:!0}),e}({},FullCalendar,FullCalendar.Internal,ICAL);
6
+ FullCalendar.ICalendar=function(e,t,n,r){"use strict";function a(e){return e&&e.__esModule?e:{default:e}}var s=a(r);class i{constructor(e){this.maxIterations=null!=e.maxIterations?e.maxIterations:1e3,this.skipInvalidDates=null!=e.skipInvalidDates&&e.skipInvalidDates,this.jCalData=s.default.parse(e.ics),this.component=new s.default.Component(this.jCalData),this.events=this.component.getAllSubcomponents("vevent").map(e=>new s.default.Event(e)),this.skipInvalidDates&&(this.events=this.events.filter(e=>{try{return e.startDate.toJSDate(),e.endDate.toJSDate(),!0}catch(e){return!1}}))}between(e,t){function n(n,r){return(!e||r>=e.getTime())&&(!t||n<=t.getTime())}function r(e){const t=e.startDate.toJSDate().getTime();let n=e.endDate.toJSDate().getTime();return e.endDate.isDate&&n>t&&(n-=1),{startTime:t,endTime:n}}const a=[];this.events.forEach(e=>{e.isRecurrenceException()&&a.push(e)});const s={events:[],occurrences:[]};return this.events.filter(e=>!e.isRecurrenceException()).forEach(e=>{const i=[];if(e.component.getAllProperties("exdate").forEach(e=>{const t=e.getFirstValue();i.push(t.toJSDate().getTime())}),e.isRecurring()){const o=e.iterator();let l,u=0;do{if(u+=1,l=o.next(),l){const o=e.getOccurrenceDetails(l),{startTime:u,endTime:c}=r(o),d=-1!==i.indexOf(u),p=a.find(t=>t.uid===e.uid&&t.recurrenceId.toJSDate().getTime()===o.startDate.toJSDate().getTime());if(t&&u>t.getTime())break;n(u,c)&&(p?s.events.push(p):d||s.occurrences.push(o))}}while(l&&(!this.maxIterations||u<this.maxIterations));return}const{startTime:o,endTime:l}=r(e);n(o,l)&&s.events.push(e)}),s}before(e){return this.between(void 0,e)}after(e){return this.between(e)}all(){return this.between()}}const o={parseMeta:e=>e.url&&"ics"===e.format?{url:e.url,format:"ics"}:null,fetch(e,t,n){let r=e.eventSource.meta,{internalState:a}=r;a&&!e.isRefetch||(a=r.internalState={response:null,iCalExpanderPromise:fetch(r.url,{method:"GET"}).then(e=>e.text().then(t=>(a.response=e,new i({ics:t,skipInvalidDates:!0}))))}),a.iCalExpanderPromise.then(n=>{t({rawEvents:l(n,e.range),response:a.response})},n)}};function l(e,t){let r=n.addDays(t.start,-1),a=n.addDays(t.end,1),s=e.between(r,a),i=[];for(let e of s.events)i.push(Object.assign(Object.assign({},u(e)),{start:e.startDate.toString(),end:d(e)&&e.endDate?e.endDate.toString():null}));for(let e of s.occurrences){let t=e.item;i.push(Object.assign(Object.assign({},u(t)),{start:e.startDate.toString(),end:d(t)&&e.endDate?e.endDate.toString():null}))}return i}function u(e){return{title:e.summary,url:c(e),extendedProps:{location:e.location,organizer:e.organizer,description:e.description}}}function c(e){let t=e.component.getFirstProperty("url");return t?t.getFirstValue():""}function d(e){return Boolean(e.component.getFirstProperty("dtend"))||Boolean(e.component.getFirstProperty("duration"))}var p=t.createPlugin({name:"@fullcalendar/icalendar",eventSourceDefs:[o]});return t.globalPlugins.push(p),e.default=p,Object.defineProperty(e,"__esModule",{value:!0}),e}({},FullCalendar,FullCalendar.Internal,ICAL);
package/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { createPlugin } from '@fullcalendar/core/index.js';
2
2
  import { addDays } from '@fullcalendar/core/internal.js';
3
- import * as ICAL from 'ical.js';
3
+ import ICAL from 'ical.js';
4
4
 
5
5
  /* eslint-disable */
6
6
  class IcalExpander {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fullcalendar/icalendar",
3
- "version": "7.0.0-beta.4",
3
+ "version": "7.0.0-rc.0",
4
4
  "title": "FullCalendar iCalendar Plugin",
5
5
  "description": "Display events from a public iCalendar feed",
6
6
  "keywords": [
@@ -13,8 +13,8 @@
13
13
  ],
14
14
  "homepage": "https://fullcalendar.io/docs/icalendar",
15
15
  "peerDependencies": {
16
- "@fullcalendar/core": "7.0.0-beta.4",
17
- "ical.js": "^1.4.0"
16
+ "@fullcalendar/core": "7.0.0-rc.0",
17
+ "ical.js": "^2.0.0"
18
18
  },
19
19
  "type": "module",
20
20
  "bugs": "https://fullcalendar.io/reporting-bugs",