@forcecalendar/core 2.1.41 → 2.1.43

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.
@@ -5,6 +5,7 @@
5
5
 
6
6
  import { ICSParser } from './ICSParser.js';
7
7
  import { Event } from '../events/Event.js';
8
+ import { RecurrenceEngineV2 } from '../events/RecurrenceEngineV2.js';
8
9
 
9
10
  export class ICSHandler {
10
11
  constructor(calendar) {
@@ -380,6 +381,7 @@ export class ICSHandler {
380
381
  const expanded = [];
381
382
  const rangeStart = dateRange?.start || new Date();
382
383
  const rangeEnd = dateRange?.end || new Date(Date.now() + 365 * 24 * 60 * 60 * 1000);
384
+ const recurrenceEngine = new RecurrenceEngineV2();
383
385
 
384
386
  for (const event of events) {
385
387
  if (!(event.recurring || event.recurrenceRule || event.recurrence)) {
@@ -387,26 +389,20 @@ export class ICSHandler {
387
389
  continue;
388
390
  }
389
391
 
390
- // TODO: Get instances from calendar's recurrence engine when implemented
391
- // For now, just include the base event
392
- const instances = [
393
- {
394
- start: event.start,
395
- end: event.end
396
- }
397
- ];
392
+ // Use RecurrenceEngineV2 to expand occurrences within the date range
393
+ const occurrences = recurrenceEngine.expandEvent(event, rangeStart, rangeEnd);
398
394
 
399
- // Add each instance as a separate event
400
- for (const instance of instances) {
395
+ // Add each occurrence as a separate event
396
+ for (const occurrence of occurrences) {
401
397
  expanded.push({
402
398
  ...event,
403
- id: `${event.id}-${instance.start.getTime()}`,
404
- start: instance.start,
405
- end: instance.end,
399
+ id: `${event.id}-${occurrence.start.getTime()}`,
400
+ start: occurrence.start,
401
+ end: occurrence.end,
406
402
  recurring: false,
407
403
  recurrenceRule: null,
408
- recurrence: null, // Remove recurrence from instances
409
- parentId: event.id // Reference to original
404
+ recurrence: null,
405
+ parentId: event.id
410
406
  });
411
407
  }
412
408
  }
@@ -281,6 +281,8 @@ export class SearchWorkerManager {
281
281
 
282
282
  this.pendingSearches.push({
283
283
  id: searchId,
284
+ query,
285
+ options,
284
286
  resolve
285
287
  });
286
288
 
@@ -349,7 +351,14 @@ export class SearchWorkerManager {
349
351
  processPendingSearches() {
350
352
  // Re-trigger pending searches after indexing
351
353
  for (const search of this.pendingSearches) {
352
- // Will be handled by worker
354
+ this.worker.postMessage({
355
+ type: 'search',
356
+ data: {
357
+ id: search.id,
358
+ query: search.query,
359
+ options: search.options
360
+ }
361
+ });
353
362
  }
354
363
  }
355
364
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forcecalendar/core",
3
- "version": "2.1.41",
3
+ "version": "2.1.43",
4
4
  "type": "module",
5
5
  "private": false,
6
6
  "description": "A modern, lightweight, framework-agnostic calendar engine optimized for Salesforce",