@atlaskit/editor-plugin-rule 0.1.3 → 0.1.5
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 -1
- package/README.md +1 -1
- package/dist/cjs/commands.js +2 -3
- package/dist/cjs/plugin.js +7 -8
- package/dist/cjs/pm-plugins/input-rule.js +3 -5
- package/dist/cjs/pm-plugins/keymap.js +1 -2
- package/dist/esm/plugin.js +5 -5
- package/dist/esm/pm-plugins/input-rule.js +1 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-rule
|
|
2
2
|
|
|
3
|
+
## 0.1.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
|
|
9
|
+
## 0.1.4
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [#39749](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/39749) [`e6b69f455c3`](https://bitbucket.org/atlassian/atlassian-frontend/commits/e6b69f455c3) - Connect yarn changeset to packages, upgrade adf-schema
|
|
14
|
+
|
|
3
15
|
## 0.1.3
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
|
@@ -16,4 +28,4 @@
|
|
|
16
28
|
|
|
17
29
|
### Patch Changes
|
|
18
30
|
|
|
19
|
-
- [`aeb5c9a01e8`](https://bitbucket.org/atlassian/atlassian-frontend/commits/aeb5c9a01e8) - Delete adf-schema from AFE and rely on npm package for adf-schema
|
|
31
|
+
- [#39481](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/39481) [`aeb5c9a01e8`](https://bitbucket.org/atlassian/atlassian-frontend/commits/aeb5c9a01e8) - Delete adf-schema from AFE and rely on npm package for adf-schema
|
package/README.md
CHANGED
|
@@ -27,4 +27,4 @@ Please see [Atlaskit - Editor plugin rule](https://atlaskit.atlassian.com/packag
|
|
|
27
27
|
For internal Atlassian, visit the slack channel [#help-editor](https://atlassian.slack.com/archives/CFG3PSQ9E) for support or visit [go/editor-help](https://go/editor-help) to submit a bug.
|
|
28
28
|
## License
|
|
29
29
|
---
|
|
30
|
-
Please see [Atlassian Frontend - License](https://
|
|
30
|
+
Please see [Atlassian Frontend - License](https://hello.atlassian.net/wiki/spaces/AF/pages/2589099144/Documentation#License) for more licensing information.
|
package/dist/cjs/commands.js
CHANGED
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.insertHorizontalRule = void 0;
|
|
7
7
|
var _inputRule = require("./pm-plugins/input-rule");
|
|
8
|
-
var insertHorizontalRule = function insertHorizontalRule(featureFlags, editorAnalyticsAPI) {
|
|
8
|
+
var insertHorizontalRule = exports.insertHorizontalRule = function insertHorizontalRule(featureFlags, editorAnalyticsAPI) {
|
|
9
9
|
return function (inputMethod) {
|
|
10
10
|
return function (state, dispatch) {
|
|
11
11
|
var tr = (0, _inputRule.createHorizontalRule)(state, featureFlags, state.selection.from, state.selection.to, inputMethod, editorAnalyticsAPI);
|
|
@@ -18,5 +18,4 @@ var insertHorizontalRule = function insertHorizontalRule(featureFlags, editorAna
|
|
|
18
18
|
return false;
|
|
19
19
|
};
|
|
20
20
|
};
|
|
21
|
-
};
|
|
22
|
-
exports.insertHorizontalRule = insertHorizontalRule;
|
|
21
|
+
};
|
package/dist/cjs/plugin.js
CHANGED
|
@@ -13,10 +13,10 @@ var _quickInsert = require("@atlaskit/editor-common/quick-insert");
|
|
|
13
13
|
var _commands = require("./commands");
|
|
14
14
|
var _inputRule = _interopRequireDefault(require("./pm-plugins/input-rule"));
|
|
15
15
|
var _keymap = _interopRequireDefault(require("./pm-plugins/keymap"));
|
|
16
|
-
var rulePlugin = function rulePlugin(_ref) {
|
|
16
|
+
var rulePlugin = exports.rulePlugin = function rulePlugin(_ref) {
|
|
17
17
|
var _api$featureFlags, _api$analytics;
|
|
18
18
|
var api = _ref.api;
|
|
19
|
-
var featureFlags = (api === null || api === void 0
|
|
19
|
+
var featureFlags = (api === null || api === void 0 || (_api$featureFlags = api.featureFlags) === null || _api$featureFlags === void 0 ? void 0 : _api$featureFlags.sharedState.currentState()) || {};
|
|
20
20
|
return {
|
|
21
21
|
name: 'rule',
|
|
22
22
|
nodes: function nodes() {
|
|
@@ -26,7 +26,7 @@ var rulePlugin = function rulePlugin(_ref) {
|
|
|
26
26
|
}];
|
|
27
27
|
},
|
|
28
28
|
actions: {
|
|
29
|
-
insertHorizontalRule: (0, _commands.insertHorizontalRule)(featureFlags, api === null || api === void 0
|
|
29
|
+
insertHorizontalRule: (0, _commands.insertHorizontalRule)(featureFlags, api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions)
|
|
30
30
|
},
|
|
31
31
|
pmPlugins: function pmPlugins() {
|
|
32
32
|
return [{
|
|
@@ -34,13 +34,13 @@ var rulePlugin = function rulePlugin(_ref) {
|
|
|
34
34
|
plugin: function plugin(_ref2) {
|
|
35
35
|
var _api$analytics2;
|
|
36
36
|
var schema = _ref2.schema;
|
|
37
|
-
return (0, _inputRule.default)(schema, featureFlags, api === null || api === void 0
|
|
37
|
+
return (0, _inputRule.default)(schema, featureFlags, api === null || api === void 0 || (_api$analytics2 = api.analytics) === null || _api$analytics2 === void 0 ? void 0 : _api$analytics2.actions);
|
|
38
38
|
}
|
|
39
39
|
}, {
|
|
40
40
|
name: 'ruleKeymap',
|
|
41
41
|
plugin: function plugin() {
|
|
42
42
|
var _api$analytics3;
|
|
43
|
-
return (0, _keymap.default)(featureFlags, api === null || api === void 0
|
|
43
|
+
return (0, _keymap.default)(featureFlags, api === null || api === void 0 || (_api$analytics3 = api.analytics) === null || _api$analytics3 === void 0 ? void 0 : _api$analytics3.actions);
|
|
44
44
|
}
|
|
45
45
|
}];
|
|
46
46
|
},
|
|
@@ -60,7 +60,7 @@ var rulePlugin = function rulePlugin(_ref) {
|
|
|
60
60
|
action: function action(insert, state) {
|
|
61
61
|
var _api$analytics4;
|
|
62
62
|
var tr = insert(state.schema.nodes.rule.createChecked());
|
|
63
|
-
api === null || api === void 0
|
|
63
|
+
api === null || api === void 0 || (_api$analytics4 = api.analytics) === null || _api$analytics4 === void 0 || _api$analytics4.actions.attachAnalyticsEvent({
|
|
64
64
|
action: _analytics.ACTION.INSERTED,
|
|
65
65
|
actionSubject: _analytics.ACTION_SUBJECT.DOCUMENT,
|
|
66
66
|
actionSubjectId: _analytics.ACTION_SUBJECT_ID.DIVIDER,
|
|
@@ -75,5 +75,4 @@ var rulePlugin = function rulePlugin(_ref) {
|
|
|
75
75
|
}
|
|
76
76
|
}
|
|
77
77
|
};
|
|
78
|
-
};
|
|
79
|
-
exports.rulePlugin = rulePlugin;
|
|
78
|
+
};
|
|
@@ -10,7 +10,7 @@ var _insert = require("@atlaskit/editor-common/insert");
|
|
|
10
10
|
var _model = require("@atlaskit/editor-prosemirror/model");
|
|
11
11
|
var _utils = require("@atlaskit/editor-prosemirror/utils");
|
|
12
12
|
var _prosemirrorInputRules = require("@atlaskit/prosemirror-input-rules");
|
|
13
|
-
var createHorizontalRule = function createHorizontalRule(state, featureFlags, start, end, inputMethod, editorAnalyticsAPI) {
|
|
13
|
+
var createHorizontalRule = exports.createHorizontalRule = function createHorizontalRule(state, featureFlags, start, end, inputMethod, editorAnalyticsAPI) {
|
|
14
14
|
if (!state.selection.empty) {
|
|
15
15
|
return null;
|
|
16
16
|
}
|
|
@@ -29,7 +29,7 @@ var createHorizontalRule = function createHorizontalRule(state, featureFlags, st
|
|
|
29
29
|
if (!tr) {
|
|
30
30
|
tr = state.tr.replaceRange(start, end, new _model.Slice(_model.Fragment.from(state.schema.nodes.rule.createChecked()), 0, 0));
|
|
31
31
|
}
|
|
32
|
-
editorAnalyticsAPI === null || editorAnalyticsAPI === void 0
|
|
32
|
+
editorAnalyticsAPI === null || editorAnalyticsAPI === void 0 || editorAnalyticsAPI.attachAnalyticsEvent({
|
|
33
33
|
action: _analytics.ACTION.INSERTED,
|
|
34
34
|
actionSubject: _analytics.ACTION_SUBJECT.DOCUMENT,
|
|
35
35
|
actionSubjectId: _analytics.ACTION_SUBJECT_ID.DIVIDER,
|
|
@@ -40,7 +40,6 @@ var createHorizontalRule = function createHorizontalRule(state, featureFlags, st
|
|
|
40
40
|
})(tr);
|
|
41
41
|
return tr;
|
|
42
42
|
};
|
|
43
|
-
exports.createHorizontalRule = createHorizontalRule;
|
|
44
43
|
var createHorizontalRuleAutoformat = function createHorizontalRuleAutoformat(state, featureFlags, start, end, editorAnalyticsAPI) {
|
|
45
44
|
var listItem = state.schema.nodes.listItem;
|
|
46
45
|
if ((0, _utils.hasParentNodeOfType)(listItem)(state.selection)) {
|
|
@@ -72,5 +71,4 @@ function inputRulePlugin(schema, featureFlags, editorAnalyticsAPI) {
|
|
|
72
71
|
}
|
|
73
72
|
return;
|
|
74
73
|
}
|
|
75
|
-
var _default = inputRulePlugin;
|
|
76
|
-
exports.default = _default;
|
|
74
|
+
var _default = exports.default = inputRulePlugin;
|
package/dist/esm/plugin.js
CHANGED
|
@@ -9,7 +9,7 @@ import keymapPlugin from './pm-plugins/keymap';
|
|
|
9
9
|
export var rulePlugin = function rulePlugin(_ref) {
|
|
10
10
|
var _api$featureFlags, _api$analytics;
|
|
11
11
|
var api = _ref.api;
|
|
12
|
-
var featureFlags = (api === null || api === void 0
|
|
12
|
+
var featureFlags = (api === null || api === void 0 || (_api$featureFlags = api.featureFlags) === null || _api$featureFlags === void 0 ? void 0 : _api$featureFlags.sharedState.currentState()) || {};
|
|
13
13
|
return {
|
|
14
14
|
name: 'rule',
|
|
15
15
|
nodes: function nodes() {
|
|
@@ -19,7 +19,7 @@ export var rulePlugin = function rulePlugin(_ref) {
|
|
|
19
19
|
}];
|
|
20
20
|
},
|
|
21
21
|
actions: {
|
|
22
|
-
insertHorizontalRule: insertHorizontalRule(featureFlags, api === null || api === void 0
|
|
22
|
+
insertHorizontalRule: insertHorizontalRule(featureFlags, api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions)
|
|
23
23
|
},
|
|
24
24
|
pmPlugins: function pmPlugins() {
|
|
25
25
|
return [{
|
|
@@ -27,13 +27,13 @@ export var rulePlugin = function rulePlugin(_ref) {
|
|
|
27
27
|
plugin: function plugin(_ref2) {
|
|
28
28
|
var _api$analytics2;
|
|
29
29
|
var schema = _ref2.schema;
|
|
30
|
-
return inputRulePlugin(schema, featureFlags, api === null || api === void 0
|
|
30
|
+
return inputRulePlugin(schema, featureFlags, api === null || api === void 0 || (_api$analytics2 = api.analytics) === null || _api$analytics2 === void 0 ? void 0 : _api$analytics2.actions);
|
|
31
31
|
}
|
|
32
32
|
}, {
|
|
33
33
|
name: 'ruleKeymap',
|
|
34
34
|
plugin: function plugin() {
|
|
35
35
|
var _api$analytics3;
|
|
36
|
-
return keymapPlugin(featureFlags, api === null || api === void 0
|
|
36
|
+
return keymapPlugin(featureFlags, api === null || api === void 0 || (_api$analytics3 = api.analytics) === null || _api$analytics3 === void 0 ? void 0 : _api$analytics3.actions);
|
|
37
37
|
}
|
|
38
38
|
}];
|
|
39
39
|
},
|
|
@@ -53,7 +53,7 @@ export var rulePlugin = function rulePlugin(_ref) {
|
|
|
53
53
|
action: function action(insert, state) {
|
|
54
54
|
var _api$analytics4;
|
|
55
55
|
var tr = insert(state.schema.nodes.rule.createChecked());
|
|
56
|
-
api === null || api === void 0
|
|
56
|
+
api === null || api === void 0 || (_api$analytics4 = api.analytics) === null || _api$analytics4 === void 0 || _api$analytics4.actions.attachAnalyticsEvent({
|
|
57
57
|
action: ACTION.INSERTED,
|
|
58
58
|
actionSubject: ACTION_SUBJECT.DOCUMENT,
|
|
59
59
|
actionSubjectId: ACTION_SUBJECT_ID.DIVIDER,
|
|
@@ -22,7 +22,7 @@ export var createHorizontalRule = function createHorizontalRule(state, featureFl
|
|
|
22
22
|
if (!tr) {
|
|
23
23
|
tr = state.tr.replaceRange(start, end, new Slice(Fragment.from(state.schema.nodes.rule.createChecked()), 0, 0));
|
|
24
24
|
}
|
|
25
|
-
editorAnalyticsAPI === null || editorAnalyticsAPI === void 0
|
|
25
|
+
editorAnalyticsAPI === null || editorAnalyticsAPI === void 0 || editorAnalyticsAPI.attachAnalyticsEvent({
|
|
26
26
|
action: ACTION.INSERTED,
|
|
27
27
|
actionSubject: ACTION_SUBJECT.DOCUMENT,
|
|
28
28
|
actionSubjectId: ACTION_SUBJECT_ID.DIVIDER,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-rule",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.5",
|
|
4
4
|
"description": "Rule plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -31,9 +31,9 @@
|
|
|
31
31
|
".": "./src/index.ts"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@atlaskit/adf-schema": "^
|
|
35
|
-
"@atlaskit/editor-common": "^76.
|
|
36
|
-
"@atlaskit/editor-plugin-analytics": "^0.
|
|
34
|
+
"@atlaskit/adf-schema": "^32.0.0",
|
|
35
|
+
"@atlaskit/editor-common": "^76.17.0",
|
|
36
|
+
"@atlaskit/editor-plugin-analytics": "^0.3.0",
|
|
37
37
|
"@atlaskit/editor-plugin-feature-flags": "^1.0.0",
|
|
38
38
|
"@atlaskit/editor-prosemirror": "1.1.0",
|
|
39
39
|
"@atlaskit/prosemirror-input-rules": "^2.4.0",
|