@atlaskit/editor-common 80.3.1 → 80.4.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 +25 -0
- package/dist/cjs/analytics/index.js +6 -0
- package/dist/cjs/analytics/types/index.js +6 -0
- package/dist/cjs/analytics/types/inline-comment-events.js +6 -1
- package/dist/cjs/analytics/types/table-events.js +4 -6
- package/dist/cjs/mark/commands.js +30 -6
- package/dist/cjs/mark/index.js +6 -0
- package/dist/cjs/monitoring/error.js +1 -1
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/cjs/ui/Mention/index.js +3 -1
- package/dist/cjs/ui/Mention/mention-with-profilecard.js +3 -1
- package/dist/cjs/ui/Mention/mention-with-providers.js +3 -1
- package/dist/es2019/analytics/index.js +1 -1
- package/dist/es2019/analytics/types/index.js +1 -1
- package/dist/es2019/analytics/types/inline-comment-events.js +5 -0
- package/dist/es2019/analytics/types/table-events.js +4 -11
- package/dist/es2019/mark/commands.js +27 -0
- package/dist/es2019/mark/index.js +1 -1
- package/dist/es2019/monitoring/error.js +1 -1
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/es2019/ui/Mention/index.js +3 -1
- package/dist/es2019/ui/Mention/mention-with-profilecard.js +3 -1
- package/dist/es2019/ui/Mention/mention-with-providers.js +3 -1
- package/dist/esm/analytics/index.js +1 -1
- package/dist/esm/analytics/types/index.js +1 -1
- package/dist/esm/analytics/types/inline-comment-events.js +5 -0
- package/dist/esm/analytics/types/table-events.js +4 -11
- package/dist/esm/mark/commands.js +29 -5
- package/dist/esm/mark/index.js +1 -1
- package/dist/esm/monitoring/error.js +1 -1
- package/dist/esm/ui/DropList/index.js +1 -1
- package/dist/esm/ui/Mention/index.js +3 -1
- package/dist/esm/ui/Mention/mention-with-profilecard.js +3 -1
- package/dist/esm/ui/Mention/mention-with-providers.js +3 -1
- package/dist/types/analytics/index.d.ts +1 -1
- package/dist/types/analytics/types/highlight-events.d.ts +5 -1
- package/dist/types/analytics/types/index.d.ts +1 -1
- package/dist/types/analytics/types/inline-comment-events.d.ts +4 -0
- package/dist/types/analytics/types/table-events.d.ts +10 -2
- package/dist/types/mark/commands.d.ts +4 -0
- package/dist/types/mark/index.d.ts +1 -1
- package/dist/types/types/annotation/emitter.d.ts +2 -0
- package/dist/types/types/annotation/index.d.ts +1 -0
- package/dist/types/types/feature-flags.d.ts +22 -6
- package/dist/types/ui/Mention/index.d.ts +1 -0
- package/dist/types/ui/Mention/mention-with-profilecard.d.ts +2 -1
- package/dist/types/ui/Mention/mention-with-providers.d.ts +4 -3
- package/dist/types-ts4.5/analytics/index.d.ts +1 -1
- package/dist/types-ts4.5/analytics/types/highlight-events.d.ts +5 -1
- package/dist/types-ts4.5/analytics/types/index.d.ts +1 -1
- package/dist/types-ts4.5/analytics/types/inline-comment-events.d.ts +4 -0
- package/dist/types-ts4.5/analytics/types/table-events.d.ts +10 -2
- package/dist/types-ts4.5/mark/commands.d.ts +4 -0
- package/dist/types-ts4.5/mark/index.d.ts +1 -1
- package/dist/types-ts4.5/types/annotation/emitter.d.ts +2 -0
- package/dist/types-ts4.5/types/annotation/index.d.ts +1 -0
- package/dist/types-ts4.5/types/feature-flags.d.ts +22 -6
- package/dist/types-ts4.5/ui/Mention/index.d.ts +1 -0
- package/dist/types-ts4.5/ui/Mention/mention-with-profilecard.d.ts +2 -1
- package/dist/types-ts4.5/ui/Mention/mention-with-providers.d.ts +4 -3
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,30 @@
|
|
|
1
1
|
# @atlaskit/editor-common
|
|
2
2
|
|
|
3
|
+
## 80.4.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#101355](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/101355)
|
|
8
|
+
[`040f4ffe7af0`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/040f4ffe7af0) -
|
|
9
|
+
Add analytic event to table alignment command
|
|
10
|
+
- [#101524](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/101524)
|
|
11
|
+
[`4821570088e6`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/4821570088e6) -
|
|
12
|
+
ED-23362 Bump ADF schema to version 36.8.1 and add support for adf validation and transformation
|
|
13
|
+
|
|
14
|
+
## 80.4.0
|
|
15
|
+
|
|
16
|
+
### Minor Changes
|
|
17
|
+
|
|
18
|
+
- [#100662](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/100662)
|
|
19
|
+
[`3d61cd8f2afe`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/3d61cd8f2afe) -
|
|
20
|
+
[ED-23355] Update annotation viewed event to with attributes nodeType and method to capture
|
|
21
|
+
usage for comments on media
|
|
22
|
+
- [#100495](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/100495)
|
|
23
|
+
[`dbb78a011fac`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/dbb78a011fac) -
|
|
24
|
+
[ux] [ED-23150] Added `changeColor` command for editor-plugin-highlight, including new
|
|
25
|
+
`removeMark` command for editor-common. Fixed bug with editor-plugin-text-color which prevented
|
|
26
|
+
color from being removed when user selects all.
|
|
27
|
+
|
|
3
28
|
## 80.3.1
|
|
4
29
|
|
|
5
30
|
### Patch Changes
|
|
@@ -249,6 +249,12 @@ Object.defineProperty(exports, "USER_CONTEXT", {
|
|
|
249
249
|
return _types.USER_CONTEXT;
|
|
250
250
|
}
|
|
251
251
|
});
|
|
252
|
+
Object.defineProperty(exports, "VIEW_METHOD", {
|
|
253
|
+
enumerable: true,
|
|
254
|
+
get: function get() {
|
|
255
|
+
return _types.VIEW_METHOD;
|
|
256
|
+
}
|
|
257
|
+
});
|
|
252
258
|
Object.defineProperty(exports, "buildEditLinkPayload", {
|
|
253
259
|
enumerable: true,
|
|
254
260
|
get: function get() {
|
|
@@ -249,6 +249,12 @@ Object.defineProperty(exports, "USER_CONTEXT", {
|
|
|
249
249
|
return _insertEvents.USER_CONTEXT;
|
|
250
250
|
}
|
|
251
251
|
});
|
|
252
|
+
Object.defineProperty(exports, "VIEW_METHOD", {
|
|
253
|
+
enumerable: true,
|
|
254
|
+
get: function get() {
|
|
255
|
+
return _inlineCommentEvents.VIEW_METHOD;
|
|
256
|
+
}
|
|
257
|
+
});
|
|
252
258
|
var _enums = require("./enums");
|
|
253
259
|
var _formatEvents = require("./format-events");
|
|
254
260
|
var _substituteEvents = require("./substitute-events");
|
|
@@ -3,10 +3,15 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.RESOLVE_METHOD = void 0;
|
|
6
|
+
exports.VIEW_METHOD = exports.RESOLVE_METHOD = void 0;
|
|
7
7
|
var RESOLVE_METHOD = exports.RESOLVE_METHOD = /*#__PURE__*/function (RESOLVE_METHOD) {
|
|
8
8
|
RESOLVE_METHOD["COMPONENT"] = "component";
|
|
9
9
|
RESOLVE_METHOD["CONSUMER"] = "consumer";
|
|
10
10
|
RESOLVE_METHOD["ORPHANED"] = "orphaned";
|
|
11
11
|
return RESOLVE_METHOD;
|
|
12
|
+
}({});
|
|
13
|
+
var VIEW_METHOD = exports.VIEW_METHOD = /*#__PURE__*/function (VIEW_METHOD) {
|
|
14
|
+
VIEW_METHOD["BADGE"] = "badge";
|
|
15
|
+
VIEW_METHOD["COMMENT_BUTTON"] = "commentButton";
|
|
16
|
+
return VIEW_METHOD;
|
|
12
17
|
}({});
|
|
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.TABLE_STATUS = exports.TABLE_OVERFLOW_CHANGE_TRIGGER = exports.TABLE_DISPLAY_MODE = exports.TABLE_BREAKOUT = exports.TABLE_ACTION = void 0;
|
|
7
|
-
//#region Constants
|
|
8
7
|
var TABLE_ACTION = exports.TABLE_ACTION = /*#__PURE__*/function (TABLE_ACTION) {
|
|
9
8
|
TABLE_ACTION["DELETED"] = "deleted";
|
|
10
9
|
TABLE_ACTION["CLEARED"] = "cleared";
|
|
@@ -38,6 +37,7 @@ var TABLE_ACTION = exports.TABLE_ACTION = /*#__PURE__*/function (TABLE_ACTION) {
|
|
|
38
37
|
TABLE_ACTION["CLONED_COLUMN"] = "clonedColumn";
|
|
39
38
|
TABLE_ACTION["ROW_OR_COLUMN_MOVED"] = "rowOrColumnMoved";
|
|
40
39
|
TABLE_ACTION["CHANGED_DISPLAY_MODE"] = "changedDisplayMode";
|
|
40
|
+
TABLE_ACTION["CHANGED_ALIGNMENT"] = "changedAlignment";
|
|
41
41
|
return TABLE_ACTION;
|
|
42
42
|
}({});
|
|
43
43
|
var TABLE_BREAKOUT = exports.TABLE_BREAKOUT = /*#__PURE__*/function (TABLE_BREAKOUT) {
|
|
@@ -45,7 +45,7 @@ var TABLE_BREAKOUT = exports.TABLE_BREAKOUT = /*#__PURE__*/function (TABLE_BREAK
|
|
|
45
45
|
TABLE_BREAKOUT["FULL_WIDTH"] = "fullWidth";
|
|
46
46
|
TABLE_BREAKOUT["NORMAL"] = "normal";
|
|
47
47
|
return TABLE_BREAKOUT;
|
|
48
|
-
}({});
|
|
48
|
+
}({});
|
|
49
49
|
var TABLE_OVERFLOW_CHANGE_TRIGGER = exports.TABLE_OVERFLOW_CHANGE_TRIGGER = /*#__PURE__*/function (TABLE_OVERFLOW_CHANGE_TRIGGER) {
|
|
50
50
|
TABLE_OVERFLOW_CHANGE_TRIGGER["EXTERNAL"] = "external";
|
|
51
51
|
TABLE_OVERFLOW_CHANGE_TRIGGER["ADDED_COLUMN"] = "addedColumn";
|
|
@@ -62,12 +62,10 @@ var TABLE_STATUS = exports.TABLE_STATUS = /*#__PURE__*/function (TABLE_STATUS) {
|
|
|
62
62
|
TABLE_STATUS["CANCELLED"] = "cancelled";
|
|
63
63
|
TABLE_STATUS["INVALID"] = "invalid";
|
|
64
64
|
return TABLE_STATUS;
|
|
65
|
-
}({});
|
|
66
|
-
//#endregion
|
|
67
|
-
//#region Analytic Event Payloads
|
|
65
|
+
}({});
|
|
68
66
|
var TABLE_DISPLAY_MODE = exports.TABLE_DISPLAY_MODE = /*#__PURE__*/function (TABLE_DISPLAY_MODE) {
|
|
69
67
|
TABLE_DISPLAY_MODE["FIXED"] = "fixed";
|
|
70
68
|
TABLE_DISPLAY_MODE["DEFAULT"] = "default";
|
|
71
69
|
TABLE_DISPLAY_MODE["INITIAL"] = "initial";
|
|
72
70
|
return TABLE_DISPLAY_MODE;
|
|
73
|
-
}({});
|
|
71
|
+
}({}); // currently duplicated in editor-plugin-table/src/types.ts
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.applyMarkOnRange = void 0;
|
|
7
7
|
exports.filterChildrenBetween = filterChildrenBetween;
|
|
8
|
-
exports.transformSmartCharsMentionsAndEmojis = exports.toggleMark = void 0;
|
|
8
|
+
exports.transformSmartCharsMentionsAndEmojis = exports.toggleMark = exports.removeMark = void 0;
|
|
9
9
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
10
10
|
var _cellSelection = require("@atlaskit/editor-tables/cell-selection");
|
|
11
11
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
@@ -138,7 +138,7 @@ var toggleMarkInRange = function toggleMarkInRange(mark) {
|
|
|
138
138
|
return function (_ref2) {
|
|
139
139
|
var tr = _ref2.tr;
|
|
140
140
|
if (tr.selection instanceof _cellSelection.CellSelection) {
|
|
141
|
-
var
|
|
141
|
+
var _removeMark = true;
|
|
142
142
|
var cells = [];
|
|
143
143
|
tr.selection.forEachCell(function (cell, cellPos) {
|
|
144
144
|
cells.push({
|
|
@@ -147,13 +147,13 @@ var toggleMarkInRange = function toggleMarkInRange(mark) {
|
|
|
147
147
|
});
|
|
148
148
|
var from = cellPos;
|
|
149
149
|
var to = cellPos + cell.nodeSize;
|
|
150
|
-
|
|
150
|
+
_removeMark && (_removeMark = entireSelectionContainsMark(mark, tr.doc, from, to));
|
|
151
151
|
});
|
|
152
152
|
for (var i = cells.length - 1; i >= 0; i--) {
|
|
153
153
|
var cell = cells[i];
|
|
154
154
|
var from = cell.pos;
|
|
155
155
|
var to = from + cell.node.nodeSize;
|
|
156
|
-
applyMarkOnRange(from, to,
|
|
156
|
+
applyMarkOnRange(from, to, _removeMark, mark, tr);
|
|
157
157
|
}
|
|
158
158
|
} else {
|
|
159
159
|
var _tr$selection = tr.selection,
|
|
@@ -164,8 +164,8 @@ var toggleMarkInRange = function toggleMarkInRange(mark) {
|
|
|
164
164
|
// Scenario 1: Selection contains both bold and non-bold text -> bold entire selection
|
|
165
165
|
// Scenario 2: Selection contains only bold text -> un-bold entire selection
|
|
166
166
|
// Scenario 3: Selection contains no bold text -> bold entire selection
|
|
167
|
-
var
|
|
168
|
-
applyMarkOnRange($from.pos, $to.pos,
|
|
167
|
+
var _removeMark2 = entireSelectionContainsMark(mark, tr.doc, $from.pos, $to.pos);
|
|
168
|
+
applyMarkOnRange($from.pos, $to.pos, _removeMark2, mark, tr);
|
|
169
169
|
}
|
|
170
170
|
if (tr.docChanged) {
|
|
171
171
|
return tr;
|
|
@@ -198,4 +198,28 @@ var toggleMark = exports.toggleMark = function toggleMark(markType, attrs) {
|
|
|
198
198
|
tr: tr
|
|
199
199
|
});
|
|
200
200
|
};
|
|
201
|
+
};
|
|
202
|
+
|
|
203
|
+
/**
|
|
204
|
+
* A wrapper around ProseMirror removeMark and removeStoredMark, which handles mark removal in text, CellSelections and cursor stored marks.
|
|
205
|
+
*/
|
|
206
|
+
var removeMark = exports.removeMark = function removeMark(mark) {
|
|
207
|
+
return function (_ref4) {
|
|
208
|
+
var tr = _ref4.tr;
|
|
209
|
+
var selection = tr.selection;
|
|
210
|
+
if (selection instanceof _cellSelection.CellSelection) {
|
|
211
|
+
selection.forEachCell(function (cell, cellPos) {
|
|
212
|
+
var from = cellPos;
|
|
213
|
+
var to = cellPos + cell.nodeSize;
|
|
214
|
+
tr.removeMark(from, to, mark);
|
|
215
|
+
});
|
|
216
|
+
} else if (selection instanceof _state.TextSelection && selection.$cursor) {
|
|
217
|
+
tr.removeStoredMark(mark);
|
|
218
|
+
} else {
|
|
219
|
+
var from = selection.from,
|
|
220
|
+
to = selection.to;
|
|
221
|
+
tr.removeMark(from, to, mark);
|
|
222
|
+
}
|
|
223
|
+
return tr;
|
|
224
|
+
};
|
|
201
225
|
};
|
package/dist/cjs/mark/index.js
CHANGED
|
@@ -33,6 +33,12 @@ Object.defineProperty(exports, "isMarkExcluded", {
|
|
|
33
33
|
return _textFormatting.isMarkExcluded;
|
|
34
34
|
}
|
|
35
35
|
});
|
|
36
|
+
Object.defineProperty(exports, "removeMark", {
|
|
37
|
+
enumerable: true,
|
|
38
|
+
get: function get() {
|
|
39
|
+
return _commands.removeMark;
|
|
40
|
+
}
|
|
41
|
+
});
|
|
36
42
|
Object.defineProperty(exports, "toggleMark", {
|
|
37
43
|
enumerable: true,
|
|
38
44
|
get: function get() {
|
|
@@ -16,7 +16,7 @@ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return
|
|
|
16
16
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
17
17
|
var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
18
18
|
var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
19
|
-
var packageVersion = "80.
|
|
19
|
+
var packageVersion = "80.4.1";
|
|
20
20
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
21
21
|
// Remove URL as it has UGC
|
|
22
22
|
// TODO: Sanitise the URL instead of just removing it
|
|
@@ -20,7 +20,7 @@ var _Layer = _interopRequireDefault(require("../Layer"));
|
|
|
20
20
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
21
21
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } /** @jsx jsx */
|
|
22
22
|
var packageName = "@atlaskit/editor-common";
|
|
23
|
-
var packageVersion = "80.
|
|
23
|
+
var packageVersion = "80.4.1";
|
|
24
24
|
var halfFocusRing = 1;
|
|
25
25
|
var dropOffset = '0, 8';
|
|
26
26
|
var DropList = /*#__PURE__*/function (_Component) {
|
|
@@ -32,13 +32,15 @@ var Mention = exports.default = /*#__PURE__*/function (_PureComponent) {
|
|
|
32
32
|
accessLevel = _this$props.accessLevel,
|
|
33
33
|
eventHandlers = _this$props.eventHandlers,
|
|
34
34
|
id = _this$props.id,
|
|
35
|
-
text = _this$props.text
|
|
35
|
+
text = _this$props.text,
|
|
36
|
+
localId = _this$props.localId;
|
|
36
37
|
var mentionProvider = providers.mentionProvider,
|
|
37
38
|
profilecardProvider = providers.profilecardProvider;
|
|
38
39
|
return /*#__PURE__*/_react.default.createElement(_mentionWithProviders.default, {
|
|
39
40
|
id: id,
|
|
40
41
|
text: text,
|
|
41
42
|
accessLevel: accessLevel,
|
|
43
|
+
localId: localId,
|
|
42
44
|
eventHandlers: eventHandlers,
|
|
43
45
|
mentionProvider: mentionProvider,
|
|
44
46
|
profilecardProvider: profilecardProvider
|
|
@@ -19,7 +19,8 @@ function MentionWithProfileCard(_ref) {
|
|
|
19
19
|
profilecardProvider = _ref.profilecardProvider,
|
|
20
20
|
onClick = _ref.onClick,
|
|
21
21
|
onMouseEnter = _ref.onMouseEnter,
|
|
22
|
-
onMouseLeave = _ref.onMouseLeave
|
|
22
|
+
onMouseLeave = _ref.onMouseLeave,
|
|
23
|
+
localId = _ref.localId;
|
|
23
24
|
var cloudId = profilecardProvider.cloudId,
|
|
24
25
|
resourceClient = profilecardProvider.resourceClient;
|
|
25
26
|
var actions = (0, _react.useMemo)(function () {
|
|
@@ -38,6 +39,7 @@ function MentionWithProfileCard(_ref) {
|
|
|
38
39
|
id: id,
|
|
39
40
|
text: text,
|
|
40
41
|
accessLevel: accessLevel,
|
|
42
|
+
localId: localId,
|
|
41
43
|
mentionProvider: mentionProvider,
|
|
42
44
|
onClick: onClick,
|
|
43
45
|
onMouseEnter: onMouseEnter,
|
|
@@ -82,7 +82,8 @@ var MentionWithProviders = exports.default = /*#__PURE__*/function (_PureCompone
|
|
|
82
82
|
eventHandlers = _this$props.eventHandlers,
|
|
83
83
|
id = _this$props.id,
|
|
84
84
|
mentionProvider = _this$props.mentionProvider,
|
|
85
|
-
text = _this$props.text
|
|
85
|
+
text = _this$props.text,
|
|
86
|
+
localId = _this$props.localId;
|
|
86
87
|
var profilecardProvider = this.state.profilecardProvider;
|
|
87
88
|
var actionHandlers = {};
|
|
88
89
|
['onClick', 'onMouseEnter', 'onMouseLeave'].forEach(function (handler) {
|
|
@@ -93,6 +94,7 @@ var MentionWithProviders = exports.default = /*#__PURE__*/function (_PureCompone
|
|
|
93
94
|
id: id,
|
|
94
95
|
text: text,
|
|
95
96
|
accessLevel: accessLevel,
|
|
97
|
+
localId: localId,
|
|
96
98
|
mentionProvider: mentionProvider,
|
|
97
99
|
profilecardProvider: profilecardProvider
|
|
98
100
|
}, actionHandlers));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, BROWSER_FREEZE_INTERACTION_TYPE, CONTENT_COMPONENT, DELETE_DIRECTION, EVENT_TYPE, FLOATING_CONTROLS_TITLE, FULL_WIDTH_MODE, GAP_CURSOR_POSITION, INDENT_DIRECTION, INDENT_TYPE, INPUT_METHOD, LAYOUT_TYPE, LINK_REPRESENTATION, LINK_RESOURCE, LINK_STATUS, LIST_TEXT_SCENARIOS, JOIN_SCENARIOS_WHEN_TYPING_TO_INSERT_LIST, OUTDENT_SCENARIOS, MODE, PLATFORMS, PUNC, PasteContents, PasteSources, PasteTypes, RESOLVE_METHOD, SELECTION_TYPE, SELECTION_POSITION, SMART_LINK_TYPE, SYMBOL, SmartLinkNodeContexts, TABLE_ACTION, TABLE_BREAKOUT, TABLE_OVERFLOW_CHANGE_TRIGGER, TABLE_STATUS, TARGET_SELECTION_SOURCE, TOOLBAR_ACTION_SUBJECT_ID, TRIGGER_METHOD, USER_CONTEXT, TABLE_DISPLAY_MODE } from './types';
|
|
1
|
+
export { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, BROWSER_FREEZE_INTERACTION_TYPE, CONTENT_COMPONENT, DELETE_DIRECTION, EVENT_TYPE, FLOATING_CONTROLS_TITLE, FULL_WIDTH_MODE, GAP_CURSOR_POSITION, INDENT_DIRECTION, INDENT_TYPE, INPUT_METHOD, LAYOUT_TYPE, LINK_REPRESENTATION, LINK_RESOURCE, LINK_STATUS, LIST_TEXT_SCENARIOS, JOIN_SCENARIOS_WHEN_TYPING_TO_INSERT_LIST, OUTDENT_SCENARIOS, MODE, PLATFORMS, PUNC, PasteContents, PasteSources, PasteTypes, RESOLVE_METHOD, SELECTION_TYPE, SELECTION_POSITION, SMART_LINK_TYPE, SYMBOL, SmartLinkNodeContexts, TABLE_ACTION, TABLE_BREAKOUT, TABLE_OVERFLOW_CHANGE_TRIGGER, TABLE_STATUS, TARGET_SELECTION_SOURCE, TOOLBAR_ACTION_SUBJECT_ID, TRIGGER_METHOD, USER_CONTEXT, TABLE_DISPLAY_MODE, VIEW_METHOD } from './types';
|
|
2
2
|
export { editorAnalyticsChannel, fireAnalyticsEvent } from './fire-analytics-event';
|
|
3
3
|
export { getAnalyticsEventsFromTransaction } from './utils';
|
|
4
4
|
export { buildEditLinkPayload, buildVisitedLinkPayload, buildOpenedSettingsPayload, unlinkPayload } from './linking-utils';
|
|
@@ -7,7 +7,7 @@ export { TABLE_ACTION, TABLE_BREAKOUT, TABLE_OVERFLOW_CHANGE_TRIGGER, TABLE_STAT
|
|
|
7
7
|
export { PasteContents, PasteSources, PasteTypes } from './paste-events';
|
|
8
8
|
export { DELETE_DIRECTION, LIST_TEXT_SCENARIOS, JOIN_SCENARIOS_WHEN_TYPING_TO_INSERT_LIST, OUTDENT_SCENARIOS } from './list-events';
|
|
9
9
|
export { GAP_CURSOR_POSITION, TARGET_SELECTION_SOURCE } from './extension-events';
|
|
10
|
-
export { RESOLVE_METHOD } from './inline-comment-events';
|
|
10
|
+
export { RESOLVE_METHOD, VIEW_METHOD } from './inline-comment-events';
|
|
11
11
|
export { LAYOUT_TYPE, SMART_LINK_TYPE } from './node-events';
|
|
12
12
|
export { SmartLinkNodeContexts } from './smart-links';
|
|
13
13
|
export { TOOLBAR_ACTION_SUBJECT_ID } from './toolbar-button';
|
|
@@ -3,4 +3,9 @@ export let RESOLVE_METHOD = /*#__PURE__*/function (RESOLVE_METHOD) {
|
|
|
3
3
|
RESOLVE_METHOD["CONSUMER"] = "consumer";
|
|
4
4
|
RESOLVE_METHOD["ORPHANED"] = "orphaned";
|
|
5
5
|
return RESOLVE_METHOD;
|
|
6
|
+
}({});
|
|
7
|
+
export let VIEW_METHOD = /*#__PURE__*/function (VIEW_METHOD) {
|
|
8
|
+
VIEW_METHOD["BADGE"] = "badge";
|
|
9
|
+
VIEW_METHOD["COMMENT_BUTTON"] = "commentButton";
|
|
10
|
+
return VIEW_METHOD;
|
|
6
11
|
}({});
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region Constants
|
|
2
1
|
export let TABLE_ACTION = /*#__PURE__*/function (TABLE_ACTION) {
|
|
3
2
|
TABLE_ACTION["DELETED"] = "deleted";
|
|
4
3
|
TABLE_ACTION["CLEARED"] = "cleared";
|
|
@@ -32,6 +31,7 @@ export let TABLE_ACTION = /*#__PURE__*/function (TABLE_ACTION) {
|
|
|
32
31
|
TABLE_ACTION["CLONED_COLUMN"] = "clonedColumn";
|
|
33
32
|
TABLE_ACTION["ROW_OR_COLUMN_MOVED"] = "rowOrColumnMoved";
|
|
34
33
|
TABLE_ACTION["CHANGED_DISPLAY_MODE"] = "changedDisplayMode";
|
|
34
|
+
TABLE_ACTION["CHANGED_ALIGNMENT"] = "changedAlignment";
|
|
35
35
|
return TABLE_ACTION;
|
|
36
36
|
}({});
|
|
37
37
|
export let TABLE_BREAKOUT = /*#__PURE__*/function (TABLE_BREAKOUT) {
|
|
@@ -40,8 +40,6 @@ export let TABLE_BREAKOUT = /*#__PURE__*/function (TABLE_BREAKOUT) {
|
|
|
40
40
|
TABLE_BREAKOUT["NORMAL"] = "normal";
|
|
41
41
|
return TABLE_BREAKOUT;
|
|
42
42
|
}({});
|
|
43
|
-
//#endregion
|
|
44
|
-
|
|
45
43
|
export let TABLE_OVERFLOW_CHANGE_TRIGGER = /*#__PURE__*/function (TABLE_OVERFLOW_CHANGE_TRIGGER) {
|
|
46
44
|
TABLE_OVERFLOW_CHANGE_TRIGGER["EXTERNAL"] = "external";
|
|
47
45
|
TABLE_OVERFLOW_CHANGE_TRIGGER["ADDED_COLUMN"] = "addedColumn";
|
|
@@ -59,16 +57,11 @@ export let TABLE_STATUS = /*#__PURE__*/function (TABLE_STATUS) {
|
|
|
59
57
|
TABLE_STATUS["INVALID"] = "invalid";
|
|
60
58
|
return TABLE_STATUS;
|
|
61
59
|
}({});
|
|
62
|
-
|
|
63
|
-
//#region Type Helpers
|
|
64
|
-
|
|
65
|
-
//#endregion
|
|
66
|
-
|
|
67
|
-
//#region Analytic Event Payloads
|
|
68
|
-
|
|
69
60
|
export let TABLE_DISPLAY_MODE = /*#__PURE__*/function (TABLE_DISPLAY_MODE) {
|
|
70
61
|
TABLE_DISPLAY_MODE["FIXED"] = "fixed";
|
|
71
62
|
TABLE_DISPLAY_MODE["DEFAULT"] = "default";
|
|
72
63
|
TABLE_DISPLAY_MODE["INITIAL"] = "initial";
|
|
73
64
|
return TABLE_DISPLAY_MODE;
|
|
74
|
-
}({});
|
|
65
|
+
}({});
|
|
66
|
+
|
|
67
|
+
// currently duplicated in editor-plugin-table/src/types.ts
|
|
@@ -205,4 +205,31 @@ export const toggleMark = (markType, attrs) => ({
|
|
|
205
205
|
return toggleMarkInRange(mark)({
|
|
206
206
|
tr
|
|
207
207
|
});
|
|
208
|
+
};
|
|
209
|
+
|
|
210
|
+
/**
|
|
211
|
+
* A wrapper around ProseMirror removeMark and removeStoredMark, which handles mark removal in text, CellSelections and cursor stored marks.
|
|
212
|
+
*/
|
|
213
|
+
export const removeMark = mark => ({
|
|
214
|
+
tr
|
|
215
|
+
}) => {
|
|
216
|
+
const {
|
|
217
|
+
selection
|
|
218
|
+
} = tr;
|
|
219
|
+
if (selection instanceof CellSelection) {
|
|
220
|
+
selection.forEachCell((cell, cellPos) => {
|
|
221
|
+
const from = cellPos;
|
|
222
|
+
const to = cellPos + cell.nodeSize;
|
|
223
|
+
tr.removeMark(from, to, mark);
|
|
224
|
+
});
|
|
225
|
+
} else if (selection instanceof TextSelection && selection.$cursor) {
|
|
226
|
+
tr.removeStoredMark(mark);
|
|
227
|
+
} else {
|
|
228
|
+
const {
|
|
229
|
+
from,
|
|
230
|
+
to
|
|
231
|
+
} = selection;
|
|
232
|
+
tr.removeMark(from, to, mark);
|
|
233
|
+
}
|
|
234
|
+
return tr;
|
|
208
235
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { transformSmartCharsMentionsAndEmojis, applyMarkOnRange, filterChildrenBetween, toggleMark } from './commands';
|
|
1
|
+
export { transformSmartCharsMentionsAndEmojis, applyMarkOnRange, filterChildrenBetween, toggleMark, removeMark } from './commands';
|
|
2
2
|
export { anyMarkActive, isMarkAllowedInRange, isMarkExcluded } from './text-formatting';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
2
2
|
const packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
3
|
-
const packageVersion = "80.
|
|
3
|
+
const packageVersion = "80.4.1";
|
|
4
4
|
const sanitiseSentryEvents = (data, _hint) => {
|
|
5
5
|
// Remove URL as it has UGC
|
|
6
6
|
// TODO: Sanitise the URL instead of just removing it
|
|
@@ -7,7 +7,7 @@ import { createAndFireEvent, withAnalyticsContext, withAnalyticsEvents } from '@
|
|
|
7
7
|
import { N0, N50A, N60A, N900 } from '@atlaskit/theme/colors';
|
|
8
8
|
import Layer from '../Layer';
|
|
9
9
|
const packageName = "@atlaskit/editor-common";
|
|
10
|
-
const packageVersion = "80.
|
|
10
|
+
const packageVersion = "80.4.1";
|
|
11
11
|
const halfFocusRing = 1;
|
|
12
12
|
const dropOffset = '0, 8';
|
|
13
13
|
class DropList extends Component {
|
|
@@ -10,7 +10,8 @@ export default class Mention extends PureComponent {
|
|
|
10
10
|
accessLevel,
|
|
11
11
|
eventHandlers,
|
|
12
12
|
id,
|
|
13
|
-
text
|
|
13
|
+
text,
|
|
14
|
+
localId
|
|
14
15
|
} = this.props;
|
|
15
16
|
const {
|
|
16
17
|
mentionProvider,
|
|
@@ -20,6 +21,7 @@ export default class Mention extends PureComponent {
|
|
|
20
21
|
id: id,
|
|
21
22
|
text: text,
|
|
22
23
|
accessLevel: accessLevel,
|
|
24
|
+
localId: localId,
|
|
23
25
|
eventHandlers: eventHandlers,
|
|
24
26
|
mentionProvider: mentionProvider,
|
|
25
27
|
profilecardProvider: profilecardProvider
|
|
@@ -9,7 +9,8 @@ export default function MentionWithProfileCard({
|
|
|
9
9
|
profilecardProvider,
|
|
10
10
|
onClick,
|
|
11
11
|
onMouseEnter,
|
|
12
|
-
onMouseLeave
|
|
12
|
+
onMouseLeave,
|
|
13
|
+
localId
|
|
13
14
|
}) {
|
|
14
15
|
const {
|
|
15
16
|
cloudId,
|
|
@@ -29,6 +30,7 @@ export default function MentionWithProfileCard({
|
|
|
29
30
|
id: id,
|
|
30
31
|
text: text,
|
|
31
32
|
accessLevel: accessLevel,
|
|
33
|
+
localId: localId,
|
|
32
34
|
mentionProvider: mentionProvider,
|
|
33
35
|
onClick: onClick,
|
|
34
36
|
onMouseEnter: onMouseEnter,
|
|
@@ -47,7 +47,8 @@ export default class MentionWithProviders extends PureComponent {
|
|
|
47
47
|
eventHandlers,
|
|
48
48
|
id,
|
|
49
49
|
mentionProvider,
|
|
50
|
-
text
|
|
50
|
+
text,
|
|
51
|
+
localId
|
|
51
52
|
} = this.props;
|
|
52
53
|
const {
|
|
53
54
|
profilecardProvider
|
|
@@ -61,6 +62,7 @@ export default class MentionWithProviders extends PureComponent {
|
|
|
61
62
|
id: id,
|
|
62
63
|
text: text,
|
|
63
64
|
accessLevel: accessLevel,
|
|
65
|
+
localId: localId,
|
|
64
66
|
mentionProvider: mentionProvider,
|
|
65
67
|
profilecardProvider: profilecardProvider
|
|
66
68
|
}, actionHandlers));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, BROWSER_FREEZE_INTERACTION_TYPE, CONTENT_COMPONENT, DELETE_DIRECTION, EVENT_TYPE, FLOATING_CONTROLS_TITLE, FULL_WIDTH_MODE, GAP_CURSOR_POSITION, INDENT_DIRECTION, INDENT_TYPE, INPUT_METHOD, LAYOUT_TYPE, LINK_REPRESENTATION, LINK_RESOURCE, LINK_STATUS, LIST_TEXT_SCENARIOS, JOIN_SCENARIOS_WHEN_TYPING_TO_INSERT_LIST, OUTDENT_SCENARIOS, MODE, PLATFORMS, PUNC, PasteContents, PasteSources, PasteTypes, RESOLVE_METHOD, SELECTION_TYPE, SELECTION_POSITION, SMART_LINK_TYPE, SYMBOL, SmartLinkNodeContexts, TABLE_ACTION, TABLE_BREAKOUT, TABLE_OVERFLOW_CHANGE_TRIGGER, TABLE_STATUS, TARGET_SELECTION_SOURCE, TOOLBAR_ACTION_SUBJECT_ID, TRIGGER_METHOD, USER_CONTEXT, TABLE_DISPLAY_MODE } from './types';
|
|
1
|
+
export { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, BROWSER_FREEZE_INTERACTION_TYPE, CONTENT_COMPONENT, DELETE_DIRECTION, EVENT_TYPE, FLOATING_CONTROLS_TITLE, FULL_WIDTH_MODE, GAP_CURSOR_POSITION, INDENT_DIRECTION, INDENT_TYPE, INPUT_METHOD, LAYOUT_TYPE, LINK_REPRESENTATION, LINK_RESOURCE, LINK_STATUS, LIST_TEXT_SCENARIOS, JOIN_SCENARIOS_WHEN_TYPING_TO_INSERT_LIST, OUTDENT_SCENARIOS, MODE, PLATFORMS, PUNC, PasteContents, PasteSources, PasteTypes, RESOLVE_METHOD, SELECTION_TYPE, SELECTION_POSITION, SMART_LINK_TYPE, SYMBOL, SmartLinkNodeContexts, TABLE_ACTION, TABLE_BREAKOUT, TABLE_OVERFLOW_CHANGE_TRIGGER, TABLE_STATUS, TARGET_SELECTION_SOURCE, TOOLBAR_ACTION_SUBJECT_ID, TRIGGER_METHOD, USER_CONTEXT, TABLE_DISPLAY_MODE, VIEW_METHOD } from './types';
|
|
2
2
|
export { editorAnalyticsChannel, fireAnalyticsEvent } from './fire-analytics-event';
|
|
3
3
|
export { getAnalyticsEventsFromTransaction } from './utils';
|
|
4
4
|
export { buildEditLinkPayload, buildVisitedLinkPayload, buildOpenedSettingsPayload, unlinkPayload } from './linking-utils';
|
|
@@ -7,7 +7,7 @@ export { TABLE_ACTION, TABLE_BREAKOUT, TABLE_OVERFLOW_CHANGE_TRIGGER, TABLE_STAT
|
|
|
7
7
|
export { PasteContents, PasteSources, PasteTypes } from './paste-events';
|
|
8
8
|
export { DELETE_DIRECTION, LIST_TEXT_SCENARIOS, JOIN_SCENARIOS_WHEN_TYPING_TO_INSERT_LIST, OUTDENT_SCENARIOS } from './list-events';
|
|
9
9
|
export { GAP_CURSOR_POSITION, TARGET_SELECTION_SOURCE } from './extension-events';
|
|
10
|
-
export { RESOLVE_METHOD } from './inline-comment-events';
|
|
10
|
+
export { RESOLVE_METHOD, VIEW_METHOD } from './inline-comment-events';
|
|
11
11
|
export { LAYOUT_TYPE, SMART_LINK_TYPE } from './node-events';
|
|
12
12
|
export { SmartLinkNodeContexts } from './smart-links';
|
|
13
13
|
export { TOOLBAR_ACTION_SUBJECT_ID } from './toolbar-button';
|
|
@@ -3,4 +3,9 @@ export var RESOLVE_METHOD = /*#__PURE__*/function (RESOLVE_METHOD) {
|
|
|
3
3
|
RESOLVE_METHOD["CONSUMER"] = "consumer";
|
|
4
4
|
RESOLVE_METHOD["ORPHANED"] = "orphaned";
|
|
5
5
|
return RESOLVE_METHOD;
|
|
6
|
+
}({});
|
|
7
|
+
export var VIEW_METHOD = /*#__PURE__*/function (VIEW_METHOD) {
|
|
8
|
+
VIEW_METHOD["BADGE"] = "badge";
|
|
9
|
+
VIEW_METHOD["COMMENT_BUTTON"] = "commentButton";
|
|
10
|
+
return VIEW_METHOD;
|
|
6
11
|
}({});
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region Constants
|
|
2
1
|
export var TABLE_ACTION = /*#__PURE__*/function (TABLE_ACTION) {
|
|
3
2
|
TABLE_ACTION["DELETED"] = "deleted";
|
|
4
3
|
TABLE_ACTION["CLEARED"] = "cleared";
|
|
@@ -32,6 +31,7 @@ export var TABLE_ACTION = /*#__PURE__*/function (TABLE_ACTION) {
|
|
|
32
31
|
TABLE_ACTION["CLONED_COLUMN"] = "clonedColumn";
|
|
33
32
|
TABLE_ACTION["ROW_OR_COLUMN_MOVED"] = "rowOrColumnMoved";
|
|
34
33
|
TABLE_ACTION["CHANGED_DISPLAY_MODE"] = "changedDisplayMode";
|
|
34
|
+
TABLE_ACTION["CHANGED_ALIGNMENT"] = "changedAlignment";
|
|
35
35
|
return TABLE_ACTION;
|
|
36
36
|
}({});
|
|
37
37
|
export var TABLE_BREAKOUT = /*#__PURE__*/function (TABLE_BREAKOUT) {
|
|
@@ -40,8 +40,6 @@ export var TABLE_BREAKOUT = /*#__PURE__*/function (TABLE_BREAKOUT) {
|
|
|
40
40
|
TABLE_BREAKOUT["NORMAL"] = "normal";
|
|
41
41
|
return TABLE_BREAKOUT;
|
|
42
42
|
}({});
|
|
43
|
-
//#endregion
|
|
44
|
-
|
|
45
43
|
export var TABLE_OVERFLOW_CHANGE_TRIGGER = /*#__PURE__*/function (TABLE_OVERFLOW_CHANGE_TRIGGER) {
|
|
46
44
|
TABLE_OVERFLOW_CHANGE_TRIGGER["EXTERNAL"] = "external";
|
|
47
45
|
TABLE_OVERFLOW_CHANGE_TRIGGER["ADDED_COLUMN"] = "addedColumn";
|
|
@@ -59,16 +57,11 @@ export var TABLE_STATUS = /*#__PURE__*/function (TABLE_STATUS) {
|
|
|
59
57
|
TABLE_STATUS["INVALID"] = "invalid";
|
|
60
58
|
return TABLE_STATUS;
|
|
61
59
|
}({});
|
|
62
|
-
|
|
63
|
-
//#region Type Helpers
|
|
64
|
-
|
|
65
|
-
//#endregion
|
|
66
|
-
|
|
67
|
-
//#region Analytic Event Payloads
|
|
68
|
-
|
|
69
60
|
export var TABLE_DISPLAY_MODE = /*#__PURE__*/function (TABLE_DISPLAY_MODE) {
|
|
70
61
|
TABLE_DISPLAY_MODE["FIXED"] = "fixed";
|
|
71
62
|
TABLE_DISPLAY_MODE["DEFAULT"] = "default";
|
|
72
63
|
TABLE_DISPLAY_MODE["INITIAL"] = "initial";
|
|
73
64
|
return TABLE_DISPLAY_MODE;
|
|
74
|
-
}({});
|
|
65
|
+
}({});
|
|
66
|
+
|
|
67
|
+
// currently duplicated in editor-plugin-table/src/types.ts
|
|
@@ -130,7 +130,7 @@ var toggleMarkInRange = function toggleMarkInRange(mark) {
|
|
|
130
130
|
return function (_ref2) {
|
|
131
131
|
var tr = _ref2.tr;
|
|
132
132
|
if (tr.selection instanceof CellSelection) {
|
|
133
|
-
var
|
|
133
|
+
var _removeMark = true;
|
|
134
134
|
var cells = [];
|
|
135
135
|
tr.selection.forEachCell(function (cell, cellPos) {
|
|
136
136
|
cells.push({
|
|
@@ -139,13 +139,13 @@ var toggleMarkInRange = function toggleMarkInRange(mark) {
|
|
|
139
139
|
});
|
|
140
140
|
var from = cellPos;
|
|
141
141
|
var to = cellPos + cell.nodeSize;
|
|
142
|
-
|
|
142
|
+
_removeMark && (_removeMark = entireSelectionContainsMark(mark, tr.doc, from, to));
|
|
143
143
|
});
|
|
144
144
|
for (var i = cells.length - 1; i >= 0; i--) {
|
|
145
145
|
var cell = cells[i];
|
|
146
146
|
var from = cell.pos;
|
|
147
147
|
var to = from + cell.node.nodeSize;
|
|
148
|
-
applyMarkOnRange(from, to,
|
|
148
|
+
applyMarkOnRange(from, to, _removeMark, mark, tr);
|
|
149
149
|
}
|
|
150
150
|
} else {
|
|
151
151
|
var _tr$selection = tr.selection,
|
|
@@ -156,8 +156,8 @@ var toggleMarkInRange = function toggleMarkInRange(mark) {
|
|
|
156
156
|
// Scenario 1: Selection contains both bold and non-bold text -> bold entire selection
|
|
157
157
|
// Scenario 2: Selection contains only bold text -> un-bold entire selection
|
|
158
158
|
// Scenario 3: Selection contains no bold text -> bold entire selection
|
|
159
|
-
var
|
|
160
|
-
applyMarkOnRange($from.pos, $to.pos,
|
|
159
|
+
var _removeMark2 = entireSelectionContainsMark(mark, tr.doc, $from.pos, $to.pos);
|
|
160
|
+
applyMarkOnRange($from.pos, $to.pos, _removeMark2, mark, tr);
|
|
161
161
|
}
|
|
162
162
|
if (tr.docChanged) {
|
|
163
163
|
return tr;
|
|
@@ -190,4 +190,28 @@ export var toggleMark = function toggleMark(markType, attrs) {
|
|
|
190
190
|
tr: tr
|
|
191
191
|
});
|
|
192
192
|
};
|
|
193
|
+
};
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
* A wrapper around ProseMirror removeMark and removeStoredMark, which handles mark removal in text, CellSelections and cursor stored marks.
|
|
197
|
+
*/
|
|
198
|
+
export var removeMark = function removeMark(mark) {
|
|
199
|
+
return function (_ref4) {
|
|
200
|
+
var tr = _ref4.tr;
|
|
201
|
+
var selection = tr.selection;
|
|
202
|
+
if (selection instanceof CellSelection) {
|
|
203
|
+
selection.forEachCell(function (cell, cellPos) {
|
|
204
|
+
var from = cellPos;
|
|
205
|
+
var to = cellPos + cell.nodeSize;
|
|
206
|
+
tr.removeMark(from, to, mark);
|
|
207
|
+
});
|
|
208
|
+
} else if (selection instanceof TextSelection && selection.$cursor) {
|
|
209
|
+
tr.removeStoredMark(mark);
|
|
210
|
+
} else {
|
|
211
|
+
var from = selection.from,
|
|
212
|
+
to = selection.to;
|
|
213
|
+
tr.removeMark(from, to, mark);
|
|
214
|
+
}
|
|
215
|
+
return tr;
|
|
216
|
+
};
|
|
193
217
|
};
|
package/dist/esm/mark/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { transformSmartCharsMentionsAndEmojis, applyMarkOnRange, filterChildrenBetween, toggleMark } from './commands';
|
|
1
|
+
export { transformSmartCharsMentionsAndEmojis, applyMarkOnRange, filterChildrenBetween, toggleMark, removeMark } from './commands';
|
|
2
2
|
export { anyMarkActive, isMarkAllowedInRange, isMarkExcluded } from './text-formatting';
|
|
@@ -6,7 +6,7 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
|
|
|
6
6
|
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; }
|
|
7
7
|
var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
8
8
|
var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
9
|
-
var packageVersion = "80.
|
|
9
|
+
var packageVersion = "80.4.1";
|
|
10
10
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
11
11
|
// Remove URL as it has UGC
|
|
12
12
|
// TODO: Sanitise the URL instead of just removing it
|
|
@@ -15,7 +15,7 @@ import { createAndFireEvent, withAnalyticsContext, withAnalyticsEvents } from '@
|
|
|
15
15
|
import { N0, N50A, N60A, N900 } from '@atlaskit/theme/colors';
|
|
16
16
|
import Layer from '../Layer';
|
|
17
17
|
var packageName = "@atlaskit/editor-common";
|
|
18
|
-
var packageVersion = "80.
|
|
18
|
+
var packageVersion = "80.4.1";
|
|
19
19
|
var halfFocusRing = 1;
|
|
20
20
|
var dropOffset = '0, 8';
|
|
21
21
|
var DropList = /*#__PURE__*/function (_Component) {
|
|
@@ -22,13 +22,15 @@ var Mention = /*#__PURE__*/function (_PureComponent) {
|
|
|
22
22
|
accessLevel = _this$props.accessLevel,
|
|
23
23
|
eventHandlers = _this$props.eventHandlers,
|
|
24
24
|
id = _this$props.id,
|
|
25
|
-
text = _this$props.text
|
|
25
|
+
text = _this$props.text,
|
|
26
|
+
localId = _this$props.localId;
|
|
26
27
|
var mentionProvider = providers.mentionProvider,
|
|
27
28
|
profilecardProvider = providers.profilecardProvider;
|
|
28
29
|
return /*#__PURE__*/React.createElement(MentionWithProviders, {
|
|
29
30
|
id: id,
|
|
30
31
|
text: text,
|
|
31
32
|
accessLevel: accessLevel,
|
|
33
|
+
localId: localId,
|
|
32
34
|
eventHandlers: eventHandlers,
|
|
33
35
|
mentionProvider: mentionProvider,
|
|
34
36
|
profilecardProvider: profilecardProvider
|
|
@@ -9,7 +9,8 @@ export default function MentionWithProfileCard(_ref) {
|
|
|
9
9
|
profilecardProvider = _ref.profilecardProvider,
|
|
10
10
|
onClick = _ref.onClick,
|
|
11
11
|
onMouseEnter = _ref.onMouseEnter,
|
|
12
|
-
onMouseLeave = _ref.onMouseLeave
|
|
12
|
+
onMouseLeave = _ref.onMouseLeave,
|
|
13
|
+
localId = _ref.localId;
|
|
13
14
|
var cloudId = profilecardProvider.cloudId,
|
|
14
15
|
resourceClient = profilecardProvider.resourceClient;
|
|
15
16
|
var actions = useMemo(function () {
|
|
@@ -28,6 +29,7 @@ export default function MentionWithProfileCard(_ref) {
|
|
|
28
29
|
id: id,
|
|
29
30
|
text: text,
|
|
30
31
|
accessLevel: accessLevel,
|
|
32
|
+
localId: localId,
|
|
31
33
|
mentionProvider: mentionProvider,
|
|
32
34
|
onClick: onClick,
|
|
33
35
|
onMouseEnter: onMouseEnter,
|
|
@@ -72,7 +72,8 @@ var MentionWithProviders = /*#__PURE__*/function (_PureComponent) {
|
|
|
72
72
|
eventHandlers = _this$props.eventHandlers,
|
|
73
73
|
id = _this$props.id,
|
|
74
74
|
mentionProvider = _this$props.mentionProvider,
|
|
75
|
-
text = _this$props.text
|
|
75
|
+
text = _this$props.text,
|
|
76
|
+
localId = _this$props.localId;
|
|
76
77
|
var profilecardProvider = this.state.profilecardProvider;
|
|
77
78
|
var actionHandlers = {};
|
|
78
79
|
['onClick', 'onMouseEnter', 'onMouseLeave'].forEach(function (handler) {
|
|
@@ -83,6 +84,7 @@ var MentionWithProviders = /*#__PURE__*/function (_PureComponent) {
|
|
|
83
84
|
id: id,
|
|
84
85
|
text: text,
|
|
85
86
|
accessLevel: accessLevel,
|
|
87
|
+
localId: localId,
|
|
86
88
|
mentionProvider: mentionProvider,
|
|
87
89
|
profilecardProvider: profilecardProvider
|
|
88
90
|
}, actionHandlers));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, BROWSER_FREEZE_INTERACTION_TYPE, CONTENT_COMPONENT, DELETE_DIRECTION, EVENT_TYPE, FLOATING_CONTROLS_TITLE, FULL_WIDTH_MODE, GAP_CURSOR_POSITION, INDENT_DIRECTION, INDENT_TYPE, INPUT_METHOD, LAYOUT_TYPE, LINK_REPRESENTATION, LINK_RESOURCE, LINK_STATUS, LIST_TEXT_SCENARIOS, JOIN_SCENARIOS_WHEN_TYPING_TO_INSERT_LIST, OUTDENT_SCENARIOS, MODE, PLATFORMS, PUNC, PasteContents, PasteSources, PasteTypes, RESOLVE_METHOD, SELECTION_TYPE, SELECTION_POSITION, SMART_LINK_TYPE, SYMBOL, SmartLinkNodeContexts, TABLE_ACTION, TABLE_BREAKOUT, TABLE_OVERFLOW_CHANGE_TRIGGER, TABLE_STATUS, TARGET_SELECTION_SOURCE, TOOLBAR_ACTION_SUBJECT_ID, TRIGGER_METHOD, USER_CONTEXT, TABLE_DISPLAY_MODE, } from './types';
|
|
1
|
+
export { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, BROWSER_FREEZE_INTERACTION_TYPE, CONTENT_COMPONENT, DELETE_DIRECTION, EVENT_TYPE, FLOATING_CONTROLS_TITLE, FULL_WIDTH_MODE, GAP_CURSOR_POSITION, INDENT_DIRECTION, INDENT_TYPE, INPUT_METHOD, LAYOUT_TYPE, LINK_REPRESENTATION, LINK_RESOURCE, LINK_STATUS, LIST_TEXT_SCENARIOS, JOIN_SCENARIOS_WHEN_TYPING_TO_INSERT_LIST, OUTDENT_SCENARIOS, MODE, PLATFORMS, PUNC, PasteContents, PasteSources, PasteTypes, RESOLVE_METHOD, SELECTION_TYPE, SELECTION_POSITION, SMART_LINK_TYPE, SYMBOL, SmartLinkNodeContexts, TABLE_ACTION, TABLE_BREAKOUT, TABLE_OVERFLOW_CHANGE_TRIGGER, TABLE_STATUS, TARGET_SELECTION_SOURCE, TOOLBAR_ACTION_SUBJECT_ID, TRIGGER_METHOD, USER_CONTEXT, TABLE_DISPLAY_MODE, VIEW_METHOD } from './types';
|
|
2
2
|
export type { AnalyticsDispatch, AnalyticsEventPayload, AnalyticsEventPayloadCallback, AnalyticsEventPayloadWithChannel, AnnotationAEP, AnnotationAEPAttributes, AnnotationActionType, AnnotationDraftAEPAttributes, AnnotationResolvedAEPAttributes, CaptionTrackAction, ColorPickerAEP, CommonListAnalyticsAttributes, RestartListsAttributesForListOutdented, CreateLinkInlineDialogActionType, CreateLinkInlineDialogEventPayload, DismissedCreateLinkInlineDialogAEP, DispatchAnalyticsEvent, EditLinkToolbarAEP, EnteredTextLinkSearchInputAEP, ErrorEventAttributes, ErrorEventPayload, ExperimentalEventPayload, ExtensionEventPayload, ExtensionType, FeatureExposureAEP, FormatEventPayload, GeneralEventPayload, HighlightedSearchResultsAEP, InputMethodInsertLink, InputMethodInsertMedia, InsertEventPayload, InsertSmartLinkAEP, ListEventPayload, MediaSwitchType, MediaAltTextActionType, MediaEventPayload, MediaLinkAEP, MediaResizeTrackAction, MediaInputResizeTrackAction, NodeCount, NodeEventPayload, OperationalAEP, PASTE_ACTION_SUBJECT_ID, PasteContent, PasteEventPayload, PasteSource, PasteType, PluginMethodReport, PluginPerformanceReportData, PluginsReport, QuickSearchPerfAEP, RecentActivitiesPerfAEP, SelectAllAEP, SelectCellAEP, SelectNodeAEP, SelectRangeAEP, SelectedSearchResultsAEP, SelectionEventPayload, SelectionJson, ShownPostQuerySearchResultsAEP, ShownPreQuerySearchResultsAEP, SimplifiedNode, SmartLinkNodeContext, SubstituteEventPayload, TableEventPayload, TextColorSelectedAEP, TextColorSelectedAttr, TextColorShowPaletteToggleAEP, TextColorShowPaletteToggleAttr, ToolbarEventPayload, TransactionEventPayload, TypeAheadPayload, UfoSessionCompletePayloadAEP, UnlinkToolbarAEP, ViewedCreateLinkInlineDialogAEP, FireAnalyticsCallback, FireAnalyticsEvent, FireAnalyticsEventPayload, InitialiseFragmentMarksAEP, ConnectedNodesAEP, DisconnectedSourceAEP, DisconnectedTargetAEP, GotConnectionsAEP, UpdatedFragmentMarkNameAEP, UpdatedSourceAEP, UpdatedTargetAEP, OverflowStateInfo, } from './types';
|
|
3
3
|
export type { EditorAnalyticsAPI } from './api';
|
|
4
4
|
export { editorAnalyticsChannel, fireAnalyticsEvent, } from './fire-analytics-event';
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import type { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID } from './enums';
|
|
2
2
|
import type { TrackAEP } from './utils';
|
|
3
3
|
export type HighlightToolbarToggleAEP = TrackAEP<ACTION.OPENED | ACTION.CLOSED, ACTION_SUBJECT.TOOLBAR, ACTION_SUBJECT_ID.FORMAT_BACKGROUND_COLOR, undefined, undefined>;
|
|
4
|
-
export type
|
|
4
|
+
export type HighlightTextAEP = TrackAEP<ACTION.FORMATTED, ACTION_SUBJECT.TEXT, ACTION_SUBJECT_ID.FORMAT_BACKGROUND_COLOR, {
|
|
5
|
+
newColor: string;
|
|
6
|
+
previousColor: string;
|
|
7
|
+
}, undefined>;
|
|
8
|
+
export type HighlightEventPayload = HighlightToolbarToggleAEP | HighlightTextAEP;
|
|
@@ -21,7 +21,7 @@ export type { TextColorSelectedAttr, TextColorSelectedAEP, TextColorShowPaletteT
|
|
|
21
21
|
export { GAP_CURSOR_POSITION, TARGET_SELECTION_SOURCE, } from './extension-events';
|
|
22
22
|
export type { SelectionJson, ExtensionType, ExtensionEventPayload, } from './extension-events';
|
|
23
23
|
export type { AnnotationActionType, AnnotationAEP, AnnotationAEPAttributes, AnnotationDraftAEPAttributes, AnnotationResolvedAEPAttributes, } from './inline-comment-events';
|
|
24
|
-
export { RESOLVE_METHOD } from './inline-comment-events';
|
|
24
|
+
export { RESOLVE_METHOD, VIEW_METHOD } from './inline-comment-events';
|
|
25
25
|
export { LAYOUT_TYPE, SMART_LINK_TYPE } from './node-events';
|
|
26
26
|
export type { NodeEventPayload } from './node-events';
|
|
27
27
|
export type { SelectNodeAEP, SelectRangeAEP, SelectAllAEP, SelectCellAEP, SelectionEventPayload, } from './selection-events';
|
|
@@ -37,7 +37,8 @@ export declare enum TABLE_ACTION {
|
|
|
37
37
|
* the MOVED_ROW | MOVED_COLUMN actions if you want to track events which move row/cols in a single step.
|
|
38
38
|
*/
|
|
39
39
|
ROW_OR_COLUMN_MOVED = "rowOrColumnMoved",
|
|
40
|
-
CHANGED_DISPLAY_MODE = "changedDisplayMode"
|
|
40
|
+
CHANGED_DISPLAY_MODE = "changedDisplayMode",
|
|
41
|
+
CHANGED_ALIGNMENT = "changedAlignment"
|
|
41
42
|
}
|
|
42
43
|
export declare enum TABLE_BREAKOUT {
|
|
43
44
|
WIDE = "wide",
|
|
@@ -188,5 +189,12 @@ type TableChangedDisplayModeAEP = TableAEP<TABLE_ACTION.CHANGED_DISPLAY_MODE, {
|
|
|
188
189
|
newDisplayMode: TABLE_DISPLAY_MODE;
|
|
189
190
|
tableWidth: number | null;
|
|
190
191
|
} & TotalRowAndColCount, undefined>;
|
|
191
|
-
|
|
192
|
+
type AlignmentOptions = 'center' | 'align-start';
|
|
193
|
+
type TableChangedAlignmentAEP = TableAEP<TABLE_ACTION.CHANGED_ALIGNMENT, {
|
|
194
|
+
newAlignment: AlignmentOptions;
|
|
195
|
+
previousAlignment: AlignmentOptions | null;
|
|
196
|
+
tableWidth: number | null;
|
|
197
|
+
inputMethod: INPUT_METHOD.FLOATING_TB;
|
|
198
|
+
} & TotalRowAndColCount, undefined>;
|
|
199
|
+
export type TableEventPayload = TableDeleteAEP | TableClearAEP | TableMergeSplitAEP | TableColorAEP | TableToggleHeaderAEP | TableChangeBreakoutAEP | TableCopyAndCutAEP | TableAddRowOrColumnAEP | TableSortColumnAEP | TableDeleteRowOrColumnAEP | TableReplaceAEP | TableAttemptedResizeAEP | TableDistributeColumnsWidthsAEP | TableCollapsedAEP | TableFixedAEP | TableOverflowChangedAEP | TableInitialOverflowCapturedAEP | TableResizedAEP | TableResizePerfSamplingAEP | TableRowOrColumnMovedAEP | TableMovedRowOrColumnAEP | TableClonedRowOrColumnAEP | TableChangedDisplayModeAEP | TableColumnResizedAEP | TableChangedAlignmentAEP;
|
|
192
200
|
export {};
|
|
@@ -16,3 +16,7 @@ export declare const applyMarkOnRange: (from: number, to: number, removeMark: bo
|
|
|
16
16
|
export declare const toggleMark: (markType: MarkType, attrs?: {
|
|
17
17
|
[key: string]: any;
|
|
18
18
|
} | undefined) => EditorCommand;
|
|
19
|
+
/**
|
|
20
|
+
* A wrapper around ProseMirror removeMark and removeStoredMark, which handles mark removal in text, CellSelections and cursor stored marks.
|
|
21
|
+
*/
|
|
22
|
+
export declare const removeMark: (mark: MarkType | Mark) => EditorCommand;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { transformSmartCharsMentionsAndEmojis, applyMarkOnRange, filterChildrenBetween, toggleMark, } from './commands';
|
|
1
|
+
export { transformSmartCharsMentionsAndEmojis, applyMarkOnRange, filterChildrenBetween, toggleMark, removeMark, } from './commands';
|
|
2
2
|
export { anyMarkActive, isMarkAllowedInRange, isMarkExcluded, } from './text-formatting';
|
|
@@ -15,6 +15,8 @@ type SetFocusPayload = Record<'annotationId', AnnotationId>;
|
|
|
15
15
|
export type OnAnnotationClickPayload = {
|
|
16
16
|
annotationIds: Array<AnnotationId>;
|
|
17
17
|
eventTarget: HTMLElement;
|
|
18
|
+
eventTargetType?: string;
|
|
19
|
+
viewMethod?: string;
|
|
18
20
|
};
|
|
19
21
|
type SetStatePayload = Record<AnnotationId, AnnotationState<AnnotationTypes.INLINE_COMMENT>>;
|
|
20
22
|
export type AnnotationUpdateEventPayloads = {
|
|
@@ -126,6 +126,7 @@ interface AnnotationTypeProvider<Type> {
|
|
|
126
126
|
allowCommentsOnMedia?: boolean;
|
|
127
127
|
isCommentsOnMediaBugFixEnabled?: boolean;
|
|
128
128
|
isCommentsOnMediaBugVideoCommentEnabled?: boolean;
|
|
129
|
+
isCommentsOnMediaAnalyticsEnabled?: boolean;
|
|
129
130
|
}
|
|
130
131
|
export type InlineCommentAnnotationProvider = AnnotationTypeProvider<AnnotationTypes.INLINE_COMMENT> & {
|
|
131
132
|
selectionComponent?: React.ComponentType<React.PropsWithChildren<InlineCommentSelectionComponentProps>>;
|
|
@@ -246,13 +246,29 @@ export type FeatureFlags = {
|
|
|
246
246
|
*/
|
|
247
247
|
macroInteractionUpdates?: boolean;
|
|
248
248
|
/**
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
249
|
+
* @description
|
|
250
|
+
* Enables bug fix on media comments
|
|
251
|
+
*
|
|
252
|
+
// * @see https://product-fabric.atlassian.net/browse/ED-23093
|
|
253
|
+
* @default false
|
|
254
|
+
*/
|
|
255
255
|
commentsOnMediaBugFix?: boolean;
|
|
256
|
+
/**
|
|
257
|
+
* @description
|
|
258
|
+
* Toggle fix to mediaInline node with annotation
|
|
259
|
+
*
|
|
260
|
+
* @see https://product-fabric.atlassian.net/browse/ED-23094
|
|
261
|
+
* @default false
|
|
262
|
+
*/
|
|
263
|
+
commentsOnMediaMediaInlineBugFix?: boolean;
|
|
264
|
+
/**
|
|
265
|
+
* @description
|
|
266
|
+
* Enables extra analytics to be added for comments on media
|
|
267
|
+
*
|
|
268
|
+
* @see https://product-fabric.atlassian.net/browse/ED-23355
|
|
269
|
+
* @default false
|
|
270
|
+
*/
|
|
271
|
+
commentsOnMediaAnalytics?: boolean;
|
|
256
272
|
};
|
|
257
273
|
export type FeatureFlagKey = keyof FeatureFlags;
|
|
258
274
|
export type GetEditorFeatureFlags = () => FeatureFlags;
|
|
@@ -11,5 +11,6 @@ export interface Props {
|
|
|
11
11
|
onClick?: MentionEventHandler;
|
|
12
12
|
onMouseEnter?: MentionEventHandler;
|
|
13
13
|
onMouseLeave?: MentionEventHandler;
|
|
14
|
+
localId?: string;
|
|
14
15
|
}
|
|
15
|
-
export default function MentionWithProfileCard({ id, text, accessLevel, mentionProvider, profilecardProvider, onClick, onMouseEnter, onMouseLeave, }: Props): JSX.Element;
|
|
16
|
+
export default function MentionWithProfileCard({ id, text, accessLevel, mentionProvider, profilecardProvider, onClick, onMouseEnter, onMouseLeave, localId, }: Props): JSX.Element;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { PureComponent } from 'react';
|
|
2
|
-
import { MentionProvider } from '@atlaskit/mention/resource';
|
|
3
|
-
import { ProfilecardProvider } from '../../provider-factory/profile-card-provider';
|
|
4
|
-
import { MentionEventHandlers } from '../EventHandlers';
|
|
2
|
+
import type { MentionProvider } from '@atlaskit/mention/resource';
|
|
3
|
+
import type { ProfilecardProvider } from '../../provider-factory/profile-card-provider';
|
|
4
|
+
import type { MentionEventHandlers } from '../EventHandlers';
|
|
5
5
|
export interface Props {
|
|
6
6
|
id: string;
|
|
7
7
|
text: string;
|
|
@@ -9,6 +9,7 @@ export interface Props {
|
|
|
9
9
|
mentionProvider?: Promise<MentionProvider>;
|
|
10
10
|
profilecardProvider?: Promise<ProfilecardProvider>;
|
|
11
11
|
eventHandlers?: MentionEventHandlers;
|
|
12
|
+
localId?: string;
|
|
12
13
|
}
|
|
13
14
|
export interface State {
|
|
14
15
|
profilecardProvider: ProfilecardProvider | null;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, BROWSER_FREEZE_INTERACTION_TYPE, CONTENT_COMPONENT, DELETE_DIRECTION, EVENT_TYPE, FLOATING_CONTROLS_TITLE, FULL_WIDTH_MODE, GAP_CURSOR_POSITION, INDENT_DIRECTION, INDENT_TYPE, INPUT_METHOD, LAYOUT_TYPE, LINK_REPRESENTATION, LINK_RESOURCE, LINK_STATUS, LIST_TEXT_SCENARIOS, JOIN_SCENARIOS_WHEN_TYPING_TO_INSERT_LIST, OUTDENT_SCENARIOS, MODE, PLATFORMS, PUNC, PasteContents, PasteSources, PasteTypes, RESOLVE_METHOD, SELECTION_TYPE, SELECTION_POSITION, SMART_LINK_TYPE, SYMBOL, SmartLinkNodeContexts, TABLE_ACTION, TABLE_BREAKOUT, TABLE_OVERFLOW_CHANGE_TRIGGER, TABLE_STATUS, TARGET_SELECTION_SOURCE, TOOLBAR_ACTION_SUBJECT_ID, TRIGGER_METHOD, USER_CONTEXT, TABLE_DISPLAY_MODE, } from './types';
|
|
1
|
+
export { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, BROWSER_FREEZE_INTERACTION_TYPE, CONTENT_COMPONENT, DELETE_DIRECTION, EVENT_TYPE, FLOATING_CONTROLS_TITLE, FULL_WIDTH_MODE, GAP_CURSOR_POSITION, INDENT_DIRECTION, INDENT_TYPE, INPUT_METHOD, LAYOUT_TYPE, LINK_REPRESENTATION, LINK_RESOURCE, LINK_STATUS, LIST_TEXT_SCENARIOS, JOIN_SCENARIOS_WHEN_TYPING_TO_INSERT_LIST, OUTDENT_SCENARIOS, MODE, PLATFORMS, PUNC, PasteContents, PasteSources, PasteTypes, RESOLVE_METHOD, SELECTION_TYPE, SELECTION_POSITION, SMART_LINK_TYPE, SYMBOL, SmartLinkNodeContexts, TABLE_ACTION, TABLE_BREAKOUT, TABLE_OVERFLOW_CHANGE_TRIGGER, TABLE_STATUS, TARGET_SELECTION_SOURCE, TOOLBAR_ACTION_SUBJECT_ID, TRIGGER_METHOD, USER_CONTEXT, TABLE_DISPLAY_MODE, VIEW_METHOD } from './types';
|
|
2
2
|
export type { AnalyticsDispatch, AnalyticsEventPayload, AnalyticsEventPayloadCallback, AnalyticsEventPayloadWithChannel, AnnotationAEP, AnnotationAEPAttributes, AnnotationActionType, AnnotationDraftAEPAttributes, AnnotationResolvedAEPAttributes, CaptionTrackAction, ColorPickerAEP, CommonListAnalyticsAttributes, RestartListsAttributesForListOutdented, CreateLinkInlineDialogActionType, CreateLinkInlineDialogEventPayload, DismissedCreateLinkInlineDialogAEP, DispatchAnalyticsEvent, EditLinkToolbarAEP, EnteredTextLinkSearchInputAEP, ErrorEventAttributes, ErrorEventPayload, ExperimentalEventPayload, ExtensionEventPayload, ExtensionType, FeatureExposureAEP, FormatEventPayload, GeneralEventPayload, HighlightedSearchResultsAEP, InputMethodInsertLink, InputMethodInsertMedia, InsertEventPayload, InsertSmartLinkAEP, ListEventPayload, MediaSwitchType, MediaAltTextActionType, MediaEventPayload, MediaLinkAEP, MediaResizeTrackAction, MediaInputResizeTrackAction, NodeCount, NodeEventPayload, OperationalAEP, PASTE_ACTION_SUBJECT_ID, PasteContent, PasteEventPayload, PasteSource, PasteType, PluginMethodReport, PluginPerformanceReportData, PluginsReport, QuickSearchPerfAEP, RecentActivitiesPerfAEP, SelectAllAEP, SelectCellAEP, SelectNodeAEP, SelectRangeAEP, SelectedSearchResultsAEP, SelectionEventPayload, SelectionJson, ShownPostQuerySearchResultsAEP, ShownPreQuerySearchResultsAEP, SimplifiedNode, SmartLinkNodeContext, SubstituteEventPayload, TableEventPayload, TextColorSelectedAEP, TextColorSelectedAttr, TextColorShowPaletteToggleAEP, TextColorShowPaletteToggleAttr, ToolbarEventPayload, TransactionEventPayload, TypeAheadPayload, UfoSessionCompletePayloadAEP, UnlinkToolbarAEP, ViewedCreateLinkInlineDialogAEP, FireAnalyticsCallback, FireAnalyticsEvent, FireAnalyticsEventPayload, InitialiseFragmentMarksAEP, ConnectedNodesAEP, DisconnectedSourceAEP, DisconnectedTargetAEP, GotConnectionsAEP, UpdatedFragmentMarkNameAEP, UpdatedSourceAEP, UpdatedTargetAEP, OverflowStateInfo, } from './types';
|
|
3
3
|
export type { EditorAnalyticsAPI } from './api';
|
|
4
4
|
export { editorAnalyticsChannel, fireAnalyticsEvent, } from './fire-analytics-event';
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import type { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID } from './enums';
|
|
2
2
|
import type { TrackAEP } from './utils';
|
|
3
3
|
export type HighlightToolbarToggleAEP = TrackAEP<ACTION.OPENED | ACTION.CLOSED, ACTION_SUBJECT.TOOLBAR, ACTION_SUBJECT_ID.FORMAT_BACKGROUND_COLOR, undefined, undefined>;
|
|
4
|
-
export type
|
|
4
|
+
export type HighlightTextAEP = TrackAEP<ACTION.FORMATTED, ACTION_SUBJECT.TEXT, ACTION_SUBJECT_ID.FORMAT_BACKGROUND_COLOR, {
|
|
5
|
+
newColor: string;
|
|
6
|
+
previousColor: string;
|
|
7
|
+
}, undefined>;
|
|
8
|
+
export type HighlightEventPayload = HighlightToolbarToggleAEP | HighlightTextAEP;
|
|
@@ -21,7 +21,7 @@ export type { TextColorSelectedAttr, TextColorSelectedAEP, TextColorShowPaletteT
|
|
|
21
21
|
export { GAP_CURSOR_POSITION, TARGET_SELECTION_SOURCE, } from './extension-events';
|
|
22
22
|
export type { SelectionJson, ExtensionType, ExtensionEventPayload, } from './extension-events';
|
|
23
23
|
export type { AnnotationActionType, AnnotationAEP, AnnotationAEPAttributes, AnnotationDraftAEPAttributes, AnnotationResolvedAEPAttributes, } from './inline-comment-events';
|
|
24
|
-
export { RESOLVE_METHOD } from './inline-comment-events';
|
|
24
|
+
export { RESOLVE_METHOD, VIEW_METHOD } from './inline-comment-events';
|
|
25
25
|
export { LAYOUT_TYPE, SMART_LINK_TYPE } from './node-events';
|
|
26
26
|
export type { NodeEventPayload } from './node-events';
|
|
27
27
|
export type { SelectNodeAEP, SelectRangeAEP, SelectAllAEP, SelectCellAEP, SelectionEventPayload, } from './selection-events';
|
|
@@ -37,7 +37,8 @@ export declare enum TABLE_ACTION {
|
|
|
37
37
|
* the MOVED_ROW | MOVED_COLUMN actions if you want to track events which move row/cols in a single step.
|
|
38
38
|
*/
|
|
39
39
|
ROW_OR_COLUMN_MOVED = "rowOrColumnMoved",
|
|
40
|
-
CHANGED_DISPLAY_MODE = "changedDisplayMode"
|
|
40
|
+
CHANGED_DISPLAY_MODE = "changedDisplayMode",
|
|
41
|
+
CHANGED_ALIGNMENT = "changedAlignment"
|
|
41
42
|
}
|
|
42
43
|
export declare enum TABLE_BREAKOUT {
|
|
43
44
|
WIDE = "wide",
|
|
@@ -188,5 +189,12 @@ type TableChangedDisplayModeAEP = TableAEP<TABLE_ACTION.CHANGED_DISPLAY_MODE, {
|
|
|
188
189
|
newDisplayMode: TABLE_DISPLAY_MODE;
|
|
189
190
|
tableWidth: number | null;
|
|
190
191
|
} & TotalRowAndColCount, undefined>;
|
|
191
|
-
|
|
192
|
+
type AlignmentOptions = 'center' | 'align-start';
|
|
193
|
+
type TableChangedAlignmentAEP = TableAEP<TABLE_ACTION.CHANGED_ALIGNMENT, {
|
|
194
|
+
newAlignment: AlignmentOptions;
|
|
195
|
+
previousAlignment: AlignmentOptions | null;
|
|
196
|
+
tableWidth: number | null;
|
|
197
|
+
inputMethod: INPUT_METHOD.FLOATING_TB;
|
|
198
|
+
} & TotalRowAndColCount, undefined>;
|
|
199
|
+
export type TableEventPayload = TableDeleteAEP | TableClearAEP | TableMergeSplitAEP | TableColorAEP | TableToggleHeaderAEP | TableChangeBreakoutAEP | TableCopyAndCutAEP | TableAddRowOrColumnAEP | TableSortColumnAEP | TableDeleteRowOrColumnAEP | TableReplaceAEP | TableAttemptedResizeAEP | TableDistributeColumnsWidthsAEP | TableCollapsedAEP | TableFixedAEP | TableOverflowChangedAEP | TableInitialOverflowCapturedAEP | TableResizedAEP | TableResizePerfSamplingAEP | TableRowOrColumnMovedAEP | TableMovedRowOrColumnAEP | TableClonedRowOrColumnAEP | TableChangedDisplayModeAEP | TableColumnResizedAEP | TableChangedAlignmentAEP;
|
|
192
200
|
export {};
|
|
@@ -16,3 +16,7 @@ export declare const applyMarkOnRange: (from: number, to: number, removeMark: bo
|
|
|
16
16
|
export declare const toggleMark: (markType: MarkType, attrs?: {
|
|
17
17
|
[key: string]: any;
|
|
18
18
|
} | undefined) => EditorCommand;
|
|
19
|
+
/**
|
|
20
|
+
* A wrapper around ProseMirror removeMark and removeStoredMark, which handles mark removal in text, CellSelections and cursor stored marks.
|
|
21
|
+
*/
|
|
22
|
+
export declare const removeMark: (mark: MarkType | Mark) => EditorCommand;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { transformSmartCharsMentionsAndEmojis, applyMarkOnRange, filterChildrenBetween, toggleMark, } from './commands';
|
|
1
|
+
export { transformSmartCharsMentionsAndEmojis, applyMarkOnRange, filterChildrenBetween, toggleMark, removeMark, } from './commands';
|
|
2
2
|
export { anyMarkActive, isMarkAllowedInRange, isMarkExcluded, } from './text-formatting';
|
|
@@ -15,6 +15,8 @@ type SetFocusPayload = Record<'annotationId', AnnotationId>;
|
|
|
15
15
|
export type OnAnnotationClickPayload = {
|
|
16
16
|
annotationIds: Array<AnnotationId>;
|
|
17
17
|
eventTarget: HTMLElement;
|
|
18
|
+
eventTargetType?: string;
|
|
19
|
+
viewMethod?: string;
|
|
18
20
|
};
|
|
19
21
|
type SetStatePayload = Record<AnnotationId, AnnotationState<AnnotationTypes.INLINE_COMMENT>>;
|
|
20
22
|
export type AnnotationUpdateEventPayloads = {
|
|
@@ -126,6 +126,7 @@ interface AnnotationTypeProvider<Type> {
|
|
|
126
126
|
allowCommentsOnMedia?: boolean;
|
|
127
127
|
isCommentsOnMediaBugFixEnabled?: boolean;
|
|
128
128
|
isCommentsOnMediaBugVideoCommentEnabled?: boolean;
|
|
129
|
+
isCommentsOnMediaAnalyticsEnabled?: boolean;
|
|
129
130
|
}
|
|
130
131
|
export type InlineCommentAnnotationProvider = AnnotationTypeProvider<AnnotationTypes.INLINE_COMMENT> & {
|
|
131
132
|
selectionComponent?: React.ComponentType<React.PropsWithChildren<InlineCommentSelectionComponentProps>>;
|
|
@@ -246,13 +246,29 @@ export type FeatureFlags = {
|
|
|
246
246
|
*/
|
|
247
247
|
macroInteractionUpdates?: boolean;
|
|
248
248
|
/**
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
249
|
+
* @description
|
|
250
|
+
* Enables bug fix on media comments
|
|
251
|
+
*
|
|
252
|
+
// * @see https://product-fabric.atlassian.net/browse/ED-23093
|
|
253
|
+
* @default false
|
|
254
|
+
*/
|
|
255
255
|
commentsOnMediaBugFix?: boolean;
|
|
256
|
+
/**
|
|
257
|
+
* @description
|
|
258
|
+
* Toggle fix to mediaInline node with annotation
|
|
259
|
+
*
|
|
260
|
+
* @see https://product-fabric.atlassian.net/browse/ED-23094
|
|
261
|
+
* @default false
|
|
262
|
+
*/
|
|
263
|
+
commentsOnMediaMediaInlineBugFix?: boolean;
|
|
264
|
+
/**
|
|
265
|
+
* @description
|
|
266
|
+
* Enables extra analytics to be added for comments on media
|
|
267
|
+
*
|
|
268
|
+
* @see https://product-fabric.atlassian.net/browse/ED-23355
|
|
269
|
+
* @default false
|
|
270
|
+
*/
|
|
271
|
+
commentsOnMediaAnalytics?: boolean;
|
|
256
272
|
};
|
|
257
273
|
export type FeatureFlagKey = keyof FeatureFlags;
|
|
258
274
|
export type GetEditorFeatureFlags = () => FeatureFlags;
|
|
@@ -11,5 +11,6 @@ export interface Props {
|
|
|
11
11
|
onClick?: MentionEventHandler;
|
|
12
12
|
onMouseEnter?: MentionEventHandler;
|
|
13
13
|
onMouseLeave?: MentionEventHandler;
|
|
14
|
+
localId?: string;
|
|
14
15
|
}
|
|
15
|
-
export default function MentionWithProfileCard({ id, text, accessLevel, mentionProvider, profilecardProvider, onClick, onMouseEnter, onMouseLeave, }: Props): JSX.Element;
|
|
16
|
+
export default function MentionWithProfileCard({ id, text, accessLevel, mentionProvider, profilecardProvider, onClick, onMouseEnter, onMouseLeave, localId, }: Props): JSX.Element;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { PureComponent } from 'react';
|
|
2
|
-
import { MentionProvider } from '@atlaskit/mention/resource';
|
|
3
|
-
import { ProfilecardProvider } from '../../provider-factory/profile-card-provider';
|
|
4
|
-
import { MentionEventHandlers } from '../EventHandlers';
|
|
2
|
+
import type { MentionProvider } from '@atlaskit/mention/resource';
|
|
3
|
+
import type { ProfilecardProvider } from '../../provider-factory/profile-card-provider';
|
|
4
|
+
import type { MentionEventHandlers } from '../EventHandlers';
|
|
5
5
|
export interface Props {
|
|
6
6
|
id: string;
|
|
7
7
|
text: string;
|
|
@@ -9,6 +9,7 @@ export interface Props {
|
|
|
9
9
|
mentionProvider?: Promise<MentionProvider>;
|
|
10
10
|
profilecardProvider?: Promise<ProfilecardProvider>;
|
|
11
11
|
eventHandlers?: MentionEventHandlers;
|
|
12
|
+
localId?: string;
|
|
12
13
|
}
|
|
13
14
|
export interface State {
|
|
14
15
|
profilecardProvider: ProfilecardProvider | null;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-common",
|
|
3
|
-
"version": "80.
|
|
3
|
+
"version": "80.4.1",
|
|
4
4
|
"description": "A package that contains common classes and components for editor and renderer",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -97,7 +97,7 @@
|
|
|
97
97
|
},
|
|
98
98
|
"dependencies": {
|
|
99
99
|
"@atlaskit/activity-provider": "^2.4.0",
|
|
100
|
-
"@atlaskit/adf-schema": "^36.
|
|
100
|
+
"@atlaskit/adf-schema": "^36.8.0",
|
|
101
101
|
"@atlaskit/adf-utils": "^19.2.0",
|
|
102
102
|
"@atlaskit/analytics-listeners": "^8.9.0",
|
|
103
103
|
"@atlaskit/analytics-namespaced-context": "^6.9.0",
|
|
@@ -116,7 +116,7 @@
|
|
|
116
116
|
"@atlaskit/icon": "^22.2.0",
|
|
117
117
|
"@atlaskit/icon-object": "^6.4.0",
|
|
118
118
|
"@atlaskit/in-product-testing": "^0.2.0",
|
|
119
|
-
"@atlaskit/link-datasource": "^2.
|
|
119
|
+
"@atlaskit/link-datasource": "^2.3.0",
|
|
120
120
|
"@atlaskit/link-picker": "^1.36.0",
|
|
121
121
|
"@atlaskit/media-card": "^77.11.0",
|
|
122
122
|
"@atlaskit/media-client": "^27.0.0",
|
|
@@ -132,7 +132,7 @@
|
|
|
132
132
|
"@atlaskit/primitives": "^6.2.0",
|
|
133
133
|
"@atlaskit/profilecard": "^19.13.0",
|
|
134
134
|
"@atlaskit/section-message": "^6.5.0",
|
|
135
|
-
"@atlaskit/smart-card": "^26.
|
|
135
|
+
"@atlaskit/smart-card": "^26.69.0",
|
|
136
136
|
"@atlaskit/smart-user-picker": "^6.9.0",
|
|
137
137
|
"@atlaskit/spinner": "^16.1.0",
|
|
138
138
|
"@atlaskit/task-decision": "^17.10.0",
|