@atlaskit/editor-plugin-floating-toolbar 0.6.0 → 0.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 +12 -0
- package/dist/cjs/plugin.js +5 -8
- package/dist/cjs/pm-plugins/force-focus/index.js +3 -6
- package/dist/cjs/pm-plugins/toolbar-data/commands.js +3 -5
- package/dist/cjs/pm-plugins/toolbar-data/plugin-factory.js +3 -6
- package/dist/cjs/pm-plugins/toolbar-data/plugin-key.js +1 -2
- package/dist/cjs/pm-plugins/toolbar-data/plugin.js +2 -3
- package/dist/cjs/pm-plugins/toolbar-data/reducer.js +2 -3
- package/dist/cjs/ui/CheckboxModal.js +3 -4
- package/dist/cjs/ui/ConfirmationModal.js +1 -2
- package/dist/cjs/ui/Dropdown.js +3 -4
- package/dist/cjs/ui/DropdownMenu.js +9 -11
- package/dist/cjs/ui/EmojiPickerButton.js +4 -5
- package/dist/cjs/ui/ExtensionsPlaceholder.js +2 -3
- package/dist/cjs/ui/Input.js +2 -3
- package/dist/cjs/ui/ScrollButtons.js +7 -8
- package/dist/cjs/ui/Select.js +2 -2
- package/dist/cjs/ui/Separator.js +1 -2
- package/dist/cjs/ui/SimpleModal.js +2 -3
- package/dist/cjs/ui/Toolbar.js +6 -7
- package/dist/cjs/ui/ToolbarLoader.js +2 -3
- package/dist/cjs/ui/messages.js +2 -3
- package/dist/cjs/ui/styles.js +3 -5
- package/dist/esm/plugin.js +2 -2
- package/dist/esm/ui/CheckboxModal.js +1 -1
- package/dist/esm/ui/Dropdown.js +1 -1
- package/dist/esm/ui/DropdownMenu.js +5 -5
- package/dist/esm/ui/EmojiPickerButton.js +2 -2
- package/dist/esm/ui/ScrollButtons.js +5 -5
- package/dist/esm/ui/Select.js +2 -2
- package/dist/esm/ui/Toolbar.js +5 -5
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-floating-toolbar
|
|
2
2
|
|
|
3
|
+
## 0.6.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
|
|
9
|
+
## 0.6.1
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [#39749](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/39749) [`e6b69f455c3`](https://bitbucket.org/atlassian/atlassian-frontend/commits/e6b69f455c3) - Connect yarn changeset to packages, upgrade adf-schema
|
|
14
|
+
|
|
3
15
|
## 0.6.0
|
|
4
16
|
|
|
5
17
|
### Minor Changes
|
package/dist/cjs/plugin.js
CHANGED
|
@@ -29,7 +29,7 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
29
29
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
30
30
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
31
31
|
// AFP-2532 TODO: Fix automatic suppressions below
|
|
32
|
-
var getRelevantConfig = function getRelevantConfig(selection, configs) {
|
|
32
|
+
var getRelevantConfig = exports.getRelevantConfig = function getRelevantConfig(selection, configs) {
|
|
33
33
|
// node selections always take precedence, see if
|
|
34
34
|
var configPair;
|
|
35
35
|
configs.find(function (config) {
|
|
@@ -91,7 +91,6 @@ var getRelevantConfig = function getRelevantConfig(selection, configs) {
|
|
|
91
91
|
}
|
|
92
92
|
return;
|
|
93
93
|
};
|
|
94
|
-
exports.getRelevantConfig = getRelevantConfig;
|
|
95
94
|
var getDomRefFromSelection = function getDomRefFromSelection(view, dispatchAnalyticsEvent) {
|
|
96
95
|
try {
|
|
97
96
|
return (0, _utils.findDomRefAtPos)(view.state.selection.from, view.domAtPos.bind(view));
|
|
@@ -119,7 +118,7 @@ var getDomRefFromSelection = function getDomRefFromSelection(view, dispatchAnaly
|
|
|
119
118
|
function filterUndefined(x) {
|
|
120
119
|
return !!x;
|
|
121
120
|
}
|
|
122
|
-
var floatingToolbarPlugin = function floatingToolbarPlugin(_ref) {
|
|
121
|
+
var floatingToolbarPlugin = exports.floatingToolbarPlugin = function floatingToolbarPlugin(_ref) {
|
|
123
122
|
var api = _ref.api;
|
|
124
123
|
return {
|
|
125
124
|
name: 'floatingToolbar',
|
|
@@ -160,7 +159,7 @@ var floatingToolbarPlugin = function floatingToolbarPlugin(_ref) {
|
|
|
160
159
|
if (!editorState) {
|
|
161
160
|
return undefined;
|
|
162
161
|
}
|
|
163
|
-
var configWithNodeInfo = (_pluginKey$getState$g = (_pluginKey$getState = pluginKey.getState(editorState)) === null || _pluginKey$getState === void 0
|
|
162
|
+
var configWithNodeInfo = (_pluginKey$getState$g = (_pluginKey$getState = pluginKey.getState(editorState)) === null || _pluginKey$getState === void 0 || (_pluginKey$getState$g2 = _pluginKey$getState.getConfigWithNodeInfo) === null || _pluginKey$getState$g2 === void 0 ? void 0 : _pluginKey$getState$g2.call(_pluginKey$getState, editorState)) !== null && _pluginKey$getState$g !== void 0 ? _pluginKey$getState$g : undefined;
|
|
164
163
|
return {
|
|
165
164
|
configWithNodeInfo: configWithNodeInfo,
|
|
166
165
|
floatingToolbarData: _pluginKey.pluginKey.getState(editorState)
|
|
@@ -185,7 +184,6 @@ var floatingToolbarPlugin = function floatingToolbarPlugin(_ref) {
|
|
|
185
184
|
}
|
|
186
185
|
};
|
|
187
186
|
};
|
|
188
|
-
exports.floatingToolbarPlugin = floatingToolbarPlugin;
|
|
189
187
|
function ContentComponent(_ref5) {
|
|
190
188
|
var _pluginInjectionApi$f, _configWithNodeInfo$c, _configWithNodeInfo$c2;
|
|
191
189
|
var pluginInjectionApi = _ref5.pluginInjectionApi,
|
|
@@ -195,7 +193,7 @@ function ContentComponent(_ref5) {
|
|
|
195
193
|
popupsScrollableElement = _ref5.popupsScrollableElement,
|
|
196
194
|
providerFactory = _ref5.providerFactory,
|
|
197
195
|
dispatchAnalyticsEvent = _ref5.dispatchAnalyticsEvent;
|
|
198
|
-
var featureFlags = (pluginInjectionApi === null || pluginInjectionApi === void 0
|
|
196
|
+
var featureFlags = (pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$f = pluginInjectionApi.featureFlags) === null || _pluginInjectionApi$f === void 0 ? void 0 : _pluginInjectionApi$f.sharedState.currentState()) || {};
|
|
199
197
|
var _useSharedPluginState = (0, _hooks.useSharedPluginState)(pluginInjectionApi, ['floatingToolbar', 'editorDisabled']),
|
|
200
198
|
floatingToolbarState = _useSharedPluginState.floatingToolbarState,
|
|
201
199
|
editorDisabledState = _useSharedPluginState.editorDisabledState;
|
|
@@ -334,12 +332,11 @@ function ContentComponent(_ref5) {
|
|
|
334
332
|
*/
|
|
335
333
|
// We throttle update of this plugin with RAF.
|
|
336
334
|
// So from other plugins you will always get the previous state.
|
|
337
|
-
var pluginKey = new _state.PluginKey('floatingToolbarPluginKey');
|
|
335
|
+
var pluginKey = exports.pluginKey = new _state.PluginKey('floatingToolbarPluginKey');
|
|
338
336
|
|
|
339
337
|
/**
|
|
340
338
|
* Clean up floating toolbar configs from undesired properties.
|
|
341
339
|
*/
|
|
342
|
-
exports.pluginKey = pluginKey;
|
|
343
340
|
function sanitizeFloatingToolbarConfig(config) {
|
|
344
341
|
// Cleanup from non existing node types
|
|
345
342
|
if (Array.isArray(config.nodeType)) {
|
|
@@ -7,13 +7,12 @@ exports.checkShouldForceFocusAndApply = checkShouldForceFocusAndApply;
|
|
|
7
7
|
exports.forceFocusStateKey = exports.forceFocusSelector = exports.default = void 0;
|
|
8
8
|
var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
|
|
9
9
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
10
|
-
var forceFocusStateKey = new _state.PluginKey('forceFocusStatePlugin');
|
|
10
|
+
var forceFocusStateKey = exports.forceFocusStateKey = new _state.PluginKey('forceFocusStatePlugin');
|
|
11
11
|
/**
|
|
12
12
|
* Used in cases where a floating toolbar button opens a submenu which destroys
|
|
13
13
|
* the button, but the user has pressed ESC to close the submenu and focus needs
|
|
14
14
|
* to move back to the button. */
|
|
15
|
-
exports.
|
|
16
|
-
var _default = function _default() {
|
|
15
|
+
var _default = exports.default = function _default() {
|
|
17
16
|
return new _safePlugin.SafePlugin({
|
|
18
17
|
key: forceFocusStateKey,
|
|
19
18
|
state: {
|
|
@@ -37,8 +36,7 @@ var _default = function _default() {
|
|
|
37
36
|
/**
|
|
38
37
|
* The provided selector should be the floating toolbar button that needs focus.
|
|
39
38
|
*/
|
|
40
|
-
exports.
|
|
41
|
-
var forceFocusSelector = function forceFocusSelector(selector) {
|
|
39
|
+
var forceFocusSelector = exports.forceFocusSelector = function forceFocusSelector(selector) {
|
|
42
40
|
return function (tr) {
|
|
43
41
|
return tr.setMeta(forceFocusStateKey, {
|
|
44
42
|
selector: selector
|
|
@@ -49,7 +47,6 @@ var forceFocusSelector = function forceFocusSelector(selector) {
|
|
|
49
47
|
/**
|
|
50
48
|
* If a selector is set and the element exists, focus it.
|
|
51
49
|
*/
|
|
52
|
-
exports.forceFocusSelector = forceFocusSelector;
|
|
53
50
|
function checkShouldForceFocusAndApply(view) {
|
|
54
51
|
var state = view === null || view === void 0 ? void 0 : view.state;
|
|
55
52
|
if (state) {
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.showConfirmDialog = exports.hideConfirmDialog = void 0;
|
|
7
7
|
var _pluginFactory = require("./plugin-factory");
|
|
8
|
-
var showConfirmDialog = function showConfirmDialog(buttonIndex) {
|
|
8
|
+
var showConfirmDialog = exports.showConfirmDialog = function showConfirmDialog(buttonIndex) {
|
|
9
9
|
return (0, _pluginFactory.createCommand)({
|
|
10
10
|
type: 'SHOW_CONFIRM_DIALOG',
|
|
11
11
|
data: {
|
|
@@ -15,12 +15,10 @@ var showConfirmDialog = function showConfirmDialog(buttonIndex) {
|
|
|
15
15
|
return tr.setMeta('addToHistory', false);
|
|
16
16
|
});
|
|
17
17
|
};
|
|
18
|
-
exports.
|
|
19
|
-
var hideConfirmDialog = function hideConfirmDialog() {
|
|
18
|
+
var hideConfirmDialog = exports.hideConfirmDialog = function hideConfirmDialog() {
|
|
20
19
|
return (0, _pluginFactory.createCommand)({
|
|
21
20
|
type: 'HIDE_CONFIRM_DIALOG'
|
|
22
21
|
}, function (tr) {
|
|
23
22
|
return tr.setMeta('addToHistory', false);
|
|
24
23
|
});
|
|
25
|
-
};
|
|
26
|
-
exports.hideConfirmDialog = hideConfirmDialog;
|
|
24
|
+
};
|
|
@@ -8,9 +8,6 @@ var _utils = require("@atlaskit/editor-common/utils");
|
|
|
8
8
|
var _pluginKey = require("./plugin-key");
|
|
9
9
|
var _reducer = require("./reducer");
|
|
10
10
|
var _pluginFactory = (0, _utils.pluginFactory)(_pluginKey.pluginKey, _reducer.reducer),
|
|
11
|
-
createPluginState = _pluginFactory.createPluginState,
|
|
12
|
-
createCommand = _pluginFactory.createCommand,
|
|
13
|
-
getPluginState = _pluginFactory.getPluginState;
|
|
14
|
-
exports.getPluginState = getPluginState;
|
|
15
|
-
exports.createCommand = createCommand;
|
|
16
|
-
exports.createPluginState = createPluginState;
|
|
11
|
+
createPluginState = exports.createPluginState = _pluginFactory.createPluginState,
|
|
12
|
+
createCommand = exports.createCommand = _pluginFactory.createCommand,
|
|
13
|
+
getPluginState = exports.getPluginState = _pluginFactory.getPluginState;
|
|
@@ -5,5 +5,4 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.pluginKey = void 0;
|
|
7
7
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
8
|
-
var pluginKey = new _state.PluginKey('floatingToolbarData');
|
|
9
|
-
exports.pluginKey = pluginKey;
|
|
8
|
+
var pluginKey = exports.pluginKey = new _state.PluginKey('floatingToolbarData');
|
|
@@ -7,10 +7,9 @@ exports.createPlugin = void 0;
|
|
|
7
7
|
var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
|
|
8
8
|
var _pluginFactory = require("./plugin-factory");
|
|
9
9
|
var _pluginKey = require("./plugin-key");
|
|
10
|
-
var createPlugin = function createPlugin(dispatch) {
|
|
10
|
+
var createPlugin = exports.createPlugin = function createPlugin(dispatch) {
|
|
11
11
|
return new _safePlugin.SafePlugin({
|
|
12
12
|
state: (0, _pluginFactory.createPluginState)(dispatch, {}),
|
|
13
13
|
key: _pluginKey.pluginKey
|
|
14
14
|
});
|
|
15
|
-
};
|
|
16
|
-
exports.createPlugin = createPlugin;
|
|
15
|
+
};
|
|
@@ -8,7 +8,7 @@ exports.reducer = void 0;
|
|
|
8
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
9
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
10
10
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
11
|
-
var reducer = function reducer(pluginState, action) {
|
|
11
|
+
var reducer = exports.reducer = function reducer(pluginState, action) {
|
|
12
12
|
switch (action.type) {
|
|
13
13
|
case 'SHOW_CONFIRM_DIALOG':
|
|
14
14
|
return _objectSpread(_objectSpread({}, pluginState), {}, {
|
|
@@ -21,5 +21,4 @@ var reducer = function reducer(pluginState, action) {
|
|
|
21
21
|
default:
|
|
22
22
|
return pluginState;
|
|
23
23
|
}
|
|
24
|
-
};
|
|
25
|
-
exports.reducer = reducer;
|
|
24
|
+
};
|
|
@@ -15,7 +15,7 @@ var _modalDialog = _interopRequireWildcard(require("@atlaskit/modal-dialog"));
|
|
|
15
15
|
var _messages = _interopRequireDefault(require("./messages"));
|
|
16
16
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
17
17
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
18
|
-
var CheckboxModal = function CheckboxModal(props) {
|
|
18
|
+
var CheckboxModal = exports.CheckboxModal = function CheckboxModal(props) {
|
|
19
19
|
var _options$getChildrenI;
|
|
20
20
|
var _useState = (0, _react.useState)(false),
|
|
21
21
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
@@ -30,7 +30,7 @@ var CheckboxModal = function CheckboxModal(props) {
|
|
|
30
30
|
var okButtonLabel = (options === null || options === void 0 ? void 0 : options.okButtonLabel) || formatMessage(_messages.default.confirmModalOK);
|
|
31
31
|
var cancelButtonLabel = (options === null || options === void 0 ? void 0 : options.cancelButtonLabel) || formatMessage(_messages.default.confirmModalCancel);
|
|
32
32
|
var checkboxlabel = options === null || options === void 0 ? void 0 : options.checkboxLabel;
|
|
33
|
-
var childrenInfo = options === null || options === void 0
|
|
33
|
+
var childrenInfo = options === null || options === void 0 || (_options$getChildrenI = options.getChildrenInfo) === null || _options$getChildrenI === void 0 ? void 0 : _options$getChildrenI.call(options);
|
|
34
34
|
var ListComponent = function ListComponent(_ref) {
|
|
35
35
|
var nodes = _ref.nodes;
|
|
36
36
|
if (nodes.length === 0) {
|
|
@@ -79,5 +79,4 @@ var CheckboxModal = function CheckboxModal(props) {
|
|
|
79
79
|
},
|
|
80
80
|
testId: testId ? "".concat(testId, "-confirm-button") : undefined
|
|
81
81
|
}, okButtonLabel)));
|
|
82
|
-
};
|
|
83
|
-
exports.CheckboxModal = CheckboxModal;
|
|
82
|
+
};
|
|
@@ -18,5 +18,4 @@ var ConfirmationModalImpl = function ConfirmationModalImpl(props) {
|
|
|
18
18
|
};
|
|
19
19
|
return options ? /*#__PURE__*/_react.default.createElement(_modalDialog.ModalTransition, null, renderModel(options === null || options === void 0 ? void 0 : options.isReferentialityDialog)) : null;
|
|
20
20
|
};
|
|
21
|
-
var ConfirmationModal = (0, _reactIntlNext.injectIntl)(ConfirmationModalImpl);
|
|
22
|
-
exports.ConfirmationModal = ConfirmationModal;
|
|
21
|
+
var ConfirmationModal = exports.ConfirmationModal = (0, _reactIntlNext.injectIntl)(ConfirmationModalImpl);
|
package/dist/cjs/ui/Dropdown.js
CHANGED
|
@@ -44,7 +44,7 @@ var CompositeIcon = function CompositeIcon(_ref) {
|
|
|
44
44
|
})));
|
|
45
45
|
};
|
|
46
46
|
// eslint-disable-next-line @repo/internal/react/no-class-components
|
|
47
|
-
var Dropdown = /*#__PURE__*/function (_Component) {
|
|
47
|
+
var Dropdown = exports.default = /*#__PURE__*/function (_Component) {
|
|
48
48
|
(0, _inherits2.default)(Dropdown, _Component);
|
|
49
49
|
var _super = _createSuper(Dropdown);
|
|
50
50
|
function Dropdown() {
|
|
@@ -96,7 +96,7 @@ var Dropdown = /*#__PURE__*/function (_Component) {
|
|
|
96
96
|
var _document$querySelect;
|
|
97
97
|
// Focus the trigger button only on Escape
|
|
98
98
|
// Focus is done before hiding to ensure onBlur is called
|
|
99
|
-
(_document$querySelect = document.querySelector("[data-testid=".concat(_this.props.buttonTestId, "]"))) === null || _document$querySelect === void 0
|
|
99
|
+
(_document$querySelect = document.querySelector("[data-testid=".concat(_this.props.buttonTestId, "]"))) === null || _document$querySelect === void 0 || _document$querySelect.focus();
|
|
100
100
|
_this.hide();
|
|
101
101
|
});
|
|
102
102
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onOpenChanged", function (openChangedEvent) {
|
|
@@ -208,5 +208,4 @@ var Dropdown = /*#__PURE__*/function (_Component) {
|
|
|
208
208
|
}
|
|
209
209
|
}]);
|
|
210
210
|
return Dropdown;
|
|
211
|
-
}(_react.Component);
|
|
212
|
-
exports.default = Dropdown;
|
|
211
|
+
}(_react.Component);
|
|
@@ -27,13 +27,12 @@ var _templateObject, _templateObject2, _templateObject3;
|
|
|
27
27
|
// eslint-disable-next-line @atlaskit/design-system/no-deprecated-imports
|
|
28
28
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
29
29
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
30
|
-
var menuItemDimensions = {
|
|
30
|
+
var menuItemDimensions = exports.menuItemDimensions = {
|
|
31
31
|
width: 175,
|
|
32
32
|
height: 32
|
|
33
33
|
};
|
|
34
34
|
|
|
35
35
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
36
|
-
exports.menuItemDimensions = menuItemDimensions;
|
|
37
36
|
var spacer = (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n flex: 1;\n padding: ", ";\n"])), "var(--ds-space-100, 8px)");
|
|
38
37
|
|
|
39
38
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
@@ -44,10 +43,10 @@ var label = (0, _react2.css)(_templateObject3 || (_templateObject3 = (0, _tagged
|
|
|
44
43
|
|
|
45
44
|
// TODO: Migrate away from gridSize
|
|
46
45
|
// Recommendation: Replace with 4 as itemSpacing is used in calculations expecting a number
|
|
47
|
-
var itemSpacing = (0, _constants.gridSize)() / 2;
|
|
46
|
+
var itemSpacing = exports.itemSpacing = (0, _constants.gridSize)() / 2;
|
|
48
47
|
|
|
49
48
|
// Extend the ButtonItem component type to allow mouse events to be accepted from the Typescript check
|
|
50
|
-
|
|
49
|
+
|
|
51
50
|
var DropdownButtonItem = _menu.ButtonItem;
|
|
52
51
|
var DropdownMenuItem = function DropdownMenuItem(_ref) {
|
|
53
52
|
var item = _ref.item,
|
|
@@ -111,7 +110,7 @@ var DropdownMenuItem = function DropdownMenuItem(_ref) {
|
|
|
111
110
|
dispatchCommand(item.onClick);
|
|
112
111
|
hide();
|
|
113
112
|
if (!(editorView !== null && editorView !== void 0 && editorView.hasFocus())) {
|
|
114
|
-
editorView === null || editorView === void 0
|
|
113
|
+
editorView === null || editorView === void 0 || editorView.focus();
|
|
115
114
|
}
|
|
116
115
|
}, [dispatchCommand, item.onClick, hide, editorView]);
|
|
117
116
|
|
|
@@ -126,14 +125,14 @@ var DropdownMenuItem = function DropdownMenuItem(_ref) {
|
|
|
126
125
|
(0, _react.useEffect)(function () {
|
|
127
126
|
var labelRefCurrent = labelRef.current;
|
|
128
127
|
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
129
|
-
labelRefCurrent === null || labelRefCurrent === void 0
|
|
128
|
+
labelRefCurrent === null || labelRefCurrent === void 0 || labelRefCurrent.addEventListener('click', handleTitleWrapperMouseEvent);
|
|
130
129
|
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
131
|
-
labelRefCurrent === null || labelRefCurrent === void 0
|
|
130
|
+
labelRefCurrent === null || labelRefCurrent === void 0 || labelRefCurrent.addEventListener('mousedown', handleTitleWrapperMouseEvent);
|
|
132
131
|
return function () {
|
|
133
132
|
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
134
|
-
labelRefCurrent === null || labelRefCurrent === void 0
|
|
133
|
+
labelRefCurrent === null || labelRefCurrent === void 0 || labelRefCurrent.removeEventListener('click', handleTitleWrapperMouseEvent);
|
|
135
134
|
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
136
|
-
labelRefCurrent === null || labelRefCurrent === void 0
|
|
135
|
+
labelRefCurrent === null || labelRefCurrent === void 0 || labelRefCurrent.removeEventListener('mousedown', handleTitleWrapperMouseEvent);
|
|
137
136
|
};
|
|
138
137
|
});
|
|
139
138
|
var itemContent = (0, _react2.jsx)(DropdownButtonItem, {
|
|
@@ -214,5 +213,4 @@ var Dropdown = /*#__PURE__*/function (_Component) {
|
|
|
214
213
|
}]);
|
|
215
214
|
return Dropdown;
|
|
216
215
|
}(_react.Component);
|
|
217
|
-
var _default = (0, _reactIntlNext.injectIntl)(Dropdown);
|
|
218
|
-
exports.default = _default;
|
|
216
|
+
var _default = exports.default = (0, _reactIntlNext.injectIntl)(Dropdown);
|
|
@@ -22,7 +22,7 @@ var _templateObject;
|
|
|
22
22
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
23
23
|
var emojiPickerButtonWrapper = (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n position: relative;\n"])));
|
|
24
24
|
var EmojiPickerWithListener = (0, _uiReact.withReactEditorViewOuterListeners)(_emoji.EmojiPicker);
|
|
25
|
-
var EmojiPickerButton = function EmojiPickerButton(props) {
|
|
25
|
+
var EmojiPickerButton = exports.EmojiPickerButton = function EmojiPickerButton(props) {
|
|
26
26
|
var buttonRef = _react.default.useRef(null);
|
|
27
27
|
var _React$useState = _react.default.useState(false),
|
|
28
28
|
_React$useState2 = (0, _slicedToArray2.default)(_React$useState, 2),
|
|
@@ -42,7 +42,7 @@ var EmojiPickerButton = function EmojiPickerButton(props) {
|
|
|
42
42
|
props.onChange && props.onChange(emoji);
|
|
43
43
|
requestAnimationFrame(function () {
|
|
44
44
|
var _props$editorView;
|
|
45
|
-
(_props$editorView = props.editorView) === null || _props$editorView === void 0
|
|
45
|
+
(_props$editorView = props.editorView) === null || _props$editorView === void 0 || _props$editorView.focus();
|
|
46
46
|
});
|
|
47
47
|
};
|
|
48
48
|
var isDetachedElement = function isDetachedElement(el) {
|
|
@@ -60,7 +60,7 @@ var EmojiPickerButton = function EmojiPickerButton(props) {
|
|
|
60
60
|
var handleEmojiPressEscape = function handleEmojiPressEscape() {
|
|
61
61
|
var _buttonRef$current;
|
|
62
62
|
setIsPopupOpen(false);
|
|
63
|
-
(_buttonRef$current = buttonRef.current) === null || _buttonRef$current === void 0
|
|
63
|
+
(_buttonRef$current = buttonRef.current) === null || _buttonRef$current === void 0 || _buttonRef$current.focus();
|
|
64
64
|
};
|
|
65
65
|
var renderPicker = function renderPicker(providers) {
|
|
66
66
|
if (!providers.emojiProvider) {
|
|
@@ -117,5 +117,4 @@ var EmojiPickerButton = function EmojiPickerButton(props) {
|
|
|
117
117
|
isSelected: props.isSelected,
|
|
118
118
|
iconBefore: (0, _react2.jsx)(_EditorEmojiAddIcon.default, null)
|
|
119
119
|
})), renderPopup());
|
|
120
|
-
};
|
|
121
|
-
exports.EmojiPickerButton = EmojiPickerButton;
|
|
120
|
+
};
|
|
@@ -95,7 +95,7 @@ var ExtensionButton = function ExtensionButton(props) {
|
|
|
95
95
|
disabled: item.disabled
|
|
96
96
|
}, item.label);
|
|
97
97
|
};
|
|
98
|
-
var ExtensionsPlaceholder = function ExtensionsPlaceholder(props) {
|
|
98
|
+
var ExtensionsPlaceholder = exports.ExtensionsPlaceholder = function ExtensionsPlaceholder(props) {
|
|
99
99
|
var node = props.node,
|
|
100
100
|
editorView = props.editorView,
|
|
101
101
|
extensionProvider = props.extensionProvider,
|
|
@@ -175,5 +175,4 @@ var ExtensionsPlaceholder = function ExtensionsPlaceholder(props) {
|
|
|
175
175
|
return /*#__PURE__*/_react.default.createElement(_buttonGroup.default, {
|
|
176
176
|
children: children
|
|
177
177
|
});
|
|
178
|
-
};
|
|
179
|
-
exports.ExtensionsPlaceholder = ExtensionsPlaceholder;
|
|
178
|
+
};
|
package/dist/cjs/ui/Input.js
CHANGED
|
@@ -21,7 +21,7 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
21
21
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
22
22
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } /** @jsx jsx */
|
|
23
23
|
// eslint-disable-next-line @repo/internal/react/no-class-components
|
|
24
|
-
var TextField = /*#__PURE__*/function (_Component) {
|
|
24
|
+
var TextField = exports.default = /*#__PURE__*/function (_Component) {
|
|
25
25
|
(0, _inherits2.default)(TextField, _Component);
|
|
26
26
|
var _super = _createSuper(TextField);
|
|
27
27
|
function TextField(props) {
|
|
@@ -76,5 +76,4 @@ var TextField = /*#__PURE__*/function (_Component) {
|
|
|
76
76
|
}
|
|
77
77
|
}]);
|
|
78
78
|
return TextField;
|
|
79
|
-
}(_react.Component);
|
|
80
|
-
exports.default = TextField;
|
|
79
|
+
}(_react.Component);
|
|
@@ -24,7 +24,7 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
24
24
|
var toolbarScrollButtons = (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: grid;\n grid-template-columns: 1fr 1fr;\n grid-gap: ", ";\n padding: ", " ", ";\n border-left: solid ", " 1px;\n flex-shrink: 0;\n align-items: center;\n"])), "var(--ds-space-050, 4px)", "var(--ds-space-050, 4px)", "var(--ds-space-100, 8px)", "var(--ds-border, ".concat(_colors.N30, ")"));
|
|
25
25
|
var LeftIcon = _chevronLeftLarge.default;
|
|
26
26
|
var RightIcon = _chevronRightLarge.default;
|
|
27
|
-
var ScrollButtons = function ScrollButtons(_ref) {
|
|
27
|
+
var ScrollButtons = exports.ScrollButtons = function ScrollButtons(_ref) {
|
|
28
28
|
var intl = _ref.intl,
|
|
29
29
|
scrollContainerRef = _ref.scrollContainerRef,
|
|
30
30
|
node = _ref.node,
|
|
@@ -67,7 +67,7 @@ var ScrollButtons = function ScrollButtons(_ref) {
|
|
|
67
67
|
|
|
68
68
|
// scroll to current position - scroll container width
|
|
69
69
|
var scrollTo = scrollLeft - scrollContainerWidth;
|
|
70
|
-
(_scrollContainerRef$c4 = scrollContainerRef.current) === null || _scrollContainerRef$c4 === void 0
|
|
70
|
+
(_scrollContainerRef$c4 = scrollContainerRef.current) === null || _scrollContainerRef$c4 === void 0 || _scrollContainerRef$c4.scrollTo({
|
|
71
71
|
top: 0,
|
|
72
72
|
left: scrollTo,
|
|
73
73
|
behavior: 'smooth'
|
|
@@ -82,16 +82,16 @@ var ScrollButtons = function ScrollButtons(_ref) {
|
|
|
82
82
|
|
|
83
83
|
// scroll to current position + scroll container width
|
|
84
84
|
var scrollTo = scrollLeft + scrollContainerWidth;
|
|
85
|
-
(_scrollContainerRef$c7 = scrollContainerRef.current) === null || _scrollContainerRef$c7 === void 0
|
|
85
|
+
(_scrollContainerRef$c7 = scrollContainerRef.current) === null || _scrollContainerRef$c7 === void 0 || _scrollContainerRef$c7.scrollTo({
|
|
86
86
|
top: 0,
|
|
87
87
|
left: scrollTo,
|
|
88
88
|
behavior: 'smooth'
|
|
89
89
|
});
|
|
90
90
|
};
|
|
91
91
|
var resizeObserver = new ResizeObserver(function (t) {
|
|
92
|
-
var _scrollContainerRef$c8, _scrollContainerRef$c9
|
|
92
|
+
var _scrollContainerRef$c8, _scrollContainerRef$c9;
|
|
93
93
|
var widthNeededToShowAllItems = ((_scrollContainerRef$c8 = scrollContainerRef.current) === null || _scrollContainerRef$c8 === void 0 ? void 0 : _scrollContainerRef$c8.scrollWidth) || 0;
|
|
94
|
-
var availableSpace = (_scrollContainerRef$c9 = scrollContainerRef.current) === null || _scrollContainerRef$c9 === void 0
|
|
94
|
+
var availableSpace = (_scrollContainerRef$c9 = scrollContainerRef.current) === null || _scrollContainerRef$c9 === void 0 || (_scrollContainerRef$c9 = _scrollContainerRef$c9.parentNode) === null || _scrollContainerRef$c9 === void 0 ? void 0 : _scrollContainerRef$c9.offsetWidth;
|
|
95
95
|
if (availableSpace >= widthNeededToShowAllItems) {
|
|
96
96
|
setNeedScroll(false);
|
|
97
97
|
} else {
|
|
@@ -126,7 +126,7 @@ var ScrollButtons = function ScrollButtons(_ref) {
|
|
|
126
126
|
var _scrollContainerRefCu;
|
|
127
127
|
// reset scroll position when switching from one node with toolbar to another
|
|
128
128
|
// scroll to made optional as it may not be rendered in testing env
|
|
129
|
-
(_scrollContainerRefCu = scrollContainerRefCurrent.scrollTo) === null || _scrollContainerRefCu === void 0
|
|
129
|
+
(_scrollContainerRefCu = scrollContainerRefCurrent.scrollTo) === null || _scrollContainerRefCu === void 0 || _scrollContainerRefCu.call(scrollContainerRefCurrent, {
|
|
130
130
|
left: 0
|
|
131
131
|
});
|
|
132
132
|
}
|
|
@@ -151,5 +151,4 @@ var ScrollButtons = function ScrollButtons(_ref) {
|
|
|
151
151
|
onClick: scrollRight,
|
|
152
152
|
disabled: !canScrollRight || disabled
|
|
153
153
|
})) : null;
|
|
154
|
-
};
|
|
155
|
-
exports.ScrollButtons = ScrollButtons;
|
|
154
|
+
};
|
package/dist/cjs/ui/Select.js
CHANGED
|
@@ -25,13 +25,13 @@ function Search(props) {
|
|
|
25
25
|
});
|
|
26
26
|
},
|
|
27
27
|
menuPortal: function menuPortal(base) {
|
|
28
|
-
var _selectRef$current, _selectRef$
|
|
28
|
+
var _selectRef$current, _selectRef$current2;
|
|
29
29
|
// ED:16095: We add two possible getter paths for safely reaching into the underlying
|
|
30
30
|
// react-select element. We first try a getter that conforms with react-select v5 APIs,
|
|
31
31
|
// Failing that, we try a getter consistent with react-select v4 APIs. (We
|
|
32
32
|
// handle both as consumers may control the time of the actual dependency version
|
|
33
33
|
// cutover).
|
|
34
|
-
var controlWrapper = (selectRef === null || selectRef === void 0
|
|
34
|
+
var controlWrapper = (selectRef === null || selectRef === void 0 || (_selectRef$current = selectRef.current) === null || _selectRef$current === void 0 || (_selectRef$current = _selectRef$current.select) === null || _selectRef$current === void 0 || (_selectRef$current = _selectRef$current.controlRef) === null || _selectRef$current === void 0 ? void 0 : _selectRef$current.parentNode) || (selectRef === null || selectRef === void 0 || (_selectRef$current2 = selectRef.current) === null || _selectRef$current2 === void 0 || (_selectRef$current2 = _selectRef$current2.select) === null || _selectRef$current2 === void 0 || (_selectRef$current2 = _selectRef$current2.select) === null || _selectRef$current2 === void 0 || (_selectRef$current2 = _selectRef$current2.controlRef) === null || _selectRef$current2 === void 0 ? void 0 : _selectRef$current2.parentNode);
|
|
35
35
|
var menuPortalStyles = controlWrapper && props.setDisableParentScroll ? {
|
|
36
36
|
// since the portal is now outside, we need to position it as before
|
|
37
37
|
top: controlWrapper.offsetTop,
|
package/dist/cjs/ui/Separator.js
CHANGED
|
@@ -5,5 +5,4 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _ui = require("@atlaskit/editor-common/ui");
|
|
8
|
-
var _default = _ui.FloatingToolbarSeparator;
|
|
9
|
-
exports.default = _default;
|
|
8
|
+
var _default = exports.default = _ui.FloatingToolbarSeparator;
|
|
@@ -12,7 +12,7 @@ var _modalDialog = _interopRequireWildcard(require("@atlaskit/modal-dialog"));
|
|
|
12
12
|
var _messages = _interopRequireDefault(require("./messages"));
|
|
13
13
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
14
14
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
15
|
-
var SimpleModal = function SimpleModal(props) {
|
|
15
|
+
var SimpleModal = exports.SimpleModal = function SimpleModal(props) {
|
|
16
16
|
var onConfirm = props.onConfirm,
|
|
17
17
|
onClose = props.onClose,
|
|
18
18
|
options = props.options,
|
|
@@ -38,5 +38,4 @@ var SimpleModal = function SimpleModal(props) {
|
|
|
38
38
|
},
|
|
39
39
|
testId: testId ? "".concat(testId, "-confirm-button") : undefined
|
|
40
40
|
}, okButtonLabel)));
|
|
41
|
-
};
|
|
42
|
-
exports.SimpleModal = SimpleModal;
|
|
41
|
+
};
|
package/dist/cjs/ui/Toolbar.js
CHANGED
|
@@ -76,7 +76,7 @@ var ToolbarItems = /*#__PURE__*/_react.default.memo(function (_ref) {
|
|
|
76
76
|
} else {
|
|
77
77
|
dispatchCommand(item.onClick);
|
|
78
78
|
if (item.focusEditoronEnter && !(editorView !== null && editorView !== void 0 && editorView.hasFocus())) {
|
|
79
|
-
editorView === null || editorView === void 0
|
|
79
|
+
editorView === null || editorView === void 0 || editorView.focus();
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
82
|
};
|
|
@@ -231,8 +231,8 @@ var ToolbarItems = /*#__PURE__*/_react.default.memo(function (_ref) {
|
|
|
231
231
|
editorView: editorView,
|
|
232
232
|
extensionProvider: extensionsProvider,
|
|
233
233
|
separator: item.separator,
|
|
234
|
-
applyChangeToContextPanel: api === null || api === void 0
|
|
235
|
-
extensionApi: api === null || api === void 0
|
|
234
|
+
applyChangeToContextPanel: api === null || api === void 0 || (_api$contextPanel = api.contextPanel) === null || _api$contextPanel === void 0 ? void 0 : _api$contextPanel.actions.applyChange,
|
|
235
|
+
extensionApi: api === null || api === void 0 || (_api$extension = api.extension) === null || _api$extension === void 0 ? void 0 : _api$extension.actions.api()
|
|
236
236
|
});
|
|
237
237
|
case 'separator':
|
|
238
238
|
return (0, _react2.jsx)(_Separator.default, {
|
|
@@ -288,7 +288,7 @@ var Toolbar = /*#__PURE__*/function (_Component) {
|
|
|
288
288
|
if (isDropdownOpen || isSelectMenuOpen) {
|
|
289
289
|
return;
|
|
290
290
|
}
|
|
291
|
-
(_this$props$editorVie = _this.props.editorView) === null || _this$props$editorVie === void 0
|
|
291
|
+
(_this$props$editorVie = _this.props.editorView) === null || _this$props$editorVie === void 0 || _this$props$editorVie.focus();
|
|
292
292
|
event.preventDefault();
|
|
293
293
|
event.stopPropagation();
|
|
294
294
|
});
|
|
@@ -315,7 +315,7 @@ var Toolbar = /*#__PURE__*/function (_Component) {
|
|
|
315
315
|
if (table) {
|
|
316
316
|
return (0, _commands.clearHoverSelection)()(state, dispatch);
|
|
317
317
|
}
|
|
318
|
-
(_this$props$api = this.props.api) === null || _this$props$api === void 0
|
|
318
|
+
(_this$props$api = this.props.api) === null || _this$props$api === void 0 || _this$props$api.decorations.actions.removeDecoration(state, dispatch);
|
|
319
319
|
}
|
|
320
320
|
}
|
|
321
321
|
}, {
|
|
@@ -432,5 +432,4 @@ var Toolbar = /*#__PURE__*/function (_Component) {
|
|
|
432
432
|
}]);
|
|
433
433
|
return Toolbar;
|
|
434
434
|
}(_react.Component);
|
|
435
|
-
var _default = (0, _reactIntlNext.injectIntl)(Toolbar);
|
|
436
|
-
exports.default = _default;
|
|
435
|
+
var _default = exports.default = (0, _reactIntlNext.injectIntl)(Toolbar);
|
|
@@ -9,7 +9,7 @@ var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
|
9
9
|
var _reactLoadable = _interopRequireDefault(require("react-loadable"));
|
|
10
10
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
11
11
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || (0, _typeof2.default)(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
12
|
-
var ToolbarLoader = (0, _reactLoadable.default)({
|
|
12
|
+
var ToolbarLoader = exports.ToolbarLoader = (0, _reactLoadable.default)({
|
|
13
13
|
loader: function loader() {
|
|
14
14
|
return Promise.resolve().then(function () {
|
|
15
15
|
return _interopRequireWildcard(require( /* webpackChunkName: "@atlaskit-internal_editor-core-floating-toolbar" */
|
|
@@ -21,5 +21,4 @@ var ToolbarLoader = (0, _reactLoadable.default)({
|
|
|
21
21
|
loading: function loading() {
|
|
22
22
|
return null;
|
|
23
23
|
}
|
|
24
|
-
});
|
|
25
|
-
exports.ToolbarLoader = ToolbarLoader;
|
|
24
|
+
});
|
package/dist/cjs/ui/messages.js
CHANGED
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _reactIntlNext = require("react-intl-next");
|
|
8
|
-
var _default = (0, _reactIntlNext.defineMessages)({
|
|
8
|
+
var _default = exports.default = (0, _reactIntlNext.defineMessages)({
|
|
9
9
|
confirmModalDefaultHeading: {
|
|
10
10
|
id: 'fabric.editor.floatingToolbar.confirmModalHeading',
|
|
11
11
|
defaultMessage: 'Are you sure?',
|
|
@@ -51,5 +51,4 @@ var _default = (0, _reactIntlNext.defineMessages)({
|
|
|
51
51
|
defaultMessage: 'Scroll right',
|
|
52
52
|
description: 'Button to scroll right when the toolbar is in the overflow state'
|
|
53
53
|
}
|
|
54
|
-
});
|
|
55
|
-
exports.default = _default;
|
|
54
|
+
});
|
package/dist/cjs/ui/styles.js
CHANGED
|
@@ -53,7 +53,7 @@ var getStyles = function getStyles(property, _ref) {
|
|
|
53
53
|
}
|
|
54
54
|
return property[appearance][state][mode];
|
|
55
55
|
};
|
|
56
|
-
var iconOnlySpacing = {
|
|
56
|
+
var iconOnlySpacing = exports.iconOnlySpacing = {
|
|
57
57
|
'&&': {
|
|
58
58
|
padding: '0px',
|
|
59
59
|
/**
|
|
@@ -69,11 +69,9 @@ var iconOnlySpacing = {
|
|
|
69
69
|
margin: '0px'
|
|
70
70
|
}
|
|
71
71
|
};
|
|
72
|
-
exports.
|
|
73
|
-
var getButtonStyles = function getButtonStyles(props) {
|
|
72
|
+
var getButtonStyles = exports.getButtonStyles = function getButtonStyles(props) {
|
|
74
73
|
return {
|
|
75
74
|
background: getStyles(background, props),
|
|
76
75
|
color: getStyles(color, props)
|
|
77
76
|
};
|
|
78
|
-
};
|
|
79
|
-
exports.getButtonStyles = getButtonStyles;
|
|
77
|
+
};
|
package/dist/esm/plugin.js
CHANGED
|
@@ -150,7 +150,7 @@ export var floatingToolbarPlugin = function floatingToolbarPlugin(_ref) {
|
|
|
150
150
|
if (!editorState) {
|
|
151
151
|
return undefined;
|
|
152
152
|
}
|
|
153
|
-
var configWithNodeInfo = (_pluginKey$getState$g = (_pluginKey$getState = pluginKey.getState(editorState)) === null || _pluginKey$getState === void 0
|
|
153
|
+
var configWithNodeInfo = (_pluginKey$getState$g = (_pluginKey$getState = pluginKey.getState(editorState)) === null || _pluginKey$getState === void 0 || (_pluginKey$getState$g2 = _pluginKey$getState.getConfigWithNodeInfo) === null || _pluginKey$getState$g2 === void 0 ? void 0 : _pluginKey$getState$g2.call(_pluginKey$getState, editorState)) !== null && _pluginKey$getState$g !== void 0 ? _pluginKey$getState$g : undefined;
|
|
154
154
|
return {
|
|
155
155
|
configWithNodeInfo: configWithNodeInfo,
|
|
156
156
|
floatingToolbarData: dataPluginKey.getState(editorState)
|
|
@@ -184,7 +184,7 @@ function ContentComponent(_ref5) {
|
|
|
184
184
|
popupsScrollableElement = _ref5.popupsScrollableElement,
|
|
185
185
|
providerFactory = _ref5.providerFactory,
|
|
186
186
|
dispatchAnalyticsEvent = _ref5.dispatchAnalyticsEvent;
|
|
187
|
-
var featureFlags = (pluginInjectionApi === null || pluginInjectionApi === void 0
|
|
187
|
+
var featureFlags = (pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$f = pluginInjectionApi.featureFlags) === null || _pluginInjectionApi$f === void 0 ? void 0 : _pluginInjectionApi$f.sharedState.currentState()) || {};
|
|
188
188
|
var _useSharedPluginState = useSharedPluginState(pluginInjectionApi, ['floatingToolbar', 'editorDisabled']),
|
|
189
189
|
floatingToolbarState = _useSharedPluginState.floatingToolbarState,
|
|
190
190
|
editorDisabledState = _useSharedPluginState.editorDisabledState;
|
|
@@ -20,7 +20,7 @@ export var CheckboxModal = function CheckboxModal(props) {
|
|
|
20
20
|
var okButtonLabel = (options === null || options === void 0 ? void 0 : options.okButtonLabel) || formatMessage(messages.confirmModalOK);
|
|
21
21
|
var cancelButtonLabel = (options === null || options === void 0 ? void 0 : options.cancelButtonLabel) || formatMessage(messages.confirmModalCancel);
|
|
22
22
|
var checkboxlabel = options === null || options === void 0 ? void 0 : options.checkboxLabel;
|
|
23
|
-
var childrenInfo = options === null || options === void 0
|
|
23
|
+
var childrenInfo = options === null || options === void 0 || (_options$getChildrenI = options.getChildrenInfo) === null || _options$getChildrenI === void 0 ? void 0 : _options$getChildrenI.call(options);
|
|
24
24
|
var ListComponent = function ListComponent(_ref) {
|
|
25
25
|
var nodes = _ref.nodes;
|
|
26
26
|
if (nodes.length === 0) {
|
package/dist/esm/ui/Dropdown.js
CHANGED
|
@@ -88,7 +88,7 @@ var Dropdown = /*#__PURE__*/function (_Component) {
|
|
|
88
88
|
var _document$querySelect;
|
|
89
89
|
// Focus the trigger button only on Escape
|
|
90
90
|
// Focus is done before hiding to ensure onBlur is called
|
|
91
|
-
(_document$querySelect = document.querySelector("[data-testid=".concat(_this.props.buttonTestId, "]"))) === null || _document$querySelect === void 0
|
|
91
|
+
(_document$querySelect = document.querySelector("[data-testid=".concat(_this.props.buttonTestId, "]"))) === null || _document$querySelect === void 0 || _document$querySelect.focus();
|
|
92
92
|
_this.hide();
|
|
93
93
|
});
|
|
94
94
|
_defineProperty(_assertThisInitialized(_this), "onOpenChanged", function (openChangedEvent) {
|
|
@@ -105,7 +105,7 @@ var DropdownMenuItem = function DropdownMenuItem(_ref) {
|
|
|
105
105
|
dispatchCommand(item.onClick);
|
|
106
106
|
hide();
|
|
107
107
|
if (!(editorView !== null && editorView !== void 0 && editorView.hasFocus())) {
|
|
108
|
-
editorView === null || editorView === void 0
|
|
108
|
+
editorView === null || editorView === void 0 || editorView.focus();
|
|
109
109
|
}
|
|
110
110
|
}, [dispatchCommand, item.onClick, hide, editorView]);
|
|
111
111
|
|
|
@@ -120,14 +120,14 @@ var DropdownMenuItem = function DropdownMenuItem(_ref) {
|
|
|
120
120
|
useEffect(function () {
|
|
121
121
|
var labelRefCurrent = labelRef.current;
|
|
122
122
|
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
123
|
-
labelRefCurrent === null || labelRefCurrent === void 0
|
|
123
|
+
labelRefCurrent === null || labelRefCurrent === void 0 || labelRefCurrent.addEventListener('click', handleTitleWrapperMouseEvent);
|
|
124
124
|
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
125
|
-
labelRefCurrent === null || labelRefCurrent === void 0
|
|
125
|
+
labelRefCurrent === null || labelRefCurrent === void 0 || labelRefCurrent.addEventListener('mousedown', handleTitleWrapperMouseEvent);
|
|
126
126
|
return function () {
|
|
127
127
|
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
128
|
-
labelRefCurrent === null || labelRefCurrent === void 0
|
|
128
|
+
labelRefCurrent === null || labelRefCurrent === void 0 || labelRefCurrent.removeEventListener('click', handleTitleWrapperMouseEvent);
|
|
129
129
|
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
130
|
-
labelRefCurrent === null || labelRefCurrent === void 0
|
|
130
|
+
labelRefCurrent === null || labelRefCurrent === void 0 || labelRefCurrent.removeEventListener('mousedown', handleTitleWrapperMouseEvent);
|
|
131
131
|
};
|
|
132
132
|
});
|
|
133
133
|
var itemContent = jsx(DropdownButtonItem, {
|
|
@@ -36,7 +36,7 @@ export var EmojiPickerButton = function EmojiPickerButton(props) {
|
|
|
36
36
|
props.onChange && props.onChange(emoji);
|
|
37
37
|
requestAnimationFrame(function () {
|
|
38
38
|
var _props$editorView;
|
|
39
|
-
(_props$editorView = props.editorView) === null || _props$editorView === void 0
|
|
39
|
+
(_props$editorView = props.editorView) === null || _props$editorView === void 0 || _props$editorView.focus();
|
|
40
40
|
});
|
|
41
41
|
};
|
|
42
42
|
var isDetachedElement = function isDetachedElement(el) {
|
|
@@ -54,7 +54,7 @@ export var EmojiPickerButton = function EmojiPickerButton(props) {
|
|
|
54
54
|
var handleEmojiPressEscape = function handleEmojiPressEscape() {
|
|
55
55
|
var _buttonRef$current;
|
|
56
56
|
setIsPopupOpen(false);
|
|
57
|
-
(_buttonRef$current = buttonRef.current) === null || _buttonRef$current === void 0
|
|
57
|
+
(_buttonRef$current = buttonRef.current) === null || _buttonRef$current === void 0 || _buttonRef$current.focus();
|
|
58
58
|
};
|
|
59
59
|
var renderPicker = function renderPicker(providers) {
|
|
60
60
|
if (!providers.emojiProvider) {
|
|
@@ -58,7 +58,7 @@ export var ScrollButtons = function ScrollButtons(_ref) {
|
|
|
58
58
|
|
|
59
59
|
// scroll to current position - scroll container width
|
|
60
60
|
var scrollTo = scrollLeft - scrollContainerWidth;
|
|
61
|
-
(_scrollContainerRef$c4 = scrollContainerRef.current) === null || _scrollContainerRef$c4 === void 0
|
|
61
|
+
(_scrollContainerRef$c4 = scrollContainerRef.current) === null || _scrollContainerRef$c4 === void 0 || _scrollContainerRef$c4.scrollTo({
|
|
62
62
|
top: 0,
|
|
63
63
|
left: scrollTo,
|
|
64
64
|
behavior: 'smooth'
|
|
@@ -73,16 +73,16 @@ export var ScrollButtons = function ScrollButtons(_ref) {
|
|
|
73
73
|
|
|
74
74
|
// scroll to current position + scroll container width
|
|
75
75
|
var scrollTo = scrollLeft + scrollContainerWidth;
|
|
76
|
-
(_scrollContainerRef$c7 = scrollContainerRef.current) === null || _scrollContainerRef$c7 === void 0
|
|
76
|
+
(_scrollContainerRef$c7 = scrollContainerRef.current) === null || _scrollContainerRef$c7 === void 0 || _scrollContainerRef$c7.scrollTo({
|
|
77
77
|
top: 0,
|
|
78
78
|
left: scrollTo,
|
|
79
79
|
behavior: 'smooth'
|
|
80
80
|
});
|
|
81
81
|
};
|
|
82
82
|
var resizeObserver = new ResizeObserver(function (t) {
|
|
83
|
-
var _scrollContainerRef$c8, _scrollContainerRef$c9
|
|
83
|
+
var _scrollContainerRef$c8, _scrollContainerRef$c9;
|
|
84
84
|
var widthNeededToShowAllItems = ((_scrollContainerRef$c8 = scrollContainerRef.current) === null || _scrollContainerRef$c8 === void 0 ? void 0 : _scrollContainerRef$c8.scrollWidth) || 0;
|
|
85
|
-
var availableSpace = (_scrollContainerRef$c9 = scrollContainerRef.current) === null || _scrollContainerRef$c9 === void 0
|
|
85
|
+
var availableSpace = (_scrollContainerRef$c9 = scrollContainerRef.current) === null || _scrollContainerRef$c9 === void 0 || (_scrollContainerRef$c9 = _scrollContainerRef$c9.parentNode) === null || _scrollContainerRef$c9 === void 0 ? void 0 : _scrollContainerRef$c9.offsetWidth;
|
|
86
86
|
if (availableSpace >= widthNeededToShowAllItems) {
|
|
87
87
|
setNeedScroll(false);
|
|
88
88
|
} else {
|
|
@@ -117,7 +117,7 @@ export var ScrollButtons = function ScrollButtons(_ref) {
|
|
|
117
117
|
var _scrollContainerRefCu;
|
|
118
118
|
// reset scroll position when switching from one node with toolbar to another
|
|
119
119
|
// scroll to made optional as it may not be rendered in testing env
|
|
120
|
-
(_scrollContainerRefCu = scrollContainerRefCurrent.scrollTo) === null || _scrollContainerRefCu === void 0
|
|
120
|
+
(_scrollContainerRefCu = scrollContainerRefCurrent.scrollTo) === null || _scrollContainerRefCu === void 0 || _scrollContainerRefCu.call(scrollContainerRefCurrent, {
|
|
121
121
|
left: 0
|
|
122
122
|
});
|
|
123
123
|
}
|
package/dist/esm/ui/Select.js
CHANGED
|
@@ -15,13 +15,13 @@ export default function Search(props) {
|
|
|
15
15
|
});
|
|
16
16
|
},
|
|
17
17
|
menuPortal: function menuPortal(base) {
|
|
18
|
-
var _selectRef$current, _selectRef$
|
|
18
|
+
var _selectRef$current, _selectRef$current2;
|
|
19
19
|
// ED:16095: We add two possible getter paths for safely reaching into the underlying
|
|
20
20
|
// react-select element. We first try a getter that conforms with react-select v5 APIs,
|
|
21
21
|
// Failing that, we try a getter consistent with react-select v4 APIs. (We
|
|
22
22
|
// handle both as consumers may control the time of the actual dependency version
|
|
23
23
|
// cutover).
|
|
24
|
-
var controlWrapper = (selectRef === null || selectRef === void 0
|
|
24
|
+
var controlWrapper = (selectRef === null || selectRef === void 0 || (_selectRef$current = selectRef.current) === null || _selectRef$current === void 0 || (_selectRef$current = _selectRef$current.select) === null || _selectRef$current === void 0 || (_selectRef$current = _selectRef$current.controlRef) === null || _selectRef$current === void 0 ? void 0 : _selectRef$current.parentNode) || (selectRef === null || selectRef === void 0 || (_selectRef$current2 = selectRef.current) === null || _selectRef$current2 === void 0 || (_selectRef$current2 = _selectRef$current2.select) === null || _selectRef$current2 === void 0 || (_selectRef$current2 = _selectRef$current2.select) === null || _selectRef$current2 === void 0 || (_selectRef$current2 = _selectRef$current2.controlRef) === null || _selectRef$current2 === void 0 ? void 0 : _selectRef$current2.parentNode);
|
|
25
25
|
var menuPortalStyles = controlWrapper && props.setDisableParentScroll ? {
|
|
26
26
|
// since the portal is now outside, we need to position it as before
|
|
27
27
|
top: controlWrapper.offsetTop,
|
package/dist/esm/ui/Toolbar.js
CHANGED
|
@@ -67,7 +67,7 @@ var ToolbarItems = /*#__PURE__*/React.memo(function (_ref) {
|
|
|
67
67
|
} else {
|
|
68
68
|
dispatchCommand(item.onClick);
|
|
69
69
|
if (item.focusEditoronEnter && !(editorView !== null && editorView !== void 0 && editorView.hasFocus())) {
|
|
70
|
-
editorView === null || editorView === void 0
|
|
70
|
+
editorView === null || editorView === void 0 || editorView.focus();
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
73
|
};
|
|
@@ -222,8 +222,8 @@ var ToolbarItems = /*#__PURE__*/React.memo(function (_ref) {
|
|
|
222
222
|
editorView: editorView,
|
|
223
223
|
extensionProvider: extensionsProvider,
|
|
224
224
|
separator: item.separator,
|
|
225
|
-
applyChangeToContextPanel: api === null || api === void 0
|
|
226
|
-
extensionApi: api === null || api === void 0
|
|
225
|
+
applyChangeToContextPanel: api === null || api === void 0 || (_api$contextPanel = api.contextPanel) === null || _api$contextPanel === void 0 ? void 0 : _api$contextPanel.actions.applyChange,
|
|
226
|
+
extensionApi: api === null || api === void 0 || (_api$extension = api.extension) === null || _api$extension === void 0 ? void 0 : _api$extension.actions.api()
|
|
227
227
|
});
|
|
228
228
|
case 'separator':
|
|
229
229
|
return jsx(Separator, {
|
|
@@ -279,7 +279,7 @@ var Toolbar = /*#__PURE__*/function (_Component) {
|
|
|
279
279
|
if (isDropdownOpen || isSelectMenuOpen) {
|
|
280
280
|
return;
|
|
281
281
|
}
|
|
282
|
-
(_this$props$editorVie = _this.props.editorView) === null || _this$props$editorVie === void 0
|
|
282
|
+
(_this$props$editorVie = _this.props.editorView) === null || _this$props$editorVie === void 0 || _this$props$editorVie.focus();
|
|
283
283
|
event.preventDefault();
|
|
284
284
|
event.stopPropagation();
|
|
285
285
|
});
|
|
@@ -306,7 +306,7 @@ var Toolbar = /*#__PURE__*/function (_Component) {
|
|
|
306
306
|
if (table) {
|
|
307
307
|
return clearHoverSelection()(state, dispatch);
|
|
308
308
|
}
|
|
309
|
-
(_this$props$api = this.props.api) === null || _this$props$api === void 0
|
|
309
|
+
(_this$props$api = this.props.api) === null || _this$props$api === void 0 || _this$props$api.decorations.actions.removeDecoration(state, dispatch);
|
|
310
310
|
}
|
|
311
311
|
}
|
|
312
312
|
}, {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-floating-toolbar",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.2",
|
|
4
4
|
"description": "Floating toolbar plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -23,13 +23,13 @@
|
|
|
23
23
|
".": "./src/index.ts"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@atlaskit/adf-schema": "^
|
|
26
|
+
"@atlaskit/adf-schema": "^32.0.0",
|
|
27
27
|
"@atlaskit/button": "^16.10.0",
|
|
28
28
|
"@atlaskit/checkbox": "^12.6.0",
|
|
29
|
-
"@atlaskit/editor-common": "^76.
|
|
29
|
+
"@atlaskit/editor-common": "^76.2.0",
|
|
30
30
|
"@atlaskit/editor-palette": "1.5.1",
|
|
31
31
|
"@atlaskit/editor-plugin-context-panel": "^0.2.0",
|
|
32
|
-
"@atlaskit/editor-plugin-copy-button": "^0.
|
|
32
|
+
"@atlaskit/editor-plugin-copy-button": "^1.0.0",
|
|
33
33
|
"@atlaskit/editor-plugin-decorations": "^0.2.0",
|
|
34
34
|
"@atlaskit/editor-plugin-editor-disabled": "^0.2.0",
|
|
35
35
|
"@atlaskit/editor-plugin-extension": "^0.2.0",
|