@atlaskit/editor-plugin-extension 10.1.6 → 10.1.8
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/pm-plugins/toolbar.js +13 -2
- package/dist/cjs/ui/ConfigPanel/ConfigPanel.js +37 -26
- package/dist/cjs/ui/ConfigPanel/Fields/UserSelect.js +6 -3
- package/dist/cjs/ui/ConfigPanel/NestedForms/RemovableField.js +7 -4
- package/dist/es2019/pm-plugins/toolbar.js +14 -3
- package/dist/es2019/ui/ConfigPanel/ConfigPanel.js +37 -26
- package/dist/es2019/ui/ConfigPanel/Fields/UserSelect.js +6 -3
- package/dist/es2019/ui/ConfigPanel/NestedForms/RemovableField.js +7 -4
- package/dist/esm/pm-plugins/toolbar.js +14 -3
- package/dist/esm/ui/ConfigPanel/ConfigPanel.js +37 -26
- package/dist/esm/ui/ConfigPanel/Fields/UserSelect.js +6 -3
- package/dist/esm/ui/ConfigPanel/NestedForms/RemovableField.js +7 -4
- package/package.json +5 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-extension
|
|
2
2
|
|
|
3
|
+
## 10.1.8
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`a4f09d516e927`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/a4f09d516e927) -
|
|
8
|
+
[NO-ISSUE] Analytics for onclick for extensions copy
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
11
|
+
## 10.1.7
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [`d2f1426fe5b85`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/d2f1426fe5b85) -
|
|
16
|
+
[ux] ENGHEALTH-46817 Add feature gated a11y eslint fixes across editor packages
|
|
17
|
+
- Updated dependencies
|
|
18
|
+
|
|
3
19
|
## 10.1.6
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
|
@@ -300,6 +300,17 @@ var createOnClickCopyButton = exports.createOnClickCopyButton = function createO
|
|
|
300
300
|
|
|
301
301
|
// this command copies the text content of the unsupported content extension to the clipboard
|
|
302
302
|
return function (editorState) {
|
|
303
|
+
var _extensionApi$analyti;
|
|
304
|
+
extensionApi === null || extensionApi === void 0 || (_extensionApi$analyti = extensionApi.analytics) === null || _extensionApi$analyti === void 0 || _extensionApi$analyti.actions.fireAnalyticsEvent({
|
|
305
|
+
action: _analytics.ACTION.CLICKED,
|
|
306
|
+
actionSubject: _analytics.ACTION_SUBJECT.COPY_BUTTON,
|
|
307
|
+
actionSubjectId: node.type.name,
|
|
308
|
+
eventType: _analytics.EVENT_TYPE.UI,
|
|
309
|
+
attributes: {
|
|
310
|
+
extensionType: node.attrs.extensionType,
|
|
311
|
+
extensionKey: node.attrs.extensionKey
|
|
312
|
+
}
|
|
313
|
+
});
|
|
303
314
|
(0, _utils3.copyUnsupportedContentToClipboard)({
|
|
304
315
|
locale: locale,
|
|
305
316
|
unsupportedContent: adf,
|
|
@@ -324,14 +335,14 @@ var getToolbarConfig = exports.getToolbarConfig = function getToolbarConfig(_ref
|
|
|
324
335
|
extensionApi = _ref2.extensionApi,
|
|
325
336
|
getUnsupportedContent = _ref2.getUnsupportedContent;
|
|
326
337
|
return function (state, intl) {
|
|
327
|
-
var _extensionApi$decorat, _extensionApi$context, _extensionApi$
|
|
338
|
+
var _extensionApi$decorat, _extensionApi$context, _extensionApi$analyti2, _extensionApi$connect;
|
|
328
339
|
var formatMessage = intl.formatMessage,
|
|
329
340
|
locale = intl.locale;
|
|
330
341
|
var extensionState = (0, _pluginFactory.getPluginState)(state);
|
|
331
342
|
var extensionProvider = extensionState.extensionProvider;
|
|
332
343
|
var hoverDecoration = extensionApi === null || extensionApi === void 0 || (_extensionApi$decorat = extensionApi.decorations) === null || _extensionApi$decorat === void 0 ? void 0 : _extensionApi$decorat.actions.hoverDecoration;
|
|
333
344
|
var applyChangeToContextPanel = extensionApi === null || extensionApi === void 0 || (_extensionApi$context = extensionApi.contextPanel) === null || _extensionApi$context === void 0 ? void 0 : _extensionApi$context.actions.applyChange;
|
|
334
|
-
var editorAnalyticsAPI = extensionApi === null || extensionApi === void 0 || (_extensionApi$
|
|
345
|
+
var editorAnalyticsAPI = extensionApi === null || extensionApi === void 0 || (_extensionApi$analyti2 = extensionApi.analytics) === null || _extensionApi$analyti2 === void 0 ? void 0 : _extensionApi$analyti2.actions;
|
|
335
346
|
if (!extensionState || extensionState.showContextPanel || !extensionState.element) {
|
|
336
347
|
return;
|
|
337
348
|
}
|
|
@@ -16,11 +16,13 @@ var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/ge
|
|
|
16
16
|
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
17
17
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
18
18
|
var _react = _interopRequireWildcard(require("react"));
|
|
19
|
+
var _bindEventListener = require("bind-event-listener");
|
|
19
20
|
var _isEqual2 = _interopRequireDefault(require("lodash/isEqual"));
|
|
20
21
|
var _merge = _interopRequireDefault(require("lodash/merge"));
|
|
21
22
|
var _memoizeOne = _interopRequireDefault(require("memoize-one"));
|
|
22
23
|
var _reactIntlNext = require("react-intl-next");
|
|
23
24
|
var _analyticsNext = require("@atlaskit/analytics-next");
|
|
25
|
+
var _browserApis = require("@atlaskit/browser-apis");
|
|
24
26
|
var _buttonGroup = _interopRequireDefault(require("@atlaskit/button/button-group"));
|
|
25
27
|
var _new = _interopRequireDefault(require("@atlaskit/button/new"));
|
|
26
28
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
@@ -28,6 +30,7 @@ var _extensions = require("@atlaskit/editor-common/extensions");
|
|
|
28
30
|
var _hooks = require("@atlaskit/editor-common/hooks");
|
|
29
31
|
var _form = _interopRequireWildcard(require("@atlaskit/form"));
|
|
30
32
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
33
|
+
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
31
34
|
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
32
35
|
var _constants = require("./constants");
|
|
33
36
|
var _DescriptionSummary = require("./DescriptionSummary");
|
|
@@ -354,6 +357,7 @@ var ConfigPanel = /*#__PURE__*/function (_React$Component) {
|
|
|
354
357
|
firstVisibleFieldName: props.fields ? _this.getFirstVisibleFieldName(props.fields) : undefined
|
|
355
358
|
};
|
|
356
359
|
_this.onFieldChange = null;
|
|
360
|
+
_this.unbindKeyDownHandler = null;
|
|
357
361
|
return _this;
|
|
358
362
|
}
|
|
359
363
|
(0, _inherits2.default)(ConfigPanel, _React$Component);
|
|
@@ -364,15 +368,26 @@ var ConfigPanel = /*#__PURE__*/function (_React$Component) {
|
|
|
364
368
|
fields = _this$props3.fields,
|
|
365
369
|
parameters = _this$props3.parameters;
|
|
366
370
|
this.parseParameters(fields, parameters);
|
|
371
|
+
if ((0, _expValEquals.expValEquals)('platform_editor_a11y_eslint_fix', 'isEnabled', true)) {
|
|
372
|
+
var doc = (0, _browserApis.getDocument)();
|
|
373
|
+
if (doc) {
|
|
374
|
+
this.unbindKeyDownHandler = (0, _bindEventListener.bind)(doc, {
|
|
375
|
+
type: 'keydown',
|
|
376
|
+
listener: this.handleKeyDown
|
|
377
|
+
});
|
|
378
|
+
}
|
|
379
|
+
}
|
|
367
380
|
}
|
|
368
381
|
}, {
|
|
369
382
|
key: "componentWillUnmount",
|
|
370
383
|
value: function componentWillUnmount() {
|
|
384
|
+
var _this$unbindKeyDownHa;
|
|
371
385
|
var _this$props4 = this.props,
|
|
372
386
|
createAnalyticsEvent = _this$props4.createAnalyticsEvent,
|
|
373
387
|
extensionManifest = _this$props4.extensionManifest,
|
|
374
388
|
fields = _this$props4.fields;
|
|
375
389
|
var currentParameters = this.state.currentParameters;
|
|
390
|
+
(_this$unbindKeyDownHa = this.unbindKeyDownHandler) === null || _this$unbindKeyDownHa === void 0 || _this$unbindKeyDownHa.call(this);
|
|
376
391
|
(0, _analytics.fireAnalyticsEvent)(createAnalyticsEvent)({
|
|
377
392
|
payload: {
|
|
378
393
|
action: _analytics.ACTION.CLOSED,
|
|
@@ -456,32 +471,28 @@ var ConfigPanel = /*#__PURE__*/function (_React$Component) {
|
|
|
456
471
|
handleSubmit: handleSubmit
|
|
457
472
|
}, function (onFieldChange) {
|
|
458
473
|
_this2.onFieldChange = onFieldChange;
|
|
459
|
-
return (
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
featureFlags: featureFlags,
|
|
482
|
-
disableFields: _this2.props.disableFields
|
|
483
|
-
}))
|
|
484
|
-
);
|
|
474
|
+
return /*#__PURE__*/_react.default.createElement("form", (0, _extends2.default)({}, formProps, {
|
|
475
|
+
noValidate: true,
|
|
476
|
+
onKeyDown: (0, _expValEquals.expValEquals)('platform_editor_a11y_eslint_fix', 'isEnabled', true) ? undefined : handleKeyDown,
|
|
477
|
+
"data-testid": "extension-config-panel"
|
|
478
|
+
}), _this2.renderHeader(extensionManifest), (0, _platformFeatureFlags.fg)('platform_editor_ai_object_sidebar_injection') && /*#__PURE__*/_react.default.createElement(_DescriptionSummary.DescriptionSummary, {
|
|
479
|
+
extensionManifest: extensionManifest
|
|
480
|
+
}), /*#__PURE__*/_react.default.createElement(ConfigFormIntlWithBoundary, {
|
|
481
|
+
api: api,
|
|
482
|
+
canSave: false,
|
|
483
|
+
errorMessage: errorMessage,
|
|
484
|
+
extensionManifest: extensionManifest,
|
|
485
|
+
fields: fields !== null && fields !== void 0 ? fields : [],
|
|
486
|
+
firstVisibleFieldName: firstVisibleFieldName,
|
|
487
|
+
hasParsedParameters: hasParsedParameters,
|
|
488
|
+
isLoading: isLoading || false,
|
|
489
|
+
onCancel: onCancel,
|
|
490
|
+
onFieldChange: onFieldChange,
|
|
491
|
+
parameters: currentParameters,
|
|
492
|
+
submitting: submitting,
|
|
493
|
+
featureFlags: featureFlags,
|
|
494
|
+
disableFields: _this2.props.disableFields
|
|
495
|
+
}));
|
|
485
496
|
});
|
|
486
497
|
});
|
|
487
498
|
}
|
|
@@ -113,8 +113,11 @@ function SafeSmartUserPicker(_ref) {
|
|
|
113
113
|
_context.next = 2;
|
|
114
114
|
return (0, _smartUserPicker.hydrateDefaultValues)(undefined,
|
|
115
115
|
// no need to override baseUrl
|
|
116
|
-
makeCompat(safeValue), productKey, undefined
|
|
117
|
-
|
|
116
|
+
makeCompat(safeValue), productKey, undefined,
|
|
117
|
+
// no need to override siteId
|
|
118
|
+
{
|
|
119
|
+
tenantId: siteId
|
|
120
|
+
});
|
|
118
121
|
case 2:
|
|
119
122
|
hydrated = _context.sent;
|
|
120
123
|
if (!(cancel || !isOptionData(hydrated))) {
|
|
@@ -136,7 +139,7 @@ function SafeSmartUserPicker(_ref) {
|
|
|
136
139
|
return function () {
|
|
137
140
|
cancel = true;
|
|
138
141
|
};
|
|
139
|
-
}, [safeValue, productKey]);
|
|
142
|
+
}, [safeValue, productKey, siteId]);
|
|
140
143
|
return /*#__PURE__*/_react.default.createElement(_smartUserPicker.default
|
|
141
144
|
// Ignored via go/ees005
|
|
142
145
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
@@ -11,6 +11,7 @@ var _reactIntlNext = require("react-intl-next");
|
|
|
11
11
|
var _extensions = require("@atlaskit/editor-common/extensions");
|
|
12
12
|
var _crossCircle = _interopRequireDefault(require("@atlaskit/icon/core/cross-circle"));
|
|
13
13
|
var _colors = require("@atlaskit/theme/colors");
|
|
14
|
+
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
14
15
|
var _tooltip = _interopRequireDefault(require("@atlaskit/tooltip"));
|
|
15
16
|
/**
|
|
16
17
|
* @jsxRuntime classic
|
|
@@ -53,12 +54,14 @@ var RemovableField = function RemovableField(_ref) {
|
|
|
53
54
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
54
55
|
,
|
|
55
56
|
className: className
|
|
56
|
-
}, children, canRemoveField &&
|
|
57
|
-
|
|
58
|
-
(0, _react2.jsx)("div", {
|
|
57
|
+
}, children, canRemoveField && (0, _react2.jsx)("div", {
|
|
58
|
+
role: (0, _expValEquals.expValEquals)('platform_editor_a11y_eslint_fix', 'isEnabled', true) ? 'button' : undefined,
|
|
59
59
|
css: removeButtonWrapperStyles,
|
|
60
60
|
"data-testid": "remove-field-".concat(name),
|
|
61
|
-
onClick: onClickCallback
|
|
61
|
+
onClick: onClickCallback,
|
|
62
|
+
onKeyDown: (0, _expValEquals.expValEquals)('platform_editor_a11y_eslint_fix', 'isEnabled', true) ? onClickCallback : undefined,
|
|
63
|
+
onFocus: (0, _expValEquals.expValEquals)('platform_editor_a11y_eslint_fix', 'isEnabled', true) ? onClickCallback : undefined,
|
|
64
|
+
tabIndex: (0, _expValEquals.expValEquals)('platform_editor_a11y_eslint_fix', 'isEnabled', true) ? 0 : undefined
|
|
62
65
|
}, (0, _react2.jsx)(_tooltip.default, {
|
|
63
66
|
content: intl.formatMessage(_extensions.configPanelMessages.removeField),
|
|
64
67
|
position: "left"
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
2
|
+
import { INPUT_METHOD, ACTION, ACTION_SUBJECT, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
3
3
|
import { messages, NATIVE_EMBED_EXTENSION_TYPE } from '@atlaskit/editor-common/extensions';
|
|
4
4
|
import commonMessages from '@atlaskit/editor-common/messages';
|
|
5
5
|
import { BODIED_EXT_MBE_MARGIN_TOP } from '@atlaskit/editor-common/styles';
|
|
@@ -302,6 +302,17 @@ export const createOnClickCopyButton = ({
|
|
|
302
302
|
|
|
303
303
|
// this command copies the text content of the unsupported content extension to the clipboard
|
|
304
304
|
return editorState => {
|
|
305
|
+
var _extensionApi$analyti;
|
|
306
|
+
extensionApi === null || extensionApi === void 0 ? void 0 : (_extensionApi$analyti = extensionApi.analytics) === null || _extensionApi$analyti === void 0 ? void 0 : _extensionApi$analyti.actions.fireAnalyticsEvent({
|
|
307
|
+
action: ACTION.CLICKED,
|
|
308
|
+
actionSubject: ACTION_SUBJECT.COPY_BUTTON,
|
|
309
|
+
actionSubjectId: node.type.name,
|
|
310
|
+
eventType: EVENT_TYPE.UI,
|
|
311
|
+
attributes: {
|
|
312
|
+
extensionType: node.attrs.extensionType,
|
|
313
|
+
extensionKey: node.attrs.extensionKey
|
|
314
|
+
}
|
|
315
|
+
});
|
|
305
316
|
copyUnsupportedContentToClipboard({
|
|
306
317
|
locale,
|
|
307
318
|
unsupportedContent: adf,
|
|
@@ -325,7 +336,7 @@ export const getToolbarConfig = ({
|
|
|
325
336
|
extensionApi,
|
|
326
337
|
getUnsupportedContent
|
|
327
338
|
}) => (state, intl) => {
|
|
328
|
-
var _extensionApi$decorat, _extensionApi$context, _extensionApi$
|
|
339
|
+
var _extensionApi$decorat, _extensionApi$context, _extensionApi$analyti2, _extensionApi$connect, _extensionApi$connect2, _extensionApi$connect3;
|
|
329
340
|
const {
|
|
330
341
|
formatMessage,
|
|
331
342
|
locale
|
|
@@ -336,7 +347,7 @@ export const getToolbarConfig = ({
|
|
|
336
347
|
} = extensionState;
|
|
337
348
|
const hoverDecoration = extensionApi === null || extensionApi === void 0 ? void 0 : (_extensionApi$decorat = extensionApi.decorations) === null || _extensionApi$decorat === void 0 ? void 0 : _extensionApi$decorat.actions.hoverDecoration;
|
|
338
349
|
const applyChangeToContextPanel = extensionApi === null || extensionApi === void 0 ? void 0 : (_extensionApi$context = extensionApi.contextPanel) === null || _extensionApi$context === void 0 ? void 0 : _extensionApi$context.actions.applyChange;
|
|
339
|
-
const editorAnalyticsAPI = extensionApi === null || extensionApi === void 0 ? void 0 : (_extensionApi$
|
|
350
|
+
const editorAnalyticsAPI = extensionApi === null || extensionApi === void 0 ? void 0 : (_extensionApi$analyti2 = extensionApi.analytics) === null || _extensionApi$analyti2 === void 0 ? void 0 : _extensionApi$analyti2.actions;
|
|
340
351
|
if (!extensionState || extensionState.showContextPanel || !extensionState.element) {
|
|
341
352
|
return;
|
|
342
353
|
}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
3
|
import React, { useCallback, useEffect, useRef } from 'react';
|
|
4
|
+
import { bind } from 'bind-event-listener';
|
|
4
5
|
import _isEqual from 'lodash/isEqual';
|
|
5
6
|
import _mergeRecursive from 'lodash/merge';
|
|
6
7
|
import memoizeOne from 'memoize-one';
|
|
7
8
|
import { injectIntl } from 'react-intl-next';
|
|
8
9
|
import { withAnalyticsContext, withAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
10
|
+
import { getDocument } from '@atlaskit/browser-apis';
|
|
9
11
|
import ButtonGroup from '@atlaskit/button/button-group';
|
|
10
12
|
import Button from '@atlaskit/button/new';
|
|
11
13
|
import { ACTION, ACTION_SUBJECT, EVENT_TYPE, fireAnalyticsEvent } from '@atlaskit/editor-common/analytics';
|
|
@@ -13,6 +15,7 @@ import { isTabGroup, configPanelMessages as messages } from '@atlaskit/editor-co
|
|
|
13
15
|
import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
|
|
14
16
|
import Form, { FormFooter } from '@atlaskit/form';
|
|
15
17
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
18
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
16
19
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
17
20
|
import { ALLOWED_LOGGED_MACRO_PARAMS } from './constants';
|
|
18
21
|
import { DescriptionSummary } from './DescriptionSummary';
|
|
@@ -292,6 +295,7 @@ class ConfigPanel extends React.Component {
|
|
|
292
295
|
firstVisibleFieldName: props.fields ? this.getFirstVisibleFieldName(props.fields) : undefined
|
|
293
296
|
};
|
|
294
297
|
this.onFieldChange = null;
|
|
298
|
+
this.unbindKeyDownHandler = null;
|
|
295
299
|
}
|
|
296
300
|
componentDidMount() {
|
|
297
301
|
const {
|
|
@@ -299,8 +303,18 @@ class ConfigPanel extends React.Component {
|
|
|
299
303
|
parameters
|
|
300
304
|
} = this.props;
|
|
301
305
|
this.parseParameters(fields, parameters);
|
|
306
|
+
if (expValEquals('platform_editor_a11y_eslint_fix', 'isEnabled', true)) {
|
|
307
|
+
const doc = getDocument();
|
|
308
|
+
if (doc) {
|
|
309
|
+
this.unbindKeyDownHandler = bind(doc, {
|
|
310
|
+
type: 'keydown',
|
|
311
|
+
listener: this.handleKeyDown
|
|
312
|
+
});
|
|
313
|
+
}
|
|
314
|
+
}
|
|
302
315
|
}
|
|
303
316
|
componentWillUnmount() {
|
|
317
|
+
var _this$unbindKeyDownHa;
|
|
304
318
|
const {
|
|
305
319
|
createAnalyticsEvent,
|
|
306
320
|
extensionManifest,
|
|
@@ -309,6 +323,7 @@ class ConfigPanel extends React.Component {
|
|
|
309
323
|
const {
|
|
310
324
|
currentParameters
|
|
311
325
|
} = this.state;
|
|
326
|
+
(_this$unbindKeyDownHa = this.unbindKeyDownHandler) === null || _this$unbindKeyDownHa === void 0 ? void 0 : _this$unbindKeyDownHa.call(this);
|
|
312
327
|
fireAnalyticsEvent(createAnalyticsEvent)({
|
|
313
328
|
payload: {
|
|
314
329
|
action: ACTION.CLOSED,
|
|
@@ -395,32 +410,28 @@ class ConfigPanel extends React.Component {
|
|
|
395
410
|
handleSubmit: handleSubmit
|
|
396
411
|
}, onFieldChange => {
|
|
397
412
|
this.onFieldChange = onFieldChange;
|
|
398
|
-
return (
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
featureFlags: featureFlags,
|
|
421
|
-
disableFields: this.props.disableFields
|
|
422
|
-
}))
|
|
423
|
-
);
|
|
413
|
+
return /*#__PURE__*/React.createElement("form", _extends({}, formProps, {
|
|
414
|
+
noValidate: true,
|
|
415
|
+
onKeyDown: expValEquals('platform_editor_a11y_eslint_fix', 'isEnabled', true) ? undefined : handleKeyDown,
|
|
416
|
+
"data-testid": "extension-config-panel"
|
|
417
|
+
}), this.renderHeader(extensionManifest), fg('platform_editor_ai_object_sidebar_injection') && /*#__PURE__*/React.createElement(DescriptionSummary, {
|
|
418
|
+
extensionManifest: extensionManifest
|
|
419
|
+
}), /*#__PURE__*/React.createElement(ConfigFormIntlWithBoundary, {
|
|
420
|
+
api: api,
|
|
421
|
+
canSave: false,
|
|
422
|
+
errorMessage: errorMessage,
|
|
423
|
+
extensionManifest: extensionManifest,
|
|
424
|
+
fields: fields !== null && fields !== void 0 ? fields : [],
|
|
425
|
+
firstVisibleFieldName: firstVisibleFieldName,
|
|
426
|
+
hasParsedParameters: hasParsedParameters,
|
|
427
|
+
isLoading: isLoading || false,
|
|
428
|
+
onCancel: onCancel,
|
|
429
|
+
onFieldChange: onFieldChange,
|
|
430
|
+
parameters: currentParameters,
|
|
431
|
+
submitting: submitting,
|
|
432
|
+
featureFlags: featureFlags,
|
|
433
|
+
disableFields: this.props.disableFields
|
|
434
|
+
}));
|
|
424
435
|
});
|
|
425
436
|
});
|
|
426
437
|
}
|
|
@@ -79,8 +79,11 @@ function SafeSmartUserPicker({
|
|
|
79
79
|
async function hydrate() {
|
|
80
80
|
const hydrated = await hydrateDefaultValues(undefined,
|
|
81
81
|
// no need to override baseUrl
|
|
82
|
-
makeCompat(safeValue), productKey, undefined
|
|
83
|
-
|
|
82
|
+
makeCompat(safeValue), productKey, undefined,
|
|
83
|
+
// no need to override siteId
|
|
84
|
+
{
|
|
85
|
+
tenantId: siteId
|
|
86
|
+
});
|
|
84
87
|
if (cancel || !isOptionData(hydrated)) {
|
|
85
88
|
return;
|
|
86
89
|
}
|
|
@@ -90,7 +93,7 @@ function SafeSmartUserPicker({
|
|
|
90
93
|
return () => {
|
|
91
94
|
cancel = true;
|
|
92
95
|
};
|
|
93
|
-
}, [safeValue, productKey]);
|
|
96
|
+
}, [safeValue, productKey, siteId]);
|
|
94
97
|
return /*#__PURE__*/React.createElement(SmartUserPicker
|
|
95
98
|
// Ignored via go/ees005
|
|
96
99
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
@@ -10,6 +10,7 @@ import { injectIntl } from 'react-intl-next';
|
|
|
10
10
|
import { configPanelMessages as messages } from '@atlaskit/editor-common/extensions';
|
|
11
11
|
import CrossCircleIcon from '@atlaskit/icon/core/cross-circle';
|
|
12
12
|
import { N80, R300 } from '@atlaskit/theme/colors';
|
|
13
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
13
14
|
import Tooltip from '@atlaskit/tooltip';
|
|
14
15
|
const removableFieldWrapperStyles = css({
|
|
15
16
|
position: 'relative',
|
|
@@ -44,12 +45,14 @@ const RemovableField = ({
|
|
|
44
45
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
45
46
|
,
|
|
46
47
|
className: className
|
|
47
|
-
}, children, canRemoveField &&
|
|
48
|
-
|
|
49
|
-
jsx("div", {
|
|
48
|
+
}, children, canRemoveField && jsx("div", {
|
|
49
|
+
role: expValEquals('platform_editor_a11y_eslint_fix', 'isEnabled', true) ? 'button' : undefined,
|
|
50
50
|
css: removeButtonWrapperStyles,
|
|
51
51
|
"data-testid": `remove-field-${name}`,
|
|
52
|
-
onClick: onClickCallback
|
|
52
|
+
onClick: onClickCallback,
|
|
53
|
+
onKeyDown: expValEquals('platform_editor_a11y_eslint_fix', 'isEnabled', true) ? onClickCallback : undefined,
|
|
54
|
+
onFocus: expValEquals('platform_editor_a11y_eslint_fix', 'isEnabled', true) ? onClickCallback : undefined,
|
|
55
|
+
tabIndex: expValEquals('platform_editor_a11y_eslint_fix', 'isEnabled', true) ? 0 : undefined
|
|
53
56
|
}, jsx(Tooltip, {
|
|
54
57
|
content: intl.formatMessage(messages.removeField),
|
|
55
58
|
position: "left"
|
|
@@ -3,7 +3,7 @@ import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
|
3
3
|
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; }
|
|
4
4
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
5
5
|
import React from 'react';
|
|
6
|
-
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
6
|
+
import { INPUT_METHOD, ACTION, ACTION_SUBJECT, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
7
7
|
import { messages, NATIVE_EMBED_EXTENSION_TYPE } from '@atlaskit/editor-common/extensions';
|
|
8
8
|
import commonMessages from '@atlaskit/editor-common/messages';
|
|
9
9
|
import { BODIED_EXT_MBE_MARGIN_TOP } from '@atlaskit/editor-common/styles';
|
|
@@ -294,6 +294,17 @@ export var createOnClickCopyButton = function createOnClickCopyButton(_ref) {
|
|
|
294
294
|
|
|
295
295
|
// this command copies the text content of the unsupported content extension to the clipboard
|
|
296
296
|
return function (editorState) {
|
|
297
|
+
var _extensionApi$analyti;
|
|
298
|
+
extensionApi === null || extensionApi === void 0 || (_extensionApi$analyti = extensionApi.analytics) === null || _extensionApi$analyti === void 0 || _extensionApi$analyti.actions.fireAnalyticsEvent({
|
|
299
|
+
action: ACTION.CLICKED,
|
|
300
|
+
actionSubject: ACTION_SUBJECT.COPY_BUTTON,
|
|
301
|
+
actionSubjectId: node.type.name,
|
|
302
|
+
eventType: EVENT_TYPE.UI,
|
|
303
|
+
attributes: {
|
|
304
|
+
extensionType: node.attrs.extensionType,
|
|
305
|
+
extensionKey: node.attrs.extensionKey
|
|
306
|
+
}
|
|
307
|
+
});
|
|
297
308
|
copyUnsupportedContentToClipboard({
|
|
298
309
|
locale: locale,
|
|
299
310
|
unsupportedContent: adf,
|
|
@@ -318,14 +329,14 @@ export var getToolbarConfig = function getToolbarConfig(_ref2) {
|
|
|
318
329
|
extensionApi = _ref2.extensionApi,
|
|
319
330
|
getUnsupportedContent = _ref2.getUnsupportedContent;
|
|
320
331
|
return function (state, intl) {
|
|
321
|
-
var _extensionApi$decorat, _extensionApi$context, _extensionApi$
|
|
332
|
+
var _extensionApi$decorat, _extensionApi$context, _extensionApi$analyti2, _extensionApi$connect;
|
|
322
333
|
var formatMessage = intl.formatMessage,
|
|
323
334
|
locale = intl.locale;
|
|
324
335
|
var extensionState = getPluginState(state);
|
|
325
336
|
var extensionProvider = extensionState.extensionProvider;
|
|
326
337
|
var hoverDecoration = extensionApi === null || extensionApi === void 0 || (_extensionApi$decorat = extensionApi.decorations) === null || _extensionApi$decorat === void 0 ? void 0 : _extensionApi$decorat.actions.hoverDecoration;
|
|
327
338
|
var applyChangeToContextPanel = extensionApi === null || extensionApi === void 0 || (_extensionApi$context = extensionApi.contextPanel) === null || _extensionApi$context === void 0 ? void 0 : _extensionApi$context.actions.applyChange;
|
|
328
|
-
var editorAnalyticsAPI = extensionApi === null || extensionApi === void 0 || (_extensionApi$
|
|
339
|
+
var editorAnalyticsAPI = extensionApi === null || extensionApi === void 0 || (_extensionApi$analyti2 = extensionApi.analytics) === null || _extensionApi$analyti2 === void 0 ? void 0 : _extensionApi$analyti2.actions;
|
|
329
340
|
if (!extensionState || extensionState.showContextPanel || !extensionState.element) {
|
|
330
341
|
return;
|
|
331
342
|
}
|
|
@@ -12,11 +12,13 @@ import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
|
12
12
|
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
13
13
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
14
14
|
import React, { useCallback, useEffect, useRef } from 'react';
|
|
15
|
+
import { bind } from 'bind-event-listener';
|
|
15
16
|
import _isEqual from 'lodash/isEqual';
|
|
16
17
|
import _mergeRecursive from 'lodash/merge';
|
|
17
18
|
import memoizeOne from 'memoize-one';
|
|
18
19
|
import { injectIntl } from 'react-intl-next';
|
|
19
20
|
import { withAnalyticsContext, withAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
21
|
+
import { getDocument } from '@atlaskit/browser-apis';
|
|
20
22
|
import ButtonGroup from '@atlaskit/button/button-group';
|
|
21
23
|
import Button from '@atlaskit/button/new';
|
|
22
24
|
import { ACTION, ACTION_SUBJECT, EVENT_TYPE, fireAnalyticsEvent } from '@atlaskit/editor-common/analytics';
|
|
@@ -24,6 +26,7 @@ import { isTabGroup, configPanelMessages as messages } from '@atlaskit/editor-co
|
|
|
24
26
|
import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
|
|
25
27
|
import Form, { FormFooter } from '@atlaskit/form';
|
|
26
28
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
29
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
27
30
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
28
31
|
import { ALLOWED_LOGGED_MACRO_PARAMS } from './constants';
|
|
29
32
|
import { DescriptionSummary } from './DescriptionSummary';
|
|
@@ -345,6 +348,7 @@ var ConfigPanel = /*#__PURE__*/function (_React$Component) {
|
|
|
345
348
|
firstVisibleFieldName: props.fields ? _this.getFirstVisibleFieldName(props.fields) : undefined
|
|
346
349
|
};
|
|
347
350
|
_this.onFieldChange = null;
|
|
351
|
+
_this.unbindKeyDownHandler = null;
|
|
348
352
|
return _this;
|
|
349
353
|
}
|
|
350
354
|
_inherits(ConfigPanel, _React$Component);
|
|
@@ -355,15 +359,26 @@ var ConfigPanel = /*#__PURE__*/function (_React$Component) {
|
|
|
355
359
|
fields = _this$props3.fields,
|
|
356
360
|
parameters = _this$props3.parameters;
|
|
357
361
|
this.parseParameters(fields, parameters);
|
|
362
|
+
if (expValEquals('platform_editor_a11y_eslint_fix', 'isEnabled', true)) {
|
|
363
|
+
var doc = getDocument();
|
|
364
|
+
if (doc) {
|
|
365
|
+
this.unbindKeyDownHandler = bind(doc, {
|
|
366
|
+
type: 'keydown',
|
|
367
|
+
listener: this.handleKeyDown
|
|
368
|
+
});
|
|
369
|
+
}
|
|
370
|
+
}
|
|
358
371
|
}
|
|
359
372
|
}, {
|
|
360
373
|
key: "componentWillUnmount",
|
|
361
374
|
value: function componentWillUnmount() {
|
|
375
|
+
var _this$unbindKeyDownHa;
|
|
362
376
|
var _this$props4 = this.props,
|
|
363
377
|
createAnalyticsEvent = _this$props4.createAnalyticsEvent,
|
|
364
378
|
extensionManifest = _this$props4.extensionManifest,
|
|
365
379
|
fields = _this$props4.fields;
|
|
366
380
|
var currentParameters = this.state.currentParameters;
|
|
381
|
+
(_this$unbindKeyDownHa = this.unbindKeyDownHandler) === null || _this$unbindKeyDownHa === void 0 || _this$unbindKeyDownHa.call(this);
|
|
367
382
|
fireAnalyticsEvent(createAnalyticsEvent)({
|
|
368
383
|
payload: {
|
|
369
384
|
action: ACTION.CLOSED,
|
|
@@ -447,32 +462,28 @@ var ConfigPanel = /*#__PURE__*/function (_React$Component) {
|
|
|
447
462
|
handleSubmit: handleSubmit
|
|
448
463
|
}, function (onFieldChange) {
|
|
449
464
|
_this2.onFieldChange = onFieldChange;
|
|
450
|
-
return (
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
featureFlags: featureFlags,
|
|
473
|
-
disableFields: _this2.props.disableFields
|
|
474
|
-
}))
|
|
475
|
-
);
|
|
465
|
+
return /*#__PURE__*/React.createElement("form", _extends({}, formProps, {
|
|
466
|
+
noValidate: true,
|
|
467
|
+
onKeyDown: expValEquals('platform_editor_a11y_eslint_fix', 'isEnabled', true) ? undefined : handleKeyDown,
|
|
468
|
+
"data-testid": "extension-config-panel"
|
|
469
|
+
}), _this2.renderHeader(extensionManifest), fg('platform_editor_ai_object_sidebar_injection') && /*#__PURE__*/React.createElement(DescriptionSummary, {
|
|
470
|
+
extensionManifest: extensionManifest
|
|
471
|
+
}), /*#__PURE__*/React.createElement(ConfigFormIntlWithBoundary, {
|
|
472
|
+
api: api,
|
|
473
|
+
canSave: false,
|
|
474
|
+
errorMessage: errorMessage,
|
|
475
|
+
extensionManifest: extensionManifest,
|
|
476
|
+
fields: fields !== null && fields !== void 0 ? fields : [],
|
|
477
|
+
firstVisibleFieldName: firstVisibleFieldName,
|
|
478
|
+
hasParsedParameters: hasParsedParameters,
|
|
479
|
+
isLoading: isLoading || false,
|
|
480
|
+
onCancel: onCancel,
|
|
481
|
+
onFieldChange: onFieldChange,
|
|
482
|
+
parameters: currentParameters,
|
|
483
|
+
submitting: submitting,
|
|
484
|
+
featureFlags: featureFlags,
|
|
485
|
+
disableFields: _this2.props.disableFields
|
|
486
|
+
}));
|
|
476
487
|
});
|
|
477
488
|
});
|
|
478
489
|
}
|
|
@@ -104,8 +104,11 @@ function SafeSmartUserPicker(_ref) {
|
|
|
104
104
|
_context.next = 2;
|
|
105
105
|
return hydrateDefaultValues(undefined,
|
|
106
106
|
// no need to override baseUrl
|
|
107
|
-
makeCompat(safeValue), productKey, undefined
|
|
108
|
-
|
|
107
|
+
makeCompat(safeValue), productKey, undefined,
|
|
108
|
+
// no need to override siteId
|
|
109
|
+
{
|
|
110
|
+
tenantId: siteId
|
|
111
|
+
});
|
|
109
112
|
case 2:
|
|
110
113
|
hydrated = _context.sent;
|
|
111
114
|
if (!(cancel || !isOptionData(hydrated))) {
|
|
@@ -127,7 +130,7 @@ function SafeSmartUserPicker(_ref) {
|
|
|
127
130
|
return function () {
|
|
128
131
|
cancel = true;
|
|
129
132
|
};
|
|
130
|
-
}, [safeValue, productKey]);
|
|
133
|
+
}, [safeValue, productKey, siteId]);
|
|
131
134
|
return /*#__PURE__*/React.createElement(SmartUserPicker
|
|
132
135
|
// Ignored via go/ees005
|
|
133
136
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
@@ -10,6 +10,7 @@ import { injectIntl } from 'react-intl-next';
|
|
|
10
10
|
import { configPanelMessages as messages } from '@atlaskit/editor-common/extensions';
|
|
11
11
|
import CrossCircleIcon from '@atlaskit/icon/core/cross-circle';
|
|
12
12
|
import { N80, R300 } from '@atlaskit/theme/colors';
|
|
13
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
13
14
|
import Tooltip from '@atlaskit/tooltip';
|
|
14
15
|
var removableFieldWrapperStyles = css({
|
|
15
16
|
position: 'relative',
|
|
@@ -45,12 +46,14 @@ var RemovableField = function RemovableField(_ref) {
|
|
|
45
46
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
46
47
|
,
|
|
47
48
|
className: className
|
|
48
|
-
}, children, canRemoveField &&
|
|
49
|
-
|
|
50
|
-
jsx("div", {
|
|
49
|
+
}, children, canRemoveField && jsx("div", {
|
|
50
|
+
role: expValEquals('platform_editor_a11y_eslint_fix', 'isEnabled', true) ? 'button' : undefined,
|
|
51
51
|
css: removeButtonWrapperStyles,
|
|
52
52
|
"data-testid": "remove-field-".concat(name),
|
|
53
|
-
onClick: onClickCallback
|
|
53
|
+
onClick: onClickCallback,
|
|
54
|
+
onKeyDown: expValEquals('platform_editor_a11y_eslint_fix', 'isEnabled', true) ? onClickCallback : undefined,
|
|
55
|
+
onFocus: expValEquals('platform_editor_a11y_eslint_fix', 'isEnabled', true) ? onClickCallback : undefined,
|
|
56
|
+
tabIndex: expValEquals('platform_editor_a11y_eslint_fix', 'isEnabled', true) ? 0 : undefined
|
|
54
57
|
}, jsx(Tooltip, {
|
|
55
58
|
content: intl.formatMessage(messages.removeField),
|
|
56
59
|
position: "left"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-extension",
|
|
3
|
-
"version": "10.1.
|
|
3
|
+
"version": "10.1.8",
|
|
4
4
|
"description": "editor-plugin-extension plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
"@atlaskit/adf-utils": "^19.27.0",
|
|
26
26
|
"@atlaskit/analytics-next": "^11.1.0",
|
|
27
27
|
"@atlaskit/avatar": "^25.8.0",
|
|
28
|
+
"@atlaskit/browser-apis": "^0.0.1",
|
|
28
29
|
"@atlaskit/button": "^23.9.0",
|
|
29
30
|
"@atlaskit/checkbox": "^17.3.0",
|
|
30
31
|
"@atlaskit/datetime-picker": "^17.5.0",
|
|
@@ -45,7 +46,7 @@
|
|
|
45
46
|
"@atlaskit/heading": "^5.3.0",
|
|
46
47
|
"@atlaskit/icon": "^31.0.0",
|
|
47
48
|
"@atlaskit/link": "^3.3.0",
|
|
48
|
-
"@atlaskit/mention": "^24.
|
|
49
|
+
"@atlaskit/mention": "^24.5.0",
|
|
49
50
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
50
51
|
"@atlaskit/primitives": "^18.0.0",
|
|
51
52
|
"@atlaskit/radio": "^8.4.0",
|
|
@@ -57,7 +58,7 @@
|
|
|
57
58
|
"@atlaskit/textarea": "^8.2.0",
|
|
58
59
|
"@atlaskit/textfield": "^8.2.0",
|
|
59
60
|
"@atlaskit/theme": "^21.0.0",
|
|
60
|
-
"@atlaskit/tmp-editor-statsig": "^29.
|
|
61
|
+
"@atlaskit/tmp-editor-statsig": "^29.6.0",
|
|
61
62
|
"@atlaskit/toggle": "^15.2.0",
|
|
62
63
|
"@atlaskit/tokens": "^11.0.0",
|
|
63
64
|
"@atlaskit/tooltip": "^20.14.0",
|
|
@@ -71,7 +72,7 @@
|
|
|
71
72
|
"uuid": "^3.1.0"
|
|
72
73
|
},
|
|
73
74
|
"peerDependencies": {
|
|
74
|
-
"@atlaskit/editor-common": "^111.
|
|
75
|
+
"@atlaskit/editor-common": "^111.20.0",
|
|
75
76
|
"react": "^18.2.0",
|
|
76
77
|
"react-intl-next": "npm:react-intl@^5.18.1"
|
|
77
78
|
},
|