@atlaskit/editor-common 81.1.3 → 81.1.5
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 +6779 -6802
- package/dist/cjs/monitoring/error.js +1 -1
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/cjs/ui/WidthProvider/index.js +23 -7
- package/dist/es2019/monitoring/error.js +1 -1
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/es2019/ui/WidthProvider/index.js +23 -7
- package/dist/esm/monitoring/error.js +1 -1
- package/dist/esm/ui/DropList/index.js +1 -1
- package/dist/esm/ui/WidthProvider/index.js +23 -7
- package/dist/types/analytics/types/insert-events.d.ts +1 -1
- package/dist/types/provider-factory/quick-insert-provider.d.ts +2 -1
- package/dist/types-ts4.5/analytics/types/insert-events.d.ts +1 -1
- package/dist/types-ts4.5/provider-factory/quick-insert-provider.d.ts +2 -1
- package/package.json +2 -2
|
@@ -16,7 +16,7 @@ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return
|
|
|
16
16
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
17
17
|
var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
18
18
|
var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
19
|
-
var packageVersion = "81.1.
|
|
19
|
+
var packageVersion = "81.1.5";
|
|
20
20
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
21
21
|
// Remove URL as it has UGC
|
|
22
22
|
// TODO: Sanitise the URL instead of just removing it
|
|
@@ -20,7 +20,7 @@ var _Layer = _interopRequireDefault(require("../Layer"));
|
|
|
20
20
|
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); }; }
|
|
21
21
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } /** @jsx jsx */
|
|
22
22
|
var packageName = "@atlaskit/editor-common";
|
|
23
|
-
var packageVersion = "81.1.
|
|
23
|
+
var packageVersion = "81.1.5";
|
|
24
24
|
var halfFocusRing = 1;
|
|
25
25
|
var dropOffset = '0, 8';
|
|
26
26
|
var DropList = /*#__PURE__*/function (_Component) {
|
|
@@ -53,17 +53,33 @@ var WidthProvider = exports.WidthProvider = function WidthProvider(_ref) {
|
|
|
53
53
|
_React$useState2 = (0, _slicedToArray2.default)(_React$useState, 2),
|
|
54
54
|
width = _React$useState2[0],
|
|
55
55
|
setWidth = _React$useState2[1];
|
|
56
|
+
var widthRef = _react.default.useRef(width);
|
|
57
|
+
var isMountedRef = _react.default.useRef(true);
|
|
56
58
|
var providerValue = _react.default.useMemo(function () {
|
|
57
59
|
return createWidthContext(width);
|
|
58
60
|
}, [width]);
|
|
59
|
-
var updateWidth =
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
61
|
+
var updateWidth = _react.default.useMemo(function () {
|
|
62
|
+
return (0, _rafSchd.default)(function (nextWidth) {
|
|
63
|
+
var currentWidth = widthRef.current || 0;
|
|
64
|
+
// Ignore changes that are less than SCROLLBAR_WIDTH, otherwise it can cause infinite re-scaling
|
|
65
|
+
if (Math.abs(currentWidth - nextWidth) < SCROLLBAR_WIDTH) {
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
// Avoid React memory leak by checking if the component is still mounted
|
|
70
|
+
if (!isMountedRef.current) {
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
setWidth(nextWidth);
|
|
74
|
+
});
|
|
75
|
+
}, []);
|
|
66
76
|
var skipWidthDetection = shouldCheckExistingValue && existingContextValue.width > 0;
|
|
77
|
+
_react.default.useLayoutEffect(function () {
|
|
78
|
+
isMountedRef.current = true;
|
|
79
|
+
return function () {
|
|
80
|
+
isMountedRef.current = false;
|
|
81
|
+
};
|
|
82
|
+
}, []);
|
|
67
83
|
return (
|
|
68
84
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
69
85
|
(0, _react2.jsx)("div", {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
2
2
|
const packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
3
|
-
const packageVersion = "81.1.
|
|
3
|
+
const packageVersion = "81.1.5";
|
|
4
4
|
const sanitiseSentryEvents = (data, _hint) => {
|
|
5
5
|
// Remove URL as it has UGC
|
|
6
6
|
// TODO: Sanitise the URL instead of just removing it
|
|
@@ -7,7 +7,7 @@ import { createAndFireEvent, withAnalyticsContext, withAnalyticsEvents } from '@
|
|
|
7
7
|
import { N0, N50A, N60A, N900 } from '@atlaskit/theme/colors';
|
|
8
8
|
import Layer from '../Layer';
|
|
9
9
|
const packageName = "@atlaskit/editor-common";
|
|
10
|
-
const packageVersion = "81.1.
|
|
10
|
+
const packageVersion = "81.1.5";
|
|
11
11
|
const halfFocusRing = 1;
|
|
12
12
|
const dropOffset = '0, 8';
|
|
13
13
|
class DropList extends Component {
|
|
@@ -37,15 +37,31 @@ export const WidthProvider = ({
|
|
|
37
37
|
var _document$body$offset, _document$body;
|
|
38
38
|
const existingContextValue = React.useContext(WidthContext);
|
|
39
39
|
const [width, setWidth] = React.useState(typeof document !== 'undefined' ? (_document$body$offset = (_document$body = document.body) === null || _document$body === void 0 ? void 0 : _document$body.offsetWidth) !== null && _document$body$offset !== void 0 ? _document$body$offset : 0 : 0);
|
|
40
|
+
const widthRef = React.useRef(width);
|
|
41
|
+
const isMountedRef = React.useRef(true);
|
|
40
42
|
const providerValue = React.useMemo(() => createWidthContext(width), [width]);
|
|
41
|
-
const updateWidth =
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
43
|
+
const updateWidth = React.useMemo(() => {
|
|
44
|
+
return rafSchedule(nextWidth => {
|
|
45
|
+
const currentWidth = widthRef.current || 0;
|
|
46
|
+
// Ignore changes that are less than SCROLLBAR_WIDTH, otherwise it can cause infinite re-scaling
|
|
47
|
+
if (Math.abs(currentWidth - nextWidth) < SCROLLBAR_WIDTH) {
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
// Avoid React memory leak by checking if the component is still mounted
|
|
52
|
+
if (!isMountedRef.current) {
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
setWidth(nextWidth);
|
|
56
|
+
});
|
|
57
|
+
}, []);
|
|
48
58
|
const skipWidthDetection = shouldCheckExistingValue && existingContextValue.width > 0;
|
|
59
|
+
React.useLayoutEffect(() => {
|
|
60
|
+
isMountedRef.current = true;
|
|
61
|
+
return () => {
|
|
62
|
+
isMountedRef.current = false;
|
|
63
|
+
};
|
|
64
|
+
}, []);
|
|
49
65
|
return (
|
|
50
66
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
51
67
|
jsx("div", {
|
|
@@ -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 = "81.1.
|
|
9
|
+
var packageVersion = "81.1.5";
|
|
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
|
|
@@ -15,7 +15,7 @@ import { createAndFireEvent, withAnalyticsContext, withAnalyticsEvents } from '@
|
|
|
15
15
|
import { N0, N50A, N60A, N900 } from '@atlaskit/theme/colors';
|
|
16
16
|
import Layer from '../Layer';
|
|
17
17
|
var packageName = "@atlaskit/editor-common";
|
|
18
|
-
var packageVersion = "81.1.
|
|
18
|
+
var packageVersion = "81.1.5";
|
|
19
19
|
var halfFocusRing = 1;
|
|
20
20
|
var dropOffset = '0, 8';
|
|
21
21
|
var DropList = /*#__PURE__*/function (_Component) {
|
|
@@ -40,17 +40,33 @@ export var WidthProvider = function WidthProvider(_ref) {
|
|
|
40
40
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
41
41
|
width = _React$useState2[0],
|
|
42
42
|
setWidth = _React$useState2[1];
|
|
43
|
+
var widthRef = React.useRef(width);
|
|
44
|
+
var isMountedRef = React.useRef(true);
|
|
43
45
|
var providerValue = React.useMemo(function () {
|
|
44
46
|
return createWidthContext(width);
|
|
45
47
|
}, [width]);
|
|
46
|
-
var updateWidth =
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
48
|
+
var updateWidth = React.useMemo(function () {
|
|
49
|
+
return rafSchedule(function (nextWidth) {
|
|
50
|
+
var currentWidth = widthRef.current || 0;
|
|
51
|
+
// Ignore changes that are less than SCROLLBAR_WIDTH, otherwise it can cause infinite re-scaling
|
|
52
|
+
if (Math.abs(currentWidth - nextWidth) < SCROLLBAR_WIDTH) {
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// Avoid React memory leak by checking if the component is still mounted
|
|
57
|
+
if (!isMountedRef.current) {
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
setWidth(nextWidth);
|
|
61
|
+
});
|
|
62
|
+
}, []);
|
|
53
63
|
var skipWidthDetection = shouldCheckExistingValue && existingContextValue.width > 0;
|
|
64
|
+
React.useLayoutEffect(function () {
|
|
65
|
+
isMountedRef.current = true;
|
|
66
|
+
return function () {
|
|
67
|
+
isMountedRef.current = false;
|
|
68
|
+
};
|
|
69
|
+
}, []);
|
|
54
70
|
return (
|
|
55
71
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
56
72
|
jsx("div", {
|
|
@@ -109,7 +109,7 @@ type InsertExtensionAEP = InsertAEP<ACTION_SUBJECT_ID.EXTENSION, {
|
|
|
109
109
|
extensionType: string;
|
|
110
110
|
extensionKey: string;
|
|
111
111
|
key: string;
|
|
112
|
-
inputMethod: INPUT_METHOD.QUICK_INSERT;
|
|
112
|
+
inputMethod: INPUT_METHOD.QUICK_INSERT | INPUT_METHOD.TOOLBAR;
|
|
113
113
|
}, any>;
|
|
114
114
|
type InsertNodeViaExtensionAPIAEP = InsertAEP<undefined, {
|
|
115
115
|
nodeType: string;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Node } from '@atlaskit/editor-prosemirror/model';
|
|
2
2
|
import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
+
import type { INPUT_METHOD } from "../analytics/types/enums";
|
|
3
4
|
import type { TypeAheadItem } from '../types/type-ahead';
|
|
4
5
|
export type QuickInsertActionInsert = (node?: Node | Record<string, any> | string, opts?: {
|
|
5
6
|
selectInlineNode?: boolean;
|
|
@@ -23,7 +24,7 @@ export type QuickInsertItem = TypeAheadItem & {
|
|
|
23
24
|
* If a search occurs -- then a separate insert action is called
|
|
24
25
|
* @see packages/editor/editor-core/src/plugins/insert-block/ui/ToolbarInsertBlock/index.tsx for details
|
|
25
26
|
*/
|
|
26
|
-
action: (insert: QuickInsertActionInsert, state: EditorState) => Transaction | false;
|
|
27
|
+
action: (insert: QuickInsertActionInsert, state: EditorState, source?: INPUT_METHOD.TOOLBAR | INPUT_METHOD.QUICK_INSERT) => Transaction | false;
|
|
27
28
|
};
|
|
28
29
|
export type QuickInsertProvider = {
|
|
29
30
|
getItems: () => Promise<Array<QuickInsertItem>>;
|
|
@@ -109,7 +109,7 @@ type InsertExtensionAEP = InsertAEP<ACTION_SUBJECT_ID.EXTENSION, {
|
|
|
109
109
|
extensionType: string;
|
|
110
110
|
extensionKey: string;
|
|
111
111
|
key: string;
|
|
112
|
-
inputMethod: INPUT_METHOD.QUICK_INSERT;
|
|
112
|
+
inputMethod: INPUT_METHOD.QUICK_INSERT | INPUT_METHOD.TOOLBAR;
|
|
113
113
|
}, any>;
|
|
114
114
|
type InsertNodeViaExtensionAPIAEP = InsertAEP<undefined, {
|
|
115
115
|
nodeType: string;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Node } from '@atlaskit/editor-prosemirror/model';
|
|
2
2
|
import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
+
import type { INPUT_METHOD } from "../analytics/types/enums";
|
|
3
4
|
import type { TypeAheadItem } from '../types/type-ahead';
|
|
4
5
|
export type QuickInsertActionInsert = (node?: Node | Record<string, any> | string, opts?: {
|
|
5
6
|
selectInlineNode?: boolean;
|
|
@@ -23,7 +24,7 @@ export type QuickInsertItem = TypeAheadItem & {
|
|
|
23
24
|
* If a search occurs -- then a separate insert action is called
|
|
24
25
|
* @see packages/editor/editor-core/src/plugins/insert-block/ui/ToolbarInsertBlock/index.tsx for details
|
|
25
26
|
*/
|
|
26
|
-
action: (insert: QuickInsertActionInsert, state: EditorState) => Transaction | false;
|
|
27
|
+
action: (insert: QuickInsertActionInsert, state: EditorState, source?: INPUT_METHOD.TOOLBAR | INPUT_METHOD.QUICK_INSERT) => Transaction | false;
|
|
27
28
|
};
|
|
28
29
|
export type QuickInsertProvider = {
|
|
29
30
|
getItems: () => Promise<Array<QuickInsertItem>>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-common",
|
|
3
|
-
"version": "81.1.
|
|
3
|
+
"version": "81.1.5",
|
|
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/"
|
|
@@ -130,7 +130,7 @@
|
|
|
130
130
|
"@atlaskit/primitives": "^6.3.0",
|
|
131
131
|
"@atlaskit/profilecard": "^19.14.0",
|
|
132
132
|
"@atlaskit/section-message": "^6.5.0",
|
|
133
|
-
"@atlaskit/smart-card": "^27.
|
|
133
|
+
"@atlaskit/smart-card": "^27.3.0",
|
|
134
134
|
"@atlaskit/smart-user-picker": "^6.9.0",
|
|
135
135
|
"@atlaskit/spinner": "^16.1.0",
|
|
136
136
|
"@atlaskit/task-decision": "^17.10.0",
|