@cocoar/vue-calendar 1.17.0 → 2.0.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.
Files changed (62) hide show
  1. package/dist/builders/calendar-builder.d.ts +179 -2
  2. package/dist/builders/calendar-builder.d.ts.map +1 -1
  3. package/dist/builders/types.d.ts +41 -0
  4. package/dist/builders/types.d.ts.map +1 -1
  5. package/dist/components/CoarAgendaView.vue.d.ts.map +1 -1
  6. package/dist/components/CoarCalendar.vue.d.ts.map +1 -1
  7. package/dist/components/CoarMonthView.vue.d.ts.map +1 -1
  8. package/dist/components/CoarTimeGrid.vue.d.ts.map +1 -1
  9. package/dist/components/CoarTimelineView.vue.d.ts +68 -0
  10. package/dist/components/CoarTimelineView.vue.d.ts.map +1 -0
  11. package/dist/components/CoarWorkWeekView.vue.d.ts +53 -0
  12. package/dist/components/CoarWorkWeekView.vue.d.ts.map +1 -0
  13. package/dist/components/internal/CoarEventDecorations.vue.d.ts +1 -1
  14. package/dist/components/internal/CoarEventDecorations.vue.d.ts.map +1 -1
  15. package/dist/composables/useViewWindow.d.ts.map +1 -1
  16. package/dist/core/dnd/move-math.d.ts +23 -0
  17. package/dist/core/dnd/move-math.d.ts.map +1 -1
  18. package/dist/core/index.d.ts +8 -15
  19. package/dist/core/index.d.ts.map +1 -1
  20. package/dist/core/temporal.d.ts +13 -0
  21. package/dist/core/temporal.d.ts.map +1 -1
  22. package/dist/core/timelineLayout.d.ts +77 -0
  23. package/dist/core/timelineLayout.d.ts.map +1 -0
  24. package/dist/core/types.d.ts +1 -1
  25. package/dist/core/types.d.ts.map +1 -1
  26. package/dist/core/viewWindow.d.ts +8 -1
  27. package/dist/core/viewWindow.d.ts.map +1 -1
  28. package/dist/{core-DK63eHat.js → core-D-gBBiQ5.js} +276 -400
  29. package/dist/core.js +3 -2
  30. package/dist/index.d.ts +5 -1
  31. package/dist/index.d.ts.map +1 -1
  32. package/dist/index.js +1739 -1232
  33. package/dist/move-math-vYSpEW-r.js +215 -0
  34. package/dist/recurrence/index.d.ts +70 -0
  35. package/dist/recurrence/index.d.ts.map +1 -0
  36. package/dist/recurrence/internal/default-engine.d.ts +20 -0
  37. package/dist/recurrence/internal/default-engine.d.ts.map +1 -0
  38. package/dist/recurrence/internal/dst-resolve.d.ts +12 -0
  39. package/dist/recurrence/internal/dst-resolve.d.ts.map +1 -0
  40. package/dist/recurrence/internal/engine-to-events.d.ts +38 -0
  41. package/dist/recurrence/internal/engine-to-events.d.ts.map +1 -0
  42. package/dist/recurrence/internal/series-to-engine.d.ts +4 -0
  43. package/dist/recurrence/internal/series-to-engine.d.ts.map +1 -0
  44. package/dist/recurrence/types.d.ts +252 -0
  45. package/dist/recurrence/types.d.ts.map +1 -0
  46. package/dist/recurrence-rrule-temporal/index.d.ts +12 -0
  47. package/dist/recurrence-rrule-temporal/index.d.ts.map +1 -0
  48. package/dist/recurrence-rrule-temporal.js +158 -0
  49. package/dist/recurrence.js +225 -0
  50. package/dist/types-fzCER_SC.js +4 -0
  51. package/dist/useTimelineView.d.ts +6 -0
  52. package/dist/useTimelineView.d.ts.map +1 -0
  53. package/dist/useWorkWeekView.d.ts +6 -0
  54. package/dist/useWorkWeekView.d.ts.map +1 -0
  55. package/dist/vue-calendar.css +1 -1
  56. package/package.json +12 -7
  57. package/dist/core/recurrence-public.d.ts +0 -59
  58. package/dist/core/recurrence-public.d.ts.map +0 -1
  59. package/dist/core/recurrence.d.ts +0 -112
  60. package/dist/core/recurrence.d.ts.map +0 -1
  61. package/dist/core/recurrenceWorker.d.ts +0 -62
  62. package/dist/core/recurrenceWorker.d.ts.map +0 -1
@@ -1,112 +0,0 @@
1
- /**
2
- * Recurrence engine — main-thread API.
3
- *
4
- * Two paths sharing one request/response shape:
5
- *
6
- * - `expandSync` — runs `rrule-rust` in the calling thread.
7
- * Cheapest for small workloads (single rule,
8
- * one-shot expansion). Blocks the main thread.
9
- *
10
- * - `expandAsync` — dispatches to a long-lived worker. Cheapest
11
- * for large workloads where main-thread blocking
12
- * would jank the UI. Pays a postMessage round-
13
- * trip (~ 1-2 ms) on top of the actual expansion.
14
- *
15
- * Spike E benchmarks both at four scales (W1-W4) and locks the
16
- * auto-dispatch threshold — when does the worker round-trip beat
17
- * in-thread? Per Spike B's measurements (`rrule-rust` warm path =
18
- * 0.6 ms / expansion), the in-thread cost is much lower than the
19
- * spike-plan hypothesis suggested, so the auto-dispatch threshold
20
- * lands at higher series counts than originally estimated.
21
- *
22
- * Wire format is the same in both modes; consumers swap engines by
23
- * choosing which function to call. A higher-level
24
- * `<CoarCalendar :recurrence-engine="...">` prop in Phase 1 will
25
- * pick automatically based on `series.length` against the locked
26
- * threshold.
27
- */
28
- export interface RecurrenceRequest {
29
- rules: ReadonlyArray<{
30
- seriesId: string;
31
- rruleString: string;
32
- }>;
33
- /** Window start as unix-ms (absolute timestamp). */
34
- windowStart: number;
35
- /** Window end as unix-ms (absolute timestamp), exclusive-ish. */
36
- windowEnd: number;
37
- }
38
- export interface RecurrenceRuleResult {
39
- seriesId: string;
40
- /** Unix-ms timestamps of every occurrence inside the window. */
41
- timestamps: Float64Array;
42
- }
43
- export interface RecurrenceResponse {
44
- results: RecurrenceRuleResult[];
45
- /** Time spent in actual expansion (ms). Excludes worker round-trip. */
46
- expansionMs: number;
47
- /** Per-rule errors; empty on full success. */
48
- errors: Array<{
49
- seriesId: string;
50
- message: string;
51
- }>;
52
- }
53
- /**
54
- * Synchronous in-thread expansion. Runs in the caller's thread; for
55
- * large workloads (≥ threshold), prefer `expandAsync`.
56
- */
57
- export declare function expandSync(req: RecurrenceRequest): RecurrenceResponse;
58
- /**
59
- * Asynchronous expansion via a long-lived worker. The worker is
60
- * lazily created on first use and reused for the lifetime of the
61
- * page. Cold-start (~ 175 ms WASM init) hits the first call; warm
62
- * calls cost ~ 1-2 ms postMessage round-trip plus the expansion
63
- * time.
64
- */
65
- export declare function expandAsync(req: RecurrenceRequest): Promise<RecurrenceResponse>;
66
- /**
67
- * Tear down the worker. Useful for tests or for apps that know
68
- * recurrence won't be needed any more.
69
- */
70
- export declare function shutdownRecurrenceWorker(): void;
71
- export interface RecurrenceEngine {
72
- /**
73
- * Expand a batch of recurring rules over a window. The engine
74
- * decides whether to run sync (in-thread) or async (worker)
75
- * per-call; consumers always await regardless.
76
- */
77
- expand(request: RecurrenceRequest): Promise<RecurrenceResponse>;
78
- }
79
- export interface DefaultRecurrenceEngineOptions {
80
- /**
81
- * Auto-dispatch threshold. Rules >= threshold → worker. Default
82
- * 200, locked empirically in Phase 0 Spike E (W1 sync stays
83
- * under one frame, W2+ blocks UI).
84
- */
85
- threshold?: number;
86
- }
87
- /**
88
- * Default engine: rrule-rust with auto-dispatch at the locked
89
- * threshold (200 rules by default, configurable).
90
- */
91
- export declare class DefaultRecurrenceEngine implements RecurrenceEngine {
92
- private threshold;
93
- constructor(opts?: DefaultRecurrenceEngineOptions);
94
- expand(request: RecurrenceRequest): Promise<RecurrenceResponse>;
95
- }
96
- /**
97
- * Forces every expansion through the synchronous in-thread path.
98
- * Useful for tests (no worker setup) and SSR (no Worker API).
99
- */
100
- export declare class SyncOnlyRecurrenceEngine implements RecurrenceEngine {
101
- expand(request: RecurrenceRequest): Promise<RecurrenceResponse>;
102
- }
103
- /**
104
- * Forces every expansion through the worker. Useful for diagnostic
105
- * purposes — never blocks the main thread, even for tiny inputs.
106
- * Production consumers should prefer `DefaultRecurrenceEngine` so
107
- * the small-batch fast path stays sync.
108
- */
109
- export declare class WorkerOnlyRecurrenceEngine implements RecurrenceEngine {
110
- expand(request: RecurrenceRequest): Promise<RecurrenceResponse>;
111
- }
112
- //# sourceMappingURL=recurrence.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"recurrence.d.ts","sourceRoot":"","sources":["../../src/core/recurrence.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAQH,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,aAAa,CAAC;QAAE,QAAQ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B,GAAG,OAAO,CAAC,kBAAkB,CAAC;CAGtE;AAED;;;;;GAKG;AACH,qBAAa,0BAA2B,YAAW,gBAAgB;IAC3D,MAAM,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,kBAAkB,CAAC;CAGtE"}
@@ -1,62 +0,0 @@
1
- /**
2
- * Recurrence expansion worker — runs `rrule-rust` off the main
3
- * thread. Imported via Vite's `?worker` syntax; only this file
4
- * actually executes in the worker context.
5
- *
6
- * The worker pays ~ 175 ms WASM init on first instantiation (per
7
- * Spike B browser cold-start measurement). Subsequent expansions
8
- * are sub-millisecond. The main thread keeps this worker alive for
9
- * the lifetime of the calendar; warm-path expansions cost only the
10
- * postMessage round-trip.
11
- *
12
- * Wire format (request → response):
13
- *
14
- * self.postMessage({
15
- * id: 7,
16
- * rules: [{ seriesId: 'standup', rruleString: 'DTSTART:...\nRRULE:...' }, …],
17
- * windowStart: 1717200000000,
18
- * windowEnd: 1719792000000,
19
- * });
20
- *
21
- * self.onmessage = (e) => {
22
- * // e.data: {
23
- * // id: 7,
24
- * // results: [{ seriesId, timestamps: Float64Array }, …],
25
- * // expansionMs: 0.6,
26
- * // errors: [{ seriesId, message }, …] // empty on success
27
- * // }
28
- * // Transferred: the Float64Array buffers themselves.
29
- * };
30
- *
31
- * Float64Array is a Transferable. Sending 7.000 timestamps as a
32
- * 56 KB ArrayBuffer is roughly free; structured-cloning the same
33
- * count of plain-object dates would cost milliseconds.
34
- */
35
- export interface RecurrenceRequest {
36
- id: number;
37
- rules: ReadonlyArray<{
38
- seriesId: string;
39
- rruleString: string;
40
- }>;
41
- windowStart: number;
42
- windowEnd: number;
43
- }
44
- export interface RecurrenceRuleResult {
45
- seriesId: string;
46
- /**
47
- * Unix-ms timestamps of every occurrence in the window. Always
48
- * sent as a Float64Array whose `.buffer` is in the transferList.
49
- */
50
- timestamps: Float64Array;
51
- }
52
- export interface RecurrenceResponse {
53
- id: number;
54
- results: RecurrenceRuleResult[];
55
- /** Worker-side time spent on actual expansion, in milliseconds. */
56
- expansionMs: number;
57
- errors: Array<{
58
- seriesId: string;
59
- message: string;
60
- }>;
61
- }
62
- //# sourceMappingURL=recurrenceWorker.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"recurrenceWorker.d.ts","sourceRoot":"","sources":["../../src/core/recurrenceWorker.ts"],"names":[],"mappings":"AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAIH,MAAM,WAAW,iBAAiB;IAChC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,aAAa,CAAC;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAChE,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,oBAAoB;IACnC,QAAQ,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,UAAU,EAAE,YAAY,CAAC;CAC1B;AAED,MAAM,WAAW,kBAAkB;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,oBAAoB,EAAE,CAAC;IAChC,mEAAmE;IACnE,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,KAAK,CAAC;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CACtD"}