@atlaskit/editor-common 108.6.0 → 108.6.2
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 +22 -0
- package/dist/cjs/ai-messages/ai-failed-state.js +2 -2
- package/dist/cjs/card/LinkToolbarButtonGroup.js +4 -2
- package/dist/cjs/card/link-toolbar-button-group-options.js +3 -2
- package/dist/cjs/floating-toolbar/DropdownMenuExtensionItems.js +3 -3
- package/dist/cjs/hooks/useSharedPluginState.js +1 -1
- package/dist/cjs/hooks/useSharedPluginStateSelector/useSharedPluginStateSelector.js +3 -0
- package/dist/cjs/link/LinkPicker/HyperlinkAddToolbar/HyperlinkAddToolbar.js +42 -2
- package/dist/cjs/link/LinkSearch/LinkSearchList.js +66 -2
- package/dist/cjs/link/LinkSearch/LinkSearchListItem.js +87 -1
- package/dist/cjs/messages/block-menu.js +1 -1
- package/dist/cjs/monitoring/error.js +1 -1
- package/dist/cjs/preset/core-plugin/index.js +13 -2
- package/dist/cjs/safe-plugin/index.js +1 -1
- package/dist/cjs/toolbar-flag-check.js +2 -2
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/cjs/ui/FloatingToolbar/Button.js +4 -4
- package/dist/cjs/ui/FloatingToolbar/Separator.js +3 -3
- package/dist/es2019/ai-messages/ai-failed-state.js +2 -2
- package/dist/es2019/card/LinkToolbarButtonGroup.js +4 -2
- package/dist/es2019/card/link-toolbar-button-group-options.js +3 -2
- package/dist/es2019/floating-toolbar/DropdownMenuExtensionItems.js +3 -3
- package/dist/es2019/hooks/useSharedPluginState.js +1 -1
- package/dist/es2019/hooks/useSharedPluginStateSelector/useSharedPluginStateSelector.js +3 -0
- package/dist/es2019/link/LinkPicker/HyperlinkAddToolbar/HyperlinkAddToolbar.js +42 -2
- package/dist/es2019/link/LinkSearch/LinkSearchList.js +58 -1
- package/dist/es2019/link/LinkSearch/LinkSearchListItem.js +89 -1
- package/dist/es2019/messages/block-menu.js +1 -1
- package/dist/es2019/monitoring/error.js +1 -1
- package/dist/es2019/preset/core-plugin/index.js +13 -2
- package/dist/es2019/safe-plugin/index.js +1 -1
- package/dist/es2019/toolbar-flag-check.js +1 -1
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/es2019/ui/FloatingToolbar/Button.js +4 -4
- package/dist/es2019/ui/FloatingToolbar/Separator.js +3 -3
- package/dist/esm/ai-messages/ai-failed-state.js +2 -2
- package/dist/esm/card/LinkToolbarButtonGroup.js +4 -2
- package/dist/esm/card/link-toolbar-button-group-options.js +3 -2
- package/dist/esm/floating-toolbar/DropdownMenuExtensionItems.js +3 -3
- package/dist/esm/hooks/useSharedPluginState.js +1 -1
- package/dist/esm/hooks/useSharedPluginStateSelector/useSharedPluginStateSelector.js +3 -0
- package/dist/esm/link/LinkPicker/HyperlinkAddToolbar/HyperlinkAddToolbar.js +42 -2
- package/dist/esm/link/LinkSearch/LinkSearchList.js +63 -1
- package/dist/esm/link/LinkSearch/LinkSearchListItem.js +87 -1
- package/dist/esm/messages/block-menu.js +1 -1
- package/dist/esm/monitoring/error.js +1 -1
- package/dist/esm/preset/core-plugin/index.js +13 -2
- package/dist/esm/safe-plugin/index.js +1 -1
- package/dist/esm/toolbar-flag-check.js +2 -2
- package/dist/esm/ui/DropList/index.js +1 -1
- package/dist/esm/ui/FloatingToolbar/Button.js +4 -4
- package/dist/esm/ui/FloatingToolbar/Separator.js +3 -3
- package/dist/types/card/LinkToolbarButtonGroup.d.ts +1 -0
- package/dist/types/card/link-toolbar-button-group-options.d.ts +1 -1
- package/dist/types/floating-toolbar/DropdownMenuExtensionItems.d.ts +1 -0
- package/dist/types/hooks/useSharedPluginState.d.ts +1 -1
- package/dist/types/hooks/useSharedPluginStateSelector/useSharedPluginStateSelector.d.ts +3 -0
- package/dist/types/link/LinkPicker/HyperlinkAddToolbar/HyperlinkAddToolbar.d.ts +3 -0
- package/dist/types/link/LinkSearch/LinkSearchList.d.ts +22 -1
- package/dist/types/link/LinkSearch/LinkSearchListItem.d.ts +16 -1
- package/dist/types/safe-plugin/index.d.ts +1 -1
- package/dist/types/toolbar-flag-check.d.ts +1 -1
- package/dist/types/types/next-editor-plugin.d.ts +2 -1
- package/dist/types/ui/FloatingToolbar/Button.d.ts +2 -1
- package/dist/types/ui/FloatingToolbar/Separator.d.ts +2 -1
- package/dist/types-ts4.5/card/LinkToolbarButtonGroup.d.ts +1 -0
- package/dist/types-ts4.5/card/link-toolbar-button-group-options.d.ts +1 -1
- package/dist/types-ts4.5/floating-toolbar/DropdownMenuExtensionItems.d.ts +1 -0
- package/dist/types-ts4.5/hooks/useSharedPluginState.d.ts +1 -1
- package/dist/types-ts4.5/hooks/useSharedPluginStateSelector/useSharedPluginStateSelector.d.ts +3 -0
- package/dist/types-ts4.5/link/LinkPicker/HyperlinkAddToolbar/HyperlinkAddToolbar.d.ts +3 -0
- package/dist/types-ts4.5/link/LinkSearch/LinkSearchList.d.ts +22 -1
- package/dist/types-ts4.5/link/LinkSearch/LinkSearchListItem.d.ts +16 -1
- package/dist/types-ts4.5/safe-plugin/index.d.ts +1 -1
- package/dist/types-ts4.5/toolbar-flag-check.d.ts +1 -1
- package/dist/types-ts4.5/types/next-editor-plugin.d.ts +2 -1
- package/dist/types-ts4.5/ui/FloatingToolbar/Button.d.ts +2 -1
- package/dist/types-ts4.5/ui/FloatingToolbar/Separator.d.ts +2 -1
- package/package.json +6 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# @atlaskit/editor-common
|
|
2
2
|
|
|
3
|
+
## 108.6.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`c0113eeccb2df`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/c0113eeccb2df) -
|
|
8
|
+
[ux] ED-29120 add a new config option for default editor preset
|
|
9
|
+
(`toolbar.enableNewToolbarExperience`) which allows the new toolbar to be disabled. This is needed
|
|
10
|
+
for editors that can't be excluded at the experiment level.
|
|
11
|
+
- [`7e2bd9dc6d5ca`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/7e2bd9dc6d5ca) -
|
|
12
|
+
EDITOR-1531 Updated error message.
|
|
13
|
+
- Updated dependencies
|
|
14
|
+
|
|
15
|
+
## 108.6.1
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- [`1315abde398a6`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/1315abde398a6) -
|
|
20
|
+
[ux] a11y: make search result items focusable under insert link popup
|
|
21
|
+
- [`c308a1fcb2292`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/c308a1fcb2292) -
|
|
22
|
+
Fix codeblock block menu option text
|
|
23
|
+
- Updated dependencies
|
|
24
|
+
|
|
3
25
|
## 108.6.0
|
|
4
26
|
|
|
5
27
|
### Minor Changes
|
|
@@ -65,7 +65,7 @@ var aiFailedStateMessages = exports.aiFailedStateMessages = (0, _reactIntlNext.d
|
|
|
65
65
|
},
|
|
66
66
|
adfStreamingError: {
|
|
67
67
|
id: 'fabric.editor.ai.experience.adfStreamingError',
|
|
68
|
-
defaultMessage: "
|
|
69
|
-
description: "
|
|
68
|
+
defaultMessage: "Our apologies, we couldn't get a response.",
|
|
69
|
+
description: "This error message is displayed when error(s) are encountered during processing of LLM response in ADF format."
|
|
70
70
|
}
|
|
71
71
|
});
|
|
@@ -53,7 +53,8 @@ var LinkToolbarButtonGroup = exports.LinkToolbarButtonGroup = function LinkToolb
|
|
|
53
53
|
tooltipContent = _ref3.tooltipContent,
|
|
54
54
|
title = _ref3.title,
|
|
55
55
|
icon = _ref3.icon,
|
|
56
|
-
iconFallback = _ref3.iconFallback
|
|
56
|
+
iconFallback = _ref3.iconFallback,
|
|
57
|
+
areAnyNewToolbarFlagsEnabled = _ref3.areAnyNewToolbarFlagsEnabled;
|
|
57
58
|
var ButtonIcon = icon;
|
|
58
59
|
return (0, _react2.jsx)(DisallowedWrapper, {
|
|
59
60
|
css: disabled ? disallowedWrapperStyle : defaultWrapperStyle,
|
|
@@ -72,7 +73,8 @@ var LinkToolbarButtonGroup = exports.LinkToolbarButtonGroup = function LinkToolb
|
|
|
72
73
|
onClick: onClick,
|
|
73
74
|
testId: testId,
|
|
74
75
|
disabled: disabled,
|
|
75
|
-
tooltipContent: tooltipContent
|
|
76
|
+
tooltipContent: tooltipContent,
|
|
77
|
+
areAnyNewToolbarFlagsEnabled: areAnyNewToolbarFlagsEnabled
|
|
76
78
|
}));
|
|
77
79
|
}));
|
|
78
80
|
};
|
|
@@ -36,7 +36,7 @@ var appearancePropsMap = exports.appearancePropsMap = {
|
|
|
36
36
|
iconFallback: _embed.IconEmbed
|
|
37
37
|
}
|
|
38
38
|
};
|
|
39
|
-
var getButtonGroupOption = exports.getButtonGroupOption = function getButtonGroupOption(intl, dispatchCommand, _ref) {
|
|
39
|
+
var getButtonGroupOption = exports.getButtonGroupOption = function getButtonGroupOption(intl, areAnyNewToolbarFlagsEnabled, dispatchCommand, _ref) {
|
|
40
40
|
var disabled = _ref.disabled,
|
|
41
41
|
_onClick = _ref.onClick,
|
|
42
42
|
selected = _ref.selected,
|
|
@@ -57,6 +57,7 @@ var getButtonGroupOption = exports.getButtonGroupOption = function getButtonGrou
|
|
|
57
57
|
disabled: Boolean(disabled),
|
|
58
58
|
tooltipContent: tooltip || null,
|
|
59
59
|
testId: testId,
|
|
60
|
-
selected: selected
|
|
60
|
+
selected: selected,
|
|
61
|
+
areAnyNewToolbarFlagsEnabled: areAnyNewToolbarFlagsEnabled
|
|
61
62
|
};
|
|
62
63
|
};
|
|
@@ -12,7 +12,6 @@ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/
|
|
|
12
12
|
var _react = _interopRequireWildcard(require("react"));
|
|
13
13
|
var _reactLoadable = _interopRequireDefault(require("react-loadable"));
|
|
14
14
|
var _extensions = require("../extensions");
|
|
15
|
-
var _toolbarFlagCheck = require("../toolbar-flag-check");
|
|
16
15
|
var _utils = require("../utils");
|
|
17
16
|
var _DropdownMenuItem = require("./DropdownMenuItem");
|
|
18
17
|
var _DropdownSeparator = require("./DropdownSeparator");
|
|
@@ -133,7 +132,8 @@ var DropdownMenuExtensionItems = exports.DropdownMenuExtensionItems = function D
|
|
|
133
132
|
editorView = props.editorView,
|
|
134
133
|
extension = props.extension,
|
|
135
134
|
disabled = props.disabled,
|
|
136
|
-
dropdownOptions = props.dropdownOptions
|
|
135
|
+
dropdownOptions = props.dropdownOptions,
|
|
136
|
+
areAnyNewToolbarFlagsEnabled = props.areAnyNewToolbarFlagsEnabled;
|
|
137
137
|
|
|
138
138
|
// Ignored via go/ees005
|
|
139
139
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -200,5 +200,5 @@ var DropdownMenuExtensionItems = exports.DropdownMenuExtensionItems = function D
|
|
|
200
200
|
extension: extension,
|
|
201
201
|
dropdownOptions: dropdownOptions
|
|
202
202
|
});
|
|
203
|
-
}),
|
|
203
|
+
}), areAnyNewToolbarFlagsEnabled && /*#__PURE__*/_react.default.createElement(_DropdownSeparator.DropdownSeparator, null));
|
|
204
204
|
};
|
|
@@ -43,7 +43,7 @@ function useStaticPlugins(plugins) {
|
|
|
43
43
|
}
|
|
44
44
|
/**
|
|
45
45
|
*
|
|
46
|
-
* NOTE: Generally you
|
|
46
|
+
* NOTE: Generally you want to use `usePluginStateWithSelector` over this which behaves similarly
|
|
47
47
|
* but selects a slice of the state which is more performant.
|
|
48
48
|
*
|
|
49
49
|
* ⚠️⚠️⚠️ This is a debounced hook ⚠️⚠️⚠️
|
|
@@ -41,6 +41,9 @@ var _usePluginStateEffect = require("../usePluginStateEffect");
|
|
|
41
41
|
|
|
42
42
|
/**
|
|
43
43
|
*
|
|
44
|
+
* NOTE: Generally you want to use `usePluginStateWithSelector` over this which behaves similarly
|
|
45
|
+
* but selects a slice of the state which is more performant.
|
|
46
|
+
*
|
|
44
47
|
* ⚠️⚠️⚠️ This is a debounced hook ⚠️⚠️⚠️
|
|
45
48
|
* If the plugins you are listening to generate multiple shared states while the user is typing,
|
|
46
49
|
* your React Component will get only the last one.
|
|
@@ -25,13 +25,14 @@ var _adfSchema = require("@atlaskit/adf-schema");
|
|
|
25
25
|
var _withAnalyticsEvents = _interopRequireDefault(require("@atlaskit/analytics-next/withAnalyticsEvents"));
|
|
26
26
|
var _ = _interopRequireDefault(require("@atlaskit/icon-object/glyph/page/16"));
|
|
27
27
|
var _crossCircle = _interopRequireDefault(require("@atlaskit/icon/core/migration/cross-circle"));
|
|
28
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
28
29
|
var _primitives = require("@atlaskit/primitives");
|
|
29
30
|
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
30
31
|
var _tooltip = _interopRequireDefault(require("@atlaskit/tooltip"));
|
|
31
32
|
var _analytics = require("../../../analytics");
|
|
32
33
|
var _ui = require("../../../ui");
|
|
33
34
|
var _utils = require("../../../utils");
|
|
34
|
-
var _LinkSearchList =
|
|
35
|
+
var _LinkSearchList = _interopRequireWildcard(require("../../LinkSearch/LinkSearchList"));
|
|
35
36
|
var _ToolbarComponents = require("../../LinkSearch/ToolbarComponents");
|
|
36
37
|
var _transformTimeStamp = require("../../LinkSearch/transformTimeStamp");
|
|
37
38
|
var _utils2 = require("./utils");
|
|
@@ -170,6 +171,10 @@ var HyperlinkLinkAddToolbar = exports.HyperlinkLinkAddToolbar = /*#__PURE__*/fun
|
|
|
170
171
|
(0, _defineProperty2.default)(_this, "urlInputContainer", null);
|
|
171
172
|
(0, _defineProperty2.default)(_this, "displayTextInputContainer", null);
|
|
172
173
|
(0, _defineProperty2.default)(_this, "wrapperRef", /*#__PURE__*/_react.default.createRef());
|
|
174
|
+
// introduced via ff platform_editor_a11y_insert_link_item_focus, remove this comment cleaning up
|
|
175
|
+
(0, _defineProperty2.default)(_this, "listItemRefs", {
|
|
176
|
+
current: {}
|
|
177
|
+
});
|
|
173
178
|
(0, _defineProperty2.default)(_this, "quickSearchQueryVersion", 0);
|
|
174
179
|
(0, _defineProperty2.default)(_this, "analyticSource", 'createLinkInlineDialog');
|
|
175
180
|
(0, _defineProperty2.default)(_this, "quickSearch", /*#__PURE__*/function () {
|
|
@@ -418,6 +423,17 @@ var HyperlinkLinkAddToolbar = exports.HyperlinkLinkAddToolbar = /*#__PURE__*/fun
|
|
|
418
423
|
return "".concat(name, ", ").concat(_container, ", ").concat(date === null || date === void 0 ? void 0 : date.pageAction, " ").concat(date === null || date === void 0 ? void 0 : date.dateString, " ").concat((date === null || date === void 0 ? void 0 : date.timeSince) || '');
|
|
419
424
|
}
|
|
420
425
|
});
|
|
426
|
+
// introduced via ff platform_editor_a11y_insert_link_item_focus, remove this comment cleaning up
|
|
427
|
+
(0, _defineProperty2.default)(_this, "listItemRefCallback", function (el, id) {
|
|
428
|
+
if (!_this.listItemRefs.current) {
|
|
429
|
+
return;
|
|
430
|
+
}
|
|
431
|
+
if (el === null) {
|
|
432
|
+
delete _this.listItemRefs.current[id];
|
|
433
|
+
} else {
|
|
434
|
+
_this.listItemRefs.current[id] = el;
|
|
435
|
+
}
|
|
436
|
+
});
|
|
421
437
|
(0, _defineProperty2.default)(_this, "isUrlPopulatedWithSelectedItem", function () {
|
|
422
438
|
/**
|
|
423
439
|
* When we use ArrowKey to navigate through result items,
|
|
@@ -530,6 +546,12 @@ var HyperlinkLinkAddToolbar = exports.HyperlinkLinkAddToolbar = /*#__PURE__*/fun
|
|
|
530
546
|
return;
|
|
531
547
|
}
|
|
532
548
|
});
|
|
549
|
+
// introduced via ff platform_editor_a11y_insert_link_item_focus, remove this comment cleaning up
|
|
550
|
+
(0, _defineProperty2.default)(_this, "handleListItemFocus", function (index) {
|
|
551
|
+
_this.setState({
|
|
552
|
+
selectedIndex: index
|
|
553
|
+
});
|
|
554
|
+
});
|
|
533
555
|
// Ignored via go/ees005
|
|
534
556
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
535
557
|
(0, _defineProperty2.default)(_this, "handleKeyDown", function (event) {
|
|
@@ -566,6 +588,11 @@ var HyperlinkLinkAddToolbar = exports.HyperlinkLinkAddToolbar = /*#__PURE__*/fun
|
|
|
566
588
|
updatedIndex = selectedIndex > 0 ? selectedIndex - 1 : items.length - 1;
|
|
567
589
|
}
|
|
568
590
|
if ([KEY_CODE_ARROW_DOWN, KEY_CODE_ARROW_UP].includes(keyCode) && items[updatedIndex]) {
|
|
591
|
+
// introduced via ff platform_editor_a11y_insert_link_item_focus, remove this comment cleaning up
|
|
592
|
+
if (_this.listItemRefs.current) {
|
|
593
|
+
var _this$listItemRefs$cu;
|
|
594
|
+
(_this$listItemRefs$cu = _this.listItemRefs.current[items[updatedIndex].objectId]) === null || _this$listItemRefs$cu === void 0 || _this$listItemRefs$cu.focus();
|
|
595
|
+
}
|
|
569
596
|
_this.setState({
|
|
570
597
|
selectedIndex: updatedIndex,
|
|
571
598
|
displayUrl: items[updatedIndex].url
|
|
@@ -937,7 +964,20 @@ var HyperlinkLinkAddToolbar = exports.HyperlinkLinkAddToolbar = /*#__PURE__*/fun
|
|
|
937
964
|
id: "fabric.editor.hyperlink.suggested.results"
|
|
938
965
|
}, displayUrl && formatMessage(messages.searchLinkResults, {
|
|
939
966
|
count: items.length
|
|
940
|
-
})), (0, _react2.jsx)(_LinkSearchList.
|
|
967
|
+
})), (0, _platformFeatureFlags.fg)('platform_editor_a11y_insert_link_item_focus') ? (0, _react2.jsx)(_LinkSearchList.LinkSearchListNext, {
|
|
968
|
+
ariaControls: "fabric.editor.hyperlink.suggested.results",
|
|
969
|
+
id: linkSearchListId,
|
|
970
|
+
role: "listbox",
|
|
971
|
+
items: items,
|
|
972
|
+
isLoading: isLoading,
|
|
973
|
+
selectedIndex: selectedIndex,
|
|
974
|
+
listItemRefCallback: this.listItemRefCallback,
|
|
975
|
+
onFocus: this.handleListItemFocus,
|
|
976
|
+
onKeyDown: this.handleKeyDown,
|
|
977
|
+
onSelect: this.handleSelected,
|
|
978
|
+
onMouseEnter: this.handleMouseEnterResultItem,
|
|
979
|
+
onMouseLeave: this.handleMouseLeaveResultItem
|
|
980
|
+
}) : (0, _react2.jsx)(_LinkSearchList.default, {
|
|
941
981
|
ariaControls: "fabric.editor.hyperlink.suggested.results",
|
|
942
982
|
id: linkSearchListId,
|
|
943
983
|
role: "listbox",
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
4
5
|
Object.defineProperty(exports, "__esModule", {
|
|
5
6
|
value: true
|
|
6
7
|
});
|
|
7
|
-
exports.linkSearchList = exports.default = void 0;
|
|
8
|
+
exports.linkSearchList = exports.default = exports.LinkSearchListNext = void 0;
|
|
8
9
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
9
10
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
10
11
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
@@ -13,7 +14,8 @@ var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits
|
|
|
13
14
|
var _react = require("react");
|
|
14
15
|
var _react2 = require("@emotion/react");
|
|
15
16
|
var _spinner = _interopRequireDefault(require("@atlaskit/spinner"));
|
|
16
|
-
var _LinkSearchListItem =
|
|
17
|
+
var _LinkSearchListItem = _interopRequireWildcard(require("./LinkSearchListItem"));
|
|
18
|
+
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); }
|
|
17
19
|
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)); }
|
|
18
20
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } /**
|
|
19
21
|
* @jsxRuntime classic
|
|
@@ -35,6 +37,68 @@ var linkSearchList = exports.linkSearchList = (0, _react2.css)({
|
|
|
35
37
|
padding: 0,
|
|
36
38
|
listStyle: 'none'
|
|
37
39
|
});
|
|
40
|
+
var LinkSearchListNext = exports.LinkSearchListNext = function LinkSearchListNext(_ref) {
|
|
41
|
+
var listItemRefCallback = _ref.listItemRefCallback,
|
|
42
|
+
_onFocus = _ref.onFocus,
|
|
43
|
+
onKeyDown = _ref.onKeyDown,
|
|
44
|
+
onSelect = _ref.onSelect,
|
|
45
|
+
onMouseMove = _ref.onMouseMove,
|
|
46
|
+
onMouseEnter = _ref.onMouseEnter,
|
|
47
|
+
onMouseLeave = _ref.onMouseLeave,
|
|
48
|
+
items = _ref.items,
|
|
49
|
+
selectedIndex = _ref.selectedIndex,
|
|
50
|
+
isLoading = _ref.isLoading,
|
|
51
|
+
ariaControls = _ref.ariaControls,
|
|
52
|
+
role = _ref.role,
|
|
53
|
+
id = _ref.id;
|
|
54
|
+
var itemsContent;
|
|
55
|
+
var loadingContent;
|
|
56
|
+
if (items && items.length > 0) {
|
|
57
|
+
itemsContent = (0, _react2.jsx)("ul", {
|
|
58
|
+
css: linkSearchList,
|
|
59
|
+
id: id,
|
|
60
|
+
role: role,
|
|
61
|
+
"aria-controls": ariaControls,
|
|
62
|
+
"data-testid": "".concat(id, "--items")
|
|
63
|
+
}, items.map(function (item, index) {
|
|
64
|
+
return (0, _react2.jsx)(_LinkSearchListItem.ForwardedLinkSearchListItemNextWithIntl, {
|
|
65
|
+
id: "link-search-list-item-".concat(index),
|
|
66
|
+
item: item,
|
|
67
|
+
selected: selectedIndex === index,
|
|
68
|
+
onFocus: function onFocus() {
|
|
69
|
+
return _onFocus === null || _onFocus === void 0 ? void 0 : _onFocus(index);
|
|
70
|
+
},
|
|
71
|
+
onKeyDown: onKeyDown,
|
|
72
|
+
onMouseMove: onMouseMove,
|
|
73
|
+
onMouseEnter: onMouseEnter,
|
|
74
|
+
onMouseLeave: onMouseLeave,
|
|
75
|
+
onSelect: onSelect,
|
|
76
|
+
key: item.objectId,
|
|
77
|
+
ref: function ref(el) {
|
|
78
|
+
return listItemRefCallback === null || listItemRefCallback === void 0 ? void 0 : listItemRefCallback(el, item.objectId);
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
}));
|
|
82
|
+
}
|
|
83
|
+
if (isLoading) {
|
|
84
|
+
loadingContent = (0, _react2.jsx)("div", {
|
|
85
|
+
id: id,
|
|
86
|
+
"data-testid": "".concat(id, "--loading"),
|
|
87
|
+
css: spinnerContainer
|
|
88
|
+
}, (0, _react2.jsx)(_spinner.default, {
|
|
89
|
+
size: "medium",
|
|
90
|
+
interactionName: "link-search-spinner"
|
|
91
|
+
}));
|
|
92
|
+
}
|
|
93
|
+
return (0, _react2.jsx)("div", {
|
|
94
|
+
css: listContainer
|
|
95
|
+
}, itemsContent, loadingContent);
|
|
96
|
+
};
|
|
97
|
+
/**
|
|
98
|
+
* *Warning:* With `platform_editor_a11y_insert_link_item_focus` enabled this component is no longer used and is replaced with `<LinkSearchListNext />`.
|
|
99
|
+
*
|
|
100
|
+
* If making changes to this component please ensure to also update `<LinkSearchListNext />`.
|
|
101
|
+
*/
|
|
38
102
|
// Ignored via go/ees005
|
|
39
103
|
// eslint-disable-next-line @repo/internal/react/no-class-components
|
|
40
104
|
var LinkSearchList = exports.default = /*#__PURE__*/function (_PureComponent) {
|
|
@@ -5,7 +5,7 @@ var _typeof = require("@babel/runtime/helpers/typeof");
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.nameStyle = exports.default = exports.containerSelected = exports.containerName = exports.container = void 0;
|
|
8
|
+
exports.nameStyle = exports.default = exports.containerSelected = exports.containerName = exports.container = exports.ForwardedLinkSearchListItemNextWithIntl = void 0;
|
|
9
9
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
10
10
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
11
11
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
@@ -70,6 +70,92 @@ var iconStyle = (0, _react2.css)({
|
|
|
70
70
|
maxWidth: '16px'
|
|
71
71
|
}
|
|
72
72
|
});
|
|
73
|
+
var LinkSearchListItemNext = function LinkSearchListItemNext(props, ref) {
|
|
74
|
+
var id = props.id,
|
|
75
|
+
item = props.item,
|
|
76
|
+
onFocus = props.onFocus,
|
|
77
|
+
onKeyDown = props.onKeyDown,
|
|
78
|
+
onMouseEnter = props.onMouseEnter,
|
|
79
|
+
onMouseLeave = props.onMouseLeave,
|
|
80
|
+
onMouseMove = props.onMouseMove,
|
|
81
|
+
onSelect = props.onSelect,
|
|
82
|
+
selected = props.selected,
|
|
83
|
+
intl = props.intl;
|
|
84
|
+
var handleSelect = (0, _react.useCallback)(function (e) {
|
|
85
|
+
e.preventDefault(); // don't let editor lose focus
|
|
86
|
+
onSelect(item.url, item.name);
|
|
87
|
+
}, [onSelect, item.url, item.name]);
|
|
88
|
+
var handleKeyDown = (0, _react.useCallback)(function (event) {
|
|
89
|
+
if (event.key === 'Enter') {
|
|
90
|
+
onSelect(item.url, item.name);
|
|
91
|
+
}
|
|
92
|
+
onKeyDown === null || onKeyDown === void 0 || onKeyDown(event);
|
|
93
|
+
}, [onSelect, onKeyDown, item.url, item.name]);
|
|
94
|
+
var handleMouseMove = (0, _react.useCallback)(function () {
|
|
95
|
+
onMouseMove === null || onMouseMove === void 0 || onMouseMove(item.objectId);
|
|
96
|
+
}, [onMouseMove, item.objectId]);
|
|
97
|
+
var handleMouseEnter = (0, _react.useCallback)(function () {
|
|
98
|
+
onMouseEnter === null || onMouseEnter === void 0 || onMouseEnter(item.objectId);
|
|
99
|
+
}, [onMouseEnter, item.objectId]);
|
|
100
|
+
var handleMouseLeave = (0, _react.useCallback)(function () {
|
|
101
|
+
onMouseLeave === null || onMouseLeave === void 0 || onMouseLeave(item.objectId);
|
|
102
|
+
}, [onMouseLeave, item.objectId]);
|
|
103
|
+
var renderIcon = function renderIcon() {
|
|
104
|
+
if (item.icon) {
|
|
105
|
+
return (0, _react2.jsx)("span", {
|
|
106
|
+
css: iconStyle
|
|
107
|
+
}, item.icon);
|
|
108
|
+
}
|
|
109
|
+
if (item.iconUrl) {
|
|
110
|
+
return (0, _react2.jsx)("span", {
|
|
111
|
+
css: iconStyle
|
|
112
|
+
}, (0, _react2.jsx)("img", {
|
|
113
|
+
src: item.iconUrl,
|
|
114
|
+
alt: (0, _listItemAlts.getCorrectAltByIconUrl)(item.iconUrl, intl)
|
|
115
|
+
}));
|
|
116
|
+
}
|
|
117
|
+
return null;
|
|
118
|
+
};
|
|
119
|
+
var renderTimeStamp = function renderTimeStamp() {
|
|
120
|
+
var date = (0, _transformTimeStamp.transformTimeStamp)(intl, item.lastViewedDate, item.lastUpdatedDate);
|
|
121
|
+
return date && (0, _react2.jsx)(_react.Fragment, null, "\xA0 \u2022", (0, _react2.jsx)("span", {
|
|
122
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
123
|
+
className: "link-search-timestamp",
|
|
124
|
+
"data-testid": "link-search-timestamp"
|
|
125
|
+
}, "\xA0 ", date.pageAction, " ", date.dateString, " ", date.timeSince || ''));
|
|
126
|
+
};
|
|
127
|
+
return (0, _react2.jsx)("div", {
|
|
128
|
+
ref: ref,
|
|
129
|
+
css: [container, selected && containerSelected],
|
|
130
|
+
role: 'option',
|
|
131
|
+
tabIndex: 0,
|
|
132
|
+
id: id,
|
|
133
|
+
"aria-selected": selected,
|
|
134
|
+
"data-testid": "link-search-list-item",
|
|
135
|
+
onFocus: onFocus,
|
|
136
|
+
onKeyDown: handleKeyDown,
|
|
137
|
+
onMouseMove: handleMouseMove,
|
|
138
|
+
onMouseEnter: handleMouseEnter,
|
|
139
|
+
onMouseLeave: handleMouseLeave,
|
|
140
|
+
onClick: handleSelect
|
|
141
|
+
}, renderIcon(), (0, _react2.jsx)("span", {
|
|
142
|
+
css: nameWrapper
|
|
143
|
+
}, (0, _react2.jsx)("div", {
|
|
144
|
+
css: nameStyle
|
|
145
|
+
}, item.name), (0, _react2.jsx)("div", {
|
|
146
|
+
"data-testid": "link-search-list-item-container",
|
|
147
|
+
css: containerName
|
|
148
|
+
}, item.container, renderTimeStamp())));
|
|
149
|
+
};
|
|
150
|
+
var ForwardedLinkSearchListItemNext = /*#__PURE__*/(0, _react.forwardRef)(LinkSearchListItemNext);
|
|
151
|
+
var ForwardedLinkSearchListItemNextWithIntl = exports.ForwardedLinkSearchListItemNextWithIntl = (0, _reactIntlNext.injectIntl)(ForwardedLinkSearchListItemNext, {
|
|
152
|
+
forwardRef: true
|
|
153
|
+
});
|
|
154
|
+
/**
|
|
155
|
+
* *Warning:* With `platform_editor_a11y_insert_link_item_focus` enabled this component is no longer used and is replaced with `<LinkSearchListItemNext />`.
|
|
156
|
+
*
|
|
157
|
+
* If making changes to this component please ensure to also update `<LinkSearchListItemNext />`.
|
|
158
|
+
*/
|
|
73
159
|
// Ignored via go/ees005
|
|
74
160
|
// eslint-disable-next-line @repo/internal/react/no-class-components
|
|
75
161
|
var LinkSearchListItem = /*#__PURE__*/function (_React$PureComponent) {
|
|
@@ -37,7 +37,7 @@ var messages = exports.messages = (0, _reactIntlNext.defineMessages)({
|
|
|
37
37
|
description: 'Convert to a code block'
|
|
38
38
|
},
|
|
39
39
|
layout: {
|
|
40
|
-
id: 'fabric.editor.block.menu.
|
|
40
|
+
id: 'fabric.editor.block.menu.layout',
|
|
41
41
|
defaultMessage: 'Layout',
|
|
42
42
|
description: 'Convert to a layout node'
|
|
43
43
|
}
|
|
@@ -16,7 +16,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
16
16
|
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); }
|
|
17
17
|
var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
18
18
|
var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
19
|
-
var packageVersion = "
|
|
19
|
+
var packageVersion = "108.6.1";
|
|
20
20
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
21
21
|
// Remove URL as it has UGC
|
|
22
22
|
// Ignored via go/ees007
|
|
@@ -130,13 +130,24 @@ var corePlugin = exports.corePlugin = function corePlugin(_ref) {
|
|
|
130
130
|
}
|
|
131
131
|
return cb(view === null || view === void 0 ? void 0 : view.state.schema);
|
|
132
132
|
},
|
|
133
|
-
getAnchorIdForNode: function getAnchorIdForNode(node) {
|
|
133
|
+
getAnchorIdForNode: function getAnchorIdForNode(node, pos) {
|
|
134
134
|
var _config$getEditorView3;
|
|
135
135
|
var view = (_config$getEditorView3 = config === null || config === void 0 ? void 0 : config.getEditorView()) !== null && _config$getEditorView3 !== void 0 ? _config$getEditorView3 : null;
|
|
136
136
|
if (!view) {
|
|
137
137
|
return undefined;
|
|
138
138
|
}
|
|
139
|
-
|
|
139
|
+
var cachedId = (0, _nodeAnchorProvider.getNodeIdProvider)(view).getIdForNode(node);
|
|
140
|
+
if (cachedId) {
|
|
141
|
+
return cachedId;
|
|
142
|
+
}
|
|
143
|
+
if (pos < 0) {
|
|
144
|
+
return undefined;
|
|
145
|
+
}
|
|
146
|
+
var nodeDOM = view.nodeDOM(pos);
|
|
147
|
+
if (nodeDOM instanceof HTMLElement) {
|
|
148
|
+
return nodeDOM.getAttribute('data-node-anchor') || undefined;
|
|
149
|
+
}
|
|
150
|
+
return undefined;
|
|
140
151
|
}
|
|
141
152
|
}
|
|
142
153
|
};
|
|
@@ -26,7 +26,7 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
|
|
|
26
26
|
* This function is useful for annotating DOM elements with metadata that describes the type and characteristics of the ProseMirror node.
|
|
27
27
|
*
|
|
28
28
|
*
|
|
29
|
-
* @param {
|
|
29
|
+
* @param {object} params - The parameters for the function.
|
|
30
30
|
* @param {PMNode} params.node - The ProseMirror node from which to derive metadata.
|
|
31
31
|
* @param {HTMLElement} params.dom - The DOM element to which the metadata attributes will be attached.
|
|
32
32
|
*/
|
|
@@ -6,6 +6,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.areToolbarFlagsEnabled = void 0;
|
|
7
7
|
var _expValEqualsNoExposure = require("@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure");
|
|
8
8
|
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
9
|
-
var areToolbarFlagsEnabled = exports.areToolbarFlagsEnabled = function areToolbarFlagsEnabled() {
|
|
10
|
-
return (0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_editor_controls', 'cohort', 'variant1') || (0, _experiments.editorExperiment)('platform_editor_toolbar_aifc', true);
|
|
9
|
+
var areToolbarFlagsEnabled = exports.areToolbarFlagsEnabled = function areToolbarFlagsEnabled(isNewToolbarEnabled) {
|
|
10
|
+
return Boolean((0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_editor_controls', 'cohort', 'variant1') || isNewToolbarEnabled && (0, _experiments.editorExperiment)('platform_editor_toolbar_aifc', true));
|
|
11
11
|
};
|
|
@@ -24,7 +24,7 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
|
|
|
24
24
|
* @jsx jsx
|
|
25
25
|
*/ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
26
26
|
var packageName = "@atlaskit/editor-common";
|
|
27
|
-
var packageVersion = "
|
|
27
|
+
var packageVersion = "108.6.1";
|
|
28
28
|
var halfFocusRing = 1;
|
|
29
29
|
var dropOffset = '0, 8';
|
|
30
30
|
var fadeIn = (0, _react2.keyframes)({
|
|
@@ -13,7 +13,6 @@ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/sli
|
|
|
13
13
|
var _react = _interopRequireWildcard(require("react"));
|
|
14
14
|
var _customThemeButton = _interopRequireDefault(require("@atlaskit/button/custom-theme-button"));
|
|
15
15
|
var _tooltip = _interopRequireDefault(require("@atlaskit/tooltip"));
|
|
16
|
-
var _toolbarFlagCheck = require("../../toolbar-flag-check");
|
|
17
16
|
var _Pulse = require("../Pulse/Pulse");
|
|
18
17
|
var _ButtonSpotlightCard = require("./ButtonSpotlightCard");
|
|
19
18
|
var _styles = require("./styles");
|
|
@@ -57,7 +56,8 @@ var _default = exports.default = function _default(_ref) {
|
|
|
57
56
|
ariaLabel = _ref.ariaLabel,
|
|
58
57
|
isRadioButton = _ref.isRadioButton,
|
|
59
58
|
pulse = _ref.pulse,
|
|
60
|
-
spotlightConfig = _ref.spotlightConfig
|
|
59
|
+
spotlightConfig = _ref.spotlightConfig,
|
|
60
|
+
areAnyNewToolbarFlagsEnabled = _ref.areAnyNewToolbarFlagsEnabled;
|
|
61
61
|
// Check if there's only an icon and add additional styles
|
|
62
62
|
var iconOnly = (icon || iconAfter) && !children;
|
|
63
63
|
var customSpacing = iconOnly ? _styles.iconOnlySpacing : {};
|
|
@@ -111,7 +111,7 @@ var _default = exports.default = function _default(_ref) {
|
|
|
111
111
|
appearance: appearance,
|
|
112
112
|
state: themeProps.state,
|
|
113
113
|
mode: themeProps.mode
|
|
114
|
-
})),
|
|
114
|
+
})), areAnyNewToolbarFlagsEnabled ? customSizeAndPadding : {})
|
|
115
115
|
}, rest);
|
|
116
116
|
},
|
|
117
117
|
"aria-label": ariaLabel || title,
|
|
@@ -120,7 +120,7 @@ var _default = exports.default = function _default(_ref) {
|
|
|
120
120
|
role: isRadioButton ? 'radio' : undefined,
|
|
121
121
|
"aria-expanded": ariaHasPopup ? selected : undefined,
|
|
122
122
|
"aria-controls": ariaHasPopup ? areaControls : undefined,
|
|
123
|
-
spacing:
|
|
123
|
+
spacing: areAnyNewToolbarFlagsEnabled ? 'default' : 'compact',
|
|
124
124
|
href: href,
|
|
125
125
|
target: target,
|
|
126
126
|
appearance: appearance,
|
|
@@ -5,7 +5,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _react = require("@emotion/react");
|
|
8
|
-
var _toolbarFlagCheck = require("../../toolbar-flag-check");
|
|
9
8
|
/**
|
|
10
9
|
* @jsxRuntime classic
|
|
11
10
|
* @jsx jsx
|
|
@@ -29,9 +28,10 @@ var separatorFullHeight = (0, _react.css)({
|
|
|
29
28
|
height: '40px'
|
|
30
29
|
});
|
|
31
30
|
var _default = exports.default = function _default(_ref) {
|
|
32
|
-
var fullHeight = _ref.fullHeight
|
|
31
|
+
var fullHeight = _ref.fullHeight,
|
|
32
|
+
areAnyNewToolbarFlagsEnabled = _ref.areAnyNewToolbarFlagsEnabled;
|
|
33
33
|
return (0, _react.jsx)("div", {
|
|
34
|
-
css: [
|
|
34
|
+
css: [areAnyNewToolbarFlagsEnabled ? separatorNew : separator, fullHeight && separatorFullHeight]
|
|
35
35
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
36
36
|
,
|
|
37
37
|
className: "separator"
|
|
@@ -58,7 +58,7 @@ export const aiFailedStateMessages = defineMessages({
|
|
|
58
58
|
},
|
|
59
59
|
adfStreamingError: {
|
|
60
60
|
id: 'fabric.editor.ai.experience.adfStreamingError',
|
|
61
|
-
defaultMessage: `
|
|
62
|
-
description: `
|
|
61
|
+
defaultMessage: `Our apologies, we couldn't get a response.`,
|
|
62
|
+
description: `This error message is displayed when error(s) are encountered during processing of LLM response in ADF format.`
|
|
63
63
|
}
|
|
64
64
|
});
|
|
@@ -48,7 +48,8 @@ export const LinkToolbarButtonGroup = ({
|
|
|
48
48
|
tooltipContent,
|
|
49
49
|
title,
|
|
50
50
|
icon,
|
|
51
|
-
iconFallback
|
|
51
|
+
iconFallback,
|
|
52
|
+
areAnyNewToolbarFlagsEnabled
|
|
52
53
|
}) => {
|
|
53
54
|
const ButtonIcon = icon;
|
|
54
55
|
return jsx(DisallowedWrapper, {
|
|
@@ -68,7 +69,8 @@ export const LinkToolbarButtonGroup = ({
|
|
|
68
69
|
onClick: onClick,
|
|
69
70
|
testId: testId,
|
|
70
71
|
disabled: disabled,
|
|
71
|
-
tooltipContent: tooltipContent
|
|
72
|
+
tooltipContent: tooltipContent,
|
|
73
|
+
areAnyNewToolbarFlagsEnabled: areAnyNewToolbarFlagsEnabled
|
|
72
74
|
}));
|
|
73
75
|
}));
|
|
74
76
|
};
|
|
@@ -29,7 +29,7 @@ export const appearancePropsMap = {
|
|
|
29
29
|
iconFallback: IconEmbed
|
|
30
30
|
}
|
|
31
31
|
};
|
|
32
|
-
export const getButtonGroupOption = (intl, dispatchCommand, {
|
|
32
|
+
export const getButtonGroupOption = (intl, areAnyNewToolbarFlagsEnabled, dispatchCommand, {
|
|
33
33
|
disabled,
|
|
34
34
|
onClick,
|
|
35
35
|
selected,
|
|
@@ -50,6 +50,7 @@ export const getButtonGroupOption = (intl, dispatchCommand, {
|
|
|
50
50
|
disabled: Boolean(disabled),
|
|
51
51
|
tooltipContent: tooltip || null,
|
|
52
52
|
testId,
|
|
53
|
-
selected
|
|
53
|
+
selected,
|
|
54
|
+
areAnyNewToolbarFlagsEnabled: areAnyNewToolbarFlagsEnabled
|
|
54
55
|
};
|
|
55
56
|
};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React, { useEffect, useState } from 'react';
|
|
2
2
|
import Loadable from 'react-loadable';
|
|
3
3
|
import { getContextualToolbarItemsFromModule } from '../extensions';
|
|
4
|
-
import { areToolbarFlagsEnabled } from '../toolbar-flag-check';
|
|
5
4
|
import { nodeToJSON } from '../utils';
|
|
6
5
|
import { DropdownMenuItem } from './DropdownMenuItem';
|
|
7
6
|
import { DropdownSeparator } from './DropdownSeparator';
|
|
@@ -86,7 +85,8 @@ export const DropdownMenuExtensionItems = props => {
|
|
|
86
85
|
editorView,
|
|
87
86
|
extension,
|
|
88
87
|
disabled,
|
|
89
|
-
dropdownOptions
|
|
88
|
+
dropdownOptions,
|
|
89
|
+
areAnyNewToolbarFlagsEnabled
|
|
90
90
|
} = props;
|
|
91
91
|
|
|
92
92
|
// Ignored via go/ees005
|
|
@@ -124,5 +124,5 @@ export const DropdownMenuExtensionItems = props => {
|
|
|
124
124
|
extension: extension,
|
|
125
125
|
dropdownOptions: dropdownOptions
|
|
126
126
|
});
|
|
127
|
-
}),
|
|
127
|
+
}), areAnyNewToolbarFlagsEnabled && /*#__PURE__*/React.createElement(DropdownSeparator, null));
|
|
128
128
|
};
|
|
@@ -29,7 +29,7 @@ function useStaticPlugins(plugins) {
|
|
|
29
29
|
}
|
|
30
30
|
/**
|
|
31
31
|
*
|
|
32
|
-
* NOTE: Generally you
|
|
32
|
+
* NOTE: Generally you want to use `usePluginStateWithSelector` over this which behaves similarly
|
|
33
33
|
* but selects a slice of the state which is more performant.
|
|
34
34
|
*
|
|
35
35
|
* ⚠️⚠️⚠️ This is a debounced hook ⚠️⚠️⚠️
|
|
@@ -32,6 +32,9 @@ import { usePluginStateEffect } from '../usePluginStateEffect';
|
|
|
32
32
|
|
|
33
33
|
/**
|
|
34
34
|
*
|
|
35
|
+
* NOTE: Generally you want to use `usePluginStateWithSelector` over this which behaves similarly
|
|
36
|
+
* but selects a slice of the state which is more performant.
|
|
37
|
+
*
|
|
35
38
|
* ⚠️⚠️⚠️ This is a debounced hook ⚠️⚠️⚠️
|
|
36
39
|
* If the plugins you are listening to generate multiple shared states while the user is typing,
|
|
37
40
|
* your React Component will get only the last one.
|