@atlaskit/task-decision 19.2.7 → 19.2.9
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/CHANGELOG.md +14 -0
- package/afm-cc/tsconfig.json +2 -2
- package/afm-dev-agents/tsconfig.json +45 -0
- package/afm-passionfruit/tsconfig.json +45 -0
- package/afm-volt/tsconfig.json +7 -1
- package/constants/package.json +1 -1
- package/dist/types/components/DecisionItem.d.ts +3 -4
- package/dist/types/components/Item.d.ts +6 -6
- package/dist/types/components/ResourcedTaskItem.d.ts +14 -14
- package/dist/types/components/TaskItem.d.ts +9 -9
- package/dist/types/components/TaskList.d.ts +1 -1
- package/dist/types/types.d.ts +13 -14
- package/dist/types-ts4.5/components/DecisionItem.d.ts +3 -4
- package/dist/types-ts4.5/components/Item.d.ts +6 -6
- package/dist/types-ts4.5/components/ResourcedTaskItem.d.ts +14 -14
- package/dist/types-ts4.5/components/TaskItem.d.ts +9 -9
- package/dist/types-ts4.5/components/TaskList.d.ts +1 -1
- package/dist/types-ts4.5/types.d.ts +13 -14
- package/package.json +3 -4
- package/type-helpers/package.json +1 -1
- package/types/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @atlaskit/task-decision
|
|
2
2
|
|
|
3
|
+
## 19.2.9
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`0fdcb6f2f96fd`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/0fdcb6f2f96fd) -
|
|
8
|
+
Sorted type and interface props to improve Atlaskit docs
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
11
|
+
## 19.2.8
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- Updated dependencies
|
|
16
|
+
|
|
3
17
|
## 19.2.7
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
package/afm-cc/tsconfig.json
CHANGED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": "../../../../tsconfig.entry-points.dev-agents.json",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"declaration": true,
|
|
5
|
+
"target": "es5",
|
|
6
|
+
"outDir": "../../../../../dev-agents/tsDist/@atlaskit__task-decision/app",
|
|
7
|
+
"rootDir": "../",
|
|
8
|
+
"composite": true
|
|
9
|
+
},
|
|
10
|
+
"include": [
|
|
11
|
+
"../src/**/*.ts",
|
|
12
|
+
"../src/**/*.tsx"
|
|
13
|
+
],
|
|
14
|
+
"exclude": [
|
|
15
|
+
"../src/**/__tests__/*",
|
|
16
|
+
"../src/**/*.test.*",
|
|
17
|
+
"../src/**/test.*",
|
|
18
|
+
"../src/**/examples.*",
|
|
19
|
+
"../src/**/examples/*",
|
|
20
|
+
"../src/**/examples/**/*",
|
|
21
|
+
"../src/**/*.stories.*",
|
|
22
|
+
"../src/**/stories/*",
|
|
23
|
+
"../src/**/stories/**/*"
|
|
24
|
+
],
|
|
25
|
+
"references": [
|
|
26
|
+
{
|
|
27
|
+
"path": "../../../analytics/analytics-namespaced-context/afm-dev-agents/tsconfig.json"
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"path": "../../../analytics/analytics-next/afm-dev-agents/tsconfig.json"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"path": "../../../design-system/icon/afm-dev-agents/tsconfig.json"
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"path": "../../../platform/feature-flags/afm-dev-agents/tsconfig.json"
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"path": "../../../design-system/tokens/afm-dev-agents/tsconfig.json"
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
"path": "../../util-service-support/afm-dev-agents/tsconfig.json"
|
|
43
|
+
}
|
|
44
|
+
]
|
|
45
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": "../../../../tsconfig.entry-points.passionfruit.json",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"declaration": true,
|
|
5
|
+
"target": "es5",
|
|
6
|
+
"outDir": "../../../../../passionfruit/tsDist/@atlaskit__task-decision/app",
|
|
7
|
+
"rootDir": "../",
|
|
8
|
+
"composite": true
|
|
9
|
+
},
|
|
10
|
+
"include": [
|
|
11
|
+
"../src/**/*.ts",
|
|
12
|
+
"../src/**/*.tsx"
|
|
13
|
+
],
|
|
14
|
+
"exclude": [
|
|
15
|
+
"../src/**/__tests__/*",
|
|
16
|
+
"../src/**/*.test.*",
|
|
17
|
+
"../src/**/test.*",
|
|
18
|
+
"../src/**/examples.*",
|
|
19
|
+
"../src/**/examples/*",
|
|
20
|
+
"../src/**/examples/**/*",
|
|
21
|
+
"../src/**/*.stories.*",
|
|
22
|
+
"../src/**/stories/*",
|
|
23
|
+
"../src/**/stories/**/*"
|
|
24
|
+
],
|
|
25
|
+
"references": [
|
|
26
|
+
{
|
|
27
|
+
"path": "../../../analytics/analytics-namespaced-context/afm-passionfruit/tsconfig.json"
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"path": "../../../analytics/analytics-next/afm-passionfruit/tsconfig.json"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"path": "../../../design-system/icon/afm-passionfruit/tsconfig.json"
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"path": "../../../platform/feature-flags/afm-passionfruit/tsconfig.json"
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"path": "../../../design-system/tokens/afm-passionfruit/tsconfig.json"
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
"path": "../../util-service-support/afm-passionfruit/tsconfig.json"
|
|
43
|
+
}
|
|
44
|
+
]
|
|
45
|
+
}
|
package/afm-volt/tsconfig.json
CHANGED
|
@@ -14,7 +14,13 @@
|
|
|
14
14
|
"exclude": [
|
|
15
15
|
"../src/**/__tests__/*",
|
|
16
16
|
"../src/**/*.test.*",
|
|
17
|
-
"../src/**/test.*"
|
|
17
|
+
"../src/**/test.*",
|
|
18
|
+
"../src/**/examples.*",
|
|
19
|
+
"../src/**/examples/*",
|
|
20
|
+
"../src/**/examples/**/*",
|
|
21
|
+
"../src/**/*.stories.*",
|
|
22
|
+
"../src/**/stories/*",
|
|
23
|
+
"../src/**/stories/**/*"
|
|
18
24
|
],
|
|
19
25
|
"references": [
|
|
20
26
|
{
|
package/constants/package.json
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { type Appearance, type ContentRef } from '../types';
|
|
3
2
|
export interface Props {
|
|
3
|
+
appearance?: Appearance;
|
|
4
4
|
children?: any;
|
|
5
5
|
contentRef?: ContentRef;
|
|
6
|
-
placeholder?: string;
|
|
7
|
-
showPlaceholder?: boolean;
|
|
8
|
-
appearance?: Appearance;
|
|
9
6
|
dataAttributes?: {
|
|
10
7
|
[key: string]: string | number;
|
|
11
8
|
};
|
|
9
|
+
placeholder?: string;
|
|
10
|
+
showPlaceholder?: boolean;
|
|
12
11
|
}
|
|
13
12
|
declare const DecisionItem: ({ appearance, children, contentRef, placeholder, showPlaceholder, dataAttributes, }: Props) => JSX.Element;
|
|
14
13
|
export default DecisionItem;
|
|
@@ -5,17 +5,17 @@
|
|
|
5
5
|
import { PureComponent } from 'react';
|
|
6
6
|
import { type Appearance, type ContentRef, type TaskType, type DecisionType } from '../types';
|
|
7
7
|
export interface Props {
|
|
8
|
-
icon: JSX.Element;
|
|
9
|
-
itemType: TaskType | DecisionType;
|
|
10
|
-
children?: any;
|
|
11
8
|
appearance?: Appearance;
|
|
9
|
+
checkBoxId?: string;
|
|
10
|
+
children?: any;
|
|
12
11
|
contentRef?: ContentRef;
|
|
13
|
-
placeholder?: string;
|
|
14
|
-
showPlaceholder?: boolean;
|
|
15
12
|
dataAttributes?: {
|
|
16
13
|
[key: string]: string | number;
|
|
17
14
|
};
|
|
18
|
-
|
|
15
|
+
icon: JSX.Element;
|
|
16
|
+
itemType: TaskType | DecisionType;
|
|
17
|
+
placeholder?: string;
|
|
18
|
+
showPlaceholder?: boolean;
|
|
19
19
|
}
|
|
20
20
|
export default class Item extends PureComponent<Props, {}> {
|
|
21
21
|
static defaultProps: Partial<Props>;
|
|
@@ -2,25 +2,25 @@ import React, { type Ref } from 'react';
|
|
|
2
2
|
import { PureComponent } from 'react';
|
|
3
3
|
import { type Appearance, type ContentRef, type TaskDecisionProvider } from '../types';
|
|
4
4
|
export interface Props {
|
|
5
|
-
taskId: string;
|
|
6
|
-
isDone?: boolean;
|
|
7
|
-
isRenderer?: boolean;
|
|
8
|
-
isFocused?: boolean;
|
|
9
|
-
onChange?: (taskId: string, isChecked: boolean) => void;
|
|
10
|
-
onClick?: () => void;
|
|
11
|
-
contentRef?: ContentRef;
|
|
12
|
-
children?: any;
|
|
13
|
-
taskDecisionProvider?: Promise<TaskDecisionProvider>;
|
|
14
|
-
objectAri?: string;
|
|
15
|
-
showPlaceholder?: boolean;
|
|
16
|
-
placeholder?: string;
|
|
17
5
|
appearance?: Appearance;
|
|
18
|
-
|
|
6
|
+
children?: any;
|
|
7
|
+
contentRef?: ContentRef;
|
|
19
8
|
dataAttributes?: {
|
|
20
9
|
[key: string]: string | number;
|
|
21
10
|
};
|
|
22
|
-
|
|
11
|
+
disabled?: boolean;
|
|
23
12
|
disableOnChange?: boolean;
|
|
13
|
+
inputRef?: Ref<HTMLInputElement>;
|
|
14
|
+
isDone?: boolean;
|
|
15
|
+
isFocused?: boolean;
|
|
16
|
+
isRenderer?: boolean;
|
|
17
|
+
objectAri?: string;
|
|
18
|
+
onChange?: (taskId: string, isChecked: boolean) => void;
|
|
19
|
+
onClick?: () => void;
|
|
20
|
+
placeholder?: string;
|
|
21
|
+
showPlaceholder?: boolean;
|
|
22
|
+
taskDecisionProvider?: Promise<TaskDecisionProvider>;
|
|
23
|
+
taskId: string;
|
|
24
24
|
}
|
|
25
25
|
export interface State {
|
|
26
26
|
isDone?: boolean;
|
|
@@ -6,22 +6,22 @@ import React, { type Ref } from 'react';
|
|
|
6
6
|
import { type Appearance, type ContentRef } from '../types';
|
|
7
7
|
import { type WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
|
|
8
8
|
export interface Props {
|
|
9
|
-
|
|
9
|
+
appearance?: Appearance;
|
|
10
|
+
children?: any;
|
|
11
|
+
contentRef?: ContentRef;
|
|
12
|
+
dataAttributes?: {
|
|
13
|
+
[key: string]: string | number;
|
|
14
|
+
};
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
inputRef?: Ref<HTMLInputElement>;
|
|
10
17
|
isDone?: boolean;
|
|
11
18
|
isFocused?: boolean;
|
|
12
19
|
isRenderer?: boolean;
|
|
13
20
|
onChange?: (taskId: string, isChecked: boolean) => void;
|
|
14
21
|
onClick?: () => void;
|
|
15
|
-
contentRef?: ContentRef;
|
|
16
|
-
children?: any;
|
|
17
22
|
placeholder?: string;
|
|
18
23
|
showPlaceholder?: boolean;
|
|
19
|
-
|
|
20
|
-
disabled?: boolean;
|
|
21
|
-
dataAttributes?: {
|
|
22
|
-
[key: string]: string | number;
|
|
23
|
-
};
|
|
24
|
-
inputRef?: Ref<HTMLInputElement>;
|
|
24
|
+
taskId: string;
|
|
25
25
|
}
|
|
26
26
|
declare const _default: React.ForwardRefExoticComponent<Omit<Props, keyof WithAnalyticsEventsProps> & React.RefAttributes<any>>;
|
|
27
27
|
export default _default;
|
package/dist/types/types.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { type ServiceConfig } from '@atlaskit/util-service-support';
|
|
3
2
|
export type DecisionState = 'DECIDED';
|
|
4
3
|
export type DecisionStatus = 'CREATED';
|
|
@@ -10,20 +9,20 @@ export interface ContentRef {
|
|
|
10
9
|
(ref: HTMLElement | null): void;
|
|
11
10
|
}
|
|
12
11
|
export interface ObjectKey {
|
|
13
|
-
localId: string;
|
|
14
12
|
containerAri?: string;
|
|
13
|
+
localId: string;
|
|
15
14
|
objectAri: string;
|
|
16
15
|
}
|
|
17
16
|
export interface BaseItem<S> extends ObjectKey {
|
|
18
|
-
state: S;
|
|
19
17
|
lastUpdateDate: Date;
|
|
18
|
+
state: S;
|
|
20
19
|
type: DecisionType | TaskType;
|
|
21
20
|
}
|
|
22
21
|
export interface ServiceDecision {
|
|
23
22
|
creationDate?: string;
|
|
24
23
|
creatorId?: UserId;
|
|
25
|
-
lastUpdaterId?: UserId;
|
|
26
24
|
lastUpdateDate: string;
|
|
25
|
+
lastUpdaterId?: UserId;
|
|
27
26
|
localId: string;
|
|
28
27
|
objectAri: string;
|
|
29
28
|
participants?: UserId[];
|
|
@@ -48,8 +47,8 @@ export interface ServiceTaskState {
|
|
|
48
47
|
export interface Decision extends BaseItem<DecisionState> {
|
|
49
48
|
creationDate?: Date;
|
|
50
49
|
creator?: UserId;
|
|
51
|
-
lastUpdater?: UserId;
|
|
52
50
|
lastUpdateDate: Date;
|
|
51
|
+
lastUpdater?: UserId;
|
|
53
52
|
participants?: UserId[];
|
|
54
53
|
status: DecisionStatus;
|
|
55
54
|
type: DecisionType;
|
|
@@ -59,8 +58,8 @@ export type UserId = string;
|
|
|
59
58
|
export interface ServiceTask {
|
|
60
59
|
creationDate?: string;
|
|
61
60
|
creatorId?: UserId;
|
|
62
|
-
lastUpdaterId?: UserId;
|
|
63
61
|
lastUpdateDate: string;
|
|
62
|
+
lastUpdaterId?: UserId;
|
|
64
63
|
localId: string;
|
|
65
64
|
objectAri: string;
|
|
66
65
|
parentLocalId?: string;
|
|
@@ -72,8 +71,8 @@ export interface ServiceTask {
|
|
|
72
71
|
export interface Task extends BaseItem<TaskState> {
|
|
73
72
|
creationDate?: Date;
|
|
74
73
|
creator?: UserId;
|
|
75
|
-
lastUpdater?: UserId;
|
|
76
74
|
lastUpdateDate: Date;
|
|
75
|
+
lastUpdater?: UserId;
|
|
77
76
|
parentLocalId?: string;
|
|
78
77
|
participants?: UserId[];
|
|
79
78
|
position?: number;
|
|
@@ -82,8 +81,8 @@ export interface Task extends BaseItem<TaskState> {
|
|
|
82
81
|
export type Handler = (state: TaskState | DecisionState) => void;
|
|
83
82
|
export type RecentUpdatesId = string;
|
|
84
83
|
export interface RecentUpdateContext {
|
|
85
|
-
objectAri: string;
|
|
86
84
|
localId?: string;
|
|
85
|
+
objectAri: string;
|
|
87
86
|
}
|
|
88
87
|
/**
|
|
89
88
|
* A subscriber interface that can be called back if there are new decisions/tasks/items
|
|
@@ -105,7 +104,6 @@ export interface RecentUpdatesListener {
|
|
|
105
104
|
recentUpdates(updateContext: RecentUpdateContext): void;
|
|
106
105
|
}
|
|
107
106
|
export interface TaskDecisionResourceConfig extends ServiceConfig {
|
|
108
|
-
pubSubClient?: PubSubClient;
|
|
109
107
|
/**
|
|
110
108
|
* Indicates if initial state for an action or decision is should be cached,
|
|
111
109
|
* from the content, i.e. was originally hydrated from the service initially,
|
|
@@ -117,20 +115,21 @@ export interface TaskDecisionResourceConfig extends ServiceConfig {
|
|
|
117
115
|
* If false the state will always be hydrated from the service on first view.
|
|
118
116
|
*/
|
|
119
117
|
disableServiceHydration?: boolean;
|
|
118
|
+
pubSubClient?: PubSubClient;
|
|
120
119
|
}
|
|
121
120
|
export interface TaskDecisionProvider {
|
|
122
|
-
unsubscribeRecentUpdates(id: RecentUpdatesId): void;
|
|
123
121
|
notifyRecentUpdates(updateContext: RecentUpdateContext): void;
|
|
124
|
-
toggleTask(objectKey: ObjectKey, state: TaskState): Promise<TaskState>;
|
|
125
122
|
subscribe(objectKey: ObjectKey, handler: Handler, item?: BaseItem<TaskState | DecisionState>): void;
|
|
123
|
+
toggleTask(objectKey: ObjectKey, state: TaskState): Promise<TaskState>;
|
|
126
124
|
unsubscribe(objectKey: ObjectKey, handler: Handler): void;
|
|
125
|
+
unsubscribeRecentUpdates(id: RecentUpdatesId): void;
|
|
127
126
|
}
|
|
128
127
|
/**
|
|
129
128
|
* Same as RendererContext in editor-core (don't want an direct dep though)
|
|
130
129
|
*/
|
|
131
130
|
export interface RendererContext {
|
|
132
|
-
objectAri: string;
|
|
133
131
|
containerAri?: string;
|
|
132
|
+
objectAri: string;
|
|
134
133
|
}
|
|
135
134
|
export interface RenderDocument {
|
|
136
135
|
(document: any, rendererContext?: RendererContext): JSX.Element;
|
|
@@ -148,10 +147,10 @@ export interface PubSubOnEvent<T = any> {
|
|
|
148
147
|
(event: string, data: T): void;
|
|
149
148
|
}
|
|
150
149
|
export interface PubSubClient {
|
|
151
|
-
on(eventAvi: string, listener: PubSubOnEvent): PubSubClient;
|
|
152
|
-
off(eventAvi: string, listener: PubSubOnEvent): PubSubClient;
|
|
153
150
|
join(aris: ARI[]): Promise<PubSubClient>;
|
|
154
151
|
leave(aris: ARI[]): Promise<PubSubClient>;
|
|
152
|
+
off(eventAvi: string, listener: PubSubOnEvent): PubSubClient;
|
|
153
|
+
on(eventAvi: string, listener: PubSubOnEvent): PubSubClient;
|
|
155
154
|
}
|
|
156
155
|
export declare enum PubSubSpecialEventType {
|
|
157
156
|
ERROR = "ERROR",
|
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { type Appearance, type ContentRef } from '../types';
|
|
3
2
|
export interface Props {
|
|
3
|
+
appearance?: Appearance;
|
|
4
4
|
children?: any;
|
|
5
5
|
contentRef?: ContentRef;
|
|
6
|
-
placeholder?: string;
|
|
7
|
-
showPlaceholder?: boolean;
|
|
8
|
-
appearance?: Appearance;
|
|
9
6
|
dataAttributes?: {
|
|
10
7
|
[key: string]: string | number;
|
|
11
8
|
};
|
|
9
|
+
placeholder?: string;
|
|
10
|
+
showPlaceholder?: boolean;
|
|
12
11
|
}
|
|
13
12
|
declare const DecisionItem: ({ appearance, children, contentRef, placeholder, showPlaceholder, dataAttributes, }: Props) => JSX.Element;
|
|
14
13
|
export default DecisionItem;
|
|
@@ -5,17 +5,17 @@
|
|
|
5
5
|
import { PureComponent } from 'react';
|
|
6
6
|
import { type Appearance, type ContentRef, type TaskType, type DecisionType } from '../types';
|
|
7
7
|
export interface Props {
|
|
8
|
-
icon: JSX.Element;
|
|
9
|
-
itemType: TaskType | DecisionType;
|
|
10
|
-
children?: any;
|
|
11
8
|
appearance?: Appearance;
|
|
9
|
+
checkBoxId?: string;
|
|
10
|
+
children?: any;
|
|
12
11
|
contentRef?: ContentRef;
|
|
13
|
-
placeholder?: string;
|
|
14
|
-
showPlaceholder?: boolean;
|
|
15
12
|
dataAttributes?: {
|
|
16
13
|
[key: string]: string | number;
|
|
17
14
|
};
|
|
18
|
-
|
|
15
|
+
icon: JSX.Element;
|
|
16
|
+
itemType: TaskType | DecisionType;
|
|
17
|
+
placeholder?: string;
|
|
18
|
+
showPlaceholder?: boolean;
|
|
19
19
|
}
|
|
20
20
|
export default class Item extends PureComponent<Props, {}> {
|
|
21
21
|
static defaultProps: Partial<Props>;
|
|
@@ -2,25 +2,25 @@ import React, { type Ref } from 'react';
|
|
|
2
2
|
import { PureComponent } from 'react';
|
|
3
3
|
import { type Appearance, type ContentRef, type TaskDecisionProvider } from '../types';
|
|
4
4
|
export interface Props {
|
|
5
|
-
taskId: string;
|
|
6
|
-
isDone?: boolean;
|
|
7
|
-
isRenderer?: boolean;
|
|
8
|
-
isFocused?: boolean;
|
|
9
|
-
onChange?: (taskId: string, isChecked: boolean) => void;
|
|
10
|
-
onClick?: () => void;
|
|
11
|
-
contentRef?: ContentRef;
|
|
12
|
-
children?: any;
|
|
13
|
-
taskDecisionProvider?: Promise<TaskDecisionProvider>;
|
|
14
|
-
objectAri?: string;
|
|
15
|
-
showPlaceholder?: boolean;
|
|
16
|
-
placeholder?: string;
|
|
17
5
|
appearance?: Appearance;
|
|
18
|
-
|
|
6
|
+
children?: any;
|
|
7
|
+
contentRef?: ContentRef;
|
|
19
8
|
dataAttributes?: {
|
|
20
9
|
[key: string]: string | number;
|
|
21
10
|
};
|
|
22
|
-
|
|
11
|
+
disabled?: boolean;
|
|
23
12
|
disableOnChange?: boolean;
|
|
13
|
+
inputRef?: Ref<HTMLInputElement>;
|
|
14
|
+
isDone?: boolean;
|
|
15
|
+
isFocused?: boolean;
|
|
16
|
+
isRenderer?: boolean;
|
|
17
|
+
objectAri?: string;
|
|
18
|
+
onChange?: (taskId: string, isChecked: boolean) => void;
|
|
19
|
+
onClick?: () => void;
|
|
20
|
+
placeholder?: string;
|
|
21
|
+
showPlaceholder?: boolean;
|
|
22
|
+
taskDecisionProvider?: Promise<TaskDecisionProvider>;
|
|
23
|
+
taskId: string;
|
|
24
24
|
}
|
|
25
25
|
export interface State {
|
|
26
26
|
isDone?: boolean;
|
|
@@ -6,22 +6,22 @@ import React, { type Ref } from 'react';
|
|
|
6
6
|
import { type Appearance, type ContentRef } from '../types';
|
|
7
7
|
import { type WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
|
|
8
8
|
export interface Props {
|
|
9
|
-
|
|
9
|
+
appearance?: Appearance;
|
|
10
|
+
children?: any;
|
|
11
|
+
contentRef?: ContentRef;
|
|
12
|
+
dataAttributes?: {
|
|
13
|
+
[key: string]: string | number;
|
|
14
|
+
};
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
inputRef?: Ref<HTMLInputElement>;
|
|
10
17
|
isDone?: boolean;
|
|
11
18
|
isFocused?: boolean;
|
|
12
19
|
isRenderer?: boolean;
|
|
13
20
|
onChange?: (taskId: string, isChecked: boolean) => void;
|
|
14
21
|
onClick?: () => void;
|
|
15
|
-
contentRef?: ContentRef;
|
|
16
|
-
children?: any;
|
|
17
22
|
placeholder?: string;
|
|
18
23
|
showPlaceholder?: boolean;
|
|
19
|
-
|
|
20
|
-
disabled?: boolean;
|
|
21
|
-
dataAttributes?: {
|
|
22
|
-
[key: string]: string | number;
|
|
23
|
-
};
|
|
24
|
-
inputRef?: Ref<HTMLInputElement>;
|
|
24
|
+
taskId: string;
|
|
25
25
|
}
|
|
26
26
|
declare const _default: React.ForwardRefExoticComponent<Omit<Props, keyof WithAnalyticsEventsProps> & React.RefAttributes<any>>;
|
|
27
27
|
export default _default;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { type ServiceConfig } from '@atlaskit/util-service-support';
|
|
3
2
|
export type DecisionState = 'DECIDED';
|
|
4
3
|
export type DecisionStatus = 'CREATED';
|
|
@@ -10,20 +9,20 @@ export interface ContentRef {
|
|
|
10
9
|
(ref: HTMLElement | null): void;
|
|
11
10
|
}
|
|
12
11
|
export interface ObjectKey {
|
|
13
|
-
localId: string;
|
|
14
12
|
containerAri?: string;
|
|
13
|
+
localId: string;
|
|
15
14
|
objectAri: string;
|
|
16
15
|
}
|
|
17
16
|
export interface BaseItem<S> extends ObjectKey {
|
|
18
|
-
state: S;
|
|
19
17
|
lastUpdateDate: Date;
|
|
18
|
+
state: S;
|
|
20
19
|
type: DecisionType | TaskType;
|
|
21
20
|
}
|
|
22
21
|
export interface ServiceDecision {
|
|
23
22
|
creationDate?: string;
|
|
24
23
|
creatorId?: UserId;
|
|
25
|
-
lastUpdaterId?: UserId;
|
|
26
24
|
lastUpdateDate: string;
|
|
25
|
+
lastUpdaterId?: UserId;
|
|
27
26
|
localId: string;
|
|
28
27
|
objectAri: string;
|
|
29
28
|
participants?: UserId[];
|
|
@@ -48,8 +47,8 @@ export interface ServiceTaskState {
|
|
|
48
47
|
export interface Decision extends BaseItem<DecisionState> {
|
|
49
48
|
creationDate?: Date;
|
|
50
49
|
creator?: UserId;
|
|
51
|
-
lastUpdater?: UserId;
|
|
52
50
|
lastUpdateDate: Date;
|
|
51
|
+
lastUpdater?: UserId;
|
|
53
52
|
participants?: UserId[];
|
|
54
53
|
status: DecisionStatus;
|
|
55
54
|
type: DecisionType;
|
|
@@ -59,8 +58,8 @@ export type UserId = string;
|
|
|
59
58
|
export interface ServiceTask {
|
|
60
59
|
creationDate?: string;
|
|
61
60
|
creatorId?: UserId;
|
|
62
|
-
lastUpdaterId?: UserId;
|
|
63
61
|
lastUpdateDate: string;
|
|
62
|
+
lastUpdaterId?: UserId;
|
|
64
63
|
localId: string;
|
|
65
64
|
objectAri: string;
|
|
66
65
|
parentLocalId?: string;
|
|
@@ -72,8 +71,8 @@ export interface ServiceTask {
|
|
|
72
71
|
export interface Task extends BaseItem<TaskState> {
|
|
73
72
|
creationDate?: Date;
|
|
74
73
|
creator?: UserId;
|
|
75
|
-
lastUpdater?: UserId;
|
|
76
74
|
lastUpdateDate: Date;
|
|
75
|
+
lastUpdater?: UserId;
|
|
77
76
|
parentLocalId?: string;
|
|
78
77
|
participants?: UserId[];
|
|
79
78
|
position?: number;
|
|
@@ -82,8 +81,8 @@ export interface Task extends BaseItem<TaskState> {
|
|
|
82
81
|
export type Handler = (state: TaskState | DecisionState) => void;
|
|
83
82
|
export type RecentUpdatesId = string;
|
|
84
83
|
export interface RecentUpdateContext {
|
|
85
|
-
objectAri: string;
|
|
86
84
|
localId?: string;
|
|
85
|
+
objectAri: string;
|
|
87
86
|
}
|
|
88
87
|
/**
|
|
89
88
|
* A subscriber interface that can be called back if there are new decisions/tasks/items
|
|
@@ -105,7 +104,6 @@ export interface RecentUpdatesListener {
|
|
|
105
104
|
recentUpdates(updateContext: RecentUpdateContext): void;
|
|
106
105
|
}
|
|
107
106
|
export interface TaskDecisionResourceConfig extends ServiceConfig {
|
|
108
|
-
pubSubClient?: PubSubClient;
|
|
109
107
|
/**
|
|
110
108
|
* Indicates if initial state for an action or decision is should be cached,
|
|
111
109
|
* from the content, i.e. was originally hydrated from the service initially,
|
|
@@ -117,20 +115,21 @@ export interface TaskDecisionResourceConfig extends ServiceConfig {
|
|
|
117
115
|
* If false the state will always be hydrated from the service on first view.
|
|
118
116
|
*/
|
|
119
117
|
disableServiceHydration?: boolean;
|
|
118
|
+
pubSubClient?: PubSubClient;
|
|
120
119
|
}
|
|
121
120
|
export interface TaskDecisionProvider {
|
|
122
|
-
unsubscribeRecentUpdates(id: RecentUpdatesId): void;
|
|
123
121
|
notifyRecentUpdates(updateContext: RecentUpdateContext): void;
|
|
124
|
-
toggleTask(objectKey: ObjectKey, state: TaskState): Promise<TaskState>;
|
|
125
122
|
subscribe(objectKey: ObjectKey, handler: Handler, item?: BaseItem<TaskState | DecisionState>): void;
|
|
123
|
+
toggleTask(objectKey: ObjectKey, state: TaskState): Promise<TaskState>;
|
|
126
124
|
unsubscribe(objectKey: ObjectKey, handler: Handler): void;
|
|
125
|
+
unsubscribeRecentUpdates(id: RecentUpdatesId): void;
|
|
127
126
|
}
|
|
128
127
|
/**
|
|
129
128
|
* Same as RendererContext in editor-core (don't want an direct dep though)
|
|
130
129
|
*/
|
|
131
130
|
export interface RendererContext {
|
|
132
|
-
objectAri: string;
|
|
133
131
|
containerAri?: string;
|
|
132
|
+
objectAri: string;
|
|
134
133
|
}
|
|
135
134
|
export interface RenderDocument {
|
|
136
135
|
(document: any, rendererContext?: RendererContext): JSX.Element;
|
|
@@ -148,10 +147,10 @@ export interface PubSubOnEvent<T = any> {
|
|
|
148
147
|
(event: string, data: T): void;
|
|
149
148
|
}
|
|
150
149
|
export interface PubSubClient {
|
|
151
|
-
on(eventAvi: string, listener: PubSubOnEvent): PubSubClient;
|
|
152
|
-
off(eventAvi: string, listener: PubSubOnEvent): PubSubClient;
|
|
153
150
|
join(aris: ARI[]): Promise<PubSubClient>;
|
|
154
151
|
leave(aris: ARI[]): Promise<PubSubClient>;
|
|
152
|
+
off(eventAvi: string, listener: PubSubOnEvent): PubSubClient;
|
|
153
|
+
on(eventAvi: string, listener: PubSubOnEvent): PubSubClient;
|
|
155
154
|
}
|
|
156
155
|
export declare enum PubSubSpecialEventType {
|
|
157
156
|
ERROR = "ERROR",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/task-decision",
|
|
3
|
-
"version": "19.2.
|
|
3
|
+
"version": "19.2.9",
|
|
4
4
|
"description": "Tasks and decisions react components",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"@atlaskit/analytics-namespaced-context": "^7.0.0",
|
|
44
44
|
"@atlaskit/analytics-next": "^11.1.0",
|
|
45
|
-
"@atlaskit/icon": "^
|
|
45
|
+
"@atlaskit/icon": "^28.0.0",
|
|
46
46
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
47
47
|
"@atlaskit/tokens": "^6.0.0",
|
|
48
48
|
"@atlaskit/util-service-support": "^6.3.0",
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"@atlaskit/analytics-listeners": "^9.0.0",
|
|
63
63
|
"@atlaskit/elements-test-helpers": "workspace:^",
|
|
64
64
|
"@atlaskit/ssr": "workspace:^",
|
|
65
|
-
"@atlaskit/util-data-test": "^18.
|
|
65
|
+
"@atlaskit/util-data-test": "^18.1.0",
|
|
66
66
|
"@testing-library/react": "^13.4.0",
|
|
67
67
|
"@testing-library/user-event": "^14.4.3",
|
|
68
68
|
"@types/url-search-params": "^0.10.0",
|
|
@@ -70,7 +70,6 @@
|
|
|
70
70
|
"enzyme": "^3.10.0",
|
|
71
71
|
"fetch-mock": "^8.0.0",
|
|
72
72
|
"sinon": "^2.2.0",
|
|
73
|
-
"typescript": "~5.4.2",
|
|
74
73
|
"url-search-params": "^0.10.0"
|
|
75
74
|
},
|
|
76
75
|
"techstack": {
|