@atlaskit/editor-common 72.4.1 → 72.5.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 +52 -0
- package/dist/cjs/analytics/analytics-queue.js +79 -0
- package/dist/cjs/analytics/fire-analytics-event.js +36 -0
- package/dist/cjs/analytics/index.js +15 -1
- package/dist/cjs/analytics/types/enums.js +4 -0
- package/dist/cjs/analytics/utils.js +16 -0
- package/dist/cjs/hooks/index.js +20 -0
- package/dist/cjs/hooks/useConstructor.js +22 -0
- package/dist/cjs/hooks/usePreviousState.js +23 -0
- package/dist/cjs/keymaps/index.js +1 -1
- package/dist/cjs/styles/index.js +6 -0
- package/dist/cjs/styles/shared/table.js +3 -1
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/cjs/ui/index.js +6 -0
- package/dist/cjs/ui-color/ColorPalette/Color/index.js +2 -3
- package/dist/cjs/ui-color/ColorPalette/Palettes/panelBackgroundPalette.js +1 -1
- package/dist/cjs/ui-color/ColorPalette/index.js +9 -11
- package/dist/cjs/ui-color/ColorPalette/utils.js +42 -0
- package/dist/cjs/ui-color/index.js +25 -0
- package/dist/cjs/ui-menu/ArrowKeyNavigationProvider/ColorPaletteArrowKeyNavigationProvider/index.js +141 -0
- package/dist/cjs/ui-menu/{MenuArrowKeyNavigationProvider → ArrowKeyNavigationProvider/MenuArrowKeyNavigationProvider}/index.js +15 -0
- package/dist/cjs/ui-menu/ArrowKeyNavigationProvider/index.js +29 -0
- package/dist/cjs/ui-menu/ArrowKeyNavigationProvider/types.js +12 -0
- package/dist/cjs/ui-menu/Dropdown/index.js +5 -7
- package/dist/cjs/ui-menu/DropdownMenu/index.js +50 -24
- package/dist/cjs/ui-menu/ToolbarButton/index.js +3 -1
- package/dist/cjs/ui-menu/index.js +21 -0
- package/dist/cjs/utils/analytics.js +5 -1
- package/dist/cjs/utils/index.js +6 -0
- package/dist/cjs/utils/referentiality.js +29 -15
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/analytics/analytics-queue.js +53 -0
- package/dist/es2019/analytics/fire-analytics-event.js +27 -0
- package/dist/es2019/analytics/index.js +3 -1
- package/dist/es2019/analytics/types/enums.js +4 -0
- package/dist/es2019/analytics/utils.js +4 -0
- package/dist/es2019/hooks/index.js +2 -0
- package/dist/es2019/hooks/useConstructor.js +17 -0
- package/dist/es2019/hooks/usePreviousState.js +18 -0
- package/dist/es2019/keymaps/index.js +1 -1
- package/dist/es2019/styles/index.js +1 -1
- package/dist/es2019/styles/shared/table.js +1 -0
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/es2019/ui/index.js +1 -1
- package/dist/es2019/ui-color/ColorPalette/Color/index.js +7 -4
- package/dist/es2019/ui-color/ColorPalette/Palettes/panelBackgroundPalette.js +1 -1
- package/dist/es2019/ui-color/ColorPalette/index.js +9 -11
- package/dist/es2019/ui-color/ColorPalette/utils.js +31 -0
- package/dist/es2019/ui-color/index.js +1 -0
- package/dist/es2019/ui-menu/ArrowKeyNavigationProvider/ColorPaletteArrowKeyNavigationProvider/index.js +132 -0
- package/dist/es2019/ui-menu/{MenuArrowKeyNavigationProvider → ArrowKeyNavigationProvider/MenuArrowKeyNavigationProvider}/index.js +16 -1
- package/dist/es2019/ui-menu/ArrowKeyNavigationProvider/index.js +21 -0
- package/dist/es2019/ui-menu/ArrowKeyNavigationProvider/types.js +5 -0
- package/dist/es2019/ui-menu/Dropdown/index.js +5 -7
- package/dist/es2019/ui-menu/DropdownMenu/index.js +46 -23
- package/dist/es2019/ui-menu/ToolbarButton/index.js +3 -1
- package/dist/es2019/ui-menu/index.js +3 -0
- package/dist/es2019/utils/analytics.js +1 -0
- package/dist/es2019/utils/index.js +1 -1
- package/dist/es2019/utils/referentiality.js +19 -15
- package/dist/es2019/version.json +1 -1
- package/dist/esm/analytics/analytics-queue.js +71 -0
- package/dist/esm/analytics/fire-analytics-event.js +29 -0
- package/dist/esm/analytics/index.js +3 -1
- package/dist/esm/analytics/types/enums.js +4 -0
- package/dist/esm/analytics/utils.js +9 -0
- package/dist/esm/hooks/index.js +2 -0
- package/dist/esm/hooks/useConstructor.js +17 -0
- package/dist/esm/hooks/usePreviousState.js +18 -0
- package/dist/esm/keymaps/index.js +1 -1
- package/dist/esm/styles/index.js +1 -1
- package/dist/esm/styles/shared/table.js +1 -0
- package/dist/esm/ui/DropList/index.js +1 -1
- package/dist/esm/ui/index.js +1 -1
- package/dist/esm/ui-color/ColorPalette/Color/index.js +2 -3
- package/dist/esm/ui-color/ColorPalette/Palettes/panelBackgroundPalette.js +1 -1
- package/dist/esm/ui-color/ColorPalette/index.js +9 -11
- package/dist/esm/ui-color/ColorPalette/utils.js +32 -0
- package/dist/esm/ui-color/index.js +1 -0
- package/dist/esm/ui-menu/ArrowKeyNavigationProvider/ColorPaletteArrowKeyNavigationProvider/index.js +131 -0
- package/dist/esm/ui-menu/{MenuArrowKeyNavigationProvider → ArrowKeyNavigationProvider/MenuArrowKeyNavigationProvider}/index.js +16 -1
- package/dist/esm/ui-menu/ArrowKeyNavigationProvider/index.js +21 -0
- package/dist/esm/ui-menu/ArrowKeyNavigationProvider/types.js +5 -0
- package/dist/esm/ui-menu/Dropdown/index.js +5 -7
- package/dist/esm/ui-menu/DropdownMenu/index.js +50 -24
- package/dist/esm/ui-menu/ToolbarButton/index.js +3 -1
- package/dist/esm/ui-menu/index.js +3 -0
- package/dist/esm/utils/analytics.js +3 -0
- package/dist/esm/utils/index.js +1 -1
- package/dist/esm/utils/referentiality.js +28 -15
- package/dist/esm/version.json +1 -1
- package/dist/types/analytics/analytics-queue.d.ts +10 -0
- package/dist/types/analytics/fire-analytics-event.d.ts +2 -0
- package/dist/types/analytics/index.d.ts +3 -1
- package/dist/types/analytics/types/enums.d.ts +4 -0
- package/dist/types/analytics/types/events.d.ts +2 -1
- package/dist/types/analytics/types/general-events.d.ts +2 -2
- package/dist/types/analytics/types/index.d.ts +1 -1
- package/dist/types/analytics/utils.d.ts +3 -0
- package/dist/types/extensions/types/extension-manifest.d.ts +1 -1
- package/dist/types/hooks/index.d.ts +2 -0
- package/dist/types/hooks/useConstructor.d.ts +9 -0
- package/dist/types/hooks/usePreviousState.d.ts +11 -0
- package/dist/types/styles/index.d.ts +1 -1
- package/dist/types/styles/shared/table.d.ts +1 -0
- package/dist/types/types/editor-actions.d.ts +2 -1
- package/dist/types/types/feature-flags.d.ts +11 -0
- package/dist/types/types/floating-toolbar.d.ts +1 -1
- package/dist/types/types/index.d.ts +2 -2
- package/dist/types/types/next-editor-plugin.d.ts +37 -32
- package/dist/types/ui/index.d.ts +1 -1
- package/dist/types/ui-color/ColorPalette/Color/index.d.ts +1 -5
- package/dist/types/ui-color/ColorPalette/index.d.ts +1 -0
- package/dist/types/ui-color/ColorPalette/utils.d.ts +11 -0
- package/dist/types/ui-color/index.d.ts +1 -0
- package/dist/types/ui-menu/ArrowKeyNavigationProvider/ColorPaletteArrowKeyNavigationProvider/index.d.ts +7 -0
- package/dist/types/ui-menu/ArrowKeyNavigationProvider/MenuArrowKeyNavigationProvider/index.d.ts +7 -0
- package/dist/types/ui-menu/ArrowKeyNavigationProvider/index.d.ts +3 -0
- package/dist/types/ui-menu/ArrowKeyNavigationProvider/types.d.ts +33 -0
- package/dist/types/ui-menu/Dropdown/index.d.ts +2 -3
- package/dist/types/ui-menu/DropdownMenu/index.d.ts +2 -0
- package/dist/types/ui-menu/DropdownMenu/types.d.ts +3 -6
- package/dist/types/ui-menu/ToolbarButton/index.d.ts +2 -0
- package/dist/types/ui-menu/index.d.ts +3 -0
- package/dist/types/utils/analytics.d.ts +1 -0
- package/dist/types/utils/index.d.ts +1 -1
- package/dist/types/utils/referentiality.d.ts +11 -0
- package/hooks/package.json +15 -0
- package/package.json +16 -12
- package/dist/types/ui-menu/MenuArrowKeyNavigationProvider/index.d.ts +0 -16
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
-
import React, { useCallback, useLayoutEffect, useRef, useState } from 'react';
|
|
2
|
+
import React, { useCallback, useEffect, useLayoutEffect, useRef, useState } from 'react';
|
|
3
3
|
/**
|
|
4
4
|
* This component is a wrapper of vertical menus which listens to keydown events of children
|
|
5
5
|
* and handles up/down arrow key navigation
|
|
@@ -36,6 +36,21 @@ export var MenuArrowKeyNavigationProvider = function MenuArrowKeyNavigationProvi
|
|
|
36
36
|
setCurrentSelectedItemIndex(nextIndex);
|
|
37
37
|
return nextIndex;
|
|
38
38
|
}, [currentSelectedItemIndex]);
|
|
39
|
+
|
|
40
|
+
// this useEffect uses onSelection in it's dependency list which gets
|
|
41
|
+
// changed as a result of the dropdown menu getting re-rendered in it's
|
|
42
|
+
// parent component. Note that if onSelection gets updated to useMemo
|
|
43
|
+
// this will no longer work.
|
|
44
|
+
useEffect(function () {
|
|
45
|
+
var currentIndex = currentSelectedItemIndex;
|
|
46
|
+
var list = getFocusableElements(wrapperRef === null || wrapperRef === void 0 ? void 0 : wrapperRef.current);
|
|
47
|
+
var currentElement = list[currentIndex];
|
|
48
|
+
if (currentElement && currentElement.getAttribute('aria-disabled') === 'true') {
|
|
49
|
+
var _list$focusIndex;
|
|
50
|
+
var focusIndex = incrementIndex(list);
|
|
51
|
+
(_list$focusIndex = list[focusIndex]) === null || _list$focusIndex === void 0 ? void 0 : _list$focusIndex.focus();
|
|
52
|
+
}
|
|
53
|
+
}, [currentSelectedItemIndex, onSelection, incrementIndex, decrementIndex]);
|
|
39
54
|
useLayoutEffect(function () {
|
|
40
55
|
if (disableArrowKeyNavigation) {
|
|
41
56
|
return;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["children", "type"];
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import { ColorPaletteArrowKeyNavigationProvider } from './ColorPaletteArrowKeyNavigationProvider';
|
|
6
|
+
import { MenuArrowKeyNavigationProvider } from './MenuArrowKeyNavigationProvider';
|
|
7
|
+
import { ArrowKeyNavigationType } from './types';
|
|
8
|
+
export var ArrowKeyNavigationProvider = function ArrowKeyNavigationProvider(props) {
|
|
9
|
+
var children = props.children,
|
|
10
|
+
type = props.type,
|
|
11
|
+
restProps = _objectWithoutProperties(props, _excluded);
|
|
12
|
+
if (type === ArrowKeyNavigationType.COLOR) {
|
|
13
|
+
return /*#__PURE__*/React.createElement(ColorPaletteArrowKeyNavigationProvider, _extends({
|
|
14
|
+
selectedRowIndex: props.selectedRowIndex,
|
|
15
|
+
selectedColumnIndex: props.selectedColumnIndex,
|
|
16
|
+
isOpenedByKeyboard: props.isOpenedByKeyboard,
|
|
17
|
+
isPopupPositioned: props.isPopupPositioned
|
|
18
|
+
}, restProps), children);
|
|
19
|
+
}
|
|
20
|
+
return /*#__PURE__*/React.createElement(MenuArrowKeyNavigationProvider, restProps, children);
|
|
21
|
+
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
1
2
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
3
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
4
|
import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
|
|
@@ -11,7 +12,7 @@ import React, { PureComponent } from 'react';
|
|
|
11
12
|
import { withReactEditorViewOuterListeners } from '../../ui-react';
|
|
12
13
|
import DropdownList from '../../ui/DropList';
|
|
13
14
|
import Popup from '../../ui/Popup';
|
|
14
|
-
import {
|
|
15
|
+
import { ArrowKeyNavigationProvider } from '../ArrowKeyNavigationProvider';
|
|
15
16
|
/**
|
|
16
17
|
* Wrapper around @atlaskit/droplist which uses Popup and Portal to render
|
|
17
18
|
* droplist outside of "overflow: hidden" containers when needed.
|
|
@@ -55,8 +56,7 @@ export var Dropdown = /*#__PURE__*/function (_PureComponent) {
|
|
|
55
56
|
fitHeight = _this$props.fitHeight,
|
|
56
57
|
fitWidth = _this$props.fitWidth,
|
|
57
58
|
zIndex = _this$props.zIndex,
|
|
58
|
-
|
|
59
|
-
keyDownHandlerContext = _this$props.keyDownHandlerContext;
|
|
59
|
+
arrowKeyNavigationProviderOptions = _this$props.arrowKeyNavigationProviderOptions;
|
|
60
60
|
return /*#__PURE__*/React.createElement(Popup, {
|
|
61
61
|
target: target,
|
|
62
62
|
mountTo: mountTo,
|
|
@@ -66,9 +66,7 @@ export var Dropdown = /*#__PURE__*/function (_PureComponent) {
|
|
|
66
66
|
fitHeight: fitHeight,
|
|
67
67
|
fitWidth: fitWidth,
|
|
68
68
|
zIndex: zIndex
|
|
69
|
-
}, /*#__PURE__*/React.createElement(
|
|
70
|
-
disableArrowKeyNavigation: disableArrowKeyNavigation,
|
|
71
|
-
keyDownHandlerContext: keyDownHandlerContext,
|
|
69
|
+
}, /*#__PURE__*/React.createElement(ArrowKeyNavigationProvider, _extends({}, arrowKeyNavigationProviderOptions, {
|
|
72
70
|
closeOnTab: true,
|
|
73
71
|
handleClose: function handleClose(event) {
|
|
74
72
|
return onOpenChange && onOpenChange({
|
|
@@ -76,7 +74,7 @@ export var Dropdown = /*#__PURE__*/function (_PureComponent) {
|
|
|
76
74
|
event: event
|
|
77
75
|
});
|
|
78
76
|
}
|
|
79
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
77
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
80
78
|
style: {
|
|
81
79
|
height: 0,
|
|
82
80
|
minWidth: fitWidth || 0
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
-
import _extends from "@babel/runtime/helpers/extends";
|
|
3
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
4
4
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
5
5
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
6
6
|
import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
|
|
@@ -11,6 +11,8 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
11
11
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
12
12
|
var _excluded = ["children"];
|
|
13
13
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4;
|
|
14
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
15
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
14
16
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
15
17
|
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; } }
|
|
16
18
|
/** @jsx jsx */
|
|
@@ -25,7 +27,8 @@ import { DropdownMenuSharedCssClassName } from '../../styles';
|
|
|
25
27
|
import { withReactEditorViewOuterListeners } from '../../ui-react';
|
|
26
28
|
import DropList from '../../ui/DropList';
|
|
27
29
|
import Popup from '../../ui/Popup';
|
|
28
|
-
import {
|
|
30
|
+
import { ArrowKeyNavigationProvider } from '../ArrowKeyNavigationProvider';
|
|
31
|
+
import { ArrowKeyNavigationType } from '../ArrowKeyNavigationProvider/types';
|
|
29
32
|
var wrapper = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n /* tooltip in ToolbarButton is display:block */\n & > div > div {\n display: flex;\n }\n"])));
|
|
30
33
|
var focusedMenuItemStyle = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n box-shadow: inset 0px 0px 0px 2px ", ";\n outline: none;\n"])), "var(--ds-border-focused, ".concat(B100, ")"));
|
|
31
34
|
var buttonStyles = function buttonStyles(isActive, submenuActive) {
|
|
@@ -48,7 +51,7 @@ var buttonStyles = function buttonStyles(isActive, submenuActive) {
|
|
|
48
51
|
})(theme), ";\n }"), themed({
|
|
49
52
|
light: "var(--ds-text-disabled, ".concat(N70, ")"),
|
|
50
53
|
dark: "var(--ds-text-disabled, ".concat(DN80, ")")
|
|
51
|
-
})(theme), focusedMenuItemStyle); // The
|
|
54
|
+
})(theme), focusedMenuItemStyle); // The default focus-visible style is removed to ensure consistency across browsers
|
|
52
55
|
}
|
|
53
56
|
};
|
|
54
57
|
};
|
|
@@ -75,6 +78,7 @@ var DropdownMenuWrapper = /*#__PURE__*/function (_PureComponent) {
|
|
|
75
78
|
popupPlacement: ['bottom', 'left'],
|
|
76
79
|
selectionIndex: -1
|
|
77
80
|
});
|
|
81
|
+
_defineProperty(_assertThisInitialized(_this), "popupRef", /*#__PURE__*/React.createRef());
|
|
78
82
|
_defineProperty(_assertThisInitialized(_this), "handleRef", function (target) {
|
|
79
83
|
_this.setState({
|
|
80
84
|
target: target || undefined
|
|
@@ -120,23 +124,15 @@ var DropdownMenuWrapper = /*#__PURE__*/function (_PureComponent) {
|
|
|
120
124
|
isOpen = _this$props.isOpen,
|
|
121
125
|
zIndex = _this$props.zIndex,
|
|
122
126
|
shouldUseDefaultRole = _this$props.shouldUseDefaultRole,
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
fitHeight: fitHeight,
|
|
133
|
-
fitWidth: fitWidth,
|
|
134
|
-
zIndex: zIndex || akEditorFloatingPanelZIndex,
|
|
135
|
-
offset: offset
|
|
136
|
-
}, jsx(MenuArrowKeyNavigationProvider, {
|
|
137
|
-
disableArrowKeyNavigation: disableArrowKeyNavigation,
|
|
138
|
-
handleClose: this.handleCloseAndFocus,
|
|
139
|
-
keyDownHandlerContext: keyDownHandlerContext,
|
|
127
|
+
onItemActivated = _this$props.onItemActivated,
|
|
128
|
+
arrowKeyNavigationProviderOptions = _this$props.arrowKeyNavigationProviderOptions;
|
|
129
|
+
|
|
130
|
+
// Note that this onSelection function can't be refactored to useMemo for
|
|
131
|
+
// performance gains as it is being used as a dependency in a useEffect in
|
|
132
|
+
// MenuArrowKeyNavigationProvider in order to check for re-renders to adjust
|
|
133
|
+
// focus for accessibility. If this needs to be refactored in future refer
|
|
134
|
+
// back to ED-16740 for context.
|
|
135
|
+
var navigationProviderProps = arrowKeyNavigationProviderOptions.type === ArrowKeyNavigationType.COLOR ? arrowKeyNavigationProviderOptions : _objectSpread(_objectSpread({}, arrowKeyNavigationProviderOptions), {}, {
|
|
140
136
|
onSelection: function onSelection(index) {
|
|
141
137
|
var result = [];
|
|
142
138
|
if (typeof onItemActivated === 'function') {
|
|
@@ -148,9 +144,22 @@ var DropdownMenuWrapper = /*#__PURE__*/function (_PureComponent) {
|
|
|
148
144
|
shouldCloseMenu: false
|
|
149
145
|
});
|
|
150
146
|
}
|
|
151
|
-
}
|
|
147
|
+
}
|
|
148
|
+
});
|
|
149
|
+
return jsx(Popup, {
|
|
150
|
+
target: isOpen ? target : undefined,
|
|
151
|
+
mountTo: mountTo,
|
|
152
|
+
boundariesElement: boundariesElement,
|
|
153
|
+
scrollableElement: scrollableElement,
|
|
154
|
+
onPlacementChanged: this.updatePopupPlacement,
|
|
155
|
+
fitHeight: fitHeight,
|
|
156
|
+
fitWidth: fitWidth,
|
|
157
|
+
zIndex: zIndex || akEditorFloatingPanelZIndex,
|
|
158
|
+
offset: offset
|
|
159
|
+
}, jsx(ArrowKeyNavigationProvider, _extends({}, navigationProviderProps, {
|
|
160
|
+
handleClose: this.handleCloseAndFocus,
|
|
152
161
|
closeOnTab: true
|
|
153
|
-
}, jsx(DropListWithOutsideListeners, {
|
|
162
|
+
}), jsx(DropListWithOutsideListeners, {
|
|
154
163
|
isOpen: true,
|
|
155
164
|
appearance: "tall",
|
|
156
165
|
position: popupPlacement.join(' '),
|
|
@@ -165,7 +174,9 @@ var DropdownMenuWrapper = /*#__PURE__*/function (_PureComponent) {
|
|
|
165
174
|
height: 0,
|
|
166
175
|
minWidth: fitWidth || 0
|
|
167
176
|
}
|
|
168
|
-
}),
|
|
177
|
+
}), jsx("div", {
|
|
178
|
+
ref: this.popupRef
|
|
179
|
+
}, items.map(function (group, index) {
|
|
169
180
|
return jsx(MenuGroup, {
|
|
170
181
|
key: index,
|
|
171
182
|
role: shouldUseDefaultRole ? 'group' : 'menu'
|
|
@@ -180,7 +191,7 @@ var DropdownMenuWrapper = /*#__PURE__*/function (_PureComponent) {
|
|
|
180
191
|
onMouseLeave: _this2.props.onMouseLeave
|
|
181
192
|
});
|
|
182
193
|
}));
|
|
183
|
-
}))));
|
|
194
|
+
})))));
|
|
184
195
|
}
|
|
185
196
|
}, {
|
|
186
197
|
key: "render",
|
|
@@ -194,6 +205,21 @@ var DropdownMenuWrapper = /*#__PURE__*/function (_PureComponent) {
|
|
|
194
205
|
ref: this.handleRef
|
|
195
206
|
}, children), isOpen ? this.renderDropdownMenu() : null);
|
|
196
207
|
}
|
|
208
|
+
}, {
|
|
209
|
+
key: "componentDidUpdate",
|
|
210
|
+
value: function componentDidUpdate(previousProps) {
|
|
211
|
+
var isOpenToggled = this.props.isOpen !== previousProps.isOpen;
|
|
212
|
+
if (this.props.isOpen && isOpenToggled) {
|
|
213
|
+
if (typeof this.props.shouldFocusFirstItem === 'function' && this.props.shouldFocusFirstItem()) {
|
|
214
|
+
var _this$state$target2;
|
|
215
|
+
var keyboardEvent = new KeyboardEvent('keydown', {
|
|
216
|
+
key: 'ArrowDown',
|
|
217
|
+
bubbles: true
|
|
218
|
+
});
|
|
219
|
+
(_this$state$target2 = this.state.target) === null || _this$state$target2 === void 0 ? void 0 : _this$state$target2.dispatchEvent(keyboardEvent);
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
}
|
|
197
223
|
}]);
|
|
198
224
|
return DropdownMenuWrapper;
|
|
199
225
|
}(PureComponent);
|
|
@@ -36,6 +36,7 @@ var ToolbarButton = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
36
36
|
ariaPressed = props['aria-pressed'],
|
|
37
37
|
ariaKeyShortcuts = props['aria-keyshortcuts'],
|
|
38
38
|
onClick = props.onClick,
|
|
39
|
+
onKeyDown = props.onKeyDown,
|
|
39
40
|
onItemClick = props.onItemClick;
|
|
40
41
|
var handleClick = useCallback(function (event, analyticsEvent) {
|
|
41
42
|
if (disabled) {
|
|
@@ -78,7 +79,8 @@ var ToolbarButton = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
78
79
|
"aria-haspopup": ariaHasPopup,
|
|
79
80
|
"aria-label": ariaLabel,
|
|
80
81
|
"aria-pressed": ariaPressed,
|
|
81
|
-
"aria-keyshortcuts": ariaKeyShortcuts
|
|
82
|
+
"aria-keyshortcuts": ariaKeyShortcuts,
|
|
83
|
+
onKeyDown: onKeyDown
|
|
82
84
|
}, children);
|
|
83
85
|
if (!title) {
|
|
84
86
|
return button;
|
|
@@ -1,3 +1,6 @@
|
|
|
1
1
|
export { default as DropdownMenu } from '../ui-menu/DropdownMenu';
|
|
2
2
|
export { default as ToolbarButton, TOOLBAR_BUTTON } from '../ui-menu/ToolbarButton';
|
|
3
|
+
export { ArrowKeyNavigationProvider } from '../ui-menu/ArrowKeyNavigationProvider';
|
|
4
|
+
export { ArrowKeyNavigationType } from '../ui-menu/ArrowKeyNavigationProvider/types';
|
|
5
|
+
export { ColorPaletteArrowKeyNavigationProvider } from './ArrowKeyNavigationProvider/ColorPaletteArrowKeyNavigationProvider';
|
|
3
6
|
export { default as Dropdown } from './Dropdown';
|
|
@@ -13,6 +13,9 @@ export var getAnalyticsAppearance = function getAnalyticsAppearance(appearance)
|
|
|
13
13
|
return EDITOR_APPEARANCE_CONTEXT.MOBILE;
|
|
14
14
|
}
|
|
15
15
|
};
|
|
16
|
+
export var getAnalyticsEditorAppearance = function getAnalyticsEditorAppearance(editorAppearance) {
|
|
17
|
+
return editorAppearance ? "editor_".concat(getAnalyticsAppearance(editorAppearance)) : '_unknown';
|
|
18
|
+
};
|
|
16
19
|
export var getAnalyticsEventSeverity = function getAnalyticsEventSeverity(duration, normalThreshold, degradedThreshold) {
|
|
17
20
|
if (duration > normalThreshold && duration <= degradedThreshold) {
|
|
18
21
|
return SEVERITY.DEGRADED;
|
package/dist/esm/utils/index.js
CHANGED
|
@@ -11,7 +11,7 @@ export { pluginFactory } from './plugin-state-factory';
|
|
|
11
11
|
export { getFragmentBackingArray, mapFragment, mapSlice, flatmap, mapChildren } from './slice';
|
|
12
12
|
export { walkUpTreeUntil, unwrap, removeNestedEmptyEls, containsClassName, closest, closestElement, parsePx, mapElem, maphElem } from './dom';
|
|
13
13
|
export { default as ADFTraversor } from './traversor';
|
|
14
|
-
export { analyticsEventKey, getAnalyticsAppearance, getAnalyticsEventSeverity, SEVERITY, getUnsupportedContentLevelData, UNSUPPORTED_CONTENT_LEVEL_SEVERITY, UNSUPPORTED_CONTENT_LEVEL_SEVERITY_THRESHOLD_DEFAULTS } from './analytics';
|
|
14
|
+
export { analyticsEventKey, getAnalyticsAppearance, getAnalyticsEditorAppearance, getAnalyticsEventSeverity, SEVERITY, getUnsupportedContentLevelData, UNSUPPORTED_CONTENT_LEVEL_SEVERITY, UNSUPPORTED_CONTENT_LEVEL_SEVERITY_THRESHOLD_DEFAULTS } from './analytics';
|
|
15
15
|
export { findAndTrackUnsupportedContentNodes } from './track-unsupported-content';
|
|
16
16
|
export { getDistortedDurationMonitor, measureRender } from './performance/measure-render';
|
|
17
17
|
export { startMeasure, stopMeasure, clearMeasure } from './performance/measure';
|
|
@@ -39,7 +39,7 @@ export var isReferencedSource = function isReferencedSource(state, node) {
|
|
|
39
39
|
});
|
|
40
40
|
return found;
|
|
41
41
|
};
|
|
42
|
-
var getConnections = function getConnections(state) {
|
|
42
|
+
export var getConnections = function getConnections(state) {
|
|
43
43
|
var result = {};
|
|
44
44
|
var doc = state.doc,
|
|
45
45
|
schema = state.schema;
|
|
@@ -52,7 +52,7 @@ var getConnections = function getConnections(state) {
|
|
|
52
52
|
// Perform a prelim scan creating the initial id to connection link mappings.
|
|
53
53
|
// This will also save a list of data sources consumed per node.
|
|
54
54
|
doc.descendants(function (node, pos) {
|
|
55
|
-
var _node$attrs2, _fragmentMark$attrs$l, _fragmentMark, _fragmentMark$attrs, _node$attrs3, _fragmentMark2, _fragmentMark2$attrs, _node$attrs4,
|
|
55
|
+
var _node$attrs2, _fragmentMark$attrs$l, _fragmentMark, _fragmentMark$attrs, _node$attrs3, _fragmentMark2, _fragmentMark2$attrs, _node$attrs4, _fragmentMark3, _fragmentMark3$attrs;
|
|
56
56
|
var dataConsumer;
|
|
57
57
|
var fragmentMark;
|
|
58
58
|
node.marks.some(function (mark) {
|
|
@@ -86,7 +86,7 @@ var getConnections = function getConnections(state) {
|
|
|
86
86
|
}
|
|
87
87
|
result[normalizedId] = {
|
|
88
88
|
localId: normalizedId,
|
|
89
|
-
name: (
|
|
89
|
+
name: (_fragmentMark3 = fragmentMark) === null || _fragmentMark3 === void 0 ? void 0 : (_fragmentMark3$attrs = _fragmentMark3.attrs) === null || _fragmentMark3$attrs === void 0 ? void 0 : _fragmentMark3$attrs.name,
|
|
90
90
|
node: node,
|
|
91
91
|
pos: pos,
|
|
92
92
|
targets: []
|
|
@@ -176,6 +176,7 @@ var getIdsToBeDeleted = function getIdsToBeDeleted(selectedIds, allNodes) {
|
|
|
176
176
|
|
|
177
177
|
// for get children info for confirmation dialog
|
|
178
178
|
export var getChildrenInfo = function getChildrenInfo(state, node) {
|
|
179
|
+
var allChildrenHadName = true;
|
|
179
180
|
if (!node) {
|
|
180
181
|
return [];
|
|
181
182
|
}
|
|
@@ -188,14 +189,28 @@ export var getChildrenInfo = function getChildrenInfo(state, node) {
|
|
|
188
189
|
allNodes[id].targets.forEach(childrenIdSet.add, childrenIdSet);
|
|
189
190
|
}
|
|
190
191
|
});
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
192
|
+
var _iterator2 = _createForOfIteratorHelper(childrenIdSet),
|
|
193
|
+
_step2;
|
|
194
|
+
try {
|
|
195
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
196
|
+
var id = _step2.value;
|
|
197
|
+
if (!getNodeNameById(id, allNodes)) {
|
|
198
|
+
allChildrenHadName = false;
|
|
199
|
+
break;
|
|
200
|
+
} else {
|
|
201
|
+
childrenInfoArray.push({
|
|
202
|
+
id: id,
|
|
203
|
+
name: getNodeNameById(id, allNodes),
|
|
204
|
+
amount: getChildrenNodeAmount(id, allNodes)
|
|
205
|
+
});
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
} catch (err) {
|
|
209
|
+
_iterator2.e(err);
|
|
210
|
+
} finally {
|
|
211
|
+
_iterator2.f();
|
|
212
|
+
}
|
|
213
|
+
return allChildrenHadName ? childrenInfoArray : [];
|
|
199
214
|
};
|
|
200
215
|
var getChildrenNodeAmount = function getChildrenNodeAmount(id, allNodes) {
|
|
201
216
|
var searchTerms = new Set([id]);
|
|
@@ -225,19 +240,17 @@ var getNodeTargetsById = function getNodeTargetsById(id, allNodes) {
|
|
|
225
240
|
}
|
|
226
241
|
return allNodes[id].targets;
|
|
227
242
|
};
|
|
228
|
-
var DEFAULT_EXTENSION_NAME = 'Default extension';
|
|
229
243
|
var getNodeNameById = function getNodeNameById(id, allNodes) {
|
|
230
244
|
if (_typeof(id) === 'object') {
|
|
231
|
-
var _name2;
|
|
232
245
|
var name;
|
|
233
246
|
id.forEach(function (localId) {
|
|
234
247
|
var _name, _allNodes$localId;
|
|
235
248
|
name = (_name = name) !== null && _name !== void 0 ? _name : (_allNodes$localId = allNodes[localId]) === null || _allNodes$localId === void 0 ? void 0 : _allNodes$localId.name;
|
|
236
249
|
});
|
|
237
|
-
return
|
|
250
|
+
return name || null;
|
|
238
251
|
}
|
|
239
252
|
if (!id || !allNodes[id]) {
|
|
240
|
-
return
|
|
253
|
+
return null;
|
|
241
254
|
}
|
|
242
255
|
return allNodes[id].name;
|
|
243
256
|
};
|
package/dist/esm/version.json
CHANGED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare class AnalyticsQueue {
|
|
2
|
+
private readonly tasks;
|
|
3
|
+
private running;
|
|
4
|
+
static get: import("memoize-one").MemoizedFn<() => AnalyticsQueue>;
|
|
5
|
+
private constructor();
|
|
6
|
+
private request;
|
|
7
|
+
private pending;
|
|
8
|
+
private process;
|
|
9
|
+
schedule(task: Function): void;
|
|
10
|
+
}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
export { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, BROWSER_FREEZE_INTERACTION_TYPE, CONTENT_COMPONENT, DELETE_DIRECTION, EVENT_TYPE, FLOATING_CONTROLS_TITLE, FULL_WIDTH_MODE, GAP_CURSOR_POSITION, INDENT_DIRECTION, INDENT_TYPE, INPUT_METHOD, LAYOUT_TYPE, LINK_REPRESENTATION, LINK_RESOURCE, LINK_STATUS, LIST_TEXT_SCENARIOS, JOIN_SCENARIOS_WHEN_TYPING_TO_INSERT_LIST, OUTDENT_SCENARIOS, MODE, PLATFORMS, PUNC, PasteContents, PasteSources, PasteTypes, RESOLVE_METHOD, SELECTION_TYPE, SELECTION_POSITION, SMART_LINK_TYPE, SYMBOL, SmartLinkNodeContexts, TABLE_ACTION, TABLE_BREAKOUT, TARGET_SELECTION_SOURCE, TOOLBAR_ACTION_SUBJECT_ID, TRIGGER_METHOD, USER_CONTEXT, } from './types';
|
|
2
|
-
export type { AnalyticsDispatch, AnalyticsEventPayload, AnalyticsEventPayloadCallback, AnalyticsEventPayloadWithChannel, AnnotationAEP, AnnotationAEPAttributes, AnnotationActionType, AnnotationDraftAEPAttributes, AnnotationResolvedAEPAttributes, CaptionTrackAction, ColorPickerAEP, CommonListAnalyticsAttributes, RestartListsAttributesForListOutdented, CreateLinkInlineDialogActionType, CreateLinkInlineDialogEventPayload, DismissedCreateLinkInlineDialogAEP, DispatchAnalyticsEvent, EditLinkToolbarAEP, EnteredTextLinkSearchInputAEP, ErrorEventAttributes, ErrorEventPayload, ExperimentalEventPayload, ExtensionEventPayload, ExtensionType, FeatureExposureAEP, FormatEventPayload, GeneralEventPayload, HighlightedSearchResultsAEP, InputMethodInsertLink, InputMethodInsertMedia, InsertEventPayload, InsertSmartLinkAEP, ListEventPayload, MediaAltTextActionType, MediaEventPayload, MediaLinkAEP, NodeCount, NodeEventPayload, OperationalAEP, PASTE_ACTION_SUBJECT_ID, PasteContent, PasteEventPayload, PasteSource, PasteType, PluginMethodReport, PluginPerformanceReportData, PluginsReport, QuickSearchPerfAEP, RecentActivitiesPerfAEP, SelectAllAEP, SelectCellAEP, SelectNodeAEP, SelectRangeAEP, SelectedSearchResultsAEP, SelectionEventPayload, SelectionJson, ShownPostQuerySearchResultsAEP, ShownPreQuerySearchResultsAEP, SimplifiedNode, SmartLinkNodeContext, SubstituteEventPayload, TableEventPayload, TextColorSelectedAEP, TextColorSelectedAttr, TextColorShowPaletteToggleAEP, TextColorShowPaletteToggleAttr, ToolbarEventPayload, TransactionEventPayload, TypeAheadPayload, UfoSessionCompletePayloadAEP, UnlinkToolbarAEP, ViewedCreateLinkInlineDialogAEP, FireAnalyticsCallback, InitialiseFragmentMarksAEP, ConnectedNodesAEP, DisconnectedSourceAEP, DisconnectedTargetAEP, GotConnectionsAEP, UpdatedFragmentMarkNameAEP, UpdatedSourceAEP, UpdatedTargetAEP, } from './types';
|
|
2
|
+
export type { AnalyticsDispatch, AnalyticsEventPayload, AnalyticsEventPayloadCallback, AnalyticsEventPayloadWithChannel, AnnotationAEP, AnnotationAEPAttributes, AnnotationActionType, AnnotationDraftAEPAttributes, AnnotationResolvedAEPAttributes, CaptionTrackAction, ColorPickerAEP, CommonListAnalyticsAttributes, RestartListsAttributesForListOutdented, CreateLinkInlineDialogActionType, CreateLinkInlineDialogEventPayload, DismissedCreateLinkInlineDialogAEP, DispatchAnalyticsEvent, EditLinkToolbarAEP, EnteredTextLinkSearchInputAEP, ErrorEventAttributes, ErrorEventPayload, ExperimentalEventPayload, ExtensionEventPayload, ExtensionType, FeatureExposureAEP, FormatEventPayload, GeneralEventPayload, HighlightedSearchResultsAEP, InputMethodInsertLink, InputMethodInsertMedia, InsertEventPayload, InsertSmartLinkAEP, ListEventPayload, MediaAltTextActionType, MediaEventPayload, MediaLinkAEP, NodeCount, NodeEventPayload, OperationalAEP, PASTE_ACTION_SUBJECT_ID, PasteContent, PasteEventPayload, PasteSource, PasteType, PluginMethodReport, PluginPerformanceReportData, PluginsReport, QuickSearchPerfAEP, RecentActivitiesPerfAEP, SelectAllAEP, SelectCellAEP, SelectNodeAEP, SelectRangeAEP, SelectedSearchResultsAEP, SelectionEventPayload, SelectionJson, ShownPostQuerySearchResultsAEP, ShownPreQuerySearchResultsAEP, SimplifiedNode, SmartLinkNodeContext, SubstituteEventPayload, TableEventPayload, TextColorSelectedAEP, TextColorSelectedAttr, TextColorShowPaletteToggleAEP, TextColorShowPaletteToggleAttr, ToolbarEventPayload, TransactionEventPayload, TypeAheadPayload, UfoSessionCompletePayloadAEP, UnlinkToolbarAEP, ViewedCreateLinkInlineDialogAEP, FireAnalyticsCallback, FireAnalyticsEvent, FireAnalyticsEventPayload, InitialiseFragmentMarksAEP, ConnectedNodesAEP, DisconnectedSourceAEP, DisconnectedTargetAEP, GotConnectionsAEP, UpdatedFragmentMarkNameAEP, UpdatedSourceAEP, UpdatedTargetAEP, } from './types';
|
|
3
3
|
export type { EditorAnalyticsAPI } from './api';
|
|
4
|
+
export { fireAnalyticsEvent } from './fire-analytics-event';
|
|
5
|
+
export { getAnalyticsEventsFromTransaction } from './utils';
|
|
@@ -59,6 +59,10 @@ export declare enum ACTION {
|
|
|
59
59
|
INITIALISED_FRAGMENT_MARK = "initialisedFragmentMark",
|
|
60
60
|
INPUT_PERF_SAMPLING = "inputPerfSampling",
|
|
61
61
|
INPUT_PERF_SAMPLING_AVG = "inputPerfSamplingAvg",
|
|
62
|
+
INPUT_PERF_SAMPLING_SINGLE_KEYPRESS = "inputPerfSamplingSingleKeypress",
|
|
63
|
+
INPUT_PERF_SAMPLING_SINGLE_KEYPRESS_AVG = "inputPerfSamplingSingleKeypressAvg",
|
|
64
|
+
INPUT_PERF_SAMPLING_RENDERED = "inputPerfSamplingRendered",
|
|
65
|
+
INPUT_PERF_SAMPLING_RENDERED_AVG = "inputPerfSamplingRenderedAvg",
|
|
62
66
|
INSERTED = "inserted",
|
|
63
67
|
INVALID_DOCUMENT_ENCOUNTERED = "invalidDocumentEncountered",
|
|
64
68
|
INVOKED = "invoked",
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { EditorState, PluginKey } from 'prosemirror-state';
|
|
3
|
+
import { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
3
4
|
import type { NewCollabSyncUpErrorAttributes } from '../../types';
|
|
4
5
|
import type { UnsupportedContentPayload, UnsupportedContentTooltipPayload, UserBrowserExtensionResults } from '../../utils';
|
|
5
6
|
import type { AvatarEventPayload } from './avatar';
|
|
@@ -121,7 +122,7 @@ declare type SmartLinkErrorAEP = OperationalAEP<ACTION.ERRORED, ACTION_SUBJECT.S
|
|
|
121
122
|
export declare type ErrorEventPayload = InvalidTransactionErrorAEP | InvalidTransactionStepErrorAEP | FailedToUnmountErrorAEP | SynchronyErrorAEP | InvalidDocumentEncounteredAEP | SynchronyEntityErrorAEP | ContentComponentErrorAEP | ComponentCrashErrorAEP | ComponentCrashAdditionalInfoErrorAEP | SmartLinkErrorAEP;
|
|
122
123
|
export declare type AnalyticsEventPayloadCallback = (state: EditorState) => AnalyticsEventPayload | undefined;
|
|
123
124
|
export declare type FireAnalyticsCallback = <T>(payload: FireAnalyticsEventPayload<T>) => void | undefined;
|
|
124
|
-
export declare type FireAnalyticsEvent = () => FireAnalyticsCallback;
|
|
125
|
+
export declare type FireAnalyticsEvent = (createAnalyticsEvent?: CreateUIAnalyticsEvent) => FireAnalyticsCallback;
|
|
125
126
|
export declare type FireAnalyticsEventPayload<T = void> = {
|
|
126
127
|
payload: AnalyticsEventPayload<T>;
|
|
127
128
|
channel?: string;
|
|
@@ -76,14 +76,14 @@ declare type SlowInputAEP = OperationalAEPWithObjectId<ACTION.SLOW_INPUT, ACTION
|
|
|
76
76
|
participants: number;
|
|
77
77
|
nodeCount?: Record<string, number>;
|
|
78
78
|
}, undefined>;
|
|
79
|
-
declare type InputPerfSamlingAEP = OperationalAEPWithObjectId<ACTION.INPUT_PERF_SAMPLING, ACTION_SUBJECT.EDITOR, undefined, {
|
|
79
|
+
declare type InputPerfSamlingAEP = OperationalAEPWithObjectId<ACTION.INPUT_PERF_SAMPLING | ACTION.INPUT_PERF_SAMPLING_SINGLE_KEYPRESS | ACTION.INPUT_PERF_SAMPLING_RENDERED, ACTION_SUBJECT.EDITOR, undefined, {
|
|
80
80
|
time: number;
|
|
81
81
|
nodeSize: number;
|
|
82
82
|
participants: number;
|
|
83
83
|
nodeCount?: Record<string, number>;
|
|
84
84
|
severity?: SEVERITY;
|
|
85
85
|
}, undefined>;
|
|
86
|
-
declare type InputPerfSamplingAvgAEP = OperationalAEPWithObjectId<ACTION.INPUT_PERF_SAMPLING_AVG, ACTION_SUBJECT.EDITOR, undefined, {
|
|
86
|
+
declare type InputPerfSamplingAvgAEP = OperationalAEPWithObjectId<ACTION.INPUT_PERF_SAMPLING_AVG | ACTION.INPUT_PERF_SAMPLING_SINGLE_KEYPRESS_AVG | ACTION.INPUT_PERF_SAMPLING_RENDERED_AVG, ACTION_SUBJECT.EDITOR, undefined, {
|
|
87
87
|
mean: number;
|
|
88
88
|
median: number;
|
|
89
89
|
sampleSize: number;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD, TRIGGER_METHOD, CONTENT_COMPONENT, FLOATING_CONTROLS_TITLE, } from './enums';
|
|
2
|
-
export type { AnalyticsDispatch, AnalyticsEventPayload, AnalyticsEventPayloadCallback, AnalyticsEventPayloadWithChannel, ErrorEventAttributes, ErrorEventPayload, FeatureExposureAEP, FireAnalyticsCallback, SimplifiedNode, TransactionEventPayload, } from './events';
|
|
2
|
+
export type { AnalyticsDispatch, AnalyticsEventPayload, AnalyticsEventPayloadCallback, AnalyticsEventPayloadWithChannel, ErrorEventAttributes, ErrorEventPayload, FeatureExposureAEP, FireAnalyticsCallback, FireAnalyticsEvent, FireAnalyticsEventPayload, SimplifiedNode, TransactionEventPayload, } from './events';
|
|
3
3
|
export type { FormatEventPayload } from './format-events';
|
|
4
4
|
export type { SubstituteEventPayload } from './substitute-events';
|
|
5
5
|
export type { UfoSessionCompletePayloadAEP, ColorPickerAEP, GeneralEventPayload, } from './general-events';
|
|
@@ -21,7 +21,7 @@ export declare type ExtensionModuleActionObject<T extends Parameters = Parameter
|
|
|
21
21
|
type: 'node';
|
|
22
22
|
parameters?: T;
|
|
23
23
|
};
|
|
24
|
-
export declare type MaybeADFEntity = MaybeESModule<ADFEntity | void>;
|
|
24
|
+
export declare type MaybeADFEntity = MaybeESModule<ADFEntity | Array<ADFEntity> | void>;
|
|
25
25
|
export declare type ExtensionModuleActionHandler = () => Promise<MaybeADFEntity>;
|
|
26
26
|
export declare type ExtensionModuleAction<T extends Parameters = Parameters> = ExtensionModuleActionObject<T> | ExtensionModuleActionHandler;
|
|
27
27
|
export declare type ExtensionModule<T extends Parameters = Parameters> = {
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* Hook to run code once in a functional component.
|
|
4
|
+
* Emulates the behaviour of a `constructor` in a class component
|
|
5
|
+
* Place this at the top of your functional component so that it is run first.
|
|
6
|
+
*
|
|
7
|
+
* @param callback Callback function to run once
|
|
8
|
+
*/
|
|
9
|
+
export default function useConstructor(callback: () => void): void;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* Can be used to get the previous state of a prop.
|
|
4
|
+
* This can be helpful when converting class components to functional
|
|
5
|
+
* where we don't have the `prevProps`.
|
|
6
|
+
*
|
|
7
|
+
* @param value New state of the
|
|
8
|
+
* @param initialValue Optional parameter for the inital state of the component
|
|
9
|
+
* @returns
|
|
10
|
+
*/
|
|
11
|
+
export default function usePreviousState<T>(value: T, initialValue?: T): T | undefined;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { textColorStyles } from './shared/text-color';
|
|
2
|
-
export { tableSharedStyle, tableMarginTop, tableMarginBottom, tableMarginSides, tableCellMinWidth, tableNewColumnMinWidth, tableCellBorderWidth, calcTableWidth, TableSharedCssClassName, tableResizeHandleWidth, tableCellPadding, } from './shared/table';
|
|
2
|
+
export { tableSharedStyle, tableMarginTop, tableMarginBottom, tableMarginSides, tableCellMinWidth, tableNewColumnMinWidth, tableCellBorderWidth, calcTableWidth, TableSharedCssClassName, tableResizeHandleWidth, tableCellPadding, tableMarginTopWithControl, } from './shared/table';
|
|
3
3
|
export { AnnotationSharedClassNames, AnnotationSharedCSSByState, annotationSharedStyles, } from './shared/annotation';
|
|
4
4
|
export { columnLayoutSharedStyle } from './shared/column-layout';
|
|
5
5
|
export { mediaSingleSharedStyle, richMediaClassName, } from './shared/media-single';
|
|
@@ -2,6 +2,7 @@ import { TableLayout } from '@atlaskit/adf-schema';
|
|
|
2
2
|
import { ThemeProps } from '@atlaskit/theme/types';
|
|
3
3
|
export declare const tableMarginTop = 24;
|
|
4
4
|
export declare const tableMarginBottom = 16;
|
|
5
|
+
export declare const tableMarginTopWithControl = 14;
|
|
5
6
|
export declare const tableMarginSides = 8;
|
|
6
7
|
export declare const tableCellMinWidth = 48;
|
|
7
8
|
export declare const tableNewColumnMinWidth = 140;
|
|
@@ -4,6 +4,7 @@ import { JSONDocNode } from '@atlaskit/editor-json-transformer';
|
|
|
4
4
|
import { ResolvedEditorState } from '../collab';
|
|
5
5
|
import { EventDispatcher } from '../event-dispatcher';
|
|
6
6
|
export declare type ContextUpdateHandler = (editorView: EditorView, eventDispatcher: EventDispatcher) => void;
|
|
7
|
+
export declare type ReplaceRawValue = Node | object | string;
|
|
7
8
|
export interface EditorActionsOptions<T = any> {
|
|
8
9
|
focus(): boolean;
|
|
9
10
|
blur(): boolean;
|
|
@@ -13,7 +14,7 @@ export interface EditorActionsOptions<T = any> {
|
|
|
13
14
|
getNodeByFragmentLocalId(id: string): Node | undefined;
|
|
14
15
|
getSelectedNode(): Node | undefined;
|
|
15
16
|
replaceDocument(rawValue: any): boolean;
|
|
16
|
-
replaceSelection(rawValue:
|
|
17
|
+
replaceSelection(rawValue: ReplaceRawValue | Array<ReplaceRawValue>): boolean;
|
|
17
18
|
appendText(text: string): boolean;
|
|
18
19
|
isDocumentEmpty(): boolean;
|
|
19
20
|
getResolvedEditorState(): Promise<ResolvedEditorState | undefined>;
|
|
@@ -375,6 +375,17 @@ export declare type FeatureFlags = {
|
|
|
375
375
|
* @default false
|
|
376
376
|
*/
|
|
377
377
|
preventPopupOverflow?: boolean;
|
|
378
|
+
/**
|
|
379
|
+
* @description
|
|
380
|
+
* Use the new editor next component which uses a preset to configure the editor plugins used.
|
|
381
|
+
*
|
|
382
|
+
* @see https://product-fabric.atlassian.net/wiki/spaces/EA/pages/3356459260/MAKE+Project+Poster+Editor+Presets+for+Easy+Adoption
|
|
383
|
+
* @see https://product-fabric.atlassian.net/browse/ED-16576
|
|
384
|
+
* @see https://product-fabric.atlassian.net/browse/ED-16577
|
|
385
|
+
* DUE DATE: April 2023
|
|
386
|
+
* @default false
|
|
387
|
+
*/
|
|
388
|
+
useEditorNext?: boolean;
|
|
378
389
|
};
|
|
379
390
|
export declare type FeatureFlagKey = keyof FeatureFlags;
|
|
380
391
|
export declare type GetEditorFeatureFlags = () => FeatureFlags;
|
|
@@ -10,7 +10,7 @@ export declare enum SortOrder {
|
|
|
10
10
|
}
|
|
11
11
|
export { AnnotationUpdateEmitter, AnnotationUpdateEvent } from './annotation';
|
|
12
12
|
export type { AnnotationState, AnnotationProviders, AnnotationUpdateEventPayloads, InlineCommentSelectionComponentProps, InlineCommentViewComponentProps, InlineCommentAnnotationProvider, OnAnnotationClickPayload, AnnotationByMatches, AnnotationActionResult, } from './annotation';
|
|
13
|
-
export type { ContextUpdateHandler, EditorActionsOptions, } from './editor-actions';
|
|
13
|
+
export type { ContextUpdateHandler, EditorActionsOptions, ReplaceRawValue, } from './editor-actions';
|
|
14
14
|
export type { TypeAheadStats, TypeAheadItemRenderProps, TypeAheadInsert, TypeAheadSelectItem, TypeAheadItem, TypeAheadForceSelect, TypeAheadHandler, } from './type-ahead';
|
|
15
15
|
export type { NewCollabSyncUpErrorAttributes, SyncUpErrorFunction, } from './collab';
|
|
16
16
|
export type { CommandDispatch, Command, HigherOrderCommand } from './command';
|
|
@@ -29,7 +29,7 @@ export type { EditorReactContext } from './editor-react-context';
|
|
|
29
29
|
export type { PMPluginFactoryParams, PMPluginFactory, PMPlugin, } from './plugin-factory';
|
|
30
30
|
export type { NodeConfig, MarkConfig, NodeViewConfig, } from './prosemirror-config';
|
|
31
31
|
export type { PluginsOptions, EditorPlugin, getPosHandler, getPosHandlerNode, } from './editor-plugin';
|
|
32
|
-
export type { AllBuilderPlugins, VerifyPluginDependencies,
|
|
32
|
+
export type { AllBuilderPlugins, VerifyPluginDependencies, NextEditorPlugin, SafePresetCheck, } from './next-editor-plugin';
|
|
33
33
|
export declare type IconProps = {
|
|
34
34
|
label?: string;
|
|
35
35
|
};
|