@atlaskit/editor-core 189.3.29 → 189.3.31

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.
Files changed (122) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/cjs/plugins/index.js +0 -7
  3. package/dist/cjs/presets/universal.js +2 -1
  4. package/dist/cjs/utils/document.js +0 -6
  5. package/dist/cjs/utils/index.js +0 -6
  6. package/dist/cjs/version-wrapper.js +1 -1
  7. package/dist/es2019/plugins/index.js +0 -1
  8. package/dist/es2019/presets/universal.js +2 -1
  9. package/dist/es2019/utils/document.js +1 -1
  10. package/dist/es2019/utils/index.js +1 -1
  11. package/dist/es2019/version-wrapper.js +1 -1
  12. package/dist/esm/plugins/index.js +0 -1
  13. package/dist/esm/presets/universal.js +2 -1
  14. package/dist/esm/utils/document.js +1 -1
  15. package/dist/esm/utils/index.js +1 -1
  16. package/dist/esm/version-wrapper.js +1 -1
  17. package/dist/types/plugins/index.d.ts +0 -1
  18. package/dist/types/plugins/insert-block/types.d.ts +2 -2
  19. package/dist/types/plugins/toolbar-lists-indentation/index.d.ts +2 -2
  20. package/dist/types/utils/document.d.ts +1 -1
  21. package/dist/types/utils/index.d.ts +1 -1
  22. package/dist/types-ts4.5/plugins/index.d.ts +0 -1
  23. package/dist/types-ts4.5/plugins/insert-block/types.d.ts +2 -2
  24. package/dist/types-ts4.5/plugins/toolbar-lists-indentation/index.d.ts +2 -2
  25. package/dist/types-ts4.5/utils/document.d.ts +1 -1
  26. package/dist/types-ts4.5/utils/index.d.ts +1 -1
  27. package/package.json +4 -4
  28. package/dist/cjs/plugins/tasks-and-decisions/commands.js +0 -288
  29. package/dist/cjs/plugins/tasks-and-decisions/index.js +0 -166
  30. package/dist/cjs/plugins/tasks-and-decisions/nodeviews/decisionItem.js +0 -117
  31. package/dist/cjs/plugins/tasks-and-decisions/nodeviews/hooks/use-show-placeholder.js +0 -40
  32. package/dist/cjs/plugins/tasks-and-decisions/nodeviews/taskItem.js +0 -211
  33. package/dist/cjs/plugins/tasks-and-decisions/pm-plugins/commands.js +0 -96
  34. package/dist/cjs/plugins/tasks-and-decisions/pm-plugins/helpers.js +0 -299
  35. package/dist/cjs/plugins/tasks-and-decisions/pm-plugins/input-rules.js +0 -94
  36. package/dist/cjs/plugins/tasks-and-decisions/pm-plugins/keymaps.js +0 -376
  37. package/dist/cjs/plugins/tasks-and-decisions/pm-plugins/main.js +0 -263
  38. package/dist/cjs/plugins/tasks-and-decisions/pm-plugins/plugin-key.js +0 -8
  39. package/dist/cjs/plugins/tasks-and-decisions/pm-plugins/types.js +0 -11
  40. package/dist/cjs/plugins/tasks-and-decisions/types.js +0 -5
  41. package/dist/cjs/plugins/tasks-and-decisions/ui/Decision/index.js +0 -51
  42. package/dist/cjs/plugins/tasks-and-decisions/ui/Task/index.js +0 -80
  43. package/dist/cjs/plugins/tasks-and-decisions/ui/Task/task-item-with-providers.js +0 -137
  44. package/dist/cjs/plugins/tasks-and-decisions/ui/ToolbarDecision/index.js +0 -76
  45. package/dist/cjs/plugins/tasks-and-decisions/ui/ToolbarTask/index.js +0 -75
  46. package/dist/cjs/plugins/tasks-and-decisions/utils.js +0 -41
  47. package/dist/es2019/plugins/tasks-and-decisions/commands.js +0 -279
  48. package/dist/es2019/plugins/tasks-and-decisions/index.js +0 -155
  49. package/dist/es2019/plugins/tasks-and-decisions/nodeviews/decisionItem.js +0 -76
  50. package/dist/es2019/plugins/tasks-and-decisions/nodeviews/hooks/use-show-placeholder.js +0 -36
  51. package/dist/es2019/plugins/tasks-and-decisions/nodeviews/taskItem.js +0 -173
  52. package/dist/es2019/plugins/tasks-and-decisions/pm-plugins/commands.js +0 -94
  53. package/dist/es2019/plugins/tasks-and-decisions/pm-plugins/helpers.js +0 -316
  54. package/dist/es2019/plugins/tasks-and-decisions/pm-plugins/input-rules.js +0 -91
  55. package/dist/es2019/plugins/tasks-and-decisions/pm-plugins/keymaps.js +0 -370
  56. package/dist/es2019/plugins/tasks-and-decisions/pm-plugins/main.js +0 -262
  57. package/dist/es2019/plugins/tasks-and-decisions/pm-plugins/plugin-key.js +0 -2
  58. package/dist/es2019/plugins/tasks-and-decisions/pm-plugins/types.js +0 -5
  59. package/dist/es2019/plugins/tasks-and-decisions/types.js +0 -1
  60. package/dist/es2019/plugins/tasks-and-decisions/ui/Decision/index.js +0 -30
  61. package/dist/es2019/plugins/tasks-and-decisions/ui/Task/index.js +0 -54
  62. package/dist/es2019/plugins/tasks-and-decisions/ui/Task/task-item-with-providers.js +0 -71
  63. package/dist/es2019/plugins/tasks-and-decisions/ui/ToolbarDecision/index.js +0 -52
  64. package/dist/es2019/plugins/tasks-and-decisions/ui/ToolbarTask/index.js +0 -51
  65. package/dist/es2019/plugins/tasks-and-decisions/utils.js +0 -32
  66. package/dist/esm/plugins/tasks-and-decisions/commands.js +0 -281
  67. package/dist/esm/plugins/tasks-and-decisions/index.js +0 -156
  68. package/dist/esm/plugins/tasks-and-decisions/nodeviews/decisionItem.js +0 -110
  69. package/dist/esm/plugins/tasks-and-decisions/nodeviews/hooks/use-show-placeholder.js +0 -34
  70. package/dist/esm/plugins/tasks-and-decisions/nodeviews/taskItem.js +0 -204
  71. package/dist/esm/plugins/tasks-and-decisions/pm-plugins/commands.js +0 -90
  72. package/dist/esm/plugins/tasks-and-decisions/pm-plugins/helpers.js +0 -285
  73. package/dist/esm/plugins/tasks-and-decisions/pm-plugins/input-rules.js +0 -87
  74. package/dist/esm/plugins/tasks-and-decisions/pm-plugins/keymaps.js +0 -368
  75. package/dist/esm/plugins/tasks-and-decisions/pm-plugins/main.js +0 -256
  76. package/dist/esm/plugins/tasks-and-decisions/pm-plugins/plugin-key.js +0 -2
  77. package/dist/esm/plugins/tasks-and-decisions/pm-plugins/types.js +0 -5
  78. package/dist/esm/plugins/tasks-and-decisions/types.js +0 -1
  79. package/dist/esm/plugins/tasks-and-decisions/ui/Decision/index.js +0 -44
  80. package/dist/esm/plugins/tasks-and-decisions/ui/Task/index.js +0 -70
  81. package/dist/esm/plugins/tasks-and-decisions/ui/Task/task-item-with-providers.js +0 -128
  82. package/dist/esm/plugins/tasks-and-decisions/ui/ToolbarDecision/index.js +0 -66
  83. package/dist/esm/plugins/tasks-and-decisions/ui/ToolbarTask/index.js +0 -65
  84. package/dist/esm/plugins/tasks-and-decisions/utils.js +0 -30
  85. package/dist/types/plugins/tasks-and-decisions/commands.d.ts +0 -16
  86. package/dist/types/plugins/tasks-and-decisions/index.d.ts +0 -3
  87. package/dist/types/plugins/tasks-and-decisions/nodeviews/decisionItem.d.ts +0 -10
  88. package/dist/types/plugins/tasks-and-decisions/nodeviews/hooks/use-show-placeholder.d.ts +0 -11
  89. package/dist/types/plugins/tasks-and-decisions/nodeviews/taskItem.d.ts +0 -14
  90. package/dist/types/plugins/tasks-and-decisions/pm-plugins/commands.d.ts +0 -15
  91. package/dist/types/plugins/tasks-and-decisions/pm-plugins/helpers.d.ts +0 -76
  92. package/dist/types/plugins/tasks-and-decisions/pm-plugins/input-rules.d.ts +0 -6
  93. package/dist/types/plugins/tasks-and-decisions/pm-plugins/keymaps.d.ts +0 -11
  94. package/dist/types/plugins/tasks-and-decisions/pm-plugins/main.d.ts +0 -7
  95. package/dist/types/plugins/tasks-and-decisions/pm-plugins/plugin-key.d.ts +0 -2
  96. package/dist/types/plugins/tasks-and-decisions/pm-plugins/types.d.ts +0 -8
  97. package/dist/types/plugins/tasks-and-decisions/types.d.ts +0 -49
  98. package/dist/types/plugins/tasks-and-decisions/ui/Decision/index.d.ts +0 -14
  99. package/dist/types/plugins/tasks-and-decisions/ui/Task/index.d.ts +0 -28
  100. package/dist/types/plugins/tasks-and-decisions/ui/Task/task-item-with-providers.d.ts +0 -29
  101. package/dist/types/plugins/tasks-and-decisions/ui/ToolbarDecision/index.d.ts +0 -23
  102. package/dist/types/plugins/tasks-and-decisions/ui/ToolbarTask/index.d.ts +0 -23
  103. package/dist/types/plugins/tasks-and-decisions/utils.d.ts +0 -4
  104. package/dist/types-ts4.5/plugins/tasks-and-decisions/commands.d.ts +0 -16
  105. package/dist/types-ts4.5/plugins/tasks-and-decisions/index.d.ts +0 -3
  106. package/dist/types-ts4.5/plugins/tasks-and-decisions/nodeviews/decisionItem.d.ts +0 -10
  107. package/dist/types-ts4.5/plugins/tasks-and-decisions/nodeviews/hooks/use-show-placeholder.d.ts +0 -11
  108. package/dist/types-ts4.5/plugins/tasks-and-decisions/nodeviews/taskItem.d.ts +0 -14
  109. package/dist/types-ts4.5/plugins/tasks-and-decisions/pm-plugins/commands.d.ts +0 -15
  110. package/dist/types-ts4.5/plugins/tasks-and-decisions/pm-plugins/helpers.d.ts +0 -76
  111. package/dist/types-ts4.5/plugins/tasks-and-decisions/pm-plugins/input-rules.d.ts +0 -6
  112. package/dist/types-ts4.5/plugins/tasks-and-decisions/pm-plugins/keymaps.d.ts +0 -11
  113. package/dist/types-ts4.5/plugins/tasks-and-decisions/pm-plugins/main.d.ts +0 -7
  114. package/dist/types-ts4.5/plugins/tasks-and-decisions/pm-plugins/plugin-key.d.ts +0 -2
  115. package/dist/types-ts4.5/plugins/tasks-and-decisions/pm-plugins/types.d.ts +0 -8
  116. package/dist/types-ts4.5/plugins/tasks-and-decisions/types.d.ts +0 -49
  117. package/dist/types-ts4.5/plugins/tasks-and-decisions/ui/Decision/index.d.ts +0 -14
  118. package/dist/types-ts4.5/plugins/tasks-and-decisions/ui/Task/index.d.ts +0 -28
  119. package/dist/types-ts4.5/plugins/tasks-and-decisions/ui/Task/task-item-with-providers.d.ts +0 -29
  120. package/dist/types-ts4.5/plugins/tasks-and-decisions/ui/ToolbarDecision/index.d.ts +0 -23
  121. package/dist/types-ts4.5/plugins/tasks-and-decisions/ui/ToolbarTask/index.d.ts +0 -23
  122. package/dist/types-ts4.5/plugins/tasks-and-decisions/utils.d.ts +0 -4
@@ -1,49 +0,0 @@
1
- import type { DecisionItemDefinition, TaskItemDefinition } from '@atlaskit/adf-schema';
2
- import type { NodeType } from '@atlaskit/editor-prosemirror/model';
3
- import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
4
- import type { INPUT_METHOD, USER_CONTEXT } from '@atlaskit/editor-common/analytics';
5
- import type { NextEditorPlugin, OptionalPlugin, LongPressSelectionPluginOptions } from '@atlaskit/editor-common/types';
6
- import type { TypeAheadPlugin } from '@atlaskit/editor-plugin-type-ahead';
7
- import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
8
- import type { insertTaskDecisionCommand } from './commands';
9
- import type { getIndentCommand, getUnindentCommand } from './pm-plugins/keymaps';
10
- export type TaskDecisionListType = 'taskList' | 'decisionList';
11
- export type TaskDecisionInputMethod = INPUT_METHOD.TOOLBAR | INPUT_METHOD.INSERT_MENU | INPUT_METHOD.QUICK_INSERT | INPUT_METHOD.FORMATTING | INPUT_METHOD.KEYBOARD;
12
- export type ContextData = {
13
- objectId: string;
14
- containerId: string;
15
- userContext: USER_CONTEXT;
16
- };
17
- export type AddItemAttrs = Partial<DecisionItemDefinition['attrs']> | Partial<TaskItemDefinition['attrs']>;
18
- export type AddItemTransactionCreator = (opts: {
19
- state: EditorState;
20
- tr: Transaction;
21
- list: NodeType;
22
- item: NodeType;
23
- listLocalId: string;
24
- itemLocalId: string;
25
- itemAttrs?: AddItemAttrs;
26
- }) => Transaction | null;
27
- export interface TaskDecisionPluginOptions extends LongPressSelectionPluginOptions {
28
- allowNestedTasks?: boolean;
29
- consumeTabs?: boolean;
30
- }
31
- export type TaskAndDecisionsSharedState = {
32
- focusedTaskItemLocalId: string | null;
33
- indentDisabled: boolean;
34
- outdentDisabled: boolean;
35
- isInsideTask: boolean;
36
- };
37
- export type TaskAndDecisionsPlugin = NextEditorPlugin<'taskDecision', {
38
- pluginConfiguration: TaskDecisionPluginOptions | undefined;
39
- sharedState: TaskAndDecisionsSharedState | undefined;
40
- dependencies: [
41
- OptionalPlugin<TypeAheadPlugin>,
42
- OptionalPlugin<AnalyticsPlugin>
43
- ];
44
- actions: {
45
- insertTaskDecision: ReturnType<typeof insertTaskDecisionCommand>;
46
- indentTaskList: ReturnType<typeof getIndentCommand>;
47
- outdentTaskList: ReturnType<typeof getUnindentCommand>;
48
- };
49
- }>;
@@ -1,14 +0,0 @@
1
- import React from 'react';
2
- import type { WrappedComponentProps } from 'react-intl-next';
3
- interface Props {
4
- contentRef: any;
5
- showPlaceholder?: boolean;
6
- }
7
- export declare class Decision extends React.Component<Props & WrappedComponentProps, {}> {
8
- static displayName: string;
9
- render(): JSX.Element;
10
- }
11
- declare const _default: React.FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps<"intl">>> & {
12
- WrappedComponent: React.ComponentType<Props & WrappedComponentProps<"intl">>;
13
- };
14
- export default _default;
@@ -1,28 +0,0 @@
1
- import type { ReactElement } from 'react';
2
- import React, { PureComponent } from 'react';
3
- import type { WrappedComponentProps } from 'react-intl-next';
4
- import { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
5
- import type { ContentRef } from '@atlaskit/task-decision';
6
- export interface TaskProps {
7
- taskId: string;
8
- isDone: boolean;
9
- isFocused?: boolean;
10
- contentRef?: ContentRef;
11
- onChange?: (taskId: string, isChecked: boolean) => void;
12
- showPlaceholder?: boolean;
13
- children?: ReactElement<any>;
14
- providers?: ProviderFactory;
15
- disabled?: boolean;
16
- }
17
- export declare class TaskItem extends PureComponent<TaskProps & WrappedComponentProps, {}> {
18
- static displayName: string;
19
- private providerFactory;
20
- constructor(props: TaskProps & WrappedComponentProps);
21
- componentWillUnmount(): void;
22
- private renderWithProvider;
23
- render(): JSX.Element;
24
- }
25
- declare const _default: React.FC<import("react-intl-next").WithIntlProps<TaskProps & WrappedComponentProps<"intl">>> & {
26
- WrappedComponent: React.ComponentType<TaskProps & WrappedComponentProps<"intl">>;
27
- };
28
- export default _default;
@@ -1,29 +0,0 @@
1
- import type { ReactElement } from 'react';
2
- import { Component } from 'react';
3
- import type { ContextIdentifierProvider } from '@atlaskit/editor-common/provider-factory';
4
- import type { ContentRef, TaskDecisionProvider } from '@atlaskit/task-decision';
5
- export interface Props {
6
- taskId: string;
7
- isDone: boolean;
8
- isFocused?: boolean;
9
- contentRef?: ContentRef;
10
- onChange?: (taskId: string, isChecked: boolean) => void;
11
- showPlaceholder?: boolean;
12
- placeholder?: string;
13
- children?: ReactElement<any>;
14
- taskDecisionProvider?: Promise<TaskDecisionProvider>;
15
- contextIdentifierProvider?: Promise<ContextIdentifierProvider>;
16
- }
17
- export interface State {
18
- resolvedContextProvider?: ContextIdentifierProvider;
19
- }
20
- export default class TaskItemWithProviders extends Component<Props, State> {
21
- static displayName: string;
22
- state: State;
23
- private mounted;
24
- UNSAFE_componentWillMount(): void;
25
- componentWillUnmount(): void;
26
- UNSAFE_componentWillReceiveProps(nextProps: Props): void;
27
- private updateContextIdentifierProvider;
28
- render(): JSX.Element;
29
- }
@@ -1,23 +0,0 @@
1
- import React, { PureComponent } from 'react';
2
- import type { EditorView } from '@atlaskit/editor-prosemirror/view';
3
- import type { WrappedComponentProps } from 'react-intl-next';
4
- import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
5
- import type { TaskAndDecisionsPlugin } from '../../types';
6
- export interface Props {
7
- editorView?: EditorView;
8
- isDisabled?: boolean;
9
- isReducedSpacing?: boolean;
10
- editorAPI: ExtractInjectionAPI<TaskAndDecisionsPlugin> | undefined;
11
- }
12
- export interface State {
13
- disabled: boolean;
14
- }
15
- export declare class ToolbarDecision extends PureComponent<Props & WrappedComponentProps, State> {
16
- state: State;
17
- render(): JSX.Element;
18
- private handleInsertDecision;
19
- }
20
- declare const _default: React.FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps<"intl">>> & {
21
- WrappedComponent: React.ComponentType<Props & WrappedComponentProps<"intl">>;
22
- };
23
- export default _default;
@@ -1,23 +0,0 @@
1
- import React, { PureComponent } from 'react';
2
- import type { EditorView } from '@atlaskit/editor-prosemirror/view';
3
- import type { WrappedComponentProps } from 'react-intl-next';
4
- import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
5
- import type { TaskAndDecisionsPlugin } from '../../types';
6
- export interface Props {
7
- editorView?: EditorView;
8
- isDisabled?: boolean;
9
- isReducedSpacing?: boolean;
10
- editorAPI: ExtractInjectionAPI<TaskAndDecisionsPlugin> | undefined;
11
- }
12
- export interface State {
13
- disabled: boolean;
14
- }
15
- export declare class ToolbarTask extends PureComponent<Props & WrappedComponentProps, State> {
16
- state: State;
17
- render(): JSX.Element;
18
- private handleInsertTask;
19
- }
20
- declare const _default: React.FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps<"intl">>> & {
21
- WrappedComponent: React.ComponentType<Props & WrappedComponentProps<"intl">>;
22
- };
23
- export default _default;
@@ -1,4 +0,0 @@
1
- import { Selection } from '@atlaskit/editor-prosemirror/state';
2
- import { transformSliceToDecisionList } from '@atlaskit/editor-common/transforms';
3
- export { transformSliceToDecisionList };
4
- export declare const normalizeTaskItemsSelection: (selection: Selection) => Selection;
@@ -1,16 +0,0 @@
1
- import type { NodeType, ResolvedPos, Schema } from '@atlaskit/editor-prosemirror/model';
2
- import type { EditorState, Selection, Transaction } from '@atlaskit/editor-prosemirror/state';
3
- import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
4
- import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
5
- import type { TOOLBAR_MENU_TYPE, Command } from '@atlaskit/editor-common/types';
6
- import type { AddItemAttrs, AddItemTransactionCreator, TaskDecisionInputMethod, TaskDecisionListType } from './types';
7
- export declare const getListTypes: (listType: TaskDecisionListType, schema: Schema) => {
8
- list: NodeType;
9
- item: NodeType;
10
- };
11
- export declare const insertTaskDecisionAction: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (state: EditorState, listType: TaskDecisionListType, inputMethod?: INPUT_METHOD.FORMATTING | INPUT_METHOD.QUICK_INSERT | TOOLBAR_MENU_TYPE, addItem?: AddItemTransactionCreator, listLocalId?: string, itemLocalId?: string, itemAttrs?: AddItemAttrs) => Transaction;
12
- export declare const insertTaskDecisionCommand: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (listType: TaskDecisionListType, inputMethod?: INPUT_METHOD.FORMATTING | INPUT_METHOD.QUICK_INSERT | TOOLBAR_MENU_TYPE, addItem?: AddItemTransactionCreator, listLocalId?: string, itemLocalId?: string) => Command;
13
- export declare const insertTaskDecisionWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (state: EditorState, listType: TaskDecisionListType, inputMethod: TaskDecisionInputMethod, addAndCreateList: AddItemTransactionCreator, addToList?: AddItemTransactionCreator, listLocalId?: string, itemLocalId?: string, itemAttrs?: AddItemAttrs) => Transaction | null;
14
- export declare const isSupportedSourceNode: (schema: Schema, selection: Selection) => boolean;
15
- export declare const changeInDepth: (before: ResolvedPos, after: ResolvedPos) => number;
16
- export declare const createListAtSelection: (tr: Transaction, list: any, item: any, schema: Schema, state: EditorState, listLocalId?: string, itemLocalId?: string, itemAttrs?: AddItemAttrs) => Transaction | null;
@@ -1,3 +0,0 @@
1
- import type { TaskAndDecisionsPlugin } from './types';
2
- declare const tasksAndDecisionsPlugin: TaskAndDecisionsPlugin;
3
- export default tasksAndDecisionsPlugin;
@@ -1,10 +0,0 @@
1
- import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
2
- import type { EditorView, NodeView } from '@atlaskit/editor-prosemirror/view';
3
- import type { EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
4
- import type { PortalProviderAPI } from '@atlaskit/editor-common/portal-provider';
5
- import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
6
- import type { TaskAndDecisionsPlugin } from '../types';
7
- type getPosHandler = getPosHandlerNode | boolean;
8
- type getPosHandlerNode = () => number | undefined;
9
- export declare const decisionItemNodeView: (portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, api: ExtractInjectionAPI<TaskAndDecisionsPlugin> | undefined) => (node: PMNode, view: EditorView, getPos: getPosHandler) => NodeView;
10
- export {};
@@ -1,11 +0,0 @@
1
- import type { EditorView } from '@atlaskit/editor-prosemirror/view';
2
- import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
3
- import type { TaskAndDecisionsPlugin } from '../../types';
4
- type Props2 = {
5
- editorView: EditorView;
6
- api: ExtractInjectionAPI<TaskAndDecisionsPlugin> | undefined;
7
- getPos: () => number | undefined;
8
- isContentNodeEmpty: boolean;
9
- };
10
- export declare const useShowPlaceholder: ({ editorView, api, isContentNodeEmpty, getPos, }: Props2) => boolean;
11
- export {};
@@ -1,14 +0,0 @@
1
- import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
2
- import type { EditorView, NodeView } from '@atlaskit/editor-prosemirror/view';
3
- import type { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
4
- import type { EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
5
- import type { PortalProviderAPI } from '@atlaskit/editor-common/portal-provider';
6
- import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
7
- import type { TaskAndDecisionsPlugin } from '../types';
8
- type getPosHandler = getPosHandlerNode | boolean;
9
- type getPosHandlerNode = () => number | undefined;
10
- export interface Props {
11
- providerFactory: ProviderFactory;
12
- }
13
- export declare function taskItemNodeViewFactory(portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, providerFactory: ProviderFactory, api: ExtractInjectionAPI<TaskAndDecisionsPlugin> | undefined): (node: PMNode, view: EditorView, getPos: getPosHandler) => NodeView;
14
- export {};
@@ -1,15 +0,0 @@
1
- import type { ResolvedPos } from '@atlaskit/editor-prosemirror/model';
2
- import type { Command } from '../../../types';
3
- export declare const liftSelection: Command;
4
- export declare const wrapSelectionInTaskList: Command;
5
- /**
6
- * Tries to move the paragraph content near the given position into the taskItem or decisionItem
7
- * before it.
8
- *
9
- * Looks backwards from the given position to find the "cut point" between the last taskItem and the
10
- * following paragraph. Then tries to move the content from that paragraph into the taskItem.
11
- *
12
- * @param $pos Position at the end of, or anywhere in paragraph following, the last taskItem
13
- * @see {joinToPreviousListItem}
14
- */
15
- export declare const joinAtCut: ($pos: ResolvedPos) => Command;
@@ -1,76 +0,0 @@
1
- import type { Node, NodeType, ResolvedPos } from '@atlaskit/editor-prosemirror/model';
2
- import type { EditorState, Selection, Transaction } from '@atlaskit/editor-prosemirror/state';
3
- import type { EditorView } from '@atlaskit/editor-prosemirror/view';
4
- import type { TaskItemData } from './types';
5
- export declare const isInsideTaskOrDecisionItem: (state: EditorState) => boolean;
6
- export declare const isActionOrDecisionList: (node: Node) => boolean;
7
- export declare const isActionOrDecisionItem: (node: Node) => boolean;
8
- export declare const isInsideTask: (state: EditorState) => boolean;
9
- export declare const isInsideDecision: (state: EditorState) => boolean;
10
- export declare const isTable: (node?: Node | null) => boolean;
11
- /**
12
- * Creates a NodeRange around the given taskItem and the following
13
- * ("nested") taskList, if one exists.
14
- */
15
- export declare const getBlockRange: ($from: ResolvedPos, $to: ResolvedPos) => import("prosemirror-model").NodeRange | null;
16
- /**
17
- * Finds the distance between the current $from and the root of the taskList.
18
- */
19
- export declare const getCurrentIndentLevel: (selection: Selection) => number | null;
20
- /**
21
- * Finds the index of the current task item in relation to the closest taskList
22
- */
23
- export declare const getTaskItemIndex: (state: EditorState) => number;
24
- /**
25
- * Walk outwards from a position until we encounter the (inside) start of
26
- * the next node, or reach the end of the document.
27
- *
28
- * @param $startPos Position to start walking from.
29
- */
30
- export declare const walkOut: ($startPos: ResolvedPos) => ResolvedPos;
31
- /**
32
- * Finds the height of a tree-like structure, given any position inside it.
33
- *
34
- * Traverses from the top of the tree to all leaf nodes, and returns the length
35
- * of the longest path.
36
- *
37
- * This means you can use it with things like taskList, which
38
- * do not nest themselves inside taskItems but rather as adjacent children.
39
- *
40
- * @param $pos Any position inside the tree.
41
- * @param types The node types to consider traversable
42
- */
43
- export declare const subtreeHeight: ($from: ResolvedPos, $to: ResolvedPos, types: NodeType[]) => number;
44
- /**
45
- * Returns `true` if the taskItem or decisionItem has no text.
46
- */
47
- export declare const isEmptyTaskDecision: (state: EditorState) => boolean;
48
- /**
49
- * Lifts a taskItem and any directly following taskList
50
- * (taskItem and its "nested children") out one level.
51
- *
52
- * @param tr Transaction to base steps on
53
- * @param $from Start of range you want to lift
54
- * @param $to End of range you want to lift (can be same as `$from`)
55
- */
56
- export declare const liftBlock: (tr: Transaction, $from: ResolvedPos, $to: ResolvedPos) => Transaction | null;
57
- export declare function getTaskItemDataAtPos(view: EditorView): {
58
- pos: number;
59
- localId: any;
60
- } | undefined;
61
- export declare function getAllTaskItemsDataInRootTaskList(view: EditorView): {
62
- node: Node;
63
- pos: number;
64
- index: number;
65
- }[] | undefined;
66
- export declare function getCurrentTaskItemIndex(view: EditorView, allTaskItems: Array<{
67
- node: Node;
68
- pos: number;
69
- index: number;
70
- }>): number;
71
- export declare function getTaskItemDataToFocus(view: EditorView, direction: 'next' | 'previous'): {
72
- pos: number;
73
- localId: any;
74
- } | undefined;
75
- export declare function focusCheckboxAndUpdateSelection(view: EditorView, taskItemData: TaskItemData): void;
76
- export declare function removeCheckboxFocus(view: EditorView): void;
@@ -1,6 +0,0 @@
1
- import type { FeatureFlags } from '../../../types/feature-flags';
2
- import type { Schema } from '@atlaskit/editor-prosemirror/model';
3
- import type { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
4
- import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
5
- export declare const inputRulePlugin: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (schema: Schema, featureFlags: FeatureFlags) => SafePlugin;
6
- export default inputRulePlugin;
@@ -1,11 +0,0 @@
1
- import type { Schema } from '@atlaskit/editor-prosemirror/model';
2
- import type { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
3
- import type { ExtractInjectionAPI, Command } from '@atlaskit/editor-common/types';
4
- import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
5
- import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
6
- import type { TaskAndDecisionsPlugin } from '../types';
7
- type IndentationInputMethod = INPUT_METHOD.KEYBOARD | INPUT_METHOD.TOOLBAR;
8
- export declare const getUnindentCommand: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (inputMethod?: IndentationInputMethod) => Command;
9
- export declare const getIndentCommand: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (inputMethod?: IndentationInputMethod) => Command;
10
- export declare function keymapPlugin(schema: Schema, api: ExtractInjectionAPI<TaskAndDecisionsPlugin> | undefined, allowNestedTasks?: boolean, consumeTabs?: boolean): SafePlugin | undefined;
11
- export default keymapPlugin;
@@ -1,7 +0,0 @@
1
- import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
2
- import type { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
3
- import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
4
- import type { TaskAndDecisionsPlugin } from '../types';
5
- import type { Dispatch, EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
6
- import type { PortalProviderAPI } from '@atlaskit/editor-common/portal-provider';
7
- export declare function createPlugin(portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, providerFactory: ProviderFactory, dispatch: Dispatch, api: ExtractInjectionAPI<TaskAndDecisionsPlugin> | undefined, useLongPressSelection?: boolean): SafePlugin<any>;
@@ -1,2 +0,0 @@
1
- import { PluginKey } from '@atlaskit/editor-prosemirror/state';
2
- export declare const stateKey: PluginKey<any>;
@@ -1,8 +0,0 @@
1
- export declare enum ACTIONS {
2
- SET_CONTEXT_PROVIDER = 0,
3
- FOCUS_BY_LOCALID = 1
4
- }
5
- export type TaskItemData = {
6
- pos: number;
7
- localId: string | null;
8
- };
@@ -1,49 +0,0 @@
1
- import type { DecisionItemDefinition, TaskItemDefinition } from '@atlaskit/adf-schema';
2
- import type { NodeType } from '@atlaskit/editor-prosemirror/model';
3
- import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
4
- import type { INPUT_METHOD, USER_CONTEXT } from '@atlaskit/editor-common/analytics';
5
- import type { NextEditorPlugin, OptionalPlugin, LongPressSelectionPluginOptions } from '@atlaskit/editor-common/types';
6
- import type { TypeAheadPlugin } from '@atlaskit/editor-plugin-type-ahead';
7
- import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
8
- import type { insertTaskDecisionCommand } from './commands';
9
- import type { getIndentCommand, getUnindentCommand } from './pm-plugins/keymaps';
10
- export type TaskDecisionListType = 'taskList' | 'decisionList';
11
- export type TaskDecisionInputMethod = INPUT_METHOD.TOOLBAR | INPUT_METHOD.INSERT_MENU | INPUT_METHOD.QUICK_INSERT | INPUT_METHOD.FORMATTING | INPUT_METHOD.KEYBOARD;
12
- export type ContextData = {
13
- objectId: string;
14
- containerId: string;
15
- userContext: USER_CONTEXT;
16
- };
17
- export type AddItemAttrs = Partial<DecisionItemDefinition['attrs']> | Partial<TaskItemDefinition['attrs']>;
18
- export type AddItemTransactionCreator = (opts: {
19
- state: EditorState;
20
- tr: Transaction;
21
- list: NodeType;
22
- item: NodeType;
23
- listLocalId: string;
24
- itemLocalId: string;
25
- itemAttrs?: AddItemAttrs;
26
- }) => Transaction | null;
27
- export interface TaskDecisionPluginOptions extends LongPressSelectionPluginOptions {
28
- allowNestedTasks?: boolean;
29
- consumeTabs?: boolean;
30
- }
31
- export type TaskAndDecisionsSharedState = {
32
- focusedTaskItemLocalId: string | null;
33
- indentDisabled: boolean;
34
- outdentDisabled: boolean;
35
- isInsideTask: boolean;
36
- };
37
- export type TaskAndDecisionsPlugin = NextEditorPlugin<'taskDecision', {
38
- pluginConfiguration: TaskDecisionPluginOptions | undefined;
39
- sharedState: TaskAndDecisionsSharedState | undefined;
40
- dependencies: [
41
- OptionalPlugin<TypeAheadPlugin>,
42
- OptionalPlugin<AnalyticsPlugin>
43
- ];
44
- actions: {
45
- insertTaskDecision: ReturnType<typeof insertTaskDecisionCommand>;
46
- indentTaskList: ReturnType<typeof getIndentCommand>;
47
- outdentTaskList: ReturnType<typeof getUnindentCommand>;
48
- };
49
- }>;
@@ -1,14 +0,0 @@
1
- import React from 'react';
2
- import type { WrappedComponentProps } from 'react-intl-next';
3
- interface Props {
4
- contentRef: any;
5
- showPlaceholder?: boolean;
6
- }
7
- export declare class Decision extends React.Component<Props & WrappedComponentProps, {}> {
8
- static displayName: string;
9
- render(): JSX.Element;
10
- }
11
- declare const _default: React.FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps<"intl">>> & {
12
- WrappedComponent: React.ComponentType<Props & WrappedComponentProps<"intl">>;
13
- };
14
- export default _default;
@@ -1,28 +0,0 @@
1
- import type { ReactElement } from 'react';
2
- import React, { PureComponent } from 'react';
3
- import type { WrappedComponentProps } from 'react-intl-next';
4
- import { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
5
- import type { ContentRef } from '@atlaskit/task-decision';
6
- export interface TaskProps {
7
- taskId: string;
8
- isDone: boolean;
9
- isFocused?: boolean;
10
- contentRef?: ContentRef;
11
- onChange?: (taskId: string, isChecked: boolean) => void;
12
- showPlaceholder?: boolean;
13
- children?: ReactElement<any>;
14
- providers?: ProviderFactory;
15
- disabled?: boolean;
16
- }
17
- export declare class TaskItem extends PureComponent<TaskProps & WrappedComponentProps, {}> {
18
- static displayName: string;
19
- private providerFactory;
20
- constructor(props: TaskProps & WrappedComponentProps);
21
- componentWillUnmount(): void;
22
- private renderWithProvider;
23
- render(): JSX.Element;
24
- }
25
- declare const _default: React.FC<import("react-intl-next").WithIntlProps<TaskProps & WrappedComponentProps<"intl">>> & {
26
- WrappedComponent: React.ComponentType<TaskProps & WrappedComponentProps<"intl">>;
27
- };
28
- export default _default;
@@ -1,29 +0,0 @@
1
- import type { ReactElement } from 'react';
2
- import { Component } from 'react';
3
- import type { ContextIdentifierProvider } from '@atlaskit/editor-common/provider-factory';
4
- import type { ContentRef, TaskDecisionProvider } from '@atlaskit/task-decision';
5
- export interface Props {
6
- taskId: string;
7
- isDone: boolean;
8
- isFocused?: boolean;
9
- contentRef?: ContentRef;
10
- onChange?: (taskId: string, isChecked: boolean) => void;
11
- showPlaceholder?: boolean;
12
- placeholder?: string;
13
- children?: ReactElement<any>;
14
- taskDecisionProvider?: Promise<TaskDecisionProvider>;
15
- contextIdentifierProvider?: Promise<ContextIdentifierProvider>;
16
- }
17
- export interface State {
18
- resolvedContextProvider?: ContextIdentifierProvider;
19
- }
20
- export default class TaskItemWithProviders extends Component<Props, State> {
21
- static displayName: string;
22
- state: State;
23
- private mounted;
24
- UNSAFE_componentWillMount(): void;
25
- componentWillUnmount(): void;
26
- UNSAFE_componentWillReceiveProps(nextProps: Props): void;
27
- private updateContextIdentifierProvider;
28
- render(): JSX.Element;
29
- }
@@ -1,23 +0,0 @@
1
- import React, { PureComponent } from 'react';
2
- import type { EditorView } from '@atlaskit/editor-prosemirror/view';
3
- import type { WrappedComponentProps } from 'react-intl-next';
4
- import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
5
- import type { TaskAndDecisionsPlugin } from '../../types';
6
- export interface Props {
7
- editorView?: EditorView;
8
- isDisabled?: boolean;
9
- isReducedSpacing?: boolean;
10
- editorAPI: ExtractInjectionAPI<TaskAndDecisionsPlugin> | undefined;
11
- }
12
- export interface State {
13
- disabled: boolean;
14
- }
15
- export declare class ToolbarDecision extends PureComponent<Props & WrappedComponentProps, State> {
16
- state: State;
17
- render(): JSX.Element;
18
- private handleInsertDecision;
19
- }
20
- declare const _default: React.FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps<"intl">>> & {
21
- WrappedComponent: React.ComponentType<Props & WrappedComponentProps<"intl">>;
22
- };
23
- export default _default;
@@ -1,23 +0,0 @@
1
- import React, { PureComponent } from 'react';
2
- import type { EditorView } from '@atlaskit/editor-prosemirror/view';
3
- import type { WrappedComponentProps } from 'react-intl-next';
4
- import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
5
- import type { TaskAndDecisionsPlugin } from '../../types';
6
- export interface Props {
7
- editorView?: EditorView;
8
- isDisabled?: boolean;
9
- isReducedSpacing?: boolean;
10
- editorAPI: ExtractInjectionAPI<TaskAndDecisionsPlugin> | undefined;
11
- }
12
- export interface State {
13
- disabled: boolean;
14
- }
15
- export declare class ToolbarTask extends PureComponent<Props & WrappedComponentProps, State> {
16
- state: State;
17
- render(): JSX.Element;
18
- private handleInsertTask;
19
- }
20
- declare const _default: React.FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps<"intl">>> & {
21
- WrappedComponent: React.ComponentType<Props & WrappedComponentProps<"intl">>;
22
- };
23
- export default _default;
@@ -1,4 +0,0 @@
1
- import { Selection } from '@atlaskit/editor-prosemirror/state';
2
- import { transformSliceToDecisionList } from '@atlaskit/editor-common/transforms';
3
- export { transformSliceToDecisionList };
4
- export declare const normalizeTaskItemsSelection: (selection: Selection) => Selection;