@atlaskit/editor-plugin-indentation 1.0.2 → 1.0.3
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 +6 -0
- package/dist/cjs/commands/index.js +0 -6
- package/dist/cjs/commands/utils.js +0 -1
- package/dist/es2019/commands/index.js +0 -6
- package/dist/es2019/commands/utils.js +0 -1
- package/dist/esm/commands/index.js +0 -6
- package/dist/esm/commands/utils.js +0 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-indentation
|
|
2
2
|
|
|
3
|
+
## 1.0.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#80679](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/80679) [`104eb9443b7e`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/104eb9443b7e) - ED-22553 Updating adf-schema version to 35.6.0
|
|
8
|
+
|
|
3
9
|
## 1.0.2
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
|
@@ -77,17 +77,14 @@ var getIndentAttrs = function getIndentAttrs(oldAttr) {
|
|
|
77
77
|
level: 1
|
|
78
78
|
}; // No mark exist, create a new one with level 1
|
|
79
79
|
}
|
|
80
|
-
|
|
81
80
|
var level = oldAttr.level;
|
|
82
81
|
if (level >= _indentation.MAX_INDENTATION_LEVEL) {
|
|
83
82
|
return undefined; // Max indentation level reached, do nothing.
|
|
84
83
|
}
|
|
85
|
-
|
|
86
84
|
return {
|
|
87
85
|
level: level + 1
|
|
88
86
|
}; // Otherwise, increase the level by one
|
|
89
87
|
};
|
|
90
|
-
|
|
91
88
|
var getIndentCommand = exports.getIndentCommand = function getIndentCommand(editorAnalyticsAPI) {
|
|
92
89
|
return function () {
|
|
93
90
|
var inputMethod = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _analytics.INPUT_METHOD.KEYBOARD;
|
|
@@ -111,17 +108,14 @@ var getOutdentAttrs = function getOutdentAttrs(oldAttr) {
|
|
|
111
108
|
if (!oldAttr) {
|
|
112
109
|
return undefined; // Do nothing;
|
|
113
110
|
}
|
|
114
|
-
|
|
115
111
|
var level = oldAttr.level;
|
|
116
112
|
if (level <= 1) {
|
|
117
113
|
return false; // Remove the mark
|
|
118
114
|
}
|
|
119
|
-
|
|
120
115
|
return {
|
|
121
116
|
level: level - 1
|
|
122
117
|
}; // Decrease the level on other cases
|
|
123
118
|
};
|
|
124
|
-
|
|
125
119
|
var getOutdentCommand = exports.getOutdentCommand = function getOutdentCommand(editorAnalyticsAPI) {
|
|
126
120
|
return function () {
|
|
127
121
|
var inputMethod = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _analytics.INPUT_METHOD.KEYBOARD;
|
|
@@ -68,7 +68,6 @@ function createAnalyticsDispatch(_ref) {
|
|
|
68
68
|
if (!indentType) {
|
|
69
69
|
return; // If no valid indent type continue
|
|
70
70
|
}
|
|
71
|
-
|
|
72
71
|
editorAnalyticsAPI === null || editorAnalyticsAPI === void 0 || editorAnalyticsAPI.attachAnalyticsEvent({
|
|
73
72
|
action: _analytics.ACTION.FORMATTED,
|
|
74
73
|
actionSubject: _analytics.ACTION_SUBJECT.TEXT,
|
|
@@ -77,19 +77,16 @@ const getIndentAttrs = oldAttr => {
|
|
|
77
77
|
level: 1
|
|
78
78
|
}; // No mark exist, create a new one with level 1
|
|
79
79
|
}
|
|
80
|
-
|
|
81
80
|
const {
|
|
82
81
|
level
|
|
83
82
|
} = oldAttr;
|
|
84
83
|
if (level >= MAX_INDENTATION_LEVEL) {
|
|
85
84
|
return undefined; // Max indentation level reached, do nothing.
|
|
86
85
|
}
|
|
87
|
-
|
|
88
86
|
return {
|
|
89
87
|
level: level + 1
|
|
90
88
|
}; // Otherwise, increase the level by one
|
|
91
89
|
};
|
|
92
|
-
|
|
93
90
|
export const getIndentCommand = editorAnalyticsAPI => (inputMethod = INPUT_METHOD.KEYBOARD) => createIndentationCommandWithAnalytics({
|
|
94
91
|
getNewIndentationAttrs: getIndentAttrs,
|
|
95
92
|
direction: INDENT_DIRECTION.INDENT,
|
|
@@ -108,19 +105,16 @@ const getOutdentAttrs = oldAttr => {
|
|
|
108
105
|
if (!oldAttr) {
|
|
109
106
|
return undefined; // Do nothing;
|
|
110
107
|
}
|
|
111
|
-
|
|
112
108
|
const {
|
|
113
109
|
level
|
|
114
110
|
} = oldAttr;
|
|
115
111
|
if (level <= 1) {
|
|
116
112
|
return false; // Remove the mark
|
|
117
113
|
}
|
|
118
|
-
|
|
119
114
|
return {
|
|
120
115
|
level: level - 1
|
|
121
116
|
}; // Decrease the level on other cases
|
|
122
117
|
};
|
|
123
|
-
|
|
124
118
|
export const getOutdentCommand = editorAnalyticsAPI => (inputMethod = INPUT_METHOD.KEYBOARD) => createIndentationCommandWithAnalytics({
|
|
125
119
|
getNewIndentationAttrs: getOutdentAttrs,
|
|
126
120
|
direction: INDENT_DIRECTION.OUTDENT,
|
|
@@ -65,7 +65,6 @@ export function createAnalyticsDispatch({
|
|
|
65
65
|
if (!indentType) {
|
|
66
66
|
return; // If no valid indent type continue
|
|
67
67
|
}
|
|
68
|
-
|
|
69
68
|
editorAnalyticsAPI === null || editorAnalyticsAPI === void 0 ? void 0 : editorAnalyticsAPI.attachAnalyticsEvent({
|
|
70
69
|
action: ACTION.FORMATTED,
|
|
71
70
|
actionSubject: ACTION_SUBJECT.TEXT,
|
|
@@ -70,17 +70,14 @@ var getIndentAttrs = function getIndentAttrs(oldAttr) {
|
|
|
70
70
|
level: 1
|
|
71
71
|
}; // No mark exist, create a new one with level 1
|
|
72
72
|
}
|
|
73
|
-
|
|
74
73
|
var level = oldAttr.level;
|
|
75
74
|
if (level >= MAX_INDENTATION_LEVEL) {
|
|
76
75
|
return undefined; // Max indentation level reached, do nothing.
|
|
77
76
|
}
|
|
78
|
-
|
|
79
77
|
return {
|
|
80
78
|
level: level + 1
|
|
81
79
|
}; // Otherwise, increase the level by one
|
|
82
80
|
};
|
|
83
|
-
|
|
84
81
|
export var getIndentCommand = function getIndentCommand(editorAnalyticsAPI) {
|
|
85
82
|
return function () {
|
|
86
83
|
var inputMethod = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : INPUT_METHOD.KEYBOARD;
|
|
@@ -104,17 +101,14 @@ var getOutdentAttrs = function getOutdentAttrs(oldAttr) {
|
|
|
104
101
|
if (!oldAttr) {
|
|
105
102
|
return undefined; // Do nothing;
|
|
106
103
|
}
|
|
107
|
-
|
|
108
104
|
var level = oldAttr.level;
|
|
109
105
|
if (level <= 1) {
|
|
110
106
|
return false; // Remove the mark
|
|
111
107
|
}
|
|
112
|
-
|
|
113
108
|
return {
|
|
114
109
|
level: level - 1
|
|
115
110
|
}; // Decrease the level on other cases
|
|
116
111
|
};
|
|
117
|
-
|
|
118
112
|
export var getOutdentCommand = function getOutdentCommand(editorAnalyticsAPI) {
|
|
119
113
|
return function () {
|
|
120
114
|
var inputMethod = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : INPUT_METHOD.KEYBOARD;
|
|
@@ -61,7 +61,6 @@ export function createAnalyticsDispatch(_ref) {
|
|
|
61
61
|
if (!indentType) {
|
|
62
62
|
return; // If no valid indent type continue
|
|
63
63
|
}
|
|
64
|
-
|
|
65
64
|
editorAnalyticsAPI === null || editorAnalyticsAPI === void 0 || editorAnalyticsAPI.attachAnalyticsEvent({
|
|
66
65
|
action: ACTION.FORMATTED,
|
|
67
66
|
actionSubject: ACTION_SUBJECT.TEXT,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-indentation",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"description": "Indentation plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -33,8 +33,8 @@
|
|
|
33
33
|
".": "./src/index.ts"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@atlaskit/adf-schema": "^35.
|
|
37
|
-
"@atlaskit/editor-common": "^78.
|
|
36
|
+
"@atlaskit/adf-schema": "^35.6.0",
|
|
37
|
+
"@atlaskit/editor-common": "^78.12.0",
|
|
38
38
|
"@atlaskit/editor-plugin-analytics": "^1.0.0",
|
|
39
39
|
"@atlaskit/editor-prosemirror": "3.0.0",
|
|
40
40
|
"@babel/runtime": "^7.0.0"
|