@taskctrl/canvas-timeline 0.6.0 → 0.8.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.
@@ -5,3 +5,17 @@ import type { LayoutEngine } from './LayoutEngine';
5
5
  export declare function hitTest(canvasX: number, canvasY: number, view: ViewState, tree: IntervalTree<Item>, layout: LayoutEngine, groups: Group[]): Item | null;
6
6
  export declare function hitTestGroup(canvasY: number, view: ViewState, groups: Group[]): Group | null;
7
7
  export declare function detectEdge(canvasX: number, item: Item, view: ViewState, threshold?: number): 'left' | 'right' | 'body';
8
+ /**
9
+ * Resolve the effective `canResize` for an item: a per-item `item.canResize`
10
+ * wins when present, otherwise the timeline-wide `globalCanResize` applies.
11
+ * Uses `??` (not `||`) so an explicit per-item `false` disables resize rather
12
+ * than falling through to the global value.
13
+ */
14
+ export declare function resolveCanResize(item: Item, globalCanResize: false | 'left' | 'right' | 'both'): false | 'left' | 'right' | 'both';
15
+ /**
16
+ * Resolve the effective `canMove` for an item: a per-item `item.canMove` wins
17
+ * when present, otherwise the timeline-wide `globalCanMove` applies. Uses `??`
18
+ * (not `||`) so an explicit per-item `false` disables moving rather than
19
+ * falling through to the global value.
20
+ */
21
+ export declare function resolveCanMove(item: Item, globalCanMove: boolean): boolean;
package/dist/types.d.ts CHANGED
@@ -14,6 +14,12 @@ export interface Item {
14
14
  end_time: number;
15
15
  parentId?: number;
16
16
  type?: string;
17
+ /** Per-item override of the timeline-wide `canResize` prop. When set, this
18
+ * wins for this item; when omitted, the global `canResize` applies. */
19
+ canResize?: false | 'left' | 'right' | 'both';
20
+ /** Per-item override of the timeline-wide `canMove` prop. When set, this
21
+ * wins for this item; when omitted, the global `canMove` applies. */
22
+ canMove?: boolean;
17
23
  [key: string]: unknown;
18
24
  }
19
25
  export interface ItemBounds {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@taskctrl/canvas-timeline",
3
- "version": "0.6.0",
3
+ "version": "0.8.0",
4
4
  "description": "High-performance canvas-based timeline component for React",
5
5
  "scripts": {
6
6
  "build": "rimraf ./dist && tsc && vite build",