@atlaskit/editor-plugin-tasks-and-decisions 1.0.0 → 1.0.2
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 +36 -0
- package/dist/cjs/pm-plugins/input-rules.js +7 -5
- package/dist/es2019/pm-plugins/input-rules.js +5 -3
- package/dist/esm/pm-plugins/input-rules.js +5 -3
- package/dist/types/pm-plugins/input-rules.d.ts +1 -1
- package/dist/types-ts4.5/pm-plugins/input-rules.d.ts +1 -1
- package/package.json +5 -10
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,41 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-tasks-and-decisions
|
|
2
2
|
|
|
3
|
+
## 1.0.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#75482](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/75482) [`18b5a6fb910a`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/18b5a6fb910a) - # MAJOR CHANGE to `@atlaskit/prosemirror-input-rules` package.
|
|
8
|
+
|
|
9
|
+
## WHY?
|
|
10
|
+
|
|
11
|
+
Removing editor-common dependencies from prosemirror-input-rules package.
|
|
12
|
+
|
|
13
|
+
This makes it easier for editor updates because it simplifies our dependency graph.
|
|
14
|
+
|
|
15
|
+
## WHAT and HOW?
|
|
16
|
+
|
|
17
|
+
These are no longer available via `@atlaskit/prosemirror-input-rules` but are available from `@atlaskit/editor-common/types`:
|
|
18
|
+
|
|
19
|
+
- InputRuleWrapper
|
|
20
|
+
- InputRuleHandler
|
|
21
|
+
- OnHandlerApply
|
|
22
|
+
- createRule
|
|
23
|
+
|
|
24
|
+
These have changed from a `SafePlugin` to a `SafePluginSpec`. In order to update your code you need to instantiate a `SafePlugin` (ie. `new SafePlugin(createPlugin( ... ))`).
|
|
25
|
+
|
|
26
|
+
`SafePlugin` exists in `@atlaskit/editor-common/safe-plugin`.
|
|
27
|
+
|
|
28
|
+
- createPlugin
|
|
29
|
+
- createInputRulePlugin
|
|
30
|
+
|
|
31
|
+
- Updated dependencies
|
|
32
|
+
|
|
33
|
+
## 1.0.1
|
|
34
|
+
|
|
35
|
+
### Patch Changes
|
|
36
|
+
|
|
37
|
+
- Updated dependencies
|
|
38
|
+
|
|
3
39
|
## 1.0.0
|
|
4
40
|
|
|
5
41
|
### Major Changes
|
|
@@ -7,15 +7,17 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.inputRulePlugin = exports.default = void 0;
|
|
8
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
9
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
10
|
+
var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
|
|
11
|
+
var _utils = require("@atlaskit/editor-common/utils");
|
|
10
12
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
11
|
-
var
|
|
13
|
+
var _utils2 = require("@atlaskit/editor-prosemirror/utils");
|
|
12
14
|
var _prosemirrorInputRules = require("@atlaskit/prosemirror-input-rules");
|
|
13
15
|
var _commands = require("../commands");
|
|
14
16
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
15
17
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
16
18
|
var createListRule = function createListRule(editorAnalyticsAPI, getContextIdentifierProvider) {
|
|
17
19
|
return function (regex, listType, itemAttrs) {
|
|
18
|
-
return (0,
|
|
20
|
+
return (0, _utils.createRule)(regex, function (state, _match, start, end) {
|
|
19
21
|
var paragraph = state.schema.nodes.paragraph;
|
|
20
22
|
var _getListTypes = (0, _commands.getListTypes)(listType, state.schema),
|
|
21
23
|
list = _getListTypes.list;
|
|
@@ -23,7 +25,7 @@ var createListRule = function createListRule(editorAnalyticsAPI, getContextIdent
|
|
|
23
25
|
var $endOfParent = state.doc.resolve($end.after());
|
|
24
26
|
// Only allow creating list in nodes that support them.
|
|
25
27
|
// Parent must be a paragraph as we don't want this applying to headings
|
|
26
|
-
if ($end.parent.type !== paragraph || !(0,
|
|
28
|
+
if ($end.parent.type !== paragraph || !(0, _utils2.canInsert)($endOfParent, list.createAndFill())) {
|
|
27
29
|
return null;
|
|
28
30
|
}
|
|
29
31
|
var insertTr = (0, _commands.insertTaskDecisionAction)(editorAnalyticsAPI, getContextIdentifierProvider)(state, listType, _analytics.INPUT_METHOD.FORMATTING, addItem(start, end), undefined, undefined, itemAttrs);
|
|
@@ -103,9 +105,9 @@ var inputRulePlugin = exports.inputRulePlugin = function inputRulePlugin(editorA
|
|
|
103
105
|
state: 'DONE'
|
|
104
106
|
}));
|
|
105
107
|
}
|
|
106
|
-
return (0, _prosemirrorInputRules.createPlugin)('tasks-and-decisions', rules, {
|
|
108
|
+
return new _safePlugin.SafePlugin((0, _prosemirrorInputRules.createPlugin)('tasks-and-decisions', rules, {
|
|
107
109
|
isBlockNodeRule: true
|
|
108
|
-
});
|
|
110
|
+
}));
|
|
109
111
|
};
|
|
110
112
|
};
|
|
111
113
|
var _default = exports.default = inputRulePlugin;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
2
|
+
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
3
|
+
import { createRule } from '@atlaskit/editor-common/utils';
|
|
2
4
|
import { NodeSelection, TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
3
5
|
import { canInsert } from '@atlaskit/editor-prosemirror/utils';
|
|
4
|
-
import { createPlugin,
|
|
6
|
+
import { createPlugin, leafNodeReplacementCharacter } from '@atlaskit/prosemirror-input-rules';
|
|
5
7
|
import { changeInDepth, getListTypes, insertTaskDecisionAction } from '../commands';
|
|
6
8
|
const createListRule = (editorAnalyticsAPI, getContextIdentifierProvider) => (regex, listType, itemAttrs) => {
|
|
7
9
|
return createRule(regex, (state, _match, start, end) => {
|
|
@@ -102,8 +104,8 @@ export const inputRulePlugin = (editorAnalyticsAPI, getContextIdentifierProvider
|
|
|
102
104
|
state: 'DONE'
|
|
103
105
|
}));
|
|
104
106
|
}
|
|
105
|
-
return createPlugin('tasks-and-decisions', rules, {
|
|
107
|
+
return new SafePlugin(createPlugin('tasks-and-decisions', rules, {
|
|
106
108
|
isBlockNodeRule: true
|
|
107
|
-
});
|
|
109
|
+
}));
|
|
108
110
|
};
|
|
109
111
|
export default inputRulePlugin;
|
|
@@ -2,9 +2,11 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
2
2
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
3
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
4
|
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
5
|
+
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
6
|
+
import { createRule } from '@atlaskit/editor-common/utils';
|
|
5
7
|
import { NodeSelection, TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
6
8
|
import { canInsert } from '@atlaskit/editor-prosemirror/utils';
|
|
7
|
-
import { createPlugin,
|
|
9
|
+
import { createPlugin, leafNodeReplacementCharacter } from '@atlaskit/prosemirror-input-rules';
|
|
8
10
|
import { changeInDepth, getListTypes, insertTaskDecisionAction } from '../commands';
|
|
9
11
|
var createListRule = function createListRule(editorAnalyticsAPI, getContextIdentifierProvider) {
|
|
10
12
|
return function (regex, listType, itemAttrs) {
|
|
@@ -96,9 +98,9 @@ export var inputRulePlugin = function inputRulePlugin(editorAnalyticsAPI, getCon
|
|
|
96
98
|
state: 'DONE'
|
|
97
99
|
}));
|
|
98
100
|
}
|
|
99
|
-
return createPlugin('tasks-and-decisions', rules, {
|
|
101
|
+
return new SafePlugin(createPlugin('tasks-and-decisions', rules, {
|
|
100
102
|
isBlockNodeRule: true
|
|
101
|
-
});
|
|
103
|
+
}));
|
|
102
104
|
};
|
|
103
105
|
};
|
|
104
106
|
export default inputRulePlugin;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
2
|
-
import
|
|
2
|
+
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
3
3
|
import type { FeatureFlags } from '@atlaskit/editor-common/types';
|
|
4
4
|
import type { Schema } from '@atlaskit/editor-prosemirror/model';
|
|
5
5
|
import type { GetContextIdentifier } from '../types';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
2
|
-
import
|
|
2
|
+
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
3
3
|
import type { FeatureFlags } from '@atlaskit/editor-common/types';
|
|
4
4
|
import type { Schema } from '@atlaskit/editor-prosemirror/model';
|
|
5
5
|
import type { GetContextIdentifier } from '../types';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-tasks-and-decisions",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "Tasks and decisions plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -36,13 +36,13 @@
|
|
|
36
36
|
"@atlaskit/adf-schema": "^35.5.1",
|
|
37
37
|
"@atlaskit/analytics-namespaced-context": "^6.9.0",
|
|
38
38
|
"@atlaskit/analytics-next": "^9.2.0",
|
|
39
|
-
"@atlaskit/editor-common": "^
|
|
39
|
+
"@atlaskit/editor-common": "^78.4.0",
|
|
40
40
|
"@atlaskit/editor-plugin-analytics": "^1.0.0",
|
|
41
41
|
"@atlaskit/editor-plugin-context-identifier": "^1.0.0",
|
|
42
42
|
"@atlaskit/editor-plugin-type-ahead": "^1.0.0",
|
|
43
43
|
"@atlaskit/editor-prosemirror": "3.0.0",
|
|
44
|
-
"@atlaskit/icon": "^22.
|
|
45
|
-
"@atlaskit/prosemirror-input-rules": "^
|
|
44
|
+
"@atlaskit/icon": "^22.1.0",
|
|
45
|
+
"@atlaskit/prosemirror-input-rules": "^3.0.0",
|
|
46
46
|
"@atlaskit/task-decision": "^17.9.0",
|
|
47
47
|
"@babel/runtime": "^7.0.0",
|
|
48
48
|
"@emotion/react": "^11.7.1"
|
|
@@ -100,10 +100,5 @@
|
|
|
100
100
|
]
|
|
101
101
|
}
|
|
102
102
|
},
|
|
103
|
-
"prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.0"
|
|
104
|
-
"platform-feature-flags": {
|
|
105
|
-
"platform.editor.allow-action-in-list": {
|
|
106
|
-
"type": "boolean"
|
|
107
|
-
}
|
|
108
|
-
}
|
|
103
|
+
"prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.0"
|
|
109
104
|
}
|