beeple-toolkit 1.0.43 → 1.0.45

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.
@@ -1,8 +1,8 @@
1
- import type { TeamCardProps, TeamCardColor, TeamCardUser } from '../types';
1
+ import type { TeamCardProps, TeamCardColor, TeamCardUser, TeamCardUserDragData, TeamCardUserDropPayload } from '../types';
2
2
  import './teamCard.css';
3
- declare var __VLS_22: {};
3
+ declare var __VLS_24: {};
4
4
  type __VLS_Slots = {} & {
5
- 'progress-bar-tooltip'?: (props: typeof __VLS_22) => any;
5
+ 'progress-bar-tooltip'?: (props: typeof __VLS_24) => any;
6
6
  };
7
7
  declare const __VLS_base: import("vue").DefineComponent<TeamCardProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
8
8
  click: (event: MouseEvent) => any;
@@ -18,6 +18,8 @@ declare const __VLS_base: import("vue").DefineComponent<TeamCardProps, {}, {}, {
18
18
  index: number;
19
19
  event: MouseEvent;
20
20
  }) => any;
21
+ "user-drag-start": (payload: TeamCardUserDragData) => any;
22
+ "user-drop": (payload: TeamCardUserDropPayload) => any;
21
23
  "menu-action": (action: "copy" | "move" | "delete" | "edit") => any;
22
24
  "update:status": (status: "published" | "unpublished") => any;
23
25
  }, string, import("vue").PublicProps, Readonly<TeamCardProps> & Readonly<{
@@ -34,10 +36,13 @@ declare const __VLS_base: import("vue").DefineComponent<TeamCardProps, {}, {}, {
34
36
  index: number;
35
37
  event: MouseEvent;
36
38
  }) => any) | undefined;
39
+ "onUser-drag-start"?: ((payload: TeamCardUserDragData) => any) | undefined;
40
+ "onUser-drop"?: ((payload: TeamCardUserDropPayload) => any) | undefined;
37
41
  "onMenu-action"?: ((action: "copy" | "move" | "delete" | "edit") => any) | undefined;
38
42
  "onUpdate:status"?: ((status: "published" | "unpublished") => any) | undefined;
39
43
  }>, {
40
44
  color: TeamCardColor;
45
+ isDraggable: boolean;
41
46
  showUsers: boolean;
42
47
  showUserColor: boolean;
43
48
  selected: boolean;
@@ -1,5 +1,7 @@
1
- import type { TeamCardRights, TeamCardSummaryItem, TeamCardUser, TeamCardTranslations } from '../types';
1
+ import type { TeamCardRights, TeamCardSummaryItem, TeamCardUser, TeamCardUserDragData, TeamCardUserDropPayload, TeamCardTranslations } from '../types';
2
2
  type __VLS_Props = {
3
+ cardId?: string | number;
4
+ isDraggable?: boolean;
3
5
  teamSummary?: TeamCardSummaryItem[];
4
6
  users?: TeamCardUser[];
5
7
  showUsers?: boolean;
@@ -30,6 +32,8 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {},
30
32
  index: number;
31
33
  event: MouseEvent;
32
34
  }) => any;
35
+ "user-drag-start": (payload: TeamCardUserDragData) => any;
36
+ "user-drop": (payload: TeamCardUserDropPayload) => any;
33
37
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
34
38
  "onAdd-collaborator"?: (() => any) | undefined;
35
39
  "onUpdate:needed"?: ((value: number) => any) | undefined;
@@ -43,6 +47,8 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {},
43
47
  index: number;
44
48
  event: MouseEvent;
45
49
  }) => any) | undefined;
50
+ "onUser-drag-start"?: ((payload: TeamCardUserDragData) => any) | undefined;
51
+ "onUser-drop"?: ((payload: TeamCardUserDropPayload) => any) | undefined;
46
52
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
47
53
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
48
54
  declare const _default: typeof __VLS_export;
@@ -410,7 +410,30 @@ export interface TeamCardRights {
410
410
  update?: boolean;
411
411
  delete?: boolean;
412
412
  }
413
+ /** Data carried while dragging a user row (serialized through dataTransfer). */
414
+ export interface TeamCardUserDragData {
415
+ user: TeamCardUser;
416
+ index: number;
417
+ cardId?: string | number;
418
+ }
419
+ /** Payload emitted when a dragged user is dropped onto a card. */
420
+ export interface TeamCardUserDropPayload {
421
+ /** 'add' when dropped on empty space, 'replace' when dropped on an existing user row. */
422
+ type: 'add' | 'replace';
423
+ /** The user that was dragged (from the source card). */
424
+ dragged: TeamCardUserDragData;
425
+ /** Id of the card that received the drop. */
426
+ cardId?: string | number;
427
+ /** Target user (only for 'replace'). */
428
+ targetUser?: TeamCardUser;
429
+ /** Target user index within the receiving card (only for 'replace'). */
430
+ targetIndex?: number;
431
+ }
413
432
  export interface TeamCardProps {
433
+ /** Optional identifier used to distinguish cards in drag & drop payloads. */
434
+ id?: string | number;
435
+ /** Enables dragging users (by the handle) out of, and dropping users onto, this card. */
436
+ isDraggable?: boolean;
414
437
  color?: TeamCardColor;
415
438
  labels?: TeamCardLabel[];
416
439
  status?: TeamCardStatus;
@@ -1,4 +1,10 @@
1
+ import type { ButtonType } from '../components/constants';
1
2
  export type ToastType = 'success' | 'error' | 'warning' | 'info';
3
+ export interface ToastAction {
4
+ label: string;
5
+ action: () => void;
6
+ style?: ButtonType;
7
+ }
2
8
  export interface Toast {
3
9
  id: string;
4
10
  title?: string;
@@ -8,11 +14,7 @@ export interface Toast {
8
14
  persistent?: boolean;
9
15
  withIcon?: boolean;
10
16
  allowHtml?: boolean;
11
- actions?: Array<{
12
- label: string;
13
- action: () => void;
14
- style?: 'primary' | 'secondary';
15
- }>;
17
+ actions?: ToastAction[];
16
18
  }
17
19
  export interface ToastOptions {
18
20
  title?: string;
@@ -22,11 +24,7 @@ export interface ToastOptions {
22
24
  persistent?: boolean;
23
25
  withIcon?: boolean;
24
26
  allowHtml?: boolean;
25
- actions?: Array<{
26
- label: string;
27
- action: () => void;
28
- style?: 'primary' | 'secondary';
29
- }>;
27
+ actions?: ToastAction[];
30
28
  }
31
29
  export declare const useToastStore: import("pinia").StoreDefinition<"toast", Pick<{
32
30
  toasts: import("vue").Ref<{
@@ -41,7 +39,7 @@ export declare const useToastStore: import("pinia").StoreDefinition<"toast", Pic
41
39
  actions?: {
42
40
  label: string;
43
41
  action: () => void;
44
- style?: "primary" | "secondary" | undefined;
42
+ style?: ButtonType | undefined;
45
43
  }[] | undefined;
46
44
  }[], Toast[] | {
47
45
  id: string;
@@ -55,7 +53,7 @@ export declare const useToastStore: import("pinia").StoreDefinition<"toast", Pic
55
53
  actions?: {
56
54
  label: string;
57
55
  action: () => void;
58
- style?: "primary" | "secondary" | undefined;
56
+ style?: ButtonType | undefined;
59
57
  }[] | undefined;
60
58
  }[]>;
61
59
  addToast: (options: ToastOptions) => string;
@@ -78,7 +76,7 @@ export declare const useToastStore: import("pinia").StoreDefinition<"toast", Pic
78
76
  actions?: {
79
77
  label: string;
80
78
  action: () => void;
81
- style?: "primary" | "secondary" | undefined;
79
+ style?: ButtonType | undefined;
82
80
  }[] | undefined;
83
81
  }[], Toast[] | {
84
82
  id: string;
@@ -92,7 +90,7 @@ export declare const useToastStore: import("pinia").StoreDefinition<"toast", Pic
92
90
  actions?: {
93
91
  label: string;
94
92
  action: () => void;
95
- style?: "primary" | "secondary" | undefined;
93
+ style?: ButtonType | undefined;
96
94
  }[] | undefined;
97
95
  }[]>;
98
96
  addToast: (options: ToastOptions) => string;
@@ -115,7 +113,7 @@ export declare const useToastStore: import("pinia").StoreDefinition<"toast", Pic
115
113
  actions?: {
116
114
  label: string;
117
115
  action: () => void;
118
- style?: "primary" | "secondary" | undefined;
116
+ style?: ButtonType | undefined;
119
117
  }[] | undefined;
120
118
  }[], Toast[] | {
121
119
  id: string;
@@ -129,7 +127,7 @@ export declare const useToastStore: import("pinia").StoreDefinition<"toast", Pic
129
127
  actions?: {
130
128
  label: string;
131
129
  action: () => void;
132
- style?: "primary" | "secondary" | undefined;
130
+ style?: ButtonType | undefined;
133
131
  }[] | undefined;
134
132
  }[]>;
135
133
  addToast: (options: ToastOptions) => string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "beeple-toolkit",
3
- "version": "1.0.43",
3
+ "version": "1.0.45",
4
4
  "description": "Vue 3 component library beeple-toolkit",
5
5
  "keywords": [
6
6
  "vue",