@tasknotes/calendar 0.1.7 → 0.1.8

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/dist/esm/index.js CHANGED
@@ -7,7 +7,7 @@ import {
7
7
  TIMELINE_UNIT_DAYS,
8
8
  defaultOptions,
9
9
  localeFirstDay
10
- } from "./chunk-EDRCVOY7.js";
10
+ } from "./chunk-EXKFHPW2.js";
11
11
  import {
12
12
  DAY_MS,
13
13
  ItemStore,
package/dist/esm/react.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  Calendar
3
- } from "./chunk-EDRCVOY7.js";
3
+ } from "./chunk-EXKFHPW2.js";
4
4
  import "./chunk-66A6EMCU.js";
5
5
 
6
6
  // src/react/index.tsx
@@ -25,6 +25,7 @@ export interface CalendarItem<D = unknown> {
25
25
  backgroundColor?: string;
26
26
  borderColor?: string;
27
27
  textColor?: string;
28
+ timeDisplay?: "start" | "range";
28
29
  className?: string | string[];
29
30
  /** Host-managed temporary placement: inert, mirror-styled and never hidden by event limits. */
30
31
  preview?: boolean;
@@ -25,6 +25,7 @@ export interface CalendarItem<D = unknown> {
25
25
  backgroundColor?: string;
26
26
  borderColor?: string;
27
27
  textColor?: string;
28
+ timeDisplay?: "start" | "range";
28
29
  className?: string | string[];
29
30
  /** Host-managed temporary placement: inert, mirror-styled and never hidden by event limits. */
30
31
  preview?: boolean;
@@ -37,6 +37,11 @@ export declare class Calendar<D = unknown> implements ViewContext<D> {
37
37
  scroll: number;
38
38
  };
39
39
  draggingId: string | null;
40
+ private listDragPreview;
41
+ private dragSources;
42
+ private dragScrollFrame;
43
+ private readonly dragScrollOrigins;
44
+ private readonly itemWriteStates;
40
45
  dragRow: {
41
46
  id: string;
42
47
  rowId: string;
@@ -53,6 +58,7 @@ export declare class Calendar<D = unknown> implements ViewContext<D> {
53
58
  private session;
54
59
  private selection;
55
60
  private suppressClick;
61
+ private cancelledPointerId;
56
62
  private selectedIds;
57
63
  private popover;
58
64
  private timer;
@@ -136,7 +142,7 @@ export declare class Calendar<D = unknown> implements ViewContext<D> {
136
142
  suppressNextClick(): void;
137
143
  dayArg(day: Day): DayArg;
138
144
  dayClasses(day: Day): string[];
139
- isEditable(n: NormalizedItem<D>, what: "start" | "duration"): boolean;
145
+ isEditable(n: NormalizedItem<D>, what: "start" | "duration", presentation?: boolean): boolean;
140
146
  navLink(day: Day, label: Node | string, cls: string): HTMLElement;
141
147
  navigate(day: Day, jsEvent: MouseEvent | KeyboardEvent, view?: "day" | "month"): void;
142
148
  createItemEl(meta: ElMeta<D>): HTMLElement;
@@ -197,6 +203,7 @@ export declare class Calendar<D = unknown> implements ViewContext<D> {
197
203
  private readonly onDocPointerDown;
198
204
  private readonly onPointerDown;
199
205
  private activate;
206
+ private startDragScroll;
200
207
  private readonly onTouchMove;
201
208
  private readonly onPointerMove;
202
209
  private readonly onPointerUp;
@@ -204,6 +211,7 @@ export declare class Calendar<D = unknown> implements ViewContext<D> {
204
211
  private readonly onDocKeyDown;
205
212
  /** Proposal for the current pointer position. */
206
213
  private track;
214
+ private invalidateProposal;
207
215
  private trackExternal;
208
216
  private externalItem;
209
217
  private timelineSnap;
@@ -222,6 +230,7 @@ export declare class Calendar<D = unknown> implements ViewContext<D> {
222
230
  /** Ends the current pointer session, committing unless `cancel`. */
223
231
  private endSession;
224
232
  private commit;
233
+ private applyItemWriteState;
225
234
  /** Runs in the capture phase so the click ending a drag never reaches content inside the calendar, React portals included. */
226
235
  private readonly onClickCapture;
227
236
  private readonly onClick;
@@ -37,6 +37,11 @@ export declare class Calendar<D = unknown> implements ViewContext<D> {
37
37
  scroll: number;
38
38
  };
39
39
  draggingId: string | null;
40
+ private listDragPreview;
41
+ private dragSources;
42
+ private dragScrollFrame;
43
+ private readonly dragScrollOrigins;
44
+ private readonly itemWriteStates;
40
45
  dragRow: {
41
46
  id: string;
42
47
  rowId: string;
@@ -53,6 +58,7 @@ export declare class Calendar<D = unknown> implements ViewContext<D> {
53
58
  private session;
54
59
  private selection;
55
60
  private suppressClick;
61
+ private cancelledPointerId;
56
62
  private selectedIds;
57
63
  private popover;
58
64
  private timer;
@@ -136,7 +142,7 @@ export declare class Calendar<D = unknown> implements ViewContext<D> {
136
142
  suppressNextClick(): void;
137
143
  dayArg(day: Day): DayArg;
138
144
  dayClasses(day: Day): string[];
139
- isEditable(n: NormalizedItem<D>, what: "start" | "duration"): boolean;
145
+ isEditable(n: NormalizedItem<D>, what: "start" | "duration", presentation?: boolean): boolean;
140
146
  navLink(day: Day, label: Node | string, cls: string): HTMLElement;
141
147
  navigate(day: Day, jsEvent: MouseEvent | KeyboardEvent, view?: "day" | "month"): void;
142
148
  createItemEl(meta: ElMeta<D>): HTMLElement;
@@ -197,6 +203,7 @@ export declare class Calendar<D = unknown> implements ViewContext<D> {
197
203
  private readonly onDocPointerDown;
198
204
  private readonly onPointerDown;
199
205
  private activate;
206
+ private startDragScroll;
200
207
  private readonly onTouchMove;
201
208
  private readonly onPointerMove;
202
209
  private readonly onPointerUp;
@@ -204,6 +211,7 @@ export declare class Calendar<D = unknown> implements ViewContext<D> {
204
211
  private readonly onDocKeyDown;
205
212
  /** Proposal for the current pointer position. */
206
213
  private track;
214
+ private invalidateProposal;
207
215
  private trackExternal;
208
216
  private externalItem;
209
217
  private timelineSnap;
@@ -222,6 +230,7 @@ export declare class Calendar<D = unknown> implements ViewContext<D> {
222
230
  /** Ends the current pointer session, committing unless `cancel`. */
223
231
  private endSession;
224
232
  private commit;
233
+ private applyItemWriteState;
225
234
  /** Runs in the capture phase so the click ending a drag never reaches content inside the calendar, React portals included. */
226
235
  private readonly onClickCapture;
227
236
  private readonly onClick;
@@ -16,7 +16,7 @@ export interface ViewInfo {
16
16
  title: string;
17
17
  /**
18
18
  * The days whose items the calendar can show: `range`, extended to the
19
- * end of the days a date strip is showing so their dots are right. Load
19
+ * full window of days a date strip is showing so their dots are right. Load
20
20
  * items for this range; `onRangeChange` fires when it changes too.
21
21
  */
22
22
  dataRange: DateRange;
@@ -332,7 +332,7 @@ export interface CalendarOptions<D = unknown> {
332
332
  * the tap target: dots ignore the pointer and are hidden from assistive
333
333
  * technology, and the cell is labelled with its item count.
334
334
  */
335
- monthDisplay: "full" | "dots";
335
+ monthDisplay: "full" | "dots" | "chips";
336
336
  /** "local" or an IANA name. */
337
337
  timeZone: string;
338
338
  locale: string | undefined;
@@ -16,7 +16,7 @@ export interface ViewInfo {
16
16
  title: string;
17
17
  /**
18
18
  * The days whose items the calendar can show: `range`, extended to the
19
- * end of the days a date strip is showing so their dots are right. Load
19
+ * full window of days a date strip is showing so their dots are right. Load
20
20
  * items for this range; `onRangeChange` fires when it changes too.
21
21
  */
22
22
  dataRange: DateRange;
@@ -332,7 +332,7 @@ export interface CalendarOptions<D = unknown> {
332
332
  * the tap target: dots ignore the pointer and are hidden from assistive
333
333
  * technology, and the cell is labelled with its item count.
334
334
  */
335
- monthDisplay: "full" | "dots";
335
+ monthDisplay: "full" | "dots" | "chips";
336
336
  /** "local" or an IANA name. */
337
337
  timeZone: string;
338
338
  locale: string | undefined;
@@ -13,7 +13,7 @@ export declare class DayGridView<D> implements View {
13
13
  private morePx;
14
14
  private topPx;
15
15
  private lastHeights;
16
- private readonly dotsMode;
16
+ private dotsMode;
17
17
  constructor(ctx: ViewContext<D>);
18
18
  private daysPerWeek;
19
19
  private sizeKey;
@@ -13,7 +13,7 @@ export declare class DayGridView<D> implements View {
13
13
  private morePx;
14
14
  private topPx;
15
15
  private lastHeights;
16
- private readonly dotsMode;
16
+ private dotsMode;
17
17
  constructor(ctx: ViewContext<D>);
18
18
  private daysPerWeek;
19
19
  private sizeKey;
@@ -21,6 +21,7 @@ export declare class YearView<D> implements View {
21
21
  top: number;
22
22
  left: number;
23
23
  }): void;
24
+ revealDay(day: Day): void;
24
25
  elementsFor(_id: string): HTMLElement[];
25
26
  destroy(): void;
26
27
  }
@@ -21,6 +21,7 @@ export declare class YearView<D> implements View {
21
21
  top: number;
22
22
  left: number;
23
23
  }): void;
24
+ revealDay(day: Day): void;
24
25
  elementsFor(_id: string): HTMLElement[];
25
26
  destroy(): void;
26
27
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tasknotes/calendar",
3
- "version": "0.1.7",
3
+ "version": "0.1.8",
4
4
  "description": "Task-native calendar engine for TaskNotes: incremental layout, time grid, month, list, year and timeline views.",
5
5
  "license": "MIT",
6
6
  "type": "module",