@atlaskit/editor-plugin-tasks-and-decisions 6.4.2 → 6.4.4
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 +16 -0
- package/dist/cjs/nodeviews/DecisionItemNodeView.js +2 -2
- package/dist/es2019/nodeviews/DecisionItemNodeView.js +2 -2
- package/dist/esm/nodeviews/DecisionItemNodeView.js +2 -2
- package/dist/types/nodeviews/DecisionItemNodeView.d.ts +1 -1
- package/dist/types/nodeviews/TaskItemNodeView.d.ts +2 -2
- package/dist/types/nodeviews/hooks/use-show-placeholder.d.ts +1 -1
- package/dist/types/pm-plugins/helpers.d.ts +3 -3
- package/dist/types/pm-plugins/insert-commands.d.ts +1 -1
- package/dist/types/pm-plugins/types.d.ts +1 -1
- package/dist/types/tasksAndDecisionsPluginType.d.ts +4 -4
- package/dist/types/types/index.d.ts +15 -15
- package/dist/types/ui/Task/RequestToEditPopup.d.ts +4 -4
- package/dist/types/ui/Task/index.d.ts +8 -8
- package/dist/types/ui/Task/task-item-with-providers.d.ts +6 -6
- package/dist/types/ui/ToolbarDecision/index.d.ts +1 -1
- package/dist/types/ui/ToolbarTask/index.d.ts +1 -1
- package/dist/types-ts4.5/nodeviews/DecisionItemNodeView.d.ts +1 -1
- package/dist/types-ts4.5/nodeviews/TaskItemNodeView.d.ts +2 -2
- package/dist/types-ts4.5/nodeviews/hooks/use-show-placeholder.d.ts +1 -1
- package/dist/types-ts4.5/pm-plugins/helpers.d.ts +3 -3
- package/dist/types-ts4.5/pm-plugins/insert-commands.d.ts +1 -1
- package/dist/types-ts4.5/pm-plugins/types.d.ts +1 -1
- package/dist/types-ts4.5/tasksAndDecisionsPluginType.d.ts +4 -4
- package/dist/types-ts4.5/types/index.d.ts +15 -15
- package/dist/types-ts4.5/ui/Task/RequestToEditPopup.d.ts +4 -4
- package/dist/types-ts4.5/ui/Task/index.d.ts +8 -8
- package/dist/types-ts4.5/ui/Task/task-item-with-providers.d.ts +6 -6
- package/dist/types-ts4.5/ui/ToolbarDecision/index.d.ts +1 -1
- package/dist/types-ts4.5/ui/ToolbarTask/index.d.ts +1 -1
- package/package.json +3 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-tasks-and-decisions
|
|
2
2
|
|
|
3
|
+
## 6.4.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`265c1bf0cefa4`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/265c1bf0cefa4) -
|
|
8
|
+
Sorted type and interface props to improve Atlaskit docs
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
11
|
+
## 6.4.3
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [`d2a535bed291e`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/d2a535bed291e) -
|
|
16
|
+
[EDITOR-1153] Make sure that Tab works for range selections for `blockTaskItem`
|
|
17
|
+
- Updated dependencies
|
|
18
|
+
|
|
3
19
|
## 6.4.2
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
|
@@ -9,7 +9,7 @@ var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/cl
|
|
|
9
9
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
10
10
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
11
|
var _model = require("@atlaskit/editor-prosemirror/model");
|
|
12
|
-
var
|
|
12
|
+
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
13
13
|
var _decisionItemNodeSpec = require("./decisionItemNodeSpec");
|
|
14
14
|
/**
|
|
15
15
|
* NodeView for the DecisionItem node.
|
|
@@ -83,7 +83,7 @@ var DecisionItemNodeView = exports.DecisionItemNodeView = /*#__PURE__*/function
|
|
|
83
83
|
// This was discovered while implementing the platform_editor_debounce_portal_provider experiment
|
|
84
84
|
// And there will only be an issue if the experiment is enabled.
|
|
85
85
|
// As such, this fix is behind this experiment.
|
|
86
|
-
if (!(0,
|
|
86
|
+
if (!(0, _expValEquals.expValEquals)('platform_editor_debounce_portal_provider', 'isEnabled', true, false)) {
|
|
87
87
|
return false; // Let ProseMirror handle all mutations when experiment is disabled
|
|
88
88
|
}
|
|
89
89
|
if (!this.contentDOM) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
import { DOMSerializer } from '@atlaskit/editor-prosemirror/model';
|
|
3
|
-
import {
|
|
3
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
4
4
|
import { decisionItemToDOM } from './decisionItemNodeSpec';
|
|
5
5
|
|
|
6
6
|
/**
|
|
@@ -69,7 +69,7 @@ export class DecisionItemNodeView {
|
|
|
69
69
|
// This was discovered while implementing the platform_editor_debounce_portal_provider experiment
|
|
70
70
|
// And there will only be an issue if the experiment is enabled.
|
|
71
71
|
// As such, this fix is behind this experiment.
|
|
72
|
-
if (!
|
|
72
|
+
if (!expValEquals('platform_editor_debounce_portal_provider', 'isEnabled', true, false)) {
|
|
73
73
|
return false; // Let ProseMirror handle all mutations when experiment is disabled
|
|
74
74
|
}
|
|
75
75
|
if (!this.contentDOM) {
|
|
@@ -2,7 +2,7 @@ import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
|
2
2
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
3
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
4
4
|
import { DOMSerializer } from '@atlaskit/editor-prosemirror/model';
|
|
5
|
-
import {
|
|
5
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
6
6
|
import { decisionItemToDOM } from './decisionItemNodeSpec';
|
|
7
7
|
|
|
8
8
|
/**
|
|
@@ -77,7 +77,7 @@ export var DecisionItemNodeView = /*#__PURE__*/function () {
|
|
|
77
77
|
// This was discovered while implementing the platform_editor_debounce_portal_provider experiment
|
|
78
78
|
// And there will only be an issue if the experiment is enabled.
|
|
79
79
|
// As such, this fix is behind this experiment.
|
|
80
|
-
if (!
|
|
80
|
+
if (!expValEquals('platform_editor_debounce_portal_provider', 'isEnabled', true, false)) {
|
|
81
81
|
return false; // Let ProseMirror handle all mutations when experiment is disabled
|
|
82
82
|
}
|
|
83
83
|
if (!this.contentDOM) {
|
|
@@ -44,7 +44,7 @@ export declare class DecisionItemNodeView implements NodeView {
|
|
|
44
44
|
* const shouldIgnore = decisionItemNodeView.ignoreMutation(mutationRecord);
|
|
45
45
|
*/
|
|
46
46
|
ignoreMutation(mutation: MutationRecord | {
|
|
47
|
-
type: 'selection';
|
|
48
47
|
target: Node;
|
|
48
|
+
type: 'selection';
|
|
49
49
|
}): boolean;
|
|
50
50
|
}
|
|
@@ -6,8 +6,8 @@ import type { NodeView } from '@atlaskit/editor-prosemirror/view';
|
|
|
6
6
|
import type { TasksAndDecisionsPlugin } from '../tasksAndDecisionsPluginType';
|
|
7
7
|
interface TaskItemNodeViewOptions {
|
|
8
8
|
api: ExtractInjectionAPI<TasksAndDecisionsPlugin> | undefined;
|
|
9
|
-
placeholder?: string;
|
|
10
9
|
intl: IntlShape;
|
|
10
|
+
placeholder?: string;
|
|
11
11
|
}
|
|
12
12
|
export declare class TaskItemNodeView implements NodeView {
|
|
13
13
|
dom: Node;
|
|
@@ -31,8 +31,8 @@ export declare class TaskItemNodeView implements NodeView {
|
|
|
31
31
|
private updatePlaceholder;
|
|
32
32
|
update(node: PMNode): boolean;
|
|
33
33
|
ignoreMutation(mutation: MutationRecord | {
|
|
34
|
-
type: 'selection';
|
|
35
34
|
target: Node;
|
|
35
|
+
type: 'selection';
|
|
36
36
|
}): boolean;
|
|
37
37
|
destroy(): void;
|
|
38
38
|
}
|
|
@@ -2,8 +2,8 @@ import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
|
2
2
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
3
3
|
import type { TasksAndDecisionsPlugin } from '../../tasksAndDecisionsPluginType';
|
|
4
4
|
type Props2 = {
|
|
5
|
-
editorView: EditorView;
|
|
6
5
|
api: ExtractInjectionAPI<TasksAndDecisionsPlugin> | undefined;
|
|
6
|
+
editorView: EditorView;
|
|
7
7
|
getPos: () => number | undefined;
|
|
8
8
|
isContentNodeEmpty: boolean;
|
|
9
9
|
};
|
|
@@ -70,14 +70,14 @@ export declare function getTaskItemDataAtPos(view: EditorView): {
|
|
|
70
70
|
localId: any;
|
|
71
71
|
} | undefined;
|
|
72
72
|
export declare function getAllTaskItemsDataInRootTaskList(view: EditorView): {
|
|
73
|
+
index: number;
|
|
73
74
|
node: Node;
|
|
74
75
|
pos: number;
|
|
75
|
-
index: number;
|
|
76
76
|
}[] | undefined;
|
|
77
77
|
export declare function getCurrentTaskItemIndex(view: EditorView, allTaskItems: Array<{
|
|
78
|
+
index: number;
|
|
78
79
|
node: Node;
|
|
79
80
|
pos: number;
|
|
80
|
-
index: number;
|
|
81
81
|
}>): number;
|
|
82
82
|
export declare function getTaskItemDataToFocus(view: EditorView, direction: 'next' | 'previous'): {
|
|
83
83
|
pos: number;
|
|
@@ -89,6 +89,6 @@ export declare function removeCheckboxFocus(view: EditorView): void;
|
|
|
89
89
|
export declare function openRequestEditPopupAt(view: EditorView, pos: number): void;
|
|
90
90
|
export declare function closeRequestEditPopupAt(view: EditorView): void;
|
|
91
91
|
export declare function findFirstParentListNode($pos: ResolvedPos): {
|
|
92
|
-
pos: number;
|
|
93
92
|
node: Node;
|
|
93
|
+
pos: number;
|
|
94
94
|
} | null;
|
|
@@ -6,8 +6,8 @@ import type { EditorState, Selection, Transaction } from '@atlaskit/editor-prose
|
|
|
6
6
|
import type { TaskDecisionProvider } from '@atlaskit/task-decision/types';
|
|
7
7
|
import type { AddItemAttrs, AddItemTransactionCreator, GetContextIdentifier, TaskDecisionInputMethod, TaskDecisionListType } from '../types';
|
|
8
8
|
export declare const getListTypes: (listType: TaskDecisionListType, schema: Schema) => {
|
|
9
|
-
list: NodeType;
|
|
10
9
|
item: NodeType;
|
|
10
|
+
list: NodeType;
|
|
11
11
|
};
|
|
12
12
|
export declare const insertTaskDecisionAction: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined, getContextIdentifierProvider: GetContextIdentifier) => (state: EditorState, listType: TaskDecisionListType, inputMethod?: INPUT_METHOD.FORMATTING | INPUT_METHOD.QUICK_INSERT | TOOLBAR_MENU_TYPE, addItem?: AddItemTransactionCreator, listLocalId?: string, itemLocalId?: string, itemAttrs?: AddItemAttrs) => Transaction;
|
|
13
13
|
export declare const insertTaskDecisionCommand: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined, getContextIdentifierProvider: GetContextIdentifier) => (listType: TaskDecisionListType, inputMethod?: INPUT_METHOD.FORMATTING | INPUT_METHOD.QUICK_INSERT | TOOLBAR_MENU_TYPE, addItem?: AddItemTransactionCreator, listLocalId?: string, itemLocalId?: string) => Command;
|
|
@@ -14,12 +14,9 @@ export type TasksAndDecisionsPluginDependencies = [
|
|
|
14
14
|
OptionalPlugin<EditorViewModePlugin>
|
|
15
15
|
];
|
|
16
16
|
export type TasksAndDecisionsPlugin = NextEditorPlugin<'taskDecision', {
|
|
17
|
-
pluginConfiguration: TasksAndDecisionsPluginOptions | undefined;
|
|
18
|
-
sharedState: TaskAndDecisionsSharedState | undefined;
|
|
19
|
-
dependencies: TasksAndDecisionsPluginDependencies;
|
|
20
17
|
actions: {
|
|
21
|
-
insertTaskDecision: ReturnType<typeof insertTaskDecisionCommand>;
|
|
22
18
|
indentTaskList: ReturnType<typeof getIndentCommand>;
|
|
19
|
+
insertTaskDecision: ReturnType<typeof insertTaskDecisionCommand>;
|
|
23
20
|
outdentTaskList: ReturnType<typeof getUnindentCommand>;
|
|
24
21
|
setProvider: (provider: Promise<TaskDecisionProvider>) => Promise<boolean>;
|
|
25
22
|
};
|
|
@@ -27,4 +24,7 @@ export type TasksAndDecisionsPlugin = NextEditorPlugin<'taskDecision', {
|
|
|
27
24
|
updateEditPermission: (hasEditPermission: boolean | undefined) => EditorCommand;
|
|
28
25
|
updateHasRequestedEditPermission: (hasRequestedEditPermission: boolean) => EditorCommand;
|
|
29
26
|
};
|
|
27
|
+
dependencies: TasksAndDecisionsPluginDependencies;
|
|
28
|
+
pluginConfiguration: TasksAndDecisionsPluginOptions | undefined;
|
|
29
|
+
sharedState: TaskAndDecisionsSharedState | undefined;
|
|
30
30
|
}>;
|
|
@@ -9,25 +9,29 @@ import type { TaskDecisionProvider } from '@atlaskit/task-decision/types';
|
|
|
9
9
|
export type TaskDecisionListType = 'taskList' | 'decisionList';
|
|
10
10
|
export type TaskDecisionInputMethod = INPUT_METHOD.TOOLBAR | INPUT_METHOD.INSERT_MENU | INPUT_METHOD.QUICK_INSERT | INPUT_METHOD.FORMATTING | INPUT_METHOD.KEYBOARD;
|
|
11
11
|
export type ContextData = {
|
|
12
|
-
objectId: string;
|
|
13
12
|
containerId: string;
|
|
13
|
+
objectId: string;
|
|
14
14
|
userContext: USER_CONTEXT;
|
|
15
15
|
};
|
|
16
16
|
export type AddItemAttrs = Partial<DecisionItemDefinition['attrs']> | Partial<TaskItemDefinition['attrs']> | Partial<BlockTaskItemDefinition['attrs']>;
|
|
17
17
|
export type AddItemTransactionCreator = (opts: {
|
|
18
|
-
state: EditorState;
|
|
19
|
-
tr: Transaction;
|
|
20
|
-
list: NodeType;
|
|
21
18
|
item: NodeType;
|
|
22
|
-
listLocalId: string;
|
|
23
|
-
itemLocalId: string;
|
|
24
19
|
itemAttrs?: AddItemAttrs;
|
|
20
|
+
itemLocalId: string;
|
|
21
|
+
list: NodeType;
|
|
22
|
+
listLocalId: string;
|
|
23
|
+
state: EditorState;
|
|
24
|
+
tr: Transaction;
|
|
25
25
|
}) => Transaction | null;
|
|
26
26
|
/**
|
|
27
27
|
* Interface representing the options for the TaskDecisionPlugin.
|
|
28
28
|
* Extends the LongPressSelectionPluginOptions interface.
|
|
29
29
|
*/
|
|
30
30
|
export interface TasksAndDecisionsPluginOptions extends LongPressSelectionPluginOptions {
|
|
31
|
+
/**
|
|
32
|
+
* Allows the blockTaskItem node to be a child of taskList (taskItem variant that supports block children - currently only supports extension and is intended to support Confluence TinyMCE migration flows in conjunction with the Legacy Content Extension)
|
|
33
|
+
*/
|
|
34
|
+
allowBlockTaskItem?: boolean;
|
|
31
35
|
/**
|
|
32
36
|
* Indicates whether nested tasks are allowed.
|
|
33
37
|
* @default false
|
|
@@ -64,10 +68,6 @@ export interface TasksAndDecisionsPluginOptions extends LongPressSelectionPlugin
|
|
|
64
68
|
* Placeholder text to display when creating a task.
|
|
65
69
|
*/
|
|
66
70
|
taskPlaceholder?: string;
|
|
67
|
-
/**
|
|
68
|
-
* Allows the blockTaskItem node to be a child of taskList (taskItem variant that supports block children - currently only supports extension and is intended to support Confluence TinyMCE migration flows in conjunction with the Legacy Content Extension)
|
|
69
|
-
*/
|
|
70
|
-
allowBlockTaskItem?: boolean;
|
|
71
71
|
}
|
|
72
72
|
/**
|
|
73
73
|
* @private
|
|
@@ -76,24 +76,24 @@ export interface TasksAndDecisionsPluginOptions extends LongPressSelectionPlugin
|
|
|
76
76
|
*/
|
|
77
77
|
export type TaskDecisionPluginOptions = TasksAndDecisionsPluginOptions;
|
|
78
78
|
export type TaskDecisionPluginState = {
|
|
79
|
-
|
|
79
|
+
decorations: DecorationSet;
|
|
80
80
|
focusedTaskItemLocalId: string | null;
|
|
81
81
|
hasEditPermission?: boolean;
|
|
82
82
|
hasRequestedEditPermission?: boolean;
|
|
83
|
+
insideTaskDecisionItem: boolean;
|
|
84
|
+
openRequestToEditPopupAt?: number | null;
|
|
83
85
|
requestToEditContent?: () => void;
|
|
84
86
|
taskDecisionProvider: TaskDecisionProvider | undefined;
|
|
85
|
-
openRequestToEditPopupAt?: number | null;
|
|
86
|
-
decorations: DecorationSet;
|
|
87
87
|
};
|
|
88
88
|
export type TaskAndDecisionsSharedState = Pick<TaskDecisionPluginState, 'focusedTaskItemLocalId' | 'hasEditPermission' | 'requestToEditContent' | 'taskDecisionProvider' | 'hasRequestedEditPermission' | 'openRequestToEditPopupAt'> & {
|
|
89
|
-
isInsideTask: boolean;
|
|
90
89
|
indentDisabled: boolean;
|
|
90
|
+
isInsideTask: boolean;
|
|
91
91
|
outdentDisabled: boolean;
|
|
92
92
|
};
|
|
93
93
|
export type GetContextIdentifier = () => ContextIdentifierProvider | undefined;
|
|
94
94
|
export type TaskItemState = 'DONE' | 'TODO';
|
|
95
95
|
export type TaskItemInfoMeta = {
|
|
96
|
+
checkState: TaskItemState;
|
|
96
97
|
from: number;
|
|
97
98
|
to: number;
|
|
98
|
-
checkState: TaskItemState;
|
|
99
99
|
};
|
|
@@ -8,14 +8,14 @@ import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
|
8
8
|
import { type EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
9
9
|
import type { TasksAndDecisionsPlugin } from '../../tasksAndDecisionsPluginType';
|
|
10
10
|
interface Props {
|
|
11
|
-
|
|
12
|
-
mountTo?: HTMLElement;
|
|
11
|
+
api: ExtractInjectionAPI<TasksAndDecisionsPlugin> | undefined;
|
|
13
12
|
boundariesElement?: HTMLElement;
|
|
14
|
-
scrollableElement?: HTMLElement;
|
|
15
13
|
dispatchAnalyticsEvent?: DispatchAnalyticsEvent;
|
|
16
14
|
editorView: EditorView;
|
|
17
|
-
|
|
15
|
+
element: HTMLElement;
|
|
16
|
+
mountTo?: HTMLElement;
|
|
18
17
|
onClose: () => void;
|
|
18
|
+
scrollableElement?: HTMLElement;
|
|
19
19
|
}
|
|
20
20
|
export declare const RequestToEditPopup: ({ element, api, editorView, onClose, mountTo, boundariesElement, scrollableElement, }: Props) => JSX.Element | null;
|
|
21
21
|
export {};
|
|
@@ -7,20 +7,20 @@ import type { ContentRef } from '@atlaskit/task-decision';
|
|
|
7
7
|
import type { TasksAndDecisionsPlugin } from '../../tasksAndDecisionsPluginType';
|
|
8
8
|
import { type TaskAndDecisionsSharedState } from '../../types';
|
|
9
9
|
export interface TaskProps {
|
|
10
|
-
|
|
10
|
+
api: ExtractInjectionAPI<TasksAndDecisionsPlugin> | undefined;
|
|
11
|
+
children?: ReactElement<any>;
|
|
12
|
+
contentRef?: ContentRef;
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
disableOnChange?: boolean;
|
|
15
|
+
inputRef?: Ref<HTMLInputElement>;
|
|
11
16
|
isDone: boolean;
|
|
12
17
|
isFocused?: boolean;
|
|
13
|
-
contentRef?: ContentRef;
|
|
14
18
|
onChange?: (taskId: string, isChecked: boolean) => void;
|
|
15
19
|
onClick?: () => void;
|
|
16
20
|
placeholder?: string;
|
|
17
|
-
showPlaceholder?: boolean;
|
|
18
|
-
children?: ReactElement<any>;
|
|
19
21
|
providers?: ProviderFactory;
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
inputRef?: Ref<HTMLInputElement>;
|
|
23
|
-
api: ExtractInjectionAPI<TasksAndDecisionsPlugin> | undefined;
|
|
22
|
+
showPlaceholder?: boolean;
|
|
23
|
+
taskId: string;
|
|
24
24
|
}
|
|
25
25
|
type TaskItemProps = TaskProps & WrappedComponentProps & {
|
|
26
26
|
taskDecisionProvider: TaskAndDecisionsSharedState['taskDecisionProvider'] | undefined;
|
|
@@ -3,17 +3,17 @@ import React, { Component } from 'react';
|
|
|
3
3
|
import type { ContextIdentifierProvider } from '@atlaskit/editor-common/provider-factory';
|
|
4
4
|
import type { ContentRef, TaskDecisionProvider } from '@atlaskit/task-decision';
|
|
5
5
|
export interface Props {
|
|
6
|
-
|
|
6
|
+
children?: ReactElement<any>;
|
|
7
|
+
contentRef?: ContentRef;
|
|
8
|
+
contextIdentifierProvider?: Promise<ContextIdentifierProvider>;
|
|
9
|
+
inputRef?: React.Ref<HTMLInputElement>;
|
|
7
10
|
isDone: boolean;
|
|
8
11
|
isFocused?: boolean;
|
|
9
|
-
contentRef?: ContentRef;
|
|
10
12
|
onChange?: (taskId: string, isChecked: boolean) => void;
|
|
11
|
-
showPlaceholder?: boolean;
|
|
12
13
|
placeholder?: string;
|
|
13
|
-
|
|
14
|
+
showPlaceholder?: boolean;
|
|
14
15
|
taskDecisionProvider?: Promise<TaskDecisionProvider>;
|
|
15
|
-
|
|
16
|
-
inputRef?: React.Ref<HTMLInputElement>;
|
|
16
|
+
taskId: string;
|
|
17
17
|
}
|
|
18
18
|
export interface State {
|
|
19
19
|
resolvedContextProvider?: ContextIdentifierProvider;
|
|
@@ -4,10 +4,10 @@ import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
|
4
4
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
5
5
|
import type { TasksAndDecisionsPlugin } from '../../tasksAndDecisionsPluginType';
|
|
6
6
|
export interface Props {
|
|
7
|
+
editorAPI: ExtractInjectionAPI<TasksAndDecisionsPlugin> | undefined;
|
|
7
8
|
editorView?: EditorView;
|
|
8
9
|
isDisabled?: boolean;
|
|
9
10
|
isReducedSpacing?: boolean;
|
|
10
|
-
editorAPI: ExtractInjectionAPI<TasksAndDecisionsPlugin> | undefined;
|
|
11
11
|
}
|
|
12
12
|
export interface State {
|
|
13
13
|
disabled: boolean;
|
|
@@ -4,10 +4,10 @@ import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
|
4
4
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
5
5
|
import type { TasksAndDecisionsPlugin } from '../../tasksAndDecisionsPluginType';
|
|
6
6
|
export interface Props {
|
|
7
|
+
editorAPI: ExtractInjectionAPI<TasksAndDecisionsPlugin> | undefined;
|
|
7
8
|
editorView?: EditorView;
|
|
8
9
|
isDisabled?: boolean;
|
|
9
10
|
isReducedSpacing?: boolean;
|
|
10
|
-
editorAPI: ExtractInjectionAPI<TasksAndDecisionsPlugin> | undefined;
|
|
11
11
|
}
|
|
12
12
|
export interface State {
|
|
13
13
|
disabled: boolean;
|
|
@@ -44,7 +44,7 @@ export declare class DecisionItemNodeView implements NodeView {
|
|
|
44
44
|
* const shouldIgnore = decisionItemNodeView.ignoreMutation(mutationRecord);
|
|
45
45
|
*/
|
|
46
46
|
ignoreMutation(mutation: MutationRecord | {
|
|
47
|
-
type: 'selection';
|
|
48
47
|
target: Node;
|
|
48
|
+
type: 'selection';
|
|
49
49
|
}): boolean;
|
|
50
50
|
}
|
|
@@ -6,8 +6,8 @@ import type { NodeView } from '@atlaskit/editor-prosemirror/view';
|
|
|
6
6
|
import type { TasksAndDecisionsPlugin } from '../tasksAndDecisionsPluginType';
|
|
7
7
|
interface TaskItemNodeViewOptions {
|
|
8
8
|
api: ExtractInjectionAPI<TasksAndDecisionsPlugin> | undefined;
|
|
9
|
-
placeholder?: string;
|
|
10
9
|
intl: IntlShape;
|
|
10
|
+
placeholder?: string;
|
|
11
11
|
}
|
|
12
12
|
export declare class TaskItemNodeView implements NodeView {
|
|
13
13
|
dom: Node;
|
|
@@ -31,8 +31,8 @@ export declare class TaskItemNodeView implements NodeView {
|
|
|
31
31
|
private updatePlaceholder;
|
|
32
32
|
update(node: PMNode): boolean;
|
|
33
33
|
ignoreMutation(mutation: MutationRecord | {
|
|
34
|
-
type: 'selection';
|
|
35
34
|
target: Node;
|
|
35
|
+
type: 'selection';
|
|
36
36
|
}): boolean;
|
|
37
37
|
destroy(): void;
|
|
38
38
|
}
|
|
@@ -2,8 +2,8 @@ import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
|
2
2
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
3
3
|
import type { TasksAndDecisionsPlugin } from '../../tasksAndDecisionsPluginType';
|
|
4
4
|
type Props2 = {
|
|
5
|
-
editorView: EditorView;
|
|
6
5
|
api: ExtractInjectionAPI<TasksAndDecisionsPlugin> | undefined;
|
|
6
|
+
editorView: EditorView;
|
|
7
7
|
getPos: () => number | undefined;
|
|
8
8
|
isContentNodeEmpty: boolean;
|
|
9
9
|
};
|
|
@@ -70,14 +70,14 @@ export declare function getTaskItemDataAtPos(view: EditorView): {
|
|
|
70
70
|
localId: any;
|
|
71
71
|
} | undefined;
|
|
72
72
|
export declare function getAllTaskItemsDataInRootTaskList(view: EditorView): {
|
|
73
|
+
index: number;
|
|
73
74
|
node: Node;
|
|
74
75
|
pos: number;
|
|
75
|
-
index: number;
|
|
76
76
|
}[] | undefined;
|
|
77
77
|
export declare function getCurrentTaskItemIndex(view: EditorView, allTaskItems: Array<{
|
|
78
|
+
index: number;
|
|
78
79
|
node: Node;
|
|
79
80
|
pos: number;
|
|
80
|
-
index: number;
|
|
81
81
|
}>): number;
|
|
82
82
|
export declare function getTaskItemDataToFocus(view: EditorView, direction: 'next' | 'previous'): {
|
|
83
83
|
pos: number;
|
|
@@ -89,6 +89,6 @@ export declare function removeCheckboxFocus(view: EditorView): void;
|
|
|
89
89
|
export declare function openRequestEditPopupAt(view: EditorView, pos: number): void;
|
|
90
90
|
export declare function closeRequestEditPopupAt(view: EditorView): void;
|
|
91
91
|
export declare function findFirstParentListNode($pos: ResolvedPos): {
|
|
92
|
-
pos: number;
|
|
93
92
|
node: Node;
|
|
93
|
+
pos: number;
|
|
94
94
|
} | null;
|
|
@@ -6,8 +6,8 @@ import type { EditorState, Selection, Transaction } from '@atlaskit/editor-prose
|
|
|
6
6
|
import type { TaskDecisionProvider } from '@atlaskit/task-decision/types';
|
|
7
7
|
import type { AddItemAttrs, AddItemTransactionCreator, GetContextIdentifier, TaskDecisionInputMethod, TaskDecisionListType } from '../types';
|
|
8
8
|
export declare const getListTypes: (listType: TaskDecisionListType, schema: Schema) => {
|
|
9
|
-
list: NodeType;
|
|
10
9
|
item: NodeType;
|
|
10
|
+
list: NodeType;
|
|
11
11
|
};
|
|
12
12
|
export declare const insertTaskDecisionAction: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined, getContextIdentifierProvider: GetContextIdentifier) => (state: EditorState, listType: TaskDecisionListType, inputMethod?: INPUT_METHOD.FORMATTING | INPUT_METHOD.QUICK_INSERT | TOOLBAR_MENU_TYPE, addItem?: AddItemTransactionCreator, listLocalId?: string, itemLocalId?: string, itemAttrs?: AddItemAttrs) => Transaction;
|
|
13
13
|
export declare const insertTaskDecisionCommand: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined, getContextIdentifierProvider: GetContextIdentifier) => (listType: TaskDecisionListType, inputMethod?: INPUT_METHOD.FORMATTING | INPUT_METHOD.QUICK_INSERT | TOOLBAR_MENU_TYPE, addItem?: AddItemTransactionCreator, listLocalId?: string, itemLocalId?: string) => Command;
|
|
@@ -14,12 +14,9 @@ export type TasksAndDecisionsPluginDependencies = [
|
|
|
14
14
|
OptionalPlugin<EditorViewModePlugin>
|
|
15
15
|
];
|
|
16
16
|
export type TasksAndDecisionsPlugin = NextEditorPlugin<'taskDecision', {
|
|
17
|
-
pluginConfiguration: TasksAndDecisionsPluginOptions | undefined;
|
|
18
|
-
sharedState: TaskAndDecisionsSharedState | undefined;
|
|
19
|
-
dependencies: TasksAndDecisionsPluginDependencies;
|
|
20
17
|
actions: {
|
|
21
|
-
insertTaskDecision: ReturnType<typeof insertTaskDecisionCommand>;
|
|
22
18
|
indentTaskList: ReturnType<typeof getIndentCommand>;
|
|
19
|
+
insertTaskDecision: ReturnType<typeof insertTaskDecisionCommand>;
|
|
23
20
|
outdentTaskList: ReturnType<typeof getUnindentCommand>;
|
|
24
21
|
setProvider: (provider: Promise<TaskDecisionProvider>) => Promise<boolean>;
|
|
25
22
|
};
|
|
@@ -27,4 +24,7 @@ export type TasksAndDecisionsPlugin = NextEditorPlugin<'taskDecision', {
|
|
|
27
24
|
updateEditPermission: (hasEditPermission: boolean | undefined) => EditorCommand;
|
|
28
25
|
updateHasRequestedEditPermission: (hasRequestedEditPermission: boolean) => EditorCommand;
|
|
29
26
|
};
|
|
27
|
+
dependencies: TasksAndDecisionsPluginDependencies;
|
|
28
|
+
pluginConfiguration: TasksAndDecisionsPluginOptions | undefined;
|
|
29
|
+
sharedState: TaskAndDecisionsSharedState | undefined;
|
|
30
30
|
}>;
|
|
@@ -9,25 +9,29 @@ import type { TaskDecisionProvider } from '@atlaskit/task-decision/types';
|
|
|
9
9
|
export type TaskDecisionListType = 'taskList' | 'decisionList';
|
|
10
10
|
export type TaskDecisionInputMethod = INPUT_METHOD.TOOLBAR | INPUT_METHOD.INSERT_MENU | INPUT_METHOD.QUICK_INSERT | INPUT_METHOD.FORMATTING | INPUT_METHOD.KEYBOARD;
|
|
11
11
|
export type ContextData = {
|
|
12
|
-
objectId: string;
|
|
13
12
|
containerId: string;
|
|
13
|
+
objectId: string;
|
|
14
14
|
userContext: USER_CONTEXT;
|
|
15
15
|
};
|
|
16
16
|
export type AddItemAttrs = Partial<DecisionItemDefinition['attrs']> | Partial<TaskItemDefinition['attrs']> | Partial<BlockTaskItemDefinition['attrs']>;
|
|
17
17
|
export type AddItemTransactionCreator = (opts: {
|
|
18
|
-
state: EditorState;
|
|
19
|
-
tr: Transaction;
|
|
20
|
-
list: NodeType;
|
|
21
18
|
item: NodeType;
|
|
22
|
-
listLocalId: string;
|
|
23
|
-
itemLocalId: string;
|
|
24
19
|
itemAttrs?: AddItemAttrs;
|
|
20
|
+
itemLocalId: string;
|
|
21
|
+
list: NodeType;
|
|
22
|
+
listLocalId: string;
|
|
23
|
+
state: EditorState;
|
|
24
|
+
tr: Transaction;
|
|
25
25
|
}) => Transaction | null;
|
|
26
26
|
/**
|
|
27
27
|
* Interface representing the options for the TaskDecisionPlugin.
|
|
28
28
|
* Extends the LongPressSelectionPluginOptions interface.
|
|
29
29
|
*/
|
|
30
30
|
export interface TasksAndDecisionsPluginOptions extends LongPressSelectionPluginOptions {
|
|
31
|
+
/**
|
|
32
|
+
* Allows the blockTaskItem node to be a child of taskList (taskItem variant that supports block children - currently only supports extension and is intended to support Confluence TinyMCE migration flows in conjunction with the Legacy Content Extension)
|
|
33
|
+
*/
|
|
34
|
+
allowBlockTaskItem?: boolean;
|
|
31
35
|
/**
|
|
32
36
|
* Indicates whether nested tasks are allowed.
|
|
33
37
|
* @default false
|
|
@@ -64,10 +68,6 @@ export interface TasksAndDecisionsPluginOptions extends LongPressSelectionPlugin
|
|
|
64
68
|
* Placeholder text to display when creating a task.
|
|
65
69
|
*/
|
|
66
70
|
taskPlaceholder?: string;
|
|
67
|
-
/**
|
|
68
|
-
* Allows the blockTaskItem node to be a child of taskList (taskItem variant that supports block children - currently only supports extension and is intended to support Confluence TinyMCE migration flows in conjunction with the Legacy Content Extension)
|
|
69
|
-
*/
|
|
70
|
-
allowBlockTaskItem?: boolean;
|
|
71
71
|
}
|
|
72
72
|
/**
|
|
73
73
|
* @private
|
|
@@ -76,24 +76,24 @@ export interface TasksAndDecisionsPluginOptions extends LongPressSelectionPlugin
|
|
|
76
76
|
*/
|
|
77
77
|
export type TaskDecisionPluginOptions = TasksAndDecisionsPluginOptions;
|
|
78
78
|
export type TaskDecisionPluginState = {
|
|
79
|
-
|
|
79
|
+
decorations: DecorationSet;
|
|
80
80
|
focusedTaskItemLocalId: string | null;
|
|
81
81
|
hasEditPermission?: boolean;
|
|
82
82
|
hasRequestedEditPermission?: boolean;
|
|
83
|
+
insideTaskDecisionItem: boolean;
|
|
84
|
+
openRequestToEditPopupAt?: number | null;
|
|
83
85
|
requestToEditContent?: () => void;
|
|
84
86
|
taskDecisionProvider: TaskDecisionProvider | undefined;
|
|
85
|
-
openRequestToEditPopupAt?: number | null;
|
|
86
|
-
decorations: DecorationSet;
|
|
87
87
|
};
|
|
88
88
|
export type TaskAndDecisionsSharedState = Pick<TaskDecisionPluginState, 'focusedTaskItemLocalId' | 'hasEditPermission' | 'requestToEditContent' | 'taskDecisionProvider' | 'hasRequestedEditPermission' | 'openRequestToEditPopupAt'> & {
|
|
89
|
-
isInsideTask: boolean;
|
|
90
89
|
indentDisabled: boolean;
|
|
90
|
+
isInsideTask: boolean;
|
|
91
91
|
outdentDisabled: boolean;
|
|
92
92
|
};
|
|
93
93
|
export type GetContextIdentifier = () => ContextIdentifierProvider | undefined;
|
|
94
94
|
export type TaskItemState = 'DONE' | 'TODO';
|
|
95
95
|
export type TaskItemInfoMeta = {
|
|
96
|
+
checkState: TaskItemState;
|
|
96
97
|
from: number;
|
|
97
98
|
to: number;
|
|
98
|
-
checkState: TaskItemState;
|
|
99
99
|
};
|
|
@@ -8,14 +8,14 @@ import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
|
8
8
|
import { type EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
9
9
|
import type { TasksAndDecisionsPlugin } from '../../tasksAndDecisionsPluginType';
|
|
10
10
|
interface Props {
|
|
11
|
-
|
|
12
|
-
mountTo?: HTMLElement;
|
|
11
|
+
api: ExtractInjectionAPI<TasksAndDecisionsPlugin> | undefined;
|
|
13
12
|
boundariesElement?: HTMLElement;
|
|
14
|
-
scrollableElement?: HTMLElement;
|
|
15
13
|
dispatchAnalyticsEvent?: DispatchAnalyticsEvent;
|
|
16
14
|
editorView: EditorView;
|
|
17
|
-
|
|
15
|
+
element: HTMLElement;
|
|
16
|
+
mountTo?: HTMLElement;
|
|
18
17
|
onClose: () => void;
|
|
18
|
+
scrollableElement?: HTMLElement;
|
|
19
19
|
}
|
|
20
20
|
export declare const RequestToEditPopup: ({ element, api, editorView, onClose, mountTo, boundariesElement, scrollableElement, }: Props) => JSX.Element | null;
|
|
21
21
|
export {};
|
|
@@ -7,20 +7,20 @@ import type { ContentRef } from '@atlaskit/task-decision';
|
|
|
7
7
|
import type { TasksAndDecisionsPlugin } from '../../tasksAndDecisionsPluginType';
|
|
8
8
|
import { type TaskAndDecisionsSharedState } from '../../types';
|
|
9
9
|
export interface TaskProps {
|
|
10
|
-
|
|
10
|
+
api: ExtractInjectionAPI<TasksAndDecisionsPlugin> | undefined;
|
|
11
|
+
children?: ReactElement<any>;
|
|
12
|
+
contentRef?: ContentRef;
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
disableOnChange?: boolean;
|
|
15
|
+
inputRef?: Ref<HTMLInputElement>;
|
|
11
16
|
isDone: boolean;
|
|
12
17
|
isFocused?: boolean;
|
|
13
|
-
contentRef?: ContentRef;
|
|
14
18
|
onChange?: (taskId: string, isChecked: boolean) => void;
|
|
15
19
|
onClick?: () => void;
|
|
16
20
|
placeholder?: string;
|
|
17
|
-
showPlaceholder?: boolean;
|
|
18
|
-
children?: ReactElement<any>;
|
|
19
21
|
providers?: ProviderFactory;
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
inputRef?: Ref<HTMLInputElement>;
|
|
23
|
-
api: ExtractInjectionAPI<TasksAndDecisionsPlugin> | undefined;
|
|
22
|
+
showPlaceholder?: boolean;
|
|
23
|
+
taskId: string;
|
|
24
24
|
}
|
|
25
25
|
type TaskItemProps = TaskProps & WrappedComponentProps & {
|
|
26
26
|
taskDecisionProvider: TaskAndDecisionsSharedState['taskDecisionProvider'] | undefined;
|
|
@@ -3,17 +3,17 @@ import React, { Component } from 'react';
|
|
|
3
3
|
import type { ContextIdentifierProvider } from '@atlaskit/editor-common/provider-factory';
|
|
4
4
|
import type { ContentRef, TaskDecisionProvider } from '@atlaskit/task-decision';
|
|
5
5
|
export interface Props {
|
|
6
|
-
|
|
6
|
+
children?: ReactElement<any>;
|
|
7
|
+
contentRef?: ContentRef;
|
|
8
|
+
contextIdentifierProvider?: Promise<ContextIdentifierProvider>;
|
|
9
|
+
inputRef?: React.Ref<HTMLInputElement>;
|
|
7
10
|
isDone: boolean;
|
|
8
11
|
isFocused?: boolean;
|
|
9
|
-
contentRef?: ContentRef;
|
|
10
12
|
onChange?: (taskId: string, isChecked: boolean) => void;
|
|
11
|
-
showPlaceholder?: boolean;
|
|
12
13
|
placeholder?: string;
|
|
13
|
-
|
|
14
|
+
showPlaceholder?: boolean;
|
|
14
15
|
taskDecisionProvider?: Promise<TaskDecisionProvider>;
|
|
15
|
-
|
|
16
|
-
inputRef?: React.Ref<HTMLInputElement>;
|
|
16
|
+
taskId: string;
|
|
17
17
|
}
|
|
18
18
|
export interface State {
|
|
19
19
|
resolvedContextProvider?: ContextIdentifierProvider;
|
|
@@ -4,10 +4,10 @@ import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
|
4
4
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
5
5
|
import type { TasksAndDecisionsPlugin } from '../../tasksAndDecisionsPluginType';
|
|
6
6
|
export interface Props {
|
|
7
|
+
editorAPI: ExtractInjectionAPI<TasksAndDecisionsPlugin> | undefined;
|
|
7
8
|
editorView?: EditorView;
|
|
8
9
|
isDisabled?: boolean;
|
|
9
10
|
isReducedSpacing?: boolean;
|
|
10
|
-
editorAPI: ExtractInjectionAPI<TasksAndDecisionsPlugin> | undefined;
|
|
11
11
|
}
|
|
12
12
|
export interface State {
|
|
13
13
|
disabled: boolean;
|
|
@@ -4,10 +4,10 @@ import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
|
4
4
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
5
5
|
import type { TasksAndDecisionsPlugin } from '../../tasksAndDecisionsPluginType';
|
|
6
6
|
export interface Props {
|
|
7
|
+
editorAPI: ExtractInjectionAPI<TasksAndDecisionsPlugin> | undefined;
|
|
7
8
|
editorView?: EditorView;
|
|
8
9
|
isDisabled?: boolean;
|
|
9
10
|
isReducedSpacing?: boolean;
|
|
10
|
-
editorAPI: ExtractInjectionAPI<TasksAndDecisionsPlugin> | undefined;
|
|
11
11
|
}
|
|
12
12
|
export interface State {
|
|
13
13
|
disabled: boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-tasks-and-decisions",
|
|
3
|
-
"version": "6.4.
|
|
3
|
+
"version": "6.4.4",
|
|
4
4
|
"description": "Tasks and decisions plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -49,14 +49,14 @@
|
|
|
49
49
|
"@atlaskit/primitives": "^14.11.0",
|
|
50
50
|
"@atlaskit/prosemirror-input-rules": "^3.4.0",
|
|
51
51
|
"@atlaskit/task-decision": "^19.2.0",
|
|
52
|
-
"@atlaskit/tmp-editor-statsig": "^11.
|
|
52
|
+
"@atlaskit/tmp-editor-statsig": "^11.5.0",
|
|
53
53
|
"@atlaskit/tokens": "^6.0.0",
|
|
54
54
|
"@babel/runtime": "^7.0.0",
|
|
55
55
|
"@compiled/react": "^0.18.3",
|
|
56
56
|
"bind-event-listener": "^3.0.0"
|
|
57
57
|
},
|
|
58
58
|
"peerDependencies": {
|
|
59
|
-
"@atlaskit/editor-common": "^107.
|
|
59
|
+
"@atlaskit/editor-common": "^107.28.0",
|
|
60
60
|
"react": "^18.2.0",
|
|
61
61
|
"react-dom": "^18.2.0",
|
|
62
62
|
"react-intl-next": "npm:react-intl@^5.18.1"
|
|
@@ -66,7 +66,6 @@
|
|
|
66
66
|
"@af/visual-regression": "workspace:^",
|
|
67
67
|
"@atlaskit/ssr": "workspace:^",
|
|
68
68
|
"@atlaskit/util-data-test": "^18.1.0",
|
|
69
|
-
"@atlaskit/visual-regression": "workspace:^",
|
|
70
69
|
"@testing-library/react": "^13.4.0",
|
|
71
70
|
"wait-for-expect": "^1.2.0"
|
|
72
71
|
},
|