@atlaskit/editor-common 102.2.1 → 102.3.0
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 +16 -0
- package/dist/cjs/analytics/types/enums.js +1 -0
- package/dist/cjs/extensions/module-helpers.js +31 -14
- package/dist/cjs/keymaps/index.js +3 -2
- package/dist/cjs/monitoring/error.js +1 -1
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/cjs/ui/Mention/index.js +13 -1
- package/dist/cjs/ui/Mention/mention-with-providers.js +105 -2
- package/dist/es2019/analytics/types/enums.js +1 -0
- package/dist/es2019/extensions/module-helpers.js +24 -5
- package/dist/es2019/keymaps/index.js +1 -0
- package/dist/es2019/monitoring/error.js +1 -1
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/es2019/ui/Mention/index.js +14 -2
- package/dist/es2019/ui/Mention/mention-with-providers.js +83 -2
- package/dist/esm/analytics/types/enums.js +1 -0
- package/dist/esm/extensions/module-helpers.js +31 -14
- package/dist/esm/keymaps/index.js +1 -0
- package/dist/esm/monitoring/error.js +1 -1
- package/dist/esm/ui/DropList/index.js +1 -1
- package/dist/esm/ui/Mention/index.js +14 -2
- package/dist/esm/ui/Mention/mention-with-providers.js +105 -2
- package/dist/types/analytics/types/enums.d.ts +1 -0
- package/dist/types/analytics/types/selection-events.d.ts +5 -1
- package/dist/types/extensions/module-helpers.d.ts +2 -2
- package/dist/types/extensions/types/extension-manifest-toolbar-item.d.ts +3 -1
- package/dist/types/extensions/types/extension-manifest.d.ts +1 -1
- package/dist/types/keymaps/index.d.ts +1 -0
- package/dist/types/types/floating-toolbar.d.ts +2 -1
- package/dist/types/types/index.d.ts +1 -1
- package/dist/types/ui/Mention/mention-with-providers.d.ts +8 -1
- package/dist/types/ui-menu/ColorPickerButton/index.d.ts +1 -1
- package/dist/types-ts4.5/analytics/types/enums.d.ts +1 -0
- package/dist/types-ts4.5/analytics/types/selection-events.d.ts +5 -1
- package/dist/types-ts4.5/extensions/module-helpers.d.ts +2 -2
- package/dist/types-ts4.5/extensions/types/extension-manifest-toolbar-item.d.ts +3 -1
- package/dist/types-ts4.5/extensions/types/extension-manifest.d.ts +1 -1
- package/dist/types-ts4.5/keymaps/index.d.ts +1 -0
- package/dist/types-ts4.5/types/floating-toolbar.d.ts +2 -1
- package/dist/types-ts4.5/types/index.d.ts +1 -1
- package/dist/types-ts4.5/ui/Mention/mention-with-providers.d.ts +8 -1
- package/dist/types-ts4.5/ui-menu/ColorPickerButton/index.d.ts +1 -1
- package/package.json +8 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @atlaskit/editor-common
|
|
2
2
|
|
|
3
|
+
## 102.3.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#122181](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/122181)
|
|
8
|
+
[`cf759849b38dc`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/cf759849b38dc) -
|
|
9
|
+
[ux] Added dropdown menu in floating toolbar for autoconverted extensions
|
|
10
|
+
- [#124688](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/124688)
|
|
11
|
+
[`9b1137bda6f87`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/9b1137bda6f87) -
|
|
12
|
+
[ux] ED-25486 Updates cmd+a behaviour to progressively select nodes behind
|
|
13
|
+
platform_editor_cmd_a_progressively_select_nodes experiment.
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- Updated dependencies
|
|
18
|
+
|
|
3
19
|
## 102.2.1
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
|
@@ -100,6 +100,7 @@ var ACTION = exports.ACTION = /*#__PURE__*/function (ACTION) {
|
|
|
100
100
|
ACTION["RESOLVED"] = "resolved";
|
|
101
101
|
ACTION["REQUEST_TO_EDIT"] = "requestToEdit";
|
|
102
102
|
ACTION["SELECTED"] = "selected";
|
|
103
|
+
ACTION["SELECT_ALL"] = "selectAll";
|
|
103
104
|
ACTION["SHOWN"] = "shown";
|
|
104
105
|
ACTION["SLOW_INPUT"] = "slowInput";
|
|
105
106
|
ACTION["STARTED"] = "started";
|
|
@@ -14,6 +14,7 @@ var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"))
|
|
|
14
14
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
15
15
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
16
16
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
17
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
17
18
|
var _manifestHelpers = require("./manifest-helpers");
|
|
18
19
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
19
20
|
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) { (0, _defineProperty2.default)(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; }
|
|
@@ -164,21 +165,21 @@ var logError = function logError(msg) {
|
|
|
164
165
|
// eslint-disable-next-line no-console
|
|
165
166
|
(_console = console).error.apply(_console, [msg].concat(args));
|
|
166
167
|
};
|
|
167
|
-
var toolbarItemToButtonConfig = function toolbarItemToButtonConfig(
|
|
168
|
-
var tooltip =
|
|
169
|
-
tooltipStyle =
|
|
170
|
-
key =
|
|
171
|
-
label =
|
|
172
|
-
ariaLabel =
|
|
173
|
-
icon =
|
|
174
|
-
action =
|
|
175
|
-
disabled =
|
|
168
|
+
var toolbarItemToButtonConfig = function toolbarItemToButtonConfig(toolbarButton, parentKey) {
|
|
169
|
+
var tooltip = toolbarButton.tooltip,
|
|
170
|
+
tooltipStyle = toolbarButton.tooltipStyle,
|
|
171
|
+
key = toolbarButton.key,
|
|
172
|
+
label = toolbarButton.label,
|
|
173
|
+
ariaLabel = toolbarButton.ariaLabel,
|
|
174
|
+
icon = toolbarButton.icon,
|
|
175
|
+
action = toolbarButton.action,
|
|
176
|
+
disabled = toolbarButton.disabled;
|
|
176
177
|
var itemKey = [parentKey, key].join(':');
|
|
177
178
|
if (typeof action !== 'function') {
|
|
178
179
|
logError("Provided action is not a function for extension toolbar button: ".concat(label, " (").concat(itemKey, ")"));
|
|
179
180
|
}
|
|
180
181
|
var labelAndIcon = {};
|
|
181
|
-
switch (
|
|
182
|
+
switch (toolbarButton.display) {
|
|
182
183
|
case 'icon':
|
|
183
184
|
if (!icon) {
|
|
184
185
|
logError("icon should be provided for extension toolbar button (".concat(itemKey, "), when display is set to 'icon'"));
|
|
@@ -254,9 +255,16 @@ var getContextualToolbarItemsFromModule = exports.getContextualToolbarItemsFromM
|
|
|
254
255
|
return toolbarItems;
|
|
255
256
|
}
|
|
256
257
|
return [];
|
|
257
|
-
}).flatMap(function (
|
|
258
|
-
return
|
|
259
|
-
|
|
258
|
+
}).flatMap(function (toolbarItems) {
|
|
259
|
+
return toolbarItems.map(function (toolbarItem) {
|
|
260
|
+
if ((0, _platformFeatureFlags.fg)('forge_macro_autoconvert')) {
|
|
261
|
+
if (isToolbarButton(toolbarItem)) {
|
|
262
|
+
return toolbarItemToButtonConfig(toolbarItem, extension.key);
|
|
263
|
+
}
|
|
264
|
+
return toolbarItem;
|
|
265
|
+
} else {
|
|
266
|
+
return toolbarItemToButtonConfig(toolbarItem, extension.key);
|
|
267
|
+
}
|
|
260
268
|
});
|
|
261
269
|
});
|
|
262
270
|
}
|
|
@@ -265,6 +273,12 @@ var getContextualToolbarItemsFromModule = exports.getContextualToolbarItemsFromM
|
|
|
265
273
|
return extensionToolbarButtons;
|
|
266
274
|
});
|
|
267
275
|
};
|
|
276
|
+
var isToolbarButton = function isToolbarButton(toolbarItem) {
|
|
277
|
+
if ('type' in toolbarItem) {
|
|
278
|
+
return false;
|
|
279
|
+
}
|
|
280
|
+
return true;
|
|
281
|
+
};
|
|
268
282
|
|
|
269
283
|
// defines whether to add toolbar item for the given node
|
|
270
284
|
function shouldAddExtensionItemForNode(item, node) {
|
|
@@ -280,11 +294,14 @@ function shouldAddExtensionItemForNode(item, node) {
|
|
|
280
294
|
|
|
281
295
|
// in cases where we need custom exclusion depending on the node
|
|
282
296
|
if (item.context.shouldExclude) {
|
|
283
|
-
|
|
297
|
+
if (item.context.shouldExclude(node)) {
|
|
298
|
+
return false;
|
|
299
|
+
}
|
|
284
300
|
}
|
|
285
301
|
var _item$context = item.context,
|
|
286
302
|
extensionType = _item$context.extensionType,
|
|
287
303
|
extensionKey = _item$context.extensionKey;
|
|
304
|
+
|
|
288
305
|
// if extension type is given - should match extension type
|
|
289
306
|
if (extensionType && extensionType !== ((_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.extensionType)) {
|
|
290
307
|
return false;
|
|
@@ -102,8 +102,8 @@ Object.defineProperty(exports, "keymap", {
|
|
|
102
102
|
exports.makeKeyMapArrayWithCommon = makeKeyMapArrayWithCommon;
|
|
103
103
|
exports.makeKeyMapWithCommon = makeKeyMapWithCommon;
|
|
104
104
|
exports.makeKeymap = makeKeymap;
|
|
105
|
-
exports.
|
|
106
|
-
exports.toggleUnderline = exports.toggleTaskItemCheckbox = exports.toggleTable = exports.toggleSuperscript = exports.toggleSubscript = exports.toggleStrikethrough = exports.toggleOrderedList = exports.toggleItalic = exports.toggleHighlightPalette = exports.toggleHeading6 = exports.toggleHeading5 = exports.toggleHeading4 = exports.toggleHeading3 = exports.toggleHeading2 = exports.toggleHeading1 = exports.toggleCode = exports.toggleBulletList = exports.toggleBold = exports.toggleBlockQuote = exports.tab = exports.submit = void 0;
|
|
105
|
+
exports.splitListItem = exports.splitCodeBlock = exports.space = exports.showElementDragHandle = exports.shiftTab = exports.shiftEnter = exports.shiftBackspace = exports.shiftArrowUp = exports.setNormalText = exports.selectTable = exports.selectRow = exports.selectNode = exports.selectColumn = exports.redo = exports.previousCell = exports.pastePlainText = exports.paste = exports.outdentList = exports.outdent = exports.openHelp = exports.nextCell = exports.navToFloatingToolbar = exports.navToEditorToolbar = exports.moveUp = exports.moveRowUp = exports.moveRowDown = exports.moveRight = exports.moveLeft = exports.moveDown = exports.moveColumnRight = exports.moveColumnLeft = void 0;
|
|
106
|
+
exports.toggleUnderline = exports.toggleTaskItemCheckbox = exports.toggleTable = exports.toggleSuperscript = exports.toggleSubscript = exports.toggleStrikethrough = exports.toggleOrderedList = exports.toggleItalic = exports.toggleHighlightPalette = exports.toggleHeading6 = exports.toggleHeading5 = exports.toggleHeading4 = exports.toggleHeading3 = exports.toggleHeading2 = exports.toggleHeading1 = exports.toggleCode = exports.toggleBulletList = exports.toggleBold = exports.toggleBlockQuote = exports.tab = exports.submit = exports.startColumnResizing = void 0;
|
|
107
107
|
exports.tooltip = tooltip;
|
|
108
108
|
exports.undo = void 0;
|
|
109
109
|
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
@@ -207,6 +207,7 @@ var toggleTaskItemCheckbox = exports.toggleTaskItemCheckbox = makeKeyMapWithComm
|
|
|
207
207
|
var selectRow = exports.selectRow = makeKeyMapArrayWithCommon('Select row', ['Mod-Alt-Shift-ArrowLeft', 'Mod-Alt-Shift-ArrowRight']);
|
|
208
208
|
var selectColumn = exports.selectColumn = makeKeyMapArrayWithCommon('Select column', ['Mod-Alt-Shift-ArrowDown', 'Mod-Alt-Shift-ArrowUp']);
|
|
209
209
|
var selectTable = exports.selectTable = makeKeyMapWithCommon('Select table', 'Mod-a');
|
|
210
|
+
var selectNode = exports.selectNode = makeKeyMapWithCommon('Select node', 'Mod-a');
|
|
210
211
|
var increaseMediaSize = exports.increaseMediaSize = makeKeyMapWithCommon('increase image size', 'Mod-Alt-]');
|
|
211
212
|
var decreaseMediaSize = exports.decreaseMediaSize = makeKeyMapWithCommon('increase image size', 'Mod-Alt-[');
|
|
212
213
|
var activateVideoControls = exports.activateVideoControls = makeKeyMapWithCommon('Activate controls panel on video', 'Shift-F10');
|
|
@@ -17,7 +17,7 @@ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return
|
|
|
17
17
|
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 && {}.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; }
|
|
18
18
|
var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
19
19
|
var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
20
|
-
var packageVersion = "102.
|
|
20
|
+
var packageVersion = "102.3.0";
|
|
21
21
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
22
22
|
// Remove URL as it has UGC
|
|
23
23
|
// Ignored via go/ees007
|
|
@@ -23,7 +23,7 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
|
|
|
23
23
|
* @jsx jsx
|
|
24
24
|
*/ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
25
25
|
var packageName = "@atlaskit/editor-common";
|
|
26
|
-
var packageVersion = "102.
|
|
26
|
+
var packageVersion = "102.3.0";
|
|
27
27
|
var halfFocusRing = 1;
|
|
28
28
|
var dropOffset = '0, 8';
|
|
29
29
|
// Ignored via go/ees005
|
|
@@ -13,6 +13,7 @@ var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/ge
|
|
|
13
13
|
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
14
14
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
15
15
|
var _react = _interopRequireWildcard(require("react"));
|
|
16
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
16
17
|
var _providerFactory = require("../../provider-factory");
|
|
17
18
|
var _mentionWithProviders = require("./mention-with-providers");
|
|
18
19
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
@@ -33,7 +34,18 @@ var Mention = exports.default = /*#__PURE__*/function (_PureComponent) {
|
|
|
33
34
|
localId = _this$props.localId;
|
|
34
35
|
var mentionProvider = providers.mentionProvider,
|
|
35
36
|
profilecardProvider = providers.profilecardProvider;
|
|
36
|
-
|
|
37
|
+
if ((0, _platformFeatureFlags.fg)('platform_editor_react18_mention_with_provider_fix')) {
|
|
38
|
+
return /*#__PURE__*/_react.default.createElement(_mentionWithProviders.MentionWithProviders, {
|
|
39
|
+
id: id,
|
|
40
|
+
text: text,
|
|
41
|
+
accessLevel: accessLevel,
|
|
42
|
+
localId: localId,
|
|
43
|
+
eventHandlers: eventHandlers,
|
|
44
|
+
mentionProvider: mentionProvider,
|
|
45
|
+
profilecardProvider: profilecardProvider
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
return /*#__PURE__*/_react.default.createElement(_mentionWithProviders.MentionWithProvidersOld, {
|
|
37
49
|
id: id,
|
|
38
50
|
text: text,
|
|
39
51
|
accessLevel: accessLevel,
|
|
@@ -5,14 +5,24 @@ var _typeof = require("@babel/runtime/helpers/typeof");
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.MentionWithProviders = void 0;
|
|
8
|
+
exports.MentionWithProvidersOld = exports.MentionWithProviders = void 0;
|
|
9
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
11
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
12
|
+
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
13
|
+
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
14
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
15
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
16
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
10
17
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
18
|
var _element = require("@atlaskit/mention/element");
|
|
12
19
|
var _mentionWithProfilecard = _interopRequireDefault(require("./mention-with-profilecard"));
|
|
13
20
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
14
21
|
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 && {}.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; }
|
|
22
|
+
function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
|
|
23
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
15
24
|
var GENERIC_USER_IDS = ['HipChat', 'all', 'here'];
|
|
25
|
+
var noop = function noop() {};
|
|
16
26
|
var MentionWithProviders = exports.MentionWithProviders = function MentionWithProviders(_ref) {
|
|
17
27
|
var accessLevel = _ref.accessLevel,
|
|
18
28
|
eventHandlers = _ref.eventHandlers,
|
|
@@ -62,4 +72,97 @@ var MentionWithProviders = exports.MentionWithProviders = function MentionWithPr
|
|
|
62
72
|
onMouseEnter: eventHandlers === null || eventHandlers === void 0 ? void 0 : eventHandlers.onMouseEnter,
|
|
63
73
|
onMouseLeave: eventHandlers === null || eventHandlers === void 0 ? void 0 : eventHandlers.onMouseLeave
|
|
64
74
|
});
|
|
65
|
-
};
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
// eslint-disable-next-line @repo/internal/react/no-class-components
|
|
78
|
+
var MentionWithProvidersOld = exports.MentionWithProvidersOld = /*#__PURE__*/function (_PureComponent) {
|
|
79
|
+
function MentionWithProvidersOld() {
|
|
80
|
+
var _this;
|
|
81
|
+
(0, _classCallCheck2.default)(this, MentionWithProvidersOld);
|
|
82
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
83
|
+
args[_key] = arguments[_key];
|
|
84
|
+
}
|
|
85
|
+
_this = _callSuper(this, MentionWithProvidersOld, [].concat(args));
|
|
86
|
+
(0, _defineProperty2.default)(_this, "state", {
|
|
87
|
+
profilecardProvider: null
|
|
88
|
+
});
|
|
89
|
+
return _this;
|
|
90
|
+
}
|
|
91
|
+
(0, _inherits2.default)(MentionWithProvidersOld, _PureComponent);
|
|
92
|
+
return (0, _createClass2.default)(MentionWithProvidersOld, [{
|
|
93
|
+
key: "UNSAFE_componentWillMount",
|
|
94
|
+
value:
|
|
95
|
+
// Ignored via go/ees005
|
|
96
|
+
// eslint-disable-next-line react/no-unsafe
|
|
97
|
+
function UNSAFE_componentWillMount() {
|
|
98
|
+
this.updateProfilecardProvider(this.props);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
// Ignored via go/ees005
|
|
102
|
+
// eslint-disable-next-line react/no-unsafe
|
|
103
|
+
}, {
|
|
104
|
+
key: "UNSAFE_componentWillReceiveProps",
|
|
105
|
+
value: function UNSAFE_componentWillReceiveProps(nextProps) {
|
|
106
|
+
if (nextProps.profilecardProvider !== this.props.profilecardProvider) {
|
|
107
|
+
this.updateProfilecardProvider(nextProps);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}, {
|
|
111
|
+
key: "updateProfilecardProvider",
|
|
112
|
+
value: function updateProfilecardProvider(props) {
|
|
113
|
+
var _this2 = this;
|
|
114
|
+
// We are not using async/await here to avoid having an intermediate Promise
|
|
115
|
+
// introduced by the transpiler.
|
|
116
|
+
// This will allow consumer to use a SynchronousPromise.resolve and avoid useless
|
|
117
|
+
// rerendering
|
|
118
|
+
if (props.profilecardProvider) {
|
|
119
|
+
props.profilecardProvider.then(function (profilecardProvider) {
|
|
120
|
+
_this2.setState({
|
|
121
|
+
profilecardProvider: profilecardProvider
|
|
122
|
+
});
|
|
123
|
+
}).catch(function () {
|
|
124
|
+
_this2.setState({
|
|
125
|
+
profilecardProvider: null
|
|
126
|
+
});
|
|
127
|
+
});
|
|
128
|
+
} else {
|
|
129
|
+
this.setState({
|
|
130
|
+
profilecardProvider: null
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}, {
|
|
135
|
+
key: "render",
|
|
136
|
+
value: function render() {
|
|
137
|
+
var _this$props = this.props,
|
|
138
|
+
accessLevel = _this$props.accessLevel,
|
|
139
|
+
eventHandlers = _this$props.eventHandlers,
|
|
140
|
+
id = _this$props.id,
|
|
141
|
+
mentionProvider = _this$props.mentionProvider,
|
|
142
|
+
text = _this$props.text,
|
|
143
|
+
localId = _this$props.localId;
|
|
144
|
+
var profilecardProvider = this.state.profilecardProvider;
|
|
145
|
+
|
|
146
|
+
// Ignored via go/ees005
|
|
147
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
148
|
+
var actionHandlers = {};
|
|
149
|
+
['onClick', 'onMouseEnter', 'onMouseLeave'].forEach(function (handler) {
|
|
150
|
+
actionHandlers[handler] = eventHandlers && eventHandlers[handler] || noop;
|
|
151
|
+
});
|
|
152
|
+
var MentionComponent = profilecardProvider && GENERIC_USER_IDS.indexOf(id) === -1 ? _mentionWithProfilecard.default : _element.ResourcedMention;
|
|
153
|
+
return /*#__PURE__*/_react.default.createElement(MentionComponent, (0, _extends2.default)({
|
|
154
|
+
id: id,
|
|
155
|
+
text: text,
|
|
156
|
+
accessLevel: accessLevel,
|
|
157
|
+
localId: localId,
|
|
158
|
+
mentionProvider: mentionProvider
|
|
159
|
+
// Ignored via go/ees005
|
|
160
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
161
|
+
,
|
|
162
|
+
profilecardProvider: profilecardProvider
|
|
163
|
+
// Ignored via go/ees005
|
|
164
|
+
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
165
|
+
}, actionHandlers));
|
|
166
|
+
}
|
|
167
|
+
}]);
|
|
168
|
+
}(_react.PureComponent);
|
|
@@ -94,6 +94,7 @@ export let ACTION = /*#__PURE__*/function (ACTION) {
|
|
|
94
94
|
ACTION["RESOLVED"] = "resolved";
|
|
95
95
|
ACTION["REQUEST_TO_EDIT"] = "requestToEdit";
|
|
96
96
|
ACTION["SELECTED"] = "selected";
|
|
97
|
+
ACTION["SELECT_ALL"] = "selectAll";
|
|
97
98
|
ACTION["SHOWN"] = "shown";
|
|
98
99
|
ACTION["SLOW_INPUT"] = "slowInput";
|
|
99
100
|
ACTION["STARTED"] = "started";
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
1
2
|
import { buildAction } from './manifest-helpers';
|
|
2
3
|
export const groupBy = (arr, attr, keyRenamer) =>
|
|
3
4
|
// Ignored via go/ees005
|
|
@@ -68,7 +69,7 @@ const logError = (msg, ...args) => {
|
|
|
68
69
|
// eslint-disable-next-line no-console
|
|
69
70
|
console.error(msg, ...args);
|
|
70
71
|
};
|
|
71
|
-
const toolbarItemToButtonConfig = (
|
|
72
|
+
const toolbarItemToButtonConfig = (toolbarButton, parentKey) => {
|
|
72
73
|
const {
|
|
73
74
|
tooltip,
|
|
74
75
|
tooltipStyle,
|
|
@@ -78,13 +79,13 @@ const toolbarItemToButtonConfig = (toolbarItem, parentKey) => {
|
|
|
78
79
|
icon,
|
|
79
80
|
action,
|
|
80
81
|
disabled
|
|
81
|
-
} =
|
|
82
|
+
} = toolbarButton;
|
|
82
83
|
const itemKey = [parentKey, key].join(':');
|
|
83
84
|
if (typeof action !== 'function') {
|
|
84
85
|
logError(`Provided action is not a function for extension toolbar button: ${label} (${itemKey})`);
|
|
85
86
|
}
|
|
86
87
|
let labelAndIcon = {};
|
|
87
|
-
switch (
|
|
88
|
+
switch (toolbarButton.display) {
|
|
88
89
|
case 'icon':
|
|
89
90
|
if (!icon) {
|
|
90
91
|
logError(`icon should be provided for extension toolbar button (${itemKey}), when display is set to 'icon'`);
|
|
@@ -157,11 +158,26 @@ export const getContextualToolbarItemsFromModule = (extensions, node, api) => {
|
|
|
157
158
|
return toolbarItems;
|
|
158
159
|
}
|
|
159
160
|
return [];
|
|
160
|
-
}).flatMap(
|
|
161
|
+
}).flatMap(toolbarItems => toolbarItems.map(toolbarItem => {
|
|
162
|
+
if (fg('forge_macro_autoconvert')) {
|
|
163
|
+
if (isToolbarButton(toolbarItem)) {
|
|
164
|
+
return toolbarItemToButtonConfig(toolbarItem, extension.key);
|
|
165
|
+
}
|
|
166
|
+
return toolbarItem;
|
|
167
|
+
} else {
|
|
168
|
+
return toolbarItemToButtonConfig(toolbarItem, extension.key);
|
|
169
|
+
}
|
|
170
|
+
}));
|
|
161
171
|
}
|
|
162
172
|
return [];
|
|
163
173
|
}).flatMap(extensionToolbarButtons => extensionToolbarButtons);
|
|
164
174
|
};
|
|
175
|
+
const isToolbarButton = toolbarItem => {
|
|
176
|
+
if ('type' in toolbarItem) {
|
|
177
|
+
return false;
|
|
178
|
+
}
|
|
179
|
+
return true;
|
|
180
|
+
};
|
|
165
181
|
|
|
166
182
|
// defines whether to add toolbar item for the given node
|
|
167
183
|
function shouldAddExtensionItemForNode(item, node) {
|
|
@@ -177,12 +193,15 @@ function shouldAddExtensionItemForNode(item, node) {
|
|
|
177
193
|
|
|
178
194
|
// in cases where we need custom exclusion depending on the node
|
|
179
195
|
if (item.context.shouldExclude) {
|
|
180
|
-
|
|
196
|
+
if (item.context.shouldExclude(node)) {
|
|
197
|
+
return false;
|
|
198
|
+
}
|
|
181
199
|
}
|
|
182
200
|
const {
|
|
183
201
|
extensionType,
|
|
184
202
|
extensionKey
|
|
185
203
|
} = item.context;
|
|
204
|
+
|
|
186
205
|
// if extension type is given - should match extension type
|
|
187
206
|
if (extensionType && extensionType !== ((_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.extensionType)) {
|
|
188
207
|
return false;
|
|
@@ -93,6 +93,7 @@ export const toggleTaskItemCheckbox = makeKeyMapWithCommon('Toggles task item',
|
|
|
93
93
|
export const selectRow = makeKeyMapArrayWithCommon('Select row', ['Mod-Alt-Shift-ArrowLeft', 'Mod-Alt-Shift-ArrowRight']);
|
|
94
94
|
export const selectColumn = makeKeyMapArrayWithCommon('Select column', ['Mod-Alt-Shift-ArrowDown', 'Mod-Alt-Shift-ArrowUp']);
|
|
95
95
|
export const selectTable = makeKeyMapWithCommon('Select table', 'Mod-a');
|
|
96
|
+
export const selectNode = makeKeyMapWithCommon('Select node', 'Mod-a');
|
|
96
97
|
export const increaseMediaSize = makeKeyMapWithCommon('increase image size', 'Mod-Alt-]');
|
|
97
98
|
export const decreaseMediaSize = makeKeyMapWithCommon('increase image size', 'Mod-Alt-[');
|
|
98
99
|
export const activateVideoControls = makeKeyMapWithCommon('Activate controls panel on video', 'Shift-F10');
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { isFedRamp } from './environment';
|
|
2
2
|
const SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
3
3
|
const packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
4
|
-
const packageVersion = "102.
|
|
4
|
+
const packageVersion = "102.3.0";
|
|
5
5
|
const sanitiseSentryEvents = (data, _hint) => {
|
|
6
6
|
// Remove URL as it has UGC
|
|
7
7
|
// Ignored via go/ees007
|
|
@@ -13,7 +13,7 @@ import withAnalyticsContext from '@atlaskit/analytics-next/withAnalyticsContext'
|
|
|
13
13
|
import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
|
|
14
14
|
import Layer from '../Layer';
|
|
15
15
|
const packageName = "@atlaskit/editor-common";
|
|
16
|
-
const packageVersion = "102.
|
|
16
|
+
const packageVersion = "102.3.0";
|
|
17
17
|
const halfFocusRing = 1;
|
|
18
18
|
const dropOffset = '0, 8';
|
|
19
19
|
// Ignored via go/ees005
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
/* eslint-disable @repo/internal/react/no-class-components */
|
|
3
3
|
import React, { PureComponent } from 'react';
|
|
4
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
4
5
|
import { ProviderFactory, WithProviders } from '../../provider-factory';
|
|
5
|
-
import { MentionWithProviders } from './mention-with-providers';
|
|
6
|
+
import { MentionWithProviders, MentionWithProvidersOld } from './mention-with-providers';
|
|
6
7
|
export default class Mention extends PureComponent {
|
|
7
8
|
constructor(props) {
|
|
8
9
|
super(props);
|
|
@@ -18,7 +19,18 @@ export default class Mention extends PureComponent {
|
|
|
18
19
|
mentionProvider,
|
|
19
20
|
profilecardProvider
|
|
20
21
|
} = providers;
|
|
21
|
-
|
|
22
|
+
if (fg('platform_editor_react18_mention_with_provider_fix')) {
|
|
23
|
+
return /*#__PURE__*/React.createElement(MentionWithProviders, {
|
|
24
|
+
id: id,
|
|
25
|
+
text: text,
|
|
26
|
+
accessLevel: accessLevel,
|
|
27
|
+
localId: localId,
|
|
28
|
+
eventHandlers: eventHandlers,
|
|
29
|
+
mentionProvider: mentionProvider,
|
|
30
|
+
profilecardProvider: profilecardProvider
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
return /*#__PURE__*/React.createElement(MentionWithProvidersOld, {
|
|
22
34
|
id: id,
|
|
23
35
|
text: text,
|
|
24
36
|
accessLevel: accessLevel,
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
|
+
import React, { PureComponent, useLayoutEffect, useRef, useState } from 'react';
|
|
2
4
|
import { ResourcedMention } from '@atlaskit/mention/element';
|
|
3
5
|
import ResourcedMentionWithProfilecard from './mention-with-profilecard';
|
|
4
6
|
const GENERIC_USER_IDS = ['HipChat', 'all', 'here'];
|
|
7
|
+
const noop = () => {};
|
|
5
8
|
export const MentionWithProviders = ({
|
|
6
9
|
accessLevel,
|
|
7
10
|
eventHandlers,
|
|
@@ -49,4 +52,82 @@ export const MentionWithProviders = ({
|
|
|
49
52
|
onMouseEnter: eventHandlers === null || eventHandlers === void 0 ? void 0 : eventHandlers.onMouseEnter,
|
|
50
53
|
onMouseLeave: eventHandlers === null || eventHandlers === void 0 ? void 0 : eventHandlers.onMouseLeave
|
|
51
54
|
});
|
|
52
|
-
};
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
// eslint-disable-next-line @repo/internal/react/no-class-components
|
|
58
|
+
export class MentionWithProvidersOld extends PureComponent {
|
|
59
|
+
constructor(...args) {
|
|
60
|
+
super(...args);
|
|
61
|
+
_defineProperty(this, "state", {
|
|
62
|
+
profilecardProvider: null
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
// Ignored via go/ees005
|
|
66
|
+
// eslint-disable-next-line react/no-unsafe
|
|
67
|
+
UNSAFE_componentWillMount() {
|
|
68
|
+
this.updateProfilecardProvider(this.props);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
// Ignored via go/ees005
|
|
72
|
+
// eslint-disable-next-line react/no-unsafe
|
|
73
|
+
UNSAFE_componentWillReceiveProps(nextProps) {
|
|
74
|
+
if (nextProps.profilecardProvider !== this.props.profilecardProvider) {
|
|
75
|
+
this.updateProfilecardProvider(nextProps);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
updateProfilecardProvider(props) {
|
|
79
|
+
// We are not using async/await here to avoid having an intermediate Promise
|
|
80
|
+
// introduced by the transpiler.
|
|
81
|
+
// This will allow consumer to use a SynchronousPromise.resolve and avoid useless
|
|
82
|
+
// rerendering
|
|
83
|
+
if (props.profilecardProvider) {
|
|
84
|
+
props.profilecardProvider.then(profilecardProvider => {
|
|
85
|
+
this.setState({
|
|
86
|
+
profilecardProvider
|
|
87
|
+
});
|
|
88
|
+
}).catch(() => {
|
|
89
|
+
this.setState({
|
|
90
|
+
profilecardProvider: null
|
|
91
|
+
});
|
|
92
|
+
});
|
|
93
|
+
} else {
|
|
94
|
+
this.setState({
|
|
95
|
+
profilecardProvider: null
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
render() {
|
|
100
|
+
const {
|
|
101
|
+
accessLevel,
|
|
102
|
+
eventHandlers,
|
|
103
|
+
id,
|
|
104
|
+
mentionProvider,
|
|
105
|
+
text,
|
|
106
|
+
localId
|
|
107
|
+
} = this.props;
|
|
108
|
+
const {
|
|
109
|
+
profilecardProvider
|
|
110
|
+
} = this.state;
|
|
111
|
+
|
|
112
|
+
// Ignored via go/ees005
|
|
113
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
114
|
+
const actionHandlers = {};
|
|
115
|
+
['onClick', 'onMouseEnter', 'onMouseLeave'].forEach(handler => {
|
|
116
|
+
actionHandlers[handler] = eventHandlers && eventHandlers[handler] || noop;
|
|
117
|
+
});
|
|
118
|
+
const MentionComponent = profilecardProvider && GENERIC_USER_IDS.indexOf(id) === -1 ? ResourcedMentionWithProfilecard : ResourcedMention;
|
|
119
|
+
return /*#__PURE__*/React.createElement(MentionComponent, _extends({
|
|
120
|
+
id: id,
|
|
121
|
+
text: text,
|
|
122
|
+
accessLevel: accessLevel,
|
|
123
|
+
localId: localId,
|
|
124
|
+
mentionProvider: mentionProvider
|
|
125
|
+
// Ignored via go/ees005
|
|
126
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
127
|
+
,
|
|
128
|
+
profilecardProvider: profilecardProvider
|
|
129
|
+
// Ignored via go/ees005
|
|
130
|
+
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
131
|
+
}, actionHandlers));
|
|
132
|
+
}
|
|
133
|
+
}
|
|
@@ -94,6 +94,7 @@ export var ACTION = /*#__PURE__*/function (ACTION) {
|
|
|
94
94
|
ACTION["RESOLVED"] = "resolved";
|
|
95
95
|
ACTION["REQUEST_TO_EDIT"] = "requestToEdit";
|
|
96
96
|
ACTION["SELECTED"] = "selected";
|
|
97
|
+
ACTION["SELECT_ALL"] = "selectAll";
|
|
97
98
|
ACTION["SHOWN"] = "shown";
|
|
98
99
|
ACTION["SLOW_INPUT"] = "slowInput";
|
|
99
100
|
ACTION["STARTED"] = "started";
|
|
@@ -7,6 +7,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
7
7
|
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
|
|
8
8
|
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
9
9
|
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
10
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
10
11
|
import { buildAction } from './manifest-helpers';
|
|
11
12
|
export var groupBy = function groupBy(arr, attr, keyRenamer) {
|
|
12
13
|
return (
|
|
@@ -154,21 +155,21 @@ var logError = function logError(msg) {
|
|
|
154
155
|
// eslint-disable-next-line no-console
|
|
155
156
|
(_console = console).error.apply(_console, [msg].concat(args));
|
|
156
157
|
};
|
|
157
|
-
var toolbarItemToButtonConfig = function toolbarItemToButtonConfig(
|
|
158
|
-
var tooltip =
|
|
159
|
-
tooltipStyle =
|
|
160
|
-
key =
|
|
161
|
-
label =
|
|
162
|
-
ariaLabel =
|
|
163
|
-
icon =
|
|
164
|
-
action =
|
|
165
|
-
disabled =
|
|
158
|
+
var toolbarItemToButtonConfig = function toolbarItemToButtonConfig(toolbarButton, parentKey) {
|
|
159
|
+
var tooltip = toolbarButton.tooltip,
|
|
160
|
+
tooltipStyle = toolbarButton.tooltipStyle,
|
|
161
|
+
key = toolbarButton.key,
|
|
162
|
+
label = toolbarButton.label,
|
|
163
|
+
ariaLabel = toolbarButton.ariaLabel,
|
|
164
|
+
icon = toolbarButton.icon,
|
|
165
|
+
action = toolbarButton.action,
|
|
166
|
+
disabled = toolbarButton.disabled;
|
|
166
167
|
var itemKey = [parentKey, key].join(':');
|
|
167
168
|
if (typeof action !== 'function') {
|
|
168
169
|
logError("Provided action is not a function for extension toolbar button: ".concat(label, " (").concat(itemKey, ")"));
|
|
169
170
|
}
|
|
170
171
|
var labelAndIcon = {};
|
|
171
|
-
switch (
|
|
172
|
+
switch (toolbarButton.display) {
|
|
172
173
|
case 'icon':
|
|
173
174
|
if (!icon) {
|
|
174
175
|
logError("icon should be provided for extension toolbar button (".concat(itemKey, "), when display is set to 'icon'"));
|
|
@@ -244,9 +245,16 @@ export var getContextualToolbarItemsFromModule = function getContextualToolbarIt
|
|
|
244
245
|
return toolbarItems;
|
|
245
246
|
}
|
|
246
247
|
return [];
|
|
247
|
-
}).flatMap(function (
|
|
248
|
-
return
|
|
249
|
-
|
|
248
|
+
}).flatMap(function (toolbarItems) {
|
|
249
|
+
return toolbarItems.map(function (toolbarItem) {
|
|
250
|
+
if (fg('forge_macro_autoconvert')) {
|
|
251
|
+
if (isToolbarButton(toolbarItem)) {
|
|
252
|
+
return toolbarItemToButtonConfig(toolbarItem, extension.key);
|
|
253
|
+
}
|
|
254
|
+
return toolbarItem;
|
|
255
|
+
} else {
|
|
256
|
+
return toolbarItemToButtonConfig(toolbarItem, extension.key);
|
|
257
|
+
}
|
|
250
258
|
});
|
|
251
259
|
});
|
|
252
260
|
}
|
|
@@ -255,6 +263,12 @@ export var getContextualToolbarItemsFromModule = function getContextualToolbarIt
|
|
|
255
263
|
return extensionToolbarButtons;
|
|
256
264
|
});
|
|
257
265
|
};
|
|
266
|
+
var isToolbarButton = function isToolbarButton(toolbarItem) {
|
|
267
|
+
if ('type' in toolbarItem) {
|
|
268
|
+
return false;
|
|
269
|
+
}
|
|
270
|
+
return true;
|
|
271
|
+
};
|
|
258
272
|
|
|
259
273
|
// defines whether to add toolbar item for the given node
|
|
260
274
|
function shouldAddExtensionItemForNode(item, node) {
|
|
@@ -270,11 +284,14 @@ function shouldAddExtensionItemForNode(item, node) {
|
|
|
270
284
|
|
|
271
285
|
// in cases where we need custom exclusion depending on the node
|
|
272
286
|
if (item.context.shouldExclude) {
|
|
273
|
-
|
|
287
|
+
if (item.context.shouldExclude(node)) {
|
|
288
|
+
return false;
|
|
289
|
+
}
|
|
274
290
|
}
|
|
275
291
|
var _item$context = item.context,
|
|
276
292
|
extensionType = _item$context.extensionType,
|
|
277
293
|
extensionKey = _item$context.extensionKey;
|
|
294
|
+
|
|
278
295
|
// if extension type is given - should match extension type
|
|
279
296
|
if (extensionType && extensionType !== ((_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.extensionType)) {
|
|
280
297
|
return false;
|
|
@@ -94,6 +94,7 @@ export var toggleTaskItemCheckbox = makeKeyMapWithCommon('Toggles task item', 'M
|
|
|
94
94
|
export var selectRow = makeKeyMapArrayWithCommon('Select row', ['Mod-Alt-Shift-ArrowLeft', 'Mod-Alt-Shift-ArrowRight']);
|
|
95
95
|
export var selectColumn = makeKeyMapArrayWithCommon('Select column', ['Mod-Alt-Shift-ArrowDown', 'Mod-Alt-Shift-ArrowUp']);
|
|
96
96
|
export var selectTable = makeKeyMapWithCommon('Select table', 'Mod-a');
|
|
97
|
+
export var selectNode = makeKeyMapWithCommon('Select node', 'Mod-a');
|
|
97
98
|
export var increaseMediaSize = makeKeyMapWithCommon('increase image size', 'Mod-Alt-]');
|
|
98
99
|
export var decreaseMediaSize = makeKeyMapWithCommon('increase image size', 'Mod-Alt-[');
|
|
99
100
|
export var activateVideoControls = makeKeyMapWithCommon('Activate controls panel on video', 'Shift-F10');
|
|
@@ -7,7 +7,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
7
7
|
import { isFedRamp } from './environment';
|
|
8
8
|
var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
9
9
|
var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
10
|
-
var packageVersion = "102.
|
|
10
|
+
var packageVersion = "102.3.0";
|
|
11
11
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
12
12
|
// Remove URL as it has UGC
|
|
13
13
|
// Ignored via go/ees007
|
|
@@ -20,7 +20,7 @@ import withAnalyticsContext from '@atlaskit/analytics-next/withAnalyticsContext'
|
|
|
20
20
|
import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
|
|
21
21
|
import Layer from '../Layer';
|
|
22
22
|
var packageName = "@atlaskit/editor-common";
|
|
23
|
-
var packageVersion = "102.
|
|
23
|
+
var packageVersion = "102.3.0";
|
|
24
24
|
var halfFocusRing = 1;
|
|
25
25
|
var dropOffset = '0, 8';
|
|
26
26
|
// Ignored via go/ees005
|
|
@@ -8,8 +8,9 @@ function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstruct
|
|
|
8
8
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
9
9
|
/* eslint-disable @repo/internal/react/no-class-components */
|
|
10
10
|
import React, { PureComponent } from 'react';
|
|
11
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
11
12
|
import { ProviderFactory, WithProviders } from '../../provider-factory';
|
|
12
|
-
import { MentionWithProviders } from './mention-with-providers';
|
|
13
|
+
import { MentionWithProviders, MentionWithProvidersOld } from './mention-with-providers';
|
|
13
14
|
var Mention = /*#__PURE__*/function (_PureComponent) {
|
|
14
15
|
function Mention(props) {
|
|
15
16
|
var _this;
|
|
@@ -24,7 +25,18 @@ var Mention = /*#__PURE__*/function (_PureComponent) {
|
|
|
24
25
|
localId = _this$props.localId;
|
|
25
26
|
var mentionProvider = providers.mentionProvider,
|
|
26
27
|
profilecardProvider = providers.profilecardProvider;
|
|
27
|
-
|
|
28
|
+
if (fg('platform_editor_react18_mention_with_provider_fix')) {
|
|
29
|
+
return /*#__PURE__*/React.createElement(MentionWithProviders, {
|
|
30
|
+
id: id,
|
|
31
|
+
text: text,
|
|
32
|
+
accessLevel: accessLevel,
|
|
33
|
+
localId: localId,
|
|
34
|
+
eventHandlers: eventHandlers,
|
|
35
|
+
mentionProvider: mentionProvider,
|
|
36
|
+
profilecardProvider: profilecardProvider
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
return /*#__PURE__*/React.createElement(MentionWithProvidersOld, {
|
|
28
40
|
id: id,
|
|
29
41
|
text: text,
|
|
30
42
|
accessLevel: accessLevel,
|
|
@@ -1,8 +1,18 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
3
|
+
import _createClass from "@babel/runtime/helpers/createClass";
|
|
4
|
+
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
5
|
+
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
6
|
+
import _inherits from "@babel/runtime/helpers/inherits";
|
|
7
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
1
8
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
-
|
|
9
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
10
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
11
|
+
import React, { PureComponent, useLayoutEffect, useRef, useState } from 'react';
|
|
3
12
|
import { ResourcedMention } from '@atlaskit/mention/element';
|
|
4
13
|
import ResourcedMentionWithProfilecard from './mention-with-profilecard';
|
|
5
14
|
var GENERIC_USER_IDS = ['HipChat', 'all', 'here'];
|
|
15
|
+
var noop = function noop() {};
|
|
6
16
|
export var MentionWithProviders = function MentionWithProviders(_ref) {
|
|
7
17
|
var accessLevel = _ref.accessLevel,
|
|
8
18
|
eventHandlers = _ref.eventHandlers,
|
|
@@ -52,4 +62,97 @@ export var MentionWithProviders = function MentionWithProviders(_ref) {
|
|
|
52
62
|
onMouseEnter: eventHandlers === null || eventHandlers === void 0 ? void 0 : eventHandlers.onMouseEnter,
|
|
53
63
|
onMouseLeave: eventHandlers === null || eventHandlers === void 0 ? void 0 : eventHandlers.onMouseLeave
|
|
54
64
|
});
|
|
55
|
-
};
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
// eslint-disable-next-line @repo/internal/react/no-class-components
|
|
68
|
+
export var MentionWithProvidersOld = /*#__PURE__*/function (_PureComponent) {
|
|
69
|
+
function MentionWithProvidersOld() {
|
|
70
|
+
var _this;
|
|
71
|
+
_classCallCheck(this, MentionWithProvidersOld);
|
|
72
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
73
|
+
args[_key] = arguments[_key];
|
|
74
|
+
}
|
|
75
|
+
_this = _callSuper(this, MentionWithProvidersOld, [].concat(args));
|
|
76
|
+
_defineProperty(_this, "state", {
|
|
77
|
+
profilecardProvider: null
|
|
78
|
+
});
|
|
79
|
+
return _this;
|
|
80
|
+
}
|
|
81
|
+
_inherits(MentionWithProvidersOld, _PureComponent);
|
|
82
|
+
return _createClass(MentionWithProvidersOld, [{
|
|
83
|
+
key: "UNSAFE_componentWillMount",
|
|
84
|
+
value:
|
|
85
|
+
// Ignored via go/ees005
|
|
86
|
+
// eslint-disable-next-line react/no-unsafe
|
|
87
|
+
function UNSAFE_componentWillMount() {
|
|
88
|
+
this.updateProfilecardProvider(this.props);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
// Ignored via go/ees005
|
|
92
|
+
// eslint-disable-next-line react/no-unsafe
|
|
93
|
+
}, {
|
|
94
|
+
key: "UNSAFE_componentWillReceiveProps",
|
|
95
|
+
value: function UNSAFE_componentWillReceiveProps(nextProps) {
|
|
96
|
+
if (nextProps.profilecardProvider !== this.props.profilecardProvider) {
|
|
97
|
+
this.updateProfilecardProvider(nextProps);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}, {
|
|
101
|
+
key: "updateProfilecardProvider",
|
|
102
|
+
value: function updateProfilecardProvider(props) {
|
|
103
|
+
var _this2 = this;
|
|
104
|
+
// We are not using async/await here to avoid having an intermediate Promise
|
|
105
|
+
// introduced by the transpiler.
|
|
106
|
+
// This will allow consumer to use a SynchronousPromise.resolve and avoid useless
|
|
107
|
+
// rerendering
|
|
108
|
+
if (props.profilecardProvider) {
|
|
109
|
+
props.profilecardProvider.then(function (profilecardProvider) {
|
|
110
|
+
_this2.setState({
|
|
111
|
+
profilecardProvider: profilecardProvider
|
|
112
|
+
});
|
|
113
|
+
}).catch(function () {
|
|
114
|
+
_this2.setState({
|
|
115
|
+
profilecardProvider: null
|
|
116
|
+
});
|
|
117
|
+
});
|
|
118
|
+
} else {
|
|
119
|
+
this.setState({
|
|
120
|
+
profilecardProvider: null
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}, {
|
|
125
|
+
key: "render",
|
|
126
|
+
value: function render() {
|
|
127
|
+
var _this$props = this.props,
|
|
128
|
+
accessLevel = _this$props.accessLevel,
|
|
129
|
+
eventHandlers = _this$props.eventHandlers,
|
|
130
|
+
id = _this$props.id,
|
|
131
|
+
mentionProvider = _this$props.mentionProvider,
|
|
132
|
+
text = _this$props.text,
|
|
133
|
+
localId = _this$props.localId;
|
|
134
|
+
var profilecardProvider = this.state.profilecardProvider;
|
|
135
|
+
|
|
136
|
+
// Ignored via go/ees005
|
|
137
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
138
|
+
var actionHandlers = {};
|
|
139
|
+
['onClick', 'onMouseEnter', 'onMouseLeave'].forEach(function (handler) {
|
|
140
|
+
actionHandlers[handler] = eventHandlers && eventHandlers[handler] || noop;
|
|
141
|
+
});
|
|
142
|
+
var MentionComponent = profilecardProvider && GENERIC_USER_IDS.indexOf(id) === -1 ? ResourcedMentionWithProfilecard : ResourcedMention;
|
|
143
|
+
return /*#__PURE__*/React.createElement(MentionComponent, _extends({
|
|
144
|
+
id: id,
|
|
145
|
+
text: text,
|
|
146
|
+
accessLevel: accessLevel,
|
|
147
|
+
localId: localId,
|
|
148
|
+
mentionProvider: mentionProvider
|
|
149
|
+
// Ignored via go/ees005
|
|
150
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
151
|
+
,
|
|
152
|
+
profilecardProvider: profilecardProvider
|
|
153
|
+
// Ignored via go/ees005
|
|
154
|
+
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
155
|
+
}, actionHandlers));
|
|
156
|
+
}
|
|
157
|
+
}]);
|
|
158
|
+
}(PureComponent);
|
|
@@ -17,5 +17,9 @@ export type SelectCellAEP = SelectAEP<ACTION_SUBJECT_ID.CELL, {
|
|
|
17
17
|
export type SelectTableAEP = SelectAEP<ACTION_SUBJECT_ID.TABLE, {
|
|
18
18
|
localId: string;
|
|
19
19
|
}>;
|
|
20
|
-
export type
|
|
20
|
+
export type SelectAllNodeAEP = TrackAEP<ACTION.SELECT_ALL, ACTION_SUBJECT.DOCUMENT, ACTION_SUBJECT_ID.ALL, {
|
|
21
|
+
followedBy?: string;
|
|
22
|
+
fromDepth?: number;
|
|
23
|
+
}, undefined>;
|
|
24
|
+
export type SelectionEventPayload = SelectNodeAEP | SelectRangeAEP | SelectAllAEP | SelectAllNodeAEP | SelectCellAEP | SelectTableAEP;
|
|
21
25
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ADFEntity } from '@atlaskit/adf-utils/types';
|
|
2
2
|
import type { ExtensionAPI } from './types/extension-handler';
|
|
3
3
|
import type { ExtensionAutoConvertHandler, ExtensionManifest, ExtensionModule } from './types/extension-manifest';
|
|
4
|
-
import type {
|
|
4
|
+
import type { ExtensionToolbarItem } from './types/extension-manifest-toolbar-item';
|
|
5
5
|
import type { Parameters } from './types/extension-parameters';
|
|
6
6
|
import type { ExtensionProvider } from './types/extension-provider';
|
|
7
7
|
import type { MenuItem } from './types/utils';
|
|
@@ -13,4 +13,4 @@ export declare const getQuickInsertItemsFromModule: <T extends Parameters>(exten
|
|
|
13
13
|
export declare function getAutoConvertPatternsFromModule<T extends Parameters>(extensions: ExtensionManifest<T>[]): Promise<ExtensionAutoConvertHandler[]>;
|
|
14
14
|
export declare const createAutoConverterRunner: (autoConvertHandlers: ExtensionAutoConvertHandler[]) => ExtensionAutoConvertHandler;
|
|
15
15
|
export declare function getExtensionAutoConvertersFromProvider(extensionProviderPromise: Promise<ExtensionProvider>): Promise<ExtensionAutoConvertHandler>;
|
|
16
|
-
export declare const getContextualToolbarItemsFromModule: (extensions: ExtensionManifest[], node: ADFEntity, api: ExtensionAPI) =>
|
|
16
|
+
export declare const getContextualToolbarItemsFromModule: (extensions: ExtensionManifest[], node: ADFEntity, api: ExtensionAPI) => ExtensionToolbarItem[];
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { ADFEntity } from '@atlaskit/adf-utils/types';
|
|
3
|
+
import type { Command, FloatingToolbarDropdown, FloatingToolbarItem } from '../../types';
|
|
3
4
|
import type { ExtensionAPI } from './extension-handler';
|
|
4
5
|
import type { ExtensionIconModule } from './extension-manifest-common';
|
|
5
6
|
export type ToolbarButtonAction = (contextNode: ADFEntity, api: ExtensionAPI) => Promise<void>;
|
|
@@ -19,7 +20,7 @@ export type ToolbarButton = ExtensionModuleToolbarButtonLabelOrIcon & {
|
|
|
19
20
|
display?: 'icon' | 'label' | 'icon-and-label';
|
|
20
21
|
disabled?: boolean;
|
|
21
22
|
};
|
|
22
|
-
export type ToolbarItem = ToolbarButton
|
|
23
|
+
export type ToolbarItem = ToolbarButton | FloatingToolbarItem<Command>;
|
|
23
24
|
export type ToolbarContext = ExtensionNodeContext | StandardNodeContext;
|
|
24
25
|
export type ContextualToolbar = {
|
|
25
26
|
context: ToolbarContext;
|
|
@@ -44,6 +45,7 @@ export type StandardNodeContext = {
|
|
|
44
45
|
type: 'node';
|
|
45
46
|
nodeType: 'table';
|
|
46
47
|
};
|
|
48
|
+
export type ExtensionToolbarItem = ExtensionToolbarButton | FloatingToolbarDropdown<Command>;
|
|
47
49
|
export type ExtensionToolbarButton = {
|
|
48
50
|
key: string;
|
|
49
51
|
label?: string;
|
|
@@ -101,7 +101,7 @@ export type ExtensionManifest<T extends Parameters = Parameters> = {
|
|
|
101
101
|
};
|
|
102
102
|
modules: ExtensionModules<T>;
|
|
103
103
|
autoConvert?: {
|
|
104
|
-
|
|
104
|
+
matchers: Array<AutoConvertMatches>;
|
|
105
105
|
};
|
|
106
106
|
};
|
|
107
107
|
export type Icon = () => ExtensionIconModule;
|
|
@@ -89,6 +89,7 @@ export declare const toggleTaskItemCheckbox: Keymap;
|
|
|
89
89
|
export declare const selectRow: Keymap[];
|
|
90
90
|
export declare const selectColumn: Keymap[];
|
|
91
91
|
export declare const selectTable: Keymap;
|
|
92
|
+
export declare const selectNode: Keymap;
|
|
92
93
|
export declare const increaseMediaSize: Keymap;
|
|
93
94
|
export declare const decreaseMediaSize: Keymap;
|
|
94
95
|
export declare const activateVideoControls: Keymap;
|
|
@@ -240,6 +240,7 @@ export type FloatingToolbarSeparator = {
|
|
|
240
240
|
fullHeight?: boolean;
|
|
241
241
|
supportsViewMode?: boolean;
|
|
242
242
|
};
|
|
243
|
+
export type ExtensionDropdownOptions = () => DropdownOptions<Function>;
|
|
243
244
|
export type FloatingToolbarDropdown<T extends Object> = {
|
|
244
245
|
testId?: string;
|
|
245
246
|
id?: string;
|
|
@@ -250,7 +251,7 @@ export type FloatingToolbarDropdown<T extends Object> = {
|
|
|
250
251
|
* Places an icon before the title as a representation
|
|
251
252
|
*/
|
|
252
253
|
iconBefore?: Icon;
|
|
253
|
-
options: DropdownOptions<T
|
|
254
|
+
options: DropdownOptions<T> | ExtensionDropdownOptions;
|
|
254
255
|
hidden?: boolean;
|
|
255
256
|
hideExpandIcon?: boolean;
|
|
256
257
|
disabled?: boolean;
|
|
@@ -13,7 +13,7 @@ export type { FeatureFlags, FeatureFlagKey, GetEditorFeatureFlags } from './feat
|
|
|
13
13
|
export type { Browsers, Range, DisableSpellcheckByBrowser } from './supported-browsers';
|
|
14
14
|
export type { EditorContainerWidth, GetEditorContainerWidth } from './editor-container-width';
|
|
15
15
|
export type { EmptyStateHandler, EmptyStateHandlerParams } from './empty-state-handler';
|
|
16
|
-
export type { RenderOptionsPropsT, DropdownOptionT, DropdownOptions, SelectOption, ButtonAppearance, Icon, RenderOptionsProps, AlignType, ConfirmDialogChildInfo, ConfirmDialogOptions, ConfirmationDialogProps, FloatingToolbarButton, FloatingToolbarCopyButton, FloatingToolbarInput, FloatingToolbarCustom, FloatingToolbarListPicker, FloatingToolbarColorPicker, FloatingToolbarEmojiPicker, FloatingToolbarDatePicker, FloatingToolbarSelect, FloatingToolbarSeparator, FloatingToolbarDropdown, FloatingToolbarFallbackItem, FloatingToolbarItem, FloatingToolbarConfig, FloatingToolbarHandler, FloatingToolbarButtonSpotlightConfig, typeOption, FloatingToolbarOverflowDropdownOptions, } from './floating-toolbar';
|
|
16
|
+
export type { RenderOptionsPropsT, DropdownOptionT, DropdownOptions, ExtensionDropdownOptions, SelectOption, ButtonAppearance, Icon, RenderOptionsProps, AlignType, ConfirmDialogChildInfo, ConfirmDialogOptions, ConfirmationDialogProps, FloatingToolbarButton, FloatingToolbarCopyButton, FloatingToolbarInput, FloatingToolbarCustom, FloatingToolbarListPicker, FloatingToolbarColorPicker, FloatingToolbarEmojiPicker, FloatingToolbarDatePicker, FloatingToolbarSelect, FloatingToolbarSeparator, FloatingToolbarDropdown, FloatingToolbarFallbackItem, FloatingToolbarItem, FloatingToolbarConfig, FloatingToolbarHandler, FloatingToolbarButtonSpotlightConfig, typeOption, FloatingToolbarOverflowDropdownOptions, } from './floating-toolbar';
|
|
17
17
|
export type { MarkOptions, NodeOptions } from './copy-button';
|
|
18
18
|
export type { ContextPanelHandler } from './context-panel';
|
|
19
19
|
export type { EditorAppearance } from './editor-appearance';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { PureComponent } from 'react';
|
|
2
2
|
import type { MentionProvider } from '@atlaskit/mention/resource';
|
|
3
3
|
import type { ProfilecardProvider } from '../../provider-factory/profile-card-provider';
|
|
4
4
|
import type { MentionEventHandlers } from '../EventHandlers';
|
|
@@ -15,3 +15,10 @@ export interface State {
|
|
|
15
15
|
profilecardProvider: ProfilecardProvider | null;
|
|
16
16
|
}
|
|
17
17
|
export declare const MentionWithProviders: ({ accessLevel, eventHandlers, id, mentionProvider, profilecardProvider: profilecardProviderResolver, text, localId, }: Props) => React.JSX.Element;
|
|
18
|
+
export declare class MentionWithProvidersOld extends PureComponent<Props, State> {
|
|
19
|
+
state: State;
|
|
20
|
+
UNSAFE_componentWillMount(): void;
|
|
21
|
+
UNSAFE_componentWillReceiveProps(nextProps: Props): void;
|
|
22
|
+
private updateProfilecardProvider;
|
|
23
|
+
render(): React.JSX.Element;
|
|
24
|
+
}
|
|
@@ -14,7 +14,7 @@ declare const _default: React.ForwardRefExoticComponent<Omit<Omit<{
|
|
|
14
14
|
colorPalette: PaletteColor[];
|
|
15
15
|
placement: string;
|
|
16
16
|
cols?: number | undefined;
|
|
17
|
-
alignX?: "
|
|
17
|
+
alignX?: "end" | "left" | "right" | "center" | undefined;
|
|
18
18
|
size?: {
|
|
19
19
|
width: string;
|
|
20
20
|
height: string;
|
|
@@ -17,5 +17,9 @@ export type SelectCellAEP = SelectAEP<ACTION_SUBJECT_ID.CELL, {
|
|
|
17
17
|
export type SelectTableAEP = SelectAEP<ACTION_SUBJECT_ID.TABLE, {
|
|
18
18
|
localId: string;
|
|
19
19
|
}>;
|
|
20
|
-
export type
|
|
20
|
+
export type SelectAllNodeAEP = TrackAEP<ACTION.SELECT_ALL, ACTION_SUBJECT.DOCUMENT, ACTION_SUBJECT_ID.ALL, {
|
|
21
|
+
followedBy?: string;
|
|
22
|
+
fromDepth?: number;
|
|
23
|
+
}, undefined>;
|
|
24
|
+
export type SelectionEventPayload = SelectNodeAEP | SelectRangeAEP | SelectAllAEP | SelectAllNodeAEP | SelectCellAEP | SelectTableAEP;
|
|
21
25
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ADFEntity } from '@atlaskit/adf-utils/types';
|
|
2
2
|
import type { ExtensionAPI } from './types/extension-handler';
|
|
3
3
|
import type { ExtensionAutoConvertHandler, ExtensionManifest, ExtensionModule } from './types/extension-manifest';
|
|
4
|
-
import type {
|
|
4
|
+
import type { ExtensionToolbarItem } from './types/extension-manifest-toolbar-item';
|
|
5
5
|
import type { Parameters } from './types/extension-parameters';
|
|
6
6
|
import type { ExtensionProvider } from './types/extension-provider';
|
|
7
7
|
import type { MenuItem } from './types/utils';
|
|
@@ -13,4 +13,4 @@ export declare const getQuickInsertItemsFromModule: <T extends Parameters>(exten
|
|
|
13
13
|
export declare function getAutoConvertPatternsFromModule<T extends Parameters>(extensions: ExtensionManifest<T>[]): Promise<ExtensionAutoConvertHandler[]>;
|
|
14
14
|
export declare const createAutoConverterRunner: (autoConvertHandlers: ExtensionAutoConvertHandler[]) => ExtensionAutoConvertHandler;
|
|
15
15
|
export declare function getExtensionAutoConvertersFromProvider(extensionProviderPromise: Promise<ExtensionProvider>): Promise<ExtensionAutoConvertHandler>;
|
|
16
|
-
export declare const getContextualToolbarItemsFromModule: (extensions: ExtensionManifest[], node: ADFEntity, api: ExtensionAPI) =>
|
|
16
|
+
export declare const getContextualToolbarItemsFromModule: (extensions: ExtensionManifest[], node: ADFEntity, api: ExtensionAPI) => ExtensionToolbarItem[];
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { ADFEntity } from '@atlaskit/adf-utils/types';
|
|
3
|
+
import type { Command, FloatingToolbarDropdown, FloatingToolbarItem } from '../../types';
|
|
3
4
|
import type { ExtensionAPI } from './extension-handler';
|
|
4
5
|
import type { ExtensionIconModule } from './extension-manifest-common';
|
|
5
6
|
export type ToolbarButtonAction = (contextNode: ADFEntity, api: ExtensionAPI) => Promise<void>;
|
|
@@ -19,7 +20,7 @@ export type ToolbarButton = ExtensionModuleToolbarButtonLabelOrIcon & {
|
|
|
19
20
|
display?: 'icon' | 'label' | 'icon-and-label';
|
|
20
21
|
disabled?: boolean;
|
|
21
22
|
};
|
|
22
|
-
export type ToolbarItem = ToolbarButton
|
|
23
|
+
export type ToolbarItem = ToolbarButton | FloatingToolbarItem<Command>;
|
|
23
24
|
export type ToolbarContext = ExtensionNodeContext | StandardNodeContext;
|
|
24
25
|
export type ContextualToolbar = {
|
|
25
26
|
context: ToolbarContext;
|
|
@@ -44,6 +45,7 @@ export type StandardNodeContext = {
|
|
|
44
45
|
type: 'node';
|
|
45
46
|
nodeType: 'table';
|
|
46
47
|
};
|
|
48
|
+
export type ExtensionToolbarItem = ExtensionToolbarButton | FloatingToolbarDropdown<Command>;
|
|
47
49
|
export type ExtensionToolbarButton = {
|
|
48
50
|
key: string;
|
|
49
51
|
label?: string;
|
|
@@ -101,7 +101,7 @@ export type ExtensionManifest<T extends Parameters = Parameters> = {
|
|
|
101
101
|
};
|
|
102
102
|
modules: ExtensionModules<T>;
|
|
103
103
|
autoConvert?: {
|
|
104
|
-
|
|
104
|
+
matchers: Array<AutoConvertMatches>;
|
|
105
105
|
};
|
|
106
106
|
};
|
|
107
107
|
export type Icon = () => ExtensionIconModule;
|
|
@@ -89,6 +89,7 @@ export declare const toggleTaskItemCheckbox: Keymap;
|
|
|
89
89
|
export declare const selectRow: Keymap[];
|
|
90
90
|
export declare const selectColumn: Keymap[];
|
|
91
91
|
export declare const selectTable: Keymap;
|
|
92
|
+
export declare const selectNode: Keymap;
|
|
92
93
|
export declare const increaseMediaSize: Keymap;
|
|
93
94
|
export declare const decreaseMediaSize: Keymap;
|
|
94
95
|
export declare const activateVideoControls: Keymap;
|
|
@@ -240,6 +240,7 @@ export type FloatingToolbarSeparator = {
|
|
|
240
240
|
fullHeight?: boolean;
|
|
241
241
|
supportsViewMode?: boolean;
|
|
242
242
|
};
|
|
243
|
+
export type ExtensionDropdownOptions = () => DropdownOptions<Function>;
|
|
243
244
|
export type FloatingToolbarDropdown<T extends Object> = {
|
|
244
245
|
testId?: string;
|
|
245
246
|
id?: string;
|
|
@@ -250,7 +251,7 @@ export type FloatingToolbarDropdown<T extends Object> = {
|
|
|
250
251
|
* Places an icon before the title as a representation
|
|
251
252
|
*/
|
|
252
253
|
iconBefore?: Icon;
|
|
253
|
-
options: DropdownOptions<T
|
|
254
|
+
options: DropdownOptions<T> | ExtensionDropdownOptions;
|
|
254
255
|
hidden?: boolean;
|
|
255
256
|
hideExpandIcon?: boolean;
|
|
256
257
|
disabled?: boolean;
|
|
@@ -13,7 +13,7 @@ export type { FeatureFlags, FeatureFlagKey, GetEditorFeatureFlags } from './feat
|
|
|
13
13
|
export type { Browsers, Range, DisableSpellcheckByBrowser } from './supported-browsers';
|
|
14
14
|
export type { EditorContainerWidth, GetEditorContainerWidth } from './editor-container-width';
|
|
15
15
|
export type { EmptyStateHandler, EmptyStateHandlerParams } from './empty-state-handler';
|
|
16
|
-
export type { RenderOptionsPropsT, DropdownOptionT, DropdownOptions, SelectOption, ButtonAppearance, Icon, RenderOptionsProps, AlignType, ConfirmDialogChildInfo, ConfirmDialogOptions, ConfirmationDialogProps, FloatingToolbarButton, FloatingToolbarCopyButton, FloatingToolbarInput, FloatingToolbarCustom, FloatingToolbarListPicker, FloatingToolbarColorPicker, FloatingToolbarEmojiPicker, FloatingToolbarDatePicker, FloatingToolbarSelect, FloatingToolbarSeparator, FloatingToolbarDropdown, FloatingToolbarFallbackItem, FloatingToolbarItem, FloatingToolbarConfig, FloatingToolbarHandler, FloatingToolbarButtonSpotlightConfig, typeOption, FloatingToolbarOverflowDropdownOptions, } from './floating-toolbar';
|
|
16
|
+
export type { RenderOptionsPropsT, DropdownOptionT, DropdownOptions, ExtensionDropdownOptions, SelectOption, ButtonAppearance, Icon, RenderOptionsProps, AlignType, ConfirmDialogChildInfo, ConfirmDialogOptions, ConfirmationDialogProps, FloatingToolbarButton, FloatingToolbarCopyButton, FloatingToolbarInput, FloatingToolbarCustom, FloatingToolbarListPicker, FloatingToolbarColorPicker, FloatingToolbarEmojiPicker, FloatingToolbarDatePicker, FloatingToolbarSelect, FloatingToolbarSeparator, FloatingToolbarDropdown, FloatingToolbarFallbackItem, FloatingToolbarItem, FloatingToolbarConfig, FloatingToolbarHandler, FloatingToolbarButtonSpotlightConfig, typeOption, FloatingToolbarOverflowDropdownOptions, } from './floating-toolbar';
|
|
17
17
|
export type { MarkOptions, NodeOptions } from './copy-button';
|
|
18
18
|
export type { ContextPanelHandler } from './context-panel';
|
|
19
19
|
export type { EditorAppearance } from './editor-appearance';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { PureComponent } from 'react';
|
|
2
2
|
import type { MentionProvider } from '@atlaskit/mention/resource';
|
|
3
3
|
import type { ProfilecardProvider } from '../../provider-factory/profile-card-provider';
|
|
4
4
|
import type { MentionEventHandlers } from '../EventHandlers';
|
|
@@ -15,3 +15,10 @@ export interface State {
|
|
|
15
15
|
profilecardProvider: ProfilecardProvider | null;
|
|
16
16
|
}
|
|
17
17
|
export declare const MentionWithProviders: ({ accessLevel, eventHandlers, id, mentionProvider, profilecardProvider: profilecardProviderResolver, text, localId, }: Props) => React.JSX.Element;
|
|
18
|
+
export declare class MentionWithProvidersOld extends PureComponent<Props, State> {
|
|
19
|
+
state: State;
|
|
20
|
+
UNSAFE_componentWillMount(): void;
|
|
21
|
+
UNSAFE_componentWillReceiveProps(nextProps: Props): void;
|
|
22
|
+
private updateProfilecardProvider;
|
|
23
|
+
render(): React.JSX.Element;
|
|
24
|
+
}
|
|
@@ -14,7 +14,7 @@ declare const _default: React.ForwardRefExoticComponent<Omit<Omit<{
|
|
|
14
14
|
colorPalette: PaletteColor[];
|
|
15
15
|
placement: string;
|
|
16
16
|
cols?: number | undefined;
|
|
17
|
-
alignX?: "
|
|
17
|
+
alignX?: "end" | "left" | "right" | "center" | undefined;
|
|
18
18
|
size?: {
|
|
19
19
|
width: string;
|
|
20
20
|
height: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-common",
|
|
3
|
-
"version": "102.
|
|
3
|
+
"version": "102.3.0",
|
|
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/"
|
|
@@ -160,7 +160,7 @@
|
|
|
160
160
|
"@atlaskit/spinner": "^18.0.0",
|
|
161
161
|
"@atlaskit/task-decision": "^19.0.0",
|
|
162
162
|
"@atlaskit/textfield": "^8.0.0",
|
|
163
|
-
"@atlaskit/tmp-editor-statsig": "^3.
|
|
163
|
+
"@atlaskit/tmp-editor-statsig": "^3.5.0",
|
|
164
164
|
"@atlaskit/tokens": "^4.3.0",
|
|
165
165
|
"@atlaskit/tooltip": "^20.0.0",
|
|
166
166
|
"@atlaskit/width-detector": "^5.0.0",
|
|
@@ -253,6 +253,9 @@
|
|
|
253
253
|
"editor_inline_comments_paste_insert_nodes": {
|
|
254
254
|
"type": "boolean"
|
|
255
255
|
},
|
|
256
|
+
"platform_editor_react18_mention_with_provider_fix": {
|
|
257
|
+
"type": "boolean"
|
|
258
|
+
},
|
|
256
259
|
"platform_editor_react18_phase2_v2": {
|
|
257
260
|
"type": "boolean"
|
|
258
261
|
},
|
|
@@ -324,6 +327,9 @@
|
|
|
324
327
|
},
|
|
325
328
|
"platform_editor_elements_dnd_multi_select_patch_1": {
|
|
326
329
|
"type": "boolean"
|
|
330
|
+
},
|
|
331
|
+
"forge_macro_autoconvert": {
|
|
332
|
+
"type": "boolean"
|
|
327
333
|
}
|
|
328
334
|
}
|
|
329
335
|
}
|