@atlaskit/editor-common 75.8.4 → 76.1.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 +20 -0
- package/dist/cjs/element-browser/constants.js +1 -1
- package/dist/cjs/floating-toolbar/index.js +111 -0
- package/dist/cjs/monitoring/error.js +1 -1
- package/dist/cjs/resizer/Resizer.js +37 -71
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/es2019/element-browser/constants.js +1 -1
- package/dist/es2019/floating-toolbar/index.js +86 -0
- package/dist/es2019/monitoring/error.js +1 -1
- package/dist/es2019/resizer/Resizer.js +49 -73
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/esm/element-browser/constants.js +1 -1
- package/dist/esm/floating-toolbar/index.js +101 -0
- package/dist/esm/monitoring/error.js +1 -1
- package/dist/esm/resizer/Resizer.js +38 -72
- package/dist/esm/ui/DropList/index.js +1 -1
- package/dist/types/floating-toolbar/index.d.ts +6 -0
- package/dist/types/provider-factory/types.d.ts +13 -13
- package/dist/types/resizer/Resizer.d.ts +38 -18
- package/dist/types/resizer/index.d.ts +1 -1
- package/dist/types/resizer/types.d.ts +1 -1
- package/dist/types-ts4.5/floating-toolbar/index.d.ts +6 -0
- package/dist/types-ts4.5/provider-factory/types.d.ts +13 -13
- package/dist/types-ts4.5/resizer/Resizer.d.ts +38 -18
- package/dist/types-ts4.5/resizer/index.d.ts +1 -1
- package/dist/types-ts4.5/resizer/types.d.ts +1 -1
- package/floating-toolbar/package.json +15 -0
- package/package.json +3 -2
|
@@ -9,7 +9,7 @@ import { themed } from '@atlaskit/theme/components';
|
|
|
9
9
|
import { borderRadius } from '@atlaskit/theme/constants';
|
|
10
10
|
import Layer from '../Layer';
|
|
11
11
|
const packageName = "@atlaskit/editor-common";
|
|
12
|
-
const packageVersion = "
|
|
12
|
+
const packageVersion = "76.1.0";
|
|
13
13
|
const halfFocusRing = 1;
|
|
14
14
|
const dropOffset = '0, 8';
|
|
15
15
|
class DropList extends Component {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// eslint-disable-next-line @atlaskit/design-system/no-deprecated-imports
|
|
2
2
|
import { gridSize } from '@atlaskit/theme/constants';
|
|
3
|
-
// TODO: Migrate away from gridSize
|
|
3
|
+
// TODO: Migrate away from deprecated gridSize
|
|
4
4
|
// Recommendation: Replace gridSize with 8
|
|
5
5
|
export var GRID_SIZE = gridSize();
|
|
6
6
|
export var DEVICE_BREAKPOINT_NUMBERS = {
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
function makeSameType(_a, _b) {
|
|
2
|
+
return true;
|
|
3
|
+
}
|
|
4
|
+
export var shallowEqual = function shallowEqual(objA, objB) {
|
|
5
|
+
if (objA === objB) {
|
|
6
|
+
return true;
|
|
7
|
+
}
|
|
8
|
+
if (objA == null || objB == null) {
|
|
9
|
+
return false;
|
|
10
|
+
}
|
|
11
|
+
var keysA = Object.keys(objA);
|
|
12
|
+
var keysB = Object.keys(objB);
|
|
13
|
+
if (keysA.length !== keysB.length) {
|
|
14
|
+
return false;
|
|
15
|
+
}
|
|
16
|
+
var bHasOwnProperty = Object.prototype.hasOwnProperty.bind(objB);
|
|
17
|
+
for (var idx = 0; idx < keysA.length; idx++) {
|
|
18
|
+
var key = keysA[idx];
|
|
19
|
+
if (!bHasOwnProperty(key)) {
|
|
20
|
+
return false;
|
|
21
|
+
}
|
|
22
|
+
if (objA[key] !== objB[key]) {
|
|
23
|
+
return false;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
return true;
|
|
27
|
+
};
|
|
28
|
+
export var compareArrays = function compareArrays(left, right) {
|
|
29
|
+
var compareFn = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : shallowEqual;
|
|
30
|
+
if (left.length !== right.length) {
|
|
31
|
+
return false;
|
|
32
|
+
}
|
|
33
|
+
for (var idx = 0; idx < left.length; idx++) {
|
|
34
|
+
if (!compareFn(left[idx], right[idx])) {
|
|
35
|
+
return false;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
return true;
|
|
39
|
+
};
|
|
40
|
+
var compareItemWithKeys = function compareItemWithKeys(leftItem, rightItem) {
|
|
41
|
+
var excludedKeys = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
|
|
42
|
+
return Object.keys(leftItem).filter(function (key) {
|
|
43
|
+
return excludedKeys.indexOf(key) === -1;
|
|
44
|
+
}).every(function (key) {
|
|
45
|
+
return leftItem[key] instanceof Object ? shallowEqual(leftItem[key], rightItem[key]) : leftItem[key] === rightItem[key];
|
|
46
|
+
});
|
|
47
|
+
};
|
|
48
|
+
export var isSameItem = function isSameItem(leftItem, rightItem) {
|
|
49
|
+
if (leftItem.type !== rightItem.type) {
|
|
50
|
+
return false;
|
|
51
|
+
}
|
|
52
|
+
switch (leftItem.type) {
|
|
53
|
+
case 'button':
|
|
54
|
+
// Need to typecast `rightItem as typeof leftItem` otherwise we will
|
|
55
|
+
// have to put the `type !==` inside each case.
|
|
56
|
+
return compareItemWithKeys(leftItem, rightItem, ['type', 'onClick', 'onMouseEnter', 'onMouseLeave']);
|
|
57
|
+
case 'copy-button':
|
|
58
|
+
return compareItemWithKeys(leftItem, rightItem, ['type', 'items']);
|
|
59
|
+
case 'input':
|
|
60
|
+
return compareItemWithKeys(leftItem, rightItem, ['type', 'onSubmit', 'onBlur']);
|
|
61
|
+
case 'select':
|
|
62
|
+
if (makeSameType(leftItem, rightItem) && Array.isArray(leftItem.options) && Array.isArray(rightItem.options) && !compareArrays(leftItem.options, rightItem.options, function (left, right) {
|
|
63
|
+
return compareItemWithKeys(left, right);
|
|
64
|
+
})) {
|
|
65
|
+
return false;
|
|
66
|
+
}
|
|
67
|
+
return compareItemWithKeys(leftItem, rightItem, ['type', 'onChange', 'options']);
|
|
68
|
+
case 'dropdown':
|
|
69
|
+
if (makeSameType(leftItem, rightItem) && Array.isArray(leftItem.options) && Array.isArray(rightItem.options) &&
|
|
70
|
+
// @ts-expect-error TS2345: Argument of type 'DropdownOptionT<Function>[]' is not assignable to parameter of type 'any[][]'
|
|
71
|
+
!compareArrays(leftItem.options, rightItem.options, function (left, right) {
|
|
72
|
+
return (
|
|
73
|
+
// @ts-expect-error TS2322: Type '"onClick"' is not assignable to type 'keyof any[]'
|
|
74
|
+
compareItemWithKeys(left, right, ['onClick'])
|
|
75
|
+
);
|
|
76
|
+
})) {
|
|
77
|
+
return false;
|
|
78
|
+
}
|
|
79
|
+
return compareItemWithKeys(leftItem, rightItem, ['type', 'options']);
|
|
80
|
+
case 'custom':
|
|
81
|
+
return false;
|
|
82
|
+
case 'separator':
|
|
83
|
+
return compareItemWithKeys(leftItem, rightItem);
|
|
84
|
+
case 'extensions-placeholder':
|
|
85
|
+
return compareItemWithKeys(leftItem, rightItem);
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
export var areSameItems = function areSameItems(leftArr, rightArr) {
|
|
89
|
+
if (leftArr === undefined && rightArr === undefined) {
|
|
90
|
+
return true;
|
|
91
|
+
}
|
|
92
|
+
if (leftArr === undefined || rightArr === undefined) {
|
|
93
|
+
return false;
|
|
94
|
+
}
|
|
95
|
+
if (leftArr.length !== rightArr.length) {
|
|
96
|
+
return false;
|
|
97
|
+
}
|
|
98
|
+
return leftArr.every(function (item, index) {
|
|
99
|
+
return isSameItem(rightArr[index], item);
|
|
100
|
+
});
|
|
101
|
+
};
|
|
@@ -6,7 +6,7 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
|
|
|
6
6
|
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) { _defineProperty(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; }
|
|
7
7
|
var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
8
8
|
var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
9
|
-
var packageVersion = "
|
|
9
|
+
var packageVersion = "76.1.0";
|
|
10
10
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
11
11
|
// Remove URL as it has UGC
|
|
12
12
|
// TODO: Sanitise the URL instead of just removing it
|
|
@@ -2,14 +2,15 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
4
4
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
5
|
-
var _excluded = ["width", "children", "handleClassName", "className", "handleResize", "handleResizeStart", "handleResizeStop", "
|
|
5
|
+
var _excluded = ["width", "children", "handleClassName", "className", "handleResize", "handleResizeStart", "handleResizeStop", "handleSize", "handleAlignmentMethod", "handlePositioning", "appearance", "handleStyles", "resizeRatio", "snap", "snapGap", "isHandleVisible", "handleHighlight", "handleTooltipContent"];
|
|
6
6
|
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; }
|
|
7
7
|
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) { _defineProperty(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; }
|
|
8
|
-
import React, { useMemo, useRef, useState } from 'react';
|
|
8
|
+
import React, { useCallback, useMemo, useRef, useState } from 'react';
|
|
9
9
|
import classnames from 'classnames';
|
|
10
10
|
import { Resizable } from 're-resizable';
|
|
11
11
|
import Tooltip from '@atlaskit/tooltip';
|
|
12
12
|
import { handleWrapperClass, resizerDangerClassName, resizerHandleClassName, resizerHandleThumbClassName, resizerHandleTrackClassName, resizerHandleZIndex, resizerHoverZoneClassName, resizerItemClassName } from '../styles/shared/resizer';
|
|
13
|
+
var SUPPORTED_HANDLES = ['left', 'right'];
|
|
13
14
|
export default function ResizerNext(props) {
|
|
14
15
|
var _useState = useState(false),
|
|
15
16
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -23,8 +24,8 @@ export default function ResizerNext(props) {
|
|
|
23
24
|
handleResize = props.handleResize,
|
|
24
25
|
handleResizeStart = props.handleResizeStart,
|
|
25
26
|
handleResizeStop = props.handleResizeStop,
|
|
26
|
-
_props$
|
|
27
|
-
|
|
27
|
+
_props$handleSize = props.handleSize,
|
|
28
|
+
handleSize = _props$handleSize === void 0 ? 'medium' : _props$handleSize,
|
|
28
29
|
_props$handleAlignmen = props.handleAlignmentMethod,
|
|
29
30
|
handleAlignmentMethod = _props$handleAlignmen === void 0 ? 'center' : _props$handleAlignmen,
|
|
30
31
|
_props$handlePosition = props.handlePositioning,
|
|
@@ -33,24 +34,21 @@ export default function ResizerNext(props) {
|
|
|
33
34
|
handleStyles = props.handleStyles,
|
|
34
35
|
_props$resizeRatio = props.resizeRatio,
|
|
35
36
|
resizeRatio = _props$resizeRatio === void 0 ? 1 : _props$resizeRatio,
|
|
36
|
-
innerPadding = props.innerPadding,
|
|
37
37
|
snap = props.snap,
|
|
38
38
|
snapGap = props.snapGap,
|
|
39
|
-
handleMarginTop = props.handleMarginTop,
|
|
40
39
|
_props$isHandleVisibl = props.isHandleVisible,
|
|
41
40
|
isHandleVisible = _props$isHandleVisibl === void 0 ? false : _props$isHandleVisibl,
|
|
42
|
-
handleComponent = props.handleComponent,
|
|
43
41
|
_props$handleHighligh = props.handleHighlight,
|
|
44
42
|
handleHighlight = _props$handleHighligh === void 0 ? 'none' : _props$handleHighligh,
|
|
45
43
|
handleTooltipContent = props.handleTooltipContent,
|
|
46
44
|
otherProps = _objectWithoutProperties(props, _excluded);
|
|
47
|
-
var onResizeStart =
|
|
45
|
+
var onResizeStart = useCallback(function (event) {
|
|
48
46
|
// prevent creating a drag event on Firefox
|
|
49
47
|
event.preventDefault();
|
|
50
48
|
setIsResizing(true);
|
|
51
49
|
handleResizeStart();
|
|
52
50
|
}, [handleResizeStart]);
|
|
53
|
-
var onResize =
|
|
51
|
+
var onResize = useCallback(function (_event, _direction, _elementRef, delta) {
|
|
54
52
|
var resizableCurrent = resizable.current;
|
|
55
53
|
if (!resizableCurrent || !resizableCurrent.state.original) {
|
|
56
54
|
return;
|
|
@@ -63,7 +61,7 @@ export default function ResizerNext(props) {
|
|
|
63
61
|
};
|
|
64
62
|
handleResize(originalState, delta);
|
|
65
63
|
}, [handleResize]);
|
|
66
|
-
var onResizeStop =
|
|
64
|
+
var onResizeStop = useCallback(function (_event, _direction, _elementRef, delta) {
|
|
67
65
|
var resizableCurrent = resizable.current;
|
|
68
66
|
if (!resizableCurrent || !resizableCurrent.state.original) {
|
|
69
67
|
return;
|
|
@@ -78,81 +76,49 @@ export default function ResizerNext(props) {
|
|
|
78
76
|
handleResizeStop(originalState, delta);
|
|
79
77
|
}, [handleResizeStop]);
|
|
80
78
|
var handles = {
|
|
81
|
-
left: classnames(handleClassName !== null && handleClassName !== void 0 ? handleClassName : resizerHandleClassName, 'left',
|
|
82
|
-
right: classnames(handleClassName !== null && handleClassName !== void 0 ? handleClassName : resizerHandleClassName, 'right',
|
|
79
|
+
left: classnames(handleClassName !== null && handleClassName !== void 0 ? handleClassName : resizerHandleClassName, 'left', handleSize, handleAlignmentMethod),
|
|
80
|
+
right: classnames(handleClassName !== null && handleClassName !== void 0 ? handleClassName : resizerHandleClassName, 'right', handleSize, handleAlignmentMethod)
|
|
83
81
|
};
|
|
84
82
|
var baseHandleStyles = {
|
|
85
83
|
width: handlePositioning === 'adjacent' ? "var(--ds-space-100, 8px)" : "var(--ds-space-300, 24px)",
|
|
86
|
-
// eslint-disable-next-line
|
|
87
|
-
marginTop: Number.isFinite(handleMarginTop) ? "".concat(handleMarginTop, "px") : undefined,
|
|
88
84
|
zIndex: resizerHandleZIndex,
|
|
89
85
|
pointerEvents: 'auto',
|
|
90
86
|
alignItems: handlePositioning === 'adjacent' ? 'center' : undefined
|
|
91
87
|
};
|
|
92
|
-
var offset =
|
|
93
|
-
var nextHandleStyles = {
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
left: offset
|
|
97
|
-
}, handleStyles === null || handleStyles === void 0 ? void 0 : handleStyles.left),
|
|
98
|
-
right: _objectSpread(_objectSpread({}, baseHandleStyles), {}, {
|
|
99
|
-
// eslint-disable-next-line
|
|
100
|
-
right: offset
|
|
101
|
-
}, handleStyles === null || handleStyles === void 0 ? void 0 : handleStyles.right)
|
|
102
|
-
};
|
|
88
|
+
var offset = handlePositioning === 'adjacent' ? "calc(".concat(baseHandleStyles.width, " * -1)") : "calc(".concat(baseHandleStyles.width, " * -0.5)");
|
|
89
|
+
var nextHandleStyles = SUPPORTED_HANDLES.reduce(function (result, position) {
|
|
90
|
+
return _objectSpread(_objectSpread({}, result), {}, _defineProperty({}, position, _objectSpread(_objectSpread({}, baseHandleStyles), {}, _defineProperty({}, position, offset), handleStyles === null || handleStyles === void 0 ? void 0 : handleStyles[position])));
|
|
91
|
+
}, {});
|
|
103
92
|
var resizerClassName = classnames(className, resizerItemClassName, _defineProperty({
|
|
104
93
|
'is-resizing': isResizing,
|
|
105
94
|
'display-handle': isHandleVisible
|
|
106
95
|
}, resizerDangerClassName, appearance === 'danger'));
|
|
107
|
-
var
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
})
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
className: resizerHandleThumbClassName
|
|
124
|
-
}),
|
|
125
|
-
right: handleComponent.right && /*#__PURE__*/React.cloneElement(handleComponent.right, {
|
|
126
|
-
className: resizerHandleThumbClassName
|
|
127
|
-
})
|
|
128
|
-
};
|
|
129
|
-
}
|
|
130
|
-
var children = /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
131
|
-
className: classnames(resizerHandleTrackClassName, handleHighlight)
|
|
132
|
-
}), /*#__PURE__*/React.createElement("div", {
|
|
133
|
-
className: resizerHandleThumbClassName
|
|
134
|
-
}));
|
|
135
|
-
if (!!handleTooltipContent) {
|
|
136
|
-
return {
|
|
137
|
-
left: /*#__PURE__*/React.createElement(Tooltip, {
|
|
96
|
+
var handleComponent = useMemo(function () {
|
|
97
|
+
return SUPPORTED_HANDLES.reduce(function (result, position) {
|
|
98
|
+
var thumb = /*#__PURE__*/React.createElement("div", {
|
|
99
|
+
className: resizerHandleThumbClassName,
|
|
100
|
+
"data-testid": "resizer-handle-".concat(position, "-thumb"),
|
|
101
|
+
contentEditable: false
|
|
102
|
+
});
|
|
103
|
+
if ((!handleHighlight || handleHighlight === 'none') && !handleTooltipContent) {
|
|
104
|
+
return _objectSpread(_objectSpread({}, result), {}, _defineProperty({}, position, thumb));
|
|
105
|
+
}
|
|
106
|
+
var thumbWithTrack = /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
107
|
+
className: classnames(resizerHandleTrackClassName, handleHighlight),
|
|
108
|
+
"data-testid": "resizer-handle-".concat(position, "-track")
|
|
109
|
+
}), thumb);
|
|
110
|
+
if (!!handleTooltipContent) {
|
|
111
|
+
return _objectSpread(_objectSpread({}, result), {}, _defineProperty({}, position, /*#__PURE__*/React.createElement(Tooltip, {
|
|
138
112
|
content: handleTooltipContent,
|
|
139
113
|
hideTooltipOnClick: true,
|
|
140
114
|
position: "mouse",
|
|
141
|
-
mousePosition: "auto-start"
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
}, children)
|
|
149
|
-
};
|
|
150
|
-
}
|
|
151
|
-
return {
|
|
152
|
-
left: children,
|
|
153
|
-
right: children
|
|
154
|
-
};
|
|
155
|
-
}, [handleHighlight, handleTooltipContent, handleComponent]);
|
|
115
|
+
mousePosition: "auto-start",
|
|
116
|
+
testId: "resizer-handle-".concat(position, "-tooltip")
|
|
117
|
+
}, thumbWithTrack)));
|
|
118
|
+
}
|
|
119
|
+
return _objectSpread(_objectSpread({}, result), {}, _defineProperty({}, position, thumbWithTrack));
|
|
120
|
+
}, {});
|
|
121
|
+
}, [handleHighlight, handleTooltipContent]);
|
|
156
122
|
|
|
157
123
|
// snapGap is usually a constant, if snap.x?.length is 0 and snapGap has a value resizer cannot be resized
|
|
158
124
|
var snapGapActual = useMemo(function () {
|
|
@@ -179,7 +145,7 @@ export default function ResizerNext(props) {
|
|
|
179
145
|
resizeRatio: resizeRatio,
|
|
180
146
|
snapGap: snapGapActual,
|
|
181
147
|
snap: snap,
|
|
182
|
-
handleComponent:
|
|
148
|
+
handleComponent: handleComponent
|
|
183
149
|
}, otherProps), /*#__PURE__*/React.createElement("span", {
|
|
184
150
|
className: resizerHoverZoneClassName
|
|
185
151
|
}, children));
|
|
@@ -19,7 +19,7 @@ import { themed } from '@atlaskit/theme/components';
|
|
|
19
19
|
import { borderRadius } from '@atlaskit/theme/constants';
|
|
20
20
|
import Layer from '../Layer';
|
|
21
21
|
var packageName = "@atlaskit/editor-common";
|
|
22
|
-
var packageVersion = "
|
|
22
|
+
var packageVersion = "76.1.0";
|
|
23
23
|
var halfFocusRing = 1;
|
|
24
24
|
var dropOffset = '0, 8';
|
|
25
25
|
var DropList = /*#__PURE__*/function (_Component) {
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { FloatingToolbarItem } from '../types';
|
|
2
|
+
export type Item = FloatingToolbarItem<Function>;
|
|
3
|
+
export declare const shallowEqual: (objA?: Object, objB?: Object) => boolean;
|
|
4
|
+
export declare const compareArrays: <T extends any[]>(left: T[], right: T[], compareFn?: (left: T, right: T) => boolean) => boolean;
|
|
5
|
+
export declare const isSameItem: (leftItem: Item, rightItem: Item) => boolean;
|
|
6
|
+
export declare const areSameItems: (leftArr?: Array<Item>, rightArr?: Array<Item>) => boolean;
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { ActivityProvider } from '@atlaskit/activity-provider';
|
|
1
|
+
import type { ActivityProvider } from '@atlaskit/activity-provider';
|
|
2
2
|
import type { EmojiProvider } from '@atlaskit/emoji/types';
|
|
3
|
-
import { MentionProvider } from '@atlaskit/mention/types';
|
|
4
|
-
import { TaskDecisionProvider } from '@atlaskit/task-decision/types';
|
|
3
|
+
import type { MentionProvider } from '@atlaskit/mention/types';
|
|
4
|
+
import type { TaskDecisionProvider } from '@atlaskit/task-decision/types';
|
|
5
5
|
import type { CollabEditProvider } from '../collab';
|
|
6
|
-
import { ExtensionProvider } from '../extensions/types';
|
|
7
|
-
import { AutoformattingProvider } from './autoformatting-provider';
|
|
8
|
-
import { CardProvider } from './card-provider';
|
|
9
|
-
import { ContextIdentifierProvider } from './context-identifier-provider';
|
|
10
|
-
import { ImageUploadProvider } from './image-upload-provider';
|
|
11
|
-
import { MacroProvider } from './macro-provider';
|
|
12
|
-
import { MediaProvider } from './media-provider';
|
|
13
|
-
import { ProfilecardProvider } from './profile-card-provider';
|
|
14
|
-
import { QuickInsertProvider } from './quick-insert-provider';
|
|
15
|
-
import { SearchProvider } from './search-provider';
|
|
6
|
+
import type { ExtensionProvider } from '../extensions/types';
|
|
7
|
+
import type { AutoformattingProvider } from './autoformatting-provider';
|
|
8
|
+
import type { CardProvider } from './card-provider';
|
|
9
|
+
import type { ContextIdentifierProvider } from './context-identifier-provider';
|
|
10
|
+
import type { ImageUploadProvider } from './image-upload-provider';
|
|
11
|
+
import type { MacroProvider } from './macro-provider';
|
|
12
|
+
import type { MediaProvider } from './media-provider';
|
|
13
|
+
import type { ProfilecardProvider } from './profile-card-provider';
|
|
14
|
+
import type { QuickInsertProvider } from './quick-insert-provider';
|
|
15
|
+
import type { SearchProvider } from './search-provider';
|
|
16
16
|
export interface Providers {
|
|
17
17
|
mediaProvider?: Promise<MediaProvider>;
|
|
18
18
|
emojiProvider?: Promise<EmojiProvider>;
|
|
@@ -1,32 +1,52 @@
|
|
|
1
|
-
import
|
|
2
|
-
import type { PropsWithChildren } from 'react';
|
|
3
|
-
import type { HandleComponent } from 're-resizable';
|
|
1
|
+
import type { CSSProperties, PropsWithChildren } from 'react';
|
|
4
2
|
import type { TooltipProps } from '@atlaskit/tooltip';
|
|
5
|
-
import type { EnabledHandles, HandleAlignmentMethod,
|
|
3
|
+
import type { EnabledHandles, HandleAlignmentMethod, HandleHighlight, HandlePositioning, HandleResize, HandleResizeStart, HandleSize, HandleStyles, ResizerAppearance, Snap } from './types';
|
|
6
4
|
export type ResizerProps = {
|
|
5
|
+
className?: string;
|
|
7
6
|
enable: EnabledHandles;
|
|
8
7
|
width: number;
|
|
9
|
-
handleResizeStart: HandleResizeStart;
|
|
10
|
-
handleResize: HandleResize;
|
|
11
|
-
handleResizeStop: HandleResize;
|
|
12
|
-
innerPadding?: number;
|
|
13
|
-
handleClassName?: string;
|
|
14
|
-
className?: string;
|
|
15
8
|
minWidth?: number;
|
|
16
9
|
maxWidth?: number;
|
|
17
|
-
handleWrapperStyle?: React.CSSProperties;
|
|
18
|
-
handleComponent?: HandleComponent;
|
|
19
|
-
handleStyles?: HandleStyles;
|
|
20
|
-
handlePositioning?: HandlePositioning;
|
|
21
|
-
handleHeightSize?: HandleHeightSizeType;
|
|
22
|
-
handleMarginTop?: number;
|
|
23
10
|
snap?: Snap;
|
|
24
11
|
snapGap?: number;
|
|
25
|
-
handleAlignmentMethod?: HandleAlignmentMethod;
|
|
26
12
|
resizeRatio?: number;
|
|
27
|
-
isHandleVisible?: boolean;
|
|
28
13
|
appearance?: ResizerAppearance;
|
|
14
|
+
isHandleVisible?: boolean;
|
|
15
|
+
handleResizeStart: HandleResizeStart;
|
|
16
|
+
handleResize: HandleResize;
|
|
17
|
+
handleResizeStop: HandleResize;
|
|
18
|
+
/**
|
|
19
|
+
* This can be used to override the css class name applied to the resize handle.
|
|
20
|
+
*/
|
|
21
|
+
handleClassName?: string;
|
|
22
|
+
/**
|
|
23
|
+
* This is used to override the style of resize handles wrapper.
|
|
24
|
+
*/
|
|
25
|
+
handleWrapperStyle?: CSSProperties;
|
|
26
|
+
/**
|
|
27
|
+
* This property is used to override the style of one or more resize handles. Only the axis you specify will have
|
|
28
|
+
* its handle style overriden.
|
|
29
|
+
*/
|
|
30
|
+
handleStyles?: HandleStyles;
|
|
31
|
+
/**
|
|
32
|
+
* The handleAlignmentMethod is used in determining the vertical positioning of the resizer handle in relation to its children.
|
|
33
|
+
*/
|
|
34
|
+
handleAlignmentMethod?: HandleAlignmentMethod;
|
|
35
|
+
/**
|
|
36
|
+
* The handlePositioning is used to determine the horizontal position of the resizer handle in relation to its children.
|
|
37
|
+
*/
|
|
38
|
+
handlePositioning?: HandlePositioning;
|
|
39
|
+
/**
|
|
40
|
+
* The handleSize is used to determine the width/height of the handle element.
|
|
41
|
+
*/
|
|
42
|
+
handleSize?: HandleSize;
|
|
43
|
+
/**
|
|
44
|
+
* The handleHighlight is used to determine how the handle looks when the users mouse hovers over the handle element.
|
|
45
|
+
*/
|
|
29
46
|
handleHighlight?: HandleHighlight;
|
|
47
|
+
/**
|
|
48
|
+
* The handle can display a tooltip when mouse hovers.
|
|
49
|
+
*/
|
|
30
50
|
handleTooltipContent?: TooltipProps['content'];
|
|
31
51
|
};
|
|
32
52
|
export default function ResizerNext(props: PropsWithChildren<ResizerProps>): JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { default as ResizerNext } from './Resizer';
|
|
2
|
-
export type { HandleAlignmentMethod, HandleHighlight,
|
|
2
|
+
export type { HandleAlignmentMethod, HandleHighlight, HandleSize, HandlePositioning, EnabledHandles, HandleResize, Position, Snap, HandleResizeStart, Dimensions, } from './types';
|
|
@@ -21,7 +21,7 @@ export type HandleStyles = {
|
|
|
21
21
|
right?: React.CSSProperties;
|
|
22
22
|
left?: React.CSSProperties;
|
|
23
23
|
};
|
|
24
|
-
export type
|
|
24
|
+
export type HandleSize = 'small' | 'medium' | 'large';
|
|
25
25
|
export type HandleAlignmentMethod = 'center' | 'sticky';
|
|
26
26
|
export type HandlePositioning = 'overlap' | 'adjacent';
|
|
27
27
|
export type ResizerAppearance = 'danger';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { FloatingToolbarItem } from '../types';
|
|
2
|
+
export type Item = FloatingToolbarItem<Function>;
|
|
3
|
+
export declare const shallowEqual: (objA?: Object, objB?: Object) => boolean;
|
|
4
|
+
export declare const compareArrays: <T extends any[]>(left: T[], right: T[], compareFn?: (left: T, right: T) => boolean) => boolean;
|
|
5
|
+
export declare const isSameItem: (leftItem: Item, rightItem: Item) => boolean;
|
|
6
|
+
export declare const areSameItems: (leftArr?: Array<Item>, rightArr?: Array<Item>) => boolean;
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { ActivityProvider } from '@atlaskit/activity-provider';
|
|
1
|
+
import type { ActivityProvider } from '@atlaskit/activity-provider';
|
|
2
2
|
import type { EmojiProvider } from '@atlaskit/emoji/types';
|
|
3
|
-
import { MentionProvider } from '@atlaskit/mention/types';
|
|
4
|
-
import { TaskDecisionProvider } from '@atlaskit/task-decision/types';
|
|
3
|
+
import type { MentionProvider } from '@atlaskit/mention/types';
|
|
4
|
+
import type { TaskDecisionProvider } from '@atlaskit/task-decision/types';
|
|
5
5
|
import type { CollabEditProvider } from '../collab';
|
|
6
|
-
import { ExtensionProvider } from '../extensions/types';
|
|
7
|
-
import { AutoformattingProvider } from './autoformatting-provider';
|
|
8
|
-
import { CardProvider } from './card-provider';
|
|
9
|
-
import { ContextIdentifierProvider } from './context-identifier-provider';
|
|
10
|
-
import { ImageUploadProvider } from './image-upload-provider';
|
|
11
|
-
import { MacroProvider } from './macro-provider';
|
|
12
|
-
import { MediaProvider } from './media-provider';
|
|
13
|
-
import { ProfilecardProvider } from './profile-card-provider';
|
|
14
|
-
import { QuickInsertProvider } from './quick-insert-provider';
|
|
15
|
-
import { SearchProvider } from './search-provider';
|
|
6
|
+
import type { ExtensionProvider } from '../extensions/types';
|
|
7
|
+
import type { AutoformattingProvider } from './autoformatting-provider';
|
|
8
|
+
import type { CardProvider } from './card-provider';
|
|
9
|
+
import type { ContextIdentifierProvider } from './context-identifier-provider';
|
|
10
|
+
import type { ImageUploadProvider } from './image-upload-provider';
|
|
11
|
+
import type { MacroProvider } from './macro-provider';
|
|
12
|
+
import type { MediaProvider } from './media-provider';
|
|
13
|
+
import type { ProfilecardProvider } from './profile-card-provider';
|
|
14
|
+
import type { QuickInsertProvider } from './quick-insert-provider';
|
|
15
|
+
import type { SearchProvider } from './search-provider';
|
|
16
16
|
export interface Providers {
|
|
17
17
|
mediaProvider?: Promise<MediaProvider>;
|
|
18
18
|
emojiProvider?: Promise<EmojiProvider>;
|
|
@@ -1,32 +1,52 @@
|
|
|
1
|
-
import
|
|
2
|
-
import type { PropsWithChildren } from 'react';
|
|
3
|
-
import type { HandleComponent } from 're-resizable';
|
|
1
|
+
import type { CSSProperties, PropsWithChildren } from 'react';
|
|
4
2
|
import type { TooltipProps } from '@atlaskit/tooltip';
|
|
5
|
-
import type { EnabledHandles, HandleAlignmentMethod,
|
|
3
|
+
import type { EnabledHandles, HandleAlignmentMethod, HandleHighlight, HandlePositioning, HandleResize, HandleResizeStart, HandleSize, HandleStyles, ResizerAppearance, Snap } from './types';
|
|
6
4
|
export type ResizerProps = {
|
|
5
|
+
className?: string;
|
|
7
6
|
enable: EnabledHandles;
|
|
8
7
|
width: number;
|
|
9
|
-
handleResizeStart: HandleResizeStart;
|
|
10
|
-
handleResize: HandleResize;
|
|
11
|
-
handleResizeStop: HandleResize;
|
|
12
|
-
innerPadding?: number;
|
|
13
|
-
handleClassName?: string;
|
|
14
|
-
className?: string;
|
|
15
8
|
minWidth?: number;
|
|
16
9
|
maxWidth?: number;
|
|
17
|
-
handleWrapperStyle?: React.CSSProperties;
|
|
18
|
-
handleComponent?: HandleComponent;
|
|
19
|
-
handleStyles?: HandleStyles;
|
|
20
|
-
handlePositioning?: HandlePositioning;
|
|
21
|
-
handleHeightSize?: HandleHeightSizeType;
|
|
22
|
-
handleMarginTop?: number;
|
|
23
10
|
snap?: Snap;
|
|
24
11
|
snapGap?: number;
|
|
25
|
-
handleAlignmentMethod?: HandleAlignmentMethod;
|
|
26
12
|
resizeRatio?: number;
|
|
27
|
-
isHandleVisible?: boolean;
|
|
28
13
|
appearance?: ResizerAppearance;
|
|
14
|
+
isHandleVisible?: boolean;
|
|
15
|
+
handleResizeStart: HandleResizeStart;
|
|
16
|
+
handleResize: HandleResize;
|
|
17
|
+
handleResizeStop: HandleResize;
|
|
18
|
+
/**
|
|
19
|
+
* This can be used to override the css class name applied to the resize handle.
|
|
20
|
+
*/
|
|
21
|
+
handleClassName?: string;
|
|
22
|
+
/**
|
|
23
|
+
* This is used to override the style of resize handles wrapper.
|
|
24
|
+
*/
|
|
25
|
+
handleWrapperStyle?: CSSProperties;
|
|
26
|
+
/**
|
|
27
|
+
* This property is used to override the style of one or more resize handles. Only the axis you specify will have
|
|
28
|
+
* its handle style overriden.
|
|
29
|
+
*/
|
|
30
|
+
handleStyles?: HandleStyles;
|
|
31
|
+
/**
|
|
32
|
+
* The handleAlignmentMethod is used in determining the vertical positioning of the resizer handle in relation to its children.
|
|
33
|
+
*/
|
|
34
|
+
handleAlignmentMethod?: HandleAlignmentMethod;
|
|
35
|
+
/**
|
|
36
|
+
* The handlePositioning is used to determine the horizontal position of the resizer handle in relation to its children.
|
|
37
|
+
*/
|
|
38
|
+
handlePositioning?: HandlePositioning;
|
|
39
|
+
/**
|
|
40
|
+
* The handleSize is used to determine the width/height of the handle element.
|
|
41
|
+
*/
|
|
42
|
+
handleSize?: HandleSize;
|
|
43
|
+
/**
|
|
44
|
+
* The handleHighlight is used to determine how the handle looks when the users mouse hovers over the handle element.
|
|
45
|
+
*/
|
|
29
46
|
handleHighlight?: HandleHighlight;
|
|
47
|
+
/**
|
|
48
|
+
* The handle can display a tooltip when mouse hovers.
|
|
49
|
+
*/
|
|
30
50
|
handleTooltipContent?: TooltipProps['content'];
|
|
31
51
|
};
|
|
32
52
|
export default function ResizerNext(props: PropsWithChildren<ResizerProps>): JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { default as ResizerNext } from './Resizer';
|
|
2
|
-
export type { HandleAlignmentMethod, HandleHighlight,
|
|
2
|
+
export type { HandleAlignmentMethod, HandleHighlight, HandleSize, HandlePositioning, EnabledHandles, HandleResize, Position, Snap, HandleResizeStart, Dimensions, } from './types';
|
|
@@ -21,7 +21,7 @@ export type HandleStyles = {
|
|
|
21
21
|
right?: React.CSSProperties;
|
|
22
22
|
left?: React.CSSProperties;
|
|
23
23
|
};
|
|
24
|
-
export type
|
|
24
|
+
export type HandleSize = 'small' | 'medium' | 'large';
|
|
25
25
|
export type HandleAlignmentMethod = 'center' | 'sticky';
|
|
26
26
|
export type HandlePositioning = 'overlap' | 'adjacent';
|
|
27
27
|
export type ResizerAppearance = 'danger';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@atlaskit/editor-common/floating-toolbar",
|
|
3
|
+
"main": "../dist/cjs/floating-toolbar/index.js",
|
|
4
|
+
"module": "../dist/esm/floating-toolbar/index.js",
|
|
5
|
+
"module:es2019": "../dist/es2019/floating-toolbar/index.js",
|
|
6
|
+
"sideEffects": false,
|
|
7
|
+
"types": "../dist/types/floating-toolbar/index.d.ts",
|
|
8
|
+
"typesVersions": {
|
|
9
|
+
">=4.5 <4.9": {
|
|
10
|
+
"*": [
|
|
11
|
+
"../dist/types-ts4.5/floating-toolbar/index.d.ts"
|
|
12
|
+
]
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-common",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "76.1.0",
|
|
4
4
|
"description": "A package that contains common classes and components for editor and renderer",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -79,7 +79,8 @@
|
|
|
79
79
|
"./commands": "./src/commands/index.ts",
|
|
80
80
|
"./clipboard": "./src/clipboard/index.ts",
|
|
81
81
|
"./lists": "./src/lists/index.ts",
|
|
82
|
-
"./element-browser": "./src/element-browser/index.ts"
|
|
82
|
+
"./element-browser": "./src/element-browser/index.ts",
|
|
83
|
+
"./floating-toolbar": "./src/floating-toolbar/index.ts"
|
|
83
84
|
},
|
|
84
85
|
"dependencies": {
|
|
85
86
|
"@atlaskit/activity-provider": "^2.4.0",
|