@atlaskit/renderer 118.1.1 → 118.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +9 -0
- package/afm-post-office/tsconfig.json +3 -0
- package/dist/cjs/react/utils/EditorMediaClientProvider.js +8 -22
- package/dist/cjs/ui/Renderer/index.js +1 -1
- package/dist/es2019/react/utils/EditorMediaClientProvider.js +10 -24
- package/dist/es2019/ui/Renderer/index.js +1 -1
- package/dist/esm/react/utils/EditorMediaClientProvider.js +10 -24
- package/dist/esm/ui/Renderer/index.js +1 -1
- package/package.json +1 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @atlaskit/renderer
|
|
2
2
|
|
|
3
|
+
## 118.1.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#155231](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/155231)
|
|
8
|
+
[`6fe1356da03dd`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/6fe1356da03dd) -
|
|
9
|
+
Cleanup FG platform_editor_speedup_media_client
|
|
10
|
+
- Updated dependencies
|
|
11
|
+
|
|
3
12
|
## 118.1.1
|
|
4
13
|
|
|
5
14
|
### Patch Changes
|
|
@@ -10,7 +10,6 @@ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/sli
|
|
|
10
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
11
|
var _mediaClientReact = require("@atlaskit/media-client-react");
|
|
12
12
|
var _providerFactory = require("@atlaskit/editor-common/provider-factory");
|
|
13
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
14
13
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
15
14
|
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 && {}.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; }
|
|
16
15
|
var EditorMediaClientProvider = exports.EditorMediaClientProvider = function EditorMediaClientProvider(_ref) {
|
|
@@ -20,14 +19,13 @@ var EditorMediaClientProvider = exports.EditorMediaClientProvider = function Edi
|
|
|
20
19
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
21
20
|
mediaClientConfig = _useState2[0],
|
|
22
21
|
setMediaClientConfig = _useState2[1];
|
|
23
|
-
var oldMediaProvider = (0, _providerFactory.useProvider)('mediaProvider');
|
|
24
22
|
var mediaProvider = (0, _providerFactory.useProviderLayout)('mediaProvider');
|
|
25
23
|
|
|
26
24
|
/**
|
|
27
25
|
* If a mediaClientConfig is provided then we will force
|
|
28
26
|
* skip the mediaClient from context
|
|
29
27
|
*/
|
|
30
|
-
var shouldSkipContext = Boolean((ssr === null || ssr === void 0 ? void 0 : ssr.config) ||
|
|
28
|
+
var shouldSkipContext = Boolean((ssr === null || ssr === void 0 ? void 0 : ssr.config) || mediaProvider);
|
|
31
29
|
var contextMediaClient = (0, _react.useContext)(_mediaClientReact.MediaClientContext);
|
|
32
30
|
|
|
33
31
|
// MediaClientProvider currently requires a mediaClientConfig
|
|
@@ -41,26 +39,14 @@ var EditorMediaClientProvider = exports.EditorMediaClientProvider = function Edi
|
|
|
41
39
|
// by not providing both SSR config and mediaProvider,
|
|
42
40
|
// and provide a top level mediaClient context
|
|
43
41
|
// This is useful for testing and creating examples.
|
|
44
|
-
|
|
45
|
-
if (!(0, _platformFeatureFlags.fg)('platform_editor_speedup_media_client')) {
|
|
46
|
-
if (ssr !== null && ssr !== void 0 && ssr.config) {
|
|
47
|
-
setMediaClientConfig(ssr.config);
|
|
48
|
-
} else if (oldMediaProvider) {
|
|
49
|
-
oldMediaProvider.then(function (provider) {
|
|
50
|
-
setMediaClientConfig(provider.viewMediaClientConfig);
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
}, [oldMediaProvider, ssr]);
|
|
42
|
+
|
|
55
43
|
(0, _react.useLayoutEffect)(function () {
|
|
56
|
-
if (
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
});
|
|
63
|
-
}
|
|
44
|
+
if (ssr !== null && ssr !== void 0 && ssr.config) {
|
|
45
|
+
setMediaClientConfig(ssr.config);
|
|
46
|
+
} else if (mediaProvider) {
|
|
47
|
+
mediaProvider.then(function (provider) {
|
|
48
|
+
setMediaClientConfig(provider.viewMediaClientConfig);
|
|
49
|
+
});
|
|
64
50
|
}
|
|
65
51
|
}, [mediaProvider, ssr]);
|
|
66
52
|
return /*#__PURE__*/_react.default.createElement(_mediaClientReact.MediaClientContext.Provider, {
|
|
@@ -63,7 +63,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
63
63
|
var NORMAL_SEVERITY_THRESHOLD = exports.NORMAL_SEVERITY_THRESHOLD = 2000;
|
|
64
64
|
var DEGRADED_SEVERITY_THRESHOLD = exports.DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
65
65
|
var packageName = "@atlaskit/renderer";
|
|
66
|
-
var packageVersion = "118.1.
|
|
66
|
+
var packageVersion = "118.1.2";
|
|
67
67
|
var setAsQueryContainerStyles = (0, _react2.css)({
|
|
68
68
|
containerName: 'ak-renderer-wrapper',
|
|
69
69
|
containerType: 'inline-size'
|
|
@@ -1,20 +1,18 @@
|
|
|
1
|
-
import React, { useContext,
|
|
1
|
+
import React, { useContext, useLayoutEffect, useMemo, useState } from 'react';
|
|
2
2
|
import { MediaClientContext, getMediaClient } from '@atlaskit/media-client-react';
|
|
3
|
-
import { useProviderLayout
|
|
4
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
3
|
+
import { useProviderLayout } from '@atlaskit/editor-common/provider-factory';
|
|
5
4
|
export const EditorMediaClientProvider = ({
|
|
6
5
|
children,
|
|
7
6
|
ssr
|
|
8
7
|
}) => {
|
|
9
8
|
const [mediaClientConfig, setMediaClientConfig] = useState();
|
|
10
|
-
const oldMediaProvider = useProvider('mediaProvider');
|
|
11
9
|
const mediaProvider = useProviderLayout('mediaProvider');
|
|
12
10
|
|
|
13
11
|
/**
|
|
14
12
|
* If a mediaClientConfig is provided then we will force
|
|
15
13
|
* skip the mediaClient from context
|
|
16
14
|
*/
|
|
17
|
-
const shouldSkipContext = Boolean((ssr === null || ssr === void 0 ? void 0 : ssr.config) ||
|
|
15
|
+
const shouldSkipContext = Boolean((ssr === null || ssr === void 0 ? void 0 : ssr.config) || mediaProvider);
|
|
18
16
|
const contextMediaClient = useContext(MediaClientContext);
|
|
19
17
|
|
|
20
18
|
// MediaClientProvider currently requires a mediaClientConfig
|
|
@@ -26,26 +24,14 @@ export const EditorMediaClientProvider = ({
|
|
|
26
24
|
// by not providing both SSR config and mediaProvider,
|
|
27
25
|
// and provide a top level mediaClient context
|
|
28
26
|
// This is useful for testing and creating examples.
|
|
29
|
-
|
|
30
|
-
if (!fg('platform_editor_speedup_media_client')) {
|
|
31
|
-
if (ssr !== null && ssr !== void 0 && ssr.config) {
|
|
32
|
-
setMediaClientConfig(ssr.config);
|
|
33
|
-
} else if (oldMediaProvider) {
|
|
34
|
-
oldMediaProvider.then(provider => {
|
|
35
|
-
setMediaClientConfig(provider.viewMediaClientConfig);
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
}, [oldMediaProvider, ssr]);
|
|
27
|
+
|
|
40
28
|
useLayoutEffect(() => {
|
|
41
|
-
if (
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
});
|
|
48
|
-
}
|
|
29
|
+
if (ssr !== null && ssr !== void 0 && ssr.config) {
|
|
30
|
+
setMediaClientConfig(ssr.config);
|
|
31
|
+
} else if (mediaProvider) {
|
|
32
|
+
mediaProvider.then(provider => {
|
|
33
|
+
setMediaClientConfig(provider.viewMediaClientConfig);
|
|
34
|
+
});
|
|
49
35
|
}
|
|
50
36
|
}, [mediaProvider, ssr]);
|
|
51
37
|
return /*#__PURE__*/React.createElement(MediaClientContext.Provider, {
|
|
@@ -48,7 +48,7 @@ import { PortalContext } from './PortalContext';
|
|
|
48
48
|
export const NORMAL_SEVERITY_THRESHOLD = 2000;
|
|
49
49
|
export const DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
50
50
|
const packageName = "@atlaskit/renderer";
|
|
51
|
-
const packageVersion = "118.1.
|
|
51
|
+
const packageVersion = "118.1.2";
|
|
52
52
|
const setAsQueryContainerStyles = css({
|
|
53
53
|
containerName: 'ak-renderer-wrapper',
|
|
54
54
|
containerType: 'inline-size'
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
-
import React, { useContext,
|
|
2
|
+
import React, { useContext, useLayoutEffect, useMemo, useState } from 'react';
|
|
3
3
|
import { MediaClientContext, getMediaClient } from '@atlaskit/media-client-react';
|
|
4
|
-
import { useProviderLayout
|
|
5
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
4
|
+
import { useProviderLayout } from '@atlaskit/editor-common/provider-factory';
|
|
6
5
|
export var EditorMediaClientProvider = function EditorMediaClientProvider(_ref) {
|
|
7
6
|
var children = _ref.children,
|
|
8
7
|
ssr = _ref.ssr;
|
|
@@ -10,14 +9,13 @@ export var EditorMediaClientProvider = function EditorMediaClientProvider(_ref)
|
|
|
10
9
|
_useState2 = _slicedToArray(_useState, 2),
|
|
11
10
|
mediaClientConfig = _useState2[0],
|
|
12
11
|
setMediaClientConfig = _useState2[1];
|
|
13
|
-
var oldMediaProvider = useProvider('mediaProvider');
|
|
14
12
|
var mediaProvider = useProviderLayout('mediaProvider');
|
|
15
13
|
|
|
16
14
|
/**
|
|
17
15
|
* If a mediaClientConfig is provided then we will force
|
|
18
16
|
* skip the mediaClient from context
|
|
19
17
|
*/
|
|
20
|
-
var shouldSkipContext = Boolean((ssr === null || ssr === void 0 ? void 0 : ssr.config) ||
|
|
18
|
+
var shouldSkipContext = Boolean((ssr === null || ssr === void 0 ? void 0 : ssr.config) || mediaProvider);
|
|
21
19
|
var contextMediaClient = useContext(MediaClientContext);
|
|
22
20
|
|
|
23
21
|
// MediaClientProvider currently requires a mediaClientConfig
|
|
@@ -31,26 +29,14 @@ export var EditorMediaClientProvider = function EditorMediaClientProvider(_ref)
|
|
|
31
29
|
// by not providing both SSR config and mediaProvider,
|
|
32
30
|
// and provide a top level mediaClient context
|
|
33
31
|
// This is useful for testing and creating examples.
|
|
34
|
-
|
|
35
|
-
if (!fg('platform_editor_speedup_media_client')) {
|
|
36
|
-
if (ssr !== null && ssr !== void 0 && ssr.config) {
|
|
37
|
-
setMediaClientConfig(ssr.config);
|
|
38
|
-
} else if (oldMediaProvider) {
|
|
39
|
-
oldMediaProvider.then(function (provider) {
|
|
40
|
-
setMediaClientConfig(provider.viewMediaClientConfig);
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
}, [oldMediaProvider, ssr]);
|
|
32
|
+
|
|
45
33
|
useLayoutEffect(function () {
|
|
46
|
-
if (
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
});
|
|
53
|
-
}
|
|
34
|
+
if (ssr !== null && ssr !== void 0 && ssr.config) {
|
|
35
|
+
setMediaClientConfig(ssr.config);
|
|
36
|
+
} else if (mediaProvider) {
|
|
37
|
+
mediaProvider.then(function (provider) {
|
|
38
|
+
setMediaClientConfig(provider.viewMediaClientConfig);
|
|
39
|
+
});
|
|
54
40
|
}
|
|
55
41
|
}, [mediaProvider, ssr]);
|
|
56
42
|
return /*#__PURE__*/React.createElement(MediaClientContext.Provider, {
|
|
@@ -53,7 +53,7 @@ import { PortalContext } from './PortalContext';
|
|
|
53
53
|
export var NORMAL_SEVERITY_THRESHOLD = 2000;
|
|
54
54
|
export var DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
55
55
|
var packageName = "@atlaskit/renderer";
|
|
56
|
-
var packageVersion = "118.1.
|
|
56
|
+
var packageVersion = "118.1.2";
|
|
57
57
|
var setAsQueryContainerStyles = css({
|
|
58
58
|
containerName: 'ak-renderer-wrapper',
|
|
59
59
|
containerType: 'inline-size'
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/renderer",
|
|
3
|
-
"version": "118.1.
|
|
3
|
+
"version": "118.1.2",
|
|
4
4
|
"description": "Renderer component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -138,9 +138,6 @@
|
|
|
138
138
|
"platform_renderer_annotations_create_debug_logging": {
|
|
139
139
|
"type": "boolean"
|
|
140
140
|
},
|
|
141
|
-
"platform_editor_speedup_media_client": {
|
|
142
|
-
"type": "boolean"
|
|
143
|
-
},
|
|
144
141
|
"platform_editor_annotation_position_comment_nodes": {
|
|
145
142
|
"type": "boolean"
|
|
146
143
|
},
|