@atlaskit/editor-plugin-floating-toolbar 8.2.18 → 8.2.20
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 +17 -0
- package/dist/cjs/floatingToolbarPlugin.js +21 -1
- package/dist/cjs/pm-plugins/force-focus/index.js +2 -0
- package/dist/cjs/ui/CheckboxModal.js +5 -3
- package/dist/cjs/ui/SimpleModal.js +1 -2
- package/dist/es2019/floatingToolbarPlugin.js +21 -1
- package/dist/es2019/pm-plugins/force-focus/index.js +2 -0
- package/dist/es2019/ui/CheckboxModal.js +5 -3
- package/dist/es2019/ui/SimpleModal.js +1 -2
- package/dist/esm/floatingToolbarPlugin.js +21 -1
- package/dist/esm/pm-plugins/force-focus/index.js +2 -0
- package/dist/esm/ui/CheckboxModal.js +5 -3
- package/dist/esm/ui/SimpleModal.js +1 -2
- package/package.json +10 -13
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-floating-toolbar
|
|
2
2
|
|
|
3
|
+
## 8.2.20
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`4d676bbdb3ce6`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/4d676bbdb3ce6) -
|
|
8
|
+
ts-ignore added temporarily to unblock local consumption for help-center, will be removed once
|
|
9
|
+
project refs are setup
|
|
10
|
+
- Updated dependencies
|
|
11
|
+
|
|
12
|
+
## 8.2.19
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- [`24092f8832d34`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/24092f8832d34) -
|
|
17
|
+
[EDITOR-3321] Clean up platform_editor_update_modal_close_button
|
|
18
|
+
- Updated dependencies
|
|
19
|
+
|
|
3
20
|
## 8.2.18
|
|
4
21
|
|
|
5
22
|
### Patch Changes
|
|
@@ -45,6 +45,8 @@ var SUPPRESS_TOOLBAR_USER_INTENTS = ['dragging', 'tableContextualMenuPopupOpen',
|
|
|
45
45
|
var getRelevantConfig = exports.getRelevantConfig = function getRelevantConfig(selection, configs) {
|
|
46
46
|
// node selections always take precedence, see if
|
|
47
47
|
var configPair;
|
|
48
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
49
|
+
|
|
48
50
|
configs.find(function (config) {
|
|
49
51
|
var node = (0, _utils.findSelectedNodeOfType)(config.nodeType)(selection);
|
|
50
52
|
if (node) {
|
|
@@ -62,8 +64,12 @@ var getRelevantConfig = exports.getRelevantConfig = function getRelevantConfig(s
|
|
|
62
64
|
|
|
63
65
|
// create mapping of node type name to configs
|
|
64
66
|
var configByNodeType = {};
|
|
67
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
68
|
+
|
|
65
69
|
configs.forEach(function (config) {
|
|
66
70
|
if (Array.isArray(config.nodeType)) {
|
|
71
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
72
|
+
|
|
67
73
|
config.nodeType.forEach(function (nodeType) {
|
|
68
74
|
configByNodeType[nodeType.name] = config;
|
|
69
75
|
});
|
|
@@ -327,6 +333,8 @@ function ContentComponent(_ref5) {
|
|
|
327
333
|
if (isInViewMode) {
|
|
328
334
|
// Typescript note: Not all toolbar item types have the `supportsViewMode` prop.
|
|
329
335
|
var toolbarItemViewModeProp = 'supportsViewMode';
|
|
336
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
337
|
+
|
|
330
338
|
items = iterableItems.filter(function (item) {
|
|
331
339
|
return toolbarItemViewModeProp in item && !!item[toolbarItemViewModeProp];
|
|
332
340
|
});
|
|
@@ -335,11 +343,15 @@ function ContentComponent(_ref5) {
|
|
|
335
343
|
var _items2;
|
|
336
344
|
// Consolidate floating toolbar items
|
|
337
345
|
var toolbarItemsArray = Array.isArray(items) ? items : (_items2 = items) === null || _items2 === void 0 ? void 0 : _items2(node);
|
|
346
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
347
|
+
|
|
338
348
|
var overflowDropdownItems = toolbarItemsArray.filter(function (item) {
|
|
339
349
|
return item.type === 'overflow-dropdown';
|
|
340
350
|
});
|
|
341
351
|
if (overflowDropdownItems.length > 1) {
|
|
342
352
|
var consolidatedOverflowDropdown = (0, _utils3.consolidateOverflowDropdownItems)(overflowDropdownItems);
|
|
353
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
354
|
+
|
|
343
355
|
var otherItems = toolbarItemsArray.filter(function (item) {
|
|
344
356
|
return item.type !== 'overflow-dropdown';
|
|
345
357
|
});
|
|
@@ -361,6 +373,8 @@ function ContentComponent(_ref5) {
|
|
|
361
373
|
if (overflowDropdownItems.length > 0 && dispatchAnalyticsEvent) {
|
|
362
374
|
var _items3;
|
|
363
375
|
var currentItems = Array.isArray(items) ? items : (_items3 = items) === null || _items3 === void 0 ? void 0 : _items3(node);
|
|
376
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
377
|
+
|
|
364
378
|
var updatedItems = currentItems.map(function (item) {
|
|
365
379
|
if (item.type !== 'overflow-dropdown') {
|
|
366
380
|
return item;
|
|
@@ -532,6 +546,8 @@ function sanitizeFloatingToolbarConfig(config) {
|
|
|
532
546
|
// Cleanup from non existing node types
|
|
533
547
|
if (Array.isArray(config.nodeType)) {
|
|
534
548
|
return _objectSpread(_objectSpread({}, config), {}, {
|
|
549
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
550
|
+
|
|
535
551
|
nodeType: config.nodeType.filter(filterUndefined)
|
|
536
552
|
});
|
|
537
553
|
}
|
|
@@ -607,7 +623,9 @@ function floatingToolbarPluginFactory(options) {
|
|
|
607
623
|
getConfigWithNodeInfo: getConfigWithNodeInfo
|
|
608
624
|
};
|
|
609
625
|
},
|
|
610
|
-
apply: (0, _expValEquals.expValEquals)('platform_editor_lovability_suppress_toolbar_event', 'isEnabled', true)
|
|
626
|
+
apply: (0, _expValEquals.expValEquals)('platform_editor_lovability_suppress_toolbar_event', 'isEnabled', true)
|
|
627
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
628
|
+
? function (_tr, _pluginState, __oldEditorState, newEditorState) {
|
|
611
629
|
var suppressedToolbar = getIsToolbarSuppressed(newEditorState);
|
|
612
630
|
var newPluginState = {
|
|
613
631
|
getConfigWithNodeInfo: getConfigWithNodeInfo,
|
|
@@ -618,6 +636,8 @@ function floatingToolbarPluginFactory(options) {
|
|
|
618
636
|
},
|
|
619
637
|
view: (0, _expValEquals.expValEquals)('platform_editor_lovability_suppress_toolbar_event', 'isEnabled', true) ? function () {
|
|
620
638
|
return {
|
|
639
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
640
|
+
|
|
621
641
|
update: function update(view, prevState) {
|
|
622
642
|
var pluginState = pluginKey.getState(view.state);
|
|
623
643
|
var prevPluginState = pluginKey.getState(prevState);
|
|
@@ -21,6 +21,8 @@ var _default = exports.default = function _default() {
|
|
|
21
21
|
selector: null
|
|
22
22
|
};
|
|
23
23
|
},
|
|
24
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
25
|
+
|
|
24
26
|
apply: function apply(tr, prevState) {
|
|
25
27
|
var meta = tr.getMeta(forceFocusStateKey);
|
|
26
28
|
if (meta && 'selector' in meta) {
|
|
@@ -13,7 +13,6 @@ var _new = _interopRequireDefault(require("@atlaskit/button/new"));
|
|
|
13
13
|
var _checkbox = require("@atlaskit/checkbox");
|
|
14
14
|
var _floatingToolbar = require("@atlaskit/editor-common/floating-toolbar");
|
|
15
15
|
var _modalDialog = _interopRequireWildcard(require("@atlaskit/modal-dialog"));
|
|
16
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
17
16
|
var _compiled = require("@atlaskit/primitives/compiled");
|
|
18
17
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
19
18
|
var CheckboxModal = exports.CheckboxModal = function CheckboxModal(props) {
|
|
@@ -63,7 +62,7 @@ var CheckboxModal = exports.CheckboxModal = function CheckboxModal(props) {
|
|
|
63
62
|
onClose: onClose,
|
|
64
63
|
testId: testId
|
|
65
64
|
}, /*#__PURE__*/_react.default.createElement(_modalDialog.ModalHeader, {
|
|
66
|
-
hasCloseButton:
|
|
65
|
+
hasCloseButton: true
|
|
67
66
|
}, /*#__PURE__*/_react.default.createElement(_modalDialog.ModalTitle, {
|
|
68
67
|
appearance: "warning"
|
|
69
68
|
}, heading)), /*#__PURE__*/_react.default.createElement(_modalDialog.ModalBody, null, /*#__PURE__*/_react.default.createElement(_compiled.Text, {
|
|
@@ -77,7 +76,10 @@ var CheckboxModal = exports.CheckboxModal = function CheckboxModal(props) {
|
|
|
77
76
|
onChange: function onChange() {
|
|
78
77
|
return setCheckbox(!isChecked);
|
|
79
78
|
},
|
|
80
|
-
label: checkboxlabel
|
|
79
|
+
label: checkboxlabel
|
|
80
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
81
|
+
,
|
|
82
|
+
|
|
81
83
|
testId: testId ? "".concat(testId, "-checkbox") : undefined
|
|
82
84
|
}))), /*#__PURE__*/_react.default.createElement(_modalDialog.ModalFooter, null, /*#__PURE__*/_react.default.createElement(_new.default, {
|
|
83
85
|
appearance: "default",
|
|
@@ -10,7 +10,6 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
10
10
|
var _new = _interopRequireDefault(require("@atlaskit/button/new"));
|
|
11
11
|
var _floatingToolbar = require("@atlaskit/editor-common/floating-toolbar");
|
|
12
12
|
var _modalDialog = _interopRequireWildcard(require("@atlaskit/modal-dialog"));
|
|
13
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
14
13
|
var _compiled = require("@atlaskit/primitives/compiled");
|
|
15
14
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
16
15
|
var SimpleModal = exports.SimpleModal = function SimpleModal(props) {
|
|
@@ -26,7 +25,7 @@ var SimpleModal = exports.SimpleModal = function SimpleModal(props) {
|
|
|
26
25
|
onClose: onClose,
|
|
27
26
|
testId: testId
|
|
28
27
|
}, /*#__PURE__*/_react.default.createElement(_modalDialog.ModalHeader, {
|
|
29
|
-
hasCloseButton:
|
|
28
|
+
hasCloseButton: true
|
|
30
29
|
}, /*#__PURE__*/_react.default.createElement(_modalDialog.ModalTitle, {
|
|
31
30
|
appearance: "warning"
|
|
32
31
|
}, heading)), /*#__PURE__*/_react.default.createElement(_modalDialog.ModalBody, null, /*#__PURE__*/_react.default.createElement(_compiled.Text, {
|
|
@@ -31,6 +31,8 @@ const SUPPRESS_TOOLBAR_USER_INTENTS = ['dragging', 'tableContextualMenuPopupOpen
|
|
|
31
31
|
export const getRelevantConfig = (selection, configs) => {
|
|
32
32
|
// node selections always take precedence, see if
|
|
33
33
|
let configPair;
|
|
34
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
35
|
+
|
|
34
36
|
configs.find(config => {
|
|
35
37
|
const node = findSelectedNodeOfType(config.nodeType)(selection);
|
|
36
38
|
if (node) {
|
|
@@ -48,8 +50,12 @@ export const getRelevantConfig = (selection, configs) => {
|
|
|
48
50
|
|
|
49
51
|
// create mapping of node type name to configs
|
|
50
52
|
const configByNodeType = {};
|
|
53
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
54
|
+
|
|
51
55
|
configs.forEach(config => {
|
|
52
56
|
if (Array.isArray(config.nodeType)) {
|
|
57
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
58
|
+
|
|
53
59
|
config.nodeType.forEach(nodeType => {
|
|
54
60
|
configByNodeType[nodeType.name] = config;
|
|
55
61
|
});
|
|
@@ -317,15 +323,21 @@ export function ContentComponent({
|
|
|
317
323
|
if (isInViewMode) {
|
|
318
324
|
// Typescript note: Not all toolbar item types have the `supportsViewMode` prop.
|
|
319
325
|
const toolbarItemViewModeProp = 'supportsViewMode';
|
|
326
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
327
|
+
|
|
320
328
|
items = iterableItems.filter(item => toolbarItemViewModeProp in item && !!item[toolbarItemViewModeProp]);
|
|
321
329
|
}
|
|
322
330
|
if (areToolbarFlagsEnabled(Boolean(pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.toolbar))) {
|
|
323
331
|
var _items2;
|
|
324
332
|
// Consolidate floating toolbar items
|
|
325
333
|
const toolbarItemsArray = Array.isArray(items) ? items : (_items2 = items) === null || _items2 === void 0 ? void 0 : _items2(node);
|
|
334
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
335
|
+
|
|
326
336
|
const overflowDropdownItems = toolbarItemsArray.filter(item => item.type === 'overflow-dropdown');
|
|
327
337
|
if (overflowDropdownItems.length > 1) {
|
|
328
338
|
const consolidatedOverflowDropdown = consolidateOverflowDropdownItems(overflowDropdownItems);
|
|
339
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
340
|
+
|
|
329
341
|
const otherItems = toolbarItemsArray.filter(item => item.type !== 'overflow-dropdown');
|
|
330
342
|
if (otherItems.length > 0) {
|
|
331
343
|
// remove the last separators
|
|
@@ -345,6 +357,8 @@ export function ContentComponent({
|
|
|
345
357
|
if (overflowDropdownItems.length > 0 && dispatchAnalyticsEvent) {
|
|
346
358
|
var _items3;
|
|
347
359
|
const currentItems = Array.isArray(items) ? items : (_items3 = items) === null || _items3 === void 0 ? void 0 : _items3(node);
|
|
360
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
361
|
+
|
|
348
362
|
const updatedItems = currentItems.map(item => {
|
|
349
363
|
if (item.type !== 'overflow-dropdown') {
|
|
350
364
|
return item;
|
|
@@ -515,6 +529,8 @@ function sanitizeFloatingToolbarConfig(config) {
|
|
|
515
529
|
if (Array.isArray(config.nodeType)) {
|
|
516
530
|
return {
|
|
517
531
|
...config,
|
|
532
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
533
|
+
|
|
518
534
|
nodeType: config.nodeType.filter(filterUndefined)
|
|
519
535
|
};
|
|
520
536
|
}
|
|
@@ -592,7 +608,9 @@ export function floatingToolbarPluginFactory(options) {
|
|
|
592
608
|
getConfigWithNodeInfo
|
|
593
609
|
};
|
|
594
610
|
},
|
|
595
|
-
apply: expValEquals('platform_editor_lovability_suppress_toolbar_event', 'isEnabled', true)
|
|
611
|
+
apply: expValEquals('platform_editor_lovability_suppress_toolbar_event', 'isEnabled', true)
|
|
612
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
613
|
+
? (_tr, _pluginState, __oldEditorState, newEditorState) => {
|
|
596
614
|
const suppressedToolbar = getIsToolbarSuppressed(newEditorState);
|
|
597
615
|
const newPluginState = {
|
|
598
616
|
getConfigWithNodeInfo,
|
|
@@ -603,6 +621,8 @@ export function floatingToolbarPluginFactory(options) {
|
|
|
603
621
|
},
|
|
604
622
|
view: expValEquals('platform_editor_lovability_suppress_toolbar_event', 'isEnabled', true) ? () => {
|
|
605
623
|
return {
|
|
624
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
625
|
+
|
|
606
626
|
update: (view, prevState) => {
|
|
607
627
|
const pluginState = pluginKey.getState(view.state);
|
|
608
628
|
const prevPluginState = pluginKey.getState(prevState);
|
|
@@ -11,6 +11,8 @@ export default (() => new SafePlugin({
|
|
|
11
11
|
init: () => ({
|
|
12
12
|
selector: null
|
|
13
13
|
}),
|
|
14
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
15
|
+
|
|
14
16
|
apply: (tr, prevState) => {
|
|
15
17
|
const meta = tr.getMeta(forceFocusStateKey);
|
|
16
18
|
if (meta && 'selector' in meta) {
|
|
@@ -4,7 +4,6 @@ import Button from '@atlaskit/button/new';
|
|
|
4
4
|
import { Checkbox } from '@atlaskit/checkbox';
|
|
5
5
|
import { messages } from '@atlaskit/editor-common/floating-toolbar';
|
|
6
6
|
import Modal, { ModalBody, ModalFooter, ModalHeader, ModalTitle } from '@atlaskit/modal-dialog';
|
|
7
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
8
7
|
import { Text } from '@atlaskit/primitives/compiled';
|
|
9
8
|
export const CheckboxModal = props => {
|
|
10
9
|
var _options$getChildrenI;
|
|
@@ -54,7 +53,7 @@ export const CheckboxModal = props => {
|
|
|
54
53
|
onClose: onClose,
|
|
55
54
|
testId: testId
|
|
56
55
|
}, /*#__PURE__*/React.createElement(ModalHeader, {
|
|
57
|
-
hasCloseButton:
|
|
56
|
+
hasCloseButton: true
|
|
58
57
|
}, /*#__PURE__*/React.createElement(ModalTitle, {
|
|
59
58
|
appearance: "warning"
|
|
60
59
|
}, heading)), /*#__PURE__*/React.createElement(ModalBody, null, /*#__PURE__*/React.createElement(Text, {
|
|
@@ -66,7 +65,10 @@ export const CheckboxModal = props => {
|
|
|
66
65
|
}, /*#__PURE__*/React.createElement(Checkbox, {
|
|
67
66
|
isChecked: isChecked,
|
|
68
67
|
onChange: () => setCheckbox(!isChecked),
|
|
69
|
-
label: checkboxlabel
|
|
68
|
+
label: checkboxlabel
|
|
69
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
70
|
+
,
|
|
71
|
+
|
|
70
72
|
testId: testId ? `${testId}-checkbox` : undefined
|
|
71
73
|
}))), /*#__PURE__*/React.createElement(ModalFooter, null, /*#__PURE__*/React.createElement(Button, {
|
|
72
74
|
appearance: "default",
|
|
@@ -2,7 +2,6 @@ import React from 'react';
|
|
|
2
2
|
import Button from '@atlaskit/button/new';
|
|
3
3
|
import { messages } from '@atlaskit/editor-common/floating-toolbar';
|
|
4
4
|
import Modal, { ModalBody, ModalFooter, ModalHeader, ModalTitle } from '@atlaskit/modal-dialog';
|
|
5
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
6
5
|
import { Text } from '@atlaskit/primitives/compiled';
|
|
7
6
|
export const SimpleModal = props => {
|
|
8
7
|
const {
|
|
@@ -21,7 +20,7 @@ export const SimpleModal = props => {
|
|
|
21
20
|
onClose: onClose,
|
|
22
21
|
testId: testId
|
|
23
22
|
}, /*#__PURE__*/React.createElement(ModalHeader, {
|
|
24
|
-
hasCloseButton:
|
|
23
|
+
hasCloseButton: true
|
|
25
24
|
}, /*#__PURE__*/React.createElement(ModalTitle, {
|
|
26
25
|
appearance: "warning"
|
|
27
26
|
}, heading)), /*#__PURE__*/React.createElement(ModalBody, null, /*#__PURE__*/React.createElement(Text, {
|
|
@@ -35,6 +35,8 @@ var SUPPRESS_TOOLBAR_USER_INTENTS = ['dragging', 'tableContextualMenuPopupOpen',
|
|
|
35
35
|
export var getRelevantConfig = function getRelevantConfig(selection, configs) {
|
|
36
36
|
// node selections always take precedence, see if
|
|
37
37
|
var configPair;
|
|
38
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
39
|
+
|
|
38
40
|
configs.find(function (config) {
|
|
39
41
|
var node = findSelectedNodeOfType(config.nodeType)(selection);
|
|
40
42
|
if (node) {
|
|
@@ -52,8 +54,12 @@ export var getRelevantConfig = function getRelevantConfig(selection, configs) {
|
|
|
52
54
|
|
|
53
55
|
// create mapping of node type name to configs
|
|
54
56
|
var configByNodeType = {};
|
|
57
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
58
|
+
|
|
55
59
|
configs.forEach(function (config) {
|
|
56
60
|
if (Array.isArray(config.nodeType)) {
|
|
61
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
62
|
+
|
|
57
63
|
config.nodeType.forEach(function (nodeType) {
|
|
58
64
|
configByNodeType[nodeType.name] = config;
|
|
59
65
|
});
|
|
@@ -317,6 +323,8 @@ export function ContentComponent(_ref5) {
|
|
|
317
323
|
if (isInViewMode) {
|
|
318
324
|
// Typescript note: Not all toolbar item types have the `supportsViewMode` prop.
|
|
319
325
|
var toolbarItemViewModeProp = 'supportsViewMode';
|
|
326
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
327
|
+
|
|
320
328
|
items = iterableItems.filter(function (item) {
|
|
321
329
|
return toolbarItemViewModeProp in item && !!item[toolbarItemViewModeProp];
|
|
322
330
|
});
|
|
@@ -325,11 +333,15 @@ export function ContentComponent(_ref5) {
|
|
|
325
333
|
var _items2;
|
|
326
334
|
// Consolidate floating toolbar items
|
|
327
335
|
var toolbarItemsArray = Array.isArray(items) ? items : (_items2 = items) === null || _items2 === void 0 ? void 0 : _items2(node);
|
|
336
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
337
|
+
|
|
328
338
|
var overflowDropdownItems = toolbarItemsArray.filter(function (item) {
|
|
329
339
|
return item.type === 'overflow-dropdown';
|
|
330
340
|
});
|
|
331
341
|
if (overflowDropdownItems.length > 1) {
|
|
332
342
|
var consolidatedOverflowDropdown = consolidateOverflowDropdownItems(overflowDropdownItems);
|
|
343
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
344
|
+
|
|
333
345
|
var otherItems = toolbarItemsArray.filter(function (item) {
|
|
334
346
|
return item.type !== 'overflow-dropdown';
|
|
335
347
|
});
|
|
@@ -351,6 +363,8 @@ export function ContentComponent(_ref5) {
|
|
|
351
363
|
if (overflowDropdownItems.length > 0 && dispatchAnalyticsEvent) {
|
|
352
364
|
var _items3;
|
|
353
365
|
var currentItems = Array.isArray(items) ? items : (_items3 = items) === null || _items3 === void 0 ? void 0 : _items3(node);
|
|
366
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
367
|
+
|
|
354
368
|
var updatedItems = currentItems.map(function (item) {
|
|
355
369
|
if (item.type !== 'overflow-dropdown') {
|
|
356
370
|
return item;
|
|
@@ -522,6 +536,8 @@ function sanitizeFloatingToolbarConfig(config) {
|
|
|
522
536
|
// Cleanup from non existing node types
|
|
523
537
|
if (Array.isArray(config.nodeType)) {
|
|
524
538
|
return _objectSpread(_objectSpread({}, config), {}, {
|
|
539
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
540
|
+
|
|
525
541
|
nodeType: config.nodeType.filter(filterUndefined)
|
|
526
542
|
});
|
|
527
543
|
}
|
|
@@ -597,7 +613,9 @@ export function floatingToolbarPluginFactory(options) {
|
|
|
597
613
|
getConfigWithNodeInfo: getConfigWithNodeInfo
|
|
598
614
|
};
|
|
599
615
|
},
|
|
600
|
-
apply: expValEquals('platform_editor_lovability_suppress_toolbar_event', 'isEnabled', true)
|
|
616
|
+
apply: expValEquals('platform_editor_lovability_suppress_toolbar_event', 'isEnabled', true)
|
|
617
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
618
|
+
? function (_tr, _pluginState, __oldEditorState, newEditorState) {
|
|
601
619
|
var suppressedToolbar = getIsToolbarSuppressed(newEditorState);
|
|
602
620
|
var newPluginState = {
|
|
603
621
|
getConfigWithNodeInfo: getConfigWithNodeInfo,
|
|
@@ -608,6 +626,8 @@ export function floatingToolbarPluginFactory(options) {
|
|
|
608
626
|
},
|
|
609
627
|
view: expValEquals('platform_editor_lovability_suppress_toolbar_event', 'isEnabled', true) ? function () {
|
|
610
628
|
return {
|
|
629
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
630
|
+
|
|
611
631
|
update: function update(view, prevState) {
|
|
612
632
|
var pluginState = pluginKey.getState(view.state);
|
|
613
633
|
var prevPluginState = pluginKey.getState(prevState);
|
|
@@ -5,7 +5,6 @@ import Button from '@atlaskit/button/new';
|
|
|
5
5
|
import { Checkbox } from '@atlaskit/checkbox';
|
|
6
6
|
import { messages } from '@atlaskit/editor-common/floating-toolbar';
|
|
7
7
|
import Modal, { ModalBody, ModalFooter, ModalHeader, ModalTitle } from '@atlaskit/modal-dialog';
|
|
8
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
9
8
|
import { Text } from '@atlaskit/primitives/compiled';
|
|
10
9
|
export var CheckboxModal = function CheckboxModal(props) {
|
|
11
10
|
var _options$getChildrenI;
|
|
@@ -54,7 +53,7 @@ export var CheckboxModal = function CheckboxModal(props) {
|
|
|
54
53
|
onClose: onClose,
|
|
55
54
|
testId: testId
|
|
56
55
|
}, /*#__PURE__*/React.createElement(ModalHeader, {
|
|
57
|
-
hasCloseButton:
|
|
56
|
+
hasCloseButton: true
|
|
58
57
|
}, /*#__PURE__*/React.createElement(ModalTitle, {
|
|
59
58
|
appearance: "warning"
|
|
60
59
|
}, heading)), /*#__PURE__*/React.createElement(ModalBody, null, /*#__PURE__*/React.createElement(Text, {
|
|
@@ -68,7 +67,10 @@ export var CheckboxModal = function CheckboxModal(props) {
|
|
|
68
67
|
onChange: function onChange() {
|
|
69
68
|
return setCheckbox(!isChecked);
|
|
70
69
|
},
|
|
71
|
-
label: checkboxlabel
|
|
70
|
+
label: checkboxlabel
|
|
71
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
72
|
+
,
|
|
73
|
+
|
|
72
74
|
testId: testId ? "".concat(testId, "-checkbox") : undefined
|
|
73
75
|
}))), /*#__PURE__*/React.createElement(ModalFooter, null, /*#__PURE__*/React.createElement(Button, {
|
|
74
76
|
appearance: "default",
|
|
@@ -2,7 +2,6 @@ import React from 'react';
|
|
|
2
2
|
import Button from '@atlaskit/button/new';
|
|
3
3
|
import { messages } from '@atlaskit/editor-common/floating-toolbar';
|
|
4
4
|
import Modal, { ModalBody, ModalFooter, ModalHeader, ModalTitle } from '@atlaskit/modal-dialog';
|
|
5
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
6
5
|
import { Text } from '@atlaskit/primitives/compiled';
|
|
7
6
|
export var SimpleModal = function SimpleModal(props) {
|
|
8
7
|
var onConfirm = props.onConfirm,
|
|
@@ -17,7 +16,7 @@ export var SimpleModal = function SimpleModal(props) {
|
|
|
17
16
|
onClose: onClose,
|
|
18
17
|
testId: testId
|
|
19
18
|
}, /*#__PURE__*/React.createElement(ModalHeader, {
|
|
20
|
-
hasCloseButton:
|
|
19
|
+
hasCloseButton: true
|
|
21
20
|
}, /*#__PURE__*/React.createElement(ModalTitle, {
|
|
22
21
|
appearance: "warning"
|
|
23
22
|
}, heading)), /*#__PURE__*/React.createElement(ModalBody, null, /*#__PURE__*/React.createElement(Text, {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-floating-toolbar",
|
|
3
|
-
"version": "8.2.
|
|
3
|
+
"version": "8.2.20",
|
|
4
4
|
"description": "Floating toolbar plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -34,20 +34,20 @@
|
|
|
34
34
|
"@atlaskit/editor-plugin-emoji": "^7.6.0",
|
|
35
35
|
"@atlaskit/editor-plugin-extension": "^9.2.0",
|
|
36
36
|
"@atlaskit/editor-plugin-interaction": "^10.0.0",
|
|
37
|
-
"@atlaskit/editor-plugin-table": "^15.
|
|
37
|
+
"@atlaskit/editor-plugin-table": "^15.4.0",
|
|
38
38
|
"@atlaskit/editor-plugin-user-intent": "^4.0.0",
|
|
39
39
|
"@atlaskit/editor-prosemirror": "7.0.0",
|
|
40
|
-
"@atlaskit/emoji": "^69.
|
|
40
|
+
"@atlaskit/emoji": "^69.8.0",
|
|
41
41
|
"@atlaskit/icon": "^29.0.0",
|
|
42
42
|
"@atlaskit/menu": "^8.4.0",
|
|
43
|
-
"@atlaskit/modal-dialog": "^14.
|
|
43
|
+
"@atlaskit/modal-dialog": "^14.7.0",
|
|
44
44
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
45
|
-
"@atlaskit/primitives": "^16.
|
|
46
|
-
"@atlaskit/select": "^21.
|
|
45
|
+
"@atlaskit/primitives": "^16.3.0",
|
|
46
|
+
"@atlaskit/select": "^21.4.0",
|
|
47
47
|
"@atlaskit/theme": "^21.0.0",
|
|
48
|
-
"@atlaskit/tmp-editor-statsig": "^13.
|
|
49
|
-
"@atlaskit/tokens": "^8.
|
|
50
|
-
"@atlaskit/tooltip": "^20.
|
|
48
|
+
"@atlaskit/tmp-editor-statsig": "^13.42.0",
|
|
49
|
+
"@atlaskit/tokens": "^8.3.0",
|
|
50
|
+
"@atlaskit/tooltip": "^20.10.0",
|
|
51
51
|
"@babel/runtime": "^7.0.0",
|
|
52
52
|
"@emotion/react": "^11.7.1",
|
|
53
53
|
"bind-event-listener": "^3.0.0",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"react-loadable": "^5.1.0"
|
|
58
58
|
},
|
|
59
59
|
"peerDependencies": {
|
|
60
|
-
"@atlaskit/editor-common": "^110.
|
|
60
|
+
"@atlaskit/editor-common": "^110.34.0",
|
|
61
61
|
"react": "^18.2.0",
|
|
62
62
|
"react-dom": "^18.2.0"
|
|
63
63
|
},
|
|
@@ -125,9 +125,6 @@
|
|
|
125
125
|
"platform_editor_a11y_add_role_to_popup": {
|
|
126
126
|
"type": "boolean"
|
|
127
127
|
},
|
|
128
|
-
"platform_editor_update_modal_close_button": {
|
|
129
|
-
"type": "boolean"
|
|
130
|
-
},
|
|
131
128
|
"platform_editor_toolbar_aifc_user_intent_fix": {
|
|
132
129
|
"type": "boolean"
|
|
133
130
|
}
|