@atlaskit/editor-plugin-insert-block 3.3.0 → 3.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-insert-block
|
|
2
2
|
|
|
3
|
+
## 3.4.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#176604](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/176604)
|
|
8
|
+
[`65c00b32defac`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/65c00b32defac) -
|
|
9
|
+
[ux] adding functionality to feature insert whiteboard options at the top of the quick insert menu
|
|
10
|
+
|
|
11
|
+
## 3.3.1
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [#175546](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/175546)
|
|
16
|
+
[`1b24bd01d2634`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/1b24bd01d2634) -
|
|
17
|
+
[EDITOR-636] Remove fg editor_a11y_tab_does_not_close_menus
|
|
18
|
+
- Updated dependencies
|
|
19
|
+
|
|
3
20
|
## 3.3.0
|
|
4
21
|
|
|
5
22
|
### Minor Changes
|
|
@@ -12,6 +12,7 @@ var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers
|
|
|
12
12
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
13
13
|
var _react = require("react");
|
|
14
14
|
var _react2 = require("@emotion/react");
|
|
15
|
+
var _reactIntlNext = require("react-intl-next");
|
|
15
16
|
var _CellMeasurer = require("react-virtualized/dist/commonjs/CellMeasurer");
|
|
16
17
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
17
18
|
var _elementBrowser = require("@atlaskit/editor-common/element-browser");
|
|
@@ -59,6 +60,8 @@ var InsertMenu = function InsertMenu(_ref) {
|
|
|
59
60
|
_useState4 = (0, _slicedToArray2.default)(_useState3, 2),
|
|
60
61
|
height = _useState4[0],
|
|
61
62
|
setHeight = _useState4[1];
|
|
63
|
+
var _useIntl = (0, _reactIntlNext.useIntl)(),
|
|
64
|
+
formatMessage = _useIntl.formatMessage;
|
|
62
65
|
var cache = (0, _react.useMemo)(function () {
|
|
63
66
|
return new _CellMeasurer.CellMeasurerCache({
|
|
64
67
|
fixedWidth: true,
|
|
@@ -119,6 +122,46 @@ var InsertMenu = function InsertMenu(_ref) {
|
|
|
119
122
|
var _useSharedState = useSharedState(pluginInjectionApi),
|
|
120
123
|
connectivityMode = _useSharedState.connectivityMode;
|
|
121
124
|
var getItems = (0, _react.useCallback)(function (query, category) {
|
|
125
|
+
var filterForPinWhiteboardsExperiment = function filterForPinWhiteboardsExperiment(featuredItems) {
|
|
126
|
+
// Part of ATLAS-95399 to pin whiteboards to the top of the InsertMenu
|
|
127
|
+
// Need to check if whiteboard options are available, and filter for the cohort
|
|
128
|
+
// Takes the original featuredItems list and returns one with the right whiteboard option at the top
|
|
129
|
+
if ((0, _platformFeatureFlags.fg)('confluence-whiteboards-quick-insert-eligible')) {
|
|
130
|
+
var DIAGRAM_TITLE = 'Create diagram',
|
|
131
|
+
BLANK_TITLE = 'Create whiteboard';
|
|
132
|
+
var featuredWhiteboardsPresent = featuredItems.filter(function (item) {
|
|
133
|
+
return [DIAGRAM_TITLE, BLANK_TITLE].includes(item.title);
|
|
134
|
+
}).length === 2;
|
|
135
|
+
if (featuredWhiteboardsPresent) {
|
|
136
|
+
(0, _expValEquals.expValEquals)('confluence_whiteboards_quick_insert_aa', 'cohort', 'control');
|
|
137
|
+
var pinWhiteboardActionToTop = function pinWhiteboardActionToTop(featuredItems, title) {
|
|
138
|
+
// find the requested item by title, give it the appropriate description, and bring it to the top of the list
|
|
139
|
+
var index = featuredItems.findIndex(function (item) {
|
|
140
|
+
return item.title === title;
|
|
141
|
+
});
|
|
142
|
+
var filteredList = featuredItems.filter(function (item) {
|
|
143
|
+
return ![DIAGRAM_TITLE, BLANK_TITLE].includes(item.title);
|
|
144
|
+
});
|
|
145
|
+
if (index === -1) {
|
|
146
|
+
return filteredList;
|
|
147
|
+
}
|
|
148
|
+
var featuredItem = _objectSpread({}, featuredItems[index]);
|
|
149
|
+
featuredItem.description = formatMessage(_quickInsert.messages.featuredWhiteboardDescription);
|
|
150
|
+
return [featuredItem].concat((0, _toConsumableArray2.default)(filteredList));
|
|
151
|
+
};
|
|
152
|
+
if ((0, _expValEquals.expValEquals)('confluence_whiteboards_quick_insert', 'cohort', 'test_blank')) {
|
|
153
|
+
return pinWhiteboardActionToTop(featuredItems, BLANK_TITLE);
|
|
154
|
+
} else if ((0, _expValEquals.expValEquals)('confluence_whiteboards_quick_insert', 'cohort', 'test_diagram')) {
|
|
155
|
+
return pinWhiteboardActionToTop(featuredItems, DIAGRAM_TITLE);
|
|
156
|
+
} else {
|
|
157
|
+
return featuredItems.filter(function (item) {
|
|
158
|
+
return ![DIAGRAM_TITLE, BLANK_TITLE].includes(item.title);
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
return featuredItems;
|
|
164
|
+
};
|
|
122
165
|
var result;
|
|
123
166
|
/**
|
|
124
167
|
* @warning The results if there is a query are not the same as the results if there is no query.
|
|
@@ -152,26 +195,7 @@ var InsertMenu = function InsertMenu(_ref) {
|
|
|
152
195
|
}
|
|
153
196
|
setItemCount(result.length);
|
|
154
197
|
return result;
|
|
155
|
-
}, [pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$q6 = pluginInjectionApi.quickInsert) === null || _pluginInjectionApi$q6 === void 0 ? void 0 : _pluginInjectionApi$q6.actions, quickInsertDropdownItems, connectivityMode]);
|
|
156
|
-
var filterForPinWhiteboardsExperiment = function filterForPinWhiteboardsExperiment(featuredItems) {
|
|
157
|
-
// Part of ATLAS-95399 to pin whiteboards to the top of the InsertMenu
|
|
158
|
-
// Need to check if whiteboard options are available, and filter for the cohort
|
|
159
|
-
// Takes the original featuredItems list and returns one with the right whiteboard option at the top
|
|
160
|
-
if ((0, _platformFeatureFlags.fg)('confluence-whiteboards-quick-insert-eligible')) {
|
|
161
|
-
var featuredWhiteboards = ['Create diagram', 'Create whiteboard'];
|
|
162
|
-
var featuredWhiteboardsPresent = featuredItems.filter(function (item) {
|
|
163
|
-
return featuredWhiteboards.includes(item.title);
|
|
164
|
-
}).length === 2;
|
|
165
|
-
if (featuredWhiteboardsPresent) {
|
|
166
|
-
(0, _expValEquals.expValEquals)('confluence_whiteboards_quick_insert_aa', 'cohort', 'control');
|
|
167
|
-
}
|
|
168
|
-
// removing all whiteboards for now since they aren't present by default, will add more specific logic later.
|
|
169
|
-
return featuredItems.filter(function (item) {
|
|
170
|
-
return !featuredWhiteboards.includes(item.title);
|
|
171
|
-
});
|
|
172
|
-
}
|
|
173
|
-
return featuredItems;
|
|
174
|
-
};
|
|
198
|
+
}, [pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$q6 = pluginInjectionApi.quickInsert) === null || _pluginInjectionApi$q6 === void 0 ? void 0 : _pluginInjectionApi$q6.actions, quickInsertDropdownItems, connectivityMode, formatMessage]);
|
|
175
199
|
var emptyStateHandler = pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$q7 = pluginInjectionApi.quickInsert) === null || _pluginInjectionApi$q7 === void 0 || (_pluginInjectionApi$q7 = _pluginInjectionApi$q7.sharedState.currentState()) === null || _pluginInjectionApi$q7 === void 0 ? void 0 : _pluginInjectionApi$q7.emptyStateHandler;
|
|
176
200
|
var onViewMore = (0, _react.useCallback)(function () {
|
|
177
201
|
var _pluginInjectionApi$c, _pluginInjectionApi$q8;
|
|
@@ -185,7 +209,7 @@ var InsertMenu = function InsertMenu(_ref) {
|
|
|
185
209
|
}, (0, _react2.jsx)(ElementBrowserWrapper, {
|
|
186
210
|
handleClickOutside: toggleVisiblity,
|
|
187
211
|
handleEscapeKeydown: toggleVisiblity,
|
|
188
|
-
closeOnTab:
|
|
212
|
+
closeOnTab: false
|
|
189
213
|
}, (0, _react2.jsx)(_elementBrowser.ElementBrowser, {
|
|
190
214
|
mode: "inline",
|
|
191
215
|
getItems: getItems,
|
|
@@ -8,11 +8,12 @@ import { useCallback, useContext, useLayoutEffect, useMemo, useState } from 'rea
|
|
|
8
8
|
|
|
9
9
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
10
10
|
import { css, jsx } from '@emotion/react';
|
|
11
|
+
import { useIntl } from 'react-intl-next';
|
|
11
12
|
import { CellMeasurerCache } from 'react-virtualized/dist/commonjs/CellMeasurer';
|
|
12
13
|
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
13
14
|
import { ELEMENT_ITEM_HEIGHT, ElementBrowser } from '@atlaskit/editor-common/element-browser';
|
|
14
15
|
import { useSharedPluginState, sharedPluginStateHookMigratorFactory } from '@atlaskit/editor-common/hooks';
|
|
15
|
-
import { IconCode, IconDate, IconDecision, IconDivider, IconExpand, IconPanel, IconQuote, IconStatus } from '@atlaskit/editor-common/quick-insert';
|
|
16
|
+
import { messages, IconCode, IconDate, IconDecision, IconDivider, IconExpand, IconPanel, IconQuote, IconStatus } from '@atlaskit/editor-common/quick-insert';
|
|
16
17
|
import { OutsideClickTargetRefContext, withReactEditorViewOuterListeners as withOuterListeners } from '@atlaskit/editor-common/ui-react';
|
|
17
18
|
import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared-plugin-state-selector';
|
|
18
19
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
@@ -45,6 +46,9 @@ const InsertMenu = ({
|
|
|
45
46
|
var _pluginInjectionApi$q8, _pluginInjectionApi$q9, _pluginInjectionApi$q0;
|
|
46
47
|
const [itemCount, setItemCount] = useState(0);
|
|
47
48
|
const [height, setHeight] = useState(DEFAULT_HEIGHT);
|
|
49
|
+
const {
|
|
50
|
+
formatMessage
|
|
51
|
+
} = useIntl();
|
|
48
52
|
const cache = useMemo(() => {
|
|
49
53
|
return new CellMeasurerCache({
|
|
50
54
|
fixedWidth: true,
|
|
@@ -98,6 +102,39 @@ const InsertMenu = ({
|
|
|
98
102
|
connectivityMode
|
|
99
103
|
} = useSharedState(pluginInjectionApi);
|
|
100
104
|
const getItems = useCallback((query, category) => {
|
|
105
|
+
const filterForPinWhiteboardsExperiment = featuredItems => {
|
|
106
|
+
// Part of ATLAS-95399 to pin whiteboards to the top of the InsertMenu
|
|
107
|
+
// Need to check if whiteboard options are available, and filter for the cohort
|
|
108
|
+
// Takes the original featuredItems list and returns one with the right whiteboard option at the top
|
|
109
|
+
if (fg('confluence-whiteboards-quick-insert-eligible')) {
|
|
110
|
+
const [DIAGRAM_TITLE, BLANK_TITLE] = ['Create diagram', 'Create whiteboard'];
|
|
111
|
+
const featuredWhiteboardsPresent = featuredItems.filter(item => [DIAGRAM_TITLE, BLANK_TITLE].includes(item.title)).length === 2;
|
|
112
|
+
if (featuredWhiteboardsPresent) {
|
|
113
|
+
expValEquals('confluence_whiteboards_quick_insert_aa', 'cohort', 'control');
|
|
114
|
+
const pinWhiteboardActionToTop = (featuredItems, title) => {
|
|
115
|
+
// find the requested item by title, give it the appropriate description, and bring it to the top of the list
|
|
116
|
+
const index = featuredItems.findIndex(item => item.title === title);
|
|
117
|
+
const filteredList = featuredItems.filter(item => ![DIAGRAM_TITLE, BLANK_TITLE].includes(item.title));
|
|
118
|
+
if (index === -1) {
|
|
119
|
+
return filteredList;
|
|
120
|
+
}
|
|
121
|
+
const featuredItem = {
|
|
122
|
+
...featuredItems[index]
|
|
123
|
+
};
|
|
124
|
+
featuredItem.description = formatMessage(messages.featuredWhiteboardDescription);
|
|
125
|
+
return [featuredItem, ...filteredList];
|
|
126
|
+
};
|
|
127
|
+
if (expValEquals('confluence_whiteboards_quick_insert', 'cohort', 'test_blank')) {
|
|
128
|
+
return pinWhiteboardActionToTop(featuredItems, BLANK_TITLE);
|
|
129
|
+
} else if (expValEquals('confluence_whiteboards_quick_insert', 'cohort', 'test_diagram')) {
|
|
130
|
+
return pinWhiteboardActionToTop(featuredItems, DIAGRAM_TITLE);
|
|
131
|
+
} else {
|
|
132
|
+
return featuredItems.filter(item => ![DIAGRAM_TITLE, BLANK_TITLE].includes(item.title));
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
return featuredItems;
|
|
137
|
+
};
|
|
101
138
|
let result;
|
|
102
139
|
/**
|
|
103
140
|
* @warning The results if there is a query are not the same as the results if there is no query.
|
|
@@ -129,22 +166,7 @@ const InsertMenu = ({
|
|
|
129
166
|
}
|
|
130
167
|
setItemCount(result.length);
|
|
131
168
|
return result;
|
|
132
|
-
}, [pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$q8 = pluginInjectionApi.quickInsert) === null || _pluginInjectionApi$q8 === void 0 ? void 0 : _pluginInjectionApi$q8.actions, quickInsertDropdownItems, connectivityMode]);
|
|
133
|
-
const filterForPinWhiteboardsExperiment = featuredItems => {
|
|
134
|
-
// Part of ATLAS-95399 to pin whiteboards to the top of the InsertMenu
|
|
135
|
-
// Need to check if whiteboard options are available, and filter for the cohort
|
|
136
|
-
// Takes the original featuredItems list and returns one with the right whiteboard option at the top
|
|
137
|
-
if (fg('confluence-whiteboards-quick-insert-eligible')) {
|
|
138
|
-
const featuredWhiteboards = ['Create diagram', 'Create whiteboard'];
|
|
139
|
-
const featuredWhiteboardsPresent = featuredItems.filter(item => featuredWhiteboards.includes(item.title)).length === 2;
|
|
140
|
-
if (featuredWhiteboardsPresent) {
|
|
141
|
-
expValEquals('confluence_whiteboards_quick_insert_aa', 'cohort', 'control');
|
|
142
|
-
}
|
|
143
|
-
// removing all whiteboards for now since they aren't present by default, will add more specific logic later.
|
|
144
|
-
return featuredItems.filter(item => !featuredWhiteboards.includes(item.title));
|
|
145
|
-
}
|
|
146
|
-
return featuredItems;
|
|
147
|
-
};
|
|
169
|
+
}, [pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$q8 = pluginInjectionApi.quickInsert) === null || _pluginInjectionApi$q8 === void 0 ? void 0 : _pluginInjectionApi$q8.actions, quickInsertDropdownItems, connectivityMode, formatMessage]);
|
|
148
170
|
const emptyStateHandler = pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$q9 = pluginInjectionApi.quickInsert) === null || _pluginInjectionApi$q9 === void 0 ? void 0 : (_pluginInjectionApi$q0 = _pluginInjectionApi$q9.sharedState.currentState()) === null || _pluginInjectionApi$q0 === void 0 ? void 0 : _pluginInjectionApi$q0.emptyStateHandler;
|
|
149
171
|
const onViewMore = useCallback(() => {
|
|
150
172
|
var _pluginInjectionApi$c, _pluginInjectionApi$q1;
|
|
@@ -158,7 +180,7 @@ const InsertMenu = ({
|
|
|
158
180
|
}, jsx(ElementBrowserWrapper, {
|
|
159
181
|
handleClickOutside: toggleVisiblity,
|
|
160
182
|
handleEscapeKeydown: toggleVisiblity,
|
|
161
|
-
closeOnTab:
|
|
183
|
+
closeOnTab: false
|
|
162
184
|
}, jsx(ElementBrowser, {
|
|
163
185
|
mode: "inline",
|
|
164
186
|
getItems: getItems,
|
|
@@ -15,11 +15,12 @@ import { useCallback, useContext, useLayoutEffect, useMemo, useState } from 'rea
|
|
|
15
15
|
|
|
16
16
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
17
17
|
import { css, jsx } from '@emotion/react';
|
|
18
|
+
import { useIntl } from 'react-intl-next';
|
|
18
19
|
import { CellMeasurerCache } from 'react-virtualized/dist/commonjs/CellMeasurer';
|
|
19
20
|
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
20
21
|
import { ELEMENT_ITEM_HEIGHT, ElementBrowser } from '@atlaskit/editor-common/element-browser';
|
|
21
22
|
import { useSharedPluginState, sharedPluginStateHookMigratorFactory } from '@atlaskit/editor-common/hooks';
|
|
22
|
-
import { IconCode, IconDate, IconDecision, IconDivider, IconExpand, IconPanel, IconQuote, IconStatus } from '@atlaskit/editor-common/quick-insert';
|
|
23
|
+
import { messages, IconCode, IconDate, IconDecision, IconDivider, IconExpand, IconPanel, IconQuote, IconStatus } from '@atlaskit/editor-common/quick-insert';
|
|
23
24
|
import { OutsideClickTargetRefContext, withReactEditorViewOuterListeners as withOuterListeners } from '@atlaskit/editor-common/ui-react';
|
|
24
25
|
import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared-plugin-state-selector';
|
|
25
26
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
@@ -56,6 +57,8 @@ var InsertMenu = function InsertMenu(_ref) {
|
|
|
56
57
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
57
58
|
height = _useState4[0],
|
|
58
59
|
setHeight = _useState4[1];
|
|
60
|
+
var _useIntl = useIntl(),
|
|
61
|
+
formatMessage = _useIntl.formatMessage;
|
|
59
62
|
var cache = useMemo(function () {
|
|
60
63
|
return new CellMeasurerCache({
|
|
61
64
|
fixedWidth: true,
|
|
@@ -116,6 +119,46 @@ var InsertMenu = function InsertMenu(_ref) {
|
|
|
116
119
|
var _useSharedState = useSharedState(pluginInjectionApi),
|
|
117
120
|
connectivityMode = _useSharedState.connectivityMode;
|
|
118
121
|
var getItems = useCallback(function (query, category) {
|
|
122
|
+
var filterForPinWhiteboardsExperiment = function filterForPinWhiteboardsExperiment(featuredItems) {
|
|
123
|
+
// Part of ATLAS-95399 to pin whiteboards to the top of the InsertMenu
|
|
124
|
+
// Need to check if whiteboard options are available, and filter for the cohort
|
|
125
|
+
// Takes the original featuredItems list and returns one with the right whiteboard option at the top
|
|
126
|
+
if (fg('confluence-whiteboards-quick-insert-eligible')) {
|
|
127
|
+
var DIAGRAM_TITLE = 'Create diagram',
|
|
128
|
+
BLANK_TITLE = 'Create whiteboard';
|
|
129
|
+
var featuredWhiteboardsPresent = featuredItems.filter(function (item) {
|
|
130
|
+
return [DIAGRAM_TITLE, BLANK_TITLE].includes(item.title);
|
|
131
|
+
}).length === 2;
|
|
132
|
+
if (featuredWhiteboardsPresent) {
|
|
133
|
+
expValEquals('confluence_whiteboards_quick_insert_aa', 'cohort', 'control');
|
|
134
|
+
var pinWhiteboardActionToTop = function pinWhiteboardActionToTop(featuredItems, title) {
|
|
135
|
+
// find the requested item by title, give it the appropriate description, and bring it to the top of the list
|
|
136
|
+
var index = featuredItems.findIndex(function (item) {
|
|
137
|
+
return item.title === title;
|
|
138
|
+
});
|
|
139
|
+
var filteredList = featuredItems.filter(function (item) {
|
|
140
|
+
return ![DIAGRAM_TITLE, BLANK_TITLE].includes(item.title);
|
|
141
|
+
});
|
|
142
|
+
if (index === -1) {
|
|
143
|
+
return filteredList;
|
|
144
|
+
}
|
|
145
|
+
var featuredItem = _objectSpread({}, featuredItems[index]);
|
|
146
|
+
featuredItem.description = formatMessage(messages.featuredWhiteboardDescription);
|
|
147
|
+
return [featuredItem].concat(_toConsumableArray(filteredList));
|
|
148
|
+
};
|
|
149
|
+
if (expValEquals('confluence_whiteboards_quick_insert', 'cohort', 'test_blank')) {
|
|
150
|
+
return pinWhiteboardActionToTop(featuredItems, BLANK_TITLE);
|
|
151
|
+
} else if (expValEquals('confluence_whiteboards_quick_insert', 'cohort', 'test_diagram')) {
|
|
152
|
+
return pinWhiteboardActionToTop(featuredItems, DIAGRAM_TITLE);
|
|
153
|
+
} else {
|
|
154
|
+
return featuredItems.filter(function (item) {
|
|
155
|
+
return ![DIAGRAM_TITLE, BLANK_TITLE].includes(item.title);
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
return featuredItems;
|
|
161
|
+
};
|
|
119
162
|
var result;
|
|
120
163
|
/**
|
|
121
164
|
* @warning The results if there is a query are not the same as the results if there is no query.
|
|
@@ -149,26 +192,7 @@ var InsertMenu = function InsertMenu(_ref) {
|
|
|
149
192
|
}
|
|
150
193
|
setItemCount(result.length);
|
|
151
194
|
return result;
|
|
152
|
-
}, [pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$q6 = pluginInjectionApi.quickInsert) === null || _pluginInjectionApi$q6 === void 0 ? void 0 : _pluginInjectionApi$q6.actions, quickInsertDropdownItems, connectivityMode]);
|
|
153
|
-
var filterForPinWhiteboardsExperiment = function filterForPinWhiteboardsExperiment(featuredItems) {
|
|
154
|
-
// Part of ATLAS-95399 to pin whiteboards to the top of the InsertMenu
|
|
155
|
-
// Need to check if whiteboard options are available, and filter for the cohort
|
|
156
|
-
// Takes the original featuredItems list and returns one with the right whiteboard option at the top
|
|
157
|
-
if (fg('confluence-whiteboards-quick-insert-eligible')) {
|
|
158
|
-
var featuredWhiteboards = ['Create diagram', 'Create whiteboard'];
|
|
159
|
-
var featuredWhiteboardsPresent = featuredItems.filter(function (item) {
|
|
160
|
-
return featuredWhiteboards.includes(item.title);
|
|
161
|
-
}).length === 2;
|
|
162
|
-
if (featuredWhiteboardsPresent) {
|
|
163
|
-
expValEquals('confluence_whiteboards_quick_insert_aa', 'cohort', 'control');
|
|
164
|
-
}
|
|
165
|
-
// removing all whiteboards for now since they aren't present by default, will add more specific logic later.
|
|
166
|
-
return featuredItems.filter(function (item) {
|
|
167
|
-
return !featuredWhiteboards.includes(item.title);
|
|
168
|
-
});
|
|
169
|
-
}
|
|
170
|
-
return featuredItems;
|
|
171
|
-
};
|
|
195
|
+
}, [pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$q6 = pluginInjectionApi.quickInsert) === null || _pluginInjectionApi$q6 === void 0 ? void 0 : _pluginInjectionApi$q6.actions, quickInsertDropdownItems, connectivityMode, formatMessage]);
|
|
172
196
|
var emptyStateHandler = pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$q7 = pluginInjectionApi.quickInsert) === null || _pluginInjectionApi$q7 === void 0 || (_pluginInjectionApi$q7 = _pluginInjectionApi$q7.sharedState.currentState()) === null || _pluginInjectionApi$q7 === void 0 ? void 0 : _pluginInjectionApi$q7.emptyStateHandler;
|
|
173
197
|
var onViewMore = useCallback(function () {
|
|
174
198
|
var _pluginInjectionApi$c, _pluginInjectionApi$q8;
|
|
@@ -182,7 +206,7 @@ var InsertMenu = function InsertMenu(_ref) {
|
|
|
182
206
|
}, jsx(ElementBrowserWrapper, {
|
|
183
207
|
handleClickOutside: toggleVisiblity,
|
|
184
208
|
handleEscapeKeydown: toggleVisiblity,
|
|
185
|
-
closeOnTab:
|
|
209
|
+
closeOnTab: false
|
|
186
210
|
}, jsx(ElementBrowser, {
|
|
187
211
|
mode: "inline",
|
|
188
212
|
getItems: getItems,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-insert-block",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.4.0",
|
|
4
4
|
"description": "Insert block plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -34,14 +34,14 @@
|
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@atlaskit/button": "^23.2.0",
|
|
37
|
-
"@atlaskit/editor-common": "^107.
|
|
37
|
+
"@atlaskit/editor-common": "^107.3.0",
|
|
38
38
|
"@atlaskit/editor-plugin-analytics": "^2.3.0",
|
|
39
39
|
"@atlaskit/editor-plugin-block-type": "^5.2.0",
|
|
40
40
|
"@atlaskit/editor-plugin-code-block": "^4.4.0",
|
|
41
41
|
"@atlaskit/editor-plugin-connectivity": "^2.0.0",
|
|
42
42
|
"@atlaskit/editor-plugin-date": "^4.3.0",
|
|
43
43
|
"@atlaskit/editor-plugin-emoji": "^3.7.0",
|
|
44
|
-
"@atlaskit/editor-plugin-expand": "^3.
|
|
44
|
+
"@atlaskit/editor-plugin-expand": "^3.4.0",
|
|
45
45
|
"@atlaskit/editor-plugin-extension": "^5.5.0",
|
|
46
46
|
"@atlaskit/editor-plugin-feature-flags": "^1.4.0",
|
|
47
47
|
"@atlaskit/editor-plugin-hyperlink": "^4.5.0",
|
|
@@ -57,19 +57,19 @@
|
|
|
57
57
|
"@atlaskit/editor-plugin-quick-insert": "^2.6.0",
|
|
58
58
|
"@atlaskit/editor-plugin-rule": "^2.1.0",
|
|
59
59
|
"@atlaskit/editor-plugin-status": "^3.1.0",
|
|
60
|
-
"@atlaskit/editor-plugin-table": "^10.
|
|
60
|
+
"@atlaskit/editor-plugin-table": "^10.13.0",
|
|
61
61
|
"@atlaskit/editor-plugin-tasks-and-decisions": "^5.1.0",
|
|
62
62
|
"@atlaskit/editor-plugin-type-ahead": "^2.7.0",
|
|
63
63
|
"@atlaskit/editor-prosemirror": "7.0.0",
|
|
64
64
|
"@atlaskit/editor-shared-styles": "^3.4.0",
|
|
65
65
|
"@atlaskit/emoji": "^69.3.0",
|
|
66
66
|
"@atlaskit/heading": "^5.2.0",
|
|
67
|
-
"@atlaskit/icon": "^27.
|
|
68
|
-
"@atlaskit/icon-lab": "^5.
|
|
67
|
+
"@atlaskit/icon": "^27.2.0",
|
|
68
|
+
"@atlaskit/icon-lab": "^5.1.0",
|
|
69
69
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
70
|
-
"@atlaskit/primitives": "^14.
|
|
70
|
+
"@atlaskit/primitives": "^14.10.0",
|
|
71
71
|
"@atlaskit/theme": "^18.0.0",
|
|
72
|
-
"@atlaskit/tmp-editor-statsig": "^8.
|
|
72
|
+
"@atlaskit/tmp-editor-statsig": "^8.5.0",
|
|
73
73
|
"@atlaskit/tokens": "^5.4.0",
|
|
74
74
|
"@atlaskit/tooltip": "^20.3.0",
|
|
75
75
|
"@babel/runtime": "^7.0.0",
|
|
@@ -133,9 +133,6 @@
|
|
|
133
133
|
"platform_editor_toolbar_responsive_fixes": {
|
|
134
134
|
"type": "boolean"
|
|
135
135
|
},
|
|
136
|
-
"editor_a11y_tab_does_not_close_menus": {
|
|
137
|
-
"type": "boolean"
|
|
138
|
-
},
|
|
139
136
|
"platform_editor_ease_of_use_metrics": {
|
|
140
137
|
"type": "boolean"
|
|
141
138
|
},
|