@atlaskit/editor-core 189.0.14 → 189.1.1
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 +18 -0
- package/dist/cjs/extensibility.js +4 -4
- package/dist/cjs/plugins/annotation/commands/index.js +51 -43
- package/dist/cjs/plugins/annotation/commands/transform.js +43 -33
- package/dist/cjs/plugins/annotation/index.js +12 -5
- package/dist/cjs/plugins/annotation/pm-plugins/inline-comment.js +17 -13
- package/dist/cjs/plugins/annotation/pm-plugins/keymap.js +2 -2
- package/dist/cjs/plugins/annotation/toolbar.js +41 -39
- package/dist/cjs/plugins/annotation/ui/InlineCommentView.js +4 -3
- package/dist/cjs/plugins/index.js +0 -14
- package/dist/cjs/plugins/placeholder-text/index.js +8 -1
- package/dist/cjs/plugins/placeholder-text/plugin.js +2 -1
- package/dist/cjs/plugins/placeholder-text/styles.js +1 -1
- package/dist/cjs/presets/default.js +1 -2
- package/dist/cjs/presets/universal.js +2 -1
- package/dist/cjs/ui/ContentStyles/index.js +7 -8
- package/dist/cjs/utils/document.js +0 -26
- package/dist/cjs/utils/index.js +0 -4
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/es2019/extensibility.js +1 -1
- package/dist/es2019/plugins/annotation/commands/index.js +8 -8
- package/dist/es2019/plugins/annotation/commands/transform.js +13 -11
- package/dist/es2019/plugins/annotation/index.js +12 -5
- package/dist/es2019/plugins/annotation/pm-plugins/inline-comment.js +10 -10
- package/dist/es2019/plugins/annotation/pm-plugins/keymap.js +2 -2
- package/dist/es2019/plugins/annotation/toolbar.js +2 -2
- package/dist/es2019/plugins/annotation/ui/InlineCommentView.js +4 -3
- package/dist/es2019/plugins/index.js +0 -2
- package/dist/es2019/plugins/placeholder-text/index.js +2 -1
- package/dist/es2019/plugins/placeholder-text/plugin.js +2 -1
- package/dist/es2019/plugins/placeholder-text/styles.js +24 -1
- package/dist/es2019/presets/default.js +1 -2
- package/dist/es2019/presets/universal.js +3 -2
- package/dist/es2019/ui/ContentStyles/index.js +0 -2
- package/dist/es2019/utils/document.js +0 -25
- package/dist/es2019/utils/index.js +0 -4
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/esm/extensibility.js +1 -1
- package/dist/esm/plugins/annotation/commands/index.js +51 -43
- package/dist/esm/plugins/annotation/commands/transform.js +40 -30
- package/dist/esm/plugins/annotation/index.js +12 -5
- package/dist/esm/plugins/annotation/pm-plugins/inline-comment.js +17 -13
- package/dist/esm/plugins/annotation/pm-plugins/keymap.js +2 -2
- package/dist/esm/plugins/annotation/toolbar.js +41 -39
- package/dist/esm/plugins/annotation/ui/InlineCommentView.js +4 -3
- package/dist/esm/plugins/index.js +0 -2
- package/dist/esm/plugins/placeholder-text/index.js +2 -1
- package/dist/esm/plugins/placeholder-text/plugin.js +2 -1
- package/dist/esm/plugins/placeholder-text/styles.js +2 -2
- package/dist/esm/presets/default.js +1 -2
- package/dist/esm/presets/universal.js +3 -2
- package/dist/esm/ui/ContentStyles/index.js +2 -3
- package/dist/esm/utils/document.js +0 -24
- package/dist/esm/utils/index.js +0 -4
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/types/extensibility.d.ts +1 -1
- package/dist/types/plugins/annotation/commands/index.d.ts +5 -4
- package/dist/types/plugins/annotation/commands/transform.d.ts +5 -4
- package/dist/types/plugins/annotation/index.d.ts +5 -2
- package/dist/types/plugins/annotation/pm-plugins/keymap.d.ts +2 -1
- package/dist/types/plugins/annotation/pm-plugins/types.d.ts +2 -0
- package/dist/types/plugins/annotation/toolbar.d.ts +2 -1
- package/dist/types/plugins/annotation/ui/InlineCommentView.d.ts +3 -1
- package/dist/types/plugins/index.d.ts +0 -2
- package/dist/types/plugins/placeholder-text/index.d.ts +1 -0
- package/dist/types/plugins/placeholder-text/types.d.ts +4 -1
- package/dist/types/presets/default.d.ts +4 -4
- package/dist/types/ui/Appearance/FullPage/StyledComponents.d.ts +1 -1
- package/dist/types/ui/ConfigPanel/ConfigPanel.d.ts +1 -1
- package/dist/types/ui/ContentStyles/index.d.ts +2 -2
- package/dist/types/utils/document.d.ts +0 -11
- package/dist/types-ts4.5/extensibility.d.ts +1 -1
- package/dist/types-ts4.5/plugins/annotation/commands/index.d.ts +5 -4
- package/dist/types-ts4.5/plugins/annotation/commands/transform.d.ts +5 -4
- package/dist/types-ts4.5/plugins/annotation/index.d.ts +7 -2
- package/dist/types-ts4.5/plugins/annotation/pm-plugins/keymap.d.ts +2 -1
- package/dist/types-ts4.5/plugins/annotation/pm-plugins/types.d.ts +2 -0
- package/dist/types-ts4.5/plugins/annotation/toolbar.d.ts +2 -1
- package/dist/types-ts4.5/plugins/annotation/ui/InlineCommentView.d.ts +3 -1
- package/dist/types-ts4.5/plugins/index.d.ts +0 -2
- package/dist/types-ts4.5/plugins/placeholder-text/index.d.ts +1 -0
- package/dist/types-ts4.5/plugins/placeholder-text/types.d.ts +1 -1
- package/dist/types-ts4.5/presets/default.d.ts +0 -4
- package/dist/types-ts4.5/ui/Appearance/FullPage/StyledComponents.d.ts +1 -1
- package/dist/types-ts4.5/ui/ConfigPanel/ConfigPanel.d.ts +1 -1
- package/dist/types-ts4.5/ui/ContentStyles/index.d.ts +2 -2
- package/dist/types-ts4.5/utils/document.d.ts +0 -11
- package/package.json +4 -3
- package/dist/cjs/plugins/fake-text-cursor/index.js +0 -32
- package/dist/cjs/plugins/fake-text-cursor/styles.js +0 -12
- package/dist/cjs/plugins/fragment/index.js +0 -29
- package/dist/cjs/plugins/fragment/plugin-key.js +0 -8
- package/dist/cjs/plugins/fragment/pm-plugins/fragment-consistency.js +0 -143
- package/dist/es2019/plugins/fake-text-cursor/index.js +0 -20
- package/dist/es2019/plugins/fake-text-cursor/styles.js +0 -26
- package/dist/es2019/plugins/fragment/index.js +0 -20
- package/dist/es2019/plugins/fragment/plugin-key.js +0 -2
- package/dist/es2019/plugins/fragment/pm-plugins/fragment-consistency.js +0 -113
- package/dist/esm/plugins/fake-text-cursor/index.js +0 -26
- package/dist/esm/plugins/fake-text-cursor/styles.js +0 -5
- package/dist/esm/plugins/fragment/index.js +0 -23
- package/dist/esm/plugins/fragment/plugin-key.js +0 -2
- package/dist/esm/plugins/fragment/pm-plugins/fragment-consistency.js +0 -137
- package/dist/types/plugins/fake-text-cursor/index.d.ts +0 -7
- package/dist/types/plugins/fake-text-cursor/styles.d.ts +0 -1
- package/dist/types/plugins/fragment/index.d.ts +0 -3
- package/dist/types/plugins/fragment/plugin-key.d.ts +0 -2
- package/dist/types/plugins/fragment/pm-plugins/fragment-consistency.d.ts +0 -15
- package/dist/types-ts4.5/plugins/fake-text-cursor/index.d.ts +0 -7
- package/dist/types-ts4.5/plugins/fake-text-cursor/styles.d.ts +0 -1
- package/dist/types-ts4.5/plugins/fragment/index.d.ts +0 -3
- package/dist/types-ts4.5/plugins/fragment/plugin-key.d.ts +0 -2
- package/dist/types-ts4.5/plugins/fragment/pm-plugins/fragment-consistency.d.ts +0 -15
- /package/dist/cjs/plugins/{fake-text-cursor → placeholder-text/fake-text-cursor}/cursor.js +0 -0
- /package/dist/es2019/plugins/{fake-text-cursor → placeholder-text/fake-text-cursor}/cursor.js +0 -0
- /package/dist/esm/plugins/{fake-text-cursor → placeholder-text/fake-text-cursor}/cursor.js +0 -0
- /package/dist/types/plugins/{fake-text-cursor → placeholder-text/fake-text-cursor}/cursor.d.ts +0 -0
- /package/dist/types-ts4.5/plugins/{fake-text-cursor → placeholder-text/fake-text-cursor}/cursor.d.ts +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @atlaskit/editor-core
|
|
2
2
|
|
|
3
|
+
## 189.1.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#42279](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/42279) [`f4fd8d16522`](https://bitbucket.org/atlassian/atlassian-frontend/commits/f4fd8d16522) - ED-20556 Extract Fragment plugin
|
|
8
|
+
- [#42255](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/42255) [`44cdc71165d`](https://bitbucket.org/atlassian/atlassian-frontend/commits/44cdc71165d) - Decouple annotation plugin from deprecated analytics plugin.
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
11
|
+
## 189.1.0
|
|
12
|
+
|
|
13
|
+
### Minor Changes
|
|
14
|
+
|
|
15
|
+
- [#42210](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/42210) [`a00e52ea8b8`](https://bitbucket.org/atlassian/atlassian-frontend/commits/a00e52ea8b8) - ED-20478: removes editor fake-text-cursor editor plugin and relocates it under placeholder-text plugin
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- Updated dependencies
|
|
20
|
+
|
|
3
21
|
## 189.0.14
|
|
4
22
|
|
|
5
23
|
### Patch Changes
|
|
@@ -26,14 +26,14 @@ Object.defineProperty(exports, "ExtensionNodeWrapper", {
|
|
|
26
26
|
Object.defineProperty(exports, "getChangedNodes", {
|
|
27
27
|
enumerable: true,
|
|
28
28
|
get: function get() {
|
|
29
|
-
return
|
|
29
|
+
return _utils.getChangedNodes;
|
|
30
30
|
}
|
|
31
31
|
});
|
|
32
32
|
exports.tablePluginKey = void 0;
|
|
33
33
|
Object.defineProperty(exports, "toJSON", {
|
|
34
34
|
enumerable: true,
|
|
35
35
|
get: function get() {
|
|
36
|
-
return
|
|
36
|
+
return _utils2.toJSON;
|
|
37
37
|
}
|
|
38
38
|
});
|
|
39
39
|
Object.defineProperty(exports, "validateNodes", {
|
|
@@ -42,9 +42,9 @@ Object.defineProperty(exports, "validateNodes", {
|
|
|
42
42
|
return _nodes.validateNodes;
|
|
43
43
|
}
|
|
44
44
|
});
|
|
45
|
-
var
|
|
45
|
+
var _utils = require("@atlaskit/editor-common/utils");
|
|
46
46
|
var _nodes = require("./utils/nodes");
|
|
47
|
-
var
|
|
47
|
+
var _utils2 = require("./utils");
|
|
48
48
|
var _Extension = _interopRequireDefault(require("./plugins/extension/ui/Extension"));
|
|
49
49
|
var _ExtensionNodeWrapper = _interopRequireDefault(require("./plugins/extension/ui/Extension/ExtensionNodeWrapper"));
|
|
50
50
|
var _extension = require("./plugins/extension/nodeviews/extension");
|
|
@@ -13,18 +13,20 @@ var _utils = require("../utils");
|
|
|
13
13
|
var _types = require("../pm-plugins/types");
|
|
14
14
|
var _transform = _interopRequireDefault(require("./transform"));
|
|
15
15
|
var _types2 = require("../types");
|
|
16
|
-
var updateInlineCommentResolvedState = exports.updateInlineCommentResolvedState = function updateInlineCommentResolvedState(
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
var updateInlineCommentResolvedState = exports.updateInlineCommentResolvedState = function updateInlineCommentResolvedState(editorAnalyticsAPI) {
|
|
17
|
+
return function (partialNewState, resolveMethod) {
|
|
18
|
+
var command = {
|
|
19
|
+
type: _types.ACTIONS.UPDATE_INLINE_COMMENT_STATE,
|
|
20
|
+
data: partialNewState
|
|
21
|
+
};
|
|
22
|
+
var allResolved = Object.values(partialNewState).every(function (state) {
|
|
23
|
+
return state;
|
|
24
|
+
});
|
|
25
|
+
if (resolveMethod && allResolved) {
|
|
26
|
+
return (0, _pluginFactory.createCommand)(command, _transform.default.addResolveAnalytics(editorAnalyticsAPI)(resolveMethod));
|
|
27
|
+
}
|
|
28
|
+
return (0, _pluginFactory.createCommand)(command);
|
|
20
29
|
};
|
|
21
|
-
var allResolved = Object.values(partialNewState).every(function (state) {
|
|
22
|
-
return state;
|
|
23
|
-
});
|
|
24
|
-
if (resolveMethod && allResolved) {
|
|
25
|
-
return (0, _pluginFactory.createCommand)(command, _transform.default.addResolveAnalytics(resolveMethod));
|
|
26
|
-
}
|
|
27
|
-
return (0, _pluginFactory.createCommand)(command);
|
|
28
30
|
};
|
|
29
31
|
var closeComponent = exports.closeComponent = function closeComponent() {
|
|
30
32
|
return (0, _pluginFactory.createCommand)({
|
|
@@ -74,29 +76,33 @@ var getDraftCommandAction = function getDraftCommandAction(drafting) {
|
|
|
74
76
|
};
|
|
75
77
|
};
|
|
76
78
|
};
|
|
77
|
-
var setInlineCommentDraftState = exports.setInlineCommentDraftState = function setInlineCommentDraftState(
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
79
|
+
var setInlineCommentDraftState = exports.setInlineCommentDraftState = function setInlineCommentDraftState(editorAnalyticsAPI) {
|
|
80
|
+
return function (drafting) {
|
|
81
|
+
var inputMethod = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _analytics.INPUT_METHOD.TOOLBAR;
|
|
82
|
+
var commandAction = getDraftCommandAction(drafting);
|
|
83
|
+
return (0, _pluginFactory.createCommand)(commandAction, _transform.default.addOpenCloseAnalytics(editorAnalyticsAPI)(drafting, inputMethod));
|
|
84
|
+
};
|
|
81
85
|
};
|
|
82
|
-
var addInlineComment = exports.addInlineComment = function addInlineComment(
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
86
|
+
var addInlineComment = exports.addInlineComment = function addInlineComment(editorAnalyticsAPI) {
|
|
87
|
+
return function (id) {
|
|
88
|
+
var commandAction = function commandAction(editorState) {
|
|
89
|
+
return {
|
|
90
|
+
type: _types.ACTIONS.ADD_INLINE_COMMENT,
|
|
91
|
+
data: {
|
|
92
|
+
drafting: false,
|
|
93
|
+
inlineComments: (0, _defineProperty2.default)({}, id, false),
|
|
94
|
+
// Auto make the newly inserted comment selected.
|
|
95
|
+
// We move the selection to the head of the comment selection.
|
|
96
|
+
selectedAnnotations: [{
|
|
97
|
+
id: id,
|
|
98
|
+
type: _adfSchema.AnnotationTypes.INLINE_COMMENT
|
|
99
|
+
}],
|
|
100
|
+
editorState: editorState
|
|
101
|
+
}
|
|
102
|
+
};
|
|
97
103
|
};
|
|
104
|
+
return (0, _pluginFactory.createCommand)(commandAction, _transform.default.addInlineComment(editorAnalyticsAPI)(id));
|
|
98
105
|
};
|
|
99
|
-
return (0, _pluginFactory.createCommand)(commandAction, _transform.default.addInlineComment(id));
|
|
100
106
|
};
|
|
101
107
|
var updateMouseState = exports.updateMouseState = function updateMouseState(mouseData) {
|
|
102
108
|
return (0, _pluginFactory.createCommand)({
|
|
@@ -117,19 +123,21 @@ var setSelectedAnnotation = exports.setSelectedAnnotation = function setSelected
|
|
|
117
123
|
}
|
|
118
124
|
});
|
|
119
125
|
};
|
|
120
|
-
var createAnnotation = exports.createAnnotation = function createAnnotation(
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
126
|
+
var createAnnotation = exports.createAnnotation = function createAnnotation(editorAnalyticsAPI) {
|
|
127
|
+
return function (id) {
|
|
128
|
+
var annotationType = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _adfSchema.AnnotationTypes.INLINE_COMMENT;
|
|
129
|
+
return function (state, dispatch) {
|
|
130
|
+
// don't try to add if there are is no temp highlight bookmarked
|
|
131
|
+
var _ref = (0, _utils.getPluginState)(state) || {},
|
|
132
|
+
bookmark = _ref.bookmark;
|
|
133
|
+
if (!bookmark || !dispatch) {
|
|
134
|
+
return false;
|
|
135
|
+
}
|
|
136
|
+
if (annotationType === _adfSchema.AnnotationTypes.INLINE_COMMENT) {
|
|
137
|
+
return addInlineComment(editorAnalyticsAPI)(id)(state, dispatch);
|
|
138
|
+
}
|
|
127
139
|
return false;
|
|
128
|
-
}
|
|
129
|
-
if (annotationType === _adfSchema.AnnotationTypes.INLINE_COMMENT) {
|
|
130
|
-
return addInlineComment(id)(state, dispatch);
|
|
131
|
-
}
|
|
132
|
-
return false;
|
|
140
|
+
};
|
|
133
141
|
};
|
|
134
142
|
};
|
|
135
143
|
var setInlineCommentsVisibility = exports.setInlineCommentsVisibility = function setInlineCommentsVisibility(isVisible) {
|
|
@@ -7,13 +7,12 @@ exports.default = void 0;
|
|
|
7
7
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
8
8
|
var _adfSchema = require("@atlaskit/adf-schema");
|
|
9
9
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
10
|
-
var _utils = require("
|
|
11
|
-
var _utils2 = require("../utils");
|
|
10
|
+
var _utils = require("../utils");
|
|
12
11
|
var _mark = require("@atlaskit/editor-common/mark");
|
|
13
12
|
var addAnnotationMark = function addAnnotationMark(id) {
|
|
14
13
|
return function (transaction, state) {
|
|
15
|
-
var inlineCommentState = (0,
|
|
16
|
-
var _getSelectionPosition = (0,
|
|
14
|
+
var inlineCommentState = (0, _utils.getPluginState)(state);
|
|
15
|
+
var _getSelectionPosition = (0, _utils.getSelectionPositions)(state, inlineCommentState),
|
|
17
16
|
from = _getSelectionPosition.from,
|
|
18
17
|
to = _getSelectionPosition.to,
|
|
19
18
|
head = _getSelectionPosition.head;
|
|
@@ -28,43 +27,54 @@ var addAnnotationMark = function addAnnotationMark(id) {
|
|
|
28
27
|
return tr;
|
|
29
28
|
};
|
|
30
29
|
};
|
|
31
|
-
var addInlineComment = function addInlineComment(
|
|
32
|
-
return function (
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
30
|
+
var addInlineComment = function addInlineComment(editorAnalyticsAPI) {
|
|
31
|
+
return function (id) {
|
|
32
|
+
return function (transaction, state) {
|
|
33
|
+
var tr = addAnnotationMark(id)(transaction, state);
|
|
34
|
+
// add insert analytics step to transaction
|
|
35
|
+
tr = addInsertAnalytics(editorAnalyticsAPI)(tr, state);
|
|
36
|
+
// add close analytics step to transaction
|
|
37
|
+
tr = addOpenCloseAnalytics(editorAnalyticsAPI)(false, _analytics.INPUT_METHOD.TOOLBAR)(tr, state);
|
|
38
|
+
return tr;
|
|
39
|
+
};
|
|
39
40
|
};
|
|
40
41
|
};
|
|
41
|
-
var addOpenCloseAnalytics = function addOpenCloseAnalytics(
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
42
|
+
var addOpenCloseAnalytics = function addOpenCloseAnalytics(editorAnalyticsAPI) {
|
|
43
|
+
return function (drafting) {
|
|
44
|
+
var method = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _analytics.INPUT_METHOD.TOOLBAR;
|
|
45
|
+
return function (transaction, state) {
|
|
46
|
+
var draftingPayload = (0, _utils.getDraftCommandAnalyticsPayload)(drafting, method)(state);
|
|
47
|
+
editorAnalyticsAPI === null || editorAnalyticsAPI === void 0 || editorAnalyticsAPI.attachAnalyticsEvent(draftingPayload)(transaction);
|
|
48
|
+
return transaction;
|
|
49
|
+
};
|
|
46
50
|
};
|
|
47
51
|
};
|
|
48
|
-
var addInsertAnalytics = function addInsertAnalytics(
|
|
49
|
-
return (0, _utils.addAnalytics)(state, transaction, {
|
|
50
|
-
action: _analytics.ACTION.INSERTED,
|
|
51
|
-
actionSubject: _analytics.ACTION_SUBJECT.ANNOTATION,
|
|
52
|
-
eventType: _analytics.EVENT_TYPE.TRACK,
|
|
53
|
-
actionSubjectId: _analytics.ACTION_SUBJECT_ID.INLINE_COMMENT
|
|
54
|
-
});
|
|
55
|
-
};
|
|
56
|
-
var addResolveAnalytics = function addResolveAnalytics(method) {
|
|
52
|
+
var addInsertAnalytics = function addInsertAnalytics(editorAnalyticsAPI) {
|
|
57
53
|
return function (transaction, state) {
|
|
58
|
-
|
|
59
|
-
action: _analytics.ACTION.
|
|
54
|
+
editorAnalyticsAPI === null || editorAnalyticsAPI === void 0 || editorAnalyticsAPI.attachAnalyticsEvent({
|
|
55
|
+
action: _analytics.ACTION.INSERTED,
|
|
60
56
|
actionSubject: _analytics.ACTION_SUBJECT.ANNOTATION,
|
|
61
|
-
actionSubjectId: _analytics.ACTION_SUBJECT_ID.INLINE_COMMENT,
|
|
62
57
|
eventType: _analytics.EVENT_TYPE.TRACK,
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
58
|
+
actionSubjectId: _analytics.ACTION_SUBJECT_ID.INLINE_COMMENT
|
|
59
|
+
})(transaction);
|
|
60
|
+
return transaction;
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
var addResolveAnalytics = function addResolveAnalytics(editorAnalyticsAPI) {
|
|
64
|
+
return function (method) {
|
|
65
|
+
return function (transaction, state) {
|
|
66
|
+
var resolvedPayload = {
|
|
67
|
+
action: _analytics.ACTION.RESOLVED,
|
|
68
|
+
actionSubject: _analytics.ACTION_SUBJECT.ANNOTATION,
|
|
69
|
+
actionSubjectId: _analytics.ACTION_SUBJECT_ID.INLINE_COMMENT,
|
|
70
|
+
eventType: _analytics.EVENT_TYPE.TRACK,
|
|
71
|
+
attributes: {
|
|
72
|
+
method: method
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
editorAnalyticsAPI === null || editorAnalyticsAPI === void 0 || editorAnalyticsAPI.attachAnalyticsEvent(resolvedPayload)(transaction);
|
|
76
|
+
return transaction;
|
|
66
77
|
};
|
|
67
|
-
return (0, _utils.addAnalytics)(state, transaction, resolvedPayload);
|
|
68
78
|
};
|
|
69
79
|
};
|
|
70
80
|
var _default = exports.default = {
|
|
@@ -46,11 +46,13 @@ var annotationPlugin = function annotationPlugin(_ref) {
|
|
|
46
46
|
portalProviderAPI = _ref2.portalProviderAPI,
|
|
47
47
|
eventDispatcher = _ref2.eventDispatcher;
|
|
48
48
|
if (annotationProviders) {
|
|
49
|
+
var _api$analytics;
|
|
49
50
|
return (0, _inlineComment.inlineCommentPlugin)({
|
|
50
51
|
dispatch: dispatch,
|
|
51
52
|
portalProviderAPI: portalProviderAPI,
|
|
52
53
|
eventDispatcher: eventDispatcher,
|
|
53
|
-
provider: annotationProviders.inlineComment
|
|
54
|
+
provider: annotationProviders.inlineComment,
|
|
55
|
+
editorAnalyticsAPI: api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions
|
|
54
56
|
});
|
|
55
57
|
}
|
|
56
58
|
return;
|
|
@@ -59,7 +61,8 @@ var annotationPlugin = function annotationPlugin(_ref) {
|
|
|
59
61
|
name: 'annotationKeymap',
|
|
60
62
|
plugin: function plugin() {
|
|
61
63
|
if (annotationProviders) {
|
|
62
|
-
|
|
64
|
+
var _api$analytics2;
|
|
65
|
+
return (0, _keymap.keymapPlugin)(api === null || api === void 0 || (_api$analytics2 = api.analytics) === null || _api$analytics2 === void 0 ? void 0 : _api$analytics2.actions);
|
|
63
66
|
}
|
|
64
67
|
return;
|
|
65
68
|
}
|
|
@@ -72,8 +75,9 @@ var annotationPlugin = function annotationPlugin(_ref) {
|
|
|
72
75
|
}
|
|
73
76
|
var pluginState = (0, _utils.getPluginState)(state);
|
|
74
77
|
if (pluginState && pluginState.isVisible && !pluginState.bookmark && !pluginState.mouseData.isSelecting) {
|
|
78
|
+
var _api$analytics3;
|
|
75
79
|
var isToolbarAbove = annotationProviders.inlineComment.isToolbarAbove;
|
|
76
|
-
return (0, _toolbar.buildToolbar)(state, intl, isToolbarAbove);
|
|
80
|
+
return (0, _toolbar.buildToolbar)(api === null || api === void 0 || (_api$analytics3 = api.analytics) === null || _api$analytics3 === void 0 ? void 0 : _api$analytics3.actions)(state, intl, isToolbarAbove);
|
|
77
81
|
}
|
|
78
82
|
},
|
|
79
83
|
selectionToolbar: function selectionToolbar(state, intl) {
|
|
@@ -82,8 +86,9 @@ var annotationPlugin = function annotationPlugin(_ref) {
|
|
|
82
86
|
}
|
|
83
87
|
var pluginState = (0, _utils.getPluginState)(state);
|
|
84
88
|
if (pluginState && pluginState.isVisible && !pluginState.bookmark && !pluginState.mouseData.isSelecting) {
|
|
89
|
+
var _api$analytics4;
|
|
85
90
|
var isToolbarAbove = annotationProviders.inlineComment.isToolbarAbove;
|
|
86
|
-
return (0, _toolbar.buildToolbar)(state, intl, isToolbarAbove);
|
|
91
|
+
return (0, _toolbar.buildToolbar)(api === null || api === void 0 || (_api$analytics4 = api.analytics) === null || _api$analytics4 === void 0 ? void 0 : _api$analytics4.actions)(state, intl, isToolbarAbove);
|
|
87
92
|
}
|
|
88
93
|
}
|
|
89
94
|
},
|
|
@@ -103,6 +108,7 @@ var annotationPlugin = function annotationPlugin(_ref) {
|
|
|
103
108
|
};
|
|
104
109
|
};
|
|
105
110
|
function AnnotationContentComponent(_ref4) {
|
|
111
|
+
var _api$analytics5;
|
|
106
112
|
var api = _ref4.api,
|
|
107
113
|
editorView = _ref4.editorView,
|
|
108
114
|
annotationProviders = _ref4.annotationProviders,
|
|
@@ -117,7 +123,8 @@ function AnnotationContentComponent(_ref4) {
|
|
|
117
123
|
}, /*#__PURE__*/_react.default.createElement(_InlineCommentView.InlineCommentView, {
|
|
118
124
|
providers: annotationProviders,
|
|
119
125
|
editorView: editorView,
|
|
120
|
-
dispatchAnalyticsEvent: dispatchAnalyticsEvent
|
|
126
|
+
dispatchAnalyticsEvent: dispatchAnalyticsEvent,
|
|
127
|
+
editorAnalyticsAPI: api === null || api === void 0 || (_api$analytics5 = api.analytics) === null || _api$analytics5 === void 0 ? void 0 : _api$analytics5.actions
|
|
121
128
|
}));
|
|
122
129
|
}
|
|
123
130
|
var _default = exports.default = annotationPlugin;
|
|
@@ -47,7 +47,7 @@ var fetchProviderStates = /*#__PURE__*/function () {
|
|
|
47
47
|
// fetchState is unable to return a command as it's runs async and may dispatch at a later time
|
|
48
48
|
// Requires `editorView` instead of the decomposition as the async means state may end up stale
|
|
49
49
|
var fetchState = /*#__PURE__*/function () {
|
|
50
|
-
var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(provider, annotationIds, editorView) {
|
|
50
|
+
var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(provider, annotationIds, editorView, editorAnalyticsAPI) {
|
|
51
51
|
var inlineCommentStates;
|
|
52
52
|
return _regenerator.default.wrap(function _callee2$(_context2) {
|
|
53
53
|
while (1) switch (_context2.prev = _context2.next) {
|
|
@@ -63,7 +63,7 @@ var fetchState = /*#__PURE__*/function () {
|
|
|
63
63
|
case 4:
|
|
64
64
|
inlineCommentStates = _context2.sent;
|
|
65
65
|
if (editorView.dispatch) {
|
|
66
|
-
(0, _commands.updateInlineCommentResolvedState)(inlineCommentStates)(editorView.state, editorView.dispatch);
|
|
66
|
+
(0, _commands.updateInlineCommentResolvedState)(editorAnalyticsAPI)(inlineCommentStates)(editorView.state, editorView.dispatch);
|
|
67
67
|
}
|
|
68
68
|
case 6:
|
|
69
69
|
case "end":
|
|
@@ -71,7 +71,7 @@ var fetchState = /*#__PURE__*/function () {
|
|
|
71
71
|
}
|
|
72
72
|
}, _callee2);
|
|
73
73
|
}));
|
|
74
|
-
return function fetchState(_x3, _x4, _x5) {
|
|
74
|
+
return function fetchState(_x3, _x4, _x5, _x6) {
|
|
75
75
|
return _ref2.apply(this, arguments);
|
|
76
76
|
};
|
|
77
77
|
}();
|
|
@@ -97,14 +97,18 @@ var hideToolbar = function hideToolbar(state, dispatch) {
|
|
|
97
97
|
};
|
|
98
98
|
|
|
99
99
|
// Subscribe to updates from consumer
|
|
100
|
-
var onResolve = function onResolve(
|
|
101
|
-
return function (
|
|
102
|
-
|
|
100
|
+
var onResolve = function onResolve(editorAnalyticsAPI) {
|
|
101
|
+
return function (state, dispatch) {
|
|
102
|
+
return function (annotationId) {
|
|
103
|
+
(0, _commands.updateInlineCommentResolvedState)(editorAnalyticsAPI)((0, _defineProperty2.default)({}, annotationId, true), _inlineCommentEvents.RESOLVE_METHOD.CONSUMER)(state, dispatch);
|
|
104
|
+
};
|
|
103
105
|
};
|
|
104
106
|
};
|
|
105
|
-
var onUnResolve = function onUnResolve(
|
|
106
|
-
return function (
|
|
107
|
-
|
|
107
|
+
var onUnResolve = function onUnResolve(editorAnalyticsAPI) {
|
|
108
|
+
return function (state, dispatch) {
|
|
109
|
+
return function (annotationId) {
|
|
110
|
+
(0, _commands.updateInlineCommentResolvedState)(editorAnalyticsAPI)((0, _defineProperty2.default)({}, annotationId, false))(state, dispatch);
|
|
111
|
+
};
|
|
108
112
|
};
|
|
109
113
|
};
|
|
110
114
|
var onMouseUp = function onMouseUp(state, dispatch) {
|
|
@@ -142,12 +146,12 @@ var inlineCommentPlugin = exports.inlineCommentPlugin = function inlineCommentPl
|
|
|
142
146
|
view: function view(editorView) {
|
|
143
147
|
// Get initial state
|
|
144
148
|
// Need to pass `editorView` to mitigate editor state going stale
|
|
145
|
-
fetchState(provider, (0, _utils.getAllAnnotations)(editorView.state.doc), editorView);
|
|
149
|
+
fetchState(provider, (0, _utils.getAllAnnotations)(editorView.state.doc), editorView, options.editorAnalyticsAPI);
|
|
146
150
|
var resolve = function resolve(annotationId) {
|
|
147
|
-
return onResolve(editorView.state, editorView.dispatch)(annotationId);
|
|
151
|
+
return onResolve(options.editorAnalyticsAPI)(editorView.state, editorView.dispatch)(annotationId);
|
|
148
152
|
};
|
|
149
153
|
var unResolve = function unResolve(annotationId) {
|
|
150
|
-
return onUnResolve(editorView.state, editorView.dispatch)(annotationId);
|
|
154
|
+
return onUnResolve(options.editorAnalyticsAPI)(editorView.state, editorView.dispatch)(annotationId);
|
|
151
155
|
};
|
|
152
156
|
var mouseUp = function mouseUp(event) {
|
|
153
157
|
return onMouseUp(editorView.state, editorView.dispatch)(event);
|
|
@@ -175,7 +179,7 @@ var inlineCommentPlugin = exports.inlineCommentPlugin = function inlineCommentPl
|
|
|
175
179
|
return;
|
|
176
180
|
}
|
|
177
181
|
(0, _commands.clearDirtyMark)()(view.state, view.dispatch);
|
|
178
|
-
fetchState(provider, (0, _utils.getAllAnnotations)(view.state.doc), view);
|
|
182
|
+
fetchState(provider, (0, _utils.getAllAnnotations)(view.state.doc), view, options.editorAnalyticsAPI);
|
|
179
183
|
},
|
|
180
184
|
destroy: function destroy() {
|
|
181
185
|
editorView.root.removeEventListener('mouseup', mouseUp);
|
|
@@ -8,8 +8,8 @@ var _keymap = require("@atlaskit/editor-prosemirror/keymap");
|
|
|
8
8
|
var _keymaps = require("../../../keymaps");
|
|
9
9
|
var _commands = require("../commands");
|
|
10
10
|
var _analytics = require("../../analytics");
|
|
11
|
-
function keymapPlugin() {
|
|
11
|
+
function keymapPlugin(editorAnalyticsAPI) {
|
|
12
12
|
var list = {};
|
|
13
|
-
(0, _keymaps.bindKeymapWithCommand)(_keymaps.addInlineComment.common, (0, _commands.setInlineCommentDraftState)(true, _analytics.INPUT_METHOD.SHORTCUT), list);
|
|
13
|
+
(0, _keymaps.bindKeymapWithCommand)(_keymaps.addInlineComment.common, (0, _commands.setInlineCommentDraftState)(editorAnalyticsAPI)(true, _analytics.INPUT_METHOD.SHORTCUT), list);
|
|
14
14
|
return (0, _keymap.keymap)(list);
|
|
15
15
|
}
|
|
@@ -13,45 +13,47 @@ var _types = require("./types");
|
|
|
13
13
|
var _utils = require("./utils");
|
|
14
14
|
var _messages = require("@atlaskit/editor-common/messages");
|
|
15
15
|
var _utils2 = require("@atlaskit/editor-common/utils");
|
|
16
|
-
var buildToolbar = exports.buildToolbar = function buildToolbar(
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
var createCommentMessage = intl.formatMessage(_messages.annotationMessages.createComment);
|
|
24
|
-
var commentDisabledMessage = intl.formatMessage(_messages.annotationMessages.createCommentInvalid);
|
|
25
|
-
var createComment = {
|
|
26
|
-
type: 'button',
|
|
27
|
-
showTitle: true,
|
|
28
|
-
disabled: selectionValid === _types.AnnotationSelectionType.DISABLED,
|
|
29
|
-
testId: _types.AnnotationTestIds.floatingToolbarCreateButton,
|
|
30
|
-
icon: _comment.default,
|
|
31
|
-
tooltipContent: selectionValid === _types.AnnotationSelectionType.DISABLED ? commentDisabledMessage : /*#__PURE__*/_react.default.createElement(_keymaps.ToolTipContent, {
|
|
32
|
-
description: createCommentMessage,
|
|
33
|
-
keymap: _keymaps.addInlineComment
|
|
34
|
-
}),
|
|
35
|
-
title: createCommentMessage,
|
|
36
|
-
onClick: function onClick(state, dispatch) {
|
|
37
|
-
return (0, _commands.setInlineCommentDraftState)(true)(state, dispatch);
|
|
16
|
+
var buildToolbar = exports.buildToolbar = function buildToolbar(editorAnalyticsAPI) {
|
|
17
|
+
return function (state, intl) {
|
|
18
|
+
var isToolbarAbove = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
19
|
+
var schema = state.schema;
|
|
20
|
+
var selectionValid = (0, _utils.isSelectionValid)(state);
|
|
21
|
+
if (selectionValid === _types.AnnotationSelectionType.INVALID) {
|
|
22
|
+
return undefined;
|
|
38
23
|
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
24
|
+
var createCommentMessage = intl.formatMessage(_messages.annotationMessages.createComment);
|
|
25
|
+
var commentDisabledMessage = intl.formatMessage(_messages.annotationMessages.createCommentInvalid);
|
|
26
|
+
var createComment = {
|
|
27
|
+
type: 'button',
|
|
28
|
+
showTitle: true,
|
|
29
|
+
disabled: selectionValid === _types.AnnotationSelectionType.DISABLED,
|
|
30
|
+
testId: _types.AnnotationTestIds.floatingToolbarCreateButton,
|
|
31
|
+
icon: _comment.default,
|
|
32
|
+
tooltipContent: selectionValid === _types.AnnotationSelectionType.DISABLED ? commentDisabledMessage : /*#__PURE__*/_react.default.createElement(_keymaps.ToolTipContent, {
|
|
33
|
+
description: createCommentMessage,
|
|
34
|
+
keymap: _keymaps.addInlineComment
|
|
35
|
+
}),
|
|
36
|
+
title: createCommentMessage,
|
|
37
|
+
onClick: function onClick(state, dispatch) {
|
|
38
|
+
return (0, _commands.setInlineCommentDraftState)(editorAnalyticsAPI)(true)(state, dispatch);
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
var annotation = schema.marks.annotation;
|
|
42
|
+
var validNodes = Object.keys(schema.nodes).reduce(function (acc, current) {
|
|
43
|
+
var type = schema.nodes[current];
|
|
44
|
+
if (type.allowsMarkType(annotation)) {
|
|
45
|
+
acc.push(type);
|
|
46
|
+
}
|
|
47
|
+
return acc;
|
|
48
|
+
}, []);
|
|
49
|
+
var toolbarTitle = intl.formatMessage(_messages.annotationMessages.toolbar);
|
|
50
|
+
var calcToolbarPosition = isToolbarAbove ? _utils2.calculateToolbarPositionAboveSelection : _utils2.calculateToolbarPositionTrackHead;
|
|
51
|
+
var onPositionCalculated = calcToolbarPosition(toolbarTitle);
|
|
52
|
+
return {
|
|
53
|
+
title: toolbarTitle,
|
|
54
|
+
nodeType: validNodes,
|
|
55
|
+
items: [createComment],
|
|
56
|
+
onPositionCalculated: onPositionCalculated
|
|
57
|
+
};
|
|
56
58
|
};
|
|
57
59
|
};
|
|
@@ -34,6 +34,7 @@ var findPosForDOM = function findPosForDOM(sel) {
|
|
|
34
34
|
function InlineCommentView(_ref) {
|
|
35
35
|
var providers = _ref.providers,
|
|
36
36
|
editorView = _ref.editorView,
|
|
37
|
+
editorAnalyticsAPI = _ref.editorAnalyticsAPI,
|
|
37
38
|
dispatchAnalyticsEvent = _ref.dispatchAnalyticsEvent;
|
|
38
39
|
// As inlineComment is the only annotation present, this function is not generic
|
|
39
40
|
var inlineCommentProvider = providers.inlineComment;
|
|
@@ -93,11 +94,11 @@ function InlineCommentView(_ref) {
|
|
|
93
94
|
dom: dom,
|
|
94
95
|
textSelection: textSelection,
|
|
95
96
|
onCreate: function onCreate(id) {
|
|
96
|
-
(0, _commands.createAnnotation)(id)(editorView.state, editorView.dispatch);
|
|
97
|
+
(0, _commands.createAnnotation)(editorAnalyticsAPI)(id)(editorView.state, editorView.dispatch);
|
|
97
98
|
!editorView.hasFocus() && editorView.focus();
|
|
98
99
|
},
|
|
99
100
|
onClose: function onClose() {
|
|
100
|
-
(0, _commands.setInlineCommentDraftState)(false)(editorView.state, editorView.dispatch);
|
|
101
|
+
(0, _commands.setInlineCommentDraftState)(editorAnalyticsAPI)(false)(editorView.state, editorView.dispatch);
|
|
101
102
|
!editorView.hasFocus() && editorView.focus();
|
|
102
103
|
}
|
|
103
104
|
}));
|
|
@@ -142,7 +143,7 @@ function InlineCommentView(_ref) {
|
|
|
142
143
|
return (0, _commands.removeInlineCommentNearSelection)(id)(state, dispatch);
|
|
143
144
|
},
|
|
144
145
|
onResolve: function onResolve(id) {
|
|
145
|
-
return (0, _commands.updateInlineCommentResolvedState)((0, _defineProperty2.default)({}, id, true), _inlineCommentEvents.RESOLVE_METHOD.COMPONENT)(editorView.state, editorView.dispatch);
|
|
146
|
+
return (0, _commands.updateInlineCommentResolvedState)(editorAnalyticsAPI)((0, _defineProperty2.default)({}, id, true), _inlineCommentEvents.RESOLVE_METHOD.COMPONENT)(editorView.state, editorView.dispatch);
|
|
146
147
|
},
|
|
147
148
|
onClose: function onClose() {
|
|
148
149
|
(0, _commands.closeComponent)()(editorView.state, editorView.dispatch);
|
|
@@ -89,12 +89,6 @@ Object.defineProperty(exports, "extensionPlugin", {
|
|
|
89
89
|
return _extension.default;
|
|
90
90
|
}
|
|
91
91
|
});
|
|
92
|
-
Object.defineProperty(exports, "fakeTextCursorPlugin", {
|
|
93
|
-
enumerable: true,
|
|
94
|
-
get: function get() {
|
|
95
|
-
return _fakeTextCursor.default;
|
|
96
|
-
}
|
|
97
|
-
});
|
|
98
92
|
Object.defineProperty(exports, "feedbackDialogPlugin", {
|
|
99
93
|
enumerable: true,
|
|
100
94
|
get: function get() {
|
|
@@ -107,12 +101,6 @@ Object.defineProperty(exports, "findReplacePlugin", {
|
|
|
107
101
|
return _findReplace.default;
|
|
108
102
|
}
|
|
109
103
|
});
|
|
110
|
-
Object.defineProperty(exports, "fragmentMarkPlugin", {
|
|
111
|
-
enumerable: true,
|
|
112
|
-
get: function get() {
|
|
113
|
-
return _fragment.default;
|
|
114
|
-
}
|
|
115
|
-
});
|
|
116
104
|
Object.defineProperty(exports, "indentationPlugin", {
|
|
117
105
|
enumerable: true,
|
|
118
106
|
get: function get() {
|
|
@@ -213,7 +201,6 @@ var _clearMarksOnChangeToEmptyDocument = _interopRequireDefault(require("./clear
|
|
|
213
201
|
var _codeBlock = _interopRequireDefault(require("./code-block"));
|
|
214
202
|
var _collabEdit = _interopRequireDefault(require("./collab-edit"));
|
|
215
203
|
var _extension = _interopRequireDefault(require("./extension"));
|
|
216
|
-
var _fakeTextCursor = _interopRequireDefault(require("./fake-text-cursor"));
|
|
217
204
|
var _insertBlock = _interopRequireDefault(require("./insert-block"));
|
|
218
205
|
var _jiraIssue = _interopRequireDefault(require("./jira-issue"));
|
|
219
206
|
var _layout = _interopRequireDefault(require("./layout"));
|
|
@@ -227,7 +214,6 @@ var _tasksAndDecisions = _interopRequireDefault(require("./tasks-and-decisions")
|
|
|
227
214
|
var _breakout = _interopRequireDefault(require("./breakout"));
|
|
228
215
|
var _alignment = _interopRequireDefault(require("./alignment"));
|
|
229
216
|
var _dataConsumer = _interopRequireDefault(require("./data-consumer"));
|
|
230
|
-
var _fragment = _interopRequireDefault(require("./fragment"));
|
|
231
217
|
var _indentation = _interopRequireDefault(require("./indentation"));
|
|
232
218
|
var _annotation = _interopRequireDefault(require("./annotation"));
|
|
233
219
|
var _analytics = _interopRequireDefault(require("./analytics"));
|
|
@@ -4,10 +4,17 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
+
Object.defineProperty(exports, "FakeTextCursorSelection", {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: function get() {
|
|
10
|
+
return _cursor.FakeTextCursorSelection;
|
|
11
|
+
}
|
|
12
|
+
});
|
|
7
13
|
Object.defineProperty(exports, "placeholderTextPlugin", {
|
|
8
14
|
enumerable: true,
|
|
9
15
|
get: function get() {
|
|
10
16
|
return _plugin.default;
|
|
11
17
|
}
|
|
12
18
|
});
|
|
13
|
-
var _plugin = _interopRequireDefault(require("./plugin"));
|
|
19
|
+
var _plugin = _interopRequireDefault(require("./plugin"));
|
|
20
|
+
var _cursor = require("./fake-text-cursor/cursor");
|
|
@@ -13,7 +13,7 @@ var _adfSchema = require("@atlaskit/adf-schema");
|
|
|
13
13
|
var _text = _interopRequireDefault(require("@atlaskit/icon/glyph/media-services/text"));
|
|
14
14
|
var _hooks = require("@atlaskit/editor-common/hooks");
|
|
15
15
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
16
|
-
var _cursor = require("
|
|
16
|
+
var _cursor = require("./fake-text-cursor/cursor");
|
|
17
17
|
var _PlaceholderFloatingToolbar = _interopRequireDefault(require("./ui/PlaceholderFloatingToolbar"));
|
|
18
18
|
var _actions = require("./actions");
|
|
19
19
|
var _placeholderTextNodeview = require("./placeholder-text-nodeview");
|
|
@@ -100,6 +100,7 @@ function createPlugin(dispatch, options, api) {
|
|
|
100
100
|
return;
|
|
101
101
|
},
|
|
102
102
|
props: {
|
|
103
|
+
decorations: _cursor.drawFakeTextCursor,
|
|
103
104
|
handleDOMEvents: {
|
|
104
105
|
beforeinput: function beforeinput(view, event) {
|
|
105
106
|
var state = view.state;
|
|
@@ -10,4 +10,4 @@ var _react = require("@emotion/react");
|
|
|
10
10
|
var _colors = require("@atlaskit/theme/colors");
|
|
11
11
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
12
12
|
var _templateObject;
|
|
13
|
-
var placeholderTextStyles = exports.placeholderTextStyles = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n .ProseMirror span[data-placeholder] {\n color: ", ";\n display: inline;\n }\n\n .ProseMirror span.pm-placeholder {\n display: inline;\n color: ", ";\n }\n .ProseMirror span.pm-placeholder__text {\n display: inline;\n color: ", ";\n }\n\n .ProseMirror span.pm-placeholder.", " {\n ", "\n }\n\n .ProseMirror span.pm-placeholder__text[data-placeholder]::after {\n color: ", ";\n cursor: text;\n content: attr(data-placeholder);\n display: inline;\n }\n"])), "var(--ds-text-subtlest, ".concat(_colors.N200, ")"), "var(--ds-text-subtlest, ".concat(_colors.N200, ")"), "var(--ds-text-subtlest, ".concat(_colors.N200, ")"), _editorSharedStyles.akEditorSelectedNodeClassName, (0, _editorSharedStyles.getSelectionStyles)([_editorSharedStyles.SelectionStyle.Background]), "var(--ds-text-subtlest, ".concat(_colors.N200, ")"));
|
|
13
|
+
var placeholderTextStyles = exports.placeholderTextStyles = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n .ProseMirror span[data-placeholder] {\n color: ", ";\n display: inline;\n }\n\n .ProseMirror span.pm-placeholder {\n display: inline;\n color: ", ";\n }\n .ProseMirror span.pm-placeholder__text {\n display: inline;\n color: ", ";\n }\n\n .ProseMirror span.pm-placeholder.", " {\n ", "\n }\n\n .ProseMirror span.pm-placeholder__text[data-placeholder]::after {\n color: ", ";\n cursor: text;\n content: attr(data-placeholder);\n display: inline;\n }\n\n .ProseMirror {\n .ProseMirror-fake-text-cursor {\n display: inline;\n pointer-events: none;\n position: relative;\n }\n\n .ProseMirror-fake-text-cursor::after {\n content: '';\n display: inline;\n top: 0;\n position: absolute;\n border-right: 1px solid ", ";\n }\n\n .ProseMirror-fake-text-selection {\n display: inline;\n pointer-events: none;\n position: relative;\n background-color: ", ";\n }\n }\n"])), "var(--ds-text-subtlest, ".concat(_colors.N200, ")"), "var(--ds-text-subtlest, ".concat(_colors.N200, ")"), "var(--ds-text-subtlest, ".concat(_colors.N200, ")"), _editorSharedStyles.akEditorSelectedNodeClassName, (0, _editorSharedStyles.getSelectionStyles)([_editorSharedStyles.SelectionStyle.Background]), "var(--ds-text-subtlest, ".concat(_colors.N200, ")"), "var(--ds-border, rgba(0, 0, 0, 0.4))", "var(--ds-background-selected, ".concat(_colors.B75, ")"));
|