@atlaskit/editor-common 74.51.5 → 74.51.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +13 -0
- package/dist/cjs/guideline/utils.js +14 -12
- package/dist/cjs/lists/analytics.js +10 -10
- package/dist/cjs/monitoring/error.js +1 -1
- package/dist/cjs/preset/editor-commands.js +36 -4
- package/dist/cjs/preset/index.js +6 -0
- package/dist/cjs/quick-insert/assets/images.js +28 -54
- package/dist/cjs/quick-insert/assets/mention.js +27 -9
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/es2019/guideline/utils.js +7 -9
- package/dist/es2019/lists/analytics.js +6 -6
- package/dist/es2019/monitoring/error.js +1 -1
- package/dist/es2019/preset/editor-commands.js +21 -3
- package/dist/es2019/preset/index.js +1 -1
- package/dist/es2019/quick-insert/assets/images.js +29 -53
- package/dist/es2019/quick-insert/assets/mention.js +28 -8
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/esm/guideline/utils.js +14 -12
- package/dist/esm/lists/analytics.js +10 -10
- package/dist/esm/monitoring/error.js +1 -1
- package/dist/esm/preset/editor-commands.js +33 -4
- package/dist/esm/preset/index.js +1 -1
- package/dist/esm/quick-insert/assets/images.js +28 -53
- package/dist/esm/quick-insert/assets/mention.js +27 -8
- package/dist/esm/ui/DropList/index.js +1 -1
- package/dist/types/lists/analytics.d.ts +4 -4
- package/dist/types/preset/editor-commands.d.ts +8 -0
- package/dist/types/preset/index.d.ts +1 -1
- package/dist/types/types/editor-command.d.ts +1 -1
- package/dist/types-ts4.5/lists/analytics.d.ts +4 -4
- package/dist/types-ts4.5/preset/editor-commands.d.ts +8 -0
- package/dist/types-ts4.5/preset/index.d.ts +1 -1
- package/dist/types-ts4.5/types/editor-command.d.ts +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @atlaskit/editor-common
|
|
2
2
|
|
|
3
|
+
## 74.51.7
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`4795a87a349`](https://bitbucket.org/atlassian/atlassian-frontend/commits/4795a87a349) - Migrating some actions of `editor-plugin-list` to commands. Adding sharedState for `editor-plugin-text-formatting`.
|
|
8
|
+
- [`a34c6ca52c2`](https://bitbucket.org/atlassian/atlassian-frontend/commits/a34c6ca52c2) - [ux] [ED-19442] - Modified images and mentions icons and added dark mode
|
|
9
|
+
|
|
10
|
+
## 74.51.6
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- [`edeab2d50b2`](https://bitbucket.org/atlassian/atlassian-frontend/commits/edeab2d50b2) - Fix analytics event for image resizing and relative snaps
|
|
15
|
+
|
|
3
16
|
## 74.51.5
|
|
4
17
|
|
|
5
18
|
### Patch Changes
|
|
@@ -38,22 +38,24 @@ var getGuidelineTypeFromKey = function getGuidelineTypeFromKey(keys, guidelines)
|
|
|
38
38
|
return 'default';
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
-
//
|
|
42
|
-
|
|
43
|
-
return
|
|
44
|
-
return
|
|
41
|
+
// Check for temporary guidelines
|
|
42
|
+
if (keys.some(function (key) {
|
|
43
|
+
return ['media_'].some(function (temoporaryGuideline) {
|
|
44
|
+
return key.indexOf(temoporaryGuideline) >= 0;
|
|
45
45
|
});
|
|
46
|
-
})
|
|
47
|
-
|
|
48
|
-
return 'none';
|
|
46
|
+
})) {
|
|
47
|
+
return 'temporary';
|
|
49
48
|
}
|
|
50
49
|
|
|
51
|
-
// Check
|
|
52
|
-
if (
|
|
53
|
-
return
|
|
54
|
-
|
|
55
|
-
|
|
50
|
+
// Check for relative guidelines
|
|
51
|
+
if (keys.some(function (key) {
|
|
52
|
+
return ['relative_'].some(function (relativeGuideline) {
|
|
53
|
+
return key.indexOf(relativeGuideline) >= 0;
|
|
54
|
+
});
|
|
55
|
+
})) {
|
|
56
|
+
return 'relative';
|
|
56
57
|
}
|
|
58
|
+
return 'none';
|
|
57
59
|
};
|
|
58
60
|
|
|
59
61
|
/**
|
|
@@ -6,10 +6,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.getCommonListAnalyticsAttributes = exports.countListItemsInSelection = void 0;
|
|
7
7
|
var _utils = require("../utils");
|
|
8
8
|
var _selection = require("./selection");
|
|
9
|
-
var getCommonListAnalyticsAttributes = function getCommonListAnalyticsAttributes(
|
|
10
|
-
var
|
|
11
|
-
$from =
|
|
12
|
-
$to =
|
|
9
|
+
var getCommonListAnalyticsAttributes = function getCommonListAnalyticsAttributes(tr) {
|
|
10
|
+
var _tr$selection = tr.selection,
|
|
11
|
+
$from = _tr$selection.$from,
|
|
12
|
+
$to = _tr$selection.$to;
|
|
13
13
|
var fromAttrs = (0, _selection.getListItemAttributes)($from);
|
|
14
14
|
var toAttrs = (0, _selection.getListItemAttributes)($to);
|
|
15
15
|
return {
|
|
@@ -17,19 +17,19 @@ var getCommonListAnalyticsAttributes = function getCommonListAnalyticsAttributes
|
|
|
17
17
|
itemIndexAtSelectionEnd: toAttrs.itemIndex,
|
|
18
18
|
indentLevelAtSelectionStart: fromAttrs.indentLevel,
|
|
19
19
|
indentLevelAtSelectionEnd: toAttrs.indentLevel,
|
|
20
|
-
itemsInSelection: countListItemsInSelection(
|
|
20
|
+
itemsInSelection: countListItemsInSelection(tr)
|
|
21
21
|
};
|
|
22
22
|
};
|
|
23
23
|
exports.getCommonListAnalyticsAttributes = getCommonListAnalyticsAttributes;
|
|
24
|
-
var countListItemsInSelection = function countListItemsInSelection(
|
|
25
|
-
var
|
|
26
|
-
from =
|
|
27
|
-
to =
|
|
24
|
+
var countListItemsInSelection = function countListItemsInSelection(tr) {
|
|
25
|
+
var _tr$selection2 = tr.selection,
|
|
26
|
+
from = _tr$selection2.from,
|
|
27
|
+
to = _tr$selection2.to;
|
|
28
28
|
if (from === to) {
|
|
29
29
|
return 1;
|
|
30
30
|
}
|
|
31
31
|
var count = 0;
|
|
32
|
-
var listSlice =
|
|
32
|
+
var listSlice = tr.doc.cut(from, to);
|
|
33
33
|
listSlice.content.nodesBetween(0, listSlice.content.size, function (node, pos, parent, index) {
|
|
34
34
|
if (parent && (0, _utils.isListItemNode)(parent) && !(0, _utils.isListNode)(node) && index === 0) {
|
|
35
35
|
count++;
|
|
@@ -16,7 +16,7 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
16
16
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
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 = "74.51.
|
|
19
|
+
var packageVersion = "74.51.7";
|
|
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
|
|
@@ -1,9 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
3
4
|
Object.defineProperty(exports, "__esModule", {
|
|
4
5
|
value: true
|
|
5
6
|
});
|
|
7
|
+
exports.PassiveTransaction = void 0;
|
|
6
8
|
exports.editorCommandToPMCommand = editorCommandToPMCommand;
|
|
9
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
10
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
11
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
12
|
+
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
13
|
+
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
14
|
+
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
15
|
+
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); }; }
|
|
16
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
7
17
|
/**
|
|
8
18
|
* Convert a EditorCommand to a standard Prosemirror Command.
|
|
9
19
|
* The preferred approach to dispatching a `EditorCommand` is via the
|
|
@@ -20,10 +30,32 @@ function editorCommandToPMCommand(command) {
|
|
|
20
30
|
var newTr = command === null || command === void 0 ? void 0 : command({
|
|
21
31
|
tr: tr
|
|
22
32
|
});
|
|
23
|
-
if (newTr) {
|
|
24
|
-
|
|
33
|
+
if (!newTr) {
|
|
34
|
+
return false;
|
|
35
|
+
}
|
|
36
|
+
if (newTr instanceof PassiveTransaction) {
|
|
25
37
|
return true;
|
|
26
38
|
}
|
|
27
|
-
|
|
39
|
+
dispatch === null || dispatch === void 0 ? void 0 : dispatch(newTr);
|
|
40
|
+
return true;
|
|
28
41
|
};
|
|
29
|
-
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* PassiveTransaction is used only to indicate that
|
|
46
|
+
* an `EditorCommand` should return `true` but should not dispatch.
|
|
47
|
+
*/
|
|
48
|
+
var PassiveTransaction = /*#__PURE__*/function (_Transaction) {
|
|
49
|
+
(0, _inherits2.default)(PassiveTransaction, _Transaction);
|
|
50
|
+
var _super = _createSuper(PassiveTransaction);
|
|
51
|
+
// This is very cheeky but this should never be used outside its intended
|
|
52
|
+
// purpose - it will likely crash the editor so we should get an early warning
|
|
53
|
+
// signal
|
|
54
|
+
function PassiveTransaction() {
|
|
55
|
+
(0, _classCallCheck2.default)(this, PassiveTransaction);
|
|
56
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
57
|
+
return _super.call(this, {});
|
|
58
|
+
}
|
|
59
|
+
return (0, _createClass2.default)(PassiveTransaction);
|
|
60
|
+
}(_state.Transaction);
|
|
61
|
+
exports.PassiveTransaction = PassiveTransaction;
|
package/dist/cjs/preset/index.js
CHANGED
|
@@ -15,6 +15,12 @@ Object.defineProperty(exports, "EditorPresetBuilder", {
|
|
|
15
15
|
return _builder.EditorPresetBuilder;
|
|
16
16
|
}
|
|
17
17
|
});
|
|
18
|
+
Object.defineProperty(exports, "PassiveTransaction", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function get() {
|
|
21
|
+
return _editorCommands.PassiveTransaction;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
18
24
|
Object.defineProperty(exports, "editorCommandToPMCommand", {
|
|
19
25
|
enumerable: true,
|
|
20
26
|
get: function get() {
|
|
@@ -6,84 +6,58 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.default = IconImages;
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
|
|
10
|
-
/* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
|
|
11
|
-
|
|
9
|
+
var _useIconThemed2 = require("../use-icon-themed");
|
|
12
10
|
function IconImages() {
|
|
11
|
+
var _useIconThemed = (0, _useIconThemed2.useIconThemed)(),
|
|
12
|
+
iconThemed = _useIconThemed.iconThemed;
|
|
13
13
|
return /*#__PURE__*/_react.default.createElement("svg", {
|
|
14
14
|
focusable: "false",
|
|
15
15
|
"aria-hidden": true,
|
|
16
16
|
width: 40,
|
|
17
17
|
height: 40
|
|
18
|
-
}, /*#__PURE__*/_react.default.createElement("defs", null, /*#__PURE__*/_react.default.createElement("
|
|
19
|
-
x1: "46.315%",
|
|
20
|
-
y1: "-31.529%",
|
|
21
|
-
x2: "50%",
|
|
22
|
-
y2: "100%",
|
|
23
|
-
id: "images-a"
|
|
24
|
-
}, /*#__PURE__*/_react.default.createElement("stop", {
|
|
25
|
-
stopColor: "#FFD500",
|
|
26
|
-
offset: "0%"
|
|
27
|
-
}), /*#__PURE__*/_react.default.createElement("stop", {
|
|
28
|
-
stopColor: "#FFAB00",
|
|
29
|
-
offset: "100%"
|
|
30
|
-
})), /*#__PURE__*/_react.default.createElement("linearGradient", {
|
|
31
|
-
x1: "100.699%",
|
|
32
|
-
y1: "50%",
|
|
33
|
-
x2: "-14.52%",
|
|
34
|
-
y2: "50%",
|
|
35
|
-
id: "images-b"
|
|
36
|
-
}, /*#__PURE__*/_react.default.createElement("stop", {
|
|
37
|
-
stopColor: "#FAFBFC",
|
|
38
|
-
offset: "0%"
|
|
39
|
-
}), /*#__PURE__*/_react.default.createElement("stop", {
|
|
40
|
-
stopColor: "#F4F6F8",
|
|
41
|
-
stopOpacity: 0.859,
|
|
42
|
-
offset: "12.52%"
|
|
43
|
-
}), /*#__PURE__*/_react.default.createElement("stop", {
|
|
44
|
-
stopColor: "#E3E6EA",
|
|
45
|
-
stopOpacity: 0.402,
|
|
46
|
-
offset: "54.65%"
|
|
47
|
-
}), /*#__PURE__*/_react.default.createElement("stop", {
|
|
48
|
-
stopColor: "#D7DCE1",
|
|
49
|
-
stopOpacity: 0.113,
|
|
50
|
-
offset: "83.66%"
|
|
51
|
-
}), /*#__PURE__*/_react.default.createElement("stop", {
|
|
52
|
-
stopColor: "#D3D8DE",
|
|
53
|
-
stopOpacity: 0,
|
|
54
|
-
offset: "97.03%"
|
|
55
|
-
}))), /*#__PURE__*/_react.default.createElement("g", {
|
|
18
|
+
}, /*#__PURE__*/_react.default.createElement("defs", null), /*#__PURE__*/_react.default.createElement("g", {
|
|
56
19
|
fill: "none",
|
|
57
20
|
fillRule: "evenodd"
|
|
58
21
|
}, /*#__PURE__*/_react.default.createElement("path", {
|
|
59
|
-
fill:
|
|
22
|
+
fill: iconThemed({
|
|
23
|
+
light: '#FFF',
|
|
24
|
+
dark: '#161A1D'
|
|
25
|
+
}),
|
|
60
26
|
d: "M0 0h40v40H0z"
|
|
61
27
|
}), /*#__PURE__*/_react.default.createElement("g", {
|
|
62
28
|
transform: "translate(4 9)",
|
|
63
29
|
fillRule: "nonzero"
|
|
64
30
|
}, /*#__PURE__*/_react.default.createElement("rect", {
|
|
65
|
-
fill:
|
|
31
|
+
fill: iconThemed({
|
|
32
|
+
light: '#EBB800',
|
|
33
|
+
dark: '#09326C'
|
|
34
|
+
}),
|
|
66
35
|
width: 32,
|
|
67
36
|
height: 24,
|
|
68
37
|
rx: 1
|
|
69
38
|
}), /*#__PURE__*/_react.default.createElement("path", {
|
|
70
|
-
fill:
|
|
39
|
+
fill: iconThemed({
|
|
40
|
+
light: '#F7F8F9',
|
|
41
|
+
dark: '#161A1D'
|
|
42
|
+
}),
|
|
71
43
|
d: "M4 4h24v16H4z"
|
|
72
44
|
}), /*#__PURE__*/_react.default.createElement("path", {
|
|
73
|
-
fill:
|
|
45
|
+
fill: iconThemed({
|
|
46
|
+
light: '#09326C',
|
|
47
|
+
dark: '#09326C'
|
|
48
|
+
}),
|
|
74
49
|
d: "M6.351 18.062l5.594-6.017 5.594 6.017z"
|
|
75
50
|
}), /*#__PURE__*/_react.default.createElement("path", {
|
|
76
|
-
fill:
|
|
51
|
+
fill: iconThemed({
|
|
52
|
+
light: '#0065FF',
|
|
53
|
+
dark: '#0055CC'
|
|
54
|
+
}),
|
|
77
55
|
d: "M9.341 18.062l8.198-8.818 8.198 8.818z"
|
|
78
|
-
}), /*#__PURE__*/_react.default.createElement("path", {
|
|
79
|
-
d: "M20.484 14.353c-2.618-1.255-5.104-.564-8.519-1.373C9.625 12.426 6.719 11.135 4 8v11.913h20.294c-.321-2.073-1.26-4.337-3.81-5.56z",
|
|
80
|
-
fill: "url(#images-b)",
|
|
81
|
-
opacity: 0.37,
|
|
82
|
-
style: {
|
|
83
|
-
mixBlendMode: 'screen'
|
|
84
|
-
}
|
|
85
56
|
}), /*#__PURE__*/_react.default.createElement("ellipse", {
|
|
86
|
-
fill:
|
|
57
|
+
fill: iconThemed({
|
|
58
|
+
light: '#F88A0D',
|
|
59
|
+
dark: '#B85C00'
|
|
60
|
+
}),
|
|
87
61
|
cx: 9,
|
|
88
62
|
cy: 9.028,
|
|
89
63
|
rx: 2,
|
|
@@ -6,10 +6,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.default = IconMention;
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
|
|
10
|
-
/* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
|
|
11
|
-
|
|
9
|
+
var _useIconThemed2 = require("../use-icon-themed");
|
|
12
10
|
function IconMention() {
|
|
11
|
+
var _useIconThemed = (0, _useIconThemed2.useIconThemed)(),
|
|
12
|
+
iconThemed = _useIconThemed.iconThemed;
|
|
13
13
|
return /*#__PURE__*/_react.default.createElement("svg", {
|
|
14
14
|
focusable: "false",
|
|
15
15
|
"aria-hidden": true,
|
|
@@ -19,34 +19,52 @@ function IconMention() {
|
|
|
19
19
|
fill: "none",
|
|
20
20
|
fillRule: "evenodd"
|
|
21
21
|
}, /*#__PURE__*/_react.default.createElement("path", {
|
|
22
|
-
fill:
|
|
22
|
+
fill: iconThemed({
|
|
23
|
+
light: '#FFF',
|
|
24
|
+
dark: '#161A1D'
|
|
25
|
+
}),
|
|
23
26
|
d: "M0 0h40v40H0z"
|
|
24
27
|
}), /*#__PURE__*/_react.default.createElement("g", {
|
|
25
28
|
transform: "translate(6 12)"
|
|
26
29
|
}, /*#__PURE__*/_react.default.createElement("circle", {
|
|
27
|
-
fill:
|
|
30
|
+
fill: iconThemed({
|
|
31
|
+
light: '#388BFF',
|
|
32
|
+
dark: '#0055CC'
|
|
33
|
+
}),
|
|
28
34
|
cx: 8,
|
|
29
35
|
cy: 8,
|
|
30
36
|
r: 8
|
|
31
37
|
}), /*#__PURE__*/_react.default.createElement("path", {
|
|
32
38
|
d: "M12.875 12.767A6.891 6.891 0 018.02 14.75a6.889 6.889 0 01-4.895-2.026V11.9c0-1.049.873-1.9 1.95-1.9h5.85c1.077 0 1.95.851 1.95 1.9v.867zM8 3a2.874 2.874 0 10-.001 5.748 2.874 2.874 0 000-5.748",
|
|
33
|
-
fill:
|
|
39
|
+
fill: iconThemed({
|
|
40
|
+
light: '#85B8FF',
|
|
41
|
+
dark: '#388BFF'
|
|
42
|
+
})
|
|
34
43
|
}), /*#__PURE__*/_react.default.createElement("rect", {
|
|
35
|
-
fill:
|
|
44
|
+
fill: iconThemed({
|
|
45
|
+
light: '#A4ACB9',
|
|
46
|
+
dark: '#A4ACB9'
|
|
47
|
+
}),
|
|
36
48
|
x: 19,
|
|
37
49
|
y: 3,
|
|
38
50
|
width: 12,
|
|
39
51
|
height: 1,
|
|
40
52
|
rx: 0.5
|
|
41
53
|
}), /*#__PURE__*/_react.default.createElement("rect", {
|
|
42
|
-
fill:
|
|
54
|
+
fill: iconThemed({
|
|
55
|
+
light: '#A4ACB9',
|
|
56
|
+
dark: '#A4ACB9'
|
|
57
|
+
}),
|
|
43
58
|
x: 19,
|
|
44
59
|
y: 7,
|
|
45
60
|
width: 6,
|
|
46
61
|
height: 1,
|
|
47
62
|
rx: 0.5
|
|
48
63
|
}), /*#__PURE__*/_react.default.createElement("rect", {
|
|
49
|
-
fill:
|
|
64
|
+
fill: iconThemed({
|
|
65
|
+
light: '#A4ACB9',
|
|
66
|
+
dark: '#A4ACB9'
|
|
67
|
+
}),
|
|
50
68
|
x: 19,
|
|
51
69
|
y: 11,
|
|
52
70
|
width: 8,
|
|
@@ -24,7 +24,7 @@ var _templateObject, _templateObject2, _templateObject3;
|
|
|
24
24
|
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); }; }
|
|
25
25
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } /** @jsx jsx */
|
|
26
26
|
var packageName = "@atlaskit/editor-common";
|
|
27
|
-
var packageVersion = "74.51.
|
|
27
|
+
var packageVersion = "74.51.7";
|
|
28
28
|
var halfFocusRing = 1;
|
|
29
29
|
var dropOffset = '0, 8';
|
|
30
30
|
var DropList = /*#__PURE__*/function (_Component) {
|
|
@@ -17,18 +17,16 @@ export const getGuidelineTypeFromKey = (keys, guidelines) => {
|
|
|
17
17
|
return 'default';
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
//
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
return 'none';
|
|
20
|
+
// Check for temporary guidelines
|
|
21
|
+
if (keys.some(key => ['media_'].some(temoporaryGuideline => key.indexOf(temoporaryGuideline) >= 0))) {
|
|
22
|
+
return 'temporary';
|
|
24
23
|
}
|
|
25
24
|
|
|
26
|
-
// Check
|
|
27
|
-
if (
|
|
28
|
-
return
|
|
29
|
-
} else {
|
|
30
|
-
return isRange(matchedGuideline.position.x) ? 'relative' : 'none'; // Can never have temporary horizontal guides
|
|
25
|
+
// Check for relative guidelines
|
|
26
|
+
if (keys.some(key => ['relative_'].some(relativeGuideline => key.indexOf(relativeGuideline) >= 0))) {
|
|
27
|
+
return 'relative';
|
|
31
28
|
}
|
|
29
|
+
return 'none';
|
|
32
30
|
};
|
|
33
31
|
|
|
34
32
|
/**
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { isListItemNode, isListNode } from '../utils';
|
|
2
2
|
import { getListItemAttributes } from './selection';
|
|
3
|
-
export const getCommonListAnalyticsAttributes =
|
|
3
|
+
export const getCommonListAnalyticsAttributes = tr => {
|
|
4
4
|
const {
|
|
5
5
|
selection: {
|
|
6
6
|
$from,
|
|
7
7
|
$to
|
|
8
8
|
}
|
|
9
|
-
} =
|
|
9
|
+
} = tr;
|
|
10
10
|
const fromAttrs = getListItemAttributes($from);
|
|
11
11
|
const toAttrs = getListItemAttributes($to);
|
|
12
12
|
return {
|
|
@@ -14,19 +14,19 @@ export const getCommonListAnalyticsAttributes = state => {
|
|
|
14
14
|
itemIndexAtSelectionEnd: toAttrs.itemIndex,
|
|
15
15
|
indentLevelAtSelectionStart: fromAttrs.indentLevel,
|
|
16
16
|
indentLevelAtSelectionEnd: toAttrs.indentLevel,
|
|
17
|
-
itemsInSelection: countListItemsInSelection(
|
|
17
|
+
itemsInSelection: countListItemsInSelection(tr)
|
|
18
18
|
};
|
|
19
19
|
};
|
|
20
|
-
export const countListItemsInSelection =
|
|
20
|
+
export const countListItemsInSelection = tr => {
|
|
21
21
|
const {
|
|
22
22
|
from,
|
|
23
23
|
to
|
|
24
|
-
} =
|
|
24
|
+
} = tr.selection;
|
|
25
25
|
if (from === to) {
|
|
26
26
|
return 1;
|
|
27
27
|
}
|
|
28
28
|
let count = 0;
|
|
29
|
-
const listSlice =
|
|
29
|
+
const listSlice = tr.doc.cut(from, to);
|
|
30
30
|
listSlice.content.nodesBetween(0, listSlice.content.size, (node, pos, parent, index) => {
|
|
31
31
|
if (parent && isListItemNode(parent) && !isListNode(node) && index === 0) {
|
|
32
32
|
count++;
|
|
@@ -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 = "74.51.
|
|
3
|
+
const packageVersion = "74.51.7";
|
|
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
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
1
2
|
/**
|
|
2
3
|
* Convert a EditorCommand to a standard Prosemirror Command.
|
|
3
4
|
* The preferred approach to dispatching a `EditorCommand` is via the
|
|
@@ -15,10 +16,27 @@ export function editorCommandToPMCommand(command) {
|
|
|
15
16
|
const newTr = command === null || command === void 0 ? void 0 : command({
|
|
16
17
|
tr
|
|
17
18
|
});
|
|
18
|
-
if (newTr) {
|
|
19
|
-
|
|
19
|
+
if (!newTr) {
|
|
20
|
+
return false;
|
|
21
|
+
}
|
|
22
|
+
if (newTr instanceof PassiveTransaction) {
|
|
20
23
|
return true;
|
|
21
24
|
}
|
|
22
|
-
|
|
25
|
+
dispatch === null || dispatch === void 0 ? void 0 : dispatch(newTr);
|
|
26
|
+
return true;
|
|
23
27
|
};
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* PassiveTransaction is used only to indicate that
|
|
32
|
+
* an `EditorCommand` should return `true` but should not dispatch.
|
|
33
|
+
*/
|
|
34
|
+
export class PassiveTransaction extends Transaction {
|
|
35
|
+
// This is very cheeky but this should never be used outside its intended
|
|
36
|
+
// purpose - it will likely crash the editor so we should get an early warning
|
|
37
|
+
// signal
|
|
38
|
+
constructor() {
|
|
39
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
40
|
+
super({});
|
|
41
|
+
}
|
|
24
42
|
}
|
|
@@ -1,81 +1,57 @@
|
|
|
1
|
-
// TODO: https://product-fabric.atlassian.net/browse/DSP-4138
|
|
2
|
-
/* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
|
|
3
1
|
import React from 'react';
|
|
2
|
+
import { useIconThemed } from '../use-icon-themed';
|
|
4
3
|
export default function IconImages() {
|
|
4
|
+
const {
|
|
5
|
+
iconThemed
|
|
6
|
+
} = useIconThemed();
|
|
5
7
|
return /*#__PURE__*/React.createElement("svg", {
|
|
6
8
|
focusable: "false",
|
|
7
9
|
"aria-hidden": true,
|
|
8
10
|
width: 40,
|
|
9
11
|
height: 40
|
|
10
|
-
}, /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement("
|
|
11
|
-
x1: "46.315%",
|
|
12
|
-
y1: "-31.529%",
|
|
13
|
-
x2: "50%",
|
|
14
|
-
y2: "100%",
|
|
15
|
-
id: "images-a"
|
|
16
|
-
}, /*#__PURE__*/React.createElement("stop", {
|
|
17
|
-
stopColor: "#FFD500",
|
|
18
|
-
offset: "0%"
|
|
19
|
-
}), /*#__PURE__*/React.createElement("stop", {
|
|
20
|
-
stopColor: "#FFAB00",
|
|
21
|
-
offset: "100%"
|
|
22
|
-
})), /*#__PURE__*/React.createElement("linearGradient", {
|
|
23
|
-
x1: "100.699%",
|
|
24
|
-
y1: "50%",
|
|
25
|
-
x2: "-14.52%",
|
|
26
|
-
y2: "50%",
|
|
27
|
-
id: "images-b"
|
|
28
|
-
}, /*#__PURE__*/React.createElement("stop", {
|
|
29
|
-
stopColor: "#FAFBFC",
|
|
30
|
-
offset: "0%"
|
|
31
|
-
}), /*#__PURE__*/React.createElement("stop", {
|
|
32
|
-
stopColor: "#F4F6F8",
|
|
33
|
-
stopOpacity: 0.859,
|
|
34
|
-
offset: "12.52%"
|
|
35
|
-
}), /*#__PURE__*/React.createElement("stop", {
|
|
36
|
-
stopColor: "#E3E6EA",
|
|
37
|
-
stopOpacity: 0.402,
|
|
38
|
-
offset: "54.65%"
|
|
39
|
-
}), /*#__PURE__*/React.createElement("stop", {
|
|
40
|
-
stopColor: "#D7DCE1",
|
|
41
|
-
stopOpacity: 0.113,
|
|
42
|
-
offset: "83.66%"
|
|
43
|
-
}), /*#__PURE__*/React.createElement("stop", {
|
|
44
|
-
stopColor: "#D3D8DE",
|
|
45
|
-
stopOpacity: 0,
|
|
46
|
-
offset: "97.03%"
|
|
47
|
-
}))), /*#__PURE__*/React.createElement("g", {
|
|
12
|
+
}, /*#__PURE__*/React.createElement("defs", null), /*#__PURE__*/React.createElement("g", {
|
|
48
13
|
fill: "none",
|
|
49
14
|
fillRule: "evenodd"
|
|
50
15
|
}, /*#__PURE__*/React.createElement("path", {
|
|
51
|
-
fill:
|
|
16
|
+
fill: iconThemed({
|
|
17
|
+
light: '#FFF',
|
|
18
|
+
dark: '#161A1D'
|
|
19
|
+
}),
|
|
52
20
|
d: "M0 0h40v40H0z"
|
|
53
21
|
}), /*#__PURE__*/React.createElement("g", {
|
|
54
22
|
transform: "translate(4 9)",
|
|
55
23
|
fillRule: "nonzero"
|
|
56
24
|
}, /*#__PURE__*/React.createElement("rect", {
|
|
57
|
-
fill:
|
|
25
|
+
fill: iconThemed({
|
|
26
|
+
light: '#EBB800',
|
|
27
|
+
dark: '#09326C'
|
|
28
|
+
}),
|
|
58
29
|
width: 32,
|
|
59
30
|
height: 24,
|
|
60
31
|
rx: 1
|
|
61
32
|
}), /*#__PURE__*/React.createElement("path", {
|
|
62
|
-
fill:
|
|
33
|
+
fill: iconThemed({
|
|
34
|
+
light: '#F7F8F9',
|
|
35
|
+
dark: '#161A1D'
|
|
36
|
+
}),
|
|
63
37
|
d: "M4 4h24v16H4z"
|
|
64
38
|
}), /*#__PURE__*/React.createElement("path", {
|
|
65
|
-
fill:
|
|
39
|
+
fill: iconThemed({
|
|
40
|
+
light: '#09326C',
|
|
41
|
+
dark: '#09326C'
|
|
42
|
+
}),
|
|
66
43
|
d: "M6.351 18.062l5.594-6.017 5.594 6.017z"
|
|
67
44
|
}), /*#__PURE__*/React.createElement("path", {
|
|
68
|
-
fill:
|
|
45
|
+
fill: iconThemed({
|
|
46
|
+
light: '#0065FF',
|
|
47
|
+
dark: '#0055CC'
|
|
48
|
+
}),
|
|
69
49
|
d: "M9.341 18.062l8.198-8.818 8.198 8.818z"
|
|
70
|
-
}), /*#__PURE__*/React.createElement("path", {
|
|
71
|
-
d: "M20.484 14.353c-2.618-1.255-5.104-.564-8.519-1.373C9.625 12.426 6.719 11.135 4 8v11.913h20.294c-.321-2.073-1.26-4.337-3.81-5.56z",
|
|
72
|
-
fill: "url(#images-b)",
|
|
73
|
-
opacity: 0.37,
|
|
74
|
-
style: {
|
|
75
|
-
mixBlendMode: 'screen'
|
|
76
|
-
}
|
|
77
50
|
}), /*#__PURE__*/React.createElement("ellipse", {
|
|
78
|
-
fill:
|
|
51
|
+
fill: iconThemed({
|
|
52
|
+
light: '#F88A0D',
|
|
53
|
+
dark: '#B85C00'
|
|
54
|
+
}),
|
|
79
55
|
cx: 9,
|
|
80
56
|
cy: 9.028,
|
|
81
57
|
rx: 2,
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
// TODO: https://product-fabric.atlassian.net/browse/DSP-4138
|
|
2
|
-
/* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
|
|
3
1
|
import React from 'react';
|
|
2
|
+
import { useIconThemed } from '../use-icon-themed';
|
|
4
3
|
export default function IconMention() {
|
|
4
|
+
const {
|
|
5
|
+
iconThemed
|
|
6
|
+
} = useIconThemed();
|
|
5
7
|
return /*#__PURE__*/React.createElement("svg", {
|
|
6
8
|
focusable: "false",
|
|
7
9
|
"aria-hidden": true,
|
|
@@ -11,34 +13,52 @@ export default function IconMention() {
|
|
|
11
13
|
fill: "none",
|
|
12
14
|
fillRule: "evenodd"
|
|
13
15
|
}, /*#__PURE__*/React.createElement("path", {
|
|
14
|
-
fill:
|
|
16
|
+
fill: iconThemed({
|
|
17
|
+
light: '#FFF',
|
|
18
|
+
dark: '#161A1D'
|
|
19
|
+
}),
|
|
15
20
|
d: "M0 0h40v40H0z"
|
|
16
21
|
}), /*#__PURE__*/React.createElement("g", {
|
|
17
22
|
transform: "translate(6 12)"
|
|
18
23
|
}, /*#__PURE__*/React.createElement("circle", {
|
|
19
|
-
fill:
|
|
24
|
+
fill: iconThemed({
|
|
25
|
+
light: '#388BFF',
|
|
26
|
+
dark: '#0055CC'
|
|
27
|
+
}),
|
|
20
28
|
cx: 8,
|
|
21
29
|
cy: 8,
|
|
22
30
|
r: 8
|
|
23
31
|
}), /*#__PURE__*/React.createElement("path", {
|
|
24
32
|
d: "M12.875 12.767A6.891 6.891 0 018.02 14.75a6.889 6.889 0 01-4.895-2.026V11.9c0-1.049.873-1.9 1.95-1.9h5.85c1.077 0 1.95.851 1.95 1.9v.867zM8 3a2.874 2.874 0 10-.001 5.748 2.874 2.874 0 000-5.748",
|
|
25
|
-
fill:
|
|
33
|
+
fill: iconThemed({
|
|
34
|
+
light: '#85B8FF',
|
|
35
|
+
dark: '#388BFF'
|
|
36
|
+
})
|
|
26
37
|
}), /*#__PURE__*/React.createElement("rect", {
|
|
27
|
-
fill:
|
|
38
|
+
fill: iconThemed({
|
|
39
|
+
light: '#A4ACB9',
|
|
40
|
+
dark: '#A4ACB9'
|
|
41
|
+
}),
|
|
28
42
|
x: 19,
|
|
29
43
|
y: 3,
|
|
30
44
|
width: 12,
|
|
31
45
|
height: 1,
|
|
32
46
|
rx: 0.5
|
|
33
47
|
}), /*#__PURE__*/React.createElement("rect", {
|
|
34
|
-
fill:
|
|
48
|
+
fill: iconThemed({
|
|
49
|
+
light: '#A4ACB9',
|
|
50
|
+
dark: '#A4ACB9'
|
|
51
|
+
}),
|
|
35
52
|
x: 19,
|
|
36
53
|
y: 7,
|
|
37
54
|
width: 6,
|
|
38
55
|
height: 1,
|
|
39
56
|
rx: 0.5
|
|
40
57
|
}), /*#__PURE__*/React.createElement("rect", {
|
|
41
|
-
fill:
|
|
58
|
+
fill: iconThemed({
|
|
59
|
+
light: '#A4ACB9',
|
|
60
|
+
dark: '#A4ACB9'
|
|
61
|
+
}),
|
|
42
62
|
x: 19,
|
|
43
63
|
y: 11,
|
|
44
64
|
width: 8,
|
|
@@ -8,7 +8,7 @@ import { themed } from '@atlaskit/theme/components';
|
|
|
8
8
|
import { borderRadius } from '@atlaskit/theme/constants';
|
|
9
9
|
import Layer from '../Layer';
|
|
10
10
|
const packageName = "@atlaskit/editor-common";
|
|
11
|
-
const packageVersion = "74.51.
|
|
11
|
+
const packageVersion = "74.51.7";
|
|
12
12
|
const halfFocusRing = 1;
|
|
13
13
|
const dropOffset = '0, 8';
|
|
14
14
|
class DropList extends Component {
|
|
@@ -28,22 +28,24 @@ export var getGuidelineTypeFromKey = function getGuidelineTypeFromKey(keys, guid
|
|
|
28
28
|
return 'default';
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
//
|
|
32
|
-
|
|
33
|
-
return
|
|
34
|
-
return
|
|
31
|
+
// Check for temporary guidelines
|
|
32
|
+
if (keys.some(function (key) {
|
|
33
|
+
return ['media_'].some(function (temoporaryGuideline) {
|
|
34
|
+
return key.indexOf(temoporaryGuideline) >= 0;
|
|
35
35
|
});
|
|
36
|
-
})
|
|
37
|
-
|
|
38
|
-
return 'none';
|
|
36
|
+
})) {
|
|
37
|
+
return 'temporary';
|
|
39
38
|
}
|
|
40
39
|
|
|
41
|
-
// Check
|
|
42
|
-
if (
|
|
43
|
-
return
|
|
44
|
-
|
|
45
|
-
|
|
40
|
+
// Check for relative guidelines
|
|
41
|
+
if (keys.some(function (key) {
|
|
42
|
+
return ['relative_'].some(function (relativeGuideline) {
|
|
43
|
+
return key.indexOf(relativeGuideline) >= 0;
|
|
44
|
+
});
|
|
45
|
+
})) {
|
|
46
|
+
return 'relative';
|
|
46
47
|
}
|
|
48
|
+
return 'none';
|
|
47
49
|
};
|
|
48
50
|
|
|
49
51
|
/**
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { isListItemNode, isListNode } from '../utils';
|
|
2
2
|
import { getListItemAttributes } from './selection';
|
|
3
|
-
export var getCommonListAnalyticsAttributes = function getCommonListAnalyticsAttributes(
|
|
4
|
-
var
|
|
5
|
-
$from =
|
|
6
|
-
$to =
|
|
3
|
+
export var getCommonListAnalyticsAttributes = function getCommonListAnalyticsAttributes(tr) {
|
|
4
|
+
var _tr$selection = tr.selection,
|
|
5
|
+
$from = _tr$selection.$from,
|
|
6
|
+
$to = _tr$selection.$to;
|
|
7
7
|
var fromAttrs = getListItemAttributes($from);
|
|
8
8
|
var toAttrs = getListItemAttributes($to);
|
|
9
9
|
return {
|
|
@@ -11,18 +11,18 @@ export var getCommonListAnalyticsAttributes = function getCommonListAnalyticsAtt
|
|
|
11
11
|
itemIndexAtSelectionEnd: toAttrs.itemIndex,
|
|
12
12
|
indentLevelAtSelectionStart: fromAttrs.indentLevel,
|
|
13
13
|
indentLevelAtSelectionEnd: toAttrs.indentLevel,
|
|
14
|
-
itemsInSelection: countListItemsInSelection(
|
|
14
|
+
itemsInSelection: countListItemsInSelection(tr)
|
|
15
15
|
};
|
|
16
16
|
};
|
|
17
|
-
export var countListItemsInSelection = function countListItemsInSelection(
|
|
18
|
-
var
|
|
19
|
-
from =
|
|
20
|
-
to =
|
|
17
|
+
export var countListItemsInSelection = function countListItemsInSelection(tr) {
|
|
18
|
+
var _tr$selection2 = tr.selection,
|
|
19
|
+
from = _tr$selection2.from,
|
|
20
|
+
to = _tr$selection2.to;
|
|
21
21
|
if (from === to) {
|
|
22
22
|
return 1;
|
|
23
23
|
}
|
|
24
24
|
var count = 0;
|
|
25
|
-
var listSlice =
|
|
25
|
+
var listSlice = tr.doc.cut(from, to);
|
|
26
26
|
listSlice.content.nodesBetween(0, listSlice.content.size, function (node, pos, parent, index) {
|
|
27
27
|
if (parent && isListItemNode(parent) && !isListNode(node) && index === 0) {
|
|
28
28
|
count++;
|
|
@@ -6,7 +6,7 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
6
6
|
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; }
|
|
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 = "74.51.
|
|
9
|
+
var packageVersion = "74.51.7";
|
|
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
|
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
import _createClass from "@babel/runtime/helpers/createClass";
|
|
2
|
+
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
3
|
+
import _inherits from "@babel/runtime/helpers/inherits";
|
|
4
|
+
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
5
|
+
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
6
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
7
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
8
|
+
import { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
1
9
|
/**
|
|
2
10
|
* Convert a EditorCommand to a standard Prosemirror Command.
|
|
3
11
|
* The preferred approach to dispatching a `EditorCommand` is via the
|
|
@@ -14,10 +22,31 @@ export function editorCommandToPMCommand(command) {
|
|
|
14
22
|
var newTr = command === null || command === void 0 ? void 0 : command({
|
|
15
23
|
tr: tr
|
|
16
24
|
});
|
|
17
|
-
if (newTr) {
|
|
18
|
-
|
|
25
|
+
if (!newTr) {
|
|
26
|
+
return false;
|
|
27
|
+
}
|
|
28
|
+
if (newTr instanceof PassiveTransaction) {
|
|
19
29
|
return true;
|
|
20
30
|
}
|
|
21
|
-
|
|
31
|
+
dispatch === null || dispatch === void 0 ? void 0 : dispatch(newTr);
|
|
32
|
+
return true;
|
|
22
33
|
};
|
|
23
|
-
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* PassiveTransaction is used only to indicate that
|
|
38
|
+
* an `EditorCommand` should return `true` but should not dispatch.
|
|
39
|
+
*/
|
|
40
|
+
export var PassiveTransaction = /*#__PURE__*/function (_Transaction) {
|
|
41
|
+
_inherits(PassiveTransaction, _Transaction);
|
|
42
|
+
var _super = _createSuper(PassiveTransaction);
|
|
43
|
+
// This is very cheeky but this should never be used outside its intended
|
|
44
|
+
// purpose - it will likely crash the editor so we should get an early warning
|
|
45
|
+
// signal
|
|
46
|
+
function PassiveTransaction() {
|
|
47
|
+
_classCallCheck(this, PassiveTransaction);
|
|
48
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
49
|
+
return _super.call(this, {});
|
|
50
|
+
}
|
|
51
|
+
return _createClass(PassiveTransaction);
|
|
52
|
+
}(Transaction);
|
package/dist/esm/preset/index.js
CHANGED
|
@@ -1,81 +1,56 @@
|
|
|
1
|
-
// TODO: https://product-fabric.atlassian.net/browse/DSP-4138
|
|
2
|
-
/* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
|
|
3
1
|
import React from 'react';
|
|
2
|
+
import { useIconThemed } from '../use-icon-themed';
|
|
4
3
|
export default function IconImages() {
|
|
4
|
+
var _useIconThemed = useIconThemed(),
|
|
5
|
+
iconThemed = _useIconThemed.iconThemed;
|
|
5
6
|
return /*#__PURE__*/React.createElement("svg", {
|
|
6
7
|
focusable: "false",
|
|
7
8
|
"aria-hidden": true,
|
|
8
9
|
width: 40,
|
|
9
10
|
height: 40
|
|
10
|
-
}, /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement("
|
|
11
|
-
x1: "46.315%",
|
|
12
|
-
y1: "-31.529%",
|
|
13
|
-
x2: "50%",
|
|
14
|
-
y2: "100%",
|
|
15
|
-
id: "images-a"
|
|
16
|
-
}, /*#__PURE__*/React.createElement("stop", {
|
|
17
|
-
stopColor: "#FFD500",
|
|
18
|
-
offset: "0%"
|
|
19
|
-
}), /*#__PURE__*/React.createElement("stop", {
|
|
20
|
-
stopColor: "#FFAB00",
|
|
21
|
-
offset: "100%"
|
|
22
|
-
})), /*#__PURE__*/React.createElement("linearGradient", {
|
|
23
|
-
x1: "100.699%",
|
|
24
|
-
y1: "50%",
|
|
25
|
-
x2: "-14.52%",
|
|
26
|
-
y2: "50%",
|
|
27
|
-
id: "images-b"
|
|
28
|
-
}, /*#__PURE__*/React.createElement("stop", {
|
|
29
|
-
stopColor: "#FAFBFC",
|
|
30
|
-
offset: "0%"
|
|
31
|
-
}), /*#__PURE__*/React.createElement("stop", {
|
|
32
|
-
stopColor: "#F4F6F8",
|
|
33
|
-
stopOpacity: 0.859,
|
|
34
|
-
offset: "12.52%"
|
|
35
|
-
}), /*#__PURE__*/React.createElement("stop", {
|
|
36
|
-
stopColor: "#E3E6EA",
|
|
37
|
-
stopOpacity: 0.402,
|
|
38
|
-
offset: "54.65%"
|
|
39
|
-
}), /*#__PURE__*/React.createElement("stop", {
|
|
40
|
-
stopColor: "#D7DCE1",
|
|
41
|
-
stopOpacity: 0.113,
|
|
42
|
-
offset: "83.66%"
|
|
43
|
-
}), /*#__PURE__*/React.createElement("stop", {
|
|
44
|
-
stopColor: "#D3D8DE",
|
|
45
|
-
stopOpacity: 0,
|
|
46
|
-
offset: "97.03%"
|
|
47
|
-
}))), /*#__PURE__*/React.createElement("g", {
|
|
11
|
+
}, /*#__PURE__*/React.createElement("defs", null), /*#__PURE__*/React.createElement("g", {
|
|
48
12
|
fill: "none",
|
|
49
13
|
fillRule: "evenodd"
|
|
50
14
|
}, /*#__PURE__*/React.createElement("path", {
|
|
51
|
-
fill:
|
|
15
|
+
fill: iconThemed({
|
|
16
|
+
light: '#FFF',
|
|
17
|
+
dark: '#161A1D'
|
|
18
|
+
}),
|
|
52
19
|
d: "M0 0h40v40H0z"
|
|
53
20
|
}), /*#__PURE__*/React.createElement("g", {
|
|
54
21
|
transform: "translate(4 9)",
|
|
55
22
|
fillRule: "nonzero"
|
|
56
23
|
}, /*#__PURE__*/React.createElement("rect", {
|
|
57
|
-
fill:
|
|
24
|
+
fill: iconThemed({
|
|
25
|
+
light: '#EBB800',
|
|
26
|
+
dark: '#09326C'
|
|
27
|
+
}),
|
|
58
28
|
width: 32,
|
|
59
29
|
height: 24,
|
|
60
30
|
rx: 1
|
|
61
31
|
}), /*#__PURE__*/React.createElement("path", {
|
|
62
|
-
fill:
|
|
32
|
+
fill: iconThemed({
|
|
33
|
+
light: '#F7F8F9',
|
|
34
|
+
dark: '#161A1D'
|
|
35
|
+
}),
|
|
63
36
|
d: "M4 4h24v16H4z"
|
|
64
37
|
}), /*#__PURE__*/React.createElement("path", {
|
|
65
|
-
fill:
|
|
38
|
+
fill: iconThemed({
|
|
39
|
+
light: '#09326C',
|
|
40
|
+
dark: '#09326C'
|
|
41
|
+
}),
|
|
66
42
|
d: "M6.351 18.062l5.594-6.017 5.594 6.017z"
|
|
67
43
|
}), /*#__PURE__*/React.createElement("path", {
|
|
68
|
-
fill:
|
|
44
|
+
fill: iconThemed({
|
|
45
|
+
light: '#0065FF',
|
|
46
|
+
dark: '#0055CC'
|
|
47
|
+
}),
|
|
69
48
|
d: "M9.341 18.062l8.198-8.818 8.198 8.818z"
|
|
70
|
-
}), /*#__PURE__*/React.createElement("path", {
|
|
71
|
-
d: "M20.484 14.353c-2.618-1.255-5.104-.564-8.519-1.373C9.625 12.426 6.719 11.135 4 8v11.913h20.294c-.321-2.073-1.26-4.337-3.81-5.56z",
|
|
72
|
-
fill: "url(#images-b)",
|
|
73
|
-
opacity: 0.37,
|
|
74
|
-
style: {
|
|
75
|
-
mixBlendMode: 'screen'
|
|
76
|
-
}
|
|
77
49
|
}), /*#__PURE__*/React.createElement("ellipse", {
|
|
78
|
-
fill:
|
|
50
|
+
fill: iconThemed({
|
|
51
|
+
light: '#F88A0D',
|
|
52
|
+
dark: '#B85C00'
|
|
53
|
+
}),
|
|
79
54
|
cx: 9,
|
|
80
55
|
cy: 9.028,
|
|
81
56
|
rx: 2,
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
// TODO: https://product-fabric.atlassian.net/browse/DSP-4138
|
|
2
|
-
/* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
|
|
3
1
|
import React from 'react';
|
|
2
|
+
import { useIconThemed } from '../use-icon-themed';
|
|
4
3
|
export default function IconMention() {
|
|
4
|
+
var _useIconThemed = useIconThemed(),
|
|
5
|
+
iconThemed = _useIconThemed.iconThemed;
|
|
5
6
|
return /*#__PURE__*/React.createElement("svg", {
|
|
6
7
|
focusable: "false",
|
|
7
8
|
"aria-hidden": true,
|
|
@@ -11,34 +12,52 @@ export default function IconMention() {
|
|
|
11
12
|
fill: "none",
|
|
12
13
|
fillRule: "evenodd"
|
|
13
14
|
}, /*#__PURE__*/React.createElement("path", {
|
|
14
|
-
fill:
|
|
15
|
+
fill: iconThemed({
|
|
16
|
+
light: '#FFF',
|
|
17
|
+
dark: '#161A1D'
|
|
18
|
+
}),
|
|
15
19
|
d: "M0 0h40v40H0z"
|
|
16
20
|
}), /*#__PURE__*/React.createElement("g", {
|
|
17
21
|
transform: "translate(6 12)"
|
|
18
22
|
}, /*#__PURE__*/React.createElement("circle", {
|
|
19
|
-
fill:
|
|
23
|
+
fill: iconThemed({
|
|
24
|
+
light: '#388BFF',
|
|
25
|
+
dark: '#0055CC'
|
|
26
|
+
}),
|
|
20
27
|
cx: 8,
|
|
21
28
|
cy: 8,
|
|
22
29
|
r: 8
|
|
23
30
|
}), /*#__PURE__*/React.createElement("path", {
|
|
24
31
|
d: "M12.875 12.767A6.891 6.891 0 018.02 14.75a6.889 6.889 0 01-4.895-2.026V11.9c0-1.049.873-1.9 1.95-1.9h5.85c1.077 0 1.95.851 1.95 1.9v.867zM8 3a2.874 2.874 0 10-.001 5.748 2.874 2.874 0 000-5.748",
|
|
25
|
-
fill:
|
|
32
|
+
fill: iconThemed({
|
|
33
|
+
light: '#85B8FF',
|
|
34
|
+
dark: '#388BFF'
|
|
35
|
+
})
|
|
26
36
|
}), /*#__PURE__*/React.createElement("rect", {
|
|
27
|
-
fill:
|
|
37
|
+
fill: iconThemed({
|
|
38
|
+
light: '#A4ACB9',
|
|
39
|
+
dark: '#A4ACB9'
|
|
40
|
+
}),
|
|
28
41
|
x: 19,
|
|
29
42
|
y: 3,
|
|
30
43
|
width: 12,
|
|
31
44
|
height: 1,
|
|
32
45
|
rx: 0.5
|
|
33
46
|
}), /*#__PURE__*/React.createElement("rect", {
|
|
34
|
-
fill:
|
|
47
|
+
fill: iconThemed({
|
|
48
|
+
light: '#A4ACB9',
|
|
49
|
+
dark: '#A4ACB9'
|
|
50
|
+
}),
|
|
35
51
|
x: 19,
|
|
36
52
|
y: 7,
|
|
37
53
|
width: 6,
|
|
38
54
|
height: 1,
|
|
39
55
|
rx: 0.5
|
|
40
56
|
}), /*#__PURE__*/React.createElement("rect", {
|
|
41
|
-
fill:
|
|
57
|
+
fill: iconThemed({
|
|
58
|
+
light: '#A4ACB9',
|
|
59
|
+
dark: '#A4ACB9'
|
|
60
|
+
}),
|
|
42
61
|
x: 19,
|
|
43
62
|
y: 11,
|
|
44
63
|
width: 8,
|
|
@@ -18,7 +18,7 @@ import { themed } from '@atlaskit/theme/components';
|
|
|
18
18
|
import { borderRadius } from '@atlaskit/theme/constants';
|
|
19
19
|
import Layer from '../Layer';
|
|
20
20
|
var packageName = "@atlaskit/editor-common";
|
|
21
|
-
var packageVersion = "74.51.
|
|
21
|
+
var packageVersion = "74.51.7";
|
|
22
22
|
var halfFocusRing = 1;
|
|
23
23
|
var dropOffset = '0, 8';
|
|
24
24
|
var DropList = /*#__PURE__*/function (_Component) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import { CommonListAnalyticsAttributes } from '../analytics';
|
|
3
|
-
export declare const getCommonListAnalyticsAttributes: (
|
|
4
|
-
export declare const countListItemsInSelection: (
|
|
1
|
+
import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
+
import type { CommonListAnalyticsAttributes } from '../analytics';
|
|
3
|
+
export declare const getCommonListAnalyticsAttributes: (tr: Transaction) => CommonListAnalyticsAttributes;
|
|
4
|
+
export declare const countListItemsInSelection: (tr: Transaction) => number;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
1
2
|
import type { Command } from '../types/command';
|
|
2
3
|
import type { EditorCommand } from '../types/editor-command';
|
|
3
4
|
/**
|
|
@@ -11,3 +12,10 @@ import type { EditorCommand } from '../types/editor-command';
|
|
|
11
12
|
* @returns Command
|
|
12
13
|
*/
|
|
13
14
|
export declare function editorCommandToPMCommand(command: EditorCommand | undefined): Command;
|
|
15
|
+
/**
|
|
16
|
+
* PassiveTransaction is used only to indicate that
|
|
17
|
+
* an `EditorCommand` should return `true` but should not dispatch.
|
|
18
|
+
*/
|
|
19
|
+
export declare class PassiveTransaction extends Transaction {
|
|
20
|
+
constructor();
|
|
21
|
+
}
|
|
@@ -2,4 +2,4 @@ import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
|
2
2
|
export type EditorCommand = (props: {
|
|
3
3
|
tr: Transaction;
|
|
4
4
|
}) => Transaction | null;
|
|
5
|
-
export type EditorCommandWithMetadata = (args: any) => EditorCommand;
|
|
5
|
+
export type EditorCommandWithMetadata = (...args: any) => EditorCommand;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import { CommonListAnalyticsAttributes } from '../analytics';
|
|
3
|
-
export declare const getCommonListAnalyticsAttributes: (
|
|
4
|
-
export declare const countListItemsInSelection: (
|
|
1
|
+
import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
+
import type { CommonListAnalyticsAttributes } from '../analytics';
|
|
3
|
+
export declare const getCommonListAnalyticsAttributes: (tr: Transaction) => CommonListAnalyticsAttributes;
|
|
4
|
+
export declare const countListItemsInSelection: (tr: Transaction) => number;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
1
2
|
import type { Command } from '../types/command';
|
|
2
3
|
import type { EditorCommand } from '../types/editor-command';
|
|
3
4
|
/**
|
|
@@ -11,3 +12,10 @@ import type { EditorCommand } from '../types/editor-command';
|
|
|
11
12
|
* @returns Command
|
|
12
13
|
*/
|
|
13
14
|
export declare function editorCommandToPMCommand(command: EditorCommand | undefined): Command;
|
|
15
|
+
/**
|
|
16
|
+
* PassiveTransaction is used only to indicate that
|
|
17
|
+
* an `EditorCommand` should return `true` but should not dispatch.
|
|
18
|
+
*/
|
|
19
|
+
export declare class PassiveTransaction extends Transaction {
|
|
20
|
+
constructor();
|
|
21
|
+
}
|
|
@@ -2,4 +2,4 @@ import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
|
2
2
|
export type EditorCommand = (props: {
|
|
3
3
|
tr: Transaction;
|
|
4
4
|
}) => Transaction | null;
|
|
5
|
-
export type EditorCommandWithMetadata = (args: any) => EditorCommand;
|
|
5
|
+
export type EditorCommandWithMetadata = (...args: any) => EditorCommand;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-common",
|
|
3
|
-
"version": "74.51.
|
|
3
|
+
"version": "74.51.7",
|
|
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/"
|
|
@@ -146,7 +146,7 @@
|
|
|
146
146
|
"@atlaskit/editor-test-helpers": "^18.11.0",
|
|
147
147
|
"@atlaskit/media-core": "^34.1.0",
|
|
148
148
|
"@atlaskit/media-test-helpers": "^33.0.0",
|
|
149
|
-
"@atlaskit/smart-card": "^26.
|
|
149
|
+
"@atlaskit/smart-card": "^26.16.0",
|
|
150
150
|
"@atlaskit/util-data-test": "^17.8.0",
|
|
151
151
|
"@atlaskit/visual-regression": "*",
|
|
152
152
|
"@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
|