@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.
- package/CHANGELOG.md +13 -0
- package/dist/cjs/plugins/index.js +0 -7
- package/dist/cjs/presets/universal.js +2 -1
- package/dist/cjs/utils/document.js +0 -6
- package/dist/cjs/utils/index.js +0 -6
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/es2019/plugins/index.js +0 -1
- package/dist/es2019/presets/universal.js +2 -1
- package/dist/es2019/utils/document.js +1 -1
- package/dist/es2019/utils/index.js +1 -1
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/esm/plugins/index.js +0 -1
- package/dist/esm/presets/universal.js +2 -1
- package/dist/esm/utils/document.js +1 -1
- package/dist/esm/utils/index.js +1 -1
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/types/plugins/index.d.ts +0 -1
- package/dist/types/plugins/insert-block/types.d.ts +2 -2
- package/dist/types/plugins/toolbar-lists-indentation/index.d.ts +2 -2
- package/dist/types/utils/document.d.ts +1 -1
- package/dist/types/utils/index.d.ts +1 -1
- package/dist/types-ts4.5/plugins/index.d.ts +0 -1
- package/dist/types-ts4.5/plugins/insert-block/types.d.ts +2 -2
- package/dist/types-ts4.5/plugins/toolbar-lists-indentation/index.d.ts +2 -2
- package/dist/types-ts4.5/utils/document.d.ts +1 -1
- package/dist/types-ts4.5/utils/index.d.ts +1 -1
- package/package.json +4 -4
- package/dist/cjs/plugins/tasks-and-decisions/commands.js +0 -288
- package/dist/cjs/plugins/tasks-and-decisions/index.js +0 -166
- package/dist/cjs/plugins/tasks-and-decisions/nodeviews/decisionItem.js +0 -117
- package/dist/cjs/plugins/tasks-and-decisions/nodeviews/hooks/use-show-placeholder.js +0 -40
- package/dist/cjs/plugins/tasks-and-decisions/nodeviews/taskItem.js +0 -211
- package/dist/cjs/plugins/tasks-and-decisions/pm-plugins/commands.js +0 -96
- package/dist/cjs/plugins/tasks-and-decisions/pm-plugins/helpers.js +0 -299
- package/dist/cjs/plugins/tasks-and-decisions/pm-plugins/input-rules.js +0 -94
- package/dist/cjs/plugins/tasks-and-decisions/pm-plugins/keymaps.js +0 -376
- package/dist/cjs/plugins/tasks-and-decisions/pm-plugins/main.js +0 -263
- package/dist/cjs/plugins/tasks-and-decisions/pm-plugins/plugin-key.js +0 -8
- package/dist/cjs/plugins/tasks-and-decisions/pm-plugins/types.js +0 -11
- package/dist/cjs/plugins/tasks-and-decisions/types.js +0 -5
- package/dist/cjs/plugins/tasks-and-decisions/ui/Decision/index.js +0 -51
- package/dist/cjs/plugins/tasks-and-decisions/ui/Task/index.js +0 -80
- package/dist/cjs/plugins/tasks-and-decisions/ui/Task/task-item-with-providers.js +0 -137
- package/dist/cjs/plugins/tasks-and-decisions/ui/ToolbarDecision/index.js +0 -76
- package/dist/cjs/plugins/tasks-and-decisions/ui/ToolbarTask/index.js +0 -75
- package/dist/cjs/plugins/tasks-and-decisions/utils.js +0 -41
- package/dist/es2019/plugins/tasks-and-decisions/commands.js +0 -279
- package/dist/es2019/plugins/tasks-and-decisions/index.js +0 -155
- package/dist/es2019/plugins/tasks-and-decisions/nodeviews/decisionItem.js +0 -76
- package/dist/es2019/plugins/tasks-and-decisions/nodeviews/hooks/use-show-placeholder.js +0 -36
- package/dist/es2019/plugins/tasks-and-decisions/nodeviews/taskItem.js +0 -173
- package/dist/es2019/plugins/tasks-and-decisions/pm-plugins/commands.js +0 -94
- package/dist/es2019/plugins/tasks-and-decisions/pm-plugins/helpers.js +0 -316
- package/dist/es2019/plugins/tasks-and-decisions/pm-plugins/input-rules.js +0 -91
- package/dist/es2019/plugins/tasks-and-decisions/pm-plugins/keymaps.js +0 -370
- package/dist/es2019/plugins/tasks-and-decisions/pm-plugins/main.js +0 -262
- package/dist/es2019/plugins/tasks-and-decisions/pm-plugins/plugin-key.js +0 -2
- package/dist/es2019/plugins/tasks-and-decisions/pm-plugins/types.js +0 -5
- package/dist/es2019/plugins/tasks-and-decisions/types.js +0 -1
- package/dist/es2019/plugins/tasks-and-decisions/ui/Decision/index.js +0 -30
- package/dist/es2019/plugins/tasks-and-decisions/ui/Task/index.js +0 -54
- package/dist/es2019/plugins/tasks-and-decisions/ui/Task/task-item-with-providers.js +0 -71
- package/dist/es2019/plugins/tasks-and-decisions/ui/ToolbarDecision/index.js +0 -52
- package/dist/es2019/plugins/tasks-and-decisions/ui/ToolbarTask/index.js +0 -51
- package/dist/es2019/plugins/tasks-and-decisions/utils.js +0 -32
- package/dist/esm/plugins/tasks-and-decisions/commands.js +0 -281
- package/dist/esm/plugins/tasks-and-decisions/index.js +0 -156
- package/dist/esm/plugins/tasks-and-decisions/nodeviews/decisionItem.js +0 -110
- package/dist/esm/plugins/tasks-and-decisions/nodeviews/hooks/use-show-placeholder.js +0 -34
- package/dist/esm/plugins/tasks-and-decisions/nodeviews/taskItem.js +0 -204
- package/dist/esm/plugins/tasks-and-decisions/pm-plugins/commands.js +0 -90
- package/dist/esm/plugins/tasks-and-decisions/pm-plugins/helpers.js +0 -285
- package/dist/esm/plugins/tasks-and-decisions/pm-plugins/input-rules.js +0 -87
- package/dist/esm/plugins/tasks-and-decisions/pm-plugins/keymaps.js +0 -368
- package/dist/esm/plugins/tasks-and-decisions/pm-plugins/main.js +0 -256
- package/dist/esm/plugins/tasks-and-decisions/pm-plugins/plugin-key.js +0 -2
- package/dist/esm/plugins/tasks-and-decisions/pm-plugins/types.js +0 -5
- package/dist/esm/plugins/tasks-and-decisions/types.js +0 -1
- package/dist/esm/plugins/tasks-and-decisions/ui/Decision/index.js +0 -44
- package/dist/esm/plugins/tasks-and-decisions/ui/Task/index.js +0 -70
- package/dist/esm/plugins/tasks-and-decisions/ui/Task/task-item-with-providers.js +0 -128
- package/dist/esm/plugins/tasks-and-decisions/ui/ToolbarDecision/index.js +0 -66
- package/dist/esm/plugins/tasks-and-decisions/ui/ToolbarTask/index.js +0 -65
- package/dist/esm/plugins/tasks-and-decisions/utils.js +0 -30
- package/dist/types/plugins/tasks-and-decisions/commands.d.ts +0 -16
- package/dist/types/plugins/tasks-and-decisions/index.d.ts +0 -3
- package/dist/types/plugins/tasks-and-decisions/nodeviews/decisionItem.d.ts +0 -10
- package/dist/types/plugins/tasks-and-decisions/nodeviews/hooks/use-show-placeholder.d.ts +0 -11
- package/dist/types/plugins/tasks-and-decisions/nodeviews/taskItem.d.ts +0 -14
- package/dist/types/plugins/tasks-and-decisions/pm-plugins/commands.d.ts +0 -15
- package/dist/types/plugins/tasks-and-decisions/pm-plugins/helpers.d.ts +0 -76
- package/dist/types/plugins/tasks-and-decisions/pm-plugins/input-rules.d.ts +0 -6
- package/dist/types/plugins/tasks-and-decisions/pm-plugins/keymaps.d.ts +0 -11
- package/dist/types/plugins/tasks-and-decisions/pm-plugins/main.d.ts +0 -7
- package/dist/types/plugins/tasks-and-decisions/pm-plugins/plugin-key.d.ts +0 -2
- package/dist/types/plugins/tasks-and-decisions/pm-plugins/types.d.ts +0 -8
- package/dist/types/plugins/tasks-and-decisions/types.d.ts +0 -49
- package/dist/types/plugins/tasks-and-decisions/ui/Decision/index.d.ts +0 -14
- package/dist/types/plugins/tasks-and-decisions/ui/Task/index.d.ts +0 -28
- package/dist/types/plugins/tasks-and-decisions/ui/Task/task-item-with-providers.d.ts +0 -29
- package/dist/types/plugins/tasks-and-decisions/ui/ToolbarDecision/index.d.ts +0 -23
- package/dist/types/plugins/tasks-and-decisions/ui/ToolbarTask/index.d.ts +0 -23
- package/dist/types/plugins/tasks-and-decisions/utils.d.ts +0 -4
- package/dist/types-ts4.5/plugins/tasks-and-decisions/commands.d.ts +0 -16
- package/dist/types-ts4.5/plugins/tasks-and-decisions/index.d.ts +0 -3
- package/dist/types-ts4.5/plugins/tasks-and-decisions/nodeviews/decisionItem.d.ts +0 -10
- package/dist/types-ts4.5/plugins/tasks-and-decisions/nodeviews/hooks/use-show-placeholder.d.ts +0 -11
- package/dist/types-ts4.5/plugins/tasks-and-decisions/nodeviews/taskItem.d.ts +0 -14
- package/dist/types-ts4.5/plugins/tasks-and-decisions/pm-plugins/commands.d.ts +0 -15
- package/dist/types-ts4.5/plugins/tasks-and-decisions/pm-plugins/helpers.d.ts +0 -76
- package/dist/types-ts4.5/plugins/tasks-and-decisions/pm-plugins/input-rules.d.ts +0 -6
- package/dist/types-ts4.5/plugins/tasks-and-decisions/pm-plugins/keymaps.d.ts +0 -11
- package/dist/types-ts4.5/plugins/tasks-and-decisions/pm-plugins/main.d.ts +0 -7
- package/dist/types-ts4.5/plugins/tasks-and-decisions/pm-plugins/plugin-key.d.ts +0 -2
- package/dist/types-ts4.5/plugins/tasks-and-decisions/pm-plugins/types.d.ts +0 -8
- package/dist/types-ts4.5/plugins/tasks-and-decisions/types.d.ts +0 -49
- package/dist/types-ts4.5/plugins/tasks-and-decisions/ui/Decision/index.d.ts +0 -14
- package/dist/types-ts4.5/plugins/tasks-and-decisions/ui/Task/index.d.ts +0 -28
- package/dist/types-ts4.5/plugins/tasks-and-decisions/ui/Task/task-item-with-providers.d.ts +0 -29
- package/dist/types-ts4.5/plugins/tasks-and-decisions/ui/ToolbarDecision/index.d.ts +0 -23
- package/dist/types-ts4.5/plugins/tasks-and-decisions/ui/ToolbarTask/index.d.ts +0 -23
- package/dist/types-ts4.5/plugins/tasks-and-decisions/utils.d.ts +0 -4
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
|
-
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
|
-
import _inherits from "@babel/runtime/helpers/inherits";
|
|
4
|
-
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
5
|
-
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
6
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
7
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
8
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
9
|
-
import React from 'react';
|
|
10
|
-
import { defineMessages, injectIntl } from 'react-intl-next';
|
|
11
|
-
import { DecisionItem } from '@atlaskit/task-decision';
|
|
12
|
-
var messages = defineMessages({
|
|
13
|
-
placeholder: {
|
|
14
|
-
id: 'fabric.editor.decisionPlaceholder',
|
|
15
|
-
defaultMessage: 'Add a decision…',
|
|
16
|
-
description: 'Placeholder description for an empty decision in the editor'
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
export var Decision = /*#__PURE__*/function (_React$Component) {
|
|
20
|
-
_inherits(Decision, _React$Component);
|
|
21
|
-
var _super = _createSuper(Decision);
|
|
22
|
-
function Decision() {
|
|
23
|
-
_classCallCheck(this, Decision);
|
|
24
|
-
return _super.apply(this, arguments);
|
|
25
|
-
}
|
|
26
|
-
_createClass(Decision, [{
|
|
27
|
-
key: "render",
|
|
28
|
-
value: function render() {
|
|
29
|
-
var _this$props = this.props,
|
|
30
|
-
contentRef = _this$props.contentRef,
|
|
31
|
-
showPlaceholder = _this$props.showPlaceholder,
|
|
32
|
-
formatMessage = _this$props.intl.formatMessage;
|
|
33
|
-
var placeholder = formatMessage(messages.placeholder);
|
|
34
|
-
return /*#__PURE__*/React.createElement(DecisionItem, {
|
|
35
|
-
contentRef: contentRef,
|
|
36
|
-
placeholder: placeholder,
|
|
37
|
-
showPlaceholder: showPlaceholder
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
}]);
|
|
41
|
-
return Decision;
|
|
42
|
-
}(React.Component);
|
|
43
|
-
_defineProperty(Decision, "displayName", 'Decision');
|
|
44
|
-
export default injectIntl(Decision);
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
-
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
4
|
-
import _createClass from "@babel/runtime/helpers/createClass";
|
|
5
|
-
import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
|
|
6
|
-
import _inherits from "@babel/runtime/helpers/inherits";
|
|
7
|
-
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
8
|
-
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
9
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
10
|
-
var _excluded = ["providers", "intl"];
|
|
11
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
12
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
13
|
-
import React, { PureComponent } from 'react';
|
|
14
|
-
import { defineMessages, injectIntl } from 'react-intl-next';
|
|
15
|
-
import { ProviderFactory, WithProviders } from '@atlaskit/editor-common/provider-factory';
|
|
16
|
-
import TaskItemWithProviders from './task-item-with-providers';
|
|
17
|
-
var messages = defineMessages({
|
|
18
|
-
placeholder: {
|
|
19
|
-
id: 'fabric.editor.taskPlaceholder',
|
|
20
|
-
defaultMessage: "Type your action, use '@' to assign to someone.",
|
|
21
|
-
description: 'Placeholder description for an empty action/task in the editor'
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
|
-
export var TaskItem = /*#__PURE__*/function (_PureComponent) {
|
|
25
|
-
_inherits(TaskItem, _PureComponent);
|
|
26
|
-
var _super = _createSuper(TaskItem);
|
|
27
|
-
function TaskItem(props) {
|
|
28
|
-
var _this;
|
|
29
|
-
_classCallCheck(this, TaskItem);
|
|
30
|
-
_this = _super.call(this, props);
|
|
31
|
-
_defineProperty(_assertThisInitialized(_this), "renderWithProvider", function (providers) {
|
|
32
|
-
var _this$props = _this.props,
|
|
33
|
-
_providerFactory = _this$props.providers,
|
|
34
|
-
formatMessage = _this$props.intl.formatMessage,
|
|
35
|
-
otherProps = _objectWithoutProperties(_this$props, _excluded);
|
|
36
|
-
var taskDecisionProvider = providers.taskDecisionProvider,
|
|
37
|
-
contextIdentifierProvider = providers.contextIdentifierProvider;
|
|
38
|
-
var placeholder = formatMessage(messages.placeholder);
|
|
39
|
-
return /*#__PURE__*/React.createElement(TaskItemWithProviders, _extends({}, otherProps, {
|
|
40
|
-
placeholder: placeholder,
|
|
41
|
-
taskDecisionProvider: taskDecisionProvider,
|
|
42
|
-
contextIdentifierProvider: contextIdentifierProvider
|
|
43
|
-
}));
|
|
44
|
-
});
|
|
45
|
-
_this.providerFactory = props.providers || new ProviderFactory();
|
|
46
|
-
return _this;
|
|
47
|
-
}
|
|
48
|
-
_createClass(TaskItem, [{
|
|
49
|
-
key: "componentWillUnmount",
|
|
50
|
-
value: function componentWillUnmount() {
|
|
51
|
-
if (!this.props.providers) {
|
|
52
|
-
// new ProviderFactory is created if no `providers` has been set
|
|
53
|
-
// in this case when component is unmounted it's safe to destroy this providerFactory
|
|
54
|
-
this.providerFactory.destroy();
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
}, {
|
|
58
|
-
key: "render",
|
|
59
|
-
value: function render() {
|
|
60
|
-
return /*#__PURE__*/React.createElement(WithProviders, {
|
|
61
|
-
providers: ['taskDecisionProvider', 'contextIdentifierProvider'],
|
|
62
|
-
providerFactory: this.providerFactory,
|
|
63
|
-
renderNode: this.renderWithProvider
|
|
64
|
-
});
|
|
65
|
-
}
|
|
66
|
-
}]);
|
|
67
|
-
return TaskItem;
|
|
68
|
-
}(PureComponent);
|
|
69
|
-
_defineProperty(TaskItem, "displayName", 'TaskItem');
|
|
70
|
-
export default injectIntl(TaskItem);
|
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
-
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
4
|
-
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
5
|
-
import _createClass from "@babel/runtime/helpers/createClass";
|
|
6
|
-
import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
|
|
7
|
-
import _inherits from "@babel/runtime/helpers/inherits";
|
|
8
|
-
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
9
|
-
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
10
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
11
|
-
var _excluded = ["contextIdentifierProvider"];
|
|
12
|
-
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
13
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
14
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
15
|
-
import React, { Component } from 'react';
|
|
16
|
-
import { FabricElementsAnalyticsContext } from '@atlaskit/analytics-namespaced-context';
|
|
17
|
-
import { ResourcedTaskItem } from '@atlaskit/task-decision';
|
|
18
|
-
var TaskItemWithProviders = /*#__PURE__*/function (_Component) {
|
|
19
|
-
_inherits(TaskItemWithProviders, _Component);
|
|
20
|
-
var _super = _createSuper(TaskItemWithProviders);
|
|
21
|
-
function TaskItemWithProviders() {
|
|
22
|
-
var _this;
|
|
23
|
-
_classCallCheck(this, TaskItemWithProviders);
|
|
24
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
25
|
-
args[_key] = arguments[_key];
|
|
26
|
-
}
|
|
27
|
-
_this = _super.call.apply(_super, [this].concat(args));
|
|
28
|
-
_defineProperty(_assertThisInitialized(_this), "state", {
|
|
29
|
-
resolvedContextProvider: undefined
|
|
30
|
-
});
|
|
31
|
-
// Storing the mounted state is an anti-pattern, however the asynchronous state
|
|
32
|
-
// updates via `updateContextIdentifierProvider` means we may be dismounted before
|
|
33
|
-
// it receives a response.
|
|
34
|
-
// Since we can't cancel the Promise we store the mounted state to avoid state
|
|
35
|
-
// updates when no longer suitable.
|
|
36
|
-
_defineProperty(_assertThisInitialized(_this), "mounted", false);
|
|
37
|
-
return _this;
|
|
38
|
-
}
|
|
39
|
-
_createClass(TaskItemWithProviders, [{
|
|
40
|
-
key: "UNSAFE_componentWillMount",
|
|
41
|
-
value: function UNSAFE_componentWillMount() {
|
|
42
|
-
this.mounted = true;
|
|
43
|
-
this.updateContextIdentifierProvider(this.props);
|
|
44
|
-
}
|
|
45
|
-
}, {
|
|
46
|
-
key: "componentWillUnmount",
|
|
47
|
-
value: function componentWillUnmount() {
|
|
48
|
-
this.mounted = false;
|
|
49
|
-
}
|
|
50
|
-
}, {
|
|
51
|
-
key: "UNSAFE_componentWillReceiveProps",
|
|
52
|
-
value: function UNSAFE_componentWillReceiveProps(nextProps) {
|
|
53
|
-
if (nextProps.contextIdentifierProvider !== this.props.contextIdentifierProvider) {
|
|
54
|
-
this.updateContextIdentifierProvider(nextProps);
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
}, {
|
|
58
|
-
key: "updateContextIdentifierProvider",
|
|
59
|
-
value: function () {
|
|
60
|
-
var _updateContextIdentifierProvider = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(props) {
|
|
61
|
-
var resolvedContextProvider;
|
|
62
|
-
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
63
|
-
while (1) switch (_context.prev = _context.next) {
|
|
64
|
-
case 0:
|
|
65
|
-
if (!props.contextIdentifierProvider) {
|
|
66
|
-
_context.next = 13;
|
|
67
|
-
break;
|
|
68
|
-
}
|
|
69
|
-
_context.prev = 1;
|
|
70
|
-
_context.next = 4;
|
|
71
|
-
return props.contextIdentifierProvider;
|
|
72
|
-
case 4:
|
|
73
|
-
resolvedContextProvider = _context.sent;
|
|
74
|
-
if (this.mounted) {
|
|
75
|
-
this.setState({
|
|
76
|
-
resolvedContextProvider: resolvedContextProvider
|
|
77
|
-
});
|
|
78
|
-
}
|
|
79
|
-
_context.next = 11;
|
|
80
|
-
break;
|
|
81
|
-
case 8:
|
|
82
|
-
_context.prev = 8;
|
|
83
|
-
_context.t0 = _context["catch"](1);
|
|
84
|
-
if (this.mounted) {
|
|
85
|
-
this.setState({
|
|
86
|
-
resolvedContextProvider: undefined
|
|
87
|
-
});
|
|
88
|
-
}
|
|
89
|
-
case 11:
|
|
90
|
-
_context.next = 14;
|
|
91
|
-
break;
|
|
92
|
-
case 13:
|
|
93
|
-
this.setState({
|
|
94
|
-
resolvedContextProvider: undefined
|
|
95
|
-
});
|
|
96
|
-
case 14:
|
|
97
|
-
case "end":
|
|
98
|
-
return _context.stop();
|
|
99
|
-
}
|
|
100
|
-
}, _callee, this, [[1, 8]]);
|
|
101
|
-
}));
|
|
102
|
-
function updateContextIdentifierProvider(_x) {
|
|
103
|
-
return _updateContextIdentifierProvider.apply(this, arguments);
|
|
104
|
-
}
|
|
105
|
-
return updateContextIdentifierProvider;
|
|
106
|
-
}()
|
|
107
|
-
}, {
|
|
108
|
-
key: "render",
|
|
109
|
-
value: function render() {
|
|
110
|
-
var _this$props = this.props,
|
|
111
|
-
contextIdentifierProvider = _this$props.contextIdentifierProvider,
|
|
112
|
-
otherProps = _objectWithoutProperties(_this$props, _excluded);
|
|
113
|
-
var _ref = this.state.resolvedContextProvider || {},
|
|
114
|
-
objectId = _ref.objectId;
|
|
115
|
-
var userContext = objectId ? 'edit' : 'new';
|
|
116
|
-
return /*#__PURE__*/React.createElement(FabricElementsAnalyticsContext, {
|
|
117
|
-
data: {
|
|
118
|
-
userContext: userContext
|
|
119
|
-
}
|
|
120
|
-
}, /*#__PURE__*/React.createElement(ResourcedTaskItem, _extends({}, otherProps, {
|
|
121
|
-
objectAri: objectId
|
|
122
|
-
})));
|
|
123
|
-
}
|
|
124
|
-
}]);
|
|
125
|
-
return TaskItemWithProviders;
|
|
126
|
-
}(Component);
|
|
127
|
-
_defineProperty(TaskItemWithProviders, "displayName", 'TaskItemWithProviders');
|
|
128
|
-
export { TaskItemWithProviders as default };
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
|
-
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
|
-
import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
|
|
4
|
-
import _inherits from "@babel/runtime/helpers/inherits";
|
|
5
|
-
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
6
|
-
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
7
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
8
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
9
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
10
|
-
import React, { PureComponent } from 'react';
|
|
11
|
-
import { injectIntl } from 'react-intl-next';
|
|
12
|
-
import DecisionIcon from '@atlaskit/icon/glyph/editor/decision';
|
|
13
|
-
import { TOOLBAR_BUTTON, ToolbarButton } from '@atlaskit/editor-common/ui-menu';
|
|
14
|
-
import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages';
|
|
15
|
-
import { insertTaskDecisionCommand } from '../../commands';
|
|
16
|
-
export var ToolbarDecision = /*#__PURE__*/function (_PureComponent) {
|
|
17
|
-
_inherits(ToolbarDecision, _PureComponent);
|
|
18
|
-
var _super = _createSuper(ToolbarDecision);
|
|
19
|
-
function ToolbarDecision() {
|
|
20
|
-
var _this;
|
|
21
|
-
_classCallCheck(this, ToolbarDecision);
|
|
22
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
23
|
-
args[_key] = arguments[_key];
|
|
24
|
-
}
|
|
25
|
-
_this = _super.call.apply(_super, [this].concat(args));
|
|
26
|
-
_defineProperty(_assertThisInitialized(_this), "state", {
|
|
27
|
-
disabled: false
|
|
28
|
-
});
|
|
29
|
-
_defineProperty(_assertThisInitialized(_this), "handleInsertDecision", function () {
|
|
30
|
-
var _editorAPI$analytics;
|
|
31
|
-
var _this$props = _this.props,
|
|
32
|
-
editorView = _this$props.editorView,
|
|
33
|
-
editorAPI = _this$props.editorAPI;
|
|
34
|
-
if (!editorView) {
|
|
35
|
-
return false;
|
|
36
|
-
}
|
|
37
|
-
insertTaskDecisionCommand(editorAPI === null || editorAPI === void 0 || (_editorAPI$analytics = editorAPI.analytics) === null || _editorAPI$analytics === void 0 ? void 0 : _editorAPI$analytics.actions)('decisionList')(editorView.state, editorView.dispatch);
|
|
38
|
-
return true;
|
|
39
|
-
});
|
|
40
|
-
return _this;
|
|
41
|
-
}
|
|
42
|
-
_createClass(ToolbarDecision, [{
|
|
43
|
-
key: "render",
|
|
44
|
-
value: function render() {
|
|
45
|
-
var disabled = this.state.disabled;
|
|
46
|
-
var _this$props2 = this.props,
|
|
47
|
-
isDisabled = _this$props2.isDisabled,
|
|
48
|
-
isReducedSpacing = _this$props2.isReducedSpacing,
|
|
49
|
-
formatMessage = _this$props2.intl.formatMessage;
|
|
50
|
-
var label = formatMessage(messages.decision);
|
|
51
|
-
return /*#__PURE__*/React.createElement(ToolbarButton, {
|
|
52
|
-
buttonId: TOOLBAR_BUTTON.DECISION_LIST,
|
|
53
|
-
onClick: this.handleInsertDecision,
|
|
54
|
-
disabled: disabled || isDisabled,
|
|
55
|
-
spacing: isReducedSpacing ? 'none' : 'default',
|
|
56
|
-
title: "".concat(label, " <>"),
|
|
57
|
-
"aria-keyshortcuts": "Shift+, Shift+. space",
|
|
58
|
-
iconBefore: /*#__PURE__*/React.createElement(DecisionIcon, {
|
|
59
|
-
label: label
|
|
60
|
-
})
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
}]);
|
|
64
|
-
return ToolbarDecision;
|
|
65
|
-
}(PureComponent);
|
|
66
|
-
export default injectIntl(ToolbarDecision);
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
|
-
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
|
-
import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
|
|
4
|
-
import _inherits from "@babel/runtime/helpers/inherits";
|
|
5
|
-
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
6
|
-
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
7
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
8
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
9
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
10
|
-
import React, { PureComponent } from 'react';
|
|
11
|
-
import { injectIntl } from 'react-intl-next';
|
|
12
|
-
import TaskIcon from '@atlaskit/icon/glyph/editor/task';
|
|
13
|
-
import { TOOLBAR_BUTTON, ToolbarButton } from '@atlaskit/editor-common/ui-menu';
|
|
14
|
-
import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages';
|
|
15
|
-
import { insertTaskDecisionCommand } from '../../commands';
|
|
16
|
-
export var ToolbarTask = /*#__PURE__*/function (_PureComponent) {
|
|
17
|
-
_inherits(ToolbarTask, _PureComponent);
|
|
18
|
-
var _super = _createSuper(ToolbarTask);
|
|
19
|
-
function ToolbarTask() {
|
|
20
|
-
var _this;
|
|
21
|
-
_classCallCheck(this, ToolbarTask);
|
|
22
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
23
|
-
args[_key] = arguments[_key];
|
|
24
|
-
}
|
|
25
|
-
_this = _super.call.apply(_super, [this].concat(args));
|
|
26
|
-
_defineProperty(_assertThisInitialized(_this), "state", {
|
|
27
|
-
disabled: false
|
|
28
|
-
});
|
|
29
|
-
_defineProperty(_assertThisInitialized(_this), "handleInsertTask", function () {
|
|
30
|
-
var _editorAPI$analytics;
|
|
31
|
-
var _this$props = _this.props,
|
|
32
|
-
editorView = _this$props.editorView,
|
|
33
|
-
editorAPI = _this$props.editorAPI;
|
|
34
|
-
if (!editorView) {
|
|
35
|
-
return false;
|
|
36
|
-
}
|
|
37
|
-
insertTaskDecisionCommand(editorAPI === null || editorAPI === void 0 || (_editorAPI$analytics = editorAPI.analytics) === null || _editorAPI$analytics === void 0 ? void 0 : _editorAPI$analytics.actions)('taskList')(editorView.state, editorView.dispatch);
|
|
38
|
-
return true;
|
|
39
|
-
});
|
|
40
|
-
return _this;
|
|
41
|
-
}
|
|
42
|
-
_createClass(ToolbarTask, [{
|
|
43
|
-
key: "render",
|
|
44
|
-
value: function render() {
|
|
45
|
-
var disabled = this.state.disabled;
|
|
46
|
-
var _this$props2 = this.props,
|
|
47
|
-
isDisabled = _this$props2.isDisabled,
|
|
48
|
-
isReducedSpacing = _this$props2.isReducedSpacing,
|
|
49
|
-
formatMessage = _this$props2.intl.formatMessage;
|
|
50
|
-
var label = formatMessage(messages.action);
|
|
51
|
-
return /*#__PURE__*/React.createElement(ToolbarButton, {
|
|
52
|
-
buttonId: TOOLBAR_BUTTON.TASK_LIST,
|
|
53
|
-
onClick: this.handleInsertTask,
|
|
54
|
-
disabled: disabled || isDisabled,
|
|
55
|
-
spacing: isReducedSpacing ? 'none' : 'default',
|
|
56
|
-
title: "".concat(label, " []"),
|
|
57
|
-
iconBefore: /*#__PURE__*/React.createElement(TaskIcon, {
|
|
58
|
-
label: label
|
|
59
|
-
})
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
}]);
|
|
63
|
-
return ToolbarTask;
|
|
64
|
-
}(PureComponent);
|
|
65
|
-
export default injectIntl(ToolbarTask);
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { NodeSelection, Selection, TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
-
import { transformSliceToDecisionList } from '@atlaskit/editor-common/transforms';
|
|
3
|
-
export { transformSliceToDecisionList };
|
|
4
|
-
function isTaskListNode(node) {
|
|
5
|
-
return Boolean(node && node.type && 'taskList' === node.type.name);
|
|
6
|
-
}
|
|
7
|
-
var resolvePositionToStartOfTaskItem = function resolvePositionToStartOfTaskItem($pos) {
|
|
8
|
-
var fromRange = $pos.blockRange($pos, isTaskListNode);
|
|
9
|
-
var fromPosition = fromRange && $pos.textOffset === 0 && fromRange.end - 1 === $pos.pos ? Selection.near($pos.doc.resolve(fromRange.end + 1), 1).$from : $pos;
|
|
10
|
-
return fromPosition;
|
|
11
|
-
};
|
|
12
|
-
var resolvePositionToEndOfTaskItem = function resolvePositionToEndOfTaskItem($pos) {
|
|
13
|
-
var toRange = $pos.blockRange($pos, isTaskListNode);
|
|
14
|
-
var toPosition = toRange && $pos.textOffset === 0 && toRange.start + 1 === $pos.pos ? Selection.near($pos.doc.resolve(toRange.start - 1), -1).$to : $pos;
|
|
15
|
-
return toPosition;
|
|
16
|
-
};
|
|
17
|
-
export var normalizeTaskItemsSelection = function normalizeTaskItemsSelection(selection) {
|
|
18
|
-
if (selection.empty) {
|
|
19
|
-
return selection;
|
|
20
|
-
}
|
|
21
|
-
var $from = selection.$from,
|
|
22
|
-
$to = selection.$to;
|
|
23
|
-
if (selection instanceof NodeSelection) {
|
|
24
|
-
var _head = resolvePositionToStartOfTaskItem($from);
|
|
25
|
-
return new TextSelection(_head, _head);
|
|
26
|
-
}
|
|
27
|
-
var head = resolvePositionToStartOfTaskItem($from);
|
|
28
|
-
var anchor = resolvePositionToEndOfTaskItem($to);
|
|
29
|
-
return new TextSelection(anchor, head);
|
|
30
|
-
};
|
|
@@ -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,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>;
|