@atlaskit/editor-common 74.4.0 → 74.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/dist/cjs/hooks/useSharedPluginState.js +25 -10
- package/dist/cjs/monitoring/error.js +3 -1
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/hooks/useSharedPluginState.js +34 -19
- package/dist/es2019/monitoring/error.js +3 -1
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/hooks/useSharedPluginState.js +26 -11
- package/dist/esm/monitoring/error.js +3 -1
- package/dist/esm/ui/DropList/index.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/types/editor-container-width.d.ts +0 -1
- package/dist/types/types/editor-plugin.d.ts +10 -1
- package/dist/types/types/index.d.ts +1 -1
- package/dist/types/types/ui-components.d.ts +1 -0
- package/dist/types-ts4.5/types/editor-container-width.d.ts +0 -1
- package/dist/types-ts4.5/types/editor-plugin.d.ts +10 -1
- package/dist/types-ts4.5/types/index.d.ts +1 -1
- package/dist/types-ts4.5/types/ui-components.d.ts +1 -0
- package/package.json +4 -4
- package/tmp/api-report-tmp.d.ts +9 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @atlaskit/editor-common
|
|
2
2
|
|
|
3
|
+
## 74.5.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`a336b15fe85`](https://bitbucket.org/atlassian/atlassian-frontend/commits/a336b15fe85) - NO-ISSUE Explicitly remove breadcrumbs for Editor Sentry events
|
|
8
|
+
|
|
9
|
+
## 74.5.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- [`7cd4abcdc0d`](https://bitbucket.org/atlassian/atlassian-frontend/commits/7cd4abcdc0d) - Fix workaround in `editor-plugin-width`. This involved removing `WidthEmitter` in `editor-core`, removing `containerWidth` from `WidthPluginState`. This change also introduces `usePluginHook` for an `EditorPlugin` - this enables a react hook to be mounted for plugins (in all appearances).
|
|
14
|
+
|
|
3
15
|
## 74.4.0
|
|
4
16
|
|
|
5
17
|
### Minor Changes
|
|
@@ -28,6 +28,16 @@ function mapValues(object, mapFunction) {
|
|
|
28
28
|
}, {});
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
+
// When we use the `useSharedPluginState` example: `useSharedPluginState(api, ['width'])`
|
|
32
|
+
// it will re-render every time the component re-renders as the array "['width']" is seen as an update.
|
|
33
|
+
// This hook is used to prevent re-renders due to this.
|
|
34
|
+
function useStaticPlugins(plugins) {
|
|
35
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
36
|
+
return (0, _react.useMemo)(function () {
|
|
37
|
+
return plugins;
|
|
38
|
+
}, []);
|
|
39
|
+
}
|
|
40
|
+
|
|
31
41
|
/**
|
|
32
42
|
*
|
|
33
43
|
* Used to return the current plugin state of
|
|
@@ -61,12 +71,14 @@ function mapValues(object, mapFunction) {
|
|
|
61
71
|
* the values are the shared state exposed by that plugin.
|
|
62
72
|
*/
|
|
63
73
|
function useSharedPluginState(injectionApi, plugins) {
|
|
74
|
+
var pluginNames = useStaticPlugins(plugins);
|
|
75
|
+
|
|
64
76
|
// Create a memoized object containing the named plugins
|
|
65
77
|
var namedExternalPlugins = (0, _react.useMemo)(function () {
|
|
66
|
-
return
|
|
78
|
+
return pluginNames.reduce(function (acc, pluginName) {
|
|
67
79
|
return _objectSpread(_objectSpread({}, acc), {}, (0, _defineProperty2.default)({}, "".concat(pluginName, "State"), injectionApi === null || injectionApi === void 0 ? void 0 : injectionApi.dependencies[pluginName]));
|
|
68
80
|
}, {});
|
|
69
|
-
}, [injectionApi === null || injectionApi === void 0 ? void 0 : injectionApi.dependencies,
|
|
81
|
+
}, [injectionApi === null || injectionApi === void 0 ? void 0 : injectionApi.dependencies, pluginNames]);
|
|
70
82
|
return useSharedPluginStateInternal(namedExternalPlugins);
|
|
71
83
|
}
|
|
72
84
|
function useSharedPluginStateInternal(externalPlugins) {
|
|
@@ -74,10 +86,10 @@ function useSharedPluginStateInternal(externalPlugins) {
|
|
|
74
86
|
return value === null || value === void 0 ? void 0 : value.sharedState.currentState();
|
|
75
87
|
})),
|
|
76
88
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
(0, _react.
|
|
80
|
-
var
|
|
89
|
+
pluginStates = _useState2[0],
|
|
90
|
+
setPluginState = _useState2[1];
|
|
91
|
+
(0, _react.useLayoutEffect)(function () {
|
|
92
|
+
var unsubs = Object.entries(externalPlugins).map(function (_ref3) {
|
|
81
93
|
var _ref4 = (0, _slicedToArray2.default)(_ref3, 2),
|
|
82
94
|
pluginKey = _ref4[0],
|
|
83
95
|
externalPlugin = _ref4[1];
|
|
@@ -87,16 +99,19 @@ function useSharedPluginStateInternal(externalPlugins) {
|
|
|
87
99
|
if (prevSharedState === nextSharedState) {
|
|
88
100
|
return;
|
|
89
101
|
}
|
|
90
|
-
|
|
91
|
-
return _objectSpread(_objectSpread({},
|
|
102
|
+
setPluginState(function (currentPluginStates) {
|
|
103
|
+
return _objectSpread(_objectSpread({}, currentPluginStates), {}, (0, _defineProperty2.default)({}, pluginKey, nextSharedState));
|
|
92
104
|
});
|
|
93
105
|
});
|
|
94
106
|
});
|
|
95
107
|
return function () {
|
|
96
|
-
|
|
108
|
+
unsubs.forEach(function (cb) {
|
|
97
109
|
return cb === null || cb === void 0 ? void 0 : cb();
|
|
98
110
|
});
|
|
99
111
|
};
|
|
112
|
+
// Do not re-render due to state changes, we only need to check this when
|
|
113
|
+
// setting up the initial subscription.
|
|
114
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
100
115
|
}, [externalPlugins]);
|
|
101
|
-
return
|
|
116
|
+
return pluginStates;
|
|
102
117
|
}
|
|
@@ -16,7 +16,7 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
16
16
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
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 = "74.
|
|
19
|
+
var packageVersion = "74.5.1";
|
|
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
|
|
@@ -87,6 +87,8 @@ var logException = /*#__PURE__*/function () {
|
|
|
87
87
|
// Confluence environment variables
|
|
88
88
|
'confluence-frontend-version': window.__buildInfo.FRONTEND_VERSION
|
|
89
89
|
}, tags));
|
|
90
|
+
// Explicitly remove the breadcrumbs as it's too likely to log UGC/PII to side-step the hub integrations not being respected
|
|
91
|
+
scope.clearBreadcrumbs();
|
|
90
92
|
hub.captureException(error);
|
|
91
93
|
});
|
|
92
94
|
return _context.abrupt("return", client.close());
|
|
@@ -24,7 +24,7 @@ var _templateObject, _templateObject2, _templateObject3;
|
|
|
24
24
|
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); }; }
|
|
25
25
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } /** @jsx jsx */
|
|
26
26
|
var packageName = "@atlaskit/editor-common";
|
|
27
|
-
var packageVersion = "74.
|
|
27
|
+
var packageVersion = "74.5.1";
|
|
28
28
|
var halfFocusRing = 1;
|
|
29
29
|
var dropOffset = '0, 8';
|
|
30
30
|
var DropList = /*#__PURE__*/function (_Component) {
|
package/dist/cjs/version.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useLayoutEffect, useMemo, useState } from 'react';
|
|
2
2
|
/**
|
|
3
3
|
*
|
|
4
4
|
* Directly map object values
|
|
@@ -15,6 +15,14 @@ function mapValues(object, mapFunction) {
|
|
|
15
15
|
}), {});
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
+
// When we use the `useSharedPluginState` example: `useSharedPluginState(api, ['width'])`
|
|
19
|
+
// it will re-render every time the component re-renders as the array "['width']" is seen as an update.
|
|
20
|
+
// This hook is used to prevent re-renders due to this.
|
|
21
|
+
function useStaticPlugins(plugins) {
|
|
22
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
23
|
+
return useMemo(() => plugins, []);
|
|
24
|
+
}
|
|
25
|
+
|
|
18
26
|
/**
|
|
19
27
|
*
|
|
20
28
|
* Used to return the current plugin state of
|
|
@@ -48,31 +56,38 @@ function mapValues(object, mapFunction) {
|
|
|
48
56
|
* the values are the shared state exposed by that plugin.
|
|
49
57
|
*/
|
|
50
58
|
export function useSharedPluginState(injectionApi, plugins) {
|
|
59
|
+
const pluginNames = useStaticPlugins(plugins);
|
|
60
|
+
|
|
51
61
|
// Create a memoized object containing the named plugins
|
|
52
|
-
const namedExternalPlugins = useMemo(() =>
|
|
62
|
+
const namedExternalPlugins = useMemo(() => pluginNames.reduce((acc, pluginName) => ({
|
|
53
63
|
...acc,
|
|
54
64
|
[`${pluginName}State`]: injectionApi === null || injectionApi === void 0 ? void 0 : injectionApi.dependencies[pluginName]
|
|
55
|
-
}), {}), [injectionApi === null || injectionApi === void 0 ? void 0 : injectionApi.dependencies,
|
|
65
|
+
}), {}), [injectionApi === null || injectionApi === void 0 ? void 0 : injectionApi.dependencies, pluginNames]);
|
|
56
66
|
return useSharedPluginStateInternal(namedExternalPlugins);
|
|
57
67
|
}
|
|
58
68
|
function useSharedPluginStateInternal(externalPlugins) {
|
|
59
|
-
const [
|
|
60
|
-
|
|
61
|
-
const
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
69
|
+
const [pluginStates, setPluginState] = useState(mapValues(externalPlugins, value => value === null || value === void 0 ? void 0 : value.sharedState.currentState()));
|
|
70
|
+
useLayoutEffect(() => {
|
|
71
|
+
const unsubs = Object.entries(externalPlugins).map(([pluginKey, externalPlugin]) => {
|
|
72
|
+
return externalPlugin === null || externalPlugin === void 0 ? void 0 : externalPlugin.sharedState.onChange(({
|
|
73
|
+
nextSharedState,
|
|
74
|
+
prevSharedState
|
|
75
|
+
}) => {
|
|
76
|
+
if (prevSharedState === nextSharedState) {
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
setPluginState(currentPluginStates => ({
|
|
80
|
+
...currentPluginStates,
|
|
81
|
+
[pluginKey]: nextSharedState
|
|
82
|
+
}));
|
|
83
|
+
});
|
|
84
|
+
});
|
|
73
85
|
return () => {
|
|
74
|
-
|
|
86
|
+
unsubs.forEach(cb => cb === null || cb === void 0 ? void 0 : cb());
|
|
75
87
|
};
|
|
88
|
+
// Do not re-render due to state changes, we only need to check this when
|
|
89
|
+
// setting up the initial subscription.
|
|
90
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
76
91
|
}, [externalPlugins]);
|
|
77
|
-
return
|
|
92
|
+
return pluginStates;
|
|
78
93
|
}
|
|
@@ -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 = "74.
|
|
3
|
+
const packageVersion = "74.5.1";
|
|
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
|
|
@@ -59,6 +59,8 @@ export const logException = async (error, tags) => {
|
|
|
59
59
|
'confluence-frontend-version': window.__buildInfo.FRONTEND_VERSION,
|
|
60
60
|
...tags
|
|
61
61
|
});
|
|
62
|
+
// Explicitly remove the breadcrumbs as it's too likely to log UGC/PII to side-step the hub integrations not being respected
|
|
63
|
+
scope.clearBreadcrumbs();
|
|
62
64
|
hub.captureException(error);
|
|
63
65
|
});
|
|
64
66
|
return client.close();
|
|
@@ -8,7 +8,7 @@ import { themed } from '@atlaskit/theme/components';
|
|
|
8
8
|
import { borderRadius } from '@atlaskit/theme/constants';
|
|
9
9
|
import Layer from '../Layer';
|
|
10
10
|
const packageName = "@atlaskit/editor-common";
|
|
11
|
-
const packageVersion = "74.
|
|
11
|
+
const packageVersion = "74.5.1";
|
|
12
12
|
const halfFocusRing = 1;
|
|
13
13
|
const dropOffset = '0, 8';
|
|
14
14
|
class DropList extends Component {
|
package/dist/es2019/version.json
CHANGED
|
@@ -2,7 +2,7 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
2
2
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
3
|
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; }
|
|
4
4
|
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; }
|
|
5
|
-
import {
|
|
5
|
+
import { useLayoutEffect, useMemo, useState } from 'react';
|
|
6
6
|
/**
|
|
7
7
|
*
|
|
8
8
|
* Directly map object values
|
|
@@ -21,6 +21,16 @@ function mapValues(object, mapFunction) {
|
|
|
21
21
|
}, {});
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
+
// When we use the `useSharedPluginState` example: `useSharedPluginState(api, ['width'])`
|
|
25
|
+
// it will re-render every time the component re-renders as the array "['width']" is seen as an update.
|
|
26
|
+
// This hook is used to prevent re-renders due to this.
|
|
27
|
+
function useStaticPlugins(plugins) {
|
|
28
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
29
|
+
return useMemo(function () {
|
|
30
|
+
return plugins;
|
|
31
|
+
}, []);
|
|
32
|
+
}
|
|
33
|
+
|
|
24
34
|
/**
|
|
25
35
|
*
|
|
26
36
|
* Used to return the current plugin state of
|
|
@@ -54,12 +64,14 @@ function mapValues(object, mapFunction) {
|
|
|
54
64
|
* the values are the shared state exposed by that plugin.
|
|
55
65
|
*/
|
|
56
66
|
export function useSharedPluginState(injectionApi, plugins) {
|
|
67
|
+
var pluginNames = useStaticPlugins(plugins);
|
|
68
|
+
|
|
57
69
|
// Create a memoized object containing the named plugins
|
|
58
70
|
var namedExternalPlugins = useMemo(function () {
|
|
59
|
-
return
|
|
71
|
+
return pluginNames.reduce(function (acc, pluginName) {
|
|
60
72
|
return _objectSpread(_objectSpread({}, acc), {}, _defineProperty({}, "".concat(pluginName, "State"), injectionApi === null || injectionApi === void 0 ? void 0 : injectionApi.dependencies[pluginName]));
|
|
61
73
|
}, {});
|
|
62
|
-
}, [injectionApi === null || injectionApi === void 0 ? void 0 : injectionApi.dependencies,
|
|
74
|
+
}, [injectionApi === null || injectionApi === void 0 ? void 0 : injectionApi.dependencies, pluginNames]);
|
|
63
75
|
return useSharedPluginStateInternal(namedExternalPlugins);
|
|
64
76
|
}
|
|
65
77
|
function useSharedPluginStateInternal(externalPlugins) {
|
|
@@ -67,10 +79,10 @@ function useSharedPluginStateInternal(externalPlugins) {
|
|
|
67
79
|
return value === null || value === void 0 ? void 0 : value.sharedState.currentState();
|
|
68
80
|
})),
|
|
69
81
|
_useState2 = _slicedToArray(_useState, 2),
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
var
|
|
82
|
+
pluginStates = _useState2[0],
|
|
83
|
+
setPluginState = _useState2[1];
|
|
84
|
+
useLayoutEffect(function () {
|
|
85
|
+
var unsubs = Object.entries(externalPlugins).map(function (_ref3) {
|
|
74
86
|
var _ref4 = _slicedToArray(_ref3, 2),
|
|
75
87
|
pluginKey = _ref4[0],
|
|
76
88
|
externalPlugin = _ref4[1];
|
|
@@ -80,16 +92,19 @@ function useSharedPluginStateInternal(externalPlugins) {
|
|
|
80
92
|
if (prevSharedState === nextSharedState) {
|
|
81
93
|
return;
|
|
82
94
|
}
|
|
83
|
-
|
|
84
|
-
return _objectSpread(_objectSpread({},
|
|
95
|
+
setPluginState(function (currentPluginStates) {
|
|
96
|
+
return _objectSpread(_objectSpread({}, currentPluginStates), {}, _defineProperty({}, pluginKey, nextSharedState));
|
|
85
97
|
});
|
|
86
98
|
});
|
|
87
99
|
});
|
|
88
100
|
return function () {
|
|
89
|
-
|
|
101
|
+
unsubs.forEach(function (cb) {
|
|
90
102
|
return cb === null || cb === void 0 ? void 0 : cb();
|
|
91
103
|
});
|
|
92
104
|
};
|
|
105
|
+
// Do not re-render due to state changes, we only need to check this when
|
|
106
|
+
// setting up the initial subscription.
|
|
107
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
93
108
|
}, [externalPlugins]);
|
|
94
|
-
return
|
|
109
|
+
return pluginStates;
|
|
95
110
|
}
|
|
@@ -6,7 +6,7 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
6
6
|
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; }
|
|
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 = "74.
|
|
9
|
+
var packageVersion = "74.5.1";
|
|
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
|
|
@@ -73,6 +73,8 @@ export var logException = /*#__PURE__*/function () {
|
|
|
73
73
|
// Confluence environment variables
|
|
74
74
|
'confluence-frontend-version': window.__buildInfo.FRONTEND_VERSION
|
|
75
75
|
}, tags));
|
|
76
|
+
// Explicitly remove the breadcrumbs as it's too likely to log UGC/PII to side-step the hub integrations not being respected
|
|
77
|
+
scope.clearBreadcrumbs();
|
|
76
78
|
hub.captureException(error);
|
|
77
79
|
});
|
|
78
80
|
return _context.abrupt("return", client.close());
|
|
@@ -18,7 +18,7 @@ import { themed } from '@atlaskit/theme/components';
|
|
|
18
18
|
import { borderRadius } from '@atlaskit/theme/constants';
|
|
19
19
|
import Layer from '../Layer';
|
|
20
20
|
var packageName = "@atlaskit/editor-common";
|
|
21
|
-
var packageVersion = "74.
|
|
21
|
+
var packageVersion = "74.5.1";
|
|
22
22
|
var halfFocusRing = 1;
|
|
23
23
|
var dropOffset = '0, 8';
|
|
24
24
|
var DropList = /*#__PURE__*/function (_Component) {
|
package/dist/esm/version.json
CHANGED
|
@@ -6,7 +6,7 @@ import type { MarkConfig, NodeConfig } from './prosemirror-config';
|
|
|
6
6
|
import type { QuickInsertHandler } from './quick-insert';
|
|
7
7
|
import type { ToolbarUIComponentFactory } from './toolbar';
|
|
8
8
|
import type { TypeAheadHandler } from './type-ahead';
|
|
9
|
-
import type { UIComponentFactory } from './ui-components';
|
|
9
|
+
import type { ReactHookFactory, UIComponentFactory } from './ui-components';
|
|
10
10
|
export type PluginsOptions = {
|
|
11
11
|
[pluginName: string]: any;
|
|
12
12
|
/**
|
|
@@ -60,6 +60,15 @@ export interface EditorPlugin {
|
|
|
60
60
|
* Although it’s common to specify a custom mount point (eg. date picker)
|
|
61
61
|
*/
|
|
62
62
|
contentComponent?: UIComponentFactory;
|
|
63
|
+
/**
|
|
64
|
+
* Optional react hook that is mounted for all appearances
|
|
65
|
+
*
|
|
66
|
+
* This can be used to access React context, or other React specific code (ie. run `useEffect`)
|
|
67
|
+
* within a plugin that will run for all appearances without mounting any components.
|
|
68
|
+
*
|
|
69
|
+
* Example usages include analytics or width.
|
|
70
|
+
*/
|
|
71
|
+
usePluginHook?: ReactHookFactory;
|
|
63
72
|
/**
|
|
64
73
|
* Optional UI-component that will be added to the toolbar at the top of the editor (doesn't exist in the compact-editor).
|
|
65
74
|
*
|
|
@@ -23,7 +23,7 @@ export type { ContextPanelHandler } from './context-panel';
|
|
|
23
23
|
export type { EditorAppearance } from './editor-appearance';
|
|
24
24
|
export type { ToolbarUiComponentFactoryParams, ToolbarUIComponentFactory, } from './toolbar';
|
|
25
25
|
export { ToolbarSize, ToolbarWidths, ToolbarWidthsFullPage } from './toolbar';
|
|
26
|
-
export type { UiComponentFactoryParams, UIComponentFactory, } from './ui-components';
|
|
26
|
+
export type { UiComponentFactoryParams, UIComponentFactory, ReactHookFactory, } from './ui-components';
|
|
27
27
|
export type { EditorReactContext } from './editor-react-context';
|
|
28
28
|
export type { PMPluginFactoryParams, PMPluginFactory, PMPlugin, } from './plugin-factory';
|
|
29
29
|
export type { NodeConfig, MarkConfig, NodeViewConfig, } from './prosemirror-config';
|
|
@@ -20,3 +20,4 @@ export type UiComponentFactoryParams = {
|
|
|
20
20
|
wrapperElement: HTMLElement | null;
|
|
21
21
|
};
|
|
22
22
|
export type UIComponentFactory = (params: UiComponentFactoryParams) => React.ReactElement<any> | null;
|
|
23
|
+
export type ReactHookFactory = (params: Pick<UiComponentFactoryParams, 'editorView' | 'containerElement'>) => void;
|
|
@@ -6,7 +6,7 @@ import type { MarkConfig, NodeConfig } from './prosemirror-config';
|
|
|
6
6
|
import type { QuickInsertHandler } from './quick-insert';
|
|
7
7
|
import type { ToolbarUIComponentFactory } from './toolbar';
|
|
8
8
|
import type { TypeAheadHandler } from './type-ahead';
|
|
9
|
-
import type { UIComponentFactory } from './ui-components';
|
|
9
|
+
import type { ReactHookFactory, UIComponentFactory } from './ui-components';
|
|
10
10
|
export type PluginsOptions = {
|
|
11
11
|
[pluginName: string]: any;
|
|
12
12
|
/**
|
|
@@ -60,6 +60,15 @@ export interface EditorPlugin {
|
|
|
60
60
|
* Although it’s common to specify a custom mount point (eg. date picker)
|
|
61
61
|
*/
|
|
62
62
|
contentComponent?: UIComponentFactory;
|
|
63
|
+
/**
|
|
64
|
+
* Optional react hook that is mounted for all appearances
|
|
65
|
+
*
|
|
66
|
+
* This can be used to access React context, or other React specific code (ie. run `useEffect`)
|
|
67
|
+
* within a plugin that will run for all appearances without mounting any components.
|
|
68
|
+
*
|
|
69
|
+
* Example usages include analytics or width.
|
|
70
|
+
*/
|
|
71
|
+
usePluginHook?: ReactHookFactory;
|
|
63
72
|
/**
|
|
64
73
|
* Optional UI-component that will be added to the toolbar at the top of the editor (doesn't exist in the compact-editor).
|
|
65
74
|
*
|
|
@@ -23,7 +23,7 @@ export type { ContextPanelHandler } from './context-panel';
|
|
|
23
23
|
export type { EditorAppearance } from './editor-appearance';
|
|
24
24
|
export type { ToolbarUiComponentFactoryParams, ToolbarUIComponentFactory, } from './toolbar';
|
|
25
25
|
export { ToolbarSize, ToolbarWidths, ToolbarWidthsFullPage } from './toolbar';
|
|
26
|
-
export type { UiComponentFactoryParams, UIComponentFactory, } from './ui-components';
|
|
26
|
+
export type { UiComponentFactoryParams, UIComponentFactory, ReactHookFactory, } from './ui-components';
|
|
27
27
|
export type { EditorReactContext } from './editor-react-context';
|
|
28
28
|
export type { PMPluginFactoryParams, PMPluginFactory, PMPlugin, } from './plugin-factory';
|
|
29
29
|
export type { NodeConfig, MarkConfig, NodeViewConfig, } from './prosemirror-config';
|
|
@@ -20,3 +20,4 @@ export type UiComponentFactoryParams = {
|
|
|
20
20
|
wrapperElement: HTMLElement | null;
|
|
21
21
|
};
|
|
22
22
|
export type UIComponentFactory = (params: UiComponentFactoryParams) => React.ReactElement<any> | null;
|
|
23
|
+
export type ReactHookFactory = (params: Pick<UiComponentFactoryParams, 'editorView' | 'containerElement'>) => void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-common",
|
|
3
|
-
"version": "74.
|
|
3
|
+
"version": "74.5.1",
|
|
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/"
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"atlassian": {
|
|
26
26
|
"team": "Editor",
|
|
27
27
|
"inPublicMirror": true,
|
|
28
|
-
"releaseModel": "
|
|
28
|
+
"releaseModel": "continuous"
|
|
29
29
|
},
|
|
30
30
|
"af:exports": {
|
|
31
31
|
"./event-dispatcher": "./src/event-dispatcher/index.ts",
|
|
@@ -79,7 +79,7 @@
|
|
|
79
79
|
"@atlaskit/button": "^16.7.0",
|
|
80
80
|
"@atlaskit/code": "^14.6.0",
|
|
81
81
|
"@atlaskit/codemod-utils": "^4.2.0",
|
|
82
|
-
"@atlaskit/collab-provider": "^9.
|
|
82
|
+
"@atlaskit/collab-provider": "^9.2.0",
|
|
83
83
|
"@atlaskit/editor-json-transformer": "^8.9.0",
|
|
84
84
|
"@atlaskit/editor-palette": "1.4.2",
|
|
85
85
|
"@atlaskit/editor-shared-styles": "^2.4.0",
|
|
@@ -143,7 +143,7 @@
|
|
|
143
143
|
"@atlaskit/editor-plugin-feature-flags": "^0.1.0",
|
|
144
144
|
"@atlaskit/editor-plugin-grid": "^0.1.0",
|
|
145
145
|
"@atlaskit/editor-plugin-table": "^1.5.0",
|
|
146
|
-
"@atlaskit/editor-plugin-width": "^0.0
|
|
146
|
+
"@atlaskit/editor-plugin-width": "^0.1.0",
|
|
147
147
|
"@atlaskit/editor-test-helpers": "^18.5.0",
|
|
148
148
|
"@atlaskit/media-core": "^34.1.0",
|
|
149
149
|
"@atlaskit/util-data-test": "^17.8.0",
|