@atlaskit/editor-core 185.2.20 → 185.2.23
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/plugins/card/ui/EditorSmartCardEventsNext.js +22 -11
- package/dist/cjs/plugins/hyperlink/commands.js +10 -0
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/plugins/card/ui/EditorSmartCardEventsNext.js +22 -11
- package/dist/es2019/plugins/hyperlink/commands.js +11 -1
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/plugins/card/ui/EditorSmartCardEventsNext.js +22 -11
- package/dist/esm/plugins/hyperlink/commands.js +11 -1
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/esm/version.json +1 -1
- package/package.json +6 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @atlaskit/editor-core
|
|
2
2
|
|
|
3
|
+
## 185.2.23
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`91ea76040d5`](https://bitbucket.org/atlassian/atlassian-frontend/commits/91ea76040d5) - Fix editor not providing creation method for link created events triggered by link picker insertions on text selections
|
|
8
|
+
|
|
3
9
|
## 185.2.20
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
|
@@ -129,13 +129,16 @@ var EventsBinding = function EventsBinding(_ref4) {
|
|
|
129
129
|
display = _ref5.display,
|
|
130
130
|
nodeContext = _ref5.nodeContext,
|
|
131
131
|
metadata = (0, _objectWithoutProperties2.default)(_ref5, _excluded);
|
|
132
|
+
var displayCategory = displayCategoryFromDisplay(display);
|
|
133
|
+
var sourceEvent = getSourceEventFromMetadata(metadata);
|
|
134
|
+
var creationMethod = getMethod(metadata);
|
|
132
135
|
linkCreated({
|
|
133
136
|
url: url,
|
|
134
|
-
displayCategory:
|
|
135
|
-
},
|
|
137
|
+
displayCategory: displayCategory
|
|
138
|
+
}, sourceEvent, {
|
|
136
139
|
display: display,
|
|
137
140
|
nodeContext: nodeContext,
|
|
138
|
-
creationMethod:
|
|
141
|
+
creationMethod: creationMethod
|
|
139
142
|
});
|
|
140
143
|
},
|
|
141
144
|
updated: function updated(_ref6) {
|
|
@@ -144,15 +147,19 @@ var EventsBinding = function EventsBinding(_ref4) {
|
|
|
144
147
|
previousDisplay = _ref6.previousDisplay,
|
|
145
148
|
nodeContext = _ref6.nodeContext,
|
|
146
149
|
metadata = (0, _objectWithoutProperties2.default)(_ref6, _excluded2);
|
|
150
|
+
var displayCategory = displayCategoryFromDisplay(display);
|
|
151
|
+
var sourceEvent = getSourceEventFromMetadata(metadata);
|
|
152
|
+
var updateMethod = getMethod(metadata);
|
|
153
|
+
var updateType = getUpdateType(metadata);
|
|
147
154
|
linkUpdated({
|
|
148
155
|
url: url,
|
|
149
|
-
displayCategory:
|
|
150
|
-
},
|
|
156
|
+
displayCategory: displayCategory
|
|
157
|
+
}, sourceEvent, {
|
|
151
158
|
display: display,
|
|
152
159
|
previousDisplay: previousDisplay,
|
|
153
160
|
nodeContext: nodeContext,
|
|
154
|
-
updateMethod:
|
|
155
|
-
updateType:
|
|
161
|
+
updateMethod: updateMethod,
|
|
162
|
+
updateType: updateType
|
|
156
163
|
});
|
|
157
164
|
},
|
|
158
165
|
deleted: function deleted(_ref7) {
|
|
@@ -160,14 +167,18 @@ var EventsBinding = function EventsBinding(_ref4) {
|
|
|
160
167
|
display = _ref7.display,
|
|
161
168
|
nodeContext = _ref7.nodeContext,
|
|
162
169
|
metadata = (0, _objectWithoutProperties2.default)(_ref7, _excluded3);
|
|
170
|
+
var displayCategory = displayCategoryFromDisplay(display);
|
|
171
|
+
var sourceEvent = getSourceEventFromMetadata(metadata);
|
|
172
|
+
var deleteMethod = getMethod(metadata);
|
|
173
|
+
var deleteType = getDeleteType(metadata);
|
|
163
174
|
linkDeleted({
|
|
164
175
|
url: url,
|
|
165
|
-
displayCategory:
|
|
166
|
-
},
|
|
176
|
+
displayCategory: displayCategory
|
|
177
|
+
}, sourceEvent, {
|
|
167
178
|
display: display,
|
|
168
179
|
nodeContext: nodeContext,
|
|
169
|
-
deleteMethod:
|
|
170
|
-
deleteType:
|
|
180
|
+
deleteMethod: deleteMethod,
|
|
181
|
+
deleteType: deleteType
|
|
171
182
|
});
|
|
172
183
|
}
|
|
173
184
|
};
|
|
@@ -16,6 +16,7 @@ exports.showLinkToolbar = showLinkToolbar;
|
|
|
16
16
|
exports.updateLink = updateLink;
|
|
17
17
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
18
18
|
var _card = require("@atlaskit/editor-common/card");
|
|
19
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
19
20
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
20
21
|
var _main = require("./pm-plugins/main");
|
|
21
22
|
var _prosemirrorState = require("prosemirror-state");
|
|
@@ -126,6 +127,15 @@ function insertLink(from, to, incomingHref, incomingTitle, displayText, source,
|
|
|
126
127
|
tr.setSelection(_prosemirrorState.Selection.near(tr.doc.resolve(markEnd)));
|
|
127
128
|
if (!displayText || displayText === incomingHref) {
|
|
128
129
|
(0, _doc.queueCardsFromChangedTr)(state, tr, source, _analytics2.ACTION.INSERTED, false, sourceEvent);
|
|
130
|
+
} else if ((0, _platformFeatureFlags.getBooleanFF)('platform.linking-platform.editor.fix-link-insert-analytics')) {
|
|
131
|
+
/**
|
|
132
|
+
* Add link metadata because queue cards would have otherwise handled this for us
|
|
133
|
+
*/
|
|
134
|
+
(0, _card.addLinkMetadata)(state.selection, tr, {
|
|
135
|
+
action: _analytics2.ACTION.INSERTED,
|
|
136
|
+
inputMethod: source,
|
|
137
|
+
sourceEvent: sourceEvent
|
|
138
|
+
});
|
|
129
139
|
}
|
|
130
140
|
tr.setMeta(_main.stateKey, {
|
|
131
141
|
type: _main.LinkAction.HIDE_TOOLBAR
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.version = exports.nextMajorVersion = exports.name = void 0;
|
|
7
7
|
var name = "@atlaskit/editor-core";
|
|
8
8
|
exports.name = name;
|
|
9
|
-
var version = "185.2.
|
|
9
|
+
var version = "185.2.23";
|
|
10
10
|
exports.version = version;
|
|
11
11
|
var nextMajorVersion = function nextMajorVersion() {
|
|
12
12
|
return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
|
package/dist/cjs/version.json
CHANGED
|
@@ -117,13 +117,16 @@ export const EventsBinding = ({
|
|
|
117
117
|
nodeContext,
|
|
118
118
|
...metadata
|
|
119
119
|
}) => {
|
|
120
|
+
const displayCategory = displayCategoryFromDisplay(display);
|
|
121
|
+
const sourceEvent = getSourceEventFromMetadata(metadata);
|
|
122
|
+
const creationMethod = getMethod(metadata);
|
|
120
123
|
linkCreated({
|
|
121
124
|
url,
|
|
122
|
-
displayCategory
|
|
123
|
-
},
|
|
125
|
+
displayCategory
|
|
126
|
+
}, sourceEvent, {
|
|
124
127
|
display,
|
|
125
128
|
nodeContext,
|
|
126
|
-
creationMethod
|
|
129
|
+
creationMethod
|
|
127
130
|
});
|
|
128
131
|
},
|
|
129
132
|
updated: ({
|
|
@@ -133,15 +136,19 @@ export const EventsBinding = ({
|
|
|
133
136
|
nodeContext,
|
|
134
137
|
...metadata
|
|
135
138
|
}) => {
|
|
139
|
+
const displayCategory = displayCategoryFromDisplay(display);
|
|
140
|
+
const sourceEvent = getSourceEventFromMetadata(metadata);
|
|
141
|
+
const updateMethod = getMethod(metadata);
|
|
142
|
+
const updateType = getUpdateType(metadata);
|
|
136
143
|
linkUpdated({
|
|
137
144
|
url,
|
|
138
|
-
displayCategory
|
|
139
|
-
},
|
|
145
|
+
displayCategory
|
|
146
|
+
}, sourceEvent, {
|
|
140
147
|
display,
|
|
141
148
|
previousDisplay,
|
|
142
149
|
nodeContext,
|
|
143
|
-
updateMethod
|
|
144
|
-
updateType
|
|
150
|
+
updateMethod,
|
|
151
|
+
updateType
|
|
145
152
|
});
|
|
146
153
|
},
|
|
147
154
|
deleted: ({
|
|
@@ -150,14 +157,18 @@ export const EventsBinding = ({
|
|
|
150
157
|
nodeContext,
|
|
151
158
|
...metadata
|
|
152
159
|
}) => {
|
|
160
|
+
const displayCategory = displayCategoryFromDisplay(display);
|
|
161
|
+
const sourceEvent = getSourceEventFromMetadata(metadata);
|
|
162
|
+
const deleteMethod = getMethod(metadata);
|
|
163
|
+
const deleteType = getDeleteType(metadata);
|
|
153
164
|
linkDeleted({
|
|
154
165
|
url,
|
|
155
|
-
displayCategory
|
|
156
|
-
},
|
|
166
|
+
displayCategory
|
|
167
|
+
}, sourceEvent, {
|
|
157
168
|
display,
|
|
158
169
|
nodeContext,
|
|
159
|
-
deleteMethod
|
|
160
|
-
deleteType
|
|
170
|
+
deleteMethod,
|
|
171
|
+
deleteType
|
|
161
172
|
});
|
|
162
173
|
}
|
|
163
174
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { commandWithMetadata } from '@atlaskit/editor-common/card';
|
|
1
|
+
import { addLinkMetadata, commandWithMetadata } from '@atlaskit/editor-common/card';
|
|
2
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
2
3
|
import { normalizeUrl, getLinkCreationAnalyticsEvent } from '@atlaskit/editor-common/utils';
|
|
3
4
|
import { stateKey, LinkAction } from './pm-plugins/main';
|
|
4
5
|
import { Selection } from 'prosemirror-state';
|
|
@@ -111,6 +112,15 @@ export function insertLink(from, to, incomingHref, incomingTitle, displayText, s
|
|
|
111
112
|
tr.setSelection(Selection.near(tr.doc.resolve(markEnd)));
|
|
112
113
|
if (!displayText || displayText === incomingHref) {
|
|
113
114
|
queueCardsFromChangedTr(state, tr, source, ACTION.INSERTED, false, sourceEvent);
|
|
115
|
+
} else if (getBooleanFF('platform.linking-platform.editor.fix-link-insert-analytics')) {
|
|
116
|
+
/**
|
|
117
|
+
* Add link metadata because queue cards would have otherwise handled this for us
|
|
118
|
+
*/
|
|
119
|
+
addLinkMetadata(state.selection, tr, {
|
|
120
|
+
action: ACTION.INSERTED,
|
|
121
|
+
inputMethod: source,
|
|
122
|
+
sourceEvent
|
|
123
|
+
});
|
|
114
124
|
}
|
|
115
125
|
tr.setMeta(stateKey, {
|
|
116
126
|
type: LinkAction.HIDE_TOOLBAR
|
package/dist/es2019/version.json
CHANGED
|
@@ -120,13 +120,16 @@ export var EventsBinding = function EventsBinding(_ref4) {
|
|
|
120
120
|
display = _ref5.display,
|
|
121
121
|
nodeContext = _ref5.nodeContext,
|
|
122
122
|
metadata = _objectWithoutProperties(_ref5, _excluded);
|
|
123
|
+
var displayCategory = displayCategoryFromDisplay(display);
|
|
124
|
+
var sourceEvent = getSourceEventFromMetadata(metadata);
|
|
125
|
+
var creationMethod = getMethod(metadata);
|
|
123
126
|
linkCreated({
|
|
124
127
|
url: url,
|
|
125
|
-
displayCategory:
|
|
126
|
-
},
|
|
128
|
+
displayCategory: displayCategory
|
|
129
|
+
}, sourceEvent, {
|
|
127
130
|
display: display,
|
|
128
131
|
nodeContext: nodeContext,
|
|
129
|
-
creationMethod:
|
|
132
|
+
creationMethod: creationMethod
|
|
130
133
|
});
|
|
131
134
|
},
|
|
132
135
|
updated: function updated(_ref6) {
|
|
@@ -135,15 +138,19 @@ export var EventsBinding = function EventsBinding(_ref4) {
|
|
|
135
138
|
previousDisplay = _ref6.previousDisplay,
|
|
136
139
|
nodeContext = _ref6.nodeContext,
|
|
137
140
|
metadata = _objectWithoutProperties(_ref6, _excluded2);
|
|
141
|
+
var displayCategory = displayCategoryFromDisplay(display);
|
|
142
|
+
var sourceEvent = getSourceEventFromMetadata(metadata);
|
|
143
|
+
var updateMethod = getMethod(metadata);
|
|
144
|
+
var updateType = getUpdateType(metadata);
|
|
138
145
|
linkUpdated({
|
|
139
146
|
url: url,
|
|
140
|
-
displayCategory:
|
|
141
|
-
},
|
|
147
|
+
displayCategory: displayCategory
|
|
148
|
+
}, sourceEvent, {
|
|
142
149
|
display: display,
|
|
143
150
|
previousDisplay: previousDisplay,
|
|
144
151
|
nodeContext: nodeContext,
|
|
145
|
-
updateMethod:
|
|
146
|
-
updateType:
|
|
152
|
+
updateMethod: updateMethod,
|
|
153
|
+
updateType: updateType
|
|
147
154
|
});
|
|
148
155
|
},
|
|
149
156
|
deleted: function deleted(_ref7) {
|
|
@@ -151,14 +158,18 @@ export var EventsBinding = function EventsBinding(_ref4) {
|
|
|
151
158
|
display = _ref7.display,
|
|
152
159
|
nodeContext = _ref7.nodeContext,
|
|
153
160
|
metadata = _objectWithoutProperties(_ref7, _excluded3);
|
|
161
|
+
var displayCategory = displayCategoryFromDisplay(display);
|
|
162
|
+
var sourceEvent = getSourceEventFromMetadata(metadata);
|
|
163
|
+
var deleteMethod = getMethod(metadata);
|
|
164
|
+
var deleteType = getDeleteType(metadata);
|
|
154
165
|
linkDeleted({
|
|
155
166
|
url: url,
|
|
156
|
-
displayCategory:
|
|
157
|
-
},
|
|
167
|
+
displayCategory: displayCategory
|
|
168
|
+
}, sourceEvent, {
|
|
158
169
|
display: display,
|
|
159
170
|
nodeContext: nodeContext,
|
|
160
|
-
deleteMethod:
|
|
161
|
-
deleteType:
|
|
171
|
+
deleteMethod: deleteMethod,
|
|
172
|
+
deleteType: deleteType
|
|
162
173
|
});
|
|
163
174
|
}
|
|
164
175
|
};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3
3
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
4
|
-
import { commandWithMetadata } from '@atlaskit/editor-common/card';
|
|
4
|
+
import { addLinkMetadata, commandWithMetadata } from '@atlaskit/editor-common/card';
|
|
5
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
5
6
|
import { normalizeUrl, getLinkCreationAnalyticsEvent } from '@atlaskit/editor-common/utils';
|
|
6
7
|
import { stateKey, LinkAction } from './pm-plugins/main';
|
|
7
8
|
import { Selection } from 'prosemirror-state';
|
|
@@ -110,6 +111,15 @@ export function insertLink(from, to, incomingHref, incomingTitle, displayText, s
|
|
|
110
111
|
tr.setSelection(Selection.near(tr.doc.resolve(markEnd)));
|
|
111
112
|
if (!displayText || displayText === incomingHref) {
|
|
112
113
|
queueCardsFromChangedTr(state, tr, source, ACTION.INSERTED, false, sourceEvent);
|
|
114
|
+
} else if (getBooleanFF('platform.linking-platform.editor.fix-link-insert-analytics')) {
|
|
115
|
+
/**
|
|
116
|
+
* Add link metadata because queue cards would have otherwise handled this for us
|
|
117
|
+
*/
|
|
118
|
+
addLinkMetadata(state.selection, tr, {
|
|
119
|
+
action: ACTION.INSERTED,
|
|
120
|
+
inputMethod: source,
|
|
121
|
+
sourceEvent: sourceEvent
|
|
122
|
+
});
|
|
113
123
|
}
|
|
114
124
|
tr.setMeta(stateKey, {
|
|
115
125
|
type: LinkAction.HIDE_TOOLBAR
|
package/dist/esm/version.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-core",
|
|
3
|
-
"version": "185.2.
|
|
3
|
+
"version": "185.2.23",
|
|
4
4
|
"description": "A package contains Atlassian editor core functionality",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -98,7 +98,7 @@
|
|
|
98
98
|
"@atlaskit/textfield": "^5.5.0",
|
|
99
99
|
"@atlaskit/theme": "^12.5.0",
|
|
100
100
|
"@atlaskit/toggle": "^12.6.0",
|
|
101
|
-
"@atlaskit/tokens": "^1.
|
|
101
|
+
"@atlaskit/tokens": "^1.8.0",
|
|
102
102
|
"@atlaskit/tooltip": "^17.8.0",
|
|
103
103
|
"@atlaskit/width-detector": "^4.1.0",
|
|
104
104
|
"@babel/runtime": "^7.0.0",
|
|
@@ -181,6 +181,7 @@
|
|
|
181
181
|
"@atlaskit/visual-regression": "*",
|
|
182
182
|
"@atlaskit/webdriver-runner": "*",
|
|
183
183
|
"@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
|
|
184
|
+
"@atlassian/feature-flags-test-utils": "^0.1.1",
|
|
184
185
|
"@atlassian/link-picker-plugins": "^23.0.0",
|
|
185
186
|
"@atlassian/search-provider": "2.4.6",
|
|
186
187
|
"@atlassian/ufo": "^0.2.0",
|
|
@@ -243,6 +244,9 @@
|
|
|
243
244
|
"platform.editor.custom-table-width": {
|
|
244
245
|
"type": "boolean",
|
|
245
246
|
"referenceOnly": "true"
|
|
247
|
+
},
|
|
248
|
+
"platform.linking-platform.editor.fix-link-insert-analytics": {
|
|
249
|
+
"type": "boolean"
|
|
246
250
|
}
|
|
247
251
|
}
|
|
248
252
|
}
|